-
Notifications
You must be signed in to change notification settings - Fork 438
Better I/O systems support for phase plots #1001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better I/O systems support for phase plots #1001
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this file have a different name prefix than "cds101"? The commit message has "CDS 110", and the top of the file has
CDS 110/ChE 105, Winter 2024
I agree that the plots are better. After a quick review, I did not find any errors, but I need 1 day more to review the changes carefully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments on the ipynb file
-
"insighs" -> "insights"
-
"which will will" -> "which we will"
-
"resuling dynamics" -> "resulting dynamics"
-
"reseting" -> "resetting"
-
Example 3.3 in the book refers to b (γ there) as "rotational friction," but here you write "viscous friction." The equations are consistent, and Example 3.2 (balance systems) refers to "viscous friction," so either choice works. Nonetheless I am calling it out for consistency with Example 3.3.
Other comments
-
While reviewing this, I noticed functions that return
TimeResponseData
(e.g., step_response) list some properties of it. Since those docstrings were written, more properties have been added (including 2 in this pull request), so users may not be aware of the new properties. After merging this, I am happy to add a note to relevant docstrings suggesting that users read the documentation ofTimeResponseData
for all properties. -
Thanks for the many code quality improvements (sorting imports, deleting trailing space, ...)
Check failures are due to NumPy 2.0 and can be ignored (#1013 fixes this). |
This PR provides better I/O systems support for making phase plots:
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.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:
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.