Help using symbolic transfer function
32 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm trying to use the feedback function to determine the closed loop transfer function of a given system. The system has two variables K1 and K2. The 'G' in the feedback function would be: . I read a ton of posts on here stating that you can't use symbolic variables in the tf function, but I didn't see any one mention a way around it. Here is my code:
syms K1
syms K2
K = 6;
G = tf([K1*K2], [1 -3 -4]);
H1 = feedback(G,K);
0 commentaires
Réponses (1)
Paul
le 1 Mar 2021
Can do it by hand, at least for this simple case:
>> syms K1 K2 K real
>> syms s
>> K = sym(6);
>> G(s) = K1*K2/(s^2 - 3*s -4);
>> H1(s) = G/(1+G*K)
H1(s) =
(K1*K2)/(((6*K1*K2)/(- s^2 + 3*s + 4) - 1)*(- s^2 + 3*s + 4))
>> H1(s) = simplify(H1(s))
H1(s) =
-(K1*K2)/(- s^2 + 3*s - 6*K1*K2 + 4)
I'm not sure why the SMT prefers to put a negative sign on the numerator and on the leading coefficient of the denominator. It proved surprisingly difficult to change that. Also, check this comment for an approach to convert the result into a tf object after you substitute values for K1 and K2.
0 commentaires
Voir également
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!