Contents |
|
Taylor’s Theorem
You may remember Taylor’s Theorem from calculus. It’s named after mathematician Brook Taylor’s work in the eighteenth century. This theorem describes a method for converging on the solution to a differential equation.
(Eq. 4)
In Equation
4, Pn(x) represents the nth Taylor polynomial. If you take the limit of
Pn(x) as you get the Taylor series for the function. If, however, the
infinite series is not calculated and the series is actually truncated,
Rn(x) represents the error in the system. This error is called the
truncation error of approximation.
How does this apply to the problem with which we are working? If I only look at the first Taylor polynomial and do some substitution, I get Equation 5.
(Eq. 5)
Notice how
similar this equation is to Equation 3. In fact, Euler’s method is based
on this equation. The only difference is that the last error term is
dropped in Equation 5. By stopping the series at the second term, I get a
truncation error of 2. This gives Euler’s method an error of order .
If I added
another term of the Taylor series to the equation, I could reduce the
error to . However, to compute this exactly, I would need to evaluate the
next derivative of f(x). To avoid this calculation, I can do another
Taylor expansion and approximate this derivative as well. While this
approximation increases the error slightly, it preserves the error bounds
of the Taylor method. This method of expansion and substitution is known
as the Runge-Kutta techniques for solving differential equations. This
first expansion beyond Euler’s method is known as the Midpoint method or
RK2 (Runge-Kutta order 2), and is given in Equation 6. It’s called the
Midpoint method because it uses the Euler approximation to move to the
midpoint of the step, and evaluates the function at that new point. It
then steps back and takes the full time step with this midpoint
approximation.
(Eq. 6)
In fact, I
can continue to add Taylor terms to the equation using the Runge-Kutta
technique to reduce the error further. Each expansion requires more
evaluations per step, so there is a point at which the calculations
outweigh the benefit. I don’t have the space to get into it here, however,
I understand that smaller step sizes are preferred over methods above RK4
with an error of (Faires & Burden, p. 195). Runge-Kutta order 4 is outlined in
Equation 7.
(Eq. 7)
RK4 gives the simulation a very robust integrator. It should be able to handle most situations without blowing up. The only issue now is what the step size should be.
________________________________________________________