## The Nyquist Diagram for Electrical Circuits

**Introduction**

The Nyquist diagram of a transfer function is a parametric plot of its imaginary part versus real part as the frequency sweeps in a certain range [1]. When dealing with electric circuits, the transfer function is the immittance [2] of the circuit, i.e. it can be either the impedance [3] or the admittance [4] of the circuit. Depending upon the circuit’s electrical components and configuration, one may prefer impedance to admittance or vice versa for plotting the Nyquist diagram. The impedance of an electric circuit is represented by

\[ Z = R + jX\]

where \( R \) and \( X \) are *resistance* and *reactance*, respectively both expressed in *ohm* [Ω]. In the case of admittance, the circuit’s transfer function is given by

\[ Y = Z^{-1} = G + jB\]

in which \( G \) and \( B \) are *conductance* and *susceptance*, respectively and represented by *siemens* [S].

All these components are frequency dependent and so a Nyquist diagram depicts the immittance variations in the complex plane as frequency sweeps from zero to infinity. In this post, the Nyquist plot of a hybrid RC circuit in both impedance and admittance modes are analyzed theoretically and verified experimentally. The experiment has been done on the following circuit by an MFLI Lock-in Amplifier using the MF-IA Impedance Analyzer option and the frequency sweeper module of LabOne user interface.

**Mathematical Background **

The impedance of the hybrid RC circuit shown in Fig.1 is obtained as follows.

\[ Z = R_s+\frac{R_p}{1+j\omega R_p C} = R_s+\frac{R_p}{1+(\omega R_p C)^2} – j\frac{\omega R_p^2C}{1+(\omega R_p C)^2} \]

The above equation shows the real and imaginary parts of the impedance in terms of angular frequency \( \omega \). In other words, the resistance and reactance of the circuit are given by

\[ R = R_s+\frac{R_p}{1+(\omega R_p C)^2} \quad\quad\quad\quad\quad\quad\quad X = \frac{-\omega R_p^2C}{1+(\omega R_p C)^2} \]

Removing the frequency parameter from the above real and imaginary components, we obtain the following equation governing the behavior of impedance in the complex plane.

\[ \bigg(R-R_s-\frac{R_p}{2}\bigg)^2+X^2=\bigg(\frac{R_p}{2}\bigg)^2 \]

Since \(X<0\), this equation describes a half-circle in the lower complex plane with the following center and radius.

\[ \text{Center:}\ \bigg(R_s+\frac{R_p}{2},\ 0\bigg) \quad\quad\quad\quad\quad\quad\quad \text{Radius:}\ \frac{R_p}{2} \]

The boundaries of the half-circle happen at the following points corresponding to DC and high frequencies.

\[ f\rightarrow 0:\quad (R_s+R_p,\ 0)\quad\quad\quad\quad\quad\quad f\rightarrow \infty:\quad (R_s,\ 0)\]

Fig. 2 depicts the impedance Nyquist plot of the hybrid RC circuit shown in Fig. 1 with a capacitor of 100 nF, a series resistor of 200 Ω, and a parallel resistor of 1 kΩ.

The characteristics of the minimum point in the impedance Nyquist plot are represented by

\[ \text{Min:}\ \bigg(R_s+\frac{R_p}{2},\ \frac{R_p}{2}\bigg) \quad\quad\quad\quad\quad\quad\quad \omega=\frac{1}{R_pC} \]

The same procedure can be carried out for the admittance of the hybrid RC circuit. The real and imaginary parts of the admittance of the circuit shown in Fig. 1 are calculated as follows.

\[ G =\frac{1+\omega^2 C^2 R_p R_e}{(R_s+R_p)(1+(\omega R_e C)^2)}\quad\quad\quad\quad\quad B=\frac{\omega C R_p R_e}{R_s(R_s+R_p)(1+(\omega R_e C)^2)} \]

where \( R_e \) is the parallel equivalent of the series and parallel resistors given by

\[ R_e = R_s||R_p = \frac{R_s R_p}{R_s + R_p} \]

Again, removing the frequency parameter from the conductance and susceptance results in the following circle equation.

\[ \bigg(G-\frac{R_p+2R_s}{2R_s(R_p+R_s)}\bigg)^2+B^2=\bigg(\frac{R_p}{2R_s(R_s+R_p)}\bigg)^2 \]

Since \( B>0 \), the above equation describes a half-circle in the upper complex plane with the following center and radius.

\[ \text{Center:}\ \bigg(\frac{R_p+2R_s}{2R_s(R_s+R_p)},\ 0\bigg) \quad\quad\quad\quad\quad\quad\quad \text{Radius:}\ \frac{R_p}{2R_s(R_s+R_p)} \]

Fig. 3 shows the admittance Nyquist diagram of the hybrid circuit in Fig. 1 corresponding to the same resistors and capacitor used for Fig. 2.

As obtained from the expressions, the boundary points corresponding to zero and infinite frequencies are given below.

\[ f\rightarrow 0:\quad \bigg(\frac{1}{R_s+R_p},\ 0\bigg)\quad\quad\quad\quad\quad\quad\quad f\rightarrow \infty:\quad \bigg(\frac{1}{R_s},\ 0\bigg) \]

Moreover, the maximum point on top of the circle has the following characteristics.

\[ \text{Max:}\ \bigg(\frac{R_p+2R_s}{2R_s(R_p+R_s)},\ \frac{R_p}{2R_s(R_s+R_p)}\bigg) \quad\quad\quad\quad\quad\quad\quad \omega=\frac{1}{R_eC} \]

It is worth noting that the maximum of the admittance Nyquist plot and the minimum of the impedance Nyquist plot occur at different frequencies as shown in Fig. 2 and Fig. 3. Furthermore, the Nyquist diagram of the hybrid RC circuit is independent from the capacitor value and it only depends upon the series and parallel resistors.

**Experimental Results **

The circuit elements used for the configuration in Fig. 1 are nominally a 2.2 kΩ series resistor, a 6.8 kΩ parallel resistor, and a 1 μF capacitor. First for more accuracy, the actual values of the electric components are measured individually using the MFIA Impedance Analyzer or simply by an LCR meter. It turns out that the actual values are 2177 Ω, 6766 Ω, and 995 nF, respectively. The circuit elements are joined to make the hybrid configuration in Fig. 1 and then, using a crocodile-clip cable the circuit is connected to the MFLI in a 4-terminal configuration.

The measurement is controlled by a MATLAB function which takes advantage of the Sweep Module of the LabOne MATLAB API given by the ziDAQ routine. The function receives the start and stop frequencies and also the number of frequencies and then configures the device to sweep the frequency and measure the impedance at each individual frequency. The results including the frequency range and the real and imaginary components of the circuit’s impedance are finally saved in a text file. Another MATLAB script is used to read the measured data for processing and plotting. The following lines show how to read the measured data saved in the ‘impedance.txt’ file and to extract the frequency and impedance values and to calculate the admittance of the circuit.

`%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%`

% Reading measured data from file

`file_name = 'impedance.txt';`

fid = fopen(file_name,'r');

data = dlmread(file_name,'',3,0);

fclose(fid);

`% Extracting frequency and impedance`

`freq = data(:,1);`

realZ = data(:,2);

imagZ = data(:,3);

`% Calculating the admittance`

`absZ = sqrt(realZ.^2 + imagZ.^2);`

realY = realZ./(absZ.^2);

imagY = -imagZ./(absZ.^2);

`%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%`

In order to plot the real and imaginary components of the impedance or admittance the following lines can be used.

`%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%`

`figure('Name','Impedance Spectroscopy','NumberTitle','on');`

`set(gca,'FontSize',12,...`

'LineWidth',2,...

'Color',[1 1 1],...

'Box','on');

`h = semilogx(freq,realZ);`

set(h,'LineWidth',2.5,'LineStyle','-','Color','b')

hold on;

h = semilogx(freq,imagZ);

set(h,'LineWidth',2.5,'LineStyle','-.','Color','r')

grid on;

`title('Impedance Spectroscopy','fontsize',12,'fontweight','n','color','k');`

xlabel('Frequency [Hz]','fontsize',12,'fontweight','n','color','k');

ylabel('Impedance [\Omega]','fontsize',12,'fontweight','n','color','k');

`h = legend('Real Z','Imag Z');`

set(h,'Box','on','Color','w','Location','NorthEast','FontSize',12)

`%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%`

Finally, the measured resistance and reactance of the circuit versus frequency are depicted in Fig. 4. Such a representation is also called *impedance spectroscopy. *

To obtain the Nyquist diagram, we need to plot the imaginary part of immittance versus its real part. It should be noted that for having a sensible plot, the figure axes must be in the same scale. Before plotting the measured data, it is useful to have the expected plot from theory which can be calculated by the following lines.

`%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%`

% Number of frequency points

`NumPoints = 1001;`

`% Theoretical impedance components`

`Zr = linspace(Rs,Rp+Rs,NumPoints);`

Zi = -sqrt((Rp/2)^2 - (Zr - Rs - Rp/2).^2);

`% Critical point`

`MinIndex = find(Zi == min(Zi));`

`%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%`

Now, we can compare the measured data with the analytical results to evaluate our measurement accuracy. The following code generates the impedance Nyquist plot from the measured data in comparison with the expected mathematical results.

`%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%`

`figure('Name','Impedance Spectroscopy','NumberTitle','on');`

`set(gca,'FontSize',12,...`

'LineWidth',2,...

'Color',[1 1 1],...

'Box','on');

`h = plot(Zr,Zi);`

set(h,'LineWidth',1.5,'LineStyle','--','Color','b')

hold on

h = plot(realZ,imagZ);

set(h,'LineWidth',1,'LineStyle','none','Color','r',...

'Marker','o','MarkerSize',4,'MarkerEdgeColor','k','MarkerFaceColor','m');

grid on

title('Impedance','fontsize',12,'color','k');

xlabel('Resistance [\Omega]','fontsize',12,'fontweight','n','color','k');

ylabel('Reactance [\Omega]','fontsize',12,'fontweight','n','color','k');

`MinX = min(realZ);`

MaxX = max(realZ);

MinY = min(imagZ);

MaxY = max(imagZ);

LimXY = max(max(abs(MinY),abs(MaxY)),max(abs(MinX),abs(MaxX)))*0.05;

LIM = 0.5*abs((MaxX-MinX)-(MaxY-MinY));

if (MaxX-MinX)>(MaxY-MinY)

LimX = [MinX-LimXY MaxX+LimXY];

LimY = [MinY-LIM-LimXY MaxY+LIM+LimXY];

else

LimX = [MinX-LIM-LimXY MaxX+LIM+LimXY];

LimY = [MinY-LimXY MaxY+LimXY];

end

xlim(LimX);

ylim(LimY);

axis square

`h = legend('Theory','Experiment');`

set(h,'Box','on','Color','w','Location','SouthWest','FontSize',12)

txtStart = ['f = ' num2str(freq(1)) ' Hz \rightarrow'];

text(realZ(1),imagZ(1),txtStart,'HorizontalAlignment','right')

txtStop = ['\leftarrow f = ' num2str(freq(end)) ' Hz'];

text(realZ(end),imagZ(end),txtStop,'HorizontalAlignment','left')

MinImagZ = min(imagZ);

MinIndexZ = find(imagZ == MinImagZ);

txtMin = ['f = ' num2str(round(freq(MinIndexZ))) ' Hz \uparrow'];

text(realZ(MinIndexZ),imagZ(MinIndexZ),txtMin,'FontSize',12,...

'HorizontalAlignment','right','VerticalAlignment','top')

`%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%`

The impedance Nyquist diagram is plotted in Fig. 5. As it is clear from the figure, the measurement is in an excellent agreement with the theory. It implies the correctness of the measurement method and the reliability of the data measured by the MFIA Impedance Analyzer.

The admittance can also be plotted similar to the impedance. Fig. 6 compares the experimental results in blue circles with the theoretical data in red dashed line. According to the figure, again the theory and measurement are in almost perfect match.

As shown in Fig. 5 and Fig. 6, the impedance minimum point happens at the frequency 23 Hz while the admittance maximum point occurs at 100 Hz.

**Conclusion **

The MFLI Lock-in Amplifier with MF-IA Impedance Analyzer option and the MFIA Impedance Analyzer are capable of measuring the impedance of an arbitrary circuit in a certain frequency range for plotting the circuit’s Nyquist diagram as a useful tool for describing its spectral behavior. Moreover, the comparison between the real measurement and the expected theoretical results demonstrates a high-accuracy and precise measurement that can be carried out by Zurich Instruments Impedance Products.

**References**

- Wikipedia: “Nyquist plot.”
- Wikipedia: “Immittance.”
- Wikipedia: “Impedance.”
- Wikipedia: “Admittance.”