The following code doesn't seem to work - it keeps running with no result (RK4 method)
古いコメントを表示
There are 3 differential equations as defined in 'f' below separated by semi-colon. The time span is from 0 to 84 by 7.
f = @(t,x) [388-0.009*x(1)-0.0000000361*x(1)*x(3); 0.0000000361*x(1)*x(3) - 0.18*x(2); 50000*x(3) - 23*x(3)];
tspan = 0:7:84;
[t,xa] = ode45(f,tspan,[43100 0 0.0033]);
3 件のコメント
Walter Roberson
2015 年 12 月 5 日
Could you post the original equations?
Walter Roberson
2015 年 12 月 5 日
It appears that you need to add β = 0.361e-7 to match the f you posted.
採用された回答
その他の回答 (1 件)
John D'Errico
2015 年 12 月 5 日
編集済み: John D'Errico
2015 年 12 月 5 日
0 投票
This is surely what would be called a stiff problem. It will cause ODE45 (or any non-stiff solver like it) to run very poorly. The first clue to the problem being a stiff one is the fact that ODE45 DID work poorly. A better clue is the wide disparity of magnitudes of the coefficients in that ODE. That tends to create stiff systems.
So instead, try one of the stiff solvers. All of the stiff solvers have names that end in s, thus ode23s, ode15s.
カテゴリ
ヘルプ センター および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!