Bode plot calculator (gain and phase margin)

Enter your values. The answer and the full worked solution update as you type.

Result

Gain margin9.542 dB
Phase margin32.61 °
Gain crossover frequency0.7494 rad/s
Phase crossover frequency1.414 rad/s
Closed loopstable (if the open loop has no right half-plane poles)
ω (rad/s)|G(jω)||G| (dB)phase (°)
0.0199.9940−90.86
0.0215446.433.33−91.85
0.0464221.5226.65−93.99
0.19.93819.95−98.57
0.21544.51113.09−108.3
0.46421.9045.591−128
10.6325−3.979−161.6
2.1540.133−17.53−202.2
4.6420.01796−34.92−234.5
100.001951−54.19−253
21.540.0001989−74.03−262
46.421.998 × 10⁻⁵−93.99−266.3
1002 × 10⁻⁶−114−268.3

Draw the Bode diagram of a transfer function G(s) entered as numerator and denominator coefficients. The calculator plots the magnitude in dB and the phase against frequency, lists them in a table, and finds the gain crossover frequency (|G| = 0 dB), the phase crossover frequency (phase = −180°), the gain margin and the phase margin.

Bode plot

|G(jω)| (dB)0.010.1110100−150−100−50050ωgc​ = 0.7494GM = 9.542 dBphase (°)0.010.1110100−270−225−180−135−90PM = 32.61°ωpc​ = 1.414ω (rad/s)

Step-by-step solution

Frequency response

G(s) = (2)/(s³ + 3s² + 2s)
s = jω: |G(jω)| in dB = 20·log₁₀|G(jω)|, phase = arg G(jω)
at low frequency: G ≈ 1·s-1 → phase → −90°

Gain crossover: |G(jω)| = 1 (0 dB)

ω = 0.7494 rad/s: phase = −147.4° → PM = 180° + (−147.4°) = 32.61°

Phase crossover: phase = −180°

ω = 1.414 rad/s: |G| = −9.542 dB → GM = −(−9.542) = 9.542 dB

Stability

For an open loop without right half-plane poles, the closed loop is stable when both margins are positive.

How to find gain and phase margins from a Bode plot

  1. Substitute s = jω and evaluate |G(jω)| in dB (20·log₁₀|G|) and the phase arg G(jω) over a range of frequencies.
  2. Gain crossover ω_gc: where |G(jω)| = 1, i.e. 0 dB. The phase margin is PM = 180° + phase at ω_gc.
  3. Phase crossover ω_pc: where the phase is −180°. The gain margin is GM = −|G(jω_pc)| in dB.
  4. For an open loop without right half-plane poles, the closed loop is stable when both margins are positive.
  5. Typical design targets are a phase margin of 45° to 60° and a gain margin of at least 6 dB.

Questions and answers

How do I enter G(s)?

Type the coefficients of the numerator and the denominator from the highest power of s down, with zeros for missing powers. 2/(s(s + 1)(s + 2)) = 2/(s³ + 3s² + 2s) is numerator 2 and denominator 1 3 2 0.

Why is the phase not limited to −180°…180°?

The phase is unwrapped: it changes continuously with frequency, so a system with three poles goes down to −270°. The crossover with −180° is found on that continuous curve.

What if there is no crossover?

If |G| never crosses 0 dB, the phase margin is infinite; if the phase never reaches −180°, the gain margin is infinite. A first-order or second-order system without delay, for example, has an infinite gain margin.

When can the margins mislead?

For open-loop systems with right half-plane poles or zeros, or with several crossovers, the margins alone do not decide stability; use the Nyquist criterion. The calculator reports the smallest margins when there are several crossovers.

How accurate are the results?

The response is evaluated directly from the complex transfer function on a fine logarithmic grid, and the crossovers are refined by bisection, so the frequencies and margins are accurate to many digits.

Practise it yourself

Practise Bode plots & margins

A calculator gives the answer. In the exam you need the method: practise it with new problems, hints and worked solutions.

</> Embed

Free for teachers and schools: paste this code into your course page, LMS or website. Students can use the calculator and its worked solution without an account.

More calculators