Title: bug: delayed dirac input not considered in forced_response · Issue #1152 · python-control/python-control · GitHub
Open Graph Title: bug: delayed dirac input not considered in forced_response · Issue #1152 · python-control/python-control
X Title: bug: delayed dirac input not considered in forced_response · Issue #1152 · python-control/python-control
Description: Hi, I have encountered a strange issue using the function forced_response with a NonlinearIOSystem object: When applying a dirac as input, if the dirac is applied after too much time after the beginning of the simulation, the response of...
Open Graph Description: Hi, I have encountered a strange issue using the function forced_response with a NonlinearIOSystem object: When applying a dirac as input, if the dirac is applied after too much time after the begi...
X Description: Hi, I have encountered a strange issue using the function forced_response with a NonlinearIOSystem object: When applying a dirac as input, if the dirac is applied after too much time after the begi...
Opengraph URL: https://github.com/python-control/python-control/issues/1152
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: delayed dirac input not considered in forced_response","articleBody":"Hi,\n\nI have encountered a strange issue using the function forced_response with a NonlinearIOSystem object:\n\nWhen applying a dirac as input, if the dirac is applied after too much time after the beginning of the simulation, the response of the system does not include its impact. \nHere is a small piece of code to reproduce the issue:\n\n```\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport control\n\ndef dynamic_function(t, x, u, param=None):\n \"\"\"\n Dynamic function for the system.\n \"\"\"\n A = np.array([[0, 1], [-1, -1]])\n B = np.array([[0], [1]])\n return A @ x + B @ u\n\ndef output_function(t, x, u, param=None):\n \"\"\"\n Output function for the system.\n \"\"\"\n C = np.array([[1, 0]])\n return C @ x\n\nsys = control.NonlinearIOSystem(\n dynamic_function, output_function,\n inputs=1,\n outputs=1,\n states=2\n )\n\nt = np.linspace(0, 10, 100)\nu = np.zeros_like(t)\n\n\ndirac_index = 6\n\n\nu[dirac_index] = 1 # Dirac input at t=0\n\nresults = control.forced_response(sys, T=t, U=u)\n\nplt.figure()\nplt.plot(t, results.y[0], label='Output')\nplt.title('Response of Nonlinear System to Dirac Input')\nplt.xlabel('Time (s)')\nplt.ylabel('Output')\nplt.grid()\nplt.legend()\nplt.show()\n```\n\nIf dirac_index is inferior or equal to 5, the normal output is obtained while if dirac_index is superior to 6, both the output and the state of the function are null for the whole simulation time.\n\nHere are the installed package:\n├── control v0.10.1\n│ ├── matplotlib v3.10.3 \n│ ├── numpy v2.2.5\n│ └── scipy v1.15.3\n\nUsing python 3.12.3.","author":{"url":"https://github.com/BobAubouin","@type":"Person","name":"BobAubouin"},"datePublished":"2025-06-05T10:32:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1152/python-control/issues/1152"}
| 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:e947ad81-599a-4f62-3476-09cbf4836e9e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C116:1EC1C6:2C50B66:3C18E99:6979B927 |
| html-safe-nonce | 94d440de67f8feb7143d3655a266b692ddd3ef3689686e329516f2bf53bf7287 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTE2OjFFQzFDNjoyQzUwQjY2OjNDMThFOTk6Njk3OUI5MjciLCJ2aXNpdG9yX2lkIjoiNDY3NjA2MjMxODYyOTA3NTIzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5a848acca05a62f2d58721fd2a362877585acf11c2855ae26100cf418c62c621 |
| hovercard-subject-tag | issue:3120688656 |
| 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/1152/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c9efde635543bf2d3463e9314dc235dd741d76eef152b689e5a5cb6f0e4cd5c5/python-control/python-control/issues/1152 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c9efde635543bf2d3463e9314dc235dd741d76eef152b689e5a5cb6f0e4cd5c5/python-control/python-control/issues/1152 |
| og:image:alt | Hi, I have encountered a strange issue using the function forced_response with a NonlinearIOSystem object: When applying a dirac as input, if the dirac is applied after too much time after the begi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | BobAubouin |
| 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