Problem with NonNegative option of ODE45

4 ビュー (過去 30 日間)
Luca Vergani
Luca Vergani 2022 年 9 月 15 日
コメント済み: James Tursa 2022 年 9 月 15 日
Hi everyone!
I'm tryng to solve an implicit system of ordinary differential equation of the type:
where are some parameters. The problem is that if the resulting y is the ode solution ends up to be complex. In order to avoid this I''ve tried to add the option NonNegative to the ode solver. I've a sistem of 5 differential equation so i've written:
options = odeset('NonNegative',[1:5]);
But it does not work because I still find complex solution. Wat's wrong?
Thanks in advance!
  3 件のコメント
Torsten
Torsten 2022 年 9 月 15 日
編集済み: Torsten 2022 年 9 月 15 日
Maybe your differential equations are such that the solution variables become negative.
E.g. The differential equation dy/dt = -1 with y(0) = 1 has solution y(t) = -t+1 and it will become negative if t>1. The NonNegative option won't prevent this from happening.
The NonNegative option only might help if the variables become negative because of inaccuracies of integration.
James Tursa
James Tursa 2022 年 9 月 15 日
Please show the actual equations.

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

回答 (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