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

8 visualizaciones (últimos 30 días)
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);

Respuestas (2)

madhan ravi
madhan ravi el 28 de Dic. de 2018
Editada: madhan ravi el 28 de Dic. de 2018

Walter Roberson
Walter Roberson el 28 de Dic. de 2018
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.

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Productos


Versión

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by