Download Using Simulink

Transcript
Discrete-Time Systems
Discrete-Time Systems
Simulink has the ability to simulate discrete (sampled data) systems. Models
can be multirate; that is, they can contain blocks that are sampled at different
rates. Models can also be hybrid, containing a mixture of discrete and
continuous blocks.
Discrete Blocks
Each of the discrete blocks has a built-in sampler at its input, and a zero-order
hold at its output. When the discrete blocks are mixed with continuous blocks,
the output of the discrete blocks between sample times is held constant. The
outputs of the discrete blocks are updated only at times that correspond to
sample hits.
Sample Time
The Sample time parameter sets the sample time at which a discrete block’s
states are updated. Normally, the sample time is set to a scalar variable;
however, it is possible to specify an offset time (or skew) by specifying a
two-element vector in this field.
For example, specifying the Sample time parameter as the vector [Ts,offset]
sets the sample time to Ts and the offset value to offset. The discrete block is
updated on integer multiples of the sample time and offset values only
t = n * Ts + offset
where n is an integer and offset can be positive or negative, but less than the
sample time. The offset is useful if some discrete blocks must be updated sooner
or later than others.
You cannot change the sample time of a block while a simulation is running. If
you want to change a block’s sample time, you must stop and restart the
simulation for the change to take effect.
Purely Discrete Systems
Purely discrete systems can be simulated using any of the solvers; there is no
difference in the solutions. To generate output points only at the sample hits,
choose one of the discrete solvers.
9-13