home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
DOOG
/
PCSSP1.ZIP
/
GAUQUAD.ZIP
/
QG2.FOR
< prev
next >
Wrap
Text File
|
1985-11-29
|
1KB
|
45 lines
C
C ..................................................................
C
C SUBROUTINE QG2
C
C PURPOSE
C TO COMPUTE INTEGRAL(FCT(X), SUMMED OVER X FROM XL TO XU)
C
C USAGE
C CALL QG2 (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 2-POINT GAUSS QUADRATURE
C FORMULA, WHICH INTEGRATES POLYNOMIALS UP TO DEGREE 3
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 QG2(XL,XU,FCT,Y)
C
C
A=.5*(XU+XL)
B=XU-XL
Y=.2886751*B
Y=.5*B*(FCT(A+Y)+FCT(A-Y))
RETURN
END