Solving a non-linear P(I)DE - neural field equation

Hi everyone !

I am searching for some way to solve the following non linear P(I)DE, known as the neural field equation:

\frac{\partial}{\partial_t} u(t,x) = -\alpha u(t,x) + \int w(y,x) f(u(t,y)) dy,

for some scalar \alpha and functions w,f. The parameters I used in the script below are \alpha=1, f(u) = \min(u,1) and w(y,x) = \exp(-|y-x|).

I tried MethodOfLines.jl and in particular this doc, but did not succeed. Here is the script I tried inspired from the doc.

using MethodOfLines, ModelingToolkit, DomainSets, OrdinaryDiffEq, Plots

# Parameters of the PDE and initial condition
tmin = 0.0
tmax = 200.0
α = 1.0
f(u) = (u < 1.0) * u + (u >= 1.0) * 1.0
w(y,x) = exp(-abs(y-x))
xmin = -10.0
xmax = 10.0
u_in(x) = 1.0 * (-1.0 < x) * (x < 1.0)

# Parameters, variables, derivatives and integral
@parameters t x y
@variables u(..) integrand(..)
Dt = Differential(t)

Iy = Integral(y in DomainSets.ClosedInterval(xmin, xmax))

eqs = [
    Dt(u(t, x)) + α * u(t, x) ~ Iy(integrand(t, x, y))
    integrand(t, x, y) ~ w(y, x) * f(u(t, y))
]

bcs = [
    u(0, x) ~ u_in(x),
    integrand(0, x, y) ~ w(y, x) * f(u_in(y))
]

domains = [
    t ∈ Interval(tmin, tmax),
    x ∈ Interval(xmin, xmax),
    y ∈ Interval(xmin, xmax)
]

@named pde_system = PDESystem(eqs, bcs, domains, [t, x, y], [u(t, x), integrand(t, x, y)])

# Method of lines discretization
discretization = MOLFiniteDifference([x => 100, y => 100], t)
prob = discretize(pde_system, discretization)

At this point, the following error is raised:

ERROR: AssertionError: There must be the same number of equations and unknowns, got 2 equations and 3 unknowns

I don’t understand what “unknowns” means here. I thought it was the number of objects created by @variables

I recently posted this related topic.

Unknowns is the number of dependent variables. You have one too many constraints given the integral condition is both an algebraic equation and a BC. It shouldn’t be repeated. I would think

If you use a Riemann sum for the integral, you can write this as

\frac{du}{dt} = -u + W\cdot S(u)

and it is easy to solve this using DifferentialEquations.jl.

You can also use more precise integration scheme like Simpson.

Actually, for your kernel, Id say that the linear operator has finite rank (2?) and you can find a 2?d ODE equivalent to your NFE.

Thank you both !
I will have a look at your ideas.