# Discrete-time input matrix when one of the eigenvalues of the system matrix is zero

If we have a continuous time state-equation,

$$\dot{x}(t) = A x(t) + B u(t)$$

where $A \in \mathbb{R}^{n \times n}, x \in \mathbb{R}^{n\times1}, B \in \mathbb{R}^{n \times m}, u \in \mathbb{R}^{m \times 1}$, the analytical solution is obtained as

$$x(t) = e^{A t} x(0) + \int_0^t e^{A(t-\tau)}B u(\tau)\, d\tau$$

Converting this to discrete-time, with sampling period $T_s$, and assuming that all eigenvalues of $A$ are non-zero, real & distinct and $u$ remains constant within each sample interval, $k$ to $k+1$, we get the following difference equation,

$$x[k+1] = e^{A T_s} x[k] + \left[\int_0^{T_s} e^{A\tau}B \, d\tau\right] u[k]$$

which can be written as

$$x[k+1] = A_d x[k] + B_d u[k]$$

When the original matrix $A$ is invertible, the integral term corresponding to $B_d$ can be written as

$$B_d = A^{-1}(A_d - I)$$

The question is, What about the case when A is non-invertible? In particular, if

$$A=\begin{bmatrix}a_1 & 0 & 0 \\ 0 & a_2 & 0 \\ 0 & 0 & 0 \end{bmatrix}$$ and $$B=\begin{bmatrix}b_1 \\ b_2 \\ b_3 \end{bmatrix}$$

then one of the eigenvalues of $A$ is zero. In this case, how do I obtain the corresponding $B_d$?

$$\begin{array}{rl} \mathrm B_d &= \displaystyle\int_{0}^{T_s} \exp(\mathrm A t) \mathrm B \, \mathrm d t\\ &= \displaystyle\int_{0}^{T_s} \left(\sum_{k=0}^{\infty} \frac{t^k}{k!} \mathrm A^k \right)\mathrm B \, \mathrm d t\\ &= \displaystyle \sum_{k=0}^{\infty} \left( \int_{0}^{T_s} \frac{t^k}{k!} \, \mathrm d t \right) \mathrm A^k \mathrm B\\ &= \displaystyle \sum_{k=0}^{\infty} \frac{T_s^{k+1}}{(k+1)!} \mathrm A^k \mathrm B\\ &\approx T_s \left( \mathrm I + \frac{T_s}{2} \mathrm A \right) \mathrm B\end{array}$$

That equivalence is only valid if $A$ is invertible, hence it is a result but not a definition. This is typically done via the following relation

$$\exp\left(\begin{bmatrix}A & B\\0 &0\end{bmatrix}t\right) = \begin{bmatrix}e^{At} &\int e^{At}B\\0&I\end{bmatrix}=\begin{bmatrix}A_d & B_d\\0 &I\end{bmatrix}$$

where exp is the matrix exponential, and $t$ is the sampling period. $C, D$ matrices remain unchanged.

Shameless plug: I've recently finished these conversion tools in my python package. The code for other methods can be found https://github.com/ilayn/harold/blob/master/harold/_discrete_funcs.py#L139.

• Sorry. That answer is absolutely unclear. I just want to know how to compute $A_d$ and $B_d$ for my specific example. Can you expand on your answer ? – Krishna May 24 '18 at 9:28
• If you type expm([A B;zeros(m,n+m) in matlab you get B as the upper right block. – percusse May 24 '18 at 9:29
• And how is the sample time $T_s$ influencing the discrete matrices? Simply taking the matrix exponentials will not produce their corresponding discrete-time equivalents – Krishna May 24 '18 at 9:31
• @Krishna Ah good catch I've forgot to add that. Give me a second – percusse May 24 '18 at 9:31
• @Krishna I don't understand, the matrix exponential is defined for all matrices, nonsingularity is not required. Either manually obtain the matrix exponential and integrate or you can use the formulation in my answer. – percusse May 24 '18 at 9:47