Integration Algorithms

The core of any dynamic simulation is the integration algorithm used. There are many different algorithms available, and the reason for this is performance. With big models, the number of calculations required for a simulation can be enormous, and integration step size is obviously the crucial factor in determining the number of calculations required for a particular period of simulated time. Sophisticated algorithms allow much larger integration steps to be used, while preserving accuracy and stability.

The simplest of all the integration algorithms is the Euler method. With this algorithm, the predicted next value of the output is simply the derivative of the output wrt time at the current time, multiplied by the integration time step. For accuracy and stability it is necessary to use small step sizes. This has the advantage that it generates lots of points for plotting, but makes the Euler method very slow for complex systems.

The Runge-Kutta method evaluates the derivative at several points in the step interval, and uses these values to more accurately predict the behaviour of the output. Since more calculations are done per step than with the Euler method, the step size must be much larger for the approach to be worthwhile. In fact it is possible to use much bigger steps and still preserve accuracy and stability, making the R-K method much more suitable for dynamic simulation calculations. VisSim offers two basic RK methods: a 2nd order algorithm; and a 4th order algorithm. The 4th order algorithm allows bigger integration steps to be taken - this means that simulations will run faster, but fewer points will be available for plotting (this leads to jagged looking graphs). The VisSim default algorithm is RK2 (the 2nd. order method).

Adaptive algorithms adjust the integration step size according to what's happening in the problem. At the start of a response, things are usually changing rapidly and a small step is appropriate, but towards the end of a response things move much more slowly and larger step sizes can be used without causing problems. VisSim offers four adaptive step algorithms, but it is very unlikely that you will need to use an adaptive algorithm in this course.

VisSim also offers three algorithms suitable for 'stiff' systems (backward Euler, Adaptive Adams-Moulton, Adaptive BDF). Stiff systems possess processes which have significantly different speeds of response (i.e. some are very fast and some very slow). Once again it's unlikely you'll need to use these in this course.