Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-02 - decus/20-0026/hpcg.doc
There are 2 other files named hpcg.doc in the archive. Click here to see a list.
SUBROUTINE HPCG

PURPOSE
   TO SOLVE A SYSTEM OF FIRST ORDER ORDINARY GENERAL
   DIFFERENTIAL EQUATIONS WITH GIVEN INITIAL VALUES.

USAGE
   CALL HPCG (PRMT,Y,DERY,NDIM,IHLF,FCT,OUTP,AUX)
   PARAMETERS FCT AND OUTP REQUIRE AN EXTERNAL STATEMENT.

DESCRIPTION OF PARAMETERS
   PRMT   - AN INPUT AND OUTPUT VECTOR WITH DIMENSION GREATER
	    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 HPCG. EXCEPT PRMT(5)
	    THE COMPONENTS ARE NOT DESTROYED BY SUBROUTINE
	    HPCG 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 HPCG INITIALIZES
	    PRMT(5)=0. IF THE USER WANTS TO TERMINATE
	    SUBROUTINE HPCG 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 HPCG DOES NOT REQUIRE
	    AND CHANGE THEM. NEVERTHELESS THEY MAY BE USEFUL
	    FOR HANDING RESULT VALUES TO THE MAIN PROGRAM
	    (CALLING HPCG) WHICH ARE OBTAINED BY SPECIAL
	    MANIPULATIONS WITH OUTPUT DATA IN SUBROUTINE OUTP.
   Y	  - INPUT VECTOR OF INITIAL VALUES.  (DESTROYED)
	    LATERON Y IS THE RESULTING VECTOR OF DEPENDENT
	    VARIABLES COMPUTED AT INTERMEDIATE POINTS X.
   DERY   - 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 A POINT 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 HPCG 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.
   FCT	  - THE NAME OF AN EXTERNAL SUBROUTINE USED. IT
	    COMPUTES THE RIGHT HAND SIDES DERY OF THE SYSTEM
	    TO GIVEN VALUES OF X AND Y. ITS PARAMETER LIST
	    MUST BE X,Y,DERY. THE SUBROUTINE SHOULD NOT
	    DESTROY X AND Y.
   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 HPCG IS TERMINATED.
   AUX	  - AN AUXILIARY STORAGE ARRAY WITH 16 ROWS AND NDIM
	    COLUMNS.

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 FCT(X,Y,DERY) 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 HPCG 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.