# Accuracy of the Simulation Algorithms

Compared to Euler's method, both Runge-Kutta methods require additional evaluations within each iteration. The 2nd-order method requires two additional evaluations and the 4th-order method requires four additional evaluations. If these two methods were no more accurate then Euler's, it certainly would not be worth the cost of the additional calculations.

A good way to compare the three methods is with an example. The temperature model presented earlier in this Chapter was used to estimate values of temperature using each of the simulation algorithms. Since the Runge-Kutta methods require additional calculations in each iteration, a different step size (DT) was used so that the total number of calculations performed were the same in each case. The results are shown in Figure 13-5.

Figure 13-5 Comparison of Euler's, 2nd-Order, and 4th-Order Runge-Kutta

Notice that the step size (DT) for 2nd-order Runge-Kutta is twice that of the Euler's estimate, while the 4th-order Runge-Kutta estimates use a step size 4 times larger than Euler's. However, even with the larger step sizes, the errors produced with the Runge-Kutta methods are significantly smaller than those produced using Euler's.