フィルターのクリア

Saving of state just before nonconvergence of ode solvers

1 回表示 (過去 30 日間)
Salil Kulkarni
Salil Kulkarni 2023 年 10 月 27 日
編集済み: Torsten 2023 年 10 月 27 日
I am trying to solve a set of coupled stiff ode's using the ode45/ode15s solvers. The solver sometimes does not converge and exists with an error. Is it possible save the state variables up to the point the solver has successfully converged and then exit.
Thank you

採用された回答

Torsten
Torsten 2023 年 10 月 27 日
編集済み: Torsten 2023 年 10 月 27 日
The stepsize before the solver exists usually becomes small. So if you choose "tspan" in the call to the ode integrator as a 2-element vector, many solutions are collected in this region, and you can examine the curves with the plot command.
Another alternative is to choose many output times in advance so that you can be sure to capture a point in the critical region.
Or you can repeat the run up to a time slightly smaller than the time when the solver got into trouble.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by