DCL:MATH2:ODELIB: Ordinary Differential Equation (Runge-Kutta Method): Explanation of Subroutines
Performs two-step integration by ODRKG (ODRKGR, ODRKGS) or ODRK4 (ODRK4R, ODRK4S), and determines the appropriate DT while checking the precision. ODRKGS and ODRK4S performs two-step integration for a given DT, then calculates and returns the DT for the next step. In contrast, ODRKGR and ODRK4R repeats the calculation process when the required precision is not satisfied using a smaller value for DT.
CALL ODRKGR(N,FCN,T,DT,EPSL,X,WORK)
CALL ODRKGS(N,FCN,T,DT,EPSL,X,WORK)
CALL ODRK4R(N,FCN,T,DT,EPSL,X,WORK)
CALL ODRK4S(N,FCN,T,DT,EPSL,X,WORK)
N (I) Number of variables of integration (integrands). (i) FCN Name of procedure Name of subroutine that calculates DX. T (R) Value of the independent variable t. It is outputted with the integration interval for the 2 steps added. (i/o) DT (R) Step width of integration. It is changed to an appropriate value before being outputted. (i/o) EPSL (R) Required precision. (i) X R(N) Outputs the value at t=T+2¡ßDT for and inputted value of the variable of integration at t=T. WORK R(N,M) Working variable. M=7 ( ODRK4R), M=5 ( ODRK4S, ODRKGR), M=3 ( ODRKGS).
SUBROUTINE FCN(N,T,X,DX).