You are on page 1of 4

Title : Finite Difference Method for ODE with boundary value problem

Intended Learning Outcomes : At the end of this lesson, you should be able to :
1. Identify Ordinary Differential Equation(ODE) with Boundary Value Problem
2. Approximate the required function in the ODE using the Finite Difference Method

Discussions :
A differential equation(DE) has an order. A first-order DE has the highest derivative equal to
the first derivative (ex. y’ + 2y = 0). A second-order DE has the highest derivative equal to the
second derivative (ex. y’’ - 3y’ + K = 0).
A second-order DE can be reduced to a first-order DE using a substitution of variables.
Original DE : y’’ - 3y’ + K = 0
let t = y’ & t’ = y’’.
First-Order DE by substitution : t’ - 3t’ + K = 0
Several analytical methods can be employed to integrate the differential equation in order to
arrive at the general and specific solutions. In some instances, the DE can be approximated using
numerical methods.
Finite Difference Method(FDM) for an ODE with Boundary Value Problem
ODE of the form y = f(x,y, y’, y’’) having initial values (xi , yi) and final values (xf, yf) can
be approximated using the FDM. Finite divide differences are substituted for the first and second
derivative whenever they appear in the equation, hence
y i−1−2 y i + y i+1 −y i −1 + y i+1
y ' '= 2
& y '=
h 2h
where : h =Δx = step increment.
A system of linear equations having the unknown values of y at specific values of x are
created. The boundary conditions are applied in the first and the final equations.

Steps in FDM
1. Define the step size h = (xf - xi)/n. The number of subdivision is n ≥ 2

2. For each ith iteration substitute


y i−1−2 y i + y i+1 −y i −1 + y i+1
y ' '= 2
& y '=
h 2h

3. Solve the System of Linear equations to determine the approximate y values.

Finite Difference Method for ODE with boundary value problem page 1 of 4
Illustrative Problem
Estimate the deflection in the simply-supported
beam shown at every 1m interval all throughout
its length. Use FDM. Assume constant EI
and neglect the weight of beam.

Solution :
1. Draw the Moment Diagram and Fill up the table shown below

i x(m) M(KN-m)
0 0 0
1 1.0 7.5
2 2.0 12
3 3.0 13.5
4 4.0 12
5 5.0 7.5
6 6.0 0

M = 9x – 1.5x2 (moment equation)

Concept from Statics


EI y’’ = M

Boundary conditions
at x = 0m, y = 0, (roller support) , zero vertical deflection
at x = 6m, y = 0, (pin support) , zero vertical deflection

2. Define the step size h = (xf – xi)/n.


h = 1m = (6 – 0) /n
n = 6 (number of subdivisions)

3. For each ith iteration substitute


y i−1−2 y i + y i+1
y ' '= 2
h

EI y’’ = M
let EI = 1 (EI is constant)
y’’ = M
y i−1−2 y i + y i+1
2
=M
h

yi-1 - 2yi + yi+1 = Mh2


since h = 1 m, h2 = 1m2
yi-1 - 2yi + yi+1 = M

Finite Difference Method for ODE with boundary value problem page 2 of 4
at i = 1, M = 7.5 KN.m
yi-1 - 2yi + yi+1 = M
yo - 2y1 + y2 = 7.5
apply boundary condition, at x = 0, y = yo= 0
- 2y1 + y2 = 7.5 ------- E1

at i = 2, M = KN.m
y1 – 2y2 + y3 = 12 ------- E2

at i = 3, M = 13.5KN.m
y2 – 2y3 + y4 = 13.5 ------- E3

at i = 4, M = 12 KN.m
y3 – 2y4 + y5 = 12 ------- E4

at i = 5, M = 7.5 KN.m
y4 – 2y5 + y6 = 7.5
apply boundary condition, at x = 6m, y = y6= 0
y4 – 2y5 = 7.5 ------- E5

3. Solve the System of Linear equations to determine the approximate y values.

Using a Numerical Software to solve the system of Linear equations


y1 = -26.5 KN.m3 /EI
y2 = -45 KN.m3 /EI
y3 = -51.75 KN.m3 /EI
y4 = -45 KN.m3 /EI
y5 = -26.5 KN.m3 /EI

4. Determine the actual values and Calculate the percent Error


Using Double Integration Method
EI y = 1.5x3 - 0.125x4 – 27x KN.m3
x(m) M(KN-m) y(FDM) y(Actual) %Error
0 0 0 0 0
1.0 7.5 -26.50 -25.625 3.41
2.0 12 -45.00 -44.000 2.27
3.0 13.5 -51.75 -50.625 2.22
4.0 12 -45.00 -44.000 2.27
5.0 7.5 -26.50 -25.625 3.41
6.0 0 0.0 0.0 0

Note : The higher the subdivisions(n value) the lower the %Error

Finite Difference Method for ODE with boundary value problem page 3 of 4
Self Assessment(Problem Set) :

P1. Estimate the deflection in the simply-supported


beam shown. Use FDM. Assume constant EI
and neglect the weight of beam. Use n such that %Error ≤ 1% .

References :
1. Applied Numerical Methods with MATLAB for Engineers and Scientist
Steven C. Chapra, McGraw Hill International Edition c.2005

2. Elementary Numerical Analysis 3rd Edition


Kendall Atkinson &Weimin Han, John Wiley and Sons c.2004

3. Numerical Methods for Engineers 5th Edition


Steven C. Chapra & Raymond P. Canale, McGraw Hill International Edition c.2006

Finite Difference Method for ODE with boundary value problem page 4 of 4

You might also like