How can I represent a transfer function interms of symbolic variables? Apparently tf(num, den) can only take numeric values.

조회 수: 9 (최근 30일)
How can I represent a transfer function interms of symbolic variables. Apparently tf(num, den) can only take numeric values. I have also tried sym2poly() function, but that also generates errors.
syms theta(t) J b r I l B L F phi
theta_p = diff(theta, t);
theta_pp = diff(theta, t, 2);
func = J*theta_pp + b*theta_p - 2*r*I*l*B == -L*F*sin(phi);
Sol = dsolve(func, theta(0)==0, theta_p(0)==0);
TF = laplace(Sol)
%pretty(TF);
[symNum,symDen] = numden(TF) %Get num and den of Symbolic TF *****all is good untill this point****
%TFnum = sym2poly(symNum) %Convert Symbolic num to polynomial
% TFden = sym2poly(symDen); %Convert Symbolic den to polynomial
% ans =tf(TFnum,TFden);

답변 (2개)

madhan ravi
madhan ravi 2018년 12월 28일
편집: madhan ravi 2018년 12월 28일

Walter Roberson
Walter Roberson 2018년 12월 28일
syms theta(t) J b r I l B L F phi s
theta_p = diff(theta, t);
theta_pp = diff(theta, t, 2);
func = J*theta_pp + b*theta_p - 2*r*I*l*B == -L*F*sin(phi);
Sol = dsolve(func, theta(0)==0, theta_p(0)==0);
TF = laplace(Sol)
[symNum,symDen] = numden(simplify(TF)) %Get num and den of Symbolic TF
NumCoeff = coeffs(symNum,s,'all');
DenCoeff = coeffs(symDen,s,'all');
The transfer function would then logically be tf(NumCoeff, DenCoeff)
But only logically. The Control System Toolbox does not support symbolic coefficients.
The Control System Toolbox does support tuneable systems. See the discussion at https://www.mathworks.com/matlabcentral/answers/305339-how-to-create-a-transfer-function-with-gain-k#answer_236890 . These are not symbolic coefficients.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by