finds the numeric solution
of the discrete matrix equation
.
DiscreteLyapunovSolve[a,b,c]
solves
.
DiscreteLyapunovSolve[{a,d},c]
solves
.
DiscreteLyapunovSolve[{a,d},{b,e},c]
solves
.
DiscreteLyapunovSolve
finds the numeric solution
of the discrete matrix equation
.
DiscreteLyapunovSolve[a,b,c]
solves
.
DiscreteLyapunovSolve[{a,d},c]
solves
.
DiscreteLyapunovSolve[{a,d},{b,e},c]
solves
.
Details
- DiscreteLyapunovSolve solves the discrete-time Lyapunov and Stein equations.
- DiscreteLyapunovSolve works on both numerical and symbolic matrices.
Examples
open all close allBasic Examples (1)
Scope (7)
Solve a discrete Lyapunov equation:
{a, c} = {(| | |
| ---- | ---- |
| -0.5 | 1 |
| -0.1 | -0.4 |), (| | |
| - | -- |
| 1 | 0 |
| 1 | -1 |)};DiscreteLyapunovSolve[a, c]a.%.a - % - c//ChopSolve an equation with symbolic matrices:
DiscreteLyapunovSolve[(| | |
| ----- | -- |
| 1 / 2 | 1 |
| -1 | -1 |), (| | |
| -- | -- |
| c1 | 0 |
| 0 | c2 |)]Solve
for coefficient matrices having different dimensions:
DiscreteLyapunovSolve[a = (| | | | |
| ---- | ----- | ---- | ----- |
| 4.05 | 0.831 | 5.71 | 3.44 |
| 0.75 | 3.85 | 1 | 4.42 |
| 3.17 | 1.91 | 5.24 | 4.87 |
| 5.87 | 4.5 | 4 | 2.281 |), b = (| | | |
| ---- | ---- | ---- |
| 3.94 | 3.45 | 2.5 |
| 3.45 | 3.27 | 2.66 |
| 2.98 | 2.9 | 3 |), c = (| | | |
| ----- | ----- | ----- |
| 0.34 | 0.62 | 1.5 |
| 0.94 | 0.91 | 0.19 |
| 0.878 | 0.355 | 1.646 |
| 1.72 | 0.51 | 0.32 |)]//MatrixFormDiscreteLyapunovSolve[
{a = (| | | | |
| ------ | ------ | ------ | ----- |
| 0.048 | -1.22 | -0.75 | 1.961 |
| 1.423 | -0.59 | -1.622 | 0.447 |
| -0.985 | 0.3816 | 1.431 | 1.5 |
| 1.028 | 1.59 | -1.78 | 1.49 |), d = (| | | | |
| ---- | ----- | ----- | ---- |
| 2.3 | 3.759 | 2.805 | 3.47 |
| 2.62 | 3.26 | 2.3 | 3.17 |
| 3.83 | 3.75 | 3.47 | 2.55 |
| 2.16 | 2.8 | 3.942 | 3.5 |)}, c = (| | | | |
| ------ | ----- | ------ | ----- |
| 1.0285 | 0.078 | 0.717 | 0.57 |
| 1.252 | 1.389 | 1.0483 | 1.292 |
| 0.298 | 0.18 | 0.485 | 0.996 |
| 0.186 | 0.325 | 1.6628 | 1.304 |)]//MatrixFormDiscreteLyapunovSolve[
{a = (| | | |
| ------ | ------- | ----- |
| 0.807 | -1.28 | -1.8 |
| -0.782 | 0.815 | 1.612 |
| -1.35 | -0.9395 | 0.63 |), d = (| | | |
| ----- | ----- | ----- |
| 0.053 | 0.962 | 1.037 |
| 1.85 | 0.41 | 1.466 |
| 1.35 | 0.432 | 1 |)}, {b = (| | | |
| ----- | ------ | ------ |
| 2.541 | 2.944 | 3.6745 |
| 2.689 | 3.9485 | 3.596 |
| 3.464 | 3.957 | 3.15 |), e = (| | | |
| ------ | ----- | ----- |
| -0.868 | 0.387 | 0.001 |
| 0.591 | 0.548 | 0.728 |
| -0.956 | -0.26 | 0.278 |)}, c = (| | | |
| ----- | ----- | ---- |
| 7.25 | 7.915 | 6.47 |
| 5.527 | 5.28 | 5.12 |
| 6.64 | 5 | 5 |)]//MatrixFormSolve the discrete Lyapunov equation
with symbolic coefficients:
DiscreteLyapunovSolve[{(a), (d)}, (c)]Obtain the symbolic solution of
:
DiscreteLyapunovSolve[{(a), (d)}, {(b), (e)}, (c)]Applications (4)
Test the stability of
by checking if the solution of
is positive definite for a negative definite
:
a = (| | |
| ------ | ------ |
| -3.779 | -3.057 |
| 4.8019 | 3.981 |);DiscreteLyapunovSolve[a, -(| | |
| - | - |
| 1 | 0 |
| 0 | 2 |)]//PositiveDefiniteMatrixQAs expected, the eigenvalues are inside the unit circle:
Eigenvalues[a]a = (| | |
| ------ | ------ |
| -1.676 | -0.168 |
| 0.493 | -0.602 |);DiscreteLyapunovSolve[a, -(| | |
| - | - |
| 1 | 0 |
| 0 | 2 |)]//PositiveDefiniteMatrixQEigenvalues[a]Compute the controllability Gramian of a stable discrete-time system:
{a, b} = {(| | | |
| ------- | ------- | ------- |
| -0.5303 | -0.1961 | -0.0423 |
| 0.1577 | -0.1203 | 0.0643 |
| 0.252 | 0.3137 | -0.3098 |), (| |
| ------- |
| 0.2466 |
| -0.01 |
| -0.0989 |)};DiscreteLyapunovSolve[a, -b.b]ControllabilityGramian[StateSpaceModel[{a, b}, SamplingPeriod -> τ]] == %Compute the observability Gramian of a stable discrete-time system:
{a, c} = {(| | | |
| ------- | ------- | ------ |
| 0.3638 | -0.0334 | -0.188 |
| 0.1655 | 0.7583 | 2.0776 |
| -0.1442 | -0.2858 | -1.023 |), (1.2956 1.3797 1.948)};DiscreteLyapunovSolve[a, -c.c]ObservabilityGramian[StateSpaceModel[{a, {{Subscript[b, 1]}, {Subscript[b, 2]}, {Subscript[b, 3]}}, c}, SamplingPeriod -> τ]] == %Properties & Relations (5)
The equation
, with a negative definite
, yields a unique positive definite solution if and only if the eigenvalues of
are within the unit circle:
Subscript[a, stable] = (| | |
| ---- | ----- |
| -0.5 | 0 |
| 0.5 | -0.25 |);DiscreteLyapunovSolve[Subscript[a, stable], c = (| | |
| -- | -- |
| -1 | 0 |
| 0 | -1 |)]//PositiveDefiniteMatrixQEigenvalues[Subscript[a, stable]]Subscript[a, unstable] = (| | |
| --- | ---- |
| 0.5 | 0.1 |
| 0 | -1.5 |);DiscreteLyapunovSolve[Subscript[a, unstale], c = (| | |
| -- | -- |
| -1 | 0 |
| 0 | -1 |)]//PositiveDefiniteMatrixQEigenvalues[Subscript[a, unstable]]The indefinite sum
is the solution to
if
is asymptotically stable:
{a, c} = {(| | |
| ------ | ----- |
| -(1/2) | 0 |
| 0 | (1/2) |), (| | |
| - | - |
| 1 | 0 |
| 0 | 1 |)};-(Underoverscript[∑, n = 0, ∞]MatrixPower[a, n].c.MatrixPower[a, n])DiscreteLyapunovSolve[a, c] == %Compute the infinite-horizon quadratic cost for the asymptotically stable system
:
{a, q} = {(| | | | |
| --- | --- | --- | --- |
| 0.5 | 0 | 0 | 0 |
| 0 | 0.4 | 0 | 0 |
| 0 | 0 | 0.3 | 0 |
| 0 | 0 | 0 | 0.1 |), (| | | | |
| --- | --- | - | - |
| 0.5 | 0 | 0 | 0 |
| 0 | 0.8 | 0 | 0 |
| 0 | 0 | 2 | 0 |
| 0 | 0 | 0 | 4 |)};s = DiscreteLyapunovSolve[a, -q];Subscript[x, 0] = (| |
| -- |
| 1 |
| 0 |
| -1 |
| 0 |);((1/2) Subscript[x, 0].s.Subscript[x, 0])[[1, 1]]Compute the same using direct summation:
With[{v = MatrixPower[a, n].Subscript[x, 0]}, Limit[(1/2)Underoverscript[∑, n = 0, N]v.q.v, N -> ∞]][[1, 1]]{a, b, c, d, e} = {(| | |
| -- | - |
| -1 | 2 |
| 1 | 1 |), (| | |
| - | - |
| 1 | 0 |
| 0 | 1 |), (| | |
| -- | - |
| 1 | 3 |
| -2 | 1 |), (| | |
| - | - |
| 0 | 0 |
| 0 | 0 |), (| | |
| - | - |
| 0 | 0 |
| 0 | 0 |)};DiscreteLyapunovSolve[{a, d}, {b, e}, c]LinearSolve gives the same solution:
LinearSolve[a, c]Solve the equation
using LinearSolve:
{a, b, c, d, e} = {(| | |
| ------ | ------ |
| 1.6015 | 3.2231 |
| 1.1416 | 2.655 |), (| | |
| ------ | ------ |
| 2.0354 | 2.4405 |
| 1.4194 | 3.5231 |), (| | |
| ------ | ------ |
| 1.7552 | 1.3824 |
| 1.1756 | 3.994 |), (| | |
| ------ | ------ |
| 2.2495 | 2.8306 |
| 1.6824 | 1.3905 |), (| | |
| ------ | ------ |
| 2.0441 | 2.3971 |
| 2.465 | 2.0718 |)};Partition[LinearSolve[KroneckerProduct[a, b] + KroneckerProduct[-d, e], Flatten[c]], 2]DiscreteLyapunovSolve gives the same solution:
DiscreteLyapunovSolve[{a, d}, {b, e}, c]See Also
Related Guides
History
Text
Wolfram Research (2010), DiscreteLyapunovSolve, Wolfram Language function, https://reference.wolfram.com/language/ref/DiscreteLyapunovSolve.html.
CMS
Wolfram Language. 2010. "DiscreteLyapunovSolve." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DiscreteLyapunovSolve.html.
APA
Wolfram Language. (2010). DiscreteLyapunovSolve. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DiscreteLyapunovSolve.html
BibTeX
@misc{reference.wolfram_2026_discretelyapunovsolve, author="Wolfram Research", title="{DiscreteLyapunovSolve}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/DiscreteLyapunovSolve.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_discretelyapunovsolve, organization={Wolfram Research}, title={DiscreteLyapunovSolve}, year={2010}, url={https://reference.wolfram.com/language/ref/DiscreteLyapunovSolve.html}, note=[Accessed: 13-June-2026]}