# DiscreteRiccatiSolve

DiscreteRiccatiSolve[{a,b},{q,r}]

gives the matrix that is the stabilizing solution of the discrete algebraic Riccati equation .

DiscreteRiccatiSolve[{a,b},{q,r,p}]

solves .

# Details and Options • In , denotes the conjugate transpose.
• The equation has a unique, symmetric, positive semidefinite solution only if is stabilizable, is detectable, , and . Consequently, all the eigenvalues of the matrix lie inside the unit circle, and the solution is stabilizing.
• The solution is positive definite when is controllable and is observable.
• DiscreteRiccatiSolve supports a Method option. The following settings can be specified:
•  Automatic automatically determined method "Eigensystem" based on eigen decomposition "GeneralizedEigensystem" based on generalized eigen decomposition "GeneralizedSchur" based on generalized Schur decomposition "InverseFree" a variant of "GeneralizedSchur" "MatrixSign" iterative method using the matrix sign function "Newton" iterative Newton method "Schur" based on Schur decomposition
• All methods apply to approximate numeric matrices. "Eigensystem" applies to exact matrices.

# Examples

open allclose all

## Basic Examples(1)

Solve a discrete algebraic Riccati equation:

Verify the solution:

## Scope(3)

Solve a discrete Riccati equation:

Solve a discrete Riccati equation with a cross-coupling matrix:

Solve the Riccati equation for a sampled-data transfer-function model:

## Options(7)

### Method(7)

Automatic and "Eigensystem" methods can be used for exact systems:

As well as for inexact systems:

"Schur" method can be used for inexact systems:

"Newton" applies to inexact systems and may be more accurate than Automatic:

Compute the solution and absolute error:

Compare with the default method:

"Newton" takes suboptions "StartingMatrix", "MaxIterations", and "Tolerance":

The "Newton" method may not compute a stabilizing solution even if such a solution exists: Compare with the Automatic method:

"MatrixSign" is typically used as an initial approximation for the "Newton" method:

Use xinit to initialize the "Newton" method:

Compare errors:

"MatrixSign" takes suboptions "MaxIterations" and "Tolerance":

"GeneralizedSchur" or "GeneralizedEigensystem" applies when a is singular:

The matrix a is singular:

These two methods work for a singular a:

Verify error:

"Eigensystem" cannot be used when a is singular: "InverseFree" can be used when r is ill-conditioned:

The matrix r has a high condition number:

Use the method:

Compare to the default method:

The absolute error is higher for the default method in this case:

## Applications(2)

The linearized model of a turbo-generator has state and input matrices:

The discrete LQ regulation cost Jopt for given weighting matrices {q,r} and initial state s0:

Compute an optimal state-feedback gain that guarantees that all the closed-loop poles are inside a circle of radius :

The closed-loop poles without any prescribed degree of stability:

## Properties & Relations(11)

DiscreteRiccatiSolve[{a,b},{q,r,p}] is equivalent to DiscreteRiccatiSolve[{a-b. .p,b},{q-p.r -1.p,r}]:

An equivalent result can be found by incorporating p into the a and q matrices:

If {a,b} is stabilizable and {a,g} is detectable, and q=Transpose[g].g, then the solution to the discrete Riccati equation is positive semidefinite:

If {a,b} is controllable and {a,g} is observable, and q=Transpose[g].g, then the solution to the discrete Riccati equation is positive definite:

The matrix associated with the discrete algebraic Riccati equation is symplectic:

The eigenvalues of the symplectic matrix are pairs of the form : and are similar matrices:

The symplectic matrix must satisfy the stability and complementarity properties to obtain a stabilizing solution to the Riccati equation:

Stability property:

Complementarity property:

The stabilizing solution:

The eigenvalues of the feedback system with are the stable eigenvalues of the symplectic matrix:

Compute optimal state-feedback gains using DiscreteRiccatiSolve:

Use LQRegulatorGains to obtain the same result directly:

Compute optimal output feedback gains using DiscreteRiccatiSolve:

LQOutputRegulatorGains gives the same result:

Compute optimal estimator gains using DiscreteRiccatiSolve:

Use LQEstimatorGains:

The optimal trajectory of the discrete approximation of a system results in a higher cost:

The optimal LQ regulation costs for the systems starting at s0:

## Possible Issues(1)

If {a,b} is not stabilizable and {a,g} is not detectable, then the Riccati equation with q=g.g has no stabilizing solution: 