Serializable
, Cloneable
, org.apache.commons.math.ode.events.EventHandler
, DelayValueHolder
, DESSolver
AdaptiveStepsizeIntegrator
, EulerMethod
, RungeKutta_EventSolver
public abstract class AbstractDESSolver extends Object implements DelayValueHolder, DESSolver, org.apache.commons.math.ode.events.EventHandler
Modifier and Type | Field | Description |
---|---|---|
protected AbstractDESSolver |
clonedSolver |
A cloned version of this object
|
static String |
PROGRESS |
Key used when informing listeners about progress by this solver.
|
Constructor | Description |
---|---|
AbstractDESSolver() |
Initialize with default integration step size and non-negative attribute
true . |
AbstractDESSolver(double stepSize) |
Initialize with given integration step size.
|
AbstractDESSolver(double stepSize,
boolean nonnegative) |
Initialize with given step size and a flag whether or not negative values should be allowed.
|
AbstractDESSolver(AbstractDESSolver solver) |
Clone constructor.
|
Modifier and Type | Method | Description |
---|---|---|
protected double[] |
additionalResults(DESystem DES,
double t,
double[] yTemp,
MultiTable data,
int rowIndex) |
Compute additional result values
|
void |
addPropertyChangeListener(PropertyChangeListener listener) |
Add PropertyChangedListener to this Solver
|
abstract AbstractDESSolver |
clone() |
|
abstract double[] |
computeChange(DESystem DES,
double[] y,
double t,
double stepSize,
double[] change,
boolean steadyState) |
Computes the change for a given system at the current time with the
current setting for the integration step size.
|
double |
computeDelayedValue(double time,
String id,
DESystem DES,
double[] initialValues,
int yIndex) |
Returns the value for the element with the given id at a time point in
the past, where the time gives the amount of time in the past.
|
protected double[] |
computeSteadyState(FastProcessDESystem DES,
double[] result,
double timeBegin) |
|
int |
eventOccurred(double t,
double[] y,
boolean increasing) |
|
void |
firePropertyChange(double oldValue,
double newValue) |
Tell each listener that property value changed.
|
double |
g(double t,
double[] y) |
|
abstract String |
getName() |
This gives a human-readable name of this solver that can be displayed in
a graphical user interface.
|
static long |
getSerialversionuid() |
|
double |
getStepSize() |
Obtain the currently set integration step size.
|
protected abstract boolean |
hasSolverEventProcessing() |
|
int |
inBetweenSteps(double lastTime,
double nextTime,
double stepSize) |
Computes the number of necessary steps between two time steps.
|
protected MultiTable |
initResultMatrix(DESystem DES,
double[] initialValues,
double[] timePoints) |
|
protected MultiTable |
initResultMatrix(DESystem DES,
double[] initialValues,
double timeBegin,
double timeEnd) |
|
protected MultiTable |
initResultMatrix(DESystem DES,
double[] initialValues,
double timeBegin,
int numSteps) |
|
boolean |
isIncludeIntermediates() |
If this method returns
true , intermediate results that may
originate from a RichDESystem are included into the
MultiTable that contains the result of a numerical integration. |
boolean |
isNonnegative() |
|
boolean |
isUnstable() |
Method to check whether the solution of the numerical integration
procedure contains
Double.NaN values. |
boolean |
processEvents(EventDESystem EDES,
double time,
double previousTime,
double[] yTemp) |
Processes sudden changes in the system due to events in the EDES
|
boolean |
processEventsAndRules(boolean forceProcessing,
DESystem DES,
double t,
double previousTime,
double[] yTemp) |
Function for processing the events and rules at a certain time step.
|
boolean |
processRules(EventDESystem EDES,
double time,
double[] Ytemp) |
Function for processing the rules at a certain time step.
|
void |
removePropertyChangeListener(PropertyChangeListener listener) |
remove PropertyChangedListener to this Solver
|
void |
reset() |
Initialize with default integration step size and non-negative attribute
true . |
void |
resetState(double t,
double[] y) |
|
void |
setIncludeIntermediates(boolean includeIntermediates) |
Allows switching whether or not intermediate results should be included
into the
MultiTable of the result. |
void |
setNonnegative(boolean nonnegative) |
|
void |
setStepSize(double stepSize) |
Set the integration step size.
|
void |
setUnstableFlag(boolean unstableFlag) |
|
MultiTable |
solve(DESystem DES,
double[] initialValues,
double[] timePoints) |
Solves the given differential equation system with the step size h and
the number of steps as given starting at the value x.
|
MultiTable |
solve(DESystem DES,
double[] initialValues,
double timeBegin,
double timeEnd) |
Solves the given differential equation system
|
MultiTable |
solve(DESystem DES,
double[] initialValues,
double x,
double h,
int steps) |
Solves the given differential equation system with the step size h and
the number of steps as given starting at the value x.
|
MultiTable |
solve(DESystem DES,
MultiTable.Block initConditions,
double[] initialValues) |
Solves the given
DESystem using new initial conditions in each
time step. |
MultiTable |
steadystate(DESystem DES,
double[] initialValues,
double maxSteps) |
getKiSAOterm
protected AbstractDESSolver clonedSolver
public static final String PROGRESS
public AbstractDESSolver()
true
.public AbstractDESSolver(AbstractDESSolver solver)
solver
- public AbstractDESSolver(double stepSize)
stepSize
- public AbstractDESSolver(double stepSize, boolean nonnegative)
stepSize
- nonnegative
- public static long getSerialversionuid()
public void reset()
true
.protected double[] additionalResults(DESystem DES, double t, double[] yTemp, MultiTable data, int rowIndex) throws org.apache.commons.math.ode.DerivativeException
DES
- the differential equation systemt
- the current timeyTemp
- the vector yTempdata
- the data as multi tablerowIndex
- the index of the roworg.apache.commons.math.ode.DerivativeException
public void addPropertyChangeListener(PropertyChangeListener listener)
DESSolver
addPropertyChangeListener
in interface DESSolver
public abstract AbstractDESSolver clone()
public abstract double[] computeChange(DESystem DES, double[] y, double t, double stepSize, double[] change, boolean steadyState) throws org.apache.commons.math.ode.DerivativeException
DES
- The system to be simulated.y
- The current state of the system.t
- The current simulation time.stepSize
- The current integration step size.change
- The vector for the resulting change of the system.steadyState
- org.apache.commons.math.ode.DerivativeException
public double computeDelayedValue(double time, String id, DESystem DES, double[] initialValues, int yIndex)
DelayValueHolder
computeDelayedValue
in interface DelayValueHolder
time
- the time point (in the past) at which the value is to be
computed for the element with the given id.id
- the id of the delayed valueDES
- the DESysteminitialValues
- the initialValues of the DESyIndex
- the index corresponding to the id in the vector of the DESprotected double[] computeSteadyState(FastProcessDESystem DES, double[] result, double timeBegin) throws org.apache.commons.math.ode.DerivativeException
DES
- the differential equation systemresult
- the result vectortimeBegin
- the current timeorg.apache.commons.math.ode.DerivativeException
public int eventOccurred(double t, double[] y, boolean increasing) throws org.apache.commons.math.ode.events.EventException
eventOccurred
in interface org.apache.commons.math.ode.events.EventHandler
org.apache.commons.math.ode.events.EventException
public void firePropertyChange(double oldValue, double newValue)
DESSolver
firePropertyChange
in interface DESSolver
public double g(double t, double[] y) throws org.apache.commons.math.ode.events.EventException
g
in interface org.apache.commons.math.ode.events.EventHandler
org.apache.commons.math.ode.events.EventException
public abstract String getName()
public double getStepSize()
DESSolver
getStepSize
in interface DESSolver
protected abstract boolean hasSolverEventProcessing()
public int inBetweenSteps(double lastTime, double nextTime, double stepSize)
lastTime
- nextTime
- stepSize
- protected MultiTable initResultMatrix(DESystem DES, double[] initialValues, double timeBegin, double timeEnd)
DES
- initialValues
- timeBegin
- timeEnd
- MultiTable
protected MultiTable initResultMatrix(DESystem DES, double[] initialValues, double timeBegin, int numSteps)
DES
- initialValues
- timeBegin
- numSteps
- MultiTable
protected MultiTable initResultMatrix(DESystem DES, double[] initialValues, double[] timePoints)
DES
- initialValues
- timePoints
- MultiTable
public boolean isIncludeIntermediates()
DESSolver
true
, intermediate results that may
originate from a RichDESystem
are included into the
MultiTable
that contains the result of a numerical integration.isIncludeIntermediates
in interface DESSolver
public boolean isNonnegative()
public boolean isUnstable()
DESSolver
Double.NaN
values.isUnstable
in interface DESSolver
public boolean processEvents(EventDESystem EDES, double time, double previousTime, double[] yTemp) throws org.apache.commons.math.ode.DerivativeException
EDES
- the differential equation system with eventstime
- the current timepreviousTime
- the time this function has been called previouslyyTemp
- the vector Ytemporg.apache.commons.math.ode.DerivativeException
public boolean processEventsAndRules(boolean forceProcessing, DESystem DES, double t, double previousTime, double[] yTemp) throws org.apache.commons.math.ode.DerivativeException
forceProcessing
- flag that is true if the events should be processed even if
the solver has its own event processingDES
- the differential equation system with eventst
- the current timepreviousTime
- the time this function has been called previouslyyTemp
- the vector Ytemporg.apache.commons.math.ode.DerivativeException
public boolean processRules(EventDESystem EDES, double time, double[] Ytemp) throws org.apache.commons.math.ode.DerivativeException
EDES
- the differential equation system with eventstime
- the current timeYtemp
- the vector Ytemporg.apache.commons.math.ode.DerivativeException
public void removePropertyChangeListener(PropertyChangeListener listener)
DESSolver
removePropertyChangeListener
in interface DESSolver
public void resetState(double t, double[] y) throws org.apache.commons.math.ode.events.EventException
resetState
in interface org.apache.commons.math.ode.events.EventHandler
org.apache.commons.math.ode.events.EventException
public void setIncludeIntermediates(boolean includeIntermediates)
DESSolver
MultiTable
of the result.setIncludeIntermediates
in interface DESSolver
includeIntermediates
- if true
, intermediate results are included into the
result.public void setNonnegative(boolean nonnegative)
nonnegative
- the nonnegative to setpublic void setStepSize(double stepSize)
DESSolver
setStepSize
in interface DESSolver
public void setUnstableFlag(boolean unstableFlag)
unstableFlag
- public MultiTable solve(DESystem DES, double[] initialValues, double timeBegin, double timeEnd) throws org.apache.commons.math.ode.DerivativeException
DESSolver
solve
in interface DESSolver
DES
- the differential equation systeminitialValues
- timeBegin
- timeEnd
- MultiTable
org.apache.commons.math.ode.DerivativeException
- if something's wrong...public MultiTable solve(DESystem DES, double[] initialValues, double x, double h, int steps) throws org.apache.commons.math.ode.DerivativeException
DESSolver
solve
in interface DESSolver
DES
- The differential equation system to be solved.initialValues
- Return value at the start point.x
- Start argument.h
- Step size.steps
- Number of steps.org.apache.commons.math.ode.DerivativeException
- if something's wrong...public MultiTable solve(DESystem DES, double[] initialValues, double[] timePoints) throws org.apache.commons.math.ode.DerivativeException
DESSolver
public MultiTable solve(DESystem DES, MultiTable.Block initConditions, double[] initialValues) throws org.apache.commons.math.ode.DerivativeException
DESSolver
DESystem
using new initial conditions in each
time step. The given MultiTable
contains the expected
solution of the solver at certain time points. The solver has the task to
re-initialize the integration procedure in each given time point using
the initial values from this state.solve
in interface DESSolver
DES
- The DESystem
to be simulated.initConditions
- A time series of initial conditions for each time point. In
some cases the dimension of the given DESystem
may
exceed the number of columns in this given time-series. Thus,
for the initialization of the simulation a full vector of
initial values is required and must be passed to this method
as a separate double array.initialValues
- An array of all initial values. This array may exceed the
number of columns in the given MultiTable.Block
but its length
must equal the dimension of the given DESystem
.MultiTable
containing a time series of the
same dimension as given by the DESystem
and simulated
values at each time point.org.apache.commons.math.ode.DerivativeException
public MultiTable steadystate(DESystem DES, double[] initialValues, double maxSteps) throws org.apache.commons.math.ode.DerivativeException
org.apache.commons.math.ode.DerivativeException
Copyright © 2007–2018. All rights reserved.