ODE Event Location detecting events other than zero

조회 수: 6 (최근 30일)
Hariharan MK
Hariharan MK 2021년 1월 14일
댓글: Hariharan MK 2021년 1월 14일

"Use event functions to detect when certain events occur during the solution of an ODE. Event functions take an expression that you specify, and detect an event when that expression is equal to zero. They can also signal the ODE solver to halt integration when they detect an event."

This section is taken from the "ODE Event location" documentation. My question is, whether there is a event function that is able to halt the integration when the expression is equal to a certain value(i.e not zero; <0 or >0)
Does such a function exist?
Thank you in advance!

채택된 답변

Mischa Kim
Mischa Kim 2021년 1월 14일
Hi Hariharan,
yes it is. You simply define a function that is equal to zero whenever your expression equals a certain value. For example, say you want to track x = 5. In the events function you then use, e.g. y = x - 5. So whenever a zero is detected (y = 0), by definition you know that x = 5.
  댓글 수: 3
Mischa Kim
Mischa Kim 2021년 1월 14일
Yes, this is possible. There is a good example in our documentation here.
Hariharan MK
Hariharan MK 2021년 1월 14일
Thank you for your help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by