Title: fix time series inconsistency between continuous and discrete time simulations by murrayrm · Pull Request #295 · python-control/python-control · GitHub
Open Graph Title: fix time series inconsistency between continuous and discrete time simulations by murrayrm · Pull Request #295 · python-control/python-control
X Title: fix time series inconsistency between continuous and discrete time simulations by murrayrm · Pull Request #295 · python-control/python-control
Description: As pointed out in issue #239, there is an inconsistency between the way that continuous time simulations and discrete time simulations return their outputs for single output systems. In continuous time, the code follows the documentation and the following works: t, y = step_response(sys) plot(t, y) However, in discrete time simulations the returned value for y had shape (1, len(t)), which meant that you had to do the following for discrete time systems: t, y = step_response(sysd) plot(t, y[0]) The problem was that for continuous time simulations forced_response() (the ultimate function that gets called) had an np.squeeze() at the end but this wasn't present for discrete time simulations. This PR fixes that problem so that the behavior is consistent, resolving the bug in issue #239. Other small changes: Added unit tests that catch the original bug Added a squeeze keyword that controls whether this behavior is implemented (default = True). Did some PEP8 cleanup on timeresponse.py Note that this may make some existing code break since discrete time simulations can now return an output that is a 1D array instead of 2D. The fix is either to remove the output index (y[0] becomes y) or set the squeeze keyword to False).
Open Graph Description: As pointed out in issue #239, there is an inconsistency between the way that continuous time simulations and discrete time simulations return their outputs for single output systems. In continuous...
X Description: As pointed out in issue #239, there is an inconsistency between the way that continuous time simulations and discrete time simulations return their outputs for single output systems. In continuous...
Opengraph URL: https://github.com/python-control/python-control/pull/295
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:ff8366de-6212-2882-3cc1-e4f19d2522b8 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | AE66:27ED3:DCF575:137EF5F:697B8BFA |
| html-safe-nonce | a6a02298981b2d4361820f725ab72340d800d83fccb1c701782fbd4631cbccb5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTY2OjI3RUQzOkRDRjU3NToxMzdFRjVGOjY5N0I4QkZBIiwidmlzaXRvcl9pZCI6IjY2MDI4MjkzOTI1ODQwODQ0NzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | aac71c9407ffce2e94f4ea0289ff4fa5278bfa036036768270ed3231f6b4fdd0 |
| hovercard-subject-tag | pull_request:272221587 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/python-control/python-control/pull/295/checks |
| twitter:image | https://avatars.githubusercontent.com/u/293362?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/293362?s=400&v=4 |
| og:image:alt | As pointed out in issue #239, there is an inconsistency between the way that continuous time simulations and discrete time simulations return their outputs for single output systems. In continuous... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 86b3730167656228ed8d24c4f0770806131d1f695bff36b9485630bb7443aa64 |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6adfecb5bc9d8f1aac645d1f3797aca9d302dd85 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width