|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simulator.math.odes.AbstractDESSolver
public abstract class AbstractDESSolver
This Class represents an abstract solver for event-driven DES
Field Summary | |
---|---|
(package private) java.util.List<java.beans.PropertyChangeListener> |
listenerList
List of PropertyChangeListener s (for threading purpose) |
Fields inherited from interface org.apache.commons.math.ode.events.EventHandler |
---|
CONTINUE, RESET_DERIVATIVES, RESET_STATE, STOP |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
protected void |
additionalResults(DESystem DES,
double t,
double[] yTemp,
MultiTable data,
int rowIndex)
Compute additional result values |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add PropertyChangedListener to this Solver |
(package private) boolean |
checkSolution(double[] currentState)
Checks whether or not the given current state contains Double.NaN values. |
(package private) boolean |
checkSolution(double[] currentChange,
double[] yPrev)
Checks whether or not the given current state contains Double.NaN values. |
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,
java.lang.String id)
|
(package private) double |
computeNextState(DESystem DES,
double t,
double stepSize,
double[] yPrev,
double[] change,
double[] yTemp,
boolean increase,
boolean steadyState)
|
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 java.lang.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. |
(package private) int |
numSteps(double timeBegin,
double timeEnd)
Calculates and returns the number of steps for given start and end time using the currently set interval size of integration steps. |
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(java.beans.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. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.List<java.beans.PropertyChangeListener> listenerList
List
of PropertyChangeListener
s (for threading purpose)
Constructor Detail |
---|
public AbstractDESSolver()
true
.
public AbstractDESSolver(AbstractDESSolver solver)
solver
- public AbstractDESSolver(double stepSize)
stepSize
- public AbstractDESSolver(double stepSize, boolean nonnegative)
stepSize
- nonnegative
- Method Detail |
---|
public static long getSerialversionuid()
public void reset()
true
.
protected void additionalResults(DESystem DES, double t, double[] yTemp, MultiTable data, int rowIndex) throws org.apache.commons.math.ode.DerivativeException
the
- differential equation systemthe
- current timethe
- vector yTempthe
- data as multi tablethe
- index of the row
org.apache.commons.math.ode.DerivativeException
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
DESSolver
addPropertyChangeListener
in interface DESSolver
boolean checkSolution(double[] currentState)
currentState
- The current state of the system during a simulation.
boolean checkSolution(double[] currentChange, double[] yPrev)
the
- current change of the system during a simulation.the
- previous state of the system
public abstract AbstractDESSolver clone()
clone
in interface DESSolver
clone
in class java.lang.Object
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.The
- current integration step size.change
- The vector for the resulting change of the system.steadyState
-
java.lang.Exception
org.apache.commons.math.ode.DerivativeException
public double computeDelayedValue(double time, java.lang.String id) throws org.apache.commons.math.ode.DerivativeException
computeDelayedValue
in interface DelayValueHolder
org.apache.commons.math.ode.DerivativeException
double computeNextState(DESystem DES, double t, double stepSize, double[] yPrev, double[] change, double[] yTemp, boolean increase, boolean steadyState) throws org.apache.commons.math.ode.DerivativeException
the
- differential equation systemthe
- current timestepSize
- the
- previous y vectorthe
- change vectorthe
- current y vector to be filledincrease
- whether or not to increase the given time by the given step
size.
org.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 java.lang.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
-
protected MultiTable initResultMatrix(DESystem DES, double[] initialValues, double timeBegin, int numSteps)
DES
- initialValues
- timeBegin
- numSteps
-
protected MultiTable initResultMatrix(DESystem DES, double[] initialValues, double[] timePoints)
DES
- initialValues
- timePoints
-
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
int numSteps(double timeBegin, double timeEnd)
timeBegin
- timeEnd
-
public boolean processEvents(EventDESystem EDES, double time, double previousTime, double[] yTemp) throws org.apache.commons.math.ode.DerivativeException
the
- differential equation system with eventsthe
- current timethe
- time this function has been called previouslythe
- vector Ytemp
org.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
flag
- that is true if the events should be processed even if the solver has its own event processingthe
- differential equation system with eventsthe
- current timethe
- time this function has been called previouslythe
- vector Ytemp
org.apache.commons.math.ode.DerivativeException
public boolean processRules(EventDESystem EDES, double time, double[] Ytemp) throws org.apache.commons.math.ode.DerivativeException
the
- differential equation system with eventsthe
- current timethe
- vector Ytemp
org.apache.commons.math.ode.DerivativeException
public void removePropertyChangeListener(java.beans.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
differential
- equation systeminitialValues
- timeBegin
- timeEnd
-
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.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
solve
in interface DESSolver
differential
- equation systeminitialValues
- the
- time points
org.apache.commons.math.ode.DerivativeException
- if something's wrong...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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |