pzmap and bode do not return zeros for all specified outputs
7 views (last 30 days)
Show older comments
marcel hendrix
on 14 Dec 2023
Commented: marcel hendrix
on 15 Dec 2023
I derived the state-space description of a simple RC network and now want to inspect its poles and (tranmission) zeroes. Surprisingly, pzmap, tzero(systf), and tzero(systss) refuse to return the zeros, while the pretty-printed result from the ZPK function clearly shows them.
% State Equation dx/dt = A x + B u
A = [
-1.6551724137931035e+0003 6.2068965517241384e+0002 1.0344827586206895e+0003
6.4998468694961241e+0002 -2.5999387477984496e+0003 1.9499540608488371e+0003
5.7471264367816090e+0001 1.0344827586206897e+0002 -1.1609195402298849e+0003 ];
B = [
0.0000000000000000e+0000
0.0000000000000000e+0000
1.0000000000000000e+0003 ];
C = [
1.0000000000000000e+0000 0.0000000000000000e+0000 0.0000000000000000e+0000
0.0000000000000000e+0000 1.0000000000000000e+0000 0.0000000000000000e+0000
0.0000000000000000e+0000 0.0000000000000000e+0000 1.0000000000000000e+0000 ];
D = [
0.0000000000000000e+0000
0.0000000000000000e+0000
0.0000000000000000e+0000 ];
xnames = ["v_{C3}" "v_{C2}" "v_{C1}" ];
unames = ["V1" ];
cname = 'Laplace';
sysss = ss(A,B,C,D); systf = tf(sysss); syszpk = zpk(sysss);
figure(1); bodef(systf); figure(2); pzmap(systf);
P = pole(systf); Z = tzero(systf);
sysss, systf, syszpk, Z, P
The printed result is
>> run 'd:\dfwforth\examples\SPICE\ispice\circuits\net_lts\laplace\Laplace.m'
sysss =
A =
x1 x2 x3
x1 -1655 620.7 1034
x2 650 -2600 1950
x3 57.47 103.4 -1161
B =
u1
x1 0
x2 0
x3 1000
C =
x1 x2 x3
y1 1 0 0
y2 0 1 0
y3 0 0 1
D =
u1
y1 0
y2 0
y3 0
Continuous-time state-space model.
Model Properties
systf =
From input to output...
1.034e06 s + 3.9e09
1: ------------------------------------
s^3 + 5416 s^2 + 8.579e06 s + 3.9e09
1.95e06 s + 3.9e09
2: ------------------------------------
s^3 + 5416 s^2 + 8.579e06 s + 3.9e09
1000 s^2 + 4.255e06 s + 3.9e09
3: ------------------------------------
s^3 + 5416 s^2 + 8.579e06 s + 3.9e09
Continuous-time transfer function.
Model Properties
syszpk =
From input to output...
1.0345e06 (s+3770)
1: ---------------------------
(s+2969) (s+1652) (s+795.3)
1.95e06 (s+2000)
2: ---------------------------
(s+2969) (s+1652) (s+795.3)
1000 (s+2919) (s+1336)
3: ---------------------------
(s+2969) (s+1652) (s+795.3)
Continuous-time zero/pole/gain model.
Model Properties
Z =
0×1 empty double column vector
P =
1.0e+03 *
-2.9692
-1.6515
-0.7953
>>
Z is 0x1 vector? The pzmap plot only shows poles:
What am I doing wrong? Is it that MATLAB's pzmap has a problem with the fact that this (MIMO) network has 3 transfer functions?
0 Comments
Accepted Answer
Sulaymon Eshkabilov
on 14 Dec 2023
Here is the corrected code:
A = [
-1.6551724137931035e+0003 6.2068965517241384e+0002 1.0344827586206895e+0003
6.4998468694961241e+0002 -2.5999387477984496e+0003 1.9499540608488371e+0003
5.7471264367816090e+0001 1.0344827586206897e+0002 -1.1609195402298849e+0003 ];
B = [
0.0000000000000000e+0000
0.0000000000000000e+0000
1.0000000000000000e+0003 ];
C = [
1.0000000000000000e+0000 0.0000000000000000e+0000 0.0000000000000000e+0000
0.0000000000000000e+0000 1.0000000000000000e+0000 0.0000000000000000e+0000
0.0000000000000000e+0000 0.0000000000000000e+0000 1.0000000000000000e+0000 ];
D = [
0.0000000000000000e+0000
0.0000000000000000e+0000
0.0000000000000000e+0000 ];
xnames = ["v_{C3}" "v_{C2}" "v_{C1}" ];
unames = ["V1" ];
cname = 'Laplace';
sysss = ss(A,B,C,D);
systf = tf(sysss);
[ZeroS, PoleS, GainS] = zpkdata(sysss)
figure(1); bode(systf); figure(2); pzmap(systf(1,1)), hold on;pzmap(systf(2,1)), pzmap(systf(3,1))
% P = pole(systf); Z = tzero(systf);
% sysss, systf, syszpk, Z, P
2 Comments
More Answers (1)
Paul
on 15 Dec 2023
Edited: Paul
on 15 Dec 2023
Hi Marcel,
There isn't really a problem. If you want to get the pzmap of each individual transfer function of MIMO system, then you have to call pzmap on each individual I/O pair in the system, as in @Sulaymon Eshkabilov's answer. If all you want are the pzmaps, there's no need to convert the ss model to a tf (and if you already have an ss object, there's rarely, if ever a need to convert to tf, and if you do want to convert to tf consider converting to zpk instead).
A = [
-1.6551724137931035e+0003 6.2068965517241384e+0002 1.0344827586206895e+0003
6.4998468694961241e+0002 -2.5999387477984496e+0003 1.9499540608488371e+0003
5.7471264367816090e+0001 1.0344827586206897e+0002 -1.1609195402298849e+0003 ];
B = [
0.0000000000000000e+0000
0.0000000000000000e+0000
1.0000000000000000e+0003 ];
C = [
1.0000000000000000e+0000 0.0000000000000000e+0000 0.0000000000000000e+0000
0.0000000000000000e+0000 1.0000000000000000e+0000 0.0000000000000000e+0000
0.0000000000000000e+0000 0.0000000000000000e+0000 1.0000000000000000e+0000 ];
D = [
0.0000000000000000e+0000
0.0000000000000000e+0000
0.0000000000000000e+0000 ];
xnames = ["v_{C3}" "v_{C2}" "v_{C1}" ];
unames = ["V1" ];
cname = 'Laplace';
sysss = ss(A,B,C,D);
figure
pzmap(sysss(1,1),sysss(2,1),sysss(3,1))
The documentation for pzmap states that "For SISO systems, pzmap plots the system poles and zeros. For MIMO systems, pzmap plots the system poles and transmission zeros." And it later says that these zeros are the output of tzero.
The concept of zeros, paticularly for non-SISO systems is very complex and can be tricky even for SISO sytems. In fact, it's so easy to get wrong that the second sentence in the quoted statement from the pzmap doc is actually incorrect.
Consider a simple SISO system:
h = zpk([-1],[-2 -3],1)
The system zeros are defined as the roots of the numerator, which in this case is s0 = -1, and is the result returned from tzero
tzero(h)
Now add an additional zero in the numerator at the same location as a pole
h = zpk([-1 -2],[-2 -3],1)
Again, tzero returns both zeros from the numerator
tzero(h)
And both are showed by pzmap
figure
pzmap(h)
However, the zero at s0 = -2 IS NOT a transmission zero. And, if you check the doc page for tzero it says that if the system is non-minimal then the function actually returns the invariant zeros, not the transmission zeros (for the SISO case as in this example, system zeros and invariant zeros are the same). The doc page for pzmap should say that for MIMO systems it plots the invariant zeros.
Now, in your problem we have a system with 3 outputs and 1 input. For non-SISO (which I'll just call MIMO for generality) systems, the concept of zeros (and poles for that matter) becomes an absolute nightmare, and the nightmare becomes worse if we allow for systems with non-minimal state space realizations.
For MIMO systems, the invariant zeros as returned from tzero (and the transmission zeros which are the same as the invariant zeros or a subset of them depending on the system) will not, in general, be the same as the zeros of any individual transfer function in the transfer function matrix. In your example, each element of systf has one or more zeros, but the transfer function matrix as whole deoesn't have any invariant (or transmission) zeros, as indicated by tzero
tzero(sysss)
The converse can also be true. Consider this 2x2 transfer function matrix
G = [zpk(1) zpk([],-3,1);0 1]
None of the four elements have a zero, but the system as a whole has a transmission zero.
tzero(G)
This link (from which I took the preceding example) may be of interest, and you can find many other resources on the net from university classes that go into additional related concepts. It's a really complicated topic. If you want a good textbook, try Linear Systems (Kailath); I'm sure there are many others.
See Also
Categories
Find more on Stability Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!