Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

CHAPTER-3

Finite Differences and their Applications

1.1 Introduction
Most frequently engineering problems are represented by
diff
differential
i l equations,
i
f which
for
hi h exact solutions
l i
are generally
ll not
available.
Numerical treatment of such equations can yield approximate
results, acceptable for most practical purposes.
Numerical methods for the solution of differential equations
have become popular in the recent years because of the easy
availability of electronic digital computers.
One of these numerical methods is the Finite Difference
Method

1.2 Differentiation Formulas By


y Interpolating
p
g
Parabolas
The simplest way of obtaining approximate expressions for the
derivatives of a function y(x) at some pivotal point i, consists in
substituting for the function y a parabola passing through a certain
number of pivotal points, and in taking the derivatives of the
parabola as a approximate values of the derivates of y.
To determine the difference form of the derivative of y, when y is
known at three points i-1,i and i+1 evenly spaced by the interval h
on the x-axis and denoting the corresponding ordinates at these
points as yi 1 , yi , yi +1
pass the quadratic parabola through these
points (Fig.1). Choose origin at point I, we obtain

y = Ax 2 + Bx + c

((1))

y=A
Ax 2 + Bx
B +C

y(x )

y i 1

yi

h
i1

y i +1

h
i

Fig.1 Interpolating parabola

i+1

y ( h ) = yi 1 = Ah 2 Bh + C

y (0 ) = yi = C

y (h ) = yi +1 = Ah 2 + Bh + C

From which

y i 1 2 y i + y i + 1
A=
2h 2
y i + 1 y i 1
B=
2h
C = yi

The first derivative of y at i is given by the following relation

yi + i yi 1
dy
yi =
=B=
dx i
2h

(2)

2
yi i 2 yi + yi + i
d
y
''

y i = 2 = 2A =
d x i
h2

(3)

'

Analogous expressions for higher order derivatives may be


obtained by means of higher degree interpolating parabolas.
Pass a cubic parabola through the i 1, i, i + 1, i + 2 points and
again choose origin at i.

y = Ax 3 + Bx 2 + Cx + D

(4)

y ( h ) = yi 1 = A.h 3 + B.h 2 C.h + D

y (0) = yi = D

y (h ) = yi +1 = A.h 3 + B.h 2 + C.h + D

y (2h ) = yi + 2 = 8 A.h 3 + 4 B.h 2 + 2C.h + D

The third derivative of y at i is given by


3
yi i + 3 yi 3 yi + i + yi + 2
d
y
' ''
y i = 3 = 6A =
h3
dx i

(5)

1.3 Backward,, Forward and Central Differences


Fig.2
Fi 2 represents
t a function
f ti
y=f(x)
f( ) in
i which
hi h equally
ll spacedd
abscissa

x1 , x2 , x3 , ....., xi 1 , x1 , xi +1 ,......, xn 2 , xn 1 , xn

y1 , y2 , y3 , ....., yi 1 , y1 , yi +1 ,......, yn 2 , yn 1 , yn their


corresponding ordinates respectively are known at equal intervals
of h.

r3

r1 r2

h h
1

ri 1

ri ri +1

h h
3

i 1 i i +1

rn i

rn 2

rn

h h
n 2 n 1 n

Fig.2 Evenly spaced pivotal points

The first backward difference is defined as

yi = yi yi 1

(6)

Similarly ,the
the second and the higher order backward differences
can be written as

2 yi = yi yi 1 = ( yi yi-1 ) - ( yi-1 yi-2 )


= yi - 2 yi-1 + yi-2

n yi = n 1 yi n 1 yi 1 = n 1 yi

((7))

It may be observed that each difference is obtained by subtracting


two adjoining differences in Table 1 . The nodal points are used in
descending order

Table 1
Backward Differences

x
xi

yi

x i 1

y i 1

xi 2

yi 2

xi 3

yi 3

xi 4

yi 4

yi

y i 1
yi 2
yi 3

y
2

2 yi
2 y i 1
2 yi 2

3 y

3 yi

3 y i 1

4 y

4 yi

In an analogous manner, forward differences can be derived.


Th
These
are given
i
below
b l

yi = yi +1 yi

(8)

Similarly, second and the higher order differences can be


written as
2 y i = ( y i ) = y i + 2 - 2 y i + 1 + y i
....

....

(9)

n y i = n 1 y i + 1 n 1 y i = n 1 y i

The nodal points in forward differences are in the ascending


order.
To relate the derivatives of y with the differences, consider the
Taylors, expansion of y(x + h) about x:

h '
h 2 ''
h 3 '''
y(x + h ) = y(x ) + y (x ) +
y ( x ) + y ( x ) + ......
1!
2!
3!

(10)

Using the powers of D to indicate the derivates of y,


h
h2 2
h3 3
y ( x + h ) = y ( x ) + Dy (x ) + D y ( x ) + D y ( x ) + ......
1!
2!
3!
h

h 2 2 h3 3
= 1 + D + D + D + ...... y (x )
2!
3!

1!

(11)

= e hD y ( x )

Substituting x = xi and indicating y (xi + h ) = yr


yr = e hD yi

(12)

In the case of forward differences


yi = yr yi

(13)

= e hD y i y i

= e hD 1 y i
e
= 1+
Takingg logg on both the sides
hD

2 3 4
hD = Log(1 + ) = + + ...
2 3 4

(14)

(15)

Taking powers on both sides we obtain


4
5
11

h 2 D 2 = 2 3 +

+ ...
12
6
34 7 5
3 3
3
h D = +

+ ...
2
4
17 6
4 4
4
5
h D = 2 +
+ ...
6

((16))

But in the case of backward differences,, changing


g g h into h in
Eq.(12) we have
x = xi

y ( xi + h ) = yr

(17)

y1 = e hD yi

Proceeding
di in
i the
h same manner, we obtain
b i
2 3 4
hD = +
+
+
+ ...
2
3
4
11 4
2 2
2
3
h D = + +
+ ...
12
3 4 7 5
3 3
3
h D = +
+
+ ...
4
2
6
17

h 4 D 4 = 4 + 2 5 +
+ ...
6

(18)

Table.2
Schematic representation of Backward and Forward Difference Expressions

TYPE

ri k

COEFFICIENTS

i 1

i 4 i3

BACKWARD

i 2

r1 '

1/ h

ri ''
ri '''

1/ h2

ri ''''

1/ h4

r1 '

1/ h

i
1

i+1
1

ri ''
ri '''

1/ h2

1 / h3

ri ''''

1/ h4

1 / h3

FORWARD

i 2 i3

i 4

Central Difference
Central differences involving pivotal points symmetrically
located with respect to I,
I are more accurate than backward or
forward differences.
For intermediate points,
points we use average of the subscripts of the
points forming the differences.
y(x)) at I is defined byy
Thus the first order central difference of y(

yi = y

1
i+
2

1
2

yi +1 + yi yi + yi 1
=

2
2

1
= ( yi +1 yi 1 )
2

(19)

The second central difference at I is the difference of the first


differences.

yi = (yi ) = y 1 y 1 y 1 y 1
i 1 / 2
i +1 / 2
i + 2 +1/ 2

i + 2 1/ 2
2
2
(20)
= yi +1 2 yi + yi 1
2

n
n 1
(

y
=

yi )
The nth central difference is defined by
i

rr

h/2

ri

r1

r11
h/2

11 1 1 / 2

h/2

h/2

1 i 1/ 2

rrr

h/2

i +1/ 2

h/2 h/2

x
r r + 1 / 2 rr

Fig.3 Pivotal points for central differences

Table 3
Central Differences

xi 2

yi 2

x i 1

y i 1

xi

yi

x i +1

y i +1

xi + 2

yi + 2

yi 3 / 2
y i 1 / 2
y i +1 / 2

yi + 3 / 2

y
2

2 y i 1
2 yi
2 y i +1

3y

3 y i 1 / 2
3 y i +1 / 2

4y

4 yi

TTable
bl 4
Schematic representation of Central Difference Expressions

r i (k )

COEFFICIENTS

i 2

i 1

r1 '

1 / 2h

ri ''
ri '''

1/ h2

1 / 2h 3

ri ''''

1/ h4

1
2

2
4

i+1 i + 2

1
2

1.4 Derivation of Differential formulas using


Taylors series
It is possible to get derivatives of y in terms of the difference
expressions by use of Taylors series expansion around the point
x=a
2
(
x a ). y ' (a ) ( x a ) . y '' (a )
y ( x ) = y (a ) +
+
+ ...

1!

(21)

2!

To obtain (y '' )i , evaluate the series for the ppoints x = xi 1 , x = xi +1


h. y 'i h 2 . y ''i h 3 . y '''i
yi +1 = yi +
+
+
+ ...
1!
2!
3!
h. y 'i h 2 . y ''i h 3 . y '''i
yi 1 = y1
+

+ ...
1!
2!
3!

(22)
(23)

1 5 Boundary Conditions
1.5
Solution of the governing equilibrium equations for beams,
plates
l
or any other
h engineering
i
i
problem
bl
b finite
by
fi i difference
diff
method requires proper finite difference representation of the
boundaryy conditions.
Consequently the derivatives at the boundaries are to be
replaced by finite difference expressions which require the
i t d ti off fictitious
introduction
fi titi
points
i t outside
t id the
th boundaries.
b
d i
The boundaries may be fixed, simply supported, completely
free or mixed type.
yp
The finite difference expressions for different boundary
conditions or the relations of fictitious points to inner points are
d i d
derived.

Fixed boundaryy
A fixed end in beam or plate has deflection and the slope zero
yi = 0

1
dy
( yi +1 yi 1 ) = 0
=

dx i 2h

(24)

yi +1 = yi 1

Simply
p y supported
pp
The boundary condition representing a simple support has
deflection and bending moment is directly proportional to the
second derivative of the deflection
d 2 y yi +1 2 yi + yi 1
=
=0
2
2
dx i
h
yi 1 = yi +1

(25)

Free end
The free end has always bending moment, i.e., the second
derivative and the shear force, i.e., the third derivative zero. The
ordinates
di t off deflection
d fl ti att fictitious
fi titi
points
i t can be
b expressedd in
i
terms of inner points of the beam.
d 2 y yi +1 2 yi + yi 1
2 =
=0
2
h
dx i
yi +1 = 2 yi yi 1
d 3 y yi 2 + 2 yi 1 2 yi +1 + yi + 2
3 =
=0
3
2h
dx i

(26)

1.6 Beam deflection


To illustrate the application of finite difference method to
engineering problems,
problems let us consider a simple beam of uniform
flexural rigidity EI simply supported over the span L.
Th beam
The
b
i loaded
is
l d d with
i h a uniformly
if
l distributed
di ib d load
l d off
intensity q per unit length.
The transverse deflection y is given by the following differential
equation.

d4y
EI 4 = q
dx

(27)

The differential equation (27) can be written in the difference


form as
q.h 4
(28)
y i + 2 4 y i +1 + 6 y i 4 y i 1 + y i 2 =
EI
Since, both ends of the beam are simply supported, we have
y x = 0 = 0 and y x = L = 0

d2y
2 = 0
dx x = 0

d2y
2
=0
dx x = L

(29)

Considering the beam to be divided into 4 equal parts with

g ,
interval h=L/4 and numberingg the ppivotal ppoints as shown in fig.3,
the differential equation (b) can be written at each pivotal point
where the deflection ordinates are unknown quantities.
quantities

Point 1:

q.h 4
y1 4 y0 + 6 y1 4 y2 + y3 =
EI

(30)

Point 2:

q.h 4
y0 4 y1 + 6 y2 4 y3 + y4 =
EI

(31)

Point 3:

q.h 4
y1 4 y2 + 6 y3 4 y4 + y5 =
EI

(32)

From the end conditions in equation (29), we obtain

y0 = 0

y4 = 0

y1 = y1

y5 = y3

(33)

Solving
S l i the
h above
b
equations
i
we get
5 qL4
y1 =
512 EI

7 qL4
y2 =
512 EI

5 qL4
y3 =
512 EI

The exact solution at the mid-span is

5 qL4
.
y2 =
whereas
512 EI

the

finite difference solution by considering beam into 4 parts, is


5.25 qL4
y2 =
.
512 EI

and
d suchh a percentage
t
error is
i 5%.
5% By
B increasing
i
i the
th

number of subintervals, the error can be reduced to a large extent.

1.7 Solution of characteristic value problems


p
Consider the Euler buckling problem of a simply supported
beam as shown in Fig.4, acted upon by compressive axial force P.
The beam is of uniform cross section throughout.
The deflection of the axis of the beam are governed by the
following characteristic problem.
P

P
L

P ''
y +
y =0
EI
iv

((34))

The differential equation


q
((34)) can be written in the difference
form as:
yi + 2 4 yi +1 + 6 yi 4 yi 1 + yi 2 P yi +1 2 yi + yi 1
+
.
=0
4
2
(35)
h
EI
h
Let n=L/n and simplifying Eq.(35)
P.L2
yi + 2 4 yi +1 + 6 yi 4 yi 1 + yi 2 + 2 . yi +1 2 yi + yi 1 = 0
n EI
Put

(36)

PL2
=K
EI

Eq.(36)
Eq (36) can be rewritten as
2K
K

yi + 2 + 2 4 yi +1 + 6 2 yi + 2 4 yi 1 + yi 2 = 0
n
n

(37)

The boundary conditions for the problem shall be:


y (0) = y '' (0 ) = y (L ) = y '' (L ) = 0

Which means y x =0 , L = 0
Approximation

(38)

y n +1 = y n 1 at both the ends

(39)

n=2
0

3 h = L/2

upon solving Eq. (d) and using the boundary conditions we get
the value of K
(40)
K 2=8

Approximation

n=3
0

3 h = L/3
L/3

L/3

L/3

K 3=9
Approximation

(41)

n=4
0

3 h = L/4
L/4

L/4

L/4

K 4=9.367

L/4

(42)

The smallest root is K 4=9.367

9.367 EI
Pcr =
L2

(43)

9.8775 EI
The exact value of Pcr =
and this gives an error of
L2
5%

1.8 Richardsons Extrapolation


The approximate values of the functions obtained by using two

different sets of subintervals can be improved by Richardsons


extrapolation.
Assuming A as the true value of the unknown function and An1

and An2, the approximate values obtained by using n1 and n2


subintervals
bi t
l respectively.
ti l
The error e(x) can be written in series form as

e( x ) = f1 ( x ).h 2 + f 2 ( x ).h 4 + f 3 ( x ).h 6 + ....

(44)

When the expression evaluated by the differences is independent


of x, the error series has constant coefficients and may be written
as
e = c1h 2 + c2 h 4 + c3 h 6 + ....

Let

h1 =

ba
n1

and h2 =

ba
n2

Taking first term of the series only we have


c1 (b a )
e1 = A An1 =
n12

c1 (b a )
e2 = A An 2 =
n22

Where (b-a) is the total interval or the limits

(45)

((46))

Eliminating the unknown constants from the two equations and


solving for true value of A, we obtain the
- extrapolation
h2
formula.
An1,n 2

n22
n12
= 2
. An 2 2
. An1
2
2
n2 n1
n2 n1

(47)

Where An1,n 2 is an improved extrapolated value from An1 and An 2


And gives better approximation of A.

1.9 Use of Unevenly Spaced Pivotal Points


Consider
C id a simply
i l supported
t d column
l
as shown
h
i Fig.4,
in
Fi 4 acted
t d
upon by compressive axial force P. The governing differential
equation is given by
P
.y = 0
EI
y (0) = y (L ) = 0
y '' +

(49)

I0

0 .4 I 0

(48)

0.2 L

0 .4 I 0

0.2 L

0.6 L
L

0.15 L

0.2 L

0.3L

0.2 L

0.15 L

The beam is unevenly


y divided into parts
p
as shown in Fig.4
g
Since the spacing between pivotal points varies from point to
point the second derivative of y at I can be written as
1
2
[yi 1 (1 + )yi + yi +1 ]
y = 2.
h ( + 1)
x x
h = xi x1
= i +1 i
xi xi 1
For the g
given p
problem
''
i

h1 = 0.15 L
h2 = 0.2 L
0.2 L 4
=
0.15 L 3
0.3L
2 =
= 1.5
0.2 L

1 =

(50)

(51)

The governing differential equation (2) can be written in the


difference form as:
2
P.h 2
[yi 1 ( + 1) yi + yi +1 ] +
. yi = 0
(
)
+1
EI

(52)

Substituting Eq. (c) in the Eq.(d) and solving by using the


boundary conditions that at both the ends of the column
y0 = 0 .
EI 0
The value of Pcr = 7.855 L2 as against the exact value of
Pcr = 8.55

EI 0
L2

1.10 Integration
g
Formulas byy Interpolating
p
g
Parabolas
In many engineering problems, evaluation of integrals is too
cumbersome if the integration is not possible within the finite
terms.
To obtain acceptable solution to such problems,
problems numerical
methods of integration are employed.
If a parabola is assumed to pass through a number of pivotal
points, then the area under the curve between the limits will be
approximately equal to the area under the integrand.
Given the pivotal points

....., y i-2 , y i-1 , y i , y i +1 , y i + 2 ,.......

Evenly spaced by h and taking the origin at x=xi, the straight


line
y ( x ) = A.x + B
pass through
g the ppoints ((0,y
,yi) and ((h,, yi+1) provided
p
Will p

yi +1 yi
A=
h
The approximate first degree parabola thus
yi ++11 yi
y(x ) =
. x + yi
h

(53)

And the area under y(


y(x)) curve between 0 and h is approximated
pp
by
h

yi +1 yi h 2
h
A = y (x ).dx =
. + yi .h = ( yi + yi +1 )
h
2
2
0

(54)

yi +1 yi h 2
h
A = y (x ).dx
d =
. + yi .h = ( yi + yi +1 )
h
2
2
0

(55)

This is known as the Trapezoidal Rule Formula, since it


approximates the area under one strip by area of a trapezoid.
y
B

A
0

0 1
x=a

4
Fig.4

7 8
x=b

2
(
)
y
x
=
A
.
x
+ B.x + C
If the second degree
g
pparabola

is p
passed

through points (-h, yi-1), (0,yi), (h, yi+1)


yi 1 = A.h 2 B.h + C
yi = C
yi +1 = A.h 2 + B.h + C

Solving for A,B and C, we have


yi 1 2 yi + yi 1
A=
2h 2
yi +1 yi 1
B=
2h
C = yi

(56)

The area under this p


parabola between h and +h,, ggives
2.h 2
h
B = y ( x ).dx =
. A + 2.h.C = ( yi +1 + 4 yi + yi 1 )
h
3
3
+h

(57)

This is known as Simpsons 1/3 Rule Formula for the area


under the two strips of width h.
Similarly,
Si il l the
th area under
d four
f
strips
t i between
b t
-2h
2h and
d +2h
becomes
C=

+2 h

2h

y ( x ).dx =

4h
(2 yi +1 yi + 2 yi 1 )
3

(58)

Thank you

You might also like