public abstract class OdeSolver extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
OdeSolver.ThetaQueue
Manages the registered theta events.
|
Modifier and Type | Field and Description |
---|---|
private OdeController |
controller |
protected double |
currentTime |
protected List<Double> |
dependentVariables |
private Double |
independentVariableEnd |
private Double |
independentVariableStart |
private Set<Observer> |
observers |
private Ode |
ode |
protected double |
stepSize |
private OdeSolver.ThetaQueue |
thetaQueue |
Constructor and Description |
---|
OdeSolver(Ode ode,
double tStart,
double tEnd,
double stepSize)
Create the solver object with initial consitions.
|
Modifier and Type | Method and Description |
---|---|
void |
addObserver(Observer observer)
Add an observer to the engines list of observers.
|
protected void |
doThetaEvent()
Gets called when the simulator reaches the predetermined time of a theta event.
|
List<Double> |
getDependentVariables()
Get the dependent variables.
|
String |
getDependetVariablesAsCsv()
Get a csv representation of the current state of the dependent variables.
|
double |
getNextThetaEventTime()
Theta defines a moment, where the simulator has to invoke theta of a observers.
|
void |
registerNewTheta(Observer obs,
double thetaTime,
Object event)
Register a new theta event that is triggered at a given time.
|
abstract void |
run()
Solve the system of ODEs.
|
protected final double stepSize
private final Double independentVariableStart
private final Double independentVariableEnd
private final Ode ode
protected double currentTime
private OdeController controller
private OdeSolver.ThetaQueue thetaQueue
public OdeSolver(Ode ode, double tStart, double tEnd, double stepSize)
ode
- the ode object containing the specification of the ode.tStart
- the start time (the independent variable is assumed to be time)tEnd
- the end time (the independent variable is assumed to be time)stepSize
- the size of the step to be used in the solver.public final void addObserver(Observer observer)
observer
- the observer.public final void registerNewTheta(Observer obs, double thetaTime, Object event)
obs
- the observers which is registering.thetaTime
- the time the theta event occurs.event
- the theta event.protected final void doThetaEvent()
public final double getNextThetaEventTime()
Simulator#doThetaEvent()
which basically calls the observers.public final String getDependetVariablesAsCsv()
public final List<Double> getDependentVariables()
public abstract void run()
Copyright © 2015 University of Glasgow. All rights reserved.