You are on page 1of 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

This chapter involves formation of difference equation, Meshing


and difference equation formulation,

Lecture Note: this lecture note is available for download in pdf


format at www.ccihueze.com.

Recommended Textbooks:

Grading:
Attendance (10%)
Bi-Weekly homework (12%)
Midterm (28%)
Final Exam (50%)

Introduction
Finite Difference Modelling means discretizing a field
function and deriving a difference equation of the
function or model to be approximated

A difference
equation model of a
field function is
passed through
interior mesh points
of a region to
establish a system of
equations

FORMATION OF DIFFERENCE EQUATION:


DERIVATION OF CENTRAL DIFFERENCES OF FUNCTIONS
By employing Taylor series approximation of a function y(x) the following finite
difference for derivatives of function y(x) can be expressed

So that

When h is small, we can ignore its higher powers terms

By subtracting (1) and (2)

By adding (1) and (2)

The expression of (5) and (6) are referred to as central differences of the derivatives of the
function y(x).

Meshing and difference equation formulation


Supposing

8h

represents a regular partition of interval [a,b]

Where I = 0. 1 2, ., n and
h
h

The points

2
h

10h

Figure 1: Finite difference


model of a field region

are called interior mesh points of the interval [a,b]


By expressing differential equation as

and by letting

Meshing and difference equation formulation CONTINUES

and by replacing by their central difference approximations derived as

So that equation (4) becomes

Or by rearrangement

Equation (10) gives the finite difference equation which is an


approximation to the differential equation.

SOLUTION OF INITIAL VALUE PROBLEMS


Example B.1: Solve the following boundary value problem

Solution: Given that for a general linear second order boundary value
problem,

The finite difference equation is,

Then the application of the finite difference method with n = 8 to the


solution of the boundary value problem,

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,

Example B.1 CONTINUES

Which on substitution into equation (5) for i= 1, 2, 3, 4, 5, 6, 7 results in


the system of equations

This can be put in matrix form,

Where A is the matrix of coefficients, Y is the solution vector and B is a


column matrix of constants. If each side of equation 6 is multiplied by
then
The matrices are as displayed below

Example B.1 CONTINUES

Thus

This becomes

Example B.1 CONTINUES

The matrix multiplication results in the solution vector Y being 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.1985
2
1.250
-0.4165
3
1.375
-0.6507
4
1.500
-0.8988
5
1.625
-1.1591
6
1.750
-1.4298
7
1.875
-1.7103

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

The finite difference equation applicable to


this boundary value problem (Laplace
equation) is

16
8

u12

u 22

u11

u 21

Application of equation (1) results in a system of linear equations put in


matrix form as

B: SOLUTION OF LAPACE EQUATION Continues


By employing Gauss-Seidel scheme
U0 U1
6

U2
6 4.75

4 3.5

U4

U5

U6

U7

U8

U9

U10

U11

U12

4.25 3.938 3.813 3.734 3.703 3.684 3.676 3.671 3.669 3.668

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
8

U3

4 2.75

5.875 5.625 5.469 5.406 5.367 5.352 5.342 5.338 5.335 5.334
2.25 1.938 1.813 1.734 1.703 1.684 1.676 1.671 1.669 1.668

The solution thus becomes

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 conditions
are depicted thus
y

A mesh size h(=1/4)utilized in equation(B.1), the


system of equations that results put in matrix form
is

25

50

75

u13 u 23 u33

75

u12 u22 u32

50

u11 u 21 u31

25

Example B.3: continues


By employing Gauss-Seidel scheme
U0
6

U1
6.25

U2
6.38

U3
8.61

U4
6.41

U5
7.46

U6
6.33

U7
6.86

U8
6.30

U9
6.56

U10
6.28

13

12.75

17.25

12.81

14.92

12.18

13.12

12.59

13.11

12.55

12.80

20

19.5

19.13

21.20

18.94

19.97

18.85

19.36

18.80

19.05

12

12.75

17.19

12.81

14.92

12.68

13.72

12.59

13.11

25

43.25

25.75

29.88

25.38

27.44

25.19

26.22

40

38.75

42.57

37.94

39.96

37.70

38.72

20

19.25

19.13

21.17

18.94

19.97

40

38.75

42.5

37.94

39.96

60

57.5

56.88

58.77

56.47

U11

U12

U13

U14

U15

U16

U17

U18

U19

6.4

6.384

6.325

6.317

6.288

6.283

6.269

6.267

6.259

12.578

12.65

12.61

12.575

12.564

12.538

12.533

12.519

12.517

18.88

18.9

18.789

18.825

18.805

18.788

18.782

18.769

18.767

18.759

12.55

12.80

12.958

12.65

12.658

12.575

12.57

12.538

12.534

12.519

12.517

25.1

25.59

25.15

25.3

25.268

25.15

25.134

25.075

25.067

25.038

25.033

25.019

37.60

38.07

37.55

37.80

37.578

37.65

37.61

37.575

37.564

37.538

37.533

37.519

37.517

18.85

19.36

18.80

19.05

20.40

18.9

18.979

18.825

18.829

18.788

18.785

18.769

18.767

18.759

37.70

38.72

37.60

38.07

37.55

37.80

37.958

37.65

37.658

37.575

37.57

37.538

37.534

37.519

37.517

57.48

56.35

56.86

56.30

56.54

56.28

56.4

56.384

56.325

56.317

56.288

56.283

56.269

56.267

56.259

The solution vector is thus displayed

B: SOLUTION OF LAPACE EQUATION Continues


Example B.4:
Solve Example B.3 but with a modified boundary condition as

The boundary conditions together with the interior mesh points are as
y
depicted in the diagram below
10

With a mesh size of 0.25, the use of equation B.1


results in the system of equations;

20

40
20

By employing Gauss-Seidel scheme


U0

U1

U2

U3

U4

U5

U6

U7

U8

U9

U10

U11

U12

U13

U14

20

40

p13 p23

p33

70

p12 p22

60

p11 p21

p32
p31

10

30

20

U15

U16

50

x
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 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

Equation ( b1) is re-written in subscript form to become

becomes

B: SOLUTION OF LAPACE EQUATION Continues

Example 8:
To solve the equation

using a mesh size h(=1/4) subject to some given boundary conditions


y
depicted in the diagram below;
0 0
0
0
Solution: Application of equation (1) of B.5 leads
to the equation

0 .5

u14 u24

u34 u 44

u33 u 43

1
1

For i =1,2,3,4 and j=1,2,3,4 equation7.3 results


in the system of equations

Solution by Gauss-Seidel iteration scheme leads to

0
0

u42

u 41

B: SOLUTION OF LAPACE EQUATION Continues

Example B.6:

Approximate the solution of the Poisson equation


subject to the boundary condition

Solution: The boundary condition is displayed graphically as thus


y
0

Making use of the derived difference equation 0


(B.2), with fij = -64 the applicable finite
0
difference equation becomes
0

u13 u 23

u 22

u32

u11 u 21

u31

u12
0

Equation 8.1 evaluated at the interior mesh points results in the system
of linear equations

Example B.6 continues


To preclude monotony of method the above system is solved by the use of
Cramers rule as presented below;

To conserve space a compact notation could be use for the Cramers rule to
obtain the remaining solutions. For example
Where

Example B.6 continues

The solution vector becomes

GOODLUCK

You might also like