11 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
16 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
28 return computeSteadyStateRiccatiMatrix(Q, R, A, B, Q, K, verbose, eps, maxIter);
31 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
48 while (diff >= eps && numIter < maxIter)
51 dynamicRDE_.iterateRobust(Q, R, A, B, P, K);
52 diff = (P - P_prev).cwiseAbs().maxCoeff();
54 throw std::runtime_error(
"DARE : Failed to converge - K is unstable.");
59 throw std::runtime_error(
"DARE : Failed to converge - maximum number of iterations reached.");
63 std::cout <<
"DARE : converged after " << numIter <<
" iterations out of a maximum of " << maxIter << std::endl;
64 std::cout <<
"Resulting K: " << K << std::endl;
Eigen::Matrix< SCALAR, CONTROL_DIM, CONTROL_DIM > control_matrix_t
Definition: DARE.hpp:30
DARE()
Definition: DARE-impl.hpp:12
Eigen::Matrix< SCALAR, STATE_DIM, CONTROL_DIM > control_gain_matrix_t
Definition: DARE.hpp:32
CppAD::AD< CppAD::cg::CG< double > > SCALAR
Eigen::Matrix< SCALAR, CONTROL_DIM, STATE_DIM > control_feedback_t
Definition: DARE.hpp:33
Discrete-Time Algebraic Riccati Equation.
Definition: DARE.hpp:24
Eigen::Matrix< double, nStates, nStates > state_matrix_t
const bool verbose
Definition: ConstraintComparison.h:18
state_matrix_t computeSteadyStateRiccatiMatrix(const state_matrix_t &Q, const control_matrix_t &R, const state_matrix_t &A, const control_gain_matrix_t &B, control_feedback_t &K, bool verbose=false, const SCALAR eps=1e-6, size_t maxIter=1000)
Definition: DARE-impl.hpp:18