DCL:MATH2:ODELIB: Ordinary Differential Equation (Runge-Kutta Method): Explanation of Subroutines
Performs a one-step integration using the given step width following a specific algorithm. The algorithms for integration are: the Runge-Kutta-Gill method (ODRKGODRK4), the 2nd-order Runge-Kutta method (ODRK2), and the 1st-order Runge-Kutta (Euler) method (ODRK1).
CALL ODRKG(N,FCN,T,DT,X,DX,XOUT,WORK)
CALL ODRK4(N,FCN,T,DT,X,DX,XOUT,WORK)
CALL ODRK2(N,FCN,T,DT,X,DX,XOUT,WORK)
CALL ODRK1(N,FCN,T,DT,X,DX,XOUT,WORK)
N (I) Number of the variables of integration (or integrands) (i) FCN Name of procedure Name of subroutine that calculates DX. T (R) Value of independent variable t. (i) DT (R) Step width of integration. (i) X R(N) Value of variable of integration at t=T. (i) DX R(N) Value of derivative of the variable of integration at t=T. (i) In ODRKG, the value of DX is not retained. XOUT R(N) Value of variable of integration at t =T+DT. (i) The same variable as X may be specified as the floating-point variable. WORK R(N,M) Working variable. M=3 (for ODRK4) or 1 (for other routines).
SUBROUTINE FCN(N,T,X,DX).