TOOLS / NYQUIST PLOT

Nyquist plot and encirclement count

Draw L(jω) = K·G(jω) in the complex plane, count how many times it encircles −1, and apply Z = N + P to find the number of unstable closed-loop poles.

System / G(s) = N(s) / D(s)

Coefficients in descending powers (1 3 2) or an expression such as s(s+1)(s+2).

L(s) = K·G(s); the closed loop is K·G/(1 + K·G) with unity negative feedback.

G(s) =1s³ + 3s² + 2s
Poles of G(s)
−2−10
Zeros of G(s)
none
DC gain G(0)
∞
Closed-loop poles at this K (1)
−2.325−0.3376 ± 0.5623j
Stability
Closed loop stable: every pole is in the left half-plane.
P (open-loop RHP poles)
0
N (clockwise encirclements of −1)
0
Z = N + P (closed-loop RHP poles)
0
Closest approach to −1
0.6376

Closed loop stable: every pole is in the left half-plane.

L(s) has 1 pole on the imaginary axis. The contour detours around it, so the curve closes through infinity; that part is included in N.

Same result in code

MATLAB
% G(s) = (1) / (s^3 + 3s^2 + 2s)
G = tf([1], [1 3 2 0]);
K = 1;
L = K*G;
nyquist(L); grid on
P = sum(real(pole(L)) > 0)   % open-loop RHP poles
Z = sum(real(pole(feedback(L, 1))) > 0)   % closed-loop RHP poles, Z = N + P
Python (python-control)
import control as ct
import numpy as np

G = ct.tf([1], [1, 3, 2, 0])
K = 1
L = K*G
ct.nyquist_plot(L)
print(ct.nyquist_response(L).count)  # encirclements of -1
print(np.sum(ct.poles(L).real > 0), np.sum(ct.poles(ct.feedback(L, 1)).real > 0))

MATLAB uses the Control System Toolbox; Python uses python-control 0.10 or later (pip install control).

WHAT IT COMPUTES

What this calculator computes

The solid curve is L(jω) for ω from 0 to ∞; the dashed curve is its mirror image for negative ω. Together with the arcs at infinity they form the image of the Nyquist contour around the right half-plane.

For the unstable open loop K(s+2)/((s−1)(s+5)) at K = 5, P = 1 and the curve circles −1 once counterclockwise (N = −1), so Z = 0: the closed loop is stable. It stays stable for every K > 2.5.

READ THE RESULT

How to read the result

  • P: poles of L(s) in the open right half-plane. N: clockwise encirclements of −1 (counterclockwise counts as negative). Z = N + P: closed-loop poles in the right half-plane. The loop is stable only when Z = 0.
  • The distance from −1 to the nearest point of the curve is shown as well; it is the smallest value of |1 + L(jω)| and a margin that covers gain and phase together.
METHOD

Method and conventions

  • The encirclement count is computed along the full Nyquist contour, not read from the drawing: up the imaginary axis with small detours to the right of poles on the axis, then around a large semicircle. Because 1 + L = (D + K·N)/D, the count is the difference of two polynomial windings, which stay well defined even where |L| is huge.
  • The result is checked against the closed-loop roots. If a closed-loop pole lies on the imaginary axis, the curve passes through −1 and the page says so instead of reporting a count.
LIMITS

Poles on the imaginary axis send the curve to infinity; the plot shows the finite part, and the count already includes the arcs at infinity. Time delay is not modeled.