ode45 with events returns event that did not happen

1 回表示 (過去 30 日間)
sivan levi
sivan levi 2019 年 8 月 6 日
コメント済み: sivan levi 2019 年 8 月 7 日
Hello,
i am using ode 45 with events and am having a problem i do not understand.
the problem is that i have defined the event in an event function and when i track the events values i clearly see that one goes to zero and the others do not so i am expacting one event as an output but i am recieving two event.
the other event clearly is not zero.
the codes i am using
ode45 options:
op_slip=odeset('reltol',tol,'abstol',tol,'Events',@events_slip);
ode 45 call:
[Tsl,Xsl,Tesl,Xesl,Iesl]=ode45(@sys_slip,Tsim,X0,op_slip);
tracking the events graphically:
the blue plot (data1) is the event that heppend and the red one (data2) is the event that the functions says that happened even thpough its value isnt 0
the output Iesl is [2;1]
can anyone shed some light on this problem? i am at a loss
thank you
  1 件のコメント
sivan levi
sivan levi 2019 年 8 月 7 日
Found out what went wrong.
if an event occurs at t=0 the event function does not terminate
from documantation under limitations:
"If a terminal event occurs during the first step of the integration, then the solver registers the event as nonterminal and continues integrating."

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

回答 (0 件)

カテゴリ

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