This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / linalg / _solvers / solve_continuous_lyapunov

function

scipy.linalg._solvers:solve_continuous_lyapunov

source: build-install/usr/lib/python3.14/site-packages/scipy/linalg/_solvers.py:116

Signature

def solve_continuous_lyapunov(a, q)

Summary

Solves the continuous Lyapunov equation .

Extended Summary

Uses the Bartels-Stewart algorithm to find .

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. The NEP 5 signature of this function is (i,i),(i,i)->(i,i).

Parameters

a : array_like

A square matrix

q : array_like

Right-hand side square matrix

Returns

x : ndarray

Solution to the continuous Lyapunov equation

Notes

The continuous Lyapunov equation is a special form of the Sylvester equation, hence this solver relies on LAPACK routine ?TRSYL.

Examples

Given `a` and `q` solve for `x`:
import numpy as np
from scipy import linalg
a = np.array([[-3, -2, 0], [-1, -1, 0], [0, -5, -1]])
b = np.array([2, 4, -1])
q = np.eye(3)
x = linalg.solve_continuous_lyapunov(a, q)
✓
x
✗
array([[ -0.75 ,   0.875,  -3.75 ],
       [  0.875,  -1.375,   5.313],
       [ -3.75 ,   5.313, -27.063]])
np.allclose(a.dot(x) + x.dot(a.T), q)
✓
True

See also

solve_discrete_lyapunov

computes the solution to the discrete-time Lyapunov equation

solve_sylvester

computes the solution to the Sylvester equation

Aliases

  • scipy.linalg.solve_continuous_lyapunov

Referenced by