## 6.1 Introduction

In this chapter, we introduce Hamilton-Jacobi PDEs. These PDEs are related to conservation laws and their solutions are the anti-derivative (in space) of the Entropy solutions of the corresponding conservation law, given that some assumptions are satisfied.

Roughly, a Hamilton-Jacobi PDE reads for the Cauchy problem on $$\mathbb {R}$$ for a given flux function $$f:\mathbb {R}\rightarrow \mathbb {R}$$ as

\displaystyle \begin{aligned} \partial_t\, q(t,x)+ f\big(\partial_x\, q(t,x)\big)&=0&& (t,x)\in(0,T)\times\mathbb{R}\\ q(0,x) &=q_{0}(x) && x\in\mathbb{R}. \end{aligned}

Assuming that the solutions are significantly smooth, we can differentiate the PDE with respect to the spatial variable and obtain

\displaystyle \begin{aligned} \partial_t\,\partial_x\, q(t,x)+ \partial_x\, f\big(\partial_x\, q(t,x)\big)&=0&& (t,x)\in(0,T)\times\mathbb{R}\\ \partial_x\, q(0,x) &=q_{0}^{\prime}(x) && x\in\mathbb{R}. \end{aligned}

Setting x q ≡ u for a given function $$u:(0,T)\times \mathbb {R}\rightarrow \mathbb {R}$$ one ends up with

\displaystyle \begin{aligned} \partial_t\, u(t,x)+ \partial_x\, f(u(t,x))&=0&& (t,x)\in(0,T)\times\mathbb{R}\\ u(0,x) &= q_{0}^{\prime}(x) && x\in\mathbb{R}, \end{aligned}

the conservation law in u with flux function f and initial datum $$q_{0}^{\prime }(x),x\in \mathbb {R}$$. Having a closer look into the theory of Hamilton-Jacobi PDEs, one major advantage is that the solutions to these equations remain Lipschitz continuous in case the initial datum is Lipschitz continuous (and in the case one is in the bounded domain case, also the boundary datum).

Even more, there is an explicit solution formula taking advantage of the Legendre Fenchel dual to write down the solution at every given time-space point as an convex optimization problem. This is of great importance as it not only allows to evaluate solutions without a predetermined numerical grid, the specific solution structure enables it also to study details and behavior of solutions.

These loosely described approaches will be made rigorous in the next section where we introduce the concept of strong and generalized solutions.

## 6.2 Strong Solutions

We start with the problem setup and some assumptions on the flux function which contain convexity. The same results also hold for concave functions under minor modifications.

### Definition 27 (The Hamilton-Jacobi PDE with Initial Datum)

Given a flux function $$f:\mathbb {R}\rightarrow \mathbb {R}$$ and initial datum $$q_{0}:\mathbb {R}\rightarrow \mathbb {R}$$ we call the following initial value problem

\displaystyle \begin{aligned} \partial_t\, q(t,x)+ f\big(\partial_x\, q(t,x)\big)&=0&& (t,x)\in(0,T)\times\mathbb{R}\\ q(0,x) &=q_{0}(x) && x\in\mathbb{R}. \end{aligned}

a Hamilton-Jacobi PDE, and $$q:(0,T)\times \mathbb {R}\rightarrow \mathbb {R}$$ its solution.

To guarantee the existence and uniqueness of solutions, we require some assumptions on initial datum and flux function. This is detailed in the following

### Assumption 1 (Flux Function and Initial Datum)

We assume that

1. 1.

$$q_{0}\in W^{1,\infty }_{\mathit{\text{loc}}}(\mathbb {R}):\ q_{0}^{\prime }\in L^{\infty }(\mathbb {R})$$

2. 2.

$$f\in W^{1,\infty }_{\mathit{\text{loc}}}(\mathbb {R})$$ strictly convex satisfying $$\lim _{x\rightarrow \pm \infty } \tfrac {f(x)}{|x|}=\infty$$.

For the explicit solution formula for every fixed space-time point we require the convex conjugate of the function which we define as follows.

### Definition 28 (Convex Conjugate or the Legendre Fenchel Transform)

Suppose that f satisfies item 2 in assumption 1, i.e., is in particular strictly convex and let $$I\subseteq \mathbb {R}$$ be a closed interval. Then, we define the Legendre Fenchel transform f of f on I as

(6.1)

where the domain for the Legendre transform f on I is defined as

(6.2)

### Remark 13 (Convex Conjugate)

Note that due to item 2, $$\operatorname {Dom}(f^{*})$$ is an interval in $$\mathbb {R}$$ or entire $$\mathbb {R}$$. Furthermore, f is also a convex function.

Given these definitions and assumptions we can state the main Theorem 33:

### Theorem 33 (Existence/Uniqueness of Strong Solutions and the Lax-Hopf Formula)

Let Assumption 1 hold. Then, the initial value problem in Definition 27 admits a unique strong solution $$q\in W^{1,\infty }_{\mathit{\text{loc}}}((0,T)\times \mathbb {R}), \partial _{2}q\in L^{\infty }((0,T)\times \mathbb {R})$$ and the solution at time-space point $$(t,x)\in (0,T)\times \mathbb {R}$$ can be posed as

\displaystyle \begin{aligned} q(t,x)=\min_{y\in\mathbb{R}} q_{0}(y)+t\cdot f^{*}\Big(\tfrac{x-y}{t}\Big){} \end{aligned}
(6.3)

with f as in Definition 28 . The latter identity is called Lax-Hopf formula.

### Proof

The proof can be found in [126, Chapter 3.3]. □

### Remark 14 (Interpretations of the Solution Formula and More)

As pointed out this solution formula for q requires it to solve a minimization problem at every given point in space-time. However, as f is strictly convex and q 0 grows at most linearly due to the assumption on $$q_{0}^{\prime }\in L^{\infty }(\mathbb {R})$$, this minimization problem always possesses one and only one minimal point for every given $$(t,x)\in (0,T)\times \mathbb {R}$$.

The following theorem makes the connection between the solution of the Hamilton-Jacobi equation and the Entropy solution of the corresponding conservation law. It thus details what had been described in Sect. 6.1. For the general theory of scalar conservation laws and types of solutions, particularly Entropy solutions, we refer the reader to [51].

### Theorem 34 (Relation to the Corresponding Conservation Law)

Given Assumption 1 , the spatial derivative of the solution stated in Eq.(6.3) in Theorem 33 is the unique Entropy solution of the conservation law

\displaystyle \begin{aligned} \partial_t\, u(t,x)+\partial_x\, f(u(t,x))&=0&& (t,x)\in (0,T)\times\mathbb{R}\\ u(0,x) &=q_{0}^{\prime}(x) && x\in\mathbb{R}. \end{aligned}

### Proof

The proof can be found in many text books, we again refer to [126, Chapter 3.4, Chapter 11]. □

This result is the key why instead of solving a conservation law, one might solve the corresponding Hamilton-Jacobi equation. One advantage of the solution is that it is Lipschitz continuous. Due to the gain in regularity one can apply methods on control and optimization which one could not so easily apply on the level of conservation laws.

In the following, we will also look into the case where boundary datum is prescribed, i.e., when we are on a bounded or semi-bounded domain.

Before addressing the named question we look in detail into the bounded domain case:

### 6.2.1 The Bounded Domain Case

It is worth mentioning some results for the bounded domain cases:

### Theorem 35 (Lax-Hopf Formula on $$\mathbb {R}_{>0}$$)

Let $$T\in \mathbb {R}_{>0}$$ and f satisfy Assumption 1 . Let the initial value $$u_{0} \in L^{\infty }(\mathbb {R}_{>0})$$ be given and assume that u b ∈ L ((0, T)). Then, there exists a unique strong Lipschitz continuous solution to the following Hamilton-Jacobi equation $$q:(0,T)\times \mathbb {R}_{\geq 0}\rightarrow \mathbb {R}$$ with Neumann boundary datum

The solution q can be represented by means of a three dimensional restricted minimization problem, for $$(t,x)\in \mathbb {R}_{\geq 0}\times [0,T]$$

\displaystyle \begin{aligned} q(t,x)&=\min\Bigg\{\min_{y\in\mathbb{R}_{\geq0}} \Big\{tf^{*}\big(\tfrac{x-y}{t}\big)+q_{0}(y) \Big\},\\ &\qquad \min_{\substack{0\leq t_{2}\leq t_{1}\leq t\\ a\in\mathbb{R}_{\geq0}}}\left\{q_{0}(a)+f^{*}\big(\tfrac{-a}{t_{2}}\big)t_{2}+\big(t-t_{1}\big)f^{*}\Big(\tfrac{x}{t-t_{1}}\Big)-\int_{t_{2}}^{t_{1}}f(u_{\mathit{\text{b}}}(\theta))\mathrm{d}\theta\right\}\Bigg\}. \end{aligned}

Furthermore, the spatial derivative of q, i.e.,

is the entropy solution of the conservation law

\displaystyle \begin{aligned} \partial_t\, u(t,x) + \partial_x\, f(u(t,x)) &=0 &(t,x) \in (0,T)\times\mathbb{R}_{>0}\\ u(0,x) &=u_{0}(x)=q_{0}^{\prime}(x) &x\in\mathbb{R}_{>0} \end{aligned}

satisfying the boundary condition in the sense of [ 29 ]

\displaystyle \begin{aligned} u(0,t)=\bar{u}_{\mathit{\text{b}}}(t), \quad t\in(0,T)\ \mathit{\text{almost everywhere}} \end{aligned}

with

the possibly attained boundary datum.

### Proof

The proof can be found in [184]. □

### Remark 15 (Some Remarks to the Boundary Datum and the Solution Formula)

The Neumann boundary datum on the level of Hamilton-Jacobi equations can be interpreted as a Dirichlet boundary datum for the corresponding conservation law. This is also why the boundary datum can only hold in the sense of [29] and also needs to be projected into what the flux function f can “handle.”

Finally, from the solution formula in Theorem 35 one can see that the solution is computed in two parts. The first part, i.e., $$min_{y\in \mathbb {R}_{\geq 0}} \Big \{tf^{*}\big (\tfrac {x-y}{t}\big )+q_{0}(y) \Big \}$$ is the solution which directly propagates the initial datum (compare Eq. (6.3)). The second part of the minimization is responsible for the interaction of boundary datum and initial datum.

A further result is available for two sided boundary datum, however, in this case the solution formula is much more involved as the two boundaries can influence each other over time. We refer to [185].

## 6.3 Generalized Solutions

In this section we will introduce more general solutions, the so-called Barron-Jensen/Frankowska solutions [30, 134] for Hamilton-Jacobi equations. Then, the spatial derivative might not even exist in a strong sense so that an interpretation on the level of conservation laws as in the previous section is not possible anymore. However, from an applied point of view the generalized solutions for the Hamilton-Jacobi equations have other desirable features. For example, they enable the reconciliation of data points incompatible with conservation laws, as often measured in experimental data [74]. In addition, the interpretation of these solutions goes back to the 1968 seminal article of Karl Moskowitz [234], which gives a practitioner interpretation to these solutions in terms of vehicle counts (which can be directly measured with loop detectors). The basic idea follows [21, 72,73,74] and related work. As this work is mainly concerned with traffic flow applications, the flux functions chosen here are concave. In addition, for the conservation law in $$q:(0,T)\times X\rightarrow \mathbb {R}$$ for t ∈ [0, T] and $$x\in X\subset \mathbb {R}$$ a bounded interval

\displaystyle \begin{aligned} \partial_t\, u(t,x)+ \partial_x\, f\big(u(t,x)\big)&=0\\ u(0,x) &=u_{0}(x)\\ &\text{+ boundary conditions} \end{aligned}
(6.4)

we redefine the corresponding Hamilton-Jacobi equation as

\displaystyle \begin{aligned} \partial_t\, q(t,x)-f(-\partial_x\, q(t,x))&=0{} \end{aligned}
(6.5)

so that for smooth solutions we obtain

\displaystyle \begin{aligned} u(t,x)=-\partial_x\, q(t,x).{} \end{aligned}
(6.6)

We make this precise requiring the following

### Assumption 2 (Assumption on the Flux Function)

Given a maximal density $$u_{\max }\in \mathbb {R}_{>0}$$ we assume that the flux function f considered is concave, and Lipschitz, i.e., $$f\in W^{1,\infty }((0,u_{\max }))$$ . As it will be important for the following Legendre Fenchel transform in Definition 29 to have f defined on $$\mathbb {R}$$ we extend it by the following procedure. Define

(6.7)

we extend f by $$\tilde {f}:\mathbb {R}\rightarrow \mathbb {R}$$ as follows

\displaystyle \begin{aligned} \tilde{f}(x)=\begin{cases} f(x) & x\in[0,u_{\max}]\\ f(u_{\max}) -\nu^{\sharp}(x-u_{\max}) &x\in (u_{\max},\infty)\\ f(0)+\nu^{\flat}x &x\in (-\infty,0) \end{cases}\qquad x\in\mathbb{R} \end{aligned}
(6.8)

and have that also $$\tilde {f}\in W^{1,\infty }_{\mathit{\text{loc}}}(\mathbb {R})$$ is concave. The extension is also illustrated in Fig. 6.1 . We also define

(6.9)

The reformulation of Hamilton-Jacobi equations as in Eq. (6.5) also necessitates the redefinition of the Legendre transform as

### Definition 29 (Legendre Fenchel Transform in Traffic Flow Modeling)

For a given $$u_{\max }\in \mathbb {R}_{>0}$$ let a concave flux function $$f\in W^{1,\infty }([0,u_{\max }])$$ be given and recall its extension $$\tilde {f}$$ as in Assumption 2, the Legendre Fenchel transform reads for $$u\in \operatorname {Dom}(f^{*})$$ as

For specific flux functions, as, for instance, for triangular flux functions, one can compute the dual function explicitly. We first define a triangular flux function as follows and then compute its dual.

### Definition 30 (Triangular Flux Function)

We call $$f\in W^{1,\infty }([0,u_{\max }])$$ for a given $$u_{\max }\in \mathbb {R}_{>0}$$ a triangular flux function if it satisfies

\displaystyle \begin{aligned} f: \begin{cases} [0,u_{\max}] &\rightarrow\mathbb{R}\\ u&\mapsto \begin{cases} vu & u\leq u_{\text{c}}\\ w(u-u_{\max}) & \text{else}, \end{cases} \end{cases} \end{aligned}
(6.10)

where the model parameters are the free flow speed $$v\in \mathbb {R}_{>0}$$, the critical density $$u_{\text{c}}\in [0,u_{\max })$$, the congestion speed $$w\in \mathbb {R}_{<0}$$ and the maximal density $$u_{\max }$$, satisfying $$v u_{\text{c}}=w (u_{\text{c}}-u_{\max })$$. The flux function is illustrated in Fig. 6.2.

To illustrate the complexity of the computations we give in the following an explicit expression for the Legendre Fenchel transform of f:

### Remark 16 (Computation of the Dual Function of the Triangular Flux)

Let the flux as in Eq. (6.10) be given, and recall the transform in Definition 29 we compute its dual as

\displaystyle \begin{aligned} f^{*}(u)&=\sup_{p\in\mathbb{R}}\left\{p\cdot u + \begin{cases} vp& p\leq u_{\text{c}}\\ w(p-u_{\max})& p\geq u_{\text{c}} \end{cases}\right\}\\ &=\sup_{p\in\mathbb{R}}\begin{cases} p(u +v)& p\leq u_{\text{c}}\\ p(u+w)-wu_{\max}& p\geq u_{\text{c}} \end{cases}\\ &=\sup\left\{\sup_{p\in(-\infty,u_{\text{c}}]}p(u+v), \sup_{p\in[u_{\text{c}},\infty)} p(u+w)-wu_{\max}\right\}\\ &=\begin{cases} \infty& u< -v\\ u_{\text{c}}(u+v) & -v\leq u\leq -w\\ \infty& u> -w \end{cases}, \end{aligned}

where we have used $$vu_{\text{c}}=w(u_{\text{c}}-u_{\max })$$ so that we obtain as effective domain $$\operatorname {Dom}(f^{*})=[-v,-w]$$.

### Assumption 3 (Notation for the Bounded Domain Case)

The spatial interval on which we will consider the previously introduced Eq.(6.4) will be the interval $$(A,B)\subset \mathbb {R}$$ with $$A,B\in \mathbb {R},\ A<B$$ . For notational convenience, we will sometimes write

We then start with a basic definition of value conditions, one key ingredient for the generalized solution:

### Definition 31 (Value Condition)

For $$T\in \mathbb {R}_{>0}$$ a value condition $$\mathfrak {c}:\operatorname {Dom}(\mathfrak {c})\subseteq [0,T] \times X\rightarrow \mathbb {R}$$ is a lower semicontinuous function. We extend $$\mathfrak {c}$$ by $$\tilde {\mathfrak {c}}:[0,T]\times X$$ on the entire space-time horizon by defining

(6.11)

For reasons of convenience we replace in the following $$\tilde {\mathfrak {c}}$$ again by $$\mathfrak {c}$$ which is now defined on [0, T] × X but admits as effective domain on the original $$\operatorname {Dom}(\mathfrak {c})$$.

With this definition we can present the main theorem of this section, the generalized Lax-Hopf formula based on viability theory [22]. This viability epi solution to the Hamilton-Jacobi equation is obtained in epigraphical form from the computation of a viability kernel under an auxiliary dynamics (related to characteristics). The corresponding result is given in the form of a epigraphical set; the lower envelope of this set is defined as the solution. Once established, the results of this procedure can be fully characterized as follows (details outside of the scope of this book, see, for example, [36]).

### Theorem 36 (Generalized Lax-Hopf Formula)

The viability episolution $$m_{\mathfrak {c}}$$ for $$\mathfrak {c}$$ as in Definition 31 can be expressed as:

\displaystyle \begin{aligned} m_{\mathfrak{c}}(t,x) =\inf_{(u,s) \in \operatorname{Dom}(f^{*}) \times \mathbb{R}_{\geq 0} } \Big( \mathfrak{c}(t-s,x+ s u) + s f^{*}(u)\Big). \end{aligned}
(6.12)

### Proof

See [74]. □

The following Proposition 11 enables it to compute solutions for different input datum (boundary datum, initial datum, datum on trajectories) separately, and then stick all of them together to one solution.

### Proposition 11 (Inf-morphism Property)

For i  I where I is a finite set, let $${\mathfrak {c}}_{i}:\operatorname {Dom}\subset (0,T)\times \mathbb {R}\rightarrow \mathbb {R}$$ be as in Definition 31 . Then, defining

a property known as inf-morphism property holds:

\displaystyle \begin{aligned} \forall (t,x)\in[0,T]\times X,\ m_{\mathfrak{c}} (t,x) = \min_{i \in I} m_{\mathfrak{c}_{i}}(t,x) \end{aligned}
(6.13)

with $$m_{\mathfrak {c}_{i}}$$ being the solution for the value condition $$\mathfrak {c}_{i}$$ as in Theorem 36.

### Proof

The proof can be found in [74]. □

### 6.3.1 Piecewise Affine Initial and Boundary Datum

In this section, we will investigate the generalized Lax-Hopf formula for specific initial and boundary datum, namely for piecewise affine datum. The restriction to this type of initial and boundary datum offers to compute the solution efficiently as a convex optimization problem, or—even more—state the solution explicitly.

On the level of conservation laws this means that we approximate initial and boundary datum piecewise constant. As piecewise constant functions are dense in $$L^{1}(\mathbb {R}),\ L^{1}(X)$$ respectively, we can approximate every initial and boundary flux datum as precise as we want.

### 6.3.2 Piecewise Affine Initial Datum

Defining piecewise affine initial datum, we recall Eq. (6.6) so that we know that m x(0, x) = −u 0(x) and as $$u_{0}(x)\in [0,u_{\max }]\ \forall x\in X \text{ a.e.},$$ we define as follows

### Definition 32 (Affine Initial Conditions)

We consider for $$T\in \mathbb {R}_{>0}$$ the following affine initial condition $$m_{0}\!:\operatorname {Dom}(m_{0})\subset [0,T]\times X\rightarrow \mathbb {R}$$:

\displaystyle \begin{aligned} m_{0}(t,x)=\begin{cases} a x + b & \text{ if } x \in [\underline{\alpha},\overline{\alpha}]\ \wedge \ t=0 \\ +\infty & \text{otherwise,} \end{cases} \end{aligned}

where $$\underline {\alpha },\overline {\alpha }\in X$$ with $$\underline {\alpha }\leq \overline {\alpha }$$ and $$a\in [-u_{\max },0],b\in \mathbb {R}$$. The effective domain of m 0 is

\displaystyle \begin{aligned}\operatorname{Dom}(m_{0})=\{0\}\times[\underline{\alpha},\overline{\alpha}].\end{aligned}

### Lemma 5 (Lax-Hopf Formula Affine Initial Conditions in Definition 32)

The generalized solution to the Hamilton-Jacobi equation with initial datum as in Definition 32 can be expressed for (t, x) ∈ (0, T) × X as

\displaystyle \begin{aligned} m_{m_{0}}(t,x)= \begin{cases} \inf\limits_{\substack{u \in \operatorname{Dom}(f^{*})\\ \cap\left[\frac{\underline{\alpha}-x}{t},\frac{\overline{\alpha}-x}{t}\right]}} a(x+tu)+b +tf^{*}(u) & \operatorname{Dom}(f^{*})\cap\left[\tfrac{\underline{\alpha}-x}{t},\tfrac{\overline{\alpha}-x}{t}\right]\neq\emptyset \\ \infty &\mathit{\text{ else. }} \end{cases} \end{aligned}

The solution can actually be stated explicitly for triangular flux functions:

### Lemma 6 (Explicit Solution Formula for Definition 32 and Triangular Flux)

For triangular flux function as in Definition 30 the solution formula in Lemma 5 can be stated as

\displaystyle \begin{aligned} &m_{m_{0}}(t,x)\\ &=\begin{cases} \begin{cases} a\underline{\alpha} +b+u_{\mathit{\text{c}}}(tv-x) &a+u_{\mathit{\text{c}}}\geq0\\ a\overline{\alpha} +b +u_{\mathit{\text{c}}}(tv-x)& a+u_{\mathit{\text{c}}}< 0 \end{cases}& x\in[\max\{A,\underline{\alpha}+wt\},\min\{B,\overline{\alpha}+wt\}]\\ \infty& \mathit{\text{else }} \end{cases} \end{aligned}

### Proof

According to Definition 32 and $$\operatorname {Dom}(f^{*})=[-v,-w]$$ we have for (t, x) ∈ (0, T) × X so that $$[-\frac {A-x}{\nu ^{\flat }},+\infty )\cap \left [ t-\overline {\gamma },t- \underline {\gamma }\right ]\neq \emptyset$$ (recall that a ≤ 0)

so that we obtain indeed

\displaystyle \begin{aligned} m_{m_{0}}(t,x)=\begin{cases} \begin{cases} a\underline{\alpha} +b+u_{\text{c}}(tv-x) &a+u_{\text{c}}\geq0\\ a\overline{\alpha} +b +u_{\text{c}}(tv-x)& a+u_{\text{c}}< 0 \end{cases}& \left[\frac{\underline{\alpha}-x}{t},\frac{\overline{\alpha}-x}{t}\right]\cap [-v,-w]\neq\emptyset\\ \infty& \text{else, } \end{cases} \end{aligned}

which can be reformulated to holds exactly the proposed solution formula. □

### 6.3.3 Piecewise Affine Left Hand Side Boundary Datum

As the boundary datum for the Hamilton-Jacobi equation is time-integrated flow datum, we define as follows:

### Definition 33 (Affine Left Hand Side Boundary Datum)

We consider the following upstream boundary datum γ : [0, T] × X:

\displaystyle \begin{aligned} \gamma(t,x)=\begin{cases} c t+d & \text{ if } t \in [\underline{\gamma},\overline{\gamma}]\ \wedge\ x=A \\ +\infty & \text{ otherwise, } \end{cases} \end{aligned}

where $$c\in [0,f_{\max }],d\in \mathbb {R}$$ and $$\underline {\gamma },\overline {\gamma }\in [0,T]$$ with $$\overline {\gamma }- \underline {\gamma }\geq 0.$$ The effective domain of γ is

\displaystyle \begin{aligned}\operatorname{Dom}(\gamma)=[\underline{\gamma},\overline{\gamma}]\times \{A\}.\end{aligned}

### Lemma 7 (Lax-Hopf Formula for Affine Left Hand Side b.c.)

The generalized solution to the Hamilton-Jacobi equation with left hand side boundary datum as in Definition 34 can be expressed for (t, x) ∈ [0, T] × X ∖{A} as

In case of a triangular flux function, we present the explicit solution formula in the following Lemma 8.

### Lemma 8 (Explicit Solution Formula for Lemma 7 and Triangular Flux)

For triangular flux function as in Definition 30 the solution formula in Lemma 7 can be stated for $$t\in [ \underline {\gamma },T]$$ as

\displaystyle \begin{aligned} m_{\gamma}(t,x)=\begin{cases} \begin{cases} u_{\mathit{\text{c}}}(a+vt-x)-\overline{\gamma}(u_{\mathit{\text{c}}}v-c)+d&x\leq A+v(t-\overline{\gamma})\\ \tfrac{c}{v}(A-x)+ct+d &x\geq A+v(t-\overline{\gamma}) \end{cases} & x\leq A+v(t-\underline{\gamma})\\ \infty & \mathit{\text{ else.}} \end{cases} \end{aligned}

### Proof

According to Definition 32, we have for $$(t,x)\in (0,T)\times X, \ [-\frac {A-x}{\nu ^{\flat }},+\infty )\cap \left [ t-\overline {\gamma },t- \underline {\gamma }\right ]\neq \emptyset$$ (recall that $$c\in [0,f_{\max }]$$)

\displaystyle \begin{aligned} &\inf\limits_{\substack{s \in [-\frac{A-x}{\nu^{\flat}},+\infty)\\ \cap \left[ t-\overline{\gamma},t-\underline{\gamma}\right] }} c(t-s)+d+s f^*\left(\tfrac{A-x}{s} \right) \end{aligned}

recall that ν  = v

\displaystyle \begin{aligned} &=\inf\limits_{\substack{s \in [-\frac{A-x}{v},+\infty)\\ \cap \left[ t-\overline{\gamma},t-\underline{\gamma}\right] }} c(t-s)+d+s u_{\text{c}}\big(\tfrac{A-x}{s}+v\big)\\ &=ct+d +u_{\text{c}}(A-x)+\min\limits_{\substack{s \in [-\frac{A-x}{v},+\infty)\\ \cap \left[ t-\overline{\gamma},t-\underline{\gamma}\right] }} s(u_{\text{c}}v-c) \end{aligned}

and also $$c\leq f_{\max }=f(u_{c})=u_{\text{c}}v$$

\displaystyle \begin{aligned} &=ct+d +u_{\text{c}}(A-x)+\max\left\{-\tfrac{A-x}{v},t-\overline{\gamma}\right\}(u_{\text{c}}v-c)\\ &=\begin{cases} u_{\text{c}}(a+vt-x)-\overline{\gamma}(u_{\text{c}}v-c)+d&x\leq A+v(t-\overline{\gamma})\\ \tfrac{c}{v}(A-x)+ct+d &x\geq A+v(t-\overline{\gamma}), \end{cases} \end{aligned}

from which the conclusion follows. □

### Definition 34 (Affine Right Hand Side Boundary Datum)

We consider the following right hand side boundary datum β : [0, T] × X:

\displaystyle \begin{aligned} \beta(t,x)=\begin{cases} et+f & \text{ if } \ t \in [\underline{\beta},\overline{\beta}]\ \wedge x=B\\ +\infty & \text{ otherwise,} \end{cases} \end{aligned}
(6.14)

where $$e\in [0,f_{\max }],\ f\in \mathbb {R}$$ are given as well as $$\overline {\beta }, \underline {\beta }\in [0,T]$$ with $$\overline {\beta }- \underline {\beta }\geq 0$$. The effective domain of β is therefore

\displaystyle \begin{aligned}\operatorname{Dom}(\beta)=[\underline{\beta},\overline{\beta}]\times\{B\}.\end{aligned}

### Lemma 9 (Lax-Hopf Formula for Affine Right Hand Side b.c.)

The generalized solution to the Hamilton-Jacobi equation with right hand side boundary datum as in Definition 34 can be expressed for (t, x) ∈ (0, T) × X ∖{B} as

As in Lemma 8, we will give the solution explicitly for triangular flux function and left hand side boundary datum:

### Lemma 10 (Explicit Solution Formula for Lemma 9 and Triangular Flux)

For triangular flux function as in Definition 30 the solution formula in Lemma 9 can be stated for $$t\in [ \underline {\beta },T]$$ as

\displaystyle \begin{aligned} &m_{\beta}(t,x)\\ &=\begin{cases} \begin{cases} u_{\max}(B-x)+\tfrac{x-B}{w}e+et+f&x\leq B+w(t-\overline{\beta})\\ u_{\mathit{\text{c}}}(B+vt-x)+\overline{\beta}(e-u_{\mathit{\text{c}}}v)+f&x\geq B+w(t-\overline{\beta}) \end{cases} & x\geq B+w(t-\underline{\beta})\\ \infty & \mathit{\text{ else.}} \end{cases} \end{aligned}

### Proof

According to Definition 32, we have for $$(t,x)\in (0,T)\times X, \ [\tfrac {B-x}{\nu ^{\sharp }},+\infty ) \\ \cap \left [t-\overline {\beta },t- \underline {\beta } \right ]\neq \emptyset$$ (recall that $$e\in [0,f_{\max }]$$)

\displaystyle \begin{aligned} &\inf\limits_{\substack{s \in [\frac{x-B}{\nu^{\sharp}},+\infty)\\ \cap \left[ t-\overline{\beta},t-\underline{\beta}\right] }} e(t-s)+f+s f^*\left(\tfrac{B-x}{s} \right) \end{aligned}

recall that ν  = −w

\displaystyle \begin{aligned} &=\inf\limits_{\substack{s \in [\frac{x-B}{w},+\infty)\\ \cap \left[ t-\overline{\beta},t-\underline{\beta}\right] }} e(t-s)+f+s u_{\text{c}}\big(\tfrac{B-x}{s}+v\big)\\ &=et+f +u_{\text{c}}(B-x)+\min\limits_{\substack{s \in [\frac{x-B}{w},+\infty)\\ \cap \left[ t-\overline{\beta},t-\underline{\beta}\right] }} s(u_{\text{c}}v-e) \end{aligned}

and also $$c\leq f_{\max }=f(u_{c})=u_{\text{c}}v$$

\displaystyle \begin{aligned} &=et+f +u_{\text{c}}(B-x)+\max\left\{\tfrac{x-B}{w},t-\overline{\beta}\right\}(u_{\text{c}}v-e)\\ &=\begin{cases} u_{\max}(B-x)+\tfrac{x-B}{w}e+et+f&x\leq B+w(t-\overline{\beta})\\ u_{\text{c}}(B+vt-x)+\overline{\beta}(e-u_{\text{c}}v)+f&x\geq B+w(t-\overline{\beta}), \end{cases} \end{aligned}

from which the conclusion follows. □

Having stated the solution for any piecewise affine initial datum and boundary datum, we can now move to present a solution formula for unification of such piecewise affine initial and boundary datum.

### Definition 35 (The Piecewise Affine Data)

Let the sets $$I,J,K\subset \mathbb {N}_{\geq 1}$$ be the index sets for the piecewise affine initial, left, and right hand side data. We assume that |I|, |J|, |K| < . Then, we consider for (i, j, k) ∈ I × J × K the initial, left, and right hand side boundary datum

\displaystyle \begin{aligned} m_{0,i}(t,x)&= \begin{cases} a_{i}x+b_{i} &\mbox{ if } x\in[\underline{\alpha}_{i},\overline{\alpha}_{i}]\ \wedge\ t=0\\ +\infty &\text{ otherwise} \end{cases}\\ \gamma_{j}(t,x)&=\begin{cases} c_{j} t+d_{j} & \text{ if } t \in [\underline{\gamma}_{j},\overline{\gamma}_{j}]\ \wedge\ x=A \\ +\infty & \text{ otherwise, } \end{cases}\\ \beta_{k}(t,x)&=\begin{cases} e_{k}t+f_{k} & \text{ if } \ t \in [\underline{\beta},\overline{\beta}]\ \wedge x=B\\ +\infty & \text{ otherwise,} \end{cases} \end{aligned}

with corresponding effective domain and $$\boldsymbol {a}\in [-u_{\max },0]^{|I|},\boldsymbol {b}\in \mathbb {R}^{|I|}, \underline {\boldsymbol {\alpha }},\overline {\boldsymbol {\alpha }}\in X^{|I|}$$ with $$\underline {\boldsymbol {\alpha }}\leq \overline {\boldsymbol {\alpha }}$$, $$\boldsymbol {c}\in [0,f_{\max }]^{|J|},\boldsymbol {d}\in \mathbb {R}^{|J|}, \underline {\boldsymbol {\gamma }},\overline {\boldsymbol {\gamma }}\in [0,T]^{|J|}$$ with $$\underline {\boldsymbol {\gamma }}\leq \overline {\boldsymbol {\gamma }},$$ $$\boldsymbol {e}\in [0,f_{\max }]^{|K|},\boldsymbol {f}\in \mathbb {R}^{|K|}, \underline {\boldsymbol {\beta }},\overline {\boldsymbol {\beta }}\in [0,T]^{|K|}$$ with $$\underline {\boldsymbol {\beta }}\leq \overline {\boldsymbol {\beta }}$$ the corresponding vectors collecting in their entries the different components of the set of piecewise affine linear initial and boundary data.

By the foregoing Theorems we have for every (i, j, k) ∈ I × J × K the existence of a generalized solution to the corresponding Hamilton-Jacobi equation, just incorporating the specific initial, upstream, downstream, internal data. Each solution is denoted by

\displaystyle \begin{aligned} m_{m_{0,i}},\quad m_{\gamma_{j}},\quad m_{\beta_{k}}.{} \end{aligned}
(6.15)

This brings us to the following Theorem, which incorporates all these conditions into one single solution.

### Theorem 37 (Solution to the Hamilton-Jacobi Equation for Piecewise Affine Data)

There exists a solution of the Hamilton-Jacobi Equation, incorporating the finite sequences of initial, boundary, and internal data, which we call $$c:[0,T]\times X\rightarrow \mathbb {R}$$ . Then, the solution can be determined for (t, x) ∈ [0, T] × X by the formula

\displaystyle \begin{aligned} m(t,x)=\min\Big\{\min_{i\in I}m_{m_{0,i}}(t,x),\ \min_{j\in J} m_{\gamma_{j}}(t,x),\ \min_{k\in K} m_{\beta_{k}}(t,x)\Big\},{} \end{aligned}
(6.16)

where the involved functions are introduced in Definition 6.15.

### Proof

The proof is a direct consequence of the inf-morphism property as stated in Proposition 11 in Eq. (6.13) and Definition 35. □

### Theorem 38 (Convexity of the Solutions When Changing the Parameters of Initial and Boundary Datum in Definition 35)

For any (t, x) ∈ [0, T] × X the solution m(t, x) as defined in Eq.(6.16) is convex with regard to the input variables of initial and boundary datum, i.e., a, b, c, d, e, f in the corresponding dimension.

### Proof

We only sketch the proof. Due to the specific construction of the solution being the minimum of the minimum of different functions the solution is convex if each of the contributing solutions in Eq. (6.16) is convex. We start with two initial conditions defined on the same domain, so take according to Definition 32 for given $$\underline {\alpha },\overline {\alpha }\in X: \underline {\alpha }\leq \overline {\alpha }$$ as initial datum $$m_{0}(t,x)=ax+b,\ \tilde {m}_{0}(t,x)=\tilde {a}x+\tilde {b}$$ satisfying the constraints in Definition 32 and in particular $$(a,\tilde {a})\in [-u_{\max },0]^{2}$$. Then, the corresponding solutions are given in Lemma 6 and applying the definition of convexity, we obtain for λ ∈ (0, 1) and $$t\in [0,T],\ x\in [\max \{A, \underline {\alpha }+wt\},\min \{B,\overline {\alpha }+wt\}]$$

\displaystyle \begin{aligned} &m_{\lambda \cdot m_{0}+(1-\lambda)\cdot\tilde{m}_{0}}(t,x)\\ &=\begin{cases} (\lambda a+(1-\lambda)\tilde{a})\underline{\alpha}+\lambda b+(1-\lambda)\tilde{b}+u_{\text{c}}(tv-x), & \lambda a+(1-\lambda)\tilde{a}+u_{\text{c}}\geq0\\ (\lambda a+(1-\lambda)\tilde{a})\overline{\alpha}+\lambda b+(1-\lambda)\tilde{b}+u_{\text{c}}(tv-x), & \lambda a+(1-\lambda)\tilde{a}+u_{\text{c}}<0 \end{cases}\\ &=u_{\text{c}}(tv-x)+\lambda \begin{cases} a\underline{\alpha}+b, & \lambda a+(1-\lambda)\tilde{a}+u_{\text{c}}\geq0\\ a\overline{\alpha}+b, & \lambda a+(1-\lambda)\tilde{a}+u_{\text{c}}<0 \end{cases}\\ &\quad +(1-\lambda)\begin{cases} \tilde{a}\underline{\alpha}+\tilde{b}, & \lambda a+(1-\lambda)\tilde{a}+u_{\text{c}}\geq0\\ \tilde{a}\overline{\alpha}+\tilde{b}, & \lambda a+(1-\lambda)\tilde{a}+u_{\text{c}}<0 \end{cases}\\ &\leq u_{\text{c}}(tv-x)+\lambda \begin{cases} a\underline{\alpha}+b, & \lambda a+u_{\text{c}}\geq0\\ a\overline{\alpha}+b, & \lambda a+u_{\text{c}}<0 \end{cases}\\ &\quad +(1-\lambda)\begin{cases} \tilde{a}\underline{\alpha}+\tilde{b}, & (1-\lambda)\tilde{a}+u_{\text{c}}\geq0\\ \tilde{a}\overline{\alpha}+\tilde{b}, & (1-\lambda)\tilde{a}+u_{\text{c}}<0 \end{cases}\\ &=\lambda m_{m_{0}}(t,x)+ (1-\lambda) m_{\tilde{m}_{0}}(t,x), \end{aligned}

where the inequality in the previous calculations follows from the fact that

• $$\big (a \underline {\alpha }\geq a\overline {\alpha }\big )\ \wedge \ \big (\tilde {a} \underline {\alpha }\geq \tilde {a}\overline {\alpha }\big )$$  as $$a,\tilde {a}\leq 0$$

• $$\{a\in [-u_{\max },0]:\ \lambda a+(1-\lambda )\tilde {a}\geq -u_{\text{c}}\} \subseteq \{a\in [-u_{\max },0]:\ \lambda a\geq -u_{\text{c}}\}$$

• $$\{\tilde {a}\in [-u_{\max },0]:\ \lambda a+(1-\lambda )\tilde {a}\geq -u_{\text{c}}\} \subseteq \{\tilde {a}\in [-u_{\max },0]:\ (1-\lambda ) \tilde {a}\geq -u_{\text{c}}\}$$

for every λ ∈ [0, 1]. Similar calculations for the boundary datum using the solution formulae in Lemma 8, Lemma 10 give the convexity with regard to the input parameters of the boundary datum. □

### Remark 17 (Greenshields Flux Function)

A similar explicit solution formula can be computed for other flux functions like the quadratic Greenshields [159] flux function $$f(x)=vx(u_{\max }-x),\ x\in [0,u_{\max }].$$ In this case the Legendre Fenchel dual f will be quadratic as well so that one obtains a quadratic scalar optimization problem with constraints.

As previously stated Theorem 37 gives us a solution formula for any initial and boundary datum where one can also decouple the computation of each part of initial datum and boundary datum. However, for physical relevant solutions (i.e., that there exists the spatial derivative of the solution almost everywhere) one needs to prescribe additional constraints, the so-called compatibility constraints assuring that initial datum and boundary datum fit to each other. For instance, at the space point (0, 0) where initial and boundary datum meet, the datum needs to be continuous over this corner. In addition, assume that we have two parts of piecewise affine linear initial datum as parametrized in Definition 35 so that $$\overline {\alpha }_{1}= \underline {\alpha }_{2}$$. Then, the corresponding datum does not need to satisfy a continuity assumptions, which would be $$a_{1}\overline {\alpha }_{1}+b_{1}=a_{2}\overline {\alpha }_{1}+b_{2}$$. Same does not necessarily hold true for the remaining initial and boundary conditions and is the reason why one needs additional compatibility conditions.

### 6.3.4 Compatibility Conditions

To make sure that compatibility is satisfied so that we indeed obtain solutions of the underlying LWR PDE, we state the following

### Theorem 39 (Compatibility Condition)

For the sequence of initial and boundary data as in Definition 35 the data is compatible iff

\displaystyle \begin{aligned}\forall \mathfrak{c},\tilde{\mathfrak{c}}\in\left\{m_{0,i}: i\in I\}\cup\{\gamma_{j}: j\in J\right\}\cup \left\{\beta_{k}: k\in K\right\} \end{aligned}

it holds

\displaystyle \begin{aligned} m_{\mathfrak{c}}(t,x)\geq \tilde{\mathfrak{c}}(t,x)\quad \forall (t,x)\in [0,T]\times \overline{X},{} \end{aligned}
(6.17)

where $$m_{\mathfrak {c}}$$ is the solution operator for an initial or boundary condition $$\mathfrak {c}$$ as discussed in Sect. 6.3.2.

### Proof

See [74]. □

The compatibility condition might not look very applicable as it states compatibility by just computing the solution and checking then. However, in the case where we can compute the solution explicitly as we have shown in the previous Sect. 6.3.2 for piece-wise affine linear datum, these inequalities can be checked directly. Even more, as the datum is piecewise affine linear Eq. (6.17) does not need to be checked for all (t, x) ∈ T × X but only at the boundaries of the domain of each datum and at possible intersections of the corresponding solutions.

## 6.4 Optimization with Hamilton-Jacobi Equations

In this section, we show for an easy example how the introduced theory and framework in Sect. 6.3 can be used to formulate optimal control problems in a very efficient way as convex (or even linear) optimization problems.

### Problem 2 (Problem Considered)

Assume we have at a specific time $$T\in \mathbb {R}_{>0}$$ measured the road density as $$u_{T}\in L^{\infty }(X;[0,u_{\max }])$$ and the downstream flow $$f_{\text{B}}\in L^{\infty }((0,T);[0,f_{\max }])$$. Can we infer the initial state $$u_{0}\in L^{\infty }(\mathbb {R})$$ and upstream flow f(u(⋅, A)) ∈ L ((0, T))?

We will address this problem by means of an optimal control problem. As we will take advantage of the previously developed Hamilton-Jacobi theory and generalized solutions (Sect. 6.3), we need to reformulate f B and u T as boundary values and end values for the Hamilton-Jacobi equations. Using the relation in Eqs. (6.6) and (6.5) we obtain for the Hamilton-Jacobi equation the following:

### Remark 18 (Reformulation in Terms of Hamilton-Jacobi Equations)

The downstream datum and end datum in Problem 2 read for the Hamilton-Jacobi equations for (t, x) ∈ [0, T] × (A, B) as

(6.18)

Note that the choice of integral bounds makes the end term compatible with the boundary term in the way that h T(B) = 0 = h B(T). This is necessary as the datum we would like to track should be Lipschitz continuous. Although, h T and h B are Lipschitz on their corresponding space/ time domain, they will not satisfy compatibility at the space-time point (T, B).

Now, we are able to formulate the corresponding optimal control problem in terms of Hamilton-Jacobi equations as in Definition 36:

### Definition 36

The Optimal Control Problem Considered For $$(\nu ,\sigma )\in \mathbb {R}_{>0}^{2}$$ we consider the following constrained minimization problem

\displaystyle \begin{aligned} \inf_{\substack{m_{0}\in W^{1,\infty}((X))\\ h_{\text{B}} W^{1,\infty}((0,T))}} \nu\|h_{\text{B}}-m(\cdot,B)\|{}_{L^{2}((0,T))}^{2}+\sigma \|m(T,\cdot)-h_{T}\|{}_{L^{2}(X)}^{2}, \end{aligned}

where m is the solution of the Hamilton-Jacobi equation m for initial datum m 0 and left hand side (upstream) boundary datum h A as stated in Theorem 36 and Proposition 11 for the corresponding value functions.

We will not go into details whether a minimum exists in the chosen functional setup but directly approach the problem in a simplified version: Restricting the flux to a triangular flux as in Definition 30 and the initial and boundary datum to a piecewise affine datum, we can simplify the problem as follows:

### Definition 37 (A Finite-Dimensional Optimization Problem for Triangular Flux Function and Piecewise Affine Linear Initial and Left Hand Side Boundary Datum)

Chose for the left hand side boundary datum and initial datum as in Eq. (6.15) the finite set I and J with corresponding $$\overline {\boldsymbol {\alpha }}, \underline {\boldsymbol {\alpha }}\in X^{|I|}$$ so that $$\cup _{i\in I} [ \underline {\alpha }_{i},\overline {\alpha }_{i}]=\overline {X}$$ and $$\overline {\boldsymbol {\gamma }}, \underline {\boldsymbol {\gamma }}\in [0,T]^{|J|}$$ so that $$\cup _{j\in J} [ \underline {\gamma }_{j},\overline {\gamma }_{j}]=[0,T]$$ a finite-dimensional approximation to Definition 36 reads as

\displaystyle \begin{aligned} \inf_{\substack{\boldsymbol{a}\in [-u_{\max},0]^{|I|}\\ \boldsymbol{b}\in \mathbb{R}^{|I|}\\ \boldsymbol{c}\in[0,f_{\max}]^{|J|}\\ \boldsymbol{d}\in\mathbb{R}^{|J|}}}&\nu\|h_{\text{B}}-m(\cdot,B)\|{}_{L^{2}((0,T))}^{2}+\sigma \|m(T,\cdot)-h_{T}\|{}_{L^{2}(X)}^{2}\\ m(t,x)&= \min\Big\{\min_{i\in I}m_{m_{0,i}}(t,x),\ \min_{j\in J} m_{\gamma_{j}}(t,x)\Big\}\\ m_{m_{0,i}}& \text{ as in Lemma 6} && i\in I\\ m_{\gamma_{j}}& \text{ as in Lemma 8} && j\in J. \end{aligned}

As this minimization problem will have results which are not of interest as the corresponding initial and boundary values are not attained we can add a penalization for b, d and compatibility constraints. We then obtain

### Theorem 40 (A Convex Optimization Problem)

Adding to the optimization problem in Definition 37 the corresponding compatibility constraints Theorem 39 , we still obtain a convex optimization problem in the optimization variables

\displaystyle \begin{aligned}\boldsymbol{a},\boldsymbol{b},\boldsymbol{c},\boldsymbol{d}.\end{aligned}

### Proof

This is a direct consequence of the structure of the compatibility constraints in Theorem 39, and the convexity of the solution in Theorem 38. □

Of course, the previously outlined optimization problem could easily be generalized to more complex situations and the underlying convexity structure could still be applied. In addition, as an explicit solution formula is available, the computation of the minimization problems is fast. Under specific circumstances and more manipulations one can even obtain linear or quadratic and/or mixed-integer programs [61, 74, 221].

## 6.5 Bibliographical Notes

For general theory and viscosity solutions of Hamilton-Jacobi equation we refer the reader to [94, 95] where the authors consider time-dependent and independent Hamilton-Jacobi equations with a Hamiltonian which can also be explicitly space and time-dependent with Dirichlet boundary conditions and as Cauchy problem. They introduced a notation of solutions, i.e., viscosity solutions for which existence and uniqueness of solutions and stability properties can be obtained (compare also [28]). For a rather comprehensive presentation on optimal control, the related Hamilton-Jacobi-Bellman equations (as optimality conditions) and the named viscosity solutions we refer the reader to [27, 71]. In the book [225] general solutions of Hamilton-Jacobi equations are discussed, in [30] and [134] semicontinuous viscosity solutions. For viability theory we refer to [22, 36] and for Hamilton-Jacobi equations with inequality constraints to [21].

Applications of Hamilton-Jacobi equations and related theory for transportation can be found in [72,73,74] which are one of the main sources for the latter chapter.