## Abstract

In this paper we introduce and discuss numerical schemes for the approximation of kinetic equations for flocking behavior with phase transitions that incorporate uncertain quantities. This class of schemes here considered make use of a Monte Carlo approach in the phase space coupled with a stochastic Galerkin expansion in the random space. The proposed methods naturally preserve the positivity of the statistical moments of the solution and are capable to achieve high accuracy in the random space. Several tests on a kinetic alignment model with self propulsion validate the proposed methods both in the homogeneous and inhomogeneous setting, shading light on the influence of uncertainties in phase transition phenomena driven by noise such as their smoothing and confidence band.

## Introduction

Uncertainty quantification (UQ) for partial differential equations describing real world phenomena gained in recent years lot of momentum in various communities. Without intending to review the very huge literature on this topic we mention [3, 18, 22, 34, 40, 44,45,46, 48, 49] and the references therein. One of the main advantages of this approach relies in its capability to provide a sound mathematical framework to reproduce realistic experiments through the introduction of the stochastic quantities, reflecting our incomplete information on some features on the systems’ modelling. This argument is especially true for the description of emergent social structures in interacting agents’ systems in socio-economic and life sciences. Common examples are the emergence of consensus phenomena in opinion dynamics, flocking and milling patterns in swarming of animals or humans and the formation of stable wealth distributions in economic systems, see [39]. It is worth observing how for these models we can have at most statistical information on initial conditions and on the modeling parameters, which are in practice substituted by empirical social forces embedding a huge variability, see for example [5].

From a mathematical viewpoint, the kinetic equations we are interested in are nonlinear Vlasov–Fokker–Planck equations depending on random inputs taking into account uncertainties in the interaction terms or in the boundary conditions. These equations arise in the description of collective phenomena modeling the evolution of a distribution function *f* = *f*(*𝜃*, *x*, *v*, *t*), *t* ≥ 0, \(x\in \mathbb {R}^{d_{x}}\), \(v\in \mathbb {R}^{d_{v}}\), *d*_{x}, *d*_{v} ≥ 1, and \(\theta \in I_{\theta }\subseteq \mathbb {R}\) a random field, according to

where \(\mathcal B[\cdot ]\) is a non-local operator of the form

being *P* ≥ 0 for all \(v,v_{\ast }\in \mathbb {R}^{d_{v}}\) and *D* = *D*(*𝜃*) ≥ 0 is an uncertain constant diffusion that depends on the introduced uncertainty.

As a follow-up question to the progress of the analytical understanding of real phenomena, the existence of phase transitions driven by noise represents a deeply fascinating issue, see [17, 19, 23, 25, 28, 29] and the references therein. The notion of phase transition has been fruitfully borrowed from thermodynamics to highlight the phase change of the system under specific stimuli. In particular, it is of interest the emergence of patterns in the collective dynamics for critical strengths of noise as in the classical Kuramoto model [8, 14, 37, 42] or in collective behavior [6, 28]. In the present paper we concentrate on a flocking model for interacting agents with self-propulsion and diffusion where the parameters are assumed to be stochastic. This model has been recently investigated in [1, 6, 7, 10] in absence of uncertainties. The introduction of uncertain quantities points in the direction of a more realistic description of the underlying processes and helps us to compute possible deviations from the prescribed deterministic behavior.

Suitable numerical methods that preserve the positivity of the distribution function are developed and are based on the so-called of Monte Carlo generalized polynomial chaos (MCgPC) methods. The introduced class of schemes is based on a Monte Carlo approach in the phase space that is coupled with stochastic Galerkin decomposition in the random space [34, 35, 39, 46]. This method has been recently proposed in [18] in the case of zero diffusion and it will be extended for models incorporating noise in the present setting. Furthermore, beside the natural positivity preservation, the resulting methods are spectrally accurate in the random space for sufficiently regular uncertainties. Furthermore, the adoption of a spectrally accurate methods in the random space is particularly efficient if compared with other non-intrusive approaches.

The rest of this paper has the following structure: in Section 2 we introduce in detail the class of kinetic flocking models of interest, the issue of phase transition will be treated with a particular focus on the relation between self-propulsion strength and noise intensity in the case they both depend on uncertain quantities. Section 3 focuses on the construction of Monte Carlo generalized polynomial chaos methods, a reduction in the computational complexity is here achieved through a Monte Carlo mean-field algorithm discussed in previous works. Finally, Section 4 is devoted to numerical test for the validation of the proposed schemes. Here continuous and Monte Carlo schemes will be compared to show the effectiveness of the MCgPC approach.

## Phase Transitions in Kinetic Flocking Models with Uncertainties

Kinetic models for aggregation-diffusion dynamics encountered extensive investigation in recent years [6, 7, 11, 13, 15, 16, 24, 26]. This class of models describes the aggregate behavior of large systems of self-propelled particles for which stable patterns emerge asymptotically. Nevertheless, at the present times, the study of the influence of ineradicable uncertainties in the modeling parameters is quite an unexplored area. We mention in this direction [3, 18, 30, 31, 44].

Let us consider first a kinetic flocking model for self-propelled particles with both state-independent interactions and uncertain diffusion given by (1) with the following choice

being *δ*(*x* − *x*_{∗}) the Dirac delta distribution centered in \(x_{\ast }\in \mathbb R^{d_{x}}\). The model of interest is now characterized by a localised Vlasov–Fokker–Planck equation with random inputs for the dynamics of *f* = *f*(*𝜃*, *x*, *v*, *t*) and having the following form

where *α*(*𝜃*) ≥ 0, *D*(*𝜃*) ≥ 0 are respectively self-propulsion strength and intensity of the diffusion operator, and where *u*_{f} is the momentum of the system which is not conserved in time due to the presence of the self-propulsion term

It seems worth stressing that, in the present setting, the role of the additive diffusion operator Δ_{v}*f* in (1), representing the impact of unpredictable events, is strongly different from that of the uncertainties introduced in the definition of the model parameters. The velocity diffusion term is, in fact, representative of all the possible modifications of the dynamics not modeled in a structural way, whereas *𝜃* ∈ *I*_{𝜃} summarizes all source of modifications in the *prescribed dynamics*. We point the reader to [44] for a more focussed discussion in a related setting.

In the following we will treat separately the case space-homogeneous case and then we will provide some insights on the non-localised inhomogeneous setting.

### Space Homogeneous Problem

In [6] the authors investigated the space homogeneous version of (3) in the deterministic setting. It has been proven that a phase transition between the so-called polarized and unpolarized motion takes place as the noise intensity *D* increases and for a specific range of the values of the self-propulsion strength *α*. At a difference with the cited results, the present formulation of the model embeds from the very beginning the presence of uncertain quantities.

Let us consider for simplicity the case of unitary mass, so that *f* is a probability density for all times *t* ≥ 0. First, we observe that (3) can be rewritten as a gradient flow. In fact, if we define

with *U*(*v*) a interaction potential, given by \(U(v)=\frac {|v|^{2}}{2}\), and Φ(*v*) a confining potential of the form

the equation reads

A free energy functional which dissipates along solution is defined for all *𝜃* ∈ *I*_{𝜃} as follows

with

Stationary solutions of the space–homogeneous problem satisfy the identity ∇_{v}*ξ*(*𝜃*, *t*) = 0 for all *𝜃* ∈ *I*_{𝜃} and have the form

being *C* > 0 a normalization factor. It is possible to prove the following result, see [6, Theorem 2.1].

###
**Theorem 1**

*The space–homogeneous nonlinear Fokker–Planck equation*

*exhibits a phase transition in the following sense*:

*For small enough diffusion*\(D(\theta )\rightarrow 0\)*for all 𝜃*∈*I*_{𝜃}*there is a function u*=*u*(*D*(*𝜃*))*with*\(\lim _{D\rightarrow 0}u(D(\theta )) = 1\),*such that*\(f^{\infty }(\theta ,v)\)*with*\(u=(u(D(\theta )),0,\dots ,0)\)*is a stationary solution of the original problem*.*For large enough diffusion coefficient D**the only stationary solution is the symmetric distribution given by*(4)*with u*_{f}≡ 0.

This behavior is reminiscent of the one observed for the Vicsek model [6, 23], where agents move with a constant speed and interact with their neighbors via a local alignment force and are subject to noise action. In particular, a critical noise intensity has been discovered whose value determines a phase transition between the ordered states and a chaotic state characterized by a null asymptotic average velocity of the system of agents. The critical noise value is theoretically demonstrated in [23] for the Vicsek model while for the present model there is a strong numerical evidence for its existence [6].

### Space Inhomogeneous Case

In the non-localized inhomogeneous setting sharp results on analogous phase transitions are still non present in the literature due to the additional difficulties of the models. In the zero diffusion limit and without self-propulsion forces, small variations of the arguments in [15] prove that for a Cucker–Smale type interaction

unconditional alignment, i.e., convergence to a profile travelling with the same mean velocity, emerges in the case *γ* ≤ 1/2 without conditions on the initial configuration of the system or on its dimensionality both at the kinetic and particle level [15, 20]. In this case the asymptotic distribution is a Dirac delta in the velocity space, meaning that for large times the agents share the same velocity and that they form a group with frozen mutual distances. At the particle level, the case *γ* > 1/2 leads to a conditional flocking, i.e., alignment emerges for provable initial configurations of the system [20]. Initial density conditions to achieve asymptotic alignment for *γ* > 1/2 are still not proven, in general we may expect flocking for high mean-density distributions [16].

In the following we will present a numerical insight for the case of a VFP model with Cucker–Smale type interaction forces (5) in dimension *d*_{x} = 1 and *d*_{v} = 1, self-propulsion forces and uncertain diffusion coefficient. In particular, numerical results obtained with accurate numerical schemes highlight that a phase transition can occur also in this regime, shedding light on the deep interplay between alignment forces and noise strength in more general settings with not localized alignment [20, 38].

## Stochastic Galerkin Methods for Kinetic Equations

We introduce Stochastic Galerkin (SG) numerical methods with applications to the nonlinear Vlasov–Fokker–Planck (VFP) equation (1). We discuss the class of stochastic Galerkin (SG) methods and, in particular, we concentrate on the generalized Polynomial Chaos (gPC) decomposition [22, 46, 47, 49]. These methods gained increased popularity in recent years since they guarantees spectral accuracy in the random space under suitable regularity conditions.

In our schemes, we exploit Monte Carlo methods for the approximation of the numerical solution of the (VFP) in the phase space taking advantage of particle based reformulation of the problem that converges in distribution to the solution for an increasing number of agents. The core idea then is to apply SG-gPC techniques for the efficient approximation of the random field in the resulting MC approximation. We highlight that the combination of the two approaches leads to a positive approximation of statistical moments of the solution even in the nonlinear case.

In the following we will derive a SG-gPC scheme for the continuous problem and we will consider specific formulation for the so-called Monte Carlo gPC methods (MCgPC), see [18].

### Preliminaries on SG-gPC Expansion

In this section we derive a SG-gPC approximation for the uncertain nonlinear VFP equation (1) with nonlocal drift \(\mathcal B[\cdot ]\) having the structure (2). Let (Ω, *F*, *P*) be a probability space where as usual Ω is the sample space, *F* is a *σ*-algebra and *P* a probability measure, and let us define the random variable

with \(I_{\theta }\subseteq \mathbb {R}\) and \({\mathscr{B}}_{I_{\theta }}\) the Borel set, and with known probability density function \({\Psi }(\theta ):I_{\theta }\rightarrow \mathbb {R}^{+}\). Hence, we consider the linear space \(\mathbb {P}_{M}\) of polynomials of degree up to *M*, which is generated by a family of orthonormal polynomials \(\{{\Phi }_{h}(\theta )\}_{h=0}^{M}\) such that

being *δ*_{hk} the Kronecker delta function. Assuming that Ψ(*𝜃*) has finite second order moment, we can approximate the distribution \(f \in L^{2}({\Omega },\mathcal F,P)\) in terms of the following chaos expansion

being \(\hat f_{h}(x,v,t) = \mathbb E[f(\theta ,x,v,t){\Phi }_{h}(\theta )]\) for all \(h=0,\dots ,M\). The SG-gPC formulation for the approximated distribution *f*^{M} = *f*^{M}(*𝜃*, *x*, *v*, *t*) solution of (1) is then

Thanks to the orthogonality of the polynomial basis of \(\mathbb {P}_{M}\) we obtain a coupled system of *M* + 1 purely deterministic PDEs for the evolution of each projection \(\hat f_{h}(x,v,t)\), \(h = 0,\dots ,M\) that reads

having defined the following matrices for \(h,k = 0,\dots ,M\)

The statistical quantities of interest may be defined in terms of the coefficients of the expansion. In particular, we have

We introduce the vector \(\hat {\textbf {f}} = (\hat f_{0},\dots ,\hat f_{M})\) and the (*M* + 1) × (*M* + 1) matrices \(\textbf {S} = \{S_{hk}\}_{h,k=0}^{M}\), \(\textbf {P}[\hat {\textbf {f}}]=\{P_{hk}\}_{h,k=0}^{M}\), \(\textbf {D} = \{D_{hk}\}_{h,k=0}^{M}\), whose components are given by (7–9). We can reformulate (6) in more compact form as follows

In the following, we indicate with \(\|\hat {\textbf {f}}\|_{L^{2}}\) the standard *L*^{2} norm of the vector \(\hat {\textbf {f}}(x,v,t)\)

We can easily observe that, since the norm of *f*^{M}(*𝜃*, *x*, *v*, *t*) in *L*^{2}(Ω) is

thanks to the orthonormality of the basis \(\{{\Phi }_{k}\}_{k=0}^{M}\) in *L*^{2}(Ω), it follows that

We can prove the following stability result. For notation simplicity we consider the case *d*_{x} = *d*_{v} = 1.

###
**Theorem 2**

*Assume that there exists*\(C_{\mathcal B},C_{D}>0\)*such that*\(\|\partial _{v}(S_{hk}+P_{hk})\|_{L^{\infty }}\le C_{\mathcal B}\)*and D*_{hk} ≤ *C*_{D}*for all*\(h,k=0,\dots ,M\), *then*

###
*Proof*

We multiply (6) by \(\hat f_{h}\) and integrate over \(\mathbb {R}^{2}\) to obtain

After integration by parts the transport term vanishes and the right hand term reads

and thanks to the symmetry of **S** and **P** we have

Since \(\|\partial _{v} (S_{hk}+P_{hk})\|_{L^{\infty }}\le C_{\mathcal B}\) we have

and from Cauchy–Schwarz we have

Furthermore, since *D*_{hk} ≤ *C*_{D} we have

and we obtain

and thanks to Gronwall’s Lemma, we conclude. □

We highlight how, as for classical spectral methods, the introduced SG decomposition leads to the loss of important physical properties of the solution like the positivity. A positivity preserving scheme is instead obtained if the matrix \(\textbf {S} + \textbf {P} = \{S_{hk}+ P_{hk}\}_{h,k=0}^{M}\) and the matrix \(\textbf {D} = \{D_{hk}\}_{h,k=0}^{M}\) are diagonal. This case corresponds to the situation where no uncertainties are present in self-propelling and diffusion terms and in case of interaction with a background distribution that does not encode any uncertainty. Under the introduced assumptions and with uncertain initial distribution of agents *f*(*𝜃*, *x*, *v*,0) = *f*_{0}(*𝜃*, *x*, *v*) the SG-gPC decomposition of the original problem reads for all \(h=0,\dots ,M\)

Therefore, we have to solve a set of *M* + 1 decoupled VFP equations. In this case we can apply structure preserving type schemes to ensure the positivity of the statistical moments, accurate description of the large time behavior of each projection and entropy dissipation, see [4, 13, 40, 41, 50].

To tackle efficiently the general fully nonlinear case in the following we will introduce a novel scheme that exploits the spectral convergence in the random space of SG-gCP methods and that naturally preserves the positivity of the numerical distribution.

### Particle Based SG-gPC Formulation of Kinetic Equations

As for classical spectral methods, the solution of the coupled SG system (6) for *f*^{M} looses its positivity and then a clear physical meaning. In order to overcome the difficulty recently the so-called Monte Carlo gPC (MCgPC) scheme has been proposed. These methods combine the advantages of a Monte Carlo approach for the approximation of *f* in the phase space and they conserve spectral accuracy in the random space. We refer to [18] for the study a wide range of mean-field equations describing the emergence of patterns and ordered behavior in large interacting systems in the zero diffusion limit.

The Monte Carlo (MC) method is a probabilistic particle method that describe the evolution of density functions by resorting to the computation of interactions in a finite set of randomly chosen particles of which it is known a priori the dynamics, see [21, 39]. In MC methods the updated distribution function in the phase space is typically reconstructed from particles as post-processing. Several approaches are possible for the reconstruction step, which can estimated through a histogram, weighted integration rule methods or by a convolution of the empirical particle distribution with a suitable mollifier, see [33]. All the mentioned approximations preserve the positivity of the obtained numerical distribution function. Concerning the order of accuracy for MC methods, we have a convergence rate of the order \(\mathcal O(\frac {1}{\sqrt {N}})\) where *N* is the number of considered samples, see [12].

Therefore, in order to set-up a MC scheme for the general equation (1) we need to find a system of stochastic differential equations which converge in distribution to the correct solution of the problem. This problem has been tackled in a more general setting in [9] and (1) can be derived from the following second order system of SDEs for \((x_{i}(\theta ,t),v_{i}(\theta ,t))\in \mathbb {R}^{d_{x}}\times \mathbb {R}^{d_{v}}\), \(i=1,\dots ,N\), with random inputs

with initial positions and velocities (*x*_{i}(*𝜃*,0), *v*_{i}(*𝜃*,0)). In (10) we denoted by \(\{W_{i}\}_{i=1}^{N}\) a vector of *N* independent Wiener processes and independent with the random variable *𝜃*. Notice that the random variable *𝜃* plays the role of a parameter, thus for each sampling from the distribution Ψ(*𝜃*), we can apply the mean-field results developed in [9] to conclude that (3) is the mean field limit of (10).

It is worth to remark that in the case of vanishing self-propulsion, i.e., *α*(*𝜃*) ≡ 0, and for symmetric interactions, i.e., *P*(*𝜃*, *x*_{i}, *x*_{j}) = *P*(*𝜃*, *x*_{j}, *x*_{i}), the above system of SDEs preserves the initial mean velocity of the system in the limit \(N\rightarrow +\infty \). Indeed we have

to conclude due to a law of large numbers argument. In general, the mean velocity is not conserved due to the presence of the self-propulsion forces and appropriate methods must be developed to catch the correct transient regimes.

In the following we summarize the assumptions to ensure the mean-field convergence. Let us introduce the empirical measure associated to the particle system (10) weighted by the distribution of the uncertainty Ψ(*𝜃*), i.e.,

The transition to chaos for the particle system (10) follows from a small variation of [9, Theorem 1.1] under non restrictive assumptions on the a kernel *K*(*x*_{i} − *x*_{j}, *v*_{i} − *v*_{j}) = −*P*(*𝜃*,|*x*_{i} − *x*_{j}|)(*v*_{i} − *v*_{j}) and the drift *S*(*𝜃*, *v*_{i}). The proof is based on the following argument: the *N* interacting process \((x_{i}(\theta ,t),v_{i}(\theta ,t))_{i=1}^{N}\) behaves in the limit \(N\rightarrow +\infty \) like the process defined by the set \((\bar {x}_{i}(\theta ,t),\bar {v}_{i}(\theta ,t))_{i=1}^{N}\) solution of the McKean–Vlasov equations

where *f* is the probability law of \((\theta ,\bar {x}_{i}(\theta ,t),\bar {v}_{i}(\theta ,t))\) and \(\{W_{i}\}_{i=1}^{N}\) are the Wiener processes characterizing (10). The processes are identically distributed and independent from the random variable *𝜃*, and by the Itô formula their law *f* evolves according a VFP equation of type (1). We summarize this in the following result representing a direct extension of Theorem 1.1 in [9] that holds for all *𝜃* ∈ *I*_{𝜃}.

###
**Theorem 3**

([9, *Theorem 1.1]) Let f*_{0}(*𝜃*, *x*, *v*) *be a Borel probability measure and let* (*x*_{i}(*𝜃*,0), *v*_{i}(*𝜃*,0)) *for all*\(i=1,\dots ,N\)*be N**independent variables for all 𝜃* ∈ *I*_{𝜃}. *We assume that the drift and the antisymmetric kernel satisfy that there exist constants**A*, *L*, *p* > 0 *such that*

*for all*\(x,y\in \mathbb {R}^{d_{x}}\), \(v,w\in \mathbb R^{d_{v}}\). *If the particle system* (10) *and the processes* (11) *have global solutions on the finite time interval* [0, *T*] *with initial data* (*x*_{i}(*𝜃*,0), *v*_{i}(*𝜃*,0)) *such that*

*with*\(f(\theta ,\cdot ,\cdot ) = \text {law}(\bar x_{i},\bar v_{i})\)*for 𝜃* ∈ *I*_{𝜃}, *then there exists a constant**C* > 0 *such that*

*If there exists*\(p^{\prime }>p\)*such that*

*then for all* 0 < *𝜖* < 1 *there exists a constant C* > 0 *such that*

*for all 0 ≤ t* ≤ *T**and N* ≥ 1.

We have denoted with \(\mathbb E_{\theta ,W}[\cdot ]\) the expectation taken with respect to the distribution of the Wiener processes and the random variable *𝜃*. We highlight how the provided bounds hold for all *𝜃* ∈ *I*_{𝜃} and in particular we take expectation with respect to the introduced stochastic parameter. It is easily verified that for the introduced self-propulsion force and the kernels of interest the assumptions are met. Therefore the mentioned theorem gives the following quantitative result on the convergence of the empirical measure *f*^{(N)} to the distribution *f*: let *φ* a Lipschitz map on \(\mathbb {R}^{d_{x}}\times \mathbb {R}^{d_{v}}\) then

where \(\varepsilon (N) \rightarrow 0\) for \(N\rightarrow + \infty \) with a rate *ε*(*N*) defined in (12)–(13) depending on the assumptions on the solutions in Theorem 3 and the law of large numbers to deal with the last term. These arguments are standard in interacting particle systems and analogous to [9] and the references therein.

In the next section we derive a SG-gPC decomposition of (10) so that we will preserve the exponential convergence in the random space with respect to all the uncertain quantities.

#### Stochastic Galerkin Scheme for the Particle System

In the following we consider the gPC decomposition of the microscopic dynamics (10). Space and velocity variables of the *i* th agent, for all \(i=1,\dots ,N\), are approximated by \(({x_{i}^{M}},{v_{i}^{M}})\) where

being as before \(\{{\Phi }_{k}(\theta )\}_{k=0}^{M}\) an orthonormal basis of *L*^{2}(Ω).

Next we give explicit representation of the SG-gPC expansion at the particle level. To obtain the SG-gPC decomposition for the particle system we rewrite (10) in terms of \({x_{i}^{M}}\), \({v_{i}^{M}}\) for all \(i=1,\dots ,N\), whose projection in the linear spaces of degree \(h=0,\dots ,M\) reads

and again thanks to the orthogonality of the polynomial basis we obtain for all \(i=1,\dots ,N\) the following coupled system of SDEs describing the evolution of each component of the original variables in the phase space

where

and

It is worth to remark that in the case of vanishing self-propulsion \(s_{hk}({v_{i}^{M}}) = 0\) for all \(h,k=0,\dots ,M\) and for symmetric interactions \(p_{hk}^{ij} = p_{hk}^{ji}\) we recover the conservation of the mean velocity of the system also in the SG decomposition.

The convergence of the SG-gPC expansion (6) for sufficiently regular function follows from standard results in polynomial approximation theory, we recall for example [27]. In general, thanks to the property of the introduced polynomial basis we have

###
**Theorem 4**

*We consider 𝜃* ∈ *I*_{𝜃}*with distribution* Ψ(*𝜃*) *and the basis*\(\{{\Phi }_{h}\}_{h=0}^{M}\)*of orthonormal polynomial basis in L*^{2}(Ω). *Then, for any g*(*𝜃*, *t*) ∈ *L*^{2}(Ω)

*where*\(g^{M} = {\sum }_{k=0}^{M} \left ({\int \limits }_{I_{\theta }} g(\theta ,t) {\Phi }_{k}(\theta )d{\Psi }(\theta )\right ){\Phi }_{k}(\theta )\).

In the present setting, thanks to Theorem 4 it is reasonable to expect the convergence of the empirical measure

to the empirical measure *f*^{(N)} as \(M\rightarrow \infty \) for all *t* ≥ 0 and for \(({x_{i}^{M}},{v_{i}^{M}})\) solution to (15). Hence, from the mean-field convergence showed in Theorem 3 we would guarantee that *f*^{(N, M)} converges to *f*(*𝜃*, *x*, *v*, *t*) solution of the initial VFP problem by taking first the limit of the Galerkin modes \(M\to \infty \) and then the limit of large number of particles \(N\to \infty \). We can prove the following result following the footprint of (14) and Theorem 4 applied to *x*_{i}(*𝜃*, *t*) and *v*_{i}(*𝜃*, *t*).

###
**Theorem 5**

*Let us define the following empirical measure*

*Hence, provided that*\({x_{i}^{M}}(\theta ,t) \in L^{2}({\Omega })\), \({v_{i}^{M}}(\theta ,t) \in L^{2}({\Omega })\)*we have*

in \(P(P({\Omega }\times \mathbb {R}^{d_{x}}\times \mathbb {R}^{d_{v}}))\).

###
*Proof*

To prove the convergence in \(P(P({\Omega }\times \mathbb {R}^{d_{x}}\times \mathbb {R}^{d_{v}}))\) we consider a sufficiently regular test function in all variables (*𝜃*, *x*, *v*), that we can assume of the form *φ*_{1}(*𝜃*)*φ*_{2}(*x*, *v*) without loss of generality, and we compute

providing the convergence result for \(M\rightarrow +\infty \). □

In the last section we will give numerical evidence of this result.

#### Monte Carlo gPC Scheme

We now approximate the limiting stochastic kinetic equation taking advantage of the particle reformulation of the problem. In fact, since the solution of the system of SDEs (10) converges in distribution to the solution of the original problem (1) for \(N\rightarrow +\infty \), we can approximate the original dynamics by means of a Monte Carlo (MC) method in the phase space. The main drawback of this approach lies in the computational cost \(\mathcal {O}(M^{2}N^{2})\), since at each time step and for each gPC projection each agent modifies its velocity in a genuine nonlinear way.

A significant reduction in terms of computational cost can be achieved through a mean field MC evaluation of the interaction dynamics as originally proposed in [2], see [18] for the UQ framework. Thanks to this approach we have an efficient algorithm for transport and interaction in the phase space and we can reconstruct the expected solution from the particle system from positions and velocities at the microscopic level, which is considered in the SG-gPC setting as in Section 3.2.1. This approach has been recently analysed in connection to other problems in [36].

We sketch in Fig. 1 the two approaches for the approximation of statistical quantities of the nonlinear nonlocal stochastic VFP problems of interest. In the left branch we find the standard SG approach where first we consider the gPC approximation of the original problem, which generates a coupled system of PDEs that can be solved through deterministic methods to obtain the evolution of expected quantities. On the right branch we describe the introduced MCgPC procedure, based on a particle reformulation of the problem which converges in distribution in the phase space to the solution of the problem. The advantage of considering a gPC scheme for the microscopic system lies in the preservation of the typical spectral convergence in the random space of the method. We highlight how thanks to the adoption of the computational strategy in Algorithm 1 the overall cost becomes \(\mathcal O(M^{2}SN)\), *S* ≪ *N*.

For the reconstruction of expected quantities, in the present manuscript we consider the histogram of position and velocity of the set of particles in the phase space, we point the reader to [33] for possible alternatives. Thanks to the MC approach the resulting method preserves the positivity of the expected distribution function.

###
*Remark 1*

In the case *S* = *N* we obtain the typical convergence rate of order \(\mathcal O(1/\sqrt {N})\) of Monte Carlo in the phase space, where *N* is the number of particles and spectral convergence in *M* in the random space. Due to the presence of the fast evaluation of interactions, the case *S* < *N* induces an additional error of order \(\mathcal {O}(\sqrt {1/S-1/N})\) in the microscopic dynamics. Let *f*^{(S, M)}(*𝜃*, *x*, *v*, *t*) the empirical distribution density estimated at time *t* > 0 from Algorithm 1 and let \(J = \{j_{1},\dots ,j_{S}\}\), |*J*| = *S*, be the vector of indexes sampled uniformly without repetition in \(\{1,\dots ,N\}\). Then for any test function *φ* we have

whose leading error is given by *I*_{1} since *S* ≪ *N* and, for *N* ≫ 0, we may observe that the accuracy with which we approximate *f*^{(N, M)} with *f*^{(S, M)} is \(\mathcal O\left (\sqrt {\frac {1}{S}-\frac {1}{N} } \right )\) thanks to a central limit theorem-type argument.

## Numerical Tests

In this section we present several numerical examples based on (3) both in the homogeneous and inhomogeneous cases. We test the effectiveness of the MC-gPC scheme through several tests based on VFP equations. In all test the integration of the system of stochastic differential equations (10) is performed through a standard Euler–Maruyama method whereas the solution of the system of PDEs derived from the SG procedure is solved through a standard central scheme coupled with a fourth order Runge–Kutta integration. In the whole section we will consider a uniform noise, therefore Gauss–Legendre polynomial basis are chosen in the gPC setting. Numerical investigations on the influence of uncertainties in phase transition phenomena are presented through the section. Finally, we explore the non localized inhomogeneous model with Cucker–Smale type interactions.

### Test 1: Space Homogeneous Case

In this first test we consider the space homogeneous problem in 1D with uncertain diffusion parameter of the form

where \(\theta \sim \mathcal {U}([-1,1])\) and *λ* ≤ 1 is such that *D*(*𝜃*) ≥ 0 for all \(\bar D\ge 0\). We consider a constant self propelling strength *α*(*𝜃*) = *α* ≥ 0.

The evolution of the density function *f*(*𝜃*, *v*, *t*), \(v\in \mathbb {R}\) is ruled by the following PDE

whose SG-gPC approximation is given for all \(h = 0,\dots ,M\) by

being

At the particle level we obtain from (15) the following coupled system of SDEs for the evolution of the particles’ velocities

being

and \(\{W_{i}\}_{i=1}^{N}\) defines a set of *N* independent Wiener processes. Furthermore, we indicated with \(\hat u_{h}\) the *h* th projection of the average velocity of the system.

The long time solution is given by (4) as discussed in Section 2.1. We consider as deterministic initial condition the Gaussian distribution

At the particle level the initial velocities are a sample of *N* ≫ 0 velocities from the distribution *f*_{0}(*v*). In Fig. 2 we compare the numerical expected distribution of the SG-gPC system (17) and the reconstructed expected density of the MCgPC scheme at time *T* = 50 for two uncertain diffusion coefficients (16) with \(\bar D=0.2\), \(\bar D = 0.8\) and *λ* = 0.1 in both cases. It is easily observed how for an increasing number of particles the statistical quantities are well approximated by the scheme.

In Fig. 3 we study the convergence of the temperature of the system

in *L*^{2}(Ω) obtained through the MCgPC algorithm for an increasing order of the gPC expansion. We considered *N* = 10^{4} particles and two uncertain diffusion parameters of the form (16) with \(\bar D= 0.2\) and \(\bar D= 0.8\), *λ* = 0.1 and \(\theta \sim \mathcal U([-1,1])\). Time integration has been performed up to time *T* = 50 with time step Δ*t* = 10^{− 2}.

To complete the overview of the one dimensional setting we computed in Fig. 4 the large time behavior of the expected average velocity \(\mathbb E[u_{f}(\theta ,T)]\) for several \(\bar D = \frac {\kappa }{10}\), \(\kappa = 0,\dots ,10\) with constant self-propulsion term *α* = 1. We considered an uncertain diffusion of the form (16) with *λ* = 10^{− 1} (top row) and *λ* = 10^{− 3} (bottom row). In each figure we marked in dashed red the confidence band computed in terms of the approximated standard deviation \(\sqrt {\text {Var}(u_{f})}\).

We can easily observe the regions of maximal sensitivity with respect to the presence of uncertainties. In particular, for high diffusion values the variability of the expected average velocity vanishes and we may argue that the phase transition predicted in [6] is actually a quite stable pattern in the space homogeneous regime. Nevertheless, the averaging of uncertain quantities acts as a smoothing factor of the phase transition as we can clearly observe in Fig. 4b and d. For a vanishing influence of *𝜃* ∈ *I*_{𝜃} given by \(\lambda \rightarrow 0\) in (16) the transition becomes sharper coherently with the deterministic case, see Fig. 4d. Summarizing the main effect of the uncertainties is the smoothing of the transition point making it less sharper and abrupt than in the deterministic cases.

### Test 2. Space Inhomogeneous Case

In this section we focus on inhomogeneous models. First we consider the localised case for which a phase transition is expected to happen similarly to the homogeneous case, see [6], even if this has not yet been proved. To explore other possible alternatives we will also consider the case of Cucker–Smale type interactions for which no analogous theoretical results regarding phase transitions currently exist. In all the tests of the present section we consider a sample of *N* = 10^{5} particles for the MCgPC scheme.

#### Test 2A. Localized Interaction Case

We consider a space dependent interaction function of Dirac delta form, i.e., *P*(*x*, *x*_{∗}) = *δ*(*x* − *x*_{∗}). With this choice agents interact only if they share the same position. In this case, the MCgPC scheme translates in a second order system of SDEs of the form

where *s*_{hk} has the same definition of the space homogeneous case. As before we consider an uncertain diffusion parameter *D*(*𝜃*) and a constant self-propulsion *α* = 1.

We introduce a discretization of the phase space \(\{x_{i}\}_{i=1}^{N_{x}}\), \(\{v_{i}\}_{i=1}^{N_{v}}\) such that *x*_{i+ 1} − *x*_{i} = Δ*x*, *v*_{i+ 1} − *v*_{i} = Δ*v* made by *N*_{x} = 20 gridpoints for the space variable and by *N*_{v} = 40 points for the velocity variable. At time *t* = 0 we consider the following multivariate Gaussian distribution

we considered *μ*_{x} = 0, *μ*_{v} = 1, \(\sigma _{v} = \frac {1}{10}\), \(\sigma _{x} = \frac {1}{100}\). Let us consider the evolution of the gPC system of PDEs derived in (6) with localized interactions in (8). At the numerical level we perform a second order Strang splitting approach. The transport step is integrated through a third order Runge–Kutta scheme with a fifth order WENO reconstruction [43]. In the following we compare the behavior of the continuous approximation with the one obtained through the MCgPC scheme where, to localize the interaction, we considered as a smoothing factor the indicator function of the numerical cell [*x*_{i}, *x*_{i+ 1}].

In Figs. 5 and 6 we compare the evolution of the expected density over the time interval [0,5] for the inhomogeneous kinetic equation (1) with local interactions. In particular, we present the expected density obtained through numerical integration of the SG-gPC system of PDEs with the one approximated through the MCgPC scheme with fast evaluation of the interaction term through a mean-field MC approach described in Algorithm 1 and interaction subset of *S* = 10 particles. The uncertain diffusion has the form (16) with \(\bar D = 0.2\), \(\bar D = 0.8\) and *λ* = 0.1. Periodic boundary conditions have been considered. The results are in agreement with the space homogeneous case since the interaction are localised. It is easily observed how a phase transition occurs switching from an ordered state to a chaotic isotropic state for increasing values of the diffusion. In Fig. 7 the average in position distributions in velocity are compared between the MCgPC and gPC. These results corroborate the appearance of a smoothed phase transition: a shifted distribution with positive average velocity for small values of the average diffusion is observed while for larger diffusion the distribution becomes almost symmetric.

#### Test 2B. Cucker–Smale Type Interactions

In this section we consider the evolution of statistical quantities obtained from (1) with space dependent interaction kernel of the Cucker–Smale (CS) type

This choice of interaction has been introduced in [20] and received a lot of attention in the recent literature on kinetic models for emergent behavior. Without intending to review the huge related literature we mention [15, 16, 32] for an introduction on the topic. Recent efforts on CS dynamics in the UQ setting are [3, 34]. As we already mentioned, at the present times there are no analytical results regarding possible phase transitions for this highly nonlinear kernel in the VFP setting. The determination of sharp estimates on the possible phase transitions is an open problem which goes beyond the purpose of the present manuscript. Hence, to complete the overview on the introduced methods we give a numerical insight on the features of the resulting dynamics.

In order to observe the action of uncertainty in the system we consider a stochastic diffusion parameter \(D(\theta ) = \bar D + \lambda \bar D\theta \), with *λ* = 10^{− 1} and \(\theta \sim \mathcal {U}([-1,1])\) in the cases \(\bar D = 0.2\) and \(\bar D= 0.8\). In Figs. 8 and 9 we report the expected dynamics of the VFP model (1) with CS interactions and stochastic diffusion obtained through the MCgPC scheme. Periodic boundary conditions have been taken into account. In particular, a sample of *N* = 10^{5} particles is considered for the reconstruction of the expected density in the interval [− 2,2] × [− 3,3] with *N*_{x} = 20, *N*_{v} = 40 gridpoints. In the random space we considered *M* = 3 modes for the gPC expansion. We can observe how the expected density moves from an ordered state for small values of diffusion to a chaotic isotropic for sufficiently big values of diffusion. We postpone to later works a more detailed insight on these phenomena for general interaction kernels.

## Conclusion

The introduction of uncertainties in swarming dynamics is of paramount importance for the large-scale description of realistic phenomena. We concentrated in this manuscript on the case of Vlasov–Fokker–Planck equations for emerging collective behavior with phase transitions depending on the strength of self-propelling and noise terms. We extended to these models the construction of nonnegative gPC schemes for kinetic-type equations. The proposed approach takes advantage of a Monte Carlo approximation of the kinetic equation in phase space which is coupled with a stochastic Galerkin gPC expansion. Several numerical tests were proposed both in the homogeneous and inhomogeneous settings, proving the effectiveness of the approach and shedding light on the action of uncertainties in terms of the stability of the phase transitions, We generically observe that they lead to a smoothing of the sharp transition values. Several extensions of the present work are possible from both the analytical and numerical viewpoints and in connection with more general kernels in the collision/interaction dynamics.

## References

Aceves-Sánchez, P., Bostan, M., Carrillo, J.A., Degond, P.: Hydrodynamic limits for kinetic flocking models of Cucker–Smale type. Math. Bio. Eng.

**16**, 7883–7910 (2019)Albi, G., Pareschi, L.: Binary interaction algorithms for the simulation of flocking and swarming dynamics. Multiscale Model. Simul.

**11**, 1–29 (2013)Albi, G., Pareschi, L., Zanella, M.: Uncertainty quantification in control problems for flocking models. Math. Probl. Eng.

**2015**, 850124 (2015). 14 pagesBailo, R., Carrillo, J.A., Hu, J.: Fully discrete positivity-preserving and energy-dissipative schemes for nonlinear nonlocal equations with a gradient flow structure. arXiv:1811.11502 (2018)

Ballerini, M., Cabibbo, N., Candelier, R., Cavagna, A., Cisbani, E., Giardina, I., Orlandi, A., Parisi, G., Procaccini, A., Viale, M., Zdravkovic, V.: Empirical investigation of starling flocks: a benchmark study in collective animal behavior. Anim. Behav.

**76**, 201–215 (2008)Barbaro, A.B.T., Cañizo, J. A., Carrillo, J.A., Degond, P.: Phase transitions in a kinetic flocking model of Cucker–Smale type. Multiscale Model. Simul.

**14**, 1063–1088 (2016)Barbaro, A.B.T., Degond, P.: Phase transition and diffusion among socially interacting self-propelled agents. Discrete Contin. Dyn. Syst. B

**19**, 1249–1278 (2014)Bertini, L., Giacomin, G., Pakdaman, K.: Dynamical aspects of mean field plane rotators and the Kuramoto model. J. Stat. Phys.

**138**, 270–290 (2010)Bolley, F., Cañizo, J.A., Carrillo, J.A.: Stochastic mean-field limit: non-Lipschitz forces and swarming. Math. Models Methods Appl. Sci.

**21**, 2179–2210 (2011)Bostan, M., Carrillo, J.-A.: Reduced fluid models for self-propelled particles interacting through alignment. Math. Models Methods Appl. Sci.

**27**, 1255–1299 (2017)Burger, M., Capasso, V., Morale, D.: On an aggregation model with long and short range interactions. Nonlinear Anal. Real World Appl.

**8**, 939–958 (2007)Caflisch, R.E.: Monte Carlo and quasi-Monte Carlo methods. Acta Numer.

**7**, 1–49 (1998)Carrillo, J.A., Chertock, A., Huang, Y.: A finite-volume method for nonlinear nonlocal equations with a gradient flow structure. Commun. Comput. Phys.

**17**, 233–258 (2015)Carrillo, J.A., Choi, Y.-P., Pareschi, L.: Structure preserving schemes for the continuum Kuramoto model: Phase transitions. J. Comput. Phys.

**376**, 365–389 (2019)Carrillo, J.A., Fornasier, M., Rosado, J., Toscani, G.: Asymptotic flocking dynamics for the kinetic Cucker–Smale model. SIAM. J. Math. Anal.

**42**, 218–236 (2010)Carrillo, J.A., Fornasier, M., Toscani, G., Vecil, F.: Particle, kinetic, and hydrodynamic models of swarming. In: Naldi, G., Pareschi, L., Toscani, G (eds.) Mathematical Modeling of Collective Behavior in Socio-Economic and Life Sciences. Modeling and Simulation in Science, Engineering and Technology, pp 297–336. Birkhäuser, Boston (2010)

Carrillo, J.A., Gvalani, R.S., Pavliotis, G.A., Schlichting, A.: Long-time behaviour and phase transitions for the McKean–Vlasov equation on the torus. Arch. Rat. Mech. Anal. (to appear)

Carrillo, J.A., Pareschi, L., Zanella, M.: Particle based gPC methods for mean-field models of swarming with uncertainty. Commun. Comput. Phys.

**25**, 508–531 (2019)Chayes, L., Panferov, V.: The McKean–Vlasov equation in finite volume. J. Stat. Phys.

**138**, 351–380 (2010)Cucker, F., Smale, S.: Emergent behavior in flocks. IEEE Trans. Autom. Control

**52**, 852–862 (2007)Dimarco, G., Pareschi, L.: Numerical methods for kinetic equations. Acta Numer.

**23**, 369–520 (2014)Dimarco, G., Pareschi, L., Zanella, M.: Uncertainty quantification for kinetic models in socio-economic and life sciences. In: Jin, S., Pareschi, L (eds.) Uncertainty Quantification for Hyperbolic and Kinetic Equations. SEMA SIMAI Springer Series, vol. 14, pp 151–191. Springer, Cham (2017)

Degond, P., Frouvelle, A., Liu, J.-G.: Macroscopic limits and phase transition in a system of self-propelled particles. J. Nonlinear Sci.

**23**, 427–456 (2013)Degond, P., Motsch, S.: Continuum limit of self-driven particles with orientation interaction. Math. Models Methods Appl. Sci.

**18**, 1193–1215 (2008)D’Orsogna, M.R., Chuang, Y.L., Bertozzi, A.L., Chayes, L.S.: Self-propelled particles with soft-core interactions: patterns, stability, and collapse. Phys. Rev. Lett.

**96**, 104302 (2006)Duan, R., Fornasier, M., Toscani, G.: A kinetic flocking model with diffusion. Commun. Math. Phys.

**300**, 95–145 (2010)Funaro, D.: Polynomial Approximation of Differential Equations. Springer, Berlin (1992)

Garnier, J., Papanicolaou, G., Yang, T.-W.: Consensus convergence with stochastic effects. Vietnam J. Math.

**45**, 51–75 (2017)Gomes, S.N., Pavliotis, G.A.: Mean field limits for interacting diffusions in a two-scale potential. J. Nonlinear Sci.

**28**, 905–941 (2018)Ha, S.-Y., Jin, S.: Local sensitivity analysis for the Cucker–Smale model with random inputs. Kinet. Relat. Models

**11**, 859–889 (2018)Ha, S.-Y., Jin, S., Jung, J.: Local sensitivity analysis for the Kuramoto model with random inputs in a large coupling regime. Netw. Heterog Media. To appear (2018)

Ha, S.-Y., Tadmor, E.: From particle to kinetic and hydrodynamic descriptions of flocking. Kinet. Relat. Models

**1**, 415–435 (2008)Hockney, R.W., Eastwood, J.K.: Computer Simulation Using Particles. McGraw Hill International Book Co., New York (1981)

Hu, J., Jin, S.: Uncertainty quantification for kinetic equations. In: Jin, S., Pareschi, L (eds.) Uncertainty Quantification for Hyperbolic and Kinetic Equations. SEMA-SIMAI Springer Series, vol. 14, pp 193–229. Springer, Cham (2017)

Hu, J., Jin, S., Xiu, D.: A stochastic Galerkin method for Hamilton–Jacobi equations with uncertainty. SIAM J. Sci. Comput.

**37**, A2246–A2269 (2015)Jin, S., Li, L., Liu, J.-G.: Random batch methods (RMB) for interacting particle systems. J. Comput. Phys. (to appear)

Kuramoto, Y.: Rhythms and turbulence in populations of chemical oscillators. Phys. A

**106**, 128–143 (1980). Statphys 14, Proc. Fourteenth Internat. Conf. Thermodynamics and Statist. Mech., Univ. Alberta, Edmonton, AltaMotsch, S., Tadmor, E.: Heterophilious dynamics enhances consensus. SIAM Rev.

**56**, 577–621 (2014)Pareschi, L., Toscani, G.: Interacting Multiagent Systems: Kinetic Equations and Monte Carlo Methods. Oxford University Press, Oxford (2013)

Pareschi, L., Zanella, M.: Structure preserving schemes for nonlinear Fokker–Planck equations and applications. J. Sci. Comput.

**74**, 1575–1600 (2018)Pareschi, L., Zanella, M.: Structure preserving schemes for mean-field equations of collective behavior. In: Klingenberg, C., Westdickenberg, M (eds.) Theory, Numerics and Applications of Hyperbolic Problems II. HYP: XVI International Conference on Hyperbolic Problems: Theory, Numerics, Applications. Springer Proceedings in Mathematics & Statistics, vol. 237, pp 405–421. Springer, Cham (2018)

Sakaguchi, H., Shinomoto, S., Kuramoto, Y.: Phase transitions and their bifurcation analysis in a large population of active rotators with mean-field coupling. Progr. Theor. Phys.

**79**, 600–607 (1988)Shu, C.-W.: High order weighted essentially nonoscillatory schemes for convection dominated problems. SIAM Rev.

**51**, 82–126 (2009)Tosin, A., Zanella, M.: Boltzmann–type models with uncertain binary interactions. Commun. Math. Sci.

**16**, 963–985 (2018)Tosin, A., Zanella, M.: Uncertainty damping in kinetic traffic models by driver-assist controls. arXiv:1904.00257 (2019)

Xiu, D.: Numerical Methods for Stochastic Computations. Princeton University Press, Princeton (2010)

Xiu, D., Karniadakis, G.E.: The Wiener–Askey polynomial chaos for stochastic differential equations. SIAM J. Sci. Comput.

**24**, 619–644 (2002)Zhong, X., Li, Q.: Galerkin methods for stationary radiative transfer equations with uncertain coefficients. J. Sci. Comput.

**76**, 1105–1126 (2018)Zhu, Y., Jin, S.: The Vlasov–Poisson–Fokker–Planck system with uncertainty and a one-dimensional asymptotic preserving method. Multiscale Model. Simul.

**15**, 1502–1529 (2017)Zanella, M.: Structure preserving stochastic Galerkin methods for Fokker–Planck equations with background interactions. Math. Comput Simul. https://doi.org/10.1016/j.matcom.2019.07.012 (2019)

## Acknowledgements

JAC was partially supported by the EPSRC grant number EP/P031587/1. MZ is member of the National Group on Mathematical Physics (GNFM) of INdAM (Istituto Italiano di Alta Matematica), Italy. This work has been written within the activities of the Excellence Project CUP: E11G18000350001 of the Department of Mathematical Sciences ”G. L. Lagrange” of Politecnico di Torino funded by MIUR (Italian Ministry for Education, University and Research).

## Author information

### Authors and Affiliations

### Corresponding author

## Additional information

### Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

## About this article

### Cite this article

Carrillo, J.A., Zanella, M. Monte Carlo gPC Methods for Diffusive Kinetic Flocking Models with Uncertainties.
*Vietnam J. Math.* **47, **931–954 (2019). https://doi.org/10.1007/s10013-019-00374-2

Received:

Accepted:

Published:

Issue Date:

DOI: https://doi.org/10.1007/s10013-019-00374-2

### Keywords

- Uncertainty quantification
- Stochastic Galerkin
- Collective behavior

### Mathematics Subject Classification (2010)

- 35Q83
- 65C05
- 65M70