You may add a (variable) bit of idling at the end of your simulation frame and will then be able to start the next frame right on the spot.īut what to do if your system takes longer to compute a simulation step? Let’s take a look at the following figure: As indicated above, the best way to guarantee this is to make sure that your actual compute time is lower than the time step it represents. Installations with real (target) hardware or humans-in-the-loop require that simulation time progress along real-world time. There will always be a maximum simulation step size beyond which it may the the fastest not to perform any simulation at all because results become useless anyway. However, as indicated above, always keep in mind that systems may lose precision and/or stability if you reduce the granularity of the calculations. Increasing the speed of simulation execution in the go-as-fast-as-possible setup can only be achieved in two ways, by reducing the compute time (eg, by optimizing your algorithms, parallel execution, or using a more powerful computer) or by increasing the simulation step size (ie, more simulation time gets done per step). Simulation running as fast as possible (left: faster than real time right: slower than real time) This is indicated by the following figure (note: simulation time matches real time a the end of each frame): It doesn’t matter whether your compute time differs between frames as long as you keep it lower than the simulation time step it is aimed to represent. #Write to file time of simulation fullIf you want to stay withing real-time constraints, your system’s compute time has to stay below the full duration of the step, so that you can trigger the next frame in due time. Not all the real-world time that passes between two simulation frames has to be used for actually computing a frame – and it shouldn’t. There may be systems requiring to run in exact multiples (or fractions) of real time – twice real time, for example – but since this only implies multiplying the real-world time with a factor, everything else we will be saying about the correlation between simulation time and real time remains valid. Note (don’t read if you’re already confused): when talking about real time in the following paragraphs, we usually mean real time with a factor of one. Systems where simulation time accumulates faster or slower than real-world time are labeled accordingly. A system that accumulates simulation time in-sync with the progress of real-world time is called a real-time system. In the figure above, the delta time of each simulation step is identical (fixed-step solver) but the real-world time between the steps differs and, therefore, influences the correlation between simulation time and real-world time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |