Title: Output calcs produce 0's at every other call · Issue #1009 · python-control/python-control · GitHub
Open Graph Title: Output calcs produce 0's at every other call · Issue #1009 · python-control/python-control
X Title: Output calcs produce 0's at every other call · Issue #1009 · python-control/python-control
Description: I've noticed that subsystems can produce outputs = 0 on every other call to a system's output function. The final result of the simulation is correct; however if you are doing something like processing quaternions in the output function,...
Open Graph Description: I've noticed that subsystems can produce outputs = 0 on every other call to a system's output function. The final result of the simulation is correct; however if you are doing something like proces...
X Description: I've noticed that subsystems can produce outputs = 0 on every other call to a system's output function. The final result of the simulation is correct; however if you are doing something lik...
Opengraph URL: https://github.com/python-control/python-control/issues/1009
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Output calcs produce 0's at every other call","articleBody":"I've noticed that subsystems can produce outputs = 0 on every other call to a system's output function. The final result of the simulation is correct; however if you are doing something like processing quaternions in the output function, a quaternion of all zeros is invalid and an error results (without some hacky handling of that situation).\r\n\r\nIn the code below, line 1 printouts alternate between 0 and 1 rather than printing 1 at each call.\r\n\r\n```python\r\nimport numpy as np\r\nimport control as ct\r\n\r\ndef output_sys_outputs(t, x, u, params):\r\n print(u) # alternates between zero and 1\r\n return u\r\n\r\noutput_sys = ct.nlsys(updfcn=None, outfcn=output_sys_outputs, inputs=1, outputs=1, name=\"output_sys\")\r\n\r\ndef input_sys_outputs(t, x, u, params):\r\n return 1\r\n\r\ninput_sys = ct.nlsys(updfcn=None, outfcn=input_sys_outputs, outputs=1, inputs=0, name=\"input_sys\")\r\n\r\n# outputs just 1's\r\ninput_sim = ct.input_output_response(input_sys, T=np.linspace(0, 1, 100))\r\n\r\nsystem = ct.interconnect(\r\n (input_sys, output_sys),\r\n connections=[\r\n ['output_sys.u', 'input_sys.y']\r\n ],\r\n inplist=[],\r\n outlist=['output_sys.y']\r\n)\r\n\r\ntimeseries = ct.input_output_response(system, T=np.linspace(0, 1, 100))\r\ny = timeseries.outputs\r\nprint(y) # prints all 1's\r\n```","author":{"url":"https://github.com/corbinklett","@type":"Person","name":"corbinklett"},"datePublished":"2024-06-07T16:59:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1009/python-control/issues/1009"}
| 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:26052568-c9a8-6574-eeed-97ac33c16489 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E38:37BA6B:2A47CE3:391BCC5:6979B907 |
| html-safe-nonce | 4054fe52d35f017dc282d64c2542d27256312be89e8658bc872c3e8c4d7796b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTM4OjM3QkE2QjoyQTQ3Q0UzOjM5MUJDQzU6Njk3OUI5MDciLCJ2aXNpdG9yX2lkIjoiNTYxMjA2Njc2NjIzOTQxNDUzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a76f1937a44d62c34c7ed674de0781942a0fb1e6d9d9ca504ca60358935074a2 |
| hovercard-subject-tag | issue:2340846882 |
| 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/1009/issue_layout |
| twitter:image | https://opengraph.githubassets.com/67dda335ba4f95122d5ba0bf15a804b51011a7d8de6301e08b57e0601cde5094/python-control/python-control/issues/1009 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/67dda335ba4f95122d5ba0bf15a804b51011a7d8de6301e08b57e0601cde5094/python-control/python-control/issues/1009 |
| og:image:alt | I've noticed that subsystems can produce outputs = 0 on every other call to a system's output function. The final result of the simulation is correct; however if you are doing something like proces... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | corbinklett |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width