Go to the documentation of this file.
33 #include <Eigen/Cholesky>
35 #include <Eigen/Dense>
46 assert(
A.rows() ==
B.rows());
47 assert(R.rows() ==
B.cols());
49 const int p =
A.rows();
52 Eigen::MatrixXd R_inv_B_t = R_cholesky.solve(
B.transpose());
53 Eigen::MatrixXd A_inv_trans =
A.inverse().transpose();
58 Eigen::MatrixXd H(2 * p, 2 * p);
59 H <<
A +
B * R_inv_B_t * A_inv_trans * Q, -
B * R_inv_B_t * A_inv_trans, -A_inv_trans * Q, A_inv_trans;
66 *G = G_cholesky.
solve(
B.transpose()) *
X *
A;
74 assert(H.rows() % 2 == 0);
79 Eigen::MatrixXd T = schur.matrixT();
80 Eigen::MatrixXd U = schur.matrixU();
86 const int p = H.rows() / 2;
88 if (!success || p != subspace_dim)
return false;
98 X = U1_svd.solve(U.block(p, 0, p, p).transpose());
106 assert(
A.rows() ==
B.rows());
107 assert(
A.rows() == G.cols());
108 assert(G.rows() ==
B.cols());
110 Eigen::VectorXcd
eig = (
A -
B * G).eigenvalues();
111 for (
int i = 0; i <
eig.size(); ++i)
bool have_equal_size(const Eigen::MatrixBase< DerivedA > &matrix1, const Eigen::MatrixBase< DerivedB > &matrix2)
Determine if two matrices exhibit equal sizes/dimensions.
static bool isClosedLoopStable(const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::MatrixXd > &B, const Eigen::Ref< const Eigen::MatrixXd > &G)
Determine if the closed-loop system is stable.
const Solve< LDLT, Rhs > solve(const MatrixBase< Rhs > &b) const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE AbsReturnType abs() const
Performs a real Schur decomposition of a square matrix.
bool is_square(const Eigen::MatrixBase< Derived > &matrix)
Determine if a given matrix is square.
MatrixType B(b, *n, *nrhs, *ldb)
static bool solve(const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::MatrixXd > &B, const Eigen::Ref< const Eigen::MatrixXd > &Q, const Eigen::Ref< const Eigen::MatrixXd > &R, Eigen::MatrixXd &X, Eigen::MatrixXd *G=nullptr)
Solve discrete-time algebraic Riccati equation.
Robust Cholesky decomposition of a matrix with pivoting.
SelfAdjointEigenSolver< PlainMatrixType > eig(mat, computeVectors?ComputeEigenvectors:EigenvaluesOnly)
Two-sided Jacobi SVD decomposition of a rectangular matrix.
A matrix or vector expression mapping an existing expression.
MatrixType A(a, *n, *n, *lda)
static bool solveRiccatiHamiltonianSchur(const Eigen::MatrixXd &H, Eigen::MatrixXd &X)
Solve Hamiltonian via Schur method.
static bool isInsideUnitCircle(const Eigen::Ref< const Eigen::MatrixXd > &block)
bool reorder_schur_blocks(Eigen::Ref< Eigen::MatrixXd > T, Eigen::Ref< Eigen::MatrixXd > Q, Predicate predicate, int *subspace_dim, bool standardize)
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:05:36