Title: Proposal for multiplying a NumPy array by a scalar `TransferFunction` · Issue #1076 · python-control/python-control · GitHub
Open Graph Title: Proposal for multiplying a NumPy array by a scalar `TransferFunction` · Issue #1076 · python-control/python-control
X Title: Proposal for multiplying a NumPy array by a scalar `TransferFunction` · Issue #1076 · python-control/python-control
Description: Currently, multiplying a SISO TransferFunction object by a NumPy array results in a dimension error: import control import numpy as np tf = control.TransferFunction([1], [1, 0]) arr = np.array([ [1, 0], [2, 1], ]) print(tf * arr) print(a...
Open Graph Description: Currently, multiplying a SISO TransferFunction object by a NumPy array results in a dimension error: import control import numpy as np tf = control.TransferFunction([1], [1, 0]) arr = np.array([ [1...
X Description: Currently, multiplying a SISO TransferFunction object by a NumPy array results in a dimension error: import control import numpy as np tf = control.TransferFunction([1], [1, 0]) arr = np.array([ [1...
Opengraph URL: https://github.com/python-control/python-control/issues/1076
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal for multiplying a NumPy array by a scalar `TransferFunction`","articleBody":"Currently, multiplying a SISO `TransferFunction` object by a NumPy array results in a dimension error:\r\n\r\n```python\r\nimport control\r\nimport numpy as np\r\n\r\ntf = control.TransferFunction([1], [1, 0])\r\narr = np.array([\r\n [1, 0],\r\n [2, 1],\r\n])\r\n\r\nprint(tf * arr)\r\nprint(arr * tf)\r\n```\r\n\r\n```\r\nValueError: C = A * B: A has 1 column(s) (input(s)), but B has 2 row(s) (output(s)).\r\n```\r\n\r\nI think it would be convenient if output was a MIMO `TransferFunction` object of the array's dimension. So, for example,\r\n\r\n```python\r\nG = control.TransferFunction(\r\n [\r\n [[1], [0]],\r\n [[2], [1]],\r\n ],\r\n [\r\n [[1, 0], [1, 0]],\r\n [[1, 0], [1, 0]],\r\n ],\r\n)\r\n````\r\n\r\nI would be happy to implement this and do a PR, but I want to make sure it's something the maintainers actually want. I would think all SISO systems (state-space, etc) should behave in the same way.\r\n\r\nThis appears to have been discussed in #459 , but I'm not sure what the conclusion was.","author":{"url":"https://github.com/sdahdah","@type":"Person","name":"sdahdah"},"datePublished":"2024-12-05T16:15:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/1076/python-control/issues/1076"}
| 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:643e0994-811c-a482-02c8-d2cd2cf0fe6f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B2E2:1C1FF4:3D66046:52976AB:697B0C2B |
| html-safe-nonce | b1ce2640a3b437e9fe335552f24ec3a8b935a763960d9229680431898d1a3782 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkUyOjFDMUZGNDozRDY2MDQ2OjUyOTc2QUI6Njk3QjBDMkIiLCJ2aXNpdG9yX2lkIjoiNzczNTcyNDQ5ODUyMzk0NTM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 10f952bafce2e4179867e617585d86d46a9944a27216c0fc2bfd7efd6cc96d23 |
| hovercard-subject-tag | issue:2720841140 |
| 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/1076/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a6454f6eb6b71476068901be921eb97657acd28aad3195c9952017a1aee88f62/python-control/python-control/issues/1076 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a6454f6eb6b71476068901be921eb97657acd28aad3195c9952017a1aee88f62/python-control/python-control/issues/1076 |
| og:image:alt | Currently, multiplying a SISO TransferFunction object by a NumPy array results in a dimension error: import control import numpy as np tf = control.TransferFunction([1], [1, 0]) arr = np.array([ [1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sdahdah |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7ce8ed0a54c4730aeca4e6abacfc6490365fc42e25480b86883054df3f9181c8 |
| 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 | d7bfc78137af9a4828305e52ab993fce981d7085 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width