Next Article in Journal
Degenerate Fractals: A Formal and Computational Framework for Zero-Dimension Attractors
Previous Article in Journal
Counting Tree-like Multigraphs with a Given Number of Vertices and Multiple Edges
Previous Article in Special Issue
A Stochastic Continuous-Time Markov Chain Approach for Modeling the Dynamics of Cholera Transmission: Exploring the Probability of Disease Persistence or Extinction
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

The Spatial Regime Conversion Method

by
Charles G. Cameron
,
Cameron A. Smith
and
Christian A. Yates
*
Centre for Mathematical Biology, Department of Mathematical Sciences, University of Bath, Bath BA2 7AY, UK
*
Author to whom correspondence should be addressed.
Mathematics 2025, 13(21), 3406; https://doi.org/10.3390/math13213406 (registering DOI)
Submission received: 6 July 2025 / Revised: 16 October 2025 / Accepted: 17 October 2025 / Published: 26 October 2025
(This article belongs to the Special Issue Stochastic Models in Mathematical Biology, 2nd Edition)

Abstract

We present the spatial regime conversion method (SRCM), a novel hybrid modelling framework for simulating reaction–diffusion systems that adaptively combines stochastic discrete and deterministic continuum representations. Extending the regime conversion method (RCM) to spatial settings, the SRCM employs a discrete reaction–diffusion master equation (RDME) representation in regions of low concentration and continuum partial differential equations (PDEs) where concentrations are high, dynamically switching based on local thresholds. This is an advancement over the existing methods in the literature, requiring no fixed spatial interfaces, enabling efficient and accurate simulation of systems in which stochasticity plays a key role but is not required uniformly across the domain. We specify the full mathematical formulation of the SRCM, including conversion reactions, hybrid kinetic rules, and consistent numerical updates. The method is validated across several one-dimensional test systems, including simple diffusion from a region of high concentration, the formation of a morphogen gradient, and the propagation of FKPP travelling waves. The results show that the SRCM captures key stochastic features while offering substantial gains in computational efficiency over fully stochastic models.

1. Introduction

Reaction–diffusion models form a fundamental class of mathematical frameworks widely used to describe biological and physical processes. By definition, these models capture both the diffusion of species and their kinetic interactions. Applications include wound healing [1], where logistic growth kinetics are employed; the spread of infectious diseases, where classic compartmental infectious disease dynamics are extended spatially [2]; and the formation of spatial patterns in semi-arid ecosystems [3,4], where spatial inhomogeneities arise as a result of diffusion-driven instability [5].
Depending on the required level of detail and spatial resolution, reaction–diffusion systems can be represented using several different mathematical approaches. At the microscopic scale, individual particles and their interactions are tracked explicitly in continuous space. Methods such as Brownian dynamics [6] or Langevin dynamics [7] fall into this category. While these techniques are considered the most accurate representations, they can be computationally expensive—a feature typically attributed to the requirement of tracking exact pairwise interactions. Microscopic methods are particularly useful when the specific details of species interactions are important, for instance, in modelling calcium ion release from intracellular stores [8], in which the specific timing and location of the direct binding of calcium ions determine the release of stored calcium.
At an intermediate, mesoscopic scale, compartment-based methods partition space into discrete compartments. Particles move between neighbouring compartments and react within them. These dynamics can be analysed through the reaction–diffusion master equation (RDME) and are typically simulated using stochastic simulation algorithms (SSAs). Gillespie’s exact SSA [9] produces trajectories consistent with the RDME by assigning exponential waiting times to reaction and diffusion events. Approximate methods such as tau-leaping [10] reduce computational expense (at the cost of exactness) by executing multiple reactions within the same fixed time step. Compartmental stochastic techniques have been applied to biological systems, including the p53-Mdm2 regulatory feedback loop [11] and models of gene expression during cell growth and division [12], offering a more efficient alternative to microscopic methods while still capturing important stochasticity.
At the macroscopic scale, continuous models typically describe species concentrations using partial differential equations (PDEs). These models effectively assume such sufficiently high particle counts that we can ignore any stochastic fluctuations. However, this assumption is often violated, especially in biological systems for which stochastic effects can drive key behaviours such as switching and oscillation [13]. PDEs can be derived via moment closure approximations of the RDME [14], and while computationally efficient and suitable for some systems, they may fail to capture critical noise-driven dynamics. PDEs benefit from a wide range of established numerical schemes and offer analytical advantages, such as the ability to identify steady states and their stabilities, explore bifurcations, and perform tractable theoretical analysis.
Many biological systems are inherently multiscale; some parts of the domain have high copy-numbers while other areas have low copy-numbers. This means that some spatial regions require a more detailed model to correctly capture the dynamics, while in other areas, a less detailed model will suffice. This motivates the concept of spatially extended hybrid methods, which aim to combine the complementary advantages of coarse-grain and fine-grain methods whilst negating their complementary weaknesses. These frameworks may couple detailed models in regions where stochasticity is important, with coarser models for regions in which fluctuations can be neglected. In particular, mesoscopic–macroscopic hybrid approaches offer a useful balance between computational efficiency and accuracy [15]. In regions with low particle numbers, stochastic compartment-based models are used; elsewhere, PDEs provide a deterministic description of concentration dynamics.
A typical use of such hybrid methods is to model travelling waves [16,17,18] in which the dynamics of the relatively low number of particles at the front determines the wave speed. However, behind the wavefront, stochastic fluctuations are far less important to the overall dynamics and, as a result, it is sufficient to use a PDE for the average dynamics in that region.
A key limitation of many existing mesoscopic-to-macroscopic hybrid methods is their reliance on a single (often fixed) interface between stochastic and deterministic regimes [17,19], although some recent works have introduced multiple dynamic interfaces for different species [20,21]. These approaches typically lack versatility: they require prior knowledge of where the interface should be placed, cannot easily handle multiple interfaces, and are poorly suited to irregular or non-planar geometries.
In general, implementing an interfacial hybrid method requires a criterion to partition the domain into stochastic and deterministic regions, a mechanism for mass transfer across the interface, and a robust strategy for moving/inserting/removing interface(s) consistent with changing species concentrations [21]. There remains a clear need for hybrid frameworks that can adapt automatically to complex geometries and changing species concentrations without relying on pre-defined interfaces.
In this paper, we introduce the spatial regime conversion method (SRCM), an adaptive hybrid framework that couples the mesoscale and macroscale, in order to combat these challenges. Our method dynamically converts mass between the two regimes and allows for mixed mass representation within each compartment. When concentrations are low (below a given threshold), the system converts continuous mass into discrete mass to be modelled stochastically. Conversely, when concentrations are high (exceeding a given threshold), mass is converted to a deterministic PDE representation. This adaptive conversion removes the need for user-defined interfaces and potentially makes the method particularly suitable for complex systems such as Turing pattern formation [5,22], where interface location is a priori unknown or varies over time. The SRCM offers computational efficiency by limiting stochastic simulation only to the regions in which it is truly required.
Our work builds on the regime conversion method (RCM) introduced by Kynaston et al. [23], which couples discrete and continuous descriptions of species reacting in a well-mixed system. Their framework uses conversion reactions to switch between representations based on species abundance. This process gives rise to the ‘regime conversion’ name of the method since there is a conversion between continuous mass (governed by an ODE) to discrete mass (governed by the Gillespie SSA [9]) and vice versa. Thresholds and rate parameters control these conversions. An alternative approach, the jump-switch-flow (JSF) framework, instead treats each species as either fully discrete or fully continuous at any given time, with regime changes occurring when abundances cross a fixed threshold [24].
In this paper, we extend the RCM [23] to spatially distributed systems in one dimension. Our goal is to develop an adaptive hybrid framework that dynamically couples mesoscopic and macroscopic representations across space, removing the need for predefined spatial interfaces separating different regimes while maintaining accuracy and efficiency. This generalisation requires careful treatment of local concentrations, regime transitions, and spatial coupling. Our method retains the adaptivity of the original RCM, enabling accurate and efficient simulation of systems for which stochasticity plays a fundamental role in the dynamics. By applying the discrete representation only where it is truly necessary, the method achieves a substantial gain in computational efficiency while maintaining accuracy in critical regions. This flexible framework is especially powerful for modelling systems with heterogeneous spatial features.
In Section 2, we introduce the methodological background, describing how PDEs and compartment-based stochastic methods can be used to model reaction–diffusion systems. In Section 3, we establish the requisite notation and present the simulation algorithm for a purely stochastic canonical method first. We then describe how we augment the canonical stochastic system and allow it to interface with the continuous PDE in order to construct the full SRCM. In Section 4, we apply the SRCM to four different reaction–diffusion test problems. We compare the resulting solution profiles to those obtained from purely deterministic and purely stochastic realisations, and assess the relative computational efficiency of the method.
Note that in what follows, straight letters will normally denote the name or label of a species or reaction, while italicised letters will usually denote a numerical quantity.

2. Methodological Background

We consider the spatio-temporal evolution of a collection of chemical species labelled A = [ A ( 1 ) , , A ( M ) ] within a one-dimensional spatial domain Ω = [ 0 , L ] and over a finite time interval t [ 0 , T ] . The dynamics of the system are governed by a set of chemical reactions R, which, together with the species A , define a chemical reaction network, N .

2.1. Compartment-Based Modelling

We first introduce a compartment-based modelling framework for the chemical reaction network. The domain Ω is discretised into K N non-overlapping compartments, denoted by { Ω k } k = 1 K , such that Ω = k = 1 K Ω k . Each compartment has uniform length | Ω k | = L / K for simplicity, but uniformity is not strictly required.
For each species A ( i ) , we denote by N k ( i ) ( t ) the number of particles of that species present in compartment Ω k at time t. The total number of particles of species A ( i ) across the entire spatial domain at time t is then given by the following:
N ( i ) ( t ) : = k = 1 K N k ( i ) ( t ) .
We denote the state of the system at time t by a matrix N ( t ) N 0 M × K , where the matrix entry N i , k ( t ) : = N k ( i ) ( t ) represents the number of particles of species i { 1 , , M } in compartment Ω k , for each k { 1 , , K } . This formulation provides a compact representation for tracking the spatial distribution of all the species across the entire domain.
We consider initially two types of reactions: kinetic reactions, denoted R kin , and diffusion reactions, denoted R diff . The kinetic reactions occur within each compartment, and the diffusion reactions allow particles to move between adjacent compartments. Each species in a given compartment is associated with two diffusion reactions: leftward and rightward movement. We define the set of diffusion reaction labels as
R diff = d ( 1 ) , , d ( M ) , d + ( 1 ) , , d + ( M ) ,
where the superscript indicates the species undergoing diffusion, and the subscript − or + denotes the direction of movement (left or right, respectively). We assume that each species diffuses with a constant diffusivity throughout the domain, but which may vary by species. The first M diffusion reactions listed in R diff correspond to movement to the left for each species, while the remaining M describe movement to the right.
In addition to diffusion, we consider Q kinetic reactions in each compartment. The corresponding set of kinetic reaction labels is given by the following:
R kin = { r 1 , , r Q } .
In this paper we will work only with systems that are at most second-order, although higher-order reactions could be incorporated without much conceptual difficulty. The set of kinetic reactions R kin is correspondingly partitioned into three disjoint subsets corresponding to zeroth-, first-, and second-order reactions:
R kin = R 0 kin R 1 kin R 2 kin ,
where | R 0 kin | = Q 0 , | R 1 kin | = Q 1 , and | R 2 kin | = Q 2 , so that the total number of kinetic reactions is Q = Q 0 + Q 1 + Q 2 . For each compartment Ω k , where k { 1 , , K } , we define the local reaction set as follows:
R k = { R diff , R kin } ,
which comprises 2 M + Q total reactions: 2 M diffusion reactions (one left and one right for each species) and Q kinetic reactions.
Each reaction q { 1 , , 2 M + Q } , when occurring in compartment Ω k (for k { 1 , , K } ), induces a change in the system state N ( t ) , which we encode with a stoichiometric update matrix ν q , k Z M × K . The collection ν = ( ν q , k ) q = 1 , , 2 M + Q ; k = 1 , , K defines a family of such update matrices. For any particular reaction q * { 1 , , 2 M + Q } occurring in compartment Ω k * for k * { 1 , , K } , the th column, ν q * , k * Z M , specifies the change in copy-numbers of all the species in compartment Ω resulting from reaction q * occurring in compartment Ω k * . If the reaction is a kinetic reaction occurring in compartment Ω k * , then ν q * , k * = 0 for k * , since kinetic reactions only affect species numbers within their own compartment. For diffusion reactions from compartment Ω k * , we have that ν q * , k * = 0 for k * , k * ± 1 , depending on the direction of movement.
We denote by α q , k the propensity of reaction q occurring in compartment Ω k . This propensity depends on the current state of the system, and is typically determined by the number of molecules within compartment Ω k involved in reaction q.
Simulation of the system is performed using the Gillespie algorithm [9] in which the waiting time until the next reaction, τ , is drawn from an exponential distribution with mean inversely proportional to the sum of the propensities across every reaction and compartment. The algorithm then selects both the compartment and the reaction to occur based on these propensity values. If reaction q is chosen to occur in compartment Ω k , the system state is updated by applying the corresponding stoichiometric change:
N ( t + τ ) = N ( t ) + ν q , k .

2.2. Partial Differential Equation Based Modelling

We can model reaction–diffusion systems using PDEs, describing an approximation of the mean concentration of species derived from the moment closure of the RDME [14]. Let u ( i ) ( x , t ) denote the concentration of species i { 1 , , M } at location x Ω and time t [ 0 , T ] . We define the general form for this PDE for species u ( i ) as follows:
u ( i ) t = D ( i ) 2 u ( i ) x 2 + f ( i ) ( u ) ,
where f ( i ) ( u ) encodes the reaction kinetics of the system and D ( i ) is the diffusion coefficient of species i.
Only under very specialised conditions can the solutions to such PDEs be obtained analytically. Consequently, we will resort to finding the numerical solution of such systems. A numerical approach will also make sense when we come to interfacing our PDE solutions with our RDME realisations in the SRCM.
To solve PDE (1) numerically, we discretise the domain into J + 1 spatial grid points (inclusive of the two boundaries) with spacing Δ x = L / J . We choose J > K , ensuring a finer spatial resolution of the PDE solution relative to the compartmental model. We set the number of grid points to be an integer multiple of the number of compartments, J = P K , where P > 1 is the resolution factor. We use Δ t to denote the temporal spacing. The spatial and temporal grid points are indexed as follows [25]:
x j = j Δ x , j = { 0 , 1 , , J } and t n = n Δ t , n N 0 .
The numerical solution u j ( i ) ( t n ) approximates the solution u ( i ) ( x j , t n ) of PDE (1):
u j ( i ) ( t n ) u ( i ) ( x j , t n ) .
Note that in this setting, each x j will be associated with a compartment Ω k , providing a mapping between the PDE and compartment-based representations. For each Ω k we use the left-hand-rule convention that x j Ω k for j { ( k 1 ) P , , k P 1 } . In our implementation of the SRCM we will be using a finite-difference-based fourth-order Runge–Kutta method to solve the PDE, although other suitable numerical solution methods can be substituted.

3. The Spatial Regime Conversion Method

Now that we have outlined the basis of the two reaction–diffusion modelling paradigms that we will employ in the SRCM, we can outline how they are coupled together. In Section 3.1 we discuss the simulation of a canonical RDME, which allows us to introduce the notational framework required for the general simulation of the SRCM. Building on this, we outline the mechanics and the algorithm for the SRCM (which adaptively combines PDE and RDME frameworks) in Section 3.2. Figure 1 provides a schematic representation of how we interface the continuous and discrete representations within the SRCM.

3.1. Canonical Stochastic Method

In this section we consider a canonical stochastic system, introducing the notation and general framework associated with the SRCM without explicitly interfacing with the PDEs (this will be done in Section 3.2). This canonical system will incorporate diffusion, reaction kinetics and also, importantly, the forward and backward conversion reactions (although these will not take effect until we interface with the PDE in Section 3.2). In the regime conversion method [23], ‘forward’ conversion is the conversion from continuous to discrete mass, while ‘backward’ conversion refers to the conversion from discrete to continuous. We will refer to these as ‘C-D conversion’ and ‘D-C conversion’ to mean continuous-to-discrete and discrete-to-continuous conversion, respectively. At this point, while introducing the canonical stochastic framework these conversion reactions are simply placeholders—dummy reactions with no impact on the system—however, it is important to introduce them here as these reactions later control transitions between discrete and continuous representations in the SRCM. We define the set of conversion reactions within each compartment as follows:
R con = { C CD ( 1 ) , , C CD ( M ) , C DC ( 1 ) , , C DC ( M ) } .
The first M reactions correspond to continuous-to-discrete conversion reactions for species 1 , , M , respectively, whilst the second M reactions correspond to discrete-to-continuous reactions for species 1 , , M , respectively. We now extend the full reaction list for compartment Ω k to include these conversion reactions
R k = { R con , R diff , R kin } .
Each element of R k is a label for a specific reaction initiated within compartment Ω k . As there are 2 M + 2 M + Q distinct reaction types per compartment and K compartments, the system comprises a total of K ( 4 M + Q ) reactions. For q { 1 , , M } , the reaction is a C-D conversion of species i q . For q { M + 1 , , 2 M } , it is a D-C conversion of species i q ( mod M ) . Reactions with q { 2 M + 1 , , 3 M } represent leftward diffusion, and those with q { 3 M + 1 , , 4 M } represent rightward diffusion, both of species i q ( mod M ) . Finally, for q { 4 M + 1 , 4 M + Q } , the reaction corresponds to one of the Q kinetic reactions. Whilst compartments share the same set of reactions, R k , the propensity functions of the diffusion reactions in the boundary compartments (i.e., k = 1 and k = K ) are adjusted to implement the appropriate boundary conditions [26] (typically, in the test simulations of Section 4, these will be zero-flux boundary conditions). The complete list of reactions across all the compartments of the domain is given by R = { R 1 , R 2 , , R K } .
We introduce λ q , k for q { 1 , , 4 M + Q } and k { 1 , , K } , which define the rate of reaction q occurring in compartment k. In general, these reaction rates will be consistent across compartments.
In the following subsections we will introduce notation for each of the three reaction types—conversion, diffusion, and kinetic—and discuss their implementation in the canonical stochastic framework.

3.1.1. Conversion Reactions

Here we briefly discuss conversion reactions, which handle transformations between discrete and continuous representations of species in the SRCM. Although conversion plays a crucial role in the full SRCM framework, it is important to stress that we have not yet discussed the inclusion of the PDE dynamics, so the aim of this subsection is to lay the groundwork for its later inclusion.
Let q 1 { 1 , , M } index a continuous-to-discrete conversion reaction of species i, representing the transformation of a single particle’s worth of continuous mass into a discrete particle. In the SRCM, this would describe mass transfer from the continuous to the discrete regime. For now, in this purely stochastic setting, we model this simply as a trivial first-order reaction (which does not impact the system):
A k ( i ) λ q 1 , k A k ( i ) .
This results in an update to the discrete state in compartment k:
ν q 1 , k = k = 0 Z M , ν q 1 , k k = 0 Z M .
Conversely, for the discrete-to-continuous conversion, suppose q 2 { M + 1 , , 2 M } . This would correspond to the conversion of a single discrete particle to particle’s worth of continuous mass in the SRCM. However in the canonical stochastic system we simply represent this as follows:
A k ( i ) λ q 2 , k A k ( i ) ,
with the corresponding stoichiometric change:
ν q 2 , k = k = 0 Z M , ν q 2 , k k = 0 Z M .
Although these reactions currently have no effect on any discrete or continuous species (since such a representation is not yet included), they play a vital role in the SRCM.

3.1.2. Diffusion Reactions

Let reaction q 3 { 2 M + 1 , , 3 M } index the leftward diffusion of species A ( i ) . This reaction corresponds to the movement of a particle of species i from compartment k to compartment k 1 . While this reaction is defined for k { 1 , , K } , the corresponding propensity function for k = 1 will be set to zero for the examples in this paper, implementing zero-flux boundary conditions by ensuring that there is no leftward diffusion from the first compartment.
The stoichiometric update for this reaction is encoded in the matrix ν q 3 , k . Since only species i is involved, all the rows except row i are zero. Similarly, since the diffusive jump affects only two compartments, the majority of the columns of ν q 3 , k are zero. The non-zero columns are as follows:
ν q 3 , k = k = e i Z M , ν q 3 , k = k 1 = e i Z M ,
where e i Z M is the standard basis vector with a 1 in the i-th position (and zeros elsewhere). For all the other compartments:
ν q 3 , k k , k + 1 = 0 Z M .
Similarly, q 4 { 3 M + 1 , , 4 M } indexes the rightward diffusion reactions, where species i moves from compartment k to compartment k + 1 . While this reaction is defined for k { 1 , , K } , the corresponding propensity function for k = K will be set to zero for the examples in this paper, implementing zero-flux boundary conditions by ensuring there is no rightward diffusion from the last compartment.
The corresponding stoichiometric update vectors are as follows:
ν q 4 , k = k = e i Z M , ν q 4 , k = k + 1 = e i Z M ,
and for all the other compartments:
ν q 4 , k k , k + 1 = 0 Z M .

3.1.3. Kinetic Reactions

We now focus on the kinetic reactions, which are local to each compartment. To represent these reactions, we define a stoichiometric vector μ q Z M for each reaction q, where the scalar μ q ( m ) denotes the net change in the number of particles of species m given reaction q occurs. Only the entries of μ q corresponding to the species involved in the reaction (as reactants or products) will be non-zero (even some of these entries may be zero if the corresponding reactant acts as a catalyst and therefore emerges from the reaction unchanged in copy-number). Suppose a kinetic reaction with index q { 4 M + 1 , , 4 M + Q } occurs in compartment k { 1 , , K } . The vector μ q comprises the k-th column of the stoichiometric matrix ν q , k , while all the other columns are zero:
ν q , k = k = μ q Z M ;
ν q , k k = 0 Z M .
Later, when we extend this notation to the full SRCM framework, it will be necessary to introduce new reaction types that allow interactions between discrete particles and continuous mass.

3.1.4. Propensity Functions

We define α q , k to be the propensity function of reaction q occurring within compartment k. We define
α k = [ α 1 , k , , α 4 M + Q , k ] T ,
to be the vector of all the propensity functions occurring in compartment k, for k { 1 , , K } . We then concatenate these vectors in order to define the full propensity matrix across all the compartments as follows:
α = [ α 1 , , α K ] .
These propensity values are used in the Gillespie algorithm to determine both the timing and location of the next reaction event. We define the total propensity within each compartment:
σ k = q = 1 4 M + Q α q , k ,
and collect these totals into a vector:
σ = [ σ 1 , , σ K ] ,
which will be used to determine the compartment index. We then calculate the total propensity sum that will be used to calculate the time for the next reaction:
Σ = i = 1 K σ i .
The Gillespie algorithm for this canonical stochastic reaction network is given in Algorithm 1.
Algorithm 1 Stochastic simulation of canonical system
 1:
Set t 0                                  ▹Initialise time
 2:
Set T                                    ▹Set end time
 3:
Initialise state vector N ( 0 ) N M × K
 4:
while t T do
 5:
    Draw random numbers r 1 , r 2 , r 3 uniform ( 0 , 1 )
 6:
    for  k = 1 to K do               ▹Work out propensity list for every compartment
 7:
        Compute propensities α k = [ α 1 , k , , α Q + 4 M , k ]
 8:
        Compute total propensity in compartment k: σ k = q = 1 Q + 4 M α q , k
 9:
    end for
10:
    Compute total system propensity: Σ = i = 1 K σ i
11:
    Compute time to next reaction: τ = 1 Σ ln 1 r 1
12:
    Determine the reaction compartment, k, such that:
1 Σ i = 1 k 1 σ i r 2 < 1 Σ j = 1 k σ j
13:
    Determine the reaction index, q, that occurs within compartment k such that:
1 σ k j = 1 q 1 α j , k r 3 < 1 σ k j = 1 q α j , k
14:
    Execute reaction q in compartment k by updating the state: N ( t + τ ) = N ( t ) + ν q , k
15:
    Advance time: t t + τ
16:
end while

3.2. Including the Continuous Representation—The Spatial Regime Conversion Method

After developing the groundwork for the canonical stochastic model, we now interface this with the continuous representation to characterise the SRCM. To capture discrete and continuous dynamics, we extend the state space to include both representations for each species A ( i ) .
We define the function v ( i ) ( x , t ) to be the continuous profile of species i within the SRCM framework. In order to allow the interaction and conversion between continuous and discrete mass, we will need to calculate the amount of continuum mass within each compartment and to be able to treat it, in some sense, as if it were discrete mass (i.e., particles). To that end (as in [19]) we define the number of ‘pseudo-particles’ in a compartment as the number of discrete particles that would have the same mass as represented by the continuous PDE profile over that compartment’s support. The pseudo-particle count for species i in compartment Ω k is denoted by Y k ( i ) R + for i { 1 , , M } and k { 1 , , K } . The number of continuous-mass pseudo-particles in compartment Ω k is calculated as follows
Y k ( i ) ( t ) : = Ω k v ( i ) ( x , t ) d x .
Since these values represent continuous mass, they may take non-integer values. The continuous representation of species A ( i ) will be labelled C ( i ) .
Correspondingly, the discrete representation of species A ( i ) is labelled D ( i ) , with the number of discrete particles in compartment Ω k given by X k ( i ) N 0 . These values represent actual particle counts and are, therefore, restricted to non-negative integers.
We calculate the total number of particles of species A ( i ) in compartment Ω k as the sum of its continuous and discrete components:
N k ( i ) : = X k ( i ) + Y k ( i ) .
For the SRCM we must extend the chemical reaction network N to incorporate both continuous and discrete species and the potential reactions between them. We label the extended chemical reaction network as N ¯ . This extended network explicitly includes reactions involving both continuous and discrete components. Consequently, the theoretical framework and associated stoichiometric matrices must be adapted to account for transformations involving continuously represented mass.
In the SRCM, we extend the original set of reactions to a new, augmented reaction set:
R ¯ k = [ R con , R diff , R ¯ D kin ] ,
where R ¯ D kin denotes the extended kinetic reaction set in the discrete regime of the SRCM (which we will describe in Section 3.2.4). The conversion and diffusion reactions remain unchanged. Recall that while the conversion reactions were redundant in the canonical stochastic model, they play a crucial role in the full SRCM, facilitating mass transfer between regimes in a concentration-dependent manner (as described in Section 3.2.2).
To describe the system state in this extended framework, we introduce the new state matrix N ¯ N 2 M × K . The first M rows of the state matrix represent the number of discrete particles, and the second M rows represent the number of continuous pseudo-particles. Formally, we define the following:
N ¯ i , k = X k ( i ) , if i { 1 , , M } , Y k ( i M ) , if i { M + 1 , , 2 M } , k { 1 , , K } .
We now turn to defining the stoichiometric updates in the extended system. In the canonical system, each reaction was associated with a stoichiometric matrix ν q , k Z M × K . In the SRCM, we must extend this to a stoichiometric matrix ν ¯ q , k Z 2 M × K , capturing updates to both the discrete and continuous components of the system state.

3.2.1. Updating the Continuous Profile

As described previously, in the event that a reaction occurs which changes the number of continuous pseudo-particles, with the corresponding state update equation
N ¯ ( t + τ ) = N ¯ ( t ) + ν ¯ q , k ,
there will be some non-zero element within the final M rows of ν ¯ q , k . This will represent an integer change ξ in at least one of the species i { 1 , , M } , which is captured by the following equation for the number of pseudo-particles of species i in compartment Ω k :
Y k ( i ) ( t + τ ) = Y k ( i ) ( t ) + ξ .
We need to update the continuous representation of the species by adding a (possibly negative) mass ξ , spread across the area that corresponds to compartment Ω k . This change would be implemented as follows, in the continuous PDE solution:
v ( i ) ( x , t + τ ) = v ( i ) ( x , t ) + ξ | Ω k | · 1 Ω k ( x ) ,
where 1 Ω k ( x ) is the indicator function for compartment Ω k , and | Ω k | denotes its volume.
However, since we are implementing a numerical solution of the PDE, we add ξ particles’ worth of mass spread evenly across the grid points in the associated compartment (remembering we are mapping between PDE points and compartments using the left-hand rule):
v j ( i ) ( t + τ ) = v j ( i ) ( t ) + ξ | Ω k | , j { ( k 1 ) P , , k P 1 } .
This numerical update ensures that the correct mass is added or subtracted from the numerical solution. In particular, it guarantees conservation of mass under these conversion-type reactions. In the following subsections, we extend the conversion, diffusion, and kinetic reactions for the SRCM in order to demonstrate how the framework changes with respect to the canonical stochastic system outlined in Section 3.1.

3.2.2. Conversion Reactions

In this section we will outline the implementation of conversion reactions in the full SRCM. Specifically we will consider a conversion reaction assumed to be occurring in compartment Ω k for k { 1 , , K } . In the canonical system, conversion reactions are described by the stoichiometric matrices ν q 1 , k for C-D conversion reactions, where q 1 { 1 , , M } , and by ν q 2 , k for D-C conversion reactions, where q 2 { M + 1 , , 2 M } . Because we did not include the continuous representation in the purely stochastic canonical system, these reactions were essentially redundant.
In the SRCM, we define the augmented stoichiometric matrices ν ¯ q 1 , k Z 2 M × K for the C-D conversion reactions. The first M rows correspond to the changes in the discrete representation, and the second M rows represent changes in their continuous counterparts. Specifically, the stoichiometric matrix for the C-D conversion reactions in compartment Ω k are defined as follows:
ν ¯ q 1 , k = k = e i e i + M Z 2 M , ν ¯ q 1 , k k = 0 Z 2 M .
This results in the appropriate increase in the discrete particle numbers whilst also specifying that we should update the numerical PDE concentration profile as follows:
v j ( i ) ( t + τ ) = v j ( i ) ( t ) 1 | Ω k | , j { ( k 1 ) P . , k P 1 } .
Note that if v j ( i ) ( t ) 1 | Ω k | for any PDE solution point, j, in the associated compartment, then this conversion will be aborted, as this would lead to negative values in the numerical PDE solution profile.
The stoichiometric matrix for the D-C conversion reaction, q 2 in compartment Ω k is defined as follows:
ν ¯ q 2 , k = k = e i + e i + M Z 2 M , ν ¯ q 2 , k k = 0 Z 2 M , for q 2 { M + 1 , , 2 M } .
This results in the appropriate decrease in the discrete particle numbers as well as specifying that we should update the numerical PDE profile as follows:
v j ( i ) ( t + τ ) = v j ( i ) ( t ) + 1 | Ω k | , j { ( k 1 ) P , , k P 1 } .
Note that there are no restrictions on D-C conversions since discrete particle numbers are integer valued; if the number of particles of species i is zero, that species will never be selected for a D-C conversion.
The conversion reactions are regulated by concentration thresholds, Θ i , for each species i { 1 , , M } . These thresholds correspond to mass thresholds within a compartment, defined as Θ i · | Ω k | , where | Ω k | is the compartment volume. In a given compartment Ω k , if the mass of species i, denoted N k ( i ) , exceeds its mass threshold Θ i · | Ω k | , then D-to-C conversion is active; otherwise, C-to-D conversion takes place.
We denote the full set of conversion reactions as
R con = { C C D ( 1 ) , , C C D ( M ) , C D C ( 1 ) , , C D C ( M ) } ,
which are included in the local reaction list R k for compartment Ω k . As before, we index these reactions by q { 1 , , 2 M } . The rate of each conversion reaction in compartment k is defined as the product of the fixed conversion rate γ and an indicator function that is one or zero depending on whether the combined mass is above or below the mass threshold:
λ q , k = γ · 1 { N k ( q ) Θ q · | Ω k | } , for q { 1 , , M } , γ · 1 { N k ( q M ) > Θ q M · | Ω k | } , for q { M + 1 , , 2 M } .

3.2.3. Diffusion Reactions

In the canonical system, the diffusion reactions are described by ν q 3 , k N M × K for leftward jumps, where q 3 { 2 M + 1 , , 3 M } , and by ν q 4 , k N M × K for rightward jumps, where q 4 { 3 M + 1 , , 4 M } . In the extended system, we define ν ¯ q 3 , k Z 2 M × K , where the first M rows are identical to ν q 3 , k and the remaining M rows are zero. This is because diffusion reactions only impact the discrete regime and do not affect the continuous regime. The same extended structure applies to ν ¯ q 4 , k .

3.2.4. Kinetic Reactions

Kinetic reactions present potentially the greatest departure of the SRCM from the canonical stochastic system. They must be categorised by reaction order to be implemented appropriately in the SRCM. We classify reactions as zeroth-order, first-order, and second-order. The assignment of products to either the discrete or continuous regime is governed by the following rules:
(C1):
To minimise unnecessary transitions between modelling regimes, product molecules of species A ( i ) are assigned to the same regime as their corresponding reactants of species A ( i ) (if any). In the event of a homodimerisation reaction between D ( i ) and C ( i ) (discrete and continuous representation), we will place product molecules of this species in the discrete regime.
(C2):
To preserve stochasticity, any reaction products that do not correspond to a reactant species are placed in the discrete regime.
(C3):
If all reactants in a reaction belong to the continuous regime, their products remain in the continuous regime. In this case, the reaction is naturally modelled using the PDE.
These rules were developed initially for the regime conversion method for well-mixed systems [23]. In the spatial setting of the SRCM, we will adhere to these rules in the implementation of our test problems unless otherwise specified.
In what follows, we consider kinetic reactions occurring within compartment Ω k with the assumption that identical reactions are defined independently in other compartments.
Given the stoichiometric vector μ q Z M capturing the effect of reaction q on the species numbers in compartment Ω k in the canonical stochastic system, we define μ ¯ q Z 2 M to be the extended stoichiometric vector associated with reaction q in which the first M entries are the same as μ q and the second set of M entries are zero. We specify these as follows:
μ ¯ q = m = 1 M e m μ q ( m ) Z 2 M ,
where e m Z 2 M are 2 M -dimensional basis vectors and μ q ( m ) represents the m th element of μ q .

3.2.5. Zeroth-Order Reactions

Each zeroth-order reaction in the original discrete reaction system maps directly to a single corresponding reaction in the hybrid system. A general zeroth-order reaction takes the form
λ q , k A k ( i ) ,
which will be implemented in the SRCM as follows:
λ q , k D k ( i ) .
In accordance with rule (C2), we assign all the products to the discrete regime. The stoichiometric vector is, therefore, μ ¯ q , as defined in Equation (7). Correspondingly, the stoichiometric matrix, ν ¯ q , k , will have the first M rows exactly the same as ν q , k in the canonical stochastic system, and the second set of M rows will be zero.

3.2.6. First-Order Reactions

In the canonical stochastic implementation, we can write a generic first-order reaction as follows:
A k ( i ) λ q , k ( μ q ( i ) + 1 ) A k ( i ) + m = 1 m i M μ q ( m ) A k ( m ) ,
where μ q Z M is the stoichiometric vector for the canonical system associated with reaction q. This corresponds to two possible implementations in the SRCM:
D k ( i ) λ q , k ( μ q ( i ) + 1 ) D k ( i ) + m = 1 m i M μ q ( m ) D k ( m ) ,
C k ( i ) λ q , k ( μ q ( i ) + 1 ) C k ( i ) + m = 1 m i M μ q ( m ) C k ( m ) .
Reaction (F2) involves only continuous species and is naturally implemented in the PDE regime. Consequently, we explicitly model only reaction (F1) within the discrete framework. Similarly to zeroth-order reactions, there is a one-to-one mapping between first-order reactions in the canonical stochastic reaction system and reactions of type (F1) in the discrete regime of the SRCM. The stoichiometric vector is hence μ ¯ q as specified in Equation (7).

3.2.7. Second-Order Reactions

Second-order reactions involve the interaction of two species and are written in general form as follows:
A k ( i ) + A k ( j ) λ q , k ( μ q ( i ) + 1 ) A k ( i ) + ( μ q ( j ) + 1 ) A k ( j ) + m = 1 m i , j M μ q ( m ) A k ( m ) ,
where it is possible, in the case of homodimerisation, that i = j . This potentially gives rise to four distinct second-order reactions within the SRCM:
D k ( i ) + D k ( j ) λ q , k ( μ q ( i ) + 1 ) D k ( i ) + ( μ q ( j ) + 1 ) D k ( j ) + m = 1 m i , j M μ q ( m ) D k ( m ) ,
D k ( i ) + C k ( j ) λ q , k ( μ q ( i ) + 1 ) D k ( i ) + ( μ q ( j ) + 1 ) C k ( j ) + m = 1 m i , j M μ q ( m ) D k ( m ) ,
C k ( i ) + D k ( j ) λ q , k ( μ q ( i ) + 1 ) C k ( i ) + ( μ q ( j ) + 1 ) D k ( j ) + m = 1 m i , j M μ q ( m ) D k ( m ) ,
C k ( i ) + C k ( j ) λ q , k ( μ q ( i ) + 1 ) C k ( i ) + ( μ q ( j ) + 1 ) C k ( j ) + m = 1 m i , j M μ q ( m ) C k ( m ) .
As was the case of first-order reactions, the second-order reactions involving only continuous reactants (S4) are handled directly within the PDE framework in accordance with rule (C1). By contrast, reactions (S1)–(S3) involve at least one discrete species and are, therefore, treated in the discrete SRCM framework. This distinction makes second-order reactions more complex to represent in the SRCM than their zeroth- or first-order counterparts.
In the canonical stochastic system, the total number of kinetic reactions is Q = Q 0 + Q 1 + Q 2 , where the subscripts denote reaction order. In the extended hybrid system, each first-order reaction yields two subreactions (corresponding to whether the reactant is discrete or continuous), and each second-order reaction yields four (depending on the combination of discrete and continuous reactants involved), so the total number of kinetic reactions becomes
Q ¯ = Q 0 + 2 Q 1 + 4 Q 2 .
Among these kinetic reactions, those with all the reactants in the continuous state ( Q ¯ C = Q 1 + Q 2 ) are modelled in the continuous regime. The remaining
Q ¯ D = Q 0 + Q 1 + 3 Q 2 ,
are handled stochastically in the discrete regime. Let R ¯ kin denote the full set of kinetic reactions in the extended system, with
| R ¯ kin | = Q ¯ = Q 0 + 2 Q 1 + 4 Q 2 .
We partition this set as follows:
R ¯ kin = R ¯ D kin R ¯ C kin ,
where R ¯ D kin comprises the Q ¯ D reactions with at least one discrete reactant, and R ¯ C kin comprises the Q ¯ C reactions with only continuous reactant species.
Diffusion and conversion reactions remain unchanged. Consequently, the complete set of reactions modelled in compartment k of the discrete framework is as follows:
R ¯ k = [ R con , R diff , R ¯ D kin ] .
We order the kinetic reaction set R ¯ D kin in increasing reaction order: zeroth, first, and then second, remembering that each second-order reaction of the canonical stochastic system yields three subreactions: (S1)–(S3). We specify cumulative index sets in the extended reaction network. The zeroth-order reactions correspond to indices q { 4 M + 1 , , 4 M + Q 0 } . The first-order reactions correspond to indices q { 4 M + Q 0 + 1 , , 4 M + Q 0 + Q 1 } . Finally, the second-order reactions correspond to indices q { 4 M + Q 0 + Q 1 + 1 , , 4 M + Q 0 + Q 1 + 3 Q 2 } , where the factor of three accounts for the three discrete sub-reactions associated with each second-order reaction.
We re-index kinetic reactions in the extended system using index q * . For zeroth- and first-order reactions, the mapping is identical:
q * = q , for q { 4 M + 1 , , 4 M + Q 0 + Q 1 } .
Second-order reactions, originally indexed by
q { 4 M + Q 0 + Q 1 + 1 , , 4 M + Q 0 + Q 1 + Q 2 } ,
in the canonical stochastic system, are each expanded into three discrete sub-reactions, (S1)–(S3), in the extended system. Let
i : = q ( 4 M + Q 0 + Q 1 ) ,
then the re-indexed sub-reactions are
q L * : = 4 M + Q 0 + Q 1 + 3 ( i 1 ) + L , for L = 1 , 2 , 3 and i = 1 , , Q .
Given that R kin = { r 1 , , r Q 0 + Q 1 + Q 2 } , then we will simply define R ¯ D kin = { r ¯ 1 , , r ¯ Q 0 + Q 1 + 3 Q 2 } .
We consider a generic second-order reaction involving two species A ( i ) and A ( j ) within the SRCM. Each original second-order reaction q thus yields q 1 * , q 2 * , q 3 * , corresponding to reactions (S1), (S2), and (S3), respectively. The associated stoichiometric vectors μ ¯ q L * Z 2 M are defined as follows:
μ ¯ q 1 * = μ ¯ q : = m = 1 M μ q ( m ) e m Z 2 M , μ ¯ q 2 * = μ i e i + M + m = 1 m i M μ q ( m ) e m Z 2 M , μ ¯ q 3 * = μ j e j + M + m = 1 m j M μ q ( m ) e m Z 2 M .
Each kinetic reaction is implemented within a single compartment Ω k , so the stoichiometric matrices are
ν ¯ q L * , k = k = μ ¯ q L * , ν ¯ q L * , k k = 0 .
The full state update upon the firing of reaction q L * in compartment Ω k is given by the following:
N ¯ ( t + τ ) = N ¯ ( t ) + ν ¯ q L * , k .
If L = 2 or L = 3 then there will be an interaction between continuous and discrete regimes, and therefore we would like to update the amount of mass within the continuous PDE regime as follows:
v ( i ) ( x , t + τ ) = v ( i ) ( x , t ) + μ ¯ q L * ( i + M ) | Ω k | · 1 Ω k ( x ) , for i = 1 , , M .
The vector μ ¯ q L * ( i + M ) describes the change in the value Y k ( i ) ( t + τ ) given that reaction r ¯ q L * has occurred in the extended system. Correspondingly, we update the numerical solution of the PDE profile as follows:
v j ( i ) ( t + τ ) = v j ( i ) ( t ) + μ ¯ q L * ( i + M ) | Ω k | , j { ( k 1 ) P , , k P 1 } .

3.2.8. Propensity Functions for Extended System

We define α ¯ q , k as the propensity function of the reaction q that occurs within compartment Ω k of the SRCM. We note that the propensity functions will remain the same as the canonical system for q { 1 , , 4 M + Q 0 + Q 1 } . However, we must introduce new propensity functions for q { 4 M + Q 0 + Q 1 + 1 , , 4 M + Q 0 + Q 1 + 3 Q 2 } , corresponding to the second-order interactions:
α ¯ k = [ α 1 , k , , α 4 M + Q 0 + Q 1 + 3 Q 2 , k ] T .
The propensity functions of the second-order reactions may now depend on the continuous mass. For example, if we study reactions (S1)–(S3) then the associated propensities are as follows:
α q 1 * , k = λ q 1 * , k · X k ( i ) · X k ( j ) , α q 2 * , k = λ q 2 * , k · X k ( i ) · Y k ( j ) , α q 3 * , k = λ q 3 * , k · Y k ( i ) · X k ( j ) .
Now that we have defined the full list of propensities for each compartment, we can concatenate them to produce the following propensity matrix:
α ¯ = [ α ¯ 1 , , α ¯ K ] .
We define the total propensity within each compartment as follows:
σ ¯ k = q = 1 4 M + Q 0 + Q 1 + 3 Q 2 α ¯ q , k .
We collect these totals into a vector as follows:
σ ¯ = [ σ ¯ 1 , , σ ¯ K ] ,
and define the overall propensity sum which will be used to calculate the time until the next reaction occurs:
Σ ¯ = i = 1 K σ ¯ i .
Throughout the simulations of the SRCM, we must update the state matrix N ¯ ( t ) N 2 M × K to reflect the number of pseudo-particles representing the continuous mass. This is essential because the propensity functions, specifically those associated with second-order mixed (discrete and continuous reactants) kinetic reactions and conversion reactions, depend on these values. In practice, however, we employ a more efficient strategy: rather than explicitly updating N ¯ ( t ) at every PDE step, we compute the corresponding pseudo-particle numbers from the PDE solution whenever they are required by the stochastic dynamics. The pseudocode for the SRCM is presented in Algorithm 2.
Algorithm 2 Spatial regime conversion method (SRCM)
 1:
Set t 0                           ▹Initialise time
 2:
Set T                            ▹ Set end time
 3:
Initialise discrete state matrix N ( 0 ) N M × K
 4:
Initialise PDE solution v ( i ) ( x , 0 ) for all i { 1 , , M }
 5:
Update extended state matrix N ¯ ( 0 )
 6:
t d = Δ t                        ▹ PDE timestep counter
 7:
while t T do
 8:
    for  k = 1 to K do
 9:
        Compute propensities α ¯ k = [ α ¯ 1 , k , , α ¯ 4 M + Q 0 + Q 1 + 3 Q 2 , k ]
10:
        Compute total propensity for compartment k: σ ¯ k = q = 1 4 M + Q 0 + Q 1 + 3 Q 2 α ¯ q , k
11:
    end for
12:
    Compute total system propensity: Σ ¯ = k = 1 K σ ¯ k
13:
    Draw random numbers r 1 , r 2 , r 3 uniform ( 0 , 1 )
14:
    Compute time to next reaction: τ = 1 Σ ¯ ln 1 r 1
15:
    if  t + τ < t d then                     ▹ Stochastic step
16:
        Determine compartment k such that:
1 Σ ¯ j = 1 k 1 σ ¯ j r 2 < 1 Σ ¯ j = 1 k σ ¯ j
17:
        Determine reaction q within compartment k such that:
1 σ ¯ k j = 1 q 1 α ¯ j , k r 3 < 1 σ ¯ k j = 1 q α ¯ j , k
18:
        if  ν ¯ q , k has non-zero continuous component then▹ A change in the continuous analogue
19:
           for  i = 1 to M do
20:
                v j ( i ) ( t + τ ) = v j ( i ) ( t ) + ( ν ¯ q , k ) ( i , k ) | Ω k | , j { ( ( k 1 ) P , , k P 1 } .
21:
           end for
22:
        end if
23:
        Update the extended state matrix N ¯ ( t + τ ) = N ¯ ( t ) + ν ¯ q , k .
24:
        Advance time: t t + τ
25:
    else                              ▹ PDE step
26:
        for  i = 1 to M do
27:
           Perform an update step of the PDE for: v j i ( t + Δ t ) , j { 0 , , P K }
28:
        end for
29:
        Update the extended state matrix N ¯ ( t + Δ t ) following the PDE update.
30:
        Set t = t d
31:
        Set t d = t + Δ t
32:
    end if
33:
end while

4. Results

In this section we will consider four test problems designed to demonstrate the utility and versatility of the SRCM. In order to characterise the accuracy of the SRCM we need to compare the resulting outcome of the combined mass in the SRCM against the equivalent quantity for the canonical stochastic simulations. Let N S ( t ) Z M × K denote the state matrix of the canonical (fully stochastic) system at time t averaged over a number of realisations.
Similarly, define N H ( t ) to be the ensemble average of the SRCM state at time t and N P ( t ) to be the solution of the PDE at time t. As the PDE model is deterministic, it only needs to be run once, and thus no averaging is required. To enable direct comparison between the PDE and other models, we convert the PDE concentration profile into pseudo-particle counts over the compartmental domain. Throughout this section, We will define h = | Ω k | to be the length of a compartment and K = { 1 , , K } to be the indexing set of the compartments.

4.1. Case 1: Diffusion from a Top-Hat Initial Condition

We will model a purely diffusive system using the SRCM for a single species, A, to first ensure that we can correctly simulate diffusion in the absence of kinetic reactions. As there is only one species, we will drop the superscript denoting the species index for brevity. Correspondingly, A = { A } , and the reaction set is R kin = , hence R k = [ R con , R diff ] = [ C C D , C D C , d , d + ] . The corresponding mean-field PDE for this system is given by the following:
u t = D 2 u x 2 , x ( 0 , L ) , t ( 0 , T ] .
For simplicity, we choose to implement zero-flux boundary conditions:
u x | x = 0 , L = 0 .
The jump rate of the stochastic model, d, relates to the macroscopic diffusion coefficient D as follows: D = d h 2 . We use K = 50 compartments and Ω = [ 0 , 1 ] so that h = 0.02 . We note that the solution of the PDE part of the SRCM, v ( x , t ) evolves according to the same PDE and with the same boundary conditions as u ( x , t ) .
We run the SRCM and canonical stochastic models from a top-hat initial condition with all the mass initially represented in just two compartments in the centre of the domain in the stochastic regime. We run the PDE with the corresponding initial condition. The initial condition for the SRCM and the purely stochastic simulation is defined as follows:
X k ( 0 ) = 100 , k { 24 , 25 } , 0 , k K { 24 , 25 } ,
with
v ( x , 0 ) = 0
specified additionally for the initial condition of the PDE component of the SRCM. The corresponding initial condition for the pure PDE is u ( x , 0 ) = 5000 · 1 Ω 24 Ω 25 , i.e., all the mass is set within the central two compartments.
In Figure 2 we plot N H ( t ) , N S ( t ) ; the ensemble averages over 500 realisations of the hybrid and stochastic models, respectively, at four different time points of the simulation. We also plot the solution of the corresponding mean-field PDE (9) at the same time points.
Figure 2 demonstrates the spread of mass as it diffuses outwards from a top-hat initial condition (Figure 2a). The SRCM begins with all the mass entirely in the stochastic regime. Conversion of mass to the continuous regime with rate γ begins immediately and continues while the combined mass is above the conversion threshold. In Figure 2b we can see the impact of the conversion, rapidly reducing the mass in the stochastic regime and converting it to continuous mass. By time t = 3 , almost all the mass has been converted to the continuous regime. However, as the mass diffuses outwards (see Figure 2c), the combined mass in the outer compartments sits below the threshold and the mass is either converted back to or remains as discrete mass. Finally, in Figure 2d, the combined mass is below threshold across the whole domain, so the majority of the mass is converted back into the discrete regime. Note the good agreement between the canonical stochastic model (light blue bars) and the combined SRCM mass (dashed black line) (and indeed the mean-field PDE mass (solid green line)).
To analyse the error introduced by hybridisation, we compare the averaged profile of the hybrid method against the purely stochastic method. Separately, to understand the error between discrete and continuum approaches, we also compare the SSA against the deterministic PDE. To determine the level of self-error within the SSA, we compare the averaged profiles obtained from two independent batches of ensemble realisations (with each batch consisting of multiple realisations). Let N H ( t ) denote the ensemble average of the hybrid method, computed from n = 1000 independent realisations, each initiated from identically distributed initial conditions. Similarly, let N S 1 ( t ) and N S 2 ( t ) denote two independent ensemble averages of the SSA, each based on 1000 independent realisations. The deterministic PDE solution is denoted by N P ( t ) , converted to a pseudo-particle representation for comparison. We define N ^ H ( t ) , N ^ S 1 ( t ) , N ^ S 2 ( t ) , and N ^ P ( t ) to be the normalised ensemble profiles, where normalisation is performed with respect to the total mass in the domain at each time point. The normalised histogram distance error between the hybrid and stochastic simulations is given by the following:
ε H ( t ) = 1 2 k = 1 K ( N ^ H ) k ( t ) ( N ^ S 1 ) k ( t ) ,
and the self-error of the stochastic simulations is defined as follows:
ε S ( t ) = 1 2 k = 1 K ( N ^ S 1 ) k ( t ) ( N ^ S 2 ) k ( t ) .
Similarly, the error between the hybrid and the PDE method is defined by the following:
ε P ( t ) = 1 2 k = 1 K ( N ^ S 1 ) k ( t ) ( N ^ P ) k ( t ) .
We observe in Figure 3 that the hybrid error is slightly elevated during the first few time steps of the simulation. This is likely due to the high rate of conversions between the discrete and continuous regimes in this early phase. The PDE model also exhibits an altered mass profile compared to the compartment-based canonical stochastic model, which is reflected in the large initial spike in the PDE error. When large particle masses are highly localised (as in the initial condition of Figure 2), this discrepancy is likely to be more pronounced, potentially amplifying the PDE error.
As the simulation progresses, the hybrid error decreases and quickly comes to fluctuate at or below the self-error of the canonical stochastic simulation. Notably, the PDE model yields the lowest error relative to the hybrid. This is expected, since the PDE accurately captures the mean behaviour of the stochastic system and does not contribute intrinsic noise to the error. In contrast, the self-error between two ensemble stochastic averages leads to a higher relative error when compared to a single deterministic mean as both sets of simulations contribute their own intrinsic noise to the error.
This pure diffusion test case provides a useful benchmark for assessing the performance of the SRCM before introducing additional complexity in the form of zeroth-, first-, and second-order kinetic reactions.

4.2. Case 2: Alternating Growth and Decay

In this test case, we model a production–degradation reaction–diffusion system involving a single species, A = { A } . The production and degradation processes are activated alternately over contiguous, non-overlapping time intervals. Specifically, let T 1 denote the set of time intervals during which production is active, and let T 2 denote the intervals during which degradation is active. These intervals are disjoint and together span the full simulation time, i.e., T 1 T 2 = [ 0 , T ] and T 1 T 2 = . We define the indicator function 1 T 1 ( t ) such that 1 T 1 ( t ) = 1 if t T 1 , and 0 otherwise.
The production degradation system is captured by the following pair of reactions:
r 1 : A λ 1 1 T 1 ( t ) ,
r 2 : λ 2 1 T 2 ( t ) A ,
consistent across every compartment. These are a first- and a zeroth-order reaction respectively, which means the reaction set in the SRCM is R ¯ kin = [ r ¯ 1 , r ¯ 2 ] where
r ¯ 1 : D λ 1 1 T 1 ( t ) ,
r ¯ 2 : λ 2 1 T 2 ( t ) D .
Consequently, the complete reaction system is given by R ¯ k = [ R con , R diff , R ¯ kin ] .
The corresponding PDE governing the concentration, u ( x , t ) , in the mean-field model is given by the following:
u t = D 2 u x 2 + λ 2 1 T 2 ( t ) λ 1 1 T 1 ( t ) u , x ( 0 , L ) , t ( 0 , T ] .
As in test case 1, we implement zero-flux boundary conditions:
u x | x = 0 , L = 0 .
Observe that if this were the PDE we used for the continuum representation in the SRCM, the zeroth-order production reaction would be implemented twice: once in the stochastic regime and once in the PDE. This would lead to an overproduction of mass. Since zeroth-order production is independent of concentration, including it in both regimes would result in a higher production rate than intended. In accordance with rule (C2), we implement production exclusively within the stochastic framework. This provides greater accuracy at low particle numbers, where discrete stochastic effects are most significant. Any mass that is produced can then transition into the PDE regime through standard conversion if the total mass is above the conversion threshold. As a result the PDE we solve in the SRCM is
v t = D 2 v x 2 λ 1 1 T 1 ( t ) v , x ( 0 , L ) , t ( 0 , T ] ,
with the same zero-flux boundary conditions.
We set K = 20 , Ω = [ 0 , 1 ] and correspondingly, h = 0.05 . Setting the initial conditions for the SRCM as follows:
X k ( 0 ) = 0 k K , v ( x , 0 ) = 1000 x Ω .
The corresponding pure PDE has the following identical conditions, u ( x , 0 ) = 1000 for all x Ω , while the canonical stochastic model is initialised with
X k ( 0 ) = 50 k K .
Since we begin with a uniform initial condition we expect that our simulations will maintain uniformity throughout (at least in the ensemble average profiles). This absence of spatial heterogeneity allows us to analyse the total mass across the system, rather than focusing on local variations. We compare ensemble averages of the canonical stochastic model against the SRCM, the PDE solution and canonical model itself, as before.
Figure 4 illustrates the total mass of the SRCM, its constituent continuous and discrete components, as well as the total mass of the canonical stochastic simulation and the corresponding mean-field PDE. The discrete (dashed blue line) and continuous (dashed green line) regimes of the SRCM combine to form total mass (dashed black line). The combined mass in the SRCM agrees well with the mass of the canonical stochastic simulations (solid blue line) as well as with the PDE mass (solid green line); so much so that the PDE mass curve is obscured by the SRCM and canonical stochastic curves.
As the total number of particles falls below the threshold within the first time unit of the simulation, the continuous mass begins to be converted to discrete particles. The central part of the simulation is dominated by the stochastic regime before the production reaction is turned on and the degradation reaction is turned off. This allows the total mass to rise above the threshold for conversion, at which point stochastic mass is rapidly converted to continuous mass. It is worth noting that the discrete mass in the SRCM appears to decrease before the total mass reaches the conversion threshold. This is an artefact of averaging over a large number of realisations of the stochastic SRCM algorithm. Some of these realisations will reach threshold earlier than the average profile, while others will reach threshold later. When averaged over multiple realisations this gives the impression that the ensemble average mass drops before reaching the threshold, but in any individual repeat this will not be the case.
In Figure 5, we show the stochastic self-error (cyan line), SRCM error (black line), and PDE error (red line), each measured relative to the canonical stochastic simulation. We can see that all three errors rise as the total mass in the system falls. This is a result of the fact that the fluctuations in the stochastic system have a bigger relative impact when the total mass in the system is smaller. The smallest error is observed between the PDE and the SSA. This is expected, as the PDE model provides an exact representation of the average behaviour of the stochastic system, and thus only one source of noise, the stochastic simulation, contributes to the discrepancy. In contrast, the self-error involves comparing two independent stochastic runs, each subject to its own noise, resulting in the largest relative error overall. Importantly, the SRCM error is comparable to the self-error, suggesting that the SRCM is doing a good job of replicating the canonical stochastic dynamics.

4.3. Case 3: Morphogen Gradient

In this test case, we model the formation of a morphogen gradient through a reaction–diffusion system in which there is uniform degradation of particles across the domain with production occurring at the left boundary, x = 0 . As before, we consider just a single species, A = { A } , this time with the following kinetic reactions within the canonical stochastic system:
r 1 : λ 1 , k A k , r 2 : A k λ 2 , k .
So far we have assumed that these rates are consistent between compartments. In order to model the influx of particles into the domain in the stochastic representation, a zeroth-order production reaction will be implemented in the first compartment of the domain only. This is the first test case for which there are different reaction rates occurring in different compartments. Specifically we let, λ 1 , 1 = λ 1 but set λ k , 1 = 0 for k { 2 , , K } . In doing so, we switch off production in all the compartments except the first to mimic an influx of particles over the left-hand boundary. However, we set λ 2 , k = λ 2 to be the same across all the compartments.
In the SRCM the reaction set is R ¯ kin = { r ¯ 1 , r ¯ 2 } where
r ¯ 1 : λ 1 , k D k , r ¯ 2 : D k λ 2 , k ,
and λ 1 , k and λ 2 , k are as previously described.
The corresponding mean-field PDE model for the system is
u t = D 2 u x 2 λ 1 u , x ( 0 , L ) , t ( 0 , T ] .
The system has the following boundary conditions corresponding to production occurring on the left boundary and a zero-flux right-hand boundary:
D u x | x = 0 = λ 2 , u x | x = L = 0 .
As with the top-hat test case, the solution of the PDE part of the SRCM, v ( x , t ) evolves according to the same PDE as u ( x , t ) , but with zero-flux boundary conditions at both ends:
v x | x = 0 , L = 0 .
We set K = 40 , Ω = [ 0 , 1 ] and correspondingly h = 0.025 . The initial conditions for the SRCM are
X k ( 0 ) = 1 k K , v ( x , 0 ) = 0 .
The corresponding initial condition for the pure PDE is u ( x , 0 ) = 40 for all x Ω , while the canonical stochastic model is initialised with
X k ( 0 ) = 1 k K .
In the SRCM we let mass enter the system through the left boundary the stochastic regime as described above and in accordance with rule (C2).
Figure 6 demonstrates that mass is produced at the left hand boundary and diffuses across the domain while also degrading to form an exponentially decaying profile. Once the concentration surpasses the conversion threshold, the majority of the mass in those regions is converted to the continuous PDE regime. Notably, we observe an elevated number of discrete particles in the first compartment relative to elsewhere in the domain, which is a result of the production of mass at the boundary being implemented in the discrete regime before it transitions into the PDE regime. As we move rightwards into the domain, the discrete mass increases due to C-D conversion reactions as the combined profile drops below threshold, before eventually entering the region almost entirely governed by the discrete regime, where the total concentration falls sits well below the threshold.
One potential issue with this implementation of the SRCM is the high number of conversion reactions occurring within the first compartment as a result of the influx being implemented in the stochastic regime according to rule (C2). We do not expect this to be a substantial computational cost in comparison to the potential savings made by employing the PDE instead of simulating large numbers of discrete particles. Nevertheless, one potential solution might be to produce mass stochastically when the combined mass is below threshold and then to produce via the PDE when above threshold. This would, however, add some overheads to the code and so is perhaps of questionable benefit.
Figure 7 shows both the stochastic self-error, SRCM error, and PDE error computed over 1000 realisations. While the errors are of the same order of magnitude, we observe, as before, that the hybrid error is of a similar order of magnitude to the stochastic self-error.

4.4. Case 4: FKPP Travelling Wave

The final test problem we will consider is the FKPP (Fisher–Kolmogorov–Petrovsky–Piskunov) [16,27] travelling wave system. Travelling waves are common phenomena seen in biological systems at different scales, from animal migration [28] to cell migration [29], and so represent an important and well-used candidate for hybrid modelling. The FKPP reaction–diffusion model contains a non-linear logistic growth term paired with diffusion. This is a thorough test case for the SRCM, as the front’s stochasticity critically influences wave speed [17,18].
The FKPP equation makes for an excellent final test problem for the SRCM since it is well known that the typical stochastic model used to simulate FKPP-like dynamics (see reactions (24) and (25)) differs quantitatively from the moment-closed PDE version of the model (see Equation (27)). Successfully replicating the wave speed of the stochastic analogue of the FKPP PDE will demonstrate that the SRCM is accurately capturing the important features of the full canonical stochastic model.
Again we consider a single species, A = { A } . In the canonical stochastic system we consider the following set of kinetic reactions R kin = { r 1 , r 2 } :
r 1 : A k λ 1 , k 2 A k ,
r 2 : 2 A k λ 2 , k A k .
We define the extended reaction network R ¯ = { R con , R diff , R ¯ D kin } , in which the extended kinetic reaction set is R ¯ D kin = { r ¯ 1 , r ¯ 2 , r ¯ 3 , r ¯ 4 } and corresponding propensities α ¯ k = { α 1 , k , α 2 , k , α 3 , k , α 4 , k } :
r ¯ 1 : D k λ 1 , k 2 D k , α 1 , k = λ 1 X k , r ¯ 2 : 2 D k λ 2 , k D k , α 2 , k = λ 2 X k ( X K 1 ) h , r ¯ 3 : D k + C k λ 2 , k C k , α 3 , k = λ 2 X k Y k h , r ¯ 4 : C k + D k λ 2 , k C k , α 4 , k = λ 2 X k Y k h .
Note that reactions r ¯ 3 and r ¯ 4 represent the same bimolecular interaction between D k and C k , but are listed separately to account for the two distinct ways the molecules can be selected.
The corresponding moment-closed PDE is as follows:
u t = D 2 u x 2 + λ 1 u λ 2 u 2 , x ( 0 , L ) , t ( 0 , T ] .
As in test cases 1 and 2, we implement zero-flux boundary conditions:
u x | x = 0 , L = 0 ,
although we note that the boundary condition at x = L has little effect since large amounts of mass do not reach the right-hand boundary during the course of our simulations. For this test case, we again ensure that the solution of the PDE component of the SRCM, v ( x , t ) , obeys the same dynamics and boundary conditions as the full PDE solution, u ( x , t ) . For the FKPP test case we set K = 50 , Ω = [ 0 , 5 ] , and consequently, h = 0.1 . We specify the initial conditions for the SRCM as follows:
X k ( 0 ) = 10 , k = 1 , 0 , k K 1 , v ( x , 0 ) = 0 .
The corresponding pure PDE initial conditions is u ( x , 0 ) = 100 · 1 Ω 1 , while the canonical stochastic model is initialised with
X k ( 0 ) = 10 , k = 1 , 0 , k K 1 .
Figure 8 shows the propagation of a travelling wave in the FKPP system. As expected, the concentration grows toward the stable steady state λ 1 / λ 2 and the wave moves across the domain. In the hybrid implementation, mass is only modelled as discrete stochastic particles towards the leading edge of the wave. Although the hybrid model reproduces a travelling wave, its profile and speed differs from the fully stochastic model, which in turn differs from PDE solution.
To better understand this discrepancy, we analyse both the wave speed and spatial error between the SRCM and canonical stochastic models. The PDE travelling wave solution has a theoretical minimal wavespeed of 2 D λ 1 , which the numerical simulation approaches as the wavefront stabilises (see Figure 9a) [30]. The stochastic model, with a finite number of particles, converges to a wavespeed that is slower than the PDE.
Determining the wavefront position and speed directly is complicated by stochasticity. To overcome this, we adopt the approach of Robinson et al. [31], by estimating the wave speed from the rate of change in total system mass (this method is only truly valid when the shape of the wavefront does not change). Specifically, given time points t 1 and t 2 , the wave speed is approximated by the following:
c ^ = N ( t 2 ) N ( t 1 ) t 2 t 1 · λ 1 λ 2 ,
where N ( t ) is the total mass of species A in the system at time t. Figure 9a compares the estimated wave speeds of the PDE, the SSA, and the SRCM models, alongside the theoretical minimum wave speed.
In Figure 9a, we see that the smoothed travelling wave speed of the SRCM initially matches the stochastic simulation but gradually accelerates toward the PDE wave speed. To reduce the high-frequency noise inherent in stochastic realisations, we apply a moving average over a 50-time-point window. This smoothing reveals the underlying trend in wave propagation by dampening local fluctuations. The resulting divergence from the stochastic simulation is highlighted in the error plot in Figure 9b, where the SRCM increasingly deviates over time.
The convergence of the SRCM wavespeed to that of the PDE indicates a problem with the mass generation at the wavefront (where the wave speed is determined in this pulled front). According to rule (C2) mass is produced in the PDE regime according to the first-order production reaction. This mass can then diffuse to the wavefront in sufficiently low concentrations that it cannot be converted into discrete mass, and where it is further amplified by first-orderproduction in the PDE regime. Effectively, this means the wavefront is dominated by PDE dynamics rather than the discrete stochastic dynamics that should be dominating in order to simulate the correct wave speed.
To correct this, production should be restricted to the stochastic regime ensuring that dynamics at the front remain consistent with the stochastic implementation for this pulled wavefront. However, there is a fine balance between efficiency and accuracy, so we specify that the SRCM should produce mass via the stochastic regime if total mass is below threshold and in the continuous regime if above threshold. This means that production will occur in the continuous regime behind the wavefront, while production at the wavefront will occur exclusively in the stochastic regime. We implement this change to the SRCM and demonstrate that it produces travelling waves with the correct wave speed in the following section.

4.4.1. Adaptive Production Switching

We propose an adaptive mechanism to dynamically allocate production between the discrete and continuum regimes based on a combined threshold criterion. This ensures that stochastic effects are captured at the wavefront while maintaining computational efficiency behind the wave where stochasticity is less important, balancing efficiency and accuracy.
Recall that N k ( t ) : = X k ( t ) + Y k ( t ) where Y k ( t ) = Ω k v ( x , t ) d x , for k { 1 , , K } . For each compartment Ω k , we would like to specify that if N k ( t ) Θ | Ω k | then the first-order production reaction occurs solely within the continuous PDE regime, otherwise it will occur solely within the stochastic discrete regime. This can be done using a vector of indicator functions β ( t ) { 0 , 1 } K , such that β k ( t ) = 1 N k ( t ) Θ | Ω k | . In the extended network, N ¯ , we adapt the propensity function of reaction r ¯ 1 as follows:
α k , 1 ( t ) = λ 1 N k ( t ) ( 1 β k ( t ) ) .
Let
u ¯ ( x , t ) = k = 1 K ( v ( x , t ) + X k ( t ) / h ) · 1 Ω k ( x ) ,
define the entire combined mass at position x at time t (from both regimes) within the SRCM. The corresponding PDE for the continuous component of the SRCM is given by the following:
v t = D 2 v x 2 + λ 1 k = 1 K β k ( t ) 1 Ω k ( x ) · u ¯ ( x , t ) λ 2 v 2 x ( 0 , L ) , t ( 0 , T ] .
To reflect the adaptive nature of the SRCM, we modify the PDE so that production terms are only active in compartments in which the total mass concentration exceeds the threshold, Θ . In practice, this means that if the mass concentration in compartment k falls below Θ , the corresponding source term in the PDE is turned off. This ensures that PDE production is suppressed in regions governed primarily by the discrete regime and only applied where a continuous approximation is valid.
This adaption ensures that mass is produced via either the PDE or the stochastic regime depending on the total mass within each compartment (as opposed to production being constitutively turned on for both regimes). This adaptation does incur a small computational overhead associated with adding the discrete and continuous mass at each PDE timestep to find the total. However, not having to simulate stochastic production within each compartment should offset some if not all of the extra expense. In Figure 10 we plot the profiles of the adapted SRCM (alongside the reproduced solution profiles of the canonical stochastic system and the PDE) for the FKPP model with the same parameters as in Figure 8.
We observe in Figure 10 that there is now closer agreement between the stochastic and hybrid profiles for the adapted SRCM. Correspondingly, the smoothed wave speed of the SRCM now aligns much more closely with that of the canonical SSA simulation (see Figure 11a). This is to be expected, as the stochastic regime now dominates the dynamics at the leading edge of the wave—precisely where stochastic effects are important—allowing the wavefront dynamics to be governed primarily by the discrete stochastic model. As a result, the hybrid model captures the correct wave propagation speed of the canonical stochastic model.
We observe that the error in the SRCM peaks early in the simulation and then settles to a level that closely matches the self-error of the SSA (see Figure 11b). This initial spike is likely due to discontinuities in the concentration profiles during the early stages of wave formation, when particle numbers are low. The sharp transitions in the hybrid conversion mechanism in regions with minimal mass likely contribute to the transient peak in error.

4.4.2. Efficiency

We analyse the computational efficiency of modelling the FKPP system using both the canonical stochastic model and the SRCM (with adaptive production switching to ensure accuracy). Specifically, we compare the simulation run-times of these two methods when increasing the production rate, λ 1 , from 1 to 10 (and consequently increasing the steady state value behind the wavefront) while keeping all the other parameters the same.
The stable steady-state concentration of the reaction kinetics is given by the ratio of the production rate to the degradation rate. As the production rate increases, the total mass of the system increases proportionally. In the case of the pure SSA, this leads to a continually growing number of particles to simulate. Since the time step τ between reactions is inversely proportional to the sum of all reaction propensities, and this sum increases with the total number of particles, the SSA experiences an increase in time taken per repeat. In practice, this means that simulations become increasingly slow and eventually become computationally infeasible at high concentrations.
In contrast, the SRCM mitigates this issue through adaptive switching between stochastic and PDE representations. We fix the conversion threshold at 200 particles per unit volume. Once the local concentration exceeds this value, the system switches to a PDE representation in that region. As a result, even as the total mass increases, the SSA is only used to simulate a small proportion of the total mass, keeping the computational cost manageable.
The dependence of the time taken per repeat on the production rate, λ 1 , is illustrated in Figure 12. Notably, for concentrations below the threshold, the time per repeat for the SRCM is larger than the canonical stochastic model as we pay all the costs of the stochastic simulation whilst also incurring the computational overheads of the SRCM. The SRCM peaks in time per iteration when the steady-state concentration is close to the switching threshold (200 particles per unit volume). Around this point, the concentration behind the wavefront fluctuates around the threshold, leading to many costly back-and-forth conversion events. This represents the least efficient instance for the SRCM and indicates that the conversion threshold should be chosen to be substantially below any expected steady-state concentration in order to avoid computational inefficiency.
As expected, the PDE is the most efficent modelling technique. The SRCM scales with the PDE as particle number is increased since the majority of the mass is represented by the PDE regime. The proportion of time spent simulating discrete stochastic mass becomes relatively smaller, in stark contrast to the ever-slowing canonical SSA. This highlights the practical limitations of the SSA for large-mass systems and the scalability advantages of the hybrid SRCM approach.
The efficiency of the simulation has been studied for varying the threshold and conversion rate ( γ ) values and the results are discussed in Appendix A.1. Nondimensionalisation of the Fisher–KPP system demonstrates that the dimensionless conversion parameter depends on the model parameters. For our choice of re-scaling, the dimensionless conversion rate is γ ¯ = γ / λ 1 . This implies that the choice of conversion rate is system dependent. See Appendix A.2 for further details.

5. Discussion

In this work, we have described and illustrated the spatial regime conversion method, an adaptive hybrid modelling approach for reaction–diffusion systems. By dynamically allocating mass to either stochastic or deterministic regimes, based on local densities, the SRCM seeks to balance the accuracy of discrete stochastic realisations with the efficiency of continuous PDE models. Unlike traditional hybrid methods, requiring predefined or fixed interfaces [17,18,19], the SRCM introduces local conversion reactions that facilitate the adaptive switching of regimes in response to evolving system states. Our simulation results demonstrate that this framework can substantially reduce computational cost while retaining key stochastic features, particularly in systems where mass varies substantially across time and space. However, while the SRCM performs well across a range of test cases, there are some subtleties to bear in mind.
In the pure diffusion test case (see Section 4.1), the SRCM initially exhibited elevated error compared to the fully stochastic simulation. This was most pronounced during the early stages, where frequent conversion events introduced minor discrepancies in the SRCM concentration profile. While the overall error quickly converged to the same magnitude as the stochastic self-error, this early spike indicates a sensitivity to conversion timing. Smoother transitions or more gradual blending between regimes may mitigate this.
The morphogen gradient formation test problem (see Section 4.3) demonstrated the SRCM’s ability to faithfully represent a spatial profile which crosses the threshold concentration. The hybrid model closely matched both the pure SSA and PDE outcomes. However, the hybrid error here remained marginally higher than the stochastic self-error across the simulation. This artifact may be a result of the difficulty of replicating the flux boundary condition perfectly in the SRCM, leading to a small but persistent discrepancy.
In Section 4.4 we tested the SRCM on the FKPP travelling wave system, a classical benchmark for which front propagation is critically sensitive to stochastic effects. While the default SRCM captured wave formation and overall dynamics, its profile gradually diverged from the fully stochastic simulation. This discrepancy is fundamentally due to the fact that the wave speed is determined at the front, where stochastic effects should dominate; ideally, the entire wavefront region should be modelled using the discrete stochastic regime. However, in the originally specified implementation of the SRCM, the PDE governs a small but significant amount of the production within the front region. Even though this mass is quickly converted to discrete mass, this PDE-like behaviour at the very front overrides the stochastic dynamics that are critical to accurate wave propagation. As a result, the dynamics at the front are dictated by the PDE rather than the stochastic simulation, leading to an artificially accelerated wave.
To correct this, we introduced an adaptive production mechanism, for which production occurs stochastically when the total local mass in a compartment is below a threshold and deterministically otherwise. This approach significantly improved the agreement between the SRCM wave speed and that of the canonical SSA benchmark, reducing the hybrid error. It makes sense to make this adaptive production mechanism the default for the SRCM. There is little point, when the total concentration is below the threshold, in producing mass in the PDE regime only for it to be rapidly converted into discrete mass. Indeed, as well as improving accuracy, this adaptation may also improve computational efficiency.
Future work will explore alternative frameworks for the threshold mechanism in the hybrid model. One potential avenue for improvement along this line is to introduce two separate thresholds at different concentration levels, rather than relying on a single threshold for both conversion reaction types. The current approach, which uses a single threshold, can lead to inefficiency due to conflicting conversions when the concentration profile fluctuates around to this conversion threshold, as illustrated in the efficiency plot (see Figure 12). By contrast, with a two-threshold system, mass would convert from discrete to continuous when the total mass was above the higher threshold and from continuous to discrete when the total mass was below the lower threshold. This would create an intermediate concentration band where no conversion occurs, avoiding contiguity between the two conversion modes and reducing the risk of fluctuation-induced back-and-forth conversion.
A further extension worth investigating is replacing the sharp indicator function used to control conversions with a smoother sigmoidal function centred around a threshold. This would allow the conversion rate to vary continuously with concentration, making transitions more gradual. For situations in which a high threshold is desirable, it might also be advantageous to adopt a higher-order functional form for the conversion reaction, such that it scales with the highest reaction order in the system. This would ensure that conversion reactions are not dominated by the fastest system reactions at high concentrations.
Appendix A.1 explores how the efficiency and accuracy of the SRCM vary with changes in its two ad hoc parameters—the conversion rate and the concentration threshold—for the Fisher–KPP system. Figure A1 demonstrates that the conversion rate has little influence on either the computational efficiency or the accuracy of the method. In contrast, as can be seen in Figure A2b, the concentration threshold has a more pronounced effect: increasing the threshold, and thus the proportion of the domain simulated using the SSA, predictably leads to higher computational costs but improved accuracy.
The SRCM is a natural extension of the RCM [23] and therefore shares some of its limitations. In particular, the computational advantage of the method depends on the structure of the system being simulated. For reactions involving both low and high copy-number species, the stochastic component must still be used, which can limit the speed gains over the traditional SSA. Similarly, when all species in a reaction are above their transition thresholds, the SRCM may offer similar accuracy to continuum-based methods, with no clear computational benefit. Another limitation inherited from the RCM is the inaccuracy in higher-order moments caused by the continuum approximation—a classic moment-closure issue (e.g., as seen in the Fisher–KPP system). The SRCM mitigates this issue to some degree by applying the PDE when particle numbers are high so that the impact of moment-closure errors is reduced.
While our current implementation focuses on one-dimensional, single-species reactions systems, the SRCM framework has been developed for multi-species systems and can be readily extended to higher-dimensional (two-dimensional (2-D) or three-dimensional (3-D)) domains. In 2-D or 3-D, additional challenges arise. Handling the conversion of mass is more complex in higher dimensions and model simulation will be more computationally demanding. Efficient implementations of PDEs in higher dimensions rely on optimised numerical routines and computational techniques, such as sparse matrix operations and parallelisation, to ensure both accuracy and speed, while it is even harder to limit the curse of dimensionality in spatial stochastic systems.
Despite these challenges, the hybrid nature of SRCM—combining stochastic and continuum descriptions—suggests it will offer substantial efficiency savings for systems with high particle numbers and may even be more relatively more efficient in higher-dimensional systems.
In summary, the SRCM offers a versatile and extensible framework for modelling reaction–diffusion systems that stands in contrast to traditional hybrid methods with static, predefined interfaces [17,19]. Its core innovation lies in its dynamic adaptability, allowing computationally expensive stochastic resolution to be employed only in regions where it is essential (typically low-concentration areas (e.g., wavefronts)) while leveraging the efficiency of PDEs elsewhere. This makes the SRCM particularly valuable for multiscale systems exhibiting large spatio-temporal variations in concentration. This approach offers a promising foundation for modelling a wide range of systems for which switching behaviour, spatio-temporally varying concentration, or front propagation play a critical role, including wound healing [1,32], cell proliferation [29], and biological pattern formation [3,4].
The potential to refine such schemes with smoother thresholds, to extend them to higher dimensions, and to employ them for real-world applications highlights an exciting avenue for future development. In general, this framework opens the door to handling a diverse range of multiscale systems robustly while significantly reducing computational costs.

Author Contributions

Conceptualization, C.G.C., C.A.S. and C.A.Y.; methodology, C.G.C., C.A.S. and C.A.Y.; software, C.G.C.; validation, C.G.C.; formal analysis, C.G.C.; investigation, C.G.C.; writing—original draft, C.G.C.; writing—review and editing, C.G.C., C.A.S. and C.A.Y.; visualization, C.G.C.; supervision, C.A.S. and C.A.Y. All authors have read and agreed to the published version of the manuscript.

Funding

C.G.C. is funded by the EPSRC Centre for Doctoral Training in Statistical Applied Mathematics at Bath (SAMBa) under the project EP/S022945/1.

Data Availability Statement

The data and code employed in this study are accessible at https://doi.org/10.5281/zenodo.17306542.

Acknowledgments

The authors would like to acknowledge the initial helpful discussions with Martin Robinson, University of Oxford.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Appendix A.1. Parameter Sensitivity

In this section, we will investigate the impact of the two ad hoc parameters introduced by the SRCM framework: the rate of conversion, γ , and the threshold concentration at which the conversion direction switches, Θ , using the fourth case study (the FKPP system) as an example. We will determine how the accuracy (measured using the time-averaged histogram distance error, HDE, relative to a fully stochastic implementation over the same number of repeats) and the efficiency (the time per iteration) change as these parameters are varied. As these parameters are varied, the model performance changes in distinct ways. Figure A1a shows that the errors do not show a clear trend as the conversion rate increases. There is, arguably, a small increase in HDE observed at higher conversion rates, but this behaviour is likely due to stochastic variation. Figure A1b shows that the efficiency is not substantially influenced by the conversion rate; if anything, it is slightly reduced at higher rates. Conversion rate does not appear to substantially impact either the runtime or the overall accuracy.
Figure A1. Comparison of the SRCM and SSA for the improved FKPP system while varying values of γ from 0 to 10, for fixed threshold concentration Θ = 500 . Panel (a) shows the average histogram error over t [ 0 , 7 ) , computed across 500 realisations of each method. Panel (b) shows the average runtime per realisation of the SRCM, also averaged over 500 independent runs. Parameters are as follows: Ω = [ 0 , 5 ] ; h = 0.1 ; P = 8 ; Δ x = 1.25 × 10 2 ; T = 10 ; Δ t = 0.005 ; Θ = 500 ; λ 1 = 10 ; λ 2 = 0.01 ; D = 10 2 . We have set the first five compartments to have steady state concentration.
Figure A1. Comparison of the SRCM and SSA for the improved FKPP system while varying values of γ from 0 to 10, for fixed threshold concentration Θ = 500 . Panel (a) shows the average histogram error over t [ 0 , 7 ) , computed across 500 realisations of each method. Panel (b) shows the average runtime per realisation of the SRCM, also averaged over 500 independent runs. Parameters are as follows: Ω = [ 0 , 5 ] ; h = 0.1 ; P = 8 ; Δ x = 1.25 × 10 2 ; T = 10 ; Δ t = 0.005 ; Θ = 500 ; λ 1 = 10 ; λ 2 = 0.01 ; D = 10 2 . We have set the first five compartments to have steady state concentration.
Mathematics 13 03406 g0a1
In contrast, the threshold concentration has a more pronounced effect on both accuracy and efficiency. Increasing the threshold—meaning a larger portion of the simulation is performed using the SSA—the HDE decreases with increasing threshold values. The HDE converges towards the SSA self-error as the threshold increases and the SRCM converges toward the pure SSA (see Figure A2a). Similarly, as the threshold rises and a greater proportion of the system is simulated using the SSA this leads to a predictable increase in the computational time (see Figure A2b).
Figure A2. Comparison of the SRCM and SSA for the improved FKPP system with varying values of the concentration threshold Θ [ 100 , 800 ] , for fixed γ = 1 . Panel (a) shows the average histogram error over t [ 0 , 7 ) , computed across 500 realisations of each method. Panel (b) shows the average runtime per realisation of the SRCM, also averaged over 500 independent runs. Parameters: Ω = [ 0 , 5 ] ; h = 0.1 ; P = 8 ; Δ x = 1.25 × 10 2 ; T = 10 ; Δ t = 0.005 ; Θ = 500 ; λ 1 = 10 ; λ 2 = 0.01 ; D = 10 2 . We have set the first five compartments to have steady state concentration.
Figure A2. Comparison of the SRCM and SSA for the improved FKPP system with varying values of the concentration threshold Θ [ 100 , 800 ] , for fixed γ = 1 . Panel (a) shows the average histogram error over t [ 0 , 7 ) , computed across 500 realisations of each method. Panel (b) shows the average runtime per realisation of the SRCM, also averaged over 500 independent runs. Parameters: Ω = [ 0 , 5 ] ; h = 0.1 ; P = 8 ; Δ x = 1.25 × 10 2 ; T = 10 ; Δ t = 0.005 ; Θ = 500 ; λ 1 = 10 ; λ 2 = 0.01 ; D = 10 2 . We have set the first five compartments to have steady state concentration.
Mathematics 13 03406 g0a2

Appendix A.2. Analysis of the Conversion Rate, γ, Through Nondimensionalisation

In order to gain insights into appropriate choices of conversion parameter γ we will consider the FKPP system introduced in the fourth case study. For ease of analysis, consider the discrete mass and continuous mass as evolving according to two partial differential equations representing concentrations over space, given by u and w, respectively:
u t = D 2 u x 2 + λ 1 u λ 2 u 2 + γ w 1 b γ u 1 a , w t = D 2 w x 2 + λ 1 w λ 2 w 2 γ w 1 b + γ u 1 a ,
where D is the diffusion coefficient, λ 1 is the linear growth rate, λ 2 is the degradation rate, γ is the conversion rate and 1 a = 1 u + w > Θ and 1 b = 1 u + w Θ are indicator functions governing mass conversion which are one or zero depending on whether the system is above or below the threshold.
Our goal is to nondimensionalise Equation (A1) to understand the relationship between model parameters and the conversion rate γ . We introduce the following scalings for both species u and w as well as the the spatial variable x and the temporal variable t:
u ¯ = u u 0 , w ¯ = w w 0 , x ¯ = x x 0 , τ = t t 0 .
We choose the characteristic scales u 0 , w 0 , L, and t 0 to simplify the system. Substituting the dimensionless forms into the equation for u yields
u 0 t 0 u ¯ τ = D u 0 x 0 2 2 u ¯ x ¯ 2 + λ 1 ( u 0 u ¯ ) λ 2 ( u 0 u ¯ ) 2 + γ ( w 0 w ¯ ) 1 b γ ( u 0 u ¯ ) 1 a ,
u 0 t 0 u ¯ τ = D u 0 x 0 2 2 u ¯ x ¯ 2 + λ 1 u 0 u ¯ λ 2 u 0 2 u ¯ 2 + γ w 0 w ¯ 1 b γ u 0 u ¯ 1 a .
Dividing through by u 0 / t 0 in the first equation gives
u ¯ τ = D t 0 x 0 2 2 u ¯ x ¯ 2 + λ 1 t 0 u ¯ λ 2 u 0 t 0 u ¯ 2 + γ t 0 w 0 u 0 w ¯ 1 b γ t 0 u ¯ 1 a .
The analogous operation for the second equation gives
w ¯ τ = D t 0 x 0 2 2 w ¯ x ¯ 2 + λ 1 t 0 w ¯ λ 2 w 0 t 0 w ¯ 2 γ t 0 w ¯ 1 b + γ t 0 u 0 w 0 u ¯ 1 a .
To nondimensionalise the equations, we choose characteristic scales that simplify the coefficients. A natural choice is to scale time by the rate of production, and to scale population variables with respect to the equilibrium population size:
λ 1 t 0 = 1 t 0 = 1 λ 1 ,
λ 2 u 0 t 0 = 1 u 0 = 1 λ 2 t 0 = λ 1 λ 2 ,
λ 2 w 0 t 0 = 1 w 0 = 1 λ 2 t 0 = λ 1 λ 2 = u 0 ,
D t 0 x 0 2 = 1 x 0 = D t 0 = D λ 1 .
With these choices ( u 0 = w 0 ), we can then define the dimensionless conversion rate:
γ ¯ = γ t 0 = γ λ 1 .
Substituting the scalings from Equations (A7)–(A10) into Equations (A5) and (A6), and letting 1 ¯ a : = 1 ¯ u ¯ + w ¯ > u 0 Θ and 1 ¯ b : = 1 ¯ u ¯ + w ¯ u 0 Θ gives the final nondimensional form:
u ¯ τ = 2 u ¯ x ¯ 2 + u ¯ u ¯ 2 + γ ¯ w ¯ 1 ¯ b γ ¯ u ¯ 1 ¯ a , w ¯ τ = 2 w ¯ x ¯ 2 + w ¯ w ¯ 2 γ ¯ w ¯ 1 ¯ b + γ ¯ u ¯ 1 ¯ a .
The dimensionless form reveals a clear parameter dependence on γ ¯ , indicating that the conversion rate γ must be adjusted depending on the system under study.

References

  1. Callaghan, T.; Khain, E.; Sander, L.M.; Ziff, R.M. A stochastic model for wound healing. J. Stat. Phys. 2006, 122, 909–924. [Google Scholar] [CrossRef]
  2. Volpert, V.; Petrovskii, S. Reaction–diffusion waves in biology. Phys. Life Rev. 2009, 6, 267–310. [Google Scholar] [CrossRef] [PubMed]
  3. Klausmeier, C.A. Regular and irregular patterns in semiarid vegetation. Science 1999, 284, 1826–1828. [Google Scholar] [CrossRef]
  4. Sherratt, J.A. Pattern solutions of the Klausmeier model for banded vegetation in semiarid environments V: The transition from patterns to desert. SIAM J. Appl. Math. 2013, 73, 1347–1367. [Google Scholar] [CrossRef]
  5. Turing, A.M. The Chemical Basis of Morphogenesis. Philos. Trans. R. Soc. London. Ser. B Biol. Sci. 1952, 237, 37–72. [Google Scholar] [CrossRef]
  6. Andrews, S.S.; Bray, D. Stochastic simulation of chemical reactions with spatial resolution and single molecule detail. Phys. Biol. 2004, 1, 137–151. [Google Scholar] [CrossRef]
  7. Langevin, P. Sur la théorie du mouvement brownien. Comptes Rendus L’Académie Sci. 1908, 146, 530–533. [Google Scholar]
  8. Dobramysl, U.; Rüdiger, S.; Erban, R. Particle-based multiscale modeling of calcium puff dynamics. Multiscale Model. Simul. 2016, 14, 997–1016. [Google Scholar] [CrossRef]
  9. Gillespie, D.T. Exact stochastic simulation of coupled chemical reactions. J. Phys. Chem. 1977, 81, 2340–2361. [Google Scholar] [CrossRef]
  10. Gillespie, D.T. Approximate accelerated stochastic simulation of chemically reacting systems. J. Chem. Phys. 2001, 115, 1716–1733. [Google Scholar] [CrossRef]
  11. Proctor, C.J.; Gray, D.A. Explaining oscillations and variability in the p53-Mdm2 system. BMC Syst. Biol. 2008, 2, 75. [Google Scholar] [CrossRef]
  12. Lu, T.; Volfson, D.; Tsimring, L.; Hasty, J. Cellular growth and division in the Gillespie algorithm. IEE Proc. Syst. Biol. 2004, 1, 121–128. [Google Scholar] [CrossRef]
  13. Noble, D. The role of stochasticity in biological communication processes. Prog. Biophys. Mol. Biol. 2021, 162, 122–128. [Google Scholar] [CrossRef] [PubMed]
  14. Erban, R.; Chapman, S.J. Stochastic Modelling of Reaction–Diffusion Processes, 1st ed.; Cambridge University Press: Cambridge, UK, 2019. [Google Scholar] [CrossRef]
  15. Smith, C.A.; Yates, C.A. The auxiliary region method: A hybrid method for coupling PDE- and Brownian-based dynamics for reaction–diffusion systems. R. Soc. Open Sci. 2018, 5, 180920. [Google Scholar] [CrossRef] [PubMed]
  16. Kolmogorov, A.; Petrovskii, I.; Piskunov, N. A study of the diffusion equation with increase in the amount of substance, and its application to a biological problem. Mosc. Univ. Math. Bull. 1937, 1, 1–25. [Google Scholar]
  17. Moro, E. Hybrid method for simulating front propagation in reaction-diffusion systems. Phys. Rev. E 2004, 69, 060101. [Google Scholar] [CrossRef]
  18. Harrison, J.U.; Yates, C.A. A hybrid algorithm for coupling partial differential equation and compartment-based dynamics. J. R. Soc. Interface 2016, 13, 20160335. [Google Scholar] [CrossRef]
  19. Yates, C.A.; Flegg, M.B. The pseudo-compartment method for coupling partial differential equation and compartment-based models of diffusion. J. R. Soc. Interface 2015, 12, 20150141. [Google Scholar] [CrossRef]
  20. Spill, F.; Guerrero, P.; Alarcón, T.; Maini, P.K.; Byrne, H. Hybrid approaches for multiple-species stochastic reaction–diffusion models. J. Comput. Phys. 2015, 299, 429–445. [Google Scholar] [CrossRef]
  21. Alarcón, T.; Briñas-Pascual, N.; Calvo, J.; Guerrero, P.; Stepanova, D. Hybrid methods in reaction-diffusion equations. arXiv 2024, arXiv:2409.13911. [Google Scholar]
  22. Karig, D.; Martini, K.M.; Lu, T.; DeLateur, N.A.; Goldenfeld, N.; Weiss, R. Stochastic Turing patterns in a synthetic bacterial population. Proc. Natl. Acad. Sci. USA 2018, 115, 6572–6577. [Google Scholar] [CrossRef]
  23. Kynaston, J.C.; Yates, C.A.; Hekkink, A.V.F.; Guiver, C. The regime-conversion method: A hybrid technique for simulating well-mixed chemical reaction networks. Front. Appl. Math. Stat. 2023, 9, 1107441. [Google Scholar] [CrossRef]
  24. Germano, D.P.J.; Zarebski, A.E.; Hautphenne, S.; Moss, R.; Flegg, J.A.; Flegg, M.B. A hybrid framework for compartmental models enabling simulation-based inference. arXiv 2024, arXiv:2405.13239. [Google Scholar]
  25. Morton, K.W.; Mayers, D.F. Numerical Solution of Partial Differential Equations: An Introduction, 2nd ed.; Cambridge University Press: Cambridge, UK, 2005. [Google Scholar] [CrossRef]
  26. Erban, R.; Chapman, S. Reactive boundary conditions for stochastic simulations of reaction–diffusion processes. Phys. Biol. 2007, 4, 16–28. [Google Scholar] [CrossRef] [PubMed]
  27. Fisher, R.A. The wave of advance of advantageous genes. Ann. Eugen. 1937, 7, 355–369. [Google Scholar] [CrossRef]
  28. Simpson, M.J.; McCue, S.W. Fisher–KPP-type models of biological invasion: Open source computational tools, key concepts and analysis. Proc. R. Soc. A Math. Phys. Eng. Sci. 2024, 480, 20240186. [Google Scholar] [CrossRef]
  29. Vittadello, S.T.; McCue, S.W.; Gunasingh, G.; Haass, N.K.; Simpson, M.J. Mathematical models for cell migration with real-time cell cycle dynamics. Biophys. J. 2018, 114, 1241–1253. [Google Scholar] [CrossRef]
  30. Murray, J.D. Mathematical Biology: I. An Introduction, 3rd ed.; Interdisciplinary Applied Mathematics; Springer: New York, NY, USA, 2008. [Google Scholar] [CrossRef]
  31. Robinson, M.; Flegg, M.B.; Erban, R. Adaptive two-regime method: Application to front propagation. J. Chem. Phys. 2014, 140, 124109. [Google Scholar] [CrossRef]
  32. Habbal, A.; Barelli, H.; Malandain, G. Assessing the ability of the 2D Fisher–KPP equation to model cell-sheet wound closure. Math. Biosci. 2014, 252, 45–59. [Google Scholar] [CrossRef]
Figure 1. Schematic of the spatial regime conversion method. When the combined mass (black dashed line) is above the threshold (horizontal black line), mass is converted from the discrete regime (blue rectangles) to the continuous regime (green curve). When the combined mass is below threshold, mass is converted from the continuous regime to the discrete.
Figure 1. Schematic of the spatial regime conversion method. When the combined mass (black dashed line) is above the threshold (horizontal black line), mass is converted from the discrete regime (blue rectangles) to the continuous regime (green curve). When the combined mass is below threshold, mass is converted from the continuous regime to the discrete.
Mathematics 13 03406 g001
Figure 2. Diffusion from a top-hat initial condition, in which all the mass is initially in the discrete regime. The light blue histogram shows the results of the canonical stochastic diffusion model. The solid green line indicates the continuous PDE regime. The dark blue bars represent the discrete stochastic regime of the SRCM, while the dashed green line represents the mass in the PDE regime of the SRCM and the black dashed line represents the combined mass in the SRCM. Parameters: Ω = [ 0 , 1 ] , h = 0.02 , Δ t = 0.05 , Δ x = 2.5 × 10 3 , γ = 2 , Θ = 500 , D = 10 3 . The results for the stochastic models are averaged over 500 independent realisations.
Figure 2. Diffusion from a top-hat initial condition, in which all the mass is initially in the discrete regime. The light blue histogram shows the results of the canonical stochastic diffusion model. The solid green line indicates the continuous PDE regime. The dark blue bars represent the discrete stochastic regime of the SRCM, while the dashed green line represents the mass in the PDE regime of the SRCM and the black dashed line represents the combined mass in the SRCM. Parameters: Ω = [ 0 , 1 ] , h = 0.02 , Δ t = 0.05 , Δ x = 2.5 × 10 3 , γ = 2 , Θ = 500 , D = 10 3 . The results for the stochastic models are averaged over 500 independent realisations.
Mathematics 13 03406 g002
Figure 3. The evolution of the self-error ( ε S —cyan line), the SRCM error ( ε H —black line), and the PDE error ( ε P —red line) over time for the simple diffusion test case.
Figure 3. The evolution of the self-error ( ε S —cyan line), the SRCM error ( ε H —black line), and the PDE error ( ε P —red line) over time for the simple diffusion test case.
Mathematics 13 03406 g003
Figure 4. Total mass across the domain over time for the alternating growth and decay simulation. The SRCM output includes total hybrid mass (dashed black), PDE regime component (dashed green), and discrete stochastic component (dashed blue). Solid green and solid blue lines represent the pure PDE and canonical stochastic realisations, respectively. The conversion threshold is also shown. The parameters are as follows: Ω = [ 0 , 1 ] ; K = 50 ; h = 0.02 ; P = 8 ; Δ t = 0.05 ; Δ x = 2.5 × 10 3 ; γ = 2 ; Θ = 650 ; D = 10 3 . The growth and decay rates are piecewise constant: λ 1 = 1 for T 1 = [ 0 , 4 ] and λ 2 = 200 for T 2 = ( 4 , 9 ] . The results for the stochastic models are averaged over 1000 independent realisations.
Figure 4. Total mass across the domain over time for the alternating growth and decay simulation. The SRCM output includes total hybrid mass (dashed black), PDE regime component (dashed green), and discrete stochastic component (dashed blue). Solid green and solid blue lines represent the pure PDE and canonical stochastic realisations, respectively. The conversion threshold is also shown. The parameters are as follows: Ω = [ 0 , 1 ] ; K = 50 ; h = 0.02 ; P = 8 ; Δ t = 0.05 ; Δ x = 2.5 × 10 3 ; γ = 2 ; Θ = 650 ; D = 10 3 . The growth and decay rates are piecewise constant: λ 1 = 1 for T 1 = [ 0 , 4 ] and λ 2 = 200 for T 2 = ( 4 , 9 ] . The results for the stochastic models are averaged over 1000 independent realisations.
Mathematics 13 03406 g004
Figure 5. The evolution of the self-error ( ε S —cyan line), SRCM error ( ε H —black line), and PDE error ( ε P —red line) over time for the alternating growth and decay test problem.
Figure 5. The evolution of the self-error ( ε S —cyan line), SRCM error ( ε H —black line), and PDE error ( ε P —red line) over time for the alternating growth and decay test problem.
Mathematics 13 03406 g005
Figure 6. Morphogen gradient test problem, with all the mass initially in the discrete regime. The SRCM consists of the discrete stochastic component (dark blue histogram) and the PDE component (dashed green line) which are combined to form the total mass (dashed black line). The canonical stochastic solution is shown in cyan, and the pure PDE solution in solid green. Parameters: Ω = [ 0 , 1 ] ; h = 0.025 ; Δ t = 0.005 ; Δ x = 3.125 × 10 3 ; γ = 4 ; Θ = 200 ; D = 10 3 ; λ 1 = 5 ; λ 2 = 10 2 . The results for the stochastic models are averaged over 1000 independent realisations.
Figure 6. Morphogen gradient test problem, with all the mass initially in the discrete regime. The SRCM consists of the discrete stochastic component (dark blue histogram) and the PDE component (dashed green line) which are combined to form the total mass (dashed black line). The canonical stochastic solution is shown in cyan, and the pure PDE solution in solid green. Parameters: Ω = [ 0 , 1 ] ; h = 0.025 ; Δ t = 0.005 ; Δ x = 3.125 × 10 3 ; γ = 4 ; Θ = 200 ; D = 10 3 ; λ 1 = 5 ; λ 2 = 10 2 . The results for the stochastic models are averaged over 1000 independent realisations.
Mathematics 13 03406 g006
Figure 7. The evolution of the self-error ( ε S —cyan line), SRCM error ( ε H —black line), and PDE error ( ε P —red line) over time for the morphogen gradient test problem.
Figure 7. The evolution of the self-error ( ε S —cyan line), SRCM error ( ε H —black line), and PDE error ( ε P —red line) over time for the morphogen gradient test problem.
Mathematics 13 03406 g007
Figure 8. Solutions of the FKPP test problem, with all the mass initially in the discrete regime. Figure descriptions are as in Figure 6. The parameters are as follows: Ω = [ 0 , 5 ] ; h = 0.1 ; P = 8 ; Δ x = 1.25 × 10 2 ; T = 10 ; Δ t = 0.005 ; Θ = 500 ; γ = 1 ; λ 1 = 10 ; λ 2 = 0.01 ; D = 10 2 . The results for the stochastic models are averaged over 1000 independent realisations.
Figure 8. Solutions of the FKPP test problem, with all the mass initially in the discrete regime. Figure descriptions are as in Figure 6. The parameters are as follows: Ω = [ 0 , 5 ] ; h = 0.1 ; P = 8 ; Δ x = 1.25 × 10 2 ; T = 10 ; Δ t = 0.005 ; Θ = 500 ; γ = 1 ; λ 1 = 10 ; λ 2 = 0.01 ; D = 10 2 . The results for the stochastic models are averaged over 1000 independent realisations.
Mathematics 13 03406 g008
Figure 9. Comparison of (a) wave speeds and (b) histogram distance errors across profiles, each averaged over 1000 stochastic realisations. In (a) the wave speed is computed as the ensemble average for each model, while in (b), the histogram distance errors are calculated using independent batches of 1000 realisations for each of the two models being compared. Parameters are as in Figure 8.
Figure 9. Comparison of (a) wave speeds and (b) histogram distance errors across profiles, each averaged over 1000 stochastic realisations. In (a) the wave speed is computed as the ensemble average for each model, while in (b), the histogram distance errors are calculated using independent batches of 1000 realisations for each of the two models being compared. Parameters are as in Figure 8.
Mathematics 13 03406 g009
Figure 10. Solutions of the FKPP test problem using the SRCM with adaptive production. Figure descriptions are as in Figure 6. The parameters are as follows: Ω = [ 0 , 5 ] ; h = 0.1 ; P = 8 ; Δ x = 1.25 × 10 2 ; T = 10 ; Δ t = 0.005 ; Θ = 500 ; γ = 1 ; λ 1 = 10 ; λ 2 = 0.01 ; D = 10 2 . The results for the stochastic models are averaged over 1000 realisations.
Figure 10. Solutions of the FKPP test problem using the SRCM with adaptive production. Figure descriptions are as in Figure 6. The parameters are as follows: Ω = [ 0 , 5 ] ; h = 0.1 ; P = 8 ; Δ x = 1.25 × 10 2 ; T = 10 ; Δ t = 0.005 ; Θ = 500 ; γ = 1 ; λ 1 = 10 ; λ 2 = 0.01 ; D = 10 2 . The results for the stochastic models are averaged over 1000 realisations.
Mathematics 13 03406 g010
Figure 11. Comparison of (a) wave speeds and (b) histogram distance errors across profiles, each averaged over 1000 stochastic realisations. In (a) the wave speed is computed as the ensemble average for each model, while in (b), the histogram distance errors are calculated using independent batches of 1000 realisations for each of the two models being compared. The SRCM is simulated using the adaptive production method. The parameters are as in Figure 10.
Figure 11. Comparison of (a) wave speeds and (b) histogram distance errors across profiles, each averaged over 1000 stochastic realisations. In (a) the wave speed is computed as the ensemble average for each model, while in (b), the histogram distance errors are calculated using independent batches of 1000 realisations for each of the two models being compared. The SRCM is simulated using the adaptive production method. The parameters are as in Figure 10.
Mathematics 13 03406 g011
Figure 12. Average compute time per repeat for the FKPP system using the SRCM with adaptive production. The results are averaged over 10 realisations. The red line shows the runtime for the canonical SSA, the blue line shows the runtime for the hybrid SRCM, and the green line the PDE time per iteration. The threshold concentration is shown as a purple dashed line. The parameters are the same as Figure 10 with the exception of λ 1 which we vary.
Figure 12. Average compute time per repeat for the FKPP system using the SRCM with adaptive production. The results are averaged over 10 realisations. The red line shows the runtime for the canonical SSA, the blue line shows the runtime for the hybrid SRCM, and the green line the PDE time per iteration. The threshold concentration is shown as a purple dashed line. The parameters are the same as Figure 10 with the exception of λ 1 which we vary.
Mathematics 13 03406 g012
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Cameron, C.G.; Smith, C.A.; Yates, C.A. The Spatial Regime Conversion Method. Mathematics 2025, 13, 3406. https://doi.org/10.3390/math13213406

AMA Style

Cameron CG, Smith CA, Yates CA. The Spatial Regime Conversion Method. Mathematics. 2025; 13(21):3406. https://doi.org/10.3390/math13213406

Chicago/Turabian Style

Cameron, Charles G., Cameron A. Smith, and Christian A. Yates. 2025. "The Spatial Regime Conversion Method" Mathematics 13, no. 21: 3406. https://doi.org/10.3390/math13213406

APA Style

Cameron, C. G., Smith, C. A., & Yates, C. A. (2025). The Spatial Regime Conversion Method. Mathematics, 13(21), 3406. https://doi.org/10.3390/math13213406

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop