function xdot = cstr11(t,x)global uglobal qif% Input (1)
% Coolant Flow rate
Qc = u;% States (2)
% Concentration of A in the reactor (mol/L)
T = x(1,1)% Temperature of reactor fluid (deg K)
CA = x(2,1)% Process Parameters
% Product flow rate lit/min
qif = 100;% Input product concentration mol/lit
cif = 1;% Input temperature K
tif=350;% Coolant Temperature K
tcf=350;% Container volume lit
v=100;% Activation energy term K
EoverR=10^4;% Reaction rate constant 1/min
k0=7.2*10^10;% % % Plant constant
k1=1.44e13; %K lit/min/mol
k2=0.01; %1/lit
k3=700;%lit/min
% Plant constant (Manimozhi)
% % k1=1.44*10^13; %K lit/min/mol
% % k2=1; %1/lit
% % k3=700;%lit/min
% State equations
%Tdot
xdot(1,1)=qif*(tif-T)/v + k1*CA*(exp(-EoverR/T)) + k2*Qc*(1-(exp(-k3/Qc)))*(tcf-T);%Cdot
xdot(2,1)=qif*(cif-CA)/v - k0*CA*(exp(-EoverR/T));
Command Window error message for cstr11(0,[20;100]) is Error using / Matrix dimensions must agree.
Error in cstr11 (line 45) xdot(1,1)=qif*(tif-T)/v + k1*CA*(exp(-EoverR/T)) + k2*Qc*(1-(exp(-k3/Qc)))*(tcf-T);
Please let me know where I am doing wrong? Awaiting your response. Thank You.
Best Answer