# Derivation of ZOH Discretization

I'm trying to understand the derivation of the zero order hold discretization method, and I have a couple of questions about some of the steps.

I think I understand the first part, this is just the solution to a system of linear equations using the matrix exponential and an integrating factor: $$\begin{split} \dot{x}(t) &= A x(t) + B u(t) \\ \dot{x}(t) - A x(t) &= B u(t) \\ e^{-At} \dot{x}(t) - e^{-At} A x(t) &= e^{-At} B u(t) \\ \frac{d}{dt}\left(e^{-At} x(t)\right) &= e^{-At} B u(t) \\ e^{-At} x(t) &= \int_{-\infty}^{t} e^{-A\tau} B u(\tau) d\tau + c \\ x(t) &= e^{At}c + \int_{-\infty}^{t} e^{A(t-\tau)} B u(\tau) d\tau \end{split}$$

Next, the integration constant is determined using the initial condition $$x(0)$$: $$x(0) = e^{0}c + \int_{-\infty}^{0} e^{-A\tau} B u(\tau) d\tau$$ Now, I understand that for finite, unilateral signals, this simplifies to $$c = x(0)$$, however, what happens if $$u(t)$$ is a Dirac delta? Why would the integral be zero in that case?

Then the state is sampled at $$(k+1) T_s$$: $$\begin{split} x((k+1) T_s) &= e^{A (k+1) T_s} x(0) + \int_{-\infty}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} B u(\tau) d\tau \\ &= e^{A T_s} \left(e^{A k T_s} x(0) + \int_{-\infty}^{k T_s} e^{A(k T_s-\tau)} B u(\tau) d\tau \right) + \int_{k T_s}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} B u(\tau) d\tau \\ &= e^{A T_s} x(k T_s) + \int_{k T_s}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} B u(\tau) d\tau \\ \end{split}$$ Since the input is the result of a ZOH operation with the same sample time $$T_s$$, the input is constant over a single time step: $$\forall t \in [k T_s, (k + 1) T_s): u(t) = u(k T_s)$$, therefore, $$u(\tau)$$ can be moved outside of the integral: $$x((k+1)T_s) = e^{A T_s} x(k T_s) + \int_{k T_s}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} d\tau B u(k T_s)$$ $$x[k+1] = e^{A T_s} x[k] + \int_{k T_s}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} d\tau B u[k]$$

The discrete system matrices then are: $$\begin{split} A_d &= e^{A T_s} \\ B_d &= \int_{k T_s}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} d\tau B \end{split}$$ My second question is if it's well-defined to solve this integral using substitution. The result seems to be correct, but it feels strange that the integration boundaries and the variable of integration suddenly become matrices themselves. Also, there seems to be something funny going on with the commutativity of the factor $$A^{-1}$$ and the integral when substituting $$d\tau$$.

$$\begin{split} V &= A((k+1) T_s-\tau) \\ dV &= -A d\tau \Leftrightarrow d\tau = -A^{-1} dV \\ B_d &= -A^{-1} \int_{A T_s}^{0} e^V dV B \\ &= A^{-1} \left[e^V\right]_{0}^{A T_s} B \\ &= A^{-1} \left(e^{A T_s} - I\right) B \end{split}$$

If there are any other holes or mistakes in my reasoning, feel free to let me know.

• i just realized that you are using Control Systems nomenclature where "$x(t)$" is the state and "$u(t)$" is the input and not the unit step function. Did you look up ZOH in wikipedia? – robert bristow-johnson Jul 25 '19 at 19:45
• @robertbristow-johnson Yes I did. The derivativion and the questions I asked about it are not on there, as far as I can see. – tttapa Jul 25 '19 at 19:49
• $$x(t) = e^{At}c + \int_{-\infty}^{t} e^{A(t-\tau)} B u(\tau) \ d\tau$$ what happens if $u(t)$ is a Dirac delta? Why would the integral be zero in that case?  The integral is not zero when $t>0$. You must evaluate the integrand (without the $\delta(\tau)$) at $\tau=0$ when $t>0$. – robert bristow-johnson Jul 25 '19 at 19:57
• @robertbristow-johnson I understand. And I guess it does make sense that the initial condition for the impulse response would be different. On top of that, it shouldn't matter in this ZOH case, because the complete system is actually a digital system, so the impulse response is the response to a Kronecker delta, not a Dirac delta. Then the input u(t) to the analog subsystem would just be ZOH of the Kronecker delta, i.e. a rectangular pulse of height 1 and width T_s. Any idea about the integral in the final step? Or is that a question for math.stackexchange? – tttapa Jul 26 '19 at 11:57
• i'll get back to this later, but i'm sure that someone like @MattL. or Fat32 or Olli can deal with this too. – robert bristow-johnson Jul 26 '19 at 18:44