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);
댓글 수: 0
답변 (2개)
madhan ravi
2018년 12월 28일
편집: madhan ravi
2018년 12월 28일
Might help :
Note: sin is noticed in your equation so sym2poly cannot be used.
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!