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 CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by