Error on using ODE45 and cannot prompt output
古いコメントを表示
Hi, i encounter some problem on showing the outputs for ODE45. May i know on how to solve it? I will be grateful that the solutions that provided. Thanks!
Here is the error message:
Error in p2 (line 13)
[t,C_calc]=ode45(first,timespan,C0);
Here is the codes:
clear
close all
clc
k=1000000000;
r = 4.31*(10^-3);
kt=0.9;
D=1;
timespan=[0 30]';
C0=40000;
first=@(t,C) (C*(r-((r-kt*d)/k)*C-(kt*D)));
[t,C_calc]=ode45(first,timespan,C0);
plot(t,C_calc)
hold on
3 件のコメント
Ilya Gurin
2022 年 1 月 6 日
Please post the full error text
Deck Zhan Sim
2022 年 1 月 6 日
Ilya Gurin
2022 年 1 月 6 日
There's no way that can be the full text.
回答 (1 件)
I get a different error message, which is very clear:
k=1e9;
r = 4.31e-3;
kt=0.9;
D=1;
timespan=[0 30]';
C0=40000;
first=@(t,C) (C*(r-((r-kt*d)/k)*C-(kt*D)));
[t,C_calc]=ode45(first,timespan,C0);
plot(t,C_calc)
hold on
2 件のコメント
Ilya Gurin
2022 年 1 月 6 日
I got that, too, but the OP seems to have a different problem.
Jan
2022 年 1 月 6 日
As soonas I replace "d" by "D", the code runs and displays a diagram.
カテゴリ
ヘルプ センター および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!