xso.solvers.IVPSolver

class xso.solvers.IVPSolver[source]

Solver backend using scipy.integrate.solve_ivp to solve model.

SOLVE_IVP is a variable step-size solver for ordinary differential equations, included in the SciPy Python package.

By default, it utilizes an explicit Runge-Kutta method of order 5(4).

__init__()[source]

Methods

__init__()

add_forcing(label, forcing_func, model)

Compute forcing for model time.

add_parameter(label, value)

Returns parameter as numpy array.

add_variable(label, initial_value, model)

Reformats variable to comply with solver and return storage array.

assemble(model)

Define full model dimensions after initialization.

cleanup()

Empty cleanup method, not necessary for this solver.

register_flux(label, flux, model, dims)

Method to reformat flux function with appropriate inputs and to proper size.

return_dims_and_array(value, model_time)

Helper function to expand numpy array to appropriate size for odeint solver based on value and model time.

solve(model, time_step)

Solve model using scipy.integrate.solve_ivp, passing model_function, initial values and model.time.