For what reason an ODE solver could run for ever?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dimitrios
le 26 Nov 2014
Commenté : Dimitrios
le 26 Nov 2014
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 commentaires
Andrew Reibold
le 26 Nov 2014
"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
le 26 Nov 2014
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.
Réponse acceptée
Mohammad Abouali
le 26 Nov 2014
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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!