pyodeint package¶
Python binding for odeint from boost.
-
pyodeint.
integrate_adaptive
(rhs, jac, y0, x0, xend, atol, rtol, dx0=0.0, dx_max=0.0, check_callable=False, check_indexing=False, \*\*kwargs)[source]¶ Integrates a system of ordinary differential equations.
- Parameters
- rhs: callable
Function with signature f(t, y, fout) which modifies fout inplace.
- jac: callable
Function with signature j(t, y, jmat_out, dfdx_out) which modifies jmat_out and dfdx_out inplace.
- y0: array_like
Initial values of the dependent variables.
- x0: float
Initial value of the independent variable.
- xend: float
Stopping value for the independent variable.
- atol: float
Absolute tolerance.
- rtol: float
Relative tolerance.
- dx0: float
Initial step-size.
- dx_max: float
Maximum step-size.
- check_callable: bool (default: False)
Perform signature sanity checks on
rhs
andjac
.- check_indexing: bool (default: False)
Perform item setting sanity checks on
rhs
andjac
.- **kwargs:
- ‘method’: str
‘rosenbrock4’, ‘dopri5’ or ‘bs’
- ‘return_on_error’: bool
Returns on error without raising an excpetion (with
'success'==False
).- ‘autorestart’: int
Useful for autonomous systems where conditions change during integration. Will restart the integration with
x==0
.- ‘dx0cb’: callable
Callback for calculating dx0 (make sure to pass
dx0==0.0
) to enable. Signature:f(x, y[:]) -> float
.
- Returns
- (xout, yout, info):
xout: 1-dimensional array of values for the independent variable yout: 2-dimensional array of the dependent variables (axis 1) for
values corresponding to xout (axis 0)
info: dictionary with information about the integration
-
pyodeint.
integrate_predefined
(rhs, jac, y0, xout, atol, rtol, dx0=0.0, dx_max=0.0, check_callable=False, check_indexing=False, \*\*kwargs)[source]¶ Integrates a system of ordinary differential equations.
- Parameters
- rhs: callable
Function with signature f(t, y, fout) which modifies fout inplace.
- jac: callable
Function with signature j(t, y, jmat_out, dfdx_out) which modifies jmat_out and dfdx_out inplace.
- y0: array_like
Initial values of the dependent variables.
- xout: array_like
Values of the independent variable.
- atol: float
Absolute tolerance.
- rtol: float
Relative tolerance.
- dx0: float
Initial step-size.
- dx_max: float
Maximum step-size.
- check_callable: bool (default: False)
Perform signature sanity checks on
rhs
andjac
.- check_indexing: bool (default: False)
Perform item setting sanity checks on
rhs
andjac
.- **kwargs:
- ‘method’: str
One in
('rosenbrock4', 'dopri5', 'bs')
.- ‘return_on_error’: bool
Returns on error without raising an excpetion (with
'success'==False
).- ‘autorestart’: int
Useful for autonomous systems where conditions change during integration. Will restart the integration with
x==0
.- ‘dx0cb’: callable
Callback for calculating dx0 (make sure to pass
dx0==0.0
) to enable. Signature:f(x, y[:]) -> float
.
- Returns
- (result, info):
- result: 2-dimensional array of the dependent variables (axis 1) for
values corresponding to xout (axis 0)
info: dictionary with information about the integration