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

Support for delays

Open SiFTW opened this issue 4 years ago • 13 comments

I have a biological model that has a few explicit delays that mean I need to use the DDE functionality of JuliaDiffEq. I checked on the gitter.im and was told DiffEqBiological doesn't support this stops me being able to use DiffEqBiological for now.

SiFTW avatar Mar 04 '20 13:03 SiFTW

@ChrisRackauckas Does Modeling Toolkit support generating ODEs with delays now? This might be a good reason to add MT output (at least start prototyping it).

isaacsas avatar Mar 04 '20 14:03 isaacsas

It doesn't, but it would be quite easy to do now. It's one of the reasons for making variables functions.

ChrisRackauckas avatar Mar 04 '20 14:03 ChrisRackauckas

I'm thinking that for now we can just have a separate method that gets applied to a reaction network to generate a MT model. As the simplification picture improves then we could switch the backend over to it. This would at least give users a way to start accessing MT features and code generation. If the generated models benchmark comparably to the DEBio generated ODEs we could then fully switch over the ODE code...

isaacsas avatar Mar 04 '20 14:03 isaacsas

Agreed that we at some point we have to think of moving stuff over to MT, been holding it off for quite a while waiting for MT to get more and more developed. It feels like the transition (and later updates to synch with new MT features) get easier the later on we can do it? But maybe it is time to do something now-ish?

TorkelE avatar Mar 04 '20 16:03 TorkelE

I was waiting on expression simplification, which I think is a current priority, but not really implemented yet. But I see no reason we couldn't write a separate code path to generate MT models now, and just swap it in later when simplification gets added (or if we find that the ODEs generated from the MT model end up having similar performance despite not having expression simplification).

isaacsas avatar Mar 04 '20 16:03 isaacsas

I've been moving things slowly in this direction. Sparsity support was added last week. I need to do + splitting and SDE support, and I'll add an arrow notation. But I don't think expression simplification is really the hold up.

ChrisRackauckas avatar Mar 04 '20 16:03 ChrisRackauckas

Just a polite and curious poke to see if you folks have taken this any further?

jae0 avatar Aug 02 '22 15:08 jae0

I'm not aware that this is supported in ModelingToolkit yet, but if it is for DDEs we could add it here.

For jump models there is https://github.com/palmtree2013/DelaySSAToolkit.jl which can simulate delay SSAs, adding delays into a non-delay Catalyst model.

isaacsas avatar Aug 02 '22 16:08 isaacsas

DDEs working great! Would love to see it here too one day to have more in the toolbox .. well more like a full-on platform now. Will use DelaySSAToolkit.jl if that is what you recommend. thx

jae0 avatar Aug 02 '22 16:08 jae0

Sorry, are you saying DDEs now work in ModelingToolkit? If so, can you point me to an example?

isaacsas avatar Aug 02 '22 17:08 isaacsas

whoops, was referring to: https://diffeq.sciml.ai/stable/tutorials/dde_example/#Delay-Differential-Equations

On Tue, Aug 2, 2022 at 2:58 PM Sam Isaacson @.***> wrote:

Sorry, are you saying DDEs now work in ModelingToolkit? If so, can you point me to an example?

— Reply to this email directly, view it on GitHub https://github.com/SciML/Catalyst.jl/issues/188#issuecomment-1203044667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATUQOIBUO6KSNHDVDTEPULVXFOUVANCNFSM4LBGKHCA . You are receiving this because you commented.Message ID: <SciML/Catalyst. @.***>

jae0 avatar Aug 02 '22 18:08 jae0

Yeah, once it is supported in ModelingToolkit it will hopefully be straightforward to add here too.

isaacsas avatar Aug 03 '22 22:08 isaacsas

@ChrisRackauckas pointed out delays (constant only?) are supported via the System type. That being the case we should consider adding a conversion to that type, and a corresponding DDEProblem support.

isaacsas avatar Dec 13 '23 19:12 isaacsas