{ } Raw JSON

bundles / scipy latest / scipy / linalg / _solvers / solve_discrete_lyapunov

function

scipy.linalg._solvers:solve_discrete_lyapunov

source: /scipy/linalg/_solvers.py :250

Signature

def   solve_discrete_lyapunov ( a q method = None )

Summary

Solves the discrete Lyapunov equation .

Extended Summary

The documentation is written assuming array arguments are of specified "core" shapes. However, array argument(s) of this function may have additional "batch" dimensions prepended to the core shape. In this case, the array is treated as a batch of lower-dimensional slices; see linalg_batch for details. Note that calls with zero-size batches are unsupported and will raise a ValueError.

Parameters

a, q : (M, M) array_like

Square matrices corresponding to A and Q in the equation above respectively. Must have the same shape.

method : {'direct', 'bilinear'}, optional

Type of solver.

If not given, chosen to be direct if M is less than 10 and bilinear otherwise.

Returns

x : ndarray

Solution to the discrete Lyapunov equation

Notes

This section describes the available solvers that can be selected by the 'method' parameter. The default method is direct if M is less than 10 and bilinear otherwise.

Method direct uses a direct analytical solution to the discrete Lyapunov equation. The algorithm is given in, for example, [1]. However, it requires the linear solution of a system with dimension so that performance degrades rapidly for even moderately sized matrices.

Method bilinear uses a bilinear transformation to convert the discrete Lyapunov equation to a continuous Lyapunov equation where and . The continuous equation can be efficiently solved since it is a special case of a Sylvester equation. The transformation algorithm is from Popov (1964) as described in [2].

Examples

Given `a` and `q` solve for `x`:
import numpy as np
from scipy import linalg
a = np.array([[0.2, 0.5],[0.7, -0.9]])
q = np.eye(2)
x = linalg.solve_discrete_lyapunov(a, q)
x
np.allclose(a.dot(x).dot(a.T)-x, -q)

See also

solve_continuous_lyapunov

computes the solution to the continuous-time Lyapunov equation

Aliases

  • scipy.linalg.solve_discrete_lyapunov