# RiccatiSolve

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

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

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

solves the equation .

# Details and Options

• In , denotes the conjugate transpose.
• The equation has a unique, symmetric, positive semidefinite solution if is stabilizable, is detectable, , and . Consequently, all eigenvalues of the matrix are negative and the solution is stabilizing.
• The solution is positive definite when is controllable and is observable.
• RiccatiSolve supports a Method option, with the following possible settings:
•  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" also applies to exact matrices.

# Examples

open allclose all

## Basic Examples(1)

Solve a continuous algebraic Riccati equation:

Verify the solution:

## Scope(3)

Solve a continuous Riccati equation:

Solve a Riccati equation with state-control coupling:

Solve the Riccati equation by extracting appropriate matrices from a state-space model object:

## 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 to the default method:

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

The "Newton" method may not converge even if a stabilizing 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" and "GeneralizedEigensystem" applies when a is singular:

The matrix a is singular:

These two methods work for a singular a:

Verify error:

"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(3)

Compute the cost associated with an optimal trajectory for a linearized inverted pendulum:

The optimal cost is .x.sinit:

Obtain the cost by numerical integration:

Track the "cost to go" at each instant along the optimal trajectory:

Compute an optimal state-feedback gain that places all closed-loop poles to the left of :

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

Compute the minimum error covariance for a Kalman estimator:

## Properties & Relations(8)

Find the optimal gains with cross-coupling matrix p:

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

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

The eigenvalues of the Hamiltonian matrix are pairs of the form {λ,-λ}:

and are similar matrices:

The ability to obtain a stabilizing solution depends on the Hamiltonian matrix:

The Hamiltonian matrix must satisfy the stability property:

As well as the complementarity property:

The stabilizing solution:

Find the eigenvalues of the feedback system with :

These are also the stable eigenvalues of the Hamiltonian matrix:

Compute optimal state feedback gains using RiccatiSolve:

Use LQRegulatorGains to compute the same result directly:

Compute optimal output feedback gains using RiccatiSolve:

LQOutputRegulatorGains gives the same result:

Compute optimal estimator gains using RiccatiSolve:

Use LQEstimatorGains to compute this result directly:

## Possible Issues(1)

If is not stabilizable or is not detectable, then the Riccati equation with has no stabilizing solution:

Wolfram Research (2010), RiccatiSolve, Wolfram Language function, https://reference.wolfram.com/language/ref/RiccatiSolve.html (updated 2014).

#### Text

Wolfram Research (2010), RiccatiSolve, Wolfram Language function, https://reference.wolfram.com/language/ref/RiccatiSolve.html (updated 2014).

#### CMS

Wolfram Language. 2010. "RiccatiSolve." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/RiccatiSolve.html.

#### APA

Wolfram Language. (2010). RiccatiSolve. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RiccatiSolve.html

#### BibTeX

@misc{reference.wolfram_2024_riccatisolve, author="Wolfram Research", title="{RiccatiSolve}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/RiccatiSolve.html}", note=[Accessed: 13-July-2024 ]}

#### BibLaTeX

@online{reference.wolfram_2024_riccatisolve, organization={Wolfram Research}, title={RiccatiSolve}, year={2014}, url={https://reference.wolfram.com/language/ref/RiccatiSolve.html}, note=[Accessed: 13-July-2024 ]}