# Optimal projection equations

In control theory, optimal projection equations constitute necessary and sufficient conditions for a locally optimal reduced-order LQG controller.
The linear-quadratic-Gaussian (LQG) control problem is one of the most fundamental optimal control problems. It concerns uncertain linear systems disturbed by additive white Gaussian noise, incomplete state information (i.e. not all the state variables are measured and available for feedback) also disturbed by additive white Gaussian noise and quadratic costs. Moreover, the solution is unique and constitutes a linear dynamic feedback control law that is easily computed and implemented. Finally the LQG controller is also fundamental to the optimal perturbation control of non-linear systems.
The LQG controller itself is a dynamic system like the system it controls. Both systems have the same state dimension. Therefore, implementing the LQG controller may be problematic if the dimension of the system state is large. The reduced-order LQG problem (fixed-order LQG problem) overcomes this by fixing a-priori the number of states of the LQG controller. This problem is more difficult to solve because it is no longer separable. Also the solution is no longer unique. Despite these facts numerical algorithms are available to solve the associated optimal projection equations.

## Mathematical problem formulation and solution
### Continuous-time

The reduced-order LQG control problem is almost identical to the conventional full-order LQG control problem. Let ${\hat {\mathbf {x} }}_{r}(t)$ represent the state of the reduced-order LQG controller. Then the only difference is that the state dimension $n_{r}=dim({\hat {\mathbf {x} }}_{r}(t))$ of the LQG controller is a-priori fixed to be smaller than $n=dim({\mathbf {x} }(t))$, the state dimension of the controlled system.
The reduced-order LQG controller is represented by the following equations:
    ${\dot {\hat {\mathbf {x} }}}_{r}(t)=A_{r}(t){\hat {\mathbf {x} }}_{r}(t)+B_{r}(t){\mathbf {u} }(t)+K_{r}(t)\left({\mathbf {y} }(t)-C_{r}(t){\hat {\mathbf {x} }}_{r}(t)\right),{\hat {\mathbf {x} }}_{r}(0)={\mathbf {x} }_{r}(0),$
    ${\mathbf {u} }(t)=-L_{r}(t){\hat {\mathbf {x} }}_{r}(t).$
These equations are deliberately stated in a format that equals that of the conventional full-order LQG controller. For the reduced-order LQG control problem it is convenient to rewrite them as
    ${\dot {\hat {\mathbf {x} }}}_{r}(t)=F_{r}(t){\hat {\mathbf {x} }}_{r}(t)+K_{r}(t){\mathbf {y} }(t),{\hat {\mathbf {x} }}_{r}(0)={\mathbf {x} }_{r}(0),$
    ${\mathbf {u} }(t)=-L_{r}(t){\hat {\mathbf {x} }}_{r}(t),$
where
    $F_{r}(t)=A_{r}(t)-B_{r}(t)L_{r}(t)-K_{r}(t)C_{r}(t).$
The matrices $F_{r}(t),K_{r}(t),L_{r}(t)$ and ${\mathbf {x} }_{r}(0)$ of the reduced-order LQG controller are determined by the so-called optimal projection equations (OPE).
The square optimal projection matrix $\tau (t)$ with dimension $n$ is central to the OPE. The rank of this matrix is almost everywhere equal to $n_{r}.$ The associated projection is an oblique projection: $\tau ^{2}(t)=\tau (t).$ The OPE constitute four matrix differential equations. The first two equations listed below are generalizations of the matrix Riccati differential equations associated to the conventional full-order LQG controller. In these equations $\tau _{\perp }(t)$ denotes $I_{n}-\tau (t)$ where $I_{n}$ is the identity matrix of dimension $n$.
    ${\begin{aligned}{\dot {P}}(t)=&A(t)P(t)+P(t)A'(t)-P(t)C'(t)W^{-1}(t)C(t)P(t)+V(t)\\[6pt]&+\tau _{\perp }(t)P(t)C'(t)W^{-1}(t)C(t)P(t)\tau '_{\perp }(t),\\[6pt]P(0)=&E\left({\mathbf {x} }(0){\mathbf {x} }'(0)\right),\\[6pt]&-{\dot {S}}(t)=A'(t)S(t)+S(t)A(t)-S(t)B(t)R^{-1}(t)B'(t)S(t)+Q(t)\\[6pt]&+\tau '_{\perp }(t)S(t)B(t)R^{-1}(t)B'(t)S(t)\tau _{\perp }(t),\end{aligned}}$
    $S(T)=F.$
If the dimension of the LQG controller is not reduced, that is if $n=n_{r}$, then $\tau (t)=I_{n},\tau _{\perp }(t)=0$ and the two equations above become the uncoupled matrix Riccati differential equations associated to the conventional full-order LQG controller. If $n_{r}<n$ the two equations are coupled by the oblique projection $\tau (t).$ This reveals why the reduced-order LQG problem is not separable. The oblique projection $\tau (t)$ is determined from two additional matrix differential equations which involve rank conditions. Together with the previous two matrix differential equations these are the OPE. To state the additional two matrix differential equations it is convenient to introduce the following two matrices:
    $\Psi _{1}(t)=(A(t)-B(t)R^{-1}(t)B'(t)S(t)){\hat {P}}(t)+{\hat {P}}(t)(A(t)-B(t)R^{-1}(t)B'(t)S(t))'$
             $+P(t)C'(t)W^{-1}(t)C(t)P(t),$
    $\Psi _{2}(t)=(A(t)-P(t)C'(t)W^{-1}(t)C(t))'{\hat {S}}(t)+{\hat {S}}(t)(A(t)-P(t)C'(t)W^{-1}(t)C(t))$
             $+S(t)B(t)R^{-1}(t)B'(t)S(t).$
Then the two additional matrix differential equations that complete the OPE are as follows:
    ${\dot {\hat {P}}}(t)=1/2\left(\tau (t)\Psi _{1}(t)+\Psi _{1}(t)\tau '(t)\right),{\hat {P}}(0)=E({\mathbf {x} }(0))E({\mathbf {x} }(0))',\operatorname {rank} ({\hat {P}}(t))=n_{r}$ almost everywhere,
    $-{\dot {\hat {S}}}(t)=1/2\left(\tau '(t)\Psi _{2}(t)+\Psi _{2}(t)\tau (t)\right),{\hat {S}}(T)=0,\operatorname {rank} ({\hat {S}}(t))=n_{r}$ almost everywhere,
with
    $\tau (t)={\hat {P}}(t){\hat {S}}(t)\left({\hat {P}}(t){\hat {S}}(t)\right)^{*}.$
Here * denotes the group generalized inverse or Drazin inverse that is unique and given by
    $A^{*}=A(A^{3})^{+}A.$
where + denotes the Moore–Penrose pseudoinverse.
The matrices $P(t),S(t),{\hat {P}}(t),{\hat {S}}(t)$ must all be nonnegative symmetric. Then they constitute a solution of the OPE that determines the reduced-order LQG controller matrices $F_{r}(t),K_{r}(t),L_{r}(t)$ and ${\mathbf {x} }_{r}(0)$:
    $F_{r}(t)=H(t)\left(A(t)-P(t)C'(t)W^{-1}(t)C(t)-B(t)R^{-1}(t)B'(t)S(t)\right)G(t)+{\dot {H}}(t)G'(t),$
    $K_{r}(t)=H(t)P(t)C'(t)W^{-1}(t),$
    $L_{r}(t)=R^{-1}(t)B'(t)S(t)G'(t),$
    ${\mathbf {x} }_{r}(0)=H(0)E({\mathbf {x} }(0)).$
In the equations above the matrices $G(t),H(t)$ are two matrices with the following properties:
    $G'(t)H(t)=\tau (t),G(t)H'(t)=I_{n_{r}}$ almost everywhere.
They can be obtained from a projective factorization of ${\hat {P}}(t){\hat {S}}(t)$.
The OPE can be stated in many different ways that are all equivalent. To identify the equivalent representations the following identities are especially useful:
    $\tau (t){\hat {P}}(t)={\hat {P}}(t)\tau '(t)={\hat {P}}(t),\tau '(t){\hat {S}}(t)={\hat {S}}(t)\tau (t)={\hat {S}}(t)$
Using these identities one may for instance rewrite the first two of the optimal projection equations as follows:
    ${\dot {P}}(t)=A(t)P(t)+P(t)A'(t)-P(t)C'(t)W^{-1}(t)C(t)P(t)+V(t)+\tau _{\perp }(t)\Psi _{1}(t)\tau '_{\perp }(t),$
    $P(0)=E\left({\mathbf {x} }(0){\mathbf {x} }'(0)\right),$
    $-{\dot {S}}(t)=A'(t)S(t)+S(t)A(t)-S(t)B(t)R^{-1}(t)B'(t)S(t)+Q(t)+\tau '_{\perp }\Psi _{2}(t)\tau _{\perp }(t),$
    $S(T)=F.$
This representation is both relatively simple and suitable for numerical computations.
If all the matrices in the reduced-order LQG problem formulation are time-invariant and if the horizon $T$ tends to infinity, the optimal reduced-order LQG controller becomes time-invariant and so do the OPE. In that case the derivatives on the left hand side of the OPE are zero.

### Discrete-time

Similar to the continuous-time case, in the discrete-time case the difference with the conventional discrete-time full-order LQG problem is the a-priori fixed reduced-order $n_{r}<n$ of the LQG controller state dimension. As in continuous-time, to state the discrete-time OPE it is convenient to introduce the following two matrices:
    $\Psi _{i}^{1}=\left(A_{i}-B_{i}(B'_{i}S_{i+1}B_{i}+R_{i})^{-1}B'_{i}S_{i+1}A_{i})\right){\hat {P}}_{i}\left(A_{i}-B_{i}(B'_{i}S_{i+1}B_{i}+R_{i})^{-1}B'_{i}S_{i+1}A_{i})\right)'$
             $+A_{i}P_{i}C'_{i}(C_{i}P_{i}C'_{i}+W_{i})^{-1}C_{i}P_{i}A'_{i}$
    $\Psi _{i+1}^{2}=\left(A_{i}-A_{i}P_{i}C'_{i}(C_{i}P_{i}C'_{i}+W_{i})^{-1}C_{i}\right)'{\hat {S}}_{i+1}\left(A_{i}-A_{i}P_{i}C'_{i}(C_{i}P_{i}C'_{i}+W_{i})^{-1}C_{i}\right)$
             $+A'_{i}S_{i+1}B_{i}(B'_{i}S_{i+1}B_{i}+R_{i})^{-1}B'_{i}S_{i+1}A_{i}$
Then the discrete-time OPE is
    $P_{i+1}=A_{i}\left(P_{i}-P_{i}C'_{i}\left(C_{i}P_{i}C'_{i}+W_{i}\right)^{-1}C_{i}P_{i}\right)A'_{i}+V_{i}+\tau _{\perp i+1}\Psi _{i}^{1}\tau '_{\perp i+1},P_{0}=E\left({\mathbf {x} }_{0}{\mathbf {x'} }_{0}\right)$.
    $S_{i}=A'_{i}\left(S_{i+1}-S_{i+1}B_{i}\left(B'_{i}S_{i+1}B_{i}+R_{i}\right)^{-1}B'_{i}S_{i+1}\right)A_{i}+Q_{i}+\tau '_{\perp i}\Psi _{i+1}^{2}\tau _{\perp i},S_{N}=F$.
    ${\hat {P}}_{i+1}=1/2(\tau _{i+1}\Psi _{i}^{1}+\Psi _{i}^{1}\tau '_{i+1}),{\hat {P}}_{0}=E({\mathbf {x} }(0))E({\mathbf {x} }(0))',\operatorname {rank} ({\hat {P}}_{i})=n_{r}$ almost everywhere,
    ${\hat {S}}_{i}=1/2(\tau '_{i}\Psi _{i+1}^{2}+\Psi _{i+1}^{2}\tau _{i}),{\hat {S}}_{N}=0,\operatorname {rank} ({\hat {S}}_{i})=n_{r}$ almost everywhere.
The oblique projection matrix is given by
    $\tau _{i}={\hat {P}}_{i}{\hat {S}}_{i}\left({\hat {P}}_{i}{\hat {S}}_{i}\right)^{*}.$
The nonnegative symmetric matrices $P_{i},S_{i},{\hat {P}}_{i},{\hat {S}}_{i}$ that solve the discrete-time OPE determine the reduced-order LQG controller matrices $F_{i}^{r},K_{i}^{r},L_{i}^{r}$ and ${\mathbf {x} }_{0}^{r}$:
    $F_{i}^{r}=H_{i+1}\left(A_{i}-P_{i}C'_{i}\left(C_{i}P_{i}C'_{i}+W_{i}\right)^{-1}C_{i}-B_{i}\left(B'_{i}S_{i+1}B_{i}+R_{i}\right)^{-1}B'_{i}S_{i+1}\right)G'_{i},$
    $K_{i}^{r}=H_{i+1}P_{i}C'_{i}\left(C_{i}P_{i}C'_{i}+W_{i}\right)^{-1},$
    $L_{i}^{r}=\left(B'_{i}S_{i+1}B_{i}+R_{i}\right)^{-1}B'_{i}S_{i+1}G'_{i},$
    ${\mathbf {x} }_{0}^{r}=H_{0}E({\mathbf {x} }_{0}).$
In the equations above the matrices $G_{i},H_{i}$ are two matrices with the following properties:
    $G'_{i}H_{i}=\tau _{i},G_{i}H'_{i}=I_{n_{r}}$ almost everywhere.
They can be obtained from a projective factorization of ${\hat {P}}_{i}{\hat {S}}_{i}$. To identify equivalent representations of the discrete-time OPE the following identities are especially useful:
    $\tau _{i}{\hat {P}}_{i}={\hat {P}}_{i}\tau '_{i}={\hat {P}}_{i},\tau '_{i}{\hat {S}}_{i}={\hat {S}}_{i}\tau _{i}={\hat {S}}_{i}$
As in the continuous-time case if all the matrices in the problem formulation are time-invariant and if the horizon $N$ tends to infinity the reduced-order LQG controller becomes time-invariant. Then the discrete-time OPE converge to a steady state solution that determines the time-invariant reduced-order LQG controller.
The discrete-time OPE apply also to discrete-time systems with variable state, input and output dimensions (discrete-time systems with time-varying dimensions). Such systems arise in the case of digital controller design if the sampling occurs asynchronously.