8/10/2019 Chapter C Finite Difference Method
1/22
Professor Christopher Chukwutoo Ihueze(B.Eng,M.Eng,Ph.D.)
Department of industrial and production engineering,
Nnamdi Azikiwe University,Awka
Faculty of Engineering,Nnamdi Azikiwe University,Awka
8/10/2019 Chapter C Finite Difference Method
2/22
Lecture Note: this lecture note is available for download in pdfformat at www.ccihueze.com.
Recommended Textbooks:
Grading: Attendance (10%)
Bi-Weekly homework (12%)
Midterm (28%)
Final Exam (50%)
This chapter involves formation of difference equation, Meshing
and difference equation formulation,
http://www.ccihueze.com/http://www.ccihueze.com/http://www.ccihueze.com/http://www.ccihueze.com/8/10/2019 Chapter C Finite Difference Method
3/22
Introduction
Finite Difference Modelling means discretizing a field
function and deriving a difference equation of thefunction or model to be approximated
A differenceequation model of a
field function is
passed through
interior mesh pointsof a region to
establish a system of
equations
8/10/2019 Chapter C Finite Difference Method
4/22
8/10/2019 Chapter C Finite Difference Method
5/22
Meshing and difference equation formulation
h 2h
10h
h
8h
Figure 1: Finite differencemodel of a field region
Supposing
represents a regular partition of interval [a,b]
Where I = 0. 1 2, ., n and
The points
are called interior mesh points of the interval [a,b]
By expressing differential equation as
and by letting
8/10/2019 Chapter C Finite Difference Method
6/22
Meshing and difference equation formulation CONTINUES
So that equation (4) becomes
Or by rearrangement
Equation (10) gives the finite difference equation which is an
approximation to the differential equation.
and by replacing by their central difference approximations derived as
8/10/2019 Chapter C Finite Difference Method
7/22
8/10/2019 Chapter C Finite Difference Method
8/22
Example B.1 CONTINUES
Eq(3) is re-written in the form of eq(1),
It is recognized that
Substituting into the difference equation (2) and simplifying gives
Interior points are as given as,
8/10/2019 Chapter C Finite Difference Method
9/22
Which on substitution into equation (5) for i= 1, 2, 3, 4, 5, 6, 7 results in
the system of equations
Example B.1 CONTINUES
This can be put in matrix form,
Where A is the matrix of coefficients, Y is the solution vector and B is acolumn matrix of constants. If each side of equation 6 is multiplied by
then
The matrices are as displayed below
8/10/2019 Chapter C Finite Difference Method
10/22
Example B.1 CONTINUES
Thus
This becomes
8/10/2019 Chapter C Finite Difference Method
11/22
Example B.1 CONTINUES
The matrix multiplication results in the solution vector Ybeing equal to
The solution by finite difference method to the boundary value problem
is presented in tabular form Table 1:
i xi yi
1 1.125 -0.19852 1.250 -0.4165
3 1.375 -0.6507
4 1.500 -0.8988
5 1.625 -1.1591
6 1.750 -1.42987 1.875 -1.7103
8/10/2019 Chapter C Finite Difference Method
12/22
B: SOLUTION OF LAPACE EQUATION
Example B. 2:Approximate the solution of a Laplace equation subject to the following
boundary conditions;
Use the difference equation of Laplace equation as
SOLUTION: The problem is thus graphically presented
11u
21u
12u
22u
x
y
0
0 0
0
0
0
8
16The finite difference equation applicable to
this boundary value problem (Laplace
equation) is
Application of equation (1) results in a system of linear equations put in
matrix form as
8/10/2019 Chapter C Finite Difference Method
13/22
By employing Gauss-Seidel scheme
B: SOLUTION OF LAPACE EQUATION Continues
U0 U1 U2 U3 U4 U5 U6 U7 U8 U9 U10 U11 U12
6 6 4.75 4.25 3.938 3.813 3.734 3.703 3.684 3.676 3.671 3.669 3.668
4 3.5 2.5 1.875 1.625 1.469 1.406 1.367 1.352 1.342 1.338 1.335 1.334
12 7.5 6.5 5.875 5.625 5.469 5.406 5.367 5.352 5.342 5.338 5.335 5.334
8 4 2.75 2.25 1.938 1.813 1.734 1.703 1.684 1.676 1.671 1.669 1.668
The solution thus becomes
8/10/2019 Chapter C Finite Difference Method
14/22
B: SOLUTION OF LAPACE EQUATION Continues
Example B.3:Solve the Laplace equation subject to the boundary conditions
SOLUTION: For better picture the interior points and boundary conditionsare depicted thus
y
x
25
50
75
50 7525
13u 23u
33u
12u 22u 32u
11u
21u 31u
0
0
0 0 0
0
A mesh size h(=1/4)utilized in equation(B.1), the
system of equations that results put in matrix form
is
l B 3 i
8/10/2019 Chapter C Finite Difference Method
15/22
Example B.3: continues
By employing Gauss-Seidel schemeU0 U1 U2 U3 U4 U5 U6 U7 U8 U9 U10 U11 U12 U13 U14 U15 U16 U17 U18 U19
6 6.25 6.38 8.61 6.41 7.46 6.33 6.86 6.30 6.56 6.28 6.4 6.384 6.325 6.317 6.288 6.283 6.269 6.267 6.259
13 12.75 17.25 12.81 14.92 12.18 13.12 12.59 13.11 12.55 12.80 12 .57 8 1 2. 65 1 2. 61 12 .57 5 1 2. 56 4 1 2. 538 12 .5 33 1 2. 51 9 1 2. 517
20 19.5 19.13 21.20 18.94 19.97 18.85 19.36 18.80 19.05 18.88 1 8. 9 1 8. 789 18 .8 25 18 .80 5 1 8. 78 8 1 8. 782 18 .7 69 1 8. 76 7 1 8. 759
12 12.75 17.19 12.81 14.92 12.68 13.72 12.59 13.11 12.55 12.80 12 .95 8 1 2. 65 12 .6 58 12 .57 5 12 .57 1 2. 538 12 .5 34 1 2. 51 9 1 2. 517
25 43.25 25.75 29.88 25.38 27.44 25.19 26.22 25.1 25.59 25.15 2 5. 3 2 5. 268 2 5. 15 25 .13 4 2 5. 07 5 2 5. 067 25 .0 38 2 5. 03 3 2 5. 019
40 38.75 42.57 37.94 39.96 37.70 38.72 37.60 38.07 37.55 37.80 37 .57 8 3 7. 65 3 7. 61 37 .57 5 3 7. 56 4 3 7. 538 37 .5 33 3 7. 51 9 3 7. 517
20 19.25 19.13 21.17 18.94 19.97 18.85 19.36 18.80 19.05 20.40 1 8. 9 1 8. 979 18 .8 25 18 .82 9 1 8. 78 8 1 8. 785 18 .7 69 1 8. 76 7 1 8. 759
40 38.75 42.5 37.94 39.96 37.70 38.72 37.60 38.07 37.55 37.80 37 .95 8 3 7. 65 37 .6 58 37 .57 5 37 .57 3 7. 538 37 .5 34 3 7. 51 9 3 7. 517
60 57.5 56.88 58.77 56.47 57.48 56.35 56.86 56.30 56.54 56.28 5 6. 4 5 6. 384 56 .3 25 56 .31 7 5 6. 28 8 5 6. 283 56 .2 69 5 6. 26 7 5 6. 259
The solution vector is thus displayed
B SOLUTION OF LAPACE EQUATION C i
8/10/2019 Chapter C Finite Difference Method
16/22
Example B.4:
Solve Example B.3 but with a modified boundary condition as
B: SOLUTION OF LAPACE EQUATION Continues
The boundary conditions together with the interior mesh points are as
depicted in the diagram below
11p
21p
31p
33p
13p
12p 22p 32p
23p
y
x
20
20
40
50
60
70
20
20 4010
10 30
With a mesh size of 0.25, the use of equation B.1
results in the system of equations;
By employing Gauss-Seidel schemeU0 U1 U2 U3 U4 U5 U6 U7 U8 U9 U10 U11 U12 U13 U14 U15 U16 U17 U18
27.5 27.5 25.627 24.844 23.907 23.398 22.93 22.661 22.427 22.291 22.173 22.105 22.047 22.012 21.983 21.966 21.951 21.936 21.931
35 35 33.75 32.188 31.211 30.313 29.78 29.316 29.045 28.811 28.675 28.557 28.489 28.431 28.396 28.367 28.35 28.327 28.319
42.5 42.5 41.875 40.938 40.156 39.629 39.18 38.909 38.677 38.54 38.423 38.355 38.297 38.262 38.233 38.216 38.201 38.186 38.181
45 37.5 35.625 33.438 32.383 31.406 30.864 30.391 30.118 29.883 29.746 29.629 29.561 29.502 29.468 29.438 29.421 29.398 29.391
50 45 41.25 39.063 37.188 36.094 35.156 34.609 34.141 33.867 33.633 33.496 33.379 33.311 33.252 33.218 33.188 33.157 33.148
55 52.5 50 48.438 47.305 46.406 45.854 45.391 45.117 44.883 44.746 44.629 44.561 44.502 44.468 44.438 44.421 44.398 44.391
32.5 30 26.875 25.625 24.531 23.965 23.477 23.201 22.964 22.827 22.709 22.641 22.582 22.548 22.519 22.502 22.487 22.471 22.467
45 40 36.875 34.688 33.477 32.5 31.938 31.465 31.19 30.955 30.818 30.7 30.632 30.573 30.539 30.51 30.493 30.47 30.462
57.5 52.5 50.625 49.219 48.281 47.695 47.227 46.948 46.714 46.577 46.459 46.391 46.332 46.298 46.269 46.252 46.237 46.221 46.217
The solution matrix becomes
B SOLUTION OF LAPACE EQUATION C ti
8/10/2019 Chapter C Finite Difference Method
17/22
B: SOLUTION OF LAPACE EQUATION Continues
Example B.5:Derive the finite difference equation replacement for the Poisson equation
SOLUTION: For square discretization of a plane
then the poisson equation becomes
Equation ( b1) is re-written in subscript form to become
8/10/2019 Chapter C Finite Difference Method
18/22
B SOLUTION OF LAPACE EQUATION C ti
8/10/2019 Chapter C Finite Difference Method
19/22
Approximate the solution of the Poisson equation
B: SOLUTION OF LAPACE EQUATION Continues
subject to the boundary condition
Solution: The boundary condition is displayed graphically as thusy
x
0
0
0
0 00
13u 23u
12u 22u 32u
11u
21u 31u
0
0
0 0 0
0 0
Making use of the derived difference equation(B.2), with fij = -64 the applicable finite
difference equation becomes
Equation 8.1 evaluated at the interior mesh points results in the system
of linear equations
Example B.6:
E l B 6 ti
8/10/2019 Chapter C Finite Difference Method
20/22
To preclude monotony of method the above system is solved by the use of
Cramers rule as presented below;
Example B.6 continues
To conserve space a compact notation could be use for the Cramers rule to
obtain the remaining solutions. For example
Where
8/10/2019 Chapter C Finite Difference Method
21/22
Example B.6 continues
The solution vector becomes
8/10/2019 Chapter C Finite Difference Method
22/22
GOO LU K