-
Notifications
You must be signed in to change notification settings - Fork 7
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
Recursively reason over flow control relationships #302
Conversation
# if a state is present in a rate law, and the state isn't an input to the rate | ||
# law, then that state is a controller of the rate law | ||
if ( |
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.
@nanglo123 please resurrect this, and maybe we can add some unit tests that correspond to when this gets used
b96a680
to
923a344
Compare
mira/sources/system_dynamics/pysd.py
Outdated
@@ -564,3 +582,69 @@ def with_lookup_to_piecewise(expr_text: str) -> str: | |||
conditions = ",".join(f"({y}, {variable} >= {x})" for x, y in pairs) | |||
sympy_str = f"Piecewise({conditions})" | |||
return sympy_str | |||
|
|||
|
|||
def get_identifier_to_expr(pysd_model, name_to_expr_str): |
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.
@nanglo123 here's the function that resolves the recursive rate laws
There's still an issue where we're not picking up anything interesting in terms of controllers for the rate laws
… and stocks in rate laws, fix way to identify links from stock flow amr
ccd67c7
to
9343e28
Compare
The goal in this PR is when importing vensim models, to recursively walk through all of the flow relationships to identify for each, what are the stocks involved. This will allow for making more appropriate control structure that for each relationship can properly incorporate controllers based on the stocks referenced in the rate law.
What's solved:
What's not solved: