For what reason an ODE solver could run for ever?

조회 수: 1 (최근 30일)
Dimitrios
Dimitrios 2014년 11월 26일
댓글: Dimitrios 2014년 11월 26일
I am running a simulation with ODE4 and it seems that it will never end(3 hours now).I have already run it before with less time,like t=0:0.1:1000 and it took like 20 minutes to run.Now I doubled the time(t=0:0.1:2000) and i was expecting a running time of 40 minutes,propotional to my previous run.But not.What could cause it?
  댓글 수: 2
Andrew Reibold
Andrew Reibold 2014년 11월 26일
"My code takes longer when there are more equations to solve. [This makes sense] However, my code took longer than I expected it to. Why?"
Not nearly enough information to address this. We can only troubleshoot with what you provide us
Mike Hosea
Mike Hosea 2014년 11월 26일
Did you mean ODE45 or actually ODE4? I don't know what ODE4 looks like. If it is a fixed step method, I would say Mohammad is on the right track. If variable step, then there are several possibilities such as those mentioned by Star Strider I would probably suspect first.

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

채택된 답변

Mohammad Abouali
Mohammad Abouali 2014년 11월 26일
It could be various reason.
How do you store the variables? Once running the code for twice the time t_max=2000, are you storing them all? do you require more memory? If your memory footprint is changing by increasing total time, you shouldn't expect linear increase in computer time to solve the problem.
So, in short the answer to your question highly depends on how you coded your program.
Another thing that comes to my mind is that have you checked for stability? has your code destabilized and generated NaN?
You could check your memory consumption, pay special attention to cached memory being used. If it is spiking, between the two runs, it means that you do not have enough memory for longer runs. Try to change your code to reduce it's memory footprint with increasing simulation time.
But as I said, there could be other reason for this.
  댓글 수: 1
Dimitrios
Dimitrios 2014년 11월 26일
I didnt expect to be this,but actually it is spiking.Need a new laptop :/

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

추가 답변 (0개)

카테고리

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