Tips on integrals using DiffEqOperators

I’m trying to use DiffEqOperators to define the Kermack-McKendrick model, which is basically a PDE generalization of the simple SIR epidemiological model:

The equation for I is a PDE, while that for S and R is an ODE with an integral of I over a at t.

The declarations seem straightforward:

@parameters t a β γ
@variables S(…) I(…) R(…)
@derivatives Dt’~t
@derivatives Da’~a

However, how does one describe integrals over one dimension (in this case, a)?

You can’t yet. @zobot is going to start working on it though IIRC. You mean Feature request: add integro-differential equation support · Issue #572 · SciML/ModelingToolkit.jl · GitHub right?

Kinda, but not quite. I was hoping to write down something like this for the equations (probably abusing all sorts of notation here):

@parameters t a β c γ
@variables S(t) i(t,a) R(t)
@derivatives Dt'~t
@derivatives Da'~a
Y(t) = sum(i[t,])
N(t) = S(t)+Y(t)+R(t)

eqs = [Dt(S) ~ -β*c*Y(t)*S,
       Da(i) ~ -γ*i,
       Dt(R) ~ γ*Y]

(missing out the boundary conditions and domains right now), to be passed to DiffEqOperators to be solved by the method of lines, along the lines of this:

This involves integrating along the spatial dimension rather than the time dimension - the latter is the issue you refer to for integro-differential equation support.

Yeah we can’t handle this in any of the discretizers right now. Lump it into the other requests. We’re getting to it, though a little slower than we hoped.