Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Ch9 SL3 ODE-BVP.pptx
1. 1
Numerical Solution of Ordinary
Differential Equations (ODE):
Boundary Value Problem (BVP)
Lecture-3
2. 2
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
3. 3
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
5. 5
Backward difference formulas:
𝑦′ =
1
ℎ
𝑦𝑛 − 𝑦𝑛−1
For first order
𝑦′′
=
1
ℎ2
𝑦𝑛 − 2𝑦𝑛−1 + 𝑦𝑛−2
For second order
For third order 𝑦′′′
=
1
ℎ3
𝑦𝑛 − 3𝑦𝑛−1 + 3𝑦𝑛−2 − 𝑦𝑛−3
6. 6
Central Difference formula
For first order 𝑦′
=
1
2ℎ
𝑦𝑛+1 − 𝑦𝑛−1
For second order 𝑦′′ =
1
ℎ2
𝑦𝑛+1 − 2𝑦𝑛 + 𝑦𝑛−1
For third order 𝑦′′′ =
1
2ℎ3
𝑦𝑛+2 − 2𝑦𝑛+1 + 2𝑦𝑛−1 − 𝑦𝑛−2
7. 7
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 ℎ = 1 3.
(b) Using the above finite difference formula solve the
above BVP.
Solution:
(a) Using central difference formulas, we have
𝑦′
=
1
2ℎ
𝑦𝑛+1 − 𝑦𝑛−1
𝑦′′ =
1
ℎ2
𝑦𝑛+1 − 2𝑦𝑛 + 𝑦𝑛−1
10. 10
Question 2#:
(a) Use three point central difference formula for
derivative to derive a recurrence relation for the above
IVP.
Given that 𝑦′ = 2𝑥𝑦2 − 𝑦, where 𝑦 = 1 at 𝑥 = 0.
(b) Estimate the values of y at 𝑥 = 0.4 and 0.6 using this
recurrence relation.
Three point central difference formula for derivatives is as
follows:
𝑦𝑛
′ ≈
𝑦𝑛+1 − 𝑦𝑛−1
2ℎ
Solution:
𝑦′𝑛 = 2𝑥𝑛𝑦𝑛
2 − 𝑦𝑛
(a) Differential equation at (𝑥𝑛, 𝑦𝑛) is
11. 11
Using three point central difference formula for derivatives
with the differential equation at (𝑥𝑛, 𝑦𝑛) we have
𝑦𝑛
′ ≈
𝑦𝑛+1 − 𝑦𝑛−1
2ℎ
= 2𝑥𝑛𝑦𝑛
2 − 𝑦𝑛
𝑦𝑛+1 = 𝑦𝑛−1 + 2ℎ 2𝑥𝑛𝑦𝑛
2
− 𝑦𝑛
(b) For ℎ = 0.2 with the starting values 𝑥0 = 0, 𝑦0 = 1 . For
getting the values of 𝑥1 and 𝑦1, apply Runge-Kutta four order
method. Here same ODE is used with same initial condition.
The formula of second order Runge-Kutta method:
𝑦1 = 𝑦0 +
1
6
[𝑘1 + 2𝑘2 +2𝑘3 +𝑘4]
17. 17
S.No. Questions
1 Which formula refers to central difference formula of second derivative?
(a) 𝑦′
=
1
2ℎ
𝑦𝑛+1 − 𝑦𝑛−1 ,
(b) 𝑦′′
=
1
ℎ2 𝑦𝑛+1 − 2𝑦𝑛 + 𝑦𝑛−1
(c) Both of them,
(d) None of them
2 Which formula refers to central difference formula of first derivative?
(a) 𝑦′ =
1
2ℎ
𝑦𝑛+1 − 𝑦𝑛−1 ,
(b) 𝑦′
=
1
ℎ2 𝑦𝑛+1 − 2𝑦𝑛 + 𝑦𝑛−1
3 Which formula refers to forward difference formula of second derivative?
(a) 𝑦′′
=
1
ℎ2 𝑦𝑛+2 − 2𝑦𝑛+1 + 𝑦𝑛 ,
(b) 𝑦′′ =
1
ℎ3 𝑦𝑛+2 − 𝑦𝑛+1 + 𝑦𝑛 ,
(c) Both of them
4 Which formula refers to backward difference formula of second derivative?
(a) 𝑦′′
=
1
ℎ3 𝑦𝑛+2 − 2𝑦𝑛+1 + 𝑦𝑛 ,
(b) 𝑦′′ =
1
ℎ2 𝑦𝑛 − 2𝑦𝑛−1 + 𝑦𝑛−2 ,
(c) None of them
Multiple questions:
18. 18
Try to do yourself
Exercise 2:
(a) Use three point central difference formula for
derivative to derive a recurrence relation for the above
IVP.
Given that 𝑦′ = 𝑦𝑥2 + 2𝑥, where 𝑦 = −1 at 𝑥 = 0,
and h=0.2.
(b) Estimate the values of y at 𝑥 = 0.4 and 0.6 using this
recurrence relation.
Exercise 1: Consider the boundary value problem
(a) Derive a recurrence relation using three points central
difference approximations with ℎ = 1 3.
(b) Using the above finite difference formula solve the
above BVP.
𝑦′′
+ 5𝑦′
+ 3𝑦 = 1, 𝑦 0 = 1, 𝑦 1 = 0