Re: What is the actual simulation time of NDSolve?
- To: mathgroup at smc.vnet.net
- Subject: [mg131464] Re: What is the actual simulation time of NDSolve?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Thu, 11 Jul 2013 02:02:08 -0400 (EDT)
- Delivered-to: email@example.com
- Delivered-to: firstname.lastname@example.org
- Delivered-to: email@example.com
- Delivered-to: firstname.lastname@example.org
On 7/10/13 at 3:36 AM, mccarter.patrick at gmail.com wrote: >I am trying to determine how long my simulation is going to run with >NDSolve. Without knowing what the time step is for the simulation, >is it possible to obtain the actual final time of the run? No. >For example, lets say I want to run a simulation for a total of 1000 >seconds, procedurally I could specify a dt = 0.01 and then a total >number of steps = 100000. Then dt*number of steps = 1000. I need to be >able to do this, but am not sure if it is possible with NDSolve? This computation only means something *if* the 1000 seconds is a *simulated* 1000 seconds. If your meant 1000 seconds real time, then your result is highly unlikely to have match the actual time required. Every call to NDSolve will take some finite time. The actual time required will depend on details of the model you are using NDSolve and this will be highly variable. A possible way to get an estimate of how many steps for your specific problem can be done in 1000 seconds real time would be to use TimeConstrained. If you add a counter to your model so that you can easily determine how many times NDSolve is called, you could put a constraint of say 10 seconds or whatever you are willing to wait and see how many times NDSolve was called. Using that information it should be a simple matter to see how many steps can be done in 1000 seconds and set up the problem accordingly.