How can I represent a transfer function interms of symbolic variables? Apparently tf(num, den) can only take numeric values.
11 ビュー (過去 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!