Catalyst.jl icon indicating copy to clipboard operation
Catalyst.jl copied to clipboard

events, constant and boundary condition species for SDEs and Jumps

Open isaacsas opened this issue 3 years ago • 4 comments

We've had several requests in the past for constant species, and my general advice was if one wanted A to be constant don't write A --> B but write A --> A + B or 0 --> B with rate k*A. The problem with the first is that A is treated as a variable internally. SBML includes an explicit "constant" tag for species, so this is something commonly used in models. Along those lines we could

  1. Have a way of marking A in a DSL reaction as a constant species. The Antimony DSL would have one write $A --> B to indicate it is constant. If we had something like that in the DSL we could then move it to being a parameter before actually generating the corresponding Reaction.
  2. Use the metadata system to indicate a variable is constant. Not making it a parameter internally though would mean a lot of the current codebase would have to have special cases added to handle a constant state appropriately. So I think just modifying the DSL to allow tagging a species as constant would make more sense.

isaacsas avatar Sep 18 '21 20:09 isaacsas

I guess where this would get tricky is something like 2A + B --> C with A constant and a rate k. Should this be rewritten to B --> C with rate k*A^2/2 or k*A*(A-1)/2, or something else. This would be dependent on whether the reaction is being interpreted deterministically or stochastically.

Using metadata to tag it as constant would let us keep A around as a species until model conversion, when we could resolve this, but as I mentioned above would complicate some stuff (like network analysis).

isaacsas avatar Sep 18 '21 20:09 isaacsas

Also need to consider boundary condition species (which do not get ODEs from reactions, but may have constraint equations or events).

isaacsas avatar May 23 '22 13:05 isaacsas

Closed by https://github.com/SciML/Catalyst.jl/pull/514

isaacsas avatar May 30 '22 18:05 isaacsas

Reopening as I realized this won't work beyond ODESystems and NonlinearSystems until if/when events and/or constraints can be supported with SDESystems and/or JumpSystems.

Needed components in MT:

  • [ ] discrete events, or continuous events for SDEs / mixed systems.
  • [ ] constraints to make sense for SDEs and/or jumps. (For SDEs probably means being able to extend with nonlinear or ODE systems).

As these are added in MT we can add support for this in Catalyst.

isaacsas avatar May 30 '22 20:05 isaacsas