# How do I get the transfer functions in a MIMO transfer matrix in Matlab

46 views (last 30 days)
Flavio Clarizia on 25 Feb 2020
Edited: Flavio Clarizia on 28 Feb 2020
Suppose I have defined the state space matrices A,B,C,D, and with these I define a plant as:
plant = ss(A,B,C,D)
Now, Iave a plant in state space defined as:
Now, suppose that I am considering a MIMO system, so B is a matrix. If I have 4 input and 6 outputs, which are:
and
which are respectively the output and input vector. What I want to do is to obtain the transfer from the first two input to the firat two outputs using Matlab.
For example I am trying to do things like G(1,1) or G(3,4), but I am not sure what I am getting like this. The reason why I am trying to do this is to solve this problem: https://www.mathworks.com/matlabcentral/answers/507057-problem-defining-generalized-plant-in-matlab?s_tid=prof_contriblnk, but I am having some troubles doing this.

Aquatris on 25 Feb 2020
Once you obtain the system model G, you can call any input-output pairs as you like as if you are dealing with matrices.
outputIndex = [1 4 6]; % want to have 1st 4th and 6th output
inputIndex = [2 3]; % want to have the 2nd and 3rd output
sys = plant(outputIndex, inputIndex); % system that has identical
% dynamics to G and has only
% the desired input-output pairs
When you call the plant(i,j) in MATLAB, i represents the output index and j represents the input index.
In your example G(1,1) gives you the dynamics from 1st input to 1st output whereas G(3,4) gives you the dynamics from 4th input to 3rd output. If you want to close the loop using a subset of input-output pairs but still want to have access to all the channels, "feedback()" function gives you the option to define those channels.

Flavio Clarizia on 25 Feb 2020
Thanks for answering. I have tried to do this:
%create the generalized plant
systemnames = ' W_px W_pu W_d W_theta G ';
inputvar = '[d1; d2; theta1; theta2; u1; u2]';
outputvar = '[W_px; W_pu; W_theta+W_d+G(1,2)]';
input_to_W_px = '[W_theta+W_d+G(1,2)]';
input_to_W_pu = '[u1; u2]';
input_to_W_d = '[d1; d2]';
input_to_W_theta = '[theta1; theta2]';
input_to_G = '[W_theta;W_d;u1; u2]';
cleanupsysic = 'yes';
Plant = sysic;
So, for what I have understand, in my case I should have:
but I am really having problems doing this with Matlab, and I have been on this problem for a lot of time without solving nothing. Do you think my approch is correct? Honestly I am not sure of what I have done and I think is wrong honestly.
Do you have any idea on what I am doing wrong?
Aquatris on 28 Feb 2020
I have not used the sysic functionality. Thats why I cant say.
However I used hinfsyn function and for that I always create my system with exogenous inputs as first inputs and control input as last, and performance outputs as first outputs and sensor outputs as last, as standard in hinfinity control problem formulation, while putting the system in state space form. Then I define the weights for inputs and outputs as
Win = append(W1,W2,W3,eye(n)) % assuming 3 exogenous input channels and n control inputs
and similarly for outputs (identity for control input and sensor output channels). Once weights are defined, I create the weighted plant model as
P = Wout*sys*Win
Once the weighted plant P is defined, hinfsyn function can be called.
I hope this helps a bit.
Flavio Clarizia on 28 Feb 2020
Thank you for answering. I will try.