Creating a MIMO transmission system (with multiple inputs with multiple outputs) without hard coding the number of inputs and outputs

Introduction
As part of a larger system, I am trying to create a multiple input multiple input function that only connects inputs to outputs diagonally. That is, it has non-zero transfer functions between input 1 and output 1, input 2 and output 2, etc. etc.

* Do you really think that since the MIMO system is an honest comment, I want it to be in this format because it refers to a larger system, which is really MIMO.

Hard coding
I can achieve this by combining the transfer functions so

tf1=tf([1 -1],[1 1]); tf2=tf([1 2],[1 4 5]); tf3=tf([1 2],[5 4 1]); G=[tf1 0 0; 0 tf2 0; 0 0 tf3]; 

Which works well, but (a) hard codes for the number of inputs / outputs and (b) becomes more terrible as more inputs and outputs.

Diag Function
This problem seemed ideal for the diag function, however diag does not seem to be defined for type 'tf'

 G=diag([tf1, tf2, tf3]) ??? Undefined function or method 'diag' for input arguments of type 'tf'. 

Manual manipulation
I also tried to manually manipulate the matrix (not what I really expected it to work)

 G=zeros(3); G(1,1)=tf1; G(2,2)=tf2; G(3,3)=tf3; ??? The following error occurred converting from tf to double: Error using ==> double Conversion to double from tf is not possible. 

tf directly in MIMO format
tf also has a format in which all numerators and denominators are presented separately, and a MIMO system is created directly. I tried using this in a non-hard coded format

 numerators=diag({[1 -1], [1 2],[1 2]}) denominators=diag({[1 1], [1 4 5],[5 4 1]}) G=tf( numerators , denominators ) ??? Error using ==> checkNumDenData at 19 Numerators and denominators must be specified as non empty row vectors. 

This one almost worked, unfortunately, the numerators and denominators are empty on the diagonal, not 0; leading to an error

Question
Is it possible to create a MIMO system from transfer functions without "hard coding" the number of inputs and outputs

+4
source share
2 answers

I suggest you try to implement each SISO as a state space system, say (Ak, Bk, Ck, Dk) , assemble a large diagonal system, for example

 A = blkdiag(A1,....) B = blkdiag(B1,...) C = blkdiag(C1,...) D = diag([D1, ....]) 

and then use ss2tf to calculate the transfer function of the extended system.

+2
source

diag in matlab does not match blkdiag . The overloaded LTI operator is blkdiag to put things diagonally on the matrix structure.

In your case, this is done simply

 tf1=tf([1 -1],[1 1]); tf2=tf([1 2],[1 4 5]); tf3=tf([1 2],[5 4 1]); G = blkdiag(tf1,tf2,tf3) 

The MIMO syntax requires cells to distinguish polynomial entries from the MIMO structure. Moreover, he does not like entries with a zero denominator (which is understandable), therefore, if you want to enter the by-context, you need to use

 G = tf({[1 -1],0,0;0,[1 2],0;0,0,[1 2]},{[1 1],1,1;1,[1 4 5],1;1,1,[5 4 1]}) 

or in your syntax

 Num = {[1 -1],0,0;0,[1 2],0;0,0,[1 2]}; Den = {[1 1],1,1;1,[1 4 5],1;1,1,[5 4 1]}; tf(Num,Den) 

Instead, you can basically use any valid non-zero entries.

0
source

Source: https://habr.com/ru/post/1494314/


All Articles