フィルターのクリア

how can I condition my ode solver

1 回表示 (過去 30 日間)
Noya Linder
Noya Linder 2023 年 6 月 15 日
編集済み: Torsten 2023 年 6 月 16 日
I use an ode solver here
[t, R] = ode78(@odefun, tspan, r0);
but I don't want it to run until the final t, I want it to run until R is at a certain value, and I have no idea how to go about doing that.

回答 (1 件)

Torsten
Torsten 2023 年 6 月 15 日
移動済み: Torsten 2023 年 6 月 15 日
Use the Event Facility of the ODE integrators:
  2 件のコメント
Noya Linder
Noya Linder 2023 年 6 月 16 日
And what happens if the "position" is not exactly zero? How can I specify tolerance to the value which will result in a termination?
Torsten
Torsten 2023 年 6 月 16 日
編集済み: Torsten 2023 年 6 月 16 日
ode78 checks where the expression (R - certain value) changes sign. This is the position where R reaches the specified value. There is no need to specify a tolerance.

サインインしてコメントする。

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by