home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
DOOG
/
PCSSP1.ZIP
/
GAUQUAD.ZIP
/
QG9.FOR
< prev
Wrap
Text File
|
1985-11-29
|
2KB
|
52 lines
C
C ..................................................................
C
C SUBROUTINE QG9
C
C PURPOSE
C TO COMPUTE INTEGRAL(FCT(X), SUMMED OVER X FROM XL TO XU)
C
C USAGE
C CALL QG9 (XL,XU,FCT,Y)
C PARAMETER FCT REQUIRES AN EXTERNAL STATEMENT
C
C DESCRIPTION OF PARAMETERS
C XL - THE LOWER BOUND OF THE INTERVAL.
C XU - THE UPPER BOUND OF THE INTERVAL.
C FCT - THE NAME OF AN EXTERNAL FUNCTION SUBPROGRAM USED.
C Y - THE RESULTING INTEGRAL VALUE.
C
C REMARKS
C NONE
C
C SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
C THE EXTERNAL FUNCTION SUBPROGRAM FCT(X) MUST BE FURNISHED
C BY THE USER.
C
C METHOD
C EVALUATION IS DONE BY MEANS OF 9-POINT GAUSS QUADRATURE
C FORMULA, WHICH INTEGRATES POLYNOMIALS UP TO DEGREE 17
C EXACTLY.
C FOR REFERENCE, SEE
C V.I.KRYLOV, APPROXIMATE CALCULATION OF INTEGRALS,
C MACMILLAN, NEW YORK/LONDON, 1962, PP.100-111 AND 337-338.
C
C ..................................................................
C
SUBROUTINE QG9(XL,XU,FCT,Y)
C
C
A=.5*(XU+XL)
B=XU-XL
C=.4840801*B
Y=.04063719*(FCT(A+C)+FCT(A-C))
C=.4180156*B
Y=Y+.09032408*(FCT(A+C)+FCT(A-C))
C=.3066857*B
Y=Y+.1303053*(FCT(A+C)+FCT(A-C))
C=.1621267*B
Y=Y+.1561735*(FCT(A+C)+FCT(A-C))
Y=B*(Y+.1651197*FCT(A))
RETURN
END