# Documentation

### This is machine translation

Translated by
Mouse over text to see original. Click the button below to return to the English verison of the page.

# lqry

Form linear-quadratic (LQ) state-feedback regulator with output weighting

## Syntax

`[K,S,e] = lqry(sys,Q,R,N) `

## Description

Given the plant

`$\begin{array}{l}\stackrel{˙}{x}=Ax+Bu\\ y=Cx+Du\end{array}$`

or its discrete-time counterpart, `lqry` designs a state-feedback control

`$u=-Kx$`

that minimizes the quadratic cost function with output weighting

`$J\left(u\right)={\int }_{0}^{\infty }\left({y}^{T}Qy+{u}^{T}Ru+2{y}^{T}Nu\right)dt$`

(or its discrete-time counterpart). The function `lqry` is equivalent to `lqr` or `dlqr` with weighting matrices:

`$\left[\begin{array}{cc}\overline{Q}& \overline{N}\\ {\overline{N}}^{T}& \overline{R}\end{array}\right]=\left[\begin{array}{cc}{C}^{T}& 0\\ {D}^{T}& I\end{array}\right]\left[\begin{array}{cc}Q& N\\ {N}^{T}& R\end{array}\right]\left[\begin{array}{cc}C& D\\ 0& I\end{array}\right]$`

`[K,S,e] = lqry(sys,Q,R,N) ` returns the optimal gain matrix `K`, the Riccati solution `S`, and the closed-loop eigenvalues ```e = eig(A-B*K)```. The state-space model `sys` specifies the continuous- or discrete-time plant data (A, B, C, D). The default value `N=0` is assumed when `N` is omitted.

## Examples

See LQG Design for the x-Axis for an example.

## Limitations

The data $A,B,\overline{Q},\overline{R},\overline{N}$ must satisfy the requirements for `lqr` or `dlqr`.