580 likes | 1.37k Views
Numerical Analysis – Differential Equation. Hanyang University Jong-Il Park. Differential Equation. Solving Differential Equation. Differential Equation Ordinary D.E. Partial D.E . Ordinary D.E. Linear eg. Nonlinear eg. Initial value problem Boundary value problem.
E N D
Numerical Analysis – Differential Equation Hanyang University Jong-Il Park
Solving Differential Equation • Differential Equation Ordinary D.E. Partial D.E. • Ordinary D.E. • Linear eg. • Nonlinear eg. • Initial value problem • Boundary value problem Usually no closed-form solution linearization numerical solution
Discretization in solving D.E. • Discretization • Errors in Numerical Approach • Discretization error • Stability error y Exact sol. t Grid Points
Errors • Total error truncation round-off increase 0 as as 0 0 trade-off
Local error & global error • Local error • The error at the given step if it is assumed that all the previous results are all exact • Global error • The true, or accumulated, error
Useful concepts(I) • Useful concepts in discretization • Consistency • Order • Convergence
Useful concepts(II) • stability unstable stable Consistent stable Converge
Stability • Stability condition eg. Exact sol. Euler method Amplification factor For stability
Implicit vs. Explicit Method eg. = f Explicit : Implicit : h large y y ye h small h increase t t implicit explicit “stable” “conditionally stable”
Modification to solve D.E. • Modified Differential Eq. Discretization Diff. eq. Modified D.E. Discretization by Euler method <Consistency check> <Order>
Initial value problem • Initial Value Problem • Simultaneous D.E. • High-order D.E.
Taylor series method(I) • Taylor Series Method Truncation error
<Type 2> y t More computation accuracy .... Taylor series method(II) • High order differentiation • Implementation Complicated computation <Type 1> y Requiring complicated source codes t Less computation accuracy
Euler method(I) • Euler Method y .... .... t Talyor series expansion at to
Euler method(II) Error Eg. y’ =-2x3+12x2-20x+8.5, y(0)=1
Euler method(III) Generalizing the relationship Euler’s approx. truncation error Error Analysis Accumulated truncation error ; 1st order
Modified Euler method: Heun’s method • Modified Euler’s Method • Why a modification? error modify Predictor Average slope Corrector
Heun’s method with iteration Iteration significant improvement
Error analysis • Error Analysis • Taylor series • Total error truncation 3rd order ; 2nd order method ※Significant improvement over Euler’s method!
Eg. Euler vs. Modified Euler Euler Method improvement
Runge-Kutta method • Runge-Kutta Method • Simple computation • very accurate • The idea where
Second-order Runge-Kutta method • Second-order Runge-Kutta method ① Taylor series expansion ② ③ ④ ③→① Equating ② and ④
Modified Euler - revisited set P2 P1 Modified Euler method Modified Euler method is a kind of 2nd-order Runge-Kutta method.
Other 2nd order Runge-Kutta methods • Midpoint method • Ralston’s method
Comparison: 2nd order R-K method Eg. y’ =-2x3+12x2-20x+8.5, y(0)=1
4-th order Runge-Kutta methods • Fourth-order Runge-Kutta • Taylor series expansion to 4-th order • accurate • short, straight, easy to use P4 P3 P1 P2 ※ significant improvement over modified Euler’s method
Eg. 4-th order R-K method Significant improvement
Discussion Better!
Comparison (5th order)