hybrid approximations of junctions on networksF. Bagagiolo, and R. Maggistro
ex_supplement

# Hybrid thermostatic approximations of junctions for some optimal control
problems on networks††thanks: . This work was partially supported by OptHySYS
project of the University of Trento.

Fabio Bagagiolo Department of Mathematics, University of Trento, Via Sommarive
14, I-38123 Povo-Trento, Italy<EMAIL_ADDRESS>Rosario Maggistro
Department of Mathematical Sciences, Polytechnic of Torino, Torino, Italy ().
<EMAIL_ADDRESS>
###### Abstract

The aim of this paper is to study some optimal control problems on networks
with junctions. We consider an approximation of such a problems given by the
use of a switching rule of delay-relay type and study the passage to the limit
when $\varepsilon$, the parameter of the approximation, goes to zero. First,
we take into account a twofold junction problem for which we characterize the
limit function as viscosity solution and maximal subsolution of a suitable
Hamilton-Jacobi problem. Afterwards we analyse a threefold junction problem
for which we consider two different way for passing to the limit in its
approximation. For both ways we recover some uniqueness results in the sense
of maximal subsolution.

###### keywords:

optimal control, networks, discontinuous dynamic, hysteresis, Hamilton-Jacobi
equations, viscosity solutions

34H05, 35R02, 47J40, 49L25, 35F21

##  1 Introduction

In this paper, we are interested in optimal control problems with dynamics
inside a network. Each arc $E_{i}$ of the network has is own controlled
dynamics $f_{i}$ and cost $\ell_{i}$. When passing from an arc to another one
through a node, the system then drastically experiences a discontinuity. We
refer to this situation as a “junction”. In the recent years there was an
increasing interest in the investigation of dynamical systems and differential
equation on network, for example in connection with problems of data
transmission and traffic flows (see for example Garavello-Piccoli [17], Engel
et al. [16]).
In the case of optimal control and, in particular, of dynamic programming and
Hamilton-Jacobi-Bellman (HJB) equation, the presence of junctions is a
problem. Indeed, due to the discontinuous feature of HJB, the corresponding
uniqueness of the value function as solution of HJB is not in general
guaranteed. But more, a right concept of what should be a solution of HJB in
the presence of junctions is even not clear. Some authors have recently
studied optimal control and HJB on networks, see for instance Achdou-Camilli-
Cutrì-Tchou [1], Camilli-Marchi [13], Camilli-Marchi-Schieborn [14], Camilli-
Schieborn [15], Imbert-Monneau-Zidani [20], Achdou-Oudet-Tchou [2], Achdou-
Tchou [3].
The problem with junctions is also related to $n$-dimensional optimal control
problems on multi-domains, where the dynamics and costs incur in
discontinuities when crossing some fixed hypersurfaces. This kind of problems,
whose study started with Bressan-Hong [12], has been studied, in connection
with HJB, in Barles-Briani-Chasseigne [8], Barnard-Wolenski [11], Rao-Zidani
[22], Barles-Briani-Chasseigne [9], Rao-Siconolfi-Zidani [21], Barles-
Chasseigne [10], Imbert-Monneau [19].
In this paper we study a possible approximation of an optimal control problem
on a network with a junction. Some preliminary and partial results have been
presented in Bagagiolo [4]. As said before, the main critical point is a
uniqueness result for the viscosity solution of HJB equation that turns out to
be discontinuous in the (one-dimensional) space-variable (we refer the reader
to, for example, Bardi-Capuzzo Dolcetta [7] for a comprehensive account of
viscosity solutions for Hamilton-Jacobi equations). Indeed, when using the
classical double-variable technique for proving comparison results between
sub- and super- viscosity solutions we cannot in general conclude as in the
standard way because the points of minimum and of maximum, even if very close,
may belong to different arcs for which dynamics and costs are absolutely non-
comparable (the junction, indeed). Consider the simple situation where two
half-lines (the edges) are separated by one point (the junction). Our approach
is to replace the junction, which represents a unique threshold for passing
both from one edge to the other one and vice-versa, by a so-called delayed
thermostat consisting in two different thresholds for passing separately from
one edge to the other one and vice-versa (see Fig. 1). The problem is then
transformed in a so-called hybrid problem (continuous/discrete evolution, see
for example Goebel-Sanfelice-Teel [18]) for which the discontinuity of HJB is
replaced by some suitable mutually exchanged boundary conditions on the
extreme points of the two branches. This allows to get a uniqueness result for
HJB for this kind of thermostatic problem. Indeed, as starting point, we use
the results in Bagagiolo [5] (see also Bagagiolo-Danieli [6]), where the
author studies the dynamic programming method and the corresponding HJB
problem for optimal control problems whose dynamics has a thermostatic
behavior. This means that the dynamics $f$ (as well as the cost $\ell$)
besides the control, depends on the state variable $x\in{\mathbb{R}}$, which
evolves with continuity via the equation $x^{\prime}=f$, and also depends on a
discrete variable $i\in\left\\{-1,1\right\\}$, whose evolution is governed by
a delayed thermostatic rule, subject to the evolution of the state $x$.

Figure 1:  The two-fold junction and its thermostatic approximation.

In Fig. 1 the behaviour of such a rule is explained, correspondingly to the
choice of the fixed threshold parameter $\varepsilon>0$. The output
$i\in\\{-1,1\\}$ can (and must) jump from $1$ to $-1$ only when the input $x$,
coming from the right (i.e. from values larger than or equal to
$-\varepsilon$), possibly goes below the threshold $-\varepsilon$; it can (and
must) jump from $-1$ to $1$ only when $x$, coming from the left (i.e. from
values smaller than or equal to $\varepsilon$) possibly goes above the
threshold $\varepsilon$. In all other situations it remains constant. In
particular, when $x>\varepsilon$ then $i$ is equal to $1$, and when
$x<-\varepsilon$ then $i$ is equal to $-1$.

The controlled evolution is then given by

$\begin{cases}x^{\prime}(t)=f(x(t),i(t),\alpha(t)),\\\
i(t)=h_{\varepsilon}\left[x\right](t)\\\ x(0)=x_{0},\ \ \
i(0)=i_{0}\end{cases}$

where $\alpha:\left[0,+\infty\right]\rightarrow A$ is the measurable control,
and $h_{\varepsilon}\left[\cdot\right]$ represents the thermostatic delayed
relationship between the input $x$ and the output $i$. Note that the initial
value $i_{0}\in\left\\{-1,1\right\\}$ must be coherent with the thermostatic
relation: $i_{0}=1$ (resp. $i_{0}=-1$) whenever $x_{0}>\varepsilon$ (resp.
$x_{0}<-\varepsilon$). The infinite horizon optimal control problem is then,
given a running cost $\ell$ and a discount factor $\lambda>0$, the
minimization over all measurable controls, of the cost

(1) $V_{\varepsilon}(x_{0},i_{0})=\inf_{\alpha\in{\cal
A}}\int_{0}^{\infty}e^{-\lambda t}\ell(x(t),i(t),\alpha(t))dt$

where ${\cal A}$ is the set of measurable controls. In [5], the problem is
written as a coupling of two exit time optimal control problems which mutually
exchange their exit-costs. In particular, using the notations

(2) $\Omega_{1}^{\varepsilon}=\left\\{x>-\varepsilon\right\\},\ \
\overline{\Omega}_{1}^{\varepsilon}=\left\\{x\geq-\varepsilon\right\\},\ \
\Omega_{-1}^{\varepsilon}=\left\\{x<\varepsilon\right\\}\ \
\overline{\Omega}_{-1}^{\varepsilon}=\left\\{x\leq\varepsilon\right\\},$

in $\overline{\Omega}_{1}^{\varepsilon}\times\left\\{1\right\\}$ (resp.
$\overline{\Omega}_{-1}^{\varepsilon}\times\left\\{-1\right\\}$), the function
$x\mapsto V_{\varepsilon}(x,1)$ (resp. $x\mapsto V_{\varepsilon}(x,-1)$)
coincides with the value function of the exit-time optimal control problem on
$\overline{\Omega}_{1}^{\varepsilon}$ (resp.
$\overline{\Omega}_{-1}^{\varepsilon}$ ), where the exit-cost on
$-\varepsilon$ (resp. on $\varepsilon$) is given by
$V_{\varepsilon}(-\varepsilon,-1)$ (resp. $V_{\varepsilon}(\varepsilon,1)$).
In other words, under standard hypotheses on dynamics and costs, in [5] is
proved the following theorem.

######  Theorem 1.1.

The value function $V_{\varepsilon}$ in Eq. 1 is the unique bounded,
continuous function on
$\overline{\Omega}_{1}^{\varepsilon}\times\left\\{1\right\\}\cup\overline{\Omega}_{-1}^{\varepsilon}\times\left\\{-1\right\\}$
which solves the following coupled Dirichlet problem in the viscosity sense,
where the boundary conditions (the two exit-costs) are also in the viscosity
sense.

(3) $\begin{cases}\lambda V_{\varepsilon}(x,1)+\sup_{a\in
A}\left\\{-f(x,1,a)V^{\prime}_{\varepsilon}(x,1)-\ell(x,1,a)\right\\}=0\
\text{in}\ \Omega_{1}^{\varepsilon}\times\left\\{1\right\\}\\\
V_{\varepsilon}(-\varepsilon,1)=V_{\varepsilon}(-\varepsilon,-1)\\\ \lambda
V_{\varepsilon}(x,-1)+\sup_{a\in
A}\left\\{-f(x,-1,a)V^{\prime}_{\varepsilon}(x,-1)-\ell(x,-1,a)\right\\}=0\
\text{in}\ \Omega_{-1}^{\varepsilon}\times\left\\{-1\right\\}\\\
V_{\varepsilon}(\varepsilon,-1)=V_{\varepsilon}(\varepsilon,1)\end{cases}$

where $V^{\prime}$ denotes the derivative with respect to $x$.

In the present paper, we intend to approximate some junction problems by a
suitable combinations of delayed thermostats. Every thermostat is
characterized by its two thresholds ($\varepsilon$ and $-\varepsilon$ in the
preceding description) and, starting from the results in [5], we study the
limit of the value functions $V_{\varepsilon}$ and of the HJB problem when the
threshold distance $\varepsilon$ tends to zero, and hence recovering the
junction situation.

In Barles-Briani-Chasseigne [8], among others, a one-dimensional two-fold
junction problem as the one described here above, is also studied and some
possible approximations are given. In the present paper we then introduce a
different kind of approximation (the thermostatic one) and we recover, with a
different kind of proof, similar results: we characterize the limit problem
and we get that the limit of $V_{\varepsilon}$ is the corresponding maximal
viscosity subsolution. This corresponds to the value function of the junction
optimal control problem where, on the junction point, some further dynamics
are considered: the ones given by the suitable convexification of “outward
pointing” dynamics (“regular” dynamics in [8]) and somehow corresponding to
stable equilibria on the junction point (stable equilibria of dynamics
interpreted as forces).

In the case of a “threefold” junction (see Fig. 3) the convexification of
dynamics on the junction point seems to be not more applicable (the physical
interpretation as forces equilibrium is also failing). However, inspired by
the previous thermostatic approximation, we introduce a special kind of
“convexification parameters” that somehow corresponds to the length of the
time intervals that the dynamics spends on every single branch of a
“threefold” thermostatic approximation. Here, we have more than one way for
passing to the limit in the thermostatic approximation and we recover some
uniqueness results for those limit problems in the sense of maximal
subsolution. Note that the threefold junction problem may also be extended to
the case of manifold junction problem.

The paper is organized as follows: basic assumption are set in Section 2. In
Section 3, we introduce the thermostatic approximation of a two-junction
problem and study the passage to the limit for $\varepsilon\rightarrow 0$ in
the problem studied in [5]. In Section 4 we study the case of a one
dimensional three-junction problem both in the case with uniform switching
thresholds and with non uniform switching thresholds.

##  2 Basic assumption on the junction problem and the delay thermostat

Let the junction be given by a finite number of co-planar half-lines $R_{i}$,
$i=1,\dots,n$, originating from the same point $O$, and we consider the half-
lines as closed, that is the point $O\in R_{i}$ for every $i$. On each branch
$R_{i}$ we consider a one-dimensional coordinate $x\geq 0$ such that $x(O)=0$.
The state position may be then encoded by the pair $(x,i)$. In Sect. 4, for
convenience of notation, we will sometimes change the sign of $x$ .

Figure 2: A star-shaped network.

We consider a controlled evolution on such a star-shaped network, given by the
following dynamics. On $R_{i}$ the system is driven by a continuous and
bounded dynamics $f_{i}:{\mathbb{R}}\times A\to{\mathbb{R}}$, where $A$ is
compact, with the standard Lipschitz assumption

$\exists L>0$ such that, for any $x,y\in{\mathbb{R}}$ and $a\in A$

(4) $|f_{i}(x,a)-f_{i}(y,a)|\leq L|x-y|.$

Controllability: For every $i$,

(5) $\exists\ a_{i}^{-},a_{i}^{+}\ \in A\ \ \text{s.t.}\ \ \
f_{i}(0,a_{i}^{-})<0<f_{i}(0,a_{i}^{+})$

The controlled system on the star-shaped network is then

(6) $\left\\{\begin{array}[]{ll}\displaystyle
y^{\prime}(t)=f_{j}(y(t),\alpha(t))&\mbox{for }t>0\ \mbox{and }y(t)\in
R_{j}\\\ y(0)=x\\\ x\in R_{i}\end{array}\right.$

where $\alpha:[0,+\infty[\to A$ belongs to $\cal A$, the set of measurable
controls.

To this controlled systems we associate an infinite horizon optimal control
problem. For every branch $R_{i}$ we consider a running cost
$\ell_{i}:{\mathbb{R}}\times A\to[0,+\infty[$, and the problem is given by the
minimization, over all controls $\alpha\in{\cal A}$, of the cost functional

(7) $J(x,i,\alpha)=\int_{0}^{+\infty}e^{-\lambda
t}\ell_{j}(y(t),\alpha(t))dt.$

In Eq. 7, $\lambda>0$ is a fixed discount factor, the trajectory $y(\cdot)$ is
the solution of Eq. 6, and the index $j$ is given by $y(t)\in R_{j}$.
Moreover, for every $i$, the function $\ell_{i}:{\mathbb{R}}\times
A\rightarrow{\mathbb{R}}$ is continuous and bounded, and there exists a
modulus of continuity $\omega_{\ell}:[0,\infty[\to[0,+\infty[$ (i.e.
continuous, increasing and $\omega_{\ell}(0)=0$), such that, for any
$x,y\in{\mathbb{R}}$ and $a\in A$ and for any $i$

(8) $|\ell_{i}(x,a)-\ell_{i}(y,a)|\leq\omega_{\ell}\left(|x-y|\right).$

We finally consider the value function

$V(x,i)=\inf_{\alpha\in{\cal A}}J(x,i,\alpha).$

Of course, the concept of solution (or trajectory) for the system Eq. 6 is not
a-priori well-posed. When we are on the junction point $O$, we can choose the
index $i$ we prefer, but the existence of the trajectory is not guaranteed,
due to possible fast oscillations of the index $i$ (behavior which is linked
to the pointing versus of $f_{i}(O,a)$). The main goal of the present paper is
just an approximation and the corresponding passage to the limit, for such
possible oscillating behavior in the context of optimal control. To this end,
we are going to use the so-called delayed thermostat operator. This is a
simple model for hysteresis phenomena for which we refer the reader to the
book by Visintin [24]. In particular, in addition to what already said in the
Introduction, here we point out that, fixed the thresholds
$-\varepsilon,\varepsilon$, for each continuous scalar input $t\mapsto u(t)$,
and for each initial output $i_{0}\in\\{-1,1\\}$ coherent with $u(0)$, there
exists a unique output $t\mapsto i(t)=:h_{\varepsilon}[u](t)\in\\{-1,1\\}$
satisfying $i(0)=i_{0}$. Moreover, for a regular scalar dynamics $g$, and for
a coherent initial state $(x,i_{0})$, there exists a unique solution of the
thermostatic system

$\left\\{\begin{array}[]{ll}y^{\prime}=g(y,i,t)\\\ y(0)=x\\\
i(t)=h_{\varepsilon}[y](t),\ \ i(0)=i_{0}\end{array}\right.$

The main reason for that is indeed the “splitting” of the thresholds, which
avoids fast oscillating behaviours of the switching variable $i$. For a
rigorous as well as natural definition of the trajectory we refer to [5].

##  3 A twofold junction problem

The delayed thermostatic rule may be also seen as a natural way for
approximating a discontinuous dynamics.
In a one-dimensional optimal control, this means that we have a controlled
dynamics which suddenly changes when passing from one half-line to the other
one. Denoting by $f:{\mathbb{R}}\times A\rightarrow{\mathbb{R}}$, it is
$f(x,\cdot)=f_{1}(x,\cdot)\ (\text{resp.}\ f(x,\cdot)=f_{-1}(x,\cdot))$ if
$x>0\ (\text{resp. if}\ x<0)$, where $f_{1}:[0,+\infty[\times
A\rightarrow{\mathbb{R}}$, $f_{-1}:]-\infty,0]\times
A\rightarrow{\mathbb{R}}$. The point $x=0$ may represent a “junction”, a node
on a network with two entering edges (see Fig. 1). For $\varepsilon>0$ we
approximate the junction problem by a delayed thermostatic problem. Still
denoting by $f_{1},f_{-1}$ two extensions by constancy in the space variable
$x$ of the dynamics to $[-\varepsilon,+\infty[\times A$ and to
$]-\infty,\varepsilon]\times A$ respectively, we may consider the controlled
system

(9) $\begin{cases}x^{\prime}(t)=f_{i(t)}(x(t),\alpha(t)),\\\
i(t)=h_{\varepsilon}\left[x\right](t)\\\ x(0)=x_{0},\ \ \
i(0)=i_{0}\end{cases}$

Similarly, we extend a running cost $\ell$ which is given in two different
ways, $\ell_{1},\ell_{-1}$ in the two half-lines.

Let $V_{\varepsilon}$ be the value function of the thermostatic optimal
control problem with dynamics given by Eq. 9 and corresponding costs. We
define the function

$\displaystyle\tilde{V}_{\varepsilon}:{\mathbb{R}}\setminus\left\\{0\right\\}\rightarrow{\mathbb{R}},$
$\displaystyle\ \
\tilde{V}_{\varepsilon}(x)=\begin{cases}V_{\varepsilon}(x,1)&x>0\\\
V_{\varepsilon}(x,-1)&x<0.\end{cases}$

Note that, in general, $V_{\varepsilon}(0,-1)\neq V_{\varepsilon}(0,1)$.

######  Theorem 3.1.

As $\varepsilon\rightarrow 0^{+}$, the sequence $\tilde{V}_{\varepsilon}$
uniformly converges on ${\mathbb{R}}\setminus\left\\{0\right\\}$ to a
continuous function $\tilde{V}_{1},\tilde{V}_{-1}$ respectively. If Eqs. 4 and
8 hold, then $\tilde{V}$ continuously extends to $x=0$ and, if Eq. 5 also
holds, it is the unique viscosity solution of

(10) $\begin{cases}\lambda V+H_{1}(x,V^{\prime})=0\ \ \ \text{for}\ x>0\\\
\lambda V+H_{-1}(x,V^{\prime})=0\ \ \text{for}\ x<0\\\
V(0)=\min\left\\{u_{0}(0),V_{sc(-1)}(0),V_{sc(1)}(0)\right\\}\end{cases}$

where $H_{1},H_{-1}$ are the Hamiltonians in Eq. 3, $u_{0}(0)$ is the
convexification

(11)
$u_{0}(0)=\frac{1}{\lambda}\min_{A_{0}}\left\\{\mu\ell_{-1}(0,a_{-1})+(1-\mu)\ell_{1}(0,a_{1})\right\\}$

with

(12) $A_{0}=\bigl{\\{}(\mu,a_{-1},a_{1})\in[0,1]\times A\times A:\\\ \mu
f_{-1}(0,a_{-1})+(1-\mu)f_{1}(0,a_{1})=0,f_{1}(0,a_{1})\leq
0,f_{-1}(0,a_{-1})\geq 0\bigr{\\}}$

and $V_{sc(i)}(0)$ is the value function at $x=0$ of the state-constraint
optimal control problem on the branch $i$.

######  Proof 3.2.

We are going to use the notations in Eq. 2. We also recall that the state-
constraint problem in branch $i$ is the optimal control problem restricted to
the branch $i$ and such that, when we are on the point $x=0$ we can only use
controls that make us to not leave the branch. We first prove that
$V_{\varepsilon}$ uniformly converges to a continuous function on
$\mathbb{R}\setminus\\{0\\}$. We have some cases and we illustrate some of
them.

i) $f_{-1}(0,a)\leq 0$ for all $a\in A$. Hence, when starting from a point of
$\overline{\Omega}_{-1}^{\varepsilon}\times\left\\{-1\right\\}$, it is
impossible to switch on the other branch
$\overline{\Omega}_{1}^{\varepsilon}\times\left\\{1\right\\}$. Hence, $x\to
V_{\varepsilon}(x,-1)$ is the value function of the optimal control problem
with dynamics $f_{-1}$ and cost $\ell_{-1}$ and state-constraint in
$\overline{\Omega}_{-1}^{\varepsilon}\times\left\\{-1\right\\}$, which
uniformly converges on $]-\infty,0]$ to the value function with same dynamics
and cost and with state constraints in $]-\infty,0]$ (note that dynamics and
costs are bounded), that is to $V_{sc(-1)}$. On the other branch, being
$V_{\varepsilon}(-\varepsilon,-1)$ convergent to $V_{sc(-1)}(0)$, by standard
stability results (applied to the first two lines of Eq. 3), we also get the
uniform convergence of $V_{\varepsilon}(\cdot,1)$ to the unique solution in
$[0,+\infty[$ with viscosity boundary datum $V_{sc(-1)}(0)$.

ii) $\exists\ a_{-1},a_{1}\in A$ such that
$f_{1}(0,a_{1})<0<f_{-1}(0,a_{-1})$. In this case, when $\varepsilon$ is
sufficiently small, starting from $(\varepsilon,1)$ (resp. from
$(-\varepsilon,-1)$) we can always switch on the other branch, and we can
reach $(-\varepsilon,-1)$ (resp. $(\varepsilon,1)$) in a time interval whose
length is infinitesimal as $\varepsilon$. It is then easy to check that the
difference $|V_{\varepsilon}(\varepsilon,1)-V_{\varepsilon}(-\varepsilon,-1)|$
(as well as $|V_{\varepsilon}(0,1)-V_{\varepsilon}(0,-1)|$) is also
infinitesimal as $\varepsilon$. Moreover, for every pair
$(\varepsilon_{1},\varepsilon_{2})$ with $\varepsilon_{1},\varepsilon_{2}>0$,
$\|V_{\varepsilon_{1}}-V_{\varepsilon_{2}}\|$ is also infinitesimal as
$\max\\{\varepsilon_{1},\varepsilon_{2}\\}$. Hence, again from stability
results for Eq. 3, $V_{\varepsilon}$ uniformly converges on
$\mathbb{R}\setminus\\{0\\}$, and also the continuous limit function
continuously extends to $x=0$.
We now define

$\tilde{V}(x)=\begin{cases}\tilde{V}_{1}(x)&\text{if}\ x\geq 0,\\\
\tilde{V}_{-1}(x)&\text{if}\ x\leq 0.\end{cases}$

Now, assuming Eq. 5 (which of course implies the conditions in ii)), we prove
that the continuous limit function $\tilde{V}$ satisfies the third equation of
Eq. 10. Again, we proceed illustrating some cases.

a) $V_{sc(-1)}(0)$ strictly realizes the minimum in Eq. 10. Then, there exists
a measurable control $\alpha$ such that the corresponding trajectory starting
from $x=0$ with dynamics $f_{-1}$ does not exit from $]-\infty,0]$, and the
corresponding cost, with running cost $\ell_{-1}$, is strictly less than
$u_{0}(0)$ and $V_{sc(1)}(0)$. Note that, such a control $\alpha$ has exactly
the same cost for the thermostatic problem with initial point $(0,-1)$ (no
switchings may occur).
Now, we observe that, for every $(\mu,a_{-1},a_{1})\in A_{0}$ with
$f_{-1}(0,a_{-1}),f_{1}(0,a_{1})\neq 0$, the alternation of the constant
controls $a_{-1},a_{1}$ correspondingly to every switching, gives a cost for
the thermostatic problem in $(0,-1)$ as well as in $(0,1)$, which, when
$\varepsilon$ goes to zero, converges to
$\left(\mu\ell_{-1}(0,a_{-1})+(1-\mu)\ell_{1}(0,a_{1})\right)/\lambda$.
Indeed, the condition $\mu f_{-1}(0,a_{-1})+(1-\mu)f_{1}(0,a_{1})=0$ implies
that $f_{-1}(0,a_{-1}),f_{1}(0,a_{1})$ are in the same (inverse) proportion as
$\mu$ and $1-\mu$, and the corresponding time-durations for covering the
distance $2\varepsilon$ (from one threshold to the other one) are in the same
(direct) proportion as $\mu$ and $1-\mu$. Hence, the required convergence
holds.
From this we get that $V_{sc(-1)}(0)=V_{\varepsilon}(0,-1)$ and so
$\tilde{V}(0)=V_{sc(-1)}(0)$.

b) $u_{0}(0)$ strictly realizes the minimum. Then, let $(\mu,a_{-1},a_{1})\in
A_{0}$ be such that $\mu\ell_{-1}(0,a_{-1})+(1-\mu)\ell_{1}(0,a_{1})$ is the
minimum in the definition of $u_{0}(0)$. Again, as in the previous point, we
get that a switching trajectory using controls $a_{-1}$ and $a_{1}$ is near
optimal for $V_{\varepsilon}$, and then the conclusion.

remRemark

######  Remark 1.

In this one-dimensional case, Theorem 3.1 also proves that $\tilde{V}=U^{+}$,
where $U^{+}$ is the value function of the so-called regular problem in [8].
In the sequel we are also given a different proof of such an equality where,
using the thermostatic approximation, we show that $\tilde{V}$ is the maximal
subsolution of a suitable Hamilton-Jacobi problem as in [8], namely next
problem Eq. 13.

######  Theorem 3.3.

Assume Eqs. 4, 5 and 8. The function $\tilde{V}$ is a viscosity solution of
the Hamilton-Jacobi-Bellman problem

(13) $\begin{cases}\lambda V+H_{1}(x,\nabla V)=0\ \ \text{in}\
\\{x>0\\}=:\Omega_{1}\\\ \lambda V+H_{-1}(x,\nabla V)=0\ \ \text{in}\
\\{x<0\\}=:\Omega_{-1}\\\ \min\left\\{\lambda V+H_{1},\lambda
V+H_{-1}\right\\}\leq 0\ \text{on}\ x=0\\\ \max\left\\{\lambda V+H_{1},\lambda
V+H_{-1}\right\\}\geq 0\ \text{on}\ x=0.\end{cases}$

We recall that here we mean that $\tilde{V}$ is a subsolution of the first
three equations and a supersolution of the first two together with the fourth
one.

######  Proof 3.4.

From Theorems 1.1 and 3.1 and by a classical convergence result, we have

$\lambda\tilde{V}(x)+\sup_{\alpha\in
A}\left\\{-f_{1}(x,\alpha)\tilde{V}^{\prime}(x)-\ell_{1}(x,\alpha)\right\\}=0\
\text{in}\ \Omega_{1},$

and similarly for the equation in $\Omega_{-1}$.

We now prove the third equation in Eq. 13. Let $\varphi\in
C^{1}({\mathbb{R}})$ be a test function such that $\tilde{V}-\varphi$ has a
strict relative maximum at $x=0$. By uniform convergence, there exists a
sequence $x_{\varepsilon}\in\overline{\Omega}_{1}^{\varepsilon}$ of points of
relative maxima for $V_{\varepsilon}(\cdot,1)-\varphi$ which converge to
$x=0$. We may have two cases: 1) at least for a subsequence, at
$x_{\varepsilon}$ the HJB equation satisfied by $V_{\varepsilon}(\cdot,1)$ has
the right sign ”$\leq$”, 2) it is definitely true that the boundary point
$x_{\varepsilon}=-\varepsilon$ is a strict maximum point and the HJB equation
has the wrong sign ”$>$”. Note that, when $x_{\varepsilon}$ is in the interior
of $\overline{\Omega}_{1}^{\varepsilon}$, case 1) always occurs. Also note
that the boundary of $\overline{\Omega}_{1}^{\varepsilon}$, i.e.
$x=-\varepsilon$, is also converging to $x=0$.

Case 1). Sending $\varepsilon\to 0$, we get $\lambda\tilde{V}+H_{1}\leq 0$ in
$x=0$ and so the third equation in Eq. 13.

Case 2). Since the boundary conditions in Eq. 3 are in the viscosity sense and
by virtue of the controllability condition Eq. 5, we have

(14) $V_{\varepsilon}(-\varepsilon,1)=V_{\varepsilon}(-\varepsilon,-1)$

Now, the same argumentations and cases also hold for the branches
$\overline{\Omega}_{-1}^{\varepsilon}$. If the corresponding case 1) holds,
then we get the conclusion as before. Otherwise we have

(15) $V_{\varepsilon}(\varepsilon,-1)=V_{\varepsilon}(\varepsilon,1)$

We now prove that case 2) cannot simultaneously holds in both branches.
Indeed, let us observe that $(-\varepsilon,-1)$ is in the interior of
$\overline{\Omega}_{-1}^{\varepsilon}$ and $(\varepsilon,1)$ is in the
interior of $\overline{\Omega}_{1}^{\varepsilon}$, therefore, using Eqs. 15
and 14, we get the following contradiction and conclude

$\begin{array}[]{ll}\displaystyle
V_{\varepsilon}(-\varepsilon,-1)-\varphi(-\varepsilon)<V_{\varepsilon}(\varepsilon,-1)-\varphi(-\varepsilon)=V_{\varepsilon}(\varepsilon,1)-\varphi(\varepsilon)\\\
\displaystyle<V_{\varepsilon}(-\varepsilon,1)-\varphi(\varepsilon)=V_{\varepsilon}(-\varepsilon,-1)-\varphi(-\varepsilon)\end{array}$

In order to prove the fourth equation in Eq. 13, we argue in the same way.

We now want to prove that $\tilde{V}$ is the maximal subsolution of Eq. 13. We
first prove the following lemma.

######  Lemma 3.5.

Let us assume that $\forall\ \varepsilon>0$ small enough, the optimal strategy
for the approximating problem $\varepsilon$, starting by any $(x,1),(x,-1)$
with $x\in[-\varepsilon,\varepsilon]$, is to run through infinitely many
switches between the two branches (i.e. no state-constraint behavior is
optimal). Let then $(\bar{\mu},\bar{a}_{-1},\bar{a}_{1})\in A_{0}$ be such
that $f_{-1}(0,\bar{a}_{-1})>0,f_{1}(0,\bar{a}_{1})<0$, and that

(16)
$\tilde{V}(0)=u_{0}(0)=\frac{1}{\lambda}\\{\bar{\mu}\ell_{-1}(0,\bar{a}_{-1})+(1-\bar{\mu})\ell_{1}(0,\bar{a}_{1})\\}.$

For every $x\in[-\varepsilon,\varepsilon]$, we consider the two switching
trajectories (compare with Eq. 9)

$\begin{cases}y^{\prime}(t)=f_{i(t)}(0,\bar{a}_{i(t)}),\\\
i(t)=h_{\varepsilon}\left[y\right](t),\\\ y(0)=x,\ \ \ i(0)=1,\end{cases},\ \
\ \begin{cases}y^{\prime}(t)=f_{i(t)}(0,\bar{a}_{i(t)}),\\\
i(t)=h_{\varepsilon}\left[y\right](t),\\\ y(0)=x,\ \ \ i(0)=-1.\end{cases}$

Note that the two trajectories on every branch move with constant velocity
($f_{1}(0,\bar{a}_{1})$ towards left and respectively towards right
$f_{-1}(0,\bar{a}_{-1})$), and they switch infinitely many times. We then
consider the corresponding two functions

(17) $\displaystyle\bar{V}_{\varepsilon}(x,1)$
$\displaystyle=\int_{0}^{\infty}e^{-\lambda
t}\ell_{i(t)}(0,\bar{a}_{i(t)})dt\quad\text{with}\quad i(0)=1,$
$\displaystyle\bar{V}_{\varepsilon}(x,-1)$
$\displaystyle=\int_{0}^{\infty}e^{-\lambda
t}\ell_{i(t)}(0,\bar{a}_{i(t)})dt\quad\text{with}\quad w(0)=-1.$

Then $\bar{V}_{\varepsilon}(\cdot,1)$ and $\bar{V}_{\varepsilon}(\cdot,-1)$
are differentiable in $[-\varepsilon,\varepsilon]$ and

(18)
$\sup_{x\in[-\varepsilon,\varepsilon]}|\bar{V}_{\varepsilon}^{{}^{\prime}}(x,1)-\bar{V}_{\varepsilon}^{{}^{\prime}}(x,-1)|\rightarrow
0\ \ \text{for}\ \ \varepsilon\rightarrow 0.$

######  Proof 3.6.

The derivability comes form the constancy of dynamics and costs. Note that we
can rewrite the two functions in Eq. 17 as

(19) $\displaystyle\bar{V}_{\varepsilon}(x,1)$
$\displaystyle=\int_{0}^{\frac{x+\varepsilon}{|f_{1}(0,\bar{a}_{1})|}}e^{-\lambda
t}\ell_{1}(0,\bar{a}_{1})dt+e^{\frac{-\lambda(x+\varepsilon)}{|f_{1}(0,\bar{a}_{1})|}}\bar{V}_{\varepsilon}(-\varepsilon,1),$
$\displaystyle\bar{V}_{\varepsilon}(x,-1)$
$\displaystyle=\int_{0}^{\frac{\varepsilon-x}{f_{-1}(0,\bar{a}_{-1})}}e^{-\lambda
t}\ell_{-1}(0,\bar{a}_{-1})dt+e^{\frac{-\lambda(\varepsilon-x)}{f_{-1}(0,\bar{a}_{-1})}}\bar{V}_{\varepsilon}(\varepsilon,-1),$

where the upper extremal of the integration is the reaching time of the
threshold in the corresponding initial branch. Then we have

(20)
$\bar{V}_{\varepsilon}(-\varepsilon,1)=\bar{V}_{\varepsilon}(-\varepsilon,-1)\quad\text{and}\quad\bar{V}_{\varepsilon}(\varepsilon,-1)=\bar{V}_{\varepsilon}(\varepsilon,1),$

and by Eq. 16 for any $i$, $\lim_{\varepsilon\to
0}\bar{V}_{\varepsilon}(x,i)=\tilde{V}(0)=u_{0}(0)$ uniformly in
$x\in[-\varepsilon,\varepsilon]$. A direct calculation gives

$\displaystyle\bar{V}_{\varepsilon}^{{}^{\prime}}(x,1)$
$\displaystyle=\frac{1}{|f_{1}(0,\bar{a}_{1})|}e^{\frac{-\lambda(x+\varepsilon)}{|f_{1}(0,\bar{a}_{1})|}}\ell_{1}(0,\bar{a}_{1})-\frac{\lambda
e^{\frac{-\lambda(x+\varepsilon)}{|f_{1}(0,\bar{a}_{1})|}}}{|f_{1}(0,\bar{a}_{1})|}\bar{V}_{\varepsilon}(-\varepsilon,1),$
$\displaystyle\bar{V}_{\varepsilon}^{{}^{\prime}}(x,-1)$
$\displaystyle=-\frac{1}{f_{-1}(0,\bar{a}_{-1})}e^{\frac{-\lambda(\varepsilon-x)}{f_{-1}(0,\bar{a}_{-1})}}\ell_{-1}(0,\bar{a}_{-1})+\frac{\lambda
e^{\frac{-\lambda(\varepsilon-x)}{f_{-1}(0,\bar{a}_{-1})}}}{f_{-1}(0,\bar{a}_{-1})}\bar{V}_{\varepsilon}(\varepsilon,-1).$

and then for $\varepsilon\to 0$

$\displaystyle\bar{V}_{\varepsilon}^{{}^{\prime}}(x,1)\longrightarrow\frac{\bar{\mu}\big{(}\ell_{1}(0,\bar{a}_{1})-\ell_{-1}(0,\bar{a}_{-1})\big{)}}{|f_{1}(0,\bar{a}_{1})|},$
$\displaystyle\bar{V}_{\varepsilon}^{{}^{\prime}}(x,-1)\longrightarrow\frac{(\bar{\mu}-1)\big{(}\ell_{-1}(0,\bar{a}_{-1})-\ell_{1}(0,\bar{a}_{1})\big{)}}{f_{-1}(0,\bar{a}_{-1})}.$

Recalling the definition of $A_{0}$ Eq. 12, calculating $\overline{\mu}$ we
get

$\bar{V}_{\varepsilon}^{{}^{\prime}}(x,1)\longrightarrow\frac{\ell_{1}(0,\bar{a}_{1})-\ell_{-1}(0,\bar{a}_{-1})}{f_{-1}(0,\bar{a}_{-1})-f_{1}(0,\bar{a}_{1})},\quad\bar{V}_{\varepsilon}^{{}^{\prime}}(x,-1)\longrightarrow\frac{\ell_{1}(0,\bar{a}_{1})-\ell_{-1}(0,\bar{a}_{-1})}{f_{-1}(0,\bar{a}_{-1})-f_{1}(0,\bar{a}_{1})}$

and then Eq. 18.

######  Theorem 3.7.

Let $u$ be a bounded and continuous subsolution of Eq. 13. Then
$u\leq\tilde{V}$ in ${\mathbb{R}}$.

######  Proof 3.8.

We first note that we can assume to be in the situation as in Lemma 3.5.
Indeed, otherwise in at least one branch $\tilde{V}$ coincides with the
corresponding state-constraint value function which, see for example Soner
[23], is greater than any subsolution (note that, in general the state-
constraint value functions do not satisfy the third line of Eq. 13). We then
also get $u\leq\tilde{V}$ on the other branch.
We assume by contradiction that
$\sup_{x\in{\mathbb{R}}}(u-\tilde{V})(x)>\delta>0$. If

$\exists r>0|\forall\delta^{\prime}>0\ \exists\
\overline{x}\in[r,+\infty[:\sup_{x\in{\mathbb{R}}}\big{(}(u-\tilde{V})(x)-(u-\tilde{V})(\overline{x})\big{)}\leq\delta,$

then, by Theorem 3.3 and known comparison techniques we get a contradiction
because, in $]r,+\infty[$, $\tilde{V}$ is a supersolution and $u$ is a
subsolution of the same HJB. Similarly for the opposite case $]-\infty,-r[$.
Hence we may restrict to the case where $u-\tilde{V}$ has the maximum with
respect to $r$ in $x=0$. Since $\bar{V}_{\varepsilon}(x,i)$ converges to
$\tilde{V}(0)$, with $\bar{V}_{\varepsilon}$ defined in Eq. 19, then for small
$\varepsilon$,

(21)
$u(z^{i})-\bar{V}_{\varepsilon}(z^{i},i)=\max_{[-\varepsilon,\varepsilon]}(u(\cdot)-\bar{V}_{\varepsilon}(\cdot,i))>\frac{\delta}{2}>0,$

with $z^{i}\in[-\varepsilon,\varepsilon]$. If for example
$\max(u(\cdot)-\bar{V}_{\varepsilon}(\cdot,1))$ is reached in $x=-\varepsilon$
and $\max(u(\cdot)-\bar{V}_{\varepsilon}(\cdot,-1))$ is reached only in
$\varepsilon$, then using Eq. 20 we get the following contradiction

(22) $\begin{array}[]{ll}\displaystyle
u(-\varepsilon)-\bar{V}_{\varepsilon}(-\varepsilon,1)=u(-\varepsilon)-\bar{V}_{\varepsilon}(-\varepsilon,-1)\\\
\displaystyle<u(\varepsilon)-\bar{V}_{\varepsilon}(\varepsilon,-1)=u(\varepsilon)-\bar{V}_{\varepsilon}(\varepsilon,1).\end{array}$

This implies that in at least one branch we can assume $z^{i}$ not equal to
corresponding switching threshold. Then let us assume
$z^{-1}\in[-\varepsilon,\varepsilon[$.

We are now comparing $u$ and $\overline{V}_{\varepsilon}$. We first note that
by Eq. 19 we have for every $i=-1,1$

$\lambda\bar{V}_{\varepsilon}(x,i)-f_{i}(x,\bar{a}_{i})\bar{V}_{\varepsilon}^{{}^{\prime}}(x,i)-\ell_{i}(x,\bar{a}_{i})\geq-O(\varepsilon),$

in $x\in[-\varepsilon,\varepsilon[$ or in $]-\varepsilon,\varepsilon]$
respectively, where, here and in the sequel $O(\varepsilon)$ is a suitable
positive infinitesimal quantity as $\varepsilon\to 0$. Recalling that
$\bar{V}_{\varepsilon}(\cdot,i)$ is derivable in $[-\varepsilon,\varepsilon]$
and recalling the sign of $f_{i}(0,\bar{a}_{i})$ we then get for every
$i=-1,1$

(23) $\lambda\bar{V}_{\varepsilon}(x,i)+H_{i}(x,p)\geq-O(\varepsilon),$

for every $x\in[-\varepsilon,\varepsilon[$ and for every $p$ subgradient in
$x$ with respect to $[-\varepsilon,\varepsilon]$ of
$\bar{V}_{\varepsilon}(\cdot,-1)$ (respectively for any
$x\in]-\varepsilon,\varepsilon]$ and $p$ subgradient of
$\bar{V}_{\varepsilon}(\cdot,1)$).

Let $\eta:[-\varepsilon,\varepsilon]\to{\mathbb{R}}$ be continuous and $c>0$
such that

(24) $]x+\xi\eta(x)-\xi c,x+\xi\eta(x)+\xi c[\ \subseteq\
]-\varepsilon,\varepsilon[\ \forall x\in[-\varepsilon,\varepsilon],0<\xi\leq
c.$

For any $0<\xi\leq c$, we define the function in
$[-\varepsilon,\varepsilon]\times[-\varepsilon,\varepsilon]$:

$\Phi_{\xi}(x,y)=u(x)-\bar{V}_{\varepsilon}(y,-1)-\left|\frac{x-y}{\xi}-\eta(z^{-1})\right|^{2}-\left|y-z^{-1}\right|^{2}.$

Let $(x_{\xi}^{-1},y_{\xi}^{-1})$ be a point of maximum for
$\Phi_{\xi}\in[-\varepsilon,\varepsilon]\times[-\varepsilon,\varepsilon]$.
Recalling $z^{-1}\in[-\varepsilon,\varepsilon[$ by standard estimates (see
Soner [23] or Bardi- Capuzzo Dolcetta [7] pp. 271) for small $\xi$ we get
$x_{\xi}^{-1}\in]-\varepsilon,\varepsilon[$,
$y_{\xi}^{-1}\in[-\varepsilon,\varepsilon[$ and

(25)
$\frac{x_{\xi}^{-1}-y_{\xi}^{-1}}{\xi}\rightarrow\eta(z^{-1})\quad\text{and}\quad
x_{\xi}^{-1},y_{\xi}^{-1}\rightarrow z^{-1}\quad\text{as}\quad\xi\rightarrow
0.$

We have the following possible cases, for a subsequence $\xi\to 0$:
(i) $(x_{\xi}^{-1},y_{\xi}^{-1})\in\
]-\varepsilon,0[\times[-\varepsilon,\varepsilon[$; (ii) $x_{\xi}^{-1}=0$ and
$y_{\xi}^{-1}\in]-\varepsilon,\varepsilon[$;
(iii) $(x_{\xi}^{-1},y_{\xi}^{-1})\in\
]0,\varepsilon[\times]-\varepsilon,\varepsilon[$.
Case (i). We get for any small $\xi$

(26) $\lambda
u(x_{\xi}^{-1})+H_{-1}\bigg{(}x_{\xi}^{-1},\frac{2}{\xi}\bigg{(}\frac{x_{\xi}^{-1}-y_{\xi}^{-1}}{\xi}-\eta(z^{-1})\bigg{)}\bigg{)}\leq
0,$ (27)
$\lambda\bar{V}_{\varepsilon}(y_{\xi}^{-1},-1)+H_{-1}\bigg{(}y_{\xi}^{-1},\frac{2}{\xi}\bigg{(}\frac{x_{\xi}^{-1}-y_{\xi}^{-1}}{\xi}-\eta(z^{-1})\bigg{)}+2(z^{-1}-y_{\xi}^{-1})\bigg{)}\geq-O(\varepsilon).$

and we conclude in the standard way getting the contradiction to Eq. 21 first
sending $\xi\to 0$ and then $\varepsilon\to 0$.
Case (ii). By $x_{\xi}^{-1}=0$ we have that

(28) $\displaystyle\min\biggl{\\{}\lambda
u(0)+H_{1}\bigg{(}0,\frac{2}{\xi}\bigg{(}\frac{-y_{\xi}^{-1}}{\xi}-$
$\displaystyle\eta(z^{-1})\bigg{)}\bigg{)},$ $\displaystyle\lambda
u(0)+H_{-1}\bigg{(}0,\frac{2}{\xi}\bigg{(}\frac{-y_{\xi}^{-1}}{\xi}-\eta(z^{-1})\bigg{)}\bigg{)}\biggr{\\}}\leq
0.$

If $\lambda
u(0)+H_{-1}\bigg{(}0,\frac{2}{\xi}\bigg{(}\frac{-y_{\xi}^{-1}}{\xi}-\eta(z^{-1})\bigg{)}\bigg{)}\leq
0$ for a subsequence $\xi$ tends to 0 we conclude as in Case (i). Otherwise,
we have

(29) $\lambda
u(0)+H_{1}\bigg{(}0,\frac{2}{\xi}\bigg{(}\frac{-y_{\xi}^{-1}}{\xi}-\eta(z^{-1})\bigg{)}\bigg{)}\leq
0.$

The inequality Eqs. 27 and 29 cannot be compared because they have different
Hamiltonians. However, noting that
$y_{\xi}^{-1}\in]-\varepsilon,\varepsilon[$, we have

$\left(\bar{V}_{\varepsilon}(y_{\xi}^{-1},-1)\right)^{{}^{\prime}}=\frac{2}{\xi}\bigg{(}\frac{x_{\xi}^{-1}-y_{\xi}^{-1}}{\xi}-\eta(z^{-1})\bigg{)}+2(z^{-1}-y_{\xi}^{-1}).$

By Eq. 18, we have

$\bar{V}_{\varepsilon}(y_{\xi}^{-1},1)=\bar{V}_{\varepsilon}(y_{\xi}^{-1},-1)+{O}(\varepsilon),\quad\left(\bar{V}_{\varepsilon}(y_{\xi}^{-1},1)\right)^{\prime}=\left(\bar{V}_{\varepsilon}(y_{\xi}^{-1},-1)\right)^{{}^{\prime}}+{O}(\varepsilon),$

and using Eq. 23 in $y_{\xi}^{-1}$ for $i=1$, we get

(30)
$\lambda\bar{V}_{\varepsilon}(y_{\xi}^{-1},1)+H_{1}\bigg{(}y_{\xi}^{-1},\frac{2}{\xi}\bigg{(}\frac{-y_{\xi}^{-1}}{\xi}-\eta(z^{-1})\bigg{)}+2(z^{-1}-y_{\xi}^{-1})\bigg{)}\geq-{O}(\varepsilon).$

Then using Eqs. 29 and 30 we may conclude in standard way obtaining a
contradiction as in the case (i).
Case (iii). For $x_{\xi}^{-1}\in]0,\varepsilon[$ we have

(31) $\lambda
u(x_{\xi}^{-1})+H_{1}\bigg{(}x_{\xi}^{-1},\frac{2}{\xi}\bigg{(}\frac{x_{\xi}^{-1}-y_{\xi}^{-1}}{\xi}-\eta(z^{-1})\bigg{)}\bigg{)}\leq
0$

that cannot be compared with Eq. 27. Being also in this case
$y_{\xi}^{-1}\in[-\varepsilon,\varepsilon[$, we conclude as in the case
before.

##  4 A threefold junctions problem

In the previous section we have considered the case where the junction is
given by a line divided into two half-line by a point. Here, we consider a
junction given by three half-lines entering the same point (see Fig. 3). In
this case we have three labels $\left\\{1,2,3\right\\}$, one for every half-
line $R_{1},R_{2},R_{3}$, that we identify with the labelled half-line
$R_{i}=[0,+\infty[\times\\{i\\}$. We also consider the controlled dynamics
$f_{i}:R_{i}\times A\to{\mathbb{R}}$ and the running costs
$\ell_{i}:R_{i}\times A\to[0,+\infty[$. We approximate these triple
discontinuity by a thermostatic-type combination in the following way. We
extend $f_{i}$ and $\ell_{i}$ to
$[-\varepsilon_{i},+\infty[\times\\{i\\}\times A$, where all thresholds
$\varepsilon_{i}$ are greater than $0$ and not necessarily the same for every
$i$.

Figure 3:  The threefold junctions and its thermostatic-type approximation.

The thermostatic controlled dynamics is given by

(32) $\begin{cases}x^{\prime}(t)=f_{i(t)}(x(t),\alpha(t)),\\\
i(t)=\tilde{h}[x](t),\\\ i(0)=i_{0}\in\left\\{1,2,3\right\\},\\\
x(0)=x_{0}\in\ [-\varepsilon_{i(0)},+\infty[,\end{cases}$

where $\tilde{h}[x](t)$ is the delayed thermostatic rules as show Fig. 3. In
this thermostatic representation, denoting by
$R_{\varepsilon_{i}}:=[-\varepsilon_{i},+\infty[\times\\{i\\}$ (and by
$int(R_{\varepsilon_{i}})=]-\varepsilon_{i},+\infty[\times\\{i\\}$), we can
only switch from $R_{\varepsilon_{1}}$ to $R_{\varepsilon_{2}}$, from
$R_{\varepsilon_{2}}$ to $R_{\varepsilon_{3}}$ and from $R_{\varepsilon_{3}}$
to $R_{\varepsilon_{1}}$. This is an arbitrary choice, because when we are in
the junction-point, we can in general switch in anyone of the other branches.
However, we will recover this kind of behaviour in the limit procedure.
Moreover, in the switching rule given by $\tilde{h}$, also the variable $x$ is
subject to a discontinuity at the switching instant unlike the twofold case in
previous section (see Fig. 3 and also note in the thermostat, the branch
$R_{\varepsilon_{1}}$ is oriented in the opposite way with respect to the
standard one). For every $i_{0}\in\left\\{1,2,3\right\\}$ and $\forall
x_{0}\in\ [-\varepsilon_{i(0)},+\infty[$ we consider the value function

(33)
$V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(x_{0},i_{0})=\inf_{\alpha\in{\cal
A}}\int_{0}^{\infty}e^{-\lambda t}\ell_{i(t)}(x(t),\alpha(t))dt,$

and we also have for every $i=1,2,3$ the Hamiltonians

(34) $H_{i}(x,p)=\sup_{a\in A}\left\\{-f_{i}(x,a)\cdot
p-\ell_{i}(x,a)\right\\}.$

where we drop the index $i$ in the entries of $f_{i}$, $\ell_{i}$ and hence in
$H_{i}$. We will sometimes use this simplification of the notation in the
sequel too, without remember it.
As in Theorem 1.1 we have the following proposition

######  Proposition 4.1.

For any choice of $\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}>0$ the
value function $V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}$ of the
switching three-thermostatic optimal control problem is the unique bounded and
continuous function on $R_{\varepsilon_{1}}\cup R_{\varepsilon_{2}}\cup
R_{\varepsilon_{3}}$ which satisfies, in the viscosity sense

(35) $\begin{cases}\lambda
V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(x,1)+H_{1}\bigg{(}x,V^{\prime}_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(x,1)\bigg{)}=0&\text{in}\
\textit{int}(R_{\varepsilon_{1}}),\\\
V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(-\varepsilon_{1},1)=V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(\varepsilon_{2},2);\\\
\lambda
V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(x,2)+H_{2}\bigg{(}x,V^{\prime}_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(x,2)\bigg{)}=0&\text{in}\
\textit{int}(R_{\varepsilon_{2}}),\\\
V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(-\varepsilon_{2},2)=V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(\varepsilon_{3},3);\\\
\lambda
V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(x,3)+H_{3}\bigg{(}x,V^{\prime}_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(x,3)\bigg{)}=0&\text{in}\
\textit{int}(R_{\varepsilon_{3}}),\\\
V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(-\varepsilon_{3},3)=V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(\varepsilon_{1},1).\end{cases}$

Then we study two different thermostatic problems: the first with uniform
switching thresholds and the second one with non-uniform switching thresholds.

###  4.1 Uniform switching thresholds

In this subsection we consider the
thresholds
$(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})=(\varepsilon,\varepsilon,\varepsilon)$.
Looking to the twofold junction it is easy to see that the convexification
parameters $\mu,1-\mu$ are given by the ratio between the time spent using
$f_{i}(0,a_{i})$ to go from a threshold to the other one (namely
$2\varepsilon/f_{i}(0,a_{i})$) and the total time to perform a complete
switching. Coherently to that, when for $f_{1},f_{2},f_{3}<0$ (here we drop
the entries in the dynamics), namely when we perform the whole cycle, the
right convex parameters to be considered are

(36) $\mu_{1}=\frac{f_{2}f_{3}}{f_{2}f_{3}+f_{1}f_{3}+f_{1}f_{2}},\
\mu_{2}=\frac{f_{1}f_{3}}{f_{2}f_{3}+f_{1}f_{3}+f_{1}f_{2}},\
\mu_{3}=\frac{f_{1}f_{2}}{f_{2}f_{3}+f_{1}f_{3}+f_{1}f_{2}}.$

Moreover $(\mu_{1},\mu_{2},\mu_{3})\in[0,1]^{3}$ and
$\sum_{i=1}^{3}\mu_{i}=1$. Observe that now we have not anymore the
interpretation as balance of forces, indeed in general
$\sum_{i=1}^{3}\mu_{i}f_{i}(0,a_{i})\neq 0$, regardless to our choice of the
signs of the branches $R_{i}$ and dynamics $f_{i}$. We also note that Eq. 36
is meaningful with the same interpretation when at most one $f_{i}$ is null,
in which case we definitely remain in the corresponding branch. In order to
identify the limit optimal control problem when $\varepsilon\to 0$ we start to
define its controlled dynamics. In particular, calling $TR=R_{1}\cup R_{2}\cup
R_{3}$, we have that if $(x,i)\in TR$, with $x\neq 0$ then the dynamics is the
usual $f_{i}(x,a_{i})$ with $a_{i}\in A$. If instead $x=0$, being
$(0,i)=(0,j)$ for $i,j\in\\{1,2,3\\},i\neq j$, we can either choose any
dynamics makes us to stay inside a single branch $R_{i}$ or we may rest at
zero “formally” using any combination $\sum_{i=1}^{3}\mu_{i}f_{i}(0,a_{i})$
with $f_{i}(0,a_{i})$ and $\mu_{i}$ as before. More specifically, we define
the set of controls in the junction point

$A(0)=A_{0}\cup\widetilde{A}$

with (note that in $\widetilde{A}$ the index $i$ is also at disposal)

$\displaystyle A_{0}$ $\displaystyle=\\{(a_{1},a_{2},a_{3})\in A^{3}|\
f_{i}(0,a_{i})\leq 0\ \text{with at most one equal to}\ 0\\},$
$\displaystyle\widetilde{A}$ $\displaystyle=\left\\{(a,i)\in
A\times\\{1,2,3\\}|\ f_{i}(0,a)\geq 0\ \right\\}.$

Then, calling $\hat{a}$ the generic element of $A(0)$ we define

$f_{0}(0,\hat{a})=\begin{cases}f_{i}(0,a)&\text{if}\
\hat{a}\in\widetilde{A},\\\ 0&\text{if}\ \hat{a}\in A_{0}.\end{cases}$

With the same arguments, if $(x,i)\in TR$ and $x\neq 0$ then the running cost
is $\ell_{i}(x,a_{i})$ with $a_{i}\in A$, otherwise we define

$\ell_{0}(0,\hat{a})=\begin{cases}\ell_{i}(0,a)&\text{if}\
\hat{a}\in\widetilde{A},\\\
\mu_{1}\ell_{1}(0,a_{1})+\mu_{2}\ell_{2}(0,a_{2})+\mu_{3}\ell_{3}(0,a_{3})&\text{if}\
\hat{a}\in A_{0}.\end{cases}$

The quadruples $f=(f_{1},f_{2},f_{3},f_{0})$ and
$\ell=(\ell_{1},\ell_{2},\ell_{3},\ell_{0})$ then define the threefold
junction optimal control problem. In particular given an initial state
$(x_{0},i_{0})\in TR$ and a measurable control $\alpha(t)\in A\cup A(0)$ we
consider a possible admissible trajectory in $TR$ whose evolution, denoted by
$(x(t),i(t))$, is such that $i(t)$ remains constant whenever $x(t)>0$ and
$x(t)$ evolves with dynamics described above. Let us note that given an
initial state, the set of measurable controls for which there exists a unique
admissible trajectory is not empty and we denote it by ${\cal
A}_{(x_{0},i_{0})}$. We then consider an infinite horizon problem with a
discount factor $\lambda>0$ given by

$J(x_{0},i_{0},\alpha)=\int_{0}^{+\infty}e^{-\lambda
t}\ell(x(t),i(t),\alpha(t))dt,$

where $\ell$ is the running cost described above and the corresponding value
function is

(37) $V(x_{0},i_{0})=\inf_{\alpha\in{\cal
A}_{(x_{0},i_{0})}}J(x_{0},i_{0},\alpha).$

In the sequel when $x=0$ we will drop the index $i$. Note that if we remain in
$x=0$ for all the time using controls in $A_{0}$ the best cost is given by

(38)
$u_{1,2,3}(0)=\frac{1}{\lambda}\inf_{A_{0}}\left\\{\mu_{1}\ell_{1}(0,a_{1})+\mu_{2}\ell_{2}(0,a_{2})+\mu_{3}\ell_{3}(0,a_{3})\right\\}.$

######  Remark 2.

Note that in general $A_{0}$ is not compact. However, if
$(a_{1}^{k},a_{2}^{k},a_{3}^{k})\in A_{0}$ is a minimizing sequence for
$u_{1,2,3}(0)$ converging to
$(\bar{a}_{1},\bar{a}_{2},\bar{a}_{3})\notin{A_{0}}$ we have that the quantity
inside the brachet in Eq. 38 loses meaning but we still have the inequality

$\lim_{k\rightarrow\infty}\left\\{\mu_{1}^{k}\ell_{1}(0,a_{1}^{k})+\mu_{2}^{k}\ell_{2}(0,a_{2}^{k})+\mu_{3}^{k}\ell_{3}(0,a_{3}^{k})\right\\}\geq\min\\{\ell_{i}(0,\bar{a}_{i})|f_{i}(0,\bar{a}_{i})=0\\}.$

and hence we can always detect an optimal behavior among the ones making as
remaining at $x=0$.

We now have all the ingredients to characterize the value function Eq. 37.

######  Theorem 4.2.

Assume Eqs. 4, 5 and 8. Then, $V$ is continuous on $TR$. Moreover when $x=0$,

(39)
$V(0)=\min\left\\{u_{1,2,3}(0),V_{sc(1)}(0),V_{sc(2)}(0),V_{sc(3)}(0)\right\\},$

where $V_{sc(i)}(0)$ is the value function at $x=0$ of the state- constraint
optimal control problem on $R_{i}$. Therefore
i) if $V(0)=u_{1,2,3}(0)$, then $V$ is the unique bounded and continuous
solution of the three problems (one for every $i\in\left\\{1,2,3\right\\}$)

(40) $\begin{cases}\lambda u+H_{i}(x,u^{\prime})=0\ \ \text{in}\ int(R_{i})\\\
u(0)=u_{1,2,3}(0)\end{cases}$

ii) if $V(0)=V_{sc(i)}(0)$, for some $i=1,2,3$, then $V$ satisfies:
$V=V_{sc(i)}$ in $R_{i}$, and uniquely solves (for every
$j\in\left\\{1,2,3\right\\}\setminus\left\\{i\right\\}$)

(41) $\begin{cases}\lambda u+H_{j}(x,u^{\prime})=0\ \ \text{in}\ int(R_{j})\\\
u(0)=V_{sc(i)}(0).\end{cases}$

######  Proof 4.3.

The continuity of $V$ come from by controllability Eq. 5 and regularity Eqs. 4
and 8 in a standard way. Moreover, Eq. 39 comes from Eq. 37 because the four
terms in the minimum are exactly the only allowed behaviors (see also Remark
2). Finally Eqs. 40 and 41 naturally follow from the standard properties of
the corresponding Dirichlet problems in the viscosity sense.

Theorem 4.2 plays a key role in the following result in which we characterize
the uniform limit of the value function
$V_{\varepsilon,\varepsilon,\varepsilon}$ of the approximating thermostatic
problem.

######  Theorem 4.4.

Assume Eqs. 4, 5 and 8. The value function $V$ Eq. 37 (also characterizes by
Theorem 4.2) satisfies

(42) $V(x,i)=\lim_{\varepsilon\rightarrow
0}V_{\varepsilon,\varepsilon,\varepsilon}(x,i)\ \ \forall\ (x,i)\in R_{i},\
i=1,2,3.$

where $V_{\varepsilon,\varepsilon,\varepsilon}$ is the value function of the
approximating thermostatic problem Eq. 35 with uniform thresholds
$(\varepsilon,\varepsilon,\varepsilon)$, and the convergence is uniform.
Moreover, when $x=0$ the limit is independent from $i=1,2,3$.

######  Proof 4.5.

We first prove that Eq. 42 holds for $x=0$ (the junction point). The fact that
the limit Eq. 42, whenever it exists, is independent from $i$ when $x=0$ comes
from the controllability hypothesis Eq. 5 because
$|V_{\varepsilon,\varepsilon,\varepsilon}(0,i)-V_{\varepsilon,\varepsilon,\varepsilon}(0,j)|$
is infinitesimal as $\varepsilon$. In the sequel, we drop the symbol $i$ in
the expression $V_{\varepsilon,\varepsilon,\varepsilon}(0,i)$.
We prove Eq. 42 at $x=0$ for a convergent subsequence still denoted by
$(\varepsilon,\varepsilon,\varepsilon)$ which exists because
$V_{\varepsilon,\varepsilon,\varepsilon}$ are equi-bounded. The uniqueness of
the limit will give the whole Eq. 42. By contradiction, let us suppose that
$V(0)<\lim V_{\varepsilon,\varepsilon,\varepsilon}(0)$. By Eq. 5, for every
$\varepsilon>0$, we have $V_{\varepsilon,\varepsilon,\varepsilon}(0)\leq
V_{sc(i)}(0)$ for every $i=1,2,3$. Hence, the absurd hypothesis implies
$V(0)=u_{1,2,3}(0)$ by Eq. 39. Let us suppose that $(a_{1},a_{2},a_{3})\in
A_{0}$ realizes the minimum in the definition of $u_{1,2,3}(0)$. We then
analyze some possible cases, the other ones being similar.

1) $f_{1}(0,a_{1}),f_{2}(0,a_{2}),f_{3}(0,a_{3})<0$. Hence, using a suitably
switching control between those constant controls, we get
$V_{\varepsilon,\varepsilon,\varepsilon}(0)$ is not larger then $u_{1,2,3}(0)$
plus an infinitesimal quantity as $\varepsilon\to 0$, which is a
contradiction.

2) $f_{1}(0,a_{1})=0,f_{2}(0,a_{2}),f_{3}(0,a_{3})<0$. In this case we arrive
at $R_{1}$ and we stop with $f_{1}(0,a_{1})$ in $x=0$. Hence,
$u_{1,2,3}(0)=\frac{1}{\lambda}\ell_{1}(0,a_{1})$ cannot be lower than
$V_{sc(1)}(0)$ which is a contradiction.

If instead not exists the minimizing sequence for $(a_{1},a_{2},a_{3})$ (see
Remark 2) then $u_{1,2,3}(0)$ cannot be better than a state constraints. Then
as before, we have again a contradiction.

Now assume $\lim V_{\varepsilon,\varepsilon,\varepsilon}(0)<V(0)$. Let
$\delta>0$ be such that, for $\varepsilon$ small enough, it is
$V_{\varepsilon,\varepsilon,\varepsilon}(0)+\delta<V(0)$. A measurable control
$\alpha$ which almost realizes the optimum (less than $\beta>0$) for
$V_{\varepsilon,\varepsilon,\varepsilon}(0)$ must be such that there are
infinitely many switching between all branches $R_{i}^{\varepsilon}$ (i.e for
every $i$, $f_{i}(x,\alpha_{i})<0\ \forall\ x$ ). Indeed, if it is not the
case, then, for at least one branch $R_{i}^{\varepsilon}$, the trajectory
definitely remains inside it. Hence, for small $\varepsilon$,
$V_{\varepsilon,\varepsilon,\varepsilon}(0)$ is almost equal to
$V_{sc(i)}(0)$, which is a contradiction. Note that we can limit to consider a
piecewise constant control that we call again $\alpha$ since
$V_{\varepsilon,\varepsilon,\varepsilon}$ defined both with measurable
controls and with piecewise constant controls, satisfies the same problem Eq.
35 which admits a unique solution. Then, in order to obtain the optimum, on
each branch $R_{i}^{\varepsilon}$ let $x_{1}^{i},\dots,x_{n^{i}}^{i}$ be the
points corresponding to the discontinuity instants
$t_{1}^{i},\dots,t_{n^{i}}^{i}$ of the control $\alpha$ and let $a_{j}^{i}$ be
the constant controls $\forall i=1,2,3$, $\forall\ j=1,\dots,n^{i}-1$. On the
assumption that $f_{i}(0,a_{j}^{i})<0\ \forall\ i,j$ we consider the dynamics
$f_{i}(0,a_{j}^{i})$ and the running cost $\ell_{i}(0,a_{j}^{i})$ on every
spatial interval $[x_{j}^{i},x_{j+1}^{i}]$. Now, for every $i$ we consider

(43) $\inf_{a\in A}\left\\{\frac{\ell_{i}(0,a)}{|f_{i}(0,a)|}\
|f_{i}(0,a)<0\right\\}.$

If Eq. 43 is a minimum for every $i$ obtained in
$(\bar{a}_{1},\bar{a}_{2},\bar{a}_{3})$ then in each $R_{i}^{\varepsilon}$ we
use constant dynamics $f_{i}(0,\bar{a}_{i})$ and constant running cost
$\ell_{i}(0,\bar{a}_{i})$.
Therefore $\left|J(\cdot,i,\alpha)-J(\cdot,i,\bar{a}_{i})\right|\leq
O(\varepsilon)$ and we get

(44) $\begin{array}[]{ll}\displaystyle
V_{\varepsilon,\varepsilon,\varepsilon}(0)\geq J(\cdot,i,\alpha)-\beta\geq
J(\cdot,i,\bar{a}_{i})-O(\varepsilon)-\beta\\\ \displaystyle\geq
u_{1,2,3}(0)-O(\varepsilon)-\beta\geq V(0)-O(\varepsilon)-\beta,\end{array}$

that is a contradiction. If, for some $i$, Eq. 43 is not a minimum then we can
consider the minimizing sequence $a_{i}^{k}$ that realizes the infimum less
than $O(\frac{1}{k})$. In particular $a_{i}^{k}\to\tilde{a}_{i}\in A$ for
$k\to+\infty$ and $f_{i}(0,a_{i}^{k})\to f_{i}(0,\tilde{a}_{i})=0$ being
$f_{i}(0,a_{i}^{k})<0$. However, since the optimal strategy is to switch among
the branches, we cannot stop in the branch $R_{i}^{\varepsilon}$ with dynamics
$f_{i}(0,\tilde{a}_{i})$ paying the cost $\ell_{i}(0,\tilde{a}_{i})$. Then,
always taking into account that $f_{i}(0,a_{j}^{i})<0$ we have

(45) $\begin{array}[]{ll}\displaystyle
V_{\varepsilon,\varepsilon,\varepsilon}(0)\geq J(\cdot,i,\alpha)-\beta\geq
J(\cdot,i,a_{i}^{k})-O\left(\frac{1}{k}\right)-O(\varepsilon)-\beta\\\
\displaystyle\geq
u_{1,2,3}(0)-O\left(\frac{1}{k}\right)-O(\varepsilon)-\beta\geq
V(0)-O\left(\frac{1}{k}\right)-O(\varepsilon)-\beta,\end{array}$

which is again a contradiction.
Therefore at the end, $V_{\varepsilon,\varepsilon,\varepsilon}(0)$ cannot be
less than $V(0)-\delta$ by the definition of $V(0)$. This is a contradiction.
Hence we have $\lim V_{\varepsilon,\varepsilon,\varepsilon}(0)=V(0)$. Now note
that the equations solved by $V_{\varepsilon,\varepsilon,\varepsilon}$ and by
$V$ (Eqs. 35, 40 and 41 respectively) are the same for all $(x,i)\in
int(R_{i})$ and the boundary datum converges to $V(0)$. Hence, representing
the solutions as the value functions of the corresponding optimal control
problems, we get Eq. 42 and the uniform convergence.

Now we want to show that $V$ Eq. 37 is a viscosity solution of a suitable
Hamilton-Jacobi problem, namely next problem Eq. 54. In order to do this, we
introduce the test functions for the differential equations on the branches
and give the definition of viscosity subsolution and supersolution of Eq. 54.

From now on we consider the control $\alpha$ piecewise constant as explained
in Theorem 4.4 and we indicate it with $\alpha\ p.c.$

######  Definition 4.6.

Let $\varphi:TR\to{\mathbb{R}}$ be a function such that

(46)
$\displaystyle\varphi|_{R_{i}}:=\varphi_{i}:R_{i}\longrightarrow{\mathbb{R}}$
$\displaystyle(x,i)\longmapsto\varphi_{i}(x,i)\ \ \ \text{if}\ x\neq 0,\forall
i\in\\{1,2,3\\}$
$\displaystyle(0,i)\longmapsto\varphi_{i}(0,i)=\varphi_{j}(0,j)\ \forall
j\in\\{1,2,3\\}\setminus\\{i\\},$

with $\varphi\in C^{0}(TR)$ and $\varphi_{i}\in C^{1}(R_{i})$.

######  Definition 4.7.

A continuous function $u:TR\to{\mathbb{R}}$ is a viscosity subsolution of Eq.
54 if for any $(x,i)\in TR$, any $\varphi$ as in Eq. 46 such that $u-\varphi$
has a local maximum at $(x,i)$ with respect to $TR$, then

(47) $\displaystyle\lambda u(x,i)+H_{i}(x,\varphi^{\prime}_{i}(x,i))\leq 0$
$\displaystyle x\in int(R_{i}),$ $\displaystyle\min\left\\{\lambda
u(0,i)+H_{i}(0,\varphi^{\prime}_{i}(0,i)),\ i=1,2,3\right\\}\leq 0$
$\displaystyle x=0.$

A continuous function $u:TR\to{\mathbb{R}}$ is a viscosity supersolution of
Eq. 54 if for any $(x,i)\in TR$, any $\varphi$ as in Eq. 46 such that
$u-\varphi$ has a local minimum at $(x,i)$ with respect to $TR$, then

(48) $\displaystyle\lambda u(x,i)+H_{i}(x,\varphi^{\prime}_{i}(x,i))\geq 0$
$\displaystyle x\in int(R_{i}),$ $\displaystyle\max\left\\{\lambda
u(0,i)+H_{i}(0,\varphi^{\prime}_{i}(0,i)),\ i=1,2,3\right\\}\geq 0$
$\displaystyle x=0.$

In particular note that if $x=0$ then the local maximum/minimum is with
respect to all the three branches and $\varphi^{\prime}_{i}(0,i)$ is the right
derivative on the branch $i$, $(\varphi^{\prime}_{i})^{+}$. Since
$(0,i)=(0,j)$ for $i,\ j\in\\{1,2,3\\},\ i\neq j$, in the sequel we drop the
index $i$ in the pair $(0,i)$.

We will prove the following Theorem using the thermostatic approximation,
namely considering the approximating value function
$V_{\varepsilon,\varepsilon,\varepsilon}$. Differently from the twofold
junction problem in which the index that identifies the branch is included in
the sign of $x$ and the test function $\varphi\in C^{1}({\mathbb{R}})$, here,
we need to extend the test function $\varphi_{i}$ in Eq. 46 from $R_{i}$ to
$R_{i}^{\varepsilon}$. To do that we distinguish the case in which $V-\varphi$
has a local maximum point at $x=0$ from that where $x=0$ is a local minimum
point, both respect to all three branches.
If $V-\varphi$ has a local maximum point at $x=0$ then we suppose that

(49)
$\varphi_{1}^{\prime}(0)^{+}\leq\varphi_{2}^{\prime}(0)^{+}\leq\varphi_{3}^{\prime}(0)^{+}.$

Note that our switching sequence is $1\to 2\to 3\to 1$ which is coherent with
such an order. If the order is different, then we consider a different
switching sequence in the approximating thermostatic $\varepsilon$-problem,
still coherent with the order. This is always possible because the limit
function $V$ is independent from the switching order of the chosen
approximating problem. Then we define

(50)
$\tilde{\varphi}_{i}:[-\varepsilon,+\infty[\times\\{i\\}\longrightarrow{\mathbb{R}},\quad\tilde{\varphi}_{i}=\begin{cases}\varphi_{i}(x,i)&x\geq
0\\\ \varphi_{i_{s}}(-x,i_{s})&x<0\end{cases}$

for $i=1,2$ and with $i_{s}$ the next transition to $i$. If $i=3$ we construct
$\tilde{\varphi}_{3}$ in two different way, correspondingly to the cases:

(51)
$\text{if}\quad\varphi_{1}^{\prime}(0)^{+}=\varphi_{3}^{\prime}(0)^{+}\quad\text{then}\quad\tilde{\varphi}_{3}=\begin{cases}\varphi_{3}(x,3)&x\geq
0,\\\ \varphi_{1}(-x,1)&x<0.\end{cases}$ (52)
$\text{if}\quad\varphi_{1}^{\prime}(0)^{+}<\varphi_{3}^{\prime}(0)^{+}\quad\text{then}\quad\tilde{\varphi}_{3}=\begin{cases}\varphi_{3}(x,3)&x\geq
0,\\\ \varphi_{3}(-x,3)&x<0.\end{cases}$

Note that, by the assumption Eq. 49, the first case gives,
$\varphi_{1}^{\prime}(0)^{+}=\varphi_{2}^{\prime}(0)^{+}=\varphi_{3}^{\prime}(0)^{+}$,
and that the second case gives, at least for small $\varepsilon$,
$\tilde{\varphi}_{1}(\varepsilon,1)=\varphi_{1}(\varepsilon,1)\leq\varphi_{3}(\varepsilon,3)=\tilde{\varphi}_{3}(-\varepsilon,3)$.
Finally note that in both cases we then have
$\tilde{\varphi}_{1}(\varepsilon,1)\leq\tilde{\varphi}_{3}(-\varepsilon,3)$.
If instead $V-\varphi$ has a local minimum point at $x=0$ then we suppose that

(53)
$\varphi_{1}^{\prime}(0)^{+}\geq\varphi_{2}^{\prime}(0)^{+}\geq\varphi_{3}^{\prime}(0)^{+},$

and that the switching order is the coherent one, as above. In this case we
construct $\tilde{\varphi}_{3}$ as in Eqs. 50, 51 and 52(with the only
difference of the case
$\varphi_{1}^{\prime}(0)^{+}<\varphi_{3}^{\prime}(0)^{+}$ replaced by
$\varphi_{1}^{\prime}(0)^{+}>\varphi_{3}^{\prime}(0)^{+}$). In this case, for
at least small $\varepsilon$ it is
$\tilde{\varphi}_{1}(\varepsilon,1)\geq\tilde{\varphi}_{3}(-\varepsilon,3)$.

Note that the function $\tilde{\varphi}_{i}$ is not differentiable in $x=0$,
hence we cannot write a unique HJB equation for the function
$V_{\varepsilon,\varepsilon,\varepsilon}(\cdot,i)$ in branch
$R_{i}^{\varepsilon}$. In order to overcome the problem of discontinuity of
$\tilde{\varphi}_{i}^{\prime}$ in $x=0$ we interpret the behaviour of the
dynamic $f_{i}(x,a_{i})<0$ for $x\in]-\varepsilon,0[$ as entering in the next
branch of the switching rule. More precisely, considering for example the
branches $R_{1}^{\varepsilon}$ and $R_{2}^{\varepsilon}$, we define the
function
${V}_{\varepsilon,\varepsilon,\varepsilon}(x,1)=:\widetilde{V}_{\varepsilon,\varepsilon,\varepsilon}(-x,2)$,
the dynamics $-{f}_{1}(x,a)=:\tilde{f}_{2}(-x,a)$ and the relative running
costs ${\ell}_{1}(x,a)=:\tilde{\ell}_{2}(-x,a)$ for $x\in]-\varepsilon,0[$. In
this way, for any $x\in]-\varepsilon,0[$ a local maximum point of
$V_{\varepsilon,\varepsilon,\varepsilon}(\cdot,1)-\tilde{\varphi}_{1}(\cdot,1)$,
we get that $V_{\varepsilon,\varepsilon,\varepsilon}(\cdot,1)$ satisfies

$\lambda\widetilde{V}_{\varepsilon,\varepsilon,\varepsilon}(-x,2)+\sup_{a\in
A}\left\\{-\tilde{f}_{2}(-x,a)\varphi_{2}(-x,2)^{\prime}-\widetilde{\ell}_{2}(-x,a)\right\\}\leq
0.$

which is equivalent, for the considerations before, to

$\lambda V_{\varepsilon,\varepsilon,\varepsilon}(x,1)+\sup_{a\in
A}\left\\{-f_{1}(x,a)\tilde{\varphi}_{1}(x,1)^{\prime}-\ell_{1}(x,a)\right\\}\leq
0.$

The same ideas can be applied to the other pairs of branches
$(R_{2}^{\varepsilon},R_{3}^{\varepsilon})$ and
$(R_{3}^{\varepsilon},R_{1}^{\varepsilon})$.

######  Theorem 4.8.

Assume Eqs. 4, 5 and 8. The value function $V$ Eq. 37 is a viscosity solution
of the Hamilton-Jacobi-Bellman problem

(54) $\begin{cases}\lambda V+H_{1}(x,\nabla V)=0\ \ \text{in}\ int(R_{1})\\\
\lambda V+H_{2}(x,\nabla V)=0\ \ \text{in}\ int(R_{2})\\\ \lambda
V+H_{3}(x,\nabla V)=0\ \ \text{in}\ int(R_{3})\\\ \min\left\\{\lambda
V+H_{1},\lambda V+H_{2},\lambda V+H_{3}\right\\}\leq 0\ \text{on}\ x=0\\\
\max\left\\{\lambda V+H_{1},\lambda V+H_{2},\lambda V+H_{3}\right\\}\geq 0\
\text{on}\ x=0\end{cases}$

######  Proof 4.9.

From Propositions 4.1 and 4.4 and by classical convergence result,

$\lambda V(x,1)+\sup_{a\in
A}\left\\{-f_{1}(x,a)(V(x,1))^{\prime}-\ell_{1}(x,a)\right\\}=0\ \text{in}\
int(R_{1}),$

and similarly for the equations in $int(R_{2})$ and $int(R_{3})$.
We now prove the fourth equation in Eq. 54. Let $\varphi$ as given in Eq. 46
such that $V-\varphi$ has a strict relative maximum at $x=0$ with respect all
the three branches and consider the assumption Eq. 49. Let us note that, for
every $i$ it is

(55) $\lambda V(0)+\sup_{a\in A,f_{i}(0,a)\geq
0}\\{-f_{i}(0,a)\varphi_{i}^{\prime+}(0)-\ell_{i}(0,a)\\}\leq 0.$

Indeed, for every $\varepsilon>0$, and for every $t>0$, we have
($V_{\varepsilon,\varepsilon,\varepsilon}$ solves DPP)

$V_{\varepsilon,\varepsilon,\varepsilon}(0,i)\leq\inf_{\alpha\
p.c.,f_{i}(0,\alpha)\geq 0}\left(\int_{0}^{t}e^{-\lambda
s}\ell_{i}(x(s),\alpha(s))ds+e^{-\lambda
t}V_{\varepsilon,\varepsilon,\varepsilon}(x(t),i)\right)$

and hence, passing to the limit $\varepsilon\to 0^{+}$,

$V(0)\leq\inf_{\alpha\ p.c.,f_{i}(0,\alpha)\geq
0}\left(\int_{0}^{t}e^{-\lambda s}\ell_{i}(x(s),\alpha(s))ds+e^{-\lambda
t}V(x(t),i)\right)$

and finally we get the desired inequality Eq. 55, being $x=0$ a local maximum
for $V-\varphi_{i}$ with respect to $R_{i}$. Hence, we only need to prove
that, with our hypotheses, for at least one $i$, we get

(56) $\lambda V(0)+\sup_{a\in A,f_{i}(0,a)\leq
0}\\{-f_{i}(0,a)\varphi_{i}^{\prime}(0)^{+}-\ell_{i}(0,a)\\}\leq 0.$

For each $i$ let $(x_{\varepsilon}^{i},i)$ be a sequence of local maximum
points for $V_{\varepsilon,\varepsilon,\varepsilon}-\tilde{\varphi}_{i}$ with
respect to $R_{i}^{\varepsilon}$ convergent to $(0,i)$, with
$\tilde{\varphi}_{i}$ as in Eq. 50. For each $\varepsilon$, for at least one
branch $i$ we may assume $x_{\varepsilon}^{i}\neq-\varepsilon$. Indeed, if it
is not the case, recalling that, by controllability implies
$V_{\varepsilon,\varepsilon,\varepsilon}(-\varepsilon,i)\leq
V_{\varepsilon,\varepsilon,\varepsilon}(\varepsilon,i_{s})$, we get the
contradiction

$\begin{array}[]{ll}V_{\varepsilon,\varepsilon,\varepsilon}(\varepsilon,1)-\tilde{\varphi}_{1}(\varepsilon,1)<V_{\varepsilon,\varepsilon,\varepsilon}(-\varepsilon,1)-\tilde{\varphi}_{1}(-\varepsilon,1)\leq
V_{\varepsilon,\varepsilon,\varepsilon}(\varepsilon,2)-\tilde{\varphi}_{2}(\varepsilon,2)<\\\
V_{\varepsilon,\varepsilon,\varepsilon}(-\varepsilon,2)-\tilde{\varphi}_{2}(-\varepsilon,2)\leq
V_{\varepsilon,\varepsilon,\varepsilon}(\varepsilon,3)-\tilde{\varphi}_{3}(\varepsilon,3)<V_{\varepsilon,\varepsilon,\varepsilon}(-\varepsilon,3)-\tilde{\varphi}_{3}(-\varepsilon,3)\leq\\\
V_{\varepsilon,\varepsilon,\varepsilon}(\varepsilon,1)-\tilde{\varphi}_{1}(\varepsilon,1).\end{array}$

Now, let $i$ be such that $x_{\varepsilon}^{i}\neq-\varepsilon$ for every
$\varepsilon$ (or at least for a subsequence). If $x_{\varepsilon}^{i}>0$ for
all $\varepsilon$, in the limit we get

$\lambda V(0)+\sup_{a\in
A}\left\\{-f_{i}(0,a)\varphi_{i}^{\prime}(0)^{+}-\ell_{i}(0,a)\right\\}\leq
0,$

and we get the conclusion. If $x_{\varepsilon}^{i}\in]-\varepsilon,0[$, in the
limit we get

$\lambda V(0)+\sup_{a\in
A}\left\\{-f_{i}(0,a)\tilde{\varphi}_{i}^{\prime}(0)^{-}-\ell_{i}(0,a)\right\\}\leq
0,$

and in particular

$\lambda V(0)+\sup_{a\in A,f_{i}(0,a)\leq
0}\left\\{-f_{i}(0,a)\tilde{\varphi}_{i}^{\prime}(0)^{-}-\ell_{i}(0,a)\right\\}\leq
0.$

where $\tilde{\varphi}_{i}^{\prime}(0)^{-}$ is the left derivative of
$\tilde{\varphi}_{i}$ at $x=0$. Now, if we are in the first case (all the
right derivatives coincide) then we have
$\tilde{\varphi}_{i}^{\prime}(0)^{-}=\varphi_{i_{s}}^{\prime}(0)^{+}=\varphi_{i}^{\prime}(0)^{+}$,
and hence we get Eq. 56. If instead
$\varphi_{1}^{\prime}(0)^{+}<\varphi_{3}^{\prime}(0)^{+}$ then if $i=1$ then
$i_{s}=2$, hence, by our hypotheses, in the inequality above it is

$-f_{i}(0,a)\tilde{\varphi}_{i}^{\prime}(0)^{-}=-f_{i}(0,a)\varphi_{i_{s}}^{\prime}(0)^{+}\geq-
f_{i}(0,a)\varphi_{i}^{\prime}(0)^{+},$

and we conclude. Same arguments if $i=2$ and $i_{s}=3$. If instead $i=3$, then
$\tilde{\varphi}_{3}(0)^{-}=\varphi_{3}^{\prime}(0)^{+}$ and we conclude.

Finally, if $x_{\varepsilon}^{i}=0$, then we still get

$\lambda V(0)+\sup_{a\in A,f_{i}(0,a)\leq
0}\left\\{-f_{i}(0,a)\tilde{\varphi}_{i}^{\prime}(0)^{-}-\ell_{i}(0,a)\right\\}\leq
0,$

and we conclude as before, i.e. studying the two cases as above.

Now we suppose $V-\varphi$ have a local minimum with respect to $TR$ at
$(0,i)$ and consider Eq. 53. We have to prove that, for at least one $i$, we
have

(57) $\lambda V(0)+\sup_{a\in
A}\\{-f_{i}(0,a)\varphi_{i}^{\prime}(0)^{+}-\ell_{i}(0,a)\\}\geq 0.$

If for some $i$ and for $\varepsilon\to 0^{+}$,
$V_{\varepsilon,\varepsilon,\varepsilon}(\cdot,i)$ coincides with the state-
constraint value function on $R_{\varepsilon}^{i}$, then
$V_{\varepsilon,\varepsilon,\varepsilon}(\cdot,i)$ and $V(\cdot,i)$ coincides
on $R_{i}$ and hence $V$ satisfies the same HJB equation as
$V_{\varepsilon,\varepsilon,\varepsilon}$, which is Eq. 57. Hence we suppose
that no $V_{\varepsilon,\varepsilon,\varepsilon}(\cdot,i)$ coincide with the
corresponding state-constraint value function.

For each $i$ let $(x_{\varepsilon},i)$ be a sequence of local minimum points
for $V_{\varepsilon,\varepsilon,\varepsilon}-\tilde{\varphi}_{i}$ with respect
to $R_{\varepsilon}^{i}$, which converges to $(0,i)$. In this case we may
assume that, for a fixed $i$, the sequence is such that either
$x_{\varepsilon}^{i}\neq-\varepsilon$ or $x_{\varepsilon}^{i}=-\varepsilon$
but the HJB equation satisfied by $V_{\varepsilon,\varepsilon,\varepsilon}$
has the right sign ($\geq 0$). Indeed, if it is not the case (i.e.
$x_{\varepsilon}^{i}=-\varepsilon$ and HJB has the wrong sign), we must have
$V_{\varepsilon,\varepsilon,\varepsilon}(-\varepsilon,i)=V_{\varepsilon,\varepsilon,\varepsilon}(\varepsilon,i_{s})$,
and hence we get the following contradiction

$\begin{array}[]{ll}V_{\varepsilon,\varepsilon,\varepsilon}(\varepsilon,1)-\tilde{\varphi}_{1}(\varepsilon,1)>V_{\varepsilon,\varepsilon,\varepsilon}(-\varepsilon,1)-\tilde{\varphi}_{1}(-\varepsilon,1)=V_{\varepsilon,\varepsilon,\varepsilon}(\varepsilon,2)-\tilde{\varphi}_{2}(\varepsilon,2)>\\\
V_{\varepsilon,\varepsilon,\varepsilon}(-\varepsilon,2)-\tilde{\varphi}_{2}(-\varepsilon,2)=V_{\varepsilon,\varepsilon,\varepsilon}(\varepsilon,3)-\tilde{\varphi}_{3}(\varepsilon,3)>V_{\varepsilon,\varepsilon,\varepsilon}(-\varepsilon,3)-\tilde{\varphi}_{3}(-\varepsilon,3)\geq\\\
V_{\varepsilon,\varepsilon,\varepsilon}(\varepsilon,1)-\tilde{\varphi}_{1}(\varepsilon,1).\end{array}$

If $x_{\varepsilon}^{i}>0$, in the limit we exactly get

$\lambda V(0)+\sup_{a\in
A}\\{-f_{i}(0,a)\varphi_{i}^{\prime}(0)^{+}-\ell_{i}(0,a)\\}\geq 0.$

If $x_{\varepsilon}^{i}\in[-\varepsilon,0[$ in the limit we get

$\lambda V(0)+\sup_{a\in
A}\\{-f_{i}(0,a)\tilde{\varphi}_{i}^{\prime}(0)^{-}-\ell_{i}(0,a)\\}\geq 0.$

If all the right derivatives at $x=0$ of $\varphi_{i}(0)$ coincide, then we
conclude because
$\tilde{\varphi}_{i}^{\prime}(0)^{-}=\varphi_{i_{s}}^{\prime}(0)^{+}=\varphi_{i}^{\prime}(0)^{+}$
. Otherwise, if $i=3$ then we have
$\tilde{\varphi}_{i}^{\prime}(0)^{-}=\varphi_{3}^{\prime}(0)^{+}$ and we
conclude; if $i=1$ or $i=2$, by the hypotheses on
$V_{\varepsilon,\varepsilon,\varepsilon}(\cdot,i)$ not coincident with the
state-constraint value function, we get that the supremum above is
approximated by controls such that $f_{i}(0,a)\leq 0$, which means

$-f_{i}(0,a)\tilde{\varphi}_{i}^{\prime}(0)^{-}=-f_{i}(0,a)\tilde{\varphi}_{i_{s}}(0)^{+}\leq-
f_{i}(0,a)\varphi_{i}(0)^{+}$

and we conclude.

If $x_{\varepsilon}^{i}=0$, then in the limit we get (still recalling that
$V_{\varepsilon,\varepsilon,\varepsilon}(\cdot,i)$ is not the state-constraint
value function)

$\lambda V(0)+\sup_{a\in A,f_{i}(0,a)\leq
0}\\{-f_{i}(0,a)\tilde{\varphi}_{i}^{\prime}(0)^{-}-\ell_{i}(0,a)\\}\geq 0$

and we conclude as before.

As we have obtain a result of maximal viscosity subsolution for the twofold-
junction, now we want to prove that $V$ Eq. 37 is the maximal subsolution of
Eq. 54.
Let us assume that $\forall\ \varepsilon>0$ small enough, the optimal strategy
for the approximating problem $\varepsilon$, starting by any $(x,i)$ with
$x\in[-\varepsilon,\varepsilon]$, is to run through infinitely many switches
between the three branches (i.e. no state-constraint behaviour is optimal).
Let then $\mu_{1},\mu_{2},\mu_{3}$ be as in Eq. 36 and $(a_{1},a_{2},a_{3})\in
A_{0}$ that realize the minimum in Eq. 38 such that

(58)
$V(0)=u_{1,2,3}(0)=\frac{1}{\lambda}\\{\mu_{1}\ell_{1}(0,a_{1})+\mu_{2}\ell_{2}(0,a_{2})+\mu_{3}\ell_{3}(0,a_{3})\\}.$

For every $x\in[0,\varepsilon]$, we define the following functions

(59)
$\bar{V}^{\varepsilon}(x,i)=\int_{0}^{\frac{x}{|f_{i}(0,a_{i})|}}e^{-\lambda
t}\ell_{i}(0,a_{i})dt+e^{\frac{-\lambda x}{|f_{i}(0,a_{i})|}}u_{1,2,3}(0),$

where the upper extremal of the integration is the reaching time of the point
$0$ in the corresponding branch starting from $x\in[0,\varepsilon]$. Note
that, for $x\in[0,\varepsilon]$,
$V_{\varepsilon,\varepsilon,\varepsilon,}(x,i)$ is not larger then
$\bar{V}^{\varepsilon}(x,i)$ plus an infinitesimal quantity as $\varepsilon\to
0$. The functions in Eq. 59 are differentiable in $[0,\varepsilon]$ by the
constancy of dynamics and running costs. A direct computation gives

$\bar{V}^{\varepsilon}(x,i)^{\prime}=\frac{\ell_{i}(0,a_{i})}{|f_{i}(0,a_{i})|}e^{\frac{-\lambda
x}{|f_{i}(0,a_{i})|}}-\frac{\lambda e^{\frac{-\lambda
x}{|f_{i}(0,a_{i})|}}}{|f_{i}(0,a_{i})|}{u}_{1,2,3}(0),$

and then for $\varepsilon\to 0$

$\displaystyle\bar{V}^{\varepsilon}(x,1)^{\prime}$
$\displaystyle\longrightarrow\frac{(1-\mu_{1})\ell_{1}(0,a_{1})-\mu_{2}\ell_{2}(0,a_{2})-\mu_{3}\ell_{3}(0,a_{3})}{|f_{1}(0,a_{1})|},$
$\displaystyle\bar{V}^{\varepsilon}(x,2)^{\prime}$
$\displaystyle\longrightarrow\frac{-\mu_{1}\ell_{1}(0,a_{1})+(1-\mu_{2})\ell_{2}(0,a_{2})-\mu_{3}\ell_{3}(0,a_{3})}{|f_{2}(0,a_{2})|},$
$\displaystyle\bar{V}^{\varepsilon}(x,3)^{\prime}$
$\displaystyle\longrightarrow\frac{-\mu_{1}\ell_{1}(0,a_{1})-\mu_{2}\ell_{2}(0,a_{2})+(1-\mu_{3})\ell_{3}(0,a_{3})}{|f_{3}(0,a_{3})|}.$

Moreover by Eq. 59 we have for every $i=1,2,3$

(60)
$\lambda\bar{V}^{\varepsilon}(x,i)-f_{i}(x,a_{i})\bar{V}^{\varepsilon}(x,i)^{\prime}-\ell_{i}(x,a_{i})\geq-O(\varepsilon),$

in $x\in[0,\varepsilon]$. Note that in Eq. 60 when $x=0$ we use the right
derivative of $\bar{V}^{\varepsilon}(x,i)$ and
$\bar{V}^{\varepsilon}(0,i)={u}_{1,2,3}(0)$ for every $i$. Furthermore, by
differentiability of $\bar{V}^{\varepsilon}(x,i)$ and recalling the sign of
$f_{i}(0,a_{i})$ we then get for every $i$

$\lambda\bar{V}^{\varepsilon}(x,i)+H_{i}(x,q)\geq-O(\varepsilon),$

for every $x\in[0,\varepsilon]$ and for every $q$ subgradient in $x$ of
$\bar{V}^{\varepsilon}(x,i)$.
We now define on
$TR\cap\left(\cup_{i=1}^{3}[0,\varepsilon]\times\\{i\\}\right)$ the function

(61) $\bar{V}(x)=\begin{cases}\bar{V}^{\varepsilon}(x,i)&\text{if}\ x\in
int(R_{i}),\\\ u_{1,2,3}(x)&\text{if}\ x=0.\end{cases}$

which is in $C^{1}([0,\varepsilon])$ and that we extend to whole $TR$
maintaining its differentiability. This function will be useful in the
following Theorem.

######  Theorem 4.10.

Let u be a bounded and continuous subsolution of Eq. 54. Then $u\leq V$ in
$TR$.

######  Proof 4.11.

We can assume to be in the settings above for which Eq. 58 holds. Indeed,
otherwise in at least one branch $V$ coincides with the corresponding state-
constraint value function which is greater than any subsolution (see Soner
[23]). We then also have $u\leq V$ on the other branches. By contradiction we
suppose that $\sup_{(x,i)\in TR}(u-V)(x,i)>\delta>0$. If

$\exists r>0|\forall\delta^{\prime}>0\ \exists\
(\overline{x},i)\in[r,+\infty[\times\\{i\\}:\sup_{(x,i)\in
TR}\big{(}(u-{V})(x,i)-(u-V)(\overline{x},i)\big{)}\leq\delta,$

then, by Theorem 4.8 and known comparison techniques we get a contradiction
because, in $]r,+\infty[\times\\{i\\}$, $V$ is a supersolution and $u$ is a
subsolution of the same HJB. Hence we may restrict to the case where $u-V$ has
the maximum with respect to $r$ in $x=0$. Since $\bar{V}^{\varepsilon}(x,i)$
converges to $V(0)$, with $\bar{V}^{\varepsilon}$ defined in Eq. 59, then for
small $\varepsilon$,

(62)
$u(z^{i},i)-\bar{V}^{\varepsilon}(z^{i},i)=\max_{[0,\varepsilon]\times\\{i\\}}(u(\cdot,i)-\bar{V}^{\varepsilon}(\cdot,i))>\frac{\delta}{2}>0.$

Since $u(x,i)$ is a continuous subsolution of Eq. 54 then satisfies

(63) $\lambda u(x,i)-f_{i}(x,a_{i})\cdot p-\ell_{i}(x,a_{i})\leq 0\quad\forall
p\in D^{+}u(x,i)\neq\emptyset,$

where $D^{+}u(x,i)$ is the set of super-differentials of $u$ at a point
$(x,i)$. Now, taking into account Eqs. 60 and 62 we have that

(64)
$p-\bar{V}^{\varepsilon}(x,i)^{\prime}\leq\frac{-\lambda\delta}{2|f_{i}(x,a_{i})|}+O(\varepsilon),$

whence, for
$\varepsilon<\frac{1}{2}\left|\frac{\lambda\delta}{2|f_{i}(x,a_{i})|}\right|$,
we get that $p-\bar{V}^{\varepsilon}(x,i)^{\prime}\leq-\bar{\delta}$, for a
suitable $\bar{\delta}>0$ regardless to $x$. Hence
$u(x,i)-\bar{V}^{\varepsilon}(x,i)$ is decreasing and, taking $\varepsilon$ as
above, has maximum point in $x=0$. By the previous consideration we get that
$\bar{V}(x)$ Eq. 61 is an admissible test function and that $u-\bar{V}$ has a
local maximum point in $x=0$ for suitable small $\varepsilon>0$. Hence, being
$u$ a subsolution, exists $\bar{i}\in\\{1,2,3\\}$ such that

(65) $\lambda
u(0)+H_{\bar{i}}\left(0,\left(\bar{V}^{\varepsilon}(0,\bar{i})^{\prime}\right)\right)\leq
0.$

Moreover, byEq. 59, we have

(66)
$\lambda\bar{V}^{\varepsilon}(0,\bar{i})+H_{\bar{i}}\left(0,\left(\bar{V}^{\varepsilon}(0,\bar{i})^{\prime}\right)\right)\geq-O(\varepsilon).$

Subtracting Eq. 66 to Eq. 65 we get the contradiction to Eq. 62 and then, for
$\varepsilon\to 0$, $u\leq V$ in $TR$.

###  4.2 Non-uniform switching thresholds

In this section we suppose that the three thresholds of the three-thermostatic
optimal control problem are not the same for all $R_{\varepsilon_{i}}$. This
imply that the time spent in a single branch $R_{\varepsilon_{i}}$ to reach
the relative threshold depends on the value of $\varepsilon_{i}$. Accordingly
to this, the convexification parameters
$\bar{\mu}_{1},\bar{\mu}_{2},\bar{\mu}_{3}$ are such that if at limit for
$(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})\to(0^{+},0^{+},0^{+})$ the
optimal behavior is to switch only between two branch, $R_{i}$ and $R_{j}$ for
$i,j\in\\{1,2,3\\},i\neq j$, then $\bar{\mu}_{i}+\bar{\mu}_{j}=1$. If instead
the optimal behavior is to switch among all three branches $R_{i}$ then
$\bar{\mu}_{i}=\mu_{i}$ as in Eq. 36. To identify the limit optimal control
problem when
$(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})\to(0^{+},0^{+},0^{+})$ we
start to the define the controlled dynamics. Using the same notation of the
last section, if $(x,i)\in TR$ with $x\neq 0$ then the dynamics is the usual
$f_{i}(x,a_{i})$ with $a_{i}\in A$. If instead $x=0$, being $(0,i)=(0,j)$ for
$i,j\in\\{1,2,3\\},i\neq j$, we can either choose any dynamics makes us to
stay inside a single branch $R_{i}$ or we may rest at zero using any
combination $\sum_{i=1}^{3}\bar{\mu}_{i}f_{i}(0,a_{i})$ with $f_{i}(0,a_{i})$
and $\bar{\mu}_{i}$ as before. In detail, the set of controls in the junction
point is $A(0)=\overline{A}\cup\widetilde{A}$ with

$\displaystyle\overline{A}$
$\displaystyle=\\{(a_{1},a_{2},a_{3},\sigma,\bar{\mu}_{1},\bar{\mu}_{2},\bar{\mu}_{3})\in
A^{3}\times\\{12,13,23,123\\}\times[0,1]^{3}|$
$\displaystyle\sigma=ij\Rightarrow\bar{\mu}_{i}+\bar{\mu}_{j}=1,f_{i}(0,a_{i})\leq
0;$
$\displaystyle\sigma=123\Rightarrow\bar{\mu}_{i}=\mu_{i},f_{i}(0,a_{i})\leq 0\
\text{with at most one equal to}\ 0\\},$ $\displaystyle\widetilde{A}$
$\displaystyle=\left\\{(a,i)\in A\times\\{1,2,3\\}|\ f_{i}(0,a)\geq
0\right\\}.$

Note that in $\widetilde{A}$ the index $i$ is at disposal, while in
$\overline{A}$, the notation $ij$ means that the switching is only between
$R_{i}$ and $R_{j}$ (as well as $123$ means that the switching performs among
all the three branches).
Then, as in the last section, calling $\hat{a}$ the generic element of $A(0)$
we define

$f_{0}(0,\hat{a})=\begin{cases}f_{i}(0,a)&\text{if}\
\hat{a}\in\widetilde{A},\\\ 0&\text{if}\ \hat{a}\in\overline{A}.\end{cases}$

With the same arguments, if $(x,i)\in TR$ and $x\neq 0$ then the running cost
is $\ell_{i}(x,a_{i})$ with $a_{i}\in A$, otherwise we define

$\ell_{0}(0,\hat{a})=\begin{cases}\ell_{i}(0,a)&\text{if}\
\hat{a}\in\widetilde{A},\\\
\bar{\mu}_{1}\ell_{1}(0,a_{1})+\bar{\mu}_{2}\ell_{2}(0,a_{2})&\text{if}\
\sigma=12\quad\text{and}\ \hat{a}\in\overline{A},\\\
\bar{\mu}_{1}\ell_{1}(0,a_{1})+\bar{\mu}_{3}\ell_{3}(0,a_{3})&\text{if}\
\sigma=13\quad\text{and}\ \hat{a}\in\overline{A},\\\
\bar{\mu}_{2}\ell_{2}(0,a_{2})+\bar{\mu}_{3}\ell_{3}(0,a_{3})&\text{if}\
\sigma=23\quad\text{and}\ \hat{a}\in\overline{A}\\\
\mu_{1}\ell_{1}(0,a_{1})+\mu_{2}\ell_{2}(0,a_{2})+\mu_{3}\ell_{3}(0,a_{3})&\text{if}\
\sigma=123\quad\text{and}\ \hat{a}\in\overline{A}.\end{cases}$

The quadruples $f=(f_{1},f_{2},f_{3},f_{0})$ and
$\ell=(\ell_{1},\ell_{2},\ell_{3},\ell_{0})$ then define the threefold
junction optimal control problem. The same considerations of the case with
uniform switching thresholds hold, hence, denoting by ${\cal
A}_{(x_{0},i_{0})}$ the set of measurable controls for which there exist a
unique admissible trajectory, we consider an infinite horizon problem with a
discount factor $\lambda>0$ given by

$J(x_{0},i_{0},\alpha)=\int_{0}^{+\infty}e^{-\lambda
t}\ell(x(t),i(t),\alpha(t))dt$

where $\ell$ is the running cost described above. The corresponding value
function is

(67) $V^{*}(x_{0},i_{0})=\inf_{\alpha\in{\cal
A}_{(x_{0},i_{0})}}J(x_{0},i_{0},\alpha).$

Observe that if we stay in $x=0$ for all time using controls in $\overline{A}$
the cost is

$u_{0}(0)=\frac{1}{\lambda}\ \min_{\overline{A}}\
\sum_{i=1}^{3}\bar{\mu}_{i}\ell_{i}(0,a_{i})=\frac{1}{\lambda}\
\min\left\\{u_{1,2}(0),u_{1,3}(0),u_{2,3}(0),u_{1,2,3}(0)\right\\}$

where $u_{1,2}(0)$ is the minimum over ${\overline{A}}$ of the cost $\ell_{0}$
when $\sigma=12$, $u_{1,3}(0)$ is the minimum over ${\overline{A}}$ of the
cost $\ell_{0}$ when $\sigma=13$ and similarly the others.

######  Theorem 4.12.

Assume Eqs. 4, 5 and 8. The value function $V^{*}$ Eq. 67 characterized by
Theorem 4.2, but with $u_{0}(0)$ in place of $u_{1,2,3}(0)$, namely

(68)
$V^{*}(0)=\min\left\\{u_{0}(0),V_{sc(1)}(0),V_{sc(2)}(0),V_{sc(3)}(0)\right\\},$

satisfies

(69)
$V^{*}(x,i)=\liminf_{(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})\rightarrow(0^{+},0^{+},0^{+})}V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(x,i)\
\forall\ (x,i)\in R_{i},\ i=1,2,3.$

where $V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}$ is the value
function of the approximating thermostatic problem Eq. 35, with non uniform
thresholds $(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})$, and the
convergence is uniform. Moreover, when $x=0$, the limit is independent from
$i=1,2,3$.

######  Proof 4.13.

We start to prove that Eq. 69 holds for $x=0$. The independence from $i$ of
the inferior limit Eq. 69 comes from the controllability Eq. 5 because
$|V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0,i)-V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0,j)|$
is infinitesimal as
$\max\left\\{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}\right\\}$. In the
sequel, we omit the symbol $i$ in the expression
$V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0,i)$.
By contradiction, let us suppose that $V^{*}(0)<\liminf
V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0)$. By Eq. 5, for every
$\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}>0$, we have
$V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0)\leq V_{sc(i)}(0)$ for
every $i=1,2,3.$ Hence, it implies $V^{*}(0)=u_{0}(0)$. Let
$(a_{1},a_{2},a_{3},\sigma,\bar{\mu}_{1},\bar{\mu}_{2},\bar{\mu}_{3})\in\overline{A}$
realize the minimum in the definition of $u_{0}(0)$. We analyze some possible
cases, the other ones being similar.

1) $f_{1}(0,a_{1}),f_{2}(0,a_{2}),f_{3}(0,a_{3})<0$ and $\sigma=123$.
Considering the triple
$(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})=(\varepsilon,\varepsilon,\varepsilon)$
and using a suitably switching control between those constants controls,
$V_{\varepsilon,\varepsilon,\varepsilon}(0)$ is not larger than $u_{1,2,3}(0)$
plus an infinitesimal quantity as $\varepsilon\to 0$, which is a
contradiction.

2) $f_{1}(0,a_{1}),f_{2}(0,a_{2}),f_{3}(0,a_{3})<0$ and $\sigma=23$. Here,
taking the triple
$(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})=(\varepsilon^{2},\varepsilon,\varepsilon)$,
$V_{\varepsilon,\varepsilon,\varepsilon}(0)$ is not larger than $u_{2,3}(0)$
plus an infinitesimal quantity as $\varepsilon\to 0$, which is a
contradiction.

3) $f_{1}(0,a_{1})=0,f_{2}(0,a_{2}),f_{3}(0,a_{3})<0$. In this setting we can
study two sub-cases according to the value of $\sigma$.

3.1) If $\sigma=123$ we consider the triple
$(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})=(\varepsilon,\varepsilon,\varepsilon)$,
we arrive in $R_{1}$ and we stop there. Therefore,
$u_{1,2,3}(0)=\frac{1}{\lambda}\ell_{1}(0,a_{1})$ cannot be lower than
$V_{sc(1)}(0)$ that is a contradiction.

3.2) If $\sigma=23$ we take the triple
$(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})=(\varepsilon^{2},\varepsilon,\varepsilon)$
and argue as in case 2).
We remark that if $\sigma=12$ or $13$ then considering
$(\varepsilon,\varepsilon,\varepsilon^{2})$ and
$(\varepsilon,\varepsilon^{2},\varepsilon)$ respectively we can conclude as in
3.1).

4) $f_{1}(0,a_{1}),f_{2}(0,a_{2})=0,f_{3}(0,a_{3})<0$. Also in this case we
have different sub-cases according to the value of $\sigma$.

4.1) If $\sigma=123$ we take the triple
$(\varepsilon,\varepsilon,\varepsilon)$ and conclude using Remark 2 since
$u_{1,2,3}(0)$ cannot be lower than a state constraints. Then as before a
contradiction.

4.2) If $\sigma=23$ taking the triple
$(\varepsilon^{2},\varepsilon,\varepsilon)$ we get
$u_{2,3}(0)=\frac{1}{\lambda}\ell_{2}(0,a_{2})$ that is no lower
than$V_{sc(2)}(0)$, that is a contradiction.

Now we assume $\liminf
V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0)<V^{*}(0)$. Let
$\delta>0$ be such that, for arbitrarily small suitably chosen
$(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})$ , it is
$V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0)+\delta<V^{*}(0)$. A
measurable control $\alpha$ which almost realizes the optimum (less then
$\beta$) for $V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0)$ must be
such that there are infinitely many switching between all branches
$R_{\varepsilon_{1}},R_{\varepsilon_{2}},R_{\varepsilon_{3}}$. Indeed, if it
is not the case, then, for a least one branch, say $R_{\varepsilon_{i}}$, the
trajectory definitely remains inside it. Hence, for small
$(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})$,
$V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0)$ is almost equal to
$V_{sc(i)}(0)$, which is a contradiction. Note that, as in Theorem 4.4, we can
limit to consider a piecewise constant control that we call again $\alpha$. In
order to prove that $V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0)$
cannot be less than $V^{*}(0)-\delta$ we proceed as in Theorem 4.4 considering
$O(\max\\{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}\\})$ and $u_{0}(0)$
instead of $O(\varepsilon)$ and $u_{1,2,3}(0)$ respectively.
In conclusion we have $\liminf
V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(0)=V^{*}(0)$. Note that
the equations solved by $V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}$
and by $V^{*}(0)$(Eqs. 35, 40 and 41 suitably modified) are the same in the
interior of $R_{i}$ and the boundary datum converges to $V^{*}(0)$. Then,
representing the solutions as the value functions of the corresponding optimal
control problems, we get Eq. 69 and the uniform convergence.

######  Remark 3.

As we show in the proof of Theorem 4.12, we can restrict us to consider as
thresholds
$(\varepsilon,\varepsilon,\varepsilon),(\varepsilon,\varepsilon,\varepsilon^{2}),(\varepsilon,\varepsilon^{2},\varepsilon),(\varepsilon^{2},\varepsilon,\varepsilon)$.
Hence, given the dynamics $f_{1},f_{2},f_{3}$ and the running costs
$\ell_{1},\ell_{2},\ell_{3}$ satisfying the controllability assumptions exists
a unique choice of previous triples such that

$V^{*}(x,i)=\liminf_{(\varepsilon_{1},\varepsilon_{2},\varepsilon_{3})\rightarrow(0,0,0)}V_{\varepsilon_{1},\varepsilon_{2},\varepsilon_{3}}(x,i)=\lim_{(\cdot,\cdot,\cdot)\rightarrow(0,0,0)}V_{(\cdot,\cdot,\cdot)}(x,i)\
\forall\ (x,i)\in R_{i}.$

Note that for this problem we do not consider for example triples of
thresholds of the kind $(c_{1}\varepsilon,c_{2}\varepsilon,c_{3}\varepsilon)$,
$c_{1},c_{2},c_{3}\in{\mathbb{R}}$ because they do not bring new possible
optimal behaviours. Moreover, we have no take into account the triple of
thresholds $(\varepsilon^{2},\varepsilon^{2},\varepsilon)$ and its
permutations because at the limit this would means to stay in $x=0$ without
using the balance of the dynamics, which is physically meaningless.

######  Remark 4.

When the optimal strategy is to switch among all branches we have that
$\ell_{i}(0,a_{i})=\ell_{j}(0,a_{j})\ \forall i,j\in\\{1,2,3\\},i\neq j$ and
$V^{*}(x,i)=V(x,i)$, where $V$ is the value function Eq. 37 of the threefold
junction problem with uniform switching thresholds.

Now, we suppose that the optimal strategy is to switch only between two
branches, for example $R_{1}$ and $R_{2}$. In order to prove the following
result we introduce a test function $\psi:TR\to{\mathbb{R}}$ such that
$\psi\in C^{1}(TR)$ and on each branch $\psi_{i}:R_{i}\to{\mathbb{R}}$ is such
that $\psi_{i}(x,i)=\psi_{j}(x,j)$ for every $i,j\in\\{1,2,3\\},i\neq j$ when
$x=0$. Moreover, we give the following definition.

######  Definition 4.14.

A continuous function $u:TR\to{\mathbb{R}}$ is a viscosity subsolution of Eq.
72 if for any $(x,i)\in TR$, any $\psi\in C^{1}(TR)$ such that $u-\psi$ has a
local maximum at $(x,i)$, then

(70) $\displaystyle\lambda u(x,i)+H_{i}(x,\psi^{\prime}_{i}(x,i))\leq 0$
$\displaystyle(x,i)\in int(R_{i}),$ $\displaystyle\min\left\\{\lambda
u(0,i)+H_{i}(0,\psi^{\prime}_{i}(0,i)),\ i=1,2,3\right\\}\leq 0$
$\displaystyle x=0;$

A continuous function $u:TR\to{\mathbb{R}}$ is a viscosity supersolution of
Eq. 72 if for any $(x,i)\in TR$, any $\psi\in C^{1}(TR)$ such that $u-\psi$
has a local minimum at $(x,i)$, then

(71) $\displaystyle\lambda u(x,i)+H_{i}(x,\psi^{\prime}_{i}(x,i))\geq 0$
$\displaystyle x\in int(R_{i}),$ $\displaystyle\max\left\\{\lambda
u(0,i)+H_{i}(0,\psi^{\prime}_{i}(0,i)),\ i=1,2,3\right\\}\geq 0$
$\displaystyle x=0.$

In particular, if $x=0$ then the local maximum/minimum may be considered with
respect to two of the three branches only.

We point out the difference with Definition 4.7 where, for $x=0$, the max/min
must be with respect to all three branches.

######  Theorem 4.15.

Assume Eqs. 4, 5 and 8. The function $V^{*}$ is a viscosity solution and the
maximal subsolution of the HJB problem

(72) $\begin{cases}\lambda V+H_{1}(x,\nabla V)=0\ \ \text{in}\ int(R_{1}),\\\
\lambda V+H_{2}(x,\nabla V)=0\ \ \text{in}\ int(R_{2}),\\\ \lambda
V+H_{3}(x,\nabla V)=0\ \ \text{in}\ int(R_{3}),\\\ \min\left\\{\lambda
V+H_{1},\lambda V+H_{2},\lambda V+H_{3}\right\\}\leq 0\ \text{on}\ x=0,\\\
\max\left\\{\lambda V+H_{1},\lambda V+H_{2},\lambda V+H_{3}\right\\}\geq 0\
\text{on}\ x=0.\end{cases}$

######  Proof 4.16.

By Propositions 4.1 and 4.12 we have that $V^{*}$ satisfies the first three
equations of Eq. 72. Since we are considering the function
$V^{*}=\lim_{(\varepsilon,\varepsilon,\varepsilon^{2})\to(0,0,0)}V_{\varepsilon,\varepsilon,\varepsilon^{2}}=V_{1,2}$,
if $V^{*}-\psi$ assumes his maximum or minimum in $x=0$ with respect to
$R_{1}\cup R_{2}$, then by the twofold junction problem we have that $V^{*}$
is a viscosity solution and the maximal subsolution of

$\begin{cases}\lambda V+H_{1}(x,\nabla V)=0\ \ \text{in}\ \ int(R_{1}),\\\
\lambda V+H_{2}(x,\nabla V)=0\ \ \text{in}\ \ int(R_{2}),\\\
\min\left\\{\lambda V+H_{1},\lambda V+H_{2}\right\\}\leq 0\ \text{on}\ x=0,\\\
\max\left\\{\lambda V+H_{1},\lambda V+H_{2}\right\\}\geq 0\ \text{on}\
x=0.\end{cases}$

If instead $V^{*}-\psi$ has a maximum point at $x=0$ with respect to
$R_{1}\cup R_{3}$ we prove that the $\min\left\\{\lambda V+H_{1},\lambda
V+H_{2}\right\\}$ is still lower or equal to zero. We consider two cases:

1) If the optimal behavior consists to reach $R_{2}$ and stay there, namely
$V^{*}(x,2)=V_{sc(2)}(x)$, and supposing that the cost to pay in $R_{1}$ to
reach the junction is lower than the one in $R_{3}$, we have that
$V^{*}=V_{1,2}$ on $R_{1}\cup R_{2}$. Now, since (by the assumption)
$V^{*}-\psi$ has maximum point at $x=0$ locally with respect to the branch
$R_{3}$, we have that $\psi_{3}(x,3)\geq V^{*}(x,3)$ for $x$ near to zero. The
optimality of $V_{sc(2)}$ implies that $V^{*}(\cdot,3)\geq
V_{sc(2)}(\cdot)=V^{*}(\cdot,2)$ and hence $\psi_{3}(\cdot,3)\geq
V^{*}(\cdot,2)$. Then gluing $\psi_{3}$ over $R_{2}$ we obtain that
$V^{*}-\psi_{3}$ has a maximum point in $x=0$ locally with respect to $R_{2}$.
Hence, $\min\left\\{\lambda V+H_{1},\lambda V+H_{2}\right\\}\leq 0$.

2) If the optimal strategy is to switch between $R_{1}$ and $R_{2}$ and the
maximum point at $x=0$ is still with respect to $R_{1}\cup R_{3}$ we conclude
as before because $\psi_{3}(\cdot,3)\geq V^{*}(\cdot,2)$.

If $V^{*}=V_{1,2}$ and $V^{*}-\psi$ has a maximum point at $x=0$ with respect
to $R_{2}\cup R_{3}$, with similar argument as before we conclude that
$\min\left\\{\lambda V+H_{1},\lambda V+H_{2}\right\\}\leq 0$.
In conclusion we have shown that the following condition hold: exists a couple
of indexes $(\bar{i},\bar{j})$, fixed a priori, such that
$V^{*}=V_{\bar{i},\bar{j}}$ on $R_{\bar{i}}\cup R_{\bar{j}}$ and that for all
$\psi\in C^{1}(TR)$ such that $V^{*}-\psi$ has the maximum point at $x=0$ with
respect to any couple of edges, $\min\\{\lambda V+H_{\bar{i}},\lambda
V+H_{\bar{j}}\\}\leq 0$. From the latter condition follows that
$\min\\{\lambda V+H_{1},\lambda V+H_{2},\lambda V+H_{3}\\}\leq 0$. Proceeding
as before also for the fifth equation of Eq. 72 we have that $V^{*}$ is a
viscosity solution of Eq. 72. Now, let $u$ be a continuous subsolution of Eq.
72 satisfying the above condition with the same couple of indexes
$(\bar{i},\bar{j})$ that we suppose to be $(1,2)$. Then

(73) $V^{*}\geq u\ \ \text{on}\ \ R_{1}\cup R_{2}\ \Longrightarrow\
V^{*}(0)\geq u(0).$

Furthermore $V^{*}$ is a supersolution of the third equation of Eq. 72, $u$ is
a subsolution of the same equation and hence by Eq. 73 follows $V^{*}\geq u$
on $R_{3}$. We can conclude that $V^{*}\geq u$ on $TR$ and hence it is the
maximal subsolution of Eq. 72.

A similar result holds also considering
$V^{*}=\lim_{(\varepsilon^{2},\varepsilon,\varepsilon)\to(0,0,0)}V_{\varepsilon^{2},\varepsilon,\varepsilon}=V_{2,3}$
or
$V^{*}=\lim_{(\varepsilon,\varepsilon^{2},\varepsilon)\to(0,0,0)}V_{\varepsilon,\varepsilon^{2},\varepsilon}=V_{1,3}$.

## References

  * [1] Y. Achdou, F. Camilli, A. Cutrì, and N. Tchou, Hamilton-jacobi equations constrained on networks, NoDEA Nonlinear Differ. Equ. Appl., 20 (2013), pp. 413–445.
  * [2] Y. Achdou, S. Oudet, and N. Tchou, Hamilton-jacobi equations for optimal control on junctions and networks, ESAIM Control Optim. Calc. Var., 21 (2015), pp. 876–899.
  * [3] Y. Achdou and N. Tchou, Hamilton-jacobi equations on network as limits of singularly perturbed problems in optimal control: dimension reduction, Communications in Partial Differential Equations, 40 (2015), pp. 652–693.
  * [4] F. Bagagiolo, On the value function of one-dimensional optimal control problems with junctions, IEEE, in press.
  * [5] F. Bagagiolo, An infinite horizon optimal control problem for some switching systems, Discrete Contin. Dyn. Syst. Ser. B, 1 (2001), pp. 443–462.
  * [6] F. Bagagiolo and K. Danieli, Infinite horizon optimal control problems with multiple thermostatic hybrid dynamics, Nonlinear Anal. Hybrid Syst., 6 (2012), pp. 824–838.
  * [7] M. Bardi and I. C. Dolcetta, Optimal Control and Viscosity Solutions of Hamilton-Jacobi-Bellman Equations, Birkhauser, Boston, 1997.
  * [8] G. Barles, A. Briani, and E. Chasseigne, A bellman approach for two-domains optimal control problems in $\mathbb{R}^{N}$, ESAIM Control Optim. Calc. Var., 19 (2013), pp. 710–739.
  * [9] G. Barles, A. Briani, and E. Chasseigne, A bellman approach for regional optimal control problems in $\mathbb{R}^{N}$, SIAM J. Control Optim., 52 (2014), pp. 1712–1744.
  * [10] G. Barles and E. Chasseigne, (almost) everything you always wanted to know about deterministic control problems in stratified domains, Netw. Heterog. Media, 10 (2015), pp. 809–836.
  * [11] R. Barnard and P. Wolenski, Flow invariance on stratified domains, Set-Valued Var. Anal., 21 (2013), pp. 377–403.
  * [12] A. Bressan and Y. Hong, Optimal control problems on stratified domains, Netw. Heterog. Media, 2 (2007), pp. 313–331.
  * [13] F. Camilli and C. Marchi, A comparison among various notions of viscosity solutions for hamilton-jacobi equations on networks, J. Math. Anal. Appl., 407 (2013), pp. 112–118.
  * [14] F. Camilli, C. Marchi, and D. Schieborn, Eikonal equations on ramified spaces, Interfaces Free Bound., 15 (2013), pp. 121–140.
  * [15] F. Camilli and D. Schieborn, Viscosity solutions of eikonal equations on topological networks, Calc. Var. Partial Differential Equations, 46 (2013), pp. 671–686.
  * [16] K.-J. Engel, F. Kramar, R. Nagel, and E. Sikolya, Vertex control of flows in networks, Netw. Heterog. Media, 3 (2008), pp. 709–722.
  * [17] M. Garavello and B. Piccoli, Traffic flow on networks. Conservation laws models, AIMS Series on Applied Mathematics, 1. American Institute of Mathematical Sciences (AIMS), Springfield, MO, 2006.
  * [18] R. Goebel, R. G. Sanfelice, and A. R. Teel, Hybrid Dynamical Systems: modeling, stability, and robustness, Princeton University Press, Princeton, 2012.
  * [19] C. Imbert and R. Monneau, Quasi-convex hamilton-jacobi equations posed on junctions: The multi-dimensional case, July 2016, https://arxiv.org/abs/1410.3056v2.
  * [20] C. Imbert, R. Monneau, and H. Zidani, A hamilton-jacobi approach to junction problems and application to traffic flows, ESAIM Control Optim. Calc. Var., 19 (2013), pp. 129–166.
  * [21] Z. Rao, A. Siconolfi, and H. Zidani, Transmission conditions on interfaces for hamilton-jacobi-bellman equations, J. Differential Equations, 257 (2014), pp. 3978–4014.
  * [22] Z. Rao and H. Zidani, Hamilton-Jacobi-Bellman equations on multi-domains, Control and Optimization with PDE Constraints, Internat. Ser. Numer. Math. 164, Birkhäuser Basel, 2013.
  * [23] H. Soner, Optimal control problems with state-space constraints $\mathbb{I}$, SIAM J. Control. Optim., 24 (1986), pp. 552–561.
  * [24] A. Visintin, Differential Models of Hysteresis, Springer-Verlag, Berlin, 1994.