![]() |
Numerical Tools
1.0
Numerical tools from SciPy and Numerical Methods in Physics with Python
|
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... | |
![]() | |
bool | status |
bool double [] | y |
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.
|
inline |
Initialize a DE system for real-time evolution via EvolveTo() calls.
fun | Function 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 |
method | The algorithm to use |
events | List of event structs |
args |
|
inline |
Get a copy of the state vector.
Integrators do not share a reference to their internal state vector.
Implements NumericalTools.RealtimeIntegratorInterface.
|
inline |
Set an end time for the numerical integration.
t |
|
inline |
Set a backstop on the number of steps per frame
NumericalTools.IvpRealtime.bool |
Evolve the time in the DE system to toTime
toTime |
(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)