Using loops for an initial condition change
Mostra commenti meno recenti
I am using ode45 to solve a set of differentials. At a particular point in the timespan the conditions need to be set to a fixed value, and the solver restarted to continue to solve.
For example, at time = 24 the y0 must change an be reinstated as the initial value with the ode45 solving from this point onwards.
t = [0 6 12 18 24 30 36 42 48];
y0 = [16; 0.5; 0; 2; 0; 0; 0; 0; 0.25];
[t, y] = ode45 (@solver, t ,y0);
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Programming in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!