Matrix Equations

Todo

Finish this section and add Riccati, hinfsyn etc.

The Lyapunov equations and Algebraic Riccati equations play central role in model-based control design algorithms. Recently, LMI based methods, IQC synthesis in particular demands much more precise and more importantly better-conditioned solutions. Hence, there is a need to tweak the details of such solvers however the typical software uses closed-source code and the internals are not possible to modify/observe. Therefore, harold provides some subset of the common solvers, even when there is a version in scipy as a native code.

Lyapunov Equation

The Lyapunov equations are formulated as follows,:

.. math ::
\begin{align} X A + A^T X + Y &= 0 \tag{1} \\ A^T X A - X + Y &= 0 \tag{1’} \\ E^T X A + A^T X E + Y &= 0 \tag{2} \\ A^T X A - E^T X E + Y &= 0 \tag{2’} \end{align}
harold.lyapunov_eq_solver(A, Y, E=None, form='c')

This function solves the Lyapunov and the generalized Lyapunov equations of the forms

  1. X A + A^T X + Y = 0

(1’) A^T X A - X + Y = 0

and

  1. E^T X A + A^T X E + Y = 0

(2’) A^T X A - E^T X E + Y = 0

for the unknown matrix X given square matrices A, E, and symmetric Y with compatible sizes. The numbered (primed) equations are the so-called continuous (discrete) time forms. The form keyword selects between the two.

For (1), (1’), the A matrix is brought to real Schur form and for (2), (2’) QZ decomposition is used. Then all have a similar forward substitution step. The method is a a modified implementation of T. Penzl (1998) which is essentially a modification of Bartels - Stewart method.

If the argument E is not exactly a None-type then (2) is assumed.

Parameters:
  • , Y , E (A) – Data matrices for the equation. Y is a symmetric matrix.
  • form ('c' , 'continuous' , 'd' , 'discrete') – The string selector to define which form of Lyapunov equation is going to be used.
Returns:

X – Solution to the selected Lyapunov equation.

Return type:

nxn numpy array