1 Introduction

In the formation of large clusters out of small particles, the initializing step is called the nucleation, and consists of the spontaneous reaction of agents which aggregate into small and stable polymers called nuclei. After this early step, the polymers are involved in a wide range of possible reactions, such as polymerization, fragmentation and coalescence. These reactions vary from one species to the other, and even from one application field (microtubule or protein polymerization in general) to another (phase condensation or crystallization).

To model such nucleation and polymerization processes, deterministic models consist in huge systems of ordinary differential equations, where there may be several orders of magnitude between the size of a single agent and the size of an aggregate. In these systems, the concentration of polymers made-up of i monomers, \(i\in \mathbb {N},\) is described by a time-dependent variable \(c_i (t)\). Its kinetics is given by a first-order differential equation, coupled with the equations of possibly all the other species. Among such models, we can cite the Bekker–Döring system (Collet et al. 2002), discrete growth-fragmentation models (Masel et al. 1999) or discrete coagulation-fragmentation models (Laurençot and Mischler 2002).

Continuous coagulation-fragmentation models have been developed, and proved to be the (weak) limit of the discrete models when an appropriate rescaling is carried out (Collet et al. 2002; Laurençot and Mischler 2002; Pruss et al. 2006; Doumic et al. 2009; Prigent et al. 2012). In such models, the discrete concentration \(c_i(t)\) is replaced by a continuous concentration c(tx) of polymers at time t of size x, whereas the concentration \(c_1(t)\) of monomers is treated separately. The limit is taken for a vanishing parameter \(\varepsilon :=\frac{1}{i_M}\) where \(i_M\) is the average size of a polymer. The concentration c(tx) of polymers is then the solution of a one-dimensional nonlinear first-order integro-partial differential equation on a domain \([0,T]\times [x_0,x_M]\) with \( 0\le x_0<x_M\le \infty \), and coupled with the equation satisfied by the concentration \(c_1(t)\) of monomers.

In these asymptotic results however, the integro-PDE satisfied by c(tx) requires a boundary condition at \(x=x_0 \ge 0\) for the problem to be well-posed. Such a boundary condition is formally derived for different models in Collet et al. (2002), Doumic et al. (2009), Prigent et al. (2012). Complete proofs (in a weak formulation) are also provided in Collet et al. (2002), Doumic et al. (2009), but with some extra assumptions either on the parameters (the polymerization rate needs to vanish as one approaches zero, so that a boundary condition is no longer necessary ) or on \(x_0\) (\(x_0 >0\) is required). Unfortunately, these restrictive cases are often not physically relevant: \(x_0>0\) would mean a very large minimal size of stable polymers, since it has to be on the same order of magnitude as the average size \(i_M \gg 1\) by assumption. If we assume a vanishing polymerization rate near 0 then spontaneous formation of polymers from monomers is impossible.

In Prigent et al. (2012) we proposed a general model to take into account both these large scale phenomena, modeled by a PDE approximation, and the nucleation step, which becomes a boundary condition for the smallest polymers. This boundary condition was formally derived but not theoretically proved, since it fails to satisfy these restrictive assumptions which were used in the previous studies (Collet et al. 2002; Doumic et al. 2009). We also showed via some specific examples the accuracy of this new model. However, it remains to determine how it is possible to capture numerically the specific characteristics of the nucleation step, because its scale is of infinitesimal size compared to the scale where continuous models are valid. This early step is of key importance because it influences the overall dynamics: as shown below, it provides the so-called lag time, which is the time needed for the polymerization chain reaction to ignite when initially the solution contains only monomers.

In considering numerical schemes for coagulation-fragmentation models, many successful studies have already been carried out, for the continuous equations [see e.g., Carrillo and Goudon (2004), Goudon and Lagoutière (2012) for the Lifshitz–Slyozov equation including even a space variable, and Bourgade and Filbet (2008), Filbet (2008), Filbet and Laurençot (2003, (2004a, (2004b), Kumar et al. (2006)] as well as for discrete cases (Wulkow 1996; Deuflhard et al. 2008). Our purpose here is not to elaborate on these studies, but rather to focus on the treatment of the nucleation step, which, to the best of our knowledge, has not yet been treated when combined with large chain reactions.

In a first section, we will recall the general model proposed in  Prigent et al. (2012), both in its original ODE version and its approximation by an integro-PDE system. We then write a simplified version of this system, which is the basis of this article: since our point is the treatment of the nucleation step, for the sake of clarity we neglect all the reactions which are of secondary importance when this early step dominates. In a second section, we detail our numerical strategy: the choice of an adapted grid, and convenient finite volume schemes. In a third section we present problems we chose to test our methods—one of them having the main advantage of possessing an analytical solution, which allows quantitative error estimates. We then give our numerical results. Finally, we discuss our results and how to adapt our method to more general situations where secondary pathways need to be considered.

2 Model

2.1 Framework model

In this preliminary section, we recall the general ODE model that we wish to simulate. This model has been designed to be as general as possible so that any type of reaction is represented. In the remainder of the article, we will call a monomer a single particle (or dust or atom or molecule) which is the basic unit agent in the aggregation chain reactions. Its concentration is denoted by \(c_1(t)\), whereas a concentration of polymers of size i (assumed here, for the sake of simplicity, to belong to a unique species) is denoted \(c_i(t).\) We consider the following reactions.

  • Activation scheme. An inert monomer may spontaneously convert into an active conformer, whose concentration is denoted \(c_1^*\) with reaction

    $$\begin{aligned} {c_1} \mathop {\underset{k_{I}^-}{\rightleftharpoons }}\limits ^{k_{I}^+} c_{1}^* . \end{aligned}$$
  • Nucleation step. There exist a wide variety of nucleation types—homogeneous or heterogeneous, progressive or not. Here we chose the type of reactions proposed by Oosawa and Asakura (1975) in the case of many protein polymerization processes. A nucleus here denotes the smallest stable size of polymers: smaller ones are highly unstable and too transitory to be observed. We call \(i_0\) the size of the nucleus, whose concentration is \(c_{i_0}.\) Instead of modelling a sequential addition (represented by \(c_1 \rightarrow c_2 \rightarrow c_3 \rightarrow \cdots \rightarrow c_{i_0}\)), the nucleus formation may be equivalently represented by an \(i_0\) order kinetic reaction, i.e., \(i_0 c_1^* \rightarrow c_{i_0}\). The nucleus size \(i_0\), of unknown value, can be equal to 1, 2,  3 or even more, with reaction given by

    $$\begin{aligned} \underbrace{c_1^*+ \cdots + c_1^*}_{ i_0} \mathop {\underset{k_{off}^N}{\rightleftharpoons }}\limits ^{k_{on}^N} c_{i_0} . \end{aligned}$$
  • Chain reaction of polymerization. Polymers of size i quickly polymerize into polymers of size \(i+1\) by addition of a monomer at a reaction rate \(k_{on}^i\), and may also depolymerize with a rate \(k_{dep}^i.\) This is modeled as

    $$\begin{aligned} c_i +c_1\mathop {\underset{k_{dep}^{i+1}}{\rightleftharpoons }}\limits ^{k_{on}^i} c_{i+1} . \end{aligned}$$
  • Coalescence and fragmentation. Polymers can coalesce with one another or break into two smaller polymers. We neglect the breakage into 3 or more pieces, which is generally much more hazardeous, as well as higher order coalescence of 3 or more polymers for the same reason. We denote \(k_{col}^{i,j}\) the coagulation rate of two polymers of respective size i and j,  and \(k_{off}^{i,j}\) the fragmentation rate of a polymer of size i giving rise to smaller polymers of size j and \(i-j,\) with \(2 \le j \le i_0\). Thus

    $$\begin{aligned} c_i + c_j \mathop {\underset{k_{off}^{i+j,i}}{\rightleftharpoons }}\limits ^{k_{col}^{i,j}} c_{i+j} . \end{aligned}$$

    We define \(K_{off}^j=\sum \nolimits _{i=2}^{j-2} k_{off}^{i,j}.\) This represents the total rate with which a polymer of size j can break to give smaller polymers. By symmetry we have that \(k_{off}^{i,j}=k_{off}^{j-i,j}\) and \(k_{col}^{i,j}=k_{col}^{j,i}.\)

  • Degradation and monomer addition. Each polymer, conformer or monomer may degrade with a degradation rate \(k_m^i,\) \(k_m^{1*}\) and \(k_m^1\) respectively, and monomers may be added to the system with a rate \(\lambda (t).\)

With these assumptions, the ordinary differential model is given by the sum of the laws of mass action for each of these reactions, namely

$$\begin{aligned} \frac{d c_1}{dt}&=-k_I^+ c_1 + k_I^- c_1^*-k_m^1 c_1 +\lambda (t),\end{aligned}$$
(1)
$$\begin{aligned} \frac{d c_1^*}{dt}&=k_I^+ c_1 - k_I^- c_1^*-i_{0}\, k_{on}^{N}\, (c_1^*)^{i_{0}}+i_{0}\, k_{off}^{N}\, c_{i_{0}} - k_m^{1*} c_1^*\nonumber \\&\quad -c_1^*\,\sum \limits _{i\ge i_{0}}k_{on}^{i}\, c_{i} + \sum \limits _{j=i_0}^\infty k_{dep}^j c_j+2\sum \limits _{i=2}^{i_{0}-1}\,\sum \limits _{j=i_{0}}^\infty i\, k_{off}^{i,j}\, c_{j} ,\end{aligned}$$
(2)
$$\begin{aligned} \frac{dc_{i_{0}}}{dt}&=k_{on}^{N}\, (c_1^*)^{i_{0}}-k_{off}^{N}\, c_{i_{0}}-k_{on}^{i_{0}}\, c_{i_{0}}\, c_1^*+k_{dep}^{i_0+1} c_{i_0+1}-k_m^{i_0} c_{i_0}\nonumber \\&\quad +2\sum \limits _{j=i_{0}+2}^\infty k_{off}^{i_0,j}\, c_{j} - K_{off}^{i_0} c_{i_0}-\sum _{j\ge i_{0}}k_{col}^{i_0,j} c_{i_0}\, c_{j},\end{aligned}$$
(3)
$$\begin{aligned} \frac{dc_{i}}{dt}&= c_1^* (k_{on}^{i-1}\, c_{i-1}-k_{on}^{i} \, c_{i}) - (k_{dep}^{i} c_i - k_{dep}^{i+1}c_{i+1}) - k_m^i c_i\nonumber \\&\quad +2\sum \limits _{j= i+2}^\infty k_{off}^{i,j}\, c_{j} -K_{off}^{i} c_{i}\nonumber \\&\quad +\frac{1}{2}\,\sum \limits _{i_{0}\le j\le i-2}k_{col}^{j,i-j}c_{j}\, c_{i-j}\, -\sum _{j\ge i_{0}}k_{col}^{i,j}c_{i}\, c_{j}, \quad \forall \; i\; \ge i_0+1. \end{aligned}$$
(4)

In this system, as seen above in the description of the reactions, \(i_0 \in \mathbb {N}^*\) is a fixed integer representing the size of the nucleus, which is the smallest stable polymer.

When the early steps of nucleation and conformation are absent, this is a classical system of coagulation-fragmentation reactions. This turns out to be of the family of physiologically-structured equations (Pruss et al. 2006; Diekmann et al. 2007) if we only consider fragmentation and polymerization, and to the Becker–Döring system if we do not consider either fragmentation and coalescence but only polymerization and depolymerization. This system has a positivity property, and satisfies a mass balance equation of the form

$$\begin{aligned} \frac{d}{dt}\biggl (c_1(t) + c_1^*(t) + \sum \limits _{i_0}^\infty i c_i(t)\biggr )=\lambda (t) - k_m^1 c_1(t) -k_m^{1*}c_1^* (t) - \sum \limits _{i_0}^\infty i k_m^i c_i(t). \end{aligned}$$
(5)

2.2 Aim of the article

The primary objective of this article is to find a fast and accurate numerical scheme to simulate this system. Efficiency is a key factor since intensive simulations may be necessary, for instance, to estimate parameters from experimental measurements. Such inverse problem methods and parameter identification algorithms generally require a nontrivial number of simulations. This is also required if we embed this model into a more complex one: for instance if we need a space variable (Caizo et al. 2010; Goudon and Lagoutière 2012), or if we want to model the distribution of polymers in a proliferating cell population (Sindi et al. 2009).

The main difficulty is that we expect i to take values up to \(10^6\) or even more (for instance in the case of Becker–Döring equation, part of the mass goes to infinity in the super-critical case (Penrose 1989). This makes an explicit scheme in which each differential equation for \(c_i\) must be solved very time-consuming. That is one of the reasons for the interest in a continuous approximation of \(c_i\) as it was carried out in Prigent et al. (2012), following previous studies  (Collet et al. 2002; Doumic et al. 2009; Laurençot and Mischler 2002).

2.3 Continuous approximation and numerical strategy

The continuous version of this model, formally derived in Prigent et al. (2012), is summarized next. The notation for \(c_1\) and \(c_1^*\) is unchanged, c(tx) represents the concentration of polymers of size \(x\ge x_0\ge 0\) at time t,  and the parameter functions are defined similarly. The continuous variable x replaces the discrete one i. Assumptions that coefficients must satisfy are detailed in (Prigent et al. (2012), Supplementary Data 1). The system is given by

$$\begin{aligned} \frac{d c_1}{dt}&=-k_I^+ c_1 + k_I^- c_1^*-k_m^1 c_1,\end{aligned}$$
(6)
$$\begin{aligned} \frac{d c_1^*}{dt}&=k_I^+ c_1 - k_I^-c_1^*-\frac{i_{0}\, k_{on}^{N}\, (c_1^*)^{i_{0}+1}k_{on}^{i_0}}{k_{off}^N + k_{on}^{i_0} c_1^*}\nonumber \\&\quad - k_m^{1*}c_1^* -c_1^*\,\int \limits _{x_0}^\infty k_{on}(x)\,c(t,x) dx + \int \limits _{x_0}^\infty k_{dep} (x) c(t,x)dx,\end{aligned}$$
(7)
$$\begin{aligned} \frac{\partial c(t,x)}{\partial t}&= -c_1^* \frac{\partial }{\partial x} \big (k_{on} (x) c(t,x)\big )+\frac{\partial }{\partial x} (k_{dep}(x) c(t,x)\big )\nonumber \\&\quad +2\int \limits _{x}^\infty k_{off}(x,y)\, c(y) dy -K_{off}(x) c(t,x) - k_m (x) c(t,x)\nonumber \\&\quad +\frac{1}{2}\,\int \limits _{x_0}^x k_{col}(y,x-y)c(t,y)c(t,x-y) dy\,\nonumber \\&\quad -\int \limits _{x_0}^\infty k_{col}(x,y) c(t,x)\, c(t,y) dy ,\quad x\ge x_0,\end{aligned}$$
(8)
$$\begin{aligned} k_{on}(x_0) c (t,x_0)&= k_{on} (x_0)\frac{k_{on}^{N}\, (c_1^{*})^{i_{0}}}{k_{off}^{N}+k_{on}(x_0) c_1}. \end{aligned}$$
(9)

As soon as the average polymer size \(i_M\) is large, this system is expected to be a good approximation of System (1)–(4). A second-order approximation for the polymerizing-depolymerizing terms has been proposed by  Collet and Hariz (1999), and is expected to be second-order accurate as shown by the formal calculation carried out in Collet et al. (2002) with respect to \(\varepsilon =\frac{1}{i_M}.\) The related issue of the limit of a stochastic Becker–Döring model to the Lifshitz–Slyozov equation with boundary value has also been recently investigated (Deschamps et al. 2014). The problem is that if \(i_0 \ll i_M,\) which is most often the case, there is a priori no reason for this approximation (and even the second order one) to be accurate, since the main assumption, which is the large size of i, fails to be satisfied. Our numerical strategy is thus the following.

Let us set \(\varepsilon \) as the typical precision that we want to achieve.

  • For sizes \(i\le N_0=1+\lfloor \frac{1}{\varepsilon }\rfloor ,\) we solve the original ODE system described by (1)–(4) by an accurate scheme of the desired order.

  • For sizes larger than \(N_0,\) we solve the PDE given by (8) by an appropriate finite volume scheme, as described in Sect. 3, and define a proper approximation of the polymerised mass \(\int \nolimits _{N_0}^\infty x c(t,x) dx.\) For this step, it is also possible to take advantage of existing schemes, such as developed in Bourgade and Filbet (2008), Filbet (2008), Filbet and Laurençot (2003, (2004a, (2004b), Carrillo and Goudon (2004), Goudon and Lagoutière (2012) for instance.

  • We define \(c_1\) by its equation and \(c_1^*\) by the mass conservation relation.

This corresponds to solving a mixed ODE and PDE system that we write below in the simplified case on which we will focus.

In order to keep the physical meaning and orders of magnitude, let us note that we did not carry out any dimensionless reformulation of the equations. This leads to large values of x in Eq. (8) and also to rather big values for our space step \(\Delta x \ge 1.\) The expected precision is not linked to a small \(\Delta x\) but rather to a small ratio \(\frac{\Delta x}{x},\) assumed to be in the order of \(\varepsilon .\) In this case, our PDE approximation is perfectly valid under the same kind of assumptions as in the previous studies (Collet et al. 2002; Doumic et al. 2009; Prigent et al. 2012), for example under the assumption \(k_{on} (x)=K_{on} (\varepsilon x)\) with a function \(K_{on} \in \mathcal{C}^1_b\) independent of \(\varepsilon .\) This also means that the larger x,  the more we neglect small variations of the coefficients. This is at least correct while nucleation and small polymers dominate the reactions.

2.4 Simplified model

Since our interest here is to study the nucleation step and how one can build adaptive numerical schemes, for the sake of simplicity we describe our method on a simplified case. This then is meant to be combined with existing numerical schemes for coagulation-fragmentation or the Lifshitz–Slyozov–Wagner equation.

We focus on the case when fragmentation, coalescence, depolymerization and death are not present, and we apply the previously described strategy. The ODE system is then the following

$$\begin{aligned}&\displaystyle \frac{d c_1}{dt}=-k_I^+ c_1 + k_I^- c_1^*,\end{aligned}$$
(10)
$$\begin{aligned}&\displaystyle \frac{d c_1^*}{dt}=k_I^+ c_1 - k_I^- c_1^*-i_{0}\, k_{on}^{N}\, (c_1^*)^{i_{0}}+i_{0}\, k_{off}^{N}\, c_{i_{0}} -c_1^*\,\sum \limits _{i\ge i_{0}}k_{on}^{i}\, c_{i} , \end{aligned}$$
(11)
$$\begin{aligned}&\displaystyle \frac{dc_{i_{0}}}{dt}=k_{on}^{N}\, (c_1^*)^{i_{0}}-k_{off}^{N}\, c_{i_{0}}-k_{on}^{i_{0}}\, c_{i_{0}}\, c_1^*,\end{aligned}$$
(12)
$$\begin{aligned}&\displaystyle \frac{dc_{i}}{dt}= c_1^* (k_{on}^{i-1}\, c_{i-1}-k_{on}^{i} \, c_{i}), \qquad \forall \; i\ge \; i_0+1, \end{aligned}$$
(13)

with the initial conditions

$$\begin{aligned} c_i(t=0)=c_1^*(t=0)=c_{i_0}(t=0)=0,\quad c_1(t=0)=c_0\in \mathbb {R}. \end{aligned}$$
(14)

The mass conservation, which may replace either Eqs. (10) or (11), becomes

$$\begin{aligned} \frac{d}{dt}\biggl (c_1(t)+c_1^*(t) + \sum \limits _{i_0}^\infty i c_i (t)\biggr )=0. \end{aligned}$$
(15)

3 Numerical scheme

The domain size on the order of up to a million (shown in experiments as a maximal size for protein polymers, but still larger for other applications like cluster formation) presents a challenge in the computations. Our simplified model begins with an initial concentration of only monomers. After the nucleation step, the polymers bind one monomer at a time. After the usually relevant observation times, smaller polymers are thus found at a higher concentration than larger polymers. A uniform grid, which ideally should not contain a large amount of elements in order to remain computationally tractable, does not capture these peaks at the left-hand side of the polymer distribution efficiently.

As explained in Sect. 2.3, we approximate (13) by solving the ODE system as long as \(i \le N_0\) and by a PDE for \(x \ge N_0\). The system of equations is thus given as

$$\begin{aligned} \frac{d c_1}{dt}&=-k_I^+ c_1 + k_I^- c_1^*,\end{aligned}$$
(16)
$$\begin{aligned} \frac{d c_1^*}{dt}&=k_I^+ c_1 - k_I^- c_1^*-i_{0}\, k_{on}^{N}\, (c_1^*)^{i_{0}}+i_{0}\, k_{off}^{N}\, c_{i_{0}} \nonumber \\&\quad -c_1^*\biggl (\sum \limits _{ i_{0}}^{N_0}k_{on}^{i}\, c_{i} + \int \limits _{N_0}^\infty k_{on} (x) c(t,x) dx \biggr ),\end{aligned}$$
(17)
$$\begin{aligned} \frac{dc_{i_{0}}}{dt}&=k_{on}^{N}\, (c_1^*)^{i_{0}}-k_{off}^{N}\, c_{i_{0}}-k_{on}^{i_{0}}\, c_{i_{0}}\, c_1^*,\end{aligned}$$
(18)
$$\begin{aligned} \frac{dc_i}{dt}&= c_1^*(k_{on}^{i-1}c_{i-1}-k_{on}^{i}c_i), \qquad i\le N_0,\end{aligned}$$
(19)
$$\begin{aligned} \frac{\partial c}{\partial t}&= -c_1^*\partial _x(k_{on}(x) c(x,t)), \qquad x> N_0. \end{aligned}$$
(20)

with the initial and boundary conditions

$$\begin{aligned}&c_1^*(t=0)=c_{i_0}(t=0)=c_i(t=0)=0, \quad c_1(t=0)=c_0 \in \mathbb {R},\end{aligned}$$
(21)
$$\begin{aligned}&c(t=0,x)=0, \quad c(t,x=N_0)=c_{N_0}(t). \end{aligned}$$
(22)

The mass conservation equation becomes

$$\begin{aligned} \frac{d}{dt}\biggl (c_1(t)+c_1^* (t) + \sum \limits _{i_0}^{N_0} i c_i + \int \limits _{N_0}^\infty x c(t,x) dx\biggr )=0. \end{aligned}$$
(23)

We will now discuss different types of finite volume approximations for the PDE.

3.1 Finite volume approximation

We use a finite volume scheme to approximate Eq. (20). Let the mesh be defined by \(N_0=x_{1/2}< x_{3/2}< \cdots < x_{N-1/2}=i_{max}\) with, for \(1\le i \le N-1\), \(I_i=[x_{i-1/2},\, x_{i+1/2}]\) and \(h_i=x_{i+1/2}-x_{i-1/2}\), not necessarily uniform. We define the cell average on the interval \(I_i\) as

$$\begin{aligned} Q_i^k:=\frac{1}{h_i}\int _{x_{i-1/2}}^{x_{i+1/2}}c(x,t_k)\,dx=\frac{1}{h_i}\int _{I_i}c(x,t_k)\,dx,\quad 1\le i\le N-1. \end{aligned}$$
(24)

The integral form of (20) on the interval \([t_k,\,t_{k+1}]\) is given by

$$\begin{aligned} \frac{d}{dt} \int _{I_i} c(x,t)\, dx = f_{i-1/2}(c,c^*_1,t)-f_{i+1/2}(c,c^*_1,t) \end{aligned}$$
(25)

with \(f_{i-1/2}(c,c_1^*,t)=c_1^*(t) k_{on}(x_{i-1/2}) c(x_{i-1/2},t)\). By integration, we obtain the time stepping scheme

$$\begin{aligned} Q_i^{k+1}=Q_i^k-\frac{\Delta t}{h_i} (F_{i+1/2}^k - F_{i-1/2}^k),\quad 1\le i\le N-1, \end{aligned}$$
(26)

with

$$\begin{aligned} F_{i-1/2}^k\approx \frac{1}{\Delta t}\int _{t_k}^{t_{k+1}} f_{i-1/2}(c,c_1^*,t)\, dt \end{aligned}$$
(27)

being an approximation to the average flux on the interval \([t_k,\,t_{k+1}]\). Choosing \(F_{i-1/2}^k=c_1^*(t_k) k_{on}^{i-1/2} Q_{i-1}^k\) with \(k_{on}^{i-1/2}:=k_{on}(x_{i-1/2})\), we have the simple upwind method

$$\begin{aligned} Q_i^{k+1}=Q_i^k-\frac{\Delta t}{h_i} c_1^{*,k} (k_{on}^{i+{1/2}} Q_i^k - k_{on}^{i-1/2} Q_{i-1}^k). \end{aligned}$$
(28)

This scheme is of first order. To increase the accuracy of the numerical simulations, we add a second order correction term and employ a Flux Limiter method on a non-uniform mesh (LeVeque 2002, Chapter 6.17.1). We have, for \( 1\le i\le N-1,\)

$$\begin{aligned} Q_i^{k+1}=Q_i^k-\frac{\Delta t}{h_i}c_1^{*,k} (k_{on}^{i+1/2} Q_i^k - k_{on}^{i-1/2} Q_{i-1}^k)-\frac{\Delta t}{h_i} (\tilde{F}_{i+1/2}^k - \tilde{F}_{i-1/2}^k), \end{aligned}$$
(29)

where we approximate the correction term by

$$\begin{aligned} \tilde{F}_{i-1/2}^k=\frac{c_1^{*,k}}{2}\left( h_{i-1}-c_1^{*,k} k_{on}^{i-1/2}\Delta t\right) k_{on}^{i-1/2}\left( \frac{ Q_{i}^k-Q_{i-1}^k}{\frac{1}{2}(h_{i-1}+h_i)}\right) \Phi (\lambda _{i-1}^k) \end{aligned}$$
(30)

with

$$\begin{aligned} \lambda _{i-1}^k=\left\{ \begin{array}{ll} \frac{Q_{i-1}^k-Q_{i-2}^k}{Q_{i}^k-Q_{i-1}^k}, &{} Q_{i}^k \ne Q_{i-1}^k\\ 0, &{} \text{ else } \end{array} \right. . \end{aligned}$$
(31)

For \(\Phi (\lambda _i^k)=1\), we obtain the Lax–Wendroff (LW) method which is a classical second order scheme. However, it often leads to oscillations if sharp fronts are present in the solution. As second choice we use the Van Leer (VL) Limiter given by

$$\begin{aligned} \Phi (\lambda )=\frac{|\lambda | + \lambda }{1 + |\lambda |}=\left\{ \begin{array}{cc} 0, &{} \lambda <0\\ \frac{2|\lambda |}{1+|\lambda |}, &{}\lambda >0 \end{array} \right. . \end{aligned}$$
(32)

Last, we will use a combination of Beam–Warming and Lax–Wendroff (BWLW) defined through

$$\begin{aligned} \Phi (\lambda )=\left\{ \begin{array}{cc} 0, &{}\quad \lambda \le 0\\ \lambda , &{}\quad 0\le \lambda \le 1\\ 1, &{}\quad 1\le \lambda \end{array} \right. . \end{aligned}$$
(33)

3.2 Implementation of boundary conditions

To advance the overall algorithm by one time step, we first compute \(c_{i_0}(t_{k+1})\) and solve the finite ODE system \(c_i^{k+1}\) for \(i=1,\ldots ,N_0\). The computation of \(Q_1^{n+1}\) in (26) requires the flux \(F_{-1/2}^k\) which is outside the defined problem domain. One approach would be to employ a special formula for the first cell and to compute the flux (27) by numerical integration. This in our case is not possible as \(c_1^{*,k+1}\) is necessary, but still unknown (we will discuss the exact algorithm in Sect. 3.3). As alternative, we use a ghost cell approach as defined in LeVeque (2002) (Fig. 1).

Fig. 1
figure 1

Mesh interpretation for ghost cell approach

The main idea is to make use of the solution of the ODE at time \(t_n\). As we have a hyperbolic equation, all information is transported along the streamlines through the domain. We define \(x_{-1/2}:=N_0-1\), \(x_{1/2}=N_0\) and define the linear function

$$\begin{aligned} g(x)=c_{N_{0}-1}+(x-N_0+1)\left( c_{N_0}-c_{N_{0}-1}\right) \end{aligned}$$
(34)

for \(x\in [N_0-1, N_0]\). We then define

$$\begin{aligned} Q_0^k:=\int _{x_{-1/2}}^{x_{1/2}} g(x)\, dx \end{aligned}$$
(35)

and consequently obtain (28).

3.3 The algorithm

To obtain \(c_1^{*,k}\), we need to compute the total polymerized mass \(M^k\). In case of our ODE–PDE approximation, the total polymerized mass is given by \(M^k=M_{ode}^k+M_{pde}^k\) with

$$\begin{aligned} M_{ode}^k=\sum _{i=i_0}^{N_0} i c_i^k, \quad M^k_{pde}=\int _{N_0}^{\infty }x c(t_k,x)\, dx. \end{aligned}$$

Let now \(x_i\) be the midpoint of \(I_i\), i.e. \(x_i=\frac{1}{2}(x_{i-1/2}+x_{i+1/2})\). As in Goudon and Lagoutière (2012), we use the approximation

$$\begin{aligned} M_{pde}(t_k)&=\sum _{i=1}^{N}\int _{I_i} x c(t_k,x)\, dx \approx \sum _{i=1}^{N} x_i \int _{I_i} c(t_k,x) \, dx = \sum _{i=1}^{N} x_i h_i Q_i^{k}. \end{aligned}$$

The computational algorithm is thus given by

  1. 1.

    Given \(c_1^*(t_k)\), compute \(c_{i_0}(t_{k+1})\).

  2. 2.

    Given \(c_{i_0}(t_k)\), solve the finite ODE system for \(c_i^{k+1}\), \(i=1,\ldots ,N_0\).

  3. 3.

    Given \(c_{N_0-1}^{k}, c_{N_0}^{k}\), compute a ghost cell average \(Q^k_0\). (Analogously for \(Q^k_{-1}\), \(Q^k_{-2}\) in case of the flux limiter methods).

  4. 5.

    Solve the PDE using one of the methods defined in Sect. 3.1 and obtain \(c(x_i,t_{k+1})\) for \(i=N_0,\ldots ,N\)

  5. 5.

    Compute \(M(t_{k+1})\) and update \(c_1^*(t_{k+1})\) with the mass balance equation (23), i.e. \(c_1^*(t_{k+1})=c_1(0)-M_{ode}^{k+1}-M_{pde}^{k+1}-c_1(t_{k+1})\).

Remark 1

Time discretization. In our numerical implementation, the ODE systen (19) for \(i\le N_0\) is solved with the forward Euler method. This scheme is explicit and of first order. To make use of the full higher order convergence that the Lax–Wendroff as well as Flux Limiter methods provide, it is necessary to also employ a second order scheme in time. The difficulty herein lies in the algorithm given above. A classical Runge–Kutta scheme can not be used, as it requires in step 2 the evaluation of \(c_1^*(t_{k+1})\) which is still unknown. A remedy is provided by the Adams–Bashforth multi-step method, as it depends only on previous time steps. In our discussion below, we will keep however the backward Euler method. The CFL condition dictates a rather small time step for stability, such that the measured error is mainly spatial and convergence rates become clearly visible.

Remark 2

Properties of our scheme. By replacing (18) with \(c_1^*(t)=c_1(0)-M(t)-c_1(t)=c_1(0)-M_{ode}(t)-M_{pde}(t)-c_1(t)\), our scheme is conservative for the mass balance by construction. In case of discretizing the PDE by the upwind scheme, we also have a positive method. On the uniform mesh, the Lax–Wendroff method as defined in (29) is consistent and of second order (LeVeque 2002, Chapter 9).

4 Numerical experiments

4.1 Description of numerical examples

4.1.1 Example 1

As a first example, we neglect the conformation step and choose \(c_1^*=a\in \mathbb {R}\), use a constant polymerization rate \(k_{on}\in \mathbb {R}\) and set \(k_{off}=0\). The Eqs. (10)–(13) then become

$$\begin{aligned}&\displaystyle c_1^*=a\end{aligned}$$
(36)
$$\begin{aligned}&\displaystyle \frac{dc_{i_0}}{dt} = k_{on}^N(c_1^*)^{i_0} - k_{on}c_{i_0}c_1^*,\end{aligned}$$
(37)
$$\begin{aligned}&\displaystyle \frac{dc_i}{dt} = c_1^{*}k_{on}(c_{i-1}-c_i), \quad c_i(0)=0, \quad i=i_0,\ldots . \end{aligned}$$
(38)

A solution in closed form to this simplified model can be found.

Lemma 1

For \(c_1^*=a\in \mathbb {R}\), \(k_{on}\in \mathbb {R}\) and \(k_{off}=0\), we have

$$\begin{aligned} c_{i_0}=-\frac{k_{on}^N a^{i_0-1}}{k_{on}} e^{-k_{on} a t}+\frac{k_{on}^N a^{i_0-1}}{k_{on}}, \end{aligned}$$
(39)

For \(i> i_0\), the polymer distribution is given by

$$\begin{aligned} c_{i+1}(t)=c_i(t) - (k_{on} a)^{i-i_0}\frac{k_{on}^N a^{i_0}}{(i+1-i_0)!} t^{i+1-i_0} e^{-k_{on} a t}. \end{aligned}$$
(40)

Having the exact solution provides the possibility to determine a discretization error for the distribution c of our method. However, we chose here to use a representative parameter set, for which the simulation of (40) becomes numerically unstable. When comparing the discretization error in the following section, we will therefore use a numerically computed distribution, obtained by (36), (39) and an explicit very accurate scheme for (19).

The inverse problem uses the total polymerized mass in the cost function, as this is measured in the experiments. In the following, we derive explicit solutions for the total polymerized mass to (36)–(38). Let therefore \(P=\sum _{i\ge i_0} c_i\). We add up Eqs. (37) and (38) and use the telescoping sum

$$\begin{aligned} \frac{dP}{dt}&=\frac{dc_{i_0}}{dt}+\sum _{i>i_0}\frac{dc_{i}}{dt}\\&=k_{on}^N(c_1^*)^{i_0} - k_{on}c_{i_0}c_1^*+ \sum _{i>i_0} c_1^* k_{on}(c_{i-1}- c_i)\\&=k_{on}^N(c_1^*)^{i_0}. \end{aligned}$$

With \(P(0)=0\), we obtain

$$\begin{aligned} P(t)=\int _0^t k_{on}^N (c_1^* )^{i_0}\, dt=k_{on}^N a^{i_0} t. \end{aligned}$$
(41)

Similarly, we obtain the first moment (or total polymerized mass) \(M=\sum _{i\ge i_0} i c_i\) by multiplying equations (37) and (38) by i and summing over i

$$\begin{aligned} \frac{dM}{dt}&=i_0\frac{dc_{i_0}}{dt}+\sum _{i>i_0}k \frac{dc_{i}}{dt}\\&=i_0 k_{on}^N(c_1^*)^{i_0}- i_0 k_{on}c_{i_0}c_1^* +\sum _{i>i_0}c_1^*k_{on}((i-1) c_{i-1}- c_i + c_{i-1})\\&=i_0 k_{on}^N(c_1^*)^{i_0} + P c_1^*k_{on}. \end{aligned}$$

Since \(M(0)=0\), we find

$$\begin{aligned} M(t)=\int _0^t i_0 k_{on}^N (c_1^*)^{i_0}+k_{on} c_1^* P\, ds=i_0 k_{on}^N a^{i_0}t+\frac{k_{on} k_{on}^N a^{i_0+1}}{2} t^2 . \end{aligned}$$
(42)

4.1.2 Example 2

In a second example, we again allow a conformation step and choose the polymerization function \(k_{on}^i\) to be linear in i, i.e.,

$$\begin{aligned} k_{on}^i=k_{on}^{(1)}+i k_{on}^{(2)} \end{aligned}$$

for some constants \(k_{on}^{(1)}, k_{on}^{(2)}\in \mathbb {R}\). With this choice for \(k_{on}^i\), the setting is a variation of the typical nucleation-aggregation model given by

$$\begin{aligned}&\displaystyle \frac{d c_1}{dt}=-k_I^+ c_1 + k_I^- c_1^*,\end{aligned}$$
(43)
$$\begin{aligned}&\displaystyle \frac{d c_1^*}{dt}=k_{I}^{+} c_1 - k_{I}^{-} c_1^* - i_0 k_{on}^N (c_1^*)^{i_0} + i_0 k_{off}^N c_{i_0} - c_1^* \sum _{i\ge i_0} k_{on}^i c_i , \end{aligned}$$
(44)
$$\begin{aligned}&\displaystyle \frac{dc_{i_{0}}}{dt}=k_{on}^{N}\, (c_1^*)^{i_{0}}-k_{off}^{N}\, c_{i_{0}}-k_{on}^{i_{0}}\, c_{i_{0}}\, c_1^*,\end{aligned}$$
(45)
$$\begin{aligned}&\displaystyle \frac{dc_{i}}{dt}= c_1^* (k_{on}^{i-1}\, c_{i-1}-k_{on}^{i} \, c_{i}), \end{aligned}$$
(46)

with initial conditions

$$\begin{aligned} c_i(t=0)=c_1^*(t=0)=c_{i_0}(t=0)=0, \quad c_1(t=0)=c_0. \end{aligned}$$
(47)

A solution in closed form cannot be found, but we derive an aggregated version of the model. We follow (Prigent et al. 2012, Supplementary Data 1) and in an analogous manner as above obtain

$$\begin{aligned} \frac{dP}{dt}=k_{on}^N (c_1^*)^{i_0} - k_{off}^N c_{i_0} \end{aligned}$$
(48)

and

$$\begin{aligned} \frac{dM}{dt}=c_1^* k_{on}^{(1)}P+c_1^*k_{on}^{(2)}M+i_0 k_{on}^N (c_1^*)^{i_0}-i_0 k_{off}^N c_{i_0}. \end{aligned}$$
(49)

Equations (43)–(45) and (48)–(49) form a (finite) system of ODEs which are easily solved at a high precision using an explicit scheme. This numerical solution is then used in Sect. 4.2 to compute an error for the numerical approximation.

4.2 Numerical results

We now present numerical results for the finite volume schemes applied to the two examples of the previous section. We make two choices for the mesh required in the discretization of the PDE. First, we use a simple uniform mesh defined as

$$\begin{aligned} x_i=N_0+i \cdot h, \quad i=0,\ldots ,N, \end{aligned}$$

with \(h= \frac{i_{max}-N_0}{N}\). Second, we use a progressive mesh that is defined such that a ratio between the spatial step size and the corresponding mesh element is kept constant, i.e., \(\frac{\Delta x_i}{x_i}= q <1\). This results in the formula

$$\begin{aligned} x_i=\frac{1}{1-q} x_{i-1}. \end{aligned}$$
(50)

Remark 3

The progressive mesh is a quasi uniform mesh in the sense that \(\frac{\Delta x_{i-1}}{\Delta x_{i}}=1-q=1+O(h)\). With this property, it can be shown that the upwind and Lax–Wendroff methods are consistent on the progressive mesh.

Based on the parameter estimation problem, where the cost-function uses the total polymerized mass M for the minimization process, we compute the relative \(L^2[0,T]\)-discretization error \(e_M\) as

$$\begin{aligned} e_M=\frac{\Vert M^h-M \Vert _{L^2[0,T]}}{\Vert M \Vert _{L^2[0,T]}} \end{aligned}$$

with \(M^h\) being the solution of the discretized problem. It should be emphasized here that the exact solution M corresponds to the infinite ODE setting, i.e., \(M=\sum _{i\ge i_0} i c_i\). We thus compare the numerical solution \(M^h\) (discretized by the ODE–PDE scheme) to the ODE solution. The obtained error is therefore always influenced by the quality of the continuous (PDE) approximation of the ODE system. In case of Example 1, we also compute a relative \(L^2\) error for the distribution c at the final time \(t_N\) as

$$\begin{aligned} e_c(t_N)=\frac{\left( \sum _{i\ge i_0} (\tilde{c}_i(t_N)- c^h(t_N,x=i))^2\right) ^{1/2}}{\left( \sum _{i\ge i_0}\tilde{c}_i(t_N)^2\right) ^{1/2} }. \end{aligned}$$
(51)

The approximation to the exact solution c is obtained, as described above, by solving (36), (39) and (19) with \(\Delta t_{max}=1e-3\). The integer steps of \(c^h(x=i,t_N)\) are obtained by linear interpolation between two grid points \(x_k\). Again, we compare the solution of the ODE–PDE scheme to the (numerical) ODE solution. The observed error does not obey any convergence results known from the literature for an approximation of a PDE. However it will give a rough estimate of the convergence properties of our scheme.

To measure the computational efficiency of the schemes, we also include the computation times of each method. These are measured using the Matlab tic-toc command on an Intel Core i7 processor.

4.3 Example 1

We begin by investigating a uniform mesh for the PDE with N elements and compare the flux limiter methods. The parameters are chosen as

$$\begin{aligned} c_0&=285\cdot 10^{-6},\\ k_{on}^N&= 5.5079\cdot 10^{3},\\ k_{on}&=2.1691\cdot 10^{6},\\ i_{max}&=3.2907\cdot 10^{5},\\ i_0&=3. \end{aligned}$$

These parameters are derived from a previous paper (Prigent et al. 2012), where similar values were found as best-fit parameters to the polymerization problem and thus represent some typical values. We choose the maximal time step size \(\Delta t=1e-3\). The smallest time step size is determined by the CFL condition (and thus is unknown a priori). Consequently, we have a fine time stepping and expect to see (for a rather coarse spatial mesh) mainly a spatial error. We compute the simulations up to \(T=40\) h. The discretization error \(e_M\) is found in Table 1 together with the corresponding convergence rates. These are computed in the usual way as \(\lambda _i^k=\frac{\log (e_M(N_k)/e_M(N_{k-1}))}{\log (N_{k}/N_{k-1})}\) indicating the slope of the error curves in Fig. 2. The computation times of each method with corresponding discretization error are presented in Table 2 and the polymer distributions are given in Fig. 3.

Table 1 Ex. 1: error \(e_M\) and convergence rates \(\lambda _i\) for the uniform mesh with \(\Delta t_{max}=1e-3\) and \(N_0=100\)
Fig. 2
figure 2

Example 1: convergence plots for error \(e_M\) (uniform mesh)

Table 2 Ex. 1: error \(e_M\) for the uniform mesh and computation time \(ct_i\), \(\Delta t_{max}=1e-3\), \(N_0=100\)
Fig. 3
figure 3

Example 1: polymer distribution (uniform mesh)

Fig. 4
figure 4

Example 1: convergence plots for error \(e_M\) (progressive mesh)

The simple upwind method converges with a rate of 1, while the Lax–Wendroff method converges with a rate of 2. The Flux-Limiter method rates are between 1 and 2 with the Van-Leer Limiter exhibiting a somewhat better convergence. The uniform mesh does not take the high concentration of smaller polymer sizes into account, but gives each spatial interval equal importance. The exact polymer distribution \(c_i\) to Example 1 contains a sharp front. It is thus expected and confirmed in Fig. 3 that this feature will not be captured properly. The upwind method on a uniform grid smooths out the sharp front. While the Lax–Wendroff method converges the fastest for M, it leads to large oscillations for the distribution \(c_i\). The flux limiter methods avoid oscillations and approximate the sharp front better than the upwind method. On the other hand, they have a slightly larger error \(e_M\) than Lax–Wendroff.

Table 3 Ex. 1: error \(e_M\) for the progressive mesh with \(\Delta t_{max}=10^{-3}\)

The first experiment for the progressive mesh keeps the ratio q fixed and changes \(N_0\). The error does not change significantly. Due to the constant inflow of conformers and as seen in Fig. 4, the distribution \(c_i\) is constant for smaller polymer sizes. Any of the four proposed discretization methods approximates a constant accurately. The number of \(N_0\) is thus, for this particular example, not important. In the following simulations, we set \(N_0=100\) (Table 3).

The second experiment for the progressive mesh focuses on the convergence of the error in q (or in the corresponding number of elements N). All methods converge satisfactorily (Tables 4, 5; Fig. 4). In terms of the error \(e_M\), the Lax–Wendroff method is best but again exhibits oscillations in the distribution c. In Fig. 5, we present the relative error \(e_{rel}(t)=\frac{|M^h(t)-M(t)|}{|M|}\). At the beginning, all methods have a large relative error. The model uses an instantaneous inflow of conformers which could be compared to a Dirac-delta function. Since all methods start with solving (19) up to \(i=N_0\), this peak is the same for all cases. For \(t\ge 1\), the relative error is about constant and thus the approximation \(M^h\) is found in a fan-shaped environment around M. It is clearly shown that Lax–Wendroff gives the best approximation to M, while the upwind method performs the worst.

Comparing the two meshes, the error using the progressive mesh is smaller than the one using the uniform mesh. In conclusion, a choice for practical simulations would be a flux limiter method to avoid the oscillations in the approximation of \(c_i\) in combination with a progressive mesh to make use of the smaller error (Fig. 6; Tables 6, 7).

Table 4 Ex. 1: error \(e_M\) and convergence rates \(\lambda _i\) for the progressive mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=100\)
Table 5 Ex. 1: error \(e_M\) and computation time \(ct_i\) for the progressive mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=100\)
Fig. 5
figure 5

Example 1: development of error \(e_{rel}\) in time (progressive mesh) for \(q=1/32\), \(N_0=100\) and \(\Delta t_{max}=10^{-3}\)

Fig. 6
figure 6

Example 1: polymer distribution (progressive mesh)

Table 6 Ex. 1: error \(e_c\) and convergence rates \(\lambda _i\) for the uniform mesh with \(\Delta t_{max}\!=\!10^{-3}\) and \(N_0=100\)
Table 7 Ex. 1: error \(e_c\) and convergence rates \(\lambda _i\) for the progressive mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=100\)
Fig. 7
figure 7

Example 2: distribution of polymers at \(t=12\)

4.4 Example 2

In the second numerical example, we approximate (43)–(46) using (16)–(20). The polymerization function is chosen as \(k_{on}^i=k_{on}^1+i k_{on}^2\) for the ODE, and as \(k_{on}(x)=k_{on}^1+x k_{on}^2\) in the continuous case. We use the following parameter values

$$\begin{aligned} c_0&=285\cdot 10^{-6},\\ k_I^+&=5.7428 \cdot 10^{-1},\\ k_I^{-}&=1\cdot 10^{-2},\\ k_{on}^N&= 5.5079\cdot 10^{3},\\ k_{on}^1&=8.2766 10^{3},\\ k_{on}^2&=6.5916\cdot 10^{3},\\ i_{max}&=3.2907\cdot 10^{5},\\ i_0&=3. \end{aligned}$$

The simulated curve for the total polymerized mass has a typical shape (Fig. 7) for the polymerization–aggregation model. After having a lag-phase at the beginning where the conforming step takes place, it grows steeply (polymerization) and damps out in the end when all monomers are bound to a polymer.

Table 8 Ex. 2: error \(e_{\tilde{M}}\) and convergence rates \(\lambda _i\) for the uniform mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=100\)
Table 9 Ex. 2: error \(e_{\tilde{M}}\) and computation time \(ct_i\) for the uniform mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=100\)

We again discuss the convergence of the different suggested schemes in terms of the total polymerized mass M. This example does not permit an exact solution. We solve the (finite) system of ODEs (43)–(45) and (48)–(49) numerically, which gives a good approximation \(\tilde{M}\) to the exact solution. The approximation error is then computed as

$$\begin{aligned} e_{\tilde{M}}=\frac{\Vert \tilde{M}-M^h\Vert _{L^2[0,T]}}{\Vert \tilde{M}\Vert _{L^2[0,T]}}. \end{aligned}$$
(52)

We define a maximum time step size to solve the ODE system for \(\tilde{M}\), while the minimum time step size is determined through the CFL condition. In the following numerical computations, we use \(\Delta t_{max}=10^{-4}\). For the uniform mesh, we distinguish two different \(N_0\). The errors \(e_{\tilde{M}}\) vs. the convergence rates as well as computation times for the four different methods using the uniform mesh with \(N_0=100\) and \(N_0=500\) are given in Tables 8, 9, 10 and 11. For the progressive mesh, the errors \(e_{\tilde{M}}\) and convergence rate are given in Tables 12, 13, 14, 15 and 16. We distinguish between \(\Delta t_{max}=0.5\cdot 10^{-3}\) and \(\Delta t_{max}=10^{-3}\), as well as \(N_0=100\) and \(N_0=500\).

Table 10 Ex. 2: error \(e_{\tilde{M}}\) and convergence rates \(\lambda _i\) for the uniform mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=500\)
Table 11 Ex. 2: error \(e_{\tilde{M}}\) and computation times \(ct_i\) for the uniform mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=500\)
Table 12 Ex. 2: error \(e_{\tilde{M}}\) and convergence rates \(\lambda _i\) for the progressive mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=100\)
Table 13 Ex. 2: error \(e_{\tilde{M}}\) and computational times \(ct_i\) for the progressive mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=100\)
Table 14 Ex. 2: error \(e_{\tilde{M}}\) and convergence rates \(\lambda _i\) for the progressive mesh with \(\Delta t_{max}=0.5\cdot 10^{-3}\) and \(N_0=100\)
Table 15 Ex. 2: error \(e_{\tilde{M}}\) and convergence rates \(\lambda _i\) for the progressive mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=500\)
Table 16 Ex. 2: error \(e_{\tilde{M}}\) and computational times \(ct_i\) for the progressive mesh with \(\Delta t_{max}=10^{-3}\) and \(N_0=500\)

For the uniform mesh and \(N_0=100\) and \(N_0=500\), the numerical method has not reached the asymptotic range yet for N, as the convergence rates are still changing. A convergence rate of 1 for the upwind method and 2 for the LW method are likely. We stopped the computations at this point and did not further investigate the convergence rates, as the computation times in combination with the size of the error had already reached an impractical size for our application. It should be noted that the error \(e_{\tilde{M}}\) is smaller for \(N_0=500\) throughout all methods and mesh sizes. This confirms the theory; the longer we use the actual ODE model for smaller polymers, the better is the approximation.

Fig. 8
figure 8

Example 2: convergence plots of error \(e_{\tilde{M}}\) (uniform mesh), \(\Delta t_{max}=10^{-3}\) and \(N_0=100\)

Fig. 9
figure 9

Example 2: convergence plots of error \(e_{\tilde{M}}\) (uniform mesh), \(\Delta t_{max}=10^{-3}\) and \(N_0=500\)

Fig. 10
figure 10

Example 2: convergence plots of error \(e_{\tilde{M}}\) (progressive mesh), \(\Delta t_{max}=10^{-3}\) and \(N_0=100\)

Fig. 11
figure 11

Example 2: convergence plots of error \(e_{\tilde{M}}\) (progressive mesh), \(\Delta t_{max}=10^{-3}\) and \(N_0=500\)

In case of the progressive mesh, the numerical scheme ceases to converge at a certain mesh size. To explain this, we first lowered the maximum time step size, to exclude that the error is caused by the temporal approximation. Having a smaller time step however gives an error in roughly the same range as before. We may conclude that the stagnating error is not caused by the temporal approximation. Recall that the PDE is only an approximation to the infinite ODE system, but the error \(e_{\tilde{M}}\) is computed with respect to the (numerical) ODE solution. Increasing \(N_0\) to 500 shows a smaller error and the stagnated error is smaller than in the case of \(N_0=100\). We thus conclude that we obtained a converged solution for the chosen \(N_0\) for which the error to the ODE model can only be diminished by choosing a larger \(N_0\) or a better continuous approximation to the ODE system (e.g., a second order PDE).

The goal of our study was to find an efficient scheme for the nucleation step in terms of accuracy and computation time. Fixing an acceptable computation time of 1.5 s, for example, and interpreting \(\tilde{M}\) as good approximation to the exact solution, we can make several conclusions from Tables 13 and 16. For \(N_0=100\) and for the allowed upper temporal bound, the Upwind method achieves a minimal error of \(4\cdot 10^{-3}\), while LW and VL fall below an error of \(3\cdot 10^{-4}\). The VL method performs best with an error of 0.02 % in 1.38s. A similar outcome is observed for \(N_0=500\) in Table 16. Again for a maximal computation time of 1.5 s, the VL method obtains the smallest error of 0.03 % in 1.45s (with q = 1/16), which is about 8x smaller than the corresponding Upwind error of 0.23 % in 1.34s (with q = 1/128).

Since no limiter functions have to be computed, the LW method is faster for roughly the same small error. However, due to possible oscillations, the VL method is preferable (Figs. 8, 9, 10, 11).

5 Conclusion

In this article we propose a method to deal numerically with both small sizes, predominant during early reaction phases for instance, and with very large aggregates. It is based on a mixed ODE–PDE approach, which keeps the original ODE system for small sizes and uses an approximate PDE, on a progressive grid, for larger sizes. The choice for the domain where we keep the ODE, i.e. the choice for \(N_0\), is guided by the order of magnitude of the error \(\varepsilon \) we want to achieve, with \(N_0 = O(1/\varepsilon ).\) Tested on simplified cases for which explicit solutions are available, the method proved to be accurate, especially when using a flux limiter method in combination with a progressive mesh.

For the PDE component, we used finite volume methods which were accurate for the simplified case we were investigating. The methods presented in this paper neglect the possibility of depolymerization. However, they could be applied equally, by defining the flux limiter method according to (LeVeque 2002, Chapter 9.5)

$$\begin{aligned} F_{i-1/2}=k_{on}^{i-1/2} Q_{i-1}+k_{dep}^{i-1/2} Q_i +\tilde{F}_{i-1/2} \end{aligned}$$
(53)

where \(\tilde{F}_{i-1/2}\) is defined in [LeVeque 2002, Chapter 9.3.1, (9.19)].

To adapt our ideas to more general equations or to capture long-time asymptotic behaviors, containing for instance fragmentation or coagulation terms, any other method could be used as soon as it is proved efficient to deal with the continuous equation considered on a non-uniform mesh. For instance, the very recent and accurate method developed by Goudon, Lagoutière and Tine in Goudon and Lagoutière (2012) for the Lifshitz–Slyozov equation, even if derived on uniform meshes, can be adapted on a non-uniform mesh, and others like (Filbet and Laurençot 2004b) are already written on non-uniform grids.