predict()#

ContinuousModel.predict(state0, t, input_func=None, **options)[source]#

Solve the system of ordinary differential equations. This method wraps scipy.integrate.solve_ivp().

Parameters
state0(r,) ndarray

Initial state vector.

t(nt,) ndarray

Time domain over which to integrate the model.

input_funccallable or (m, nt) ndarray

Input as a function of time (preferred) or the input values at the times t. If given as an array, cubic spline interpolation on the known data points is used as needed.

options

Arguments for scipy.integrate.solve_ivp(), See https://docs.scipy.org/doc/scipy/reference/integrate.html. Common options:

  • method : str ODE solver for the model.

    • 'RK45' (default): Explicit Runge–Kutta method of order 5(4).

    • 'RK23': Explicit Runge–Kutta method of order 3(2).

    • 'Radau': Implicit Runge–Kutta method of the Radau IIA family of order 5.

    • 'BDF': Implicit multi-step variable-order (1 to 5) method based on a backward differentiation formula for the derivative.

    • 'LSODA': Adams/BDF method with automatic stiffness detection and switching.

  • max_step : float Maximimum allowed integration step size.

Returns
states(r, nt) ndarray

Computed solution to the system over the time domain t. A more detailed report on the integration results is stored as the predict_result_ attribute.