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

조회 수: 7 (최근 30일)
Hossein
Hossein 2015년 6월 29일
댓글: Steven Lord 2015년 6월 29일
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
Steven Lord
Steven Lord 2015년 6월 29일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2015년 6월 29일
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

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by