-
-
Notifications
You must be signed in to change notification settings - Fork 79
Catalyst V15 TODO version 2 #1202
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
Comments
I will try to get #1142 done in the next week. I figure it might just make sense to merge it with just the Catalyst updates so it can be there for v15, and hold off a bit longer on the CatalystNetworkAnalysis stuff (since I need to find the bandwidth to push it to completion...hopefully in the next couple of months). |
Maybe just reference CatalystNetworkAnalysis on the main page about network analysis / explain it is in development, and list what functionality it provides that is well tested at this point? Then later you can update the docs to include it too? |
I'd also be fine if you want to just add the docs for it into Catalyst directly and skip trying to use multidocumenter. (i.e. making our docs depend on it is fine.) |
These are the PRs that are ready and which are required for v15 release (in order of merging): After that we only got (I think)
The remaining stuff we might consider for v15, but which probably isn't needed, is:
|
#1121 just needs some correctness tests (and updating to master). Would be cool to have, but I don't recall anything breaking in it so it could wait for 15.1. |
If we think we could get one in as well without too much delay that would definitely be a bonus |
What's left? |
Figuring out how to make this work when using ModelingToolkit, NonlinearSolve
@variables X1 X2 X3
@parameters k1 k2 k3 k4 Γ[1:1] = missing [guess = ones(1)]
eqs = [
0 ~ -k1*X1 + k2*X2 - k3*X1*X2 + (1//2)*k4*((-X1 - X2 + Γ[1])^2),
0 ~ k1*X1 - k2*X2 - k3*X1*X2 + (1//2)*k4*((-X1 - X2 + Γ[1])^2),
0 ~ -X1 - X2 - X3 + Γ[1]
]
initeqs = [Γ[1] ~ Initial(X1) + Initial(X3) + Initial(X2)]
@named nlsys = NonlinearSystem(eqs, [X1, X2, X3], [k1, k2, k3, k4, Γ];
initialization_eqs = initeqs)
u0 = [:X1 => 1.0, :X2 => 2.0, :X3 => 3.0]
ps = [:k1 => 0.1, :k2 => 0.2, :k3 => 0.3, :k4 => 0.4]
# WITHOUT structural_simplify
nlsys1 = complete(nlsys)
nlprob1 = NonlinearProblem(nlsys1, u0, ps)
# these pass
@test nlprob1[:X1] == 1.0
@test nlprob1[:X2] == 2.0
@test nlprob1[:X3] == 3.0
@test nlprob1.ps[:Γ][1] == 6.0
integ1 = init(nlprob1, NewtonRaphson())
@test integ1[:X1] == 1.0
@test integ1[:X2] == 2.0
@test integ1[:X3] == 3.0
@test integ1.ps[:Γ][1] == 6.0
nlprob1 = remake(nlprob1; u0 = [:X3 => nothing], p = [:Γ => [4.0]])
@test nlprob1[:X1] == 1.0 # pass
@test nlprob1[:X2] == 2.0 # pass
@test nlprob1[:X3] == 1.0 # fails as still 3.0
@test nlprob1.ps[:Γ][1] == 4.0 # pass
integ1 = init(nlprob1, NewtonRaphson())
@test integ1[:X1] == 1.0 # pass
@test integ1[:X2] == 2.0 # pass
@test integ1[:X3] == 1.0 # fails
@test integ1.ps[:Γ][1] == 4.0 # pass
# WITH structural_simplify
nlsys2 = structural_simplify(nlsys)
nlprob2 = NonlinearProblem(nlsys2, u0, ps)
# these pass
@test nlprob2[:X1] == 1.0
@test nlprob2[:X2] == 2.0
@test nlprob2[:X3] == 3.0
@test nlprob2.ps[:Γ][1] == 6.0
integ2 = init(nlprob2, NewtonRaphson())
@test integ2[:X1] == 1.0
@test integ2[:X2] == 2.0
@test integ2[:X3] == 3.0
@test integ2.ps[:Γ][1] == 6.0
nlprob2 = remake(nlprob2; u0 = [:X3 => nothing], p = [:Γ => [4.0]])
@test nlprob2[:X1] == 1.0 # pass
@test nlprob2[:X2] == 2.0 # pass
@test nlprob2[:X3] == 1.0 # pass
@test nlprob2.ps[:Γ][1] == 4.0 # pass
integ2 = init(nlprob2, NewtonRaphson())
@test integ2[:X1] == 1.0 # pass
@test integ2[:X2] == 2.0 # pass
@test integ2[:X3] == 1.0 # pass
@test integ2.ps[:Γ][1] == 4.0 # pass |
And waiting on the DelayedParentScope fix. |
There is also SciML/ModelingToolkit.jl#3529 which it would be good to have done as well. |
Close by #1232 |
remake
NonlinearSystem
s as needed for conservation law support.u0
s in remake unlessstructural_simplify
is used (and in that case it only works because the non-updated species become observables).@TorkelE @vyudu, once Vincent finishes my last set of comments on the network analysis docs I'll give the docs a last skim and we can then release.
The text was updated successfully, but these errors were encountered: