MIMO Model Creation How to create multi-input, multi-output (MIMO) models. On this page…
MIMO Transfer Function Model MIMO State-Space Model MIMO Descriptor State-Space Model MIMO Frequency Response Data Model Select Input/Output Pairs in MIMO Models
MIMO Transfer Function Model This example show s how to create a multi-input, multi-output (MIMO) transfer function model by concatenating single-input, singleoutput (SISO) transfer function models. To create the one-input, tw o-output MIMO transfer function:
perform the follow ing steps: 1. Create SISO transfer functions for each channel. g11 = tf([1 -1],[1 1]); g21 = tf([1 2],[1 4 5]);
Tip Use zpkinstead of tfto create MIMO transfer functions in factorized form. 2. Concatenate the transfer functions. G = [g11; g21]; More About
MIMO State-Space Model This example show s how to create a MIMO state-space model using ss. You create a MIMO state-space model in the same w ay as you create a SISO state-space model. The only difference betw een the SISO and MIMO cases is the dimensions of the state-space matrices. The dimensions of the B, C, and D matrices increase w ith the numbers of inputs and outputs as show n in the follow ing illustration.
In this example, you create a state-space model for a rotating body w ith inertia tensor J, damping force F, and three axes of rotation, related as:
The system input T is the driving torque. The output y is the vector of angular velocities of the rotating body. To express this system in state-space form:
rew rite it as:
Then the state-space matrices are:
To create this model, enter the follow ing commands: J = [8 -3 -3; -3 8 -3; -3 -3 8]; F = 0.2*eye(3); A = -J\F; B = inv(J); C = eye(3); D = 0: sys_mimo = ss(A,B,C,D); These commands assume that J is the inertia tensor of a cube rotating about its corner, and the damping force has magnitude 0.2. sys_mimois an ssmodel. More About
MIMO Descriptor State-Space Model
This example show s how to create a continuous-time descriptor (implicit) state-space model using dss. Note: This example uses the same rotating-body system show n in MIMO State-Space Model, w here you inverted the inertia matrix J to obtain the value of the B matrix. If J is poorly-conditioned for inversion, you can instead use a descriptor (implicit) state-space model. A descriptor (implicit) state-space model is of the form:
Create a state-space model for a rotating body w ith inertia tensor J, damping force F, and three axes of rotation, related as:
The system input T is the driving torque. The output y is the vector of angular velocities of the rotating body. You can w rite this system as a descriptor state-space model having the follow ing state-space matrices:
To create this system, enter: J = [8 -3 -3; -3 8 -3; -3 -3 8]; F = 0.2*eye(3); A = -F; B = eye(3); C = eye(3); D = 0; E = J; sys_mimo = dss(A,B,C,D,E) These commands assume that J is the inertia tensor of a cube rotating about its corner, and the damping force has magnitude 0.2. sysis an ssmodel w ith a nonempty E matrix. More About
MIMO Frequency Response Data Model This example show s how to create a MIMO frequency-response model using frd. Frequency response data for a MIMO system includes a vector of complex response data for each of the input/output (I/O) pair of the system. Thus, if you measure the frequency response of each I/O pair your system at a set of test frequencies, you can use the data to create a frequency response model: 1. Load frequency response data in AnalyzerDataMIMO.mat. load AnalyzerDataMIMO H11 H12 H21 H22 freq This command loads the data into the MATLAB® w orkspace as five column vectors H11, H12, H21, H22, and freq. The vector freqcontains 100 test frequencies. The other four vectors contain the corresponding complex-valued frequency response of each I/O pair of a tw o-input, tw o-output system. Tip To inspect these variables, enter: whos H11 H12 H21 H22 freq 2. Organize the data into a three-dimensional array. Hresp = zeros(2,2,length(freq)); Hresp(1,1,:) = H11;
Hresp(1,2,:) = H12; Hresp(2,1,:) = H21; Hresp(2,2,:) = H22; The dimensions of Hrespare the number of outputs, number of inputs, and the number of frequencies for w hich there is response data. Hresp(i,j,:)contains the frequency response from input jto output i. 3. Create a frequency-response model. H = frd(Hresp,freq); sysis an frdmodel object, w hich is a data container for representing frequency response data. You can use frdmodels w ith many frequency-domain analysis commands. For example, visualize the response of this tw o-input, tw o-output system using bode. Tip By default, the frdcommand assumes that the frequencies are in radians/second. To specify different frequency units, use the TimeUnitand FrequencyUnitproperties of the frdmodel object. For example: sys = frd(Hresp,freq,'TimeUnit','min','FrequencyUnit','rad/TimeUnit') sets the frequency units to in radians/minute. More About
Select Input/Output Pairs in MIMO Models This example show s how to select the response from the first input to the second output of a MIMO model. 1. Create a tw o-input, one-output transfer function. N = {[1 -1],[1];[1 2],[3 1 4]}; D = [1 1 10]; H = tf(N,D)
Note: For more information ing cell arrays to create MIMO transfer functions, see the tfreference page. 2. Select the response from the second input to the output of H. To do this, use MATLAB array indexing. H12 = H(1,2) For any MIMO system H, the index notation H(i,j)selects the response from the jth input to the ith output.