scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef
solve_sylvester(a, b, q)

Notes

Computes a solution to the Sylvester matrix equation via the Bartels- Stewart algorithm. The A and B matrices first undergo Schur decompositions. The resulting matrices are used to construct an alternative Sylvester equation ( RY + YS^T = F ) where the R and S matrices are in quasi-triangular form (or, when R, S or F are complex, triangular form). The simplified equation is then solved using *TRSYL from LAPACK directly.

versionadded

Parameters

a : (M, M) array_like

Leading matrix of the Sylvester equation

b : (N, N) array_like

Trailing matrix of the Sylvester equation

q : (M, N) array_like

Right-hand side

Raises

LinAlgError

If solution was not found

Returns

x : (M, N) ndarray

The solution to the Sylvester equation.

Computes a solution (X) to the Sylvester equation $AX + XB = Q$ .

Examples

Given a, b, and q solve for x:

>>> from scipy import linalg
... a = np.array([[-3, -2, 0], [-1, -1, 3], [3, -5, -1]])
... b = np.array([[1]])
... q = np.array([[1],[2],[3]])
... x = linalg.solve_sylvester(a, b, q)
... x array([[ 0.0625], [-0.5625], [ 0.6875]])
>>> np.allclose(a.dot(x) + x.dot(b), q)
True
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.linalg._solvers.solve_sylvester scipy.linalg._solvers.solve_continuous_lyapunov

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/linalg/_solvers.py#30
type: <class 'function'>
Commit: