# LMIs in Control/pages/Discrete-Time H2-Optimal Observer

LMIs in Control/pages/Discrete-Time H2-Optimal Observer

In many applications, perhaps even most, the state of the system cannot be directly known. In this case, you will need to strategically to measure key system outputs that will make the system states indirectly observable. Observers need to converge much faster than the system dynamics in order for their estimations to be accurate. Optimal observer synthesis is therefore advantageous. In this LMI, we seek to optimize the H2 norm, which conceptually is minimizing the average magnitude of error in the observer.

## The System

{\displaystyle {\begin{aligned}x_{k+1}&=A_{d}x_{k}+B_{d1}w_{k},\\y_{k}&=C_{c2}x_{k}+D_{d21}w_{k}\\\end{aligned}}}

where ${\displaystyle x\in R^{n}}$  and is the state vector, ${\displaystyle A\in R^{n\times n}}$  and is the state matrix, ${\displaystyle B\in R^{n\times r}}$  and is the input matrix, ${\displaystyle w\in R^{r}}$  and is the exogenous input, ${\displaystyle C\in R^{m\times n}}$  and is the output matrix, ${\displaystyle D\in R^{m\times r}}$  and is the feedthrough matrix, ${\displaystyle y\in R^{m}}$  and is the output, and it is assumed that ${\displaystyle (A_{d},C_{d2})}$  is detectable.

## The Data

The matrices ${\displaystyle A_{d},B_{d1},C_{cd2},C_{cd1},D_{d21}}$ .

## The Optimization Problem

An observer of the form:

{\displaystyle {\begin{aligned}{\hat {x}}_{k+1}&=A_{d}{\hat {x}}_{k}+L_{d}(y_{k}-{\hat {y}}_{k}),\\{\hat {y}}_{k}&=C_{d2}{\hat {x}}_{k}\\\end{aligned}}}

is to be designed, where ${\displaystyle L_{d}\in R^{n_{x}\times n_{y}}}$  is the observer gain.

Defining the error state ${\displaystyle e_{k}=x_{k}-{\hat {x}}_{k}}$ , the error dynamics are found to be

${\displaystyle e_{k+1}=(A_{d}-L_{d}C_{d2}e_{k}+(B_{d1}-L_{d}D_{d21})w_{k}}$ ,

and the performance output is defined as

${\displaystyle z_{k}=C_{d1}e_{k}}$ .

The observer gain ${\displaystyle L_{d}}$  is to be designed such that the ${\displaystyle H_{2}}$  of the transfer matrix from ${\displaystyle w_{k}}$  to ${\displaystyle z_{k}}$ , given by

{\displaystyle L_{d}{\begin{aligned}T(z)&=C_{d1}(z1-(A_{d}-L_{d}C_{d2}))^{-1}(B_{d1}-L_{d}D_{d21}),\\\end{aligned}}}

is minimized.

## The LMI: Discrete-Time H2-Optimal Observer

The discrete-time ${\displaystyle H_{2}}$ -optimal observer gain is synthesized by solving for ${\displaystyle P\in S^{n_{x}}}$ , ${\displaystyle Z\in S^{n_{z}}}$ , ${\displaystyle G_{d}\in R^{n_{x}\times n_{y}}}$ , and ${\displaystyle v\in R_{>0}}$  that minimize ${\displaystyle J(v)=v}$  subject to ${\displaystyle P>0,Z>0}$ ,

{\displaystyle {\begin{aligned}{\begin{bmatrix}P&PA_{d}-G_{d}C_{d2}&PB_{d1}-G_{d}D_{d21}\\*&P&0\\*&*&1\end{bmatrix}}&>0,\\{\begin{bmatrix}Z&PC_{d1}\\*&P\end{bmatrix}}&>0,\\\operatorname {tr} Z

where ${\displaystyle \operatorname {tr} }$  refers to the trace of a matrix.

## Conclusion:

The ${\displaystyle H_{2}}$ -optimal observer gain is recovered by ${\displaystyle L_{d}=P^{-1}G_{d}}$  and the ${\displaystyle H_{2}}$  norm of ${\displaystyle T(z)}$  is ${\displaystyle \mu ={\sqrt {v}}}$ . The ${\displaystyle L_{d}}$  matrix is the observer gains that can be used to form the optimal observer:

{\displaystyle {\begin{aligned}{\hat {x}}_{k+1}&=A_{d}{\hat {x}}_{k}+L_{d}(y_{k}-{\hat {y}}_{k}),\\{\hat {y}}_{k}&=C_{d2}{\hat {x}}_{k}\\\end{aligned}}}

## Implementation

This implementation requires Yalmip and Sedumi.