a well-known problem: Out of Memory during the ode process!
5 次查看(过去 30 天)
显示 更早的评论
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
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
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!