# Why does this PhaseRange not work?

Any idea why this PhaseRange does not work?

BodePlot[-(1/(s + 1000)), PlotLayout -> "Phase",
PhaseRange -> {0, 2 \[Pi]}]


• The values on the y-axis on the left are in degree, while the PhaseRange option is specified in radians. So only if the phase would exceed -360 in your plot, the PhaseRange option would take effect. Commented Feb 28, 2022 at 8:07
• @Mathias PhaseRange -> {-180, 180} doesn't work either. Why does it need the phase exceeding -360 for the option to be effective? I don't quite get it.
– hana
Commented Feb 28, 2022 at 9:00
• What if I want the phase to start at 180 degree instead? What setting should I use?
– hana
Commented Feb 28, 2022 at 9:26
• A canonical sample of a "minimal working example".
– Syed
Commented Feb 28, 2022 at 11:37
• @Syed what do you mean?
– hana
Commented Feb 28, 2022 at 11:57

This is a bug and is fixed in v13.1 to give the following correct results.

BodePlot[-(1/(s + 1000)), PlotLayout -> "Phase", "PhaseRange" -> #,
PlotLabel -> Switch[#, Automatic, #, _, Row[{#, " i.e. ", N[#/Degree]}]] ] & /@
{Automatic, {-π, π}, {0, 2 π}, {2 π, 4 π}}


Everything is working correctly. Mathematica is showing a correct Bode plot, the frequency range is just automatically set to display interesting (attenuating, likely to contain gain & phase margins) part.

First of all, for your filter, the minus sign reverses the phase ($$-\pi$$) and shifts backwards. So the range of phase shift starts from $$-\pi$$ until, as this is a decay transfer, $$-\pi-\pi/2$$. The interesting part happens at about $$1000\;\mathrm{Hz}$$, at its decay rate, as shown in your plot. To have wider frequency range,

BodePlot[TransferFunctionModel[-1/(s + 1000), s], {10^-1, 10^8}, PlotLayout -> "Phase", PhaseRange -> {0, 2 Pi}]


• Let's say it is required to show this plot from -180 to -225 degrees., How could it be done?
– Syed
Commented Feb 28, 2022 at 23:02
• Your TF starts at -180 due to a negative sign and loses another 90 for the only pole encountered. In Mathematica, try: Mod[#, 360] & /@ {-180, -270}. This is what you are seeing. This is similar to Matlab's unwrap.
– Syed
Commented Mar 2, 2022 at 14:02
• I think you have to keep adding/subtracting $2\pi$ till it is in the range $0$-$2\pi$. While specifying PhaseRange it has to be a multiple of $2\pi$ between min and max values, so that leaves us with $4\pi$ for the max value.
– Syed
Commented Mar 2, 2022 at 17:16
• @hana Your question did not ask that, but that the Bode plot is simply 'not work'. And through your comments I came to realize that your understanding on the subject matter is simply insufficient, which is the root of your question. Then kindly updated the answer explaining what PhaseRange means and why the $y$-axis ranges from $-180^\circ$ to $-270^\circ$, which you still fail to grasp. Commented Mar 2, 2022 at 17:36