Use different initial conditions. For example 0.1 0.1 0.1 0.1 0.1 0.1
Help solving these ODEs
1 次查看(过去 30 天)
显示 更早的评论
These is what I have came up with so far, however it isnt working rite.
syms CA(z) CB(z) CC(z) CD(z) CE(z) CF(z)
eqn1 = diff(CA, z) == ((-0.1)*CA*CB*CC^2-(0.05)*CA*CD-(0.15)*CA*CF);
eqn2 = diff(CB, z) == ((-0.1)*CA*CB*CC^2+(0.3)*CA*CF);
eqn3 = diff(CC, z) == ((-2)*(-0.1)*CA*CB*CC^2);
eqn4 = diff(CD, z) == ((0.1)*CA*CB*CC^2-(0.05)*CA*CD);
eqn5 = diff(CE, z) == ((0.05)*CA*CD);
eqn6 = diff(CF, z) == ((0.05)*CA*CD-(0.15)*CA*CF);
[odes, vars] = odeToVectorField(eqn1, eqn2, eqn3, eqn4, eqn5, eqn6);
fun = matlabFunction(odes,'Vars',{'t','Y'});
x0 = [0 0 0 0 0 0];
tspan = [0 25];
[t, sol] = ode45(fun,tspan,x0);
CA = sol(:,2);
CB = sol(:,1);
CC = sol(:,3);
CD = sol(:,4);
CE = sol(:,5);
CF = sol(:,6);
plot(t,CA,t,CB,t,CC,t,CD,t,CE,t,CF)
legend('CA','CB','CC','CD','CE','CF','Location','southeast')
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!