Question: The reaction system A + B C ( d e s i r e d ) A + B D ( u n d e
The reaction system
Can be represented by the system of differential equations
expexp
On the same graph, plot the graph of yield and selectivityS of compound with time
For the purposes of these calculations
Define the time range
tr linspace; Time points from to with intervals
Initial concentrations
co ; Initial concentrations of CaCbCcCd
Solve the ODE's
tc ode@hughes,trco;
Calculate Yield and Selectivity
Y c:co; Yield of c relative to initial A
e e; Small number to avoid division by zero
S c:c:e; Selectivity of C over D
Plot the results
plottYtS"linewidth",;
xlabelTime Ts;
ylabelvalues;
legendYield Y"Selectivity S;
titleYield and Selectivity vs Time";
grid on;
Define the ODE function
function dcdt hughestc
T;
kexpT;
k expT;
Extract the concentrations from c
cac; cbc; ccc; cdc;
dcdt kcacb kcacb;
kcacb kcacb;
kcacb;
kcacb
;
end. I wrote this code in matlab for the problem above but I get this errors Error using vertcat
Dimensions of arrays being concatenated are not consistent.
Error in Multiplereacttuthughes line
dcdt kcacb kcacb;
Error in odearguments line
f fevalodetyargs:; ODEI sets args to yp
Error in odeline
odeargumentsFcnHandlesUsed solvername, ode, tspan, y options, varargin;
Error in Multiplereacttutline
tc ode@hughes,trco; when I run it Please check the question and debug my code for me
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
