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 Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by