Skip to content

update get_variables! for Equations #377

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

Merged
merged 4 commits into from
May 19, 2020

Conversation

isaacsas
Copy link
Member

@isaacsas isaacsas commented May 18, 2020

Notes; get_variables! returns Operations, but we also have vars which returns Variables, so we have some redundancy here.

I still need tests for ODEs here, but local testing looks ok.

@ChrisRackauckas
Copy link
Member

Looks great. Is there anything else needed to get the dependency graph? Or can I now plot the direct connections say between variables today?

@isaacsas
Copy link
Member Author

You can get a LightGraph directed graph as: asdigraph(asgraph(sys),sys) for an ODE, SDE (but not including noise) or Jump system. The vertices are ordered first by equation and then state variable. Probably we would want some type of plot recipe or metagraph addtion on top to label nodes as Eq_i or with the corresponding state variable symbol.

@ChrisRackauckas
Copy link
Member

Is there an issue with NonlinearSystem?

@isaacsas
Copy link
Member Author

As long as eq.rhs has all the equation it should work. I can add a test for that too.

@isaacsas
Copy link
Member Author

Something like x^2 + y^2 ~ x + y isn't going to work currently.

@ChrisRackauckas
Copy link
Member

It's all in 0 ~ ... form. We should enforce that more in the construction though.

@isaacsas
Copy link
Member Author

@ChrisRackauckas Assuming tests pass this should be good now.

@isaacsas
Copy link
Member Author

Oh, I might have misunderstood your earlier comment. This will do graphs showing which states an equation depends on currently, and all of eq-eq, eq-state, state-eq, state-state for jumps. State to state for ODEs needs a version of modified_states! too. I can write a simple version of that which would work for ODE/SDEs if one can assume the LHS of the equation only has one unique variable. Anything more complicated would require dispatches for the dg routines and some more work.

@isaacsas
Copy link
Member Author

Added a version that can make all four dg types for ODEs/SDEs, correctly if the LHS of equations only involve one variable, which can be assumed to be the one modified by the equation.

@ChrisRackauckas ChrisRackauckas merged commit 8bf2adc into SciML:master May 19, 2020
@isaacsas isaacsas deleted the update-get-variables branch May 19, 2020 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants