You are on page 1of 18

Numerical Solution of Ordinary

Differential Equations (ODE): Boundary


Value Problem (BVP)
Lecture-3

1
Specific Aims
 Applications

 Introduction of Boundary value problem (BVP)

 Discuss finite difference method

 Examples of the solution of BVP by using finite difference


method

 Multiple questions

 Exercises

2
Applications
 Science and Engineering

 Introduction of BVP
Problems involving second and higher order differential
equations, we may prescribed the conditions at two or more
points. Such problems are called boundary value problems
(BVP).

 Finite Difference Formula


 Forward difference formula
 Backward difference formula
 Central difference formula

3
Forward difference formula
 ′ 1
For first order 𝑦 = ( 𝑦 𝑛 +1 − 𝑦 𝑛 )
h

  1
′′
For second order 𝑦 = 2 ( 𝑦 𝑛+2 − 2 𝑦 𝑛+1+ 𝑦 𝑛 )
h

  ′′ ′ 1
For third order 𝑦 = 𝑦 − 3 𝑦 𝑛+2 +3 𝑦 𝑛 +1 − 𝑦 𝑛 )
3 ( 𝑛+3
h

4
Backward difference formulas:
 ′ 1
For first order 𝑦 = ( 𝑦 𝑛 − 𝑦 𝑛 − 1)
h

  1
′′
For second order 𝑦 = 2 ( 𝑦 𝑛 − 2 𝑦 𝑛 − 1+ 𝑦 𝑛 − 2 )
h

  ′′ ′ 1
For third order 𝑦 = 𝑦 −3 𝑦 𝑛 − 1+3 𝑦 𝑛 −2 − 𝑦 𝑛 −3 )
3( 𝑛
h

5
Central difference formulas:
  ′ 1
For first order 𝑦= ( 𝑦 𝑛+1 − 𝑦 𝑛 −1 )
2h

  1′′
For second order 𝑦 = 2 ( 𝑦 𝑛+1 − 2 𝑦 𝑛+ 𝑦 𝑛 − 1 )
h

  ′′ ′ 1
For third order 𝑦 = 𝑦 −2 𝑦 𝑛 +1 +2 𝑦 𝑛 −1 − 𝑦 𝑛 −2 )
3 ( 𝑛 +2
2h

6
Examples
Question 1#: Consider the boundary value problem
  𝑦 ′ ′ − 𝑦 ′ =1 , 𝑦 ( 0 ) =1 , 𝑦 (1)=2 ( 𝑒 −1 )
 (a) Derive a recurrence relation using three points central
difference approximations with
(b) Using the above finite difference formula solve the
above BVP.

Solution:
(a) Using central difference formulas, we have
  1
𝑦′= ( 𝑦 𝑛+1 − 𝑦 𝑛 −1 )
2h

  1
𝑦′′ = 𝑦 − 2 𝑦 𝑛+ 𝑦 𝑛 − 1 )
2 ( 𝑛+1
h
7
Given ODE is

 
𝑦 ′ ′ − 𝑦 ′ =1
  Or,

  Taking ,

  Or

  Or

  Or

8
 (b)
With , the nodal points are .
For ,

− 36 𝑦 1 +15 𝑦 2 =2− 21=− 19 ,(1)


 

  For ,

21 𝑦1 −36 𝑦 2=2−30 (𝑒 −1)=−49.5485 , (2)


 
  [Since ]
Solving the equations (1) and (2), we have
  𝑦 1=1.4548∧ 𝑦 2=2.2250

9
Question 2#:  Given that , where .
(a) Use three point central difference formula for
derivative to derive a recurrence relation for the above
IVP.
 (b)Estimate the values of y at using this recurrence
relation.

Solution:   (a) Differential equation at is


 𝑦′ 2
𝑛 = 2 𝑥 𝑛 𝑦 𝑛 − 𝑦𝑛

 Threepoint central difference formula for derivatives is as


follows:

10
 Using three point central difference formula for derivatives
with the differential equation at we have

2
 
𝑦 𝑛+1 = 𝑦 𝑛 − 1+ 2 h ( 2 𝑥 𝑛 𝑦 − 𝑦 𝑛 ) 𝑛

 (b)
For with the starting values . For getting the values of
and , apply Runge-Kutta four order method. Here same ODE is
used with same initial condition.

The formula of second order Runge-Kutta method:

11
where
 

Now
 

    [Since ]
   [Since ,

12
 

   [Since , = - 0.2, h=0.2]


 

    [Since ]
¿ −0.1476
 

    [Since ,
= -0.1476, h=0.2]
 

    [Since ]
¿ −0.1509
 

13
 

  [Since , = - , h=0.2]
 

    [Since ]

¿ −0.1121
 

Therefore,  

14
 Substituting the values of , , , and , we get
 

  ¿ 0.8485
  We get,

 Taking ,

15
 Taking ,

  [Since h=0.2, ]

Outcomes
 Numerically solved ODE with conditions by using Finite
difference method.

16
Multiple questions:
S.No. Questions
1
1 Which formula refers to central difference formula of second derivative?
(a) ,
(b)
(c) Both of them,
(d) None of them
2 Which formula refers to central difference formula of first derivative?
(a) ,
2 (b)
3 Which formula refers to forward difference formula of second derivative?
(a) ,
(b) ,
(c) Both of them
3
4 Which formula refers to backward difference formula of second derivative?
(a) ,
(b) ,
(c) None of them

17
Try to do yourself
Exercise 1: Consider the boundary value problem
 

 (a) Derive a recurrence relation using three points central


difference approximations with
(b) Using the above finite difference formula solve the
above BVP.

Exercise 2:  Given that , where


and h=0.2.
(a) Use three point central difference formula for
derivative to derive a recurrence relation for the above
IVP.
 (b)Estimate the values of y at using this recurrence
relation. 18

You might also like