## 2 Materials and Methods
### Optimization Method  
The values of the operational variables providing the optimum polynomial functions were determined by solving the constrained non-linear optimization problem defined by Equation (1):  
\[\begin{array}{c}Max\ f(x)\\ \text{s.t.}\ h(x)=0\\ g(x)\leq 0\end{array}, \tag{1}\]  
where \(f(x)\) denotes the objective function, \(x\) the vector of operational (decision) variables, \(h(x)\) the set of equality constraints and \(g(x)\) that of inequality constraints.  
Figure 2: Scheme of two serial bioreactors operating in a repeated semi-continuous mode as well as example of profiles for the volume of medium, ethanol concentration and acetic acid concentration in each bioreactor. \(E_{u1}\) and \(E_{u2}\) are the ethanol concentrations at the time the first and second bioreactor, respectively, are unloaded; \(E_{l1}\) and \(E_{l2}\) the ethanol concentrations during loading of the first and second bioreactor, respectively; and \(V_{u1}\) and \(V_{u2}\) the volumes of medium unloaded from the first and second, respectively.  
If these functions are assumed to be differentiable, then optimal points fulfilling the Karush-Kuhn-Tucker (KKT) conditions can be determined [28; 29] from the Lagrange function shown in Equation (2) for a maximization problem (for a minimization problem, the Lagrange function is the same as Equation (2) simply by changing the sign of \(f(x)\)).  
\[\mathcal{L}(x,\lambda,\mu)=f(x)-\sum_{j}\lambda_{j}h_{j}(x)-\sum_{i}\mu_{i}g_{ i}(x), \tag{2}\]  
where \(\lambda_{j}\) and \(\mu_{i}\) are the KKT multipliers.  
Equation (3) sets the first-order KKT conditions needed for optimality:  
\[\begin{array}{c}\
abla_{x}\mathcal{L}(x,\lambda,\mu)=0\\ h_{j}(x)=0\\ g_{i}(x)\leq 0\\ \mu_{i}g_{i}(x)=0\\ \mu_{i}\geq 0\end{array}, \tag{3}\]  
where \(\
abla_{x}\) is the gradient operator with respect to \(x\).  
\(\
abla_{x}g_{i}\) and \(\
abla_{x}h_{j}\) must be linearly independent of the active constraints at the critical points \(x^{\star}\) obtained as solutions to Equation (3). The active constraints at \(x^{\star}\) are those with associated non-zero KKT multipliers. In a maximization problem, if \(f(x)\) is concave and all \(g(x)\) functions are convex, then \(x^{\star}\) will be the global solution to the optimization problem. Otherwise, it will be necessary to check whether the second order KKT conditions for \(x^{\star}\) are fulfilled in order to confirm that they provide a local maximum on \(f(x)\). A function is concave if its Hessian matrix is negative semi-definite (i.e., if all its eigenvalues are equal to or less than 0) and convex if it is positive semi-definite.  
Sufficient second-order KKT conditions can be verified by examining the sign of the last \(n-m\) leading principal minors of the bordered Hessian \(B\) (Equation (4)) evaluated on a critical point.  
\[B(x,\lambda,\mu)=\left(\begin{array}{cc}\
abla_{xx}^{2}\mathcal{L}(x, \lambda,\mu)&\
abla_{x}g(x)^{T}\\ \
abla_{x}g(x)&0_{m\times m}\end{array}\right)_{(n+m)\times(n+m)}, \tag{4}\]  
where \(n\) is the number of operational variables, \(m\) that of active constraints at the critical point, \(\
abla_{xx}^{2}\mathcal{L}(x,\lambda,\mu)\) the Hessian matrix of \(\mathcal{L}(x,\lambda,\mu)\) and \(g(x)\) the set of active constraints.  
The \(k\)th leading principal minor of \(B(x,\lambda,\mu)\) equals \(\big{|}B(x,\lambda,\mu)_{k\times k}\big{|}\) [i.e., the determinant of the \(k\times k\) submatrix taken from the upper-left of \(B(x,\lambda,\mu)\)]. Therefore, the last leading principal minor of \(B(x,\lambda,\mu)\) equals \(\big{|}B(x,\lambda,\mu)_{(n+m)\times(n+m)}\big{|}\) [i.e., the determinant of the whole matrix \(B\)], the penultimate one being \(\big{|}B(x,\lambda,\mu)_{(n+m-1)\times(n+m-1)}\big{|}\) and so on. For a critical point to be a local maximum, \(sign\big{(}B(x,\lambda,\mu)_{(n+m)\times(n+m)}\big{)}\) must be equal to \((-1)^{n}\) and the previous \(n-m-1\) leading principal minors must have an alternating sign.