Kimberly Murdoch - Rensselaer Hartford Campus

advertisement
Analysis of a Circular Plate Subjected to Uniform Loading
with Fixed Boundary Conditions:
Direct Integration, Numerical Integration, and Closed Form
Solution
Kimberly Murdoch
MEAE4960 – Numerical Analysis for Engineering
Prof. E. Gutierrez-Miravete
Spring 2001
April 10, 2001
Table of Contents
Nomenclature .................................................................................................................................................. 3
List of Tables ................................................................................................................................................... 3
List of Figures ................................................................................................................................................. 3
1.0 Introduction .............................................................................................................................................. 4
2.0 The Rayleigh-Ritz Method ....................................................................................................................... 4
3.0 The Deflection Function, w ...................................................................................................................... 4
4.0 Numerical Integration Techniques ........................................................................................................... 5
4.1 Trapezoidal Rule ........................................................................................................................ 5
4.2 Simpson’s Composite Rule ....................................................................................................... 6
4.3 Adaptive Quadrature .................................................................................................................. 6
4.4 Gaussian Quadrature .................................................................................................................. 6
5.0 Analysis of a Circular Plate Subjected to Uniform Loading .................................................................... 6
5.1 Rayleigh-Ritz Method, Numerical Integration ........................................................................... 7
5.2 Rayleigh-Ritz Method, Direct Integration .................................................................................. 8
5.3 “Exact” Closed Form Solution ................................................................................................... 9
6.0 Results Comparison................................................................................................................................ 10
7.0 References .............................................................................................................................................. 13
Appendix A: Tabulated Results .................................................................................................................... 14
Appendix B: FORTRAN Code for Trapezoidal Rule Approximation ......................................................... 15
Appendix C: FORTRAN Code for Simpson’s Composite Rule Approximation ......................................... 16
Appendix D: FORTRAN Code for Adaptive Quadrature ............................................................................ 18
Appendix E: FORTRAN Code for Gaussian Quadrature ............................................................................. 21
Appendix F: Typical Results Listings from Computer Program .................................................................. 22
Appendix G: ANSYS Log File ...................................................................................................................... 24
2
Nomenclature
 - Poisson’s Ratio
E – Modulus of Elasticity
w – deflection in z-direction (out of plane)
D – Flexural Rigidity
q – applied load
cn - constants of integration
U – strain energy
W – work due to external loads
a – outer radius of plate
t – plate thickness
 - Potential energy
List of Tables
Table 1: Strain Energy, U – Summary............................................................................................................. 7
Table 2: Work Due to External Loads, W – Summary .................................................................................... 8
Table 3: Minimization and Solutions for A0 .................................................................................................... 8
Table 4: Deflection Functions, w – Numerical Integration.............................................................................. 8
Table 5: Deflection Functions, w – Summary ............................................................................................... 10
List of Figures
Figure 1: Circular Plate with Fixed Boundary Conditions, Uniform Loading ................................................ 7
Figure 2: Deflection, w vs. Radial Position, r – Summary ............................................................................ 11
Figure 3: Deflections, w – ANSYS ............................................................................................................... 12
3
1.0 Introduction
Energy methods are methods within the theory of elasticity by which boundary value problems can be
solved. These methods are, in general, less mathematically taxing than solving governing differential
equations together with boundary conditions. One such energy method is the Rayleigh-Ritz Method.
This paper will address the foundations of the Rayleigh-Ritz Method. Then, utilizing numerical
integration methods such as the Trapezoidal Rule, Simpson’s Composite Rule, Adaptive Quadrature,
and Gaussian Quadrature, the Rayleigh-Ritz Method will be used to analyze a circular plate with fixed
boundary conditions subjected to a uniform load.
2.0 The Rayleigh-Ritz Method
The Rayleigh-Ritz Method utilizes the principles of minimum potential energy and complementary
energy to find the solutions of boundary value problems. The Principle of Minimum Potential Energy
states that, for stable equilibrium, the potential energy of the system is a minimum. That is, for all
displacements that satisfy the given boundary and equilibrium conditions, the potential energy will be
the minimum. Therefore:
  U W
   (U  W )  0
where
(2.1)
 is the potential energy, U is the strain energy, and W is the energy due to external loads.
The strain energy, U, is found by using the Principle of Virtual Displacement. Thus:
  2 w  2 w   2 w  2  
D  2 2
  dxdy
U   ( w)  2(1   )  2
 
2
A 2
 x y
 xy   

(2.2)
In cylindrical coordinates, this becomes:
 d 2 w 1 dw 2 2(1   ) dw d 2 w 
 
 rdr
U  D   2 
r dr 
r
dr dr 2 
 dr

3
Et
D
12(1   2 )
(2.3)
where  is Poisson’s ratio, D is the flexural rigidity of the plate.
The work due to external loads, W, is also found by using the Principle of Virtual Displacement. Thus:
W   qwdxdy
A
(2.4)
In cylindrical coordinates, this becomes:
W   2qwrdr
(2.5)
The total work done during the “virtual displacements” must equal zero. Therefore:
 (U  W )  W  U  0
W  U
(2.6)
This is in agreement with equation 2.1 above.
3.0 The Deflection Function, w
4
The Rayleigh-Ritz Method requires the assumption of a deflection function. The differential equation
of the deflection is:
  2 1  1  2   2 w 1 w 1  2 w  q


4 w   2 



r r r 2  2  r 2 r r r 2  2  D
 r
(3.1)
Under axisymmetric loading, the differential equation reduces to:
  2 1    2 w 1 w  q


4 w   2 

r r  r 2 r r  D
 r
(3.2)
Introducing the identity:
2 w 
d 2 w 1 dw 1 d  dw 


r

dr 2 r dr r dr  dr 
(3.3)
Equation 3.2 becomes:
1 d  d  1 d  dw   q
r
 
r
r dr  dr  r dr  dr   D
(3.4)
The deflection can then be obtained by successive integrations:
w
1
1 rq
r   drdrdrdr

r
r D
(3.5)
The general solution of 3.2 is:
w  wh  wp  c1 ln r  c2r 2 ln r  c3r 2  c4  Ar 6  Br 4
(3.6)
where cn are constants of integration and A and B are part of the particular solution.
In general, the deflection of the plate can be assumed to be a series of the form:

w   An (a 2  r 2 ) 2  n
(3.7)
n 0
This is in agreement with equation (3.6).
4.0 Numerical Integration Techniques
Numerical integration techniques can be used to approximate the value of an integral. In general, the
method of such an approximation is called numerical quadrature, and can be expressed as the
following:
b

a
n
f ( x)dx   f ( xi )ai
(4.1)
i 0
This is derived from the use of the Lagrange interpolating polynomial.
4.1 Trapezoidal Rule
The Trapezoidal rule utilizes the first Lagrange polynomial with equally spaced nodes x0 and x1. Thus,
the expression for the approximation of the integral of f(x) from x0 to x1 is:

x1
x0
h
h3
f ( x)dx   f ( x0 )  f ( x1 ) 
f ( )
2
12
(4.1.1)
where h=x1-x0. Since this involves the second derivative of the error term, , the trapezoidal rule
yields an exact solution when the function it is applied to is of order one or less (i.e., the second
derivative term is reduced to zero).
5
4.2 Simpson’s Composite Rule
Simpson’s rule utilizes the second Lagrange polynomial with equally spaced nodes x0, x1, and x2 where
x1= x0+h and h=(x2-x0)/2. Therefore, the expression approximating the integral of f(x) over the interval
x0 to x2 is:
x2

x0
f ( x)dx 
5
h
 f ( x0 )  4 f ( x1 )  f ( x2 )  h f ( )
3
90
(4.2.1)
Noting that the fourth derivative of the error term, , is in this expression, we know that an exact
solution can be obtained when the function of interest is of degree three or less.
Simpson’s Composite rule is identical to Simpson’s rule, however the composite rule utilizes the
subdivision of the interval over which the integration is performed to reduce the error. The number of
subdivisions must be an even integer to preserve the use of equally spaced nodes. As such, we can
express the approximation of the integral of f(x) over the interval a to b with n subintervals using
Simpson’s Composite Rule as:
b

a
( n / 2 ) 1
n/2
 ba 4
h
f ( x)dx   f (a)  2  f ( x2 j )  4 f ( x2 j 1 )  f (b) 
h f ( ) (4.2.2)
3
j 1
j 1
 180
where n is even, h=(b-a)/n and xj=a+jh for j=0,1,2,…n.
4.3 Adaptive Quadrature
As described above, the Trapezoidal rule and Simpson’s Composite rule both require equally spaced
nodes. This could be inappropriate depending on the function that is to be integrated. That is, if the
function of interest has both large and small variations over the interval of interest, using equally
spaced nodes will not yield a solution with evenly distributed approximation error. In this case, it
would be useful to use a method in which the step size is adapted to the varying requirements of the
function. Such methods are knows as Adaptive Quadrature. Adaptive Quadrature can be applied to
composite procedures, and for the purposes of this paper, Simpson’s Composite Rule was modified for
Adaptive Quadrature. In general, the determining factor in the “completeness” of a solution using
Adaptive Quadrature is the tolerance (or difference in error) between iterations.
4.4 Gaussian Quadrature
Gaussian Quadrature is another method of Adaptive Quadrature. The premise behind Gaussian
Quadrature is that it chooses nodes for evaluation of the integral of interest in an optimal rather than
equally spaced manner. Therefore, the nodes, xn, on the interval and the coefficients, cn, are chosen
such that the expected error obtained from the following approximation is minimized:
b

a
n
f ( x)dx   ci f ( xi )
(4.4.1)
i 1
5.0 Analysis of a Circular Plate Subjected to Uniform Loading
A circular plate of radius a=2 inches and thickness t=0.1 inch is subjected to a uniform load, q=40 psi,
on its surface. The plate will be analyzed with fixed boundary conditions. It is desired to find the
6
deflected shape of this plate at different radial locations. The material properties of the plate are as
follows: E=30x106 psi,  =0.33.
q
a
a
Figure 1: Circular Plate with Fixed Boundary Conditions, Uniform Loading
5.1 Rayleigh-Ritz Method, Numerical Integration
First we assume a solution for the deflection of the plate as:

w   An (4  r 2 ) 2 n
(5.1.1)
n 0
Taking the first term only:
w  A0 (4  r 2 ) 2
dw
 4 A0 r (4  r 2 )
dr
d 2w
 4 A0 (4  3r 2 )
2
dr
(5.1.2a)
(5.1.2b)
(5.1.2c)
Next we find the strain energy, U, using equation 2.3. Because this is an axisymmetric problem, the
second integral disappears, and we are left with:
a


U  D  2 w rdr
0
2

(5.1.3)
Substituting in equation 3.3:
 d 2 w 1 dw 2 
 rdr 
U  D   2 
0
r dr 
 dr

a
(5.1.4)
Substituting 5.1.2b and 5.1.2c into 5.1.4:
a
U  64 A0 D (16r  16r 3  4r 5 )dr
2
0
(5.1.5)
Numerically integrating using the aforementioned techniques, we obtain the following expressions for
the strain energy:
Table 1: Strain Energy, U - Summary
Strain Energy (U)
Trapezoidal Rule
11.328125*64DA02
Simpson’s Composite Rule
10.666775*64DA02
Adaptive Quadrature
10.666668*64DA02
Gaussian Quadrature
10.666666*64DA02
Then we find the work due to external loads. Utilizing equation 5.1.2a in 2.5, we obtain:
7
a
W  80A0  (16r  8r 3  r 5 )dr
(5.1.7)
0
Numerically integrating using the aforementioned techniques, we obtain the following expressions for
the work due to external loads:
Table 2: Work Due to External Loads, W - Summary
Work Due to External Loads (W)
Trapezoidal Rule
10.582031*80A0
Simpson’s Composite Rule
10.666692*80A0
Adaptive Quadrature
10.666667*80A0
Gaussian Quadrature
10.666666*80A0
Substituting the values from Tables 1 and 2 into 2.1 and solving for A0:
Table 3: Minimization and Solutions for A0
(U-W) = 0
Trapezoidal Rule
1450*DA0*A0 –
846.56248**A0 = 0
Simpson’s Composite Rule
1365.3472*DA0*A0 –
853.33536**A0 = 0
Adaptive Quadrature
1365.333504*DA0*A0 –
853.33336**A0 = 0
Gaussian Quadrature
1365.333248*DA0*A0 –
853.33328**A0 = 0
A0
0.583836
D
0.624995
D
0.6249999
D
0.625
D
And substituting the values from Table 3 back into the expression for the deflection function, 5.1.2a,
we obtain the following solution for the deflection of the plate utilizing the Rayleigh-Ritz Method:
Table 4: Deflection Functions, w - Numerical Integration
w
0.583836
Trapezoidal Rule
(4  r 2 ) 2
D
Simpson’s Composite Rule
0.624995
D
(4  r 2 ) 2
Adaptive Quadrature
0.6249999
D
Gaussian Quadrature
0.625
D
(4  r 2 ) 2
(4  r 2 ) 2
5.2 Rayleigh-Ritz Method, Direct Integration
In simple problems, direct integration is often times just as easy to perform as numerical integration.
For this problem of a circular plate with fixed boundary conditions subjected to a uniform load,
equations 5.1.5 and 5.1.7 can be directly integrated to obtain a solution for the strain energy, U, and
work due to external loads, W.
First looking at the equation for strain energy, 5.1.5:
a
U  64 A0 D (16r  16r 3  4r 5 )dr
2
0
8
Directly integrating, we obtain the following expression for the strain energy:
2048A0 D
U
3
2
(5.2.1)
Next tackling the equation for the work due to external loads, 5.1.7:
a
W  80A0  (16r  8r 3  r 5 )dr
0
Integrating, we obtain the following expression for the work due to external loads:
2560A0
3
W
(5.2.2)
Substituting 5.2.1 and 5.2.2 into 2.1:
 (U  W ) 
2048D
2560
(2 A0 )A0 
A0  0
3
3
(5.2.3)
Solving for A0:
A0 
0.625
D
(5.2.4)
And substituting back into the expression for the deflection function, 5.1.2a, we obtain the following
solution for the deflection of the plate utilizing the Rayleigh-Ritz Method:
w
0.625
(4  r 2 ) 2
D
(5.2.5)
5.3 “Exact” Closed Form Solution
For the exact solution, we assume a deflection of the form:
w  wh  wp  c1 ln r  c2r 2 ln r  c3r 2  c4  Ar 6  Br 4
(5.3.1)
The boundary conditions yield the following constraints:
dw
0
w=0
dr
dw
0
@ r=0
dr
@ r=2
By inspection, we can determine that, to have finite displacements at the center of the plate, r=0,
c1=c2=0. Therefore, the expression for the deflection reduces to:
w  wh  wp  c3r 2  c4  Ar 6  Br 4
(5.3.2)
where:
wp  Ar 6  Br 4
(5.3.3)
3
2
2 d wp 1 d wp 1 dwp p0

 3

r dr 3
r 2 dr 2
r dr
D
(5.3.4)
40
D
(5.3.5)
wh  c2 r 2  c4
Utilizing the identity:
 4 wp 
d 4 wp
dr 4

we obtain:
576 Ar 2  64 B 
Solving for the constants by matching variables:
B
0.625
D
A0
9
Now, utilizing the boundary conditions in the expression for the deflection, we obtain the following
equations:
(5.3.6a)
0  4c3  c4  16B
0  4c3  32 B
(5.3.6b)
Solving 5.3.6a and 5.3.6b simultaneously for the constants:
c3  
5
D
c4 
10
D
Therefore, the exact solution for the deflection of a circular plate with fixed boundary conditions is:
w
0.625
(4  r 2 ) 2
D
(5.3.7)
It should be noted that this solution is identical to that obtained using the Rayleigh-Ritz Method with
direct integration.
6.0 Results Comparison
The following table summarizes the expressions for the deflection of a circular plate with fixed edges
subjected to a uniform load when the Rayleigh-Ritz method is solved using varying techniques.
Additionally, the last column reports the error associated with the solution when compared with the
“Exact” Closed Form Solution.
Table 5: Deflection Functions, w - Summary
w
Trapezoidal Rule
Simpson’s Composite Rule
0.583836
D
(4  r )
% Error
6.59%
0.624995
D
(4  r 2 ) 2
<1%
(4  r 2 ) 2
<1%
2 2
Adaptive Quadrature
0.6249999
D
Gaussian Quadrature
0.625
D
(4  r 2 ) 2
-
Direct Integration
0.625
D
(4  r 2 ) 2
-
0.625
D
(4  r 2 ) 2
-
“Exact” Closed Form
Solution
10
Figure 2: Deflection, w vs. Radial Position, r - Summary
Figure 2 plots the resultant deflection of this plate, for varying radial positions, when solved using the
Rayleigh-Ritz Method with varying numerical integration techniques, Finite Element Method, and
“Exact” closed form solution. Tabulated values are included in the appendix.
As can be seen from Table 5 and Figure 2, the Trapezoid Method of numerical integration yields the
least accurate approximations to the integrals with an error of 6.59%. In contrast, Gaussian Quadrature
yields an approximation that corresponds exactly with the result obtained by direct integration (i.e., the
error is zero). The Simpson’s Composite Rule and Adaptive Quadrature of the Simpson’s Composite
rule both yield approximations within 1% of the closed form solution. It can therefore be concluded
that, for this particular problem, adaptive quadrature methods, particularly Gaussian Quadrature,
should be utilized to obtain “good” solutions. That is, the variation in the function of interest is
sufficient enough to warrant the need for non-equally spaced nodes at which the integral is
approximated.
11
The following figure shows a plot of the deflections, w, at varying radial locations as calculated using
the finite element analysis program ANSYS.
Figure 3: Deflections, w – ANSYS
12
7.0 References
1.
Burden, Richard L. and J. Douglas Faires. Numerical Analysis. Seventh Edition. Brooks/Cole
Thompson Learning. Pacific Grove, CA. 2001.
2.
Krahula, Joseph. “Class Notes – Elements of Elasticity”. Rensselaer at Hartford. Summer, 2000.
3.
Krahula, Joseph. “Class Notes – Plates and Shells”. Rensselaer at Hartford. Fall, 2000.
4.
Murdoch, Kimberly. “Analysis of a Circular Plate Subjected to Uniform Loading: Fixed and Pinned
Boundary Conditions”. Plates and Shells Term Paper. December 12, 2000.
5.
Timoshenko, Stephen and S. Woinowsky-Krieger. Theory of Plates and Shells. McGraw-Hill Classic
Textbook Reissue. New York. 1959.
6.
Urugal, Ansel C. Stresses in Plates and Shells. McGraw-Hill. Boston. 1999.
13
Appendix A: Tabulated Results
r
0
0.125
0.25
0.375
0.5
0.625
0.75
0.875
1
1.125
1.25
1.375
1.5
1.625
1.75
1.875
2
Direct
Integration
Closed
ANSYS
Form Sol'n
w
w
0.0035644
0.003536608
0.003453883
0.003318184
0.003132773
0.002902221
0.0026324
0.00233049
0.002004975
0.001665646
0.001323597
0.000991229
0.000682248
0.000411666
0.000195798
5.22673E-05
0
Trapezoid
Simpson's Adaptive Q. Gaussian Q.
Comp.
w
w
w
w
w
0.0035644 0.003546 0.0033296 0.00356437
0.0035644
0.0035644
0.00353661 0.003497 0.0033037 0.00353658 0.00353661 0.003536608
0.00345388 0.003415 0.0032264 0.00345386 0.00345388 0.003453883
0.00331818 0.00328 0.0030996 0.00331816 0.00331818 0.003318184
0.00313277 0.003095 0.0029264 0.00313275 0.00313277 0.003132773
0.00290222 0.002865 0.0027111 0.0029022 0.00290222 0.002902221
0.0026324 0.002597
0.002459 0.00263238
0.0026324
0.0026324
0.00233049 0.002296
0.002177 0.00233047 0.00233049 0.00233049
0.00200498 0.001973 0.0018729 0.00200496 0.00200497 0.002004975
0.00166565 0.001637 0.0015559 0.00166563 0.00166565 0.001665646
0.0013236 0.001298 0.0012364 0.00132359
0.0013236 0.001323597
0.00099123 0.00097 0.0009259 0.00099122 0.00099123 0.000991229
0.00068225 0.000666 0.0006373 0.00068224 0.00068225 0.000682248
0.00041167
0.0004 0.0003846 0.00041166 0.00041167 0.000411666
0.0001958 0.00019 0.0001829 0.0001958
0.0001958 0.000195798
5.2267E-05 5.35E-05 4.882E-05 5.2267E-05 5.2267E-05 5.22673E-05
0
0
0
0
0
0
14
Appendix B: FORTRAN Code for Trapezoidal Rule Approximation
C
C
C
C
c
TRAPEZOIDAL COMPOSITE ALGORITHM
F(X) = 16*X - 16*X**3 + 4*X**5
F(X) = 16*X - 8*x**3 + X**5
XA = 0.0
XB = 2.0
N = 8
H = (XB - XA)/FLOAT(N)
C
100
X = XA
SUM = 0.0
DO 100 I=1,N
SUM = SUM + H*(F(X) + F(X+H))*0.5
X = X + H
CONTINUE
C
2
WRITE(6,2) XA,XB,SUM
FORMAT('1','INTEGRAL OF F FROM',3X,E15.8,3X,'TO',3X,E15.8,3X,'IS'
*,/,3X,E15.8)
C
STOP
END
15
Appendix C: FORTRAN Code for Simpson’s Composite Rule Approximation
C**********************************************************************
C
*
C
SIMPSON'S COMPOSITE ALGORITHM 4.1
*
C
*
C**********************************************************************
C
C
C
C
TO APPROXIMATE I = INTEGRAL(( F(X) DX)) FROM A TO B:
C
C
INPUT: ENDPOINTS A, B; EVEN POSITIVE INTEGER N.
C
C
OUTPUT: APPROXIMATION XI TO I.
C
REAL A, B, XI0, XI1, XI2, H, XI, X
INTEGER N, I
CHARACTER*1 AA
LOGICAL OK
C
CHANGE FUNCTION F FOR A NEW PROBLEM
c
F(XZ) = 16*XZ - 16*XZ**3 + 4*XZ**5
F(XZ) = 16*XZ - 8*XZ**3 + XZ**5
c
OPEN(UNIT=5,FILE='CON',ACCESS='SEQUENTIAL')
c
OPEN(UNIT=6,FILE='CON',ACCESS='SEQUENTIAL')
WRITE(6,*) 'This is Simpsons Method.'
WRITE(6,*) 'Has the function F been created in the program? '
WRITE(6,*) 'Enter Y or N '
WRITE(6,*) ' '
READ(5,*) AA
IF(( AA .EQ. 'Y' ) .OR. ( AA .EQ. 'y' )) THEN
OK = .FALSE.
10
IF (OK) GOTO 11
WRITE(6,*) 'Input lower limit of integration and'
WRITE(6,*) 'upper limit of integration separated'
WRITE(6,*) 'by a blank.'
WRITE(6,*) ' '
READ(5,*) A, B
IF (A.GE.B) THEN
WRITE(6,*) 'lower limit must be less than upper limit'
WRITE(6,*) ' '
ELSE
OK = .TRUE.
ENDIF
GOTO 10
11
OK = .FALSE.
14
IF (OK) GOTO 15
WRITE(6,*) 'Input an even positive integer N.'
WRITE(6,*) ' '
READ(5,*) N
IF((N.GT.0).AND.((N/2)*2.EQ.N)) THEN
OK=.TRUE.
ELSE
WRITE(6,*) 'Input must be an even positive integer '
WRITE(6,*) ' '
ENDIF
16
15
C
C
C
C
C
C
C
20
C
C
C
040
2
GOTO 14
CONTINUE
ELSE
WRITE(6,*) 'The program will end so that the function F '
WRITE(6,*) 'can be created '
OK = .FALSE.
ENDIF
IF (.NOT.OK) GOTO 040
STEP 1
H = (B-A)/N
STEP 2
XI0 = F(A) + F(B)
SUMMATION OF F(X(2*I-1))
XI1 = 0.0
SUMMATION OF F(X(2*I))
XI2 = 0.0
STEP 3
MM=N-1
DO 20 I=1,MM
STEP 4
X = A+I*H
STEP 5
IF (I.EQ.2*(I/2)) THEN
XI2 = XI2+F(X)
ELSE
XI1 = XI1+F(X)
END IF
CONTINUE
STEP 6
XI = XI0+2*XI2+4*XI1
XI = XI*H/3
STEP 7
OUTPUT
WRITE(6,2) A,B,XI
error = (XI-5.869604404)/5.869604404
write(6,*) error
CLOSE(UNIT=5)
CLOSE(UNIT=6)
STOP
FORMAT('1','INTEGRAL OF F FROM',3X,E15.8,3X,'TO',3X,E15.8,3X,'IS'
*,/,3X,E15.8)
END
17
Appendix D: FORTRAN Code for Adaptive Quadrature
C**********************************************************************
C
*
C
ADAPTIVE QUADRATURE ALGORITHM 4.3
*
C
*
C**********************************************************************
C
C
C
C
TO APPROXIMATE THE I = INTEGRAL ((F(X) DX)) FORM A TO B TO WITHIN
C
A GIVEN TOLERANCE TOL:
C
C
INPUT:
ENDPOINTS A,B;TOLERANCE TOL
C
LIMIT N TO NUMBER OF LEVELS
C
C
OUTPUT: APPROXIMATION APP OR A MESSAGE THAT N IS EXCEEDED.
C
DIMENSION TOL(20),A(20),H(20),FA(20),FC(20),FB(20),S(20),L(20)
DIMENSION V(8)
CHARACTER*1 A1
LOGICAL OK
C
CHANGE F FOR A NEW PROBLEM
c
F(XZ) = 16*XZ - 16*XZ**3 + 4*XZ**5
F(XZ) = 16*XZ - 8*XZ**3 + XZ**5
c
OPEN(UNIT=5,FILE='CON',ACCESS='SEQUENTIAL')
c
OPEN(UNIT=6,FILE='CON',ACCESS='SEQUENTIAL')
WRITE(6,*) 'This is Adaptive Quadrature with Simpsons Method.'
WRITE(6,*) 'Has the function F been created in the program? '
WRITE(6,*) 'Enter Y or N '
WRITE(6,*) ' '
READ(5,*) A1
IF(( A1 .EQ. 'Y' ) .OR. ( A1 .EQ. 'y' )) THEN
OK = .FALSE.
10
IF (OK) GOTO 11
WRITE(6,*) 'Input lower limit of integration and'
WRITE(6,*) 'upper limit of integration separated'
WRITE(6,*) 'by a blank.'
WRITE(6,*) ' '
READ(5,*) AA, BB
IF (AA.GE.BB) THEN
WRITE(6,*) 'lower limit must be less than upper limit'
WRITE(6,*) ' '
ELSE
OK = .TRUE.
ENDIF
GOTO 10
11
OK = .FALSE.
12
IF(OK) GOTO 13
WRITE(6,*) 'Input tolerance'
WRITE(6,*) ' '
READ(5,*) EPS
IF(EPS.LE.0.0) THEN
WRITE(6,*) 'Tolerance must be positive.'
WRITE(6,*) ' '
ELSE
18
OK=.TRUE.
ENDIF
GOTO 12
13
OK=.FALSE.
14
IF (OK) GOTO 15
WRITE(6,*) 'Input the maximum number of levels.'
WRITE(6,*) ' '
READ(5,*) N
IF(N.GT.0) THEN
OK=.TRUE.
ELSE
WRITE(6,*) 'Must be positive integer '
WRITE(6,*) ' '
ENDIF
GOTO 14
15
CONTINUE
ELSE
WRITE(6,*) 'The program will end so that the function F '
WRITE(6,*) 'can be created '
OK = .FALSE.
ENDIF
IF (.NOT.OK) GOTO 040
C
STEP 1
APP = 0
I = 1
TOL(I) = 10*EPS
A(I) = AA
H(I) = (BB-AA)/2
FA(I) = F(AA)
FC(I) = F(AA+H(I))
FB(I) = F(BB)
C
APPROXIMATION FROM SIMPSON'S METHOD FOR ENTIRE INTERVAL
S(I) = H(I)*(FA(I)+4*FC(I)+FB(I))/3
L(I) = 1
C
STEP 2
22
IF (I .LE. 0) GOTO 21
C
STEP 3
FD = F(A(I)+H(I)/2)
FE = F(A(I)+3*H(I)/2)
C
APPROXIMATIONS FROM SIMPSON'S METHOD FOR HALVES OF
INTERVALS
S1 = H(I)*(FA(I)+4*FD+FC(I))/6
S2 = H(I)*(FC(I)+4*FE+FB(I))/6
C
SAVE DATA AT THIS LEVEL
V(1)=A(I)
V(2)=FA(I)
V(3)=FC(I)
V(4)=FB(I)
V(5)=H(I)
V(6)=TOL(I)
V(7)=S(I)
V(8)=L(I)
C
STEP 4
C
DELETE THE LEVEL
I=I-1
C
STEP 5
IF( ABS(S1+S2-V(7)) .LT. V(6)) THEN
19
C
C
C
C
C
C
C
21
040
2
3
4
APP = APP+(S1+S2)
xord=xord+2*v(5)
write(6,*) xord,app
ELSE
IF( V(8) .GE. N ) THEN
PROCEDURE FAILS
WRITE(6,2)
GOTO 040
ELSE
ADD ONE LEVEL
DATA FOR RIGHT HALF SUBINTERVAL
I = I+1
A(I) = V(1) + V(5)
FA(I) = V(3)
FC(I) = FE
FB(I) = V(4)
H(I) = V(5)/2
TOL(I) = V(6)/2
S(I) = S2
L(I) = V(8) + 1
DATA FOR LEFT HALF SUBINTERVAL
I = I+1
A(I) = V(1)
FA(I) = V(2)
FC(I) = FD
FB(I) = V(3)
H(I) = H(I-1)
TOL(I) = TOL(I-1)
S(I) = S1
L(I) = L(I-1)
END IF
END IF
GOTO 22
STEP 6
OUTPUT
APP APPROXIMATES I TO WITHIN EPS
CONTINUE
WRITE(6,4) AA,BB
WRITE(6,3) APP,EPS
error = (app-5.869604404)/5.869604404
write(6,*) error
CLOSE(UNIT=5)
CLOSE(UNIT=6)
STOP
FORMAT(1X,'LEVEL EXCEEDED')
FORMAT(3X,E15.8,' TO WITHIN ',E15.8)
FORMAT(1X,'THE INTEGRAL FROM ',E15.8,' TO ',E15.8,' IS')
END
20
Appendix E: FORTRAN Code for Gaussian Quadrature
C
C
C
C
C
GAUSSIAN INTEGRATION ALGORITHM
alg430.f
PARAMETER(N=3)
DIMENSION T(N),A(N),XX(N)
C
c
F(X) = 16*X - 16*X**3 + 4*X**5
F(X) = 16*X - 8*x**3 + X**5
XA = 0.0
XB = 2.0
C
C
C
ZEROS OF LEGENDRE POLYNOMIALS (N=3)
T(1) = - SQRT(3.0/5.0)
T(2) = 0.0
T(3) =
SQRT(3.0/5.0)
C
C
C
COEFFICIENTS (N=3)
A(1) = 5.0/9.0
A(2) = 8.0/9.0
A(3) = 5.0/9.0
C
C
C
NODAL LOCATIONS AND FUNCTION VALUES
25
DO 25 I=1,N
XX(I) = (XB+XA)/2.0 + (XB-XA)/2.0*T(I)
CONTINUE
C
WRITE(6,*) (XX(I),I=1,N)
WRITE(6,*) (F(XX(I)),I=1,N)
C
C
C
INTEGRAL
100
SUM = 0.0
DO 100 I=1,N
SUM = SUM + ((XB-XA)/2.0)*A(I)*F(XX(I))
CONTINUE
C
2
WRITE(6,2) XA,XB,SUM
FORMAT(1x,'INTEGRAL OF F FROM',3X,E15.8,3X,'TO',3X,E15.8,3X,'IS'
*,/,3X,E15.8)
C
STOP
END
21
Appendix F: Typical Results Listings from Computer Programs
Trapezoid Rule:
U=
1INTEGRAL OF F FROM
0.11328125E+02
W=
1INTEGRAL OF F FROM
0.10582031E+02
0.00000000E+00
TO
0.20000000E+01
IS
0.00000000E+00
TO
0.20000000E+01
IS
TO
0.20000000E+01
IS
TO
0.20000000E+01
IS
Simpson's Composite Rule:
U=
1INTEGRAL OF F FROM
0.00000000E+00
0.10666775E+02
0.817290
N=30
W=
1INTEGRAL OF F FROM
0.00000000E+00
0.10666692E+02
0.817276
Adaptive Quadrature:
U=
0.125000
0.124026
0.250000
0.484538
0.375000
1.04775
0.500000
1.76042
0.625000
2.55439
0.750000
3.35303
0.875000
4.07947
1.00000
4.66667
1.12500
5.06930
1.25000
5.27751
1.37500
5.33246
1.43750
5.33353
1.50000
5.34375
1.56250
5.39067
1.62500
5.50861
1.68750
5.73937
1.75000
6.13298
1.81250
6.74840
1.87500
7.65438
1.93750
8.93023
2.00000
10.6667
THE INTEGRAL FROM 0.00000000E+00 TO 0.20000000E+01 IS
0.10666668E+02 TO WITHIN 0.99999997E-05
0.817272
10 levels, 0.00001 tolerance
W=
0.250000
0.492229
0.375000
1.08591
22
0.500000
1.87760
0.625000
2.82976
0.750000
3.89685
0.875000
5.02744
1.00000
6.16667
1.12500
7.25927
1.25000
8.25297
1.37500
9.10240
1.50000
9.77344
1.62500
10.24800
1.75000
10.52934
1.87500
10.6477
2.00000
10.6667
THE INTEGRAL FROM 0.00000000E+00 TO 0.20000000E+01 IS
0.10666667E+02 TO WITHIN 0.99999997E-05
0.817272
10 levels, 0.00001 tolerance
Gaussian:
U=
0.225403
1.00000
1.77460
3.42555
4.00000
9.37445
INTEGRAL OF F FROM
0.00000000E+00
0.10666666E+02
TO
0.20000000E+01
IS
TO
0.20000000E+01
IS
W=
0.225403
1.00000
1.77460
3.51542
9.00000
1.28458
INTEGRAL OF F FROM
0.00000000E+00
0.10666666E+02
23
Appendix G: ANSYS Log File
/BATCH
/COM,ANSYS RELEASE 5.6.2 UP20000525
15:34:39 02/03/2001
/input,menust,tmp ,,,,,,,,,,,,,,,,,1
/GRA,POWER
/GST,ON
/REPLOT,RESIZE
/REPLOT,RESIZE
/PREP7
CYL4,0,0,2, , , ,0.1
/USER, 1
/VIEW, 1, -0.874634028448 , 0.292688342428 , 0.386456789937
/ANG, 1, 10.1550329195
/VIEW, 1, -0.989777470810 , 0.136045366735 , -0.428043977511E-01
/ANG, 1, -2.72096071561
wpro,,30.000000,
wpro,,30.000000,
wpro,,30.000000,
VSBW,
1
vplo
/FOC, 1, 0.726760830345E-02, -0.931204104251E-02, -0.147647331039
/VIEW, 1, -0.993459730907 , 0.572512989804E-01, -0.987929746096E-01
/ANG, 1, -4.92362899807
wpro,,,30.000000
wpro,,,30.000000
wpro,,,30.000000
/VIEW, 1, -0.862799274739 , -0.463560672103E-02, -0.505525392696
/ANG, 1, -5.67989614097
VSBW,
3
VSBW,
2
vplo
/VIEW, 1 ,,,1
/ANG, 1
/REP,FAST
FLST,2,3,6,ORDE,3
FITEM,2,1
FITEM,2,4
FITEM,2,-5
VDELE,P51X
/AUTO, 1
/REP
vplo
/AUTO, 1
/REP
/USER, 1
/VIEW, 1, -0.572362308757 , 0.191556531035E-01, 0.819777072422
/ANG, 1, 2.31097294119
csys,1
/VIEW, 1 ,,,1
/ANG, 1
/REP,FAST
/ZOOM,1,RECT,0.137079,0.976514,1.324159,-0.103163
!*
ET,1,SOLID45
!*
!*
UIMP,1,EX, , ,30e6,
UIMP,1,NUXY, , ,.33,
UIMP,1,ALPX, , , ,
UIMP,1,REFT, , , ,
UIMP,1,MU, , , ,
UIMP,1,DAMP, , , ,
UIMP,1,DENS, , , ,
UIMP,1,KXX, , , ,
UIMP,1,C, , , ,
UIMP,1,ENTH, , , ,
UIMP,1,HF, , , ,
UIMP,1,EMIS, , , ,
24
UIMP,1,QRATE, , , ,
UIMP,1,VISC, , , ,
UIMP,1,SONC, , , ,
UIMP,1,RSVX, , , ,
UIMP,1,PERX, , , ,
!*
!*
KEYOPT,1,1,0
KEYOPT,1,2,0
KEYOPT,1,4,0
KEYOPT,1,5,0_
KEYOPT,1,6,0
!*
FLST,5,4,4,ORDE,4
FITEM,5,11
FITEM,5,-12
FITEM,5,14
FITEM,5,-15
CM,_Y,LINE
LSEL, , , ,P51X
CM,_Y1,LINE
CMSEL,,_Y
!*
LESIZE,_Y1, , ,10, , , , ,1
CMDELE,_Y
CMDELE,_Y1
!*
/FOC, 1, 0.751840573550 , 0.780757927950 , 0.500000007451E-01
/VIEW, 1, -0.365846969693 , -0.872926893425 , 0.322729969946
/ANG, 1, 30.4540547518
FLST,5,3,4,ORDE,3
FITEM,5,10
FITEM,5,18
FITEM,5,21
CM,_Y,LINE
LSEL, , , ,P51X
CM,_Y1,LINE
CMSEL,,_Y
!*
LESIZE,_Y1, , ,4, , , , ,1
CMDELE,_Y
CMDELE,_Y1
!*
/VIEW, 1, -0.243649789379 , -0.468341180798 , 0.849288713280
/ANG, 1, 6.35903341363
FLST,5,2,4,ORDE,2
FITEM,5,4
FITEM,5,-5
CM,_Y,LINE
LSEL, , , ,P51X
CM,_Y1,LINE
CMSEL,,_Y
!*
LESIZE,_Y1, , ,20, , , , ,1
CMDELE,_Y
CMDELE,_Y1
!*
MSHAPE,0,3D
MSHKEY,1
!*
CM,_Y,VOLU
VSEL, , , ,
3
CM,_Y1,VOLU
CHKMSH,'VOLU'
CMSEL,S,_Y
!*
VMESH,_Y1
!*
CMDELE,_Y
CMDELE,_Y1
25
CMDELE,_Y2
!*
/UI,MESH,OFF
/VIEW, 1 ,,,1
/ANG, 1
/REP,FAST
/AUTO, 1
/REP
SAVE
FINISH
/SOLU
FLST,2,2,4,ORDE,2
FITEM,2,11
FITEM,2,-12
DL,P51X, ,SYMM
FLST,2,2,4,ORDE,2
FITEM,2,14
FITEM,2,-15
DL,P51X, ,SYMM
eplo
nplo
/pbc,all
eplo
/USER, 1
/VIEW, 1, -0.843433841986 , -0.136103061944 , 0.519706946964
/ANG, 1, 2.10798392583
LSCLEAR,ALL
/VIEW, 1 ,,,1
/ANG, 1
/REP,FAST
FLST,5,105,1,ORDE,2
FITEM,5,1
FITEM,5,-105
NSEL,S, , ,P51X
nplo
/VIEW, 1, 0.351929388995E-01, 0.149760276941E-01, 0.999268320145
/ANG, 1, -1.71063535786
/DIST, 1 ,1.371742,1
/REP,FAST
/DIST, 1 ,1.371742,1
/REP,FAST
/DIST, 1 ,1.371742,1
/REP,FAST
/DIST, 1 ,1.371742,1
/REP,FAST
/DIST, 1 ,1.371742,1
/REP,FAST
/DIST, 1 ,1.371742,1
/REP,FAST
WPSTYLE,,,,,,,,0
/AUTO, 1
/REP
/USER, 1
/VIEW, 1, -0.927522109453E-01, 0.512453841563E-01, 0.994369618385
/ANG, 1, -3.38926979997
DSYM,SYMM,X, ,
allsel
nplo
/VIEW, 1 ,,,1
/ANG, 1
/REP,FAST
/AUTO, 1
/REP
FLST,5,105,1,ORDE,7
FITEM,5,1
FITEM,5,-5
FITEM,5,106
FITEM,5,126
FITEM,5,-144
FITEM,5,416
26
FITEM,5,-495
NSEL,S, , ,P51X
nplo
DSYM,SYMM,Y, ,
allsel
eplo
FLST,5,1550,1,ORDE,14
FITEM,5,1
FITEM,5,-5
FITEM,5,7
FITEM,5,-25
FITEM,5,30
FITEM,5,-105
FITEM,5,126
FITEM,5,-415
FITEM,5,417
FITEM,5,-435
FITEM,5,439
FITEM,5,-495
FITEM,5,572
FITEM,5,-1655
NSEL,U, , ,P51X
nplo
/USER, 1
/VIEW, 1, -0.471569364029E-01, 0.549383535192E-01, 0.997375556479
/ANG, 1, -5.09299134508
/AUTO, 1
/REP
/VIEW, 1 ,,,1
/ANG, 1
/REP,FAST
FLST,2,105,1,ORDE,10
FITEM,2,6
FITEM,2,26
FITEM,2,-29
FITEM,2,106
FITEM,2,-125
FITEM,2,416
FITEM,2,436
FITEM,2,-438
FITEM,2,496
FITEM,2,-571
!*
/GO
D,P51X, ,0, , , ,ALL, , , , ,
/USER, 1
/VIEW, 1, -0.344249805661 , -0.757785534760 , 0.554304207644
/ANG, 1, 13.2932980231
/VIEW, 1, -0.385527503693 , -0.704329879579 , 0.596060369953
/ANG, 1, 14.4202576214
/VIEW, 1, -0.270566842638 , -0.435101694665 , 0.858766614957
/ANG, 1, 4.81162711417
/VIEW, 1, -0.189074204164E-01, 0.379648749023E-01, 0.999100184029
/ANG, 1, -0.365275739393
/VIEW, 1 ,,,1
/ANG, 1
/REP,FAST
allsel
eplo
/VIEW, 1, -0.893066474493 , -0.290112653474 , 0.343899578991
/ANG, 1, 13.0733129673
/VIEW, 1, -0.988652887089 , -0.142282130203 , 0.481795005722E-01
/ANG, 1, 17.6910282580
/FOC, 1, 1.00894266537 , 0.884362267253 , -0.107992318648
/VIEW, 1, -0.221105901449 , -0.293524585501E-01, 0.974807988027
/ANG, 1, 1.89607734520
/VIEW, 1 ,,,1
/ANG, 1
/REP,FAST
FLST,2,1,5,ORDE,1
27
FITEM,2,7
/GO
!*
SFA,P51X,1,PRES,40
!*
/PSF,PRES,NORM,2,0
/PBF,DEFA, ,1
/PSYMB,CS,0
/PSYMB,NDIR,0
/PSYMB,ESYS,0
/PSYMB,LDIV,0
/PSYMB,LDIR,0
/PSYMB,ADIR,0
/PSYMB,ECON,0
/PSYMB,XNODE,0
/PSYMB,DOT,1
/PSYMB,PCONV,
/PSYMB,LAYR,0
!*
/PBC,ALL, ,1
/REP
!*
/VIEW, 1, -0.819392389557
/ANG, 1, 24.5630941018
eplo
/VIEW, 1, -0.254405296809
/ANG, 1, 5.85170057280
!*
/PSF,PRES,NORM,3,1
/PBF,DEFA, ,1
/PSYMB,CS,0
/PSYMB,NDIR,0
/PSYMB,ESYS,0
/PSYMB,LDIV,0
/PSYMB,LDIR,0
/PSYMB,ADIR,0
/PSYMB,ECON,0
/PSYMB,XNODE,0
/PSYMB,DOT,1
/PSYMB,PCONV,
/PSYMB,LAYR,0
!*
/PBC,ALL, ,1
/REP
!*
/VIEW, 1, -0.988836014297
/ANG, 1, 15.3283212936
/VIEW, 1, -0.269001284413
/ANG, 1, 7.40341235473
BFLIST,ALL
SFLIST, ALL
SFALIS, ALL
!*
/PSF,PRES,NORM,1,0
/PBF,DEFA, ,1
/PSYMB,CS,0
/PSYMB,NDIR,0
/PSYMB,ESYS,0
/PSYMB,LDIV,0
/PSYMB,LDIR,0
/PSYMB,ADIR,0
/PSYMB,ECON,0
/PSYMB,XNODE,0
/PSYMB,DOT,1
/PSYMB,PCONV,
/PSYMB,LAYR,0
!*
/PBC,ALL, ,1
/REP
!*
, -0.555205299319
, 0.142629546534
, -0.208075347330
, 0.944448301808
, 0.163726821880E-01, 0.148105611326
, -0.210387946656
, 0.939880429037
28
/AUTO, 1
/REP
eplo
!*
ANTYPE,0
/STATUS,SOLU
SOLVE
/VIEW, 1 ,,,1
/ANG, 1
/REP,FAST
/pst1
FINISH
/post1
plns,u,z
29
Download