MIMPC++
A fast typesafe Mixed Integer MPC C++ library
Public Types | Public Member Functions | Static Public Attributes | List of all members
mimpc::System< num_states, num_cont_inputs, num_bin_inputs > Class Template Referenceabstract

#include <System.hpp>

Inheritance diagram for mimpc::System< num_states, num_cont_inputs, num_bin_inputs >:
Inheritance graph
[legend]

Public Types

using AMatrix = typename Eigen::Matrix< double, num_states, num_states >
 
using BMatrix = typename Eigen::Matrix< double, num_states, num_cont_inputs+num_bin_inputs >
 
using StateVec = typename Eigen::Vector< double, num_states >
 
using InputVec = typename Eigen::Vector< double, num_cont_inputs+num_bin_inputs >
 

Public Member Functions

virtual AMatrix getA (const StateVec &state) const =0
 
virtual BMatrix getB (const StateVec &state) const =0
 
virtual void updateA (const StateVec &state, std::function< void(unsigned int, unsigned int, double)> &changeAval) const =0
 
virtual void updateB (const StateVec &state, std::function< void(unsigned int, unsigned int, double)> &changeBval) const =0
 

Static Public Attributes

static constexpr auto NUM_STATES = num_states
 
static constexpr auto NUM_CONT_INPUTS = num_cont_inputs
 
static constexpr auto NUM_BIN_INPUTS = num_bin_inputs
 
static constexpr auto NUM_INPUTS = num_bin_inputs + num_cont_inputs
 

Detailed Description

template<int num_states, int num_cont_inputs, int num_bin_inputs>
class mimpc::System< num_states, num_cont_inputs, num_bin_inputs >

In this library the system Dynamics are represented as \( \mathbf{\dot{x}} = \mathbf{A} \mathbf{x} + \mathbf{B} \mathbf{u} \), where

This class represents the system dynamics by offering functions that return the matrices \(A,B\) in order to allow a state dependend linearization. When the MPC needs to know the system state, it will call the functions getA() or getB() to retrieve the full state matrix based on the current state. In order to avoid computational overhead when the systems state has changed the functions updateA() or updateB() are used in order to retrieve only the matrix values that change due to linearization.

To define the dynamics of a system, this abstract class has to be by a class which returns the linearized system dynamics as specified. The (SCIPSolver) or (MPC) can than be instantiated with the system dynamics as a template argument.

Template Parameters
num_statesNumber of system states
num_cont_inputsNumber of continuous inputs
num_bin_inputsNumber of binary inputs

Member Function Documentation

◆ getA()

template<int num_states, int num_cont_inputs, int num_bin_inputs>
virtual AMatrix mimpc::System< num_states, num_cont_inputs, num_bin_inputs >::getA ( const StateVec &  state) const
pure virtual

Linearizes and returns the system dynamics as matrix A

Parameters
statestate to linearize the system around
Returns
system matrix A

Implemented in mimpc::systems::REACSA.

◆ getB()

template<int num_states, int num_cont_inputs, int num_bin_inputs>
virtual BMatrix mimpc::System< num_states, num_cont_inputs, num_bin_inputs >::getB ( const StateVec &  state) const
pure virtual

Linearizes and returns the system input dynamics as a matrix B

Parameters
statestate to linearize the system around
Returns
input matrix B

Implemented in mimpc::systems::REACSA.

◆ updateA()

template<int num_states, int num_cont_inputs, int num_bin_inputs>
virtual void mimpc::System< num_states, num_cont_inputs, num_bin_inputs >::updateA ( const StateVec &  state,
std::function< void(unsigned int, unsigned int, double)> &  changeAval 
) const
pure virtual

Updates the states of the linearized system matrix A based on a new state

Parameters
statestate to linearize the system around
changeAvalcallback function that will called for each matrix element which changes due to linearization around the new state. The callback function will be called with parameters (row index, column index, value). The values that are not updated are assumed to stay as returned by getA()

Implemented in mimpc::systems::REACSA.

◆ updateB()

template<int num_states, int num_cont_inputs, int num_bin_inputs>
virtual void mimpc::System< num_states, num_cont_inputs, num_bin_inputs >::updateB ( const StateVec &  state,
std::function< void(unsigned int, unsigned int, double)> &  changeBval 
) const
pure virtual

Updates the states of the linearized system matrix B based on a new state

Parameters
statestate to linearize the system around
changeAvalcallback function that will called for each matrix element which changes due to linearization around the new state. The callback function will be called with parameter (row index, column index, value). The values that are not updated are assumed to stay as returned by getB()

Implemented in mimpc::systems::REACSA.


The documentation for this class was generated from the following file: