Ode45: constraining values of variables evolution

3 ビュー (過去 30 日間)
Mohammad Farhat
Mohammad Farhat 2020 年 3 月 30 日
回答済み: Walter Roberson 2020 年 3 月 30 日
How can I constrain the values of the integrated variables in ode45.
I found "opts = odeset('NonNegative',1)" can constrain the first solution component to be positive, I need a similar option but to constrain the values within a certain range or nature (example: I need x to be real and 3<x<4 ).

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 3 月 30 日
See the ballode example for how to use Events to terminate ode integration and restart it with the new parameters.
The nonnegative option is only intended for system that might plausibly go negative due to rounding error or interpolation error; it is not intended to confine a system that would properly go negative to be non-negative.

カテゴリ

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

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by