How do I save a large ODE solution array to disk as I solve the ode system (ODE15s)
Show older comments
When I try and solve a system of ODEs, I get an out of memory error. Is it possible to store previous solutions that are on my workspace on the hard drive(for instance, t, and y1) and only have the previous couple time step solutions in the ram for additional calculations?
For instance, if I am solving a problem from t=[1:100], could matlab save the solution every ten second to the hard drive, and clear the ram and use the previous solution to continue solving for the next time steps. On another forum, Someone said OutputFcn can do this but I don't know how to make it save data to the hard drive and then clear the ram for future calculations.
The out of memory error is because the solution timespan is very long and I have to use a very small step size, which I specify by using 'MaxStep'. The Maxstep is equal to the time constant of my system which is around 1e-6, but I need to run the simulation for 1e5. I cannot reduce the total time or increase the maxstep size.
Thanks in advance for your help!
Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!