# LMIs in Control/pages/H-infinity filtering

LMIs in Control/pages/H-infinity filtering
For systems that have disturbances, filtering can be used to reduce the effects of these disturbances. Described on this page is a method of attaining a filter that will reduce the effects of the disturbances as completely as possible. To do this, we look to find a set of new coefficient matrices that describe the filtered system. The process to achieve such a new system is described below. The H-infinity-filter tries to minimize the maximum magnitude of error.

## The System

For the application of this LMI, we will look at linear systems that can be represented in state space as
    ${\begin{aligned}{\dot {x}}&=Ax+Bw,x(0)=x_{0}\\y&=Cx+Dw\\z&=Lx\end{aligned}}$
where $x\in R^{n},y\in R^{l},z\in R^{m}$ represent the state vector, the measured output vector, and the output vector of interest, respectively, $w\in R^{p}$ is the disturbance vector, and $A,B,C,D$ and $L$ are the system matrices of appropriate dimension.
To further define: $x$ is $\in R^{n}$ and is the state vector, $A$ is $\in R^{n*n}$ and is the state matrix, $B$ is $\in R^{n*r}$ and is the input matrix, $w$ is $\in R^{r}$ and is the exogenous input, $C$ is $\in R^{m*n}$ and is the output matrix, $D$ and $L$ are $\in R^{m*r}$ and are feedthrough matrices, and $y$ and $z$ are $\in R^{m}$ and are the output and the output of interest, respectively.

## The Data

The data are $w$ (the disturbance vector), and $A,B,C,D$ and $L$ (the system matrices). Furthermore, the $A$ matrix is assumed to be stable

## The Optimization Problem

We need to design a filter that will eliminate the effects of the disturbances as best we can. For this, we take a filter of the following form:
       ${\begin{aligned}{\dot {\sigma }}&=A_{f}\sigma +B_{f}\sigma ,\sigma (0)=\sigma _{0}\\{\hat {z}}&=C_{f}\sigma +D_{f}y,\end{aligned}}$
where $\sigma \in R^{n}$ is the state vector, ${\hat {z}}\in R^{m}$ is the estimation vector of z, and $A_{f},B_{f},C_{f},andD_{f}$ are the coefficient matrices of appropriate dimensions.
Note that the combined complete system can be represented as
       ${\begin{aligned}{\dot {x}}_{e}&={\tilde {A}}x_{e}+{\tilde {B}}w,x_{e}(0)=x_{e0}\\{\tilde {z}}&={\tilde {C}}x_{e}+{\tilde {D}}w,\end{aligned}}$
where ${\tilde {z}}=z-{\hat {z}}\in R^{m}$ is the estimation error,
       ${\begin{aligned}x_{e}={\begin{bmatrix}x\\\sigma \end{bmatrix}}\\\end{aligned}}$
is the state vector of the system, and ${\tilde {A}},{\tilde {B}},{\tilde {C}},{\tilde {D}}$ are the coefficient matrices, defined as:
       ${\begin{aligned}{\tilde {A}}={\begin{bmatrix}A&0\\B_{f}C&A_{f}\end{bmatrix}},{\tilde {B}}={\begin{bmatrix}B\\B_{f}D\end{bmatrix}},\\{\tilde {C}}={\begin{bmatrix}L-D_{f}C&-C_{f}\end{bmatrix}},{\tilde {D}}=-D_{f}D\end{aligned}}$
In other words, for the system defined above we need to find $A_{f},B_{f},C_{f},andD_{f}$ such that
       ${\begin{aligned}|G_{{\tilde {z}}w}(s)|_{\inf }<\gamma ,\end{aligned}}$
where $\gamma$ is a positive constant, and
       ${\begin{aligned}G_{{\tilde {z}}w}(s)={\tilde {C}}(sI-{\tilde {A}})^{-1}{\tilde {B}}+{\tilde {D}}.\end{aligned}}$

## The LMI: H-inf Filtering

The solution can be obtained by finding matrices $R,X,M,N,Z,D_{f}$ that obey the following LMIs:
       ${\begin{aligned}X&>0\\R-X&>0\\{\begin{bmatrix}RA+A^{T}R+ZC+C^{T}Z^{T}&*&*&*\\M^{T}+ZC+XA&M^{T}+M&*&*\\B^{T}R+D^{T}Z^{T}&B^{T}X+D^{T}Z^{T}&-\gamma I&*\\L-D_{f}C&-N&-D_{f}D&-\gamma I\end{bmatrix}}&<0\\\end{aligned}}$

## Conclusion:

To find the corresponding filter, use the optimized matrices from the solution to find:
       $A_{f}=X^{-1}M,B_{f}=X^{-1}Z,C_{f}=N,D_{f}=D_{f}$
These matrices can then be used to produce ${\tilde {A}},{\tilde {B}},{\tilde {C}},{\tilde {D}}$ to construct the filter described above, that will best eliminate the disturbances of the system.

## Implementation

This implementation requires Yalmip and Sedumi.
https://github.com/rezajamesahmed/LMImatlabcode/blob/master/hinf_filtering.m

## Related LMIs

H-2_filtering

## External Links

This LMI comes from
* - "LMIs in Control Systems: Analysis, Design and Applications" by Guang-Ren Duan and Hai-Hua Yu
Other resources:
* LMI Methods in Optimal and Robust Control - A course on LMIs in Control by Matthew Peet.
* LMI Properties and Applications in Systems, Stability, and Control Theory - A List of LMIs by Ryan Caverly and James Forbes.
* LMIs in Systems and Control Theory - A downloadable book on LMIs by Stephen Boyd.

## References

Duan, G. (2013). LMIs in control systems: analysis, design and applications. Boca Raton: CRC Press, Taylor & Francis Group.