Script to solve ODEs with two variables: cB and t. (solution included, just cannot write script)
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I have a problem: dcB/dt = k1*(1.5/(1 + 1.5*0.05*t))^2 - 0.022*cB
for t0 = 0 to tf = 30
I have been told ode15s, ode15i, but I cannot figure out how to write the script.
The answer for should be cB = 0.66
Thank you.
(I have symbolic math toolbox to make process simpler)
0 件のコメント
回答 (1 件)
Roshni Garnayak
2019 年 9 月 9 日
The following code can be used to solve the ODE:
t0 = 0;
tf = 30;
tspan = [t0 tf]; % Specifies the range of variable t
cB0 = 1; % Specify the initial value of cB
[t,cB] = ode15s(@(t,cB) (1.5/(1+1.5*0.05*t))^2-0.022*cB, tspan, cB0);
You can refer to the following link to get a detailed explanation of “ode15s” solver:
0 件のコメント
参考
カテゴリ
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!