SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.simevents.ContinuousState Class Reference

Represents the portion of the simulator’s state associated with continuous-time simulation. More...

Classes

enum  IntegMethod

Public Member Functions

List< ContinuousgetContinuousVariables ()
 Returns the list of continuous-time variables currently integrated by the simulator.
IntegMethod integMethod ()
 Return an integer that represent the integration method in use.
void selectEuler (double h)
 Selects the Euler method as the integration method, with the integration step size h, in time units.
void selectRungeKutta2 (double h)
 Selects a Runge-Kutta method of order 2 as the integration method to be used, with step size h.
void selectRungeKutta4 (double h)
 Selects a Runge-Kutta method of order 4 as the integration method to be used, with step size h.

Protected Member Functions

 ContinuousState (Simulator sim)
 Creates a new ContinuousState object linked to the given simulator.
void startInteg (Continuous c)
 Starts the integration process that will change the state of.
void stopInteg (Continuous c)
 Stops the integration process for Continuous variable.

Detailed Description

Represents the portion of the simulator’s state associated with continuous-time simulation.

Any simulator, including the default static one, can have an associate continuous state which is obtained using the continuousState() method of the Simulator class. This state includes all active integration variables as well as the current integration method.

One of the methods selectEuler, selectRungeKutta2 or selectRungeKutta4 must be called before starting any integration. These methods permit one to select the numerical integration method and the step size h (in time units) that will be used for all continuous-time variables linked to the simulator. For all the methods, an integration step at time \(t\) changes the values of the variables from their old values at time \(t-h\) to their new values at time \(t\).

Each integration step is scheduled as an event and added to the event list.

Definition at line 51 of file ContinuousState.java.

Constructor & Destructor Documentation

◆ ContinuousState()

umontreal.ssj.simevents.ContinuousState.ContinuousState ( Simulator sim)
protected

Creates a new ContinuousState object linked to the given simulator.

Usually, the user should not call this constructor directly since a new object is created automatically by the continuousState() method of class Simulator.

Definition at line 108 of file ContinuousState.java.

Member Function Documentation

◆ getContinuousVariables()

List< Continuous > umontreal.ssj.simevents.ContinuousState.getContinuousVariables ( )

Returns the list of continuous-time variables currently integrated by the simulator.

The returned list is updated automatically as variables are added or removed, but it cannot be modified directly. One must instead use startInteg or stopInteg in class

Continuous to add or remove variables.

Definition at line 122 of file ContinuousState.java.

◆ integMethod()

IntegMethod umontreal.ssj.simevents.ContinuousState.integMethod ( )

Return an integer that represent the integration method in use.

Returns
Interger that represent the integration method in use.

Definition at line 160 of file ContinuousState.java.

◆ selectEuler()

void umontreal.ssj.simevents.ContinuousState.selectEuler ( double h)

Selects the Euler method as the integration method, with the integration step size h, in time units.

Parameters
hintegration step, in simulation time units

Definition at line 170 of file ContinuousState.java.

◆ selectRungeKutta2()

void umontreal.ssj.simevents.ContinuousState.selectRungeKutta2 ( double h)

Selects a Runge-Kutta method of order 2 as the integration method to be used, with step size h.

Parameters
hintegration step, in simulation time units

Definition at line 181 of file ContinuousState.java.

◆ selectRungeKutta4()

void umontreal.ssj.simevents.ContinuousState.selectRungeKutta4 ( double h)

Selects a Runge-Kutta method of order 4 as the integration method to be used, with step size h.

Parameters
hintegration step, in simulation time units

Definition at line 199 of file ContinuousState.java.

◆ startInteg()

void umontreal.ssj.simevents.ContinuousState.startInteg ( Continuous c)
protected

Starts the integration process that will change the state of.

Continuous variable at each integration step.

Definition at line 131 of file ContinuousState.java.

◆ stopInteg()

void umontreal.ssj.simevents.ContinuousState.stopInteg ( Continuous c)
protected

Stops the integration process for Continuous variable.

The variable keeps the value it took at the last integration step before calling stopInteg.

Definition at line 148 of file ContinuousState.java.


The documentation for this class was generated from the following file: