![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Adaptive integration of ordinary differential equations. More...
Go to the source code of this file.
Functions | |
| int | odesolve_open (int n) |
| Allocate the legacy solver's shared workspace for n equations. | |
| void | odesolve_close (void) |
| Free every legacy ODE workspace array and reset capacity to zero. | |
| int | odesolve_integrate (double ystart[], int n, double x1, double x2, double eps, double h1, void(*derivs)(double, double *, double *)) |
| Integrate an ODE system with adaptive Cash-Karp RK45 steps. | |
Adaptive integration of ordinary differential equations.
| void odesolve_close | ( | void | ) |
Free every legacy ODE workspace array and reset capacity to zero.
| int odesolve_integrate | ( | double | ystart[], |
| int | n, | ||
| double | x1, | ||
| double | x2, | ||
| double | eps, | ||
| double | h1, | ||
| void(* | derivs )(double, double *, double *) ) |
Integrate an ODE system with adaptive Cash-Karp RK45 steps.
| [in,out] | ystart | Non-null array of n initial states at x1, replaced with states at x2 on success; unchanged on an error return. |
| [in] | n | Positive equation count, no larger than allocated nmax. |
| [in] | x1 | Finite start coordinate in caller-selected units. |
| [in] | x2 | Finite end coordinate in the same units. |
| [in] | eps | Positive dimensionless tolerance relative to each state scale abs(y) + abs(h * dydx) + TINY. |
| [in] | h1 | Nonzero initial step, in x units, directed from x1 toward x2. |
| [in] | derivs | Non-null synchronous callback filling n dy/dx values from n states; borrowed arrays must not be modified or retained except for writing the derivative output. |
| int odesolve_open | ( | int | n | ) |
Allocate the legacy solver's shared workspace for n equations.
| [in] | n | Positive equation capacity; n * 5 must be representable as int. |