Closed isaacsas closed 4 years ago
I imagine later we might want a more mathematical looking way to specify these using Poisson RVs or measures that could be components in ODEs/SDEs, but that could presumably just sit on top of these.
Yes, you can see my final goal is to allow for saying that a variable is a Poisson random variable, or a Brownian motion, just write the differential equation, and make it a DESystem
. Then DESystem
would auto-detect the form and use this to generate JumpSystem
, SDESystem
, etc. Also make that automatically handle PDEs and allow for auto-discretizations, and then allow for analyzing and transforming these between each other. That's the grand goal of the package. What made things start working today was to not look directly at the goal but instead start building these independent systems, since indeed having these intermediates makes it much easier to reason about the right way to lower it to code.
Would it make sense to have a JumpSystem just take a list mixing these three types as its eqs?
Yes, this looks great.
I guess this would rely on being able to generate functions from the rate and the affects specified within each of the *RateJump types, is there is simple way to do this currently?
Not very well. The rate functions can easily be done with build_function
today. The affect functions will need a tie-in so that we can add u = integrator.u
preamble before the dereferencing phase. That's not hard to add, and I plan to add it quite soon.
Cool, I'll plan to open a PR to start working on this soon then. I'd like to get jumps settled too so we can switch the DEBio backend all at once to MT and then improve/update the API and interface there to allow users to more easily generate ReactionSystems
. (My plan there is to create a DEBioV2 branch we can discuss breaking changes on -- the DSL and API functions will hopefully stay the same, modulo switching symbols and expressions to variables and operations, but I think we should abandon the monolithic generation of everything in the default DSL version...)
I agree that's a great direction to go.
So all this seems to work
Would it make sense to have a
JumpSystem
just take a list mixing these three types as itseqs
? I guess this would rely on being able to generate functions from therate
and theaffects
specified within each of the*RateJump
types, is there is simple way to do this currently?I imagine later we might want a more mathematical looking way to specify these using Poisson RVs or measures that could be components in ODEs/SDEs, but that could presumably just sit on top of these.