ODEPACK is a collection of Fortran solvers for the initial value problem for ordinary differential equation systems. It consists of nine solvers, namely a basic solver called LSODE and eight variants of it, one of them being LSODI. The collection is suitable for both stiff and nonstiff systems. It includes solvers for systems given in explicit form, dy/dt = f(t,y), and also solvers for systems given in linearly implicit form, A(t,y) dy/dt = g(t,y).
The ODEPACK solvers are written in standard Fortran 77, with a few exceptions, and with minimal machine dependencies. There are separate double and single precision versions of ODEPACK. The actual solver names are those given above with a prefix of D- or S- for the double or single precision version, respectively, i.e. DLSODE/SLSODE, etc. Each solver consists of a main driver subroutine having the same name as the solver and some number of subordinate routines. For each solver, there is also a demonstration program, which solves one or two simple problems in a somewhat self-checking manner. Note that for the solution of dense and banded linear systems and associated basic linear algebra operations, ODEPACK uses several routines from LINPACK and BLAS.
LSODE (Livermore Solver for ODEs) is the basic solver of the collection, and solves explicitly given systems. It solves stiff and nonstiff systems of the form dy/dt = f, where y is the vector of dependent variables and t is the independent variable. In the stiff case, it treats the Jacobian matrix df/dy as either a dense (full) or a banded matrix, and as either user-supplied or internally approximated by difference quotients. It uses Adams methods (predictor-corrector) in the nonstiff case, and Backward Differentiation Formula (BDF) methods (the Gear methods) in the stiff case. The linear systems that arise are solved by direct methods (LU factor/solve). LSODE supersedes the older GEAR and GEARB packages, and reflects a complete redesign of the user interface and internal organization, with some algorithmic improvements.
When using LSODE, some important inputs are:
This is an example problem from chemical kinetics. Assume you have the following three rate equations:
on the interval from t = 0.0 to t = 4.e10, with initial conditions of y1 = 1.0, y2 = y3 = 0. In addition, the problem is stiff. Given that we provide the appropriate input parameters, here is the output:
| at t = 4.0000e-01 | y = 9.851726e-01 | 3.386406e-05 | 1.479357e-02 |
| at t = 4.0000e+00 | y = 9.055142e-01 | 2.240418e-05 | 9.446344e-02 |
| at t = 4.0000e+01 | y = 7.158050e-01 | 9.184616e-06 | 2.841858e-01 |
| at t = 4.0000e+02 | y = 4.504846e-01 | 3.222434e-06 | 5.495122e-01 |
| at t = 4.0000e+03 | y = 1.831701e-01 | 8.940379e-07 | 8.168290e-01 |
| at t = 4.0000e+04 | y = 3.897016e-02 | 1.621193e-07 | 9.610297e-01 |
| at t = 4.0000e+05 | y = 4.935213e-03 | 1.983756e-08 | 9.950648e-01 |
| at t = 4.0000e+06 | y = 5.159269e-04 | 2.064759e-09 | 9.994841e-01 |
| at t = 4.0000e+07 | y = 5.306413e-05 | 2.122677e-10 | 9.999469e-01 |
| at t = 4.0000e+08 | y = 5.494529e-06 | 2.197824e-11 | 9.999945e-01 |
| at t = 4.0000e+09 | y = 5.129458e-07 | 2.051784e-12 | 9.999995e-01 |
| at t = 4.0000e+10 | y = -7.170586e-08 | -2.868234e-13 | 1.000000e+00 |
LSODI is a solver for linearly implicit systems. That is, it treats systems in the linearly implicit form A(t,y) dy/dt = g(t,y), A = a square matrix, i.e. with the derivative dy/dt implicit, but linearly so. These solvers allow A to be singular, in which case the system is a differential-algebraic equation (DAE) system. In that case, the user must be very careful to supply a well-posed problem with consistent initial conditions.
LSODI solves linearly implicit systems in which the matrices involved (A, dg/dy, and d(A dy/dt)/dy) are all assumed to be either dense or banded.
When using LSODI, some important inputs are:
In addition, the expected output is:
This is an example problem from chemical kinetics. Assume you have the following three rate equations:
on the interval from t = 0.0 to t = 4.e10, with initial conditions of y1 = 1.0, y2 = y3 = 0. Given that we provide the appropriate input parameters, here is the output:
| at t = 4.0000e-01 | y = 9.851726e-01 | 3.386406e-05 | 1.479357e-02 |
| at t = 4.0000e+00 | y = 9.055142e-01 | 2.240418e-05 | 9.446344e-02 |
| at t = 4.0000e+01 | y = 7.158050e-01 | 9.184616e-06 | 2.841858e-01 |
| at t = 4.0000e+02 | y = 4.504846e-01 | 3.222434e-06 | 5.495122e-01 |
| at t = 4.0000e+03 | y = 1.831701e-01 | 8.940379e-07 | 8.168290e-01 |
| at t = 4.0000e+04 | y = 3.897016e-02 | 1.621193e-07 | 9.610297e-01 |
| at t = 4.0000e+05 | y = 4.935213e-03 | 1.983756e-08 | 9.950648e-01 |
| at t = 4.0000e+06 | y = 5.159269e-04 | 2.064759e-09 | 9.994841e-01 |
| at t = 4.0000e+07 | y = 5.306413e-05 | 2.122677e-10 | 9.999469e-01 |
| at t = 4.0000e+08 | y = 5.494532e-06 | 2.197826e-11 | 9.999945e-01 |
| at t = 4.0000e+09 | y = 5.129457e-07 | 2.051784e-12 | 9.999995e-01 |
| at t = 4.0000e+10 | y = -7.170472e-08 | -2.868188e-13 | 1.000000e+00 |
Download any or all of ODEPACK.