Skip to main content

6.4) Numerical Integration: Algorithms


The stability of a simulation depends on both the system being simulated and the algorithm used. Vensim offers two algorithms: Euler and RK4. Both of these are illustrated in the figure below for the case of an oscillating solution (like a simple pendulum). The Euler method in the example below is unstable, with the solution growing in amplitude. In a physics context the simulation does not conserve energy.

The RK4 solution, in contrast, remains constant. In this case the RK4 algorithm is preferable.

In fact, the RK4 method is almost always preferable – and yet Vensim defaults to Euler.