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

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

 采纳的回答

Takafumi
Takafumi 2017-5-11

2 个投票

まずソルバーを替えます。 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

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 常微分方程式 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!