Hello,
I'm tryiing to plot phase and magnitude plot for below complex transfor function by performing FRF for say -600 to 600 Hz
1257 s + 3.736e05
-------------------------------------------
s^2 + (1554 - 2e02i) s + (3.736e05 - 2e02i)
Please help

 採用された回答

Star Strider
Star Strider 2023 年 10 月 5 日

0 投票

Try this —
s = tf('s');
H = (1257*s + 3.736e05) / (s^2 + (1554 - 2e02i)*s + (3.736e05 - 2e02i))
H = 1257 s + 373600 ------------------------------------- s^2 + (1554-200i) s + (3.736e05-200i) Continuous-time transfer function.
opts = bodeoptions;
opts.FreqUnits = 'Hz';
opts.FreqScale = 'linear';
figure
bodeplot(H, {0 600*2*pi}, opts) % Plot Transfer Function
grid
[mag,phase,wout] = bode(H, {0 600*2*pi}); % Return Numeric Values ('wout' Will Be In rad/sec, So Divide It By (2*pi) To Get Hz)
mag = squeeze(mag);
phase = squeeze(phase);
.

5 件のコメント

Bala Sundaram Nauduri
Bala Sundaram Nauduri 2023 年 10 月 10 日
Thank you so much, it helped me, but in the paper I'm refering the magnitude plot is not in DB, how can I change scale? Once again thank you so much.
Star Strider
Star Strider 2023 年 10 月 10 日
My pleasure!
Set the MagUnits option to abs in the bodeplot call —
s = tf('s');
H = (1257*s + 3.736e05) / (s^2 + (1554 - 2e02i)*s + (3.736e05 - 2e02i))
H = 1257 s + 373600 ------------------------------------- s^2 + (1554-200i) s + (3.736e05-200i) Continuous-time transfer function.
opts = bodeoptions;
opts.FreqUnits = 'Hz';
opts.FreqScale = 'linear';
opts.MagUnits = 'abs';
figure
bodeplot(H, {0 600*2*pi}, opts) % Plot Transfer Function
grid
[mag,phase,wout] = bode(H, {0 600*2*pi}); % Return Numeric Values ('wout' Will Be In rad/sec, So Divide It By (2*pi) To Get Hz)
mag = squeeze(mag);
phase = squeeze(phase);
The units returned by the bode function are absolute for ‘mag’ and degrees for ‘phase’. Use the mag2db and deg2rad functions to convert them to dB and radians to change them if you need to. The ‘wout’ units are radians/time unit, so divide them by (2*pi) to get Hz.
.
Star Strider
Star Strider 2023 年 10 月 10 日
If my Answer helped you solve your problem, please Accept it!
.
Bala Sundaram Nauduri
Bala Sundaram Nauduri 2023 年 10 月 11 日
Once again thank you so much, Now I'm trying plot the root locus using rlocus(), and it says
Error using DynamicSystem/rlocus (line 65)
Cannot compute the root locus of models with complex data.
May be I need to rewrite my transfer function, I will get back to you if I have any questions.
Star Strider
Star Strider 2023 年 10 月 11 日
My pleasure!
I cannot suggest a work-around for the rlocus problem.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by