1 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}}\), dx, dv ≥ 1, and \(\theta \in I_{\theta }\subseteq \mathbb {R}\) a random field, according to

$$ \partial_{t} f+v\cdot\nabla_{x} f = \nabla_{v} \cdot \left[ \mathcal B[f]f+\nabla_{v} (Df) \right], $$
(1)

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

$$ \mathcal B[f](\theta,x,w,t) = S(\theta,v) + {\int}_{\mathbb{R}^{d_{x}}}{\int}_{\mathbb{R}^{d_{v}}}P(\theta,x,x_{\ast})(v-v_{\ast})f(\theta,x_{\ast},v_{\ast},t)dv_{\ast} dx_{\ast}, $$
(2)

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.

2 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

$$ P(\theta,x,x_{\ast}) = \delta(x-x_{\ast}), \qquad S(\theta,v) = \alpha(\theta) (|v|^{2}-1)v, \qquad D= D(\theta), $$

being δ(xx) 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

$$ \partial_{t}f + v\cdot\nabla_{x} f = \nabla_{v} \cdot \left[\alpha(\theta)(|v|^{2}-1)vf + \rho_{f}(v-u_{f})f + D(\theta)\nabla_{v} f \right], $$
(3)

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

$$ \rho_{f}(\theta,x,t) = {\int}_{\mathbb{R}^{d_{v}}} f(\theta,x,v,t)dv,\qquad \rho_{f} (\theta,x,t)u_{f}(\theta,x,t) = {\int}_{\mathbb{R}^{d_{v}} }v f(\theta,x,v,t)dv. $$

It seems worth stressing that, in the present setting, the role of the additive diffusion operator Δvf 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.

2.1 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

$$ \xi (\theta,v,t)= {\Phi}(\theta,v) + (U*f)(\theta,v,t) + D(\theta)\log f(\theta,v,t), $$

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

$$ {\Phi}(\theta,v) = \alpha(\theta) \left( \frac{|v|^{4}}{4}-\frac{|v|^{2}}{2} \right), $$

the equation reads

$$ \partial_{t} f(\theta,v,t) = \nabla_{v} \cdot \left( f(\theta,v,t)\nabla_{v} \xi(\theta,v,t) \right). $$

A free energy functional which dissipates along solution is defined for all 𝜃I𝜃 as follows

$$ \begin{array}{@{}rcl@{}} \mathcal E(\theta,t) &=& {\int}_{\mathbb{R}^{d_{v}}} \left( \alpha(\theta)\frac{|v|^{4}}{4}+(1-\alpha(\theta))\frac{|v|^{2}}{2} \right) f(\theta,v,t)dv -\frac{1}{2}|u_{f}|^{2}\\ &&+D(\theta){\int}_{\mathbb{R}^{d_{v}}}f(\theta,v,t)\log f(\theta,v,t)dv, \end{array} $$

with

$$ u_{f}(\theta,t) = {\int}_{\mathbb{R}^{d_{v}}}vf(\theta,v,t)dv. $$

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

$$ f^{\infty}(\theta,v) =C \exp\left\{-\frac{1}{D(\theta)}\left[\alpha(\theta)\frac{|v|^{4}}{4}+(1-\alpha(\theta))\frac{|v|^{2}}{2}-u_{f^{\infty}}\cdot v \right]\right\}, $$
(4)

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

$$ \partial_{t} f= \nabla_{v} \cdot \left[ \alpha(\theta)(|v|^{2}-1)vf + (v-u_{f}(\theta,t))f + D(\theta)\nabla_{v} f \right], $$

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 Dthe only stationary solution is the symmetric distribution given by (4) with uf ≡ 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].

2.2 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

$$ P(\theta,x,x_{\ast}) = \frac{H(\theta)}{\left( 1+ |x-x_{\ast}|^{2}\right)^{\gamma}}, \qquad H\ge 0, $$
(5)

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 dx = 1 and dv = 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].

3 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].

3.1 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

$$ \theta: ({\Omega},F) \rightarrow (I_{\theta},\mathcal{B}_{I_{\theta}}), $$

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

$$ \mathbb{E}\left[{\Phi}_{h}(\theta){\Phi}_{k}(\theta) \right] = {\int}_{I_{\theta}} {\Phi}_{h}(\theta){\Phi}_{k}(\theta){\Psi}(\theta)d\theta = \delta_{hk}, $$

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

$$ f(\theta,x,v,t) \approx f^{M}(\theta,x,v,t) = \sum\limits_{h=0}^{M} \hat f_{h}(x,v,t){\Phi}_{h}(\theta), $$

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 fM = fM(𝜃, x, v, t) solution of (1) is then

$$ \partial_{t} f^{M} +v\cdot \nabla_{v} f^{M} = \nabla_{v} \cdot \left[\mathcal B[f^{M}]f^{M} + \nabla_{v} \left( D f^{M} \right) \right]. $$

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

$$ \begin{array}{@{}rcl@{}} &&\partial_{t} \hat f_{h}(x,v,t) + v\cdot \nabla_{x} \hat f_{h}(x,v,t)\\ &=&\nabla_{v} \cdot \left[ \sum\limits_{k=0}^{M} S_{hk} \hat f_{k}(x,v,t) + \sum\limits_{k=0}^{M} P_{hk}[f^{M}]\hat f_{k}(x,v,t) + \sum\limits_{k=0}^{M} D_{hk} \nabla_{v} \hat f_{k}(x,v,t) \right], \end{array} $$
(6)

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

$$ \begin{array}{@{}rcl@{}} S_{hk}(v) &=& {\int}_{I_{\theta}} S(\theta,v) {\Phi}_{h}(\theta){\Phi}_{k}(\theta){\Psi}(\theta)d\theta, \end{array} $$
(7)
$$ \begin{array}{@{}rcl@{}} P_{hk}[\hat f] &=& {\int}_{I_{\theta}} {\int}_{\mathbb{R}^{d_{x}\times d_{v}}}P(\theta,x,x_{\ast})(v-v_{\ast})f^{M}(\theta,x_{\ast},v_{\ast},t)\\ &&\times {\Phi}_{h}(\theta){\Phi}_{k}(\theta){\Psi}(\theta) dv_{\ast} dx_{\ast} d\theta, \end{array} $$
(8)
$$ \begin{array}{@{}rcl@{}} D_{hk} &=& {\int}_{I_{\theta}} D(\theta){\Phi}_{h}(\theta){\Phi}_{k}(\theta){\Psi}(\theta)d\theta. \end{array} $$
(9)

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

$$ \mathbb E[f(\theta,x,v,t)] \approx \hat f_{0}(x,v,t), \quad \text{Var}[f(\theta,x,v,t)] \!\approx\! {\sum}_{h=0}^{M} \hat f_{h}(x,v,t) \mathbb E[{{\Phi}_{h}^{2}}(\theta)] - \hat{f}^2_{0}(x,v,t). $$

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 (79). We can reformulate (6) in more compact form as follows

$$ \partial_{t} \hat{\textbf{f}} + v\cdot \nabla_{x} \hat{\textbf{f}} = \nabla_{v} \cdot \left[ (\textbf{S} + \textbf{P}[\hat{\textbf{f}}]) \hat{\textbf{f}} + \textbf{D} \nabla_{v} \hat{\textbf{f}} \right]. $$

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

$$ \|\hat{\textbf{f}}\|_{L^{2}} := \left[{\int}_{\mathbb{R}^{d_{x}}\times \mathbb{R}^{d_{v}}} \left( \sum\limits_{h=0}^{M} \hat{f}^2_{h}(x,v,t) \right) dv dx \right]^{1/2} . $$

We can easily observe that, since the norm of fM(𝜃, x, v, t) in L2(Ω) is

$$ \|f^{M}\|_{L^{2}({\Omega})} = {\int}_{I_{\theta}} {\int}_{\mathbb{R}^{d_{x}}\times \mathbb{R}^{d_{v}}} \left( \sum\limits_{h = 0}^{M} \hat f_{h} {\Phi}_{h}(\theta) \right)^{2} dv dx {\Psi}(\theta)d\theta, $$

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

$$ \|f^{M}\|_{L^{2}({\Omega})} = \|\hat{\textbf{f}} \|_{L^{2}}. $$

We can prove the following stability result. For notation simplicity we consider the case dx = dv = 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 DhkCDfor all\(h,k=0,\dots ,M\), then

$$ \|\hat{\mathbf{f}}\|_{L^{2}}^{2} \le e^{t(C_{\mathcal B}+2C_{D})}\| \hat{\mathbf{f}}(0)\|^{2}_{L^{2}}. $$

Proof

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

$$ {\int}_{\mathbb{R}^{2}} \!\left[\partial_{t} \left( \frac{1}{2}\hat{f}^2_{h} \right) + v\partial_{x} \left( \frac{1}{2}\hat{f}_{h}^{2} \right) \right]dv dx = \! {\int}_{\mathbb{R}^{2}}\partial_{v} \!\left[\sum\limits_{k=0}^{M} (S_{hk} + P_{hk})\hat f_{k} + \partial_{v} \sum\limits_{k=0}^{M} D_{hk}\hat f_{k} \right] \!\hat f_{h} dv dx. $$

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

$$ \begin{array}{@{}rcl@{}} &&\sum\limits_{k=0}^{M} {\int}_{\mathbb{R}^{2}} \hat f_{h} \partial_{v} \left( (S_{hk}+P_{hk} )\hat f_{k}\right)dv dx \\ &=& \sum\limits_{k=0}^{M} {\int}_{\mathbb{R}^{2}}\left( \hat f_{k} \hat f_{h} \partial_{v} (S_{hk}+P_{hk}) +(S_{hk}+P_{hk}) \hat f_{h} \partial_{v} \hat f_{k} \right)dv dx \\ &=& - \sum\limits_{k=0}^{M} {\int}_{\mathbb{R}^{2}} (S_{hk}+P_{hk}) \partial_{v} \left( \hat f_{h} \hat f_{k} \right)dv dx - \sum\limits_{k=0}^{M} {\int}_{\mathbb{R}^{2}} \hat f_{k} \partial_{v} \left( (S_{hk}+P_{hk}) \hat f_{h} \right) dv dx, \end{array} $$

and thanks to the symmetry of S and P we have

$$ \begin{array}{@{}rcl@{}} 2 \sum\limits_{h,k=0}^{M} {\int}_{\mathbb{R}^{2}} \hat f_{h} \partial_{v} \left( (S_{hk}+P_{hk}) \hat f_{k} \right)dv dx & =& - \sum\limits_{h,k=0}^{M} {\int}_{\mathbb{R}^{2}} (S_{hk}+P_{hk}) \partial_{v} (\hat f_{k} \hat f_{h})dv dx \\ & =& \sum\limits_{h,k=0}^{M} {\int}_{\mathbb{R}^{2}} \hat f_{h} \hat f_{k} \partial_{v} (S_{hk}+P_{hk}) dv dx. \end{array} $$

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

$$ \sum\limits_{h,k=0}^{M} {\int}_{\mathbb{R}^{2}} \hat f_{h} \partial_{v} \left( (S_{hk}+P_{hk}) \hat f_{k}\right)dv dx \le \frac{C_{\mathcal B}}{2} \sum\limits_{h,k=0}^{M} {\int}_{\mathbb{R}^{2}} |\hat f_{h} \hat f_{k}| dv dx, $$

and from Cauchy–Schwarz we have

$$ \sum\limits_{h,k=0}^{M} {\int}_{\mathbb{R}^{2}} \hat f_{h} \partial_{v} \left( (S_{hk}+P_{hk}) \hat f_{k}\right)dv dx \le \frac{C_{\mathcal B}}{2} \| \hat{\textbf{f}} \|_{L^{2}}^{2}. $$

Furthermore, since DhkCD we have

$$ \sum\limits_{h,k=0}^{M} {\int}_{\mathbb{R}^{2}} \partial_{v} \left( \partial_{v} D_{hk}\hat f_{k} \right)\hat f_{h}dv dx \le - C_{D}\sum\limits_{h,k=0}^{M} {\int}_{\mathbb{R}^{2}} |\partial_{v} \hat f_{h} \partial_{v} \hat f_{k}| dv dx, $$

and we obtain

$$ \frac{1}{2}\partial_{t} \| \hat{\textbf{f}} \|^{2}_{L^{2}} \le \frac{C_{\mathcal B}}{2}\| \hat{\textbf{f}}\|_{L^{2}}^{2} - \|\partial_{v} \hat{\textbf{f}} \|_{L^{2}}^{2} \le \left( \frac{C_{\mathcal B}}{2}+C_{D} \right) \| \hat{\textbf{f}} \|_{L^{2}}^{2} $$

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) = f0(𝜃, x, v) the SG-gPC decomposition of the original problem reads for all \(h=0,\dots ,M\)

$$ \partial_{t} \hat f_{h}(x,v,t) + v\cdot \nabla_{x} \hat f_{h}(x,v,t) = \nabla_{v} \cdot \left[ (S_{hh}+P_{hh}) \hat f_{h}(x,v,t) + D_{hh} \nabla_{v} \hat f_{h}(x,v,t) \right]. $$

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.

3.2 Particle Based SG-gPC Formulation of Kinetic Equations

As for classical spectral methods, the solution of the coupled SG system (6) for fM 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

$$ \left\{\begin{array}{ll} d x_{i}(\theta,t) = v_{i}(\theta,t) dt,\\ d v_{i}(\theta,t) = \Big(\alpha(\theta)(1-|v_{i}|^{2})v_{i} + \frac{1}{N} \sum\limits_{j=1}^{N} P(\theta,x_{i},x_{j}) (v_{j}-v_{i}) \Big)dt + \sqrt{2D(\theta)}dW_{i} \end{array}\right. $$
(10)

with initial positions and velocities (xi(𝜃,0), vi(𝜃,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(𝜃, xi, xj) = P(𝜃, xj, xi), the above system of SDEs preserves the initial mean velocity of the system in the limit \(N\rightarrow +\infty \). Indeed we have

$$ d \sum\limits_{i =1}^{N} v_{i}(\theta,t) = \frac{1}{N} \sum\limits_{i,j=1}^{N} P(\theta,x_{i},x_{j})(v_{j}-v_{i}) + \sqrt{2D(\theta)} \sum\limits_{i=1}^{N} dW_{i} = \sqrt{2D(\theta)} d\sum\limits_{i=1}^{N} W_{i}, $$

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.,

$$ f^{(N)}(\theta,x,v,t) = \left[\frac{1}{N} \sum\limits_{i=1}^{N} \delta(x-x_{i})\otimes \delta(v-v_{i}) \right]{\Psi}(\theta). $$

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(xixj, vivj) = −P(𝜃,|xixj|)(vivj) and the drift S(𝜃, vi). 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

$$ \left\{\begin{array}{lll} d \bar{x}_{i}(\theta,t)= \bar{v}_{i}(\theta,t) dt,\\ d \bar{v}_{i}(\theta,t) = -S(\theta,\bar{v}_{i})dt - K*f(\theta,\bar{x}_{i},\bar{v}_{i})dt + \sqrt{2D(\theta)}dW_{i}, \\ (\bar{x}_{i}(\theta,0),\bar{v}_{i}(\theta,0)) = ({x}_{i}(\theta,0),{v}_{i}(\theta,0)), \end{array}\right. $$
(11)

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 f0(𝜃, x, v) be a Borel probability measure and let (xi(𝜃,0), vi(𝜃,0)) for all\(i=1,\dots ,N\)be Nindependent variables for all 𝜃I𝜃. We assume that the drift and the antisymmetric kernel satisfy that there exist constantsA, L, p > 0 such that

$$ \begin{array}{@{}rcl@{}} -(v-w)\cdot \left( S(v)-S(w) \right)&\le& A|v-w|^{2}, \\ |K(x,v) - K(y,v)| &\le& L \min\{|x-y|,1\} (1+|v|^{p}) \end{array} $$

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 (xi(𝜃,0), vi(𝜃,0)) such that

$$ \begin{array}{@{}rcl@{}} \sup_{0\le t\le T} \sup_{\theta\in I_{\theta}}\!\!\!&&\left\{ {\int}_{\mathbb{R}^{2d_{x}}\times \mathbb{R}^{2d_{v}}} |K(x-y,v-w)|^{2} df(\theta,x,v)df(\theta,y,w)\right.\\ &&\quad\left. + {\int}_{\mathbb{R}^{d_{x}}\times \mathbb{R}^{d_{v}}} \left( |x|^{2}+e^{a|v|^{p}}\right)df(\theta,x,v) \right\}<\infty, \end{array} $$

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

$$ \mathbb E_{\theta,W}\left[ |x_{i}-\bar x_{i}|^{2} + |v_{i}-\bar v_{i}|^{2} \right] \le \frac{C}{N^{e^{-Ct}}}. $$
(12)

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

$$ \sup_{0\le t\le T} \sup_{\theta\in I_{\theta}} {\int}_{\mathbb{R}^{d_{x}}\times \mathbb{R}^{d_{v}}} e^{a|v|^{p^{\prime}}}df(\theta,x,v)<\infty $$
(13)

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

$$ \mathbb E_{\theta,W}\left[ |x_{i}-\bar x_{i}|^{2} + |v_{i}-\bar v_{i}|^{2} \right] \le \frac{C}{N^{1-\epsilon}}, $$

for all 0 ≤ tTand 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

$$ \begin{array}{@{}rcl@{}} && \mathbb E_{\theta,W}\left[\left|\frac{1}{N} \sum\limits_{i=1}^{N} \varphi(x_{i},v_{i}) - {\int}_{\mathbb{R}^{d_{x}}\times \mathbb{R}^{d_{v}}} \varphi(x,v) df(\theta,x,v) \right|^{2} \right] \\ &\le& 2 \mathbb E_{\theta,W}\left[|\varphi(x_{i},v_{i})- \varphi(\bar{x}_{i},\bar{v}_{i})|^{2} + \left|\frac{1}{N} \sum\limits_{i=1}^{N} \varphi(\bar x_{i},\bar v_{i}) - {\int}_{\mathbb{R}^{d_{x}}\times \mathbb{R}^{d_{v}}} \varphi(x,v)df(\theta,x,v) \right|^{2} \right] \\ &\le& \varepsilon(N) + C/N, \end{array} $$
(14)

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.

3.2.1 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

$$ {x_{i}^{M}}(\theta,t) = \sum\limits_{k=0}^{M} \hat x_{i,k} {\Phi}_{k}(\theta),\qquad {v_{i}^{M}}(\theta,t) = \sum\limits_{k=0}^{M} \hat v_{i,k} {\Phi}_{k}(\theta), $$

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

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

$$ \left\{\begin{array}{llll} \displaystyle d {\int}_{I_{\theta}}{x_{i}^{M}} {\Phi}_{h}(\theta){\Psi}(\theta)d\theta = {\int}_{I_{\theta}} {v_{i}^{M}} {\Phi}_{h}(\theta){\Psi}(\theta)d\theta dt, \\ \displaystyle d{\int}_{I_{\theta}}{v_{i}^{M}} {\Phi}_{h}(\theta){\Psi}(\theta)d\theta = \\ \qquad \displaystyle {\int}_{I_{\theta}} \left( \alpha(\theta)(1-|{v_{i}^{M}}|^{2}){v_{i}^{M}} +\frac{1}{N} \sum\limits_{j=1}^{N} P(\theta,{x_{i}^{M}},{x_{j}^{M}})({v_{j}^{M}}-{v_{i}^{M}}) \right){\Phi}_{h}(\theta){\Psi}(\theta)d\theta dt \\ \qquad \displaystyle+ {\int}_{I_{\theta}}\sqrt{2D(\theta)}{\Phi}_{h}(\theta){\Psi}(\theta)d\theta dW_{i}, \end{array}\right. $$

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

$$ \left\{\begin{array}{ll} d \hat{x}_{i,h} = \hat{v}_{i,h} dt, \\ d \hat{v}_{i,h} = \left( \displaystyle\sum\limits_{k=0}^{M} s_{hk}({v_{i}^{M}}) \hat{v}_{i,k} + \frac{1}{N} \displaystyle\sum\limits_{j=1}^{N} \sum\limits_{k=0}^{M} p_{hk}^{ij} (\hat{v}_{j,k}- \hat{v}_{i,k}) \right)dt + d_{h} dW_{i}, \end{array}\right. $$
(15)

where

$$ \begin{array}{@{}rcl@{}} s_{hk}({v_{i}^{M}}) &=& {\int}_{I_{\theta}} \alpha(\theta)(1-|{v_{i}^{M}}|^{2}){\Phi}_{k}(\theta){\Phi}_{h}(\theta){\Psi}(\theta)d\theta, \\ p_{hk}^{ij} &=& {\int}_{I_{\theta}} P(\theta,{x_{i}^{M}},{x_{j}^{M}}) {\Phi}_{k}(\theta){\Phi}_{h}(\theta){\Psi}(\theta)d\theta, \end{array} $$

and

$$ d_{h} = {\int}_{I_{\theta}} \sqrt{2D(\theta)}{\Phi}_{h}(\theta){\Psi}(\theta)d\theta. $$

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 L2(Ω). Then, for any g(𝜃, t) ∈ L2(Ω)

$$ \|g - g^{M}\|_{L^{2}({\Omega})} \rightarrow 0 \qquad \text{as}\quad M\rightarrow \infty, $$

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

$$ f^{(N,M)}(\theta,x,v,t) = \left[\frac{1}{N} \sum\limits_{i=1}^{N} \delta(x-{x_{i}^{M}}) \otimes \delta(v-{v_{i}^{M}})\right] {\Psi}(\theta) $$

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 xi(𝜃, t) and vi(𝜃, t).

Theorem 5

Let us define the following empirical measure

$$ f^{(N,M)}(\theta,x,v,t) = \left[\frac{1}{N} \sum\limits_{i=1}^{N} \delta(x-{x_{i}^{M}}) \otimes \delta(v-{v_{i}^{M}})\right] {\Psi}(\theta). $$

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

$$ f^{(N,M)}(\theta,x,v,t) \rightarrow f^{(N)}(\theta,x,v,t), $$

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

$$ \begin{array}{@{}rcl@{}} &&{\int}_{I_{\theta}}\left|\frac{1}{N} \sum\limits_{i=1}^{N} \varphi_{2}(x_{i},v_{i}) - \frac{1}{N} \sum\limits_{i=1}^{N} \varphi_{2}({x_{i}^{M}},{v_{i}^{M}}) \right| {\Psi}(\theta) |\varphi_{1}(\theta)| d\theta\\ &\leq& \frac{1}{N }\sum\limits_{i=1}^{N} {\int}_{I_{\theta}}\left|\varphi(x_{i},v_{i})-\varphi({x_{i}^{M}},{v_{i}^{M}})\right| {\Psi}(\theta) |\varphi_{1}(\theta)|d\theta \end{array} $$

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

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

3.2.2 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].

figure a

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)\), SN.

Fig. 1
figure 1

Possible numerical approaches to nonlinear stochastic VFP equations, the right branch describes the MCgPC scheme

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

$$ \begin{array}{@{}rcl@{}} \left|\left\langle f^{(S,M)},\varphi \right\rangle - \left\langle f^{(N,M)},\varphi \right\rangle \right| &=& \left| \frac{1}{S} \sum\limits_{j \in J} \varphi({x_{j}^{M}},{v_{j}^{M}}) - \frac{1}{N} \sum\limits_{j =1}^{N} \varphi({x_{j}^{M}},{v_{j}^{M}})\right| \\ & =& \left|\left( \frac{1}{S}-\frac{1}{N} \right) \sum\limits_{j\in J}\varphi({x_{j}^{M}},{v_{j}^{M}}) - \frac{1}{N}\sum\limits_{j\not\in J}\varphi({x_{j}^{M}},{v_{j}^{M}}) \right| \\ &\le& \left| \left\langle f,\varphi \right\rangle - \left( \frac{1}{S}-\frac{1}{N} \right)\sum\limits_{j\in J}\varphi({x_{j}^{M}},{v_{j}^{M}}) \right|\\ &&+ \left| \left\langle f,\varphi \right\rangle - \frac{1}{N}\sum\limits_{j\not\in J}\varphi({x_{j}^{M}},{v_{j}^{M}}) \right| = I_{1} + I_{2}, \end{array} $$

whose leading error is given by I1 since SN 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.

4 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.

4.1 Test 1: Space Homogeneous Case

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

$$ D(\theta) = \bar D + \lambda\bar D\theta, \qquad \bar D\ge 0, $$
(16)

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

$$ \partial f(\theta,v,t) = \partial_{v} \left[ \alpha(|v|^{2}-1)f(\theta,v,t) + (v-u_{f}(\theta,t))f(\theta,v,t) + D(\theta)\partial_{v} f(\theta,v,t) \right], $$

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

$$ \partial_{t} \hat f_{h}(v,t) = \partial_{v} \left[ \alpha(|v|^{2}-1)v \hat f_{h}(v,t)+\sum\limits_{k=0}^{M} P_{hk} \hat f_{k}(v,t)+ \sum\limits_{k=0}^{M} D_{hk} \partial_{v} \hat f_{k}(v,t)\right], $$
(17)

being

$$ \begin{array}{@{}rcl@{}} P_{hk} &=& \frac{1}{\|{{\Phi}_{h}^{2}} \|_{L^{2}({\Omega})}} {\int}_{I_{\theta}}\left( v-u_{f^{M}}\right){\Phi}_{h}(\theta){\Phi}_{k}(\theta)d{\Psi}(\theta),\\ D_{hm} &=& \frac{1}{\|{{\Phi}_{h}^{2}} \|_{L^{2}({\Omega})}} {\int}_{I_{\theta}}D(\theta){\Phi}_{h}(\theta){\Phi}_{m}(\theta)d{\Psi}(\theta). \end{array} $$

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

$$ d \hat v_{i,h} =\left( \sum\limits_{k=0}^{M} s_{hk}\left( {v_{i}^{M}}\right)\hat{v}_{i,k} + \hat u_{h}- \hat v_{h}\right)dt + d_{h} dW_{i}, $$

being

$$ \begin{array}{@{}rcl@{}} s_{hk}({v_{i}^{M}}) &=& {\int}_{I_{\theta}} \alpha\left( 1-|{v_{i}^{M}}|^{2}\right){\Phi}_{k}(\theta){\Phi}_{h}(\theta){\Psi}(\theta)d\theta,\\ d_{h} &=& {\int}_{I_{\theta}} \left( 2\bar D + 2\lambda \bar D\theta\right)^{1/2} {\Psi}(\theta)d\theta, \end{array} $$

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

$$ f_{0}(v) = \frac{1}{\sqrt{2\pi \sigma^{2}}} \exp \left\{ -\frac{(v-\mu)^{2}}{2\sigma^{2}} \right\},\qquad \mu = 1, \sigma^{2} = \frac{1}{4}. $$

At the particle level the initial velocities are a sample of N ≫ 0 velocities from the distribution f0(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.

Fig. 2
figure 2

Test 1. We compare the expected density at time T = 50 obtained from (17) through the gPC system and its MCgPC approximation with an increasing number of samples N = 103, N = 104 and M = 4 gPC modes. We considered case \(\bar D = 0.2\) (left column) and \(\bar D=0.8\) (right column) and λ = 0.1, α = 1 (top row) and α = 2 (bottom row), the velocity space is discretized with Nv = 81 gridpoints and Δt = 10− 2

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

$$ \mathcal T(\theta,t) = {\int}_{\mathbb{R}} (v-u(\theta,t))^{2} f(\theta,v,t)dv, $$

in L2(Ω) obtained through the MCgPC algorithm for an increasing order of the gPC expansion. We considered N = 104 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.

Fig. 3
figure 3

Test 1. Convergence in L2(Ω) based on a reference temperature \(\mathcal {T}^{ref}\) at time T = 50 computed at the particle level with a gPC expansion of degree M = 20

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})}\).

Fig. 4
figure 4

Evolution of the expected average velocity of the system \(\mathbb E[u_{f}(\theta ,T)]\) for T = 50 and several \(\bar D = \frac {\kappa }{10}\), \(\kappa = 0,\dots ,10\). In red we computed the confidence band. The result is obtained through the MCgPC scheme with N = 104 particles and M = 4 gPC modes. We considered an uncertain diffusion of the form (16) with λ = 10− 1 in the top-left figure and λ = 10− 3 in the bottom-left figure. The right plots are a further refinement of \(\bar D\) in a subinterval near the phase transition. Different sizes of the variability region for \(\mathbb E[u_{f}]\) indicates different sensibilities to the action of uncertainties

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.

4.2 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 = 105 particles for the MCgPC scheme.

4.2.1 Test 2A. Localized Interaction Case

We consider a space dependent interaction function of Dirac delta form, i.e., P(x, x) = δ(xx). 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

$$ \left\{\begin{array}{ll} d\hat x_{i,h} = \hat v_{i,h}dt, \\ d \hat v_{i,h} = \displaystyle \left( \sum\limits_{k=0}^{M} s_{hk}({v_{i}^{M}})\hat{v}_{i,k} + \frac{1}{N} \sum\limits_{k=0}^{M} \sum\limits_{i=1}^{N} P_{hk}^{ij} (\hat{v}_{j,k}-\hat{v}_{i,k})\right)dt + d_{h} dW_{i}, \end{array}\right. $$

where shk 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 xi+ 1xi = Δx, vi+ 1vi = Δv made by Nx = 20 gridpoints for the space variable and by Nv = 40 points for the velocity variable. At time t = 0 we consider the following multivariate Gaussian distribution

$$ f_{0}(x,v) = \frac{1}{2\pi \sigma_{x} \sigma_{v}} \exp\left\{-\frac{1}{2}\left[ \frac{(x-\mu_{x})^{2}}{2{\sigma_{v}^{2}}}+ \frac{(v-\mu_{v})^{2}}{2{\sigma_{v}^{2}}} \right] \right\} $$

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 [xi, xi+ 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.

Fig. 5
figure 5

Test 2A. Evolution of the expected density in the inhomogeneous kinetic equation (1) with localized interactions at times t = 0.5,1.0,5.0. We considered deterministic self-propulsion strength α = 1 and uncertain diffusion of the form (16) with \(\bar D=0.2\) and λ = 0.1. Top row: numerical solution of the gPC system. Bottom row: reconstruction of the expected density obtained through MCgPC scheme for N = 105 particles with mean-field MC algorithm with interaction subset of S = 10 agents. We considered Nx = 20 gridpoints in the interval [− 2,2] for the space discretization and Nv = 40 gridpoints in the interval [− 3,3] for the velocity discretization

Fig. 6
figure 6

Test 2A. The same as Fig. 5 but with \(\bar D = 0.8\)

Fig. 7
figure 7

Test 2A. Marginal distributions \({\int \limits }_{\mathbb {R}^{d_{x}}}\mathbb E[f(\theta ,x,v,t)]dx\), at time t = 5, obtained from the numerical solutions of the inhomogeneous VFP with localized interactions and uncertain diffusion parameter reported in Figs. 5 and 6

4.2.2 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

$$ P(x,x_{\ast}) = \frac{1}{(1 + |x-x_{\ast}|^{2})^{\gamma}}, \qquad \gamma = 0.1. $$
(18)

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 = 105 particles is considered for the reconstruction of the expected density in the interval [− 2,2] × [− 3,3] with Nx = 20, Nv = 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.

Fig. 8
figure 8

Test 2B. Evolution of the expected density for the VFP equation with CS interaction kernel (18) and with uncertain diffusion parameter in the time interval [0,5]. The uncertain diffusion parameter is \(D(\theta ) = \bar D + \lambda \bar D\theta \) with \(\bar D = 0.2\) and λ = 0.1. Dynamics obtained through MCgPC scheme with N = 105 particles and fast evaluation of interaction with S = 10. The gPC expansion is order M = 4 and the density is reconstructed in the phase space (x, v) ∈ [− 2,2] × [− 3,3] with Nv = 40, Nx = 20

Fig. 9
figure 9

Test 2B. The same as Fig. 8 but with \(\bar D = 0.8\)

5 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.