Open isaacsas opened 1 month ago
I wrote a comment on it here: https://github.com/SciML/Catalyst.jl/pull/1056#issuecomment-2364056963, but I really need someone who knows more about Symobilcs to explain, as stuff like these just isn't documented at all.
This seems to be the culprit: https://github.com/SciML/Catalyst.jl/blob/005a58fa70b8a5a85073a60c788cf55b45136ce7/src/dsl.jl#L788
We need to instead directly build the observable variables with the independent variables specified.
@TorkelE it would be good to fix this for V15 since it technically changes the semantics of these variables.
What's the expected behavior here? should isequal(rn1.X1, rn1.X2)
return true?
If a symbolic is created via an observable the generated symbolic stood be the exact same as if it was created with @variables
.
Hmm what would be the way to check that? I don't think there's a way that they could generate the same code when expanded if the observable IVs are inferred automatically
I think I got observables to generate the same way as variables but not sure what sort of tests to write to check they are actually the same.
Maybe something like this:
rn1 = @reaction_network rn_observed begin
@variables X1(t)
@observables X2 ~ X1
k, A --> 0
end
t = Catalyst.default_t()
@variables X2(t)
# this is false on the last release, but should be true:
isequal(rn1.X2, X2)
when expanded gives
Notice the difference in
X1
's definition vs.X2
:vs