The Natural Gas Cash-Out Problem: A Bilevel Optimal Control Approach

1Departamento de Ingenieŕıa Industrial y de Sistemas, Tecnológico de Monterrey (ITESM), Campus Monterrey, Avenida Eugenio Garza Sada 2501 Sur, 64849 Monterrey, NL, Mexico 2Department of Social Modeling, Central Economics and Mathematics Institute (CEMI), Russian Academy of Sciences (RAS), Nakhimovsky Prospekt 47, Moscow 117418, Russia 3Department of Electronics and Computing, Sumy State University, Rimsky-Korsakov Street 2, Sumy 40007, Ukraine 4Institut für Numerische Mathematik und Optimierung, Fakultät für Mathematik und Informatik, TU Bergakademie Freiberg, Prüferstrasse 9, 09596 Freiberg, Germany


Introduction
Bilevel programs are hierarchical optimization problems in the sense that their constraints are defined in part by a second parametric optimization problem.Hierarchical structures can be found in diverse scientific disciplines including environmental studies, classification theory, databases, network design, transportation, game theory, economics, and new applications, such as the gas cash-out problem.In its turn, this stimulates the development of both new theoretical results and efficient algorithms to solve bilevel programming problems.
A particular case of the bilevel programming problem is presented by the following optimal control problem arising in the natural gas industry.This problem has been formulated as a mixed-integer model [1][2][3] arising from the minimization of cash-out penalty costs of a natural gas shipping company.In this study, we formulate the gas cash-out problem as a bilevel optimal control problem (BOCP) where the upper level is equipped with a Mayer-type cost function and pure state constraints, whereas the lower level is formulated as a finite-dimensional mixed-integer programming problem (MIP) with only one binary variable.
One of the main goals of this paper is to provide a maximum principle for this problem and to present a detailed discussion.The rest of the paper is organized as follows.Section 2 specifies the model and describes the system's behavior.Section 3 is the core of our whole approach: it contains the general formulation of the cash-out model, lists the assumptions we accept, reformulates the model as a single-level problem, provides Pontryagin-type optimality conditions, and illustrates the theory by means of a small example.Section 4 presents the results of application of the optimality conditions to the cash-out problem.Finally, Section 5 presents conclusions and possible items of the future research.

The Natural Gas Cash-Out Problem
Let us consider a system consisting of a single natural gas shipping company (NGSC) engaged in business with a Pipeline Operating Company (POC).The NGSC intends to transport the natural gas it buys from the wells to several consumption points (pool zones).The operative process is defined within a certain time frame [0, ], for example, a month.In every  ∈ [0, ], the NGSC buys gas at the wells, injects it into the pipeline at its string point, and extracts the amount of gas to sell it at the pool zones down the pipeline.The NGSC is required to book capacity in every pool zone before the operative period starts, so that the nominal extraction amounts are known by the POC beforehand, so that the pipeline's operations could be planned.However, the NGSC is allowed, within certain limits, to extract a different amount of fuel more than planned/booked originally, thus creating certain imbalances.An imbalance is formally defined as the difference between the booked capacity and the extracted amount.The gas extracted at every pool zone is then sold during each period of time,  ∈ [0,], to the Local Distribution Companies (LDCs) to fulfill prearranged contracts, with any unsold amounts marketed at different prices to external LDCs with no binding contracts to the NGSC.
To prevent the NGSC from generating large unjustified imbalances, the POC will limit the levels of imbalances, positive or negative, on each period of time in every pool zone, as well as the possible change, or "swing" of those imbalances from  to  + .At the end of the operative period, , the POC will analyse the existing imbalances in its pipeline and redistribute them among the pool zones moving gas from zones with positive imbalances to zones with negative (and only negative!)imbalances, until only nonnegative or nonpositive imbalances exist at all pool zones (the same sign of the imbalances as the result of balancing procedure is also required).At this point, a cash-out will be arranged between the parties, with the pipeline charging high costs for the taken extra gas and paying low prices for the bought gas so that arbitrage on part of the NGSC be discouraged.
The natural gas cash-out problem has been modeled as an optimistic bilevel optimization problem in finite-dimensional spaces (cf.[1][2][3]).In these formulations the upper level corresponds to the decision of a single NGSC regarding its capacity booking, extraction levels, and imbalances whereas the lower level deals with the decision of the POC to come up with a balancing scheme that would please both parties.This optimization modeling is intended to be a tool for NGSCs to better manage the created imbalances in their continuous-time business.Therefore, we will interchangeably refer to the NGSC's (POC's) problem as the upper level (lower level) problem.Previous studies were focused on numerical solutions; however, in this work we formulate the problem as a BOCP where the aim of the paper is to provide optimality conditions for such formulation.

Problem Statement.
Following the studies of Dempe et al. [1] and Kalashnikov and Ríos-Mercado [3], the decision making process for the NGSC is to determine how to carry out its daily imbalances such that the penalty that will be imposed by the POC is minimized.The following notation is used to describe the model.  is percentage of fuel retained for moving one unit of gas from zone  to zone ;  < , ,  ∈ .  is transportation change for moving one unit of gas from zone  to zone ;  < , ,  ∈ .  is backward haul credit for moving one unit of gas from zone  to zone ;  < , ,  ∈ .  is imbalance penalization parameter,  ∈ .  (0) is initial imbalance at  = 0 in zone ;  ∈ .

Decision Variables (Lower Level)
1 is total cash-out cost for the NGSC. 2, is final imbalance at zone ;  ∈ . 3, is forward haul volume moved from zone  to zone ;  < , ,  ∈ . 4, is backward haul volume moved from zone  to zone ;  < , ,  ∈ . 5 is auxiliary variable for linearization.

Auxiliary Variables
is binary variable equal to 1 (0) if final imbalances are nonnegative (nonpositive).In the special case when all the imbalances are zeros, we accept  = 1.
Let us postulate a quite natural assumption that   , The NGSC's problem is given by ẋ  () =   () a.e. ∈ [0, ] ,  ∈  (2b) a.e. ∈ [0, ] ,  ∈  (2c) The objective function of the NGSC (2a) is to minimize the total cash-out cost, given the control system (2b) and some initial conditions (2f).Constraints (2c)-(2e) reflect the bounds on the imbalances and imbalance swings.Note that constraints (2d)-(2e) involve only state variables.Moreover, the objective function variable  1 depends on the POC's response to this upper level model; this is not a leader's decision variable per se.In the latter problem the NGSC's objective function is minimized with respect to , , , and ; thus this formulation is adopting the optimistic approach where the upper level decision maker is able to influence the POC so that the latter select his/her reaction in the leader's favor.Finally, Ψ(()) is the solution set of the POC's problem for fixed ().Hence, considering the vector of the imbalances in all zones at the final time moment () ∈ R  as given, the POC's problem can be formulated as follows: where  1 ∈ R + is a large enough scalar value, whose lower bound can be easily calculated, making use of duality theory, due to the compactness of the feasible set in states   () ∈ R (see, e.g., [2]).Constraint (3e) arises from the business rule saying that when being rearranged by the POC, the imbalances cannot change their signs.Constraints (3b)-(3e) imply that the pipeline can haul forward or backward an amount of gas from one zone to another that does not exceed (i) the positive imbalance in the source zone and (ii) the absolute value of the negative imbalance one has in the target pool zone.Constraint (3f) explains the relationship between the last moment imbalances () ∈ R  , the final imbalances  2 , and the forward/backward haul variables  3 ,  4 .Constraints (3g)-(3h) define the cash-out variable  1 and show how the objective function variable  5 is related to  1 via linear inequalities (the latter linear inequalities help reduce the nonlinear original lower level objective function to a linear one).Restriction (3i) reflects the requirement that all the final imbalances must be of the same sign, and it is exactly where the binary variable  appears.
In [2], the mixed-integer nonlinear program (3a)-(3k) was reduced to an "almost" linear formulation.Indeed, only the presence of the binary variable  prevents the modified problem from being a linear program.Hence, for a given vector () ∈ R  , we have the equivalent mixed-integer programming problem: (1 −   ) Due to the fact that the lower level problem is purely linear, it seems to be convenient to represent it in a matrix form.Therefore, we introduce some extra notation for vectors and matrices.Namely, by   ∈ R × we denote the identity matrix of dimension  × ; O × denotes the zero matrix of dimension ×; and the zero-vector of dimension  is denoted by 0  ∈ R  .Let    ∈ R  be the th unity vector of dimension  and   ∈ R  the all-ones vector of dimension .We introduce the natural number  := (1/2)( 2 − ) and use diag() in order to define (for any  ∈ R  ) a matrix in R × whose main diagonal is given by , while all its other entries are zero.For two vectors  1 ,  2 ∈ R  , the product  1 ⋅  2 ∈ R  will be understood as the componentwise product; that is, Next, we define the lower level variable component vector  and some auxiliary vectors: Let us introduce the matrices  1 ,  2 ∈ R × and  3 ,  4 ∈ R × as follows: and use the latter ones to compose the overall system's matrices.In order to do that, we define , and  ∈ R  2 +2+2 as follows: Hence, we can rewrite (4a)-(4j) as

General Setting and Optimality Conditions
This section deals with the theoretical results providing optimality conditions for the bilevel program in general, with an aim to apply them to our gas cash-out problem in Section 4.

Preliminaries and Further Notation.
Throughout this paper, we denote by R, R  , R × , R  + , and R := R ∪ {−∞, ∞} the set of real numbers, the space of all real vectors with  components, the space of all real matrices with  rows and  columns, the nonnegative orthant of R  , and the extended real line, respectively.For any matrix  ∈ R × , let  ⊤ ∈ R × denote its transpose.Next, for an arbitrary subset  ⊆ R  , we use int(), ri(), and conv() in order to denote the interior, the relative interior, and the convex hull of , respectively.For  * ∈ , we define the Fréchet normal cone N ( * ) to  at  * by means of Here, ‖ ⋅ ‖ is an arbitrary norm in R  .Furthermore, the basic normal cone (sometimes referred to as Mordukhovich normal cone) N   ( * ) to  at  * is given by where the upper limit has to be interpreted in the sense of Painlevé-Kuratowski (cf.[4]).If  is a convex set, then N ( * ) and N   ( * ) both coincide with the normal cone of convex analysis, which we denote by N  ( * ).Let us denote by U R  and B R  the open and closed unit balls in R  , and, for any  > 0,  * ∈ R  , we define U  R  ( * ) := { * } + U R  and B  R  ( * ) := { * } + B R  , respectively.Given a differentiable function F : R  → R  , its Jacobian at  ∈ R  is represented by ∇F() ∈ R × .Next, we denote by  and  * the space of scalar continuous functions defined over the interval [0, ] and the dual space of , respectively.The set of elements in  * taking nonnegative values at nonnegative functions in  is denoted by  ⊕ .Given a nonnegative measure  ∈  ⊕ , its norm ‖‖  * coincides with the total variation of  defined as ∫  0 ||(ds) and the support of the measure ; written supp() is the smallest closed set  ⊆ [0, ] such that for any relatively open subset  ⊆ [0, ] \  one has () = 0.The Euclidean norm of a vector  ∈ R  is denoted by ‖‖, the space of all Lebesgue-integrable functions  such that  : [0, ] → R  is described by  1  , and by  1,1  we represent the Sobolev space that contains all absolutely continuous R valued functions on [0, ], whose weak derivatives belong to  1  .By  ∞  we denote the Banach space of all vector-functions with  essentially bounded components defined over [0, ].Furthermore, by L × B  we express the product -algebra generated by the Lebesgue set L and the Borel subsets of R  .
For a lower semicontinuous functional  : R  → R, we introduce its domain as dom() Furthermore, we make use of the singular subdifferential  ∞ ( * ) of  at  * , which is defined as stated below: Note that  ∞ ( * ) = {0  } holds if and only if  is locally Lipschitz continuous at  * (cf.[5]).In the latter case   ( * ), the Clarke subdifferential of  at  * is a nonempty, compact, and convex set (cf. [6]) and consequently we have  * ∈ int(dom()).Suppose that  is a convex functional and  * ∈ ri(dom()) is chosen arbitrarily.Then ∂( * ) and   ( * ) both coincide with the classical subdifferential of  at  * , the latter being denoted by ( * ).For further information on these concepts of variational analysis, we refer the interested reader to [7].Let Θ : R   R  be an arbitrary set-valued mapping.The domain and graph of Θ are denoted, respectively, by dom(Θ) and graph(Θ).We say that Θ is a polyhedral mapping provided that its graph is the union of a finite collection of polyhedra.The mapping Θ is called locally Lipschitz continuous at  * ∈ R  whenever there exist scalars  Θ ,  Θ > 0 such that for all ,   ∈ U  Θ R  ( * ) the following condition is satisfied: If the above inclusion holds only when   :=  * is fixed, then Θ is called locally upper Lipschitz continuous at  * .We call Θ upper (lower) semicontinuous at  * provided that for any open set  ⊆ R  satisfying Θ( * ) ⊆  (Θ( * ) ∩  ̸ = 0) we find  > 0 such that Θ() ⊆  (Θ() ∩  ̸ = 0) holds true for all  ∈ U  R  ( * ).Now choose an arbitrary point ( * ,  * ) ∈ graph(Θ).We say that Θ is inner semicontinuous at ( * ,  * ) if for any sequence {  } ⊆ R  converging to  * we find a sequence {  } ⊆ R  converging to  * and  0 ∈ N such that   ∈ Θ(  ) is true for all  ∈ N greater than  0 .Obviously, if Θ is locally Lipschitz continuous at  * , then it is inner semicontinuous at any point ( * , ) with  ∈ Θ( * ).The normal coderivative  * Θ( * ,  * ) : R   R  of Θ at ( * ,  * ) is defined as stated below for any  ∈ R  : Finally, we recall some helpful calculation rules concerning the Minkowski sum of sets.Due to its simplicity the corresponding proof is omitted here.Lemma 1.Let , , ,  ⊆ R  be arbitrary sets.Then the following statements hold:

General Setting.
In order to derive optimality conditions for the natural gas cash-out problem (2a)-(2g) where the lower level problem (3a)-(3k) is replaced with (4a)-(4j), we are going to develop a general formulation.The idea is to derive general optimality conditions, and by applying those theoretical results one can easily provide optimality conditions to the original problem of interest. where The problem's data comprise an interval [0, ] for a fixed final time moment  > 0, given initial conditions  0 ∈ R   , functions  :   is an absolutely continuous function that satisfies the differential equation and the initial conditions for some control function  ∈  1    .Finally, Ψ : R    R   × {0, 1} denotes the solution set mapping of the lower level problem, while  ∈ R   is a fixed vector and Γ : R    R   × {0, 1} is a set-valued mapping that will be specified below.
In other words, problem ( 16) is an optimistic BOCP with final-state-dependent finite-dimensional lower level.Moreover, the upper level problem boasts a Mayer-type cost function and state constraints.This formulation is notably interesting due to the parametric optimization problem at the lower level, whose parameter is nothing else but the final state of the upper level state variable.Hence, the natural gas cashout problem specified by (2a)-(2g) fits into the formulation of problem (16).
Taking into account the POC's problem (4a)-(4j) one can define the set Γ as follows: where Then the process (, , , ) ∈  is said to be feasible for (16) if it satisfies the dynamical system, the initial condition, and the pure state constraints, while (, ) is a global optimal solution for the corresponding lower level problem.Now we introduce the definition of a local minimizer.
Clearly, the optimality conditions for local minimizers automatically hold for strong and hence for global minimizers.By following the approach in Vinter [8], the above definition respects our desire to focus on the state variables of ( 16) while ignoring somehow the control function's behavior.Additionally, fixing the binary variable  proposes a strategy about how to deal with (16).We compute possible minimizers for the problems that arise when setting  = 0 and  = 1 and then compare the resulting points.Note that assuming  to be free in the definition of local optimal solutions is another idea we are not going to examine here.
For an arbitrary local minimum point ( * ,  * ,  * ,  * ) of ( 16), we accept the following assumptions: = 0 holds true for some  ∈ {1, . . .,   }, then there exist constants , ,  1 ,  2 > 0 and a control ũ ∈  such that for almost every s  ,  ∈ [0,  1 ) and x ∈ U The assumptions stated in (A 1 ) are typical hypotheses in optimal control.Recall that, in assumption (A 1 -(v)), (s  , x) represents the set of active inequalities at (s  , x) ∈ [0, ]×R   .On the other hand, the assumptions in (A 2 ) are essential to ensure a nondegenerated maximum principle.The reader is referred to [9,10] for a detailed discussion of these constraint qualifications.
It is not difficult to check that assumption (A 1 ) holds for the natural gas cash-out problem (2a)-(2g) at any feasible point.Finally, this general formulation allows us to deal with a smaller problem whose theoretical properties will be useful for further discussion on the gas cash-out problem.Our approach consists in reformulating problem (16) as a locally equivalent single-level problem.On the other hand, the presence of one binary variable at the lower level problem brings some additional difficulties.As mentioned earlier, we deal with that problem by considering the different cases  = 0 and  = 1.

Single-Level Reformulation.
In this subsection, we replace problem ( 16) by an equivalent single-level optimal control problem.One typical approach in bilevel programming in finite-dimensional spaces consists in substituting the follower's problem by its Karush-Kuhn-Tucker conditions.They are necessary and sufficient for optimality as long as the program's functions are continuously differentiable and convex with respect to  for a fixed parameter, and some constraint qualification (such as Slater's condition or Mangasarian-Fromovitz constraint qualification (MFCQ)) is satisfied.Hence, if the lower level problem is differentiable, convex, and a regularity condition holds, the resulting problem would be equivalent to the original one in the sense of global optimal solutions.However, from [11] it is well-known that the surrogate problem may have local optimal solutions that do not correspond to local optimal solutions of the original bilevel programming problem.Similar difficulties may appear when using this approach to tackle problem (16).
In line with the above arguments, this study uses the lower level optimal value function, which allows us to derive a problem completely equivalent to (16).The resulting modified problem usually lacks differentiability and regularity [12].Because of that, the optimal value approach has been discussed in many publications concerning bilevel programming both in the finite-and in infinite-dimensional case; compare, for instance, [13,14].The latter papers develop efficient realizations of the (lower level) optimal value method in optimistic bilevel programming by making use of formulas for the limiting/basic and singular subdifferential derived by Mordukhovich for the marginal/value functions (see Mordukhovich's book [7]).
In application to our case of the BOCP with the lower level represented by a conventional problem of parametric programming, the advanced techniques proposed in [13,14] could be employed in order to find constructive (explicit) conditions to guarantee the required local Lipschitz continuity of the (lower level) objective function's optimal value, that is, of the functions  and   ,  = 1,2, by means of vanishing their singular subdifferentials.Moreover, necessary optimality conditions for our bilevel optimal control program could be developed through the basic subdifferential of the optimal value functions.However, these prospective targets will be postponed for our future research, since, in this paper, we make use of the concept of partial calmness introduced in [15].
Namely, we define the lower level optimal value function  : R   → R by means of for any () ∈ R   and deduce (25) There are three issues that need to be especially addressed when using this approach.First, it is well-known that, in general, the value function  may not be differentiable.Secondly, common constraint qualifications such as MFCQ, the linear independence constraint qualification, or at least their nonsmooth counterparts are too strong to hold at the boundary conditions of (25).Finally, the binary variable  could cause some problems in applying a proper constraint qualification.Hence, we have to expect that a nonsmooth maximum principle via ( 25) is likely to be degenerated (in certain sense).
In order to cope with the above-mentioned obstacles, we follow the ideas of Ye and Zhu [15] where the authors use a partial penalization to reach a proper constraint qualification.This partial penalization is often called partial calmness condition, which is frequently used for the optimal value reformulation of an optimistic bilevel programming problem (i.e., problem (25) in our case).This constraint qualification turns out to be closely related to the calmness of a nonlinear optimization problem at a certain point (cf.[6] for the definition).Calmness for multifunctions (for perturbations of the lower level solution set) might be considered as well.Therefore, one could introduce a multifunction Δ : R  R   × R   × {0, 1} such that we get for any point (, , , ) ∈  and any  ∈ R. Observe that Δ() is empty for any  < 0 while Δ(0) = graph(Ψ) is valid.Results from Henrion and Surowiec [16] suggest that the calmness of Δ at (0,  * (),  * ,  * ) for an arbitrary feasible point ( * ,  * ,  * ,  * ) ∈  of (16) (referred to as value function constraint qualification or VFCQ for short) is more restrictive than the partial calmness condition given in Definition 3. In [17], the authors generalize the aforementioned results from [16] to bilevel programs where the upper level is an optimal control problem.Note that Henrion and Surowiec criticize (cf.[16]) the fact that optimality conditions derived from partial calmness (or VFCQ) only contain first order information.However, this is justified enough since any subdifferential of the optimal value function is a tool of firstorder analysis.They recommend representing the lower level problem by means of a generalized equation and consider the calmness of some corresponding perturbation mapping in order to obtain optimality conditions containing secondorder information of the lower level as well.Observe that the lower level problem in this paper is purely linear; that is, it makes use of no second-order information and hence it makes little sense to exploit this idea here.That is why we deal with a modification of the original concept of partial calmness, and it will turn out later that our problem of interest (16) possesses this partial calmness property at any of its local optimal solutions.We want to mention here that in [18] the author already made use of partial calmness to derive necessary optimality conditions for general optimal control problems but omitted a detailed discussion on when this condition holds in optimal control (apart from the situation where minimax problems are considered).
In order to define the partial calmness condition for ( 16), we need to consider a partially perturbed version of problem (25) given below for some real number : Note that the feasible set of ( 27) is empty for any  < 0. For the purpose of a space-saving notation we introduce the Banach space  :=  1,1   × R   × R.
Adapting a result from [9] it becomes clear that partial calmness can be characterized equivalently via partial penalization provided the optimal value function  is locally Lipschitz continuous in a certain neighborhood of the reference point.In order to apply the above result, we have to find a criterion which ensures the postulated Lipschitz-property of .Hence, we start a deeper analysis of the lower level problem by decomposing the lower level problem with respect to .Let us introduce two additional set-valued mappings Γ  : R    R   and functions   : R   → R,  = 0, 1, such that, for all () ∈ R   , we get The following lemma summarizes our results on the continuity of Γ 0 , Γ 1 , and Γ. Lemma 5.For any () ∈ R   , the following statements hold true: (ii) The optimal value function can be represented by the formula (()) = min{ 0 (());  1 (())} for any point () ∈ R   .
(ii) We deduce this representation directly from statement (i) of Lemma 5: (iii) We already know from statement (i) that  0 and  1 are piecewise affine and lower semicontinuous functions, being also locally Lipschitz continuous on the interior of their domains.Due to the fact that  is the pointwise minimum of these two functions (cf.statement (ii) of this lemma), it is piecewise affine as well.Now, from assertion (ii) of Lemma 5 we know that Γ is upper semicontinuous, which yields that  is a lower semicontinuous function (cf.[20]).On the other hand, at any point  * () ∈ int(dom( 0 ) ∩ dom( 1 )) the functions  0 and  1 are locally Lipschitz continuous, so the same holds true for .
(iv) One may apply the results from [21] for fully convex parametric optimization problems to the given linear optimization problems using the duality of linear programming.Note that the classical subdifferential is not bounded at the boundary points of the domain of the optimal value function.
(v) For any fixed  ∈ {0, 1}, the parametric optimization problem is completely linear and hence its solution set mapping is inner semicontinuous, while the singular subdifferential of its objective function reduces to {0 + } (cf.[22]).Note that  * is a solution of (40).We apply Theorem 7 [5] to derive In order to evaluate the above coderivative, we have to compute the basic normal cone Observe that graph(Γ  ) is a polyhedron; that is, it is closed and convex.Hence, this cone coincides with the corresponding (classical) normal cone defined as since at least Abadie Constraint Qualification holds at any feasible point of a purely linear optimization problem.It follows from (41) and the definition of the normal coderivative  * Γ  ( * (), ) that the inclusion is true; that is, the criterion from statement (v) implies  ∞   ( * ()) = {0  }.Consequently,   is Lipschitz continuous in a neighborhood of  * (), which is only possible if  * () ∈ int(dom(  )).
(vi) These formulas follow from the calculation rules of the Clarke subdifferential stated in [6].
Note that the criterion from statement (v) of the above lemma always holds if, for a fixed  * (), the linear problem (40) is solvable, while Γ( * ()) possesses an interior point.In order to make this clear, recall that, in the latter case, the Slater condition holds true for problem (40) and the set of singular Lagrange multipliers reduces to {(0   , 0  ℎ )}.In general, one may use statement (V) as a criterion to check whether  * () comes from int(dom( 0 ) ∩ dom( 1 )) = int(dom( 0 )) ∩ int(dom( 1 )), that is, whether  is locally Lipschitz continuous in a neighborhood of  * ().This condition will play an important role in our main results, that is, Theorems 7, 8, and 10.In order to present our next result, we need to introduce two surrogate single-level optimal control problems that arise (47) The following theorem reveals that ( 16) is always partially calm in the sense of Definition 3. Theorem 7. Let ( * ,  * ,  * ,  * ) ∈  be a feasible point of (16) satisfying  * () ∈ int(dom( 0 ) ∩ dom( 1 )).Then (16) is partially calm at this point.In particular, if ( * ,  * ,  * ,  * ) is a local minimizer of (16), then there exists an  > 0 such that ( * ,  * ,  * ,  * ) is a local minimizer of (29), too.
General classes of bilevel programming problems that are partially calm can be found in Ye and Zhu [15], Dempe and Zemkoho [23], and more recently Benita and Mehlitz [17] and Benita et al. [9].Furthermore, any minimax problem is partially calm at its local optimal solutions.Apart from these classes, there are two well-known conditions ensuring the partial calmness, namely, (i) the property of the lower level problem to have a so-called uniformly weak sharp minimum (cf.[15]) and (ii) the above-mentioned condition VFCQ.In [9,17], it is asserted that a BOCP with a finite-dimensional linear lower level problem is always partially calm since its lower level boasts a uniformly weak sharp minimum.Recall that we implicitly used this result when proving Theorem 7.

Optimality Conditions.
In this subsection, we present an appropriate formulation of the maximum principle for problem (16).Since, in our notion of local optimality, we consider the binary variable to be fixed, it is possible to proceed as in [9].We postulate assumptions that allow us to transform (16) into the single-level nonsmooth optimal control problem (29) by means of Theorem 7. Afterwards, we apply a maximum principle (cf.[8,9]) to (29) and exploit the subdifferential formulas for  we introduced in Lemma 6.We omit the proof here and refer the interested reader to the recent paper [9].Theorem 8. Let ( * ,  * ,  * ,  * ) ∈  be a local minimizer of ( 16), assume that (A 1 )-(A 2 ) hold, and let  * () ∈ int(dom( 0 ) ∩ dom( 1 )) be satisfied.