Bode Plot Axis Change

370 views (last 30 days)
Robert
Robert on 23 Jul 2015
Hello Im trying to learn the bode plot tool
Here is what i have
Here is my tf function Am i inputting it correct? The plot is not correct (.001*S)/(.0000005S^2 + .0017*s +1)
num = [.001];
denom = [ .0000005, .0017, 1];
g = tf(num, denom);
bode(g),grid
I get a nice bode plot from this however the max magnitude is not where its suppose to be on the plot. It is self scaling to -60dB I need to change the scale somehow to see what is going on at -4 dB for example.
Can someone help please?

Accepted Answer

Robert
Robert on 23 Jul 2015
All, i figured out my issue and maybe this will help someone in the future.
My numerator has the highest power of S as the 1st power. You must include all the powers of S all the way down to S to the zero power. There for the numerator vector must have a zero for the second component This solved my issue and the scaling is now correct also

More Answers (1)

Jonathan Espín Martin
Jonathan Espín Martin on 14 Dec 2017
First of all your numerator is not well settled
num=[0.001 0];
That mistake will be ignored. Unfortunately there's not an easy way to fix the axis limits using the bode command. However, there's a simply code that may be useful.
close all;
num=0.001;
den=[5e-7 0.0017 1];
g=tf(num,den);
opts1=bodeoptions('cstprefs');
opts1.PhaseVisible = 'off';
opts1.YLim={[-140 -50]};
Mag=subplot(2,1,1);bodeplot(g,opts1); grid on;
set(xlabel(''),'visible','off');
opts2=bodeoptions('cstprefs');
opts2.MagVisible = 'off';
opts2.YLim={[-180 0]};
Phase=subplot(2,1,2);bodeplot(g,opts2); grid on; title('');
Referring to the lines of the code, you may be able to change the Magnitud and Phase, in this example [-140 50] and [-180 0] are good options.
opts1.YLim={[-140 -50]};
opts2.YLim={[-180 0]};
I advice to previously plot the Bode Diagram to determine these values and change them as you wish. The final result looks like.

Community Treasure Hunt

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

Start Hunting!