main content

creating discrete-凯发k8网页登录

this example shows how to create discrete-time linear models using the tf, zpk, ss, and frd commands.

specifying discrete-time models

control system toolbox™ lets you create both continuous-time and discrete-time models. the syntax for creating discrete-time models is similar to that for continuous-time models, except that you must also provide a sample time (sampling interval in seconds).

for example, to specify the discrete-time transfer function:

h(z)=z-1z2-1.85z 0.9

with sampling period ts = 0.1 s, type:

num = [ 1  -1 ];
den = [ 1  -1.85  0.9 ];
h = tf(num,den,0.1)
h =
 
        z - 1
  ------------------
  z^2 - 1.85 z   0.9
 
sample time: 0.1 seconds
discrete-time transfer function.

or equivalently:

z = tf('z',0.1);
h = (z - 1) / (z^2 - 1.85*z   0.9);

similarly, to specify the discrete-time state-space model:

x[k 1]=0.5x[k] u[k]

y[k]=0.2x[k].

with sampling period ts = 0.1 s, type:

sys = ss(.5,1,.2,0,0.1);

recognizing discrete-time systems

there are several ways to determine if your lti model is discrete:

  • the display shows a nonzero sample time value

  • sys.ts or get(sys,'ts') return a nonzero sample time value.

  • isdt(sys) returns true.

for example, for the transfer function h specified above,

h.ts
ans = 0.1000
isdt(h)
ans = logical
   1

you can also spot discrete-time systems by looking for the following traits:

  • time response plots - response curve has a staircase look owing to its sampled-data nature

  • bode plots - there is a vertical bar marking the nyquist frequency (pi divided by the sample time).

the following plots show these characteristic traits:

step(h)

figure contains an axes object. the axes object contains an object of type line. this object represents h.

bode(h), grid

figure contains 2 axes objects. axes object 1 with ylabel magnitude (db) contains an object of type line. this object represents h. axes object 2 with ylabel phase (deg) contains an object of type line. this object represents h.

网站地图