7
$\begingroup$

I have a simple question:

What is the unit of the frequency axis in the BodePlot? I searched the documentation, but only found this:

The scaling functions can be specified as ScalingFunctions->{{magfreqscale,magscale}, {phasefreqscale,phasescale}}.

The frequency scales magfreqscale and phasefreqscale can be "Log10" or "Linear", which correspond to the base-10 logarithmic scale and linear scale, respectively.

The magnitude scale magscale can be "dB" or "Absolute", which correspond to the decibel >and absolute values of the magnitude, respectively.

The phase scale phasescale can be "Degree" or "Radian".

But it doesn't say me if the frequency axis is in Hz or rad/s or rad/min or what ever ... I'm asking because I have two BodePlots which, I'm rather shure one is in Hz and the other in rad/s.

$\endgroup$
4
  • 1
    $\begingroup$ Radians/S, the lower-case omega is the giveaway. There's an example in the CoordinatesToolOptions section talking about coord. tool using Hz. $\endgroup$
    – ciao
    Commented Jan 29, 2014 at 11:29
  • $\begingroup$ @rasher Thanks, I found the section, but it doesn't work. I'll try to give an example. ... $\endgroup$
    – Phab
    Commented Jan 29, 2014 at 12:41
  • $\begingroup$ Works only with "Frame -> False". Sadly a bad solution for me. But with beeing sure Mma shows rad/s I'll convert it to Hz afterwards. This, unfortunately, makes my actual problem even bigger. $\endgroup$
    – Phab
    Commented Jan 29, 2014 at 12:55
  • 1
    $\begingroup$ All you have to do is look in the documentation under Options->Ticks for examples of how to display plot ticks in Hz. $\endgroup$
    – david
    Commented Jan 29, 2014 at 17:08

1 Answer 1

9
$\begingroup$

The answer is that the unit of the frequency axis depends on the unit of the complex variable in the transfer function. So it could be anything $rad/s$, $Hz$, $rpm$, $cps$, etc., depending on how the transfer function was obtained.

However, if you know the unit of the complex variable in the transfer function and would like the frequency in different units, it can be done by rescaling the variables.

For example, in the continuous-time system $1/(s+1)$ if the unit of $s$ is $rad/sec$, and you would like plot in $Hz$, do BodePlot[1/(s + 1) /. s -> I 2 Pi f, f]. You could also do BodePlot[TransferFunctionModel[1/(s + 1), s][2 Pi s]] because it is a continuous-time system.

To do the same thing ($rad/s$ to $Hz$) for a discrete-time system do BodePlot[tfmd/.z->Exp[I 2 Pi f T], f, SamplingPeriod->T], where $tfmd$ is the expression for the discrete-time transfer function in the complex variable $z$ and $T$ is the sampling period.

$\endgroup$
3
  • 1
    $\begingroup$ This is sweet! I am curious as to how did you get this, especially the line of code? Is it through experience and knowledge or through documentation? I couldn't find what you have answered in the documentation for BodePlot. $\endgroup$
    – ModCon
    Commented Jun 17, 2020 at 17:49
  • $\begingroup$ @ModCon I know this because I'm the developer of this function and had to think through the design to handle units.:) It's documented here and here. When you realize that asking the unit of the frequency axis of BodePlot is no different than asking the unit of the x-axis in Plot[x^2, {x,0,1}], it's quite surprising and beautiful. $\endgroup$ Commented Jun 17, 2020 at 20:32
  • $\begingroup$ Ah got it. I didn’t expect there to be new things in examples. Thanks. $\endgroup$
    – ModCon
    Commented Jun 18, 2020 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.