Open TorkelE opened 4 years ago
Sounds reasonable to me, but I don't have much experience using the delay equation interface (so don't know how general it is or what we'd want to support). I guess once we see how it is done in MT we can have a similar level of support in the DSL here.
Tricky. The mathematical notation uses round brackets. This gets a little bit confusing with Julia functions, but as long as he still know that X in your example is a variable then we should be good. Square brackets do not currently collide with anything in diffeqbio but what if we want to introduce spatial modelling? Square brackets would be natural for indexing.
Looks reasonable to me. Note that adding delay lowering in MTK for ODEs and DDEs is something on my mind but isn't the easiest thing in the world, but I plan to get to it in the next month. Delays in jumps will be an issue for a bit though, since we would need to change the jump interface to include the integrator so that it could grab the sol to interpolate the history.
Never thought about delays in Jumps.
Yes, it may take some time until this might actually come to use.
Given current development, I do not think this is the way to go. Something like
@reaction_network begin
@delayed_variable Xτ ~ X(t-τ)
p, ∅ --> X
d*Xτ, X --> ∅
end
might be better though
System
seems to just accept X(t-\tau)
directly, so maybe we can just let people type that (and add a check to see if there are delayed variables / capture them).
Is it just constant lags currently?
System
seems to just acceptX(t-\tau)
directly, so maybe we can just let people type that (and add a check to see if there are delayed variables / capture them).
Exactly how would that look? E.g.
@reaction_network begin
p, ∅ --> X
d*X(t-τ), X --> ∅
end
and similar is problematic because currently X(t-τ)
could be multiplication (rather than a function call with a delayed time).
How could it be multiplication? That isn't valid in Julia is it?
No, you are right, I mixed it up!
Yes, your approach seems like the way to go
I wouldn't look at the implementation of delay into DiffEqBio just yet. (we will let MTK handle that, and first, we need jack DiffEqBio into MTK. I hope to start working on the DiffEqBio side of things in the next couple of day)
We could, however, start looking at how to allow time-delays to be given in the DiffEqBio DSL. I suggest using
[]
for this:here
X[t-τ]
would denote the value of the variableX
at some previous time. I believe we have already reserved the value oft
for the current time (cannot be used for other variables or parameters).τ
would be a simple parameter to the model. One could also write a constant, such asX[t-2.5]
. Allowing[]
,X[t-...]
, probably would not make sense. We might also need some way to check that the...
does not become negative. Or maybe we just let it become some error later on.Does this sound reasonable?