Math-Lsoda
view release on metacpan or search on metacpan
C DINTDY computes interpolated values of the K-th derivative of the
C dependent variable vector y, and stores it in DKY. This routine
C is called within the package with K = 0 and T = TOUT, but may
C also be called by the user for any K up to the current order.
C (See detailed instructions in the usage documentation.)
C
C The computed values in DKY are gotten by interpolation using the
C Nordsieck history array YH. This array corresponds uniquely to a
C vector-valued polynomial of degree NQCUR or less, and DKY is set
C to the K-th derivative of this polynomial at T.
C The formula for DKY is:
C q
C DKY(i) = sum c(j,K) * (T - tn)**(j-K) * h**(-j) * YH(i,j+1)
C j=K
C where c(j,K) = j*(j-1)*...*(j-K+1), q = NQCUR, tn = TCUR, h = HCUR.
C The quantities nq = NQCUR, l = nq+1, N = NEQ, tn, and h are
C communicated by COMMON. The above sum is done in reverse order.
C IFLAG is returned negative if either K or T is out of bounds.
C
C***SEE ALSO DLSODE
C***ROUTINES CALLED XERRWD
C (dimensioned in JAC) and/or Y has length exceeding
C NEQ(1). See the descriptions of NEQ and Y above.
C
C MF The method flag. Used only for input. The legal values
C of MF are 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24,
C and 25. MF has decimal digits METH and MITER:
C MF = 10*METH + MITER .
C
C METH indicates the basic linear multistep method:
C 1 Implicit Adams method.
C 2 Method based on backward differentiation formulas
C (BDF's).
C
C MITER indicates the corrector iteration method:
C 0 Functional iteration (no Jacobian matrix is
C involved).
C 1 Chord iteration with a user-supplied full (NEQ by
C NEQ) Jacobian.
C 2 Chord iteration with an internally generated
C (difference quotient) full Jacobian (using NEQ
C extra calls to F per df/dy value).
C and integer work space.
C The length of RWORK (in real words) must be at least
C 20 + NYH*(MAXORD + 1) + 3*NEQ + LWM where
C NYH = the initial value of NEQ,
C MAXORD = 12 (if METH = 1) or 5 (if METH = 2) (unless a
C smaller value is given as an optional input),
C LWM = 0 if MITER = 0,
C LWM = 2*NNZ + 2*NEQ + (NNZ+9*NEQ)/LENRAT if MITER = 1,
C LWM = 2*NNZ + 2*NEQ + (NNZ+10*NEQ)/LENRAT if MITER = 2,
C LWM = NEQ + 2 if MITER = 3.
C In the above formulas,
C NNZ = number of nonzero elements in the Jacobian matrix.
C LENRAT = the real to integer wordlength ratio (usually 1 in
C single precision and 2 in double precision).
C (See the MF description for METH and MITER.)
C Thus if MAXORD has its default value and NEQ is constant,
C the minimum length of RWORK is:
C 20 + 16*NEQ for MF = 10,
C 20 + 16*NEQ + LWM for MF = 11, 111, 211, 12, 112, 212,
C 22 + 17*NEQ for MF = 13,
C 20 + 9*NEQ for MF = 20,
C 20 + 9*NEQ + LWM for MF = 21, 121, 221, 22, 122, 222,
C 22 + 10*NEQ for MF = 23.
C If MITER = 1 or 2, the above formula for LWM is only a
C crude lower bound. The required length of RWORK cannot
C be readily predicted in general, as it depends on the
C sparsity structure of the problem. Some experimentation
C may be necessary.
C
C The first 20 words of RWORK are reserved for conditional
C and optional inputs and optional outputs.
C
C The following word in RWORK is a conditional input:
C RWORK(1) = TCRIT = critical value of t which the solver
C
C RWORK = a work array used for a mixture of real (double precision)
C and integer work space.
C The length of RWORK (in real words) must be at least
C 20 + NYH*(MAXORD + 1) + 3*NEQ + LWM where
C NYH = the initial value of NEQ,
C MAXORD = 12 (if METH = 1) or 5 (if METH = 2) (unless a
C smaller value is given as an optional input),
C LWM = 2*NNZ + 2*NEQ + (NNZ+9*NEQ)/LENRAT if MITER = 1,
C LWM = 2*NNZ + 2*NEQ + (NNZ+10*NEQ)/LENRAT if MITER = 2.
C in the above formulas,
C NNZ = number of nonzero elements in the iteration matrix
C P = A - con*J (con is a constant and J is the
C Jacobian matrix dr/dy).
C LENRAT = the real to integer wordlength ratio (usually 1 in
C single precision and 2 in double precision).
C (See the MF description for METH and MITER.)
C Thus if MAXORD has its default value and NEQ is constant,
C the minimum length of RWORK is:
C 20 + 16*NEQ + LWM for MF = 11, 111, 311, 12, 212, 412,
C 20 + 9*NEQ + LWM for MF = 21, 121, 321, 22, 222, 422.
C The above formula for LWM is only a crude lower bound.
C The required length of RWORK cannot be readily predicted
C in general, as it depends on the sparsity structure
C of the problem. Some experimentation may be necessary.
C
C The first 20 words of RWORK are reserved for conditional
C and optional inputs and optional outputs.
C
C The following word in RWORK is a conditional input:
C RWORK(1) = TCRIT = critical value of t which the solver
C is not to overshoot. Required if ITASK is
( run in 0.242 second using v1.01-cache-2.11-cpan-26ccb49234f )