Error using odearguments due to vector incoherent
2 views (last 30 days)
Show older comments
Muhammad Luqman
on 22 May 2023
Commented: Muhammad Luqman
on 23 May 2023
I dont understand what i did wrong with my code, i asked AI and it didnt give me any enlighmentment. anybody please help me please :')
clc; clear;
x0=[1;1;1;1;1]
tspan=[0 21]
[x,l] = ode45(@f ,tspan,x0);
plot(l,x)
function dxdl=f(l,x)
d=2;
Ft=0.85;
T0=892;
Cp_Cl=8.6;
Cp_C3=25.3;
Cp_AlCl=28.0;
Cp_2ClC3=30.7;
Cp_HCl=7.2;
U=5;
H1=-48000;
H2=-79200;
T_LMTD=-20;
x1=x(1);
x2=x(2);
dT=x(3);
r1=x(4);
r2=x(5);
dx1dl = r1*pi*d^2/(4*Ft);
dx2dl = r2*pi*d^2/(4*Ft);
dr1dl = 824000*exp(-13700/(T0+dT))*(0.8-x1-x2)*(0.2-x1-x2)/((1-x2)^2);
dr2dl = 46.8*exp(-3460/(T0+dT))*(0.8-x1-x2)*(0.2-x1-x2)/((1-x2)^2);
dCpdT = Ft*((1-5*x1-5*x2)*Cp_Cl+(4-5*x1-5*x2)*Cp_C3+(5*x1)*Cp_AlCl+(5*x2)*Cp_2ClC3+(5*x1)*Cp_HCl);
dTdl = ((pi*d*U*T_LMTD)-(r1*H1+r2*H2)*pi*d^2/4)/dCpdT;
dxdl=@(l,x) [dx1dl;dx2dl;dr1dl;dr2dl;dTdl];
end
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!