rcognita.solvers.CasADiSolver

class rcognita.solvers.CasADiSolver(integrator, time_start: float, time_final: float, step_size: float, state_init: numpy.array, action_init: numpy.array, system: rcognita.systems.System)

The CasADiSolver class is a subclass of the abstract Solver class that allows for the integration of a system of differential equations using the CasADi library. It can be used to solve a system of equations with a given initial state and action, and a given step size and final time. The CasADiSolver class has several properties, including the integrator object, the starting and ending times for the integration, the step size for the integration, the initial and current states of the system, and the initial and current actions applied to the system. It also has a step() method which advances the integration by one time step and updates the current state of the system.

__init__(integrator, time_start: float, time_final: float, step_size: float, state_init: numpy.array, action_init: numpy.array, system: rcognita.systems.System)

Initialize a CasADiSolver object.

Parameters
  • integrator (casadi.integrator) – A CasADi integrator object.

  • time_start (float) – The starting time for the solver.

  • time_final (float) – The final time for the solver.

  • step_size (float) – The step size for the solver.

  • state_init (np.array) – The initial state for the solver.

  • action_init (np.array) – The initial action for the solver.

  • system (System) – The system object for the solver.

Methods

__init__(integrator, time_start, time_final, …)

Initialize a CasADiSolver object.

step()

Advance the solver by one step.

Attributes

t

y