DIfferential equation (ODE)
7 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
John D'Errico
2017 年 8 月 24 日
編集済み: John D'Errico
2017 年 8 月 24 日
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.
回答 (1 件)
Ennio Condoleo
2017 年 8 月 26 日
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);
参考
カテゴリ
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!