# Bode Plot - Customization of axis

Posted 1 month ago
398 Views
|
2 Replies
|
1 Total Likes
|
 Hello,I would like to be able to plot the Bode diagrams of magnitude and phase in the following way in Mathematica (actually as it is shown in the following example of plotting the Bode diagram in Matlab):It seems that Mathematica plots according to w, and not to frequency. w=2pi*freq How can I make the Bode Plot in Mathematica look the same as it looks in Matlab Bode Plot?Wolfram Mathematica 12.0 file attached.Thank you. Attachments:
2 Replies
Sort By:
Posted 1 month ago
 Looks like it's not easy to fix this. See here and here for more info ?I have only this:  H = (0.31831 (1 + 7.95775*10^-8 s))/(1 + 7.95775*10^-8 s + 2.53303*10^-14 s^2); BodePlot[TransferFunctionModel[{H}, s], {w, 10^1, 10^7}, PlotRange -> {{-20, 15}, {10, -20}}, GridLines -> Automatic, FrameLabel -> {{"", HoldForm[Text[Magnitude[dB]]]}, {HoldForm[Text[Frequency[Hz]]], HoldForm[Text[Phase [Radian]]]}}, ScalingFunctions -> {{"Log10", "dB"}, {"Log10", "Radian"}}] (* Or: *) BodePlot[TransferFunctionModel[{H}, s], {w, 10^1, 10^7}, PlotRange -> {{-20, 15}, {10, -20}}, GridLines -> Automatic, FrameLabel -> {{"", HoldForm[Text[Magnitude[dB]]]}, {HoldForm[Text[Frequency[Hz]]], HoldForm[Text[Phase [deg]]]}}, ScalingFunctions -> {{"Log10", "dB"}, {"Log10", "Degree"}}] Regards M.I.
Posted 1 month ago
 The code that you posted does not change the display of the frequency axis from w to frequency (w being equal to 2pifreq (w=2pifreq)) - but at least it displays Magnitude[dB], Phase[deg], and Frequency[Hz] as text on the graphs. Anyway, I found how to do it: H = (0.31831 (1 + 7.95775*10^-8 s))/(1 + 7.95775*10^-8 s + 2.53303*10^-14 s^2) H = TransferFunctionModel[{H}, s] BodePlot[H[I*2*\[Pi]*f], {f, 10^1, 1.5*10^6}, GridLines -> Automatic, PlotRange -> {{-20, 15}, {10, -20}}, Frame -> False]