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

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

采纳的回答

Takafumi
Takafumi 2017-5-11
まずソルバーを替えます。 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 个)

类别

Help CenterFile Exchange 中查找有关 常微分方程式 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!