pymor.algorithms.lyapunov
¶
Module Contents¶
- pymor.algorithms.lyapunov.mat_eqn_sparse_min_size(value=1000)[source]¶
Returns minimal size for which a sparse solver will be used by default.
- pymor.algorithms.lyapunov.solve_cont_lyap_dense(A, E, B, trans=False, options=None, default_solver_backend=_DEFAULT_LYAP_SOLVER_BACKEND['cont']['dense'])[source]¶
Compute the solution of a continuous-time Lyapunov equation.
Returns the solution \(X\) of a (generalized) continuous-time algebraic Lyapunov equation:
if trans is
False
and E isNone
:\[A X + X A^T + B B^T = 0,\]if trans is
False
and E is aNumPy array
:\[A X E^T + E X A^T + B B^T = 0,\]if trans is
True
and E isNone
:\[A^T X + X A + B^T B = 0,\]if trans is
True
and E is aNumPy array
:\[A^T X E + E^T X A + B^T B = 0.\]
We assume A and E are real
NumPy arrays
, E is invertible, and that no two eigenvalues of (A, E) sum to zero (i.e., there exists a unique solution X).If the solver is not specified using the options argument, a solver backend is chosen based on availability in the following order:
pymess
(seepymor.bindings.pymess.solve_lyap_dense
)slycot
(seepymor.bindings.slycot.solve_lyap_dense
)scipy
(seepymor.bindings.scipy.solve_lyap_dense
)
Parameters
- A
The matrix A as a 2D
NumPy array
.- E
The matrix E as a 2D
NumPy array
orNone
.- B
The matrix B as a 2D
NumPy array
.- trans
Whether the first operator in the Lyapunov equation is transposed.
- options
The solver options to use. See:
- default_solver_backend
Default solver backend to use (pymess, slycot, scipy).
Returns
- X
Lyapunov equation solution as a
NumPy array
.
- pymor.algorithms.lyapunov.solve_cont_lyap_lrcf(A, E, B, trans=False, options=None, default_sparse_solver_backend=_DEFAULT_LYAP_SOLVER_BACKEND['cont']['sparse'], default_dense_solver_backend=_DEFAULT_LYAP_SOLVER_BACKEND['cont']['dense'])[source]¶
Compute an approximate low-rank solution of a continuous-time Lyapunov equation.
Returns a low-rank Cholesky factor \(Z\) such that \(Z Z^T\) approximates the solution \(X\) of a (generalized) continuous-time algebraic Lyapunov equation:
if trans is
False
and E isNone
:\[A X + X A^T + B B^T = 0,\]if trans is
False
and E is anOperator
:\[A X E^T + E X A^T + B B^T = 0,\]if trans is
True
and E isNone
:\[A^T X + X A + B^T B = 0,\]if trans is
True
and E is anOperator
:\[A^T X E + E^T X A + B^T B = 0.\]
We assume A and E are real
Operators
, E is invertible, and all the eigenvalues of (A, E) all lie in the open left half-plane. Operator B needs to be given as aVectorArray
fromA.source
, and for large-scale problems, we assumelen(B)
is small.If the solver is not specified using the options argument, a solver backend is chosen based on availability in the following order:
for sparse problems (minimum size specified by
mat_eqn_sparse_min_size
)pymess
(seepymor.bindings.pymess.solve_lyap_lrcf
),lradi
(seepymor.algorithms.lradi.solve_lyap_lrcf
),
for dense problems (smaller than
mat_eqn_sparse_min_size
)pymess
(seepymor.bindings.pymess.solve_lyap_lrcf
),slycot
(seepymor.bindings.slycot.solve_lyap_lrcf
),scipy
(seepymor.bindings.scipy.solve_lyap_lrcf
).
Parameters
- A
The non-parametric
Operator
A.- E
The non-parametric
Operator
E orNone
.- B
The operator B as a
VectorArray
fromA.source
.- trans
Whether the first
Operator
in the Lyapunov equation is transposed.- options
The solver options to use. See:
- default_sparse_solver_backend
Default sparse solver backend to use (pymess, lradi).
- default_dense_solver_backend
Default dense solver backend to use (pymess, slycot, scipy).
Returns
- Z
Low-rank Cholesky factor of the Lyapunov equation solution,
VectorArray
fromA.source
.
- pymor.algorithms.lyapunov.solve_disc_lyap_dense(A, E, B, trans=False, options=None, default_solver_backend=_DEFAULT_LYAP_SOLVER_BACKEND['disc']['dense'])[source]¶
Compute the solution of a discrete-time Lyapunov equation.
Returns the solution \(X\) of a (generalized) continuous-time algebraic Lyapunov equation:
if trans is
False
and E isNone
:\[A X A^T - X + B B^T = 0,\]if trans is
False
and E is aNumPy array
:\[A X A^T - E X E^T + B B^T = 0,\]if trans is
True
and E isNone
:\[A^T X A - X + B^T B = 0,\]if trans is
True
and E is anNumPy array
:\[A^T X A - E^T X E + B^T B = 0.\]
We assume A and E are real
NumPy arrays
, E is invertible, and that all pairwise products of two eigenvalues of (A, E) are not equal to one (i.e., there exists a unique solution X).If the solver is not specified using the options argument, a solver backend is chosen based on availability in the following order:
slycot
(seepymor.bindings.slycot.solve_lyap_dense
)scipy
(seepymor.bindings.scipy.solve_lyap_dense
)
Parameters
- A
The matrix A as a 2D
NumPy array
.- E
The matrix E as a 2D
NumPy array
orNone
.- B
The matrix B as a 2D
NumPy array
.- trans
Whether the first operator in the Lyapunov equation is transposed.
- options
The solver options to use. See:
- default_solver_backend
Default solver backend to use (slycot, scipy).
Returns
- X
Lyapunov equation solution as a
NumPy array
.
- pymor.algorithms.lyapunov.solve_disc_lyap_lrcf(A, E, B, trans=False, options=None, default_dense_solver_backend=_DEFAULT_LYAP_SOLVER_BACKEND['disc']['dense'])[source]¶
Compute an approximate low-rank solution of a discrete-time Lyapunov equation.
Returns a low-rank Cholesky factor \(Z\) such that \(Z Z^T\) approximates the solution \(X\) of a (generalized) discrete-time algebraic Lyapunov equation:
if trans is
False
and E isNone
:\[A X A^T - X + B B^T = 0,\]if trans is
False
and E is anOperator
:\[A X A^T - E X E^T + B B^T = 0,\]if trans is
True
and E isNone
:\[A^T X A - X + B^T B = 0,\]if trans is
True
and E is anOperator
:\[A^T X A - E^T X E + B^T B = 0.\]
We assume A and E are real
Operators
, E is invertible, and all the eigenvalues of (A, E) all lie inside the unit circle. Operator B needs to be given as aVectorArray
fromA.source
, and for large-scale problems, we assumelen(B)
is small.If the solver is not specified using the options argument, a solver backend is chosen based on availability in the following order:
slycot
(seepymor.bindings.slycot.solve_lyap_lrcf
),scipy
(seepymor.bindings.scipy.solve_lyap_lrcf
).
Parameters
- A
The non-parametric
Operator
A.- E
The non-parametric
Operator
E orNone
.- B
The operator B as a
VectorArray
fromA.source
.- trans
Whether the first
Operator
in the Lyapunov equation is transposed.- options
The solver options to use. See:
- default_dense_solver_backend
Default dense solver backend to use (slycot, scipy).
Returns
- Z
Low-rank Cholesky factor of the Lyapunov equation solution,
VectorArray
fromA.source
.