Go to the documentation of this file.
31 #include <Eigen/Dense>
32 #include <Eigen/Eigenvalues>
46 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);
57 Eigen::MatrixXcd T_adjoint = T.adjoint();
61 for (
int k =
n - 1; k >= 0; --k)
63 Eigen::VectorXcd rhs = F.col(k) + Y * T_adjoint.col(k);
65 const std::complex<double> offset = T_adjoint(k, k);
66 T.diagonal().array() += offset;
72 Y.col(k) = T_svd.solve(-rhs);
74 if (k > 0) T.diagonal().array() -= offset;
78 X = (U * Y * U.adjoint()).
real();
87 Eigen::VectorXcd eigvals_A =
A.eigenvalues();
89 for (
int i = 0; i < eigvals_A.size(); ++i)
91 for (
int j = i; j < eigvals_A.size(); ++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 hasUniqueSolution(const Eigen::Ref< const Eigen::MatrixXd > &A)
Determine if the Lyapunov equation exhibits a unique solution.
bool is_square(const Eigen::MatrixBase< Derived > &matrix)
Determine if a given matrix is square.
const EIGEN_DEVICE_FUNC ImagReturnType imag() const
Two-sided Jacobi SVD decomposition of a rectangular matrix.
A matrix or vector expression mapping an existing expression.
static bool solve(const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::MatrixXd > &Q, Eigen::MatrixXd &X)
Solve continuous-time Lyapunov equation.
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