CE 601: Numerical Methods
Lecture 28
Boundary-Value Ordinary
Differential Equations
Course Coordinator:
Dr. Suresh A. Kartha,
Associate Professor,
Department of Civil Engineering,
IIT Guwahati.
• As suggested, based on the auxiliary
conditions we can define ODE as:
o IV-ODE
o BV-ODE
• Some examples of BV-ODE:
• Beam bending problem
d4y
EI q ( x ); y (0) 0, y ( L) 0, y "(0) 0, y "( L) 0
dx 4
y deflection (dependent variable)
• Heat diffusion in a steel rod:
d 2T 2 2
T Ta
dx 2
T x1 T1
T x2 T2
• The dependent variable varying w.r.t space
generally leads to boundary-value ODEs.
• Boundary value ODEs are often found in
equilibrium problems and in closed domains.
• Following types of BV-ODEs are generally
encountered:
– Single Boundary Value ODE
– System of Boundary Value ODEs
– Linear and Non-linear ODEs
– Homogeneous and Non-homogeneous ODEs
• A general second-order non-linear BV-ODE is:
d2y dy
P x, y Q x, y y F ( x ); y ( x1 ) y1
dx 2 dx
y ( x2 ) y2
• A general second order linear BV-ODE is:
d2y dy
P Qy F ( x ); y ( x1 ) y1
dx 2 dx
y ( x2 ) y2
• Solution domain of the above equations is
x1 x x2
• Boundary conditions for BV-ODEs are:
– Dirichlet Boundary condition e.g. y( x1 ) c1
dy
– Neumann Boundary condition e.g. c2
dx x1
dy
– Mixed Boundary condition e.g. ay(x1 ) b c3
dx x1
The Equilibrium Finite-Difference Method
• We will use the equilibrium finite difference
method to solve the boundary-value ODEs.
– Discretize the entire continuous spatial domain
into smaller discrete grid points.
– Apply the ODE at each grid point.
– Approximate the derivatives at any grid point
using finite difference formulas.
– Obtain the corresponding finite-difference
algebraic equations.
– Solve them
• Consider the following 1-D second-order
linear BV-ODE:
d2y dy
P( x) Q( x) y F ( x); y ( x0 ) y0 , y ( xL ) yL
dx 2 dx
• The domain has been discretized.
• At any general node i, we have
d2y dy
P ( xi ) Q( xi ) yi F ( xi ) (1)
dx 2 i
dx i
• Now, d2y yi 1 2 yi yi 1
; O( x 2 )
dx 2 i x2
dy yi yi
1 1
; O( x 2 )
dx i 2 x
• Substituting in (1), we have
yi 1 2 yi yi 1 yi 1 yi 1
Pi Qi yi Fi
x2 2 x
• Rearranging the terms, we have
1 Pi 2 1 Pi
yi 1 yi Qi yi 1 Fi
x2 2 x x2 x2 2 x
or
x 2 x
1 Pi yi 1 2 x Qi yi 1 Pi yi 1 Fi x 2 (2)
2 2
Equation (2) is the finite-difference equation
for grid node ‘i’.
This equation is applied to each grid node ‘i’ to
generate a system of algebraic equations.
• Example: Solve the heat transfer BV-ODE for a
rod of length 1.0 cm. The governing ODE is:
d 2T 2 2
T Ta
dx 2
2
where 16.0 cm -2 (heat diffusivity)
Ta 20 C(ambient temperature)
The B.Cs T (0.0) 25 C
T (1.0) 75 C
• Solution: The rod is of length = 1.0 centimeter (cm). Let
us discretise the length as follows:
x 0.25 cm. As per the given data T0 250 C and T4 750 C. T1 , T2 , T3 are unknowns.
d 2T
For any node: 16Ti 16 20 320
dx 2 i
Ti 1 2Ti Ti 1
i.e. 2
16Ti 320
x
i.e. Ti 1 2Ti Ti 1 Ti 20
i.e. Ti 1 3Ti Ti 1 20 (1)
Eq.(1) is applied at unknown nodes 1,2,3.
At i 1, At i 2, At i 3,
T2 3T1 T0 20 T1 3T2 T3 20 T2 3T3 T4 20
T2 3T1 25 20 T2 3T1 95
3T1 T2 45
3 1 0 T1 45
i.e. 1 3 1 T2 20
0 1 3 T3 95
Solve this system of linear equations to get T1 , T2 , T3 .
• To solve problems with Neumann B.C.s
d2y dy dy
P x Q x y F ( x); y ( x0 ) y0 , m
dx 2 dx dx x L
• The FDE (2) is applied in each node ‘i’:
x x
1 Pi yi 1 2 x 2Qi yi 1 Pi yi 1 Fi x 2
2 2
• At i N , Neumann B.C. is given.
• Consider an imaginary node N+1,
i.e. not physically present and is used only for
computational purpose.
dy yN 1 yN 1
m m yN 1 yN 1 2m x
dx xN 2 x
• Substitute the previous expression for yN 1 at
node i N (FDE)
x x
i.e. 1 PN yN 1 2 x 2QN yN 1 PN y N 1 FN x 2
2 2
x x x
i.e. 1 PN 1 PN yN 1 2 x 2QN yN FN x 2 1 PN 2m. x
2 2 2
or, 2 yN 1 2 x 2QN yN FN x 2 2m. x m. x 2 PN (3)
• The FDE (3) is to be applied at the boundary
node, where Neumann B.C. is given.
In the above-mentioned example
dT
if 0 and T ( xL ) 75 C are the boundary conditions,
dx x 0
then the FDE is to be applied in nodes i 0,1, 2, 3.
dT T1 T 1
For i 0, 0 0 T1 T1
dx x 0 2 x
At i 0, T1 3T0 T1 0 20
3T0 2T1 0 0 20
At i 1, T0 3T1 T2 0 20
At i 2, 0 T1 3T2 T3 20
At i 3, 0 0 T2 3T3 95
3 2 0 0 T0 20
1 3 1 0 T1 20
System of linear equations:
0 1 3 1 T2 20
0 0 1 3 T3 95
• To solve Mixed B.C. problems:
• If the mixed B.C. is given at one-end for the
general linear second order (1-D) BV-ODE
dy
Ay (x N ) B p
dx xN
• Then at node i=N, the FDE
yN 1 yN 1
AyN B p
2 x
or, B yN 1 yN 1 2 p x 2 A xy N
1
or, yN 1 yN 1 2 p x 2 A xy N
B
Substitute this expression of yN 1 in FDE (2).