-
-
Notifications
You must be signed in to change notification settings - Fork 224
Accessors for differential and algebraic erquations #2601
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
Conversation
Format and document |
Got docstrings, so can link them in the docs, where would you want them? In the long term (as part of this PR or not), would it be useful to have an "API" page on the docs which just lists functions like these and their docstrings? |
No, API dumps are always bad. Make a proper manual page on equations. Add the |
Ok, I have added docs and run the formater. |
- `continuous_events(sys)`: The set of continuous events in the ODE. | ||
- `discrete_events(sys)`: The set of discrete events in the ODE. | ||
- `alg_equations(sys)`: The algebraic equations (i.e. that does not contain a differential) that defines the ODE. | ||
- `get_alg_eqs(sys)`: The algebraic equations (i.e. that does not contain a differential) that defines the ODE. Only returns equations of the current-level system. | ||
- `diff_equations(sys)`: The differential equations (i.e. that contain a differential) that defines the ODE. | ||
- `get_diff_eqs(sys)`: The differential equations (i.e. that contain a differential) that defines the ODE. Only returns equations of the current-level system. | ||
- `has_alg_equations(sys)`: Returns `true` if the ODE contains any algebraic equations (i.e. that does not contain a differential). | ||
- `has_alg_eqs(sys)`: Returns `true` if the ODE contains any algebraic equations (i.e. that does not contain a differential). Only considers the current-level system. | ||
- `has_diff_equations(sys)`: Returns `true` if the ODE contains any differential equations (i.e. that does contain a differential). |
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.
We should use the new non-canonical, but we can handle that in a future PR
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.
Sounds good
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.
thanks for helping getting this one sorted out quickly!
Creates 10 different general purpose accessors for handling differential and algebraic functions within systems:
Examples:
There are docstrings and tests for all functions.
These are needed in Catalyst v14 to handle equations when you convert to
ODESystem
s that may (or may not) contain algebraic equations. Sincet hey are general-purpose, I figured it was better to put them here than in Catalyst.