Conserved quantities could be replaced internally and the lost states could be computed again by an observable function directly after x:
odemodel(eqns[-idx_conserved])
g_conserved = Y(conserved_eqns,..., attach.input=TRUE)
xnew = (g_conserved*x)
This would require
- Exporting ODEs, not reactions, to SBML
- Function to substitute the conserved quantity symbolically in the equations
- Function to generate the equation for the conserved quantity
Conserved quantities could be replaced internally and the lost states could be computed again by an observable function directly after x:
This would require