How to enforce ode15s to solve a DAEs system with some state variables limited by a range?

2 ビュー (過去 30 日間)
I have a set of DAEs to be solved for state and algebraic variables in the form of vectors. Two vectors of the state variables (say V1 and V2) must be greater than zero; that is each element in V1 and V2 must return positive value. I want to tell ode15s to solve the problem considering this constraint. I tried V1(V1<0)=0; V2(V2<0)=0; but did not work. The way I know it did not work is when I plot V1 and V2 after solving the problem using ode15s, the are negative parts in the plots.
Any idea?
Thanks

採用された回答

Torsten
Torsten 2019 年 7 月 8 日
編集済み: Torsten 2019 年 7 月 8 日
The solution of your problem is uniquely determined by the equations you impose - you can't impose any further conditions on the state variables.
If you are sure the equations will give a non-negative solution, you can use smaller tolerances for RelTol and AbsTol and/or use the NonNegative option of the ODE integrators.
  1 件のコメント
Ismaeel
Ismaeel 2019 年 7 月 8 日
編集済み: Ismaeel 2019 年 7 月 8 日
Thank you Torsen. I read about "NonNegative " option; unforetunately, it cannot be used for ode15s, ode23s, ode23t, ode23tb which should I use for my stiff DAEs.
Source:
Please see the plot attached:
untitled.jpg

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

その他の回答 (0 件)

カテゴリ

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