ode45関数で実行​したら、警告が出て途​中で終了してしまいま​す。

以下のコマンドを実行したら、警告が出ます。 [t,y] = ode45(@odefcn,[0 10],[0; 10]);
警告: t=8.956588e+00 で失敗。 時間 t で最小の値で許可された (1.421085e-14) より小さいステップ サイズに減らさず に積分の許容誤差を満たすことができません。

 Accepted Answer

Takafumi
Takafumi on 11 May 2017

2 votes

まずソルバーを替えます。 ode45 から、ode15s に変更する(スティッフ ソルバーに)
>> [t,y] = ode15s(@odefcn,[0 10],[0; 10])
それで、解決しない場合は、ソルバーの許容誤差の設定を緩めることで、実行する事ができます。
>> opts = odeset('AbsTol',1e-4,'RelTol',1e-4);
>> [t,y] = ode45(@odefcn,[0 10],[0; 10],opts);
ちなみに、ソルバー選択はマニュアルに記載があります。
https://jp.mathworks.com/help/matlab/math/choose-an-ode-solver.html

More Answers (0)

Categories

Products

Tags

Asked:

on 11 May 2017

Answered:

on 11 May 2017

Community Treasure Hunt

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

Start Hunting!