Hybrid Optimal Control Problems for a Class of Semilinear Parabolic Equations

A class of optimal control problems of hybrid nature governed by semilinear parabolic equations is considered. These problems involve the optimization of switching times at which the dynamics, the integral cost, and the bounds on the control may change. First- and second-order optimality conditions are derived. The analysis is based on a reformulation involving a judiciously chosen transformation of the time domains. For autonomous systems and time-independent integral cost, we prove that the Hamiltonian is constant in time when evaluated along the optimal controls and trajectories. A numerical example is provided.


Introduction
This article is dedicated to the derivation of optimality conditions for the following class of optimal control problems of hybrid semilinear parabolic equations: x, y(t, x), u(t, x)) dx dt + Ω φ k (τ k , x, y(τ k , x)) dx subject to: , for a. e. (t, x) ∈ (τ k−1 , τ k ) × Ω, ∀k = 1, ..., K,   ẏ (t, x) − ∆y(t, x) − f k (t, x, y(t, x), u(t, x)) = 0 in (τ k−1 , τ k ) × Ω, ∀k = 1, ..., K, y(t, x) = 0 on (0, T ) × δΩ, y(0, x) = y 0 (x) in Ω, Further specifications on the problem data as well as the definition of the space Y(0, T ) will be given below. Continuity in time and space of the state variable y, in particular at the times τ 1 ,...,τ K−1 , will be guaranteed. Here the term hybrid refers to the following three features of the problem: • At time τ k , the nonlinear part of the system may change, passing from f k to f k+1 .
• At time τ k , the constraints on the control may change, passing from u − k and u + k to u − k+1 and u + k+1 respectively.
• The cost function incorporates terms depending on the value of the state at time τ k .
The optimization variables τ 1 ,...,τ K−1 are called switching times. They are not fixed a priori, but part of the optimization problem. A more general definition of hybrid control problems is provided in [12]. In that reference, as well as in other publications in the field, the dynamics f k , the integral cost k and the control constraints u − k and u + k used on the time interval (τ k−1 , τ k ) can be chosen in a finite set. This combinatorial aspect is not considered in the present paper.
In this article, for the sake of clarity, the analysis is done for K = 2: There is only one switching time to be optimized. The provided results can, however, be extended to the case K > 2 without essential difficulties. They can actually be extended to the following situations: • The state variable and the control variable are multi-dimensional.
• The functions f k , k , φ k all depend on all the switching times.
• Constraints on the switching times are considered.
The boundary conditions can also be changed to mixed boundary conditions, and a Neumann boundary control can also be considered. However, our analysis cannot be extended in a straightforward manner to the situation where the functions u − 1 ,...,u − K and u + 1 ,...,u + K depend on t and/or τ 1 ,...,τ K−1 .
Semilinear parabolic equations have been used in various fields of applications. There is also a rich literature on the optimal control of such equations. In chemical kinetics, they can model the evolution of the concentration of the substances involved in a chemical reaction (see for example [2,20]). In ecology, they can describe the evolution of interacting species (see for example [1]). In physics, they can model the phase change (e.g. from solid to liquid) of materials (see [13]). In neurobiology, the Hodgkin-Huxley and FitzHugh-Nagumo equations describe the transmission of electrical signals in axons (see [17]).
While hybrid problems of finite dimensional systems have been extensively studied in the last years, hybrid problems of systems described by partial differential equations have received little attention so far. Let us motivate each of the three features of the hybrid problem under consideration.
• Many of the semilinear parabolic models used in the literature involve physical coefficients which are often assumed to be constant. When these physical coefficients depend on the experimentation conditions (such as temperature or pressure), then a sudden change of conditions will cause a change of the coefficients, and therefore a change of dynamics. In chemical kinetics for example, the reaction rate is related to the temperature, as stated by the Arrhenius' law. In population dynamics, the reproduction and death rates of some species can be quickly modified by pesticide application, for example.
• In some situations, the control of the system is realized through different actuators, which cannot be all activated at the same time (see for example [8,9]). If the order of utilization of the different actuators is fixed, then a change of the control constraints at the switching time can be used to describe the change of actuators. We note here that our assumptions allow the equality u − k = u + k on subsets of Ω. In some other situations, the actuator should not be utilized all the time. The time interval [0, T ] can then be decomposed into active and inactive phases. Our framework enables to optimize the switching times between active and inactive phases. It is, for example, possible to penalize the duration of active phases. In this respect, our approach can be seen as complementary to the one consisting in adding a sparsity-promoting (with respect to time) penalization term to the cost functional. See [6], for example. Indeed, while the use of such a penalization term ensures the sparsity of the optimal control in a somehow indirect way, it enables us to find the global structure of the solution (such as the ordering of the actuators or the number of active and inactive phases). On the contrary, in our approach, the structure of the solution should be known, and sparsity can be imposed in the model.
Let us also mention that sometimes, it is only possible to implement a piecewise-constant control. This can also be modeled by a change of the control constraints at a switching time. Optimal control problems with piecewise-constant control are studied in e.g. [4], where they are called optimal sampled-data control problems.
• Finally, the introduction of a switching time in the cost function has also its own interest.
One can be interested, for example, in taking into account the minimum taken by a function of the state variable. This can be done by introducing a switching time τ at which the minimum of the function of the state variable is reached. Transforming the problem into a maximization problem, we obtain an L ∞ -term in the cost function, as is explained in [10].
As far as we know, this article is the first one dealing with the derivation of optimality conditions for control problems of semilinear parabolic equations with controls and switching times simultaneously. In [25], first-order optimality conditions for switching times are provided for a hybrid problem of semilinear parabolic equations. The only controls considered in [25] are the switching times themselves: In that framework, the state variable is differentiable with respect to the switching times. This property is not satisfied anymore when a control is incorporated. Moreover, as far as we know, only the recent reference [19] deals with second-order optimality conditions for finite-dimensional hybrid systems.
The theory of first-and second-order optimality conditions for optimal control problems of semilinear parabolic equations (without switching times) is now well-established. It is described in the textbooks [14,27] and was developed in the last two decades. We invite the reader to refer to [5,7,22,26,3] and the references therein on this topic. The main difficulty in the derivation of sufficient optimality conditions, called two-norm discrepancy, lies in the fact that the cost function is twice differentiable for the L ∞ -norm, but one can only assume that its Hessian is coercive for the L 2 -norm on an appropriate subspace.
The derivation of optimality conditions with respect to the switching time for our hybrid optimal control problem constitutes a significant challenge. Indeed, the cost function is not differentiable with respect to the switching times, since the controls are not continuous, in general. For the same reason, the control-to-state mapping is not differentiable with respect to the switching times. Firstorder optimality conditions with respect to the switching times -called transversality conditions -can be derived by designing specific needle perturbations, as in [12]. Here, we follow another approach to obtain first-and second-order optimality conditions. It consists in introducing a change of variables (in time) in the evolution equation. The idea goes back to -at least - [23,24], and has been also used in [10,16,19], for example. The change of variables that we use has a crucial feature: After reformulation, the discontinuity occurring in the dynamics, the control constraints, and the integral cost occurs at a fixed time. The reformulated problem is then a parametric optimal control problem. The reformulation is not only useful for the desired sensitivity analysis but also for solving the problem numerically.
In the context of optimal control of ordinary differential equations, it is well-known that the Hamiltonian is constant in time when evaluated along optimal controls and trajectories, provided that the dynamics and the integral cost are autonomous. This property is also true for the optimal control problems of semilinear parabolic equations, without switching times (see [11]). We extend it to the class of hybrid optimal control problems considered in this paper. Our approach is inspired by [23].
The article is organized as follows. In Section 2, we formulate the required assumptions on the data of the problem and we reformulate it, with a change of variables. In Section 3 the derivatives of the cost functional are calculated. Section 4 contains a technical result, used for the second-order analysis. First-order optimality conditions (Theorem 14) and necessary and sufficient second-order optimality conditions (Theorems 15 and 16) are given in Section 5. Constancy of the Hamiltonian (Theorem 19) is provided in Section 6. A numerical illustration is presented in section 7. In the appendix, we recall some properties of Nemytskii operators.
1. The functions f 1 , f 2 , 1 , 2 , φ 1 , and φ 2 are measurable. For a. e. x ∈ Ω, they are twice continuously differentiable with respect to all the other variables. They satisfy the boundedness condition (with respect to x) and the Lipschitz condition of order 2 with respect to the other variables ((t, y, u) for f 1 , f 2 , 1 , and 2 , (t, y) for φ 1 , and y for φ 2 ).
2. For all R ≥ 0, there exists a constant C R > 0 such that for a. e. (t, x, y, u) ∈ Q × R 2 , We can now formulate the hybrid system under consideration. Let τ ∈ (0, T ), y 0 ∈ H 1 0 (Ω) ∩ C(Ω), and v ∈ L ∞ (Q). Consider: Under assumption 1, it is well-known that this system has a unique weak solution in W (0, T ), that we denote S 0 (v, τ ). It can be shown that the solution lies in Y(0, T ), see [26,Proposition 2.3] and [15,Proposition 2.1]. For y ∈ Y(0, T ), v ∈ L ∞ (Q 0 ), and τ ∈ (0, T ) we define the cost and the reduced cost functionals: Finally, we fix four functions u − 1 ≤ u + 1 ∈ L ∞ (Ω) and u − 2 ≤ u + 2 ∈ L ∞ (Ω) and we define: The optimal control problem to be investigated is given by Notation. Given a function y ∈ L ∞ (Q), we denote for a. e. t ∈ [0, T ] by y(t) the function x ∈ Ω → y(t, x). Given t ∈ [0, T ], t ∈ [0, T ], y and u ∈ L ∞ (Q), we denote by F 1 (t , y(t), u(t)) the function x ∈ Ω → f 1 (t , x, y(t, x), u(t, x)). In the same manner, we associate with the functions f 2 , 1 , 2 , φ 1 , and φ 2 the functions F 2 , L 1 , L 2 , Φ 1 , and Φ 2 respectively. This enables us to omit formally the dependence on x for these functions. We further define: Similarly, we define the mapping L(s, ·, ·, ·) equal to L 1 (·, ·, ·) for s ∈ (0, 1), equal to L 2 (·, ·, ·) for s ∈ (1, 2). We later use a similar convention for the Hamiltonian. Similarly, we set: The interest of this notation will be clear in Section 2.2. The partial derivative with respect to x i of a mapping g : x = (x 1 , ..., x n ) ∈ X 1 × ... × X n → Y (where X 1 ,...,X n are Banach spaces) is denoted: D xi g(x) ∈ L(X i , Y ). The second-order partial derivative with respect to x i and x j will be denoted D 2 xi,xj g(x) and will be seen as a bilinear mapping from X i × X j to Y . The first-order and second-order derivatives with respect to all variables are denoted by Dg(x) and D 2 g(x), respectively. Twice continuously Fréchet differentiable mappings will sometimes be simply called C 2 mappings. Note that later, the Hamiltonian is never differentiated with respect to the variable p.

Change of variables
The formulation of problem (P 0 ) does not enable us to derive optimality conditions. Indeed, the feasible controls are not continuous at time τ and the corresponding state trajectories are not continuously differentiable (in time), in general. Therefore, for fixed values of v and y, the cost function τ →J 0 (y, v, τ ) is not differentiable and for a fixed value of v, the control-to-state mapping τ → S(v, τ ) is not differentiable neither. Eventually, the mapping (v, τ ) → J 0 (v, τ ) is not differentiable with respect to τ . In the formulation of problem (P 0 ), an additional difficulty lies in the fact that the set of feasible controls depends on τ . These difficulties can be overcome by reformulating the problem with the following change of variable. Consider the mapping π : [0, 2] × (0, T ) → [0, T ] defined by: Observe that: π(0, τ ) = 0, π(1, τ ) = τ , and π(2, τ ) = T . For future reference, we introduce the time-derivativeπ of π (with respect to t) and the partial derivative of π andπ with respect to τ , denoted respectively by π τ andπ τ . It holds: Note that we omit to write the variable τ , for π τ andπ τ . Accordingly we define a new class of feasible controls by and consider the following mapping One can easily check that this is a bijection. This mapping will enable us to justify the wellposedness of the reparameterized system and then to establish the equivalence of problems (P 0 ) and (P 1 ).
We observe that S(u, τ ) ∈ Y is the strong variational solution to the following hybrid system: For y ∈ Y, u ∈ L ∞ (Q), and τ ∈ (0, T ), we set: These considerations lead to the reparameterized problem: The verification is straightforward and therefore it is left to the reader. Further below we give optimality conditions for problem (P 1 ). Our sufficient second-order optimality conditions will ensure the local optimality property with respect to the L ∞ -norm for problem (P 1 ) (for the control variable). While there is an equivalence between globally optimal solutions, as stated in the above lemma, there are, however, no obvious notions of local optimality for (P 0 ) and (P 1 ) defined in such a way that if a given (ū,τ ) is a local solution to (P 1 ), then χ −1 (ū,τ ) is a local solution to (P 0 ), and conversely.

First-and second-order derivatives of the cost function
In this section, we compute the first-and second-order derivatives DJ(ū,τ ) and D 2 J(ū,τ ), at a fixed (ū,τ ) ∈ U ad ×(0, T ). We further denoteȳ = S(ū,τ ) and henceforth use the following notation: The analogous notation is used for L and the derivatives of F and L.

Linearization of the system
In this subsection, the regularity of the control-to-state operator is investigated. We first give a regularity result on linear parabolic equations, Lemma 3, which is used throughout the paper.
where ν satisfies a. e. in (0, T ) the condition 1 (a) For all z 0 ∈ L 2 (Ω), there exists a weak solution z ∈ W (0, 2) of (4) and a constant C depending on c such that there exists a strong variational solution z ∈ Y of (4) and a constant C depending on c such that Proof. Assertion (a) is a standard result. For z 0 ∈ L ∞ (Ω), the fact that (4) has a weak variational solution in W (0, 2) ∩ L ∞ (Q) and that (6)  Next we can take ν, b and z ∈ L 2 (Ω) from the left to the right hand side in the first equation of (4) and apply [18, Theorem 6.1, page 178] and [18, (6.10), page 176] in order to obtain (7), with C(Ω) and C(Q) replaced by L ∞ (Ω) and L ∞ (Q). To argue that z ∈ C(Q) we consider where , and, of course, that ζ = z in L ∞ (Q). The continuity of the solution to an equation with constant coefficients like (8) is proved in [27,Lemma 7.12], in the case of a Neumann boundary condition. The proof can be adapted to Dirichlet boundary conditions by replacing all along the proof the Proof.
For any (y, u, τ ) ∈ Y ×U ad ×[0, T ], the equality y = S(u, τ ) holds if and only if e(y, u, τ ) = 0. In the next two steps, we prove that e is C 2 and that for any (y, u, τ ) ∈ Y × L ∞ (Q) × (0, T ), D y e(y, u, τ ) is surjective. Then, it follows with the implicit function theorem that S is C 2 .
Step 2: Regularity of e. Observe first that the mappings are well-defined, linear and continuous, thus C 2 . It is easy to check that the mappings are C 2 . The mapping is well-defined, continuous and bilinear (by Cauchy-Schwarz inequality), therefore C 2 . Define: The mapping f is measurable and satisfies the boundedness condition with respect to (s, x) and the local Lipschitz condition of order 2 with respect to (t, y, u) (see Definition 21). Therefore, by Lemma 22 of the Appendix, the following mapping is C 2 : is also C 2 , and its image is embedded into L 2 (Q). We deduce that e is C 2 , since: Step 3: Surjectivity of D y e(y, u, τ ). Let (y, u, τ ) ∈ Y × L ∞ (Q) × (0, T ) and let ξ ∈ L 2 (Q). By Lemma 3, the following linear parabolic equation has a unique solution in Y: This proves the surjectivity of D y e(y, u, τ ) : Y 0 → H 1 0 (Ω) ∩ C(Ω) and concludes the proof.
Remark 5. The implicit function theorem may appear as a too strong tool for verifying the differentiability of S, since it involves the use of strong variational solutions. Their use, however, is unavoidable for our analysis. Indeed, consider the linearization of system (3) with respect to τ : where: We shall need an L ∞ (Q) bound for z. This can only be achieved if the right-hand side ξ is an element of L 2 (Q), which explains why ∆y should itself be in L 2 (Q).
Consider now the linear mapping defined by where z is the solution to the linearized equation (10), with (y, u, τ ) = (ȳ,ū,τ ) and z 0 = 0. The well-posedness and the continuity of the linear mapping K is ensured by Lemma 3. We introduce the following space: Any function y ∈ W (0, 1), (1, 2) is continuous on [0, 1) and (1,2] and has a left-and a righthand limit at time 1, that we denote by y(1 − ) and y(1 + ), respectively. The jump is denoted by We define now the mapping The function q is the concatenation of the solution to two backward linear parabolic equations: One on (1, 2) × Ω, with terminal condition b, and one on (0, 1) × Ω, with terminal condition q(1 + ) + a. The well-posedness is ensured by Lemma 3 (a) (after the change of variable t → 2 − t). Note here that q |(1,2)×Ω ∈ W (1, 2) and hence q(1 + ) ∈ L 2 (Ω). We establish below that K * is the adjoint operator of K ∈ L(L 2 (Q), L 2 (Ω) 2 × L 2 (Q)).
We obtain, by integration by parts: The proof is complete.
We define now the following mapping: As a consequence of Lemma 4, S is twice continuously Fréchet differentiable, with: Lemma 6 allows us to compute the adjoint operators of D u S(ū,τ ) and D τ S(ū,τ ) as mappings from L 2 (Q) and R respectively, to L 2 (Ω) 2 × L 2 (Q). For v ∈ L 2 (Q) and (a, b, w) ∈ L 2 (Ω) 2 × L 2 (Q), it holds:

Computation of the derivatives of the cost functional
First we define the mappings H 1 and H 2 as follows for i ∈ {1, 2}. We define the Hamiltonian H in the same fashion as in (2): Note that in what follows, the partial derivative D t H (as well as the other second-order partial derivatives in t) refers to the partial derivative with respect to the second variable in the definition of H.
Lemma 7. The Lagrangian is twice continuously differentiable. The first-order partial derivatives at (ȳ,ū,τ ) are given by: The second-order partial derivatives at (ȳ,ū,τ ) in directions z,ẑ in Y, v,v in L ∞ (Ω), δa i , δâ i for i ∈ {1, 2} in C(Ω) and θ ∈ R are given by: The derivatives which are not given above are null.
Proof. We give a proof of the differentiability of the Lagrangian and compute the first-order derivative with respect to y. The proofs for the other first-order derivatives and for the second-order derivatives are left to the reader.
This concludes the first part of the proof.

Thus the proof is complete
In the next lemma, we compute the first-and second-order derivatives of J at (ū,τ ). Observe that the second-order derivative D 2 L(ȳ,ū,τ ) can be identified with a continuous endomorphism in (C(Ω) 2 × Y) × L ∞ (Q) × R by writing In formula (16) of Proposition 8 below, the multiplication of matrices of linear mappings is defined by the usual rules of matrix calculus. The multiplication of two linear mappings is defined as their composition.
The first-order derivatives of J at (ū,τ ) are given by Proof. Relation (15) follows directly from the definition of L. Differentiating this relation twice and using the fact that D y L(ȳ,ū,τ ) = 0, we obtain the expressions of the first-and second-order derivatives. For example, we have which yields the announced expression.

Regularity of the Hessian of the cost function
In Proposition 9 below, we show that D 2 J(u, τ ) can be extended to a continuous bilinear form on L 2 (Q) × R and that it is Lipschitz continuous with respect to u (for the L ∞ -norm) and τ . The proof of the proposition is based on two other technical lemmas (Lemmas 10 and Lemma 13). They state thatJ and S satisfy the following property: Their second-order derivatives can be extended to a continuous bilinear mapping on an appropriate L 2 space and they are Lipschitz-continuous for the L ∞ -norm. All along the section, a pair (ū,τ ) ∈ U ad × (0, T ) is fixed. Let us fix two real numbers 0 < ε 0 < min(τ , T −τ ) and c > 0 satisfying the following properties: • For all u ∈ U ad and τ ∈ (0, T ), setting y = S(u, τ ), we have • For all τ ∈ [τ − ε 0 ,τ + ε 0 ] and t ∈ [0, 2], the inequality 1/c ≤π(t, τ ) ≤ c holds.
We define: Proposition 9. There exist constants C 1a > 0 and C 1b > 0 such that for all (u, τ ) ∈ W, for all (v, θ) and (v,θ) ∈ L ∞ (Q) × R, Proof. The second-order derivative of J is given by: By Lemmas 10 and 13, the result holds for C 1a = C 2a C 8a + C 3a (1 + C 2 7a ) and which concludes the proof.

It holds
The second estimate follows, taking C 6b = (ε 0 + C 4b )C 2 6a and using once again Lemma 3.

First-order optimality conditions
We define: Theorem 14. Assume that (ū,τ ) is a solution to (P 1 ). Then, for all u ∈ U ad , Moreover, Therefore, for a. e. (t, x) ∈ Q, Proof. Inequality (18) follows directly from the convexity of U ad and the differentiability of J. The equality and the inequalities given in (20) follow from the optimality ofū and a Lebesgue point argument (see for instance [27,Theorem 5.12 and Conclusion]).

Second-order optimality conditions
In this subsection, (ū,τ ) is assumed to satisfy the first-order optimality conditions (18) and (19). For the formulation of the second-order order optimality conditions and, more precisely, for the definition of the critical cone, we introduce the following subset of Q, parameterized by δ ≥ 0: Observe that by (20), for all δ ≥ 0, for a. e. (t, x) ∈ Q, We define the tangential set to U ad atū: We now define, for all δ ≥ 0, the set The set C 0 (ū,τ ) is called critical cone. Observe that for all v ∈ C 0 (ū,τ ), (t,τ )D u h t, π(τ , t),ȳ(t, x),ū(t, x),p(t, x) v(t, x) dx dt = 0.
Theorem 15. Assume that (ū,τ ) is a solution to (P 1 ). Then, for all (v, θ) ∈ C 0 (ū,τ ) × R, Proof. Let (v, θ) ∈ C 0 (ū,τ ) × R. Let (ε k ) k∈N be a sequence of positive real numbers converging to 0. For all k ∈ N, define for a. e. (t, where P [a,b] denotes the projection on the interval [a, b]. Since v ∈ T U ad (ū), for a. e. (t, x) ∈ Q, there existsk such that for all k ≥k, v k (t, x) = v(t, x). Moreover, for all k, for a. e. (t, x) ∈ Q, |v k (t, x)| ≤ |v(t, x)|, therefore, by the dominated convergence theorem, v − v k L 2 (Q) → 0. It can be easily checked that for all k, v k ∈ C 0 (ū,τ ) and thatū + ε k v k ∈ U ad . By optimality of (ū,τ ) and by Taylor's theorem, there exists for all k ∈ N a real number µ k ∈ [0, 1] such that: Using Proposition 9, we obtain which concludes the proof.
The proof is elementary, and so left to the reader. Observe that χ 2a is not surjective and that χ 2b is not injective.
Proof. The proof is very similar to the one of Lemma 4. The mapping e is now defined as follows: where N (t) = t 0 ν(s) ds. It can be represented as in (9), if one replaces τ by ν, and G 3 , G 4 by the following definitions: The surjectivity of D y e(y, u, ν) is still a consequence of Lemma 3. Thus, S 2 is continuously Fréchet differentiable, by the implicit function theorem.
Recall that D t H denotes the partial derivative of H with respect to its second variable.
7 Numerical experiment: The competitive prey-predator system As an illustration of the theoretical findings, we propose to consider the Lotka-Volterra PDEsystem, describing the evolution of populations of preys and predators. Denote by Ω = (0, 1), and let y 1 , y 2 be the distributions of populations of preys and predators, respectively. The coupled partial differential equations system we are interested in is given by: in (0, T ) × Ω, y 1 = y 2 = 0 on (0, T ) × ∂Ω, y 1 (0, ·) = y 1,0 , y 2 (0, ·) = y 2,0 in Ω. (31) Note that the control and the state are vector-valued. As mentioned in the introduction, the results of the article can be easily extended to such a situation. The control is realized through two functions u 1 and u 2 , whose supports are given byω 1 = (0.00, 0.25) andω 2 = (0.75, 1.00), respectively. The objective we define is to maximize a quantity φ 1 representing the population of preys on a subdomain ω := (0.48, 0.52) at some optimal time τ to be determined. The terminal cost φ 2 is the same function as φ 1 . More precisely, by denoting y = (y 1 , y 2 ) T we consider Denoting by u = (u 1 , u 2 ) T , the running cost functional (to be maximized) is defined as The parameters of the model are set to T = 30.0, ν 1 = ν 2 = 0.001, a = 0.3, r = 0.2, c 1 = c 2 = 0.05.
The change of dynamics is realized through the coefficients q and b, which can be interpreted respectively as the capacity of reproduction of predators and their tendency of killing preys: Their values are given by It means that after having reached a maximum for the population of preys in the region ω at time τ , through this change of dynamics we facilitate the subsistence of preys at time T by restricting their interaction with predators. The large number of preys after τ can indeed help the predators too much to reproduce, and then could lead to the extinction of preys before time T .
The space discretization is made by P1-finite elements, with 1001 degrees of freedom. The time-evolution discretization consists of 1000 time steps, and is performed with a Crank-Nicholson scheme for the state system (31), and an implicit Euler scheme for the corresponding adjoint system. In practice, in order to make the transport effect easier in space, we add in the left-hand-side of the two first equations of system (31) advection terms of type β(y 1 · ∇)y 1 and β(y 2 · ∇)y 2 , with β = 0.0005. At each time step, nonlinearities are solved with a Newton method. The results, for the cost parameter α = 10 −6 , are presented in figure 1. A Barzilai-Borwein method (see [21]) initialized with a line-search step is performed in order to vanish the gradient of the cost function, given by Proposition 8. The optimize-discretize approach actually introduces a residual error (approximately 10 −5 % here), which is observed to be proportional to the space step. That is why we stop the algorithm when the variation of the norm of the gradient (between two iterations) as smaller than 10 −10 %. We present only the evolution of the population of preys (the variable y 1 ) and the evolution of their control (the control u 1 ). The optimal control u 2 is actually not activated here.
An optimal switching time equal to τ ≈ 13.5919 has been obtained. We observe that the control starts by killing preys, likely in order to restrain the population of predators as much as possible. Then, once the population of predators is low enough, the control increases and becomes positive, so that this introduction of preys in the domain leads more efficiently to their reproduction. Secondly, we notice that the control is much more active (and negative) after time τ , in order to respond to the terminal cost. This is probably due to the fact that after the first maximum reached at time τ , the population of preys is much more important than at the initial time, and then a morenegative -active control is needed in order to avoid that the population of predators becomes too important. We also observe that the advection terms added in the model help the cost function to increase by approximately 24%, with respect to the simulation without control, instead of by approximately 3% with β = 0 (this case not presented here). Last, we observe that a delay is encoded into the model: The control is no more active shortly before the optimal time τ , or before the terminal time. This is due to the time needed to transport preys into the domain from one point to another.

Conclusion
We have provided first-and second-order optimality conditions for a hybrid control problem for a system governed by a semilinear parabolic equation. The analysis is based on a reformulation of the problem obtained by a change of variable in time. We have also shown that the framework of strong variational solutions (for the state equation) is an appropriate framework for the derivation of optimality conditions. A theoretical property, related to the variation of the Hamiltonian along an optimal trajectory, has been proved. Finally, we have provided numerical results for a hybrid Lotka-Volterra PDE-system.
The results of this article could be extended to different models of PDEs, for example to PDEs of hyperbolic type. It would also be of interest to allow for the presence of state constraints. A second-order sensitivity analysis of the value problem of our problem, with the help of a conveniently defined Riccati equation, is another topic for future work.

A Regularity of Nemytskii operators
We recall in this section a technical result concerning the regularity of Nemytskii operators. The terminology comes from [27,Section 4.3.2].
Let E x be a measurable subset of R n . Let k ∈ N. Let φ : E x × R → R. Assume that φ is measurable and that for a. e. x ∈ E x , y → φ(x, y) is continuously k-times differentiable.
Definition 21. We say that φ satisfies the boundedness conditions of order k (with respect to x) if there exists C > 0 such that: for all = 0, ..., k, for a. e.
x ∈ E x .
We say that φ satisfies the local Lipschitz condition of order k (with respect to y) if for all M ≥ 0, there exists K ≥ 0 such that for all x ∈ E x , for all y 1 and y 2 ∈ R, |y 1 | ≤ M and |y 2 | ≤ M ⇒ |D k y φ(x, y 2 ) − D k y φ(x, y 1 )| ≤ K|y 2 − y 1 |.
In particular, if the boundedness and Lipschitz conditions of order k are satisfied, then they are also satisfied for any smaller order. The following lemma is a direct extension of [27,Lemma 4.12].
Lemma 22. Assume that φ satisfies the boundedness condition of order k and the Lipschitz condition of order k. Then, the following mapping, called Nemytskii operator associated with φ, is k times continuously Fréchet differentiable: Φ : y ∈ L ∞ (E x , R) → x ∈ E x → φ(x, y(x)) ∈ L ∞ (E x , R).
It is easy to check that the above function satisfies the boundedness and the Lipschitz conditions of order 1. In particular, for all M ≥ 0, for all y 1 and y 2 ∈ R with |y 1 | ≤ M and |y 2 | ≤ M , for all x ∈ E x , where K is given by (33), for = q + 1. This proves that Ψ is continuously differentiable and by (34), D y Ψ(y)δy = A(y)δy. By (35) and (38), which proves (36) and therefore concludes the proof.
As mentioned in the proof, the derivative of order of the Nemytskii operator is the Nemytskii operator of the pointwise derivative of order . For = 1 in particular, this means that for all y ∈ L ∞ (E x , R), DΦ(y) can be seen as an element of L L ∞ (E x , R), L ∞ (E x , R) (as in (37)) or as an element of L ∞ (E x , R): x → D y φ(x, y(x)).
In the article, one of the two points of view is adopted depending on the context. For example, in the definition of the adjoint equation (13), D y Φ 1 (τ,ȳ(1)) and D y Φ 2 (ȳ(2)) are seen as element of L ∞ (Ω).
Lemma 23. Assume that φ satisfies the boundedness and the Lipschitz conditions of order k. Then, for all = 1, ..., k, for all y ∈ L ∞ (E x , R), the mapping D y Φ(y) can be extended to a -linear continuous mapping from [L (E x , R)] to L 1 (E x , R). Moreover, for all M ≥ 0, there exists R ≥ 0 such that for all y 1 and y 2 ∈ L ∞ (E x , R), for all z = (z 1 , ..., z ) ∈ [L (E x , R)] , zi L (Ex,R) .
Proof. The two statements of the lemma are a direct consequence of (34) and Hölder's inequality.