SciML / ModelingToolkit.jl

An acausal modeling framework for automatically parallelized scientific machine learning (SciML) in Julia. A computer algebra system for integrated symbolics for physics-informed machine learning and automated transformations of differential equations
https://mtk.sciml.ai/dev/
Other
1.38k stars 196 forks source link

Delay differential equation handling #955

Closed ChrisRackauckas closed 4 months ago

ChrisRackauckas commented 3 years ago

Delay differential equations are going to be really really hard, but this is how we can get there. We probably just want to build it onto ODESystem, and just add a DDEProblem lowering. "Just" doesn't do it justice, because there's a list of issues:

Building such a build_function will likely want to start by swapping out x(t-5) directly to h(p,t-5)[1], but we will need to make that so we "CSE" the history calculations if there's many at the same time. We can leave that optimization to a later issue.

asprionj commented 3 years ago

Can only state variables be delayed or also arbitrary intermediate, i.e. algebraic, variables? The latter would be useful in many "engineering" models, think e.g. a transport delay applied to some property of a volumetric flow that is (algebraically) mixed out of several sources (which could be state variables or algebraic relations themselves...).

ChrisRackauckas commented 3 years ago

If states can be delayed then algebraic variables would be able to be through the same design.

slwu89 commented 1 year ago

@ChrisRackauckas are the delays for difference equations in the tests here (https://github.com/SciML/ModelingToolkit.jl/blob/master/test/discretesystem.jl#L87) and use of DelayDiffEq in other tests here (https://github.com/SciML/ModelingToolkit.jl/blob/master/test/odesystem.jl#L536) indicative of significant progress on this front?

ChrisRackauckas commented 1 year ago

There's at least symbolic interfaces for it now, though the codegen is lacking.

ChrisRackauckas commented 4 months ago

This is handled via System