Numerical Solution of Ordinary Differential Equation A first

  • Slides: 18
Download presentation
Numerical Solution of Ordinary Differential Equation • A first order initial value problem of

Numerical Solution of Ordinary Differential Equation • A first order initial value problem of ODE may be written in the form • Example: • Numerical methods for ordinary differential equations calculate solution on the points, where h is the steps size 1

Numerical Methods for ODE • Euler Methods – Forward Euler Methods – Backward Euler

Numerical Methods for ODE • Euler Methods – Forward Euler Methods – Backward Euler Method – Modified Euler Method • Runge-Kutta Methods – Second Order – Third Order – Fourth Order 2

Forward Euler Method • Consider the forward difference approximation for first derivative • Rewriting

Forward Euler Method • Consider the forward difference approximation for first derivative • Rewriting the above equation we have • So, is recursively calculated as 3

Example: solve Solution: etc 4

Example: solve Solution: etc 4

Graph the solution 5

Graph the solution 5

Backward Euler Method • Consider the backward difference approximation for first derivative • Rewriting

Backward Euler Method • Consider the backward difference approximation for first derivative • Rewriting the above equation we have • So, is recursively calculated as 6

Example: solve Solution: Solving the problem using backward Euler method for yields So, we

Example: solve Solution: Solving the problem using backward Euler method for yields So, we have 7

8

8

Graph the solution 9

Graph the solution 9

Modified Euler Method • Modified Euler method is derived by applying the trapezoidal rule

Modified Euler Method • Modified Euler method is derived by applying the trapezoidal rule to integrating ; So, we have • If f is linear in y, we can solved for similar as backward euler method • If f is nonlinear in y, we necessary to used the method for solving nonlinear equations i. e. successive substitution method (fixed point) 10

Example: solve Solution: f is linear in y. So, solving the problem using modified

Example: solve Solution: f is linear in y. So, solving the problem using modified Euler method for yields 11

Graph the solution 12

Graph the solution 12

Second Order Runge-Kutta Method • The second order Runge-Kutta (RK-2) method is derived by

Second Order Runge-Kutta Method • The second order Runge-Kutta (RK-2) method is derived by applying the trapezoidal rule to integrating over the interval We estimate . So, we have by the forward euler method. 13

So, we have Or in a more standard form as 14

So, we have Or in a more standard form as 14

Third Order Runge-Kutta Method • The third order Runge-Kutta (RK-3) method is derived by

Third Order Runge-Kutta Method • The third order Runge-Kutta (RK-3) method is derived by applying the Simpson’s 1/3 rule to integrating over the interval We estimate . So, we have by the forward euler method. 15

The estimate may be obtained by forward difference method, central difference method for h/2,

The estimate may be obtained by forward difference method, central difference method for h/2, or linear combination both forward and central difference method. One of RK-3 scheme is written as 16

Fourth Order Runge-Kutta Method • The fourth order Runge-Kutta (RK-4) method is derived by

Fourth Order Runge-Kutta Method • The fourth order Runge-Kutta (RK-4) method is derived by applying the Simpson’s 1/3 or Simpson’s 3/8 rule to integrating over the interval. The formula of RK-4 based on the Simpson’s 1/3 is written as 17

 • The fourth order Runge-Kutta (RK-4) method is derived based on Simpson’s 3/8

• The fourth order Runge-Kutta (RK-4) method is derived based on Simpson’s 3/8 rule is written as 18