Trailing-Edge
-
PDP-10 Archives
-
decus_20tap2_198111
-
decus/20-0026/dhpcl.doc
There are 2 other files named dhpcl.doc in the archive. Click here to see a list.
SUBROUTINE DHPCL
PURPOSE
TO SOLVE A SYSTEM OF FIRST ORDER ORDINARY LINEAR
DIFFERENTIAL EQUATIONS WITH GIVEN INITIAL VALUES.
USAGE
CALL DHPCL (PRMT,Y,DERY,NDIM,IHLF,AFCT,FCT,OUTP,AUX,A)
PARAMETERS AFCT,FCT AND OUTP REQUIRE AN EXTERNAL STATEMENT.
DESCRIPTION OF PARAMETERS
PRMT - DOUBLE PRECISION INPUT AND OUTPUT VECTOR WITH
DIMENSION GREATER THAN OR EQUAL TO 5, WHICH
SPECIFIES THE PARAMETERS OF THE INTERVAL AND OF
ACCURACY AND WHICH SERVES FOR COMMUNICATION BETWEEN
OUTPUT SUBROUTINE (FURNISHED BY THE USER) AND
SUBROUTINE DHPCL. EXCEPT PRMT(5) THE COMPONENTS
ARE NOT DESTROYED BY SUBROUTINE DHPCL AND THEY ARE
PRMT(1)- LOWER BOUND OF THE INTERVAL (INPUT),
PRMT(2)- UPPER BOUND OF THE INTERVAL (INPUT),
PRMT(3)- INITIAL INCREMENT OF THE INDEPENDENT VARIABLE
(INPUT),
PRMT(4)- UPPER ERROR BOUND (INPUT). IF ABSOLUTE ERROR IS
GREATER THAN PRMT(4), INCREMENT GETS HALVED.
IF INCREMENT IS LESS THAN PRMT(3) AND ABSOLUTE
ERROR LESS THAN PRMT(4)/50, INCREMENT GETS DOUBLED.
THE USER MAY CHANGE PRMT(4) BY MEANS OF HIS
OUTPUT SUBROUTINE.
PRMT(5)- NO INPUT PARAMETER. SUBROUTINE DHPCL INITIALIZES
PRMT(5)=0. IF THE USER WANTS TO TERMINATE
SUBROUTINE DHPCL AT ANY OUTPUT POINT, HE HAS TO
CHANGE PRMT(5) TO NON-ZERO BY MEANS OF SUBROUTINE
OUTP. FURTHER COMPONENTS OF VECTOR PRMT ARE
FEASIBLE IF ITS DIMENSION IS DEFINED GREATER
THAN 5. HOWEVER SUBROUTINE DHPCL DOES NOT REQUIRE
AND CHANGE THEM. NEVERTHELESS THEY MAY BE USEFUL
FOR HANDING RESULT VALUES TO THE MAIN PROGRAM
(CALLING DHPCL) WHICH ARE OBTAINED BY SPECIAL
MANIPULATIONS WITH OUTPUT DATA IN SUBROUTINE OUTP.
Y - DOUBLE PRECISION INPUT VECTOR OF INITIAL VALUES
(DESTROYED). LATERON Y IS THE RESULTING VECTOR OF
DEPENDENT VARIABLES COMPUTED AT INTERMEDIATE
POINTS X.
DERY - DOUBLE PRECISION INPUT VECTOR OF ERROR WEIGHTS
(DESTROYED). THE SUM OF ITS COMPONENTS MUST BE
EQUAL TO 1. LATERON DERY IS THE VECTOR OF
DERIVATIVES, WHICH BELONG TO FUNCTION VALUES Y AT
INTERMEDIATE POINTS X.
NDIM - AN INPUT VALUE, WHICH SPECIFIES THE NUMBER OF
EQUATIONS IN THE SYSTEM.
IHLF - AN OUTPUT VALUE, WHICH SPECIFIES THE NUMBER OF
BISECTIONS OF THE INITIAL INCREMENT. IF IHLF GETS
GREATER THAN 10, SUBROUTINE DHPCL RETURNS WITH
ERROR MESSAGE IHLF=11 INTO MAIN PROGRAM.
ERROR MESSAGE IHLF=12 OR IHLF=13 APPEARS IN CASE
PRMT(3)=0 OR IN CASE SIGN(PRMT(3)).NE.SIGN(PRMT(2)-
PRMT(1)) RESPECTIVELY.
AFCT - THE NAME OF AN EXTERNAL SUBROUTINE USED. IT
COMPUTES MATRIX A (FACTOR OF VECTOR Y ON THE
RIGHT HAND SIDE OF THE SYSTEM) FOR A GIVEN X-VALUE.
ITS PARAMETER LIST MUST BE X,A. THE SUBROUTINE
SHOULD NOT DESTROY X.
FCT - THE NAME OF AN EXTERNAL SUBROUTINE USED. IT
COMPUTES VECTOR F (INHOMOGENEOUS PART OF THE
RIGHT HAND SIDE OF THE SYSTEM) FOR A GIVEN X-VALUE.
ITS PARAMETER LIST MUST BE X,F. THE SUBROUTINE
SHOULD NOT DESTROY X.
OUTP - THE NAME OF AN EXTERNAL OUTPUT SUBROUTINE USED.
ITS PARAMETER LIST MUST BE X,Y,DERY,IHLF,NDIM,PRMT.
NONE OF THESE PARAMETERS (EXCEPT, IF NECESSARY,
PRMT(4),PRMT(5),...) SHOULD BE CHANGED BY
SUBROUTINE OUTP. IF PRMT(5) IS CHANGED TO NON-ZERO,
SUBROUTINE DHPCL IS TERMINATED.
AUX - DOUBLE PRECISION AUXILIARY STORAGE ARRAY WITH 16
ROWS AND NDIM COLUMNS.
A - DOUBLE PRECISION NDIM BY NDIM MATRIX, WHICH IS USED
AS AUXILIARY STORAGE ARRAY.
REMARKS
THE PROCEDURE TERMINATES AND RETURNS TO CALLING PROGRAM, IF
(1) MORE THAN 10 BISECTIONS OF THE INITIAL INCREMENT ARE
NECESSARY TO GET SATISFACTORY ACCURACY (ERROR MESSAGE
IHLF=11),
(2) INITIAL INCREMENT IS EQUAL TO 0 OR HAS WRONG SIGN
(ERROR MESSAGES IHLF=12 OR IHLF=13),
(3) THE WHOLE INTEGRATION INTERVAL IS WORKED THROUGH,
(4) SUBROUTINE OUTP HAS CHANGED PRMT(5) TO NON-ZERO.
SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
THE EXTERNAL SUBROUTINES AFCT(X,A), FCT(X,F) AND
OUTP(X,Y,DERY,IHLF,NDIM,PRMT) MUST BE FURNISHED BY THE USER.
METHOD
EVALUATION IS DONE BY MEANS OF HAMMINGS MODIFIED PREDICTOR-
CORRECTOR METHOD. IT IS A FOURTH ORDER METHOD, USING 4
PRECEEDING POINTS FOR COMPUTATION OF A NEW VECTOR Y OF THE
DEPENDENT VARIABLES.
FOURTH ORDER RUNGE-KUTTA METHOD SUGGESTED BY RALSTON IS
USED FOR ADJUSTMENT OF THE INITIAL INCREMENT AND FOR
COMPUTATION OF STARTING VALUES.
SUBROUTINE DHPCL AUTOMATICALLY ADJUSTS THE INCREMENT DURING
THE WHOLE COMPUTATION BY HALVING OR DOUBLING.
TO GET FULL FLEXIBILITY IN OUTPUT, AN OUTPUT SUBROUTINE
MUST BE CODED BY THE USER.
FOR REFERENCE, SEE
(1) RALSTON/WILF, MATHEMATICAL METHODS FOR DIGITAL
COMPUTERS, WILEY, NEW YORK/LONDON, 1960, PP.95-109.
(2) RALSTON, RUNGE-KUTTA METHODS WITH MINIMUM ERROR BOUNDS,
MTAC, VOL.16, ISS.80 (1962), PP.431-437.