scipy.integrate.ode Solver

class gym_electric_motor.physical_systems.solvers.ScipyOdeSolver(integrator='dopri5', **kwargs)[source]

Wrapper class for all ode-solvers in the scipy.integrate.ode package.

https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.ode.html

Parameters:
  • integrator (str) – String to choose the integrator from the scipy.integrate.ode

  • kwargs (dict) – All parameters that can be set in the “set_integrator”-method of scipy.integrate.ode

integrate(t)[source]

Integrate the ODE-System from current time until time t

Parameters:

t (float) – Time until the system shall be integrated

Returns:

New system state at time t

Return type:

ndarray(float)

set_f_params(*args)[source]

Set further arguments for the systems function call like input quantities.

Parameters:

args (list) – Additional arguments for the next function calls.

set_initial_value(initial_value, t=0)[source]

Set the new initial system state after reset.

Parameters:
  • initial_value (numpy.ndarray(float)) – Initial system state

  • t (float) – Initial system time

set_system_equation(system_equation, jac=None)[source]

Setting of the systems equation.

Parameters:
  • system_equation (function_pointer) – Pointer to the systems equation with the parameters (t, y, *args)

  • jac (function_pointer) – Pointer to the systems jacobian with the parameters (t, y, *args)

property t

Returns: float: Current system time t

property y

Returns: float: Current system state y