I am trying to use Mathematica's TransferFunctionModel object and SystemsModelFeedbackConnect function to approach the following coupled control problem

A conceptual block flow diagram

A version of the above BFD that looks like the code is below.

A programmatical block flow diagram

I make use of SystemsModelFeedbackConnect. It is not possible to link any output to any input, but that they must be the same index. It also isn't possible to specify the feedback type of the output of system 1 to input of system 2 but it is possible to specify the feedback type of the output of system 2 to the input of system 1. I am under the impression that with the below I get away with the problem, assuming that the output of system 1 to input of system 2 is negative feedback and changing the sign on the matrix accordingly. But the system is divergent.

g11 = 3./(2. s + 1);
g12 = -10.;
g21 = 1/(s^2 + 3. s + 2.);
g22 = 4./((s + 1) (3. s + 1));
gc11 = kc11 (1 + 1/(tI11 s));
gc22 = kc22 (1 + 1/(tI22 s));
kc11 = 0.1; kc22 = 0.1; tI11 = 0.1; tI22 = 0.1;
sys1TF = TransferFunctionModel[{{gc11 g11 , g12}, {-gc11, -0}}, (* negative due to forced negative feed back *)
  s]; (* input 1 is e1, input 2 is u2, output 1 is y1, output 2 is u1 *)
sys2TF = TransferFunctionModel[{{gc22 g22, g21}, {gc22, 0}}, 
  s]; (* input 1 is e2, input 2 is u1, output 1 is y2, output 2 is u2 *)
recSys1TF = 
  sys1TF, {1, 1, 
   "Negative"}]; (* only recycle the first output to the first input *)

recSys2TF = 
  sys2TF, {1, 1, 
   "Negative"}]; (* only recycle the first output to the first input *)

totalTF = SystemsModelFeedbackConnect[recSys1TF, recSys2TF,
  {2}, (* 
  connect output 2 of system 1 to input 2 of system 2 by negative 
feedback *)
  {{2, "Positive"}} (* 
  connect output 2 of system 2 to input 2 of system 1 by addition*)

The current formulation may either be outright incorrect or just extremely unstable due to the high order of the transfer function model. The question I have is, why can only pairs of index corresponding inputs and outputs can be fed? Looking at SystemsModelStateFeedbackConnect it is possible to connect any input to any output. Is this a result of a limitation of the TransferFunctionModel in contrast to the StateSpaceModel?

  • $\begingroup$ For what I understand the help of SystemsModelFeedbackConnectyou're connecting output2 of recSys1 with input1 of recSys2 (positive feedback, as in the image in the detail section, and no further input from outside), and you're connecting output1 of recSys2 with input2 of recSys1, positive feedback. It's like in your picture. I think youre picture does not match your comments in the code. But that's just how I understood the help section. $\endgroup$
    – Phab
    Commented Mar 14, 2017 at 13:48

1 Answer 1


It's not an answer, but this way I can show with some image, how I unterstood the help of SystemsModelFeedbackConnect.

It's all about this section: enter image description here



I connect my systems like in the following picture: enter image description here

D to G, C to H (no additional input at G and H, and no choice of feedback),

and F to A (positive) and E to B (negative). There are no additional outputs at E and F.

Your resulting system is 2x2.

What you were trying was something like


You might would expect 3 outputs and 3 inputs, because you only connected just one of them to the other. But the dimensions of this resulting system are 2x2, too.

But it could be I totaly missunterstood the whole thing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.