Go to the documentation of this file.
31 #include <Eigen/Dense>
32 #include <Eigen/Eigenvalues>
46 const Eigen::MatrixXcd& T = A_schur.matrixT();
47 const Eigen::MatrixXcd& U = A_schur.matrixU();
50 Eigen::MatrixXcd F = U.adjoint() * Q * U;
52 const int n =
A.rows();
53 Eigen::MatrixXcd Y(
n,
n);
58 Eigen::MatrixXcd lhs(
n,
n);
61 Eigen::MatrixXcd T_adjoint = T.adjoint();
65 for (
int k =
n - 1; k >= 0; --k)
67 Eigen::VectorXcd rhs = F.col(k) + T * Y * T_adjoint.col(k);
70 const std::complex<double> factor = T_adjoint(k, k);
77 Y.col(k) = lhs_svd.solve(rhs);
79 if (k > 0) lhs.setIdentity();
83 X = (U * Y * U.adjoint()).
real();
92 Eigen::VectorXcd eigvals_A =
A.eigenvalues();
94 for (
int i = 0; i < eigvals_A.size(); ++i)
96 for (
int j = i; j < eigvals_A.size(); ++j)
98 std::complex<double> product = eigvals_A[i] * eigvals_A[j];
bool have_equal_size(const Eigen::MatrixBase< DerivedA > &matrix1, const Eigen::MatrixBase< DerivedB > &matrix2)
Determine if two matrices exhibit equal sizes/dimensions.
static bool solve(const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::MatrixXd > &Q, Eigen::MatrixXd &X)
Solve discrete-time Lyapunov equation.
bool is_square(const Eigen::MatrixBase< Derived > &matrix)
Determine if a given matrix is square.
Two-sided Jacobi SVD decomposition of a rectangular matrix.
A matrix or vector expression mapping an existing expression.
static bool hasUniqueSolution(const Eigen::Ref< const Eigen::MatrixXd > &A)
Determine if the Lyapunov equation exhibits a unique solution.
MatrixType A(a, *n, *n, *lda)
bool approx_equal(double a, double b, double epsilon=1e-6)
Check if two doubles are appoximately equal.
Performs a complex Schur decomposition of a real or complex square matrix.
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:05:53