Why does my long simulation slow down over time?
古いコメントを表示
I am running long simulations involving a double for-loop with each approx. 20 intervals, and each internal process taking anywhere between an hour and a day. When initiating this simulation it will start off at a rapid pace, and will slow down at a rate which appears to be correlated to the decreasing availability of RAM on the computer. This, however, puzzles me as I have set it up so that nothing, apart from a handful of matrices, is stored in between the individual processes and all matrices are assigned before use so nothing grows without being pre-assigned.
Does anyone know of any tricks I can use? Is this just to be expected for long matlab runs in general? using tic/toc or profile only emphasizes that the whole thing slows down.
Thanks in advance
8 件のコメント
Star Strider
2012 年 10 月 31 日
Are you running any solvers in your loops (ode, optimization, etc.)?
Jakob Sievers
2012 年 10 月 31 日
Star Strider
2012 年 10 月 31 日
If you're taking matrix inverses (please do not use inv) or doing matrix division, how are you doing it? I suggest mldivide.
Jakob Sievers
2012 年 10 月 31 日
Walter Roberson
2012 年 10 月 31 日
Which MATLAB version are you using, and which operating system? 32 or 64 bit ?
Star Strider
2012 年 10 月 31 日
The only other thing I can suggest is that you clear the matrices you no longer need at the end of an iteration or alternatively assign them to the empty matrix ( [] ), and re-allocate them at the beginning of the next iteration.
Jakob Sievers
2012 年 10 月 31 日
Jakob Sievers
2012 年 10 月 31 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で App Building についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!