Building LTI Arrays

Ways to Build LTI Arrays

There are several ways to build LTI arrays:

In addition, you can use the command rss to generate LTI arrays of random state-space models.

Building LTI Arrays Using for Loops

Consider the following second-order SISO transfer function that depends on two parameters, and

Suppose, based on measured input and output data, you estimate confidence intervals , and for each of the parameters, and . All of the possible combinations of the confidence limits for these model parameter values give rise to a set of four SISO models.

Four LTI Models Depending on Two Parameters

You can arrange these four models in a 2-by-2 array of SISO transfer functions called H.

The LTI Array H

Here, for , represents the transfer function

corresponding to the parameter values and .

The first two colon indices ( ) select all I/O channels from the I/O dimensions of H. The third index of H refers to the first array dimension ( ), while the fourth index is for the second array dimension ( ).

Suppose the limits of the ranges of values for and are [0.66,0.76] and [1.2,1.5], respectively. Enter these at the command line.

zeta = [0.66,0.75];
w = [1.2,1.5];

Since the four models have the same parametric structure, it's convenient to use two nested for loops to construct the LTI array.

for i = 1:2
  for j = 1:2
    H(:,:,i,j) = tf(w(j)^2,[1 2*zeta(i)*w(j) w(j)^2]);
  end
end

H now contains the four models in a 2-by-2 array. For example, to display the transfer function in the (1,2) position of the array, type

H(:,:,1,2)

Transfer function:
       2.25
-------------------
s^2 + 1.98 s + 2.25

For the purposes of efficient computation, you can initialize an LTI array to zero, and then reassign the entire array to the values you want to specify. The general syntax for zero assignment of LTI arrays is

To initialize H in the above example to zero, type

H = tf(zeros(1,1,2,2));

before you implement the nested for loops.

Building LTI Arrays Using the stack Function

Another way to build LTI arrays is using the function stack. This function operates on single LTI models as well as LTI arrays. It concatenates a list of LTI arrays or single LTI models only along the array dimension. The general syntax for stack is

stack(Arraydim,sys1,sys2...)

where

When you concatenate several models or LTI arrays along the jth array dimension, such as in

stack(j,sys1,sys2,...,sysn)

For example, if two TF models sys1 and sys2 have the same number of inputs and outputs,

sys = stack(1,sys1,sys2) 

concatenates them into a 2-by-1 array of models.

There are two principles that you should keep in mind:

Here's an example of how to build the LTI array H using the function stack.

% Set up the parameter vectors.

zeta = [0.66,0.75];
w = [1.2,1.5];

% Specify the four individual models with those parameters.
%
H11 = tf(w(1)^2,[1 2*zeta(1)*w(1) w(1)^2]);
H12 = tf(w(2)^2,[1 2*zeta(1)*w(2) w(2)^2]);
H21 = tf(w(1)^2,[1 2*zeta(2)*w(1) w(1)^2]);
H22 = tf(w(2)^2,[1 2*zeta(2)*w(2) w(2)^2]);

% Set up the LTI array using stack.

COL1 = stack(1,H11,H21); % The first column of the 2-by-2 array
COL2 = stack(1,H12,H22); % The second column of the 2-by-2 array
H = stack(2, COL1, COL2); % Concatenate the two columns of models.

Notice that this result is very different from the single MIMO LTI model returned by

H = [H11,H12;H21,H22];

Accessing LTI Arrays of Variable Order

For arrays of state-space models with variable order, you cannot use the dot operator (e.g., sys.a) to access arrays. Use the syntax

[a,b,c,d] = ssdata(sys,'cell')

to extract the state-space matrices of each model as separate cells in the cell arrays a, b, c, and d.

Building LTI Arrays Using tf, zpk, ss, and frd

You can also build LTI arrays using the tf, zpk, ss, and frd constructors. You do this by using multidimensional arrays in the input arguments for these functions.

Specifying Arrays of TF models Using tf

For TF models, use

sys = tf(num,den)

where

See MIMO Transfer Function Models for related information on the specification of single TF models.

Specifying Arrays of ZPK Models Using zpk

For ZPK models, use

sys = zpk(zeros,poles,gains)

where

Specifying Arrays of SS Models Using ss

To specify arrays of SS models, use

sys = ss(a,b,c,d)

where a, b, c, and d are real- or complex-valued multidimensional arrays of appropriate dimensions. All models in the resulting array of SS models have the same number of states, outputs, and inputs.

The Size of LTI Array Data for SS Models

The size of the model data for arrays of state-space models is summarized in the following table.

Data

Size (Data)

a

b

c

d

where

Specifying Arrays of FRD Models Using frd

To specify a K-dimensional array of p-output, m-input FRD models for which are the lengths of the array dimensions, use

sys = frd(response,frequency,units)

where

Note that for specifying an LTI array of SISO FRD models, response can also be a multidimensional array of 1-by-n matrices whose remaining dimensions determine the array dimensions of the FRD.

Generating Random LTI Arrays Using rss

A convenient way to generate arrays of state-space models with the same number of states in each model is to use rss. The syntax is

rss(N,P,M,sdim1,...,sdimk)

where

For example, to create a 4-by-2 array of random state-space models with three states, one output, and one input, type

sys = rss(3,2,1,4,2);
size(sys)

4x2 array of continuous-time state-space models
Each model has 2 outputs, 1 input, and 3 states.
  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS