Writing transfer function with auxiliary constant in the correct way
Show older comments
clc;
clear;
num1 = {1, 1, 1, 1, 1, 1, 1};
num2 = {-4, -4, -4, -4, -4, -4, -4};
den1 = {[10 1], [10 1], [10 1], [10 1], [10 1], [10 1], [10 1]};
den2 = {[15 1], [15 1], [15 1], [15 1], [15 1], [15 1], [15 1]};
Gp= tf(num1,den1, 'IODelay', [3 4 5 6 7 8 9]);
Gp = minreal(Gp);
Gd= tf(num2,den2, 'IODelay', [3 4 5 6 7 8 9]);
Gd = minreal(Gd);
a=(3:1:9);
kc=(5./(0.8.*a));
Ti=10;
s = tf('s');
Gc = kc*(1/(1/10*s));
Gc=minreal(Gc);
K = Gc.*Gp;
KK = ((1+(Gc.*Gp))); % auxiliary variable
Gc_a = tf(Gc.*Gp,KK) %apply the transfer function to convert coefficients from statespace
Suppose I want another function which will be identical to Gc_a but will have 1 in the numerator instead of Gc.*Gp. How to do that? If I just delete that factor and replace it with the number 1 the response becomes a straight line and the denominator becomes 1 as well.
1 Comment
num1 = {1, 1, 1, 1, 1, 1, 1};
num2 = {-4, -4, -4, -4, -4, -4, -4};
den1 = {[10 1], [10 1], [10 1], [10 1], [10 1], [10 1], [10 1]};
den2 = {[15 1], [15 1], [15 1], [15 1], [15 1], [15 1], [15 1]};
Gp= tf(num1,den1, 'IODelay', [3 4 5 6 7 8 9]);
Gp = minreal(Gp);
Gd= tf(num2,den2, 'IODelay', [3 4 5 6 7 8 9]);
Gd = minreal(Gd);
a=(3:1:9);
kc=(5./(0.8.*a));
Ti=10;
s = tf('s');
Gc = kc*(1/(1/10*s));
Gc=minreal(Gc);
K = Gc.*Gp;
KK = ((1+(Gc.*Gp))); % auxiliary variable
I'm not sure what you're trying to do on this line
Gc_a = tf(Gc.*Gp,KK); %apply the transfer function to convert coefficients from statespace
Actually, I'm suprised it doesn't throw an error. According to the doc page, tf isn't supposed to accept a tf input as the first input and an ss object as the second, which is the case here
class(Gc.*Gp)
class(KK)
And the result of that call just returns the first input, which I doubt is the desired result
Gc_a - Gc.*Gp
Can you explain a bit more what the goal actually is? I doubt that the approach of using transfer function matrices is appropriate, but can't know for sure without more context of what this code is supposed to be doing.
Answers (0)
Categories
Find more on Dynamic System Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!