Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 35

BITS Pilani

DE ZG535: Advanced Engineering Mathematics


Dr. K. Ram chandra murthy
Assistant Professor, BITS Pilani, Hyderabad Campus

BITS Pilani rcmurthy@hyderabad.bits-pilani.ac.in


Pilani|Dubai|Goa|Hyderabad
Review

 Laplace Transform
• Definition of the Laplace Transform
• The Inverse Transform and Transforms of Derivatives
• Translation Theorems
• Additional Operational properties
• Systems of linear differential equations

2 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Scopeofthislecture

 Numerical Solutions of Ordinary Differential Equations


• Euler Methods and Error Analysis
• Runge–Kutta Methods
• Solution using MATLAB

3 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


BITS Pilani
Pilani|Dubai|Goa|Hyderabad

Numerical Solutions
of Ordinary Differential Equations
EulerMethodsandErrorAnalysis

 Euler’s method is one of the simplest numerical methods for


approximating solutions of a first-order initial value problems

where is the function obtained from the differential equation

 is a constant and is the size of the step between and


 While this method is simple, it is also a crude approximation

5 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 A smaller step size have better accuracy but results in larger


number of calculations

6 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 Ex: By Euler’s method, obtain a four-decimal approximation of the


indicated value for a) , b)

 Solution

For

7 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 For

8 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 Errors in Numerical Methods


• For some kinds of computation the accumulation of errors
might reduce the accuracy of an approximation to the point of
making the computation useless

• On the other hand, depending on the use to which a numerical


solution may be put, extreme accuracy may not be worth the
added expense and complication

9 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 For errors arising from the use of numerical methods, it is helpful


to use the notation
• If denote the error in a numerical calculation depending on .
• Then is said to be of order , denoted by , if there is a constant
C and a positive integer such that

• If is halved, the new error is approximately or error is reduced


by a factor of .

10 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 Round-off error
• This error results from the fact that any calculator or computer
can represent numbers using only a finite number of digits.

• One way to reduce the effect of round-off error is to minimize


the number of calculations.

• Another technique on a computer is to use double-precision


arithmetic to check the results

11 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 Truncation error in Euler Method


 The value of will not agree with the actual solution evaluated
at . This is because the equation gives only a straight line
approximation to the solution.
 The error is called the local truncation error, formula error, or
discretization error.
 Value of error is given by

where

12 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 Truncation error in Euler Method:


 The total error in is an accumulation of the errors in each of
the previous steps. This total error is called the global
truncation error.
 The local truncation error in Euler’s method is

where
 The global truncation error in Euler’s method is

13 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 Ex: Consider the initial-value problem , . The analytic solution is

(a) Approximate using one step and Euler’s method.


(b) Find a bound for the local truncation error in .
(c) Compare the actual error in with your error bound.
(d) Approximate using two steps and Euler’s method.
(e) Verify that the global truncation error for Euler’s method
is by comparing the errors in parts (a) and (d).

14 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 , . The analytic solution is

(a) Approximate using one step and Euler’s method

(b) Find a bound for the local truncation error in .

15 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 , . The analytic solution is

(c) Compare the actual error in with your error bound.

(d) Approximate using two steps and Euler’s method.

16 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 , . The analytic solution is

(e) Verify that the global truncation error for Euler’s method
is by comparing the errors in parts (a) and (d).

17 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 Improved Euler’s Method

where

 This method is an example of a predictor–corrector method

18 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 Truncation Error in the Improved Euler’s Method


 The local truncation error in improved Euler’s method is
 Value of error is given by

where
 The global truncation error in improved Euler’s method is

19 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 Ex: Consider the initial-value problem , . The analytic solution is

(a) Approximate using one step and improved Euler’s method.


(b) Find a bound for the local truncation error in .
(c) Compare the actual error in with your error bound.
(d) Approximate using two steps and improved Euler’s method.
(e) Verify that the global truncation error for improved Euler’s
method is by comparing the errors in parts (a) and (d).

20 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 , . The analytic solution is

(a) Approximate using one step and improved Euler’s method.

(b) Find a bound for the local truncation error in .

21 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 , . The analytic solution is

(c) Compare the actual error in with your error bound.

(d) Approximate using two steps and improved Euler’s method.

22 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


EulerMethodsandErrorAnalysis

 , . The analytic solution is

(e) Verify that the global truncation error for improved Euler’s
method is by comparing the errors in parts (a) and (d).

23 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Runge–KuttaMethods

 Runge-Kutta Methods
• Fundamentally, all Runge–Kutta methods are generalizations of
the basic Euler formula where the slope function is replaced
by a weighted average of slopes over the interval defined by

weights are constants that generally satisfy . is the


function
evaluated at a selected point for which

24 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Runge–KuttaMethods

 First-order Runge–Kutta method

• The number m is called the order of the method.

• By taking we get the Euler formula .

• Hence Euler’s method is said to be a first-order Runge–Kutta


method.

25 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Runge–KuttaMethods

 Second-Order Runge–Kutta Method

and

 The above result is same as improved Euler’s method

26 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Runge–KuttaMethods

 Fourth-Order Runge–Kutta Method

• Also referred to as the classical Runge–Kutta or RK4 method

27 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Runge–KuttaMethods

 Euler's vs. Improved Euler's vs. Fourth Order Runge-Kutta Method

28 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Runge–KuttaMethods

 Truncation Error in fourth Order Runge-Kutta method

 The local truncation error in fourth Order Runge-Kutta method


is

 The global truncation error in fourth Order Runge-Kutta


method is

29 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Runge–KuttaMethods

 Ex: Consider the initial-value problem , . The analytic solution is

(a) Approximate using one step and the RK4 method.


(b) Find a bound for the local truncation error in .
(c) Compare the actual error in with your error bound.
(d) Approximate using two steps and the RK4 method.
(e) Verify that the global truncation error for the RK4 method is by
comparing the errors in parts (a) and (d).

30 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Runge–KuttaMethods

 , . The analytic solution is

(a) Approximate using one step and the RK4 method.

(b) Find a bound for the local truncation error in .

31 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Runge–KuttaMethods

 , . The analytic solution is

(c) Compare the actual error in with your error bound.

(d) Approximate using two steps and the RK4 method.

32 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


Runge–KuttaMethods

 , . The analytic solution is

(e) Verify that the global truncation error for the RK4 method is by
comparing the errors in parts (a) and (d)..

33 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


34 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956
35 BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956

You might also like