Hi everyone !
I am searching for some way to solve the following non-linear P(I)DE, known as the refractory density equation or age-structured equation:
for some functions f and h. The functions I used in the script below are f(a,\xi) = 1 + \xi and h(t) = \exp(-t).
I tried MethodOfLines.jl
and in particular this doc, but did not succeed. Here is the script I tried inspired from the doc.
using OrdinaryDiffEq, ModelingToolkit, MethodOfLines, DomainSets
# Parameters of the PDE and initial condition
tmin = 0.0
tmax = 10.0
f(a, ξ) = 1 + ξ
h(t) = exp(t)
amin = 0.0
amax = 3.0
u_in(a) = 1.0 * (0 < a) * (a < 2)
# Parameters, variables, derivatives and integral
@parameters s t a
@variables u(..) integrand_s(..) integrand_a(..)
Dt = Differential(t)
Da = Differential(a)
Ia = Integral(a in DomainSets.ClosedInterval(amin, amax))
Is = Integral(s in DomainSets.ClosedInterval(tmin, t))
# PDE and boundary conditions
eqs = [
Dt(u(t, a)) + Da(u(t, a)) + integrand_a(t, a) ~ 0
integrand_s(s, t, a) ~ h(t - s) * u(t, 0)
integrand_a(t, a) ~ f(a, Is(integrand_s(s, t, a))) * u(t, a)
]
bcs = [
u(0, a) ~ u_in(a),
u(t, 0) ~ Ia(integrand_a(t, a)),
integrand_a(0, a) ~ 0,
integrand_s(0, t, a) ~ 0
]
# Space and time domains
domains = [
t ā Interval(tmin, tmax),
s ā Interval(tmin, tmax),
a ā Interval(amin, amax)
]
# PDE system
@named pde_system = PDESystem(eqs, bcs, domains, [t, a], [u(t, a), integrand_s(s, t, a), integrand_a(t, a)])
# Method of lines discretization
discretization = MOLFiniteDifference([a => 100, s => 100], t)
prob = discretize(pde_system, discretization)
At this point, the following error is raised:
ERROR: ArgumentError: Integration Domain only supported for integrals from start of iterval to the variable, got 0.0 .. t in Integral(s, 0.0 .. t)(integrand_s(s, t, a))
If I understand correctly, it does not support the fact that the upper-bound of the integration domain is the variable t. However, there is a similar case in the doc (by the way, the doc is a bit confusing about this: in my humble opinion there are too many x's, both as integration variable and integral bound).
I recently posted this related topic.