Engee documentation
Notebook

Location of poles and zeros

This example shows how to investigate the location of poles and zeros of dynamical systems. This can be done graphically by building a map using pzmap. And you can find numerical values using the function zpkdata.

Studying the location of poles and zeros can be useful for tasks such as stability analysis. This example compares two closed-loop systems that have the same transfer function of the control object and different controllers.


Let's create two models of closed-loop systems.

In [ ]:
Pkg.add(["ControlSystems"])
In [ ]:
using ControlSystems

G = zpk([], [-5, -5, -10], 100)
C1 = pid(2.9, 7.1)
CL1 = feedback(G * C1, 1)
C2 = pid(29, 7.1)
CL2 = feedback(G * C2, 1)
Out[0]:
TransferFunction{Continuous, ControlSystemsBase.SisoZpk{Float64, ComplexF64}}
                              (1.0s + 5.000000140181413)(1.0s + 4.999999859818593)(1.0s + 0.14084507042253516)
2900.0---------------------------------------------------------------------------------------------------------------------------------
      (1.0s + 5.0)(1.0s + 5.0)(1.0s + 21.10553800168399)(1.0s^2 - 1.2358649411320777s + 148.49404080219574)(1.0s + 0.13032693944811272)

Continuous-time transfer function model

The C2 controller has a much higher proportional gain. Otherwise, the two closed-loop systems CL1 and CL2 are the same.

Graphically, we examine the location of the poles and zeros of both systems.

In [ ]:
pzmap(CL1,label="CL1")
pzmap!(CL2,label="CL2")
Out[0]:

pzmap displays the location of poles and zeros on the complex plane as x and o marks, respectively. When providing multiple models, the poles and zeros of each model are displayed in a different color. Here, the poles and zeros of CL1 are highlighted in orange, and the poles and zeros of CL2 are highlighted in purple. The zeros of the functions are the same, so when superimposed on each other, the color is green.

The graph shows that all poles of CL1 are in the left half-plane and, therefore, CL1 is stable. The model of the CL2 system contains poles in the right half-plane, therefore it is unstable.

Let's calculate the numerical values of the location of the poles and zeros in CL2 using zpkmap. This function returns three values in the following order: gain (k), poles (p), zeros (z).

In [ ]:
z,p,k = zpkdata(CL2)
display(z)
display(p)
1×1 Matrix{Vector{ComplexF64}}:
 [-5.000000140181413 + 0.0im, -4.999999859818593 + 0.0im, -0.14084507042253516 + 0.0im]
1×1 Matrix{Vector{ComplexF64}}:
 [-5.0 + 0.0im, -5.0 + 0.0im, -21.10553800168399 + 0.0im, 0.6179324705660388 + 12.170135589385021im, 0.6179324705660388 - 12.170135589385021im, -0.13032693944811272 + 0.0im]

There is also a separate function for finding poles. - poles, and to search for zeros - tzeros. Let's find the individual values for the CL1 system.

In [ ]:
poles(CL2)
Out[0]:
6-element Vector{ComplexF64}:
                 -5.0 + 0.0im
                 -5.0 + 0.0im
   -21.10553800168399 + 0.0im
   0.6179324705660388 + 12.170135589385021im
   0.6179324705660388 - 12.170135589385021im
 -0.13032693944811272 + 0.0im
In [ ]:
tzeros(CL1)
Out[0]:
3-element Vector{ComplexF64}:
  -5.0000000890586955 + 0.0im
   -4.999999910941301 + 0.0im
 -0.14084507042253533 + 0.0im

tzero and poles column vectors containing the locations of the zeros and poles of the system are returned.

With the help of knowledge of finding the poles and zeros of the transfer function of the system, it is possible to judge its stability. More functions for analyzing the stability of the system can be found in the [Analysis] section (https://engee.com/helpcenter/stable/julia/ControlSystems/lib/analysis.html ).