feedback(s​ys1,sys2,f​eedin,feed​out) MAYBE incorrect

6 views (last 30 days)
>>sys=[tf(1,[1 1 0]) tf(1,[1 1 0])]
sys =
From input 1 to output:
1
-------
s^2 + s
From input 2 to output:
1
-------
s^2 + s
ITS OK, BUT
>>sysf = feedback(sys,10,1,1)
sysf =
From input 1 to output:
1
------------
s^2 + s + 10
From input 2 to output:
1
------------
s^2 + s + 10
WHY NOT SO AS
From input 2 to output:
1
-------
s^2 + s

Answers (2)

Paul
Paul on 12 Nov 2020
It is correct. The plant model, sys, can be written algebraically as:
Y(s) = G1(s)*U1(s) + G2(s)*U2(s)
where G1(s) = G2(s) = 1/(s^2 + s)
Algebraically, the feedback command implements:
U1(s) = R1(s) - 10*Y(s)
Substitute:
Y(s) = G1(s)*(R1(s) - 10*Y(s)) + G2(s)*U2(s)
Solve:
Y(s) = G1(s)/(1+10*G1(s))*R(s) + G2(s)/(1 + 10*G1(s))*U2(s)
So we have
sysf = [G1(s)/(1 + 10*G1(s)) G2(s)/(1 + 10*G1(s))]
which is exactly the result you obtained from the feedback command (because G1(s) == G2(s))
  2 Comments
Gennady
Gennady on 13 Nov 2020
This is not entirely correct from the standpoint of control theory. Often (for example, when plotting a step response), it is necessary to analyze the response to each input separately without summation. In this case, there will be an error.
Paul
Paul on 13 Nov 2020
Edited: Paul on 14 Nov 2020
It is entirely correct from the standpoint of control theory.
The summation is inherent in your definition of sys. You defined sys as 1 x 2 transfer function matrix. In other words, the input/output relationship defined by sys is:
Y(s) = [G1(s) G2(s)] * [U1(s) ; U2(s)] % row x column
which is exactly what I wrote in my answer. If you don't want the summation and would rather keep the outputs of G1 and G2 separate, you need a different transfer function matrix, perhaps:
sys = tf(1,[1 1 0])*eye(2)
which is a 2x2, diagonal transfer function matrix. Then you get the result you were expecting:
>> sysf = feedback(sys,10,1,1)
sysf =
From input 1 to output...
1
1: ------------
s^2 + s + 10
2: 0
From input 2 to output...
1: 0
1
2: -------
s^2 + s
Continuous-time transfer function.
Though in this case you're representing a decoupled system with two inputs and two outputs; hence, the zeros from u1 to y2 and from u2 to y1.
If, instead of a single 2 x 2 system, you really want to be able to operate simultaneously on more than one SISO system, you should look into Tunable Models and Model Arrays.

Sign in to comment.


Gennady
Gennady on 16 Nov 2020
Thanks for the answer! A little clarification, if I may. Did I understand correctly that in MATLA CST the following two schemes are equivalent.
And what do you advise me to use in my case the third scheme
  2 Comments
Paul
Paul on 16 Nov 2020
Those three are all different systems and all require different calculations to compute the input/output relationsship, which in all cases should be a 1 x 2 transfer function matrix (2 inputs, 1 output). Also, in picture #2 you should mark that input as R2, and keep U2 as the input to G2.
Because they are simple examples, the transfer function matrix can be written by inspection, which we can compare to using commands like feedback etc. We will assume that all of the feedback paths are negative feedback (not shown explicilty in your diagrams) and that in case 1 and case 2 the output Y is the sum of the outputs from G1 and G2 respectively.
Case 1:
>> G1 = tf(1,[1 1 0]);G2 = tf(2,[1 1 0]);
>> sys = [G1 G2];
>> sysf = feedback(sys,10,1,1)
sysf =
From input 1 to output:
1
------------
s^2 + s + 10
From input 2 to output:
2
------------
s^2 + s + 10
Continuous-time transfer function.
>> [minreal(G1/(1 + 10*G1)) minreal(G2/(1 + 10*G1))] % by inspection
ans =
From input 1 to output:
1
------------
s^2 + s + 10
From input 2 to output:
2
------------
s^2 + s + 10
Continuous-time transfer function.
Case 2:
>> sys=[G1 G2];
>> sysf = feedback(sys,[10;10])
sysf =
From input 1 to output:
1
------------
s^2 + s + 30
From input 2 to output:
2
------------
s^2 + s + 30
Continuous-time transfer function.
>> [minreal(G1/(1+10*G1+10*G2)) minreal(G2/(1+10*G1+10*G2))] % by inspection
ans =
From input 1 to output:
1
------------
s^2 + s + 30
From input 2 to output:
2
------------
s^2 + s + 30
Continuous-time transfer function.
Case 3:
>> sysf=series(feedback(append(G1,G2),10,1,1),[1 1])
sysf =
From input 1 to output:
1
------------
s^2 + s + 10
From input 2 to output:
2
-------
s^2 + s
Continuous-time transfer function.
>> [feedback(G1,10) G2]
ans =
From input 1 to output:
1
------------
s^2 + s + 10
From input 2 to output:
2
-------
s^2 + s
Continuous-time transfer function.
The "by inspection" computations use transfer function algebra, which is generally not recommended, though can come in handy for simple cases and for learning. Instead, use the model interconnection functions like feedback, etc., discussed here.

Sign in to comment.

Tags

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!