Question: The reaction system A + B C ( d e s i r e d ) A + B D ( u n d e

The reaction system
A+BC(desired)
A+BD(undesired)
Can be represented by the system of differential equations
dCAdt=-k1ACACB-k2ACA0.5CB1.5
dCBdt=-k1ACACB-k2ACA0.5CB1.5
dCCdt=k1ACACB,
dCDdt=k2ACA0.5CB1.5
,k1=1.1107exp(-9200(T)),k2=4exp(-2000(T))
CA0=1,CB0=1,CC0=0,CD0=0,T=500K
On the same graph, plot the graph of yield (Y) and selectivity(S) of compound D with time
For the purposes of these calculations
Y=CCCA0
S=CCCD+e
e=10-20.% Define the time range
tr = linspace(0,100,50); %Time points from 0 to 100 with 50 intervals
% Initial concentrations
co =[1,1,0,0]; % Initial concentrations of Ca,Cb,Cc,Cd
%Solve the ODE's
[t,c]= ode45(@hughes,tr,co);
% Calculate Yield and Selectivity
Y = c(:,3)./co(1); % Yield of c relative to initial A
e =1e-20; %Small number to avoid division by zero
S= c(:,3)./(c(:,4)+e); %Selectivity of C over D
% Plot the results
plot(t,Y,t,S,"linewidth",2);
xlabel('Time T(s)');
ylabel('values');
legend("Yield (Y)","Selectivity (S)");
title("Yield and Selectivity vs Time");
grid on;
% Define the ODE function
function dcdt = hughes(t,c)
T=500;
k1=1.1*10^7*exp(-9200/T);
k2=4* exp(-2000/T);
% Extract the concentrations from c
ca=c(1); cb=c(2); cc=c(3); cd=c(4);
dcdt =[-k1*ca*cb -k2*ca^0.5*cb^1.5;
-k1*ca*cb -k2*ca^0.5*cb^1.5;
k1*ca*cb;
k2*ca^0.5*cb^1.5
];
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 Multiple_react_tut1>hughes (line 31)
dcdt =[-k1*ca*cb -k2*ca^0.5*cb^1.5;
Error in odearguments (line 90)
f0= feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45(line 115)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in Multiple_react_tut1(line 9)
[t,c]= ode45(@hughes,tr,co); when I run it. Please check the question and debug my code for me
 The reaction system A+BC(desired) A+BD(undesired) Can be represented by the system

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!