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!