How does the division operator work with transfer function objects?
31 ビュー (過去 30 日間)
I am new to MATLAB so I apologize if the answer to this is obvious: I was under the impression that since the * operator is overloaded to perform multiplication with transfer functions, the / operator might, likewise, perform division. I tried dividing to obtain the closed loop using the / operator but that gave me erroneous results. The right way, apparently, is to use the function called 'feedback', which works as expected. So I was wondering what the / operator does on tf objects. Any help is appreciated. Thanks!
G = tf([1 2], [3 4 5]) % open loop TF
H = 1;
k = 10;
T = k*G/(1 + k*G*H) % closed lopp TF (wrong)
T = feedback(k*G, H) % closed loop TF (correct)
Paul 2021 年 12 月 28 日
Let's solve a simpler problem "by-hand" using the zpk format to see what's happening.
Define the plant model:
G = zpk([-1],[-2 -3],1)
We want to find the closed loop transfer function H = G/(1 + G)
oneplusG = 1 + G
After clearing the fractions H = G/(1 + G) will end up with (s+2)(s+3) in both the numerator and denominator of H
H = G/oneplusG
H = G/(1 + G)
Now, if you're doing this by hand, you would probalby decide to cancel the common terms in the numerator and denominator, but Matlab won't do that unless you tell it to do so, using a function like minreal().
The feedback() function works differently and does not result in the apparent, common pole/zero pairs that result from the algebraic manipulations
H = feedback(G,1)
which is the same results as above after cancelling the common terms.
Futhermore, feedback() is smart enough to not cancel common pole/zero pairs should there be any in G to begin with.
G = zpk([-1 -4],[-2 -3 -4],1)
H = feedback(G,1)
Here, the pole/zero at s = -4 is inherent to the system and so remains in H.