Назад
3. Numerical Solution of Partial Differential Equations 1003
Solution of One-Dimensional Wave Equation by Method of D’Alembert
The D’Alembert method, like the Laplace transform and the method of separation
of variables, provides an analytical solution to the one-dimensional wave equation.
It can be easily shown that a function in the form of y(x, t) = f
1
(x + ct) + f
2
(xct)
is a solution to Equation VIIe.3.15. For this equation to be the final solution, it
must satisfy the initial and the boundary conditions. For the initial conditions of
y(x, 0) = f(x) and
)(/)0,( xgtxy =
, we find the solution as:
³
+
+++=
ctx
ctx
dssg
c
ctxfctxftxy )(
2
1
)]()([
2
1
),( VIIe.3.17
where s is a dummy variable. For example, consider a string, fixed at the end
points, having a length of 4 feet. The wire density and the tension force are so that
c = 2. Choosing a length increment of 1 ft, gives the optimum time step of 0.5
seconds. The string is now pulled to vibrate with an initial velocity of:
L
x
t
xy
π
sin
)0,(
=
We want to find the displacement of a point located 1/5 of the length from the left
end, 1 second after the string is disturbed. To solve the problem, we use Equa-
tion VIIe.3.17 as follows:
»
¼
º
«
¬
ª
»
¼
º
«
¬
ª
+
¸
¹
·
¨
©
§
=
µ
´
=
+
L
t
L
x
L
t
L
xL
ds
L
s
c
y
ctx
ctx
ππππ
π
π
2
cos
2
cossin4
2
1
From here, we find y for x = L/5 ft and t = 1 second as:
()
fty 296.1104.0913.0
4
15
8
cos
15
2
cos
4
35
cos
35
cos
4
=+=
¸
¹
·
¨
©
§
=
»
¼
º
«
¬
ª
¸
¹
·
¨
©
§
+
¸
¹
·
¨
©
§
=
π
ππ
π
ππππ
π
The reader should use the finite-difference method and compare the results.
Solution of the Two-Dimensional Wave Equation
Displacement of a vibrating membrane can be predicted by the solution to the
two-dimensional wave equation:
2
2
22
2
2
2
),,(1),,(),,(
t
tyxu
cy
tyxu
x
tyxu
=
+
This equation can be solved explicitly by substituting for the derivative terms from
the central-difference approximation.
2
1
,,
1
,
22
1,,1,
2
,1,,1
)(
2
1
)(
2
)(
2
t
uuu
cy
uuu
x
uuu
k
ji
k
ji
k
ji
k
ji
k
ji
k
ji
k
ji
k
ji
k
ji
+
=
+
+
+
+
++
1004 VIIe. Engineering Mathematics: Numerical Analysis
If the increments along the x and the y-axis are equal, we get:
k
ji
k
ji
k
ji
k
ji
k
ji
k
ji
k
ji
u
x
tc
uuuuu
x
tc
u
,
2
22
1
,1,1,,1,1
2
22
1
,
]
)(
)(
42[)(
)(
)(
++++
=
++
+
To further simplify this relation, we may choose the spatial and the temporal in-
crements so that the last term vanishes and we simply get:
1
,1,1,,1,1
1
,
)(
2
1
++
+
+++=
k
ji
k
ji
k
ji
k
ji
k
ji
k
ji
uuuuuu
This equation applies when 2/1)/()(
222
= xtc . Similar to the one-dimensional
wave problem, to find displacement corresponding to k – 1 when we begin the
first time step, we take advantage of the specified initial velocity. If the initial ve-
locity is zero, then displacement corresponding to the first time step is obtained
from:
)(
4
1
0
1,
0
1,
0
,1
0
,1
1
,
++
+++=
jijijijiji
uuuuu
4. The Newton–Raphson Method
As was discussed in Chapter VIId, the mathematical modeling of most physical
phenomena reduces to a set of simultaneous differential equations the solution of
which would determine the parameters of interest. The solution to such a set of
equations involves the approximation of the differential terms by finite difference,
for example, and then linearization of the nonlinear terms. The Newton-Raphson
method is most often used for the transformation of a set of differential equations.
Consider the following set of first order non-linear differential equations, con-
sisted of N equations and N unknowns:
()
()
()
¸
¸
¸
¸
¸
¸
¸
¹
·
¨
¨
¨
¨
¨
¨
¨
©
§
=
¸
¸
¸
¸
¸
¸
¹
·
¨
¨
¨
¨
¨
¨
©
§
NN
N
N
N
yyytF
yyytF
yyytF
y
y
y
dt
d
,...,,
.
.
,...,,
,...,,
.
.
21
212
211
2
1
VIIe.4.1
Functions in the right side of the above set can be linearized. To do this, each
function is expanded in Taylor’s series and then approximated by using only the
first derivative term:
()
()
(
)
[
]
()
n
i
n
i
N
i
n
N
nnn
i
n
N
nnn
iNi
yy
y
yyytF
yyytFyyytF
+=
+
¦
1
21
2121
,...,,,
,...,,,,...,,,
4. The Newton–Raphson Method 1005
We now substitute the approximated functions in the right side of Equa-
tion VIIe.4.1. We also expand the left side of the set of differential equations by
using a discrete difference at consecutive time steps. Equation VIIe.4.1 can then
be written as:
()
()
()
¸
¸
¸
¸
¸
¸
¸
¹
·
¨
¨
¨
¨
¨
¨
¨
©
§
¸
¸
¸
¸
¸
¸
¸
¹
·
¨
¨
¨
¨
¨
¨
¨
©
§
+
¸
¸
¸
¸
¸
¸
¸
¹
·
¨
¨
¨
¨
¨
¨
¨
©
§
=
¸
¸
¸
¸
¸
¸
¸
¹
·
¨
¨
¨
¨
¨
¨
¨
©
§
+
+
+
+
+
+
n
N
n
N
nn
nn
N
n
N
n
N
n
N
N
nnn
N
nnn
n
N
nnn
N
n
N
nnn
n
N
nnn
n
N
n
N
nn
nn
yy
yy
yy
yFyFyF
yFyFyF
yFyFyF
t
yyytF
yyytF
yyytF
t
yy
yy
yy
1
2
1
2
1
1
1
21
22212
12111
21
212
211
1
2
1
2
1
1
1
.
.
..
.
.
..
..
,...,,
.
.
,...,,
,...,,
.
.
VIIe.4.2
The matrix on the right hand side of Equation VIIe.4.2, which contains the partial
derivative terms, is called the Jacobian matrix. The above set can now be solved
for the increment in each variable. To do this, the Jacobian matrix multiplied by
the time step should be deducted from the unity matrix. Final answer is obtained
as:
()
()
()
1
21
22212
12111
21
212
211
1
2
1
2
1
1
1
..
.
.
..
..
1..11
..
1..11
1..11
,...,,
.
.
,...,,
,...,,
.
.
+
+
+
°
°
°
¿
°
°
°
¾
½
°
°
°
¯
°
°
°
®
¸
¸
¸
¸
¸
¸
¸
¹
·
¨
¨
¨
¨
¨
¨
¨
©
§
¸
¸
¸
¸
¸
¹
·
¨
¨
¨
¨
¨
©
§
¸
¸
¸
¸
¸
¸
¸
¹
·
¨
¨
¨
¨
¨
¨
¨
©
§
=
¸
¸
¸
¸
¸
¸
¸
¹
·
¨
¨
¨
¨
¨
¨
¨
©
§
N
n
N
n
N
n
N
N
nnn
N
nnn
n
N
nnn
N
n
N
nnn
n
N
nnn
n
N
n
N
nn
nn
yFyFyF
yFyFyF
yFyFyF
t
yyytF
yyytF
yyytF
t
yy
yy
yy
Let’s demonstrate the application of the Newton-Raphson linearization method by
solving a simple example.
Example. Find the friction factor from:
2
10
Re
7.182
log274.1
»
»
¼
º
«
«
¬
ª
¸
¸
¹
·
¨
¨
©
§
+=
f
D
f
e
ε
Data: D
e
= 1 in,
ε
= 0.004 in, Re = 1.0E7.
Solution: Since f appears in both sides of the correlation, we use the Newton-
Raphson method where:
0
Re
7.182
log274.1
2
10
=
»
»
¼
º
«
«
¬
ª
¸
¸
¹
·
¨
¨
©
§
+=
f
D
fF
e
ε
we then expand F as:
0)()( =+=
dx
dF
xxxFF
oo
Solving for x, we find:
1006 VIIe. Engineering Mathematics: Numerical Analysis
dxxdF
xF
xx
o
o
o
/)(
)(
=
This procedure is summarized in the following FORTRAN program.
implicit real*8(a-h,o-z)
data a1,a2,eps,De,Re,e/1.74,-2.00,4.00E-3,1.0,1.0E7,1.e-8/
f=0.1
1 continue
i=i+1
a3=2.00*eps/De
a4=18.7/Re
W=a3+(a4/sqrt(f))
Wp=-a4*(f**(-1.5))/2.00
V=a1+a2*alog10(W)
Vp=0.4343*a2*Wp/W
U=1./(V*V)
Up=-2.00*Vp/(V*V*V)
Fof=f-U
dFdf=1.00-Up
error=Fof/dFdf
f=f-error
if(abs(error).le.e) go to 3
if(i.gt.30) go to 2
go to 1
2 continue
Print *,'Iteration did not converge'
go to 4
3 continue
Write(*,*) i,f
4 continue
9 format(i5,f15.9)
stop
end
Using the above data, the program finds the answer after 3 iterations as 0.0284.
5. Curve Fitting to Experimental Data
In many engineering applications, we prefer to use an equation to represent a set
of experimental data. It is therefore our goal here to represent a set of experimen-
tal data by a curve that would best fit the data. The simplest case is fitting a line
between points in a set of data. In general however, the experimental data are
such that a nonlinear curve needs to be found to best fit the data. The most widely
used technique for curve fitting is the method of least squares. A polynomial of
degree n passes exactly through a set of N data points, if n = N – 1. Hence, in fit-
ting polynomials to a set of experimental data, we require n < N –1.
5.1. Regression Analysis, the Method of Least Squares
Since polynomials can be readily manipulated, to describe the method of least
squares, we consider the case of fitting a polynomial to a specified set of data. In
5. Curve Fitting to Experimental Data 1007
this method, the goal is to find the coefficients of a function of a single variable in
the form of:
¦
=
=
M
i
ii
xfcxf
1
)()( VIIe.5.1
to fit the data pairs (x
1
, y
1
), (x
2
, y
2
), ! (x
N
, y
N
) so that the summation of the square
of the errors as in the following summation:
[]
2
1
)(
¦
=
=
N
i
ii
yxfE
is minimized. Since functions f
i
(x) comprising the function f(x) are known, the
unknown coefficients c
i
should then be determined. This is accomplished by set-
ting the derivative of E with respect to the unknown coefficients (i.e. c
i
) to zero:
[]
{}
¦
=+++=
=
N
i
iiiMMii
xfyxfcxfcxfc
c
E
1
12211
1
0)()()()(2 "
[]
{}
¦
=
=+++=
N
i
iiiMMii
xfyxfcxfcxfc
c
E
1
12211
2
0)()()()(2 "
[]
{}
¦
=
=+++=
N
i
iiiMMii
M
xfyxfcxfcxfc
c
E
1
12211
0)()()()(2 "
This results in the following set of M equations and M unknowns:
»
»
»
»
»
»
»
»
»
»
»
¼
º
«
«
«
«
«
«
«
«
«
«
«
¬
ª
=
»
»
»
»
»
»
»
»
¼
º
«
«
«
«
«
«
«
«
¬
ª
»
»
»
»
»
»
»
»
»
»
»
¼
º
«
«
«
«
«
«
«
«
«
«
«
¬
ª
¦
¦
¦
¦¦¦
¦¦¦
¦¦¦
=
=
=
===
===
===
N
i
iiM
N
i
ii
N
i
ii
M
N
i
iMiM
N
i
iiM
N
i
iiM
N
i
N
i
iMi
N
i
iiii
N
i
iMi
N
i
ii
N
i
ii
yxf
yxf
yxf
c
c
c
xfxfxfxfxfxf
xfxfxfxfxfxf
xfxfxfxfxfxf
1
1
2
1
1
2
1
11
2
1
1
11
2
1
2212
1
1
1
21
1
11
)(
)(
)(
)()()()()()(
)()()()()()(
)()()()()()(
#
#
!
###
!
!
VIIe.5.2
This set can be solved for the unknown coefficients c
i
using the methods described
in Chapter VIId. We may now apply the set given in Equation VIIf.4.2 to the fol-
lowing simple polynomials with linear terms:
5. Curve Fitting to Experimental Data 1009
We may use this equation to find saturation pressure corresponding to T
sat
=
338.08 F. According to the above fit
P
sat
= –305.7 + 3.438 × 338.08 –0.01386 × (338.08)
2
+ (0.2181E-4) × (338.08)
3
=
115.2 psia
The corresponding pressure from the steam tables is P = 115 psia, resulting in an
error of less than 0.2%.
The most important task in curve fitting by the method of least squares is the
selection of the type of functions (i.e. f
i
(x)) comprising function f(x). The function
may be in any of the following forms:
¦
=
+=
n
i
i
i
xBAy
1
,
¦
=
+=
n
i
i
i
xBAy
1
)ln( ,
¦
=
+=
n
i
i
i
xBAy
1
)ln()ln( ,
¸
¸
¹
·
¨
¨
©
§
+=
¦
=
n
i
i
i
xBAxy
1
/ ,
¦
=
+=
n
i
i
i
xBAy
1
/ ,
¦
=
+=
n
i
i
i
xBAy
1
/)ln( ,
¸
¸
¹
·
¨
¨
©
§
+=
¦
=
n
i
i
i
xBAy
1
/1 ,
¦
=
+=
n
i
i
i
xBAy
1
.
Polynomial fits to data (similar to the first equation shown above) can be made by
using the regression analysis available on the accompanying CD-ROM.
VIII. Appendices
Table of Contents
Appendix I. Unit Systems, Constants, and Numbers ................................... 1013
Table A.I.1. Primary SI Units .......................................................................... 1014
Table A.I.2. Derived SI Units ......................................................................... 1014
Table A.I.3. Associated SI Units ..................................................................... 1014
Table A.I.4. Common Physical Quantities
in Two Systems of Dimensions................................................................ 1015
Table A.I.5. Physical Constants ....................................................................... 1016
Table A.I.6. Dimensionless Numbers .............................................................. 1017
Table A.I.7. Multiples of SI Units.................................................................... 1017
Table A.I.8. Unit Conversion Tables ............................................................... 1018
Appendix II. Thermodynamic Data.............................................................. 1023
Table A.II.1(SI). Saturated Water
and Dry Saturated Steam Properties, f(P) ................................................ 1024
Table A.II.2(SI). Saturated Water
and Dry Saturated Steam Properties, f(T)................................................. 1028
Table A.II.3(SI). Superheated Steam Properties .............................................. 1032
Table A.II.4(SI). Subcooled Water Properties ................................................. 1036
Table A.II.5(SI). Properties of Various Ideal Gases......................................... 1037
Table A.II.1(BU). Saturated Water
and Dry Saturated Steam Properties, f(T)................................................. 1038
Table A.II.2(BU). Saturated Water
and Dry Saturated Steam Properties, f(P) ................................................ 1040
Table A.II.3(BU). Superheated Steam Properties ............................................ 1042
Table A.II.4(BU). Subcooled Water Properties ............................................... 1046
Table A.II.5(BU). Properties of Various Ideal Gases....................................... 1047
Table A.II.6. Examples of Least-Square Fit to Saturated Water
and Dry Saturated Steam.......................................................................... 1047
Appendix III. Pipe and Tube Data................................................................. 1049
Table A.III.1(SI). Commercial Steel Pipe (Schedule Wall Thickness)............ 1050
Table A.III.2(SI). Commercial Steel Pipe (Nominal Pipe Size, NPS) ............. 1051
Table A.III.3(SI). Tube Data, Birmingham Gauges
to millimeter and inches........................................................................... 1053
Table A.III.1(BU). Pipe Data, Carbon & Alloy Steel ...................................... 1054
Table A.III.2(BU). Tube Data.......................................................................... 1055
1012 VIII. Appendices
Table A.III.4. Navier-Stokes Equations
in the Cylindrical Coordinate System ...................................................... 1056
Table A.III.5. Navier-Stokes Equations
in the Spherical Coordinate System ......................................................... 1056
Table A.III.6. Substantial Derivative and Flow Acceleration Components
(Cylindrical Coordinates)......................................................................... 1057
Table A.III.7. Substantial Derivative and Flow Acceleration Components
(Spherical Coordinates)............................................................................ 1057
Appendix IV. Thermophysical Data............................................................. 1059
Table A.IV.1(SI). Thermophysical Properties
of Selected Metallic Solids....................................................................... 1060
Table A.IV.2(SI). Thermophysical Properties
of Selected Nonmetallic Solids ................................................................ 1064
Table A.IV.3(SI). Thermophysical Properties
of Common Materials at 300 K................................................................ 1066
Table A.IV.4(SI). Thermophysical Properties
of Gases at Atmospheric Pressure............................................................ 1072
Table A.IV.5(SI). Thermophysical Properties
of Saturated Water and Saturated Steam.................................................. 1077
Table A.IV.6(SI). Thermophysical Properties of Liquid Metals...................... 1079
Table A.IV.4(BU). Thermophysical Properties of Gases
at Atmospheric Pressure........................................................................... 1080
Table A.IV.5(BU). Thermophysical Properties of Saturated Water ................ 1082
Table A.IV.6(BU). Thermophysical Properties of Saturated Steam ................ 1082
Table A.IV.7(BU). Thermophysical Properties of Superheated Steam............ 1083
Table A.IV.8(BU). Thermal Properties of Solid Dielectrics
at Normal Temperature ............................................................................ 1084
Table A.IV.9(BU). Normal, Total Emissivity of Metallic Surfaces................. 1086
Table A.IV.10(BU). Normal, Total Emissivity of Non-Metallic Surfaces ....... 1088
Appendix V. Nuclear Properties of Elements ............................................... 1091
Table A.V.1(SI). Absorption Coefficient of Gamma Rays.............................. 1092
Table A.V.2(SI). Cross Sections for Neutron Interaction ................................ 1093
Appendix I
Unit Systems, Constants, and Numbers
Table A.I.1. Primary SI Units .......................................................................... 1014
Table A.I.2. Derived SI Units ......................................................................... 1014
Table A.I.3. Associated SI Units ..................................................................... 1014
Table A.I.4. Common Physical Quantities
in Two Systems of Dimensions................................................................ 1015
Table A.I.5. Physical constants ........................................................................ 1016
Table A.I.6. Dimensionless Numbers .............................................................. 1017
Table A.I.7. Multiples of SI Units.................................................................... 1017
Table A.I.8. Unit Conversion Tables ............................................................... 1018