| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.simulator.math.odes.AbstractDESSolver
org.simulator.math.odes.AdaptiveStepsizeIntegrator
org.simulator.math.odes.RosenbrockSolver
public class RosenbrockSolver
RosenbrockSolver implements the Rosenbrock 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.
| Field Summary | |
|---|---|
| static double | a21Constants for solving | 
| static double | a31Constants for solving | 
| static double | a32Constants for solving | 
| static double | a41Constants for solving | 
| static double | a42Constants for solving | 
| static double | a43Constants for solving | 
| static double | a51Constants for solving | 
| static double | a52Constants for solving | 
| static double | a53Constants for solving | 
| static double | a54Constants for solving | 
| static double | c2Constants for solving | 
| static double | c21Constants for solving | 
| static double | c3Constants for solving | 
| static double | c31Constants for solving | 
| static double | c32Constants for solving | 
| static double | c4Constants for solving | 
| static double | c41Constants for solving | 
| static double | c42Constants for solving | 
| static double | c43Constants for solving | 
| static double | c51Constants for solving | 
| static double | c52Constants for solving | 
| static double | c53Constants for solving | 
| static double | c54Constants for solving | 
| static double | c61Constants for solving | 
| static double | c62Constants for solving | 
| static double | c63Constants for solving | 
| static double | c64Constants for solving | 
| static double | c65Constants for solving | 
| static double | d1 | 
| static double | d2 | 
| static double | d3 | 
| static double | d4 | 
| (package private)  double[] | DFDXhelper array to hold intermediate values | 
| (package private)  double[][] | FAChelper array to hold intermediate values | 
| static double | fac1Constants used to adapt the stepsize according to the error in the last step (see rodas.f) | 
| static double | fac2Constants used to adapt the stepsize according to the error in the last step (see rodas.f) | 
| (package private)  double[] | g0helper array to hold intermediate values | 
| (package private)  double[] | g1helper array to hold intermediate values | 
| (package private)  double[] | g1xhelper array to hold intermediate values | 
| (package private)  double[] | g2helper array to hold intermediate values | 
| (package private)  double[] | g2xhelper array to hold intermediate values | 
| static double | gamConstants for solving | 
| (package private)  double | hAdapfactor used for adjusting the step size, divide current step size by hAdap to get new step size | 
| (package private)  double[][] | Ihelper array to hold intermediate values | 
| (package private)  int[] | indxhelper array to hold intermediate values | 
| (package private)  double[][] | JAChelper array to hold intermediate values | 
| (package private)  int | numEqnThe number of equations | 
| static double | PWRConstants used to adapt the stepsize according to the error in the last step (see rodas.f) | 
| static double | RELMINthe minimum acceptable value of relTol - attempts to obtain higher accuracy than this are usually very expensive | 
| static double | SAFETYConstants used to adapt the stepsize according to the error in the last step (see rodas.f) | 
| (package private)  double | skfactor for calculating error value used in adjusting step size | 
| (package private)  boolean | stopKeep track whether the thread is killed or not | 
| (package private)  double[] | yahelper array to hold intermediate values | 
| (package private)  double[] | ybhelper array to hold intermediate values | 
| (package private)  double[] | yNewarray that is y with approximated errors added on, used for comparing y to y+yerr | 
| (package private)  double[] | yTemphelper array to hold intermediate values | 
| Fields inherited from class org.simulator.math.odes.AdaptiveStepsizeIntegrator | 
|---|
| absTol, relTol | 
| Fields inherited from class org.simulator.math.odes.AbstractDESSolver | 
|---|
| listenerList | 
| 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. | 
|  java.lang.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, checkSolution, checkSolution, computeDelayedValue, computeNextState, eventOccurred, firePropertyChange, g, getSerialversionuid, getStepSize, inBetweenSteps, initResultMatrix, initResultMatrix, initResultMatrix, isIncludeIntermediates, isNonnegative, isUnstable, numSteps, 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 | 
|---|
public static final double SAFETY
public static final double fac1
public static final double fac2
public static final double PWR
public static final double c2
public static final double c3
public static final double c4
public static final double a21
public static final double a31
public static final double a32
public static final double a41
public static final double a42
public static final double a43
public static final double a51
public static final double a52
public static final double a53
public static final double a54
public static final double gam
public static final double c21
public static final double c31
public static final double c32
public static final double c41
public static final double c42
public static final double c43
public static final double c51
public static final double c52
public static final double c53
public static final double c54
public static final double c61
public static final double c62
public static final double c63
public static final double c64
public static final double c65
public static final double d1
public static final double d2
public static final double d3
public static final double d4
public static final double RELMIN
double sk
double hAdap
int numEqn
double[] yNew
double[] yTemp
double[] ya
double[] yb
double[] g0
double[] g1
double[] g2
double[] g1x
double[] g2x
double[] DFDX
int[] indx
double[][] JAC
double[][] FAC
double[][] I
boolean stop
| Constructor Detail | 
|---|
public RosenbrockSolver()
size - stepsize - 
public RosenbrockSolver(int size,
                        double stepsize)
size - stepsize - public RosenbrockSolver(RosenbrockSolver solver)
solver - | Method Detail | 
|---|
public AbstractDESSolver clone()
clone in interface DESSolverclone in class AbstractDESSolver
public double step(DESystem DES)
            throws org.apache.commons.math.ode.DerivativeException
the - differential equation system
org.apache.commons.math.ode.DerivativeExceptionpublic double unitRoundoff()
public java.lang.String getName()
AbstractDESSolver
getName in class AbstractDESSolverpublic int getNumEquations()
public double[] computeChange(DESystem DES,
                              double[] y2,
                              double time,
                              double currentStepSize,
                              double[] change,
                              boolean steadyState)
                       throws org.apache.commons.math.ode.DerivativeException
AbstractDESSolver
computeChange in class AbstractDESSolverDES - The system to be simulated.y2 - The current state of the system.time - The current simulation time.change - The vector for the resulting change of the system.
org.apache.commons.math.ode.DerivativeExceptionprotected boolean hasSolverEventProcessing()
hasSolverEventProcessing in class AbstractDESSolver| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||