|
|
> Fortunately, there's a simple solution for this. While "fixing" your
> timestep
> provides a valuable increase in the quality of your simulation, the
> solution is
> to simply make a step using whatever dt you have. That is,
>
> if (dt > ts*5)
> step(dt)
> else
> while (dt > ts)
> step(ts)
> dt -= ts
>
> The 5 above was chosen at random, and can be modified to suit individual
> simulations.
That's a bad idea, what happens when Invisible comes along with his 10 year
old PC and your code starts doing time-steps of 10*ts or even 20*ts? Who
knows?
Far better to *always* do step(ts), you can absolutely guarantee that on
every single machine the results will be the same then. And if it takes
Invisible's PC 10*ts to do a ts time-step, then so be it and just let the
simulation run at 1/10th speed, it can't be improved. It's a much better
way to peform on slow PCs rather than having unknown things happen with huge
time steps.
Post a reply to this message
|
|