Help using symbolic transfer function

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);

답변 (1개)

Paul
Paul 2021년 3월 1일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

질문:

2021년 3월 1일

답변:

2021년 3월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by