Title: proposal to standardize squeezing output from systems · Issue #453 · python-control/python-control · GitHub
Open Graph Title: proposal to standardize squeezing output from systems · Issue #453 · python-control/python-control
X Title: proposal to standardize squeezing output from systems · Issue #453 · python-control/python-control
Description: Proposal: When computing frequency and time response output of systems, standardize on indexing first element so output is a 1D array if system is SISO and squeeze=True. This is instead of applying numpy.squeeze to output. Currently, the...
Open Graph Description: Proposal: When computing frequency and time response output of systems, standardize on indexing first element so output is a 1D array if system is SISO and squeeze=True. This is instead of applying...
X Description: Proposal: When computing frequency and time response output of systems, standardize on indexing first element so output is a 1D array if system is SISO and squeeze=True. This is instead of applying...
Opengraph URL: https://github.com/python-control/python-control/issues/453
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"proposal to standardize squeezing output from systems","articleBody":"Proposal: When computing frequency and time response output of systems, standardize on indexing first element so output is a 1D array if system is SISO and `squeeze=True`. This is instead of applying `numpy.squeeze` to output. \r\n\r\nCurrently, there are two ways that python-control squeezes output:\r\n\r\n1. __apply 'squeeze' to the output at the end__. This is what functions in `timeresp.py` do, e.g. `forced_response` (edit: and ``iosys`` time responses). An m x n MIMO system (m-output, n-input, m,n\u003e1) produces a [m x n x k] array, where k is the number of data points in time. But a 1 x n system's output gets squeezed to [n x k] and a m x 1 is squeezed to [m x k]. \r\n\r\n2. __use indexing to extract the first element if SISO, otherwise leave a full array__. This is what the frequency response functions `evalfr`, `freqresp` do. If SISO, give [k] length array; MIMO systems always produce [m x n x k] arrays. \r\n\r\nI propose to standardize on the latter: a MIMO system should always output [m x n x k] arrays. Rationale: this facilitates interconnection and keeps indexing the system and its outputs consistent. Along with the proposal: retain the `squeeze=True` keyword argument because it's already in use, but do the 'squeeze' by indexing the first element, and only do it if SISO. \r\n\r\nDocumentation would read something like: \r\n\r\n\"If squeeze is True (default) and sys is single input single output (SISO), returns a 1D array equal to the length k of the input, otherwise returns an (n_outputs, n_inputs, k) array for multiple input multiple output (MIMO) systems.\"\r\n\r\nThis is relevant for #449 and popped up in #442. ","author":{"url":"https://github.com/sawyerbfuller","@type":"Person","name":"sawyerbfuller"},"datePublished":"2020-08-17T17:20:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":30},"url":"https://github.com/453/python-control/issues/453"}
| 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:9a67f8d4-de7c-146a-1826-e77d6d1842a4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 820A:2A2E63:2E18C5F:3EB438A:6979B8B8 |
| html-safe-nonce | 1015c45803b8a366801d8456fb15bbe8a7487a637d51112b689aa40b8bb0c950 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjBBOjJBMkU2MzoyRTE4QzVGOjNFQjQzOEE6Njk3OUI4QjgiLCJ2aXNpdG9yX2lkIjoiNDM2ODI1NjQzNTAyNDkzNTA5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 459aac23b066a21dbcbe771afa7a4784a34fe4ce0e8d7d02c4a936ec8aa25da8 |
| hovercard-subject-tag | issue:680397927 |
| 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/453/issue_layout |
| twitter:image | https://opengraph.githubassets.com/57eb4cf5395115d0c1e1fc1117c01e4e731794854744d90161d45b37f263faa5/python-control/python-control/issues/453 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/57eb4cf5395115d0c1e1fc1117c01e4e731794854744d90161d45b37f263faa5/python-control/python-control/issues/453 |
| og:image:alt | Proposal: When computing frequency and time response output of systems, standardize on indexing first element so output is a 1D array if system is SISO and squeeze=True. This is instead of applying... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sawyerbfuller |
| hostname | github.com |
| expected-hostname | github.com |
| None | c049b65ec7e54cbf2521f5a560b6527714c612b0bd169188e2ea6e16f83bd5f4 |
| 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 | 87b137883e35e2766c3d0f6a257c4044f6390b83 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width