-
-
Notifications
You must be signed in to change notification settings - Fork 81
subnetworks
and linkagedeficieny
#396
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
@yewalenikhil65 since systems are the fundamental unit in ModelingToolkit, what about having Also, perhaps it makes sense to add an intermediary function that takes |
I did think about this earlier but am confused over parameters for the sub -
This i think is doable and will try ! In this case, I hope it's not required to |
You can get the parameters within the rate as follows: ps = parameters(network)
newps = Set{eltype(ps)}()
for rx in linkageclass # pseudocode...
Symbolics.get_variables!(newps, rx.rate, ps)
end
# newps will now have all the parameters used in reaction rates in the reactions of the linkclass |
Cool 😀 I did find |
Yeah, there are a bunch of these types of useful helper functions but they aren't always prominent in the docs, and they tend to be split across MT, Symbolics, and SymbolicUtils... |
adding intermediary function and updating `subnetworks` and `linkagedeficiency`
tweaking tests for updated `subnetworks` and `linkagedeficiency`
I decided to call the intermediary function inside the |
Also, don't forget to add the two new functions to be exported, and mention them in the |
@yewalenikhil65 with the new subnetwork functionality we can now determine if a network is weakly reversible right? (Doesn't this just correspond to checking if each of the subnetworks is strongly connected?) So we just generate the subnetwork graph, and then call |
This one is on my mind and have to check it out. (Bdw, weakly reversible also may involve some subnetwork being cyclic so it wouldn't return true from I will check out this |
No worries; take your time! This reference says weakly reversible is equivalent to each linkage class being strongly connected: https://core.ac.uk/download/pdf/191323175.pdf |
@yewalenikhil65 I'll tweak as I was suggesting since it is confusing. |
@yewalenikhil65 please make sure in the future you use the standard indentation of 4 characters. Looking at the PR locally it seems you indented the new functions by 3... |
LMK your thoughts on how I've modified it. This seems a reasonable tradeoff between performance vs. minimizing allocations I think. For the future, please try to remember about using a default indentation spacing of 4 characters, or preserving what is used in the file, and try to write |
Sorry for this really and getting back late ! I guess I should learn some good PR practices. |
I think this is good to go now. Lesson learnt that using loops could be more efficient sometimes than readymade functions like |
It all depends on context! Those functions are super useful and have their place, but it is good to always think about how much memory is getting allocated to ensure stuff works well on large networks too. |
Thanks again for putting this forward. We’re well on our way to a nice library of network analysis codes now I’d say. |
i will get back with |
Isn’t a cycle strongly connected since any node in it has a path to each other node? |
(A directed cycle…) |
shifting discussion here #401 |
from #395