Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

MIT ADTU’s

MIT School of Engineering, Pune


M. Tech. Civil
Subject:- Advanced Mathematics for Engineers

Unit:- Numerical Methods - I


Session -1Introduction to Finite differences and Interpolation-
Notes:
Finite differences and Interpolation-
Suppose we are given the following values of y  f x  for a set of values of x :
x : x0 x1 x2  xn
y : y0 y1 y2  yn
The process of finding the values of y corresponding to any value of x  xi between x 0 and x n
is called interpolation. Thus interpolation is the technique of estimating the values of a function
for any intermediate value of the independent variable.
1. Forward Operator    - It is defined as f  x   f  x  h   f  x  i.e. it is the difference
between forward value of the function & the present value.
Remark-
(i)  2 f  x  =   f  x  
=   f  x  h   f  x 
= f  x  2h   f  x  h   f  x  h   f  x 

= f  x  2h   2 f  x  h   f  x 

This gives forward difference of second order.

(ii) y0  y1  y0
(iii) 2 y0  y2  2 y1  y0
The differences are systematically set out as follows called as Forward Difference table

Value of Value of First diff. Second Third diff Fourth Fifth diff
x y diff diff
x0 y0 y 0 2 y0 3 y0 4 y0 5 y0

x0  h y1 y1 2 y1 3 y1 4 y1
x0  2 h y2 y2 2 y 2 3 y 2
x0  3h y3 y 3 2 y3
x0  4 h y4 y4

x0  5h y5

ILLUSTRATIONS

Ex.1. Prepare the forward difference table for the following data.

X 0 1 2 3 4

Y 5 4 9 26 61

Solution-

x y y 2 y 3 y 4 y

0 = x0 5 = y0 -1 = y0 6 = 2 y0 6 = 3 y0 0 = 4 y0

1 = x1 4 = y1 5= y1 12 = 2 y1 6 = 3 y1

18 =
2 = x2 9 = y2 17= y1
2 y2

3 = x3 26 = y3 35= y2

4 = x4 61 = y 4

2. Backward Operator    - It is defined as f  x   f  x   f  x  h  i.e. it is the


difference between value of the function at current point & the preceding point.

Remark-

(i) 2 f  x  =   f  x  
=   f  x   f  x  h 
= f  x   f  x  h   f  x  h   f  x  2h 
= f  x   2 f  x  h   f  x  2h 

This gives backward difference of second order.

(ii) y1  y1  y0
(iii) The differences are systematically set out as follows called as Backward
Difference table

Value of Value of First diff. Second Third diff Fourth Fifth diff
x y diff diff
x0 y0

x0  h y1 y1

x0  2 h y2 y 2  2 y2
x0  3h y3 y3  2 y3  3 y3
x0  4 h y4 y 4  2 y4  3 y4  4 y4
x0  5h y5 y5  2 y5  3 y5  4 y5  5 y5

ILLUSTRATIONS

Ex.2. Prepare the Backward difference table for the following data.

X 0 1 2 3 4

Y 5 4 9 26 61

Solution-

X y y 2 y 3 y 4 y

0 = x0 5 = y0

1 = x1 4 = y1 -1 = y1

2 = x2 9 = y2 5= y2 6 = 2 y2

3 = x3 26 = y3 17= y3 12 = 2 y3 6 = 3 y3

6 =
4 = x4 61 = y 4 35= y4 18 = 2 y4 0 34yy4
4

 h  h
3. Central difference operator   - It is defined as  f  x   f  x    f x 
 2  2
Remark-
(i)  2 f  x  =   f  x  
  h  h 
= f x  f  x  
  2  2 
= f  x  h  f  x   f  x   f  x  h 
= f  x  h  2 f  x  f  x  h

This gives central difference of second order.

1  h  h 
4. Average operator    - It is defined as  f  x    f  x   f  x  
2  2  2 
Remark-
(i)  2 f  x  =    f  x 
1   h  h  
=  f x  f  x   
2   2  2  
1 1 
= 
2 2
 f  x  h   f  x    f  x   f  x  h 
1
2 
1
=  f  x  h   2 f  x   f  x  h  
4

Relation Between the operators   ,  ,   :-

(i) 1   E
(ii)  1  E 1
1
(iii)   E2 
1

(iv)  E 2 

ILLUSTRATIONS

Ex.1. If f  x   x  2, h  2 then find f  x 

Solution- we know that f  x   f  x  h   f  x  , but h  2

 f  x   f  x  2   f  x 

=  x  2   2   x  2

=2
Ex.2. If f  x   x 2  2, h  2 then find f  x 

Solution. - we know that, f  x   f  x   f  x  h  but h  2

f  x   f  x   f  x  2 

=  x 2  2    x  2   2 
2
 

 
= x 2  2   x 2  2 x  4  2

= 2x  4

Ex.3. If f  x   x , h  1 then find  f  x 

 h  h
Solution. - we know that,  f  x   f  x    f  x   but h  1
 2  2

 1  1
= f  x   f x 
 2  2

 1  1
=  x   x  
 2  2

=1

Ex.4. If f  x   x 2 , h  2 then find  f  x  .

1  h  h 
Solution. - we know that,  f  x    f  x    f  x   but h  2
2  2  2 

1  2  2 
=  f  x   f  x  
2  2  2 

1
 f  x  1  f  x  1 
2
=

1
 x  1   x  1 
2 2
=
2 

= x2  1

Ex.5. If f  x   x 2 , h  2 then find  2 f  x  .


Soutionl. - we know that,  2 f  x   f  x  2h   2 f  x  h   f  x  but h  2

= f  x  4  2 f  x  2  f  x 

=  x  4  2  x  2  x
2 2 2

  
= x  8x  16  2 x  4 x  4  x
2 2 2

= 12

Ex.6. If f  x   x , h  2 then find  2 f  x  .

Solution. - we know that,  2 f  x   f  x  h   2 f  x   f  x  h  but h  2

= f  x  2  2 f  x   f  x  2

=  x  2  2  x    x  2

=0

Ex.7. If f  x   x 2 , h  1 then find  2 f  x  .

1
Solution. - we know that,  2   f  x  h   2 f  x   f  x  h   but h  2
4

1
 f  x  h   2 f  x   f  x  h  
4
=

=  x  2  2  x    x  2

=0

Session -2 Newton’s Forward difference Interpolation

Notes:
Newton’s Forward Difference Interpolation Formula
u  u  1 2 u  u  1 u  2  3
y  y0  u y0   y0   y0  ............
2! 3!
x  x0
where u =
h
ILLUSTRATIONS

Ex.1. Find the value of y for x  0.5 the following table of x, y values using Newton’s

Forward difference formula.

X 0 1 2 3 4

Y 1 5 25 100 250

Solution- preparing forward difference table

X y y 2 y 3 y 4 y

0 1 4 16 39 -19

1 5 20 55 20

2 25 75 75

3 100 150

4 250

Here h  1 , x0  0 , y0  0, x  0.5

By Newton’s forward interpolation formula

u  u  1 2 u  u  1 u  2  3
y  y0  u y0   y0   y0  ............
2! 3!
x  x0 0.5  0
where u =   0.5
h 1

0.5  0.5  1 0.5  0.5  1 0.5  2  0.5  0.5  1 0.5  2  0.5  3
 y  x0.5 1  0.5 4  16   39    19 
2! 3! 4!
= 4.1796

EXERCISE
dy
Ex.1. Find the value of y at x  1.5 and at x 1.5 for the following tabulated data.
dx

X 1 2 3 4 5

Y 3.47 6.92 11.25 16.75 22.94

Session -3Newton’s Backward Difference Interpolation Formula

Notes:
1. Newton’s Backward Difference Interpolation Formula
u  u  1 2 u  u  1 u  2  3
y  yn  u yn   yn   yn  ............
2! 3!
x  xn
where u =
h

Ex.1. The distance travelled by a point P in x-y plane in a mechanism is as shown in the table
below. Estimate the distance travelled, velocity and acceleration of point P when x  0.5

x 1 2 3 4 5

y 14 30 62 116 198

Solution- preparing backward difference table

X y y 2 y 3 y 4 y

1 14

2 30 16

3 62 32 16

4 116 54 22 6

5 198 82 28 6 0

Here h  1 , xn  x5  5 , yn  y5  198, x  4.5

By Newton’s backward interpolation formula

u  u  1 2 u  u  1 u  2  3
y  y5  u y5   y5   y5
2! 3!
x  xn x  5
where u =   x5
h 1

y  198   x  5   82 
 x  5 x  4   28   x  5 x  4  x  3 
6
2! 3!

 198 82 x  410   x 2  9 x  20  14   x  5  x 2  7 x  12 

 x3  2 x 2  3x  8

 y at x  4.5   4.5  2  4.5  3  4.5  8


3 2
 153.125

= distance travelled

dy
Velocity is given by v 
dx

  x3  2 x 2  3x  8 
d
dx

  3 x 2  4 x  3

Velocity at x  4.5  3  4.5  4  4.5  3


2

 81.75

dv
Acceleration 
dx


d
dx
 3x 2  4 x  3

  6x  4

Acceleration at x  4.5   6  4.5  4   31

EXERCISE

Ex.1.From the tabulated data. Estimate the value of y when x  0.47

x 0 0.1 0.2 0.3 0.4 0.5

y 1 1.046 1.09 1.44 1.29 1.25

Ex2. Given the table of square roots. Calculate the values of 155 by Newton’s interpolation
formula.

x 150 152 154 156


y x 12.247 12.329 12.410 12.490
Session4:Lagrange’s Interpolation formula (Interpolation with unequal intervals)

Notes:

Lagrange’s Interpolation formula (Interpolation with unequal intervals)


If y  f x  takes the values y 0 , y1 , y 2 ,, y n corresponding to x  x0 , x1 , x2 ,, xn
then.
y
x  x1 x  x2  x  xn  y  x  x0 x  x2  x  xn  y
x0  x1 x0  x2  x0  xn  0 x1  x0 x1  x2  x1  xn  1
.
  
 x  x0  x  x1  x  xn1 
y
xn  x0 xn  x1  xn  xn1  n
This is known as Lagrange’s Interpolation formula for unequal Intervals

ILLUSTRATIONS

Ex.1. The velocity distribution of a fluid near a flat surface is given below:

x 0.1 0.2 0.3 0.4

y 0.72 1.81 2.73 3.47

x is the distance from the surface (mm) and v is the velocity (mm/sec). use Lagrange’s

Interpolation polynomial to obtain the velocity at x=0.4.

Solution: - by Lagrange’s interpolation formula.

v
 x  x1  x  x2  x  x3  v   x  x0  x  x2  x  x3  v +
 x0  x1  x0  x2  x0  x3  0  x1  x0  x1  x2  x1  x3  1
 x  x0  x  x1  x  x3  v   x  x0  x  x1  x  x2  v
 x2  x0  x2  x1  x2  x3  2  x3  x0  x3  x1  x3  x2  3

v
 0.4  0.3 0.4  0.6  0.4  0.8 0.72   0.4  0.1 0.4  0.6  0.4  0.8  1.81
 0.1  0.3 0.1  0.6  0.1  0.8  0.3  0.1 0.3  0.6  0.3  0.8 


 0.4  0.1 0.4  0.3 0.4  0.8 2.73   0.4  0.1 0.4  0.3 0.4  0.6  3.47
 0.6  0.1 0.6  0.3 0.6  0.8  0.8  0.1 0.8  0.3 0.8  0.6 
= 2.1602

Ex.2. Find Lagrange’s interpolating polynomial passing through set of points:

x 0 1 2

y 4 3 6
3
dy
use it to findy at x  1.5 , at x  0.5 , and  yd x
dx 0

Soutionl: - by Lagrange’s interpolation formula.

y
 x  x1  x  x2  y0 
 x  x0  x  x2  y1 
 x  x0  x  x1  y2
 x0  x1  x0  x2   x1  x0  x1  x2   x2  x0  x2  x2 


 x  1 x  2  4   x  0  x  2  3
 x  0  x  1 6
 0  1 0  2  1  0 1  2   2  0  2  1

 4
2

1 2
x  3x  2   3  2 x  x 2   6   x 2  x 
1
2

 2 x 2  3x  4

 y 0.5  2  0.5  3  0.5  4  4


2

dy
 4x  3
dx

 dy 
   4  0.5   3   1
 dx 0.5
3 3

 ydx  x  3x  4  dx
2

0 0

3
 x3 x2 
 2  3  4 x 
 3 2  0

3
 33 32 
  2  3  4  3 
 3 2  0

 16.5

EXERCISE

Ex.1. Use Lagrange’s formula to find the value of y when x  10 , if the following values of x
and y

are given:

x: 5 6 9 11
y: 12 13 14 16

Ex.2.Use Lagrange’s formula to find the form of f x  , given

x: 0 2 3 6
y: 648 704 729 792

Session -5Numerical Differentiation

Notes:
d y 1  2u  1 2  3u 2  6u  2  3  4u 3  18u 2  22u  6  4 
     y0   y0   y0   y0  
 d x  xn h  2 6 24 
d y 1  2u  1 2  3u 2  6u  2  3  4u 3  18u 2  22u  6  4 
    yn   yn   yn   yn  
 d x  xn h  2 6 24 

ILLUSTRATIONS

EX.1 For the tabulated data

x 0 1 2 3 4 5

y 1.12 3.45 6.67 10.8 16.12 24.52

dy
find at x  5.5
dx

Solution- preparing backward difference table

X Y y 2 y 3 y 4 y 5 y

0 1.12

1 3.45 2.33

2 6.67 3.22 0.89

3 10.8 4.13 0.91 0.02

4 16.12 5.32 1.19 0.28 0.26

5 24.52 8.40 3.08 1.89 1.61 1.35

xn  x 5  5.5
Here h  1 , xn  5 , yn  24.52, x  5.5 , u    0.5
h 1

d y 1  2u  1 2  3u 2  6u  2  3  4u 3  18u 2  22u  6  4 
    yn   yn   yn   yn  
 d x  xn h  2 6 24 

 dy  3  0.25   6  0.5   2  4  0.125   18  0.25   22  0.5   6 


   8.40    1.89  1.61
 dx  x 5.5 2 24

11.6871

EX.2 For the tabulated data


x 500 510 520 530 540 550

y 6.2146 6.2344 6.2538 6.2729 6.2916 6.3099

dy
find at x  500
dx

Solution- preparing forward difference table

x Y y 2 y 3 y 4 y 5 y

500 6.2146 0.0198 -0.0004 0.0001 -0.0002 0.0003

510 6.2344 0.0194 -0.0003 -0.0001 0.0001

520 6.2538 0.0191 -0.0004 0

530 6.2729 0.0187 -0.0004

540 6.2916 0.0183

550 6.3099

x0  x 500  500
Here h  10 , x0  500 , y0  6.2146, x  500 , u   0
h 10

d y 1  2u  1 2  3u 2  6u  2  3  4u 3  18u 2  22u  6  4 
     y0   y0   y0   y0  
 d x  xn h  2 6 24 

 dy  1 1 1 1 1 
   0.0198   0.0004    0.0001   0.0002    0.0003
 dx  x 500 10  2 3 4 5 

 dy  1
    0.0198  0.0002  0.0003  0.00005  0.00006
 dx  x 500 10

 0.0002

EXERCISE

EX.1. For the tabulated data

x 0 1 2 3 4 5

y 4 8 15 7 6 2
dy
find at x  0 and x  5
dx

Session -6 Numerical Solution of Ordinary Differential equations by modified Euler’s Method

Notes:-

Numerical Solution of Ordinary Differential equations


Many ordinary differential equations can be solved by analytical methods. however majority of
differential equations appearing in physical problems cannot be solved analytically. Thus it
becomes
imperative to discuss their solution by numerical methods. The different methods are

1) Euler’s Method
 f x, y  with the initial condition y  y0 at
dy
Consider the differential equation
dx
x  x0
Suppose we want to solve the equation we use the following approximation
y1  y0  h f x0 , y0  ,
y2  y1  h f x1 , y1  ,
And so on, In general y n1  y n  h f xn , y n , n  0,1, 2,
To obtain the solution with desired accuracy, one has to take a smaller value of h , hence
the solution is obtained very slowly. Due to this the method is rarely used. The more
accurate method will be obtained by the modified method.
ILLUSTRATIONS

dy
Ex.1. Use Euler’s method to solve the equation  1  xy
dx

Subject to the conditions at x  0, y 1find y  0.4 

30
Solution: - given f  x , y  1  xy , h  0.1, x0  0, y0 1 and h   0.5
6

y1  y0  h f  x0 , y0 

1  0.1 f  0,1

1  0.11  0 1  1.1

y2  y1  h f  x1 , y1 

1.1  0.1 f  0.1,1.1

1.1  0.11  0.11.1  1.211

y3  y2  h f  x2 , y2 

1.211  0.1 f  0.2,1.211

1.211  0.11  0.2 1.211  1.3352

y4  y3  h f  x3 , y3 

1.3352  0.1 f  0.3,1.3352 

1.3352  0.11  0.3 1.3352  1.4752

y3  y2  h f  x2 , y2 
1.211  0.1 f  0.2,1.211

1.211  0.11  0.2 1.211  1.3352

2) Modified Euler’s Method


To start, we use Euler’s formula to find value of y at x  x1 ,
therefore y1  y0  h f x0 , y0 
0 

To find more correct approximation at x  x1 , we use Euler’s modified iteration formula

y1
 n 1
2
  n 

 y 0  f  x0 , y 0   f x1 , y1 , n 1, 2,
h
……….. (1)


i.e. new y  old y  h Meanslope  , where Mean slope  f  x0 , y 0   f x1 , y1
1
2
n 
 
1 2  n1 n 
by making use of (1) we can obtain approximations y1 , y1 ,, y1 , y1 . This
n1 n 
process is repeated till no significant change occurs. i e. y1  y1 we call this as y1
Then y1 is more correct approximation at x  x1
To find the value of y at x  x2 , the above procedure is repeated in the interval x1 , x2 
(note x2  x1  h )

ILLUSTRATIONS

dy
Ex.1. Use modified Euler’s method to solve  x  y 2 , y  0   1 to calculate y  0.4  taking
dx

h  0.2

Solution: - given f  x , y   x  y 2 , h  0.2, x0  0, y0 1

Step 1: to find y1   y  x 0.2

by Euler’s method

y10  y0  h f  x0 , y0   1  0.2 0  1   0.8


2
 

by modified Euler’s method

y11  y0   f  x0 , y0   f  x1 , y10  
h
2

0.2
 1  f  0,1  f  0.2, 0.8  
2 
0.2
 1  1  0.44   0.8560
2

y12  y0   f  x0 , y0   f  x1 , y11  
h
2

0.2
 1  f  0,1  f  0.2, 0.8560  
2 

0.2
 1  1  0.5327   0.8467
2

 y1   y  x 0.2  0.8467

Step 2: to find y1   y  x 0.4

by Euler’s method

y2 0  y1  h f  x1 , y1   0.8467  0.2 0.2   0.8467    0.7962


2
 

by modified Euler’s method

y21  y1   f  x1 , y1   f  x2 , y2 0  
h
2

0.2
 0.8467   f  0.2, 0.8467   f  0.4, 0.7962  
2 

0.2
 0.8467   0.5193  0.2340  0.7728
2

y2 2  y1   f  x1 , y1   f  x2 , y21  
h
2

0.2
 0.8467   f  0.2, 0.8467   f  0.4, 0.7728  
2 

0.2
 0.8467   0.5193  0.1972   0.7765
2

 y2   y  x 0.4  0.7765

dy
Ex.2. Use modified Euler’s method to solve  x 2  y, y  0   1 to calculate y  0.1 taking
dx
h  0.05

Sol: - given f  x , y   x 2  y , h  0.05, x0  0, y0 1

Step 1: to find y1   y  x 0.05

by Euler’s method

y10  y0  h f  x0 , y0  1 0.05 0  1 1.05

by modified Euler’s method

y11  y0   f  x0 , y0   f  x1 , y10  
h
2

0.05
 1  f  0,1  f  0.05,1.05  
2 

0.05
 1 1  1.0525  1.0513
2

y12  y0   f  x0 , y0   f  x1 , y11  
h
2

0.05
 1  f  0,1  f  0.05,1.0513  
2 

0.05
 1 1  1.0538  1.0513
2

 y1   y  05 1.0513

Step 2: to find y2   y  x 0.1

by Euler’s method

y2 0  y1  h f  x1 , y1   1.0513  0.05  0.05   1.0513  1.1040


2
 

by modified Euler’s method

y21  y1   f  x1 , y1   f  x2 , y2 0  
h
2
0.05
 1.0513   f  0.1,1.0513  f  0.1,1.1040  
2 

0.05
 1.0513  1.0538  1.114 1.1055
2

y2 2  y1   f  x1 , y1   f  x2 , y21  
h
2

0.05
 1.0513   f  0.05,1.0513   f  0.1,1.1055  
2 

0.05
 1.0513  1.0538 1.1155 1.1055
2

 y2   y  x 0.1 1.1055

EXERCISE
dy
Ex.1. Use Euler’s method to solve the equation  x  y, y  0   0 find y  0.4 
dx

Ex.2. Use Modified Euler’s method to find the value of y satisfying the equation

 logx  y , y 1  2 for x  1.2 and x  1.4


dy
dx

Ex.3. Use Modified Euler’s method to find the value of y satisfying the equation

d y yx
 , y 0  1for x  0.1 take h  0.05
d x yx
Session -7 Numerical Solution of Ordinary Differential equations by Runge-Kutta Method

 Notes:
1) Runge-Kutta Method of fourth order
The fourth order Runge-kutta method is most commonly used.Working rule for finding
the increment k of y corresponding to an increment h of x by Runge-kutta method

 f x, y , y x0   y0 is as follows:


dy
from
dx
 h k 
Calculate successively k1  h f x0 , y 0  , k 2  h f  x0  , y0  1  ,
 2 2
 h k 
k 3  h f  x0  , y 0  2  ,
 2 2

k 4  h f x0  h, y0  k 3  Finally compute k  k1  2k 2  2k 3  k 4 


1
6

Which gives the required approximate value y1  y0  k

ILLUSTRATIONS

dy
Ex.1. Use fourth order Runge- Kutta method to solve  x  y , y  0   1 to calculate
dx
y at x = 0.2

Solution: - given f  x , y   x  y , h  0.2, x0  0, y0 1

Step 1: to find y1   y  x 0.2

k1  h f  x0 , y0   0.2 0  1  0.2

 h k   0.2 0.2 
k2  h f  x0  , y0  1   0.2 f  0  ,1  
 2 2  2 2 

 0.2  0  0.1  1  0.1  0.2191

 h k   0.2 0.2191 
k3  h f  x0  , y0  2   0.2 f  0  ,1  
 2 2  2 2 

 0.2  0  0.1  1  0.1095  0.2120

k4  h f  x0  h, y0  k3   0.2 f  0  0.2,1  0.2120 

 0.2  0  0.1  1  0.1095  0.2120


1
k  k1  2k2  2k3  k4 
6

1
  0.2  2  0.2191  2  0.2120  0.2377 
6

 0.2167

 y1   y  x 0.2  y0  k  1.2167

dy 1
Ex.2. Use fourth order Runge- Kutta method to solve  , y  0  1 to find
dx x  y

y at x = 0.4 taking h=0.2

1
Solution: - given f  x , y   , h  0.2, x0  0, y0 1
x y

Step 1: to find y1   y  x 0.2


 1 
k1  h f  x0 , y0   0.2    0.2
 0 1 

 h k   0.2 0.2 
k2  h f  x0  , y0  1   0.2 f  0  ,1  
 2 2  2 2 

 1 
 0.2    0.167
 0.1  1.1 

 h k   0.2 0.167 
k3  h f  x0  , y0  2   0.2 f 0  ,1  
 2 2  2 2 

 1 
 0.2    0.169
 0.1  1.0835 

k4  h f  x0  h, y0  k3   0.2 f  0  0.2,1  0.169 

 1 
 0.2    0.1461
 0.2  1.169 

1
k  k1  2k2  2k3  k4 
6

1
  0.2  2  0.167  2  0.169  0.1461
6

 0.1697

 y1   y  x 0.2  y0  k  1.1697

Step 2: to find y2   y  x 0.4

 1 
k1  h f  x1 , y1   0.2    0.146
 0.2  1.1697 

 h k   0.2 0.146 
k2  h f  x1  , y1  1   0.2 f  0.2  ,1.1697  
 2 2  2 2 

 1 
 0.2    0.1296
 0.3  1.2497 

 h k   0.2 0.1296 
k3  h f  x1  , y1  2   0.2 f  0.2  ,1.1697  
 2 2  2 2 
 1 
 0.2    0.1303
 0.3  1.2345 

k4  h f  x1  h, y1  k3   0.2 f  0.2  0.2,1.1697  1.1303

 1 
 0.2    0.1176
 0.4  1.3 

1
k  k1  2k2  2k3  k4 
6

1
  0.146  2  0.1296  2  0.1303  0.1176 
6

 0.1306

 y2   y  x0.4  y1  k  1.3003

EXERCISE

dy
Ex.1. Use fourth order Runge- Kutta method to solve  log  x  y  , y 1  2 to find
dx

y 1.2  and y 1.4 

dy
Ex.2. Use fourth order Runge- Kutta method to solve  x 2  y 2 , y 1 1.5 to find
dx

y 1.2  with h  0.1


Session -8 Discussion on MCQ’s and assignment.

Q.1 Following table shows enthalpy at different pressures.

Pressure(bar) 1.9 2.2 2.4 2.6

Enthalpy(kJ/kg.K) 497.9 517.6 529.6 540.9

Find out the enthalpy at pressure 2.1 bar by Lagrange’s interpolation method.

x 1 2 3 4 5

y 3.47 6.92 11.25 16.75 22.94

using Lagrange’s interpolation formula.

Q.3 Find interpolating polynomial passing through following tabulated data.

x 2 6 10 14 18

y 21.857 21.025 20.132 19.145 18.057

dy
Estimate the values of y at x  2.05 and at x  14.5
dx

Q.4 Construct the difference table from the following data:


x 4.0 4.1 4.2 4.3 4.4

f ( x) 27.30 30.17 33.35 36.85 40.73

Obtain f (4.05) using Newton’s forward difference formula and f (4.35) using Newton’s
backward difference formula.


2
sin x
Q.5 Use Simpson’s 1/3 rule to evaluate 
0
x
dx , by diving the interval into four parts.


sin 2  
Q.6 Evaluate 
0
5  4 cos 
d taking h  by using i)Trapezoidal rule.
6
ii)Simpson’s 3/8 rule.

correct to two decimal places .

dy
Q.7 Use Modified-Euler’s method to solve  x  y 2 , y (0)  1 . Find the value of
dx
y (0.2) and y (0.4) in steps of 0.2 using.

dy
Q.8 Using Modified-Euler’s method solves the equation  x 2  y ; y (0)  1 to find y
dx
at x  1.2 correct to three decimal places taking h  0.2 .

dy 1
Q.9 Use Runge – Kutta method of fourth order to solve  , y ( 0)  1
dx x  y

to find y at x  0.4 taking h  0.2

Multiple Choice Questions


x 0 1 dy
1. If Lagrange’s polynomial passes through then at x  1 is given by
dx
y -4 -4
A)0 B) 2 C) 1
1
D)
2
2. Given that
x 4 6 8 10

y 1 3 8 16

using Newton’s backward formula, the value of y when x  9 is,

( Use: yn  8,  yn  3,  yn  0 and x  xn  uh )


2 3

A) 10.125 B) 11.125 C) 12.125 D) 13.125

dy x  y
3. Given equation is  with initial condition y (2)  2 and step size h  0.5 by Euler’s formula
dx x
y1 at x  2.5 is equal to 3 .First approximation y1(1) at x  2.5 calculated by modified Euler’s formula
is
A) 1.375 B) 4.5 C) 3.375 D) 3.05

dy
4. Given equation is  x 2  y 2 with initial condition y (1)  1.5 and step size h  0.1 . k1 is
dx
calculated as 0.325. k2 is given by using Runge-Kutta method
A) 0.37554 B) 0.35791 C) 0.38664 D)
0.4252

5. Newton’s Gregory forward finite difference interpolation formula for a set of data points
xi  x0  ih, i  0,1, 2, 3, , n is  x  x0  uh 
 xi , yi  , i  0,1, 2, 3, , n with
u  u  1 2 u  u  1 u  2  3
A) y  y0  u y0   y0   y0  
2! 3!

u  u  1 2 u  u  1 u  2  3
B) y  y0  u y0   y0   y0  
2! 3!

u  u  1 2 u  u  1 u  2  3
C) y  y0  u y0   y0   y0  
2! 3!

D) y  y0  u y0  u  u  1  y0  u  u  1 u  2   y0 


2 3

You might also like