org.simulator.math.odes
Class RosenbrockSolver

java.lang.Object
  extended by org.simulator.math.odes.AbstractDESSolver
      extended by org.simulator.math.odes.AdaptiveStepsizeIntegrator
          extended by org.simulator.math.odes.RosenbrockSolver
All Implemented Interfaces:
Serializable, Cloneable, EventHandler, DelayValueHolder, DESSolver

public class RosenbrockSolver
extends AdaptiveStepsizeIntegrator

An implementation of Rosenbrock's method to approximate ODE solutions.

References: William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery. Numerical recipes in C. Cambridge Univ. Press Cambridge, 1992, pp. 738-747.

This solver has been adapted from ODE Toolkit: a free application for solving systems of ordinary differential equations.

Since:
0.9
Version:
$Rev: 168 $
Author:
Chris Moore, Roland Keller
See Also:
Serialized Form

Field Summary
static double a21
          Constants for solving
static double a31
          Constants for solving
static double a32
          Constants for solving
static double a41
          Constants for solving
static double a42
          Constants for solving
static double a43
          Constants for solving
static double a51
          Constants for solving
static double a52
          Constants for solving
static double a53
          Constants for solving
static double a54
          Constants for solving
static double c2
          Constants for solving
static double c21
          Constants for solving
static double c3
          Constants for solving
static double c31
          Constants for solving
static double c32
          Constants for solving
static double c4
          Constants for solving
static double c41
          Constants for solving
static double c42
          Constants for solving
static double c43
          Constants for solving
static double c51
          Constants for solving
static double c52
          Constants for solving
static double c53
          Constants for solving
static double c54
          Constants for solving
static double c61
          Constants for solving
static double c62
          Constants for solving
static double c63
          Constants for solving
static double c64
          Constants for solving
static double c65
          Constants for solving
static double d1
           
static double d2
           
static double d3
           
static double d4
           
static double fac1
          Constants used to adapt the stepsize according to the error in the last step (see rodas.f)
static double fac2
          Constants used to adapt the stepsize according to the error in the last step (see rodas.f)
static double gam
          Constants for solving
static double PWR
          Constants used to adapt the stepsize according to the error in the last step (see rodas.f)
static double RELMIN
          the minimum acceptable value of relTol - attempts to obtain higher accuracy than this are usually very expensive
static double SAFETY
          Constants used to adapt the stepsize according to the error in the last step (see rodas.f)
 
Fields inherited from class org.simulator.math.odes.AdaptiveStepsizeIntegrator
absTol, relTol
 
Fields inherited from interface org.apache.commons.math.ode.events.EventHandler
CONTINUE, RESET_DERIVATIVES, RESET_STATE, STOP
 
Constructor Summary
RosenbrockSolver()
          default constructor
RosenbrockSolver(int size, double stepsize)
           
RosenbrockSolver(RosenbrockSolver solver)
          clone constructor
 
Method Summary
 AbstractDESSolver clone()
           
 double[] computeChange(DESystem DES, double[] y2, double time, double currentStepSize, double[] change, boolean steadyState)
          Computes the change for a given system at the current time with the current setting for the integration step size.
 int getKiSAOterm()
          For details about the Kinetic Simulation Algorithm Ontology (KiSAO) see http://biomodels.net/kisao/.
 String getName()
          This gives a human-readable name of this solver that can be displayed in a graphical user interface.
 int getNumEquations()
           
protected  boolean hasSolverEventProcessing()
           
 double step(DESystem DES)
          This function tries to make a time step.
 double unitRoundoff()
          Returns an approximation to the error involved with the current arithmetic implementation
 
Methods inherited from class org.simulator.math.odes.AdaptiveStepsizeIntegrator
getAbsTol, getRelTol, setAbsTol, setRelTol
 
Methods inherited from class org.simulator.math.odes.AbstractDESSolver
additionalResults, addPropertyChangeListener, computeDelayedValue, computeSteadyState, eventOccurred, firePropertyChange, g, getSerialversionuid, getStepSize, inBetweenSteps, initResultMatrix, initResultMatrix, initResultMatrix, isIncludeIntermediates, isNonnegative, isUnstable, processEvents, processEventsAndRules, processRules, removePropertyChangeListener, reset, resetState, setIncludeIntermediates, setNonnegative, setStepSize, setUnstableFlag, solve, solve, solve, solve
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAFETY

public static final double SAFETY
Constants used to adapt the stepsize according to the error in the last step (see rodas.f)

See Also:
Constant Field Values

fac1

public static final double fac1
Constants used to adapt the stepsize according to the error in the last step (see rodas.f)

See Also:
Constant Field Values

fac2

public static final double fac2
Constants used to adapt the stepsize according to the error in the last step (see rodas.f)

See Also:
Constant Field Values

PWR

public static final double PWR
Constants used to adapt the stepsize according to the error in the last step (see rodas.f)

See Also:
Constant Field Values

c2

public static final double c2
Constants for solving

See Also:
Constant Field Values

c3

public static final double c3
Constants for solving

See Also:
Constant Field Values

c4

public static final double c4
Constants for solving

See Also:
Constant Field Values

a21

public static final double a21
Constants for solving

See Also:
Constant Field Values

a31

public static final double a31
Constants for solving

See Also:
Constant Field Values

a32

public static final double a32
Constants for solving

See Also:
Constant Field Values

a41

public static final double a41
Constants for solving

See Also:
Constant Field Values

a42

public static final double a42
Constants for solving

See Also:
Constant Field Values

a43

public static final double a43
Constants for solving

See Also:
Constant Field Values

a51

public static final double a51
Constants for solving

See Also:
Constant Field Values

a52

public static final double a52
Constants for solving

See Also:
Constant Field Values

a53

public static final double a53
Constants for solving

See Also:
Constant Field Values

a54

public static final double a54
Constants for solving

See Also:
Constant Field Values

gam

public static final double gam
Constants for solving

See Also:
Constant Field Values

c21

public static final double c21
Constants for solving

See Also:
Constant Field Values

c31

public static final double c31
Constants for solving

See Also:
Constant Field Values

c32

public static final double c32
Constants for solving

See Also:
Constant Field Values

c41

public static final double c41
Constants for solving

See Also:
Constant Field Values

c42

public static final double c42
Constants for solving

See Also:
Constant Field Values

c43

public static final double c43
Constants for solving

See Also:
Constant Field Values

c51

public static final double c51
Constants for solving

See Also:
Constant Field Values

c52

public static final double c52
Constants for solving

See Also:
Constant Field Values

c53

public static final double c53
Constants for solving

See Also:
Constant Field Values

c54

public static final double c54
Constants for solving

See Also:
Constant Field Values

c61

public static final double c61
Constants for solving

See Also:
Constant Field Values

c62

public static final double c62
Constants for solving

See Also:
Constant Field Values

c63

public static final double c63
Constants for solving

See Also:
Constant Field Values

c64

public static final double c64
Constants for solving

See Also:
Constant Field Values

c65

public static final double c65
Constants for solving

See Also:
Constant Field Values

d1

public static final double d1
See Also:
Constant Field Values

d2

public static final double d2
See Also:
Constant Field Values

d3

public static final double d3
See Also:
Constant Field Values

d4

public static final double d4
See Also:
Constant Field Values

RELMIN

public static final double RELMIN
the minimum acceptable value of relTol - attempts to obtain higher accuracy than this are usually very expensive

See Also:
Constant Field Values
Constructor Detail

RosenbrockSolver

public RosenbrockSolver()
default constructor


RosenbrockSolver

public RosenbrockSolver(int size,
                        double stepsize)
Parameters:
size -
stepsize -

RosenbrockSolver

public RosenbrockSolver(RosenbrockSolver solver)
clone constructor

Parameters:
solver -
Method Detail

clone

public AbstractDESSolver clone()
Specified by:
clone in interface DESSolver
Specified by:
clone in class AbstractDESSolver
Returns:
the cloned solver

step

public double step(DESystem DES)
            throws DerivativeException
This function tries to make a time step.

Parameters:
DES - the differential equation system
Returns:
the error
Throws:
DerivativeException

unitRoundoff

public double unitRoundoff()
Returns an approximation to the error involved with the current arithmetic implementation

Returns:
the approximation as described above

getName

public String getName()
Description copied from class: AbstractDESSolver
This gives a human-readable name of this solver that can be displayed in a graphical user interface.

Specified by:
getName in class AbstractDESSolver
Returns:
A name that describes the underlying algorithm.

getNumEquations

public int getNumEquations()
Returns:
the number of equations in the system

computeChange

public double[] computeChange(DESystem DES,
                              double[] y2,
                              double time,
                              double currentStepSize,
                              double[] change,
                              boolean steadyState)
                       throws DerivativeException
Description copied from class: AbstractDESSolver
Computes the change for a given system at the current time with the current setting for the integration step size.

Specified by:
computeChange in class AbstractDESSolver
Parameters:
DES - The system to be simulated.
y2 - The current state of the system.
time - The current simulation time.
currentStepSize - The current integration step size.
change - The vector for the resulting change of the system.
Returns:
The change.
Throws:
DerivativeException

hasSolverEventProcessing

protected boolean hasSolverEventProcessing()
Specified by:
hasSolverEventProcessing in class AbstractDESSolver
Returns:
Does the solver do the event processing itself?

getKiSAOterm

public int getKiSAOterm()
Description copied from interface: DESSolver
For details about the Kinetic Simulation Algorithm Ontology (KiSAO) see http://biomodels.net/kisao/.

Returns:
the KiSAO term of the algorithm

Generated December 13 2012