lmlde(3)

LIBRARY ROUTINE
lmlde - solves a system of linear ODE's

LIBRARY CALL
#include "vinclude.h"
int lmlde(image,bimage,ivimage,t0,tf,h)
    struct xvimage *image,*bimage,*ivimage;
    float t0,tf,h;

INPUT

t0  initial time value for the solution.

tf  final time value for the solution

h   time step to be used to progress from t0 to tf.

image
    real or complex coefficient matrix.

bimage
    real or complex vector containing the constant driving functions of the system.

ivimage
    real or complex vector containing the initial values of the system.

OUTPUT

image
    complex vector containing solution to the differential equations. Solution is interleaved. i.e., if matrix has four rows, then solution will have five elements per row. The first element is the time, the remaining elements are the solutions to the system at various that time step.

Return Value:
    1 on success, 0 on failure.

MODIFICATIONS

Jeremy Worley 05 Mar 1992 08:50 MST
    Made certain implicitly declared functions explicit in both lmlde() and llde().

DESCRIPTION
solves a system of constant coefficient linear ordinay differential equations with constant driving functions. As input, it takes a matrix that represents the constant coefficients, a vector that contains the constant driving functions and a vector that contains the initial conditions. With these inputs, the system is defined by the equation:

        x' = Ax + b

where x',x, and b are n-vectors and A is an n x m matrix such that m is less than or equal to n.

If the constant driving function vector (b) or the initial condition vector is not specified, then they will be set to zero. The coefficient matrix is a required argument.

lmlde will output data in the variable 'solution'. solution will contains the time data for one time step followed by the data for each of the xs in order. That is followed immediately by the next time step in the same order. For example, given a second order system, the first two time steps might look like:

        solution[0] = <time step 0>
        solution[1] = <x1 data at time 0>
        solution[2] = <x2 data at time 0>
        solution[3] = <time step 1>
        solution[4] = <x1 data at time 1>
        solution[5] = <x2 data at time 1>

lmlde solves the system of linear ordinary differential equations by using the Classic 4th order Runge-Kutta method. This method uses the equations

        k1 = h*f'(xn,yn)
        k2 = h*f'(xn + h/2, yn + k1/2)
        k3 = h*f'(xn + h/2, yn + k2/2)
        k4 = h*f'(xn + h, yn + k3)

        y(n+1) = yn + k1/6 + k2/3 + k3/3 + k4/6

where yn = y(n) and xn = x(n), to progress from xn to xn+h.

SEE ALSO
mlde(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS

AUTHOR
Jeremy Worley

COPYRIGHT
Copyright 1992, University of New Mexico. All rights reserved.