# LMIs in Control/pages/H2-Optimal Filter

H2-Optimal Filter
The goal of optimal filtering is to design a filter that acts on the output ${\mathbf {z}}$of the generalized plant and optimizes the transfer matrix from ${\mathbf {w}}$to the filtered output.

## The System

Consider the continuous-time generalized LTI plant, with minimal state-space representation
${\mathbf {\dot {x}}}={\mathbf {Ax}}+{\mathbf {B}}_{1}{\mathbf {w}},$
${\mathbf {z}}={\mathbf {C}}_{1}{\mathbf {x}}+{\mathbf {D}}_{11}{\mathbf {w}},$
${\mathbf {y}}={\mathbf {C}}_{2}{\mathbf {x}}+{\mathbf {D}}_{21}{\mathbf {w}},$
where it is assumed that ${\mathbf {A}}$is Hurwitz. A continuous-time dynamic LTI filter with state-space representation
${\mathbf {\dot {x}}}_{f}={\mathbf {A}}_{f}{\mathbf {x}}_{f}+{\mathbf {B}}_{f}{\mathbf {y}},$
${\mathbf {\hat {z}}}={\mathbf {C}}_{f}{\mathbf {x}}_{f}+{\mathbf {D}}_{f}{\mathbf {y}},$
is designed to optimize the transfer function from ${\mathbf {w}}$to ${\mathbf {\tilde {z}}}={\mathbf {z}}-{\mathbf {\hat {z}}}$, which is given by
${\tilde {\mathbf {P}}}(s)={\tilde {\mathbf {C}}}_{1}(s{\mathbf {I}}-{\tilde {\mathbf {A}}})^{-1}{\tilde {\mathbf {B}}}_{1}+{\tilde {\mathbf {D}}}_{11},$
where
${\tilde {\mathbf {A}}}={\begin{bmatrix}{\mathbf {A}}&{\mathbf {0}}\\{\mathbf {B}}_{f}{\mathbf {C}}_{2}&{\mathbf {A}}_{f}\end{bmatrix}},$
${\tilde {\mathbf {B}}}_{1}={\begin{bmatrix}{\mathbf {B}}_{1}\\{\mathbf {B}}_{f}{\mathbf {D}}_{21}\end{bmatrix}},$
${\tilde {\mathbf {C}}}_{1}={\begin{bmatrix}{\mathbf {C}}_{1}-{\mathbf {D}}_{f}{\mathbf {C}}_{2}&-{\mathbf {C}}_{f}\end{bmatrix}},$
${\tilde {\mathbf {D}}}_{11}={\mathbf {D}}_{11}-{\mathbf {D}}_{f}{\mathbf {D}}_{21}.$
Optimal Filtering seeks to minimize the given norm of the transfer function ${\tilde {\mathbf {P}}}(s).$There are two methods of synthesizing the H2-optimal filter.

## Synthesis 1

Solve for ${\mathbf {A}}_{n}\in \mathbb {R} ^{n_{x}\times n_{x}},{\mathbf {B}}_{n}\in \mathbb {R} ^{n_{x}\times n_{y}},{\mathbf {C}}_{f}\in \mathbb {R} ^{n_{z}\times n_{x}},{\mathbf {D}}_{f}\in \mathbb {R} ^{n_{z}\times n_{y}},{\mathbf {X,Y}}\in \S ^{n_{x}},{\mathbf {Z}}\in \S ^{n_{z}},$and $\nu \in \mathbb {R} _{>0}$ that minimize the objective function $J(\nu )=\nu$, subject to
${\mathbf {X,Y,Z}}>0,$
${\mathbf {Y}}-{\mathbf {X}}>0,$
$tr({\mathbf {Z}})<\nu ,$
${\mathbf {D}}_{11}-{\mathbf {D}}_{f}{\mathbf {D}}_{21}={\mathbf {0}},$
${\begin{bmatrix}-{\mathbf {Z}}&{\mathbf {C}}_{1}-{\mathbf {D}}_{f}{\mathbf {C}}_{2}&-{\mathbf {C}}_{f}\\*&-{\mathbf {Y}}&-{\mathbf {X}}\\*&*&-{\mathbf {X}}\end{bmatrix}}<0,$
${\begin{bmatrix}{\mathbf {YA}}+{\mathbf {A}}^{T}{\mathbf {Y}}+{\mathbf {B}}_{n}{\mathbf {C}}_{2}+{\mathbf {C}}_{2}^{T}{\mathbf {B}}_{n}^{T}&{\mathbf {A}}_{n}+{\mathbf {C}}_{2}^{T}{\mathbf {B}}_{n}^{T}+{\mathbf {A}}^{T}{\mathbf {X}}&{\mathbf {YB}}_{1}+{\mathbf {B}}_{n}{\mathbf {D}}_{21}\\*&{\mathbf {A}}_{n}+{\mathbf {A}}_{n}^{T}&{\mathbf {XB}}_{1}+{\mathbf {B}}_{n}{\mathbf {D}}_{21}\\*&*&-{\mathbf {I}}\end{bmatrix}}<0.$

## Synthesis 2

Synthesis 2 is identical to Synthesis 1, with the exception of the final two matrix inequality constraints:
${\begin{bmatrix}-{\mathbf {Z}}&{\mathbf {B}}_{1}^{T}{\mathbf {Y}}^{T}+{\mathbf {D}}_{21}^{T}{\mathbf {B}}_{n}^{T}&{\mathbf {B}}_{1}^{T}{\mathbf {X}}^{T}+{\mathbf {D}}_{21}^{T}{\mathbf {B}}_{n}^{T}\\*&-{\mathbf {Y}}&-{\mathbf {X}}\\*&*&-{\mathbf {X}}\end{bmatrix}}<0,$
${\begin{bmatrix}{\mathbf {YA}}+{\mathbf {A}}^{T}{\mathbf {Y}}+{\mathbf {B}}_{n}{\mathbf {C}}_{2}+{\mathbf {C}}_{2}^{T}{\mathbf {B}}_{n}^{T}&{\mathbf {A}}_{n}+{\mathbf {C}}_{2}^{T}{\mathbf {B}}_{n}^{T}+{\mathbf {A}}^{T}{\mathbf {X}}&{\mathbf {C}}_{1}^{T}-{\mathbf {C}}_{2}^{T}{\mathbf {D}}_{f}^{T}\\*&{\mathbf {A}}_{n}+{\mathbf {A}}_{n}^{T}&-{\mathbf {C}}_{f}^{T}\\*&*&-{\mathbf {I}}\end{bmatrix}}<0.$

## Remark

In both cases, if ${\mathbf {D}}_{11}=0$and ${\mathbf {D}}_{21}\neq 0,$then it is often simplest to choose ${\mathbf {D}}_{f}=0$in order to satisfy the equality constraint (above).

## Conclusion

In both cases, the optimal H2 filter is recovered by the state-space matrices ${\mathbf {A}}_{f}={\mathbf {X}}^{-1}{\mathbf {A}}_{n},{\mathbf {B}}_{f}={\mathbf {X}}^{-1}{\mathbf {B}}_{n},{\mathbf {C}}_{f},$and ${\mathbf {D}}_{f}.$

## Remark

The problem of optimal filtering can alternatively be formulated as a special case of synthesizing a dynamic output "feedback" controller for the generalized plant given by
${\mathbf {\dot {x}}}={\mathbf {Ax}}+{\mathbf {B}}_{1}{\mathbf {w}},$
${\mathbf {z}}={\mathbf {C}}_{1}{\mathbf {x}}+{\mathbf {D}}_{11}{\mathbf {w}}-{\mathbf {u}},$
${\mathbf {y}}={\mathbf {C}}_{2}{\mathbf {x}}+{\mathbf {D}}_{21}{\mathbf {w}}.$
The synthesis methods presented in this page take advantage of the fact that the controller in this case is not a true feedback controller, as it only appears as a feedthrough term in the performance channel.

## External Links

A list of references documenting and validating the LMI.
* 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.