Central class for the port of the SciPy Solve_Ivp method to perform numerical integration of a system of ordinary differential equations using the error minimizing approaches RK23, RK45 or DOP853.
More...
|
struct | Event |
| Structure to define an Event for the DE solver. More...
|
|
class | OdeResult |
| This class is a strut-like wrapper for the information associated with a DE solution. More...
|
|
|
enum | Method { RK23,
RK45,
DOP853
} |
|
|
delegate double [] | DiffEqFunction (double t, double[] y, params object[] args) |
| Prototype for a function that defines the system of differential equations to be solved. More...
|
|
delegate double | EventFunction (double t, double[] y) |
| Prototype for an EventFunction to be evaluated as the DE is being solved. More...
|
|
delegate void | RTEventCallback (double t, double[] y) |
| A function to be called when IvpRealtime events are triggered. More...
|
|
|
static List< int > | FindActiveEvents (double[] g, double[] g_new, double[] direction) |
| Not for external use. This method is public to allow access by IvpRealtime. More...
|
|
static OdeResult | SolveIvp (DiffEqFunction fun, double[] t_span, double[] y0, Method method=Method.RK45, double[] t_eval=null, bool dense_output=false, List< Event > events=null, bool vectorized=false, params object[] args) |
| SolveIvp is the partial implementation of the SciPy solve_ivp function. More...
|
|
Central class for the port of the SciPy Solve_Ivp method to perform numerical integration of a system of ordinary differential equations using the error minimizing approaches RK23, RK45 or DOP853.
A summary of the features provided is at http://nbodyphysics.com/blog/numericaltools See the SciPy solve_ivp documentation for an in-depth reference.
◆ DiffEqFunction()
delegate double [] NumericalTools.Ivp.DiffEqFunction |
( |
double |
t, |
|
|
double [] |
y, |
|
|
params object [] |
args |
|
) |
| |
Prototype for a function that defines the system of differential equations to be solved.
- Parameters
-
t | time of the current state of the DE system |
y | Current state of the DE systems |
args | (optional) arguments as object[] that can be referenced by the DE system |
- Returns
◆ EventFunction()
delegate double NumericalTools.Ivp.EventFunction |
( |
double |
t, |
|
|
double [] |
y |
|
) |
| |
Prototype for an EventFunction to be evaluated as the DE is being solved.
If the event function returns zero, the event MAY be triggered, depending on whether the associated Event structure has indicated that the result of the function must be in positive or negative direction.
- Parameters
-
t | time of the current state of the DE system |
y | Current state of the DE systems |
- Returns
◆ FindActiveEvents()
static List<int> NumericalTools.Ivp.FindActiveEvents |
( |
double [] |
g, |
|
|
double [] |
g_new, |
|
|
double [] |
direction |
|
) |
| |
|
inlinestatic |
Not for external use. This method is public to allow access by IvpRealtime.
- Parameters
-
- Returns
◆ RTEventCallback()
delegate void NumericalTools.Ivp.RTEventCallback |
( |
double |
t, |
|
|
double [] |
y |
|
) |
| |
A function to be called when IvpRealtime events are triggered.
- Parameters
-
t | time of the current state of the DE system |
y | Current state of the DE systems |
◆ SolveIvp()
static OdeResult NumericalTools.Ivp.SolveIvp |
( |
DiffEqFunction |
fun, |
|
|
double [] |
t_span, |
|
|
double [] |
y0, |
|
|
Method |
method = Method.RK45 , |
|
|
double [] |
t_eval = null , |
|
|
bool |
dense_output = false , |
|
|
List< Event > |
events = null , |
|
|
bool |
vectorized = false , |
|
|
params object [] |
args |
|
) |
| |
|
inlinestatic |
SolveIvp is the partial implementation of the SciPy solve_ivp function.
The methods RK23, RK45 and DOP853 are implemented. Unit tests to compare the results of each method to the output from SciPy under python can be found in the QA directory of the asset.
Example code can be found in the NUnit tests as well as the directory: SciPyBased/Scenes/Solve_Ivp.
For a general overview see the Numerical Tools documentation at nbodyphysics.com
- Parameters
-
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 |
t_eval | A list of specific times that the DE system should be recorded at |
dense_output | (bool) Record intermediate values for later use with OdeResult.Call() |
events | List of event structs |
vectorized | Unsupported |
args | |
- Returns
◆ isTerminal
bool [] NumericalTools.Ivp.isTerminal |
|
static |
Not for external use. This method is public to allow access by IvpRealtime.
- Parameters
-
- Returns
◆ List< int >
NumericalTools.Ivp.List< int > |
|
static |
Not for external use. This method is public to allow access by IvpRealtime.
- Parameters
-
sol | |
events | |
active_events | |
is_terminal | |
t_old | |
t | |
- Returns
The documentation for this class was generated from the following file:
- DE Solver/Assets/NumericalTools/SciPyBased/Scripts/Solvers/Ivp/Ivp.cs