How to calculate ode45 of system of equations with particular initial conditions?

1 visualizzazione (ultimi 30 giorni)
Let's say that we have system of equations (I put some random values) such as:
for
I don't know how to type initial conditions different than these for t=0 in ode45. Is there an easy way to calculate ode45 with this or any similar system of equations?

Risposta accettata

Jan
Jan il 15 Mag 2021
Modificato: Jan il 15 Mag 2021
This looks trivial actually. Your initial values are:
y0 = [5, 12]
It is not required, that the initial time is 0. You can start at t=1 also without any limitations.
But if you do need the trajectory from t=0 to t=tEnd, start at t=1 with the known initial conditions and integrate backwards:
y0 = [5, 12];
[t, y] = ode45(@YourODE, [1, 0], y0);
Now t(end) = 0 and y(end, :) is the trajectory for t=0.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by