Script to solve ODEs with two variables: cB and t. (solution included, just cannot write script)

1 回表示 (過去 30 日間)
John Gow
John Gow 2019 年 9 月 6 日
回答済み: Roshni Garnayak 2019 年 9 月 9 日
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)

回答 (1 件)

Roshni Garnayak
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:

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by