control.lyap

control.lyap(A, Q, C=None, E=None, method=None)[source]

Solves the continuous-time Lyapunov equation.

X = lyap(A, Q) solves

A X + X A^T + Q = 0

where A and Q are square matrices of the same dimension. Q must be symmetric.

X = lyap(A, Q, C) solves the Sylvester equation

A X + X Q + C = 0

where A and Q are square matrices.

X = lyap(A, Q, None, E) solves the generalized continuous-time Lyapunov equation

A X E^T + E X A^T + Q = 0

where Q is a symmetric matrix and A, Q and E are square matrices of the same dimension.

Parameters
A, Q2D array_like

Input matrices for the Lyapunov or Sylvestor equation.

C2D array_like, optional

If present, solve the Sylvester equation.

E2D array_like, optional

If present, solve the generalized Lyapunov equation.

methodstr, optional

Set the method used for computing the result. Current methods are ‘slycot’ and ‘scipy’. If set to None (default), try ‘slycot’ first and then ‘scipy’.

Returns
X2D array

Solution to the Lyapunov or Sylvester equation.