IDA solves the initial-value problem (IVP) for a DAE system of the general form
Prior to integrating a DAE initial-value problem, an important requirement is that the pair of vectors y0 and y0 are both initialized to satisfy the DAE residual F(t0, y0, y0) = 0. For a class of problems that includes so-called semi-explicit index-one systems, IDA provides a routine that computes consistent initial conditions from a user's initial guess [4]. For this, the user must identify sub-vectors of y (not necessarily contiguous), denoted yd and ya, which are its differential and algebraic parts, respectively, such that F depends on yd but not on any components of ya. The assumption that the system is ``index one'' means that for a given t and yd, the system F(t, y, y) = 0 defines ya uniquely. In this case, a solver within IDA computes ya and yd at t = t0, given yd and an initial guess for ya. A second available option with this solver also computes all of y(t0) given y(t0); this is intended mainly for quasi-steady-state problems, where y(t0) = 0 is given. In both cases, IDA solves the system F(t0, y0, y0) = 0 for the unknown components of y0 and y0, using Newton iteration augmented with a line search global strategy. In doing this, it makes use of the existing machinery that is to be used for solving the linear systems during the integration, in combination with certain tricks involving the step size (which is set artificially for this calculation). For problems that do not fall into either of these categories, the user is responsible for passing consistent values or risk failure in the numerical integration.
The integration method used in IDA is the variable-order, variable-coefficient BDF (Backward Differentiation Formula), in fixed-leading-coefficient form [1]. The method order ranges from 1 to 5, with the BDF of order q given by the multistep formula
In the process of controlling errors at various levels, IDA uses a weighted root-mean-square norm, denoted | . |WRMS, for all error-like quantities. The multiplicative weights used are based on the current solution and on the relative and absolute tolerances input by the user, namely
In the case of a direct linear solver (dense or banded), the nonlinear iteration (3.4) is a Modified Newton iteration, in that the Jacobian J is fixed (and usually out of date), with a coefficient in place of in J. When using one of the Krylov methods SPGMR, SPBCG, or SPTFQMR as the linear solver, the iteration is an Inexact Newton iteration, using the current Jacobian (through matrix-free products Jv), in which the linear residual Jy + G is nonzero but controlled. The Jacobian matrix J (direct cases) or preconditioner matrix P (SPGMR/SPBCG/SPTFQMR case) is updated when:
The stopping test for the Newton iteration in IDA ensures that the iteration error yn - yn(m) is small relative to y itself. For this, we estimate the linear convergence rate at all iterations m > 1 as
R = , |
When SPGMR, SPBCG, or SPTFQMR is used to solve the linear system, to minimize the effect of linear iteration errors on the nonlinear and local integration error controls, we require the preconditioned linear residual to be small relative to the allowed error in the Newton iteration, i.e., | P-1(Jx + G)| < 0.05 . 0.33. The safety factor 0.05 can be changed by the user.
In the direct linear solver cases, the Jacobian J defined in (3.5) can be either supplied by the user or have IDA compute one internally by difference quotients. In the latter case, we use the approximation
Jij = [Fi(t, y + ej, y + ej) - Fi(t, y, y)]/ , with | |
= max| yj|,| hyj|, 1/Wjsign(hyj) , |
Jv = [F(t, y + v, y + v) - F(t, y, y)]/ , |
During the course of integrating the system, IDA computes an estimate of the local truncation error, LTE, at the n-th time step, and requires this to satisfy the inequality
|LTE|WRMS 1 . |
In IDA, the local error test is tightly coupled with the logic for selecting the step size and order. First, there is an initial phase that is treated specially; for the first few steps, the step size is doubled and the order raised (from its initial value of 1) on every step, until (a) the local error test (3.8) fails, (b) the order is reduced (by the rules given below), or (c) the order reaches 5 (the maximum). For step and order selection on the general step, IDA uses a different set of local error estimates, based on the asymptotic behavior of the local error in the case of fixed step sizes. At each of the orders q' equal to q, q - 1 (if q > 1), q - 2 (if q > 2), or q + 1 (if q < 5), there are constants C(q') such that the norm of the local truncation error at order q' satisfies
As soon as the local error test has passed, the step and order for the next step may be adjusted. No such change is made if q' = q - 1 from the prior test, if q = 5, or if q was increased on the previous step. Otherwise, if the last q + 1 steps were taken at a constant order q < 5 and a constant step size, IDA considers raising the order to q + 1. The logic is as follows: (a) If q = 1, then reset q = 2 if T(2) < T(1)/2. (b) If q > 1 then
IDA permits the user to impose optional inequality constraints on individual components of the solution vector y. Any of the following four constraints can be imposed: yi > 0, yi < 0, yi 0, or yi 0. The constraint satisfaction is tested after a successful nonlinear system solution. If any constraint fails, we declare a convergence failure of the Newton iteration and reduce the step size. Rather than cutting the step size by some arbitrary factor, IDA estimates a new step size h' using a linear approximation of the components in y that failed the constraint test (including a safety factor of 0.9 to cover the strict inequality case). These additional constraints are also imposed during the calculation of consistent initial conditions.
Normally, IDA takes steps until a user-defined output value t = tout is overtaken, and then computes y(tout) by interpolation. However, a ``one step'' mode option is available, where control returns to the calling program after each step. There are also options to force IDA not to integrate past a given stopping point t = tstop.
In order to improve the convergence of the Krylov iteration, the preconditioner matrix P should in some sense approximate the system matrix A. Yet at the same time, in order to be cost-effective, the matrix P should be reasonably efficient to evaluate and solve. Finding a good point in this tradeoff between rapid convergence and low cost can be very difficult. Good choices are often problem-dependent (for example, see [2] for an extensive study of preconditioners for reaction-transport systems).
Typical preconditioners used with IDA are based on approximations to the Newton iteration matrix of the systems involved; in other words, P + , where is a scalar inverse proportional to the integration step size h. Because the Krylov iteration occurs within a Newton iteration and further also within a time integration, and since each of these iterations has its own test for convergence, the preconditioner may use a very crude approximation, as long as it captures the dominant numerical feature(s) of the system. We have found that the combination of a preconditioner with the Newton-Krylov iteration, using even a fairly poor approximation to the Jacobian, can be surprisingly superior to using the same matrix without Krylov acceleration (i.e., a modified Newton iteration), as well as to using the Newton-Krylov method with no preconditioning.
The IDA solver has been augmented to include a rootfinding feature. This means that, while integrating the Initial Value Problem (3.1), IDA can also find the roots of a set of user-defined functions gi(t, y, y') that depend on t, the solution vector y = y(t), and its t -derivative y'(t). The number of these root functions is arbitrary, and if more than one gi is found to have a root in any given interval, the various root locations are found and reported in the order that they occur on the t axis, in the direction of integration.
Generally, this rootfinding feature finds only roots of odd multiplicity, corresponding to changes in sign of gi(t, y(t), y'(t)), denoted gi(t) for short. If a user root function has a root of even multiplicity (no sign change), it will probably be missed by IDA. If such a root is desired, the user should reformulate the root function so that it changes sign at the desired root.
The basic scheme used is to check for sign changes of any gi(t) over each time step taken, and then (when a sign change is found) to home in on the root (or roots) with a modified secant method [11]. In addition, each time g is computed, IDA checks to see if gi(t) = 0 exactly, and if so it reports this as a root. However, if an exact zero of any gi is found at a point t, IDA computes g at t + for a small increment , slightly further in the direction of integration, and if any gi(t + ) = 0 also, IDA stops and reports an error. This way, each time IDA takes a time step, it is guaranteed that the values of all gi are nonzero at some past value of t, beyond which a search for roots is to be done.
At any given time in the course of the time-stepping, after suitable checking and adjusting has been done, IDA has an interval (tlo, thi] in which roots of the gi(t) are to be sought, such that thi is further ahead in the direction of integration, and all gi(tlo) 0. The endpoint thi is either tn, the end of the time step last taken, or the next requested output time tout if this comes sooner. The endpoint tlo is either tn-1, or the last output time tout (if this occurred within the last step), or the last root location (if a root was just located within this step), possibly adjusted slightly toward tn if an exact zero was found. The algorithm checks g at thi for zeros and for sign changes in (tlo, thi). If no sign changes are found, then either a root is reported (if some gi(thi) = 0) or we proceed to the next time interval (starting at thi). If one or more sign changes were found, then a loop is entered to locate the root to within a rather tight tolerance, given by
In the loop to locate the root of gi(t), the formula for tmid is