a well-known problem: Out of Memory during the ode process!

5 visualizaciones (últimos 30 días)
Hossein
Hossein el 29 de Jun. de 2015
Comentada: Steven Lord el 29 de Jun. de 2015
Hi everyone,
I'm trying to run a model using ode113 with 5252 state variables, the solver works pretty well in predefined time interval but at the end no result matrix can be generated. Until now I have tried to use @odeplot to plot just 2 of these 5252 variables which I need but I still facing the problem. I use a 64-bit Windows and MATLAB version running with 16 GB RAM. Any further suggestion?
  1 comentario
Steven Lord
Steven Lord el 29 de Jun. de 2015
What's your tspan vector look like? If it's a vector with more than 2 elements, the ODE solver will try to return a length(tspan)-by-5252 matrix of values of the solution of your system of ODEs. Since you implied ODE113 throws an OOM error when it is trying to return, I suspect you have an extremely long tspan vector and allocating the output is what's running out of memory.

Iniciar sesión para comentar.

Respuestas (1)

Jan
Jan el 29 de Jun. de 2015
If the solver works successfully, post the code, which causes the error. We cannot guess the reason without seeing the code.
Beside this, the general rules can be recommended - search in the forum for "out of memory":
  • Install more RAM
  • Check your code for typos: rand(1e6) does not create a vector
  • Use a 64 bit Matlab and OS
  • Clear variables, which are not used anymore
  • Close other programs
  • Install more RAM
  • Prefer a a struct of arrays instead of an array of structs
  • Re-use arrays
  • Install more RAM
  • Use the smallest possible data type, e.g. uint8 instead of double.
  • Install more RAM

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by