Catalyst.jl
Catalyst.jl copied to clipboard
valid ways to write equations using the DSL
Might be worth thinking about allowing more complicated derivative expressions on the left side of differential equations.
@reaction_network begin
@variables A(t) B(t)
@equations D(A) + D(B) ~ A
end
f(A, t) = 2*A*t
@reaction_network begin
@variables A(t) B(t)
@equations f(A, t)*D(A) ~ A + B
end
This latter one may be complicated since we probably want to escape the f(A, t) but not the D(A)? @TorkelE would it be easy to change the DSL code to allow for stuff like this?
I assume we want both of the following to work?
f(A, t) = 2*A*t
@reaction_network begin
@variables A(t) B(t)
@equations f(A, t) ~ A + B
end
@reaction_network begin
@variables A(t) B(t)
@equations A + B ~ f(A, t)
end
Yes, it would be nice if all of these are supported (assuming they work in the symbolic interface).
All this should work (sans any function related its). Anything that is a valid equation normally should also work in the DSL. However, it is only in the case of D(V) ~ ... (Where there are no differentials on the RHS) Where we automatically under that V is a variable.
If you check the texts added here https://github.com/SciML/Catalyst.jl/pull/815 you can see all the details of how it work.