matlab - How to separate the real and imaginary parts of a transfer function? -
here transfer function:
s = [tf([10 2 4],[1 95 2000 3450])]; how can real(s) , imag(s)?
it sounds want fourier form of transfer function. far know, there's no builtin function you'll need use symbolic math:
num = [10 2 4]; den = [1 95 2000 3450]; syms s; syms omega real; % define real-valued f1 = poly2sym(num,s)/poly2sym(den,s) f2 = subs(f1,s,1i*omega) f2_real = simplify(real(f2)) f2_imag = simplify(imag(f2)) which returns
f1 = (10*s^2 + 2*s + 4)/(s^3 + 95*s^2 + 2000*s + 3450) f2 = (- 10*omega^2 + omega*2i + 4)/(- omega^3*1i - 95*omega^2 + omega*2000i + 3450) f2_real = (4*(237*omega^4 - 7720*omega^2 + 3450))/(omega^6 + 5025*omega^4 + 3344500*omega^2 + 11902500) f2_imag = -(2*omega*(5*omega^4 - 9907*omega^2 + 550))/(omega^6 + 5025*omega^4 + 3344500*omega^2 + 11902500) you can use subs , vpa/double evaluate these particular omega.
Comments
Post a Comment