Title: Result of the damp function for discrete time systems · Issue #646 · python-control/python-control · GitHub
Open Graph Title: Result of the damp function for discrete time systems · Issue #646 · python-control/python-control
X Title: Result of the damp function for discrete time systems · Issue #646 · python-control/python-control
Description: Hi, This is my first contribution on GitHub ;) Problem The method damp() seems to return a wrong result for discrete systems with negative poles import control as ctl H = ctl.tf([1],[1,0.2],1) H.damp() Result : RuntimeWarning: invalid va...
Open Graph Description: Hi, This is my first contribution on GitHub ;) Problem The method damp() seems to return a wrong result for discrete systems with negative poles import control as ctl H = ctl.tf([1],[1,0.2],1) H.da...
X Description: Hi, This is my first contribution on GitHub ;) Problem The method damp() seems to return a wrong result for discrete systems with negative poles import control as ctl H = ctl.tf([1],[1,0.2],1) H.da...
Opengraph URL: https://github.com/python-control/python-control/issues/646
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Result of the damp function for discrete time systems","articleBody":"Hi, \r\n\r\nThis is my first contribution on GitHub ;)\r\n\r\n### Problem \r\n\r\nThe method `damp()` seems to return a wrong result for discrete systems with negative poles\r\n\r\n```\r\nimport control as ctl\r\nH = ctl.tf([1],[1,0.2],1)\r\nH.damp()\r\n```\r\n\r\nResult : RuntimeWarning: invalid value encountered in log\r\n\r\n### Investigation\r\n\r\nThe problem seems to come from the type of the `poles` variable in the `damp`method of the LTI object\r\n\r\n```\r\nif isdtime(self, strict=True):\r\n splane_poles = np.log(poles)/self.dt\r\nelse:\r\n splane_poles = poles\r\nwn = absolute(splane_poles)\r\nZ = -real(splane_poles)/wn\r\nreturn wn, Z, poles\r\n```\r\n\r\n### Solution\r\n\r\nThe `poles` variable must be cast to a numpy complex type as follows\r\n\r\n```\r\nif isdtime(self, strict=True)\r\n splane_poles = np.log(poles.astype(complex))/self.dt\r\n...\r\n```\r\n","author":{"url":"https://github.com/vincentchoqueuse","@type":"Person","name":"vincentchoqueuse"},"datePublished":"2021-08-17T06:48:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/646/python-control/issues/646"}
| 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:3f7d2733-f936-4de2-c005-f0efd29273f5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A9AE:3A866A:FB708B:15E8E67:697BA1E7 |
| html-safe-nonce | 2e294ab1a511637bb6fc8a21cc44bce27ef7c962b3561af039c8474fbd31d52f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUFFOjNBODY2QTpGQjcwOEI6MTVFOEU2Nzo2OTdCQTFFNyIsInZpc2l0b3JfaWQiOiI1NjY2OTM5OTEyNjU4MzMwMDg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6f44a492f7f382a798ceb6cff2205bfdbf2886e6f0665a34ceb21707d69e56ca |
| hovercard-subject-tag | issue:972357407 |
| 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/646/issue_layout |
| twitter:image | https://opengraph.githubassets.com/083d594702f70e776f9d0b81004b1ae8970fda276968eb6c1979367edd292bbc/python-control/python-control/issues/646 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/083d594702f70e776f9d0b81004b1ae8970fda276968eb6c1979367edd292bbc/python-control/python-control/issues/646 |
| og:image:alt | Hi, This is my first contribution on GitHub ;) Problem The method damp() seems to return a wrong result for discrete systems with negative poles import control as ctl H = ctl.tf([1],[1,0.2],1) H.da... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vincentchoqueuse |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7ba9ae7380317898f1b98f4cf41e78605ff2d68007cb4db4e46bdaf7e9423d2e |
| 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 | d52dd9b71f0e5da9cfd694fb2faae78a81d8e46f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width