de.grogra.numeric
Interface Solver

All Known Implementing Classes:
CVodeAdapter, FirstOrderIntegratorAdapter

public interface Solver

A solver is an implementation of a numerical process to solve an ordinary differential equation.

Author:
Reinhard Hemmerling

Method Summary
 void integrate(ODE ode, double t0, double[] y0, double t1, double[] y1)
          Integrate ode from t0 to t1.
 void setMonitor(int n, Monitor monitor)
          Set monitor functions.
 void setOptions(java.util.Map options)
          Set additional options for the integration process.
 void setTolerances(double[] absTol, double[] relTol)
          Set element-specific absolute and relative tolerance values.
 

Method Detail

integrate

void integrate(ODE ode,
               double t0,
               double[] y0,
               double t1,
               double[] y1)
               throws NumericException
Integrate ode from t0 to t1. Initial state is passed in y0. Final state is stored in memory provided by y1 (can be the same as y0).

Parameters:
ode - equations
t0 - initial time
y0 - initial state
t1 - final time
y1 - memory to return state at t1, may refer to same object as y0
Throws:
NumericException

setMonitor

void setMonitor(int n,
                Monitor monitor)
                throws NumericException
Set monitor functions. A previously set monitor will be replaced by this one. A monitor can be disabled by passing zero for parameter n. The parameter monitor may be null in this case.

Parameters:
n -
monitor -
Throws:
NumericException

setOptions

void setOptions(java.util.Map options)
Set additional options for the integration process. Options are provided as mapping from keys to values. Note that supported keys and the data format of associated values depends on the implementation of the solver.

Parameters:
options -

setTolerances

void setTolerances(double[] absTol,
                   double[] relTol)
Set element-specific absolute and relative tolerance values. A value of null for either array indicates that element-specific tolerances should be disabled for this tolerance type. An value of zero in any of the arrays indicates that the integrator should provide a default tolerance value instead. Note that if any of the specified are really used is up to the implementation of the integrator.

Parameters:
absTol - element-specific absolute tolerance values, or null
relTol - element-specific relative tolerance values, or null