WAVE INTEGRAL S IN THE
LINEARIZED THEORY OF WATER WAVES
byHung-Tao Shen and Cesar Farefl
Sponsored by Office of Naval Research
Department of the Navy Contracts N00014-68-A-0196-0004
and N00014-76-C-0012
uHR Report No. 166
Iowa Institute of Hydraulic Research The University of Iowa
Iowa City, Iowa November, 1975
ABSTRACT
A method for the numerical evaluation of the derivatives of the
linear-ized velocity potential for three-dimensional flow past a unit source sub-merged in a uniform stream is presented together with a discussion of
exist-ing techniques. It is shown in particular that calculation of the double
integral term in these functions can be efficiently accomplished in terms of a single integral with the integrand expressed in terms of the complex expo-nential integral, for which numerical computing techniques are available. Fortran programs prepared for evaluation of the first-order derivatives in connection with the calculation of second-order nonlinear contributions to
the wave resistance of a body are appended.
ACKNOWLEDGEMENTS
This study was sponsored in part by the Office of Naval Research under
Contracts N000l4-68-A-0l96-0004 and N00014-76-C-0012. The second author is
also indebted to the Institut de Mécanique, Université de Grenoble, and to the Ministère de l'Education Nationale, France, for support for a one-year
stay at the Université de Grenoble, during which he was able to complete the study and prepare the final draft of the manuscript.
Page
LIST OF FIGURES iii
LIST OF TABLES iv
LIST OF SYMBOLS y
INTRODUCTION AND LITERATURE REVIEW 1
TREATMENT OF THE WAVE INTEGRALS 3
NUMERICAL EVALUATION OF THE FIRST-ORDER DERIVATIVES 9
NUMERICAL CALCULATIONS 15
DISCUSSION AND CONCLUDING REMARKS 21
REFERENCES 25
APPENDIX A - COEFFICIENTS OF THE POLYNOMIALS 27
APPENDIX B - COMPUTER PROGRAMS 29
LIST OF FIGURES
Page
Fig. 1 Contour of integration in the complex plane K = k + 1k' 5
Fig. 2 Integrand of the double integrals: F 0.40,
y/2c = -0.15, y = 0, (x-x )/2c =
(z-z)/2c = 1.2 °
Fig. 3 Integrand of the single integrals: F = 0.4,
y /2c = -0.25, y = 0, (x-x )/2c = 1.0,
(i-z )/2c = 0.2 °
o
Fig. 4 Integrand of the single integrals: Fr = 0.4,
y /2c = -0.25, y = 0, (x-x)/2c = 4.0, (-z)/2c = 1.8 iii 17 18 19
Page
Table A-1 Coefficients of the polynomial p(l/z) 27
Table A-2 Coefficients of the polynomial q(l/z) 28
LIST OF SYMBOLS
A, B limits of integration defined below Eqs. (12)
K, B limits of integration defined below Eqs. (19)
c length parameter
E1(t) the complex exponential integral
Fr Froude number =
f superscript denoting far-field term
g gravitational acceleration
Im the imaginary part of a complex quantity
I principal-value integral defined by Eq.
(4)
Tfl integral defined below Eq. (7)
i the imaginary unit
k variable of integration
k'
ImK
k
superscript denoting local term
n order of partial derivative
Q
(y+yl2
+2 2
22
R [(x-x) + (y-y) + (z-z)
R' [(x-x)2 + (y+y)2 + (z_z0)2}½
U uniform stream velocity
u
tant
x, y, z right-handed Cartesian coordinate system, origin at the
undisturbed free-surface, x axis along the flow
direc-tion, y axis vertical upwards
x y ,z
source coordinateso o o
e angle in (x, z) plane between the position vector and
the x axis
tan
(w/Ly+yj)
complex variable = -k sec2t (y+yj-iw)
complex variable = k+ik' Re
the number pi
distance to the origin in (x, z) plane
variable of integration velocity potential
Havelock's source function
double and single integrals defined by Eqs. (2)
d s
sx
y
z
the factorial symbol
vi n K 71 p T
NUMERICAL CALCULATION OF THE WAVE INTEGRALS IN THE LINEARIZED THEORY OF WATER WAVES
I. INTRODUCTION AND LITERATURE REVIEW
Within the theory of infinitesimal waves, the velocity potential
for three-dimensional flow past a unit source at (x ,y ,z ) in a uniform
o o o stream of velocity U in the positive x direction is given by
= U x + s(xiY,z x ,y ,z
o o o
where is Havelock's source function, defined by
i
x y ,z
= - 2 2+ (z-z
)2]½ O O[(x-x )
+ (y-y
o 1 +-
(y+y ) + (z-z[(xx)2+
2 2-o o o 2ksect
o+ - x k[(y+y ) + i(x-x )cos t + i(z-z )sin t]dk
dt
k-k sec2t e o o O
O O o
k sec2t[(y+y) + i(x-x )cos t +
i(z-z0)sin
t]+ Re 2i
f
k sec2t e o dt,y+y<O.
(1)Here k = g/U2, g is the acceleration of gravity, and a right-handed
rectan-gular coordinate system has been chosen, with the origin located at the level of the undisturbed free surface and the y axis directed vertically
upwards. Because in the method of Green's functions the flow about a body
is represented by distributions of sources or higher-order singularities,
the numerical calculation of and its derivatives is of importance in
wave-resistance theory, and various computational schemes can be found
reported in the literature. In this work a method used in connection with
resis-tance of a submerged spheroid is presented in detail. The method makes use of certain existing techniques and brief summaries of pertinent previous
studies are included in the text as needed for purposes of comparison.
The singularity in the integrand of the principal-value integral
in (1) can be eliminated through contour integration in the complex k-plane.
Early treatments of this integral made use of a contour consisting of the
positive half of the real axis, excluding the pole, k = k sec2t, by means
of a semicircle of radius r tending to zero, a quadrant of radius R tending to infinity, and the positive or negative half of the imaginary axis depending
on the sign of w = (x-x )cos t + (z-z )sin t (see e.g. Lunde 1951). This
o o
is essentially the method used by Yim (1963) to calculate numerically the
x derivative of (Yim used actually Rayleigh's artificial viscosity
to derive the expression for and therefore had the pole at k = k sec2t +
iji sec t). The wave elevation,n = -(U/g) (aq5/ax),is thus obtained as
the sum of a double integral, r, representing a local disturbance, and a
single integral, n, representing the far-field wave motion. For evaluation
of
r in the far field Yim used the method of stationary phase, except in
the vicinity of the critical line, where the method of steepest descent
as modified by Iirsell (1960) was used. In the near field, was evaluated
using Hermite-Gauss and Laguerre-Gauss quadratures. No estimate of the
error in these evaluations is given. The evaluation of the local term,
in the far field was carried out by direct numerical integration, using
either Gauss' quadrature formulas or simply Simpson's rule, a time-consuming
procedure in view of the oscillatory nature of the integrand. Which method
was actually selected is not specifically indicated, and a comparison between
methods is not made. In the near field the evaluation of seems to have
been carried out at least in part using a transformation due toBarakat (1961)
through which the resulting integral in k is written as the sum of two other
integrals with non-oscillating integrands plus a combination of known
functions involving the sine and cosine integrals. The possible advantage
of using Barakat's expressions, however, is not examined quantitatively. The
error criteria used in all these evaluations are not discussed.
In the present work a different contour of integration for the
evaluation of the principal value integral in (1), proposed originally by
Smith et al (1963) , is used. This contour leads directly to a
(x,y,z; x ,y ,z )
o o o
=::H
x d
jo
3
integral can be written as an integral with the integrand expressed in terms of the complex exponential integral, for which numerical computing techniques
are available. A general expression which can be used to compute higher-order
derivatives of , and therefore the solutions for submerged multipoles,
is derived. Brief comparisons of different methods of evaluation for both
the single and double intergrals are presented whenever possible.
II. TREATMENT OF THE WAVE INTEGRALS
Solutions for submerged multipoles, corresponding to the solution
(1) for a submerged source, can be obtained directly by differentiation
of the potential n times with respect to various combinations of x, y
and z. Since the first two terms present no difficulty for numerical
evaluation, only the double and single integral terms will be discussed.
We introduce the notation
ik[(x-x )cos t +(z-z )sin t]dk
dt (2a) e o o çrr/2
eo
(x,y,z; x y ,z ) = Re 2i J k sec2t k sec2t(y+y0) o o o s -ir/2ik sec2t[(x-x )cos t + (z-z )sin tidt
e o o o
and consider first the nth derivatives with respect to x,
2w ,
n 2 k k sec t o n (i COS t) k-k sec2t o o) + i(x-x )cos t + i(z-z )sin ti (3a)
o o
dkdt
and n (x,y,z; x ,y ,z ) = Re 2i (i cos t)(k sec2t)n o o o J o x S -rr/2 (2b)k sec2t[(y+y ) + i(x-x )cos t + i(z-z )sin t] (3b)
eo
o o o dt (x,y,z; x ,y ,z d o =-
1 ir Jo ç2ir f.
o 2ksect
o k(y+y k-k sec2t e o owith
Numerical evaluation of the double integral in Eq. (3a) is
cunther-some and time consuming. On the one hand, it requires evaluation for each
t of a principal-value integral over an infinite interval, with the
singu-larity at k = ksec2t, a function of t. On the other, the integrand of
the principal-value integral is highly oscillatory at large k due to the
imaginary argument of the exponential function, in which k appears as a
factor. These difficulties can be dealt with as follows. Let the
principal-value integral be written in the form
n = k-k sec2t k° -k[y+y - iwidk e o (4) o
where w = (x-x ) cos t +
(z-z
) sin t. In the case w O contour integrationo o
in the complex plane, K = k + ik', using the contour suggested by Smith et
al (1963), transforms the principal-value integral into the sum of an integral
along a ray through the origin making an angle a with the positive real axis,
chosen so as to make the argument of the exponential real along the ray
(and therefore eliminating the oscillatory behavior at large k), and a
known function of t. For w > 0, the contour is shown in Fig. 1. On path
5 we impose the condition
Im-(k+ik') (y+y -iw)] = O
that is
kw-k'y+y = O
and therefore
-1 w
= tan
With this choice of a we obtain
Re[-(k+ik') (y+y -iw)] = -kQ
22
y+y +w °>0
and K k+ik' y+yo -1w5
Integrating along the contour shown in Fig. i we get then 2 n -k sec2t(jy+y j-1w) + = I - Re iri(k sec t) e o p o 5 n where kQ n 15 jy+yj-iw
exp(-)
d( kQ kQ )fl k sec2t !y+yî-iw jy+yl-iw o co Il-n (jy+y1-iw) co (kQ)nexp(_kQ) d(kQ)(H+yj
-iw)n kQ-k sec2t(jy+y0-iw)o
n -T
Te
2
T-ksec t(jy+y0_i&
For w < O, only the sign of the half-residue contribution changes.
We can write then, for w O,
2 n Ç = (Sgn w)i (ksec t) e + n (y+y o where Ç =
-ksec2t(y+yj-iw).
dT with I T n = n -TTe
dT , di , w w O O (ImÇ (ImÇ O) O) T+Ç n -TTe
T+Ç For w = O, Eq. .oe (4) becomes i k' _k(jy+yQj)dk co n -T T e dT I p n o (6) j 1 k-k sec t y+y j o o T-k sec t y+y2j
j o o oEquations (5) and (6) can be combined in the form I T 2
nÇ
n (7) = (sgn w)iii(k sec t) e + n n (jy+yj- iw) i ,oe n -TTe
dT (5) n -iw) j T+Ç oBut and n -T
Te
--
T+r, n-1 -T I n-TI -T T e dTr,I
T e n r i-1= ¿
(-r,)
i=1E
roen-i-T
T e dT = (n-i) o oe Jofl-i -T
T edT+
7For w = O the integral
T is still a principal-value integral. Instead of
an oscillatory factor in n the integrand, however, we have now always a
decreasing exponential.
Furthermore, the integral I can be expressed in terms of the
complex exponential integral, for n the numerical calculation o which
efficient computing technic1ues have been developed. We have
T±r, dT .oe -T )fl e T+r, dT o n-2 -T T e T+r, dii
x This definition is the one adopted in the National Bureau of Standards Handbook of Mathematical Functions (Abramowitz and Stegun 1964).
roe -T -p roe e e dT du j T-I-r, J p o r,
where E1(r,) is the complex exponential integral, defined in the z-plane cut along the negative real axis by '
-co
-T
E1(z) =
dT, arg z
< 'il(The path of integration is assumed to exclude the origin and not to cross
the negative real axis) . Indeed, the translation p=T+r,carries the pole
Tn_TIe_TdT r, [Joe o oe I T n o co o co o
T = - =
ksec2t(Iy+yHiw)
to the origin and the path of integration (thepositive real axis in the T plane) to the upper or lower half of the p plane
depending respectively on whether w > O (ImÇ > O) or w < O (ImÇ < O). We
obtain therefore n
nÇ
(-Ç)(n-i)! +
(-Ç) e E1(Ç) T n jrrrlThis relationship is also valid for ImÇ = O (w=O), in which case I
is a principal-value integral, if we define
.
-t eE1(x) = dt, x < O
X
(note that ReÇ = -k sec2ty+y is always negative).
Making use of Eqs (7) and (8), we obtain for the derivative given by Eq. (3a) the expression
-2rr n
i n 2
- [q
(x,y,z; x y ,z ) = - (i cos t) (k sec t)n S o o o ir o D o (sgn w)iri n (k
2)n
i i-1 n Ç f o n (-Ç)(1j)i +
(Ç) e E1(Çfldt (9)(Iy+y0-iw)
i=lCombining Eqs (3b) and (9) we get,for the nth derivative with respect to x of the two integrals in Havelock's source function c51the expression
(x,y,z; x y ,z ) + c
(x,y,z;
x ,y ,z )] o o o S o o o D s ii/2 2n+lÇ
1 1 n= Re 2i (i cos t) (k sec t) e (i+sgn w) dt +
hir/2 °
(y+y-iw)
ir n 2n and where w = (x-x ) cos t + (z-z )sin t o of
(i cos t)ksec2t
[ (_Ç)1(n_i)!(_Ç)fl1(Ç)]
dt (10)
(8)
T
=
-ksec2t(y+yiw)
Similar expressions for the derivatives with respect to the y and z
variables can be obtained. For brevity, only the numerical evaluation of
the first-order derivatives will be discussed in detail in the following.
III. NUMERICAL EVALUATION OF THE FIRST-ORDER DERIVATIVES
Making use of the preceding results, the first-order derivatives can be written in the form
x-x x-x (x,y,z;x ,y ,z ) + O X R3 R o
31
c-Re
Isect[--eE()]d-t
ir j i-ii
/ 2 -III-
Re2k2
(i+sgn )sec3t e dt - / 2 (Y-Yo) (x,y,z;x ,y,z) = -y R3 R' 2k 2 rîr/2-
Re iri_/2
o i dt sec tE- - e E 2 21k g + Re 21k2 îr/2 lt (l+sgn w)sec t e dt (lib)and and = Zo + 2ik
- Re sec3t tan t[
- eE()] dt
7f
-,2
ff12
- Re
2k2
(1+sgn w) sec3t tan t e dt (lic)2 12
2 2 2 2 2 2 2 2
where R (x-x ) + (y-y ) +
(z-z
) and R' = (x-x ) + (y+y ) + (z-zo o o o o o
The factor (l+sgn w) in the integrands in Eqs.(il)is zero over part of the
interval of integration. Let x-x = p cos ci, z-z = p sin ci. Then
o o
w = (x-x ) cos t +
(z-z ) sin
t = p cos(t-ci)o o
and sgn w = -1 for -31r/2 < t < ci-rr/2. We have therefore, for z-z > O (O < a < ir), l+sgn w = O for -ir/2 < t < ci-n/2; for z-z < O (ir < ci < 2ir), l+sgn w = O for a-3n/2 < t < rr/2.
To carry out numerically the integrations in Eqs. (ll)we introduce the substitution
u = tan t We have
du = sec2t dt
= -ky+y
(l+u2) + ik/l+u2 [(x-x) + u(z-z) IFor convenience, we write the first-order derivatives in the form
(x,y,z; x y ,z ) = (x,y,z; x y ,z ) + (x,y,z; x y ,z
o o O S o o o o o o
X X X
and similarly for the y and z derivatives, where the superscripts i and f
and f (x,y,z;x,y0,z0) = X.
i
-k
13 U-A =-,
B = tan(-37r/2) =k y+y
(1+u2)/i+u2e0
o A cos[k0/1+u{ (x_x0) + u(z-z)}]du1=1
rE k Ìy+y I(i+u2) I (i+u2) e ' o'0I
/i+U2 Im[
- eE1()]dU
1=1
(1+u2)Re[
- eE1()]du
(12a)=2
u4+u2
- eE1()]du
i sin[k/1+u2{ (x-x) + u(z-z)}]dui=2
- I-k lYy
(1+112)-k2
u/i+u2 e 0 0 o cos[k/i+u2{ (x-x0) + u(z-z)}]du1=3
where for brevity we have partially used the notation k1
= X,
X2 = y,x3 = z. The limits of integration A and B are given by
(12b) s X.
i
(x,y,z;x0,y0,z0)
x-x o + + + x-x o + + 2k 2 o u 2 2k o -J--
3 R 3 R' y+yo 3 R z-z o '3 R z-z 2 2ko'
R3 R'3 x-x r) - for z-z < O z-z o o x-x A = tan(-Tr/2) = - C)B=
forz-z >0
z-z o 0(The expressions for z-z < O can be obtained from those for z-z > O by
o o
simple considerations of symmetry).
For x-x = O we have [note that E (ri) = E (c)]
o 1 1
and
2 / 2
with Ç = -k
Iyy
(l+u ) + ik u l+u (z-z ). The far-field terms areo o o o
obtained directly by replacing (x-x) by O in Eqs. (12b); the limits of
inte-gration are now O to oe for z-z > o, - to O for z-z < O.
o
For z-z = O, on the other hand, we have
o x-x x-x bk2
-y-y0
y+ySR3
R'3 ir O - w owith Ç = -k jy+y (l+u2) + ik/l+u2 (x-x0). The far field terms
are given by k (l+u2)y+y [k /l+u2 (x-x fldu
=8kÌ Vl+u2e
cas Sol
O O X I o -k (1+u2) = -8k2 f (l+u2) ° y±y01'2
e sin[k i/l+u (x-x )du
S o y J0 o o f O L' (14) (15) and = X =
y
= z O + -w (1+u ,Re[ -2 w eE1(C)]du (13)eE1()]du
-R Z-Z R'3 z-z ir Jo 4k O/+2
Im[ -R 30 R' = x o Im[ - 3 R R' 1T (i+u2)Re[ - eE1(C)]du oand
pz
= O
where now = -k y+y (l+u2), and
-k (l+u2)y+y
I
/2
o o=-4k
e du s o X Jo = o (17) = O zIt should be noted that
= + is continuous at x-x = 0, z-z
= 0,
yy.
In particular, for z-z =0, the functions and (givenrespectively by the first of Eqs. (14) and the first of Eqs. (15) for
x-x > 0,and by the first of Eqs (14) and zero for x-x < 0) present
discontinuities of the first kind at x-x = 0, but their sum remains
o
continuous. A corresponding discussion in Yim (1963) for the wave elevation
immediately above the singularity is not correct.
A few symmetry relations which are helpful in the calculations
are listed below. First, of course, the flow and hence the potential
are symmetric with respect to the plane z = z. Therefore, as can be easily
verified, the first and second of Eqs. (12a) and (12b) must yield the same
result, and the third equation in each set the opposite result, if z is
replaced by (2z0z) [or if (z-z) is replaced by -(z-z), with both field
point and source points symmetric with respect to the xOy planej.
Secondly, if we consider field points and source points symmetric with respect o
13
for x-x > O (a=0), and are all zero for x-x < O (=rr).
o o
When both x-x = O and z-z = O, = O and sgn w = O. We have then
o o = o y+y 4k2 r o O y R3 R'3
E
(l+u2) [- eE1()}du
(16)to the y axis, that is, if we replace in Eqs. (12) (x-x0) and (z-z) by, re-for brevity
spectively, -(x-x) and -(z-z0), we have, again using partially
z
where the functions (x,y,z; x ,y ,z ), i = 1, 2, 3, are defined by
o o o x. i E (1+u2)
/+
eky+y
J -f = o A cos[k0/i+u2{(x_x) + u(z-z)}]dui=i
rB (i+u2) k2(i+u2) e°0
0J
A sin[k/i+u2{(x-x) + u(z-z)}]dui=2
k2 u/'+ -k Iy+yI (i+u2)
2 o' o' u e o Acos[k/1+u(x-x)
+ u(z-z)}]dui=3
(19) the notation x1 = x, x2 = y, x3 = z, -(x,y,z;x,y0,z0)
i = i
X o X.y
(-x,y,-z;-x ,y,-z0) = +
(x,y,z;x0,y0,z0)
i =
2(l8a) J-and.
-
(x,y,z;x0,y0,z0)
i =
3 z -f -(x,y,z;x,y0,z0)
,i = i
f X.i
s(_x,y,_z;-x0,y0,-z0) =
X -f(x,y,z;x,y0,z0)
, i = 2 y (18h) -f -(x,y,z;x,y0,z0)
,i =
315
The limits of integration A and B are given by
x-x A=- , = for z-z < O z-z o o x-x
A = , B =
O for z-z > O z-z o oThe potential represents the far-field term for waves traveling upstream
instead of downstream from the singularity (the radiation condition it
satisfies is that no waves are propagated downstream from the singularity).
The interest of Eqs. (18b) lies in the fact that the derivatives of both
potentials and must be calculated in the evaluation of second-order
nonlinear contributions to the wave resistance of a body.
IV. NUMERICAL CALCULATIONS
The local and far-field terms of the velocity components,
are given respectively by Eqs. (12a) and (l2b). Evaluation of the
complex integral E1(), = + in, involved in the integrands of Eqs.
(l2a) was carried out using formulae suggested by Hershey (1959). For E,
n such that either + n2 < 1 or +
O.O22
+ O.044n2 < O the well-knownseries expansion (cf. e.g. Abramowitz and Stegun 1964) nfl
E1() = -y-ln-
(-1)n n!
n= 1
where y is the Euler number, 0.5772157..., was used. For = ± iO,
< 0, one has ± iO) = E1() ± ir with*
E1() =
-t dt = -y-log 1n (22) _d nOn! n=1 *E1() = -Ei(-) as defined in the National Bureau of Standards Handbook
with
2 2 2 2
For , n satisfying both Ç + > 1 and Ç + O.02Ç
+ O.O44 O a
rational polynomial approximation for the product
Ç1(Ç)
, in terms of(l/Ç), was used. This is given by
Ç
E(Ç)
14 p(l/Ç) = a (l/Ç) n n=O 14 q(l/Ç)= V
c (1/Ç)n n n= Owhere the coefficients a , c are given in Tables A-1 and A-2 together with
n n
the ratios a /c and c /c , which are the quantities needed 1n the
compu-n n n n-1
tations. The range of arguments for the present study is
- ç
< O and- < < . Actually because of the conjugate relationship
e
E1()
0Ç
E1(Ç)
the calculations need only be performed for O < n < The subroutine AINTP
pre-pared to compute the complex exponential integral has been checked by comparison with the tables published by the U. S. National Bureau of Standards (Austin 1964,
Abramowitz and Stegun 1964) - With this subroutine available for computation of
the complex exponential integral, the integration in the variable u in Eqs. (l2a)
can be carried out using Simpson's rule without difficulty. The discontinuity of
the first kind in E (Ç) for Im Ç = O [that is, u = -(x-x
)/(z-z )J
can be handled1 o o
by choosing the corresponding value of u as a point of subdivision of the
inter-val of integration, and then using (21) and (22) - As an illustration Fig. 2 shows
the integrands in Eqs. (l2a) for a particular set of values of the dimensionless
parameters defined immediately below, and u between O and 1.
(23)
/
The far-field terms, as given in Eqs.
sin
f(u) g(u) du
cos a
(l2b), are integrals of the form
(24)
with
/l+u2
y+yoI
L 0. 0. o. 0. 0 -0.2 -0.4 -0.6 -0.8 -1.0 -1.2 17 * x-derivotive y-derivotive -I
\\\
I'\
I I I I 01 0.2 0.3 0.4 0.5 0.6 07 0.8 0.9 1.0 ARGUMENT uFig. 2 Integrand of the double integrals: F = 0.40, y/2c = -0.15,
0.25 0.2 0.15 0.1
o
z
0.05I
z
- 0.05 -0.1 -0.15 z-derivativex -derivative
y - derivative oi
ARGUMENT uFig. 3 Integrand of the single integrals: Fr = 04l y/2c = -0.25,
0.25 0.20 0.15 0.10 0.05 -0.05 -0.10
-015
-0.20
-2 x- derivative 19II
II
III
It il I IIIIi
y-derivative
-V qFig. 4 Integrand of the single integrals: Fr = 0.4, y/2c = -0.25,
y = 0, (x-x)/2c = 4.0, (z-z)/2c = 1.8
0 1 2
and
g(u)
k/l+u2
+ u(z-z)] (26)(Only the case z-z > O has to be considered due to symmetry) . For
conve-o
nience we introduce in Eqs. (25) and (26) a length parameter 2c which, in
the particular case in which the present computational techniques were applied, represented the focal distance of a submerged spheroid and, in general, can represent a characteristic length parameter of the body under
and sin f(u) g(u) du cos
/2
uy i+u -k y+y (i+u2) (i+u2) ' o' 2 e d(L+uconsideration. Equations (25) and (26) can then be written as
1 2 f(u) i +u
- - (l+u
(27)F2
2c e r (x-x ) (z-z g(u) - 2 '"J+u 2c + 2c (28) F rwith F2 = U2/2gc. Figures 3 and 4 illustrate the integrands in (24) for
Fr = 0.4, y/2c = -0.25, y = 0, and two sets of values of the coordinate
parameters (x-x)/2c and (z-z)/2c. The integrands are fast-decaying
oscillatory functions and different methods have been adopted in various
wave-resistance studies for their numerical integration. I this work
two methods were used and compared: a direct application of Simpson's
rule and a generalization due to Smith (1967, 1968) of Filori's formula. [The
reader is referred to Davis and Rabinowitz (1967) for a general discussion of the
numerical integration of oscillatory functions.1 Hermite-Gwssian quadrature
was also tried but was found to give (as expected due to th oscillatory
nature of the integrands) rather inaccurate results, even cìen a 50-point
formula was used.
1 crude upper bound for the truncation error due to ;topping the
integration in (24) at u = X > O can be obtained as
i <
21 -k y+y0 (l+A2) (1+A2)jy+yJ [ o [l+k
le
o - 2 k2 (y+y)2A better estimate of the truncation error can probably be derived by
esti-mating the positive and negative contributions from each "cycle" of the integrand (that is, the contributions to the integral between consecutive
zero-crossings of the integrand). However, since the time needed for
calculation of the "single-integral" terms, Eqs. (12b), of the velocity components was about 1/10 of the time required for evaluation of the
expon-ential integral (or double integral) terms, no attempt was made at improving
(29) (See also the following section.)
The computer subroutines developed in Fortran IV language for evaluation of the local and far-field terms as described above are presented in Appen-dix E. For the far field terms both Simpson's and Filon's methods are
included, although as will be discussed further in the following section Simpson's rule is preferable for application to the calculation of second-order wave resistance effects, due to the relatively small values of the
coordinate parameters (x-x)/2c and (z-z)/2c. The computing time required
for evaluation of each velocity component is approximately 0.6 second and 0.4 sec-ond, respectively, for error bounds of 0.1 percent and 1 percent, with the
evalu-ation of the double-integral term given in Eq. (12b) taking about 90% of this
time.
V. DISCUSSION AND CONCLUDING PEMARKS
As briefly mentioned in the introduction,early treatments of the
principal-value integral in Eq. (1) made use of a contour of integration
in the complex plane consisting of the contour shown in Fig. 1 with path
5 along the imaginary axis. This is essentially the method used by Yirn
(1963) and leads to a double integral with an oscillatory integrand, the
evaluation of which is rather time-consuming. Yim used a transformation due
to Barakat (1961) through which the resulting integral in k (along the ima-ginary axis) is written as the sum of two other integrals with non-oscillating
integrands. These integrals cannot be obtained in close form, however, and
as Ai (1965) has shown, the class of integrals dealt with by Barakat can be
more efficiently computed in terms of the exponential integral. The
bility of using Barakat's transformation was therefore not examined any further
-The contour of integration proposed by Smith et al. (1963) leads
di-rectly to a nonoscillatory integrand and, as shown in this work, to a single
integral with the integrand expressed in terms of the complex exponential
in-tegral. Hess and Smith (1966) and Smith (1968) used, rather than the
exponen-tial integral representation, a rational approximation for the function e_T to
calculate in the case n = 1 the integral I defined below Eq. (7) , but a
corn-n
plete example of numerical calculation of the principal-value double integral
is not given in the references cited. Hershey's algorithm for numerical
cal-culation of the exponential integral uses partially, also, a rational polynomial
approximation, but directly for the exponential integral, and was therefore
chosen in the present work. Any faster algorithm for the calculation of the
exponential integral would certainly represent a welcome improvement.
For completeness, we mention here also that Smith et al. (1963)
con-sidered in addition a differential-equation method to calculate the
principal-value integral in (1), leading to sine and cosine integrals and related
functions, and to an integral over a finite interval with a smooth
inte-grand. The final result does not show explicitly however the far-field and local contributions, and the method seems to have been abandoned in favor of
the one mentioned above.
Other authors (Yeung 1972, Adee 1973) have used also the contour of
integration of Fig. i to evaluate the principal-value integral in Havelock's
source function. Yeung carried out the resulting double integration
numeri-cally, using an estimate of the truncation error in the evaluation of the
integral in T fl Eq. 5 (for n = O) . The double integrals evaluated by Yeung
are those needed in the calculation of sinkage and trim in first-order thin-ship theory, and correspond to particular values of the coordinates of the
source and field points, specifically y = z = O, z = O, for which the
dis-continuity defined by Eq. (21) does not arise in the ca1cuation if x x
because Im Ç = k sect (x-x) O. However (for x x) the slope of the
real part of the integrand in the neighborhood of its zero [given by
T-kysec2
t = O; see Eq. (5)1 may be large, and a separate expansion tohandle this "numerical singularity" was used by Yeung in the calculations.
These problems are avoided through use of the aigorith ava: lable for calcula-tion of E1(Ç), as shown in the present work.
23
Adee's calculations apply to any coordinate values (as do also those presented here) with Simpson's rule being used to carry out all
integrations. To handle the principal value integral I , n = O, for
w = O [see Eqs. (6) and (7)] Adee used a Taylor series epansion about
the pole and evaluated the integral term by term. This expansion could be
avoided by modifying Simpson's rule according to a technique due essentially
to L. Landweber (see e.g. Farell 1973). However, this point is not essential
since the method proposed herein eliminates altogether the need for
calcu-lating any principal value integral.
Hershey (1972,1973) uses a different technique for evaluation of the double integral, which is first expressed as an integral with the
integrand in terms of the complex exponential integral. Asymptotic and
convergent approximations for the derivatives with respect to x, y and
z are then derived. The calculation of the successive terms of the
convergent approximation is carried out term by term through use of recurrence
equations. (The convergent approximation is the one that would have to be used
in the calculation of the second-order nonlinear contributions to the wave resistance of a submerged body because most of the second-order correction
comes from the near-field first-order approximation.) The writers have
not examined however in detail Hershey's algorithm, mainly because of time
limitations. It would have indeed required a significant effort toierify
all pertinent derivations and calculations and implement the corresponding computer programs, in particular because the presentation and discussion
of
the algorithm are not always clear in the references cited.Regarding the evaluation of the single integral representing the
far-field term, Smith et al. (1963) proposed first the calculation of each
"cycle" of the integrand (i.e., contributions to the integral between
consecutive zero-crossings of the integrand) by Lobatto quadrature for a
number of cycles, and interpolation for the remaining cycles, a method they
developed only for the region outside the Kelvin wave angle due to the
difficulties involved in the calculation of the zeros of the integrand.
Smith (1968) used however a different method based on Filon's (1929)
formula for integrals of the form f(x) sin k x d x and found that this
method was more efficient than Simpson's rule for large values of the
For the calculation of the second-order contributions to th wave resistance
of a submerged spheroid, however, with 0.35 < Fr < 0.70, it was found that
the second-order correction comes from a region well within the square
O (x-x)/2c 5, 0 (z-z)/2c1 5, and in this caso Simpson's rule
turns out to be more efficient.
In summary, although actual computing times on a given computer are
not available for a quantitative comparison of different techniques, it
ap-pears from the preceding presentation and discussion that the numerical
cal-culation of the double integral term in Havelock's source function and in
its derivatives is more efficiently accomplished introducing the complex
ex-ponential integral as shown in this work, and using an adequate algorithm
for computation of this function. For the computation of the single
inte-gral representing the far-field term, in the region of interest to wave
re-sistance studies, a direct application of Simpson's rule wa: found to be
25
REFERENCES
Abramowitz, M., and Stegun, l.A. (1964) Handbook of Mathematical
Functions, National Bureau of Standards Applied Mathematics Series, Vol. 55, U.S. Government Printing Office, Washington, D.C..
Adee, B.H. (1973) "Calculation of the Streamlines about a Ship Assuming a Linearized Free-Surface Boundary Condition", Journal
of Ship Research, Vol. 17, No. 3, pp. 140-146.
Ai, D.K. (1965) "A Class of Multiple Integrals of the Stationary
Phase Type Occurring in the Theory of Water Waves," Hydrodynamics
Laboratory, Karman Laboratory of Fluid Mechanics and Jet Propulsion,
California Institute of Technology, Pasadena, California, Report
No. E-lll.4.
Astin, A.V. (1964) Tables of the Exponential Integral for Complex
Arguments, National Bureau of Standards Applied Mathematics Series, Vol. 51, U.S. Government Printing Office, Washington, D.C.
Barakat, R. (1961) "On a Class of Integrals Related to Those of
Raabe and Laplace Occurring in the Theory of Water Waves,?? Journal of Mathematics and Physics, Vol. 40, pp. 244-248.
Davis, P.J., and Rabinowitz, P. (1967) Numerical Integration,
Blaisdell Publishing Company, Watham, Mass.
Farell, C. (1973) "On the Wave Resistance of a Submerged Spheroid,"
Journal of Ship Research, Vol. 17, pp. 1-11.
Filon, L.N.G. (1928)"On a Quadrature Formula for Trigonometric
Integrals", Proceedings, Royal Society of Edinburgh, Ser. A, Vol. 49, pp. 38-47.
Hess, J.L., and Smith, A.M.O. (1966) "Calculation of Potential Flow
About Arbitrary Bodies", Progress in Aeronautical Sciences, Vol. 8,
Pergamon Press, New York, pp. 1-138.
Hershey, A.V. (1959) "Computinq Programs for the Complex Exponential
Integral," NPG Report No. 1646, U.S. Naval Proving Ground, Dahlgren, Virginia.
Hershey, A.V. (1972) "FORTRAN Programming for Surface Wave Trains,"
NWL Technical Report TR-2714, U.S. Naval Weapons Laboratory, Dahigren,
Virginia.
Hershey, A.V. (1973) "Interpolations of Surface Wave Trains' NWL
Technical Report TR-3064, U.S. Naval Weapons Laboratory Dahlgren,
Virginia.
Lunde, J.K. (1951) "On the Linearized Theory of Wave Resistance for
Displacement Ships in Steady and Accelerated Motion", Transactions,
Smith, A.M.O., Giesing, J.P., and Hess, J.L. (1963) "Calculation of Waves and Wave Resistance for Bodies Moving On or Beneath the Surface of the Sea," Aircraft Division, Douglas Aircraft Company,
Long Beach, California, Report No. 31488A.
Smith, A.M.O. (1967) "Numerical Integration of Oscillating Functions
Having a Non-Linear Argument," Aircraft Division, Douglas Aircraft
Company, Long Beach, California, Engineering Paper 3373.
Smith, A.M.O. (1968) "Recent Progress in the Calculation of Potential
Flows," Seventh Symposium on Naval Hydrodynamics, Rome, Italy.
Ursell, F. (1960) "On Kelvin's Ship-Wave Pattern", Journal of Fluid
Mechanics, Vol. 8, Part 3, pp. 418-431.
Yeung, R.W. (1973) 'Sinkage and Trim in First-Order Thin-Ship Theory,"
Journal of Ship Research, Vol. 17, No. 3, pp. 140-146.
Yim, B. (1963) "Waves due to a Submerged Body," Hydronautics, Laurel,
27
APPENDIX A
COEFFICIENTS OF THE POLYNOMIALS
Table A-1. Coefficients of the polynomial p(l/z)
a 1.0000 0000 0000 a /c 1.0000 0000 0000 0 0
00
a1 5.18)47 ri46 30143 a1 / 9.8107 1512 5261 -1 a2 1.1132 1886 0907 a2 / 9.5631 9338 3538 -1 a3 1.3030 173)4 1425)4 a3/c3 9.2)4)48 31431 2539 -1 a)4 9.2167 7639 9261 a)4/c)4 8.8)429 61)41 9210 -1 a5 )4.1303 1175 5157 a5/c5 8.3)456 5894 5319 -1 a6 1.19614 5065 97)43 a6/c6 7.7432 5089 1313 -1 a 2.2)463 9376 6690 a7/c1 7.0298 1484 9331 -1 a8 2.7016 6091 61413 a8/c8 6.20148 7508 6185 -1 a9 2.0251 3476 9983 a9/c9 5.27145 367)4 6970 -1 a10 9.0163 7336 6)4 a10/c10 14.25314 68714 2467 -1 a11 2.1965 6338 6832 a11/c11 3.1672 8026 9)448 -1 a12 2.522)4 8375 3806 a12/c12 2.0517 6261 14937 -1 a13 9.8326 285)4 3827 a13/c13 9.95147 0633 2822 -2a4
2.8400 7982 1772 a114/c114 1.1596 2796 1020 -2Table A-2.
CoeffiCients of the polynomial
q(1/z)
C o1.0000 0000 0000
Co1.0000 0000 0000
0 Cl5.2841 17)46 30)40
Cl/Co5.28)47 i)46 30)40
C2i.i6)4o 6603 5539
C2/C12.2027 02)49 7683
1 C31.409)4 5)451 2870
C3/C21.2108 0288 3891
C)41.0)422 1260 1037
C4/C31.39)48 6511 6395
O C54.9)490 5)409 1737
C5/C44.7483 2983 8868
0 C61.5)451 5290 2315
C6/C53.1221 1762 8286
0 C73.1955 0809 6207
C7/C62.0680 8535 9919
0 C84.35)40 9396 )4)4i
C8/C71.3625 6702 6480
0 C93.839)4 5523 0162
C9/C88.8180 3)48)4 5)488
-1
C102.1197 6951 3701
C10/C95.5210 1635 9)427
-1
Cli6.9351 7213 4971
C11/C103.2716 6330 5913
-1
C121.2258 3807 0677
C12/C11
1.7675 6689 9301
-1
C3
9.8773 6676 0090
C13/C128.0576 4398 770)4
-2
C)42.4)491 3016 69)49
c14/c13
2.4795 3753 91)40
-2
29
APPENDIX B
s
.s
s est 3 s 3 Yt00 OIIZIVIITNI 3'Iii
çtt0O
3 'Oh ÇfiTflO £ '1 ZAXI 86 00 '6 O tifjlOC?iJ'i
ZJJ 3 s9 r îrcu Z-Z'XS4 013' X-X'X'SOtJ'.>lA'XS9I'x0T'///1 1vILl0Ott
LJXZIiZ')4XWX')1A'IXI (QTT'9)3II (S01.i'nivwci
6ot h&:rflo çn jj'MZwZ')1X4X'A (6OT")0]i
1Ç 'ZIOO ININ 'T 1X1 66 00O
ZZLOO 3 'CZ IZtOû31
15NO38Z
TZT.(311 3LZ
oztrm IISJOJ Z U?tfl0 ¿1II1't1IkI1'ftJJ (Z'9) 31IJN 1tÚfl (QtI'ZUtjI 1WiOJ T ININ 'Z1II1'111iI1'Th3 (t 'c 0v3JZ
NIJIflO 3ZZ
£OtCO ZAXI'Zj'ZkZ')(XWX'>4A ,vioi .owwoo *iz ornn 0 1N3IX3 *0? 10130... 'ei
co:oo ONfl3GJ0d3
3AIIV13i 3 '81 OCT 00 S3tY1VA 7V33INI a31v-rnolvo SWOS O'Lt
001110 A3AIL33dS3J S1N3NCd03 Z 'A 'X 3.LV3IONI L 'Z '1 ZAXI 3 '91 001(10 03iVfl1VA3 31 01 SN0IiVi93INI 30 0N iNIN O'SI
00100 3NlIflUd 3111G 5,NÚSdWIS D st,! QO0O NI 3111V1t 1VJJJINI30 CUOIIYIflJwO33d 30 ( XVW
Z1IkI1 o 'ci03511 38 01 S1YAGJIN: (OIiY331NI 30
0N XVW IIIWI1 3'lT
(33fl1>JCS/11 0t4 0fl3dj 3.11
CG 3Z/(>IZ-Z)'3Z/C34AsA)'3Z/(X-X1 >ZWZ'WA')XWX D .01O;i.
0301113N1 ION 3 '6 3iV 91 HDfl01HI VZ1S03 NI Id/(Z's0nZ
j3113 3ii 1HI 3L0N
3.8
ou:; 3'L
.9
flfl!IIH 3.
OClUÍ)3111J S. l.0SdvIS AO (Wè131 1VOO1) 1VGO3INI
38flO0 JO NOIIV111VA3 3
'ti
OCT00 3 sc Ofltflfl *Z00:45 06150 00151 130151 CCUS1 'Jul52 JUl55 130151 '30331 00102 1313164 0tfl66 CD167 00170 130171 00173 00175 00176 63177 C011i 136700 66700 013200 0132130 1313201 (J0O? tju:'os 002J6 00206 00206 00206 00206 60210 130212 00213 30214 00214 JG?16 30217 136220 00222 6622? 00224 LU225 00776 44* 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55* 56. 57. 58. 59. 60* 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71* 72. 73. 714* 75. 76e 77. 79t 79. 80. 81* 82* 83. 84. 85. 86. 87. 88. Rq. C C C 1001 1002 1003 C 1004 C C C 91 C C C C C C 92 SUMS Z 0.0 CFXZ z 1. SPECIAL TREATMENTS FOR XMXK O AND/OR ZMZK z O. IF(IXYZ-2) 10O11OG2.1O03 IF (XMXK.EQ.O.) GO TO 25 IF(ZMZK.NE.0.) GO TO 1004 MM z
i
CFXZ z 2. 60 TO 91 IFC(XtIXK.ZMZK).NE.0. GO TO 1004 MM 1 CFXZ 2. 00 TO ?1 IV (ZMZK.EQ.0.) GO TO 25 IF(XMXK.NE.0.) GO TO 1004 MM zi
(.FXZ 2. CO TO 91 GENDAL CASE, X?IXK AND ZMZK .NE. 0. MM Z 2..*
t SGNU z 1. 00 15 TSGNU z MM A z 0.0 IF(ISONU.EQ.2) SONO z-i.
s..
*s..
' SPECIAC TREATMENT FOR C7SES WHERE DXZ ZZMXK+U.ZMZK IF(ZMZK.EQ.0.) GO TO 9 SZ = Zt<cSGNU XOSZ z XMXK/SZ IFfXOSZ.GE.0.0) GO TO 9 IJELU z 5.00-04 8 z A3S(XMXK/ZMZK)S3GNtJ-OELUIF
(IXYZ.NE.2) GO TO 92IF
tABS(B).GE.4.Oj GO TO 9 IB = ABS(B)/10. TU z 113+1 AlB z IB =0 IS POSSIBLE.ur,:'zi 90. n. 38 B/AID 8 0.3 O 00 2' 2 92. [00510 ERR O 00226 Uu::32 93* 00 21 lOI 1. IB 0032' 3 94. A B 000233 'U23L 95. B 8.08 005234 0337 90. CALL SMPSN (G,A,B,ERUSED,LIMIT2,SI1,S,NUM,IEP) CCO26 03240 97. 21 SUMS = St'MS+S*SGNU C 00251 98. A 8G2.0*DELU CCC2G 91. B 8.0.1*8 O"C262 00744 100' ERP ERUSEtJ.10.0 2002Ç 6 101. CALL SMPSiG,A,D,ERp,LIMIT2,ST1,S,NUM,TER) 00C2 71 0324L 102* SUMS SUMS4SsSGNU 900304 Ou:. 47 103. A B 000311 uo:'So 104. 6 8.CONST o O031 00251 1(15. CO TO 10 0003! 4 i.;'si 106. C r co 3114 íio:5L
iii.
c 000314 (102 ,1 106. CXMXK ANO USZMZ(< HAVE SAME STCN (I.E. DXZ IN 0(0) CAN NOT BE ZERO).
00031
I
00251
109.
C
00 IXYZ = 2 ANO ABS(XMXK/ZMZKLCE.4.O.
900 314 LO51 110. C 000314 ..7E1 111' C 000314 10752 112. 9 8 4.UsSGNU 00031G 00252 113. C r no 316 0025? 114. C 's. *
t..
000316 00252 115. C 00031G 00253 116. 10 [ROSEO ERR 000321 00254 117. [RUSE ERUSED.10. O 003" (10255 119. ERRi 0.1 003324 (10255 119. C 050374 UC?56 120. 00 1 L 1' LIMITI orc3T' LJ0?6l 121. 3 CALL SMPSN(C.A.B.ERUSELIMIT2.ST1.S.NUM,IER) 000332 (10252 122*1F (IEfl-4
5.6.5 000344 00265 123e 6 [RUSED [RUSED.1U.0 003347 0O?66 124* IF (ERUSED.LE.O.(11) GO TO 3 0O03? (10270 125. IF ABS(ERUSED-O.uj).L[.1.0E--06) COTO 3 CCO3 S 00272 126. WRITE (67) [RUSED 000363 (10275 127.7 FORiAT (SX,'.**.. [ROSEO EOUAL TO
'
F1C.6.'
.11) 000371 00710 128. GO 0 15 050371 00276 129. C 000371 [0277 130. 5 SUMS SUMS+S.SCNU 000373 fl0300 131. IF CABS(S-ABSERR1.SUMS)) 113,113,144 000376 fl3303 132*113 ir
(ABSCRL_ERR,.LTnV_nr!Ifl Tfl
1 nnna nc 00105 133* [ROSEO 1O.0.SrLJSED 00041? 00306 134. ERRi ERR1/1C.0 O PO4 15 UC07 135. IF(ABS(S).LE.ASS([RR1.SUMS)) GO TO 113 000423 00!tJ7 136. C O 0 04 '0END 0F COMPILATION: NO DIAGNOSTICS. 00100 1* C SMPSNOC1 000000 JUICO 2* C .... SMPSN0O2 0000CC 30100 3* C SMPSN003 0000CC 001.00 4' C SUBROUTINE SMPSN SMPSN004 COUCOU 30100 5' C SMPSNOOS 000000 00100 6. C PURPOSE SMPSNOO6 000000 1)1)100 7* C
INTEGRATES THE GIVE& FUNCTION OVER THE PRESCRIBOD
RANGE SMPS1qOO7 000000 001.00 A. C SMPS0008 000000 9. C USAGE SMFNIJO9 006020 01,100 10* C CALL SMPSN 1F,A,B.DEL.IMAX.SIi,SNIERJ
SMPO1O
000000 0001) 11* C sripsNoiì 000000 01)100 12' C DESCRIPTION 0F PARAMETERS S'PSN012 000000 U00O 13$ C FNAME OF USER FUNCTION SUBPROGRAM GIVING F(X
SMPSNO13 000000 01.00 14. C A
L0ER INTEGRATION LIMIT
SMPSNO14 0000CC 00100 15. C B
UPPER INTEGRATION LIMIT
SMPSNO1S 000000 0U311 137. 14i A z 9 OU 04 2 7 30312 138* 14 B z BsCONST 0004 '0 00311e 139. 68 z ß/CONST 000414 1)0315 11+0. WRITE (C.8 38 000436 00320 00320 141* 11+2P r 8 FORMAT
10X'REQuIRE0 ACCURACY NOT MET IN
LIMITi STEPS',SX, 'B Z '.F20.15) 000446 000446 00320 11+3. 00041+6 00321 14e* 15 CONTINUE 0001+4 6 00323 145. SUMS CFXZ.SUMS 00041+6 00324 146. 25 WRITE t6116) YK,XMXK,ZMZK.SUMS,ERUSED,B 000452 00331+ 00334 147. 148. 16 FORMAT (//,2X.YKz',F8.4,2x,'x_xKz',F8.r,2x..Z_zçz..F8.4, 1 2X,'SUMSZ'.E25.10,2X,'ERUSEOZ,F10.7,2x,'Bz',FiO.3,///) 000470 C C 04 70 00334 149* C 003470 1)0335 150* 98 CONTINUE 000470 30335 151* C 000470 00337 152. 99 CONTINUE 0004 '0 00331 153. C 030470 06341 151+. CALL EXIT 0004.?O 0031+2 155. END 000474
00100
16.
C
DEL -RE2UIRED ACCU9ACY
OR TOLERANCE SMPSNO16 uc:ou 11. C IMAX-MAXMUM NUMBER OF
RECOMPUTATIONS OF INTEGRAL VALUE
SMPSNO17
mnoo
la.
C
SIi -RESULTANT VALUE OF
INEGRAL JUST PRIOP TO FINAL
SMPSND13 00100 19. C EVALUATION SMPSNC1O 00100 20. C S
-RLSULANT FINAL VALUE
OF INTEGRAL SMPSNU2O 00100 21* C N
-RESULTANT NUM3ER OF INTERVALS
USED IN COMPUTING S
SM}'SNOLl
UU1U[)
22.
C
1ER -RESULTANT ERROR CODE
1HERE SMPSNO22 00100 23. C ICR 1i NO ERROR SMPSNrJ23 00100 24. C ICR 1
AB
SMPSNO24 00100 25* C ICR 2 DEL0 SMPSNO25 Cïou 26. C ICR 3IMAX LESS THAN 2
SMPSNO26 IJL 00 21. C IEi q
REQUIRED ACCURACY NOT MET IN
IMAX STEPS SMPSNOZ7 tJrJIOU 28. C SMPSNO28 DO1OU 29. C REMARKS SMPSNUZ'3 00100 30. C
SEE ERROR CODES ABOVE
SMPS030 QUICO 31. C SMPSNO]. 0tJ100 3?. C
SUBROUTINES AND FUNCTION
SUBPROGRAMS RORUIRED
SMPSNC32
00100
33.
C
F - FUNCTION SUBPROGRAM WHICH
COMPUTES F(XJ FOR X BETWEEN
SMPSND33 00100 34. C A AND B. SMSNO34 001Db 35. C
CALLING PROGRAM MUST HAVE FORTRAN
EXTERNAL STATEMENT
SMPSNO35
00100
36.
C
CONTAINING NAMES OF FUNCTION SUBPROGRAMS
LISTED IN CALL SMPSNO3G CUiCO 37. C TO SMPSN SNPSNO37 00100 38. C SUPSND38 00100 39' C METHOD SMPSNO3B UUCJL' 40. C
SIMPSONS RULE IS PERFORMED WITH
INTERVAL HALVING UNTIL
SMPAND4Q
00100
41.
C
LESS THAN DEL. FAILUR TO REACH
THE TOLERANCE ArTE
IMAX
SMPSNO41
00100
'42.
C
TRIES TERMINATES THE SUBROUTIN
SXCUTTON. SMP#N042 QUICiO '43. C SM'SNO43 0UUD 44S C SMPSNO44 00100 45. C SNPSNO'45 00101 46. SUBROUTINE SMPSNIF,A,B,DEL,IMAX.SI1,S,N.IERI SMPSNO4O 00:01 '47. C SUPSNO47 00101 48. C SMPANRLe3 L0101 49. C SMPAN04B LICI 01 50. C
IF A DOUBLE PREC 1510M VERS IO
N CF THIS ROUTINE IS DESIRED, THE
SMPSNC5O
00101
51.
C
C IN COLUMN i SHOULD BE
REMOVED FROM THE DOUBLE PRECISION
SMPANO51
UC111
52.
C
STATEMENT WHICH FOLLOWS.
SMPSNO52 00101 53. C SMPSNG53 (iiD1 54. C DOUBLE PRECISION A,8,DEL,SIi,S,BA,X,SUMX,FÍ?STX,XK,FINC,F SMPSNO54 00101 55. C SMPSNO55 BU.01 56. C
THE C MUST ALSO BE REMOVED
FROM DOUBLE PRECISION STATEMENTS
SMPSNO5G
alilCi
51.
C
APPEARING IN OTHER ROUTINES
USED IN CONJUNCTION WITH THIS
SMPSNO57 00101 5e. C ROUTINE SMPSNO53 00101 53. C SMPSNOS9 00101 OU. C
THE DOUBLE PRECiSION VERSION
OF THIS SURPOUTINE MUST ALSO
SMPSNOGO
00101
61*
C
CONTAIN DOUBLE PRECISION FORTRAN
FUNCTIONS. ABS IN STATEMENT
SMPSNOG1
00101
6?.
C
27 MUST BE CHANCED.TO DABS.
U' 00101 63. C SMPSNC63 000000 00101 64. C
USER FUNCTION SURPROCRAM,F, MUST BE IN OCUOLE PRECISION.
SUPSNCJ64 000000 00101 65. C SMPSNO6S 0000CC 011101 66' C SPSNC&6 0000CC 00101 67' C SP!PSNOE7 000CUO 00101 £8' C SMPSNO5O 000000 110103 69. S 0.110
SPS069
300000 00104 70* SI10.00 SMPSN07O 000300 00105 71.NO
SMPSNO7I 000901 00106 72. BA8-A SMPSNO72 000002 73. IFtOAI 20.19.20 SMSN073 000005 00112 74. 19 IER1 OMPSNÛ74 000006 118113 75. RETURN SMPONO75 000010 00114 76* 20 IF(DEL) 22,22.23 S?'P5N076 000014 0017 77. 22 IER2 SMPSNO77 000016 00120 78. RETURN SMPSNO78 0000'C 00121 79. 23 IF(IMAX-1) 2q,24,25 SMPSNU79 000024 110124 80* 24 IER3 SMPSNO8O 000027 00125 81* RETURN SMPSNO81 000031 00125 82. C SPSN082 000031 00125 83. C COMPUTE SIOMA(i) SMPSN003 000031 00125 84. C SMPSNO84 0000'l 00126 85. 25 X8A/2.+A SMPS'1035 000075 00127 86. NHALF1 SMPSNOB6 000040 110130 87* SUMF(XI.BA.2.f3. SMPSNC87 00004? 001318s
SsUM:r(A)4F(B)).BA/6. SMPN083 000051 00131 89. C SMPSN089 000051 00131 00131 90, 91. C CDIVIDE (A.B) INTO 2.'i,... .2..I INTERVALS. COMPUTE SIGMA(2).SIGMAC4)...ST6MAtI)
SMPSNO90 SMPSNCS1 000051 000051 00131 92* C SMPSNU92 000051 u0132 93* DO 28 I2,TMAX SMPSNC93 000072 00135 94* SI1S SMPSNOO4 000072 00136 95* S(S-SUMK/2.)/2. S?PSNO95 000074 011131 96* -ALFUHALF.2 SMPSNO96 000101 00140 97.
AMHLFNLF
SMPSNO97 CC0104 011141 98* FRSTXA+(6A/ANHLF)/2. S1PSN098 or'oiOi 011142 99* SUMKF(FRSTX) SMPSNDO9 000114 00143 100. XKFRSTX SPSN1DO 000170 00:44 101. KLASTNHALF-1 S'PSN101 000127 00145 102. FINC BA/ANHLF SMPSN100 fl0126 00146 103. DO 26 K1,KLAST SPSN103 000173 00151 104. XKx:-FINc SPS11104 000133 JUl52 105. 26 SUMSUMK+F(XK) SMPSNIO5 0001'5 00154 106. SUM)SUK.2.*8A/(3.*ANHLF) SP0N10b 000143 fl0]5 107* SS#SUMK S.PSN107 000151 00155 108. C SPSN108 000151 011155 109* CCO9PARES THE I-1H AND tI-1JST RESULTS
S'IPSNIO3 000151 00155 110* C SPSNi10 000151 00156 .111* 27 IF(A8S(S-SI1)-ABS(DEL.S1) 29,28,28 SMP'Nlll 000153 00161 112. 28 CONTINUE SMPSN112 0flO16
031.53 113' 0016k 114' 00.05 115. )C.t65 iio. 06166 117. i0i67 118. IER4 GO TO 30 29 IER0 C 30 N2.NH!LF 30 RETURN E D E-'SNl13
-ur4h14
SPSN115 MP5N116SSW117
SMPSN113 END OF COMPILATION: NO DIAGNOSTICS. 00100 1* C U0100 2. C 00131 3* FUNCTION 0(0) 00101 4' C 00101 5' C 00101 6e C 00103 1' DOUBLE PRECISION ZETA,Z[TAI,ARCR,ARCI,DXZ 00104 8. COMMON /BLKf/ YK,XMXK,ZMZK,F2,IXYZ 00104 9* C 00105 10* U2P 1.00-'U*U r)u10t 11' RC5gRTfp)
Olf101 12' DXZ XMXK4ZMZK'U 00110 13. ZETAR -ABS(YK)*U2P/FR2 00111 14. ZETAI DXZeRCIFRZ 00hz 15e C%LL AINTP(ZCTAR,ZETAI,ARCR .ARGI) 001l2 16e C 60113 17* IF IIXYZ-2) 1i2t3 G011F 18' 1 G RCsARCI 00111 19* GO 10 4 00120 20' 2 C -U2P*#RCR 00121 21' GO TO 4 00122 22 3 G U.RC.ARGI 00123 23. 4 RETURN 00124 2k. END 00100 1. C 2. C 0t1100 3. C 00101 (3* SUBROUTINE AIrTPtX,Y,AITR,AITI) 00101 5. C 00101 6' CDEFINITION OF VARIABLE NAMES:
00131 7' C El Elf Z) 00101 8' C AI EXP CZ.E1(Z) 00101 9' C AlP Z.EXPfZ)eE1tZ) 00101 10* C aIT 1/Z-EXP(Z)'El(Zl
00101 00101 00101 11' 12* 13' C C C 0000CC 0006Go 0000cr (10103 14. IMPLICIT REALS8(A-H2O-Z) ancoro 00104 15' DIMENSION 0003(14),Aoccllq) 0006CC 00104 16. C 000000 00105 17' DATA C000/-0.528471746304D 02.-0.2202702497680 02 000000 00105 18* -0.121050238389D 02.-0.739486511EOD Ole-0.474832983887D 01 000000 00105 03105 19. 20. 2 -0.3122117628250 01.-0.206808535938D 01-C.136256702648D 01, 3 -0.8818034845490 O0.-0.552101&359430 00.-0.327166330591D 00. 000000 000000 '00105 21* 4 -0.176T56639931D CO3--0.8057643987700-01,-0.247953753914D-oj/ 000000 00107 22* DATA
A0CS/0.81077512526[1 OOeO.956319338354D OC.
0000CC 00107 23. 1 0.9244834312540 00,O.8842961419210 00i0.3345658945320 00. 000000 00107 24. 2 0.778325(JS97370 00.0.7029048459330 G0.0.6204875086190 00. 000000 00107 25' 3 0.5274536746970 00.0.4253408742470 00.0.3167280269450 00v 000000 00107 26. 4 O.205776261494D CO,U.935470633282D-01.O.115902796102D-01/ 00GO 00107 27. C 000000 00111 28' EULER Z 0.5772156649D0 000000 00111 23. C roocro 00112 30. Yl Y 000001 0011! 31. IF (Y.GE.0.00) 00 TO 52 000003 90115 32. Y -Y 000006 tJr)i15 33. C 000006 00116 34. 52 R2 = X.X+Y*Y 000011 110117 0O1?C 35, 36. 1IST1 R2-1.00 TESTZ X.0.0?D0.X.X+0.044D0.Y.Y 000016 0000'O JU121 ' 37. IF (TEST2.LT.O.00) GO TO 11 000031 00123 38. IF (TEST1.GT.0.00) GO TO 22 000034 00123 39. C 000034 00123 40* C SMALL Z. 000034 00123 41* C 000034 U12S 42* 11 ZLGR O.500*DLOG CR2) 000040 00126 43. ZLGI DATANtY/X)+3.1415926535900 000044 00127 44' IERi -X 000054 00110 45. TEli -Y 01(131 46. E1R -EULER--ZLGR-TER1 000060 09132 47. CII -ZLGI-TEI1 000065 60133 48' DO 15 Kl 1, 300 000073 00136 49. AK Kl 000073 00137 50. AKP Ki+i 000101 00140 51. COEF = -AK/(AKP.AKP) 000111 ufll'U 52. TER1P TERI 000115 53. TEI1P = TEIl 000117 61143 54. IERi COEF.(X.TER1P-Y.TEI1P) CC01?1 60)44 55. TEIl COEF.(Y.TERÎP+X.TEI1P) 0001"G 00145 56. [iR E1R-TER1 0001'S 00146 57. Cil Cit-TEll 00014G 0(1140 58. C 000140
(30146 (JLTI4E 59* 60* C C 61* IF I5ABSTER1).LT.0.0O0fl01DC} GO TO 12 00151 62* 60 TO 15 011152 63*
12 IF
DARS(TEI1).LT.O.00000ÎDO) GO TO 14 00154 64* 15 CoNTINUE 0015G 65* WRITE f6,5) 1<1.T[R1.TEI1 od163 65' FORMAT(2X,'K1z',I5,5X,'TR1',E2O.1O,5X,'TT1'.E2O.10)
67* C0014
66. 14 DOXP 1.00/DEXP(X) 1)L165 69* AIR ODXP.(OCOStY)*EIRDSIN(Y).E1) 00166 70All
DDXPS(OSINfl'!*ElR+DCOS(Yl.ElIl 0uiEÌ 71*Aufl
X/R2AIR 00170 72.AlTI
Y/R2II
0[fl71 73.co to
97 00171 74* C 00171 75. C LAGER Z. 00171 76* C 00172 77* 22 TERPACC5(1).0000t1).XIR2
00173 78. TEIP AOCS(1I.COCDt1)sY/R2 (30174 79. TERQ0000I1).X/R2
03175 80* TElO COCD(1)*Y/2 00176 81* PR 1.00+TERP 00177 82* PI TEIP 83* OR 1.06+TERO 000272 00201 84. 01 TEIG 000275 00201 85* C 00202 86* 00 25 1<22. 14
0U705 87* 1<2Ml 1<2-1 00206 88* COEFP CCSL2).0000(K2)/(R2.A0CS(K2M1)3 00207 89* TERPP TERP 00210 90*TIPP
TEIP 00211 91* TERP (TERPP.X+TEIPP.Y1*COEFP 000323 00212 92* TEIP (TEIPPsXTERPP.Y).00EFP 000331 002123'
C 000331 00Z13 94* COEFO COCD(K2)/R2 000341 00214 * TEROP TERO 020345 00211 96. TCIOP TEIu 000347 00216 97* TORO (TEROP.X+TEIQP.Y).00EFO 000351 00217 98* TEIG (TEIQP.XTERQP*YsC3EFQ 000357 00217 99. C O CO 3 6 7 00720 100* PR PR+TERP 000367 00221iCic
PI PI4TEIP 00037' 00222 102. 08 QR+TER 0003 75 00223 103* 01 QI+TEIO 0004CC 00224 104. IF (0ABS(TERO).LT.O.000O01DO GO TO 23 000403 00226105.
60 TO 25 0004 07 00227 106* 23 IF IDABS(TEIG).LT.O.0UGO1D0) GO TO 24 000411 00231 107* GO TO 25 000414um or CoMPILATIo:
NO
DIAGNOSTICS.
00232 011233 00234 011234 60234 Ud35 00236 10236 00237 06240 00241 00242 00242 (J6244 0024E 00247 00247 00250 00252 UO:'2 00253
108. 109. 110* 111* 112. 113* 114. 115* 116. 117. 118* 119* 120. 121* 122. 123* 124. 125. 126. 127* 128*
C C C C C C
24 R2 z 0IsR+QIs0!
AIPR
(FR*OR+PI.QI)/RQ2
AlPI z (PI.QflpR,'I)/R2 AIR z (X'AIPR.Y.AIPfl/R2 AIL z (X.AIPIYSAIPR)/R2 AITR z X/R2AIR AlTi z Y/R2AII CO TO '37
25 CONTINUE 97 IF (Y1.CE.0.DO) GO TO 99 y z Yl AlTI z AlTI 99 IF (Y.EQ.O.) AlTI z 0.0 RETURN END 000416 tJt'047 3 0 00(4 '2 000432 0004 ! 000442 CUO4C 000450 000460 000462 006464 000471 000471 000471 O C047 4 000476 000476 C 00501 0fl0505 000505 000661
00100 00100 1* 2* c******t**,*aa******t*****a*******a*t*****A****a*******a*************** C 000000 000000 ou loO 3* C EVALUATION U
TiE SINGLE INTEGRALS BY SIUPSUNIS
PuLEs 000000 00100 ü* C 000000 00 1 0 0 5 * * * * * * * * ** * a * * a * * * A * t * * A a * * * A * * * * * A * * * * * * A * * * A * A * * A A * * * * A * * * A * * * * * * * * * 0 000 () .1 001)0 * C 000000 oc loo 7* C N(TE T'AT TI-IF. CUEF (-4K0**2) IN f(, 124 IS NOT PCLUDED, 000000 00130 * C XMX = (X.XK)/?C 0()0000 9* C Y (+Y)/2C 000000 ooioo 10* C ZZK = (Z-Z)/2C 000000 00100 11* C FR RUIOF NP. U/S(PTCG*2C) 00100 C LIMI1i
LI0!T2 = LIMPS OF ITERATIONS FO
INTFGRATIO 000)00 00100 C EQUI'E) ACCURACY 000000 00)'0 ia C NINT
N, UF POINTS TO L3E EV4LLJTE!)
000000
ooioo
15*
C
5M$
CALCOLATED IÑIEGRAL VALUES
000000 00100 16* C 000000 00100 17* C******.*********a****************************************************** 000000 00101 l4* EXTERNAL F 000000 30103 19*
COMON /LA/ Y,XMX,ZMZK,FR2,IXYZ
000001 00j04 ¿0* READ (Spi) FR,ERR,LIMITi,LI1IT2,NINT 000301 00113 ¿1* 1 FR'A1 (Fi0.7,F20.1U,3110) 000013 OOliu 22* APIlE (h2) FR,ERR,LIMITI,LIMTI2,NNT 000013 00123 ¿3* ¿FORMAT (//,21,R:U/SPTC2tC,AC)',F.5.2X,'ERR',I0,7,2X, 1
'L1I 11:' ,I5,2X, ILIMIT2:t,t5,2X, ININT:' ,15,//)
000025 000025 00120 ¿5* FR2 z FR*FW 000025 00120
¿*
C 000025 00125 ¿7* 00 99 ¡Xli,
NINT 000040 00130¿*
READ (5,9) Y,XX,ZMZK 0000t) 00135 29. q FPR'.AT (3F 10,5) 000050 30. 'ITE (6,10) IXI,YÇ,XMXX,ZMZ 000050 0fl1° 31* 10 FORMAT(/1/,
1X, 13,SX, 'VM:' ,FiQ.5,SX,1X)'XI,10,5,5X, ' Z.2M',
00001
00i0
3,* 1 F1o,5,/) 000061 ooluO 33* C 000061 0014 3o* C 000061 OÛioo 35* CC4LCULAlIUS FUR LTITS OF INTEGRATIONS.
000b1 OuiS
3*
All i, 000061 OUiOö 31* IF(ZMZM) 2CU,201,202 000o3 ()0i4o 3Ha C 000063 00)L6 ou151 39* tiOa C CHANGE Z.ZK ,LT, Q TO 07, 0, 200 7izç z OOO63 00152 01* All = -1, 000'7 00253 42* G)) 1)3 2u2 000070 00153 93* C 000070 uolS3 u*zz
o, 000070 00150 oSt 201 Xi)Z : 0,0 000072 255 ¿ibA Go Tfl 2u3 00007200155 00158 'JS* C Z-Z GT,U. 202 X1Z .xMXK/ZZK 000012 000070 00157 (4q* ¿03 CO1TINUE 000077 00V7 5i)* C 000071 00157 51* C IXYZ : 1, 2, 3 FOR X, Y, Z COMPONENTS, RESPECTIVELY. 000077 OOIe'0
5*
Où iXZ 1, 3 00007' 00183 53* sss 000loS 001805*
1,0 000ioö 00)65 55* IV (XX) 301,302,303 000110 00185 56* C OtlollO OOlóS 57* C X.XK LT. 0. 000110 001h5 58* C 000110 00170 59* 301 IF (ZMZ.c,E0.U,) GO TQ 25 0001)3 0C170 60* C 000113 00172 ol* ARA: ABS(Yk)*(1,+XOZ,XOZ)/FR2 000115 00173 62* IF (A.GT,l70.) GO TO 25 000121 00175 63* VS: 1..xUZ*xLZ)/EX(ARA) 000120 0017e, 80* IF (VS.LT,1.uE-0b) GO TO 25 000132 0o200 S* XM 1 000135 0020) * A XOZ 000137 00202 67* SGNU : 0001'41 002(3 68* 00. 10 299 000103 00d03 ,9* C 00010.3 ('0?('3 70* C 0, 000)03 0u.3 71* C Q001'3 0020g 72* 302 MXM :1 0001(45 00205 73* A : 0, 000108 00206 7(4* SONO : 1, 000107 00207 75* IF (7lZ<.NE,0,) GO TO 299 000151 00211 76* IF (IXYZ.E0.i) GO TO 299 0o0153 002)3 77* GO 10 25 000155 002137*
C 000155 00213 79* C X-X) ,GT, 0, 000155 00213 0* C 000155 00?13 81* C *Z.ç : 0, 000155 00210 2a 303 IF (ZMZK,NE,0, GO TU 313 000157 0C216 83* MXM ) 000)Ò0 00217 0* IF CIXYZ.E0.3) GO TO 25 000182 00221 5* AC : 2, 000185 00222 68* SG'' 1, 000167 0023 i7* GO TU 299 000171 002238*
C 0, 000171 OOd?0 9* 3)3 MXM : 2 000)73 00225 90* A:
0, 000170 00?28 9)* 1, 000175 00226 92* C 0001750022b 93* C 00227 2cc B A+SGNU 00227 9S1 C 00227 9b* C ISG4U i
FOR P'TGRATING ALONG
+U AXIS, ISGNU : 2 FOR OC?27 97* C INTEGWATI\G ALONG -U AXIS 0(230 9g. DO IS ISGIJ 1,MXM 00233 99* IF (ISGNU,NE.2) OU 10 300 0235 1U0* A 0 0o3ó 101* 5,NU -t 0027 102* f3 A+5NtJ 00200 103* IF (,LE,X0l) ß:XOZ 0C210 10* C 0024O luS. C 00?2
j(b*
300 F ROSEO ; 002"3 107* E'R1 0,1 002u3 10M' C 002"4 109* 00 10 L 1, LIMITI 002U7 110* 3 CALL 3MPSN (,A,g,S[O,LIMT2,SI1,S,NU,IER) 0020 111*"TE (,0)
SI1,S,NtJ,tEj,ERUSEU,A,8 002b1 002b1 i 12* 113* (J Ffl.Q'IAI (2#, ISI; , Ei5,s, 2X, 'S: tNUM 1,10, 2X, '1ER;', 12, 1 2x,IELISE:' ,Ei5,,2X, 'A:' ,Fi0,3,2X,
;',F10,3) OO2h? 110* IF CIEIJ-0) 5,,,5 UO25 11* o EfUSL0 ERLSf0*10,0 002 lib. If (ERUSLO,LE.O.01) GO TO 3 00270 117*
IF (A35(ERUSE0-O,Ul) LE, 1,0E-06)
GO 703 00272 11g. 'RITE (,7) EkUSED 00275 1i* 7 FL)P4AT
(5,t*****ERL)5ED EQUAL TU ',FlO,b,' *****',//)
0027b 120* CU TU 15 0027b 121* C 00277 122* 5 55M3 = SSS+S*SGÑU 00300 123* f (ABS(S)AhS(ERRI*SSMS)) iI3,1i3,10 00303 120* 1131F (AbS( lLkO).LT,i,')EOb) GO TU) j5 0030F, I 2s* ERUSE D : t Q,:*f R!45E0 0030b 1?b* ERRI = j/jO,li 0(3(17 127* IF (AhS(S),LE,AS(EPRi*SSMS)) GO TO 113 (1057 j?. C 003)1 l2qi. jU'4 A s b 00311 10. c 00312 131* IF CXP1XI.LF.0.) GO 10000 00310 132* IF (A,LE,XOZ) GO TO 15 0031b 133* IF ((A,SGNU),G7,XOZ GO TO 000 00320 130. B xoZ 003?i 135* GO 7G 10 00322 13be 000 A(3' ; A45(A)+O,5 00323 131* ARA; Af3S(Vl()*(1,O+Al*AgM)/FR2 00320 13g. VS; (t.+AM*AM)/EXP(ARA) 0O35 139* IF (Y5,i.E,I.UE.0b) GO 10 15 00327 100. B B s SC.'U 0O33 14l 10 CUNTINIIE 00332 102* BB b.SGN'J CO333 143. TTE (,8)
00100 00100 00100 00100 00100 END OF COMPILATION: NU OIAGNO3TICS, 1* C 2* C 3* C u* C $LIUUTINE 51P5N s c SMPSNOOI S'SN002 sPsNoo3 SPS500 SPSN005 000000 000000 000000 000000 000000 001GO 5* C PURPOSE SUPS\oob 000000 00100 7* c
INTEGRATES IME GIVEN FUNCTION OVER ThE PRESCRIBED RANGE
SPSN007 000000 001110 8* C SPSÑ0o9 000000 oÙIrO C USAGE 5PSP009 000000 001GO 10* C CALL 3MP5N (F,A,B4OELTMAx,3I1,5,N,IEP) SlPSN010 000000 00100 1* C SMPS.01l 000000 00100 j* C DESCRIPTION (F PARAMETES SMPSN01? 000000 CO 100 13* C F
A& OF USER FUNGI
S1JBPOGRAr GIVING F(X) SMPSNOI3 000000 00100 ja* C A -L0E ISTEGRATIUN LIMiT
SSN01
000000 00100 15* C sUPPEk INTF(;RATION LI'IT
$'PSN01 000000 OOIUC 15* C DEL k1UIRED ACCUQACY (j TOLERANCE SMPSNOIÔ 000000 00100 17' C
IMAX.MAXIMUM NUl8ER OF PECnMPIJTAIIUNS OF INTEGRAL VALUE
SMPSÑOI7
000000
00100
18'
C
Sil R SULTANI VALUE OF INTEGRAL JUST PRIOR ro FINAL
SMPSNOIB 000000 00100 lq* C EVALUATIIIN SMSÑO1Q 000000 OOloO 20* C 5
LSULTANT FINAL VALUE UF INTEGRAL
SrP5NO20 ((00000 0(1100 21* C N
(ESLLIAN1 NUU8ER OF INTERVALS USED IN COMPUTING $
5PSNO2l
000000
0033e
lu4*
FUMAT
(IuX,'E(UT,ED ACCURACY NOT MET IN LIMITi STEPS',SX
000(4 003 1(5* i 'B: ', F2oI5) 000u31 O033, iO337 ICth* 147* C 15 CONTINLIE 000431 000u3' ')(j33? 1u* C 000431 oO3ul IuQ* SSP.15 FAC*SSMs 000 31 003i2 l5* IF (IXYZ.E4.3) 35M3 ; 000 u 3 003'42 151* C 000434 0'i3uu 15* 25 LITE (.1t,) YK,XMXK,ZMZ,A7ZI(,5$MS,ERU3ED,8 00 0 u 43 00355 0u355 153* 154*
1!, FORMAT (/.2X, 'YK:',F8,u,2X, 'X-X:',F81a,2X,
'Z.ZK:',F8,4, I*'Ft,1,
1
'9S5z',1201o,2x, 'ERUSEr):',Fio.7,2x, 'B: ',Flo,S,///)
000u2 000b o0355 155* C 0O0u2 0035' 15h* 98 CCitTINUE 00 04 2 00355 157* C O0flu2 o035 L5.* C 0004t2 0035o I5* 99 CUNTINUE 000452 Oo3e0 150* C 000u52 OG32 1iI* CALL EXIT 000u52 0O33 ie' END 000usS
00100
¿2*
C
1ER
.HESULTAÑT
ERUR CODE WHERE
SMPSNO22 00100 23 C IEW zU NP ERROR
3MP523
00100¿*
C IF'4 :1 A;H SPSNO20 00100 25* C ¡IR 2 S'PSNO25 001)02*
C 1FR :3IAX LESS THAN 2
8PSN00b 00100 27* C IL'4 L4
MEQUIRED ACCURACY NQT MET IN IiAX STEPS
SMPs'027 00)00.
¿*
C SUPSNO2H 0 I 00¿*
C REMAR'cS SPSNO29 00100 30* CSEE ERROR CC0E5 ABOVE
SPSNO30 00100 31* C . SMPSNO3I 00100 32* C
SUBROUTINES AND FUNCTION SUBPROGRAMS
E0U1RED 5MPS032 00100 33* C F - FUNCTION SUBPROGRAM
IC4 COMPUTES F(X) FOP X BETWEEN
SMPsNQ33 00100 30* C A AND M, SMPSNO3a 00100 35* C
CALLING PRtRAM MUSTHAVE
ORTPAN EXTERNAL STATEMENT
5UP5NO35
00100
3e*
C
CONTAINING NAHES OF FUNCTION SUBPPUGPAMS LISTED IN CALL
SMPSNO3b 00100 37* C TU SMPSN SNPSNO37 00100
3*
C . SMPSNO3 00100 39* C METHOD SMPSNC3O 00100 '0 C5IMP$ONS RULE IS PERFORMED WITH INTERVAL HALVING UNTIL
SMPAÑ000 0ol0 01* C LESS THAN
DEL. FAiLLiR TO REACH THE TOLERANCE AFTER TMAX
SVPSNOI4I
00100
02* 03*
C C
TRIES TERMINATES THE SU8ROUTIN EXC'JTION,
SPN002
SMPSNO'43 00100 u* C SMPSNOL4O 00100 '45* C SMPSÑOL45 001010*
SUBROUTINE 3MP5N(F,A,,OEL,IMAX,SII,5,N,IER) $'P5N01th 00101 47* C . . 5MP$N007 00101!*
C S'PAN0U 00101 ¿49* C SMPAN(iuq 00101 50* C IFA DOUBLE PRECISION VERSION OF T'4IS ROUTINE IS OESIRED,
TH SHPSNO5O 00101 51' C C IN COLUMN I
S4O'JLD HF REMOVED FROM THE DOUBLE PRECISION
SMPANOS1 00101 52' C STATEMENT 'ICH FOLLO*S, S'PSNi052 00101 53' C . SPSN053 00101 54* C
D(1UBLE PRECISIUN L,B,DEL,5I1,S,BA,X,SU,FPSTX,XX,FINC.F
5'PSNflSO 00101 55* C
55ÑQ55
00101THE C MUST ALSO B
RE(1VFO FROM DOUBLE PRECISION STATEMENTS
SMPSNUSb
57*
C
APPEARING IN OTHER R1)UTTNES USED IN CONJUNCTION WITH THIS
SMPSNOS7 00101 5H' C ROUTINE MPNO5 00101 59* C SMPSNOSR 00101 o' C THE DOUBt E PRECISION VERSION OF THIS
SUBROUTINE MUST ALSO
SMPSNOÔO
00161
Öl*
C
CONTAIN DOuBLE PRECISION FORTRAN FUNCTIONS, ABS IN STATEMENT
SPSN06t
0010)
b2*
C
27 MuST BE CHAÑGED.TO DABS.
SMPSNOb2 00101 o3' C
5P5NQ3
00101 b4*9R FUNCTION SUpPROP4M,F, MUST BE IN
DOUBLE PRECISION. SMPSNO6U 001u1 bS* C SMPSÑObS 00101 bÓ' C SMPSNOÓ6 00)01 ö7* C SMPSNOb7
oolr3 0015 OO1Lb 01u7 ,8* 70* 71* 72* NKN : i S = 0,00 SI1:o.00 N:Ç) BA:j.A SMPSN06 S'"'S'.0b9 SMPSNO7O $HPS1\071 SUPSNO72 000000 000001 000002 000003 000000 0flt1 73' IF(A) 20,i,2O SP$N073 000007 00113 70* 19 IE:1 SMPS070 0001Ú 0011(4 75* PETIRN 5Mp3N075 000011 00115 78* 20 IF(DEL) 22,22,23 SMPS07Ó 000015 00120 77* 22 IE:2
SPS077
000017 00121 78* E1'-J'N $MPS078 000u?1 001?? 79* 23F(AX.1
20,20,25 SPSN079 000025 oote5 80* 2(4 IEP;3 SMPSNO8Ø 00003) 00128 81* RETURN 5'.PSN0l 000)32 001?b 82* C S'P5082 000032 00128 83* C COMPUTE SIGMA(1) S-'P5'03 00o032 C 3P'0SL( 00)032 00127 8r5* 25 X:MA/2,+A SPSN0&5 000036 001 ".0 Sb' NHtL:I 5MPSN08 000001 00131 87 $UF4iFtXJ*BA*2,/3. SMP5PO87 o00043 00132 00132 8* 89* C S:SUM+(FCA)F(B))*8A/b, SMPSNOBM S'PS'.089 0()0)52 000052 00132 QO' CDIVIDE (A,8) IPTO 2,'1
2''! INTERVALS, S'PSN090 00u052 00132 91* C COMPUTE sIMcn,sIGMAco 5'P5'fl9j 000052 00132 92* C SWsNoq2 O0002 00133 93* DO 21 12,IMAX SPSN093 000R7 3 00138 ÇL4* 511:5 5MP5¼090 000073 00137 00100 95* 98* S:(S-SUMK/2.)/2, N1ALf:N,1AL*2 SMPSNO95 5MP5N096 000015 000102 00101 ANHL:NAL SUPS.C97 000105 00 1 u 00103 8 * 99* FR51 X: A k A/A '. H L F ) / 2, SUM;F(FFSTX)
5MPO98
S'.PSCQ9 000110 000115 001140 100* )u:FSIX S'SN100 000121 OCIoS 101* S".S101 000123 OO1'4b 102' F.LPC 8A/ANLF SP'PS'100 000121 001147 103' Dci 2 =1,LL5T S'.PS103 001)130 o0N2 1()J* SPSI10O 0o0130 (0153 00 I S 1Cr, I Oö *26 5:S+.(Xc)
S U s'.' = S U , * A / C 3, * A N HL F) 5'PS105 SPPSNIO8 000138 000100 C015 107* S=S+SUMK 5MP5'.I07 000152 00156 1O* C SMPS"10 000152 Ufl5b 109* CCOPAES THE. I-1H Ar'.JU
(I.'.t)ST RESULTS 5'PS).109 000152 00158 110* C SMQSNI1() 010152 00157 III' WITE.(6,l) SIi,S SMPSI1IA OCCISO UUlc,3 112*
1 FURiT (1QX,'SIl:' ,E20,10,SX,'S:',E20.l0)
5Up3111R 000163 00614 113* !F(485(S.SI1)-ABSCUEL*S)) 27,28,28 5-'P51jIC 000183
END F CUMPILATIUNI NU NAGNUSTICS. 00l7 00170 00172 1144* 115* 11* 27 *N4&LF IF(N,1iT.32) Gli 1f) 2 IF(N.NE.1) GO TO 29 S"PS111I) SMPS1 I lE 5MP5 111F 0001744 000177 000202 00174 117* K N = N K N e I 5PS1j1G 000205 00175 lfli* 28 CONTINUE S4PSN112 000212 00177 119* SMPSÑ1I3 000212 002(0 120e G'] TU 30 5UpSN1144 00021 C'001 121* 29 I1Q:0 SMPSNIIS 0002l oedul 122. C 30 N:2*N1ALF SMPSNI lb 0O021 002u2 123. 30 ETU4N SMPSNI17 000217 00?03 12S* INI) 5l1PSNll8 00031e 00100 00101 00101 00101 END 0F COMPILATION: NO DIAGNOSTICS, 1* C 2* FUNCTION F(L)) 3* C C 000000 000000 000000 000000 00103 5* COUN /tLKA/ YK,XMXK, ZMZK,FQ2,IXYZ 000000 00103 001044 e,. 7. U2P 1,0+0*0 000000 o 00000 OcioS =