1 Introduction

Non-linear hyperbolic conservation laws model numerous physical phenomena in fluid mechanics, traffic flow or non-linear acoustics [1, 2]. The numerical computation of such equations is often a challenge since their solutions may present discontinuities, even if the initial data are smooth. Numerous numerical methods exist to approximate them, amongst which we may cite finite volume or finite difference schemes [3] or the front-tracking method [4]. We are interested in this paper in solving parameter-dependent hyperbolic conservation laws, which are considered for various tasks in data assimilation [5], uncertainty quantification [6,7,8,9,10], sensitivity analysis [11], or error analysis [12]. The parameters in our context appear in the initial data and in the flux function and are associated with a probability measure. The computation of approximate solutions for many instances of the parameters is usually prohibitive and require reduced order models.

Model order reduction methods aim at providing an approximation of the solution \(u(z,\xi )\), depending on physical variables z and parameters \(\xi \), that can be efficiently evaluated. They either rely on an explicit approximation of the solution map \(\xi \mapsto u(\cdot ,\xi )\) or an approximation of the solution manifold \(\{u(\cdot ,\xi ): \xi \in \Xi \}\) by some dimension reduction method. The main challenge for models driven by conservation laws is that the solution maps and solution manifolds are highly nonlinear (in particular due to the presence of discontinuities), that require the introduction of nonlinear approximation or dimension reduction methods. Several model reduction methods based on compositions have been proposed, that include methods based on parameter-dependent changes of variables [13, 14] or deep learning methods using neural networks [15]. These methods usually require high computational resources and huge training data for the approximation of highly nonlinear solution maps.

Here, we follow a different approach and propose a new surrogate modelling method. It is an extension of [16] to parameter-dependent or random conservation laws. Whereas it is classical to seek entropy weak solutions to hyperbolic conservation laws [1, 17], we are rather interested in so-called entropy measure-valued (MV) solutions, an even weaker notion of solution, introduced by DiPerna in [18, 19]. To a MV solution corresponds an occupation measure, whose marginal is the MV solution. Even if this notion of solution is very weak, there is a correspondence with entropy weak solution. The measure concentrated on the graph of the entropy weak solution is a MV solution. It is worth noting that the formulation in the setting of MV solutions leads to a linear problem, so that some efficient tools from convex analysis can be applied.

We start with a theoretical framework for parameter-dependent conservation laws similar to the one of [20, 21]. However, in our case, we introduce a weak-parametric formulation of the problem, where the classical entropy weak formulation is also integrated with respect to the parameter. The purpose of this formulation is to obtain an equivalent definition of parameter-dependent entropy MV solutions using the moments of the associated occupation measure with respect to all the variables, including the parameters. Under the assumption that flux function is polynomial and that the initial data can be described by semi-algebraic functions, the entropy formulation becomes a set of linear constraints on the moments of the occupation measure and we can follow the procedure initiated in [16]. Indeed, this allows us to consider the problem as a generalized moment problem (GMP), an infinite-dimensional optimization problem over sequences of moments of measures, where both the cost and the constraints are linear with respect to the moments of the measures. Powerful results from real algebraic geometry allow to reformulate the constraint that a sequence is a moment sequence into tractable semi-definite constraints. This problem is then solved using Lasserre’s (moment sum-of-squares) hierarchy [22], which consists in solving a sequence of convex semi-definite programs of increasing size to approximate the moments of the occupation measure. Note that the use of Lasserre’s hierarchy for solving PDEs has been also recently considered in [23], although with a different approach where the considered measure is defined on an infinite-dimensional function space, and assumed to be concentrated on the solution of the PDE.

Obtaining an approximation of the moments can be costly, but once this offline computation is performed, efficient online post-treatments are possible. First, we can naturally obtain expectations of variables of interest that are functions of the moments of the solution. Also, the graph of the entropy weak solution (for any parameter value) can be recovered using a localization property of the Christoffel–Darboux kernel of the approximate occupation measure, following the methodology proposed in [24]. This powerful approximation method allows to capture efficiently discontinuities in the solutions. Using the moment completion technique from [25], one can also have access to other quantities of interest, such as statistical moments of point-wise evaluations of the solution.

Outline

This paper is organized as follows. We first introduce some notations and the problem considered. Section 2 introduces different notions of solutions for parametrised scalar conservation laws and examines some links between these notions. Section 3 introduces the moment-SOS hierarchy and indicates how to perform several post-treatments such as retrieving the graph of the solution or estimating statistical moments of the solution. Finally, Sect. 4 presents some numerical experiments.

1.1 Notations

For \({\mathcal {X}}\subset {\mathbb {R}}^n\), with \(n\in {\mathbb {N}}\), let \({\mathcal {C}}({\mathcal {X}})\), \({\mathcal {C}}_0({\mathcal {X}})\) and \({\mathcal {C}}_c^1({\mathcal {X}})\) denote the space of functions on \({\mathcal {X}}\) that are continuous, continuous and vanishing at infinity and continuously differentiable with compact support, respectively. The sets of signed Borel measures and positive Borel measures are denoted \({\mathcal {M}}({\mathcal {X}})\) and \({\mathcal {M}}({\mathcal {X}})_+\), respectively. The set of probability measures on \({\mathcal {X}}\) is denoted by \({\mathcal {P}}({\mathcal {X}})\). The measure \(\lambda _{\mathcal {X}}\in {\mathcal {M}}({\mathcal {X}})_+\) denotes the Lebesgue measure on \({\mathcal {X}}\), and for \( B\subset {\mathcal {X}}\) a Borel set, \(\vert B \vert \) denotes its Lebesgue measure. Given a vector \(\textbf{w}=(w_1,\ldots , w_n)\), we denote by \({\mathbb {R}}[{\textbf{w}}]\) the ring of real multivariate polynomials in the variable \(w_1,\ldots ,w_n\), and for a multi-index \(\varvec{\alpha } = (\alpha _1,\ldots ,\alpha _n)\), \({\textbf{w}}^{\varvec{\alpha }}:= w_1^{\alpha _1}\ldots w_n^{\alpha _n}\). Given a positive Borel measure \(\mu \), we denote by \(\mathop {\textrm{supp}}\limits (\mu )\) its support, defined as the smallest closed set whose complement has measure zero.

1.2 Definition of the problem

We consider parameter-dependent scalar hyperbolic conservation laws that are formulated as a Cauchy problem

$$\begin{aligned}&\partial _t u(t,{\textbf{x}},{\varvec{\xi }})+{{\,\textrm{div}\,}}_{{\textbf{x}}}\textbf{f}(u(t,{\textbf{x}},\varvec{\xi }),\varvec{\xi })=0,\quad (t,\textbf{x},{\varvec{\xi }})\in {\mathbb {R}}_+\times {\mathbb {R}}^n\times {\varvec{\Xi }}, \end{aligned}$$
(1a)
$$\begin{aligned}&u(0,{\textbf{x}},{\varvec{\xi }})=u_0({\textbf{x}},{\varvec{\xi }}),\quad (\textbf{x},{\varvec{\xi }})\in {\mathbb {R}}^n\times \varvec{\Xi }, \end{aligned}$$
(1b)

where \(t \in {\mathbb {R}}_+\) is the time variable, \(\textbf{x} \in {\mathbb {R}}^n\) is the space variable, and where \(\varvec{\xi }\) is a parameter in a parameter set \(\varvec{\Xi }\subset {\mathbb {R}}^p\), \(p\in {\mathbb {N}}\). Then data are the flux \({\textbf{f}}: {\mathbb {R}} \times \varvec{\Xi } \rightarrow {\mathbb {R}}^n\) and the initial condition \(u_0: {\mathbb {R}}^n\times \varvec{\Xi }\rightarrow {\mathbb {R}}\).

The parameter set \(\varvec{\Xi }\) is equipped with a probability measure \(\rho \). We assume that \(\varvec{\Xi }\) is compact and the initial condition \(u_0 \in {\mathcal {L}}^\infty (\varvec{\Xi };{\mathcal {L}}^\infty ({\mathbb {R}}^n))\). Moreover, we shall make the following assumptions on \({\textbf{f}}\).

Assumption 1.1

For all \(K\subset {\mathbb {R}}\) compact, there exists \(C_K\in {\mathbb {R}}\) such that for all \(u\in K\) and \(\rho -\text {a.e.}\), \(\Vert {\textbf{f}}(u,\varvec{\xi })\Vert \le C_K\). Moreover, \(\rho -\text {a.e.}\), \(\textbf{f}(\cdot ,\varvec{\xi })\in {\mathcal {C}}^1({\mathbb {R}};{\mathbb {R}}^n)\).

This assumption is satisfied for a polynomial function f, that will be assumed in the next section. Then for the sake of simplicity, we restrict our analysis to this setting. A more general setting can be found in [21].

Note that the initial data \(u_0\) and the flux f may depend on distinct parameters but for the sake of clarity, and without loss of generality, we indicate a dependence on the same set of parameters \(\varvec{\xi }\).

2 Notions of parameter-dependent solution

2.1 Parametric entropy solution

We start by introducing the notion of parametric entropy weak solution, that is defined point-wise in the parameter domain. This may be considered as a strong-parametric solution, that is a straightforward notion of solution when a parameter is considered, see, e.g., [20] or [21].

Definition 2.1

(Entropy pairs) Let \(\eta \) be a locally Lipschitz and convex function from \({\mathbb {R}}\) to \({\mathbb {R}}\). Let \(\textbf{q}:{\mathbb {R}}\times \varvec{\Xi }\rightarrow {\mathbb {R}}^n\) such that \(\partial _u{\textbf{q}}(u,\varvec{\xi })=\eta '(u)\partial _u\textbf{f}(u,\varvec{\xi })\) for \(\rho \)-almost \(\varvec{\xi }\) and almost all \(u\in {\mathbb {R}}\). Then \((\eta ,{\textbf{q}})\) is called an entropy pair associated with conservation law (1a).

We may notice that for an entropy pair \((\eta ,{\textbf{q}})\), for \(\rho \)-almost all \(\varvec{\xi }\), \({\textbf{q}}(\cdot ,\varvec{\xi })\) is a locally Lipschitz function.

We now introduce three specific families of entropy pairs, each of them having a particular theoretical or numerical objective.

Definition 2.2

(\({\mathcal {C}}^1\) family of entropy pairs) The \({\mathcal {C}}^1\) family of entropy pairs, denoted \({\mathcal {E}}_{{\mathcal {C}}}\), is defined as the set of entropy pairs \((\eta ,{\textbf{q}})\) such that \(\eta \in {\mathcal {C}}^1({\mathbb {R}})\) and for \(\rho \)-almost all \(\varvec{\xi }\), \({\textbf{q}}(\cdot ,\varvec{\xi })\in {\mathcal {C}}^1({\mathbb {R}})\).

Note under assumption 1.1, if \((\eta ,{\textbf{q}})\) is an entropy pair with \(\eta \in {\mathcal {C}}^1\), then \((\eta ,{\textbf{q}}) \in {\mathcal {E}}_{{\mathcal {C}}} \). The \({\mathcal {C}}^1\) family of entropy pairs is related to the (opposite of the) thermodynamic entropy and to the second law of thermodynamics, for fluid dynamics models. The conservation law (1a), for a fixed \(\varvec{\xi }\), can be seen as a simplification of such models.

Definition 2.3

(Kruzhkov family of entropy pairs) The Kruzhkov family of entropy pairs is defined by

$$\begin{aligned} {\mathcal {E}}_K:=\left\{ (\eta _v,{\textbf{q}}_v): v\in {\mathbb {R}}\right\} , \end{aligned}$$

where for all \(v\in {\mathbb {R}}\), for all \(u\in {\mathbb {R}}\) and for \(\rho \)-almost all \(\varvec{\xi }\), \(\eta _v(u):=\vert u-v\vert \) and \(\textbf{q}_v(u,\varvec{\xi }):=\text {sign}(u-v)({\textbf{f}}(u,\varvec{\xi })-\textbf{f}(v,\varvec{\xi }))\).

Compared to \({\mathcal {E}}_{{\mathcal {C}}}\), the family \({\mathcal {E}}_K\) has the advantage of being explicitly described and of carrying strong results coming from Kruzhkov’s fundamental paper [17], allowing to obtain some theoretical results, such as uniqueness and stability.

Definition 2.4

(Polynomial family of entropy pairs) The polynomial family of entropy pairs \({\mathcal {E}}_P\) is defined as the set of entropy pairs \((\eta ,{\textbf{q}})\) such that \(\eta \) is a polynomial function. If \({\textbf{f}}\) is a polynomial function, then, for \(\rho \)-almost all \(\varvec{\xi }\), \({\textbf{q}}(\cdot ,\varvec{\xi })\) is also a polynomial function.

In the case of a uniformly convex flux function, a single polynomial entropy can be sufficient to select the relevant solution (see e.g. [26, 27]). Actually, our motivation is different. In numerical experiments, we shall use subsets of the polynomial family of entropy pairs. The SOS-moment (Lasserre’s) hierarchy, later exposed in this paper, relies indeed on a polynomial setting. Although it is possible to implement our numerical method with \({\mathcal {E}}_K\) as in [16], it is easier to do so with subsets of \({\mathcal {E}}_P\) when possible.

Definition 2.5

(Parametric entropy solution) Consider a family of entropy pairs \({\mathcal {E}}\). Let \(u_0: {\mathbb {R}}^n \times \varvec{\Xi } \rightarrow {\mathbb {R}}\) such that \(u_0 (\cdot , \varvec{\xi }) \in {\mathcal {L}}^\infty ({\mathbb {R}}^n)\) \(\rho \)-almost everywhere and \({\textbf{f}}\) satisfy Assumption 1.1. A function \(u: {\mathbb {R}}_+\times {\mathbb {R}}^n \times \varvec{\Xi } \rightarrow {\mathbb {R}} \) such that for \(\rho \)-almost all \(\varvec{\xi }\), \(u(\cdot ,\cdot ,\varvec{\xi })\in {\mathcal {L}}^\infty ({\mathbb {R}}_+\times {\mathbb {R}}^n)\) is a parametric entropy solution for \({\mathcal {E}}\) if, for all \((\eta ,{\textbf{q}})\in {\mathcal {E}}\), for all non-negative test functions \(\psi \in {\mathcal {C}}_c^1({\mathbb {R}}_+\times {\mathbb {R}}^n)\) and \(\rho \)-almost all \(\varvec{\xi }\), it satisfies

$$\begin{aligned} \int _{{\mathbb {R}}_+}\int _{{\mathbb {R}}^n}\left( \partial _t\psi \eta (u)+\nabla _{\textbf{x}}\psi \cdot {\textbf{q}}(u,\varvec{\xi })\right) d\textbf{x}dt +\int _{{\mathbb {R}}^n}\psi \eta (u_0)d{\textbf{x}}\ge 0. \end{aligned}$$
(2)

Proposition 2.6

A function u is a parametric entropy solution for \({\mathcal {E}}_K\) if and only if it is a parametric entropy solution for \({\mathcal {E}}_{{\mathcal {C}}}\).

Proof

For the proof, see Lemma 4.1 in [28] and the discussion which follows. \(\square \)

Theorem 2.7

If, for \(\rho \)-almost all \(\varvec{\xi }\), the initial data \(u_0(\cdot ,\varvec{\xi }) \in {\mathcal {L}}^\infty ({\mathbb {R}}^n)\) and if \({\textbf{f}}\) satisfies Assumption 1.1, then problem (1) has a unique parametric entropy solution u for \({\mathcal {E}}_K\), or equivalently, \({\mathcal {E}}_{{\mathcal {C}}}\). Moreover it satisfies for all \(t\in {\mathbb {R}}_+\) and for \(\rho \)-almost all \(\varvec{\xi }\),

$$\begin{aligned} \Vert u(t,\cdot ,\varvec{\xi })\Vert _{{\mathcal {L}}^\infty ({\mathbb {R}}^n)}\le \Vert u_0 (\cdot , \varvec{\xi })\Vert _{{\mathcal {L}}^\infty ({\mathbb {R}}^n)}. \end{aligned}$$
(3)

Proof

From [28, Theorem 5.2], we have that, for \(\rho \)-almost all \(\varvec{\xi }\), there exists a unique solution \(u(\cdot ,\cdot ,\varvec{\xi })\in {\mathcal {L}}^\infty ({\mathbb {R}}_+\times {\mathbb {R}}^n)\) for \({\mathcal {E}}_{{\mathcal {C}}}\). Then, from Proposition 2.6, we have that, for \(\rho \)-almost all \(\varvec{\xi }\), there exists a unique solution \(u(\cdot ,\cdot ,\varvec{\xi })\in {\mathcal {L}}^\infty ({\mathbb {R}}_+\times {\mathbb {R}}^n)\) for \({\mathcal {E}}_K\). The stability property (3) is deduced from [1, Theorem 6.2.7]. \(\square \)

Remark 2.8

Note that Theorem 2.7 does not provide any information on the measurability of u. Under the assumption that \(\varvec{\Xi }\ni \varvec{\xi }\mapsto u(\cdot ,\cdot ,\varvec{\xi })\in {\mathcal {L}}^\infty ({\mathbb {R}}_+\times {\mathbb {R}}^n)\) is Bochner measurable and that \(u_0\in {\mathcal {L}}^\infty (\varvec{\Xi };{\mathcal {L}}^\infty ({\mathbb {R}}^n))\), Theorem 2.7 allows to deduce

$$\begin{aligned} \Vert u \Vert _{{\mathcal {L}}^\infty ({\mathbb {R}}_+\times {\mathbb {R}}^n \times \varvec{\Xi })} \le \Vert u_0 \Vert _{{\mathcal {L}}^\infty ({\mathbb {R}}^n \times \varvec{\Xi })}. \end{aligned}$$

We refer to [20, Theorem 3.3] that provides measurability properties of u under additional assumptions on \(u_0\).

Remark 2.9

We might hope that imposing that \(u_0\in {\mathcal {L}}^\infty (\varvec{\Xi };{\mathcal {L}}^\infty ({\mathbb {R}}^n))\) may be sufficient to have that \(\varvec{\xi }\mapsto u(\cdot ,\cdot ,\varvec{\xi })\) is Bochner measurable, but this has not been proved yet.

2.2 Weak-parametric entropy solutions

The next notion of solution is weaker. While the parametric entropy solution adopts a pointwise point of view in the parameter domain, the following notion of solution is deduced by integration over the parameter domain.

Definition 2.10

(Weak-parametric entropy solution) Consider a family of entropy pairs \({\mathcal {E}}\). Let \(u_0\in {\mathcal {L}}^\infty ({\mathbb {R}}^n \times \varvec{\Xi })\) and \({\textbf{f}}\) satisfy Assumption 1.1. A measurable function \(u: {\mathbb {R}}_+\times {\mathbb {R}}^n\times \varvec{\Xi } \rightarrow {\mathbb {R}}\) in \({\mathcal {L}}^\infty ({\mathbb {R}}_+\times {\mathbb {R}}^n\times \varvec{\Xi })\) is called a weak-parametric entropy solution for \({\mathcal {E}}\) if, for all \((\eta ,{\textbf{q}})\in {\mathcal {E}}\) and all non-negative test functions \(\phi \in {\mathcal {C}}(\varvec{\Xi };{\mathcal {C}}^1_c({\mathbb {R}}_+\times {\mathbb {R}}^n))\), it satisfies

$$\begin{aligned}{} & {} \int _{{\mathbb {R}}_+}\int _{{\mathbb {R}}^n}\int _{\varvec{\Xi }}\left( \partial _t\phi \eta (u) +\nabla _{\textbf{x}}\phi \cdot {\textbf{q}}(u,\varvec{\xi })\right) d\rho (\varvec{\xi })d\textbf{x}dt\nonumber \\{} & {} \quad +\int _{{\mathbb {R}}^n}\int _{\varvec{\Xi }}\phi \eta (u_0)d\rho (\varvec{\xi })d\textbf{x}\ge 0. \end{aligned}$$
(4)

It is at first glance a weaker notion of solution, but we shall see that under certain assumptions, both notions of parametric entropy solution and weak-parametric entropy solution coincide.

Theorem 2.11

Assume that \(u_0 \in {\mathcal {L}}^\infty (\varvec{\Xi },{\mathcal {L}}^\infty ({\mathbb {R}}^n))\) and \({\textbf{f}}\) satisfies Assumption 1.1. A function u, such that \(\varvec{\xi }\mapsto u(\cdot ,\cdot ,\varvec{\xi })\) is Bochner measurable, is a parametric entropy solution for \({\mathcal {E}}_K\) if and only if it is a weak-parametric entropy solution for \({\mathcal {E}}_K\).

Proof

Let u be a parametric entropy solution for \({\mathcal {E}}_K\), and let \(v\in {\mathbb {R}}\) and \(\phi \in {\mathcal {C}}(\varvec{\Xi };{\mathcal {C}}^1_c({\mathbb {R}}_+\times {\mathbb {R}}^n))\). From Remark 2.8, and since \(u_0 \in {\mathcal {L}}^\infty (\varvec{\Xi },{\mathcal {L}}^\infty ({\mathbb {R}}^n))\) and \(\varvec{\xi }\mapsto u(\cdot ,\cdot ,\varvec{\xi })\) is Bochner measurable, we have that \(u\in {\mathcal {L}}^\infty ({\mathbb {R}}_+\times {\mathbb {R}}^n\times \varvec{\Xi })\). For \(\rho \)-almost all \(\varvec{\xi }\), \(\phi (\cdot ,\cdot ,\varvec{\xi })\in {\mathcal {C}}^1_c({\mathbb {R}}_+\times {\mathbb {R}}^n)\), thus u verifies equation (2) for \(\psi = \phi (\cdot ,\cdot ,\varvec{\xi })\). Let us integrate equation (2) on \(\varvec{\Xi }\). First, let us consider the terms where \(\eta _v\) appears. From Remark 2.8, u is essentially bounded. Since \(\eta _v\) is continuous, \(\eta _v\circ u\) is also essentially bounded. Since \(\phi \) and its derivative are continuous in \(\varvec{\xi }\) and \(\varvec{\Xi }\) is a compact set, the terms where \(\eta _v\) appears are integrable in \(\varvec{\xi }\). Recalling the definition of \({\textbf{q}}_v\) in Definition 2.3, we have that, for all \(y\in {\mathbb {R}}\), \(\rho \)-almost everywhere, \(\Vert {\textbf{q}}_v(y,\varvec{\xi })\Vert \le \Vert \textbf{f}(y,\varvec{\xi })\Vert +\Vert {\textbf{f}}(v,\varvec{\xi })\Vert \). From Assumption 1.1, and since from the same argument as for the terms where \(\eta _v\) appears, u is essentially bounded, there exists \(C,C_v\in {\mathbb {R}}\) such that \(\Vert \textbf{q}_v(u,\varvec{\xi })\Vert \le C+C_v\), \(\rho \)-almost everywhere. Thus, \(\varvec{\xi }\mapsto \int _{{\mathbb {R}}_+}\int _{{\mathbb {R}}^n}\nabla _{\textbf{x}}\phi \cdot {\textbf{q}}(u,\varvec{\xi })d\textbf{x}dt\) is integrable and integrating on \(\varvec{\Xi }\) yields equation (4).

Conversely, let \(u\in {\mathcal {L}}^\infty ({\mathbb {R}}_+\times {\mathbb {R}}\times \varvec{\Xi })\) be a weak-parametric entropy solution, \(v\in {\mathbb {R}}\) and \(\phi \in {\mathcal {C}}(\varvec{\Xi };{\mathcal {C}}^1_c({\mathbb {R}}_+\times {\mathbb {R}}^n))\) such that \(\phi (t,{\textbf{x}},\varvec{\xi }):=\psi (t,\textbf{x})\gamma (\varvec{\xi })\) where \(\psi \in {\mathcal {C}}^1_c({\mathbb {R}}_+\times {\mathbb {R}}^n)\) and \(\gamma \in {\mathcal {C}}(\varvec{\Xi })\). The function u then verifies (4) for our particular choice of \(\phi \). Inequality (4) can be rewritten as \(\int _{\varvec{\Xi }}I(\varvec{\xi })\gamma (\varvec{\xi })d\rho (\varvec{\xi })\ge 0\). Since I is \(\rho \)-measurable, \(\mathbbm {1}_{I<0}\) is \(\rho \)-measurable. Moreover, from [29, Theorem 12.7], since \(\rho \) is a finite Borel measure and \(\varvec{\Xi }\) is a Polish space, we have that \(\rho \) is a regular measure. Thus, there exists a sequence \(\gamma _n\in {\mathcal {C}}(\varvec{\Xi })\) such that \(\Vert \mathbbm {1}_{I<0}-\gamma _n\Vert _{{\mathcal {L}}^1(\varvec{\Xi })}\rightarrow 0\) as \(n\rightarrow \infty \) and \(\int _{\varvec{\Xi }}I(\varvec{\xi })\mathbbm {1}_{I<0}(\varvec{\xi })d\rho (\varvec{\xi })\ge 0\). Yet, \(I\mathbbm {1}_{I<0}\le 0\) \(\rho \)-almost everywhere. Thus, \(I\ge 0\) \(\rho \)-almost everywhere and it gives us that u is a parametric entropy solution, which concludes the proof.

\(\square \)

2.3 Measure-valued solutions

Following DiPerna [18], previous notions of solutions are extended to the weaker case of measure-valued solutions thanks to the notion of Young measure.

Definition 2.12

(Young measure) A Young measure on a Euclidean space \({\mathcal {X}}\) is a map \(\mu :{\mathcal {X}}\rightarrow {\mathcal {P}}({\mathbb {R}}),\tau \mapsto \mu _\tau \) such that for all \(g\in {\mathcal {C}}_0({\mathbb {R}})\) the function \(\tau \mapsto \int _{{\mathbb {R}}}g(y)\mu _\tau (dy)\) is measurable.

From this, we can seek an even weaker notion of solution that is a Young measure \(\mu _{(t,{\textbf{x}},\varvec{\xi })}\) which satisfies the following Cauchy problem:

$$\begin{aligned}&\partial _t\langle \mu _{(t,\textbf{x},\varvec{\xi })},{{\,\textrm{id}\,}}_{{\mathbb {R}}}\rangle +{{\,\textrm{div}\,}}_{\textbf{x}}\langle \mu _{(t,{\textbf{x}},\varvec{\xi })},{\textbf{f}}(\cdot ,\varvec{\xi }) \rangle =0,\quad (t,\textbf{x},\varvec{\xi })\in {\mathbb {R}}_+\times {\mathbb {R}}^n \times \varvec{\Xi }, \end{aligned}$$
(5a)
$$\begin{aligned}&\mu _{(0,{\textbf{x}},\varvec{\xi })}=\sigma _0,\quad (\textbf{x},\varvec{\xi }) \in {\mathbb {R}}^n\times \varvec{\Xi }, \end{aligned}$$
(5b)

where \(\langle \cdot ,\cdot \rangle \) denotes the integration of a (vector-valued) function \(g\in {\mathcal {C}}({\mathbb {R}}; {\mathbb {R}}^k)\) against a measure \(\mu \in {\mathcal {M}}({\mathbb {R}})\), defined by

$$\begin{aligned} \langle \mu ,g\rangle :=\int _{{\mathbb {R}}}g(y)\mu (dy) \in {\mathbb {R}}^k, \end{aligned}$$

while \(\sigma _0=\delta _{u_0}\). Equation (5a) has to be understood in a weak entropy sense, as explained in the following.

Definition 2.13

(Parametric entropy measure-valued (MV) solution) Consider a family of entropy pairs \({\mathcal {E}}\). Let \(\sigma _0\) be Young measure on \({\mathbb {R}}^n\times \varvec{\Xi }\), and let \({\textbf{f}}\) satisfying Assumption 1.1. A Young measure \(\mu \) is a parametric entropy MV solution to (5) for \({\mathcal {E}}\), if, for a family of entropy pairs \({\mathcal {E}}\), for all \((\eta ,{\textbf{q}})\in {\mathcal {E}}\) and all non-negative test functions \(\phi \in {\mathcal {C}}(\varvec{\Xi };{\mathcal {C}}^1_c({\mathbb {R}}_+\times {\mathbb {R}}^n))\), it satisfies

$$\begin{aligned}{} & {} \int _{{\mathbb {R}}_+}\int _{{\mathbb {R}}^n}\int _{\varvec{\Xi }} \left( \partial _t\phi (t,\textbf{x},\varvec{\xi })\langle \mu _{(t,\textbf{x},\varvec{\xi })}, \eta _v\rangle +\nabla _{{\textbf{x}}}\phi (t,\textbf{x},\varvec{\xi })\cdot \langle \mu _{(t,{\textbf{x}},\varvec{\xi })},\textbf{q}_v\rangle \right) d\rho (\varvec{\xi })d\textbf{x}dt\nonumber \\{} & {} \quad + \int _{{\mathbb {R}}^n}\int _{\varvec{\Xi }}\phi (0,\textbf{x},\varvec{\xi }) \langle \sigma _0,\eta _v\rangle d\rho (\varvec{\xi })d{\textbf{x}}\ge 0. \end{aligned}$$
(6)

With the injection

$$\begin{aligned} {\mathcal {L}}^\infty ({\mathbb {R}}_+\times {\mathbb {R}}^n\times \varvec{\Xi })&\rightarrow \left( {\mathbb {R}}_+\times {\mathbb {R}}^n\times \varvec{\Xi } \rightarrow {\mathcal {P}}({\mathbb {R}})\right) \\ u&\mapsto \left( (t,{\textbf{x}},\varvec{\xi })\mapsto \delta _{u(t,{\textbf{x}},\varvec{\xi })}\right) , \end{aligned}$$

we notice that, under the condition that \(\sigma _0=\delta _{u_0}\), weak-parametric entropy solutions are parametric entropy MV solutions, but without further assumptions, parametric entropy MV solutions are not necessarily weak-parametric entropy solutions. However, the following result shows that the parametric entropy MV solution can be concentrated on the graph of the weak-parametric entropy solution.

Theorem 2.14

Let \(u_0\in {\mathcal {L}}^\infty ({\mathbb {R}}^n \times \varvec{\Xi })\) and \({\textbf{f}}\) satisfy Assumption 1.1. Let u be the unique weak parametric entropy solution for \({\mathcal {E}}_K\) and \(\mu \) be a parametric entropy MV solution for \({\mathcal {E}}_K\). If \(\rho \)-almost everywhere \(\sigma _0=\delta _{u_0(\cdot )}\), then \(\rho \)-almost everywhere \(\mu =\delta _{u(\cdot )}\).

Proof

First, we may note that from the same arguments that those presented in the second part of the proof of Theorem 2.11, a parametric entropy MV solution \(\mu \) for \({\mathcal {E}}_K\) verifies the following inequality, for all \(v\in {\mathbb {R}}\), all non-negative test functions \(\psi \in {\mathcal {C}}^1_c({\mathbb {R}}_+\times {\mathbb {R}}^n)\) and \(\rho \)-almost all \(\varvec{\xi }\):

$$\begin{aligned}{} & {} \int _{{\mathbb {R}}_+}\int _{{\mathbb {R}}^n}\left( \partial _t\psi (t,{\textbf{x}}) \langle \mu _{(t,{\textbf{x}},\varvec{\xi })},\eta _v\rangle +\nabla _{{\textbf{x}}} \psi (t,{\textbf{x}})\cdot \langle \mu _{(t,{\textbf{x}},\varvec{\xi })}, {\textbf{q}}_v\rangle \right) d\textbf{x}dt\nonumber \\{} & {} \quad + \int _{{\mathbb {R}}^n}\psi (0,{\textbf{x}})\langle \sigma _0, \eta _v\rangle d{\textbf{x}}\ge 0. \end{aligned}$$
(7)

Then, for \(\rho \)-almost all \(\varvec{\xi }\), \(\mu (\cdot ,\cdot ,\varvec{\xi })\) is an entropy MV solution of the initial problem with a fixed parameter \(\varvec{\xi }\), that is a parameter-independent problem studied in [16]. Then, from [16, Theorem 1] and [18], we have that \(\rho \)-almost everywhere, if \((\sigma _0)_{(\cdot ,\varvec{\xi })}=\delta _{u(\cdot ,\varvec{\xi })}\), then \(\mu _{(\cdot ,\cdot ,\varvec{\xi })}=\delta _{u(\cdot ,\cdot ,\varvec{\xi })}\), with \(u(\cdot ,\cdot ,\varvec{\xi })\) the weak parametric entropy solution. \(\square \)

2.4 Restrictions to compact hypercubes

In order to extend the strategy developed in [16], it is mandatory to work on compact sets. Whereas introducing compact domains in time and in the parameter set is trivial, the restriction to bounded space domains has to be carefully done. To simplify the setting and to avoid the problem of introducing boundary conditions to conservation laws, see for instance [19, 30, 31], we assume that the solution has no interaction with its boundary, i.e. the solution is known on the boundary of the spatial domain at any time. Let

$$\begin{aligned} {\textbf{T}}:=[0,T],\quad {\textbf{X}}:=[L_1,R_1]\times \cdots \times [L_n,R_n],\quad \varvec{\Xi }:=[0,1]^p \end{aligned}$$
(8)

be the respective domains of time t, space variable \({\textbf{x}}\) and parameter \(\varvec{\xi }\) for fixed (but arbitrary) constants T, \((L_i)_{i=1}^n\) and \((R_i)_{i=1}^n\). The absence of interaction with the boundary is translated as follows: initial data \(u_0\) that we consider are the restrictions to \({\textbf{X}}\times \varvec{\Xi }\) of initial data defined on \({\mathbb {R}}^n\times \varvec{\Xi }\) such that, considering the associated weak parametric entropy solution u, there exists \(\epsilon >0\) such that in \(\varvec{\partial } \varvec{X}_\epsilon :=(\partial {\textbf{X}}+B(0,\epsilon ))\cap {\textbf{X}}\), and for all \(t\in {\textbf{T}}\) and \(\rho \)-almost all \(\varvec{\xi }, u(t,\cdot ,\varvec{\xi })=u_0(\cdot ,\varvec{\xi })\), i.e. the weak parametric entropy solution is stationary on \(\partial \varvec{X}_\epsilon \). This framework is the one we shall use in the following.

From (3), we can consider that u takes values in the following compact set

$$\begin{aligned} {\textbf{U}}:=[\underline{u},{\overline{u}}], \end{aligned}$$
(9)

where the bounds are \(\underline{u}:=\mathop {\mathrm {ess\,inf}}\limits _{{\textbf{X}},\varvec{\Xi }}u_0\) and \({\overline{u}}:=\mathop {\mathrm {ess\,sup}}\limits _{{\textbf{X}},\varvec{\Xi }}u_0\).

This leads us to reformulate the problem on the restricted domain.

Proposition 2.15

(Parametric entropy measure-valued solution on compact hypercubes) Consider a family of entropy pair \({\mathcal {E}}\). Let \(\mu :(t,{\textbf{x}},\varvec{\xi })\in {\mathbb {R}}_+\times {\mathbb {R}}^n\times \varvec{\Xi }\mapsto \mu _{(t,{\textbf{x}},\varvec{\xi })}\in {\mathcal {M}}_+({\textbf{U}})\) be a parametric entropy measure-valued solution for \({\mathcal {E}}\). Then it satisfies for all \((\eta ,{\textbf{q}})\in {\mathcal {E}}\) and for all non-negative test functions \(\phi \in {\mathcal {C}}(\varvec{\Xi };{\mathcal {C}}^1({\textbf{T}}\times {\textbf{X}}))\),

$$\begin{aligned}{} & {} \int _{{\textbf{T}}}\int _{{\textbf{X}}}\int _{\varvec{\Xi }}\left( \partial _t\phi (t,{\textbf{x}},\varvec{\xi }) \langle \mu _{(t,{\textbf{x}},\varvec{\xi })},\eta \rangle +\nabla _{{\textbf{x}}}\phi (t,{\textbf{x}},\varvec{\xi }) \cdot \langle \mu _{(t,{\textbf{x}},\varvec{\xi })},{\textbf{q}}\rangle \right) d\rho (\varvec{\xi })d\textbf{x}dt\nonumber \\{} & {} \quad +\int _{{\textbf{X}}}\int _{\varvec{\Xi }}\phi (0,{\textbf{x}},\varvec{\xi })\langle \sigma _0, \eta \rangle d\rho (\varvec{\xi })d{\textbf{x}}-\int _{{\textbf{X}}}\int _{\varvec{\Xi }}\phi (T,{\textbf{x}}, \varvec{\xi })\langle \sigma _T,\eta \rangle d\rho (\varvec{\xi })d{\textbf{x}}\nonumber \\{} & {} \quad -\int _{{\textbf{T}}}\int _{{\textbf{X}}} \int _{\varvec{\Xi }} \phi (t,{{\textbf{x}}},\varvec{\xi }) \langle \varvec{\gamma }, {\textbf{q}}(\cdot ,\varvec{\xi }) \rangle d\rho (\varvec{\xi })d{\textbf{x}} dt\ge 0 \end{aligned}$$
(10)

where \(\sigma _0\) and \(\sigma _T\) are Young measures supported on \({\textbf{X}}\times \varvec{\Xi }\), and where \(\varvec{\gamma }\) is such that

$$\begin{aligned}&\int _{{\textbf{T}}}\int _{{\textbf{X}}} \int _{\varvec{\Xi }} \phi (t,{{\textbf{x}}},\varvec{\xi }) \langle \varvec{\gamma } , {\textbf{q}}(\cdot ,\varvec{\xi }) \rangle d\rho (\varvec{\xi }) {d{\textbf{x}}}dt= \\&\quad \sum _{i=1}^n\int _{{\textbf{T}}}\int _{{{\textbf{X}}}} \int _{\varvec{\Xi }}\phi (t,{\textbf{x}}_{L,i},\varvec{\xi })\langle \gamma _{{L},i},q_i(\cdot ,\varvec{\xi })\rangle d\rho (\varvec{\xi }) {\delta _{\Gamma _{L,i}}(d{\textbf{x}})} dt\\&\quad -\sum _{i=1}^n \int _{{\textbf{T}}}\int _{{{\textbf{X}}}} \int _{\varvec{\Xi }}\phi (t,{\textbf{x}}_{R,i},\varvec{\xi })\langle \gamma _{{R},i},q_i(\cdot ,\varvec{\xi })\rangle d\rho (\varvec{\xi }) {\delta _{\Gamma _{R,i}}(d{\textbf{x}})} dt, \end{aligned}$$

where for each \(1\le i\le n\), \(\gamma _{L,i}\) and \(\gamma _{R,i}\) are boundary measures supported on \({\textbf{T}}\times \Gamma _{L,i}\times \varvec{\Xi }\) and \({\textbf{T}}\times \Gamma _{R,i}\times \varvec{\Xi }\) respectively, with \(\Gamma _{L,i} = \{ {\textbf{x}} \in \partial {\textbf{X}}: x_i = L_i\}\) and \(\Gamma _{R,i} = \{ {\textbf{x}} \in \partial {\textbf{X}}: x_i = R_i\}\), \({\textbf{x}}_{B,i}\) denotes the vector \((x_1,\dots ,x_{i-1},\Gamma _{B,i},x_{i+1},\dots ,x_n)\) for \(B\in \{L,R\}\).

Lemma 2.16

Consider a family of entropy pairs \({\mathcal {E}}\) such that either \(({{\,\textrm{id}\,}},{\textbf{f}})\in {\mathcal {E}}\) or \({\mathcal {E}}={\mathcal {E}}_K\). Let \(\mu \) be a parametric entropy MV solution for \({\mathcal {E}}\). Then for all test functions \(\phi \in {\mathcal {C}}(\varvec{\Xi };{\mathcal {C}}^1({\textbf{T}}\times {\textbf{X}}))\), it satisfies

$$\begin{aligned}{} & {} \int _{{\textbf{T}}}\int _{{\textbf{X}}}\int _{\varvec{\Xi }}\left( \partial _t\phi (t,{\textbf{x}},\varvec{\xi })\langle \mu _{(t,{\textbf{x}},\varvec{\xi })},{{\,\textrm{id}\,}}\rangle +\nabla _{{\textbf{x}}}\phi (t,{\textbf{x}},\varvec{\xi })\langle \mu _{(t,{\textbf{x}},\varvec{\xi })},{\textbf{f}}\rangle \right) d\rho (\varvec{\xi })d\textbf{x}dt\nonumber \\{} & {} \quad +\int _{{\textbf{X}}}\int _{\varvec{\Xi }}\phi (0,{\textbf{x}},\varvec{\xi })\langle \sigma _0,{{\,\textrm{id}\,}}\rangle d\rho (\varvec{\xi })d{\textbf{x}}-\int _{{\textbf{X}}}\int _{\varvec{\Xi }}\phi (T,{\textbf{x}},\varvec{\xi })\langle \sigma _T,{{\,\textrm{id}\,}}\rangle d\rho (\varvec{\xi })d{\textbf{x}}\nonumber \\{} & {} \quad - \int _{{\textbf{T}}}\int _{{\textbf{X}}} \int _{\varvec{\Xi }} \phi (t,{\textbf{x}},\varvec{\xi }) \langle \varvec{\gamma }, {\textbf{f}}(\cdot ,\varvec{\xi }) \rangle d\rho (\varvec{\xi }) d \textbf{x}dt=0. \end{aligned}$$
(11)

Proof

The proof of this lemma is discussed in [32], and the case of the Kruzhkov’s entropies is retrieved thanks to the boundedness of \({\textbf{U}}\). \(\square \)

Remark 2.17

Our numerical method shall not use all inequalities (10). Therefore, imposing (11) as an additional constraint may be beneficial in practice, see further discussion in Sect. 3.

Remark 2.18

(Imposing constraints on the boundary) To ensure concentration of \(\mu _{(t,x,\varvec{\xi })}\), in addition to the condition \(\sigma _0=\delta _{u_0(\cdot )}\), one may impose conditions on the boundary measures \((\gamma _{L,i})_{i=1}^n\) and \((\gamma _{R,i})_{i=1}^n\). The choice of boundary condition allows to ensure the absence of interaction with the boundary. We shall make the assumption that the trace of \(u_0\) on \(\Gamma _{B,i}\), noted \(\gamma _{B,i}(u_0)\) exists for all \(B\in \lbrace L,R\rbrace \) and all \(1\le i\le n\), and we at the same time notice that this trace does not depend on \(\varvec{\xi }\in \varvec{\Xi }\). We then want to impose that \(\gamma _{B,i}({\textbf{x}})=\delta _{\gamma _{B,i}(u_0)({\textbf{x}})}\) for almost all \({\textbf{x}}\in {\textbf{X}}\), for all \(1\le i\le n\) and for \(B\in \lbrace L,R\rbrace \).

Remark 2.19

(General Dirichlet boundary conditions) The first entropy weak formulation with Dirichlet boundary conditions has been proposed by [33], but it requires the existence of strong traces, so that it cannot be generalized to MV solutions. Later, Otto introduced boundary entropy-flux pairs in his PhD thesis. A short presentation is given in [34] while an extended analysis is available in [19]. This notion allowed Vovelle in [35] to show that the Otto’s framework can be reformulated via Kruzhkov semi-entropies and to extend the wellposedness theory of conservation laws on bounded domains to entropy process solutions, which is a similar concept to MV solutions (see also [36] for more results). Lastly, in order to express such a formulation as moment contraints, it suffices to follow the approach of doubling the number of measures in [16], recalled in Appendix B for the case of Kruzhkov entropies.

Let \(\nu \in {\mathcal {M}}({\textbf{K}})_+\) with \({\textbf{K}}:={\textbf{T}}\times {\textbf{X}}\times \varvec{\Xi }\times {\textbf{U}}\) defined by

$$\begin{aligned} d\nu (t,{\textbf{x}},\varvec{\xi },y)=dtd\textbf{x}d\rho (\varvec{\xi })\mu _{(t,{\textbf{x}},\varvec{\xi })}(dy) \end{aligned}$$
(12)

where \(\mu \) is a parametric entropy MV solution. The measure \(\nu \), called occupation measure (see [37]), has \(\lambda _{{\textbf{T}}}\otimes \lambda _{{\textbf{X}}}\otimes \rho \) for marginal in \((t,{\textbf{x}},\varvec{\xi })\), and \(\mu _{(t,{\textbf{x}},\varvec{\xi })}\) as the conditional measure in y given \((t,{\textbf{x}},\varvec{\xi })\). In the case where \(\mu _{(t,{\textbf{x}},\varvec{\xi })}(dy)=\delta _{u(t,{\textbf{x}},\varvec{\xi })}(dy)\), \(\nu \) is supported on the graph of the function u. We also introduce the time boundary measures

$$\begin{aligned}{} & {} d\nu _0(t,{\textbf{x}},\varvec{\xi },y):=\delta _0(dt)d\textbf{x}d\rho (\varvec{\xi })\sigma _0(dy),\nonumber \\{} & {} d\nu _T(t,{\textbf{x}},\varvec{\xi },y):=\delta _T(dt)d\textbf{x}d\rho (\varvec{\xi })\sigma _T(dy) \end{aligned}$$
(13)

whose supports are \({\textbf{K}}_0:=\lbrace 0\rbrace \times {\textbf{X}}\times \varvec{\Xi }\times {\textbf{U}}\) and \({\textbf{K}}_T:=\lbrace T\rbrace \times {\textbf{X}}\times \varvec{\Xi }\times {\textbf{U}}\) respectively. Similarly, we introduce the space boundary measures

$$\begin{aligned}&d\nu _{L,i}(t,{\textbf{x}},\varvec{\xi },y):=dt\delta _{\Gamma _{L,i}}(d{\textbf{x}})d\rho (\varvec{\xi }) \gamma _{L,i}(dy),\end{aligned}$$
(14)
$$\begin{aligned}&d\nu _{R,i}(t,{\textbf{x}},\varvec{\xi },y):=dt\delta _{\Gamma _{R,i}}(d{\textbf{x}})d\rho (\varvec{\xi })\gamma _{R,i}(dy) \end{aligned}$$
(15)

whose supports are given by \({\textbf{K}}_{L,i}:={\textbf{T}}\times \Gamma _{L,i}\times \varvec{\Xi }\times {\textbf{U}}\) and \({\textbf{K}}_{R,i}:={\textbf{T}}\times \Gamma _{R,i}\times \varvec{\Xi }\times {\textbf{U}}\) respectively, for \(1 \le i \le n\). For conciseness, we shall define the collection of measures \(\varvec{\nu }:=\{\nu ,\nu _0,\nu _T,(\nu _{L,i})_{i=1}^n,(\nu _{R,i})_{i=1}^n\}\).

It is known that measures with compact support are fully characterized by their moments, see e.g. [22, p.52]. Thus, marginal constraints on occupation measures \(\varvec{\nu }\) will be imposed through their moments, see details in Appendix A.

The introduction of the measure \(\nu \) allows us to rewrite the constraints (11) and (10). The equation (11) can be put in the following form

$$\begin{aligned} F(\phi ,\varvec{\nu }):= & {} \int _{{\textbf{K}}}\left( \partial _t\phi (t,{\textbf{x}},\varvec{\xi })y +\nabla _{{\textbf{x}}}\phi (t,{\textbf{x}},\varvec{\xi })\cdot {\textbf{f}}(y)\right) d \nu (t,{\textbf{x}},\varvec{\xi },y)\nonumber \\{} & {} +\int _{{\textbf{K}}}\phi (t,{\textbf{x}},\varvec{\xi })yd\nu _0(t,{\textbf{x}},\varvec{\xi },y) -\int _{{\textbf{K}}}\phi (t,{\textbf{x}},\varvec{\xi })yd\nu _T(t,{\textbf{x}},\varvec{\xi },y)\nonumber \\{} & {} +\sum _{i=1}^n\left( \int _{{\textbf{K}}}\phi (t,{\textbf{x}},\varvec{\xi })f_i(y)d\nu _{L,i} (t,{\textbf{x}},\varvec{\xi },y)\right. \nonumber \\{} & {} \left. -\int _{{\textbf{K}}}\phi (t,{\textbf{x}},\varvec{\xi })f_i(y)d\nu _{R,i} (t,{\textbf{x}},\varvec{\xi },y)\right) =0, \end{aligned}$$
(16)

where \(\phi \in {\mathcal {C}}(\varvec{\Xi };{\mathcal {C}}^1({\textbf{T}}\times {\textbf{X}}))\), and the equation (10) can be written

$$\begin{aligned} G(\phi ,\varvec{\nu },\eta ,\varvec{q}):= & {} \int _{{\textbf{K}}}\left( \partial _t\phi (t,{\textbf{x}}, \varvec{\xi })\eta (y)+\nabla _{{\textbf{x}}}\phi (t,{\textbf{x}},\varvec{\xi })\cdot {\textbf{q}}(y)\right) d \nu (t,{\textbf{x}},\varvec{\xi },y)\nonumber \\{} & {} +\int _{{\textbf{K}}}\phi (t,{\textbf{x}},\varvec{\xi })\eta (y)d\nu _0(t,{\textbf{x}},\varvec{\xi },y) -\int _{{\textbf{K}}}\phi (t,{\textbf{x}},\varvec{\xi })\eta (y)d\nu _T(t,{\textbf{x}},\varvec{\xi },y)\nonumber \\{} & {} +\sum _{i=1}^n\left( \int _{{\textbf{K}}}\phi (t,{\textbf{x}},\varvec{\xi })q_i(y)d\nu _{L,i} (t,{\textbf{x}},\varvec{\xi },y)\right. \nonumber \\{} & {} \left. -\int _{{\textbf{K}}}\phi (t,{\textbf{x}},\varvec{\xi })q_i(y)d\nu _{R,i} (t,{\textbf{x}},\varvec{\xi },y)\right) \ge 0, \end{aligned}$$
(17)

for entropy pairs \((\eta ,{\textbf{q}})\) in a family \({\mathcal {E}}\) and \(\phi \in {\mathcal {C}}(\varvec{\Xi };{\mathcal {C}}^1({\textbf{T}}\times {\textbf{X}}))\) non-negative test functions.

Remark 2.20

(On systems of conservation laws) When studying systems of conservation laws, the main difficulty is the lack of uniqueness theory. In particular, even if entropy inequalities are available, there is no hope to identify entropy measure-valued solutions with entropy weak solutions. Nevertheless, our method could be applied as such to systems of conservation laws.

3 Moment-SOS method for measure-valued solutions on compact sets

In the previous section, we introduced parametric measure-valued (MV) solutions for scalar hyperbolic equations, that are defined by equations (16)-(17). The aim of this section is to express these equations as constraints on the moments of the occupation measure and to explain how to approximate these moments based on the moment-SOS (Lasserre’s) hierarchy [22]. For that, we require the assumption that \({\textbf{f}}: {\mathbb {R}} \times \varvec{\Xi }\) is a polynomial function.

We will see in the next section how to extract from these moments some information on the solution u of the initial problem.

3.1 From weak formulations to moment constraints

The following lemma, derived from [16, Lemma 1], relies on density arguments, together with the fact that we are working with compact sets.

Lemma 3.1

Let \(\left\{ \phi ^{\varvec{\alpha }}\right\} _{\varvec{\alpha }\in {\mathbb {N}}^{n+p+1}}\) be a polynomial basis on \({\textbf{T}}\times {\textbf{X}}\times \varvec{\Xi }\). Then equation (16) is equivalent to

$$\begin{aligned} F(\phi ^{\varvec{\alpha }},\varvec{\nu })=0 \end{aligned}$$
(18)

for all \({\varvec{\alpha }}\in {\mathbb {N}}^{n+p+1}\), where F is defined in (16).

For \({\textbf{f}}\) a polynomial function, (18) provides constraints on linear combinations of moments of measures \(\varvec{\nu }\). In the case of a family of polynomial entropy pairs \({\mathcal {E}} \subseteq {\mathcal {E}}_P\), we can also express (17) as constraints on the moments of measures \(\varvec{\nu }\).

Lemma 3.2

Assume \(\left\{ \phi ^{\varvec{\alpha }}\right\} _{\varvec{\alpha }\in {\mathcal {F}}}\) for \({\mathcal {F}}\subset {\mathbb {N}}^{n+p+1}\) is a countable family of polynomials on \({\textbf{T}}\times {\textbf{X}}\times \varvec{\Xi }\) such that any non-negative polynomial can be decomposed on this family, with positive coefficients. Then, equation (17) is equivalent to

$$\begin{aligned} G(\phi ^{\varvec{\alpha }},\varvec{\nu },\eta ,{\textbf{q}})\ge 0 \end{aligned}$$
(19)

for all \({\varvec{\alpha }}\in {\mathcal {F}}\) and all \((\eta ,{\textbf{q}}) \in {\mathcal {E}}\).

Remark 3.3

Since, as stated in Lemma 2.16, equation (17) implies equation (16), then equation (19) implies equation (18) with an appropriate family of entropy pairs. It thus may seem redundant to enforce both, but, in the approximation method, the family of polynomials in Lemma 3.2 will be reduced, so that this implication is no more guaranteed and imposing (18) as additional constraints may be beneficial. An illustration is provided in Appendix C for the numerical example studied in Sect. 4.1.

The case \({\mathcal {E}}={\mathcal {E}}_K\) ensures concentration of the measure, as seen in Theorem 2.14, but we are faced with two issues: first, taking into account an uncountable family of functions parametrised by \(v\in {\textbf{U}}\) and, second, the absolute value function \(v\mapsto \vert v\vert \) is not a polynomial. To deal with the uncountable family of functions, we introduce v as a new variable. To treat the absolute value, we double the number of measures.

More precisely, we introduce as new unknowns Borel measures \(\vartheta ^+\) and \(\vartheta ^-\), whose supports are respectively defined by

$$\begin{aligned} \mathop {\textrm{supp}}\limits (\vartheta ^+)= & {} {\textbf{K}}^+: =\lbrace (t,{\textbf{x}},\varvec{\xi },y,v)\in {\textbf{K}}\times {\textbf{U}}:y\ge v\rbrace ,\\ \mathop {\textrm{supp}}\limits (\vartheta ^-)= & {} {\textbf{K}}^-:=\lbrace (t,{\textbf{x}},\varvec{\xi },y,v)\in {\textbf{K}}\times {\textbf{U}}:y\le v\rbrace , \end{aligned}$$

and impose the condition that \(\nu \otimes \lambda _{{\textbf{U}}} = \vartheta ^+ + \vartheta ^-\), which can be expressed as constraints between moments of \(\nu \), \(\vartheta ^+\) and \(\vartheta ^-.\) Similarly, we introduce time boundary measures \(\vartheta _0^+\), \(\vartheta _0^-\), \(\vartheta _T^+\) and \(\vartheta _T^-\), space boundary measures \((\vartheta _{L,i}^+)_{i=1}^n\), \((\vartheta _{L,i}^-)_{i=1}^n\), \((\vartheta _{R,i}^+)_{i=1}^n\) and \((\vartheta _{R,i}^-)_{i=1}^n\), and the corresponding constraints with measures \(\varvec{\nu }\). All those definitions are plainly written in Appendix B. We shall once again introduce a collection of measures

$$\begin{aligned} \varvec{\vartheta }:=(\vartheta ^+,\vartheta ^-,\vartheta _0^+, \vartheta _0^-,\vartheta _T^+,\vartheta _T^-,(\vartheta _{L,i}^+)_{i=1}^n, (\vartheta _{L,i}^-)_{i=1}^n,(\vartheta _{R,i}^+)_{i=1}^n,(\vartheta _{R,i}^-)_{i=1}^n). \end{aligned}$$

From [16, Lemma 2], equation (17) is equivalent to

$$\begin{aligned}{} & {} H(\phi ,\varvec{\vartheta }) :=\int _{{\textbf{K}}}\theta (v) \left( \partial _t\phi (t,{\textbf{x}},\varvec{\xi })(y-v)+\nabla _{{\textbf{x}}} \phi (t,{\textbf{x}},\varvec{\xi })\cdot ({\textbf{f}}(y)-{\textbf{f}}(v))\right) d\vartheta ^+\nonumber \\{} & {} \quad +\int _{{\textbf{K}}}\theta (v)\left( \partial _t\phi (t,{\textbf{x}},\varvec{\xi })(v-y) +\nabla _{{\textbf{x}}}\phi (t,{\textbf{x}},\varvec{\xi })\cdot ({\textbf{f}}(v) -{\textbf{f}}(y))\right) d\vartheta ^-\nonumber \\{} & {} \quad +\int _{{\textbf{K}}}\theta (v)\phi (t,{\textbf{x}},\varvec{\xi })(y-v)d\vartheta _0^+ +\int _{{\textbf{K}}}\theta (v)\phi (t,{\textbf{x}},\varvec{\xi })(v-y)d\vartheta _0^-\nonumber \\{} & {} \quad -\int _{{\textbf{K}}}\theta (v)\phi (t,{\textbf{x}},\varvec{\xi })(y-v)d\vartheta _T^+ -\int _{{\textbf{K}}}\theta (v)\phi (t,{\textbf{x}},\varvec{\xi })(v-y)d\vartheta _T^-\nonumber \\{} & {} \quad +\sum _{i=1}^n\left( \int _{{\textbf{K}}}\theta (v)\phi (t,{\textbf{x}},\varvec{\xi }) (f_i(y)-f_i(v))d\vartheta _L^+\right. \nonumber \\{} & {} \quad +\int _{{\textbf{K}}}\theta (v)\phi (t,{\textbf{x}}, \varvec{\xi })(f_i(v)-f_i(y))d\vartheta _L^-\nonumber \\{} & {} \quad -\int _{{\textbf{K}}}\theta (v)\phi (t,{\textbf{x}},\varvec{\xi })(f_i(y)-f_i(v)) d\vartheta _R^+\nonumber \\{} & {} \quad \left. -\int _{{\textbf{K}}}\theta (v)\phi (t,{\textbf{x}},\varvec{\xi })(f_i(v) -f_i(y))d\vartheta _R^-\right) \ge 0, \end{aligned}$$
(20)

for all non-negative test functions \(\phi \in {\mathcal {C}}^1({\textbf{T}}\times {\textbf{X}})\otimes {\mathcal {C}}(\varvec{\Xi })\) and all non-negative test functions \(\theta \in {\mathcal {C}}({\textbf{U}})\).

Lemma 3.4

Assume \(\left\{ \phi ^{\varvec{\alpha }}\right\} _{\varvec{\alpha }\in {\mathcal {F}}}\) is a countable family of polynomials on \({\textbf{T}}\times {\textbf{X}}\times \varvec{\Xi }\times {\textbf{U}}\) such that any non-negative polynomial can be decomposed on this family with positive coefficients. Then (20) is equivalent to

$$\begin{aligned} H(\phi ^{\varvec{\alpha }},\varvec{\vartheta })\ge 0 \end{aligned}$$
(21)

for all \({\varvec{\alpha }\in {\mathcal {F}}}\).

Proof

The proof relies on density arguments. \(\square \)

A particular family \(\left\{ \phi ^{\varvec{\alpha }}\right\} _{\varvec{\alpha }\in {\mathbb {N}}^{2(n+p+2)}}\) satisfying the assumption that any non-negative polynomial can be decomposed on this family with positive coefficients is given by

$$\begin{aligned}{} & {} \phi ^{\varvec{\alpha }}(t,{\textbf{x}},\varvec{\xi },v):=t^{\alpha _1}(T-t)^{\alpha _2} \prod _{i=1}^n\left( (x_i-L_i)^{\alpha _{2i+1}}(R_i-x_i)^{\alpha _{2(i+1)}}\right) \\{} & {} \quad \prod _{i=1}^p\left( (\xi _i)^{\alpha _{2i+2n+1}}(1-\xi _i)^{\alpha _{2(i+n+1)}} \right) (v-\underline{u})^{\alpha _{2n+2p+3}}({\overline{u}}-v)^{\alpha _{2(n+p+2)}} \end{aligned}$$

for \(\varvec{\alpha }\in {\mathbb {N}}^{2(n+p+2)}\). The proof follows the one of the Lemma 3 in [16], and uses Handelman’s Positivstellensatz [16].

3.2 Generalized moment problem

Roughly speaking, the Generalized Moment Problem (GMP) is an infinite-dimensional linear optimization problem on finitely many Borel measures \(\nu _i\in {\mathcal {M}}({\textbf{K}}_i)_+\), with \({\textbf{K}}_i\subseteq {\mathbb {R}}^{n_i}\), with \(i=1,...,N\) and \(n_i\in {\mathbb {N}}\). That is, one is interested in finding measures whose moments satisfy (possibly countably many) linear constraints and which minimize some criterion. In full generality, the GMP is intractable, but if all \({\textbf{K}}_i\) are basic semi-algebraic setsFootnote 1 and the integrands are polynomials, then one may provide an efficient numerical scheme to approximate as closely as desired any finite number of moments of optimal solutions of the GMP. It consists of solving a hierarchy of semi-definite programsFootnote 2 of increasing size. Convergence of this numerical scheme is guaranteed by invoking powerful results from real algebraic geometry, essentially positivity certificates, and further developed for many classical cases in [38, 39].

Let \(h_i\in {\mathbb {R}}[{\textbf{w}}^i]\) and \(h_{i,k}\in {\mathbb {R}}[{\textbf{w}}^i]\) be polynomials in the vector of indeterminates \({\textbf{w}}^i\in {\mathbb {R}}^{n_i}\) and let \(b_k\) be real numbers, for finitely many \(i=1,\ldots ,N\) and countably many \(k=1,2,\ldots \). The GMP is the following optimization problem over measures:

$$\begin{aligned} \begin{aligned} \inf _{\nu _1,\ldots ,\nu _N}&\sum _{i=1}^N\int _{{\textbf{K}}_i}h_id\nu _i =:\rho ^*\\ \text {s.t.}&\sum _{i=1}^N\int _{{\textbf{K}}_i}h_{i,k}d\nu _i\le b_k,\quad k=1,2,\ldots \\&\nu _i\in {\mathcal {M}}({\textbf{K}}_i)_+,\quad i=1,\ldots ,N. \end{aligned} \end{aligned}$$
(22)

3.3 From measures to moments and their approximation

Instead of optimizing over the measures in problem (22), we optimize over their moments. For simplicity and clarity of exposition, we describe the approach in the case of a single unknown measure \(\nu \), but it easily extends to the case of several measures. Let us consider the simplified GMP

$$\begin{aligned} \begin{aligned} \inf _\nu&\int _{{\textbf{K}}}hd\nu :=\rho ^*\\ \text {s.t.}&\int _{{\textbf{K}}}h_kd\nu \le b_k,\quad k=1,2,\ldots \\&\nu \in {\mathcal {M}}({\textbf{K}})_+, \end{aligned} \end{aligned}$$
(23)

where \(\textbf{K}\) is a compact set in \({\mathbb {R}}^n\), \(h\in {\mathbb {R}}[{\textbf{w}}]\), \(h_k\in {\mathbb {R}}[{\textbf{w}}]\) and \(b_k\in {\mathbb {R}}\) for all \(k=1,2,\dots \). The moment sequence \({\textbf{z}}=({\textbf{z}}_{\varvec{\alpha }})_{\varvec{\alpha }\in {\mathbb {N}}^n}\) of a measure \(\nu \in {\mathcal {M}}({\textbf{K}})_+\) is defined by

$$\begin{aligned} {\textbf{z}}_{\varvec{\alpha }}=\int _{{\textbf{K}}}{\textbf{w}}^{\varvec{\alpha }} d\nu ,\quad \varvec{\alpha }\in {\mathbb {N}}^n. \end{aligned}$$
(24)

Similarly, given a sequence \({\textbf{z}}=({\textbf{z}}_{\varvec{\alpha }})_{\varvec{\alpha }\in {\mathbb {N}}^n}\), if (24) holds for some \(\nu \in {\mathcal {M}}({\textbf{K}})_+\) we say that the sequence has the representing measure \(\nu \). Recall that measures on compact sets are uniquely characterized by their moments (see [22, p. 52]).

Remark 3.5

The use of canonical moments, i.e. associated with monomials, may be critical from a numerical point of view. Other polynomial bases with more favorable numerical properties could be considered. However, in the numerical experiments, we restrain ourselves to domains included in the unit hypercube, which moderates numerical instabilities.

Let \({\mathbb {N}}_d^n:=\lbrace \varvec{\alpha }\in {\mathbb {N}}^n:\vert \varvec{\alpha }\vert \le d\rbrace \), where \(\vert \varvec{\alpha }\vert :=\sum _{i=1}^n\alpha _i\), and \(n_d:=\left( {\begin{array}{c}n+d\\ d\end{array}}\right) \). A vector \({\textbf{p}}:=({\textbf{p}}_{\varvec{\alpha }})_{\varvec{\alpha }\in {\mathbb {N}}_d^n}\in {\mathbb {R}}^{n_d}\) is the coefficient vector (in the monomial basis) of a polynomial \(p\in {\mathbb {R}}[{\textbf{w}}]\) with degree \(d=\deg (p)\) expressed as \(p=\sum _{\varvec{\alpha }\in {\mathbb {N}}_{d}^n}{\textbf{p}}_{\varvec{\alpha }}{\textbf{w}}^{\varvec{\alpha }}\). Integrating p with respect to a measure \(\nu \) involves only finitely many moments:

$$\begin{aligned}{} & {} \int _{{\textbf{K}}}pd\nu =\int _{{\textbf{K}}}\sum _{\varvec{\alpha }\in {\mathbb {N}}_d^n}{\textbf{p}}_{\varvec{\alpha }}{\textbf{w}}^{\varvec{\alpha }} d\nu \\{} & {} \quad =\sum _{\varvec{\alpha }\in {\mathbb {N}}_d^n}{\textbf{p}}_{\varvec{\alpha }}\int _{{\textbf{K}}}{\textbf{w}}^{\varvec{\alpha }} d\nu \\{} & {} \quad =\sum _{\varvec{\alpha }\in {\mathbb {N}}_d^n}{\textbf{p}}_{\varvec{\alpha }}{\textbf{z}}_{\varvec{\alpha }}. \end{aligned}$$

Next, we define a pseudo-integration with respect to an arbitrary sequence \({\textbf{z}}\in {\mathbb {R}}^{{\mathbb {N}}^n}\) by

$$\begin{aligned} \ell _{{\textbf{z}}}(p):=\sum _{\varvec{\alpha }\in {\mathbb {N}}^n}{\textbf{p}}_{\varvec{\alpha }}{\textbf{z}}_{\varvec{\alpha }} \end{aligned}$$
(25)

and \(\ell _{{\textbf{z}}}\) is called the Riesz functional.

Theorem 3.6

(Riesz-Haviland [22, Theorem 3.1]) Let \({\textbf{K}}\subseteq {\mathbb {R}}^n\) be closed. A real sequence \({\textbf{z}}\in {\mathbb {R}}^{{\mathbb {N}}^{{n}}}\) is the moment sequence of some measure \(\nu \in {\mathcal {M}}({\textbf{K}})_+\), i.e. \({\textbf{z}}\) satisfies (24), if and only if \(\ell _{{\textbf{z}}}(p)\ge 0\) for all \(p\in {\mathbb {R}}[{\textbf{w}}]\) non-negative on \({\textbf{K}}\).

Assuming that \({\textbf{K}}\) is closed, we can reformulate thanks to this result the GMP (23) as a linear problem on moment sequences, namely

$$\begin{aligned} \begin{aligned} \inf _{{\textbf{z}}}\quad&\ell _{{\textbf{z}}}(h)=\rho ^*\\ \text {s.t.}\quad&\ell _{{\textbf{z}}}(h_k)\le b_k,\quad k=1,2,\ldots \\&\ell _{{\textbf{z}}}(p)\ge 0,\text { for all }p\in {\mathbb {R}} [{\textbf{w}}]\text { non-negative on }{\textbf{K}}. \end{aligned} \end{aligned}$$
(26)

Theorem 3.6 guarantees the equivalence between formulations (26) and (23). However, the latter reformulation is still numerically intractable.

From non-negative polynomials to sums of squares

Characterizing non-negativity of polynomials is an important issue in real algebraic geometry. Let \({\textbf{K}}\) be a basic semi-algebraic set, i.e.

$$\begin{aligned} {\textbf{K}}=\lbrace {\textbf{w}}\in {\mathbb {R}}^n:g_1({\textbf{w}})\ge 0,\ldots ,g_m({\textbf{w}})\ge 0\rbrace \end{aligned}$$
(27)

for some polynomials \(g_1,\ldots ,g_m\in {\mathbb {R}}[{\textbf{w}}]\), and assume that \({\textbf{K}}\) is compact. In addition assume that one of the polynomials, say the first one, is \(g_1({\textbf{w}}):=N-\sum _{i=1}^n w_i^2\) for some N sufficiently largeFootnote 3. For notational convenience we let \(g_0({\textbf{w}}):=1\).

We say that a polynomial \(s\in {\mathbb {R}}[{\textbf{w}}]\) is a sum of squares (SOS) if there are finitely many polynomials \(q_1,\ldots ,q_r\) such that \(s({\textbf{w}})=\sum _{j=1}^rq_j({\textbf{w}})^2\) for all \({\textbf{w}}\).

Theorem 3.7

(Putinar’s Positivstellensatz) If \(p>0\) on the basic semi-algebraic compact set \({\textbf{K}}\) defined by (27) with \(g_1({\textbf{w}}):=N-\sum _{i=1}^n w_i^2\), then \(p=\sum _{j=0}^ms_jg_j\) for some SOS polynomials \(s_j\in {\mathbb {R}}[{\textbf{w}}],j=0,1,\ldots ,m\).

By a density argument, checking non-negativity of \(\ell _{{\textbf{z}}}\) on polynomials non-negative on \({\textbf{K}}\) can be replaced by checking non-negativity only on polynomials that are strictly positive on \({\textbf{K}}\) and hence on those that have a SOS representation as in Theorem 3.7.

For a given integer d, denote by \(\Sigma [{\textbf{w}}]_d\subset {\mathbb {R}}[{\textbf{w}}]\) the set of SOS polynomials of degree at most 2d, and define the cone \(Q_d(g)\subset {\mathbb {R}}[{\textbf{w}}]\) for \(g=(g_0,\ldots ,g_m)\) by

$$\begin{aligned} Q_d(g):=\left\{ \sum _{j=0}^m\sigma _jg_j:\deg (\sigma _jg_j)\le 2d,\sigma _j\in \Sigma [{\textbf{w}}]_d,j=0,1,\ldots ,m\right\} \end{aligned}$$
(28)

and observe that \(Q_d(g)\) consists of polynomials which are non-negative on \({\textbf{K}}\).

Let \(\textbf{b}_d({\textbf{w}}):=({\textbf{w}}^{\varvec{\alpha }})_{\vert \varvec{\alpha }\vert \le d}\in {\mathbb {R}}[{\textbf{w}}]^{n_d}\) be the vector of monomials of degree at most d. We recall that \(n_d\) denotes the binomial number \(\left( {\begin{array}{c}n+d\\ n\end{array}}\right) \). For \(j=0,...,m\), let \(d_j=\lceil \deg (g_j)/2\rceil \), let \(M_{d-d_j}(g_j\textbf{z})\) denote the real symmetric matrix linear in \(\textbf{z}\) corresponding to the entrywise application of \(\ell _{\textbf{z}}\) to the matrix with polynomial entries \(g_j\textbf{b}_{d-d_j}({\textbf{w}})\textbf{b}_{d-d_j}^T({\textbf{w}})\). For \(j=0\) and \(g_0=1\), the matrix \(M_{d}(\textbf{z}) = \ell _{{\textbf{z}}}(\textbf{b}_d \textbf{b}_d^T)\) (where \(\ell _{{\textbf{z}}}\) is applied entrywise) is called the moment matrix. For any other value of j, it is called a localizing matrix. It turns out that, for all \(j=0,1,\ldots ,m\), \(\ell _{{\textbf{z}}}(g_jq^2)\ge 0\) for all \(q\in {\mathbb {R}}[{\textbf{w}}]_d\) if and only if \(M_{d-d_j}(g_j\textbf{z})\succeq 0\), which are convex linear matrix inequalities in \({\textbf{z}}\) and where \(\succeq \) denotes the positive semi-definite (or Loewner) order.

Moment-SOS hierarchy

The following finite-dimensional semi-definite programming (SDP) problems are relaxations of the moment problem (26):

$$\begin{aligned} \begin{aligned} \inf _{{\textbf{z}}\in {\mathbb {R}}^{n_{2d}}}\quad&\ell _{{\textbf{z}}}(h):=\rho ^*_d\\ \text {s.t.}\quad&\ell _{{\textbf{z}}}(h_k)\le b_k,\deg (h_k)\le 2d,k=1,2,\ldots \\&M_{d-d_j}(g_j{\textbf {z}})\succeq 0,j=0,1,\ldots ,m \end{aligned} \end{aligned}$$
(29)

and they are parametrized by the relaxation degree \(d\ge \max _{j=0,\ldots ,m}d_j\).

Theorem 3.8

(Convergence of the moment-SOS hierarchy, [38, Theorem 7]) Suppose that\(\ {\textbf{K}}\) is a basic semi-algebraic compact set. Further assume that there exists \(C>0\) such that for any \(d\in {\mathbb {N}}\), if \({\textbf{z}}^{d}\in {\mathbb {R}}^{n_{2d}}\) is solution of (29), then \(z^d_{{\textbf{0}}}\le C\), with C independent of d. Finally assume that there exists a unique solution \(\nu ^*\in {\mathcal {M}}({\textbf{K}})_+\) to problem (23). Then there exists a sequence \(({\textbf{z}}^d)_{d}=(({\textbf{z}}^d_{\varvec{\alpha }})_{\varvec{\alpha }\in {\mathbb {N}}^{n_{2d}}})_{d}\) such that \(\ell _{{\textbf{z}}^d}(h)=\rho _d^*\) and for all \(\varvec{\alpha }\in {\mathbb {N}}^{n}\)

$$\begin{aligned} {\textbf{z}}_{\varvec{\alpha }}^d\underset{d\rightarrow \infty }{\longrightarrow }\int _{{\textbf{K}}}{\textbf{w}}^{\varvec{\alpha }}d\nu ({\textbf{w}}). \end{aligned}$$
(30)

In particular, one has \(\rho _d^*\rightarrow \rho ^*\) as \(d\rightarrow \infty \).

3.4 Application to our problem

Entropy MV solution as a GMP

In the scalar hyperbolic case, the measures \(\nu _i\) under consideration are from the collection \(\varvec{\nu }\), or \(\varvec{\nu }\) and \(\varvec{\vartheta }\) when considering Kruzhkov’s entropies. The sets \({\textbf{K}}_i\) all correspond to \({\textbf{K}}={\textbf{T}}\times {\textbf{X}}\times \varvec{\Xi }\times {\textbf{U}}\). The polynomials \(h_{i,j}\) are given in (18) (conservation law), (19) when considering polynomial entropy pairs or (21) (and compatibility conditions between \(\varvec{\nu }\) and \(\varvec{\vartheta }\) (47) and similar equations) when considering Kruzhkov entropy pairs (entropy inequalities), and (38)-(41) (marginal constraints). For the sake of readibility, we shall only consider the case of polynomial entropies and a formulation only on measures \(\varvec{\nu }\).

We may also define an objective functional

$$\begin{aligned}{} & {} \int _{{\textbf{K}}}hd\nu +\int _{{\textbf{K}}}h_0d\nu _0 +\int _{{\textbf{K}}}h_Td\nu _T +\sum _{i=1}^n\left( \int _{{\textbf{K}}}h_{L,i}d\nu _{L,i} +\int _{{\textbf{K}}}h_{R,i}d\nu _{R,i}\right) ,\nonumber \\ \end{aligned}$$
(31)

with h, \(h_0\), \(h_T\), \((h_{L,i})_{i=1}^n\), \((h_{R,i})_{i=1}^n\in {\mathbb {R}}[t,{\textbf{x}},\varvec{\xi },y]\).

If the initial measure is concentrated on the graph of the initial condition and if, in addition, one imposes suitable boundary measures as exposed in Remark 2.18, then the choice of the objective functional is not crucial to recover the entropy MV solution of scalar hyperbolic PDE. Indeed, as a consequence of Theorem 2.14, the corresponding Young measure is concentrated: there is nothing to be optimized. However, our aim is to approximate the GMP by a finite dimensional optimization problem in order to solve it numerically and, then, the choice of the objective functional will impact the convergence of the corresponding relaxations. From experimental observations, two objective functionals seem to produce interesting results: the maximum of the opposite of the entropy constraints and the minimum of the trace of moment matrix. Choosing the latter seems to be a good heuristic: minimizing the nuclear norm of a matrix leads to reducing its rank (see [40]), which tends to favorise measures with localized support. However, there is up to date still no proof of a general effective functional.

Finally, one is able to define a GMP:

$$\begin{aligned} \begin{aligned}&\inf _{\nu ,\nu _T}{} & {} (31)\text { (objective functional)}\\&\text {s.t.}{} & {} (18)\text { (conservation law)},\\{} & {} {}&(19)\text { (entropy inequality)},\\{} & {} {}&(38{-}41)\text { (marginal constraints)}, \end{aligned} \end{aligned}$$
(32)

where the infimum is taken over measures \(\nu \in {\mathcal {M}}({\textbf{K}})_+,\nu _T\in {\mathcal {M}}({\textbf{K}}_T)_+\).

Theorem 3.8 extends to the case of multiple measures, as discussed in [22] and shown in [38]. Note that the compact sets \({\textbf{T}}\), \({\textbf{X}}\), \(\varvec{\Xi }\) and \({\textbf{U}}\) as defined before can be expressed as basic semi-algebraic compact sets, so that \({\textbf{K}}\) is also a basic semi-algebraic compact set:

$$\begin{aligned} \begin{aligned}&{\textbf{T}}=\lbrace t\in {\mathbb {R}}:t(T-t)\ge 0\rbrace ,\\&{\textbf{X}}=\lbrace {\textbf{x}}\in {\mathbb {R}}:(x_1-L_1)(R_1-x_1)\ge 0,\dots ,(x_n-L_n)(R_n-x_n)\ge 0\rbrace ,\\&\varvec{\Xi }=\lbrace \varvec{\xi }\in \varvec{\Xi }:\xi _1(1-\xi _1)\ge 0,\ldots ,\xi _p(1-\xi _p)\ge 0\rbrace ,\\&{\textbf{U}}=\lbrace y\in {\mathbb {R}}:(y-\underline{u})({\overline{u}}-y)\ge 0\rbrace . \end{aligned} \end{aligned}$$
(33)

Moreover, the constraint for \(\varvec{\alpha }={\textbf{0}}\) (see equation (38) in Appendix A) yields the relaxed linear constraint \({\textbf{z}}_{{\textbf{0}}}=\ell _{{\textbf{z}}}(1)=\int _{{\textbf{T}}\times {\textbf{X}}\times \varvec{\Xi }}dtdxd\rho (\varvec{\xi })\le \vert {\textbf{T}}\vert \vert {\textbf{X}}\vert \). Finally, supposing that \(\sigma _0\) is concentrated on the graph of the weak-parametric entropy solution, (32) admits a unique solution. Hence the hypotheses of Theorem 3.8 are satisfied.

Then, optimal solutions of the moment-SOS hierarchy (29) (adapted to the present context) converge to optimal solutions of (32) as d goes to infinity. In particular, one may extract the MV solution of (11), provided that \(\sigma _0\), \(\gamma _{L,i}\) and \(\gamma _{R,j}\) are concentrated for \(1\le i\le n\), as already discussed in Remark 2.18.

3.5 Post-processing quantities of interest

We have seen in the previous section how to obtain approximate sequences \({\textbf{z}}^d\) of moments of the measure \(\nu \) on \({\textbf{K}}\), such that \(d\nu (t,{\textbf{x}}, \varvec{\xi }, y) = d\mu _{t,{\textbf{x}}, \varvec{\xi }}(y) dt d{\textbf{x}} d\rho (\varvec{\xi })\) where \(\mu \) is the measure-valued solution supported on the graph of the solution. In this section, we present how to construct an approximation of the function u thanks to the Christoffel–Darboux function and its ability to estimate the support of a measure (see [41] for further details). Also, we show how to obtain approximations of statistical moments of variables of interest that are functions of the solution, possibly using a moment completion technique and the Christoffel–Darboux function.

3.5.1 Approximation of the graph of the solution

We consider that we have obtained an approximation \({\textbf{z}}^d\) of the moments of order 2d of the measure \(\nu \), which is a measure supported on the graph of the function \(u(t,\textbf{x},\varvec{\xi })\). In order to approximate the function from the moments, we rely on an approximate Christoffel–Darboux function associated with the measure (that has to be carefully defined), which tends to take high values on the support of the measure. Thus, finding the minimizers of the approximate inverse Christoffel–Darboux function for given \((t,{\textbf{x}},\varvec{\xi })\in {\textbf{T}}\times {\textbf{X}}\times \varvec{\Xi }\) gives an approximation of \(u(t,{\textbf{x}},\varvec{\xi })\). For \(\textbf{w} = (t,{\textbf{x}},\varvec{\xi }, y) \in {\textbf{K}}\), we let \(\textbf{b}_d(\textbf{w})\) be a basis of monomials of order up to d and \(M_d(\textbf{z}^d)=\ell _{{\textbf{z}}^d}(\textbf{b}_d(\cdot )\textbf{b}_d(\cdot )^T) \) be the corresponding moment matrix, that is the Gram matrix of the basis \(\textbf{b}_d(\textbf{w})\) for the measure \(\nu ^d\) corresponding to \(\textbf{z}^d\). When \(M_d(\textbf{z}^d)\) is invertible, the inverse Christoffel–Darboux function is defined by

$$\begin{aligned} q_{\nu ^d}({\textbf{w}}) = \textbf{b}_d(\textbf{w})^T M_d(\textbf{z}^d)^{-1} \textbf{b}_d(\textbf{w}) = \sum _{i=1}^{n_d} \lambda _i^{-1} (\textbf{b}_d(\textbf{w})^T{\textbf{v}}_i)^2 \end{aligned}$$

where the \((\lambda _i,\textbf{v}_i)\) are eigenpairs of \(M_d(\textbf{z}^d)\), and the polynomials \(p_i(\textbf{w}) = \lambda _i^{-1/2} \textbf{b}_d(\textbf{w})^T{\textbf{v}}_i\) form an orthonormal basis of the space of polynomials of order d in \(L^2_{\nu ^d}(\textbf{K})\). In the case where \(M_d(\textbf{z}^d)\) is singular, a regularization is introduced by considering the function

$$\begin{aligned} q_{\nu ^d,\beta }({\textbf{w}}) = \textbf{b}_d(\textbf{w})^T (M_d(\textbf{z}^d) + \beta {\textbf{I}}) ^{-1} \textbf{b}_d(\textbf{w}) = \sum _{i=1}^{n_d} (\lambda _i + \beta )^{-1} (\textbf{b}_d(\textbf{w})^T{\textbf{p}}_i)^2, \end{aligned}$$

which turns out to be the inverse Christoffel–Darboux function of a measure \(\nu ^d + \beta \nu _0\), where \(\nu _0\) is the measure on \({\textbf{K}}\) for which the monomials form an orthonormal family (see [24]). Exploiting the fact that \(q_{\nu ^d + \beta \nu _0}\) tends to take low values on the graph of u, an approximation of u is defined by

$$\begin{aligned} f_{\beta ,d}(t,{\textbf{x}}, \varvec{\xi }) \in \arg \min _{y\in {\textbf{U}}} q_{\nu ^d + \beta \nu _0}(t,{\textbf{x}}, \varvec{\xi },y). \end{aligned}$$

Further information can be found in [24].

Remark 3.9

In this paper, we consider polynomial moments of the occupation measure. This allows us to exploit the localization property of the associated Christoffel functions and to estimate the graph of the solution a posteriori. The use of moments associated with other functions, such as piecewise polynomials, could probably be considered as well (see [42] for the use of piecewise polynomial moments and a short review on the use of other types of moments).

3.5.2 Statistical moments of variables of interest

Considering \(\varvec{\xi }\) as a random parameter, one may be interested in computing the expectation of some variable of interest \(Q(\varvec{\xi }) = F(u(\cdot ,\cdot ,\varvec{\xi }); \varvec{\xi })\), where \(F(\cdot ,\varvec{\xi })\) is a real-valued function taking as input time-space functions. In some particular situations, it is possible to directly obtain an estimation of this quantity from the moments \({\textbf{z}}^d\). In particular, this is the case when

$$\begin{aligned} Q(\varvec{\xi }) = \int _{{\textbf{T}} \times {\textbf{X}}} G(u(t,{\textbf{x}}, \varvec{\xi }), t,{\textbf{x}}, \varvec{\xi }) dt d{\textbf{x}}, \end{aligned}$$

with G is polynomial since then

$$\begin{aligned} {\mathbb {E}}(Q(\varvec{\xi })) = \int _{{\textbf{T}} \times {\textbf{X}} \times \varvec{\Xi }} G({\textbf{w}}) d\nu ({\textbf{w}}) \approx \ell _{{\textbf{z}}^d}(G). \end{aligned}$$

We may also be interested in obtaining statistical moments of the solution \(u(t,{\textbf{x}}, \varvec{\xi })\) at different points \((t, {\textbf{x}})\), which is not a variable of interest in the above format. Of course, these quantities can be estimated from point-wise evaluations of u based on the technique presented in the previous section. However, an alternative approach is possible to estimate the statistical moments

$$\begin{aligned} \int _{\varvec{\Xi }}u(t,{\textbf{x}},\varvec{\xi })^kd\rho (\varvec{\xi }):= f_k(t,{\textbf{x}}) \end{aligned}$$
(34)

for all \((t,{\textbf{x}})\in {\textbf{T}}\times {\textbf{X}}\), from the the approximate moments \({\textbf{z}}^d\) of the measure \(\nu \). We know that the measure \(\nu \) can be disintegrated into its marginal \(\lambda _{{\textbf{T}}}\otimes \lambda _{{\textbf{X}}}\) and its conditional measure \(d\nu ( \varvec{\xi }, y\vert t,{\textbf{x}})\), such that \(d\nu (t,{\textbf{x}}, \varvec{\xi }, y) = d\nu ( \varvec{\xi }, y\vert t,{\textbf{x}}) dt d {\textbf{x}}.\)

We assume that \(f_k(t,{\textbf{x}})\) takes values in a compact set \({\textbf{F}}:=[\underline{F},{\overline{F}}]\) which can be easily obtained in terms of \({\textbf{U}}\) and k. We then let \(\lbrace \widetilde{g_j}\rbrace _{j=1}^m\), \(m\in {\mathbb {N}}\), be polynomials that describe the semi-algebraic compact set \({\textbf{T}}\times {\textbf{X}}\times {\textbf{F}}\). Letting \({\textbf{z}}\) be the sequence of moments of \(\nu \), we may notice that for all \(\varvec{\alpha } = (\alpha _1, \alpha _2)\in {\mathbb {N}}^{n+1}_{2d-k}\),

$$\begin{aligned} {\textbf{z}}_{\alpha _1,\alpha _2,0,k}= & {} \int _{{\textbf{T}}}\int _{{\textbf{X}}}t^{\alpha _1}{\textbf{x}}^{\alpha _2}f_k(t,{\textbf{x}})d\textbf{x}dt\\= & {} \int _{{\textbf{T}}}\int _{{\textbf{X}}}\int _{{\textbf{F}}}t^{\alpha _1}{\textbf{x}}^{\alpha _2}y\delta _{f_k(t,{\textbf{x}})}(dy)d\textbf{x}dt. \end{aligned}$$

Our goal is then here to approximate the support of the measure \(\delta _{f_k(t,{\textbf{x}})}(dy) d{\textbf{x}} dt\) from its moments \(\varvec{\omega }\) in order to recover the graph of \(f^k(t,{\textbf{x}})\). We are faced with the issue that the information we have on the moments is incomplete, namely, we only have the moments \(\omega _{\varvec{\alpha },0}\) for \(\varvec{\alpha }\in {\mathbb {N}}^{n+1}_{2d}\) and \(\omega _{\varvec{\alpha },1}\) for \(\varvec{\alpha }\in {\mathbb {N}}^{n+1}_{2d-k}\). Following [25], we introduce the following finite-dimensional semi-definite programming (SDP) problems to recover the graph of \(f_k(t,{\textbf{x}})\) from incomplete moment information:

$$\begin{aligned} \begin{aligned}&\inf _{\varvec{\omega }\in {\mathbb {R}}^{(n+2)_d}}{} & {} \text {Tr}(M_d(\varvec{\omega }))\\&\text {s.t. }{} & {} \omega _{\varvec{\alpha },0}=z^d_{\alpha _1,\alpha _2,0,0},\quad \forall \varvec{\alpha }\in {\mathbb {N}}_{2d}^{n+1}\\{} & {} {}&\omega _{\varvec{\alpha },1}=z^d_{\alpha _1,\alpha _2,0,k},\quad \forall \varvec{\alpha }\in {\mathbb {N}}_{2d-k}^{n+1}\\{} & {} {}&M_{d-d_j}(\widetilde{g_j}\varvec{\omega })\succeq 0, \quad j=0,...,m, \end{aligned} \end{aligned}$$
(35)

where \(\text {Tr}(M)\) denotes the trace of a matrix M. We recall that \(M_d(\varvec{\omega })\) denotes the moment matrix of \(\varvec{\omega }\). From this, we can compute the corresponding Christoffel–Darboux approximation of \(f_k\), following the approach of the previous section, see [24, 25].

4 Numerical examples

For numerical illustration, we consider Burgers-type equations with parametrised initial condition or parametrised flux.

The choice of entropy pairs is important to ensure uniqueness of the solution. Implementing Kruzkhov’s entropy pairs is possible (as seen in Sect. 3.1), but computationally heavy since it requires a reformulation with measures in higher dimension. It is known that the entropy \(\eta (y)=y^2\) provides sufficient constraints to ensure uniqueness of the entropy solution for Burgers equation [26]. Then, instead of using Kruzkhov’s pairs, we here rely on the following family of polynomial entropies:

$$\begin{aligned} \eta _l(y)=y^{2l},\quad \forall l\in {\mathbb {N}} \end{aligned}$$

and the corresponding polynomial functions \(\textbf{q}_l\). As an objective function, we choose the trace of the moment matrix (see discussion in section 3.4).

Numerical experiments are performed with the Matlab interface Gloptipoly3 [43].

In order to approximate the graph of solutions u, we use the method described in Sect. 3.5.1. Numerically, the optimization of the Christoffel function is achieved through a discretization of \({\textbf{T}}\), \({\textbf{X}}\), \(\varvec{\Xi }\) and \({\textbf{U}}\) and the computation of the Christoffel function at each point of the grid. We set the value of the regularization parameter \(\beta \) to \(10^{-7}\).

Remark 4.1

(On the invertibility of the moment matrix) Imposing that the moment matrix is positive semi-definite does not guarantee its invertibility, hence the regularization. However, the regularized matrix may be poorly conditioned for high values of relaxation order d, but we do not directly manipulate the ill-conditioned matrix. In order to obtain the Christoffel–Darboux kernel, we compute a spectral decomposition of the non-regularized matrix and use the inverse of shifted eigenvalues. This seems to mitigate numerical instabilities. However, a further stability analysis should be required.

We shall in the following denote by \(\widetilde{u_d}\) the Christoffel–Darboux approximation of the solution using approximate moments from a degree d of the hierarchy, and by u the exact solution of our Riemann problem.

Remark 4.2

(On computational complexity) In our numerical experiments, we used an interior-point algorithm to solve SDP problems, whose complexity is analyzed in [44]. Let \(q_d\) be the number of unknown moments of a measure. Our SDP problem has semi-positive inequalities on matrices \(M_{d-d_j} \in {\mathbb {R}}^{r_i \times r_i}\), \(0\le j \le m\), with \(r_j \le q_d/2\). Letting \(r=\sum _{j=0}^mr_j\), the complexity of the interior-point algorithm is \(O(\sqrt{r}(q_d^2\sum _{j=0}^mr_j+q_d\sum _{j=0}^mr_j^3))\). Thus, the complexity is \(O( q_d^{9/2})\).

Remark 4.3

(Curse of dimension) For a relaxation degree d, the number of unknown moments of a measure is \(q_d=\left( {\begin{array}{c}d+ n+p+2\\ d\end{array}}\right) = O(d^{n+p+2})\). Thus from Remark 4.2, we deduce that the complexity of the interior-point algorithm is \(O(d^{\frac{9}{2}(n+p+2)})\). To circumvent the curse of dimension and address problems with high dimension \(n+p+2\), we should exploit low-dimensional structures in the set of moments, such as sparsity [45] or low-rankness. This will be addressed in future works.

Remark 4.4

Mesh-based methods can be used to approximate solutions in terms of the physical variables and the parameters, also facing the curse of dimension. Due to the presence of discontinuities in terms of the physical variables and the parameters (not necessarily aligned with the coordinates), adaptive mesh refinement methods are required, leading to prohibitive computational cost in high dimension. Our method is mesh-free and seems to capture well discontinuities. Further comparisons need to be performed in future works.

Remark 4.5

(Obtaining the moment constraints) We here consider problems with polynomial or piecewise polynomial data, that allowed us to compute exactly the moments of the given measures \(\sigma _0,\gamma _{L,i}\) and \(\gamma _{R,i}\), \(1\le i\le n\). For more complicated data and high dimensional problems, numerical integration methods could be required, such as Monte Carlo methods.

4.1 Riemann problem for the Burgers equation with parametrised initial condition

As a first example, we consider the classical one-dimensional Riemann problem (see e.g., [46]) for a Burgers equation, with a parameter-independent flux

$$\begin{aligned} {\textbf{f}}(u)=\frac{1}{2}u^2. \end{aligned}$$

and where we parametrise the initial position of the shock, taking

$$\begin{aligned} u_0(x,\xi )=\left\{ \begin{aligned} 1\text { if }x<\frac{1}{4}(\xi -1),\\ 0\text { if }x\ge \frac{1}{4}(\xi -1). \end{aligned} \right. \end{aligned}$$

with a parameter \(\xi \) taking values in \(\varvec{\Xi }=[0,1]\). We know that the solution takes values in \({\textbf{U}}=[0,1]\). The time-space window on which we consider the solution is \({\textbf{T}}=[0,\frac{1}{2}]\) and \({\textbf{X}}=[-\frac{1}{2},\frac{1}{2}]\).

The unique solution is

$$\begin{aligned} u(t,x,\xi )=\left\{ \begin{aligned} 1\text { if }x<\frac{1}{4}(\xi -1)+\frac{t}{2},\\ 0\text { if }x\ge \frac{1}{4}(\xi -1)+\frac{t}{2}, \end{aligned} \right. \end{aligned}$$
(36)

Equipping \(\varvec{\Xi }\) with the Lebesgue measure on [0, 1], it yields the following statistical moments

$$\begin{aligned} \begin{aligned} f_k(t,x)&= \int _{\varvec{\Xi }}u(t,x,\xi )^k d\rho (\xi )\\&=1-\min (1,\max (0,1-2t+4x))+0^k\min (1,\max (0,1-2t+4x)), \end{aligned} \end{aligned}$$

for all \(k\in {\mathbb {N}}\), for all \((t,x)\in {\textbf{T}}\times {\textbf{X}}\). We may notice that in this simple case, \(f_k\) is independent on k for \(k\ge 1\).

We recall that at relaxation degree d, the number of unknown moments \(2q_d\le 2\left( {\begin{array}{c}d+ n+p+2\\ d\end{array}}\right) \). Indeed, each measure is expected to yield \(q_d\) moments, and we optimize over the two measures \(\nu \) and \(\nu _T\). However, \(\nu _T\) has less unknown moments, since it is supported on \({\textbf{K}}_T\) and some of its moments are dependant.

Retrieving the graph of the solution

Fig. 1 shows the graphs of the approximate solution \(\widetilde{u_d}(t,x,0)\) for \((t,x)\in {\textbf{T}}\times {\textbf{X}}\) (so that the shock is initially located at \(x=-\frac{1}{4}\)), with hierarchy’s degree \(d=2,5,8\).

Fig. 1
figure 1

Graphs of the approximate solution \(\widetilde{u_d}(t,x,0)\) for \(d=2,5,8\)

Fig. 2 shows the graphs of the approximate solution \(\widetilde{u_d}(\frac{1}{4},x,\xi )\) for \(x\in {\textbf{X}}\) and \(\xi =0,1\) (so that the shock is initially located at \(x=-\frac{1}{4}\) and \(x=0\) respectively), with relaxation degree \(d=2,5,8\), superposed with the exact solution.

Fig. 2
figure 2

Graphs of the approximate solution \(\widetilde{u_d}(\frac{1}{4},x,\xi )\) for \(d=2,5,8\) superposed with the exact solution

We see that our approximation is almost indistinguishable from the exact solution for \(d=5\), and indistinguishable from the exact solution \(d=8\). We observe the same results as in [16], where discontinuities are very well resolved as early as \(d=5\).

Error estimation

We choose to compute two different errors of our approximate solution.

\(l^1({\textbf{T}}\times {\textbf{X}}\times \varvec{\Xi })\) error We randomly pick 25 values in \(\varvec{\Xi }\), and consider 25 equidistant values in \({\textbf{T}}\) and \({\textbf{X}}\). We denote the test sets \(\varvec{\Xi }_e\), \({\textbf{T}}_e\) and \({\textbf{X}}_e\) respectively. We study the evolution of the relative \(l^1\) error with respect to the degree d of the hierarchy. Namely, we are interested in

$$\begin{aligned} e_g(d):=\frac{\Vert u-\widetilde{u_d}\Vert _{l^1({\textbf{T}}_e\times {\textbf{X}}_e\times \varvec{\Xi }_e)}}{\Vert u\Vert _{l^1({\textbf{T}}_e\times {\textbf{X}}_e\times \varvec{\Xi }_e)}}. \end{aligned}$$

The results are presented in Table 1 and on Fig. 3.

Table 1 Number of unknowns \(q_d\) and error \(e_g(d)\) for \(d=2,\dots ,8\)
Fig. 3
figure 3

Evolution of the error \(e_g\) with relaxation degree d

We observe a fast convergence of the error for small values of d. The convergence is not monotone and rather slow for high values of d. It may thus seem interesting to investigate where the errors are concentrated in our approximation. For illustrative purpose, we plot the distributed error \(\varepsilon (t,x)=\vert \widetilde{u_5}(t,x,0.2)-u(t,x,0.2)\vert \) for \((t,x)\in {\textbf{T}}_e\times {\textbf{X}}_e\) on Fig. 4. We observe that the errors are mostly concentrated around the shock, but it is noticeable that the closer to the time boundaries, the worse they are.

Fig. 4
figure 4

Graph of the error \(\varepsilon (t,x)=\vert \widetilde{u_5}(t,x,0.2)-u(t,x,0.2)\vert \)

We observe similar results on other numerical tests, although for smaller values of d we also observe large errors near spatial boundaries.

On the impact of the regularization parameter

The choice of the regularization parameter is an open question. In our experiments we chose to work with \(\beta =10^{-7}\), which avoids numerical instabilities. The results can be improved with a suitable choice of \(\beta \). For illustrative purpose, we represent the evolution of the error \(e_g\) for different values of \(\beta \) in Table 2. We define \(\beta _m^d:=1.001\times \vert \lambda _m^d\vert \), \(\lambda _{m}^d\) the minimal eigenvalue of the moment matrix obtained for a hierarchy of degree \(d\). For \(d\ge 6\), \(\lambda _m^d<0\) and minimizing the Christoffel–Darboux kernel without regularization is unstable.

Table 2 Error \(e_g(d)\) for \(d=2,\dots ,8\) for different choices of \(\beta \)

\(l^1({\textbf{T}}\times {\textbf{X}})\) error for different parameter values We consider four different values of the parameter \(\xi \in \varvec{\Xi }_e:=(0,0.2,0.6,1)\) (which correspond to a shock initially located at \(x=-0.25\), \(x=-0.2\), \(x=-0.1\) and \(x=0\)), and 100 equidistant points in \({\textbf{T}}\) and \({\textbf{X}}\), denoting the test sets \({\textbf{T}}_e\) and \({\textbf{X}}_e\) respectively. We then choose to study, for each \(\xi _e\in \varvec{\Xi }_e\), the evolution of the relative \(l^1({\textbf{T}}_e\times {\textbf{X}}_e)\) error with respect to the degree d of the hierarchy. We are thus interested in

$$\begin{aligned} {e_p}_{\xi _e}(d):=\frac{\Vert u(\cdot ,\cdot ,\xi _e)-\widetilde{u_d}(\cdot ,\cdot ,\xi _e)\Vert _{l^1({\textbf{T}}_e\times {\textbf{X}}_e)}}{\Vert u(\cdot ,\cdot ,\xi _e)\Vert _{l^1({\textbf{T}}_e\times {\textbf{X}}_e)}}, \end{aligned}$$

for all \(\xi _e\in \varvec{\Xi }_e\). The results are presented in Table 3.

Table 3 Number of unknowns \(q_d\) and errors \({e_p}_{\xi _e}(d)\) for \(d=2,\dots ,8\)

We observe the same behaviour of the errors as in the previous paragraph.

Conservation condition

We here check the conservation condition, i.e. how far \(c_d(t,\xi ):=\int _{{\textbf{X}}}(\widetilde{u_d}(t,x,\xi )-u(t,x,\xi ))dx\) is from 0. We plot on Fig. 5 the function \(t\mapsto c_d(t,0.2)\) for 11 equidistant points in \({\textbf{T}}\) and for \(d=2,5,8\). In order to approximate the integral, we compute the pointwise error for 1001 equidistant points in \({\textbf{X}}\) and divide the sum by the number of points. The conservation condition is rather well satisfied and it tends to improve as d rises.

Fig. 5
figure 5

Conservation condition \(c_d(t,0.2)\) versus time t for \(d=2,5,8\)

Retrieving statistical moments of the solution

Denote \({\textbf{T}}_e\) 100 equidistant points in \({\textbf{T}}\) and \({\textbf{X}}_e\) 100 equidistant points in \({\textbf{X}}\). We want to approximate the expectation \(f_1(x,t)\) of the solution for all \((t,x)\in {\textbf{T}}_e\times {\textbf{X}}_e\) following the method described in Sect. 3.5.2. Denoting \(\widetilde{{f_1}_d}\) the approximated expected value of the solution for degree of relaxation d of the hierarchy, we want to compute the relative \(l^1({\textbf{T}}_e\times {\textbf{X}}_e)\) error of our approximation for \(d=2,\dots ,8\), namely, we are interested in

$$\begin{aligned} e_s(d):=\frac{\Vert f_1-\widetilde{{f_1}_d}\Vert _{l^1({\textbf{T}}_e\times {\textbf{X}}_e)}}{\Vert f_1\Vert _{l^1({\textbf{T}}_e\times {\textbf{X}}_e)}}, \end{aligned}$$

for all \(d=2,\dots ,8\). The results are presented in Table 4.

Table 4 Number of unknowns \(q_d\) and error \(e_s(d)\) for \(d=2,\dots ,8\)

We note here the same phenomenon as for the errors presented above occurring, where the approximation rapidly improves as d rises until \(d=5\). The convergence is then rather slow and not monotone.

4.2 Riemann problem for the Burgers equation with parametrised flux

As a second illustration, we consider the classical one-dimensional Riemann problem (see e.g., [46]) for a Burgers equation, where we parametrise the flux of the equation. In particular, we choose the flux

$$\begin{aligned} f(u,\xi )=\frac{1}{4}(\xi +1)u^2, \end{aligned}$$

with a parameter \(\xi \) taking values in \(\varvec{\Xi }=[0,1]\). The Riemann problem to this conservation law is a Cauchy problem with the following initial condition, piecewise constant with one point of discontinuity:

$$\begin{aligned} u_0(x)=\left\{ \begin{aligned} 1\text { if }x<0,\\ 0\text { if }x\ge 0. \end{aligned} \right. \end{aligned}$$

The solution is known to take values in \({\textbf{U}}=[0,1]\). The time-space window on which we consider the solution is \({\textbf{T}}=[0,\frac{1}{2}]\) and \({\textbf{X}}=[-\frac{1}{2},\frac{1}{2}]\).

The unique analytical solution corresponding to the initial condition is

$$\begin{aligned} u(t,x,\xi )=\left\{ \begin{aligned} 1\text { if }x<\frac{1}{4}(\xi +1)t,\\ 0\text { if }x\ge \frac{1}{4}(\xi +1)t, \end{aligned} \right. \end{aligned}$$
(37)

We can note that the randomness in (36) was simply a translation of the solution, whereas, here, the phenomenon is non-linear, since the speed of the shock depends on \(\xi \).

Providing \(\varvec{\Xi }\) with the Lebesgue measure on [0, 1], it comes that, for all \(k\in {\mathbb {N}}\),

$$\begin{aligned} f_k(0,x)=u_0(x)^k, \end{aligned}$$

for all \(x\in {\textbf{X}}\), and

$$\begin{aligned} f_k(t,x)=1-\min (1,\max (0,\frac{4x}{t}-1))+0^k\min (1,\max (0,\frac{4x}{t}-1)), \end{aligned}$$

for all \((t,x)\in {\textbf{T}}\times {\textbf{X}}\). We may notice that in this simple case, for all \(t>0\), \(f_k(t,\cdot )\) is independent on k for \(k\ge 1\).

Retrieving the graph of the solution

Fig. 6 shows the graphs of the approximate solution \(\widetilde{u_d}(t,x,0)\) for \((t,x)\in {\textbf{T}}\times {\textbf{X}}\) (so that the speed of the shock is \(\frac{1}{4}\)), with relaxation degree \(d=2,5,8\).

Fig. 6
figure 6

Graphs of the approximate solution \(\widetilde{u_d}(t,x,0)\) for \(d=2,5,8\)

Fig. 7 shows the graphs of the approximate solution \(\widetilde{u_d}(\frac{1}{4},x,\xi )\) for \(x\in {\textbf{X}}\) and \(\xi =0,1\) (so that the speed of the shock is \(\frac{1}{4}\) and \(\frac{1}{2}\) respectively), with hierarchy’s degree \(d=2,5,8\), superposed with the exact solution. Once more, we see that our approximation is very close to the exact solution for \(d=5\), and indistinguishable from the exact solution for \(d=8\).

Fig. 7
figure 7

Graphs of the approximate solution \(\widetilde{u_d}(\frac{1}{4},x,\xi )\) for \(d=2,5,8\), superposed with the exact solution

\(l^1({\textbf{T}}\times {\textbf{X}}\times \varvec{\Xi })\)

error We pick at random 25 values in \(\varvec{\Xi }\), and consider 25 equidistant values in \({\textbf{T}}\) and \({\textbf{X}}\). We denote the test sets \(\varvec{\Xi }_e\), \({\textbf{T}}_e\) and \({\textbf{X}}_e\) respectively. We study the evolution of the relative \(l^1\) error with respect to the degree d of the hierarchy. Namely, we are interested in

$$\begin{aligned} e_g(d):=\frac{\Vert u-\widetilde{u_d}\Vert _{l^1({\textbf{T}}_e\times {\textbf{X}}_e\times \varvec{\Xi }_e)}}{\Vert u\Vert _{l^1({\textbf{T}}_e\times {\textbf{X}}_e\times \varvec{\Xi }_e)}}. \end{aligned}$$

The results are shown in Table 5 and on Fig. 8.

Table 5 Number of unknowns \(q_d\) and error \(e_g(d)\) for \(d=2,\dots ,8\)
Fig. 8
figure 8

Evolution of the error \(e_g\) with relaxation degree d

We note here the same phenomenon as for the errors presented above occurring, where the approximation improves as d rises until \(d=5\). Then the convergence is not monotone and rather slow.

Conservation condition

We once more study the conservation condition by plotting the function \(t\mapsto c_d(t,\xi )=\int _{{\textbf{X}}}(\widetilde{u_d}(t,x,\xi )-u(t,x,\xi ))dx\) for \(\xi =0.2\) for 11 equidistant points in \({\textbf{T}}\) and \(d=2,5,8\) on Fig. 9. The same remark as for the previous experiment holds: the conservation condition is rather well satisfied and it tends to improve as d increases.

Fig. 9
figure 9

Conservation condition \(c_d(t,0.2)\) versus time t for \(d=2,5,8\) (left) and for \(d=5,8\) (right)