Class DifferentialEquation<T extends Number & Comparable<T>>
java.lang.Object
org.djutils.event.LocalEventProducer
nl.tudelft.simulation.jstats.ode.DifferentialEquation
nl.tudelft.simulation.dsol.formalisms.dess.DifferentialEquation<T>
- Type Parameters:
T
- the time type
- All Implemented Interfaces:
Serializable
,Remote
,EventListener
,DifferentialEquationInterface
,org.djutils.event.EventListener
,org.djutils.event.EventProducer
public abstract class DifferentialEquation<T extends Number & Comparable<T>>
extends DifferentialEquation
implements DifferentialEquationInterface, org.djutils.event.EventListener
The Differential equation provides a reference implementation of the differential equation.
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Since:
- 1.5
- Author:
- Peter Jacobs
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionorg.djutils.event.EventType
FUNCTION_CHANGED_EVENT is fired on function changes.int
the number of variables in the equation.protected double
the previousX.protected double[]
the previousY.protected DessSimulatorInterface<T>
simulator.org.djutils.event.EventType[]
VALUE_CHANGED_EVENT is fired on value changes.Fields inherited from class nl.tudelft.simulation.jstats.ode.DifferentialEquation
lastX, lastY, stepSize
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION
-
Constructor Summary
ConstructorDescriptionDifferentialEquation
(DessSimulatorInterface<T> simulator, double timeStep, NumericalIntegratorType numericalIntegrator, int numberOfVariables) constructs a new DifferentialEquation.DifferentialEquation
(DessSimulatorInterface<T> simulator, int numberOfVariables) Construct a new DifferentialEquation with a step size equal to the simulator time step, and Runge-Kutta4 as the default integrator.DifferentialEquation
(DessSimulatorInterface<T> simulator, NumericalIntegratorType numericalIntegrator, int numberOfVariables) constructs a new DifferentialEquation with a step size equal to the simulator timestep. -
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(double x, double[] y) initializes the differential equation.void
notify
(org.djutils.event.Event event) Methods inherited from class nl.tudelft.simulation.jstats.ode.DifferentialEquation
getIntegrator, integrateY, setIntegrator, y
Methods inherited from class org.djutils.event.LocalEventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nl.tudelft.simulation.jstats.ode.DifferentialEquationInterface
dy, y
-
Field Details
-
VALUE_CHANGED_EVENT
public org.djutils.event.EventType[] VALUE_CHANGED_EVENTVALUE_CHANGED_EVENT is fired on value changes. The array is initialized in the ODE's constructor. -
FUNCTION_CHANGED_EVENT
public org.djutils.event.EventType FUNCTION_CHANGED_EVENTFUNCTION_CHANGED_EVENT is fired on function changes. -
simulator
simulator. -
numberOfVariables
public int numberOfVariablesthe number of variables in the equation. -
previousX
protected double previousXthe previousX. -
previousY
protected double[] previousYthe previousY.
-
-
Constructor Details
-
DifferentialEquation
public DifferentialEquation(DessSimulatorInterface<T> simulator, int numberOfVariables) throws RemoteException Construct a new DifferentialEquation with a step size equal to the simulator time step, and Runge-Kutta4 as the default integrator. Indicate the number of variables that the differential qquation will use.- Parameters:
simulator
- DessSimulatorInterface<T>; the simulatornumberOfVariables
- int; the number of variables in the equation- Throws:
RemoteException
- on remote network exception for the listener
-
DifferentialEquation
public DifferentialEquation(DessSimulatorInterface<T> simulator, NumericalIntegratorType numericalIntegrator, int numberOfVariables) throws RemoteException constructs a new DifferentialEquation with a step size equal to the simulator timestep.- Parameters:
simulator
- DessSimulatorInterface<T>; the simulatornumericalIntegrator
- NumericalIntegrator; the actual integrator to be used.numberOfVariables
- int; the number of variables in the equation- Throws:
RemoteException
- on remote network exception for the listener
-
DifferentialEquation
public DifferentialEquation(DessSimulatorInterface<T> simulator, double timeStep, NumericalIntegratorType numericalIntegrator, int numberOfVariables) throws RemoteException constructs a new DifferentialEquation.- Parameters:
simulator
- DessSimulatorInterface<T>; the simulator.timeStep
- double; the timeStep for ODE estimation.numericalIntegrator
- NumericalIntegrator; the actual integrator to be used.numberOfVariables
- int; the number of variables in the equation- Throws:
RemoteException
- on remote network exception for the listener
-
-
Method Details
-
notify
- Specified by:
notify
in interfaceorg.djutils.event.EventListener
- Throws:
RemoteException
-
initialize
public void initialize(double x, double[] y) initializes the differential equation.- Specified by:
initialize
in interfaceDifferentialEquationInterface
- Overrides:
initialize
in classDifferentialEquation
- Parameters:
x
- double; the initial x-valuey
- double[]; the initial y-value array
-