Numerical Tools  1.0
Numerical tools from SciPy and Numerical Methods in Physics with Python
NumericalTools.IvpRealtime Class Reference

Real time interface to the ODE solver code. More...

Inherits NumericalTools.RealtimeIntegratorInterface.

Public Types

enum  Status { OK, STEP_LIMIT, FAILED }
 

Public Member Functions

 IvpRealtime (Ivp.DiffEqFunction fun, double[] t_span, double[] y0, Ivp.Method method=Ivp.Method.RK45, List< Ivp.Event > events=null, params object[] args)
 Initialize a DE system for real-time evolution via EvolveTo() calls. More...
 
void SetVerbose (bool v)
 
void SetStepLimit (int limit)
 Set a backstop on the number of steps per frame More...
 
void SetEndTime (double t)
 Set an end time for the numerical integration. More...
 
void Reset ()
 
double [] GetStateVectorCloned ()
 Get a copy of the state vector. More...
 
void UpdateStateVector (double[] y_new)
 

Public Attributes

Status status = Status.OK
 
double [] Current => current
 
 bool
 Evolve the time in the DE system to toTime More...
 
- Public Attributes inherited from NumericalTools.RealtimeIntegratorInterface
bool status
 
bool double [] y
 

Detailed Description

Real time interface to the ODE solver code.

The system definition and intital conditions are specified when IvpRealtime is created via the constructor.

Evolution of the system is accomplished by calls to the EvolveTo() method.

Realtime changes in the DE system can be accomplished by getting the state using GetStateVectorCloned() and then writing back a modified state with UpdateStateVector(). Note that the integrator will likely have some internal state that will need to evolve based on the new state vector and the system may take a few integration cycles to fully adjust to the change in state.

Constructor & Destructor Documentation

◆ IvpRealtime()

NumericalTools.IvpRealtime.IvpRealtime ( Ivp.DiffEqFunction  fun,
double []  t_span,
double []  y0,
Ivp.Method  method = Ivp.Method.RK45,
List< Ivp.Event events = null,
params object []  args 
)
inline

Initialize a DE system for real-time evolution via EvolveTo() calls.

Parameters
funFunction that provides the description of the system of DEs
t_span(double[2]) Time range (from..to) to solve the DE system for
y0(double[n]) Initial conditions for the DE system
methodThe algorithm to use
eventsList of event structs
args

Member Function Documentation

◆ GetStateVectorCloned()

double [] NumericalTools.IvpRealtime.GetStateVectorCloned ( )
inline

Get a copy of the state vector.

Integrators do not share a reference to their internal state vector.

Returns

Implements NumericalTools.RealtimeIntegratorInterface.

◆ SetEndTime()

void NumericalTools.IvpRealtime.SetEndTime ( double  t)
inline

Set an end time for the numerical integration.

Parameters
t

◆ SetStepLimit()

void NumericalTools.IvpRealtime.SetStepLimit ( int  limit)
inline

Set a backstop on the number of steps per frame

Member Data Documentation

◆ bool

NumericalTools.IvpRealtime.bool

Evolve the time in the DE system to toTime

Parameters
toTime
Returns

(bool status, double[] y, double t) status: ok if true y: current state of the system t: time the system evolved to (may slightly exceed the requested toTime due to integrator dynamic time stepping)


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