Hi I am trying to figure out a way to dynamically add/remove reactions once I have defined a ReactionSystem programmatically.
Suppose I define the system using this function.
function generate_creation(n,MAT)
# Creates a vector `X` with n species.
@species X(t)[1:n]
@species A(t),B(t)
@parameters k
rxs = [
[Reaction(k, [A,B], [X[i]]) for i in 1:n];
[ADD REACTIONS USING MATRIX MAT]
]
# Assembly and return a complete `ReactionSystem`
@named lp_n = ReactionSystem(rxs, t)
return complete(lp_n)
end
I let the system reach the equilibrium. Then change the matrix mat. This changes the set of reactions. Can i update the set of reactions without needing to call this function once again.