DIfferential equation (ODE)
Afficher commentaires plus anciens
Hy everyone!
I would like to make mathematical modelling in MATLAB, but I can't get my head around it. So here it is the equation:
dc/dt = -r
-r = (kreac*Kads*(c))/(1+Kads*(c))
c(0)=125 micromol
Kads = 4.45*10^-2
kreac = 2.06*10^-2
t(0) = 0
t(f) = 120
How can I solve this in MATLAB?
2 commentaires
John D'Errico
le 24 Août 2017
Modifié(e) : John D'Errico
le 24 Août 2017
What have you tried? Have you tried dsolve? ode45? If nothing, then why not make an effort? This is a basic ODE problem. Take a shot at it. Read the help for those tools. Look at the examples. Show what you tried, and ask what you did wrong. You will get more help if you show a willingness to make an effort than if you just post a doit4me.
István Székely
le 26 Août 2017
Réponses (1)
Ennio Condoleo
le 26 Août 2017
Hey, I would like to propose you a hint. This is a classical problem to be solved by using ODE. Let's assume the following differential equation at first order:
dc/dt = (k1*k2*c)/(1+k2*c)
where k1 and k2 are real values. The initial condition c = c0 is assigned at t = t0. The final time of integration is t = tf.
A fast solution to this issue is:
odeOptions = odeset('RelTol',1e-6,'AbsTol',1e-8);
t0 = 0;
tf = 120;
c0 = 125;
k1 = 2.06e-2;
k2 = 4.45e-2;
[t,c] = ode45(@myfun,[t0,tf],c0,odeOptions,k1,k2);
plot(t,c);
where "myfun" is a function as:
function [c] = myfun(t,c,k1,k2)
c = (k1*k2*c)/(1+k2*c);
1 commentaire
István Székely
le 26 Août 2017
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!