# LyapunovSolve

LyapunovSolve[a,c]

finds a solution of the matrix Lyapunov equation .

LyapunovSolve[a,b,c]

solves .

LyapunovSolve[{a,d},c]

solves .

LyapunovSolve[{a,d},{b,e},c]

solves .

# Details • LyapunovSolve solves the continuous-time Lyapunov and Sylvester equations.
• LyapunovSolve works on both numerical and symbolic matrices.

# Examples

open allclose all

## Basic Examples(1)

Solve the Lyapunov equation :

## Scope(7)

Solve a Lyapunov equation:

Verify the solution:

Solve :

Solve for coefficient matrices with different dimensions:

Solve :

Solve :

Solve the Lyapunov equation with symbolic coefficients:

Obtain the symbolic solution of :

## Applications(7)

Test the stability of by checking if the solution of is positive definite for a negative definite :

As expected, the eigenvalues are in the left half-plane:

An unstable system:

Compute the controllability Gramian of a stable continuous-time system:

Compute the observability Gramian of a stable continuous-time system:

Compute the norm of an asymptotically stable continuous-time system:

Compute the feedback gains that place poles at desired locations:

Verify the solution:

For MIMO systems, the feedback gains are not unique:

Construct an observer for a StateSpaceModel:

First, choose an appropriate and such that the Lyapunov equation yields a nonsingular solution:

Then construct the observer as , , where is the observer state vector, is the output, is the input, and is the estimated state vector:

Compute the estimated state trajectories for a UnitStep input:

Compute the actual state trajectories for a UnitStep input:

Plot the actual and estimated states:

## Properties & Relations(5)

The equation , with a negative definite , yields a unique positive definite solution if and only if the eigenvalues of are in the closed left half-plane:

A stable system:

The definite integral is the solution to if is asymptotically stable:

Compute the infinite-horizon quadratic cost for the asymptotically stable system :

Compute using direct integration:

Solve the matrix equation :

LinearSolve gives the same solution:

Solve the Lyapunov equation using LinearSolve:

LyapunovSolve gives the same solution: