What is numerical differentiation?
What is finite difference?
How to apply that to boundary value problems?
#WikiCourses #Num001
https://wikicourses.wikispaces.com/Topic+Boundary+Value+Problems+-+Finite+Difference
This PowerPoint helps students to consider the concept of infinity.
Boundary Value Problems - Finite Difference
1. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Boundary Value Problems
Mohammad Tawfik
2. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Objectives
• Applying finite difference as a numerical
method for differentiation
• Solve a Boundary Value Problem using
finite difference method
• Applying weighted residual methods for
the solution of BVP’s
3. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Numerical Differentiation
4. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Numerical Differentiation
• In most of the practical applications, the
differentiation of the function does not present a
great challenge!
• In some cases, the differentiation becomes very
expensive in terms of the computational
requirements
• If you are using the computer, you need to teach
it how to differentiate!!!
• If the function is given in the form of a table,
what are you going to do?!
5. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Numerical Differentiation
• In the previous lectures, we learned that the
slope of the function may be approximated by a
difference expression
• Recall, the parachutist:
• Note that this evaluates the derivative at the
starting point in terms of what is going to happen
in the future!
12
12
tt
vv
t
v
dt
dv
6. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Forward Difference
• When you evaluate the slope at some
point in terms of the value of the function
at higher values of time/space, then we
call this forward difference
t
vv
tt
vv
dt
dv
tt
12
12
12
1
7. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
How about the second derivative?
• The second derivative of a function is
defined as the rate of change of slope.
121
1
2
2
tttttt
dt
dv
dt
dv
tdt
vd
8. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Substitute for the 1st derivative
121
1
2
2
tttttt
dt
dv
dt
dv
tdt
vd
t
vv
t
vv
tdt
vd
tt
1223
2
2
1
1
2
123
2
2
2
1
t
vvv
dt
vd
tt
9. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Backward Difference
• When you evaluate the slope at some point in
terms of the value of the function at lower
values of time/space, then we call this backward
difference
• Note that this is the same formula for the forward
difference!
t
vv
tt
vv
dt
dv
tt
21
21
21
2
10. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
How about the second derivative?
• The second derivative of a function is
defined as the rate of change of slope.
212
1
2
2
tttttt
dt
dv
dt
dv
tdt
vd
11. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Substitute for the 1st derivative
212
1
2
2
tttttt
dt
dv
dt
dv
tdt
vd
t
vv
t
vv
tdt
vd
tt
2110
2
2
1
2
2
210
2
2
2
2
t
vvv
dt
vd
tt
12. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Central Difference
• If you know some information about the
previous and the upcoming points, why
don’t you make use of it?
t
vv
tt
vv
dt
dv
tt
2
02
02
02
1
2
012
2
2
2
1
t
vvv
dt
vd
tt
13. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Applications
Finite Difference
14. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Finite Difference
• The finite difference is a direct application
of the numerical differentiation.
• Substitute each derivative in a DE by its
FD equivalent to transform the differential
equation into difference equation
15. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Example: The Parachutist
• The DE is:
• Applying the FD
relation:
• You get the
Euler formula!
m
cvmg
v
m
cv
g
t
vv
dt
dv
12
m
cv
gtvv 1
12
16. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Example: Heat transfer problem
dx
q1=-kAdT/dx
q2=q1+(dq1/dx)dx
q3=hPdx(T-Ta)
Tin Tout
0 L x
Ta
d2T/dx2 - b2 T = -b2Ta
Area A
Perim. P
(b2 = hP/kA)
We need 2 conditions: T(0) = Tin; T(L) = Tout
Conditions at 2 boundaries: Boundary value problem
17. Boundary Value Problems – Finite Difference
Mohammad Tawfik
#WikiCourses
http://WikiCourses.WikiSpaces.com
Finite difference methods
Discretize into n sub-domains
0 x1 x2 xn=Lxn-1
(equidistant for simplicity)
Approximate derivatives using neighboring points
d2T/dx2|i (Ti-1-2Ti+Ti+1)/h2
h
Apply equation at each internal point:
(Ti-1-2Ti+Ti+1)/h2 - b2 Ti = -b2 Ta Solve n-1 equations in n-1 unknowns