Writing transfer function with auxiliary constant in the correct way

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 commentaire

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)
ans = 'tf'
class(KK)
ans = 'ss'
And the result of that call just returns the first input, which I doubt is the desired result
Gc_a - Gc.*Gp
ans = From input 1 to output: 0 From input 2 to output: 0 From input 3 to output: 0 From input 4 to output: 0 From input 5 to output: 0 From input 6 to output: 0 From input 7 to output: 0 Continuous-time transfer function.
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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

Produits

Version

R2021b

Commenté :

le 11 Nov 2021

Community Treasure Hunt

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

Start Hunting!

Translated by