How to see later-time behavior only of a system of ODEs in Matlab?

51 Views Asked by At

Let's say I coded up a model in Matlab, and the model is described by a set of ordinary differential equations that can be solved by the default ode45 solver. How can I see the model behavior for later time scales instead of starting at time $t = 0$?

I've tried the naïve thing: input time scale tspan = [20 50], but that apparently just means that the model runs at time $t = 0$, for 30 seconds.

1

There are 1 best solutions below

0
On BEST ANSWER

Runge-Kutta methods like Matlab's ode45 do not conserve energy. In other words, computing the long-time behavior is very challenging due to the accumulation of numerical errors over the duration of the simulation. In some particular cases, other approaches are more successful than direct numerical integration. If the long-time behavior $t\to \infty$ is periodic (e.g. constant), then injecting a truncated Fourier series Ansatz in the equations and solving the system of equations satisfied by the coefficients may work fine. This approach is known as the harmonic balance method.