solve system of diferential equations. how matlab can use 4) and 5) to solve the system?

1) d(na(t))/dt=-ko*exp(-ER/T(t))*na
2) d(nw(t))/dt=-ko*exp(-ER/T(t))*nw
3) d(nb(t))/dt=-ko*exp(-ER/T(t))*nb
4) d(h(t))/dt=15*10^3*(6*T(t)-360)
5) h(t)=nb(t)*T(t)*250-na(t)*T(t)*125-nw(t)*T(t)*75+95945*na(t)+242875*nw(t)-430450*nb(t)

 Accepted Answer

Solve 5) for T and insert the expression in 1) - 4).
Then use ODE15S to solve 1) - 4).
Best wishes
Torsten.

2 Comments

First thank you for your answer. My professor told us that matlab can solve it as it is. i searched for ode15s as you told me and i found this [http://www.mathworks.com/help/symbolic/set-up-your-dae-problem.html] but when i tried to convert it to my system, i got this error. Error using decic>sls (line 170) Index may be greater than one.
function main
x0 = [10 0 60 0 20];
M=[1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 0];
options=odeset('Mass',M);
[T Y]=ode15s(@F,[0 0.5],x0,options);
function dy=F(t,y)
na = y(1);
nb = y(2);
T = y(3);
h = y(4);
nw = y(5);
dy=zeros(5,1);
dy(1)=15*10^3*(6*T-360);
dy(2)=-(5*10^10)*exp(-9020/T*nw);
dy(3)=-(5*10^10)*exp(-9020/T*na);
dy(4)=-(5*10^10)*exp(-9020/T*nb);
dy(5)=h-((nb*T*250)-(na*T*125)-(nw*T*75)+(95945*na)+(242875*nw)-(430450*nb));
Best wishes
Torsten.

Sign in to comment.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!