---
title: "BodePlot"
language: "en"
type: "Symbol"
summary: "BodePlot[lsys] generates a Bode plot of a linear time-invariant system lsys. BodePlot[lsys, {\\[Omega]min, \\[Omega]max}] plots for the frequency range \\[Omega]min to \\[Omega]max. BodePlot[expr, {\\[Omega], \\[Omega]min, \\[Omega]max}] plots expr using the variable \\[Omega]."
keywords: 
- bode plot
- bode magnitude plot
- bode phase plot
- log-modulus plot
- frequency response characteristics
- sinusoidal transfer function
- phase margin
- gain margin
- bandwidth
- sensitivity
- stability
- gain crossover frequency
- phase crossover frequency
- static position error constant
- static velocity error constant
- static accleration error constant
- classical control
- control systems
- control theory
- bode
canonical_url: "https://reference.wolfram.com/language/ref/BodePlot.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Classical Analysis and Design"
    link: "https://reference.wolfram.com/language/guide/ClassicalAnalysisAndDesign.en.md"
  - 
    title: "Fourier Analysis"
    link: "https://reference.wolfram.com/language/guide/FourierAnalysis.en.md"
  - 
    title: "Integral Transforms"
    link: "https://reference.wolfram.com/language/guide/IntegralTransforms.en.md"
  - 
    title: "Control Systems"
    link: "https://reference.wolfram.com/language/guide/ControlSystems.en.md"
  - 
    title: "Signal Filtering & Filter Design"
    link: "https://reference.wolfram.com/language/guide/SignalFilteringAndFilterDesign.en.md"
  - 
    title: "Summation Transforms"
    link: "https://reference.wolfram.com/language/guide/SummationTransforms.en.md"
  - 
    title: "Delay Control Systems"
    link: "https://reference.wolfram.com/language/guide/DelayControlSystems.en.md"
  - 
    title: "System Model Analytics & Design"
    link: "https://reference.wolfram.com/language/guide/SystemModelAnalyticsDesign.en.md"
related_functions: 
  - 
    title: "NyquistPlot"
    link: "https://reference.wolfram.com/language/ref/NyquistPlot.en.md"
  - 
    title: "NicholsPlot"
    link: "https://reference.wolfram.com/language/ref/NicholsPlot.en.md"
  - 
    title: "SingularValuePlot"
    link: "https://reference.wolfram.com/language/ref/SingularValuePlot.en.md"
  - 
    title: "GainPhaseMargins"
    link: "https://reference.wolfram.com/language/ref/GainPhaseMargins.en.md"
  - 
    title: "TransferFunctionModel"
    link: "https://reference.wolfram.com/language/ref/TransferFunctionModel.en.md"
  - 
    title: "AbsArgPlot"
    link: "https://reference.wolfram.com/language/ref/AbsArgPlot.en.md"
---
# BodePlot

BodePlot[lsys] generates a Bode plot of a linear time-invariant system lsys.

BodePlot[lsys, {ωmin, ωmax}] plots for the frequency range ωmin to ωmax.

BodePlot[expr, {ω, ωmin, ωmax}] plots expr using the variable ω.

## Details and Options

* ``BodePlot`` plots the magnitude and phase of the transfer function of ``lsys``.

* The system ``lsys`` can be ``TransferFunctionModel`` or ``StateSpaceModel``, including descriptor and delay systems.

* For a system ``lsys`` with the corresponding transfer function $g(s)$, the following expressions are plotted:

|                                                           |                                                                            |
| --------------------------------------------------------- | -------------------------------------------------------------------------- |
| $g(i \omega )$              | continuous-time system                                                     |
| $g(\exp (i \tau  \omega ))$ | discrete-time system with sample time $\tau$ |

* ``BodePlot`` treats the variable ``ω`` as local, effectively using ``Block``.

* ``BodePlot`` has the same options as ``Plot``, with the following changes and additions: []

|                        |                                        |                                                                   |
| ---------------------- | -------------------------------------- | ----------------------------------------------------------------- |
| Exclusions             | None                                   | frequencies to exclude                                            |
| FeedbackType           | "Negative"                             | the feedback type                                                 |
| Frame                  | True                                   | whether to draw a frame around each plot                          |
| MeshFunctions          | {{#1&}, {#1&}}                         | how to determine the placement of mesh divisions                  |
| PhaseRange             | Automatic                              | range of phase values to use                                      |
| PlotLayout             | "VerticalGrid"                         | the layout to be used                                             |
| PlotRange              | {{Full, Automatic}, {Full, Automatic}} | range of values to include                                        |
| SamplingPeriod         | None                                   | the sampling period                                               |
| ScalingFunctions       | {{"Log10", "dB"}, {"Log10", "Degree"}} | the scaling functions                                             |
| StabilityMargins       | False                                  | whether to show the stability margins                             |
| StabilityMarginsStyle  | Automatic                              | graphics directives to specify the style of the stability margins |

* ``ColorData["DefaultPlotColors"]`` gives the default sequence of colors used by ``PlotStyle``.

* Possible explicit settings for the option ``PlotLayout`` are ``"VerticalGrid"`` and ``"List"``.

* The option ``PlotLayout`` accepts the following values:

|                                                         |                |                                             |
| ------------------------------------------------------- | -------------- | ------------------------------------------- |
| \|         \| \| ------- \| \| [image] \| \| [image] \| | "VerticalGrid" | magnitude and phase plot in a vertical grid |
| {[image], [image]}                                      | "List"         | magnitude and phase plot in a list          |
| [image]                                                 | "Magnitude"    | magnitude plot only                         |
| [image]                                                 | "Phase"        | phase plot only                             |

* The other options of ``BodePlot`` can be specified as a list of two elements, with the first element corresponding to the magnitude plot and the second to the phase plot.

* Option specifications include:

|                         |                                                                   |
| ----------------------- | ----------------------------------------------------------------- |
| opt -> val              | use val for both the magnitude and the phase plot                 |
| opt -> {val}            | use val for the magnitude plot and the default for the phase plot |
| opt -> {val1, val2}     | use val1 for the magnitude plot and val2 for the phase plot       |
| opt -> {Automatic, val} | use the default for the magnitude plot and val for the phase plot |

* With the ``PlotLayout`` settings ``"Magnitude"`` or ``"Phase"``, a single setting refers to the plot requested.

* 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"``.

### List of all options

|                        |                                        |                                                                                    |
| ---------------------- | -------------------------------------- | ---------------------------------------------------------------------------------- |
| AlignmentPoint         | Center                                 | the default point in the graphic to align with                                     |
| AspectRatio            | 1 / GoldenRatio                        | ratio of height to width                                                           |
| Axes                   | True                                   | whether to draw axes                                                               |
| AxesLabel              | None                                   | axes labels                                                                        |
| AxesOrigin             | Automatic                              | where axes should cross                                                            |
| AxesStyle              | {}                                     | style specifications for the axes                                                  |
| Background             | None                                   | background color for the plot                                                      |
| BaselinePosition       | Automatic                              | how to align with a surrounding text baseline                                      |
| BaseStyle              | {}                                     | base style specifications for the graphic                                          |
| ClippingStyle          | None                                   | what to draw where curves are clipped                                              |
| ColorFunction          | Automatic                              | how to determine the coloring of curves                                            |
| ColorFunctionScaling   | True                                   | whether to scale arguments to ColorFunction                                        |
| ContentSelectable      | Automatic                              | whether to allow contents to be selected                                           |
| CoordinatesToolOptions | Automatic                              | detailed behavior of the coordinates tool                                          |
| Epilog                 | {}                                     | primitives rendered after the main plot                                            |
| EvaluationMonitor      | None                                   | expression to evaluate at every function evaluation                                |
| Exclusions             | None                                   | frequencies to exclude                                                             |
| ExclusionsStyle        | None                                   | what to draw at excluded points                                                    |
| FeedbackType           | "Negative"                             | the feedback type                                                                  |
| Filling                | None                                   | filling to insert under each curve                                                 |
| FillingStyle           | Automatic                              | style to use for filling                                                           |
| FormatType             | TraditionalForm                        | the default format type for text                                                   |
| Frame                  | True                                   | whether to draw a frame around each plot                                           |
| FrameLabel             | None                                   | frame labels                                                                       |
| FrameStyle             | {}                                     | style specifications for the frame                                                 |
| FrameTicks             | Automatic                              | frame ticks                                                                        |
| FrameTicksStyle        | {}                                     | style specifications for frame ticks                                               |
| GridLines              | None                                   | grid lines to draw                                                                 |
| GridLinesStyle         | {}                                     | style specifications for grid lines                                                |
| ImageMargins           | 0.                                     | the margins to leave around the graphic                                            |
| ImagePadding           | All                                    | what extra padding to allow for labels etc.                                        |
| ImageSize              | Automatic                              | the absolute size at which to render the graphic                                   |
| LabelingSize           | Automatic                              | maximum size of callouts and labels                                                |
| LabelStyle             | {}                                     | style specifications for labels                                                    |
| MaxRecursion           | Automatic                              | the maximum number of recursive subdivisions allowed                               |
| Mesh                   | None                                   | how many mesh points to draw on each curve                                         |
| MeshFunctions          | {{#1&}, {#1&}}                         | how to determine the placement of mesh divisions                                   |
| MeshShading            | None                                   | how to shade regions between mesh points                                           |
| MeshStyle              | Automatic                              | the style for mesh points                                                          |
| Method                 | Automatic                              | the method to use for refining curves                                              |
| PerformanceGoal        | \$PerformanceGoal                      | aspects of performance to try to optimize                                          |
«3 rows removed»
| PlotLabels             | None                                   | labels to use for curves                                                           |
| PlotLayout             | "VerticalGrid"                         | the layout to be used                                                              |
| PlotLegends            | None                                   | legends for curves                                                                 |
| PlotPoints             | Automatic                              | initial number of sample points                                                    |
| PlotRange              | {{Full, Automatic}, {Full, Automatic}} | range of values to include                                                         |
| PlotRangeClipping      | True                                   | whether to clip at the plot range                                                  |
| PlotRangePadding       | Automatic                              | how much to pad the range of values                                                |
| PlotRegion             | Automatic                              | the final display region to be filled                                              |
| PlotStyle              | Automatic                              | graphics directives to specify the style for each curve                            |
| PlotTheme              | \$PlotTheme                            | overall theme for the plot                                                         |
| PreserveImageOptions   | Automatic                              | whether to preserve image options when displaying new versions of the same graphic |
| Prolog                 | {}                                     | primitives rendered before the main plot                                           |
| RegionFunction         | (True&)                                | how to determine whether a point should be included                                |
| RotateLabel            | True                                   | whether to rotate y labels on the frame                                            |
| SamplingPeriod         | None                                   | the sampling period                                                                |
| ScalingFunctions       | {{"Log10", "dB"}, {"Log10", "Degree"}} | the scaling functions                                                              |
| StabilityMargins       | False                                  | whether to show the stability margins                                              |
| StabilityMarginsStyle  | Automatic                              | graphics directives to specify the style of the stability margins                  |
| TargetUnits            | Automatic                              | units to display in the plot                                                       |
| Ticks                  | Automatic                              | axes ticks                                                                         |
| TicksStyle             | {}                                     | style specifications for axes ticks                                                |
| WorkingPrecision       | MachinePrecision                       | the precision used in internal computations                                        |

---

## Examples (46)

### Basic Examples (3)

The Bode plot of a system:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{20}}, 20 + s}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

A second-order system:

```wl
In[1]:=
lsys[ω_, ζ_] := TransferFunctionModel[{{{ω^2}}, s^2 + 
   2*s*ζ*ω + ω^2}, s];
```

Plot over an explicit frequency range:

```wl
In[2]:= BodePlot[lsys[1, 1], {.01, 100}]

Out[2]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Bode plot of a state-space model:

```wl
In[1]:=
BodePlot[StateSpaceModel[{{{0, 1}, {-0.5, -0.05}}, {{0}, {1}}, {{1, 0}}, {{0}}}, SamplingPeriod -> None, 
 SystemsModelLabels -> None]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

### Scope (13)

Bode plot of a constant-gain system:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{10}}, 1}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Bode plot of an integrator:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{1}}, s}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Bode plot of a differentiator:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{s}}, 1}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Bode plot of a first-order lag:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{1}}, 1 + 10*s}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Bode plot of a first-order lead:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{1 + 10*s}}, 1}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Bode plot of a second-order system:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{100}}, 100 + 1.*s + s^2}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

A higher-order ``TransferFunctionModel`` :

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{5*(1 + 0.1*s)}}, s + 0.512*s^2 + 
   0.0064*s^3 + 0.0002*s^4}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Bode plot of a time-delay system:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{E^(-0.5*s)}}, 1. + 2.*s}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

A discrete-time system:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{-0.9 + z}}, -0.8 + z}, z, 
 SamplingPeriod -> 1]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Specify the frequency range:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{-4 + 4.9*z}}, (-4.5 + z)*(-1 + z)}, 
 z, SamplingPeriod -> 1], {0.05, (π/2)}]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

The Bode plot of a state-space model:

```wl
In[1]:=
BodePlot[StateSpaceModel[{{{-1, 10, 0}, {-2, -7, 335}, {0, 0, -10}}, {{0}, {0}, {10}}, {{1, 0, 0}}, {{0}}}, 
 SamplingPeriod -> None, SystemsModelLabels -> None]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

A system specified using its sinusoidal transfer function:

```wl
In[1]:= BodePlot[(10/20ω I + 1), {ω, 0.0005, 10}]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

The Bode plot of a multiple-input, multiple-output system:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{2, 1}, {0.5, 0.1}}, {{1 + s, 2 + s}, 
   {3 + s, 4 + s}}}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

### Generalizations & Extensions (1)

A Bode plot can be obtained from a transfer-function model or directly from its expression:

```wl
In[1]:= g = (12/9 + 0.48s + s^2);

In[2]:= {BodePlot[TransferFunctionModel[g, s]], BodePlot[g]}

Out[2]=
{|         |
| ------- |
| [image] |
| [image] |, |         |
| ------- |
| [image] |
| [image] |}
```

### Options (21)

#### CoordinatesToolOptions (5)

To obtain coordinates, select the graphics and press the period key:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{2500}}, 15500 + 400*s + s^2}, s]]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

If frequency is in rad/s, obtain coordinate frequency values in hertz by dividing it by $2 \pi$ :

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{4}}, 4 + 2*s + s^2}, s], CoordinatesToolOptions -> ("DisplayFunction" -> Function[pt, {(pt[[1]]/2 π), pt[[2]]}])]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Coordinate frequency values in different units for each plot:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{16}}, (1 + s)*(4 + s)^2}, s], CoordinatesToolOptions -> {"DisplayFunction" -> Function[pt, {(pt[[1]]/2 π), pt[[2]]}]}]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Frequency values in original units, magnitude in absolute units, and phase in radians:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{5}}, s*(10 + 6*s + s^2)}, 
 s], CoordinatesToolOptions -> {{"DisplayFunction" -> Function[pt, {pt[[1]], 10^(pt[[2]]/20)}]}, {"DisplayFunction" -> Function[pt, {pt[[1]], pt[[2]] Degree}]}}]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Specify radians as both the displayed and copied value of phase:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{100*s}}, 1 + s}, s], CoordinatesToolOptions -> {Automatic, {"DisplayFunction" -> Function[pt, {pt[[1]], pt[[2]] Degree}], "CopiedValueFunction" -> Function[pt, {pt[[1]], pt[[2]]Degree}]}}]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

#### GridLines (3)

Show grid lines:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{1.6}}, 1.6 + 3*s + s^2}, s], GridLines -> Automatic]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Show grid lines only on the magnitude plot:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{10}}, (2 + s)*(4 + s)*(6 + s)}, 
 s], GridLines -> {Automatic, None}]

Out[1]= [image]
```

---

Show specific grid lines:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{1}}, s^2*(3 + s + s^2)}, 
 s], GridLines -> {{List[0.01, 0.1, 1, 10], Range[-150, 140, 20]}, {List[0.01, 0.1, 1, 10], Range[0, 200, 25]}}]

Out[1]= [image]
```

#### GridLinesStyle (2)

Specify grid lines style:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{1}}, 10 + 3*s + s^3}, s], GridLines -> Automatic, GridLinesStyle -> Red]

Out[1]= [image]
```

---

Specify different grid lines styles:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{1 + s}}, s*(2 + s)*
   (3 + s)}, s], GridLines -> Automatic, GridLinesStyle -> {{Green, Black}, {Red, Black}}]

Out[1]= [image]
```

#### PhaseRange (1)

The phase is typically plotted as a continuous function:

```wl
In[1]:= BodePlot[(1/(s + 1)^4(s + 5)), PlotLayout -> "Phase"]

Out[1]= [image]
```

Specify a phase range:

```wl
In[2]:= BodePlot[(1/(s + 1)^4(s + 5)), PlotLayout -> "Phase", PhaseRange -> {-2 π, 0}]

Out[2]= [image]
```

#### PlotLayout (1)

By default, the magnitude plot is placed vertically above the phase plot:

```wl
In[1]:=
tfm = TransferFunctionModel[{{{-5 + s}}, 
  s*(1 + 3*s + s^2)}, s];

In[2]:= BodePlot[tfm, PlotLabel -> {"Magnitude Plot", "Phase Plot"}]

Out[2]=
|         |
| ------- |
| [image] |
| [image] |
```

Obtain the result in a list:

```wl
In[3]:= BodePlot[tfm, PlotLayout -> "list", PlotLabel -> {"magnitude", "phase"}]

Out[3]= {[image], [image]}
```

Only the magnitude plot:

```wl
In[4]:= BodePlot[tfm, PlotLayout -> "Magnitude"]

Out[4]= [image]
```

Only the phase plot:

```wl
In[5]:= BodePlot[tfm, PlotLayout -> "Phase"]

Out[5]= [image]
```

#### PlotTheme (2)

Use a theme with simple ticks and grid lines in a bright color scheme:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{20}}, 20 + s}, s], PlotTheme -> "Business"]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Change the color scheme:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{20}}, 20 + s}, s], PlotTheme -> "Business", PlotStyle -> 56]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

#### SamplingPeriod (2)

Specify the sampling period in the system description:

```wl
In[1]:=
tfm = TransferFunctionModel[{{{0.5}}, (-0.1 + z)*z^2}, z, 
 SamplingPeriod -> 1];

In[2]:= BodePlot[tfm, {0.1, Pi}]

Out[2]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Specify the sampling period in the ``BodePlot`` function:

```wl
In[1]:= BodePlot[(5/(-0.1 + z) z^2), {0.1, π}, SamplingPeriod -> 1]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

A smaller sampling period results in a higher bandwidth:

```wl
In[2]:= BodePlot[(5/(-0.1 + z) z^2), {0.1, π}, SamplingPeriod -> 0.5]

Out[2]=
|         |
| ------- |
| [image] |
| [image] |
```

#### ScalingFunctions (2)

Show absolute values of magnitude and phase in radians:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{1}}, (1 + s)*(1 + 10*s)}, s], {0.1, 10}, ScalingFunctions -> {{Automatic, "Absolute"}, {Automatic, "Radian"}}]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Plot frequency in the linear scale:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{1 + s}}, 1 + 5*s + s^2}, 
 s], {0.1, 10}, ScalingFunctions -> {{"Linear", Automatic}, {"Linear", Automatic}}]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

#### StabilityMargins (2)

Show stability margins:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{50}}, (2 + s)*(3 + s)*(8 + s)}, 
 s], StabilityMargins -> True]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Show the phase margin only:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{50}}, (2 + s)*(3 + s)*(8 + s)}, 
 s], StabilityMargins -> {False, True}]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

#### StabilityMarginsStyle (1)

Specify the stability margins style:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{10000}}, (5 + s)*(20 + s)*
   (50 + s)}, s], {0.1, 100}, StabilityMargins -> True, StabilityMarginsStyle -> {Green, Directive[Red, Dashed]}]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

### Applications (7)

The static position error constant of a type 0 system is the magnitude at steady state:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{10}}, 1 + s}, s], {0.001, 10}, Epilog -> {PointSize[Medium], Red, Point[{Log10[0.001], 20 Log10[Limit[(10/s + 1), s -> 0]]}]}, PlotRange -> {{0.0008, 10}, Automatic}, PlotLayout -> "Magnitude", Frame -> False]

Out[1]= [image]
```

Discrete-time type 0 system:

```wl
In[2]:=
BodePlot[ TransferFunctionModel[{{{z}}, (-0.6 + z)*(-0.05 + z)}, 
 z, SamplingPeriod -> 0.5], {0.001, (π/0.5)}, Epilog -> {PointSize[Medium], Red, Point[{Log10[0.001], 20 Log10[Limit[(z/(z - 0.05) (z - 0.6)), z -> 1]]}]}, PlotRange -> {{0.0008, (π/0.5)}, Automatic}, PlotLayout -> "Magnitude", Frame -> False]

Out[2]= [image]
```

---

The static velocity error constant of a type 1 system is approximately the intersection of the initial $-20$ dB/decade segment (or its extension) with the 0 dB line:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{5}}, s*(3 + s)}, s], {0.1, 100}, Epilog -> {Line[{{Log10[0.1], 0}, {Log10[100], 0}}], PointSize[Large], Red, Point[{ Log10[Limit[s (5 /s(s + 3)), s -> 0]], 0}]}, PlotLayout -> "Magnitude", Frame -> False]

Out[1]= [image]
```

Discrete-time type 1 system:

```wl
In[2]:=
BodePlot[TransferFunctionModel[{{{1}}, (-1 + z)*(-0.025 + z)}, z, 
 SamplingPeriod -> 1], {0.1, π}, Epilog -> {Line[{{Log10[0.1], 0}, {Log10[π], 0}}], PointSize[Medium], Red, Point[{Log10[Limit[(z - 1/(z - 1) (z - 0.025)), z -> 1]], 0}]}, PlotLayout -> "Magnitude", Frame -> False]

Out[2]= [image]
```

---

The square root of the static acceleration error constant of a type 2 system is approximately the intersection of the initial $-40$ dB/decade segment (or its extension) with the 0 dB line:

```wl
In[1]:= BodePlot[TransferFunctionModel[{{{1}}, s^2*(1 + s)}, s], {0.1, 10}, Epilog -> {Line[{{Log10[0.1], 0}, {Log10[10], 0}}], PointSize[Medium], Red, Point[{ Log10[Sqrt[Limit[s^2(1/s^2(s + 1)), s -> 0]]], 0}]}, PlotLayout -> "Magnitude", Frame -> False]

Out[1]= [image]
```

Discrete-time type 2 system:

```wl
In[2]:=
BodePlot[TransferFunctionModel[{{{0.0001*z}}, (-1 + z)^2*
   (0.1 - 0.3*z + z^2)}, z, SamplingPeriod -> 1], {0.001, π}, Epilog -> {Line[{{Log10[0.001], 0}, {Log10[π], 0}}], PointSize[Medium], Red, Point[{Log10[Sqrt[Limit[((z - 1)^2 (0.0001 z)/(z - 1)^2 (z^2 - 0.3 z + 0.1)), z -> 1]]], 0}]}, PlotLayout -> "Magnitude", Frame -> False]

Out[2]= [image]
```

---

Visualize the improvement in phase margin by using a proportional-integral (PI) compensator:

```wl
In[1]:=
BodePlot[{Tooltip[TransferFunctionModel[{{{583900}}, s*(36 + s)*(100 + s)}, 
 s]], Tooltip[TransferFunctionModel[{{{36786*(0.98 + s)}}, s*(0.062 + s)*
   (36 + s)*(100 + s)}, s]]}, StabilityMargins -> {True, True}, StabilityMarginsStyle -> {RGBColor[0.24, 0.6, 0.8], RGBColor[0.95, 0.627, 0.1425]}, PlotStyle -> {RGBColor[0.24, 0.6, 0.8], RGBColor[0.95, 0.627, 0.1425]}, PlotLayout -> "Phase", Frame -> False]

Out[1]= [image]
```

---

Visualize the frequency response of a zero-order hold with sampling period 1:

```wl
In[1]:=
BodePlot[TransferFunctionModel[{{{(-1 + E^s)/E^s}}, s}, 
 s], {0.01, 30}, ScalingFunctions -> {{"Linear", "Absolute"}, {"Linear", "Degree"}}, PlotRange -> All]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

---

Obtain the Bode plot with frequency in Hertz, when the Laplace variable is in radians/second:

```wl
In[1]:=
tfm = TransferFunctionModel[{{{100}}, s*(100 + 10*s + s^2)}, 
 s];

In[2]:= BodePlot[tfm[I 2 π f], f]

Out[2]=
|         |
| ------- |
| [image] |
| [image] |
```

For continuous-time systems, the same result can be obtained by scaling the Laplace variable:

```wl
In[3]:= BodePlot[tfm[2 π s]]

Out[3]=
|         |
| ------- |
| [image] |
| [image] |
```

---

The plot in Hertz for a discrete-time system with the Z-transform variable in radians/second:

```wl
In[1]:= BodePlot[(-0.4 + E^2 I f π/0.5  + E^2 I f π), f, SamplingPeriod -> 1]

Out[1]=
|         |
| ------- |
| [image] |
| [image] |
```

### Properties & Relations (1)

``SingularValuePlot`` generalizes the Bode magnitude plot to MIMO systems:

```wl
In[1]:=
tfm = TransferFunctionModel[{{{10000}}, (5 + s)*(20 + s)*
   (50 + s)}, s];

In[2]:= {SingularValuePlot[tfm], BodePlot[tfm, PlotLayout -> "Magnitude", Frame -> False]}

Out[2]= {[image], [image]}
```

## See Also

* [`NyquistPlot`](https://reference.wolfram.com/language/ref/NyquistPlot.en.md)
* [`NicholsPlot`](https://reference.wolfram.com/language/ref/NicholsPlot.en.md)
* [`SingularValuePlot`](https://reference.wolfram.com/language/ref/SingularValuePlot.en.md)
* [`GainPhaseMargins`](https://reference.wolfram.com/language/ref/GainPhaseMargins.en.md)
* [`TransferFunctionModel`](https://reference.wolfram.com/language/ref/TransferFunctionModel.en.md)
* [`AbsArgPlot`](https://reference.wolfram.com/language/ref/AbsArgPlot.en.md)

## Related Guides

* [Classical Analysis and Design](https://reference.wolfram.com/language/guide/ClassicalAnalysisAndDesign.en.md)
* [Fourier Analysis](https://reference.wolfram.com/language/guide/FourierAnalysis.en.md)
* [Integral Transforms](https://reference.wolfram.com/language/guide/IntegralTransforms.en.md)
* [Control Systems](https://reference.wolfram.com/language/guide/ControlSystems.en.md)
* [Signal Filtering & Filter Design](https://reference.wolfram.com/language/guide/SignalFilteringAndFilterDesign.en.md)
* [Summation Transforms](https://reference.wolfram.com/language/guide/SummationTransforms.en.md)
* [Delay Control Systems](https://reference.wolfram.com/language/guide/DelayControlSystems.en.md)
* [System Model Analytics & Design](https://reference.wolfram.com/language/guide/SystemModelAnalyticsDesign.en.md)

## History

* [Introduced in 2010 (8.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn80.en.md) \| [Updated in 2012 (9.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn90.en.md) ▪ [2014 (10.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn100.en.md)