man Gain so the updated state estimate lies in the constrained space
-----------------------------------------------------------------------------------------------

Alternatively, we can expand the updated state estimate term in Equation using Equation.

$$A \left(  \hat{x}_{k|k-1} + K_{k}  \nu_{k} \right) = b$$

Then, we can choose a Kalman Gain $K_k^R$, that forces the updated state estimate to be in the constrained space. In the unconstrained case, we chose the optimal Kalman Gain $K_k$, by solving the minimization problem below which yields Equation.

$$K_k = \operatorname*{arg\,min}_{K \in \mathbb{R}^{n \times m}} {\ensuremath{\textnormal{trace}}}\left[ \left(\operatorname{I}- K H_{k}\right) P_{k|k-1}   \left(\operatorname{I}- K H_{k}\right)' + K R_k K'\right]$$

Now we seek the optimal $K_k^R$ that satisfies the constrained optimization problem written below for a given time-step $k$.

$$\label{min-con}
\begin{split}
 K_k^R = \operatorname*{arg\,min}_{K \in \mathbb{R}^{n \times m}} & {\ensuremath{\textnormal{trace}}}\left[ \left(\operatorname{I}- K H_{k}\right) P_{k|k-1}   \left(\operatorname{I}- K H_{k}\right)' + K R_k K'\right] \\
 \textnormal{s.t. } & A \left(  \hat{x}_{k|k-1} + K  \nu_{k} \right) = b 
\end{split}$$

We will solve this problem using the method of Lagrange Multipliers. First, we take the steps below, using the vec notation (column stacking matrices so they appear as long vectors, see Appendix \[app::kv\]) to convert all appearances of $K$ in Equation into long vectors. Let us begin by expanding the following term.[^10]

$$\begin{gathered}
\nonumber{\ensuremath{\textnormal{trace}}}\left[\left(\operatorname{I}- K H_{k}\right) P_{k|k-1}   \left(\operatorname{I}- K H_{
man Gain so the updated state estimate dwell in the constrained quad 
 ----------------------------------------------------------------------------------------------- 

 Alternatively, we can expand the updated state appraisal term in Equation using Equation. 

 $ $ ampere \left (  \hat{x}_{k|k-1 } + K_{k }   \nu_{k } \right) = b$$ 

 Then, we can choose a Kalman Gain $ K_k^R$, that forces the updated state of matter estimate to be in the constrained space. In the unconstrained character, we chose the optimal Kalman Gain $ K_k$, by resolve the minimization trouble below which yields Equation. 

 $ $ K_k = \operatorname*{arg\,min}_{K \in \mathbb{R}^{n \times m } } { \ensuremath{\textnormal{trace}}}\left [ \left(\operatorname{I}- K H_{k}\right) P_{k|k-1 }    \left(\operatorname{I}- K H_{k}\right)' + K R_k K'\right]$$ 

 nowadays we seek the optimal $ K_k^R$ that satisfy the constrained optimization problem written below for a give time - step $ k$. 

 $ $ \label{min - con } 
 \begin{split } 
  K_k^R = \operatorname*{arg\,min}_{K \in \mathbb{R}^{n \times m } } & { \ensuremath{\textnormal{trace}}}\left [ \left(\operatorname{I}- K H_{k}\right) P_{k|k-1 }    \left(\operatorname{I}- K H_{k}\right)' + K R_k K'\right ] \\ 
  \textnormal{s.t. } & A \left (  \hat{x}_{k|k-1 } + K   \nu_{k } \right) = b 
 \end{split}$$ 

 We will resolve this problem using the method of Lagrange Multipliers. First, we take the measure below, using the vec notation (column stacking matrices so they look as retentive vectors, see Appendix   \[app::kv\ ]) to convert all appearances of $ K$ in Equation into long vectors. Let us begin by expand the following term.[^10 ] 

 $ $ \begin{gathered } 
 \nonumber{\ensuremath{\textnormal{trace}}}\left[\left(\operatorname{I}- K H_{k}\right) P_{k|k-1 }    \left(\operatorname{I}- K H _ {
man Gain so the updated staue estimate lies nb the ronstrajned spaze
-----------------------------------------------------------------------------------------------

Alternatively, we can expanv thw updqted state estimate tefm in Equwtion usung Tquation.

$$A \left(  \hef{x}_{k|k-1} + K_{k}  \nu_{k} \vight) = b$$

Then, we can ghoose a Kanman Gain $K_k^R$, dhxt forces the updated state estimate eo be im hhe constraineq spsse. Ih the unconstrained case, we chose fhe optpmal Kalman Gain $L_k$, by solving the minimizahion problem below whifh yields Ewuatyin.

$$K_k = \operaturname*{arg\,mpu}_{K \in \mathbg{R}^{n \times m}} {\ensuremath{\textnormau{tracz}}}\left[ \left(\okzeatltname{I}- K H_{k}\rmght) P_{h|k-1}   \left(\opevstornake{I}- K H_{l}\right)' + K R_k K'\vight]$$

Iow qe seek the optimal $K_n^R$ that satisfies jhe constrdiued optimization proboen wrijten telod fof a gmveh time-dte' $k$.

$$\label{min-don}
\begin{splut}
 K_k^R = \operatornamt*{ard\,nin}_{K \in \mathbg{R}^{n \tiief m}} & {\ensuremath{\textnormal{trace}}}\left[ \left(\mpedatorname{I}- K H_{k}\right) P_{k|j-1}   \left(\operatorname{I}- K H_{k}\righe)' + K R_k K'\right] \\
 \textnormal{s.t. } & A \left(  \hat{x}_{k|k-1} + K  \nu_{k} \cieht) = n 
\ena{wppit}$$

We will solve this problem using the methoq og Kagrange Multiiliers. First, we tale tng steps below, osing tks bec notation (columj stackyng mqtrices sj thry appear as long vectors, swe Appendix \[aip::kv\]) to convert all ap'earances of $K$ im Equstion into long vectors. Let us begin bj expandihe the following gerk.[^10]

$$\bagin{gathtfed}
\nonumber{\ensureiath{\textnirmak{trace}}}\ldft[\lgft(\operwtorname{I}- N H_{k}\rlcht) P_{k|k-1}   \left(\operwtorncme{I}- N H_{
man Gain so the updated state estimate the space ----------------------------------------------------------------------------------------------- we can expand in using Equation. $$A \hat{x}_{k|k-1} + K_{k} \right) = b$$ Then, we can a Kalman Gain $K_k^R$, that forces the updated state estimate to be in constrained space. In the unconstrained case, we chose the optimal Kalman Gain $K_k$, solving minimization below yields Equation. $$K_k = \operatorname*{arg\,min}_{K \in \mathbb{R}^{n \times m}} {\ensuremath{\textnormal{trace}}}\left[ \left(\operatorname{I}- K H_{k}\right) P_{k|k-1} \left(\operatorname{I}- K + K R_k K'\right]$$ Now we seek the $K_k^R$ that satisfies the optimization problem written below for given $k$. $$\label{min-con} K_k^R \operatorname*{arg\,min}_{K \mathbb{R}^{n \times m}} {\ensuremath{\textnormal{trace}}}\left[ \left(\operatorname{I}- K H_{k}\right) P_{k|k-1} \left(\operatorname{I}- K H_{k}\right)' + K R_k K'\right] \\ \textnormal{s.t. } & A \hat{x}_{k|k-1} + \right) = \end{split}$$ will this problem using of Lagrange Multipliers. First, we take using the vec notation (column stacking matrices so appear as vectors, see Appendix \[app::kv\]) to convert appearances of $K$ in Equation into long vectors. us begin by expanding the following term.[^10] $$\begin{gathered} \nonumber{\ensuremath{\textnormal{trace}}}\left[\left(\operatorname{I}- K H_{k}\right) P_{k|k-1} \left(\operatorname{I}- K H_{
man Gain so the updated state eStimate lieS in thE coNstRaIned SpacE
-----------------------------------------------------------------------------------------------

Alternatively, WE can Expand the updated state eStimaTe TErm iN eqUatioN using EQUaTIOn.

$$A \LeFt(  \Hat{X}_{k|K-1} + k_{k}  \Nu_{k} \riGht) = B$$

Then, we Can choose a kalMaN Gain $K_k^R$, that FOrCes the updaTed State estimatE to Be in thE cOnsTRaineD spAce. In The uncONstraiNed case, we ChOSe the oPTimal KaLMAn gain $k_k$, by solving the minIMiZAtion problem beLow whiCh YIeLDS EqUatIon.

$$K_k = \operaToRname*{ARg\,min}_{K \iN \MaTHBB{R}^{n \TImes m}} {\ensuremaTh{\textnormaL{TraCe}}}\left[ \LeFt(\oPEratorName{I}- k H_{K}\RigHt) P_{k|k-1}   \left(\opEratOrname{I}- K H_{K}\right)' + k r_k K'\righT]$$

now we seEk the oPtiMal $k_k^R$ tHAt SaTisFiES thE CoNstRAinEd optimiZaTiOn proBlem WRITTen bEloW for A giveN time-step $k$.

$$\labEl{mIn-coN}
\BegIn{splIt}
 K_k^R = \OperAtOrnamE*{arg\,miN}_{K \in \mAtHbb{R}^{n \times m}} & {\ensuRemaTh{\textnorMal{TrAce}}}\LeFt[ \lefT(\OperatOrnAme{i}- K H_{k}\rigHt) P_{k|k-1}   \leFT(\opErATORnAme{I}- K H_{k}\right)' + K R_k K'\riGhT] \\
 \TExTnormal{s.T. } & A \left(  \HAt{X}_{k|K-1} + k  \nu_{k} \righT) = b 
\End{SpliT}$$

wE will SolvE ThIs probleM using THe MeThod of LAgRange MUlTipLieRs. FirST, we tAke the Steps belOw, usiNG the vec notatioN (Column stackinG MaTRIcES so tHey Appear as lonG vecTOrs, sEe ApPEnDix \[APp::kv\]) tO convErT AlL Appearances of $K$ in EquAtIon intO long Vectors. Let us bEgin by expaNDINg the folLowiNG tERm.[^10]

$$\begin{gathereD}
\nonuMber{\ensureMAth{\textnOrmal{Trace}}}\lefT[\left(\operATOrname{I}- K h_{k}\rIghT) P_{k|K-1}   \leFT(\OpEratorname{I}- K H_{
man Gain so the updated st ate estima te li esinth e co nstr ained space
-- - ---- ---------------------- ----- -- - ---- - -- ----- ------- - -- - - --- -- -- --- -- - -- ----- --- ------- ----

Alte rna ti vely, we can ex pand the u pda ted state es tim ate te rm  in Equat ion  usin g Equa t ion.
$$A \left (\hat{x } _{k|k-1 } +K_{k }  \nu_{k} \right )  = b$$

Then, wecan ch oo s ea Kal man  Gain $K_k ^R $, th a t force s  t h e upd a ted state est imate to be inthe co ns tra i ned sp ace.In the  unconstrai nedcase, wechoset he opti m al Kalm an Gai n $ K_k $, b y  s ol vin gt hem in imi z ati on probl em  b elowwhic h y i elds  Eq uati on.
$$K_k = \oper ato rnam e *{a rg\,m in}_{ K \i n\math bb{R}^ {n \t im es m}} {\ensure math {\textnor mal {t rac e} }}\le f t[ \le ft( \op eratorn ame{I}- K H _{ k } \ ri ght) P_{k|k-1}   \ le f t (\ operator name{I } -KH _{k}\rig ht )'+ KR _ k K'\ righ t ]$ $

Now w e seek th eoptimal  $ K_k^R$  t hat  sa tisfi e s th e cons trainedoptim i zation problem written below fo r ag iven  ti me-step $k$ .

$ $ \lab el{m i n- con } 
\beg in{sp li t }K_k^R = \operatorna me *{arg\ ,min} _{K \in \math bb{R}^{n \ t i m es m}} &  {\e n su r emath{\textnor mal{t race}}}\le f t[ \left (\ope ratornam e{I}- K H _ { k}\right ) P _{k |k- 1}\l eft(\operator n a me{I }-  K H_{k }\r ight)'+ K  R_ k K '\r ig ht] \\
 \ textnorm al {s .t .} &  A \l e ft(  \ha t{ x}_ {k |k- 1} +K   \nu_ {k} \ righ t)  = b \end{sp l it } $ $

W ewi ll s olv ethisprob l emusing t he method  of Lagr an ge  Multip liers. First,  w e take the  s tep s belo w ,  using t he vec notation (column stackin g m atric es s o they ap pea r as l ong vector s, see  Appe nd ix\ [ app:: k v \] ) t oconvert al l app earan ce s of  $K$ in  Equation into lon g  ve ctors. Let us  be ginb y  e xpa n di n g t he fol l o wing term.[^10] 

$$\begin {g a th ered}
\non u mbe r{ \ensure math{\t extno r mal{tra ce}}}\lef t[\left(\ op erat o r nam e{I}- K H_ {k}\righ t) P_{k|k - 1}  \ le ft(\o per atorna me {I} - K H _{
man Gain_so the_updated state estimate lies_in the_constrained_space
-----------------------------------------------------------------------------------------------

Alternatively, we_can_expand the updated_state estimate term_in Equation using Equation.

$$A_\left(  \hat{x}_{k|k-1}_+_K_{k}  \nu_{k} \right) = b$$

Then, we can choose a Kalman Gain $K_k^R$, that_forces_the updated_state_estimate_to be in the constrained_space. In the unconstrained case,_we chose_the optimal Kalman Gain $K_k$, by solving the_minimization_problem below which_yields Equation.

$$K_k = \operatorname*{arg\,min}_{K \in \mathbb{R}^{n \times m}} {\ensuremath{\textnormal{trace}}}\left[_\left(\operatorname{I}- K H_{k}\right) P_{k|k-1}  _\left(\operatorname{I}- K H_{k}\right)'_+_K_R_k K'\right]$$

Now we seek_the optimal $K_k^R$ that satisfies the_constrained optimization problem written below for_a given time-step $k$.

$$\label{min-con}
\begin{split}
 K_k^R = \operatorname*{arg\,min}_{K_\in \mathbb{R}^{n \times m}} & {\ensuremath{\textnormal{trace}}}\left[_\left(\operatorname{I}- K H_{k}\right) P_{k|k-1} _ \left(\operatorname{I}-_K H_{k}\right)' + K R_k_K'\right] \\
 \textnormal{s.t._} &_A \left( _\hat{x}_{k|k-1} + K  \nu_{k} \right)_= b 
\end{split}$$

We_will solve this problem using the_method_of Lagrange Multipliers._First,_we_take the_steps below, using_the_vec notation_(column_stacking matrices so they appear as_long_vectors, see Appendix \[app::kv\]) to convert all appearances_of $K$ in Equation_into_long vectors. Let us_begin by expanding the following_term.[^10]

$$\begin{gathered}
\nonumber{\ensuremath{\textnormal{trace}}}\left[\left(\operatorname{I}- K H_{k}\right) P_{k|k-1}  _\left(\operatorname{I}- K_H_{