Discretization
|
Discretization concerns the process of transferring continuous models and equations into discrete counterparts. This process is usually carried out as a first step toward making them suitable for numerical evaluation and implementation on digital computers. In order to be processed on a digital computer another process named quantization is essential.
- Euler discretization
- Zero order hold
Discretization is also somewhat connected to discrete mathematics.
Discretization of linear state space models
Discretization does also concern the transformation of continuous differential equations into discrete difference equations, suitable for numerical computing.
The following continuous state space model
- <math>\dot{\mathbf{x}}(t) = \mathbf A \mathbf{x}(t) + \mathbf B \mathbf{u}(t)<math>
- <math>\mathbf{y}(t) = \mathbf C \mathbf{x}(t) + \mathbf D \mathbf{u}(t)<math>
may be discretized, assuming zero-order hold, to
- <math>\mathbf{x}(k+1) = \mathbf A_d \mathbf{x}(k) + \mathbf B_d \mathbf{u}(k)<math>
- <math>\mathbf{y}(k) = \mathbf C_d \mathbf{x}(k) + \mathbf D_d \mathbf{u}(k)<math>
where
- <math>\mathbf A_d = e^{\mathbf A T} = \mathcal{L}^{-1}\{(s\mathbf I - \mathbf A)^{-1}\}_{t=T} <math>
- <math>\mathbf B_d = \left( \int_{\tau=0}^{T}e^{\mathbf A \tau}d\tau \right) \mathbf B = \mathbf A^{-1}(\mathbf A_d - I)\mathbf B <math>, if <math>\mathbf A<math> is nonsingular
- <math>\mathbf C_d = \mathbf C <math>
- <math>\mathbf D_d = \mathbf D <math>
and <math>T<math> is the sample time.
Derivation
Starting with the continuous model
- <math>\mathbf\dot{x}(t) = \mathbf A\mathbf x(t) + \mathbf B \mathbf u(t)<math>
we know that the matrix exponential is
- <math>\frac{d}{dt}e^{\mathbf At} = \mathbf A e^{\mathbf At} = e^{\mathbf At} \mathbf A<math>
and by premultiplying the model we get
- <math>e^{-\mathbf At} \mathbf\dot{x}(t) = e^{-\mathbf At} \mathbf A\mathbf x(t) + e^{-\mathbf At} \mathbf B\mathbf u(t)<math>
which we recognize as
- <math>\frac{d}{dt}(e^{-\mathbf At}\mathbf x(t)) = e^{-\mathbf At} \mathbf B\mathbf u(t)<math>
and by integrating..
- <math>e^{-\mathbf At}\mathbf x(t) - e^0\mathbf x(0) = \int_0^t e^{-\mathbf A\tau}\mathbf B\mathbf u(\tau) d\tau<math>
- <math>\mathbf x(t) = e^{\mathbf At}\mathbf x(0) + \int_0^t e^{\mathbf A(t-\tau)} \mathbf B\mathbf u(\tau) d \tau<math>
which is an analytical solution to the continuous model.
Now we want to discretize the above expression. We assume that u is constant during each timestep.
- <math>\mathbf x[k] \equiv \mathbf x(kT)<math>
- <math>\mathbf x[k] = e^{\mathbf AkT}\mathbf x(0) + \int_0^{kT} e^{\mathbf A(kT-\tau)} \mathbf B\mathbf u(\tau) d \tau<math>
- <math>\mathbf x[k+1] = e^{\mathbf A(k+1)T}\mathbf x(0) + \int_0^{(k+1)T} e^{\mathbf A((k+1)T-\tau)} \mathbf B\mathbf u(\tau) d \tau<math>
- <math>\mathbf x[k+1] = e^{\mathbf AT} \left[ e^{\mathbf AkT}\mathbf x(0) + \int_0^{kT} e^{\mathbf A(kT-\tau)} \mathbf B\mathbf u(\tau) d \tau \right]+ \int_{kT}^{(k+1)T} e^{\mathbf A(kT+T-\tau)} \mathbf B\mathbf u(\tau) d \tau<math>
We recognize the bracketed expression as <math>\mathbf x[k]<math>, and the second term can be simplified by substituting <math>v = kT + T - \tau<math>. We also assume that <math>\mathbf u<math> is constant during the integral, which in turn yields
- <math>\mathbf x[k+1] = e^{\mathbf AT}\mathbf x[k] + \left( \int_0^T e^{\mathbf Av} dv \right) \mathbf B\mathbf u[k]<math>
which is an exact solution to the discretization problem.
Approximations
Exact discretization may sometimes be intractable due to the heavy matrix exponential and integral operations involved. It is far more easily to calculate an approximate discrete model, based on that for small timesteps <math>e^{\mathbf AT} \approx \mathbf I + \mathbf A T<math>. The approximate solution then becomes:
- <math>\mathbf x[k+1] \approx (\mathbf I + \mathbf AT) \mathbf x[k] + (\mathbf I T + \frac{1}{2} \mathbf A T^2 ) \mathbf B \mathbf u[k] <math>
which can further be approximated if <math>\frac{1}{2} \mathbf A T^2<math> is small; yielding
- <math>\mathbf x[k+1] \approx (\mathbf I + \mathbf AT) \mathbf x[k] + T\mathbf B \mathbf u[k] <math>