*Article* **Optimal Darwinian Selection of Microorganisms with Internal Storage**

**Walid Djema 1,\*, Térence Bayen <sup>2</sup> and Olivier Bernard 1,3**


**Abstract:** In this paper, we investigate the problem of species separation in minimal time. Droop model is considered to describe the evolution of two distinct populations of microorganisms that are in competition for the same resource in a photobioreactor. We focus on an optimal control problem (OCP) subject to a five-dimensional controlled system in which the control represents the dilution rate of the chemostat. The objective is to select the desired species in minimal-time and to synthesize an optimal feedback control. This is a very challenging issue, since we are are dealing with a ten-dimensional optimality system. We provide properties of optimal controls allowing the strain of interest to dominate the population. Our analysis is based on the Pontryagin Maximum Principle (PMP), along with a thorough study of singular arcs that is crucial in the synthesis of optimal controls. These theoretical results are also extensively illustrated and validated using a direct method in optimal control (via the Bocop software for numerically solving optimal control problems). The approach is illustrated with numerical examples with microalgae, reflecting the complexity of the optimal control structure and the richness of the dynamical behavior.

**Keywords:** optimal control; modelling; microalgae; chemostat; nonlinear control; Pontryagin's principle; singular control; Droop model; photobioreactor

#### **1. Introduction**

The interaction between species coexisting in an ecosystem is complex and affected by external factors. Depending on their environment, some species will dominate, while others, less adapted, will progressively decline. This Darwinian pressure, when it can be manipulated [1], provides the opportunity of guiding the evolution of species of interest. This concept can be applied to artificial ecosystems to select individuals with a desired trait. Here, we focus on microalgae, unicellular photosynthetic microorganisms with promising potential for industrial applications [2,3]. The great biodiversity of microalgae opens the door for a large range of applications [4]. They are grown for their pigments, antioxidants or essential fatty acids [5], and, over the longer term, their efficient way of producing proteins, bricks for green chemistry, biofuel and CO2 mitigation [2,6,7]. To date, microalgae do not have the place they deserve in biotechnology (see, e.g., [8–10]) and many optimization steps must be carried out to improve the economic and environmental performances of these processes at a large scale [6,11]. Currently, only wild organisms sampled in nature are used on an industrial scale. One of the key challenges is to improve the productivity of these strains.

Species in agriculture have been improved after centuries of selection and hybridization. The objective of this work is to develop an alternative approach adapted to microorganisms to select, on a shorter time scale, more productive microalgae strains, by Darwinian

**Citation:** Djema, W.; Bayen, T.; Bernard, O. Optimal Darwinian Selection of Microorganisms with Internal Storage. *Processes* **2022**, *10*, 461. https://doi.org/10.3390/ pr10030461

Academic Editors: Philippe Bogaerts and Alain Vande Wouwer

Received: 19 January 2022 Accepted: 14 February 2022 Published: 24 February 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

pressure. The idea is based on the competitive exclusion principle in a continuous reactor [12] stating that the species which more efficiently uses the available resources will win the competition. The conditions for a bacterial or microalgal species to win the competition for a limiting substrate have been well established, and the outcome of the competition is known to depend on the minimum requested substrate to support a growth rate equal to the dilution rate [12,13].

Experimental works for maintaining a long-term selection process to favour individuals of interest have already been carried out [14,15]. Since the experiments can last several months or several years, these approaches are costly in time. There is a margin of improvement by applying optimal control theory [16] to enhance the selection process for *N* strains competing for the same resource (the control parameter being the dilution rate).

One main issue is to decrease the operating time when the species of interest starts to dominate. Several works addressed the question of improving the selection process in minimal time in the case of the chemostat system with Monod's laws [17,18]. Microalgae are more complicated microorganisms better represented by the Droop model, taking into account the internal accumulation of the limiting nutrient [19,20]. Such a model for two strains in competition leads to a five-dimensional problem. The minimal time selection problem with this model is the main focus of the paper. It has been tackled in [21,22] after a simplification allowing for reducing the model dimension. This necessitated to oversimplify the initial dynamics which can play a role in the minimal time selection.

Optimal control [23] strategies ensuring the domination of the strain of interest are derived using the Pontryagin maximum principle [24]. Since the system is affine w.r.t. the control, we obtain various possible structures for an optimal control, namely, the concatenation of several bang arcs or of a bang arc with a singular arc of first order satisfying Legendre–Clebsch's condition. The paper is structured as follows: in Section 2, we introduce the model and present the optimal control problem. We also prove the reachability of the target set. In Section 3, we make explicit the necessary conditions provided by the Pontryagin Maximum Principle and we introduce properties of the switching function. A thorough study of singular arcs is provided in Section 4 thanks to geometrical control theory. The paper is concluded with numerical simulations of optimal strategies using a direct method in Section 5.

#### **2. The Optimal Control Problem (OCP)**

#### *2.1. Droop Model and Main Assumptions*

We consider the Droop model [19]. This emblematic variable yield model represents the growth rate of microorganims which can intracellularly store nutrients. When two strains are in competition, it results in a five-dimensional system. The growth of each strain depends on the intracellular quota-storage (*q*-variable) of the limiting nutrient (*s*-variable). More precisely, when two species/strains, of biomass concentrations *x*<sup>1</sup> and *x*<sup>2</sup> are competing for one limiting nutrient *s* in the bioreactor, the Droop model reads as follows:

$$\begin{cases} \dot{s} &= (s\_{\text{ir}} - s)D(t) - \rho\_1(s)\mathbf{x}\_1 - \rho\_2(s)\mathbf{x}\_{2\prime} \\\\ \dot{q}\_1 &= \rho\_1(s) - \mu\_1(q\_1)q\_{1\prime} \\\\ \dot{\mathbf{x}}\_1 &= [\mu\_1(q\_1) - D(t)]\mathbf{x}\_{1\prime} \\\\ \dot{q}\_2 &= \rho\_2(s) - \mu\_2(q\_2)q\_{2\prime} \\\\ \dot{\mathbf{x}}\_2 &= [\mu\_2(q\_2) - D(t)]\mathbf{x}\_{2\prime} \end{cases} \tag{1}$$

where *qi* is the quota storage of the *i*-th species and *sin* is the input substrate concentration. The dilution rate *D*(·) is a bounded non-negative control function such that *D*(*t*) ∈ [0, *D*max], where *D*max > 0 is the maximal admissible value of the dilution rate, above the maximum actual growth rates [22] (this will be made more precise in Section 2.3) of the two species as shown in Figure 1. In addition, for *i* = 1, 2, *ρ<sup>i</sup>* is a non-negative function representing the rate of substrate absorption, i.e., the uptake rate of the free nutrient

*s*, and *μ<sup>i</sup>* is also a non-negative function representing the growth rate of the *i*-th species (see [25]).

Following for instance [25], we suppose that the uptake rates *ρi*(*s*) are expressed as,

$$
\rho\_i(s) = \frac{\rho\_{m\_i^\*}s}{\mathcal{K}\_i + s'} \tag{2}
$$

which corresponds to Michaelis–Menten's kinetics. Here, the parameters *Ki* and *ρmi* are positive, *i* = 1, 2. In addition, we assume that, for *i* = 1, 2, there is *ki* > 0 such that cell division does not occur if *k* < *ki*. Concerning the Droop model, the kinetics *μ<sup>i</sup>* are defined by

$$\begin{cases} \mu\_i(q\_i) &= 0, & 0 \le q\_i \le k\_i, \\\mu\_i(q\_i) &= \mu\_{i\infty} \left(1 - \frac{k\_i}{q\_i}\right), & k\_i \le q\_i. \end{cases} \tag{3}$$

In addition, for *i* = 1, 2, let *Mi* stand for,

$$M\_{\boldsymbol{i}} := \sup\_{\boldsymbol{s} \in [0, s\_{\boldsymbol{m}}]} \rho\_{\boldsymbol{i}}(\boldsymbol{s}) = \rho\_{\boldsymbol{i}}(s\_{\boldsymbol{m}}) < \rho\_{\boldsymbol{m}\_{\boldsymbol{i}}}.$$

and let *q*¯1,*q*¯2 be such that *μi*(*q*¯*i*)*q*¯*<sup>i</sup>* = *Mi*, *i* = 1, 2 (observe that *q*¯1, *q*¯2 are uniquely defined). Thus, one has,

$$
\rho\_i(s\_{in}) = \mu\_i(\vec{q}\_i)\vec{q}\_i... 
$$

System (1) satisfies the following invariance property.

**Proposition 1.** *For every qm*<sup>1</sup> ≥ *q*¯1*, and for every qm*<sup>2</sup> ≥ *q*¯2*, the set*

$$\Omega := (0, s\_{in}) \times [k\_1, q\_{m\_1}] \times \mathbb{R}\_+^\* \times [k\_2, q\_{m\_2}] \times \mathbb{R}\_{+\prime}^\* \tag{4}$$

*is forward invariant by* (1)*.*

**Proof.** First, observe that, for *i* = 1, 2, *xi* never vanishes whenever *x*<sup>0</sup> *<sup>i</sup>* = *xi*(0) > 0. Now, (0,*sin*) is clearly invariant by the dynamics of *s*(·) since *s*˙ ≥ 0 (resp. *s*˙ ≤ 0) whenever *s* = <sup>0</sup> (resp. *s* = *sin*). Similarly, for *i* = 1, 2:

$$\begin{array}{llll} q\_i = k\_i & \Rightarrow & \dot{q}\_i = \rho\_i(s) > 0, \\ q\_i = q\_{m\_i} & \Rightarrow & \dot{q}\_i \le M\_i - \mu\_i(q\_{m\_i})q\_{m\_i} \le 0, \end{array}$$

where the last inequality follows from the choice of *Mi* and the fact that *qmi* ≥ *q*¯*i*, *i* = 1, 2. This ends the proof.

The parameter *qmi* represents the *maximum internal storage quota*. Since Ω is invariant by (1) (Proposition 1), we notice that *q*¯*<sup>i</sup>* stands for the *effective maximum internal storage quota* for *s* ∈ (0,*sin*). Thus, in the sequel, we consider without loss of generality that *qmi* = *q*¯*<sup>i</sup>* for *i* = 1, 2. In the sequel, we also assume that *ρ*1, *ρ*<sup>2</sup> fulfill the following hypothesis:

**Assumption 1.** *The affinity of species 1 for the substrate is higher than the one of species 2, i.e., Ks*<sup>2</sup> > *Ks*<sup>1</sup> *, or equivalently:*

$$\frac{\rho\_2^{\prime\prime}}{\rho\_2^{\prime}} > \frac{\rho\_1^{\prime\prime}}{\rho\_1^{\prime}}.\tag{5}$$

From (2), we deduce that, for *s* ≥ 0,

$$
\rho\_2^{\prime\prime}(s)\rho\_1^{\prime}(s) - \rho\_1^{\prime\prime}(s)\rho\_2^{\prime}(s) = \frac{2K\_1K\_2\rho\_{m\_1}\rho\_{m\_2}(K\_2 - K\_1)}{(K\_1 + s)^3(K\_2 + s)^3}.
$$

It means that species 1 with the lower *Ki* absorbs nutrients slightly faster.

We are now in a position to formulate the OCP of interest.

#### *2.2. Statement of the Optimal Control Problem (OCP)*

In this work, we suppose that the first species (with biomass concentration *x*1) is the one of interest. Our aim is to compute the best feeding strategy, that is, the optimal (dilution rate) control function *D*(·), such that *x*<sup>1</sup> becomes predominant in the photobioreactor in minimal-time. This can be formulated and quantified in terms of the ratio between the two competing species. Intuitively, we wish to find an adequate control strategy (if possible optimal) *<sup>D</sup>*(·) for which, at the end of the process, we have *<sup>x</sup>*<sup>1</sup> *<sup>x</sup>*<sup>2</sup> 1.

Firstly, the set of admissible controls is defined as,

$$\mathcal{D} := \{ D : [0, +\infty) \to [0, D\_{\text{max}}] \; ; \; D(\cdot) \in \mathcal{L}\_{loc}^{\infty}(\mathbb{R}\_+) \},$$

where <sup>L</sup><sup>∞</sup> *loc*(R+) is the space of locally integrable functions on every compact on <sup>R</sup><sup>+</sup> and *D*max > 0 is the maximum pump feeding capacity. In practice, *D*max is designed above the maximum growth rates of the coexisting species (see Section 2.3).

To handle the selection process between the two species, let us define a subset T of Ω as,

$$\mathcal{T} := \{ X := (s, q\_1, x\_1, q\_2, x\_2) \in \Omega \; ; \; x\_2 \le \varepsilon x\_1 \}. $$

We choose the parameter *ε* > 0 such that *ε* 1 in such a way to quantify the contamination rate of the interesting strain *x*1. Whenever a trajectory reaches the target set T , this means that the biomass of the first species is significantly greater than the other one when reaching the target T at the terminal time (if possible).

**Objective 1.** *The optimal control problem (OCP) can then be stated: determine a dilution-based control strategy D*(·) *in such a way that trajectories of* (1) *starting from an initial condition within the set* Ω *reach the target set* T *in minimal-time, i.e.,*

$$\inf\_{D \in \mathcal{D}} t\_f^D \quad \text{s.t.} \ X(t\_f^D) \in \mathcal{T} \quad \text{and} \ X^0 \in \Omega,\tag{6}$$

*where <sup>X</sup>*(·) *is the unique solution of* (1) *associated with <sup>D</sup>*(·) ∈ D *such that <sup>X</sup>*(0) = *<sup>X</sup>*<sup>0</sup> <sup>∈</sup> <sup>Ω</sup> *and tD <sup>f</sup>* ∈ (0, +∞] *is the first entry time of X*(·) *into the target set. In the sequel, we will use the simpler notation tf instead of t<sup>D</sup> f .*

In other words, for every positive initial conditions *X*<sup>0</sup> = (*s*0, *q*<sup>0</sup> <sup>1</sup>, *<sup>x</sup>*<sup>0</sup> <sup>1</sup>, *<sup>q</sup>*<sup>0</sup> <sup>2</sup>, *<sup>x</sup>*<sup>0</sup> <sup>2</sup>) such that *q*0 *<sup>i</sup>* > *ki*, we are seeking an admissible control strategy *D* = *DX*<sup>0</sup> ∈ D, steering the trajectory *<sup>X</sup>*(*t*) of the system (1) from *<sup>X</sup>*<sup>0</sup> to the target set <sup>T</sup> in minimal-time, for a fixed *<sup>D</sup>*max (Figure 1) and a given contamination rate *ε* 1. Note that, if one is able to synthesize such an optimal control for every *<sup>X</sup>*<sup>0</sup> <sup>∈</sup> <sup>Ω</sup>, then one is able to construct an optimal feedback control over <sup>Ω</sup> as *X*<sup>0</sup> → *DX*<sup>0</sup> (0). Such an optimal control problem falls into the class of minimal-time control problems governed by a mono-input affine controlled system, for which the synthesis of an optimal feedback control, thanks to geometric control theory, is a crucial (but also delicate) issue. In particular, handling the high dimension of the Droop model in competition and its resulting optimality system is challenging. Note also that the linearity of the problem w.r.t. *D* (in contrast, for instance, with strictly convex cost functionals) leads to technicalities because singular arcs usually occur in this setting, see Section 4.

#### *2.3. Basic Properties*

We now introduce the so-called *actual growth rates*. These key functions will have an important role in the optimal separation strategy. For that, let us firstly start with the following observations:

• The mapping *ρ<sup>i</sup>* : [0,*sin*] → [0, *Mi*] is one-to-one with *Mi* < *ρmi* ;


$$\delta\_i(q\_i) := \rho\_i^{-1}(q\_i \mu\_i(q\_i)) = \frac{K\_i q\_i \mu\_i(q\_i)}{\rho\_{m\_i} - q\_i \mu\_i(q\_i)}, \quad q\_i \in [k\_i, q\_i]\_\rho$$

is well-defined and is also one-to-one;

• Hence, the mapping *<sup>δ</sup>*−<sup>1</sup> *<sup>i</sup>* : [0,*sin*] → [*ki*, *q*¯*i*] such that

$$\delta\_i^{-1}(\mathbf{s}) := \frac{k\_i K\_i \mu\_{i\infty} + (\rho\_{m\_i} + \mu\_{i\infty} k\_i)\mathbf{s}}{\mu\_{i\infty}(K\_i + \mathbf{s})}, \quad \mathbf{s} \in [0, s\_{in}]\_{\mathbf{s}}$$

is well-defined over [0,*sin*) with values in [*ki*, *q*¯*i*] and is one-to-one.

From these observations, one can immediately check that the mappings *δi*, *i* = 1, 2 and *δ*−<sup>1</sup> *<sup>i</sup>* are increasing.

Indeed, for *i* = 1, one can write *δ*−<sup>1</sup> <sup>1</sup> (*s*) = *<sup>c</sup>*<sup>1</sup> <sup>+</sup> *<sup>c</sup>*<sup>2</sup> *<sup>s</sup>*+*c*<sup>3</sup> with *<sup>c</sup>*1, *<sup>c</sup>*<sup>3</sup> > 0 and

$$c\_2 := \delta\_i^{-1}(s) = \mathcal{C} + \mathcal{K}\_{\mathfrak{s}\_1} \left[ \frac{k\_{k\_1} \mu\_{1\infty}}{k\_1 \mu\_{1\infty} + \rho\_{m\_1}} - 1 \right] < 0,$$

which implies that *δ*−<sup>1</sup> *<sup>i</sup>* is increasing.

The *actual growth rate* of species *<sup>i</sup>* is then defined as the mapping *<sup>μ</sup><sup>i</sup>* ◦ *<sup>δ</sup>*−<sup>1</sup> *<sup>i</sup>* ,

$$\mu\_i(\delta\_i^{-1}(s)) = \frac{\rho\_{\text{ref}\_i}\mu\_{i\infty}s}{k\_i K\_i \mu\_{i\infty} + (\rho\_{\text{ref}\_i} + \mu\_{i\infty}k\_i)s}, \quad s \in [0, s\_{i\text{in}}], \quad i = 1, 2.1$$

The resulting generic functions are illustrated in Figure 1: Let us now define,

$$
\Delta(s) := \mu\_1(\delta\_1^{-1}(s)) - \mu\_2(\delta\_2^{-1}(s)), \quad s \in [0, s\_{in}].\tag{7}
$$

Throughout the paper, we suppose that Δ satisfies the following assumption.

**Assumption 2.** *There is a unique s*ˆ ∈ (0,*sin*) *such that* Δ(*s*) > 0 *for every s* ∈ (0,*s*ˆ) *and* Δ(*s*) < 0 *for every s* ∈ (*s*ˆ,*sin*)*. In addition,* Δ *has a unique maximum sc* ∈ [0,*s*ˆ]*.*

Taking into account that Δ(*s*ˆ) = 0, the inequalities satisfied by Δ according to Assumption 2 can also be written:

$$
\Delta(s)(s-\mathfrak{s}) < 0, \quad s \in (0, s\_{in})\backslash\{\mathfrak{s}\}.
$$

If we assume that *s* is regulated to *s*∗(*t*) = *sc* using an appropriate control *D*, we notice that the *q*-variables are regulated to some unique *qic* ∈ [*ki*, *qmi*], for *i* = 1, 2. The unique point (*sc*, *q*1*c*, *q*2*c*), where *sc* ∈ [0,*sin*], plays a crucial role in the optimal control strategy of (OCP) as discussed in Section 5. Finally, *D*max (the maximum dilution rate) is assumed to be large enough in order to drive competition between the two species. More precisely, we assume that *D*max satisfies the hypothesis:

**Assumption 3.** *The maximal value of the dilution rate Dmax satisfies*

$$\forall \mathbf{s} \in [0, \mathbf{s}\_{\mathrm{in}}]\_{\prime} \quad D\_{\mathrm{max}} > \max\left(\mu\_1(\delta\_1^{-1}(\mathbf{s})), \mu\_2(\delta\_2^{-1}(\mathbf{s}))\right).$$

These assumptions will ensure reachability (as detailed in the next section) of the target T , and establishes a generic framework where both species may win the competition for sufficiently large time (considering for instance various constant control parameters *D* that favor species 1 or 2). Thus, under these considerations, we ensure the well-posedness of the optimal control problem of interest. In this general framework, the objective is then to determine the optimal *D* that steers the trajectories in minimal-time to the desired target.

**Figure 1.** The illustrated absorption functions *ρ<sup>i</sup>* and growth rates *μ<sup>i</sup>* lead to a generic form of the actual growth rates *s* → *μi*(*δi*(*s*)) where both species may win the competition. The maximum dilution rate *D*max is a fixed constant value above the maximum of the functions *s* → *μi*(*δi*(*s*)) for *i* = 1, 2, as stated in Assumption 3.

#### *2.4. Reachability of the Target*

Our next aim is to show that the target is reachable from every initial condition. First, let us recall that the set

$$\mathcal{M} := \{ X \in \Omega \; ; \; \mathbf{x}\_1 q\_1 + \mathbf{x}\_2 q\_2 + \mathbf{s} = s\_{\text{in}} \} \tag{8}$$

is an invariant and attractive manifold for (1) for a given persistently exciting control (i.e., an admissible control function *<sup>D</sup>*(·) such that <sup>+</sup><sup>∞</sup> <sup>0</sup> *D*(*t*) *dt* = +∞).

**Proposition 2.** *For every initial condition <sup>X</sup>*<sup>0</sup> <sup>∈</sup> <sup>Ω</sup>*, there exists an admissible control <sup>D</sup>*(·) *and a time te* <sup>≥</sup> <sup>0</sup> *such that <sup>X</sup>*(*te*) ∈ T *, where <sup>X</sup>*(·) *is the unique solution of* (1)*, starting from <sup>X</sup>*0*, associated with D*(·)*.*

**Proof.** Let *<sup>s</sup>*† <sup>∈</sup> (0,*s*ˆ) and *<sup>X</sup>*<sup>0</sup> <sup>∈</sup> <sup>Ω</sup>. Without any loss of generality, we may assume that *s*(0) = *s*†. Indeed, observe that *s* = *s*† is not a steady-state of *s*˙ whenever *D* = 0 over R<sup>+</sup> or *D* = *Dmax* over R+. Thus, if we apply *D* = 0 (in that case *s*˙ < 0) or *D* = *Dmax* (in that case *s*˙ > 0), then *s*(*t*) = *s*† is reached in a finite horizon. Consider the feedback control function,

$$D^\dagger(x\_1, x\_2) := \frac{\rho\_1(s^\dagger)x\_1 + \rho\_2(s^\dagger)x\_2}{s\_{in} - s^\dagger},$$

in such a way that the unique solution of (1) associated with this control satisfies *s*(*t*) = *s*† for every time *t* ≥ 0 (Cauchy–Lipschitz's Theorem). We claim that there exists *t*<sup>1</sup> ≥ 0 large enough such that *<sup>D</sup>*†(*x*1(*t*), *<sup>x</sup>*2(*t*)) <sup>∈</sup> [0, *Dmax*] for every time *<sup>t</sup>* <sup>≥</sup> *<sup>t</sup>*1. Indeed, when *<sup>t</sup>* <sup>→</sup> <sup>+</sup>∞, taking into account (8), it follows:

$$D^\dagger(\mathbf{x}\_1(t), \mathbf{x}\_2(t)) \sim \mathcal{D}(t) := \frac{\rho\_1(\mathbf{s}^\dagger)\mathbf{x}\_1(t) + \rho\_2(\mathbf{s}^\dagger)\mathbf{x}\_2(t)}{\mathbf{x}\_1(t)q\_1(t) + \mathbf{x}\_2(t)q\_2(t)}.$$

Now, when *<sup>t</sup>* <sup>→</sup> <sup>+</sup>∞, it is easy to see that *<sup>q</sup>*1(*t*) converges to *<sup>ρ</sup>*1(*s*†) *μ*<sup>∞</sup> 1 + *k*1, since *q*<sup>1</sup> satisfies the linear ODE *q*˙ <sup>1</sup> + *μ*<sup>∞</sup> <sup>1</sup> *<sup>q</sup>*<sup>1</sup> <sup>=</sup> *<sup>ρ</sup>*1(*s*†) + *<sup>μ</sup>*<sup>∞</sup> <sup>1</sup> *k*1). At steady-state, we thus have

$$
\rho\_1(s^\dagger) = q\_1 \mu\_1(q\_1).
$$

In conclusion, when *t* → +∞,

$$D(t) \sim \frac{q\_1 \mu\_1(q\_1((t))x\_1(t) + q\_2(t)\mu\_2(q\_2(t))x\_2(t)}{x\_1(t)q\_1(t) + x\_2(t)q\_2(t)}\epsilon$$

or, equivalently, using that, at steady state, *s*† = *ρ*−<sup>1</sup> <sup>1</sup> (*q*1*μ*1(*q*1)) that is, *<sup>q</sup>*<sup>1</sup> <sup>=</sup> *<sup>δ</sup>*−<sup>1</sup> *<sup>i</sup>* (*s*†), we end up with

$$
\bar{D}(t) \sim \frac{\mu\_1(\delta\_1^{-1}(\mathbf{s}^\dagger))q\_1(t)\mathbf{x}\_1(t) + \mu\_2(\delta\_2^{-1}(\mathbf{s}^\dagger))q\_2(t)\mathbf{x}\_2(t)}{\mathbf{x}\_1(t)q\_1(t) + \mathbf{x}\_2(t)q\_2(t)}.
$$

Thanks to Assumption 3, this last expression is upper bounded by *Dmax* for *t* large enough, which proves our claim. Finally, posit *yi* := ln(*xi*) and observe that

$$
\dot{y}\_1 - \dot{y}\_2 = \Lambda(s^\dagger) > 0.
$$

It follows that *<sup>y</sup>*1(*t*) <sup>−</sup> *<sup>y</sup>*2(*t*) <sup>→</sup> <sup>+</sup><sup>∞</sup> when *<sup>t</sup>* <sup>→</sup> <sup>+</sup>∞, which implies that lim*t*→+<sup>∞</sup> *<sup>x</sup>*2(*t*) *<sup>x</sup>*1(*t*) <sup>=</sup> 0. This ends the proof.

#### *2.5. Motivation of Studying the OCP*

Thanks to Proposition 2, the target set is reachable from any initial condition, thus the existence of an optimal control of (6) is standard (namely because the dynamics is affine w.r.t. the control): it is an application of the Fillipov Theorem, see, e.g., [26–28]. Considering such a control as in the proof of Proposition 2 then indeed allows the system to let the species of interest dominate the reactor, but this process can be long (see, for instance, Example 1). Another possible strategy is to use a constant control *D*. Following [12], depending on the value of *D*, species 1 may win the competition, i.e.,

$$\lim\_{t \to +\infty} x\_1(t) > 0 \quad ; \quad \lim\_{t \to +\infty} x\_2(t) = 0.$$

In that case, this (simple) strategy indeed allows for reaching the target. However, this convergence is asymptotic and depends on the value of *D* as in the competitive exclusion principle. Roughly speaking, if *D* > *μ*1(*q*˜1) (where *q*˜1 and *s*† are such that *q*˜1 := *δ*−<sup>1</sup> <sup>1</sup> (*s*†) and (*μ*<sup>1</sup> ◦ *<sup>δ</sup>*−<sup>1</sup> <sup>1</sup> )(*s*†)=(*μ*<sup>2</sup> ◦ *<sup>δ</sup>*−<sup>1</sup> <sup>2</sup> )(*s*†)), then species 2 wins the competition, whereas, if *D* < *μ*1(*q*˜1), species 1 wins the competition. We refer to [12] for more details about the asymptotic behavior of (1) for a constant control *D*. Thus, the target set may not always be reachable with a constant control *D*. Our objective in this paper is precisely to propose a methodology to compute a control strategy to reach the target set T faster, playing on the control *D*(·) as illustrated in Figure 2.

**Example 1.** *Let us consider the following parameters: ρ*1*<sup>m</sup>* = 0.8*, ρ*2*<sup>m</sup>* = 0.95*, Ks*<sup>1</sup> = 1*, Ks*<sup>2</sup> = 1.4*, k*<sup>1</sup> = 1.1*, k*<sup>2</sup> = 1.4*, μ*1<sup>∞</sup> = 1.8*, μ*2<sup>∞</sup> = 1.7*, sin* = 10*. The contamination rate is fixed to ε* = 0.05*. The initial conditions are given by: s*<sup>0</sup> = 2*, q*<sup>0</sup> *<sup>i</sup>* = 2.5 *and <sup>x</sup>*<sup>0</sup> *<sup>i</sup>* = 1*. As illustrated in Figure 2, the target* T *is reached after tf* = 46.774 *days using the control D*(*t*) = *Dopt, while x*<sup>1</sup> *dominates the culture after tf* = 62.68 *days using the constant control D* = 0.48*. Let us also point out*

*that, using an arbitrary constant control D* ∈ [0, *D*max]*, we are not even sure that x*<sup>1</sup> *wins the competition (trajectories do not reach the target in that case).*

**Figure 2.** It is possible to find a constant feeding strategy *D* ∈ [0, *D*max] that could favor one species or the other. However, this is a risky time-consuming process, while the target is reached much faster using an optimized control *Dopt*, thus saving several days of costly cultures.

#### **3. Necessary Conditions on Optimal Controls**

We start this section by generalizing previously obtained results [22,29] characterizing optimal solutions of (6). For that, we apply the PMP which allows for obtaining necessary conditions satisfied by optimal controls of (6). We denote by *X* = (*s*, *q*1, *x*1, *q*2, *x*2) and *λ* = (*λs*, *λq*<sup>1</sup> , *λx*<sup>1</sup> , *λq*<sup>2</sup> , *λx*<sup>2</sup> ), respectively, the state and adjoint variables (also called co-state or covector). The Hamiltonian associated with the optimal control problem

$$H = H(\mathbf{s}, q\_1, \mathbf{x}\_1, q\_2, \mathbf{x}\_2, \lambda\_{\mathbf{s}\prime}, \lambda\_{q\_1\prime}, \lambda\_{\mathbf{x}\_1\prime}, \lambda\_{q\_2\prime}, \lambda\_{\mathbf{x}\_2\prime}, \lambda^0, D),$$

is given by

$$\begin{aligned} H &= \quad \lambda^0 - (\rho\_1(s)\mathbf{x}\_1 + \rho\_2(s)\mathbf{x}\_2)\lambda\_\delta + (\rho\_1(s) - \mu\_1(q\_1)q\_1)\lambda\_{q\_1} + \mu\_1(q\_1)\mathbf{x}\_1\lambda\_{\mathbf{x}\_1} \\ &+ (\rho\_2(s) - \mu\_2(q\_2)q\_2)\lambda\_{q\_2} + \mu\_2(q\_2)\mathbf{x}\_2\lambda\_{\mathbf{x}\_2} + D[(s\_{\mathrm{int}} - s)\lambda\_\delta - \mathbf{x}\_1\lambda\_{\mathbf{x}\_1} - \mathbf{x}\_2\lambda\_{\mathbf{x}\_2}]. \end{aligned}$$

Let *<sup>X</sup>*<sup>0</sup> <sup>∈</sup> <sup>Ω</sup>\T and let (*X*(·), *<sup>u</sup>*(·)) be an optimal pair such that *<sup>X</sup>*(·) reaches the set T in a time *tf* ≥ 0. Thanks to the PMP, there exist an absolutely-continuous map *<sup>λ</sup>* : [0, *tf* ] <sup>→</sup> <sup>R</sup><sup>5</sup> and *<sup>λ</sup>*<sup>0</sup> <sup>≤</sup> 0 such that:


$$
\lambda(t) = -\nabla\_X H(X(t), \lambda(t), \lambda^0, D(t)) \quad \text{a.e.} \ t \in [0, t\_f]. \tag{9}
$$

• The Hamiltonian maximization condition writes

$$D(t) \in \arg\max\_{\mathbb{Q}\in[0,D\_{\text{max}}]} H(X(t), \lambda(t), \lambda^0, \xi^0) \quad \text{a.e.} \ t \in [0, t\_f]. \tag{10}$$

• At the terminal time, the transversality condition writes:

$$
\lambda(t\_f) \in -N\_{\mathcal{T}}(X(t\_f)).\tag{11}
$$

Here, *<sup>N</sup>*<sup>T</sup> (*X*) = {*<sup>p</sup>* <sup>∈</sup> <sup>R</sup><sup>5</sup> ; <sup>∀</sup>*<sup>Y</sup>* ∈ T , *<sup>p</sup>* · (*<sup>Y</sup>* <sup>−</sup> *<sup>X</sup>*) <sup>≤</sup> <sup>0</sup>} stands for the normal cone to <sup>T</sup> at some point *X* ∈ T , see [28]. The adjoint Equation (9) is equivalent to:

$$\begin{cases} \dot{\lambda}\_{s} = & \left(\rho\_{1}'(s)\mathbf{x}\_{1} + \rho\_{2}'(s)\mathbf{x}\_{2}\right)\lambda\_{s} - \rho\_{1}'(s)\lambda\_{q\_{1}} - \rho\_{2}'(s)\lambda\_{q\_{2}} + D\lambda\_{s}, \\ \quad \lambda\_{q\_{1}} = & \mu\_{1\infty}\lambda\_{q\_{1}} - \mu\_{1}'(q\_{1})\mathbf{x}\_{1}\lambda\_{\mathbf{x}\_{1^{s}}} \\ \quad \dot{\lambda}\_{\mathbf{x}\_{1}} = & \rho\_{1}(s)\lambda\_{s} - \mu\_{1}(q\_{1})\lambda\_{\mathbf{x}\_{1}} + D\lambda\_{\mathbf{x}\_{1^{s}}} \\ \quad \lambda\_{q\_{2}} = & \mu\_{2\infty}\lambda\_{q\_{2}} - \mu\_{2}'(q\_{2})\mathbf{x}\_{2}\lambda\_{\mathbf{x}\_{2^{s}}} \\ \quad \dot{\lambda}\_{\mathbf{x}\_{2}} = & \rho\_{2}(s)\lambda\_{s} - \mu\_{2}(q\_{2})\lambda\_{\mathbf{x}\_{2}} + D\lambda\_{\mathbf{x}\_{2^{s}}}. \end{cases} \tag{12}$$

We define an extremal as a quadruplet (*X*(·), *<sup>λ</sup>*(·), *<sup>λ</sup>*0, *<sup>D</sup>*(·)) such that (*λ*(·), *<sup>λ</sup>*0) is non zero and such that (1) and (9)–(11) is verified. Whenever *λ*<sup>0</sup> = 0, we say that the extremal is *abnormal* ; if *<sup>λ</sup>*<sup>0</sup> <sup>=</sup> 0, then we say that the extremal is *normal*. Because (6) is autonomous (i.e., the system does not depend explicitly on time), the Hamiltonian computed along an extremal is constant. In addition, since the terminal time is not fixed, we classically obtain, following optimal control theory, that *H* = 0.

The transversality condition is crucial for obtaining properties on optimal controls by reasoning backward in time from the terminal time *t* = *tf* . We shall next extend earlier results [22] by taking into account explicitly the fact that <sup>T</sup> is a half-space of <sup>R</sup><sup>5</sup> and exploiting that *<sup>X</sup>*(*tf*) belongs to the set *<sup>E</sup>* :<sup>=</sup> {*<sup>X</sup>* <sup>∈</sup> <sup>R</sup><sup>5</sup> ; *<sup>x</sup>*<sup>2</sup> <sup>−</sup> *<sup>ε</sup>x*<sup>1</sup> <sup>=</sup> <sup>0</sup>} (the boundary of the target set). Then, condition (11) can be transformed more explicitly as follows. At *X*(*tf*), the normal cone to T writes

$$N\_{\mathcal{T}}(X(t\_f)) = \mathbb{R}\_+(0, 0, -\varepsilon, 0, 1).$$

Therefore, inclusion (11) is then equivalent to

$$
\lambda\_s(t\_f) = \lambda\_{\mathbb{q}\_1}(t\_f) = \lambda\_{\mathbb{q}\_2}(t\_f) = 0,\tag{13}
$$

together with

$$
\lambda\_{x\_1}(t\_f) + \varepsilon \lambda\_{x\_2}(t\_f) = 0,\tag{14}
$$

and the inequalities *λx*<sup>1</sup> (*tf*) ≥ 0 and *λx*<sup>2</sup> (*tf*) ≤ 0. Actually, one has *λx*<sup>1</sup> (*tf*) > 0 and *λx*<sup>2</sup> (*tf*) < 0. Suppose indeed that *λx*<sup>1</sup> (*tf*) = 0. Then, (14) would imply *λx*<sup>2</sup> (*tf*) = 0, and, since (9) is linear w.r.t. *λ*, we would obtain *λ* ≡ 0 over [0, *tf* ]. Using the constancy of *H*, we would also obtain *λ*<sup>0</sup> = 0 contradicting the PMP. We can then conclude that

$$
\lambda\_{x\_1}(t\_f) > 0 \quad \text{and} \quad \lambda\_{x\_2}(t\_f) < 0. \tag{15}
$$

Throughout the paper, we suppose that only normal extremals occur, i.e., *λ*<sup>0</sup> < 0, and, without any loss of generality, we may assume that *<sup>λ</sup>*<sup>0</sup> <sup>=</sup> <sup>−</sup>1 (up to a renormalization of the necessary conditions that are linear w.r.t. *λ*).

**Remark 1.** *Abnormal extremals are not generic. They correspond to the optimal path reaching the target set in some particular subset of the target set and are such that <sup>λ</sup>*<sup>0</sup> <sup>=</sup> <sup>0</sup> *(and thus <sup>λ</sup>*(·) <sup>=</sup> <sup>0</sup>*). From the conservation of H, this implies that μ*1(*q*1(*tf*)) = *μ*2(*q*2(*tf*)) *in such a way that λ*(*tf*) *is not uniquely defined in contrast with the normal case (see below). At such a singular point, the value function (the minimal time as a function of X*0*) is also non-differentiable.*

Going back to the normal case, i.e., *<sup>λ</sup>*<sup>0</sup> <sup>=</sup> <sup>−</sup>1, the covector *<sup>λ</sup>* at *<sup>t</sup>* <sup>=</sup> *tf* can be completely determined (thanks to the conservation of *H*) as follows:

$$\begin{aligned} \lambda\_s(t\_f) &= \lambda\_{q\_1}(t\_f) = \lambda\_{q\_2}(t\_f) = 0, \\ \lambda\_{x\_1}(t\_f) &= \frac{1}{x\_1(t\_f)(\mu\_1(q\_1(t\_f)) - \mu\_2(q\_2(t\_f)))} > 0, \\ \lambda\_{x\_2}(t\_f) &= -\frac{\lambda\_{x\_1}(t\_f)}{\varepsilon} < 0. \end{aligned} \tag{16}$$

Notice that the quantity *μ*1(*q*1(*tf*)) − *μ*2(*q*2(*tf*))) is non-zero along a normal extremal. As a consequence, the transversality condition (11) coupled with the conservation of *H* are equivalent to (16). The computation of *λ* at *t* = *tf* is useful to integrate the state adjoint system backward in time from the target set.

We now wish to exploit the Hamiltonian condition (10). It is of particular interest to introduce the *switching function,* which allows us to determine the optimal control *D* according to the sign of the switching function. For that, let us denote by Φ˜ the switching function:

$$\bar{\Phi} := -(\varkappa\_1 \lambda\_{x\_1} + \varkappa\_2 \lambda\_{x\_2}) + (s\_{\text{in}} - s)\lambda\_{s\_{\text{in}}}$$

associated with the control function *D*(·).

$$\begin{array}{ccccc}\Phi(t)>0 & \Rightarrow & D(t)=D\_{\text{max}},\\\bar{\Phi}(t)<0 & \Rightarrow & D(t)=0,\end{array} \tag{17}$$

for a.e. *t* ∈ [0, *tf* ].

In the case where Φ˜ > 0, resp. Φ˜ < 0 over a time interval [*t*1, *t*2], we say that the optimal control *<sup>u</sup>* is of bang type (denoted by *<sup>B</sup>*+, resp. *<sup>B</sup>*−). When the control *<sup>D</sup>*(·) is non-constant in every neighborhood of a time *tc* ∈ (0, *tc*), we say that *tc* is a *switching time*, and one must have Φ˜ (*tc*) = 0. Next, when the switching function Φ˜ vanishes over a time-interval [*t*1, *t*2], we state that a *singular arc* occurs. In this case, the corresponding trajectory is *singular* over [*t*1, *t*2], and such an arc will be denoted by S. Singular arcs are essential to optimize the time to steer an initial condition to the target set. Now, we are ready to state some main features of the switching function Φ˜ , and then investigate properties of the singular paths.

#### **Lemma 1.**

*(i) The function* Φ˜ *is continuously differentiable over* [0, *tf* ] *and, moreover,*

$$\dot{\Phi} = (s\_{in} - s)(\rho\_1'(s)[\mathbf{x}\_1 \lambda\_s - \lambda\_{q\_1}] + \rho\_2'(s)[\mathbf{x}\_2 \lambda\_s - \lambda\_{q\_2}]).\tag{18}$$

*(ii) At the terminal time t* = *tf , it holds:*

$$
\Phi(t\_f) = \dot{\Phi}(t\_f) = 0.\tag{19}
$$

**Proof.** By differentiating Φ˜ w.r.t. *t*, we find that

$$\dot{\Phi} = -\dot{s}\lambda\_s + (s\_{\text{in}} - s)\lambda\_s - [\dot{x}\_1\lambda\_{\text{x}\_1} + \dot{x}\_2\lambda\_{\text{x}\_2}].$$

Using (1) and (9), we obtain (18), which proves (i). For proving (ii), note that *x*(*tf*) ∈ *E* and *<sup>λ</sup>*(*tf*) <sup>∈</sup> *<sup>E</sup>*⊥, thus <sup>Φ</sup>˜ (*tf*) = 0. Using (13), we also obtain ˙ Φ˜ (*tf*) = 0, which ends the proof.

**Remark 2.** *Following the formalism of geometric control theory,* ˙ Φ˜ *never involves D explicitly, but <sup>D</sup> is present in the expression of* <sup>Φ</sup>˜ (2*k*)*, <sup>k</sup>* <sup>≥</sup> <sup>1</sup>*, see [27]. If <sup>k</sup>* <sup>≥</sup> <sup>1</sup> *is the first integer for which the control is present in the expression of* Φ˜ (2*k*)*, we usually say that the singular arc is of order k.*

At this step, an optimal control is a concatenation of bang and singular arcs:

$$
\mathcal{B}\_{\pm}, \mathcal{B}\_{\pm}\mathcal{B}\_{\mp}, \mathcal{B}\_{\pm}\mathcal{S}, \mathcal{B}\_{\pm}\mathcal{B}\_{\mp}\mathcal{S}, \mathcal{B}\_{\pm}\mathcal{B}\_{\mp}\mathcal{B}\_{\mp}\mathcal{S}\mathcal{B}\_{\pm}, \dots
$$

with possibly infinitely many crossing times (in particular, if there is a singular arc of order 2 [27]). The occurrence and properties of singular arcs as well as the various (possible) structure for an optimal control of (6) will be precisely the matter of the next section. The goal is to reduce (if possible) the number of possible structures for an optimal control.

#### **4. Singular Arcs and Insights into Optimal Solutions**

*4.1. Legendre–Clsebsch's Necessary Condition and Computation of the Singular Control*

The analysis of singular arcs requires to compute ¨ Φ˜ . Indeed, the Hamiltonian condition does not give any information about an optimal control during a singular phase. Thanks to the next computations, we shall also be able to deduce an expression of the singular control during a singular arc.

Doing so, let us define *<sup>θ</sup>*1, *<sup>θ</sup>*<sup>2</sup> : [0, *<sup>T</sup>*] <sup>→</sup> <sup>R</sup> as

$$\begin{aligned} \theta\_1 &:= \rho\_1'(s)[\mathbf{x}\_1 \boldsymbol{\lambda}\_s - \boldsymbol{\lambda}\_{q\_1}] + \rho\_2'(s)[\mathbf{x}\_2 \boldsymbol{\lambda}\_s - \boldsymbol{\lambda}\_{q\_2}], \\ \theta\_2 &:= \rho\_1''(s)[\mathbf{x}\_1 \boldsymbol{\lambda}\_s - \boldsymbol{\lambda}\_{q\_1}] + \rho\_2''(s)[\mathbf{x}\_2 \boldsymbol{\lambda}\_s - \boldsymbol{\lambda}\_{q\_2}]. \end{aligned}$$

Hereafter, to simplify the layout, we do not write the dependency of *θi*, *s*, *xi*, *λs*, *λqi* w.r.t. the time. To shorten the notation, we also do not write explicitly the dependency of certain functions w.r.t. some variables. Using (12)–(18), one can write

$$
\dot{\Phi} = (s\_{\text{in}} - s)\theta\_1 \quad \text{and} \quad \dot{\lambda}\_s = \theta\_1 + D\lambda\_s. \tag{20}
$$

#### **Lemma 2.**

*(i) The derivative of θ*<sup>1</sup> *can be expressed as:*

$$\begin{split} \dot{\theta}\_{1} &= \theta\_{2}\dot{s} + \left[\rho\_{1}^{\prime}\mathbf{x}\_{1} + \rho\_{2}^{\prime}\mathbf{x}\_{2}\right]\theta\_{1} + \lambda\_{s}\left[\mathbf{x}\_{1}\mu\_{1}\rho\_{1}^{\prime} + \mathbf{x}\_{2}\mu\_{2}\rho\_{2}^{\prime}\right] \\ &- \rho\_{1}^{\prime}\left[\mu\_{1\infty}\lambda\_{q\_{1}} - \mu\_{1}^{\prime}(q\_{1})\mathbf{x}\_{1}\lambda\_{\mathbf{x}\_{1}}\right] - \rho\_{2}^{\prime}\left[\mu\_{2\infty}\lambda\_{q\_{2}} - \mu\_{2}^{\prime}(q\_{2})\mathbf{x}\_{2}\lambda\_{\mathbf{x}\_{2}}\right]. \end{split} \tag{21}$$

*(ii) The second derivative of* Φ˜ *fulfills the equality:*

$$
\begin{split}
\dot{\Phi} &= [-\theta\_1 + (s\_{in} - s)\theta\_2]\dot{s} + (s\_{in} - s)[\rho\_1' \mathbf{x}\_1 + \rho\_2' \mathbf{x}\_2]\theta\_1 + (s\_{in} - s)\lambda\_s [\mathbf{x}\_1 \mu\_1 \rho\_1' + \mathbf{x}\_2 \mu\_2 \rho\_2'] \\ &- (s\_{in} - s)\rho\_1' [\mu\_{1\infty} \lambda\_{q\_1} - \mu\_1'(q\_1) \mathbf{x}\_1 \lambda\_{x\_1}] - (s\_{in} - s)\rho\_2' [\mu\_{2\infty} \lambda\_{q\_2} - \mu\_2'(q\_2) \mathbf{x}\_2 \lambda\_{x\_2}].
\end{split}
\tag{22}
$$

**Proof.** By differentiating *θ*<sup>1</sup> w.r.t. *t*, we have

$$\dot{\theta}\_1 = \theta\_2 \dot{\mathfrak{s}} + \rho\_1' [\dot{\mathfrak{x}}\_1 \lambda\_{\mathfrak{s}} + \mathfrak{x}\_1 \dot{\lambda}\_{\mathfrak{s}} - \dot{\lambda}\_{q\_1}] + \rho\_2' [\dot{\mathfrak{x}}\_2 \lambda\_{\mathfrak{s}} + \mathfrak{x}\_2 \dot{\lambda}\_{\mathfrak{s}} - \dot{\lambda}\_{q\_2}].$$

Using (20) and (12), we obtain (21). Using that ¨ <sup>Φ</sup>˜ <sup>=</sup> <sup>−</sup>*s*˙*θ*<sup>1</sup> + (*sin* <sup>−</sup> *<sup>s</sup>*) ˙ *θ*1, we obtain (22).

Note that these computations have been verified thanks to a symbolic computation software. The next step is to establish whether Legendre–Clebsch's condition is verified or not along a singular arc. Recall that this condition is necessary for optimality and that it can be stated as follows (see, e.g., [27,30,31]).

**Theorem 1** (Legendre–Clebsch's condition [27])**.** *Let I* = [*t*1, *t*2] *be such that the trajectory is singular over* [*t*1, *t*2]*. Then, one has:* ¨

$$
\tilde{\Phi}\_{|\_D} \ge 0,
$$

*which is fulfilled over I* = [*t*1, *t*2]*.*

Using the expression of the derivative ¨ Φ˜ given in (22), we provide in the next lemma the expression of the second derivative, ¨ <sup>Φ</sup>˜ <sup>|</sup>*<sup>D</sup>* .

**Lemma 3.** *Let I* = [*t*1, *t*2] *be such that the trajectory is singular over* [*t*1, *t*2]*. Then, one has:*

$$\check{\Phi}\_{\vert\_{D}} = (s\_{in} - s)^2 \theta\_2 = (\mathbf{x}\_1 \boldsymbol{\lambda}\_s - \boldsymbol{\lambda}\_{q\_1}) \frac{(\rho\_1'' \rho\_2' - \rho\_2'' \rho\_1')}{\rho\_2'}.\tag{24}$$

**Proof.** In (22), the only term involving the control *D* is related to *s*˙. We obtain (24) using that *θ*<sup>1</sup> ≡ 0 over [*t*1, *t*2].

**Proposition 3.** *Along a singular arc that occurs over a time interval* [*tc*, *tf* ]*, it holds that:*

$$\lambda\_s = 0,$$

*over* [*tc*, *tf* ] *and Legendre–Clebsch's condition (with a strict inequality) is fulfilled over* [*tc*, *tf*)*.*

**Proof.** Because the trajectory is singular over [*tc*, *tf* ], one has *θ*<sup>1</sup> ≡ 0 over this interval; thus, *λs*(·) satisfies:

$$
\lambda\_s = D \lambda\_{s\prime} \quad \lambda\_s(t\_f) = 0.
$$

It follows that *λ<sup>s</sup>* ≡ 0 over [*tc*, *tf* ]. In a left neighborhood of *t* = *tf* , one has from (12) *<sup>λ</sup>*˙ *<sup>q</sup>*<sup>1</sup> < 0; thus, since *<sup>λ</sup>q*<sup>1</sup> vanishes at *<sup>t</sup>* = *tf* , we necessarily have *<sup>λ</sup>q*<sup>1</sup> > 0 in a left neighborhood of *tf* . Because *λ<sup>s</sup>* is zero over [*tc*, *tf* ], we deduce that *x*1*λ<sup>s</sup>* − *λq*<sup>1</sup> = −*λq*<sup>1</sup> < 0 over [*tc*, *tf*) (at *<sup>t</sup>* <sup>=</sup> *tf* , *<sup>λ</sup>q*<sup>1</sup> vanishes at *tf* , as well as ¨ <sup>Φ</sup>˜ <sup>|</sup>*<sup>D</sup>* ). Over [*tc*, *tf* ], we note that

$$
\lambda\_{x\_1} = \lambda\_{x\_1} (D - \mu\_1(q\_1))\_{\prime \prime}
$$

hence *λx*<sup>1</sup> does not vanish over [*tc*, *tf* ]. Suppose that *λq*<sup>1</sup> vanishes over [*tc*, *tf* ] at a time *t* <sup>∈</sup> [*tc*, *tf* ]. Then, one must have *<sup>λ</sup>*˙ *<sup>q</sup>*<sup>1</sup> (*<sup>t</sup>* ) ≥ 0 since *λq*<sup>1</sup> > 0 over (*t* , *tf*). However, at *t* = *t* , the adjoint equation implies that

$$\dot{\lambda}\_{\neq 1}(t') = -\mu\_1'(q\_1(t'))\,\mathbf{x}\_1(t')\,\lambda\_{\mathbf{x}\_1}(t') < 0$$

because *q*1(*t* ) > *k*1, *μ* <sup>1</sup> > 0 over (*k*1, +∞), *x*<sup>1</sup> > 0, and *λx*<sup>1</sup> > 0 over [*tc*, *tf* ]. This is a contradiction and thus *λq*<sup>1</sup> does not vanish over *tc*, *tf* . Assumption 1 implies that *ρ* <sup>1</sup> *ρ* 2 − *ρ* <sup>2</sup> *ρ* <sup>1</sup> <sup>&</sup>lt; 0, thus ¨ <sup>Φ</sup>˜ <sup>|</sup>*<sup>D</sup>* <sup>&</sup>gt; 0 over [*tc*, *tf*) as desired. We can then conclude that Legendre– Clebsch's condition (with a strict inequality) is fulfilled over the whole interval [*tc*, *tf*).

A consequence of the previous proposition is that, when a singular arc occurs over some time interval [*tc*, *tf* ], then it is of order 1. Based on this proposition, we shall only consider singular arcs of first order in the remaining of the paper. If Legendre–Clebsch's condition holds true, the singular arc is said to be of turnpike type [26]. The expression defining the singular control can then be derived using (22). Next, let *ς*(*X*, *λ*) be defined by:

$$\begin{split} \xi(X,\lambda) := & \theta\_2[\rho\_1 \mathbf{x}\_1 + \rho\_2 \mathbf{x}\_2] - \lambda\_5(\mathbf{x}\_1 \mu\_1 \rho\_1' + \mathbf{x}\_2 \mu\_2 \rho\_2') - \rho\_1'[\mu\_{1\infty}\lambda\_{q\_1} - \mu\_1'(q\_1)\mathbf{x}\_1 \lambda\_{\mathbf{x}\_1}] \\ & - \rho\_2'[\mu\_{2\infty}\lambda\_{q\_2} - \mu\_2'(q\_2)\mathbf{x}\_2 \lambda\_{\mathbf{x}\_2}]. \end{split} \tag{25}$$

We now give an expression of the singular control as a feedback of the state and covector.

**Proposition 4.** *Suppose that an extremal is singular over* [*t*1, *t*2] *and that* (23) *is verified over* [*t*1, *t*2] *with a strict inequality. Then, the singular control Ds is given by*

$$D\_{\mathfrak{s}}(X,\lambda) := \frac{\mathfrak{s}(X,\lambda)}{(s\_{\mathrm{in}} - \mathrm{s})\theta\_2},\tag{26}$$

*where we recall that θ*<sup>2</sup> = *ρ* <sup>1</sup> (*s*)[*x*1*λ<sup>s</sup>* − *λq*<sup>1</sup> ] + *ρ* <sup>2</sup> (*s*)[*x*2*λ<sup>s</sup>* − *λq*<sup>2</sup> ] *and ς is given by* (25)*.*

**Proof.** This expression follows from (22) in which *s*˙ is replaced by (*sin* − *s*)*D* − *ρ*1*x*<sup>1</sup> − *ρ*2*x*<sup>2</sup> and *<sup>θ</sup>*<sup>1</sup> <sup>≡</sup> 0 (since ˙ Φ˜ = Φ˜ = 0).

**Corollary 1.** *If the singular arc occurs over some time interval* [*tc*, *tf*)*, expression* (26) *simplifies into*

$$D\_s(X, \lambda) := \frac{\xi(X, \lambda)}{(s\_{in} - s)\theta\_2},\tag{27}$$

*where ς*˜ *is given by*

$$\xi(X,\lambda) := \theta\_2[\rho\_1\mathbf{x}\_1 + \rho\_2\mathbf{x}\_2] - \rho\_1'[\mu\_{1\infty}\lambda\_{\eta\_1} - \mu\_1'(q\_1)\mathbf{x}\_1\lambda\_{\mathbf{x}\_1}] - \rho\_2'[\mu\_{2\infty}\lambda\_{\eta\_2} - \mu\_2'(q\_2)\mathbf{x}\_2\lambda\_{\mathbf{x}\_2}],$$

*and, in this case, θ*<sup>2</sup> *simplifies also into θ*<sup>2</sup> = −*ρ* <sup>1</sup> *λq*<sup>1</sup> − *ρ* <sup>2</sup> *λq*<sup>2</sup> *because λ<sup>s</sup>* ≡ 0*.*

#### **Remark 3.**


#### *4.2. About the Occurrence of a Terminal Singular Arc at the Terminal Time*

The aim of this section is to discuss the possibility of having a singular arc over some time interval [*tf* − *τ*, *tf* ] (with *τ* > 0) and the structure of optimal controls. Our main questioning is as follows:

Does any optimal trajectory contain a singular arc over some time interval [*tf* − *τ*, *tf* ]?

To analyze this point, let us summarize properties of the switching function at *t* = *tf* (that are consequences of transversality conditions associated with the codimension 1 target):

• The switching function and its derivative vanish at *t* = *tf* :

$$
\dot{\Phi}(t\_f) = \bar{\Phi}(t\_f) = 0. \tag{28}
$$

• The second derivative of the switching function satisfies:

$$
\ddot{\Phi}\_{|\_D}(t\_f) = 0.\tag{29}
$$

• In addition, Legendre–Clebsch's condition (23) is always satisfied along a singular arc defined in a left neighborhood of the terminal time *t* = *tf* .

The necessary conditions (28) and (29) are a very good indication for the occurrence of a singular arc and are thus strong arguments to answer positively to the above question. Thus, we could now wonder whether or not conditions (28) and (29) are sufficient to ensure the occurrence of a singular arc in some time interval [*tf* − *τ*, *tf* ]. It appears that this question is complex and falls into the setting of geometric optimal control theory. As far as we know, such conditions are not equivalent to the occurrence of a singular arc over some time interval [*tf* − *τ*, *tf* ] (this may depend, in particular, on the initial condition). It is, however, worth mentioning that these conditions (in particular (28)) are commonly used numerically to implement a singular arc in shooting methods [32]. In our context of Droop model, it is very interesting to notice that singular arcs are the cornerstone of the optimal control, in particular for a large set of initial conditions that are biologically meaningful (typically for heterogeneous cultures where *x*<sup>0</sup> 1/*x*<sup>0</sup> <sup>2</sup> ≈ 1). However, the answer to the above question is not always true and depends on the initial condition (as it has been confirmed using direct optimization methods, see Section 5). Indeed, as illustrated in Example 2—Section 5, when the initial conditions *x*<sup>0</sup> *<sup>i</sup>* are taken very close to the target (*x*2(*tf*)/*x*1(*tf*) = *ε*), and *μ*1(*q*<sup>0</sup> <sup>1</sup>) <sup>−</sup> *<sup>μ</sup>*2(*q*<sup>0</sup> <sup>2</sup>) > 0, the singular arc does not appear or appears marginally at *t* = *tf* to satisfy the transversality conditions.

Recall that <sup>Φ</sup>˜ (*tf*) = ˙ <sup>Φ</sup>˜ (*tf*) = 0. Hence, the sign of <sup>Φ</sup>˜ depends on ¨ Φ˜ (*tf*) that is computed in the next lemma.

**Lemma 4.** *At the terminal time, one has*

$$
\mu\_1(q\_1(t\_f)) - \mu\_2(q\_2(t\_f)) > 0. \tag{30}
$$

*In addition, the second derivative of the switching function exists at t* = *tf and:*

$$\tilde{\Phi}(t\_f) = \frac{[s\_{in} - s(t\_f)][\rho\_2'(s(t\_f))\mu\_2'(q\_2(t\_f)) - \rho\_1'(s(t\_f))\mu\_1'(q\_1(t\_f))]}{\mu\_2(q\_2(t\_f)) - \mu\_1(q\_1(t\_f))}.\tag{31}$$

**Proof.** Inequality (30) follows from the expression of *λ*(*tf*) and the transversality condition (16). The expression of ¨ Φ˜ (*tf*) in (31) follows from (22).

We can now define the function:

$$t \mapsto \mathfrak{z}(t) := \rho\_2'(s(t))\mu\_2'(q\_2(t)) - \rho\_1'(s(t))\mu\_1'(q\_1(t)).$$

From the previous lemma, we deduce the behavior of an optimal path near the terminal time:


$$D(t) = \text{sign}(\xi(t)).$$

• If a singular arc occurs in a left neighborhood of *t* = *tf* , then one must have *ξ*(*tf*) = 0, i.e., a singular arc reaches the target in the subset of T defined as:

$$\begin{aligned} \mathcal{T}' := \{ X = (s, q\_1, \mathbf{x}\_1, q\_2, \mathbf{x}\_2) \in \mathcal{T} \; ; \; \mu\_1(q\_1) - \mu\_2(q\_2) > 0 \text{ and} \\ \rho\_2'(\mathbf{s}) \mu\_2'(q\_2) - \rho\_1'(\mathbf{s}) \mu\_1'(q\_1) &= 0 \}. \end{aligned}$$

#### *4.3. Toward an Optimal Synthesis Characterizing the Optimal Solutions*

Reducing the number of switching times is in general non-tractable for nonlinear optimal control problems governed by a system in dimension greater than three. Nevertheless, thanks to the properties of singular arcs, we obtained previously and of the switching function at *t* = *tf* , we can expect a limited number of possible structures for an optimal control as we formulate in the next conjecture.

**Conjecture 1.** *Every initial condition in* Ω *is steered optimally to the target set via a control D that has a finite number of switching times. In addition, for almost every initial condition, an optimal control presents the following structure:*

$$B \pm B \pm \mathcal{S} \dots$$

*For a large set of initial conditions in some subset* <sup>Ω</sup>† <sup>⊂</sup> <sup>Ω</sup> *(far from the target), there is a single bang arc and a terminal singular arc, whereas, for some initial conditions close to the target set, no singular arc occurs (i.e.,* S *is of zero duration).*

This conjecture has been verified numerically for a large number of initial conditions (see Section 5). Our argumentation to confirm this conjecture is as follows.

• From the PMP, we have seen that, for every initial condition in Ω, an optimal control is a concatenation of bang arcs B± and singular arcs S.

Moreover, since the switching function Φ˜ satisfies the strong requirements ˙ Φ˜ (*tf*) = <sup>Φ</sup>˜ (*tf*) = 0, ¨ <sup>Φ</sup>˜ <sup>|</sup>*<sup>D</sup>* (*tf*) = <sup>0</sup>

(from the transversality conditions) as well as Legendre–Clebsch's condition, we conjecture that, for almost all initial conditions, an optimal control is singular in a left neighborhood of the terminal time. This implies in particular that the number of switchings is finite since we proved that any terminal singular arc is of first order. In addition, the number of switchings is minimal in general (apart when chattering

occurs, see [27], which is not the case here). Thus, an optimal control should be of type *B*±*B*∓S with one or two bang arcs before the terminal singular arc.

As we have seen, we also must have *ξ*(*tf*) = 0, which only involves state variables at the terminal time. This surprising condition mixing the first derivative of the basic functions in the Droop model, with the *s* variable on one side and the *qi* variables on the other side, is, however, hard to interpret biologically.

• For some marginal—-but admissible—initial conditions outside of Ω†, the structure of an optimal control of (6) may be of bang type for almost all *t* ∈ [0, *tf*), or [0, *tf* − *τ*], with very small *τ* > 0 (see, e.g., Example 2 in the next section). This is the case when typically *x*<sup>0</sup> <sup>1</sup> *<sup>x</sup>*<sup>0</sup> <sup>2</sup>, i.e., the initial condition is very close to the target set T , with in addition *μ*1(*q*<sup>0</sup> <sup>1</sup>) <sup>−</sup> *<sup>μ</sup>*2(*q*<sup>0</sup> <sup>2</sup>) > 0. Thus, the requirement *μ*1(*q*1(*tf*)) − *μ*2(*q*2(*tf*)) > 0 is easily satisfied. Thus, in this particular situation, it comes as no surprise that the fastest path to reach the target T is the one exploiting the fact that *x*˙1(0) *x*˙2(0) (since *x*<sup>0</sup> <sup>1</sup> *<sup>x</sup>*<sup>0</sup> <sup>2</sup>) along with *D*(*t*) = 0, since it maximizes *x*˙1(*t*) (we recall that *x*˙*<sup>i</sup>* = (*μi*(*qi*) − *D*(*t*))*xi*).

It is worth noticing that, when no singular arc occurs, the strategy mainly consists of "pushing" *x*<sup>1</sup> and *x*<sup>2</sup> as quickly as possible towards the target T using *D* = 0, when the initial conditions *x*<sup>0</sup> <sup>1</sup> and *<sup>x</sup>*<sup>0</sup> <sup>2</sup> are very close to T . Nevertheless, this strategy may not be the optimal one whenever *q*<sup>0</sup> <sup>1</sup> and *<sup>q</sup>*<sup>0</sup> <sup>2</sup> are "far" from satisfying *μ*1(*q*1(*tf*)) − *μ*2(*q*2(*tf*)) > 0. This is typically the case illustrated in Example 3 in the next section.

For an optimal control of type *B*±S, the occurrence of a singular arc is related to the socalled turnpike phenomenon that we now explain in this framework. For a large subset of initial conditions <sup>S</sup>† <sup>⊂</sup> <sup>Ω</sup> that are biologically the most relevant, the structure of the optimal control is *bang-singular B*±S. The singular arc is the control *Ds* given in (27) that reaches the target T . Moreover, this singular phase coincides with optimal trajectories (*s*(*t*), *q*1(*t*), *q*2(*t*)) that stay most of the time close to the critical point (*sc*, *q*1*c*, *q*2*c*) defined in Section 2.3 (related to the *actual* growth rates and the function Δ(*s*) = *μ*1(*δ*−<sup>1</sup> <sup>1</sup> (*s*)) <sup>−</sup> *<sup>μ</sup>*2(*δ*−<sup>1</sup> <sup>2</sup> (*s*))). Observe, for instance, the trajectories *s*, *q*<sup>1</sup> and *q*<sup>2</sup> in Figure 3a.We also believe that the concatenation of bang arcs before the major singular phase exclusively aims at moving (*s*0, *q*<sup>0</sup> <sup>1</sup>, *<sup>q</sup>*<sup>0</sup> <sup>2</sup>) towards (*sc*, *q*1*c*, *q*2*c*). Then, the singular arc *Ds* takes over at a switching-time instant *t* = *ts* and ensures that the associated singular trajectory, denoted (*ss*(*t*), *q*1*s*(*t*), *q*2*s*(*t*)), satisfies the so-called *turnpike inequality* (see, e.g., [33]),

$$\begin{aligned} &\|\|s\_{\mathfrak{k}}(t) - s\_{\mathfrak{c}}\|\| + \|q\_{1\mathfrak{k}}(t) - q\_{1\mathfrak{c}}\| + \|q\_{2\mathfrak{k}}(t) - q\_{2\mathfrak{c}}\| \le a\_1 \left( e^{-a\_2 t} + e^{a\_2(t - t\_f)} \right), \\ &a\_1, a\_2 > 0, \quad \text{for all } t \in [t\_\mathfrak{s}, t\_f]. \end{aligned} \tag{32}$$

**Figure 3.** (**a**) Optimal state in Droop model, (**b**) the resulting optimal co-state trajectories, which satisfy in particular all the transversality conditions of the PMP.

This is, for instance, the case for optimal controls illustrated in Figure 4 (of type B−S) and in Figure 5a (of type B−B+S). The inequality (32) usually holds when the time interval

[0, *tf* ] is not excessively short [33–35], which is the generic case in the Droop model (1) associated with (6). Indeed, in practice, the most significant biological experiments aim to separate species and select *x*<sup>1</sup> starting from an homogeneous culture (a well-balanced initial culture with *x*<sup>0</sup> 1/*x*<sup>0</sup> <sup>2</sup> <sup>≈</sup> 1) or even from *<sup>x</sup>*<sup>0</sup> <sup>2</sup> *<sup>x</sup>*<sup>0</sup> <sup>1</sup> with the challenging issue of selecting the minority species (*x*1), which is not naturally promoted. In these cases, Droop's kinetics ensure that the minimum selection time *tf* cannot be excessively short and therefore singular arcs as well as the *turnpike*-type behavior appear systematically in the optimal strategy of (6).

**Figure 4.** The optimal control in Example 2 (*s*<sup>0</sup> = 4, *q*<sup>0</sup> *<sup>i</sup>* <sup>=</sup> 1.9, *<sup>x</sup>*<sup>0</sup> *<sup>i</sup>* = 0.3) is of *bang(0)-singular* type.

**Figure 5.** (**a**) The optimal state trajectories *s*, *q*<sup>1</sup> and *q*<sup>2</sup> (associated with the optimal control *D* in Figure 6) get closer over time to the critical point (*sc*, *q*1*c*, *q*2*c*). The target T , with *ε* = 0.08, is reached quickly, without resorting to the singular arc. The transversality conditions are satisfied, and in particular *λs*(*tf*) = *λq*<sup>1</sup> (*tf*) = *λq*<sup>1</sup> (*tf*) = 0, as illustrated in (**b**).

**Figure 6.** Evolution of the quantity *ρ* 2(*s*(*t*))*μ* <sup>2</sup>(*q*2(*t*)) − *ρ* 1(*s*(*t*))*μ* <sup>1</sup>(*q*1(*t*)) along the optimal trajectories given in Figure 3a.

#### **5. Direct Optimization and Numerical Results**

In this section, a direct-optimization approach is performed in order to solve (6) and illustrate the different cases discussed in Section 4.3. The numerical direct methods that we use throughout this paper are implemented in Bocop [36] (an optimal control toolbox), and they have the characteristic to transform the studied (6) into a nonlinear programming problem (NLP) in finite-dimension [37], through the discretization step of the control and the state variables [38]. Numerical results are organized as follows:


In all the numerical examples, we consider the model parameters given in Table 1, with the settings in Table 2.

**Table 1.** The model parameters used in Section 5.


**Table 2.** Model and OCP settings. The contamination rate *ε* characterizes the target set T .

*sin* **Control** *<sup>D</sup>* **Contamination Rate** *<sup>ε</sup>* 6 [0, *Dmax* = 1.5] 0.08

Assumption 3 is verified when *D*max = 1.5, namely because *D*max is precisely chosen above the maximum actual growth rates of the species. The contamination rate in all the examples is fixed to a significantly small value, *ε* = 0.08.

In Bocop, the state variables (and even the time, in minimal-time OCPs) of the Droop model (1) are discretized with a Lobatto scheme based on Runge–Kutta methods of type Lobatto-IIIC of order 6, which uses an implicit trapezoidal rule. The main settings used in Bocop are given in Table 3.

**Table 3.** Bocop settings used in Section 5.


**Example 2.** *In the first example, we consider the Droop model resulting from the parameters in Table 1 and Figure 7, associated with the settings in Tables 2 and 3, and the initial conditions given in Table 4.*

**Table 4.** The initial conditions used in Example 2.


**Figure 7.** Growth and absorption (uptake) functions, respectively *μ<sup>i</sup>* and *ρi*, *i* = 1, 2, produced using the model parameters given in Table 1, and used throughout the Examples 1–3. We note that the value of *s* that maximizes the function Δ(*s*) is given *sc* = 0.092. This point maximizes the difference between the actual growth rates (as discussed in Section 2.3) and defines the unique *static* solution (*sc*, *q*1*c*, *q*2*c*). All the assumptions that ensure the well-posedness of the generic (6) are satisfied in this case. In particular, we highlight that Δ(*s*) can be positive and negative, and both species may win the competition using an appropriate control *D* (see Section 2.4).

In this example, we have a well-balanced initial culture since *x*<sup>0</sup> 1/*x*<sup>0</sup> <sup>2</sup> = 1 (see Section 4.3). The direct optimization method allows us to determine the optimal control *D*, given in Figure 4, that steers the model trajectories towards T (with *ε* = 0.08) in minimal-time *tf* = 18.3526 days.

We check and analyze the evolution of the switching function Φ˜ , its derivatives, and the co-state of the substrate *s* (Figure 8) in order to characterize the switching instant *ts* ∈ (0, *tf*). This time-instant coincides with *λ<sup>s</sup>* = 0 (since the singular arc is the one reaching the target <sup>T</sup> ), <sup>Φ</sup>˜ <sup>=</sup> ˙ Φ˜ = 0 (thus activating *Ds*, according to the PMP). We also notice that the condition ¨ Φ˜ (*tf*) = 0 is also satisfied. The optimal state and co-state trajectories are depicted in Figure 3, where we notice that *s*(*t*), *q*1(*t*) and *q*2(*t*) evolve around the *static* critical point (*sc*, *q*1*c*, *q*2*c*) for almost all *t* ∈ [*ts*, *tf* ], see the *turnpike*-like property discussed in Section 4.3.

The optimal control strategy aims to maximize the difference between the *actual* growth rates (the function Δ(*s*)) as illustrated in Figure 9. The initial arc *bang(0)* drives *<sup>s</sup>*<sup>0</sup> towards *sc* (we recall that *<sup>s</sup>*˙ = (*sin* <sup>−</sup> *<sup>s</sup>*)*<sup>D</sup>* <sup>−</sup> *<sup>ρ</sup>*1(*s*)*x*<sup>1</sup> <sup>−</sup> *<sup>ρ</sup>*2(*x*2), *<sup>s</sup>*<sup>0</sup> <sup>=</sup> 4, *sin* <sup>=</sup> 6, and, *sc* = 0.092). The quantity *μ*1(*q*1(*t*)) − *μ*2(*q*2(*t*)) is maximized, with a delayed-dynamics, as a consequence of maximizing Δ(*s*). At the final time of *tf* = 18.3526 days, we have *μ*1(*q*1(*tf*)) − *μ*2(*q*2(*tf*)) > 0. Finally, we check in Figure 6 that, at *t* = *tf* , we have

$$\frac{\rho\_2'(s)}{\rho\_1'(s)}(t\_f) = \frac{\mu\_1'(q\_1)}{\mu\_2'(q\_2)}(t\_f).$$

**Figure 8.** Characterization of the switching instant and of the singular arc in Example 2. (**a**) The switching function and its derivatives. (**b**) The co-state of the substrate *s*.

**Figure 9.** (**a**) Evolution of Δ(*s*(*t*)) and *μ*1(*q*1(*t*)) − *μ*2(*q*2(*t*)) along the optimal trajectories. The optimal control aims to maximize the function Δ. We also check in (**b**), using the optimal model trajectories given in Figure 3, that *s*(*t*) + *q*1(*t*)*x*1(*t*) + *q*2(*t*)*x*2(*t*) converges towards *sin* (see Section 2.4).

The behavior of the optimal control and optimal trajectories described in Example 2 is definitively the most compelling one (with *bang(0)-singular* or *bang(D*max*)-singular* arcs) from a biological standpoint, since it is the one that systematically appears when the final time is not extremely short. Indeed, in practice, initial conditions start more commonly sufficiently "far" from the target T , leading to a final time that allows the singular arc and the *turnpike*-like behaviors to hold.

**Example 3.** *Now, let us consider the initial conditions in Table 5.*

**Table 5.** The initial conditions used in Example 3.


It is worth noticing that the initial conditions in Example 3 are intuitively favourable for reaching the target <sup>T</sup> in a very short time, since *<sup>μ</sup>*1(*q*<sup>0</sup> <sup>1</sup>) <sup>−</sup> *<sup>μ</sup>*2(*q*<sup>0</sup> <sup>2</sup>) > 0 and *<sup>x</sup>*<sup>0</sup> 2/*x*<sup>0</sup> <sup>1</sup> = 0.083, while *ε* = 0.08 (very close to the target). The optimal control in this case is mainly a *bang(0)* over time, as illustrated in Figure 10 (see Section 4.3 for more details). The optimal state trajectories and co-state trajectories (that satisfy the transversality conditions) are illustrated in Figure 5.

**Figure 10.** The optimal control given in (**a**) is *bang(0)* almost everywhere over [0, *tf*). It achieves species separation (**b**) and selects the species *x*<sup>1</sup> at *tf* = 1.1810 days, since *x*1(*tf*) = 1.3425 and *x*2(*tf*)/*x*1(*tf*) = *ε* = 0.08.

**Example 4.** *In the last example, let us consider the initial conditions in Table 6.*

**Table 6.** The initial conditions used in Example 4.


In this situation, we notice that initial conditions are still favourable for reaching the target <sup>T</sup> in a very short time because *<sup>x</sup>*<sup>0</sup> 2/*x*<sup>0</sup> <sup>1</sup> = 0.0818 (with *<sup>ε</sup>* = 0.08, so *<sup>x</sup>*<sup>0</sup> *<sup>i</sup>* are very close to the target). However, we also note that *μ*1(*q*1(0)) − *μ*2(*q*2(0)) < 0, while *μ*1(*q*1(*tf*)) − *μ*2(*q*2(*tf*)) should be positive at *t* = *tf* (see Section 3). Thus, the issue of minimal-time separation is slightly more complex than Example 3, and we obtain a structure for the optimal control of *bang(0)-bang(1)-singular* type, as illustrated in Figure 11. The corresponding model trajectories and optimal co-states are provided in Figure 12.

**Figure 11.** The optimal control given in (**a**) is *bang(0)-bang(D*max*)-singular* over [0, *tf*), where *tf* = 4.5541 days. A first switching instant from *bang(0)* to *bang(D*max*)* occurs around 0.3 days, then *ts* occurs when *λ<sup>s</sup>* = 0, as illustrated in (**b**), starting the singular arc that steers the model trajectories towards T , with *ε* = 0.08.

**Figure 12.** The optimal model trajectories (**a**), and the optimal co-state trajectories (**b**) that satisfy the transversality conditions.

#### **6. Conclusions**

The minimal-time OCP for the competition between two microbial species accumulating nutrients is a key issue. Progressing along this problem will definitely help for experiments that nowadays last more than 6 months [14,15]. However, the competition described by the Droop model turns out to be significantly more complicated than for the Monod model in dimension 2 [17]. We have improved the preliminary results about this problem to be found in [22,29] in order to provide an optimal synthesis depending on the initial condition. In particular, we applied the PMP, we discussed the structure of the optimal control, and we identified the singular arc steering optimal paths to the desired target set in a minimal amount of time. This study also highlights the *turnpike* behavior [33] although an exact verification in our case is not possible in our setting since the problem is affine w.r.t. entries in contrast with [35] that, in general, requires coercive hypotheses on the Hamiltonian w.r.t. entries. As usual in optimal control problems that are affine in the control, the study of singular arcs via geometric methods is a crucial issue.

This study also raised a mathematical (open) question outside the scope of this paper on the existence or not of a terminal singular arc whenever the switching function, its derivative, and second derivative w.r.t. the input vanish on a terminal manifold of codimension 1 (see, e.g., [39]).

Future work will focus on the determination of closed loop (sub-optimal) controllers to be applied for bioreactor control subject to uncertainties that are inherently present in biological systems. Finally, the proposed strategy must now be tested experimentally to assess the gain in experimental time it can offer.

**Author Contributions:** Conceptualization, W.D., T.B. and O.B.; methodology, W.D., T.B. and O.B.; software, W.D.; validation, W.D., T.B. and O.B.; formal analysis, W.D., T.B. and O.B.; investigation, W.D. and T.B.; resources, W.D., T.B. and O.B.; data curation, W.D., T.B. and O.B.; writing—original draft preparation, W.D., T.B. and O.B.; writing—review and editing, W.D., T.B. and O.B.; visualization, W.D., T.B. and O.B.; supervision, W.D., T.B. and O.B.; project administration, W.D., T.B. and O.B.; funding acquisition, W.D., T.B. and O.B. All authors have read and agreed to the published version of the manuscript.

**Funding:** The authors would like to thank the *Bio-MSA* (Graine-ADEME) project, funded by the *Agence Nationale de la Recherche (ANR)* in France, for partially supporting this work.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** The authors are grateful to J.-B. Caillau and J.-B. Pomet for fruitful exchanges about singular arcs.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

