### PowerPoint Presentation - Missouri State University

```Numerical Methods To Solve Initial
Value Problems
An Over View of Runge-Kutta Fehlberg and
Dormand and Prince Methods.
William Mize
Quick Refresher
 We are looking at Ordinary Differential Equations
 More specifically Initial Value Problems
 Simple Examples:
x′ =  + 1

Solution of:  =   − 1
0 =0

x ′ = 6 − 1
Solution of:  = 3 2 − t + 4
1 =6
A Problem
 How practical are analytical methods?
′
 Equation: x =
−  2 −
+ ln | + ℎ 3 |
 We chose to find a Numerical solution because
 Closed-form is to difficult to evaluate
 No close-form solution
Some Quick Ground work
Approximations
 Then Move onto Runge-Kutta Methods for
Approximations
 Lastly onto Runge-Kutta Fehlberg and
Dormand and Prince Methods for
Approximation and keeping control of error
How these Methods Work
 All of the Methods will be using a step size
method.
 Error is determined by the size of step,
order, and method used.
 When actually calculating these, almost
always done via computer.
Taylor Series Methods(Brief)
 Taylor Series As Follows
 x  + ℎ =   + ℎ ′  +
1 2 ′′
ℎ
2!
+
1 3 ′′′
ℎ
3!
+
 Most Basic is Euler’s Method
 x  + ℎ ≈   + ℎ ′
 Higher Order Approximations better Accuracy
 But at a cost
 What can we do?
1 4 ′′′′
ℎ
4!
+. .
Runge-Kutta Methods
 Named After Carl Runge and Wilhelm Kutta
 What they do?
 Do the same Job as Taylor Series Method, but
without the analytic differentiation.
 Just like Taylor Series with higher and higher
order methods.
 Runge-Kutta Method of Order 4 Well accepted
classically used algorithm.
Runge-Kutta of Order 2
 We don’t want to take derivatives for approximations
 Instead use Taylor series to create Runge-Kutta methods to
approximate solution with just function evaluations.
ℎ
  2 ,  =  ,  +  ′ ,
2
 We Want to Approximate this with
   + ,  +
 Find A, B, C
 We get:
1 = ℎ(, )

2 = ℎ( + ℎ,  + 1 )

1
2
x  + ℎ =   + (1 + 2 )
Error (ℎ2 )
Runge-Kutta of Order 4
1
x  + ℎ =   + (1 + 22 + 23 + 4 )
6
1 = ℎ(, )
1
1
2 = ℎ( + ℎ,  + 1 )
2
2
1
1
3 = ℎ( + ℎ,  + 2 )
2
2
4 = ℎ( + ℎ,  + 3 )
Error of Order (ℎ5 )
So What's next?
 Already Viable Numerical Solution established what's the
next step?
 We want to control our Error and Step size at each step.
 These methods are called adaptive.
 Why?
 Cost Less
 Keep within Tolerance
 Also look for More efficient ways of doing these things.
 10 Function Evaluation for RK4 and RK5
 Just 6 for RKF4(5)
Runge-Kutta Fehlberg
 Coefficients ∝  ,  , βλ ,  are found via Taylor
expansions
Next Step to find These Coefficients
Further Deriving
 We assume 1 = 0, 1 = 0, ∝ 4 =1
More and more…
 So this was way more complicated than I actually
thought it would be.
 But it’s all leading some where!
 Eventually we want to have all the  , βλ ,
in terms of ∝ 2 and ∝ 5 .
 From there was must figure out our ∝
∝ 5.
 ∝ 5 ends up being arbitary
2 and
How to find ∝
2

First Take coefficients from the 5th order equation.


Where we chose ∝
2=
1/3 and ∝
2=
3/8
∝
2=
1/3
∝
2=
3/8
Comparison(Problem)
Comparisons of Methods
Dormand and Prince Methods
Visual Comparison of Methods
Conclusion
 Taylor’s method uses derivatives to solve ODE
 RK uses only a combination of specific function evaluations
instead of derivatives to approximate solution of the ODE
 RKF is beneficial because you can control your step size so
you have your global error within a predetermined tolerance
 RK4 and RK5 uses 10 function evaluations vs RKF just 6
 Runge-Kutta Fehlberg is widely accepted and used
commercially(Matlab, Mathematica, maple, etc)
Sources
 Numerical Mathematics and Computing. Sixth Edition; Ward
Cheny, David Kincaid
 Low-Order classical Runge-Kutta Formulas with StepSize
Control and their Application to some heat transfer
problems. By Erwin Fehlberg(1969)
 A family of embedded Runge-Kutta Formulae. By Dormand
and Prince(1980)
```