ODE with variable time vector

2 次查看(过去 30 天)
Simon
Simon 2015-10-7
Hello, t is my time vector which is defined as
t = tstart:dt:tend;
The ODE is solved this way:
ode15s(@ode, t, ...)
At a known time, the gradient dxdt gets in a very short time to a very high value.
To solve this, dt must be very small. The rest of ODE could be solved with a dt which is several times higher.
Can I give a time vector with a variable scale? Or have I to define three seperate ode solver with the required time vector?

回答(1 个)

Star Strider
Star Strider 2015-10-7
Your time vector can be whatever you want it to be (providing it has at least three elements), but those will be the times the ODE solver outputs the results of the integration. The solver will evaluate your ODE with adaptive time intervals just as it normally would.
If you have discontinuities in your ODE function, you can usually see them by plotting the ODE function first, and defining your time vector to avoid them.

类别

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