Discrepancy between using function 'feedback()' and calculating manually

7 ビュー (過去 30 日間)
Christopher
Christopher 2011 年 4 月 5 日
Hello,
I am working with MIMO systems and have made a comparison between the results obtained using the Matlab function 'feedback()' and computing the closed loop transfer function 'by hand'. There are differences between them I don't understand.
The code below illustrates the issue. I define a forward path array of transfer functions G and close the loop with K in the feedback path.
To compute the feedback manually I calculate CL = G/(I+K*G).
If you run this code fragment you will see that 'cl1' and 'cl2' do not agree. I don't understand why not. Can anyone enlighten me please?
Thanks,
Chris
g11 = tf(1,[1 0]);
g12 = tf(2,[1 0]);
g21 = tf(3,[1 0]);
g22 = tf(4,[1 0]);
G = [g11 g12;g21 g22];
k = 2;
K = [k 0;0 0];
cl1 = feedback(G,K,-1)
I = eye(2);
cl2 = G / (I + K*G)

採用された回答

Paul
Paul 2011 年 4 月 5 日
cl2 can be simplfied by canceling s out of the numerator and denominator of each entry. After that you'll see that cl2 and cl1 are the same to within some roundoff. Or are you concerned about the roundoff?
  3 件のコメント
Paul
Paul 2011 年 4 月 6 日
For most intents and purposes, the Bode plots are identical except at very, very low frequencies. The biggest discrepancy is in the (1,2) term and arises because of that phantom zero at 4.4e-16. If the difference at those freuqencies is an issue, then do as Arnaud suggested and take the minreal of both. But note that
isequal(minreal(cl1),minreal(cl2)) will still evaluate to false because of the roundoff errors.
Christopher
Christopher 2011 年 4 月 7 日
Thank you, your explanation is clear and helpful. Much appreciated.
Chris

サインインしてコメントする。

その他の回答 (2 件)

Arnaud Miege
Arnaud Miege 2011 年 4 月 6 日
Use minreal on both and you'll get the same answer:
g11 = tf(1,[1 0]);
g12 = tf(2,[1 0]);
g21 = tf(3,[1 0]);
g22 = tf(4,[1 0]);
G = [g11 g12;g21 g22];
k = 2;
K = [k 0;0 0];
I = eye(2);
cl1 = minreal(feedback(G,K,-1));
cl2 = minreal(G / (I + K*G));
bode(cl1,cl2)
HTH,
Arnaud
  1 件のコメント
Christopher
Christopher 2011 年 4 月 7 日
Thank you, Arnaud - very helpful.
Chris

サインインしてコメントする。


Walter Roberson
Walter Roberson 2011 年 4 月 5 日
I don't have whichever toolbox you are using, but if you were to indicate the outputs possibly I might have some ideas.
Have you read the numeric FAQ
  1 件のコメント
Christopher
Christopher 2011 年 4 月 5 日
Hello, I am using the Control toolbox (which contains 'feedback()'.
Here is the output of the script:
Transfer function from input 1 to output...
1
#1: -----
s + 2
3
#2: -----
s + 2
Transfer function from input 2 to output...
2 s + 4.441e-016
#1: ----------------
s^2 + 2 s
4 s - 4
#2: ---------
s^2 + 2 s
Transfer function from input 1 to output...
s
#1: ---------
s^2 + 2 s
3 s
#2: ---------
s^2 + 2 s
Transfer function from input 2 to output...
2 s^2
#1: -----------
s^3 + 2 s^2
4 s^2 - 4 s
#2: -----------
s^3 + 2 s^2
The transfer functions should match, and they do not.
I'm afraid I have not read the FAQ, but I will.
Thank you,
Chris

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGet Started with Control System Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by