Title: Better I/O systems support for phase plots by murrayrm · Pull Request #1001 · python-control/python-control · GitHub
Open Graph Title: Better I/O systems support for phase plots by murrayrm · Pull Request #1001 · python-control/python-control
X Title: Better I/O systems support for phase plots by murrayrm · Pull Request #1001 · python-control/python-control
Description: This PR provides better I/O systems support for making phase plots: Allow I/O systems with no inputs and/or no outputs to be specified. This is useful when generating phase plots, where you might just have a simple dynamical systems but still want to use the I/O system objects. Improve the error messages in input_output_response when the number of states, inputs, or outputs are incompatible with the system size by telling you which one didn't match. Generate warnings when simulations fail for individual initial conditions and drop individual trace (rather than terminating). This yields much nicer phase plane plots by allowing the system to generate lines when it can and ignoring the rest. Added Jupyter notebook analyzing open and closed loop dynamics of an inverted pendulum, showing off some of the capabilities of the package. Changed the way plot titles are created, using axes.set_title (centers title over axes) instead of fig.suptitle (centers over figure, which is good for multi-axes plots but otherwise looks funny). I'll propagate this same change to time plots and frequency plots in separate PRs. Did some tweaking on arrow placement so that very short lines have zero or one arrows. Could use more work, but this is better than what we had. As an example of the changes, here is the code to produce a phase portrait for the inverted pendulum example in FBS2e, Figure 5.4: from math import pi import control as ct def invpend_update(t, x, u, params): m, l, b, g = params['m'], params['l'], params['b'], params['g'] return [x[1], -b/m * x[1] + (g * l / m) * np.sin(x[0])] invpend = ct.nlsys( invpend_update, states=2, inputs=0, name='invpend', params={'m': 1, 'l': 1, 'b': 0.2, 'g': 1}) ct.phase_plane_plot(invpend, [-2*pi - 1, 2*pi + 1, -2, 2], 10) Before: After: The changes are not major, but if you look at the number and spacing of arrows along the streamlines, you'll see examples of the changes there (some streamlines have no arrows in "before" plot). Also note the change in location of the title.
Open Graph Description: This PR provides better I/O systems support for making phase plots: Allow I/O systems with no inputs and/or no outputs to be specified. This is useful when generating phase plots, where you might...
X Description: This PR provides better I/O systems support for making phase plots: Allow I/O systems with no inputs and/or no outputs to be specified. This is useful when generating phase plots, where you might...
Opengraph URL: https://github.com/python-control/python-control/pull/1001
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:04ceb456-0991-32e1-a207-53e341659ed8 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | AACA:355540:371D50:4D40CA:697A6133 |
| html-safe-nonce | f3989892812f150e8f0d021a705c804a731e85db753a300cc0702fa6ec8667c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUNBOjM1NTU0MDozNzFENTA6NEQ0MENBOjY5N0E2MTMzIiwidmlzaXRvcl9pZCI6IjUxMzc3NTIwOTU4NTUzNzA1NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 88780483f3a55aaab2bfd0bce484a760f88a02b1ec21d96a6260cf455ec23f1f |
| hovercard-subject-tag | pull_request:1865027136 |
| 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/1001/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 | This PR provides better I/O systems support for making phase plots: Allow I/O systems with no inputs and/or no outputs to be specified. This is useful when generating phase plots, where you might... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a55e2ee143d859545e2c830f5d97a7eb755ab6ff220f86ef3512eec99ded059 |
| 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 | 851f5ced370c69961aafcb448748c1790b1af4f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width