PowerPoint Presentation - Missouri State University

advertisement
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
ο‚— First Start with Taylor Series
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 + 2𝐾2 + 2𝐾3 + 𝐾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.
ο‚—
Which ultimately leads to
ο‚—
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)
Download