An Agile Modeling Framework For Population Dynamics
An Agile Modeling Framework For Population Dynamics
Original articles
MSC: In this work, we present an agile modeling framework for structured population dynamics,
92D25 leading to automated generation of population models’ equations. The structure of a population,
92-10 i.e. its separation in strata, according to one or many criteria (such as sex, income, health,
35Q49
geographic area or species if dealing with animal populations), represents a major issue for the
34K20
precision and richness of population dynamics simulations. The intensity of some phenomena
92D30
65P30
and mechanisms is highly dependent on the involved subpopulation characteristics. This mod-
eling framework can be seen as an extension of the classic McKendrick–von Foerster equation,
Keywords:
which embeds the population structure. It allows showing, under appropriate hypothesis, an
Population dynamics
McKendrick equation existence and local uniqueness result for the solution of a transport equation. A modeler
Structured population models has been implemented, to generate models that respect the desired structure hypotheses. We
Predator–prey model illustrate its abilities on an age-structured predator–prey model, subject to migratory dynamics
Model generation and to an epidemic, based on a SIRD model.
Bifurcations
0. Introduction
Modeling and simulating population is a major issue in our modern societies. Forecasting population movements, changes in
composition, health evolutions represent key features for governments, public institutions or private insurances. In this work, we aim
to provide a unified framework for population dynamics modeling and simulation. As age is an important feature, we generalize the
classic McKendrick–von Foerster equation, in order to take into account various phenomena in a multi-structured population, such
as exchanges between compartments. These are defined as subpopulations sharing common traits. We will rely on this framework to
present a modeler, i.e. a software able to generate simulable models in a high-level model description language like Modelica. Our
goal is to be able to model and simulate any structured population problem. For example, studying the dynamics of a structured
Lotka–Volterra model, including aging, migration and an epidemic, would be a satisfying objective.
Since the end of the 18th century, modeling a population with discrete or differential equations has been well known and has
proved its efficiency in a first approach [1]. But to get a precise simulation, heterogeneity needs to be taken into account, which
leads to structured models of population. Such models describe a population as a set of subpopulations, defined with one or several
traits (sex or gender, size, age, geographic area...). These traits which may influence natality, growth or mortality rates, as well
as interactions between individuals within a compartment or between compartments. The study of structured population aims to
analyze how those traits affect the model dynamics [2]. Structured population models are highly used in biological mathematics,
including the study of cells growth [3] or epidemic dynamics [4]. To model heterogeneity and provide insights on differences
between individuals, stage-structured models have been developed, sometimes within a non-deterministic point of view [5]. Related
∗ Corresponding author.
E-mail addresses: [Link]@[Link] (L. Attias), [Link]@[Link] (V. Siess), [Link]@[Link] (S. Labbé).
[Link]
Received 22 July 2024; Received in revised form 13 December 2024; Accepted 10 February 2025
Available online 21 February 2025
0378-4754/© 2025 International Association for Mathematics and Computers in Simulation (IMACS). Published by Elsevier B.V. All rights are
reserved, including those for text and data mining, AI training, and similar technologies.
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
works deal with life expectancy through stage and age-structured models [6]. Structured populations may also be studied from the
genetic point of view [7,8], but this is not the approach retained in this work.
The McKendrick–von Foerster equation [9] is one of the most fundamental equations of population dynamics. This transport
equation describes the evolution in time of an age-structured population, with births, aging and death. This model appeared for the
first time in the context of epidemiology [10,11], but its thorough analysis was achieved in a later step [12,13], thanks to methods
related to Volterra integral equations and Laplace transformation.
More recently, the introduction of non-linear models breathed new life into age-structured populations study. In Gurtin and
Maccamy [14], using non-linear integral Volterra equations, authors showed the existence, uniqueness and convergence to an
equilibrium of solutions to a non-linear Sharpe–Lotka–McKendrick model. This work paved the way to breakthroughs on non-linear
models, as much on theoretical developments as on biological applications (see [15] for an exhaustive approach). The growing
mathematical complexity of non-linearities in age-structured models led to developments of new tools and methods, such as linear
and non-linear operator semigroups in Banach spaces, with a functional analysis approach [16].
Structured population models has been studied in a cumulative formulation [17], which consists in considering various
mechanisms (aging, reproduction, death, migration. . . ) separately and adding their contributions, leveraging the superposition
principle on linear differential equations. In a such approach, population dynamics can be studied at both individual and population
level (𝑖-level and 𝑝-level, respectively) [18]. At the 𝑖-level, a probabilistic point of view prevails, as equations such as the Chapman–
Kolmogorov involve the probability to reach a state in a given subset of the states space, for an individual at a given state, at
a given time. At the 𝑝-level, a book-keeping operates to aggregate changes at the 𝑖-level. The renewal of the population, due to
reproduction and deaths, is expressed through integral equations that can be related, if one considers age as a transport variable,
to McKendrick-like equations.
The branching processes field introduced the terminology of kernel [19,20] to describe an elementary operator which rules a
phenomenon’s dynamic (e.g. the reproduction kernel).
In their works, O. Diekmann, M. Gyllenberg, J.A.J. Metz and H.R. Thieme built a strong formal and theoretical framework,
enabling to derive mathematical properties from population models (see Diekmann et al. [17,18,21,22]). In this paper, our goal is
different and consists in building a formal framework to enable a consistent numerical implementation.
The McKendrick–von Foerster equation is still used in both epidemiology and demography studies [23]. For further reading on
transport equations and application to structured population modeling, one should consult [24].
At Dassault Systèmes, we have been interested in population dynamics simulation for many years. We used an algebraic–
differential equation (DAE) formalism, representing subpopulations as compartments, relying on the Modelica language [25], a
high-level model description language. Solvers such as Dymola [26] lie on the Modelica language to perform numerical integration
of DAEs. Our objective is to develop a population model and simulation that could be adapted and tuned to stakeholder’s hypotheses
and needs, for instance in terms of structuration, granularity, scale, or scope of the simulation. Unfortunately, editing manually huge
Modelica models, in order to change its structuration and behavior laws, is time-consuming, painful and presents an important
error risk. There was a need for a tool able to take as input comprehensive population structuration and demographic phenomena
description, and to provide as output an executable file which will then be given to the solver for simulation.
To support such generality, this tool needed a unified framework – a metamodel – able to take into account any population
structure and describe any demographic phenomenon. The McKendrick–von Foerster equation turned out to be a remarkable
complete metamodel for this objective. It can be instantiated with a DAE model, that is what we did, but also within other paradigms,
such as Monte-Carlo or multi-agent simulations.
This article is divided in three sections. In the first section, we present a modeling framework for structured populations, based
on an extension of the McKendrick–von Foerster equation. In the second section, we present a model generator developed and
implemented to generate structured population models based on the previous formalism. In the last section, we apply this formalism
and this model generator to a structured Lotka–Volterra model, and briefly discuss numerical results.
1. Modeling framework
114
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
∏
𝑁
• 𝑥 belongs to a set D called the hyperparameters set; typically, one could have D = D𝑖 where 𝑁 is the number of traits1 and
𝑖=1
D𝑖 the set of values of the 𝑖th trait.
• 𝐼 is an interval of R, of the form [0, 𝑇 ] or [0, +∞[,
( )
• 𝐾 ∶ 𝐼 × 𝐿1 R+ × D × R+ × D → R is a global operator, defined for a.e. (𝑎, 𝑥) in R+ × D,
( )
• 𝑏 ∶ 𝐼 × 𝐿1 R+ × D × R+ × D × D → R+ is the natality rate function, also defined for a.e. (𝑎, 𝑥) in R∗+ × D. 𝑏(𝑡, 𝑔 , 𝑎, 𝑥, 𝑦) represents
the natality rate at time 𝑡, for a population distribution at instant 𝑡 defined by 𝑔, for parents with age 𝑎 and hyperparameter
𝑦 giving birth to children with hyperparameter 𝑥,
( )
• 𝜙0 is the initial population, belonging to 𝐿1 R+ × D ,
( )
• 𝜙 is the population, considered at least in 𝐿1 𝐼 × R+ × D . We will later give a precise meaning of the partial derivatives in
(2a).
In Section 3.2.1, we present a concrete example of how this formalism can be applied to the modeling of a predator–prey situation
with age, space and epidemic structuration. For now, let us precise that the set of hyperparameters D is meant to be the product
of multiple structuration dimensions, representing continuous or discrete criteria. For example, we consider a population model
with, in addition to age, space, gender and income structuration. The age structuration is handled by the transport trait, so D will
gather only the other traits. If we consider 𝑛 distinct zones of space, two genders {𝖬, 𝖥}, and annual income in R+ , we will have
D = [[1, 𝑛]] × {𝖬, 𝖥} × R+ . A typical hyperparameter would be 𝑥 = (𝑛, 𝖥, 𝑟) to denote women in zone 𝑛 with annual income 𝑟. The
income structure can be described continuously, as in the previous example, but also discretely, replacing R+ by income groups
{ } [ [
𝐼1 , … , 𝐼𝑝 , where 𝐼𝑘 = 𝑖𝑘 , 𝑖𝑘+1 for 𝑘 in [[1, 𝑝]], with 𝑖1 = 0 and 𝑖𝑝+1 = +∞. The integral over D in (2b) is then converted into a
discrete sum on 𝑘 going from 1 to 𝑝, which is equivalent to considering the counting measure on the income criterion for integration
over D.
In (2b) we assume that the natality rate for a parent with (𝑎, 𝑦) characteristics giving birth to a newborn with 𝑥 characteristics
may depend on the whole population 𝜙(𝑡). For example, taking into account resources or influence between different compartments.
This is a first step of complexity compared to the original McKendrick boundary condition (1b). But we also assume that this natality
rate only depends on the population 𝜙(𝑡) at instant 𝑡, and not on the population evolution history (𝜙(𝑠))𝑠∈[0,𝑡] . This hypothesis is done
for the sake of simplicity and does not seem to be limitative from a modeling point of view, since the natality rate is at first order
influenced by real-time factors, such as economic development, access to education, status of women in society, access to healthcare,
and so on. This consideration also applies to global operator 𝐾, which may include mortality, geographic migration, evolution of
the income level, etc.
The combination of structuration criteria is simplified by the genericity of the presented framework. One could easily encapsulate
in the 𝑥 hyperparameter, belonging to the hyperparameter space D, each structuration criterion, such as geographic location, income
level or health status. The flows and relationships involved by the addition of a new criterion are easily taken into account in this
unified formalism.
Pointwise operators. A pointwise operator describes an incoming or outcoming flow proportional to a subpopulation, whose
intensity may vary depending on the characteristics of the subpopulation but also on the global population at time 𝑡.
( )
We define it as a mapping 𝐾 ∶ 𝐼 × 𝐿1 R+ × D × R+ × D → R, defined only for a.e. (𝑎, 𝑥) in R+ × D, so that for any (𝑡, 𝑔) in
1
( )
𝐼 × 𝐿 R+ × D and for a.e. (𝑎, 𝑥) in R+ × D,
𝐾(𝑡, 𝑔 , 𝑎, 𝑥) = 𝜇(𝑡, 𝑔 , 𝑎, 𝑥)𝑔(𝑎, 𝑥),
( )
where 𝜇 ∶ 𝐼 × 𝐿1 R+ × D × R+ × D → R is a rate on R+ × D i.e. a mapping defined only for almost every (𝑎, 𝑥) in R+ × D; 𝜇(𝑡, 𝑔 , 𝑎, 𝑥)
represents the intensity of an incoming or outcoming flow within the (𝑎, 𝑥) compartment.
115
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Kernel operators. A kernel operator quantifies precisely the transfer flow to a given compartment from other ones. It is defined as
( ) ( )
a mapping 𝐾 ∶ 𝐼 × 𝐿1 R+ × D × R+ × D → R, defined only for a.e. (𝑎, 𝑥) in R+ × D, so that for any (𝑡, 𝑔) in 𝐼 × 𝐿1 R+ × D and for
a.e. (𝑎, 𝑥) in R+ × D,
𝐾(𝑡, 𝑔 , 𝑎, 𝑥) = 𝜅 (𝑡, 𝑔 , 𝑎, 𝑥, 𝑦) 𝑔(𝑎, 𝑦) d𝑦,
∫D
( )
where 𝜅 is a kernel on R+ × D, i.e. a mapping 𝜅 ∶ 𝐼 × 𝐿1 R+ × D × R+ × D × D → R defined only for almost every (𝑎, 𝑥, 𝑦) in
R+ × D × D; 𝜅(𝑡, 𝑔 , 𝑎, 𝑥, 𝑦) represents the intensity of an exchange flow2 from the (𝑎, 𝑦) to the (𝑎, 𝑥) state in a population distribution
𝑔, at time 𝑡. It is assumed that a kernel may model a change of hyperparameter 𝑦 to 𝑥, but does not affect age, which evolves only
through the transport term.
We may see this exchange operator as a combination of a pointwise operator with rate (𝑡, 𝑔 , 𝑎, 𝑥) ↦ 𝑘(𝑡, 𝑔 , 𝑎, 𝑦, 𝑥) d𝑦 and a kernel
∫D
operator with kernel 𝑘. As we have
𝐾(𝑡, 𝑔 , 𝑎, 𝑥) d𝑥 = 0,
∫D
we recognize a conservative property of such operator; for example, conservation of the total population considering migrations
between territories.
The population modeling formalism presented is able to handle pointwise, kernel and conservative exchange operators, which
may be sufficient for a large range of applications. We acknowledge that for now, it cannot handle some types of operators which
lead to wider types of differential equations. The main limitation is that the global operator 𝐾 must depend on the population 𝜙
only through the current population 𝜙(𝑡). This point is a key feature to enable what will follow. Thus, delay equations involving
𝜙(𝑡 − 𝜏) or equations requiring a ‘‘memory’’ on 𝜙 with a dependence of 𝐾 on 𝜙(𝐴) for a subset 𝐴 of [0, 𝑇 ] are neither handled in the
extended McKendrick formalism.
A second limitation lies in modeling discontinuous features such as hybrid models involving discrete events, because of regularity
assumptions detailed in the following.
Some of these limitations, such as delay equations, can be circumvented thanks to transport equation formulations, that would
be compatible with both the modeling framework and the simulation method presented.
There exists a variety of models that can be embedded in the extended McKendrick formalism. Being able to build conservative
exchange operators paves the way to model a wide range of behaviors. For example, as we will develop below, the predator–prey
model and the Lotka–Volterra equations can be rewritten in this framework, same as epidemic compartmental models (SIR, SIRD,
and all their variations...). Modeling economic evolutions in a population, or information propagation, would also be possible within
our formalism.
To give a precise meaning to the 𝜕𝑡 + 𝜕𝑎 transport operator, even if 𝜙 is not smooth, we reformulate (3a)–(3c) into a fixed point
formulation which will not involve such partial derivative operator, and will be equivalent to (3a)–(3c) if 𝜙 is smooth enough. This
reformulation is based on the characteristics method [9]. We define a mapping 𝑓 by
𝑓 ∶ (𝑡, 𝑎) ↦ 𝜙(𝑡, 𝑎 + 𝑡).
for any real 𝑎, not necessarily positive, and 𝑡 in the time interval [0, 𝑇 ]. This 𝑎 will be called pseudo-age, as 𝑎 + 𝑡 is the real age
considered and must be positive. We denote by 𝜙(𝑡) the mapping 𝑎 ↦ 𝜙(𝑡, 𝑎) for any age 𝑎. We then have 𝜙(𝑡) = 𝑓 (𝑡, ⋅ − 𝑡) and (3a)
rewrites, for fixed real pseudo-age 𝑎,
d𝑡 𝑓 (𝑡, 𝑎) = −𝐾 (𝑡, 𝑓 (𝑡, ⋅ − 𝑡), 𝑎 + 𝑡).
116
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Integrating this equation, distinguishing cases 𝑎 > 0 and −𝑡 ⩽ 𝑎 ⩽ 0 and taking into account initial and boundary conditions leads
to the following integral formulation, for all 𝑡 ∈ [0, 𝑇 ] and for a.e. 𝑎 ∈ [−𝑡, +∞[,
| 𝑡
| 𝜙 (𝑎) − 𝐾 (𝑠, 𝑓 (𝑠, ⋅ − 𝑠), 𝑎 + 𝑠) d𝑠 if 𝑎 > 0,
| 0 ∫0
| (
| +∞
|
| 𝑏 (|𝑎| , 𝑓 (|𝑎| , ⋅ − |𝑎|), 𝜏 , ⋅, 𝑦) 𝜙0 (𝜏 − |𝑎| , 𝑦)
| ∫|𝑎| ∫D
| )
𝑓 (𝑡, 𝑎) = | |𝑎| (4)
|
| − 𝐾 (𝑠, 𝑓 (𝑠, ⋅ − 𝑠), 𝜏 − |𝑎| + 𝑠, 𝑦) d𝑠 d𝑦 d𝜏
| ∫0
|
|
| 𝑡
| − 𝐾 (𝑠, 𝑓 (𝑠, ⋅ − 𝑠), 𝑎 + 𝑠) d𝑠 if −𝑡 ⩽ 𝑎 ⩽ 0.
| ∫
| |𝑎|
This formulation requires less regularity than (3a)–(3c) to be studied, and then may allow less regular solutions. One could think
that such integral formulation is making a mountain out of a molehill, as we could study regular solutions of (3a)–(3c), but there
is nothing of the sort. It is well known that in a transport problem, the regularity of the initial condition is usually reported to
the global solution. In population dynamics, we may imagine violent phenomena such as demographic shocks, wars, pandemics,
baby-booms, etc. Such events may be modeled as non-regular initial conditions. This justifies the study of a non-regular formulation
of the extended McKendrick equation.
We will look for solutions of (4) that will be measurable on 𝑈𝑇 , defined everywhere in time,3 𝐿1 (D) valued, for which the norm
defined by:
+∞
‖𝑓 ‖∞,𝐿1 = sup ‖𝑓 (𝑡, 𝑎)‖𝐿1 d𝑎
𝑡∈[0,𝑇 ] ∫−𝑡
( )
is finite. We will denote 𝐿∞,1 𝑈𝑇 the Banach space of such functions 𝑓 with ‖𝑓 ‖∞,𝐿1 < +∞.
We also define a specific norm on D × D:
Definition 1 (‖⋅‖𝐿1 -𝐿∞ Norm). Let 𝑢 be a function defined almost everywhere on D × D. We will denote by ‖𝑢‖𝐿1 -𝐿∞ the (potentially
infinite) quantity:
‖𝑢‖𝐿1 -𝐿∞ = sup ess |𝑢(𝑥, 𝑦)| d𝑥 = ‖ ‖
‖𝑦 ↦ ‖𝑢(⋅, 𝑦)‖𝐿1 ‖𝐿∞ .
𝑦∈D ∫D
( )
We will denote by 𝐿1 -𝐿∞ (D × D) the space of functions 𝑢 defined almost everywhere on D × D such as ‖𝑢‖𝐿1 -𝐿∞ < +∞.
( ) ( ) ( )
For 𝑟 > 0 and 𝑓0 in 𝐿∞,1 𝑈𝑇 , we will denote by 𝐵 𝑓0 , 𝑟 the closed ball with center 𝑓0 and radius 𝑟 in the space 𝐿∞,1 𝑈𝑇
endowed with ‖⋅‖∞,𝐿1 norm.
( ) ( )
(b) 𝐾 is locally semi-Lipschitz, in the sense that for any 𝑡0 in 𝐼 and 𝑔0 in 𝐿1 R+ × D there exists 𝑉0 a neighborhood of 𝑡0 , 𝑔0
( ) ( ) ( )
inside 𝐼 × 𝐿1 R+ × D , and 𝑐0 ⩾ 0, such that for any 𝑡, 𝑔1 and 𝑡, 𝑔2 in 𝑉0 ,
‖ ( ) ( )‖
‖𝐾 𝑡, 𝑔1 − 𝐾 𝑡, 𝑔2 ‖ 1 ⩽ 𝑐0 ‖ ‖
‖𝑔1 − 𝑔2 ‖𝐿1 . (6)
‖ ‖𝐿
( )
(c) 𝐾 is bounded on every compact, in the sense that for any compact subset 𝑉 of 𝐿1 R+ × D , there exists 𝑀𝐾 ,𝑉 ⩾ 0, such
that for any (𝑡, 𝑔) in 𝑉 ,
‖𝐾(𝑡, 𝑔)‖𝐿1 ⩽ 𝑀𝐾 ,𝑉 . (7)
3 a function 𝑓 defined on 𝑈 will be said defined everywhere in time if it is defined almost everywhere on 𝑈 , with for any 𝑡 in [0, 𝑇 ], 𝑓 (𝑡, ⋅) ∶ [−𝑡, +∞[→ 𝐿1 (D)
𝑇 𝑇
is well-defined.
117
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
( uniform
(b) 𝑏 has ) compact support in age 𝑎. More precisely,
[ there
] exists 0 < 𝑎min < 𝑎max such that for any 𝑡 in 𝐼 and 𝑓 in
𝐿1 R+ , 𝐿1 (D) , the support of 𝑏(𝑡, 𝑓 ) is included in 𝑎min , 𝑎max .
( )
(c) 𝑏 is essentially uniformly 𝐿1 -𝐿∞ -bounded, in the sense that for any 𝑡 in 𝐼 and 𝑔 in 𝐿1 R+ × D ,
( ( ) )
𝑏(𝑡, 𝑔) ∈ 𝐿∞ R+ , 𝐿1 -𝐿∞ (D × D) , (9)
where ‖𝑏(𝑡, 𝑔)‖𝐿∞ = sup ess ‖𝑏(𝑡, 𝑔 , 𝑎)‖𝐿1 -𝐿∞ .
𝑎∈R
+
1
( ) ( )
(d) 𝑏 is locally semi-Lipschitz,
( ) in the sense that for any 𝑡0 in 𝐼 and
( 𝑔)0 (in 𝐿 ) R+ × D , there exists 𝑉1 a neighborhood of 𝑡0 , 𝑔0
1
inside 𝐼 × 𝐿 R+ × D , there exists 𝑐1 ⩾ 0, such that for any 𝑡, 𝑔1 , 𝑡, 𝑔2 in 𝑉1 ,
‖ ( ) ( )‖
‖𝑏 𝑡, 𝑔1 − 𝑏 𝑡, 𝑔2 ‖ ∞ ⩽ 𝑐1 ‖ ‖
‖𝑔1 − 𝑔2 ‖𝐿1 . (10)
‖ ‖𝐿
(e) 𝑏 is uniformly 𝐿1 -𝐿∞ -bounded, in the sense that there exists 𝐵 > 0 such that
( )
∀ (𝑡, 𝑔) ∈ 𝐼 × 𝐿1 R+ × D , for a.e. 𝑎 ∈ R+ , ‖𝑏 (𝑡, 𝑔 , 𝑎)‖𝐿1 -𝐿∞ ⩽ 𝐵 . (11)
Theorem
( 1 )(Existence
( and
) Local Uniqueness for extended McKendrick Equation with Integral Formulation). Let 𝜙0 be an initial condition
in 𝐿1 ∩ 𝐿∞ R+ , 𝐿1 (D) , 𝐾 a global operator satisfying assumptions (5)–(7), and 𝑏 a natality rate( function
) satisfying (8)–(11). There
exists 𝑇 > 0 and 𝑟 > 0 such that if we define 𝑓0 on 𝑈𝑇 by 𝑓0 (𝑡, 𝑎) = 𝜙0 (𝑎 + 𝑡), then 𝑓0 is in 𝐿∞,1 𝑈𝑇 and there exists a unique 𝑓 in
( )
𝐵 𝑓0 , 𝑟 solution of (4).
Proof (sketch). The proof is inspired by the proof of Cauchy–Lipschitz theorem (see Teschl [27, p.47]), using the Banach fixed-point
theorem (see Agarwal ( et) al. [28]). We denote by 𝐹 (𝑓 ) the mapping between (𝑡, 𝑎) and the right member of (4). We define 𝐹 for 𝑓
on a closed ball 𝐵 𝑓0 , 𝑟 centered on 𝑓0 , with radius 𝑟 judiciously chosen later, using hypotheses on 𝐾 and 𝑏 locally semi-Lipschitz
( ) ( )
character. We firstly prove that 𝐹 is well-defined and that 𝐹 (𝑓 ) is in 𝐵 𝑓0 , 𝑟 for 𝑓 in 𝐵 𝑓0 , 𝑟 .
For the well-definition, we show that
+∞ ( ( ) )
‖𝐹 (𝑓 )(𝑡, 𝑎)‖𝐿1 d𝑎 ⩽ (𝐵 𝑇 + 1) ‖ ‖ ‖ ‖
‖𝜙0 ‖𝐿1 + 𝑐0 ‖𝑓 − 𝑓0 ‖∞,𝐿1 + 𝑀0 𝑇
∫−𝑡
( ) [ ]
where 𝑇 is chosen small enough, 𝑐0 is given ( by)(6) on a neighborhood of 0, 𝜙0 and 𝑀0 is given by (7) on 0, 𝑟0 × {𝜙0 }, where 𝑟0
is the radius of an open ball centered on 0, 𝜙0 included in a such neighborhood.
( )
To show the stability of 𝐵 𝑓0 , 𝑟 by 𝐹 , we firstly show that
( ) ( )
𝑇 𝐵‖ ‖ ‖ ‖
‖𝜙0 ‖𝐿1 + ‖𝜙0 ‖𝐿∞ + 𝑇 𝑐0 𝑟 + 𝑀0 + 𝜀0
‖𝐹 (𝑓 ) − 𝑓0 ‖ 1 ⩽
‖ ‖∞,𝐿 1 − 𝐵𝑇
𝑟0
where 𝜀0 is chosen as . We suppose that 𝑟 and 𝑇 are chosen such that
( 4 )
𝐵‖ ‖ ‖ ‖
‖𝜙0 ‖𝐿1 + ‖𝜙0 ‖𝐿∞ + 𝑀0 𝑇 + 𝜀0
( ) ⩽ 𝑟,
1 − 𝐵 + 𝑐0 𝑇
which gives
‖𝐹 (𝑓 ) − 𝑓0 ‖ 1 ⩽ 𝑟.
‖ ‖∞,𝐿
( )
Thus, 𝐵 𝑓0 , 𝑟 is stable by 𝐹 .
( ) ( )
We then show that 𝐹 is contractant on 𝐵 𝑓0 , 𝑟 . More precisely, we show that for 𝑓 and 𝑔 in 𝐵 𝑓0 , 𝑟 ,
( )
( ) ( ( )) 𝑇 2
‖𝐹 (𝑓 ) − 𝐹 (𝑔)‖∞,𝐿1 ⩽ 𝑐0 + 𝑐1 ‖ ‖
‖𝜙0 ‖𝐿1 𝑇 + 𝐵 𝑐0 + 𝑐1 𝑐0 𝑟 + 𝑀0 ‖𝑓 − 𝑔‖∞,𝐿1 ,
2
( )
where 𝑐1 is given by (10) on a neighborhood of 0, 𝜙0 . We suppose that 𝑟 and 𝑇 are chosen such that
( ) ( ( )) 𝑇 2
𝑐0 + 𝑐1 ‖ ‖
‖𝜙0 ‖𝐿1 𝑇 + 𝐵 𝑐0 + 𝑐1 𝑐0 𝑟 + 𝑀0 < 1.
2
( ) ( )
Thus, 𝐵 𝑓0 , 𝑟 is stable by 𝐹 and 𝐹 is contractant on 𝐵 𝑓0 , 𝑟 . Applying the fixed-point Banach theorem, there exists a unique
( )
fixed-point of 𝐹 in 𝐵 𝑓0 , 𝑟 , which is solution of (4) for 𝑡 in [0, 𝑇 ] and almost everywhere in 𝑎. □
118
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
2. Model generator
2.1. Motivation
When studying structured population dynamics, our goal was to take into account population structuration to reach a more
precise model. For example, because of cultural reasons, the mortality rate may vary according to the geographical area considered,
other things being equal. When modeling an epidemic, factors such as age, gender, cultural framework or educational level influence
the probability to be infected. It is still possible to model populations and interactions as homogeneous blocks, but the results would
be rough, and the conclusions would not be applicable. This justifies the interest for structured population models.
Building and simulating a model is usually made of several steps. The modeling itself consists in specifying a set of choices
on formalism, hypothesis scopes which states are defined in our model, and how the individual parameters influence transitions
between these states. This abstract model is then transcribed into a formal model, for example a set of UML diagrams, which may
itself give an executable model written in a modeling or programming language.
A modeling language such as Modelica [25] enables users to describe a model as a list of algebraic–differential equations, without
the need to go through translation and simulation steps, where the model description is transformed into numerical results through
the execution of powerful solvers. Thus, users do not need to handle discretization and integration of the ordinary differential
equations, approximate resolutions of algebraic equations, and all the numerical issues that such topics arise. The only input required
by the solver is the model description.
However, writing a model description for large population models, with lots of structuration criteria and values, is less easy
than meets the eye. Avoiding errors (syntax, consistency between equations, model completeness) is tricky. Enhancing a model
description which is already written is painful, time-consuming, and this work is not easily reusable when one wants to multiply
modifications.
Here the need of a model generating tool arises. This tool must be able to take as input a textual and comprehensive description
of a population dynamics model. It will use it to generate model description written in the Modelica language. Then, to change the
structuration hypothesis, for instance, one only has to change the textual input and give it to the generator, which will rewrite the
whole model description corresponding to the new modeling choices.
A model generating tool could be helpful when choosing discretization schemes for the numerical simulation of the model.
Indeed, if we decide to use only an ODE or DAE formulation for the model, we have to apply to (2a)–(2c) a semi-discretization for
the age partial derivative. For example, with an upwind finite difference scheme, it would write:
𝜙 (𝑡, 𝑥) − 𝜙𝑖−1 (𝑡, 𝑥) ( )
d𝑡 𝜙𝑖 (𝑡, 𝑥) + 𝑖 + 𝐾 𝑡, 𝜙(𝑡), 𝑎𝑖 , 𝑥 = 0 (12)
𝛥𝑎
with 𝑖 the number of the age class considered. But the choice of scheme can be seen as arbitrary, and one could want to change the
age discretization scheme without having to rewrite the whole model. A tool that separates the model and the input data from the
numerical scheme could offer a such feature.
2.2. Methods
Our model generator’s working principle is illustrated in Fig. 1. The program is written in the Python language.
An example model. To illustrate how the generator enables to create a Modelica model from simple user input, let us take a dummy
example of a population, age-discretized in five age groups, living in a territory divided in three zones 𝐴, 𝐵, 𝐶. People are born,
get old and die of old age only. The natality rate can depend on age, but not on zone. They may change of zone during their life,
through migration whose intensity depends on age and on attractivity of each zone, which can be arbitrarily fixed for illustration
purpose. For example, the graph represented on Fig. 2 represents the connectivity between zones 𝐴, 𝐵 and 𝐶 in our dummy model.
The numerical parameters for the intensity of these flows are chosen arbitrarily and vary with the age class.
119
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Fig. 2. Chosen migration dynamics for the dummy model. The indicated numerical values are nominal values which vary according to age.
Fig. 3. Structuration input files for the dummy model. The value of ‘‘max’’ in ‘‘population’’ means that the age of an individual is truncated at 100 years.
Population structuration. As illustrated on Fig. 3, we write in a first file (Listing 1) the structuration of population as a set of criteria
and values.4 The age structure will be written in a second file (Listing 2), because age plays a particular role in the equations derived
from the McKendrick extended model. One may also consider many population components, with no exchange between them (such
as in a predator–prey model). Then the structuration of each population component will be written in separate files.
Evolution operators. The input data files also include the description of operators, i.e. what is hidden behind the global operator
evolution 𝐾. For example, in our dummy model, we have mortality as a pointwise operator, migration as an exchange operator,
a combination of a kernel and a pointwise operator, and natality which also has a special role in our metamodel. As shown in
Listing 3, we store the names of such phenomena in front of keys describing the type of operator. These key names (‘‘pointwise’’,
‘‘exchange’’, ‘‘boundary’’) refer to various operator classes implemented in the model generator. The values refer to the specific
operator names given in the model.
{
" pointwise " : " mortality " ,
" exchange " : " migration " ,
" boundary " : " natality "
}
Listing 3: Operator description file for the dummy model
An exchange operator, such as migration, needs to be given a connectivity graph to know which values are connected to
each other. We store this information in a separate JSON file (Listing 4). The convention adopted is that keys represent destination
compartments, and the associated values or lists of values represent origin compartments where the population flow may come
from.
4 In the dummy model, there is only one criterion (zone) with three values (𝐴, 𝐵 and 𝐶).
120
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
{
" trait " : " zone " ,
" graph " : {
" A " : [ " B " ],
" B " : [ " A " , " C " ],
"C": ["A"]
}
}
Listing 4: Connectivity graph file for migrations in the dummy model, immediately derived from the graph on Fig. 2
Behavior laws for non-linear operators. A population dynamics model is usually way more complex than our dummy model. Some
relationships between subpopulations may be non-linear. For example, in an epidemic model, the amount of newly infected people
depends on the product between sensible and infected people. Such relationships are written in a separate file, in a mathematical
textual input using natural symbols, or functions defined in another file. Such files are parsed to capture the non-linear relationships
and then translate them in the executable code.
Numerical parameters. Finally, we need to feed our model generator with the numerical values of structured parameters. For
example, with our age and zone structured model, we need a natality values file with the natality rate of each age group, in each
geographic zone (Listing 5). The amount of values needed may explode when the number of structuration criteria increases, thus
one may use a script to generate such values as a combination of statistical data on a population. The initial condition is also given
in a such format.
[
{ " A " : 0.004, " B " : 0.004, " C " : 0.004},
{ " A " : 0.077, " B " : 0.077, " C " : 0.077},
{ " A " : 0.003, " B " : 0.003, " C " : 0.003},
...
]
Listing 5: Numerical values of natality (excerpt)
The Listing 6 shows how a mortality operator is represented in the virtual model. In the dummy model, the mortality operator is a
linear age-structured pointwise operator. Non-linear operators have also been implemented. The structuration for all criteria except
age is represented in the structuration attribute. For some operators, such as exchange operators, user will need to specify the
criteria susceptible to change between source and destination, and the unchanged ones. The ageStructuration attribute carries
information about the maximal age considered (here, 100 years old) and the number of age groups considered (5 in our example).
The data attribute refers to an instance of the Data class, in which the mortality rates are available. This instance is built from
numerical parameters given as input data.
A virtual model can have as many operators as necessary, each operator describing only one phenomenon undergone by the
population. The tree-like structure enables to always have, for the children nodes of an operator, all the information necessary to
provide the next steps of the simulable model generation.
121
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Fig. 5. Variables and main equation for the derived dummy model.
The equation in Listing 10 refers to the description of a natality operator equation, with a sum over all age components represented
by +_𝚊𝚐𝚎. The natality variable on the left-hand side is used for the equation of the youngest age group :
122
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Fig. 6. Equations describing operators of mortality, natality and migration for the dummy model (excerpts).
∑
𝑁
( )
𝜙0 (𝑡, 𝑧) = 𝑏 𝑡, 𝑎𝑖 , 𝑧 𝜙𝑖 (𝑡, 𝑧).
𝑖=1
Finally, the equation in Listing 11 refers to the description of a migration operator equation. The oldZone attributes corresponds to
the origin zone, and the zone one refers to the destination. The list of terms considered in such equation is given by the connectivity
graph (Listing 4), to avoid writing unexisting flows between compartments. A such equation would be written as:
( ) ( )
𝐾𝑧 𝑡, 𝜙(𝑡), 𝑎𝑖 , 𝑧 = 𝐴 = − 𝜅𝑧 𝑡, 𝑎𝑖 , 𝐵 → 𝐴 𝜙𝑖 (𝑡, 𝑧 = 𝐵)
( )
+ 𝜅𝑧 𝑡, 𝑎𝑖 , 𝐴 → 𝐵 𝜙𝑖 (𝑡, 𝑧 = 𝐴)
( )
+ 𝜅𝑧 𝑡, 𝑎𝑖 , 𝐴 → 𝐶 𝜙𝑖 (𝑡, 𝑧 = 𝐴)
The sign of terms in the right-hand side corresponds to whether the term is an incoming or outcoming migration flow.
123
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
2.3. Summary
We developed and implemented a model generator to handle generation of executable models conforming to our extended
McKendrick formalism. These models are written using the Modelica language, from synthetic inputs that can be manually written
using the JSON language, respecting a set of rules that have been documented. We tackled the issue of writing structured models,
with a number of variables and equations which may explode as the structuration is refined and gets more and more complex. Our
model generator handles ODE and PDE formalisms, and generates as output models written in Modelica, but its structure is robust
enough to consider developments with other formalisms and other modeling or programming languages.
For now, the input data interface is not very user-friendly. JSON files have many advantages – they are light, parsing libraries
already exist in almost every programming language, and the standard is complete enough to store any type of data we would need.
This format of input data is acceptable for research uses, as it enables a synthetic representation of a population dynamic model.
But is not suitable for various modeling purposes, which need a simpler and more ergonomic interface to indicate the structure of
the model and equations. For this reason, we plan to implement a UML/SysML interface between the user and the model generator
input. This interface should be user-friendly, for example with drag-and-dropping boxes to represent the steps of a population process
(for example in education, economics or health fields).
124
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Fig. 8. Time evolution (a) and phase portrait (b) of the classic predator–prey model.
The Lotka–Volterra model has been widely studied by mathematicians [32]. Its goal is to model a predator–prey dynamics
within an ecosystem, where there may be a competition for resources and an asymmetric role played by preys and predators. This
model is well known by the mathematical community. For this reason, we found interesting taking it as a toy model to show how
our modeling framework may apply and what interesting results can emerge from the introduction of structuration thanks to the
extended McKendrick formalism.
where 𝑋 (resp. 𝑌 ) is the number of preys (resp. predators), 𝛼 is the prey natality rate, only due to intrinsic reproduction, 𝛽 is
the prey mortality rate, due to predation, 𝛿 is the predator natality rate, due to predation, and 𝛾 is the predator mortality rate, only
from natural origin.
For the sake of completeness, we remind the classic shapes of time-evolution and phase portrait for the usual predator–prey
model (Fig. 8).
Species structuration. We will separate preys and predators in components (see Fig. 4), as they will not necessarily have the same
structuration and no population exchange will happen between these populations. The prey (resp. predator) component will be
denoted by 𝜙𝑋 (resp. 𝜙𝑌 ).
Age structuration. Both populations will be age structured, to take into account the aging process. The time derivatives in (14) will
be replaced by transport operator 𝜕𝑡 + 𝜕𝑎 .
Territory structuration and migrations. We suppose that the land where our preys and predators live is divided into four zones,
numbered from 1 to 4. We do arbitrary hypotheses on connectivity between zones and numerical parameters representing the
proportion of each zone population which will move to another zone – see Fig. 9. The values indicate a nominal exchange rate,
which is then linearly modulated according to the age and eventually the health status of individuals.
125
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Epidemic structuration. For illustration purpose, we decide to assume that the prey population is affected by an epidemic, according
to a SIRD model [11]. Susceptible (𝑆) individuals, once infected, move to the compartment of infected (𝐼) individuals, which may
recover (𝑅) from their disease or die (𝐷). This simple model does not take into account reinfection (no transition from 𝑅 to 𝑆 or
𝐼) nor other mortality factors than the infection, such as natural mortality due to aging. The equations of this model are given by
(15). The compartments are illustrated on Fig. 10.
⎧
⎪ d𝑡 𝑆 = −𝑘𝐼 𝑆
⎪ d𝑡 𝐼 = 𝑘𝐼 𝑆 − (𝜆 + 𝜈)𝐼
⎨ d 𝑅 = 𝜆𝐼 (15)
⎪ 𝑡
⎪ d𝑡 𝐷 = 𝜈 𝐼
⎩
𝑘 represents the infectivity rate, 𝜆 the recovering rate, and 𝜈 the lethality rate.
The goal is to include each of these structuration criteria and the behavior laws governing these phenomena, as they are, for
now, isolated from each other, within a unique population dynamics model, to describe a structured predator–prey model. The
modeling framework developed around the extended McKendrick formalism will tackle this issue.
126
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
that an individual whose parents are located in zone 𝑧 at birth is born in zone 𝑧. We get the following equations:
⎧ 𝜕 𝜙 (𝑡, 𝑎, 𝑧, 𝑠) + 𝜕 𝜙 (𝑡, 𝑎, 𝑧, 𝑠) + 𝐾 (𝑡, 𝜙(𝑡), 𝑎, 𝑧, 𝑠) = 0 ∀ (𝑡, 𝑎, (𝑧, 𝑠)) ∈ 𝐼 × R+ × D𝑋 , (a)
⎪ 𝑡 𝑋 𝑎 𝑋 𝑋
⎪
+∞ ∑
⎨ 𝜙𝑋 (𝑡, 0, 𝑧, 𝑠) = ∫ 𝑏𝑋 (𝑡, 𝜙(𝑡), 𝑎, 𝑧, 𝑠, 𝑠) ̃ d𝑎
̃ 𝜙𝑋 (𝑡, 𝑎, 𝑧, 𝑠) ∀ (𝑡, (𝑧, 𝑠)) ∈ 𝐼 × D𝑋 , (b) (16)
⎪ 0 𝑠∈{S,I,R,D}
̃
⎪ 𝜙𝑋 (0, 𝑎, 𝑧, 𝑠) = 𝜙0,𝑋 (𝑎, 𝑧, 𝑠) ∀ (𝑎, (𝑧, 𝑠)) ∈ R+ × D𝑋 . (c)
⎩
⎧ 𝜕𝑡 𝜙𝑌 (𝑡, 𝑎, 𝑧) + 𝜕𝑎 𝜙𝑌 (𝑡, 𝑎, 𝑧) + 𝐾𝑌 (𝑡, 𝜙(𝑡), 𝑎, 𝑧) = 0 ∀ (𝑡, 𝑧) ∈ 𝐼 × R+ × D𝑌 , (a)
⎪ +∞
⎨ 𝜙𝑌 (𝑡, 0, 𝑧) = ∫ 𝑏𝑌 (𝑡, 𝜙(𝑡), 𝑎, 𝑧) 𝜙𝑌 (𝑡, 𝑎, 𝑧) d𝑎 ∀ (𝑡, 𝑧) ∈ 𝐼 × D𝑌 , (b) (17)
⎪ 0
⎩ 𝜙𝑌 (0, 𝑎, 𝑧) = 𝜙0,𝑌 (𝑎, 𝑧) ∀ (𝑎, 𝑧) ∈ R+ × D𝑌 . (c)
Migration. Let us denote by 𝑚𝑖𝑗 the migration flow intensity from zone 𝑖 to zone 𝑗, as introduced in Fig. 9. The migration operator
can be written as
∑
4
( )
𝐾𝑋 ,𝑚 (𝑡, 𝜙(𝑡), 𝑎, 𝑖, 𝑠) = 𝑚𝑖𝑗 𝜙𝑋 (𝑡, 𝑎, 𝑖, 𝑠) − 𝑚𝑗 𝑖 𝜙𝑋 (𝑡, 𝑎, 𝑗 , 𝑠)
𝑗=1
for predators. We observe that each operator does not depend on the other species, and that age and health are supposed not to
change when an individual migrates, as this change can be considered as instant. Such exchange operators can be rewritten as the
sum of a pointwise and of a kernel operator. For example, for predators, we may write
( 4 )
∑ ∑
4
𝐾𝑌 ,𝑚 (𝑡, 𝜙(𝑡), 𝑎, 𝑖) = 𝑚𝑖𝑗 𝜙𝑌 (𝑡, 𝑎, 𝑖) − 𝑚𝑗 𝑖 𝜙𝑌 (𝑡, 𝑎, 𝑗)
𝑗=1 𝑗=1
∑
4
where 𝑚𝑖𝑗 is the rate of the pointwise operator representing the emigration flow from zone 𝑖, and 𝑚𝑗 𝑖 is the value of the (discrete)
𝑗=1
kernel of the kernel operator representing the immigration flow from zone 𝑗 to zone 𝑖.
Mortality. The mortality operators 𝐾𝑋 ,𝜇 and 𝐾𝑌 ,𝜇 will typically be defined as pointwise operators, according to the following
expressions issued from mortality terms in (14):
( +∞ )
𝐾𝑋 ,𝜇 (𝑡, 𝜙(𝑡), 𝑎, 𝑧, 𝑠) = 𝛽 (𝑎, ̃ 𝑧) d𝑎̃ 𝜙𝑋 (𝑡, 𝑎, 𝑧, 𝑠),
̃ 𝑧) 𝜙𝑌 (𝑡, 𝑎,
∫0
Epidemic status evolution. The SIRD equations are rewritten in the McKendrick formalism, using pointwise and kernel operators,
resulting in a sum on health statuses.
The sign is reversed in (18a)–(18d) because the global operator 𝐾𝑋 is on the left side of the extended McKendrick equation (16a).
⎧ ( +∞ )
⎪ 𝐾𝑋 ,𝑠 (𝑡, 𝜙(𝑡), 𝑎, 𝑧, S) = 𝑘 (𝑎, 𝑎) ̃ 𝑧, I) d𝑎̃ 𝜙𝑋 (𝑡, 𝑎, 𝑧, S)
̃ 𝜙𝑋 (𝑡, 𝑎, (a)
⎪ ∫0
( )
+∞
⎪
⎨ 𝐾𝑋 ,𝑠 (𝑡, 𝜙(𝑡), 𝑎, 𝑧, I) = − ∫ 𝑘 (𝑎, 𝑎) ̃ 𝑧, I) d𝑎̃ 𝜙𝑋 (𝑡, 𝑎, 𝑧, S) + (𝜆(𝑎) + 𝜈(𝑎)) 𝜙𝑋 (𝑡, 𝑎, 𝑧, I) (b)
̃ 𝜙𝑋 (𝑡, 𝑎, (18)
⎪ 0
⎪ 𝐾𝑋 ,𝑠 (𝑡, 𝜙(𝑡), 𝑎, 𝑧, R) = −𝜆(𝑎)𝜙𝑋 (𝑡, 𝑎, 𝑧, I) (c)
⎪ 𝐾𝑋 ,𝑠 (𝑡, 𝜙(𝑡), 𝑎, 𝑧, D) = −𝜈(𝑎)𝜙𝑋 (𝑡, 𝑎, 𝑧, I) (d)
⎩
In (18a) the flow of susceptible individuals is represented as a pointwise operator, with a rate expressed as a continuous sum
over ages of infected individuals a susceptible individual could meet. 𝑘 (𝑎, 𝑎)
̃ is the infectiosity between infected individuals at age
127
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
𝑎̃ and susceptible individuals at age 𝑎. In (18b) the flow of infected individuals is the sum of two terms. The first one is a kernel
operator representing the incoming infection flow due to contacts between susceptible and infected individuals, same as in (18a)
but with opposite sign. The second one is a pointwise operator representing the outgoing flows of infected individuals who recover,
with recovery rate 𝜆(𝑎), or die, with lethality 𝜈(𝑎). The Eqs. (18c) and (18d) are kernel operators for incoming flows of recovered
or died infected individuals.
Behind such equations, many modeling hypotheses have been done. For example, infectiosity, recovery rate and lethality do not
depend on time 𝑡, nor on geographic zone 𝑧. We observe that in kernel operators, kernel can be very sparse, because the incoming
flow may come from a very restricted sample of compartments. In (18c)–(18d), the incoming flow comes only from the infected
compartment of the same zone, resulting in a very sparse kernel.
3.2.3. Natality
Let us develop the natality rates behind 𝑏𝑋 and 𝑏𝑌 in (16b) and (17b).
Prey natality rate. We suppose that the prey natality rate is constant over time, dependent on the age 𝑎 of the parent, and independent
of the global population state 𝜙(𝑡) and of the zone of birth 𝑧. It may depend on the parent’s epidemic status 𝑠,̃ as infected individuals
may be less fertile, and individuals who died from the epidemic cannot reproduce. We suppose that individuals are born in the S
compartment only. There exists a mapping 𝛼 such as
̃ = 𝛿𝑠S 𝛼 (𝑎, 𝑠)
𝑏𝑋 (𝑡, 𝜙(𝑡), 𝑎, 𝑧, 𝑠, 𝑠) ̃
Predator natality rate. The formulation of the predator natality rate requires to take into account the non-linearity of the dependence
on prey populations. We will then have
+∞ ∑
𝑏𝑌 (𝑡, 𝜙(𝑡), 𝑎, 𝑧) = 𝛿 (𝑎, 𝑎, ̃ 𝑧, 𝑠) d𝑎.
̃ 𝑧, 𝑠) 𝜙𝑋 (𝑡, 𝑎, ̃ (19)
∫0
𝑠∈{S,I,R,D}
(19) expresses the contribution of preys of any age 𝑎̃ and epidemic status 𝑠, in the fixed and common zone 𝑧, to the natality rate
of predator with age 𝑎. This is a typical case where the global population state 𝜙(𝑡) at instant 𝑡 is necessary to compute the natality
rate, through the prey population 𝜙𝑋 (𝑡) specified in an age 𝑎̃ and a hyperparameter (𝑧, 𝑠).
The following results aim to show the diversity of behaviors one can encounter in a structured population dynamics model,
and the difficulty in forecasting a dynamic system’s asymptotic behavior. We base this statement on three numerical studies on
structured Lotka–Volterra models. The first model consists in a set of 400 variables and equations, representing preys and predators
with 20 age classes on each species, 4 zones, and 4 health statuses for preys. In the second model we removed the epidemic aspect,
took 30 age classes and kept geographical structuration parameters same. The model results in 240 variables and equations. In the
third model, we did not consider any structuration beyond the number of species, so that we only had 4 homogeneous species and
then, 4 variables and equations.
These three examples illustrate how one may numerically grasp the notion of bifurcation in structured population models. Not
only epidemic but also predation parameters, and even age discretization can generate bifurcations. Such bifurcations can be easily
located and visualized using a model generator.
The models generated can be found as supplementary material (Online Resources 1, 2, 3).
128
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Fig. 11. Predator–prey phase portrait. The presence of an epidemic has changed the asymptotic behavior from convergence to periodicity.
Fig. 12. Predator–prey phase portrait. The presence of an epidemic has changed the asymptotic behavior from periodicity to convergence.
129
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Fig. 13. Phase portraits of predator–prey models with different initial conditions (a) and (b). The initial condition has been marked with a red star. The
demographic parameters are unchanged between the two simulations. (For interpretation of the references to color in this figure legend, the reader is referred
to the web version of this article.)
Fig. 14. Time evolution by zone for preys and predators in a prey–predator model.
initial condition, we observed that the system winds around a different cycle (Fig. 13).
130
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Fig. 15. [llustration of chaos in a two preys–two predators system....]Illustration of chaos in a two preys–two predators system. The bifurcation
diagram (Fig. 15(a)) has been plotted with a 𝜆 parameter varying from 0 to 1 to explore a chosen line segment in the R12 parameter space,
( )
between the following parameter values for 𝛼1 , 𝛼2 , 𝛽11 , 𝛽12 , 𝛽21 , 𝛽22 , 𝛾1 , 𝛾2 , 𝛿11 , 𝛿12 , 𝛿21 , 𝛿22 : (0.5, 0.533, 0.666, 0.03, 0.033, 0.066, 0.046, 0.023, 0.02, 0.046, 5.1, 5.1) and
(0.5, 0.483, 0.042, 0.045, 0.458, 0.042, 0.029, 0.041, 0.035, 0.029, 5.1, 5.1). The Poincaré section (Fig. 15(b)) has been chosen for 𝜆 ≃ 0.208.
squirrels 𝑥2 ) and two predator species (foxes 𝑦1 and wolves 𝑦2 ) living together. The equations of a such system are the following :
⎧
⎪ d𝑡 𝑥1 (𝑡) = 𝛼1 𝑥1 (𝑡) − 𝛽11 𝑦1 (𝑡)𝑥1 (𝑡) − 𝛽12 𝑦2 (𝑡)𝑥1 (𝑡)
⎪ d𝑡 𝑥2 (𝑡) = 𝛼2 𝑥2 (𝑡) − 𝛽21 𝑦1 (𝑡)𝑥2 (𝑡) − 𝛽22 𝑦2 (𝑡)𝑥2 (𝑡)
⎨ (20)
⎪ d𝑡 𝑦1 (𝑡) = 𝛿11 𝑥1 (𝑡)𝑦1 (𝑡) + 𝛿12 𝑥2 (𝑡)𝑦1 (𝑡) − 𝛾1 𝑦1 (𝑡)
⎪ d𝑡 𝑦2 (𝑡) = 𝛿21 𝑥1 (𝑡)𝑦2 (𝑡) + 𝛿22 𝑥2 (𝑡)𝑦2 (𝑡) − 𝛾2 𝑦2 (𝑡)
⎩
where 𝛼𝑖 , 𝛽𝑖𝑗 , 𝛿𝑖𝑗 and 𝛾𝑖 , for 𝑖, 𝑗 = 1, 2, are natality and mortality parameters, defined similarly as in the classic Lotka–Volterra model.
The appearance of chaos in such a simple model may be highlighted through the plot of a bifurcation diagram (Fig. 15(a)). We
let vary parameters in given ranges, and for each value, plotted intersection points of an orbit of (20) with a chosen hyperplane
of R4 . One may distinguish parameter ranges of chaotic behavior, where intersection points (here their projection on the 𝑦1 axis)
spread on a large range of values, from periodic behavior, where intersection points form regular lines. For 𝜆 ≈ 0.8, we observe a
phenomenon that needs explanations. Two periodic attractors coexist, and the initial condition switches from an attraction basin to
the other. On Fig. 15(b), we plotted an example of a Poincaré section. The intersection points with a given hyperplane, for a chosen
set of parameters, were plotted and colored by order of intersection. The various ramifications observed in this figure indicate a
fractal nature that we can relate to usual chaotic systems (see [34]).
Discussion
The developed model generator is able to generate models conforming to a modeling framework introduced to systematically
embed any population dynamics related problem with a stock-flow approach. The modularity of its implementation makes seamless
changing the numerical scheme used to discretize our equations. As we mentioned in Section 2.3, an objective would be to implement
a user–friendlier interface to input model descriptions into the generator, for example using the SysML modeling language. Let us
give an overview of what such an interface could achieve. The SysML language could be used to replace high-level equations by
symbolic links between diagrams. Building a library of architectural patterns or a SysML profile to implement ODEs, pointwise,
kernel and exchange operators would be interesting, and should embed the behavior laws of each component. Thus, the diagrams
will convey the same information as the JSON files, with an interface where a box can be replaced by a more complex one to refine
the model without affecting the whole structure. The generator should be enhanced to convert a diagram into the corresponding
list of structured equations, according to a structuration setting that would also be formulated as a diagram in the SysML language.
It should be noted that a SysML extension named SysPhS [35] exists and enables conversion of SysML models to Modelica code. It
has been used in a first approach but the limitations encountered following our goal of generating structured model in Modelica led
to the development of our own modeler. The Fig. 16 shows an example of structure for a predator–prey model designed in SysML
to be then converted to Modelica through the model generator.
Using a model generator like the one presented could be enlightening for convergence studies on age-structured models. One
could generate models with a chosen number of age classes and observe the influence of this choice over the numerical results.
It could also be used to put to the test numerical studies on age-structured models, to ensure the number of age classes do not
influence the results.
Another limit is of technical nature. Simulating large models written in Modelica is tough. When tackling the issue of modeling
a complete population, with many levels of structuration, one can easily reach the amount of 100 000 variables and equations to
describe a such model. Generating it does not present any problem, but simulating it through Modelica solvers, as we tried with the
one embedded in the Dymola software, may present crippling computation durations. This is a major obstacle to the calibration of
131
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Fig. 16. Example of what a SysML interface for modeling system dynamics model could look like.
these models, as calibration needs hundreds of simulation runs to converge to an optimal distribution of parameters.
Concerning the numerical results presented in Section 3.3, the structured Lotka–Volterra model, which has been built, simulated
and studied, is a toy model. It aims to demonstrate our model generator’s abilities and how complex behaviors may emerge from a
structured model. Our goal is not to forecast how prey and predator populations would evolve in an ecosystem if the structure was
precisely taken into account. Thus, the model was not calibrated using field data, and many numerical values of parameters in it
were chosen arbitrarily, for demonstration purposes. This toy model has been considered to illustrate our modeler abilities, and we
may easily make it more complete and more complex by refining the modeling, taking into account new phenomena, etc. Again,
this refinement would be helped by the large scope of our modeling framework.
The epidemiologic model could be refined, by differentiating predation coefficients for infected preys, or by integrating a
transmission of the disease to predators. The goal with Lotka–Volterra and SIRD models was to show how usual population dynamics
models can be naturally embedded in our framework.
Future work
We plan several in-depth studies to carry on these works. As mentioned before, a SysML interface for the model generator input
is planned for implementation; this will increase the efficiency in building new models and imagining new scenarios. We also plan
to enhance the model generator to build and simulate models in various modeling paradigms, such as multi-agent system, stochastic
simulation, and even build hybrid models mixing such paradigms on different scales.
Deepen the structured Lotka–Volterra model analysis could be of major interest, and deeply relatable with recent works [36–38],
for example by studying and understanding the influence of an age structure on the modeling of predation between individuals. The
stability study in a structured Lotka–Volterra model could be part of this analysis, to better understand the coexistence of stable
cycles and the bifurcation phenomena observed when switching on and off the epidemic operator.
Conclusion
In this work, we developed an agile population modeling framework based on an extension of the well-known McKendrick
equation, which tackles the introduction of structure in population models. This framework has proven to be sufficiently wide to
embed complex structured models and many classic problems in population dynamics that can be easily coupled together (such as
predator–prey and epidemiologic models). Here is the main interest of our approach. It can be relatively easily extended to other
population or biological models, for example working on size structure in cell division models (see Perthame [24], Michel [39]).
We showed that the variety of phenomena usually considered can be reduced to two types of operators, called pointwise and
kernel operators. The theorem of local existence and uniqueness is based on a fixed-point argument, inspired by the proof of Cauchy–
Lipschitz theorem. We implemented a model generator in Python language, in order to generate various models easily and focus
on simulation results instead of writing the model’sexte code manually. We illustrated the power of this approach on a structured
predator–prey model, with age structuration, territorial dynamics and an epidemic through an SIRD model. The introduction of
structure in such model reveals a variety of behaviors, in terms of asymptotic behavior, stability and appearance of chaos.
132
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
Funding
This work was funded by Dassault Systèmes and the Association Nationale de la Recherche et de la Technologie (ANRT).
Laurent Attias: Writing – review & editing, Writing – original draft, Methodology, Investigation, Formal analysis, Conceptual-
ization. Vincent Siess: Writing – review & editing, Writing – original draft, Validation, Supervision, Methodology, Investigation,
Formal analysis, Conceptualization. Stéphane Labbé: Writing – review & editing, Validation, Supervision, Conceptualization.
The authors declare that they have no known competing financial interests or personal relationships that could have appeared
to influence the work reported in this paper.
Acknowledgments
This work has been carried out under a collaboration between Sorbonne Université and Dassault Systèmes.
We provide as supplementary materials the models generated to explore numerical behaviors on predator–prey structured
models. These Modelica files contain the full description of these three models, including the numerical parameters used for
demonstration purpose. More precisely, supplementary_material_1.mo refers to the model used in Section 3.3.1, supple-
mentary_material_2.mo refers to the model used in Section 3.3.2, and supplementary_material_3.mo refers to the
model used in Section 3.3.4.
Data availability
As supplementary material.
References
133
L. Attias et al. Mathematics and Computers in Simulation 234 (2025) 113–134
[21] O. Diekmann, et al., On the formulation and analysis of general deterministic structured population models II. Nonlinear theory, J. Math. Biol. 43 (2)
(2001) 157–189, [Link]
[22] O. Diekmann, et al., Steady-state analysis of structured population models, Theor. Popul. Biol. 63 (4) (2003) 309–338.
[23] B.L. Keyfitz, N. Keyfitz, The McKendrick partial differential equation and its uses in epidemiology and population study, Math. Comput. Modelling 26 (6)
(1997) [Link]
[24] B. Perthame, Transport Equations in Biology, in: Frontiers in Mathematics, Birkhäuser Basel, Basel, 2007, [Link]
[25] P. Fritzson, V. Engelson, Modelica — A unified object-oriented language for system modeling and simulation, in: E. Jul (Ed.), ECOOP’98 — Object-Oriented
Programming, Springer Berlin Heidelberg, Berlin, Heidelberg, 1998, pp. 67–90, [Link]
[26] D. Brück, et al., Dymola for multi-engineering modeling and simulation, in: M. Otter (Ed.), Proceedings of the 2nd International Modelica Conference,
2002, 55–1–55–8.
[27] G. Teschl, Ordinary Differential Equations and Dynamical Systems, in: Graduate studies in mathematics, (no. 140) American Mathematical Society, RI, US,
2012.
[28] P. Agarwal, M. Jleli, B. Samet, Banach contraction principle and applications, in: Fixed Point Theory in Metric Spaces, Springer Singapore, Singapore,
2018, pp. 1–23.
[29] P. Fritzson, et al., The OpenModelica integrated environment for modeling, simulation, and model-based development, MIC 41 (4) (2020) 241–295,
[Link]
[30] A. Ronacher, Jinja2 Documentation, Technical Report, 2014, URL [Link]
[31] Linda Petzold, A description of DASSL: A differential/algebraic system solver, in: Proceedings of 10th IMACS World Congress, 1982.
[32] P.J. Wangersky, Lotka-Volterra population models, Annu. Rev. Ecol. Syst. 9 (1) (1978) 189–218.
[33] A.J. Lotka, Elements of Physical Biology, in: universalibrary, Williams and Wilkins Company, Baltimore, 1925.
[34] W. Szemplińska-Stupnicka, Chaos: Bifurcations and Fractals Around Us, in: World Scientific series on nonlinear science, vol. 47, World Scientific, New
Jersey, 2003.
[35] Object Management Group, SysML Extension for Physical Interaction and Signal Flow Simulation, Technical Report, 2021.
[36] Y. Lu, K.A. Pawelek, S. Liu, A stage-structured predator-prey model with predation over juvenile prey, Appl. Math. Comput. 297 (2017) 115–130,
[Link]
[37] S. Bentout, S. Djilali, A. Atangana, Bifurcation analysis of an age-structured prey–predator model with infection developed in prey, Math. Methods Appl.
Sci. 45 (3) (2022) 1189–1208, [Link]
[38] X. Zhang, Z. Liu, Hopf bifurcation analysis in a predator-prey model with predator-age structure and predator-prey reaction time delay, Appl. Math. Model.
91 (2021) 530–548, [Link]
[39] P. Michel, Existence of a solution to the cell division eigenproblem, Math. Models Methods Appl. Sci. 16 (2006) 1125–1153, [Link]
S0218202506001480.
134