Title: ComplexWarning while trying to plot a pzmap · Issue #288 · python-control/python-control · GitHub
Open Graph Title: ComplexWarning while trying to plot a pzmap · Issue #288 · python-control/python-control
X Title: ComplexWarning while trying to plot a pzmap · Issue #288 · python-control/python-control
Description: I would like to understand why the zeros from my sys3 transfer function below aren't being plotted by the pzmap function. #sys1 num = [6., 0., 1.] den = [1., 3., 3., 1.] sys = control.tf(num, den) #sys2 n1 = [1., 1.] n2 = [1., 2.] d1 = [...
Open Graph Description: I would like to understand why the zeros from my sys3 transfer function below aren't being plotted by the pzmap function. #sys1 num = [6., 0., 1.] den = [1., 3., 3., 1.] sys = control.tf(num, den) ...
X Description: I would like to understand why the zeros from my sys3 transfer function below aren't being plotted by the pzmap function. #sys1 num = [6., 0., 1.] den = [1., 3., 3., 1.] sys = control.tf(num, d...
Opengraph URL: https://github.com/python-control/python-control/issues/288
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ComplexWarning while trying to plot a pzmap","articleBody":"I would like to understand why the zeros from my sys3 transfer function below aren't being plotted by the `pzmap` function.\r\n\r\n```\r\n#sys1\r\nnum = [6., 0., 1.]\r\nden = [1., 3., 3., 1.]\r\nsys = control.tf(num, den)\r\n\r\n#sys2\r\nn1 = [1., 1.]\r\nn2 = [1., 2.]\r\nd1 = [1., 2.j]\r\nd2 = [1., -2.j]\r\nd3 = [1., 3.]\r\nnum2 = np.convolve(n1, n2)\r\nden2 = np.convolve(d1,np.convolve(d2, d3))\r\nsys2 = control.tf(num2, den2)\r\n\r\n#sys3\r\nnum3 = np.convolve(num, den2)\r\nden3 = np.convolve(den, num2)\r\nsys3 = control.tf(num3, den3)\r\n\r\ncontrol.pzmap(sys3, Plot=True, title=\"Mapa de polos e zeros\")\r\n```\r\n\r\nWhen `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:\r\n\r\n```\r\nxxx/anaconda3/lib/python3.7/site-packages/control/xferfcn.py:864: ComplexWarning: Casting complex values to real discards the imaginary part\r\n num[i, j, np+1-len(numpoly):np+1] = numpoly[::-1]\r\n```\r\n\r\nIf the problem is the removal of the imaginary parts by that part of the algorithm, why is that happening then?","author":{"url":"https://github.com/fabiomolinar","@type":"Person","name":"fabiomolinar"},"datePublished":"2019-04-10T10:35:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/288/python-control/issues/288"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0e351d44-7c2c-985c-0b83-aa544fe20ca8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A8FE:295F80:2385F3B:2FBC31C:697ABF66 |
| html-safe-nonce | 607c7ab290b9dd67b9ba7890444a56c4642f00de08560c82c6b170e90cc00f73 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEZFOjI5NUY4MDoyMzg1RjNCOjJGQkMzMUM6Njk3QUJGNjYiLCJ2aXNpdG9yX2lkIjoiNTM4NjkwMzEwNTc0NjY4MTcwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2a654614db8a4629ebf4e268d9f2d1d09f280926c83a00411ab45d0059fc1edd |
| hovercard-subject-tag | issue:431428704 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-control/python-control/288/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a6cec05836a52069f60019e83a57f56eeb513d44e7a696426c34a1a04a82441a/python-control/python-control/issues/288 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a6cec05836a52069f60019e83a57f56eeb513d44e7a696426c34a1a04a82441a/python-control/python-control/issues/288 |
| og:image:alt | I would like to understand why the zeros from my sys3 transfer function below aren't being plotted by the pzmap function. #sys1 num = [6., 0., 1.] den = [1., 3., 3., 1.] sys = control.tf(num, den) ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fabiomolinar |
| hostname | github.com |
| expected-hostname | github.com |
| None | 37b00135a01848812420158e49744eb9715c1ef534ee4552f790d6ef33807fc2 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-control/python-control git https://github.com/python-control/python-control.git |
| octolytics-dimension-user_id | 2285872 |
| octolytics-dimension-user_login | python-control |
| octolytics-dimension-repository_id | 22791752 |
| octolytics-dimension-repository_nwo | python-control/python-control |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 22791752 |
| octolytics-dimension-repository_network_root_nwo | python-control/python-control |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 78685bd12c01954e3a0e08fc52173e9b3e48215d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width