Get input/output delay information for
DELAYS = getDelayInfo(MODEL)
DELAYS = getDelayInfo(MODEL,TYPE)
DELAYS = getDelayInfo(MODEL) obtains the maximum delay in each
input and output variable of an
DELAYS = getDelayInfo(MODEL,TYPE) lets you choose between
obtaining maximum delays across all input and output variables or maximum delays for
each output variable individually. When delays are obtained for each output variable
individually a matrix is returned, where each row is a vector containing
maximum delays for each output variable, and:
ny is the number of outputs of
nu is the number of inputs of
Delay information is useful for determining the number of states in the model. For nonlinear ARX models, the states are related to the set of delayed input and output variables that define the model structure (regressors). For example, if an input or output variable p has a maximum delay of D samples, then it contributes D elements to the state vector:
p(t-1), p(t-2), ...p(t-D)
The number of states of a nonlinear ARX model equals the sum of the maximum delays of
each input and output variable. For more information about the definition of states for
idnlarx models, see Definition of idnlarx States
getDelayInfo accepts the following arguments:
TYPE: (Optional) Specifies whether to obtain channel delays
'all': Default value.
DELAYScontains the maximum delays across each output (vector of ny+nu entries, where
[ny, nu] = size(MODEL)).
DELAYScontains delay values separated for each output (ny-by-(ny+nu) matrix).
DELAYS: Contains delay information in a vector of length ny+nu arranged with output channels preceding the input channels, i.e.,
[y1, y2,.., u1, u2,..].
Get Input and Output Delay Information for Nonlinear ARX Model
Create a two-output, three-input nonlinear ARX model.
M = idnlarx([2 0 2 2 1 1 0 0; 1 0 1 5 0 1 1 0],'idLinear');
Compute the maximum delays for each output variable individually.
Del = getDelayInfo(M,'channelwise')
Del = 2×5 2 0 2 1 0 1 0 1 5 0
Del contains the maximum delays for the first and second output of model
M. You can interpret the contents of matrix
Del as follows:
In the dynamics for output 1 (), the maximum delays in channels , , , , are 2, 0, 2, 1, and 0 respectively.
Similarly, in the dynamics for output 2 () of the model, the maximum delays in channels , , , , are 1, 0, 1, 5, and 0 respectively.
Find maximum delays for all the input and output variables in the order , , , , .
Del = getDelayInfo(M,'all')
Del = 1×5 2 0 2 5 0
Note, The maximum delay across all output equations can be obtained by executing
MaxDel = max(Del,,1). Since input has 5 delays (the fourth entry in
Del), there are 5 terms corresponding to in the state vector. Applying this definition to all I/O channels, the complete state vector for model