Question: Hello! I need help figuring out how to fix my Matlab code. The enthalpies, CpA, and CpBs are incorrect. Thanks! Problem Statement: Acetaldehyde ( )

Hello! I need help figuring out how to fix my Matlab code. The enthalpies, CpA, and CpBs are incorrect. Thanks!
Problem Statement:
Acetaldehyde () is produced by the dehydrogenation of ethanol:
An undesired side reaction also occurs and produces ethyl acetate:
In a pilot plant reactor, 90% of the ethanol fed to the reactor is converted to products, and there is a 65% yield of acetaldehyde (based on the total amount of ethanol fed to the reactor).
Ethanol vapor enters the reactor at 300,5 bar, and 100 mol/hr.
We want to know how much heat to add or remove in order to keep the outlet temperature at 300. R1=[{:[-1,1,1,0]:}];
R2=[-2,0,2,1];
% DeltaHf defines a vector with heat of formation for each species (kJ/mol)
%[E AA H2 EA]
DeltaHf =[-234.95-173.40-444.5}]
% DeltaHr defines the heat of reaction (in kJ/mol)
DeltaHr =[sum(R1.*DeltaHf) sum(R2.*DeltaHf)];
% Vapor Phase Heat Capacity Constants [E AA H2 EA]
% Cp = A + BT + CT^2+ DT^3 with Cp in units of J/mol K.
CpB =[5.21e-21.76e-20.00935.32e-2];
% Hvap is a generalized function that calculates the the specific enthalpy
% of the vapor by integrating the heat capacity Cp between T1 and T2. The
% factor of 1000 at the end corrects the expression to units of kJ/mol.% Knowns E AA H2 EA
n1=[100,0,0,0]; % stream 1 flow rates (mol/h)
n2=[10659012.5]; % stream 2 flow rates (mol/h)
Tref =298; % reference temperature (K)
T1=573.15; % stream 1 temperature (K)
T2=573.15; % stream 2 temperature (K)
% Solve for unknown Q
Q0=4000;
F =@(q)-sum(E.*DeltaHr)+ sum(n1.*Hvap(T1, Tref))- sum(n2.*Hvap(T2,Tref))+ q;
options = optimset('Display','off');
Qdot = fsolve(F, Q0, options);
fprintf('
Cp = Cp(T): Qdot =%6.1f kJ
', Qdot) Check stoichiometric coefficients for reaction 1
Check stoichiometric coefficients for reaction 2
Check enthalpies of formation
Variable DeltaHf has an incorrect value.
Look at the table in Murphy Appendix B carefully!
Feedback is shown for the initial error only, as subsequent failures may be due to the first error
Show Feedback
Check Heat capacity values - CpA
Check Heat capacity values -CpB
Check Heat capacity values -CpC
Check Heat capacity values -CpD
Check input flow rates n1
Check input flow rates n 2
Check the extent of reaction variables E Check reference state temperature Tref
Check T2
Check your EB equation -F
 Hello! I need help figuring out how to fix my Matlab

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Chemical Engineering Questions!