37 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR =
double>
41 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
61 : Base(nonlinearSystem->
getType()),
65 std::placeholders::_1,
66 std::placeholders::_2,
67 std::placeholders::_3,
68 std::placeholders::_4),
69 doubleSidedDerivative)
71 if (nonlinearSystem ==
nullptr)
72 throw std::runtime_error(
"SystemLinearizer: Nonlinear system is nullptr!");
84 std::placeholders::_1,
85 std::placeholders::_2,
86 std::placeholders::_3,
87 std::placeholders::_4),
117 const control_vector_t& u,
139 const control_vector_t& u,
164 const control_vector_t& u,
165 const state_vector_t& x_next,
169 state_control_matrix_t& B)
override Base::state_vector_t state_vector_t
state vector type
Definition: DiscreteSystemLinearizer.h:47
virtual void getAandB(const state_vector_t &x, const control_vector_t &u, const state_vector_t &x_next, const int n, size_t numSteps, state_matrix_t &A, state_control_matrix_t &B) override
retrieve discrete-time linear system matrices A and B.
Definition: DiscreteSystemLinearizer.h:163
DiscreteSystemLinearizer< STATE_DIM, CONTROL_DIM, SCALAR > * clone() const override
deep cloning
Definition: DiscreteSystemLinearizer.h:97
DiscreteSystemLinearizer(std::shared_ptr< system_t > nonlinearSystem, bool doubleSidedDerivative=true)
control Jacobian type (B)
Definition: DiscreteSystemLinearizer.h:60
std::shared_ptr< system_t > nonlinearSystem_
instance of non-linear system
Definition: DiscreteSystemLinearizer.h:179
interface class for a general discrete linear system or linearized discrete system ...
Definition: DiscreteLinearSystem.h:23
virtual void propagateControlledDynamics(const state_vector_t &state, const time_t n, const control_vector_t &control, state_vector_t &stateNext) override
compute the system dynamics
Definition: DiscreteLinearSystem.h:63
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > Base
Definition: DiscreteSystemLinearizer.h:43
virtual const state_control_matrix_t & getDerivativeControl(const state_vector_t &x, const control_vector_t &u, const int n=0)
get the Jacobian with respect to the input
Definition: DiscreteSystemLinearizer.h:138
DynamicsLinearizerNumDiff< STATE_DIM, CONTROL_DIM, SCALAR, int > linearizer_
instance of numerical-linearizer
Definition: DiscreteSystemLinearizer.h:181
Definition: ControlVector.h:12
A general, non-linear discrete dynamic system with a control input.
Definition: DiscreteControlledSystem.h:40
virtual ~DiscreteSystemLinearizer()
destructor
Definition: DiscreteSystemLinearizer.h:95
Base::state_control_matrix_t state_control_matrix_t
Definition: DiscreteSystemLinearizer.h:51
const state_control_matrix_t & getDerivativeControl(const state_vector_t &x, const control_vector_t &u, const TIME t=TIME(0))
get the Jacobian with respect to the input
Definition: DynamicsLinearizerNumDiff.h:137
constexpr size_t n
Definition: MatrixInversionTest.cpp:14
Base::state_matrix_t state_matrix_t
state Jacobian type (A)
Definition: DiscreteSystemLinearizer.h:50
virtual const state_matrix_t & getDerivativeState(const state_vector_t &x, const control_vector_t &u, const int n=0)
get the Jacobian with respect to the state
Definition: DiscreteSystemLinearizer.h:116
Definition: StateVector.h:12
const state_matrix_t & getDerivativeState(const state_vector_t &x, const control_vector_t &u, const TIME t=TIME(0))
get the Jacobian with respect to the state
Definition: DynamicsLinearizerNumDiff.h:82
Base::control_vector_t control_vector_t
control vector type
Definition: DiscreteSystemLinearizer.h:48
DiscreteSystemLinearizer(const DiscreteSystemLinearizer &arg)
copy constructor
Definition: DiscreteSystemLinearizer.h:79
state_matrix_t dFdx_
Jacobian wrt state.
Definition: DiscreteSystemLinearizer.h:183
SYSTEM_TYPE getType() const
get the type of system
Definition: DiscreteSystem.h:40
DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > system_t
type of system to be linearized
Definition: DiscreteSystemLinearizer.h:45
Computes the linearization of a general non-linear DiscreteControlledSystem using numerical different...
Definition: DiscreteSystemLinearizer.h:38
state_control_matrix_t dFdu_
Jacobian wrt input.
Definition: DiscreteSystemLinearizer.h:184