\section{State space representation} \begin{figure}[h] \centering \resizebox{\linewidth}{!}{ \input{tex/tikz/mimo} } \caption{Diagram of a LTI MIMO system with vector variables.} \end{figure} A system described by a system of linear differential equations of \(n\)-th order, can be equivalently be described by \(n\) first order differential equations. Which can be compactly written in matrix form as \begin{align*} \dot{\vec{x}} &= \mx{A}\vec{x} + \mx{B}\vec{u} \\ \vec{y} &= \mx{C}\vec{x} + \mx{D}\vec{u}. \end{align*} If the system is time \emph{variant} the matrices are functions of time. \begin{table} \begin{tabular}{ >{\(}c<{\)} >{\(}c<{\)} l } \toprule \text{\bfseries Symbol} & \text{\bfseries Size} & \bfseries Name \\ \midrule \vec{x} & n & State vector \\ \vec{u} & m & Output vector \\ \vec{y} & k & Output vector \\ \midrule \mx{A} & n\times n & System matrix \\ \mx{B} & m\times n & Input matrix \\ \mx{C} & n\times k & Output matrix \\ \mx{D} & k\times m & Feed forward matrix \\ \bottomrule \end{tabular} \caption{Matrices for a state space representation} \end{table} \subsection{Canonical representations} \subsubsection{Controllable form} \subsubsection{Observable form} \subsubsection{Diagonalized or Jordan form} The Jordan form diagonalizes the \(\mx{A}\) matrix. Thus we need to solve the eigenvalue problem \((\mx{A} - \lambda\mx{I})\vec{x} = \vec{0}\), which can be done by setting \(\det(\mx{A} -\lambda\mx{I}) = 0\), and solving the characteristic polynomial. The eigenvectors are obtained by plugging the \(\lambda\) values back into \((\mx{A} - \lambda\mx{I})\vec{x} = \vec{0}\), and solving an overdetermined system of equations. Tip: for a \(2\times2\) matrix \(\mx{A}\) the eigenvalues can be quickly calculated with \[ m = \frac{1}{2} \tr \mx{A} = \frac{a + d}{2}, \quad p = \det \mx{A} = ad - bc \] and then \(\lambda_{1,2} = m \pm \sqrt{m^2 - p}\). The transformation to the eigenbasis \(\mx{T}\), obtained by using the eigenvector as columns of a matrix \(\mx{T} = \begin{bmatrix} \vec{v}_1 & \cdots & \vec{v}_n \end{bmatrix}\), is then used to compute \begin{align*} \mx{\hat{A}} & = \mx{T}\mx{A}\mx{T^{-1}} & \mx{\hat{B}} & = \mx{T}\mx{B} \\ \mx{\hat{C}} & = \mx{C}\mx{T^{-1}} & \mx{\hat{D}} & = \mx{D}. \end{align*} In this form the system is described with \(n\) decoupled states \(\xi_i\) with the equations \(\dot{\vec{\xi}} = \mx{\hat{A}}\vec{\xi} + \mx{\hat{B}}\vec{u}\) and \(\vec{y} = \mx{\hat{C}}\vec{\xi} + \mx{\hat{D}} \vec{u}\). \subsection{Stability} If \emph{all} eigenvalues \(\lambda\) are not zero and have a positive real part the system is asymptotically \emph{stable}. If \emph{all} eigenvalues are not zero but \emph{at least one} has a negative real part the system is \emph{unstable}. \subsection{Controllability} The state controllability condition implies that it is possible --- by admissible inputs --- to steer the states from any initial value to any final value within some finite time window. A LTI state space model is controllable iff the matrix \[ \mx{Q} = \begin{bmatrix} \mx{B} & \mx{A}\mx{B} & \mx{A}^2\mx{B} \cdots \mx{A}^{n-1}\mx{B} \end{bmatrix} \] has \(\rank\mx{Q} = n\). For a SISO system, if all components of the vector \(\mx{\hat{B}}\) are not zero, then the system is controllable. \subsection{Observability} Observability is a measure for how well internal states of a system can be inferred by knowledge of its external outputs. A LTI state space mode is observable iff the matrix \[ \mx{Q}^t = \begin{bmatrix} \mx{C} & \mx{C}\mx{A} & \cdots & \mx{C}\mx{A}^{n-1} \end{bmatrix} \] has \(\rank\mx{Q} = n\). For a SISO system it is also possible to infer observability from the diagonalized form: if all elements of the \(\mx{\hat{C}}\) are not zero, then the system is observable. \subsection{Solutions in time domain} %% TODO: solutions in the time domain \subsection{Solutions in the \(s\)-domain} By taking the Laplace transform of the system of differential equations we obtain \begin{align*} s\vec{X} - \vec{x}(0) &= \mx{A}\vec{X} + \mx{B}\vec{U} \\ \vec{Y} &= \mx{C}\vec{X} + \mx{D}\vec{U}. \end{align*} The first equation can be solved for \(\vec{X}\) giving \[ \vec{X} = (s\mx{I} - A)^{-1}\left(\vec{x}(0) + \mx{B}\vec{U}\right). \] Substituting in the second equation results in \[ \vec{Y} = \mx{C}(s\mx{I} - \mx{A})^{-1}\left(\vec{x}(0) + \mx{B}\vec{U}\right) + \mx{D}\vec{U}. \] Assuming that the initial conditions \(\vec{x}(0) = \vec{0}\), then \[ \vec{Y} = \left(\mx{C}(s\mx{I} - \mx{A})^{-1}\mx{B} + \mx{D}\right)\vec{U}. \] from which can define the \emph{transfer matrix} \(\mx{H}\) to be the matrix that takes \(\vec{Y}\) to \(\vec{U}\), i.e. \[ \vec{H} = \mx{C}(s\mx{I} - \mx{A})^{-1}\mx{B} + \mx{D}, \] that we can use to compute \(y = \laplace^{-1}\left\{\mx{H}\laplace u\right\}\). In the special case of a SISO system the transfer matrix \(\mx{H}\) is one dimensional and exactly equal to the transfer function \(H\).