About saving output at specific time steps with an ODE solver
Ältere Kommentare anzeigen
Hi there,
I am running matlab ODE function and saving the integrated solution in a file. Each file comes out to be around 1 GB. I do not need the solution (output) barring at a few times during the run. Is there a way to save only these times and the respective output instead of output at each time step? I have an idea of trying to save the output by using a for loop after every run e.g.
T_out=[0 10 20 30...] ; %...time vector of steps at which output needs to b saved
[T out] = ode15s(....); for i-1:length(T_out) if(T==T_out)
save out to file end....
But this takes a lot of time given that there are at times 100000 time steps in the solver output. Is there a faster way to do this ?
Thanks
Antworten (2)
TUSHAR ANDRIYAS
am 20 Dez. 2012
1 Stimme
Jan
am 19 Dez. 2012
How do you define the input TSPAN for the ODE45 command? Would this help already:
[T, out] = ode15s(@fcn, T_out, y0)
If not, please explain the problem again. Why do you call a FOR loop and how does it look exactly?
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!