Usage Notes
Ordinary Differential Equations
An ordinary differential equation is an equation involving one or more dependent variables yi, an independent variable t, and derivatives of the yi with respect to t.
In the initial-value problem (IVP), the initial or starting values of the dependent variables yi at a known value t = t0 are given. Values of yi(t) for t > t0 or t < t0 are required.
The functions imsl_f_ode_runge_kutta and imsl_f_ode_adams_krogh solve the IVP for ODEs of the form
with yi(t = t0) specified. Here fi is a user-supplied function that must be evaluated at any set of values (t, y1yN), i = 1, N.
This problem statement is abbreviated by writing it as a system of first-order ODEs, y(t) = [y1(t), yN(t)]Tf(ty) = [f1(ty), fN(ty)]T, so that the problem becomes y = f(ty) with initial values y(t0).
The system is said to be stiff if some of the eigenvalues of the Jacobian matrix are large and negative. An alternate definition is based on the disparate integration times using a non-stiff solver compared to an implicit integration solver. Frequently differential equations modeling the behavior of physical systems are stiff, such as chemical reactions proceeding to equilibrium where subspecies effectively complete their reactions in different epochs. An alternate model concerns discharging capacitors such that different parts of the system have widely varying decay rates (or time constants).
Users typically identify stiff systems by the fact that numerical differential equation solvers such as imsl_f_ode_runge_kutta are inefficient, or else completely fail. Special methods are often required. The most common inefficiency is that a large number of evaluations of f(ty) (and hence an excessive amount of computer time) are required to satisfy the accuracy and stability requirements of the software. In such cases, use the IMSL function imsl_f_ode_adams_krogh. For more discussion about stiff systems, see Gear (1971, Chapter 11) or Shampine and Gear (1979).
The function imsl_f_modified_method_of_lines solves the boundary value problem (BVP) for first order systems of the form subject to the boundary conditions . Both functions are user-supplied. The functionassumes that the user has embedded the problem into a one-parameter family of problems. In this formulation, is an optional continuation parameter. It can be useful in solving nonlinear problems. When used, corresponds to an easy-to-solve problem and corresponds to the actual problem.
The functionimsl_f_ode_adams_krogh solves systems of ordinary differential equations of order one, order two, or mixed order one and two.
Differential-algebraic Equations
Frequently, it is not possible or not convenient to express the model of a dynamical system as a set of ODEs. Rather, an implicit equation is available in the form
The gi are user-supplied functions. The system is abbreviated as
With initial value y(t0). Any system of ODEs can be trivially written as a differential-algebraic system by defining
The function imsl_f_differential_algebraic_eqs solves differential-algebraic systems of index 1 or index 0. For a definition of index of a differential-algebraic system, see (Brenan et al. 1989). Also, see Gear and Petzold (1984) for an outline of the computing methods used.
Partial Differential Equations
There is a section Introduction to pde_1d_mg in this chapter for imsl_pde_1d_mg with greater details. This software is a variable grid-variable order integrator. It solves a problem
with boundary conditions
The function imsl_f_modified_method_of_lines solves the IVP problem for systems of the form
subject to the boundary conditions
and subject to the initial conditions ,for i = 1, , N. Here, fi, gi, are user-supplied, j = 1, 2.
The function imsl_f_feynman_kac solves a single equation on a finite interval . This equation often arises in applications from financial engineering and that is the primary focus of the document examples. The equation, initial conditions and Feynman-Kac boundary values are given by
The solution is approximated by a piece-wise series of Hermite quintic polynomials on a grid of the interval that yields a twice differentiable solution. To assist in the evaluation of the approximate solution and its derivatives there is the function imsl_f_feynman_kac_evaluate.
The function imsl_f_fast_poisson_2d solves Laplace’s, Poisson’s, or Helmholtz’s equation in two dimensions. This function uses a fast Poisson method to solve a PDE of the form
over a rectangle, subject to boundary conditions on each of the four sides. The scalar constant c and the function f are user specified.