home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
DOOG
/
PCSSP1.ZIP
/
NUMQUAD.ZIP
/
DQHFE.FOR
< prev
next >
Wrap
Text File
|
1985-11-29
|
2KB
|
58 lines
C
C ..................................................................
C
C SUBROUTINE DQHFE
C
C PURPOSE
C TO COMPUTE THE VECTOR OF INTEGRAL VALUES FOR A GIVEN
C EQUIDISTANT TABLE OF FUNCTION AND DERIVATIVE VALUES.
C
C USAGE
C CALL DQHFE (H,Y,DERY,Z,NDIM)
C
C DESCRIPTION OF PARAMETERS
C H - DOUBLE PRECISION INCREMENT OF ARGUMENT VALUES.
C Y - DOUBLE PRECISION INPUT VECTOR OF FUNCTION VALUES.
C DERY - DOUBLE PRECISION INPUT VECTOR OF DERIVATIVE VALUES.
C Z - RESULTING DOUBLE PRECISION VECTOR OF INTEGRAL
C VALUES. Z MAY BE IDENTICAL WITH Y OR DERY.
C NDIM - THE DIMENSION OF VECTORS Y,DERY,Z.
C
C REMARKS
C NO ACTION IN CASE NDIM LESS THAN 1.
C
C SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
C NONE
C
C METHOD
C BEGINNING WITH Z(1)=0, EVALUATION OF VECTOR Z IS DONE BY
C MEANS OF HERMITEAN FOURTH ORDER INTEGRATION FORMULA.
C FOR REFERENCE, SEE
C (1) F.B.HILDEBRAND, INTRODUCTION TO NUMERICAL ANALYSIS,
C MCGRAW-HILL, NEW YORK/TORONTO/LONDON, 1956, PP.314-319.
C (2) R.ZURMUEHL, PRAKTISCHE MATHEMATIK FUER INGENIEURE UND
C PHYSIKER, SPRINGER, BERLIN/GOETTINGEN/HEIDELBERG, 1963,
C PP.227-230.
C
C ..................................................................
C
SUBROUTINE DQHFE(H,Y,DERY,Z,NDIM)
C
C
DIMENSION Y(1),DERY(1),Z(1)
DOUBLE PRECISION Y,DERY,Z,H,HH,HS,SUM1,SUM2
C
SUM2=0.D0
IF(NDIM-1)4,3,1
1 HH=.5D0*H
HS=.16666666666666667D0*H
C
C INTEGRATION LOOP
DO 2 I=2,NDIM
SUM1=SUM2
SUM2=SUM2+HH*((Y(I)+Y(I-1))+HS*(DERY(I-1)-DERY(I)))
2 Z(I-1)=SUM1
3 Z(NDIM)=SUM2
4 RETURN
END