solve a system of differential equations
1 view (last 30 days)
Show older comments
vahid army
on 28 Apr 2015
Commented: vahid army
on 28 Apr 2015
System is like this:
A'=-A*exp(k1/C)
B'=m1*A*exp(k1/C)+m2*B*exp(k2/C)
C'=m3*A*exp(k1/C)+m3*B*exp(k2/C)
Where A=A(t), B=B(t), C=C(t) and A'=dA/dt and 3 initial conditions exist.
m1 m2 m3 k1 k2 ...are constants
Please tell me how to solve it,I already tried dsolve but there is no explicit solution
A link to a tutorial would be useful too.
Thanks
And what this set of differential equations is called like ODE OR PDE?
2 Comments
Accepted Answer
Titus Edelhofer
on 28 Apr 2015
Hi Vahid,
did you already try to solve it numerically? It should be straightforward to solve using ode45. You function that you pass to ode45 should look something like
function dy = fun(t, x, m1, m2, k1, k2, C)
A = x(1);
B = x(2);
C = x(3);
dA = -A*exp(k1/C);
% etc
dy = [dA; dB; dC];
and then you call ode45 with
[t,y] = ode45(@(t,x) fun(t, x, m1, m2, k1, k2, C), ...)
Titus
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!