You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When control.pzmap runs, it returns the correct poles and zeros, together with a plot. The problem is, this plot contains only the roots of the sys3 transfer function. Together with the plot, I am also getting the following warning message:
xxx/anaconda3/lib/python3.7/site-packages/control/xferfcn.py:864: ComplexWarning: Casting complex values to real discards the imaginary part
num[i, j, np+1-len(numpoly):np+1] = numpoly[::-1]
If the problem is the removal of the imaginary parts by that part of the algorithm, why is that happening then?
Which version of python-control are you running? On the latest master, the plot looks right to me:
(note that there are four overlapping poles around the point -1).
I also get the warning message; not sure yet what is up with that. It is coming from xferfcn._common_den() and may just be some numerical issue (that goes away when you create sys3 directly.
Looks like this was flagged in issue #154 and fixed in PR #193. This is scheduled for release with 0.8.2, which should be coming soon (this weekend, I hope).
Implicitly we assume that all transfer functions have real coefficients, so the warning message is because you are creating a transfer function that violates this assumption. We should probably generate a warning when the transfer function is created (or expand the toolbox to allow for complex transfer functions, but this is probably going overboard).
Activity
fabiomolinar commentedon Apr 10, 2019
When I create my sys3 directly like this:
I don't get the
warning. But the plot still don't show the zeros of the transfer function.murrayrm commentedon Apr 11, 2019
Which version of

python-controlare you running? On the latest master, the plot looks right to me:(note that there are four overlapping poles around the point -1).
I also get the warning message; not sure yet what is up with that. It is coming from
xferfcn._common_den()and may just be some numerical issue (that goes away when you createsys3directly.fabiomolinar commentedon Apr 11, 2019
Yeah, I have calculated the poles and zeros beforehand, so I was aware about the multiple poles at -1.0.
Regarding the version, I am using 0.8.1. Looking at the repository's branches, it seems that 0.8.1 is one of the latest ones, right?
fabiomolinar commentedon Apr 11, 2019
And this is what I am getting:
murrayrm commentedon Apr 11, 2019
Looks like this was flagged in issue #154 and fixed in PR #193. This is scheduled for release with 0.8.2, which should be coming soon (this weekend, I hope).
murrayrm commentedon Apr 11, 2019
I chased down the source of the warning message. The code snippet
creates a polynomial
den2that has complex coefficients (sinced1andd2are complex). The result I get isWhen you then construct subsequent transfer functions, you end up with complex coefficients there as well. For example
gives
Now, when you compute poles for this transfer function you get the warning:
If, on the other hand, you compute the poles for a polynomial with real coefficients, things are OK:
Implicitly we assume that all transfer functions have real coefficients, so the warning message is because you are creating a transfer function that violates this assumption. We should probably generate a warning when the transfer function is created (or expand the toolbox to allow for complex transfer functions, but this is probably going overboard).