Lably
Skip to content

Discretization

Conversion of continuous functions into discrete counterparts

  • 3 min read
  • 3 chapters

Related on Lably

Through Continuous function, Differential equation and Recurrence relation

Discretization is also related to discrete mathematics, and is an important component of granular computing. In this context, discretization may also refer to modification of variable or category granularity, as when multiple discrete variables are aggregated or multiple discrete categories fused.

Whenever continuous data is discretized, there is always some amount of discretization error. The goal is to reduce the amount to a level considered negligible for the modeling purposes at hand.

The terms discretization and quantization often have the same denotation but not always identical connotations. (Specifically, the two terms share a semantic field.) The same is true of discretization error and quantization error.

Mathematical methods relating to discretization include the Euler–Maruyama method and the zero-order hold.

Discretization of linear state space models

Discretization is also concerned with the transformation of continuous differential equations into discrete difference equations, suitable for numerical computing.

The following continuous-time state space model

x˙(t)=Ax(t)+Bu(t)+w(t)y(t)=Cx(t)+Du(t)+v(t)

where v and w are continuous zero-mean white noise sources with power spectral densities

w(t)∼N(0,Q)v(t)∼N(0,R)

can be discretized, assuming zero-order hold for the input u and continuous integration for the noise v, to

x[k+1]=Adx[k]+Bdu[k]+w[k]y[k]=Cdx[k]+Ddu[k]+v[k]

with covariances

w[k]∼N(0,Qd)v[k]∼N(0,Rd)

where

Ad=eAT=L−1{(sI−A)−1}t=TBd=(∫τ=0TeAτdτ)BCd=CDd=DQd=∫τ=0TeAτQeA⊤τdτRd=R1T

and T is the sample time. If A is nonsingular, Bd=A−1(Ad−I)B.

The equation for the discretized measurement noise is a consequence of the continuous measurement noise being defined with a power spectral density.

A clever trick to compute Ad and Bd in one step is by utilizing the following property:

e[AB00]T=[AdBd0I]

Where Ad and Bd are the discretized state-space matrices.

Discretization of process noise

Numerical evaluation of Qd is a bit trickier due to the matrix exponential integral. It can, however, be computed by first constructing a matrix, and computing the exponential of it F=[−AQ0A⊤]TG=eF=[…Ad−1Qd0Ad⊤] The discretized process noise is then evaluated by multiplying the transpose of the lower-right partition of G with the upper-right partition of G: Qd=(Ad⊤)⊤(Ad−1Qd)=Ad(Ad−1Qd).

Derivation

Starting with the continuous model x˙(t)=Ax(t)+Bu(t) we know that the matrix exponential is ddteAt=AeAt=eAtA and by premultiplying the model we get e−Atx˙(t)=e−AtAx(t)+e−AtBu(t) which we recognize as ddt[e−Atx(t)]=e−AtBu(t) and by integrating, e−Atx(t)−e0x(0)=∫0te−AτBu(τ)dτx(t)=eAtx(0)+∫0teA(t−τ)Bu(τ)dτ which is an analytical solution to the continuous model.

Now we want to discretise the above expression. We assume that u is constant during each timestep. x[k]=defx(kT)x[k]=eAkTx(0)+∫0kTeA(kT−τ)Bu(τ)dτx[k+1]=eA(k+1)Tx(0)+∫0(k+1)TeA[(k+1)T−τ]Bu(τ)dτx[k+1]=eAT[eAkTx(0)+∫0kTeA(kT−τ)Bu(τ)dτ]+∫kT(k+1)TeA(kT+T−τ)Bu(τ)dτ We recognize the bracketed expression as x[k], and the second term can be simplified by substituting with the function v(τ)=kT+T−τ. Note that dτ=−dv. We also assume that u is constant during the integral, which in turn yields

x[k+1]=eATx[k]−(∫v(kT)v((k+1)T)eAvdv)Bu[k]=eATx[k]−(∫T0eAvdv)Bu[k]=eATx[k]+(∫0TeAvdv)Bu[k]=eATx[k]+A−1(eAT−I)Bu[k]

which is an exact solution to the discretization problem.

When A is singular, the latter expression can still be used by replacing eAT by its Taylor expansion, eAT=∑k=0∞1k!(AT)k. This yields x[k+1]=eATx[k]+(∫0TeAvdv)Bu[k]=(∑k=0∞1k!(AT)k)x[k]+(∑k=1∞1k!Ak−1Tk)Bu[k], which is the form used in practice.

Approximations

Exact discretization may sometimes be intractable due to the heavy matrix exponential and integral operations involved. It is much easier to calculate an approximate discrete model, based on that for small timesteps eAT≈I+AT. The approximate solution then becomes: x[k+1]≈(I+AT)x[k]+TBu[k]

This is also known as the Euler method, which is also known as the forward Euler method. Other possible approximations are eAT≈(I−AT)−1, otherwise known as the backward Euler method and eAT≈(I+12AT)(I−12AT)−1, which is known as the bilinear transform, or Tustin transform. Each of these approximations has different stability properties. The bilinear transform preserves the instability of the continuous-time system.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication