Accessing the value in each successful time step in ode45 solver

조회 수: 2 (최근 30일)
Santhosh
Santhosh 2013년 5월 7일
I am trying to solve a second order ode with ode45 solver. I would like to get the value of the state variable in each successful time step.(by successful I mean the solver is based on an adaptive time step). Is there a way to get the value of the state variable in each successful time step while the solver is running and pass it to another function for a conditional check? Is it possible to save the values of the state variable in each successful time step and make it available to the workspace for further manipulation?

답변 (2개)

Mahmudul Hasan
Mahmudul Hasan 2013년 9월 25일
I may suggest you to go with event function of ode45.

Jan
Jan 2013년 9월 25일
편집: Jan 2013년 9월 25일
The output of the ODE integrators contain the value of the state variable in each time step already. So why do you want something else?
You can define an output functions also, see: doc odeset.
Passing a variable for a "conditional check" is not clear. What kind of reaction to this check are you thinking of? Where should this check be considered?

카테고리

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