| Creating and Manipulating Models | ![]() |
Specifying Delays on the Inputs or Outputs
While ideal for frequency-domain models with I/O delays, the ioDelay property is inadequate to capture delayed inputs or outputs in state-space models. For example, the two models
share the same transfer function
As a result, they cannot be distinguished using the ioDelay property (the I/O delay value is 0.1 seconds in both cases). Yet, these two models have different state trajectories since
and
are related by
Note that the 0.1 second delay is on the input in the first model, and on the output in the second model.
InputDelay and OutputDelay Properties
When the state trajectory is of interest, you should use the InputDelay and OutputDelay properties to distinguish between delays on the inputs and delays on the outputs in state-space models. For example, you can accurately specify the two models above by
M1 = ss(-1,1,1,0,'inputdelay',0.1) M2 = ss(-1,1,1,0,'outputdelay',0.1)
In the MIMO case, you can specify a different delay for each input (or output) channel by assigning a vector value to InputDelay (or OutputDelay). For example,
sys = ss(A,[B1 B2],[C1;C2],[D11 D12;D21 D22]) sys.inputdelay = [0.1 0] sys.outputdelay = [0.2 0.3]
creates the two-input, two-output model
You can also use the InputDelay and OutputDelay properties to conveniently specify input or output delays in TF, ZPK, or FRD models. For example, you can create the transfer function
s = tf('s');
H = [1/s ; 2/(s+1)]; % rational part
H.inputdelay = 0.1
The resulting model is displayed as
Transfer function from input to output...
1
#1: exp(-0.1*s) * -
s
2
#2: exp(-0.1*s) * -----
s + 1
By comparison, to produce an equivalent transfer function using the ioDelay property, you would need to type
H = [1/s ; 2/(s+1)]; H.iodelay = [0.1 ; 0.1];
Notice that the 0.1 second delay is repeated twice in the I/O delay matrix. More generally, for a TF, ZPK, or FRD model with input delays
and output delays
, the equivalent I/O delay matrix is
| Specifying Input/Output Delays | Specifying Delays in Discrete-Time Models | ![]() |