You are on page 1of 16

Finite Difference Method

Major: All Engineering Majors

Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.edu
Transforming Numerical Methods Education for STEM
Undergraduates

7/17/2017 http://numericalmethods.eng.usf.edu 1
Finite Difference Method

http://numericalmethods.eng.usf.edu
Finite Difference Method
An example of a boundary value ordinary differential equation is

d 2u 1 du u
2
2 0, u (5) 0.008731" , u (8) 0.0030769"
dr r dr r

The derivatives in such ordinary differential equation are substituted by finite


divided differences approximations, such as

dy yi 1 yi

dx x

d 2 y yi 1 2 yi yi 1

dx 2
x 2

3 http://numericalmethods.eng.usf.edu
Example
Take the case of a pressure vessel that is being tested in the laboratory to
check its ability to withstand pressure. For a thick pressure vessel of inner
radius a and outer radius b, the differential equation for the radial
displacement u of a point along the thickness is given by
d 2 u 1 du u
2
2 0
dr r dr r
The pressure vessel can be modeled as,
d 2u ui 1 2ui ui 1

dr 2 r 2
du ui 1 ui

dr r
Substituting these approximations gives you,
ui 1 2ui ui 1 1 ui 1 ui ui
2 0
r 2 ri r ri
1 1 2 1 1 1
u
i 1 r 2 r r r 2 i r 2 ui 1 0
u
r 2
ri r i i
4 http://numericalmethods.eng.usf.edu
Solution
Step 1 At node i 0, r0 a 5" u0 0.0038731"

Step 2 At node i 1, r1 r0 r 5 0.6 5.6"

1 2 1 1 1 1
u u
0.6 2 5.60.6 u 2 0

0.6 2 1
0.6 5.6
2 0 2
5.6 0.6

2.7778u0 5.8851u1 3.0754u2 0

Step 3 At node i 2, r2 r1 r 5.6 0.6 6.2"


1 2 1 1 1 1
u

2
u
u3 0
0.6 2 1
0.6
2
6.20.6 6.2 0.6 6.20.6
2 2

2.7778u1 5.8504u 2 3.0466u3 0

5 http://numericalmethods.eng.usf.edu
Solution Cont
Step 4 At node i 3, r3 r2 r 6.2 0.6 6.8"
1 2 1 1 1 1
u

2
u
u4 0
0.6 6.80.6 6.8 6.80.6
2 2 2 3 2
0.6 0.6
2.7778u2 5.8223u3 3.0229u4 0

Step 5 At node i 4, r4 r3 r 6.8 0.6 7.4"


1 2 1 1 1 1
u3
0.62 7.40.6 7.42 u 4
0.62 7.40.6 u5 0
0.62
2.7778u3 5.7990u4 3.0030u5 0
Step 6 At node i 5, r5 r4 r 7.4 0.6 8

u5 u |r b 0.0030769"

6 http://numericalmethods.eng.usf.edu
Solving system of equations
1 0 0 0 0 0 u0 0.0038731
2.7778 5.8851 3.0754 0 0 0 u 0

1
0 2.7778 5.8504 3.0466 0 0 u2 0

0 0 2.7778 5.8223 3.0229 0 u
3 0
0 0 0 2.7778 5.7990 3.0030 u4 0

0 0 0 0 0 1 u5 0.0030769

u 0 0.0038731 u3 0.0032743

u1 0.0036165 u4 0.0031618

u2 0.0034222 u5 0.0030769

7 http://numericalmethods.eng.usf.edu
Solution Cont
du u1 u0 0.0036165 0.0038731
r a 0.00042767
dr r 0.6

30 106 0.0038731
max 0.3 0.00042767 21307 psi
1 0.3
2
5

36 103
FS 1.6896
21307

Et 20538 21307 768.59

20538 21307
t 100 3.744 %
20538
8 http://numericalmethods.eng.usf.edu
Solution Cont
Using the approximation of
d 2 y yi 1 2 yi yi 1 dy yi 1 yi 1
and
dx 2 x 2 dx 2x

Gives you
u i 1 2u i u i 1 1 u i 1 u i 1 u i
2 0
r 2 ri 2r ri
1 1 2 1 1 1
u i 1
2r r r 2 u
r 2 r 2 i r 2 2r r u i 1 0
i i i

9 http://numericalmethods.eng.usf.edu
Solution Cont
Step 1 At node i 0, r0 a 5
u0 0.0038731
Step 2 At node i 1, r1 r0 r 5 0.6 5.6"
1 1 2 1 1 1

25.60.6 0.62 0 0.62 5.62 1 0.6 2 25.60.6 u 2 0
u u

2.6297u0 5.5874u1 2.9266u2 0

Step 3 At node i 2, r2 r1 r 5.6 0.6 6.2


1 1 2 1 1 1
u
2 1
u
u3 0

2 6.2 0.6 0.6 0.6
2
6.2
2 2
0.6
2

2 6.2 0.6

2.6434u1 5.5816u 2 2.9122u3 0

10 http://numericalmethods.eng.usf.edu
Solution Cont
Step 4 At node i 3, r3 r2 r 6.2 0.6 6.8
1 1 2 1 1 1
u
2 2
u
0.6 2 26.80.6 u 4 0

26.8 0.6 0.6 0.6 2
6.8 2

3

2.6552u2 5.5772u3 2.9003u4 0

Step 5 At node i 4, r4 r3 r 6.8 0.6 7.4


1 1 2 1 1 1


u
2 3
0.6 2 7.42 4 0.6 2 27.40.6 u5 0
u
2 7.4 0.6 0.6
2.6651u3 5.5738u4 2.8903u5 0

Step 6 At node i 5, r5 r4 r 7.4 0.6 8"

u5 u |r b 0.0030769"

11 http://numericalmethods.eng.usf.edu
Solving system of equations
1 0 0 0 0 0 u0 0.0038731
2.6297 5.5874 2.9266 0 0 0 u 0
1
0 2.6434 5.5816 2.9122 0 0 u2 0

0 0 2.6552 5.5772 2.9003 0 u3 0
0 0 0
2.6651 5.5738 2.8903 u4 0

0 0 0 0 0 1 u5 0.0030769

u 0 0.0038731 u3 0.0032689
u1 0.0036115 u4 0.0031586
u2 0.0034159 u5 0.0030769

12 http://numericalmethods.eng.usf.edu
Solution Cont
du 3u0 4u0 u2 3 0.0038731 4 0.0036115 0.0034159
0.0004925
2r
r a
dr 2(0.6)

30 106 0.0038731
max 0.3 0.0004925 20666 psi
1 0.3
2
5

36 103
FS 1.7420
20666

Et 20538 20666 128

20538 20666
t 100 0.62323 %
20538

13 http://numericalmethods.eng.usf.edu
Comparison of radial
displacements
Table 1 Comparisons of radial displacements from two methods

r uexact u1st order |t| u2nd order |t|


5 0.0038731 0.0038731 0.0000 0.0038731 0.0000
5.6 0.0036110 0.0036165 1.5160101 0.0036115 1.4540102
6.2 0.0034152 0.0034222 2.0260101 0.0034159 1.8765102
6.8 0.0032683 0.0032743 1.8157101 0.0032689 1.6334102
7.4 0.0031583 0.0031618 1.0903101 0.0031586 9.5665103
8 0.0030769 0.0030769 0.0000 0.0030769 0.0000

14 http://numericalmethods.eng.usf.edu
Additional Resources
For all resources on this topic such as digital audiovisual
lectures, primers, textbook chapters, multiple-choice
tests, worksheets in MATLAB, MATHEMATICA, MathCad
and MAPLE, blogs, related physical problems, please
visit

http://numericalmethods.eng.usf.edu/topics/finite_differ
ence_method.html
THE END

http://numericalmethods.eng.usf.edu

You might also like