public abstract class AbstractDESSolver extends Object implements DelayValueHolder, DESSolver, org.apache.commons.math.ode.events.EventHandler
Modifier and Type | Field and Description |
---|---|
static String |
PROGRESS
Key used when informing listeners about progress by this solver.
|
static String |
RESULT
Key used when informing listeners about change in the result by this solver.
|
Constructor and Description |
---|
AbstractDESSolver()
Initialize with default integration step size and non-negative attribute
true . |
AbstractDESSolver(AbstractDESSolver solver)
Clone constructor.
|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
int |
eventOccurred(double t,
double[] y,
boolean increasing) |
void |
firePropertyChange(double previousTimePoint,
double currTimePoint,
double[] currResult)
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.
|
int |
inBetweenSteps(double lastTime,
double nextTime,
double stepSize)
Computes the number of necessary steps between two time steps.
|
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[] timePoints,
PropertyChangeListener propertyChangeListener)
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,
double[] initialValues,
double x,
double h,
int steps,
PropertyChangeListener propertyChangeListener)
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,
PropertyChangeListener propertyChangeListener)
Solves the given differential equation system
|
MultiTable |
solve(DESystem DES,
MultiTable.Block timeSeriesInitConditions,
double[] initialValues)
Solves the given
DESystem using new initial conditions in each time step. |
MultiTable |
solve(DESystem DES,
MultiTable.Block initConditions,
double[] initialValues,
PropertyChangeListener propertyChangeListener)
Solves the given
DESystem using new initial conditions in each time step. |
MultiTable |
steadystate(DESystem DES,
double[] initialValues,
double maxSteps) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKiSAOterm
public static final String PROGRESS
public static final String RESULT
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
.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 DESpublic 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 previousTimePoint, double currTimePoint, double[] currResult)
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
public int inBetweenSteps(double lastTime, double nextTime, double stepSize)
lastTime
- nextTime
- stepSize
- 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
public MultiTable solve(DESystem DES, double[] initialValues, double timeBegin, double timeEnd, PropertyChangeListener propertyChangeListener) throws org.apache.commons.math.ode.DerivativeException
solve
in interface DESSolver
DES
- The differential equation system to be solved.initialValues
- Return value at the start point.propertyChangeListener
- Instance of class which is to be signalled on changed property.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
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 x, double h, int steps, PropertyChangeListener propertyChangeListener) throws org.apache.commons.math.ode.DerivativeException
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.propertyChangeListener
- Instance of class which is to be signalled on changed property.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
solve
in interface DESSolver
DES
- The differential equation system to be solved.initialValues
- Return value at the start point.timepoints
- The timepoints for which the result should be returned.org.apache.commons.math.ode.DerivativeException
- if something's wrong...public MultiTable solve(DESystem DES, double[] initialValues, double[] timePoints, PropertyChangeListener propertyChangeListener) throws org.apache.commons.math.ode.DerivativeException
solve
in interface DESSolver
DES
- The differential equation system to be solved.initialValues
- Return value at the start point.timePoints
- The timepoints for which the result should be returnedpropertyChangeListener
- Instance of class which is to be signalled on changed property.org.apache.commons.math.ode.DerivativeException
- if something's wrong...public MultiTable solve(DESystem DES, MultiTable.Block timeSeriesInitConditions, double[] initialValues) throws org.apache.commons.math.ode.DerivativeException
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.timeSeriesInitConditions
- 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 solve(DESystem DES, MultiTable.Block initConditions, double[] initialValues, PropertyChangeListener propertyChangeListener) throws org.apache.commons.math.ode.DerivativeException
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
.propertyChangeListener
- Instance of class which is to be signalled on changed
property.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–2021. All rights reserved.