Board Reference

    Flight Controller
    Field Oriented Controller

    Motor Drive

    PMSM

    Motion Control

    Attitude Control

    Tutorial

    Mathematics
    Classical Control
    State Estimation
    Feedforward Control
    Disturbance Observer
    Motion Control

Pseudo Inverse

Problem Definition

This problem appears in an optimization process or controller design including a coordinate transformation of a state.
A problem is to get x\bm{x} that satisfy
Ax=y,\begin{align} \bm{A}\bm{x}=\bm{y}, \end{align}
where
ARm×n, xRn, yRm.\begin{align} \bm{A}\in \mathbb{R}^{m\times n}, \ \bm{x}\in \mathbb{R}^{n}, \ \bm{y}\in \mathbb{R}^{m}. \end{align}
How to solve this depends on the size of A\bm{A}.

Determined system

When A\bm{A} is a positive-definite, m=nm=n. In the case, there exist the inverse matrix of A\bm{A}. A solution is uniquely sought as
x^=A1y.\begin{align} \hat{\bm{x}}=\bm{A}^{-1}\bm{y}. \end{align}

Overdetermined system

When m>nm>n. There is no solution. As an alternative, a vector that satisfy the following equation is provided.
x^=arg minx 12Axy22.\begin{align} \hat{\bm{x}}=\argmin_{\bm{x}} \ \frac{1}{2}\| \bm{A}\bm{x}-\bm{y} \|^2_2. \end{align}
A solution is sought as
x(12Axy22)=AT(Axy)=0ATAxATy=0\begin{align} \frac{\partial}{\partial \bm{x}} \left(\frac{1}{2}\| \bm{A}\bm{x}-\bm{y} \|^2_2\right) &= \bm{A}^{\mathrm T}(\bm{A}\bm{x}-\bm{y}) = 0 \\ \Leftrightarrow \bm{A}^{\mathrm T}\bm{A}\bm{x}-\bm{A}^{\mathrm T}\bm{y} &= 0\end{align}
x^=(ATA)1ATy.\begin{align} \therefore \hat{\bm{x}} = \left(\bm{A}^{\mathrm T}\bm{A}\right)^{-1}\bm{A}^{\mathrm T}\bm{y}.\end{align}

Underdetermined system

When m<nm<n. There are many solutions. A generalized solution is provided using the sum of a vectors
x^=xm+xnullxmarg minx 12x22  s. t. Ax=yxnull{x  Ax=0}Ker(A)\begin{align} \hat{\bm{x}}&=\bm{x}_{\rm m}+\bm{x}_{\rm null} \\ \bm{x}_{\rm m} &\equiv \argmin_{\bm{x}} \ \frac{1}{2}\|\bm{x}\|^2_2\ \ {\rm s.\ t.\ }\bm{A}\bm{x}=\bm{y} \\ \bm{x}_{\rm null} &\equiv \{ \bm{x}\ |\ \bm{A}\bm{x} = 0 \} \in {\rm Ker}(\bm{A}) \end{align}
These vectors are sought as
L(x,λ)=12xTx+λ(Axy){xL(xm,λ)=xmATλ=0λL(xm,λ)=Axmy=0{xm=ATλAATλ=y{xm=AT(AAT)1yλ=(AAT)1y\begin{align} &\mathcal{L}(\bm{x}, \lambda)=\frac{1}{2}\bm{x}^{\mathrm T}\bm{x}+\lambda(\bm{A}\bm{x}-\bm{y})\\ &\left\{\begin{matrix}\frac{\partial}{\partial \bm{x}}\mathcal{L}(\bm{x}_{\rm m}, \lambda)=\bm{x}_{\rm m}-\bm{A}^{\mathrm T}\lambda=0\\ \frac{\partial}{\partial \lambda}\mathcal{L}(\bm{x}_{\rm m}, \lambda)=\bm{A}\bm{x}_{\rm m}-\bm{y}=0\end{matrix}\right.\\ \Leftrightarrow&\left\{\begin{matrix}\bm{x}_{\rm m}=\bm{A}^{\mathrm T}\lambda\\\bm{A}\bm{A}^{\mathrm T}\lambda=\bm{y}\\\end{matrix}\right.\\ \Leftrightarrow&\left\{\begin{matrix}\bm{x}_{\rm m}=\bm{A}^{\mathrm T}\left(\bm{A}\bm{A}^{\mathrm T}\right)^{-1}\bm{y}\\ \lambda=\left(\bm{A}\bm{A}^{\mathrm T}\right)^{-1}\bm{y}\end{matrix}\right. \end{align}
xnull=(IAT(AAT)1A)k.\begin{align} \bm{x}_{\rm null} &= (I-\bm{A}^{\mathrm T}\left(\bm{A}\bm{A}^{\mathrm T}\right)^{-1}\bm{A})k. \end{align}
Then, the generalized form is obtained as
x^=AT(AAT)1y+(IAT(AAT)1A)k.\begin{align} \hat{\bm{x}} &=\bm{A}^{\mathrm T}\left(\bm{A}\bm{A}^{\mathrm T}\right)^{-1}\bm{y}+(I-\bm{A}^{\mathrm T}\left(\bm{A}\bm{A}^{\mathrm T}\right)^{-1}\bm{A})k. \end{align}

Pseudo Inverse and solution

A pseudo inverse matrix is given as
A+={A1(m=n)(ATA)1AT(m>n)AT(AAT)1(m<n).\begin{align} \bm{A}^{+}&=\left\{\begin{matrix} \bm{A}^{-1} & (m=n) \\ \left(\bm{A}^{\mathrm T}\bm{A}\right)^{-1}\bm{A}^{\mathrm T} & (m>n) \\ \bm{A}^{\mathrm T}\left(\bm{A}\bm{A}^{\mathrm T}\right)^{-1} & (m<n) \end{matrix}\right..\end{align}
This matrix provide a solution as
x^={A+y(m=n)A+y(m>n)A+y+(IA+A)k(m<n)\begin{align} \hat{\bm{x}}&=\left\{\begin{matrix} \bm{A}^{+}\bm{y} & (m=n) \\ \bm{A}^{+}\bm{y} & (m>n) \\ \bm{A}^{+}\bm{y} + (I - \bm{A}^{+}\bm{A})k & (m<n) \end{matrix}\right.\end{align}

© DigitalServo