필터 지우기
필터 지우기

solving nonlinear ode for a set period

조회 수: 3 (최근 30일)
Abraham Bloxham
Abraham Bloxham 2021년 2월 7일
답변: Star Strider 2021년 2월 8일
hi all,
I am solving a set of ODE (non-linear) here is first (this one is linear but i need to solve this concept before moving on).
f2 = @(t,X) [a*X(1)];
a is a number.
[t,y] = ode45(f2,[0 : t],[1]);
how can i set up the code so that the it stops at time t when a certain value in y has been reached. Then a new ODE comes into play.
thanks everyone - much appreciated.

채택된 답변

Star Strider
Star Strider 2021년 2월 8일
See the documentation section on ODE Event Location.

추가 답변 (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