# Nonlinear Model Predictive Control of a Wastewater Treatment Process Fitted with a Submerged Membrane Bioreactor

Guilherme Araujo Pimentel, Alain Rapaport, Alain Vande Wouwer

► To cite this version:

Guilherme Araujo Pimentel, Alain Rapaport, Alain Vande Wouwer. Nonlinear Model Predictive Control of a Wastewater Treatment Process Fitted with a Submerged Membrane Bioreactor. IFAC International Symposium on Advanced Control of Chemical Processes (ADCHEM 2015), International Federation of Automatic Control (IFAC). AUT., Jun 2015, Whistler, British Columbia, Canada. pp.1246-1251, 10.1016/j.ifacol.2015.09.139. hal-01154418

HAL Id: hal-01154418

https://inria.hal.science/hal-01154418v1

Submitted on 21 May 2015

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# Nonlinear Model Predictive Control of a Wastewater Treatment Process Fitted with a Submerged Membrane Bioreactor

G. Araujo Pimentel*,** A. Rapaport ** A. Vande Wouwer *

* University of Mons, Automatic Control Laboratory, Bd. Dolez 31,
7000 Mons, Belgium

<guilherme.araujopimentel,alain.vandewouwer>@umons.ac.be

** Equipe Projet INRIA MODEMIC, UMR MISTEA, Montpellier,
France. rapaport@supagro.inra.fr

**Abstract:** Submerged membrane bioreactors are increasingly applied for wastewater treatment but requires a tight control of the membrane fouling so as to ensure safe and efficient operation. The objective of this paper is to design a nonlinear model predictive control to minimize the irreversible resistance while keeping the trans-membrane pressure, which is a good indicator of membrane fouling, at an acceptable level. To this end, the manipulated variables are the permeate flow and the air scouring flow, which allows the material layer formed on the membrane (in short the “cake”) to be detached. The NMPC structure is tested in simulation considering a detailed simulator as the reference process, and a reduced-order model as the predictor. The results show that the process can be regulated until the irreversible resistance takes the main role in the fouling resistance. When this state is reached, a chemical cleaning is required, or a larger trans-membrane pressure has to be accommodated.

**Keywords:** process control; optimization; mathematical modeling; membrane bioreactor;

## 1. INTRODUCTION

Submerged membrane bioreactors (sMBRs) are a relatively new technology for wastewater treatment. Their main advantages are related to the outstanding water quality, the solid effluent concentration, the separation between solid retention time (SRT) and hydraulic retention time (HRT) and the smaller process footprint (Cicek, 2003; Bella et al., 2008; Sarioglu et al., 2009). However, one of the main drawbacks of this technology is the membrane fouling that hampers the efficiency of the process (Le-Clach et al., 2006; Zarragoita-González et al., 2008).

Nowadays, the operation of an sMBR plant is controlled by splitting it in two distinct parts: (i) the filtration efficiency control; (ii) the biological degradation process. In this study, a simple model integrating both physical and biological parts is implemented. The macroscopic model structure, characterized by a modest size, allows the application of a nonlinear model predictive control (NMPC) that has been used in industrial process control with an impressive success rate in the last decades (Kouvaritakis and Cannon, 2001). In the present case, NMPC can be used to act on the irreversible fouling resistance of the membrane while maintaining the trans-membrane pressure (TMP) at an acceptable level using the combination of permeate flow and air scouring flow (or air cross-flow).

This paper is organized as follows. In Section 2, a detailed model of an sMBR is presented along with the reduced-order dynamic model. A nonlinear model predictive controller is designed in Section 3 while Section 4 discusses

the numerical results. Finally, Section 5 draws some conclusions and outlines possible future investigation.

## 2. sMBR MODELS

A schematic view of an sMBR is presented in Figure 1. The following manipulated variables are usually available: the permeate flow $Q_{out}$ [$m^3/d$], the waste flow $Q_w$ [$m^3/d$], the air cross-flow $J_{air}$ [$m^3/m^2d$], as well as the input concentrations of biomass $X_{in}$ and substrate $S_{in}$ and the trans-membrane pressure $TMP$ [$mbar$].

<figure><img src="image_2.png" /><figcaption>Fig. 1. Schematic representation of a submerged membrane bioreactor (sMBR).</figcaption></figure>

### 2.1 Integrated Models

Many single process models have been developed for sMBRs. On the one hand, the biological aspects are usually
based on the activated sludge model (ASM) framework (Henze et al., 2000), while dedicated models have been proposed to describe the membrane fouling mechanism. However, these processes are strongly linked and an integrated model is needed (Mannina et al., 2011).

Naessens et al. (2012) point out the importance of developing an integrated model and the risk of using these separate models for optimization of the entire system, since optimal conditions for one process may not at all be optimal for another process (e.g. optimizing the air cross flow can modify biomass properties resulting in a faster/slower degradation of the substrate).

Integrated sMBR models have been proposed and applied for the first time by Lee et al. (2002) and Wintgens et al. (2003). The former presented an ASM1-SMP model (activated sludge model No.1 with soluble microbial products, which are free in mixed liquor) and the latter an ASM3-EPS model (activated sludge model No.3 with extracellular polymeric substances that are biopolymers attached on the microorganisms). Several other models were proposed afterwards, as for instance Li and Wang (2006), Zarragoita-González et al. (2008) and Bella et al. (2008). Usually, these models have a large number of parameters, as evidenced by the model proposed by Mannina et al. (2011) that includes 45 parameters. In this same study, a sensitivity analysis showed that only around 30% of the parameters are crucial to process dynamics emulation. Instead of considering a detailed model, it is therefore more appropriate to develop a simplified integrated model for control purposes. This will be dealt with in the next subsection.

The biological sub-model proposed by Mannina et al. (2011) is a modified version of the well-known ASM1(Henze et al., 2000), which takes the influence of SMPs into account. In short, the model uses Monod-type kinetics for the degradation of the different substrates and mass balance equations for the different substrate modeling biomass growth, biomass decay, ammonia and carbon removal processes. The filtration sub-model is an improved version of the model proposed by Bella et al. (2008). This model is a resistance in series model with $R_{total}$ modeled as follows:

$$R_{total} = R_{m} + \underbrace{R_{p}}_{R_{irr}} + \underbrace{R_{sc} + R_{dc}}_{R_{rev}} \quad (1)$$

where $R_m$ is the intrinsic membrane resistance, $R_{irr}$ is the irreversible resistance, which can only be removed by chemical cleaning while $R_{rev}$ denotes the reversible resistance that is affected by the air cross-flow.

The specific pore-blocking resistance $R_p$ is proportional to the amount of permeate produced and is computed through the specific pore fouling resistance ($r_p$) and in terms of the filtrate volume.

$$R_p = r_p \sum Jt_f \quad (2)$$

$J$ [$m^3/m^2d$] is the filtration flux, $t_f$ is the duration of the filtration period. The stable sludge cake resistance $R_{sc}$ and the dynamic sludge cake resistance $R_{dc}$ are presented in equations (3a) and (3b).

$$R_{sc} = r_{sc} \cdot M_{sc} \quad (3a)$$

$$R_{dc} = r_{dc} \cdot M_{dc} \quad (3b)$$

These expressions include $M_{sc}$ [$kg/m^2$] that denotes the stable sludge cake mass and $M_{dc}$ [$kg/m^2$] the dynamic sludge cake mass onto membrane surface.

$$\left\{ \begin{array}{l} \frac{dM_{sc}}{dt} = \frac{24C_{ss}J^2}{24J + C_d d_p G} - \frac{\beta_b(1-\alpha)GM_{sc}^2}{\gamma_b V_f t + M_{sc}} \quad (4a) \\ \frac{dM_{dc}}{dt} = \frac{-\beta_b(1-\alpha)GM_{dc}^2}{\gamma_b V_f t + M_{dc}} \quad (4b) \end{array} \right.$$

where $C_{ss}$ [$kg/m^3$] is the sludge concentration, $C_d$ is the coefficient of the drag and lift force, $d_p[m]$ is the particle size, $\beta_b$ is the erosion rate coefficient of the dynamic sludge film, $\alpha$ is the stickiness of the biomass particle, $\gamma_b$ [$kg/m^3s$] is the compression coefficient for the dynamic sludge film, $V_f = Jt_f$ [$m^3/m^2$] is water production within a filtration period of an operation cycle, $t$ [$d$] is time and $G$ [$s^{-1}$] is the shear intensity

$$G = \sqrt{\frac{\rho_s \cdot g \cdot Q_a}{\mu_S}} \quad (5)$$

where $\rho_s$ and $\mu_s$ are the density and viscosity, respectively, of the sludge mixture, $Q_a$ is the air cross-flow and $g$ is the gravitational constant.

## 2.2 Simplified Integrated Model

In a previous work (Pimentel et al., 2014), the simplified model (6) is presented and validated by comparison with a more complex biological and filtration model.

$$\begin{cases} \frac{d\beta}{dt} = \gamma\beta \\ \frac{dS}{dt} = -\frac{1}{Y}\mu(S)X + \frac{Q_{in}}{V}(S_{in} - S) \end{cases} \quad (6a)$$

$$\frac{dX}{dt} = \left( \mu(S) - \frac{Q_w}{V} \right) X + \frac{Q_{in}}{V} X_{in} - \frac{Q_{out}}{V} X + \frac{J_{air}}{V} \mu_{air}(m)m \quad (6c)$$

$$\text{with } \mu(S) = \mu_{S,max} \frac{S}{K_S + S}, \quad \mu_{air}(m) = \beta \frac{m}{K_{air} + m} \quad (6d)$$

The membrane filtration is modeled by equations (6a) and (6d). These equations represent the sludge cake dynamic on the membrane surface. The long-term sludge cake evolution $\beta$ is a key factor of the model and represents the ease (or difficulty) of detaching the sludge cake from the membrane by air scouring, influenced by the air cross-flow $J_{air}$. Considering a process with constant permeate flow ($Q_{out} \approx$ constant), the capacity of $J_{air}$ to detach the sludge cake decreases with time, due to the drag force on the solid particles, which results in a decay behavior of $\beta$ (difficulty of detachment), and thus $\gamma$ [$d^{-1}$] is a negative constant. It must be noted that if the process has constant trans-membrane pressure ($TMP \approx$ constant), the permeate flow decreases with time. Hence, $\beta$ increases, and $\gamma$ is positive, therefore the efficiency of $J_{air}$ increases as a consequence of the loss of the drag force of the membrane to the particle deposition. However, in this case, the model should include a term limiting the growth of $\beta$
to a practical maximum. Depending on the process setup (amplitude of permeate, waste and air flow, bulk concentration, process relaxation and filtration cycles), the value of $\gamma$ changes. Based on the observation of experimental data, it can be concluded that this phenomenon has a slow behavior (Merlo et al., 2000), thus $\gamma$ has a small value. The state vector includes the long-term sludge cake mass evolution $\beta$ [$m^{-1}$] with $\beta(0) = \beta_0 > 0$ and the cake mass $m$ [$g$] with $m(0) = m_0 > 0$. Both states are positive and bounded if $\gamma < 0$; $Q_{out} \le Q_{out} \le Q_{out}$ is the permeate flow and $J_{air} \le J_{air} \le J_{air}$ is the air cross-flow.

The sludge cake mass dynamic (6d) is divided in two terms. The first term represents the attachment of suspended particles on the membrane surface, ruled by the effluent flow rate $Q_{out}$ and suspended solids bulk concentration $X$. The second term represents the sludge cake detachment proportional to air cross-flow, governed by $J_{air}$ and also by the sludge cake mass $m$ and $K_{air}$ [$g$], the half-saturation coefficient.

The biological activity is described using a simple chemo-stat reactor (Smith and Waltman, 1995) extended to an sMBR, involving one biomass growing on a limiting substrate. It is important to note that this simple biological model structure can be easily extended to more than one biological reaction (see, for instance, Dochain and Vanrolleghem (2001)).

Equation (6b) represents the consumption of the substrate by the free biomass, ruled by a Monod law $\mu(S) = \mu_{S,max} \frac{S}{K_{S+S}}$ and the transportation of incoming and outgoing substrate through the tank. Note that the substrate is not affected by the membrane, keeping in mind that only solid matter are retained.

Equation (6c) shows that there is an interaction between the suspended solid matter and sludge cake mass build-up. The first part of the equation represents the growth of the free biomass that consumes the substrate. Material transportation involves the cake attachment $\frac{-Q_{out}X}{V}$ and detachment and the instantaneous “conversion” in suspended solids due to the air cross-flow $+\frac{J_{air}}{V}\mu_{air}(m)m$. The free particle matter is transformed in sludge cake mass and vice-versa depending on the process input values. The waste flow is represented by $Q_w$ and the influent is defined as $Q_{in} = Q_w + Q_{out}$. The biological time scale is governed by the consumption rate of substrate and, consequently, the growth of biomass. This rate is represented by a Monod law equation ($\mu(S)$) and is normally measured in days.

Usually, the sludge cake mass cannot be measured due to the lack of reliable sensors (Dalmau et al., 2013). Thus, the trans-membrane pressure is used to indirectly control the sludge cake mass build-up, according to the following equation:

$$TMP = Q_{out}\eta R_{total}. \quad (7)$$

$Q_{out}$ is the permeate pump flow selected by the operator (or controller) and $\eta$ [$mbar \cdot d$] is the apparent viscosity. The total fouling resistance, $R_{total,s}$ [$m^{-1}$], is modeled by

$$R_{total,s} = R_m + R_{cake} + \delta_R, \quad (8)$$

where $R_m$ [$m^{-1}$] is the intrinsic resistance (assumed constant) and $\delta_R$ is used to represent the total resistance disturbance, resulting from pore-blocking, biofilm, concentra-

tion polarization and scaling. $R_{cake}$ is the cake resistance and, as previously reported (Lee et al., 2002; Khan et al., 2009), it is the most important term in the fouling build-up. Since $R_m$ is proportionally small, the total resistance can thus be modeled as the cake resistance:

$$R_{cake} = \rho \frac{m + m_0}{A}, \quad (9)$$

where $\rho$ [$m \cdot g^{-1}$] is the specific cake resistance, $m_0$ [$g$] is the initial cake mass, $m$ [$g$] is the cake mass and $A$ is the membrane area.

This simplified model allows the use of advanced control theory such as NMPC and has also been validated with real data from a pilot plant with data set at 30 days long, reaching an accuracy correlation coefficient of $R^2 = 0.95$ (Pimentel et al., 2015). These results encourage us to cast the model in an NMPC optimization framework, but before, the controllability study of the model is achieved.

## 2.3 Controllability Study of the Simplified sMBR Model

The study of controllability is important in order to understand in which way the process behavior can be influenced through certain inputs. According to Slotine and Li (1991), one of the most used mathematical tools for nonlinear systems is the Lie Brackets, briefly presented in the following.

Assuming $Q_{out}$ and $J_{air}$ are the manipulated variables and rewriting system (6) in the following form

$$\dot{\mathbf{x}} = \mathbf{f}(\mathbf{x}) + \mathbf{g}(\mathbf{x})u \quad (10)$$

*Definition 2.1.* Let $\mathbf{f}$ and $\mathbf{g}$ be two vector fields on $\mathbb{R}^n$. The Lie Brackets of $\mathbf{f}$ and $\mathbf{g}$ is a third vector field defined by

$$[\mathbf{f}, \mathbf{g}] = \nabla \mathbf{g} \mathbf{f} - \nabla \mathbf{f} \mathbf{g} \quad (11)$$

It can be defined as $(ad_f^1) \equiv [f,g]$ where “ad” means “adjoint”.

*Theorem 2.1.* The system defined by:

$$\dot{x} = f(x) + \sum_{i=1}^{m} g_i(x)u_i \quad (12)$$

is locally accessible at about $x_0$ if the accessibility distribution $C$ spans an $n$ space, where $n$ is the rank of $x$ and $C$ is defined as follows:

$$C = [g_1, g_2, \dots, g_m, [g_i, g_j], \dots, [ad_{g_i}^k, g_j], \dots, [f, g_i], \dots, [ad_f^k, g_i], \dots]$$

The system is therefore controllable.

Applying the theorem 2.1 and considering $Q_{out}$ and $J_{air}$ as process actuators the system is controllable.

## 3. NMPC-sMBR PROCESS CONTROL

The main motivation behind the development of a simple dynamic model is the potential of applying advanced model-based control as NMPC. The advantage of this control technique is its ability to handle model nonlinearity and various types of constraints on the actuators and state variables (Santos et al., 2012).

NMPC uses a model to predict the trajectory of the system on a prediction horizon and computes an optimal control
<figure><img src="image_3.png" /><figcaption>Fig. 2. NMPC-Scheme</figcaption></figure>

sequence on a control horizon (Allgöwer et al., 2004). The first important element is therefore a nonlinear model in the form:

$$ \dot{x} = f(x(t), u(t)), \quad x(0) = x_0, \qquad (13) $$

together with constrains in the form $u(t) \in \mathbf{U}$, $\forall t \ge 0$, $x(t) \in \mathbf{X}$, $\forall t \ge 0$ where $x(t) \in \mathbb{R}^n$ and $u(t) \in \mathbb{R}^m$ are the vector of states and inputs, respectively. The sets $\mathbf{U}$ and $\mathbf{X}$ are compact and can be represented by $\mathbf{U} := u \in \mathbb{R}^m | u_{min} \le u \le u_{max}$, and $\mathbf{X} := x \in \mathbb{R}^n | x_{min} \le x \le x_{max}$ with the constant vector $u_{min}$, $u_{max}$ and $x_{min}$, $x_{max}$.

The NMPC control moves are usually the results of a finite horizon open-loop optimal control problem, which is solved at every sampling instant. In generic notation, the NMPC problem can be expressed as:

$$ \min_{\phi_u(\cdot)} J_{\text{NMPC}}(x(t), \phi_u(\cdot)) $$

$$ \text{s.t.} \quad \dot{\phi}_x(\tau) = f(\phi_x(\tau), \phi_u(\tau)), \phi_x(t) = x(t), \qquad (14a) $$

$$ \phi_u(\tau) = \phi_u(t + T_c), \forall \tau \in [t + T_c, t + T_p], \qquad (14b) $$

with the cost function

$$ J_{\text{NMPC}}(x(t), \phi_u(\cdot)) := \int_{t}^{t+T_p} F(\phi_x(\tau), \phi_u(\tau))d\tau; $$

where $\phi_u(\tau) \in \mathbf{U}$, $\forall \tau \in [t, t + T_c]$, $\phi_x(\tau) \in \mathbf{X}$, $\forall \tau \in [t, t + T_p]$, $T_p$ and $T_c$ are the prediction and control horizon with $T_c \le T_p$. $\phi_x(\cdot)$ denotes the new value of the state $x(\cdot)$ computed by the closed loop equation $\dot{\phi}_x$ using the new input value $\phi_u$ found by the optimization problem for each instant over the moving finite horizon $T_c$ (see figure 2).

The cost function, equation (15), is chosen based on the process desired performance and the first choice for the cost function is often the quadratic function. Positive weighting matrices ($\Omega_1$ and $\Omega_2$) can also be included in the cost function:

<table><caption>Table 1. Input concentrations of the sMBR and physical model parameters</caption><thead><tr><th>Compound</th><th>Units</th><th>Value</th></tr></thead><tbody><tr><td>$S_I$</td><td>[gCOD m<sup>-3</sup>]</td><td>30.00</td></tr><tr><td>$S_S$</td><td>[gCOD m<sup>-3</sup>]</td><td>0.77</td></tr><tr><td>$X_I$</td><td>[gCOD m<sup>-3</sup>]</td><td>3554.43</td></tr><tr><td>$X_S$</td><td>[gCOD m<sup>-3</sup>]</td><td>59.35</td></tr><tr><td>$X_{BH}$</td><td>[gCOD m<sup>-3</sup>]</td><td>3572.44</td></tr><tr><td>$X_{BA}$</td><td>[gCOD m<sup>-3</sup>]</td><td>311.33</td></tr><tr><td>$X_P$</td><td>[gCOD m<sup>-3</sup>]</td><td>2373.11</td></tr><tr><td>$S_O$</td><td>[g m<sup>-3</sup>]</td><td>2.19</td></tr><tr><td>$S_{NO}$</td><td>[gN m<sup>-3</sup>]</td><td>11.54</td></tr><tr><td>$S_{NH}$</td><td>[gN m<sup>-3</sup>]</td><td>0.33</td></tr><tr><td>$S_{ND}$</td><td>[gN m<sup>-3</sup>]</td><td>0.63</td></tr><tr><td>$X_{ND}$</td><td>[gN m<sup>-3</sup>]</td><td>4.40</td></tr><tr><td>$V$</td><td>[m<sup>3</sup>]</td><td>0.19</td></tr><tr><td>$A$</td><td>[m<sup>2</sup>]</td><td>0.93</td></tr><tr><td>$r_{sc}$</td><td>[m kg<sup>-1</sup>]</td><td>1.0e15</td></tr><tr><td>$\mu$</td><td>[Pa s]</td><td>0.001</td></tr><tr><td>$R_m$</td><td>[m<sup>-1</sup>]</td><td>1e11</td></tr><tr><td>$\gamma_b$</td><td>[kg/(m<sup>3</sup> s)]</td><td>2.5e-5</td></tr><tr><td>$\beta_b$</td><td>[-]</td><td>3.5e-4</td></tr><tr><td>$\alpha$</td><td>[-]</td><td>0.5</td></tr><tr><td>$d_p$</td><td>[m]</td><td>1e-6</td></tr><tr><td>$C_d$</td><td>[-]</td><td>1</td></tr><tr><td>$K_1$</td><td>[-]</td><td>4e-6</td></tr><tr><td>$\rho_s$</td><td>[kg/m<sup>3</sup>]</td><td>1000</td></tr><tr><td>$g$</td><td>[m/s<sup>2</sup>]</td><td>9.81</td></tr><tr><td>$r_p$</td><td>[m<sup>-2</sup>]</td><td>1.4e14</td></tr></tbody></table>

$$ F(x, u) = (x - x_{ref})^T \Omega_1 (x - x_{ref}) + (u - u_{ref})^T \Omega_2 (u - u_{ref}). \qquad (15) $$

where $x_{ref}$ and $u_{ref}$ are the desired reference of a state and an input, respectively.

## 4. SIMULATION RESULTS

Both models, the descriptive model from Mannina et al. (2011) and the simplified model, equation (6), are implemented in the Matlab environment. The biological process inputs and the descriptive model parameters can be found in Table 1.

First, the parameters of the simplified model are identified based on some prior experiments (see Pimentel et al. (2014) for the details of the parameter estimation procedure, which is based on a time-scale separation). The identified parameters are presented in Table 2.

<table><caption>Table 2. Parameter Calibration</caption><thead><tr><th>Parameters</th><th>Values</th></tr></thead><tbody><tr><td>$K_{air}$ [g]</td><td>9.3367 × 10<sup>6</sup></td></tr><tr><td>$\rho$ [m/g]</td><td>2.0229 × 10<sup>10</sup></td></tr><tr><td>$m_0$ [g]</td><td>4.4869</td></tr><tr><td>$\gamma$ [day]</td><td>0.0194</td></tr><tr><td>$Y$ [-]</td><td>1.8558</td></tr><tr><td>$\mu_{S,max}$</td><td>0.0781</td></tr></tbody></table>

Following the model calibration, the NMPC methodology is applied using the simplified model (6) as a predictor. The cost function is defined as:

$$ F(x, u) = \left( \Omega_1 \frac{Q_{out}}{A} t^2 \right)^2 + \left( \Omega_2 (TMP - TMP^*) \right)^2 \quad (16) $$
<figure><img src="image_4.png" /><figcaption>Fig. 3. The NMPC acting on the descriptive process.</figcaption></figure>

where the effluent multiplied by the square of the time is minimized in order to significantly reduce the irreversible resistance and at the same time maintain the trans-membrane pressure at desired setpoint *TMP*\* and $\Omega_i$ are the scaling factors. Note that the irreversible resistance, represented by the equations (2) and (3a), depend on the permeate flow and time that should be minimized to enlarge the periods between chemical cleaning. The following constraints are added: (i) $Q_{out} \ge 0$ for the physical range of the permeate pump and (ii) $J_{air} \ge 0$ for the cross-flow range. The methodology is applied using the Matlab code presented by Grüne and Pannek (2011).

The results presented in Figure 3 are obtained assuming that all the state variables are measured. The NMPC uses a sampling time of one day, while a prediction horizon $T_p = 3$ days and a control interval of $T_c = 1$ day.

The first plot in Figure 3, represents *TMP* computed with the total resistance, equation (1). Note that, in blue, it is possible to see the influence of the reversible resistance and, in green, the influence of the irreversible resistance on the *TMP* value. The setpoint *TMP*\* is represented by a red line, which is set to 100 mbar. To maintain the desired setpoint, the controller increases the air cross-flow ($Q_a/J_{air}$) and, at the same time, decreases the permeate flow ($Q_{out}$). These input values are presented in the last two plots of Figure 3. The decay of sludge cake mass, observed in the second plot, shows that the sludge cake resistance ($R_{rev}$) is much more important than the irreversible resistance at the beginning of the process, matching the observations of Mannina et al. (2011). It is important to highlight that the controller actions maintain the desired setpoint even though some nonlinearities are not modeled in the simplified model. In order to test the robustness of the control scheme, a simulation study is achieved by considering an additive white noise with a standard deviation of 15% on $X_{in}$, so as to emulate the variation in the daily inflow concentrations, represented in Figure 4. The results show that the NMPC is robust enough to maintaining in the desired operating range until a chemical cleaning is required. Additionally, to emulate errors in the actuators, it is added 5% random noise in the input $Q_{out}$. Even though this input affects all the

<figure><img src="image_5.png" /><figcaption>Fig. 4. The NMPC acting with 15% random noise added to $X_{in}$.</figcaption></figure>

states and the irreversible and reversible layers, the process maintains its closed-loop performance.

The behavior of the controller when the irreversible resistance becomes more important than the sludge cake is shown in Figure 5. This occurs around day 30 where the sludge cake mass is extremely small, see second plot in Figure 5. To keep the *TMP* at the selected setpoint the controller acts vigorously by changing the air cross-flow, as seen in the third plot. This action does not results in a decay of the *TMP* value, and around day 34, the controller significantly changes the permeate flow to maintain the setpoint. This action is explained recalling the equation (2), that links permeate flow to the irreversible resistant, when the fractions of the $R_{sc}$ and $R_{dc}$ are extremely small. When this state is reached, a chemical cleaning is required, or a larger trans-membrane pressure has to be selected. Note that the chemical cleaning, when applied, deeply changes the properties of the membrane filtration, resulting in the need for a new identification of the model parameters before the NMPC framework is applied to the process.

The simulation in Figure 3 shows the importance of air-scour to maintain the reversible sludge layer at an admissible level until the irreversible layer becomes more important. Comparing the process without and with noise, it is apparent that more air-cross flow is needed in the second case. Figure 5 shows the inefficiency of air-cross flow to detach the irreversible cake, resulting into a waste of energy used by the air-blowers that are the key factor in the energy consumption in a sMBR plant. Furthermore, the process performance is controlled using air-scouring and permeate flows. These two inputs profiles are good indicators about the process health. Analyzing these profiles one can understand the process. In real applications, alarms could be set when these inputs reach a certain values or if its derivatives have large value, predicting the maintenance of the membrane process.

## 5. CONCLUSION AND FUTURE WORK

A NMPC has been applied to a submerged membrane bioreator process intended to stabilize the trans-membrane pressure at a desired value. The irreversible and sludge
<figure><img src="image_6.png" /><figcaption>Fig. 5. Blue is the sludge cake influence on TMP and green is the irreversible resistance on TMP.</figcaption></figure>

cake layer resistances have been used in order to optimize the process. The results show that after a certain amount of time, the process cannot be stabilized anymore due to the irreversible resistance. The process input values of $Q_{out}$ and $J_{air}$ lead us to believe that the setpoint should be changed or the chemical cleaning procedure should be carried out. Hence, it is possible to control the process and at the same time monitor the input variations that try to predict the next cleaning procedure needed. Future research will focus on the recirculating ($Q_r$) and waste ($Q_w$) flows that will be incorporated in the NMPC framework for a better control of biological degradation in the process while modifying the hydraulic and soluble retention time factors.

## REFERENCES

Allgöwer, F., Findeisen, R., and Nagy, Z.K. (2004). Nonlinear model predictive control: from theory to application. *Journal of the Chinese Institute of Chemical Engineers*, 35, 299 – 315.

Bella, G.D., Mannina, G., and Viviani, G. (2008). An integrated model for physical-biological wastewater organic removal in a submerged membrane bioreactor: Model development and parameter estimation. *Journal of Membrane Science*, 322, 1–12.

Cicek, N. (2003). A review of membrane bioreactors and their potential application in the treatment of agriculture wastewater. *Canadian Biosystems Engineering*, 45, 637 – 649.

Dalmau, M., Rodríguez-Roda, I., Ayesa, E., Odriozola, J., Sancho, L., and Comas, J. (2013). Development of a decision tree for the integrated operation of nutrient removal MBRs based on simulation studies and expert knowledge. *Chemical Engineering Journal*, 217, 174 – 184.

Dochain, D. and Vanrolleghem, P.A. (2001). *Dynamical modeling and estimation in wastewater treatment processes*. IWA Publishing.

Grüne, L. and Pannek, J. (2011). *Nonlinear Model Predictive Control: Theory and Algorithms*. Springer.

Henze, M., Gujer, W., Mino, T., and van Loodrecht, M. (2000). *Activated sludge models ASM1, ASM2, ASM2d and ASM3*. IWA Publishing.

Khan, S.J., Visvanathan, C., and Jegatheesan, V. (2009). Prediction of membrane fouling in MBR systems using empirically estimated specific cake resistance. *Bioresource Technology*, 100(23), 6133–6136.

Kouvaritakis, B. and Cannon, M. (eds.) (2001). *Nonlinear predictive control*. IEE.

Le-Clach, P., Chen, V., and Fane, T.A. (2006). Fouling in membrane bioreactors used in wastewater treatment. *Journal of Mem*, 284, 17–53.

Lee, Y., Cho, J., Seo, Y., Lee, J.W., and Ahn, K.H. (2002). Modeling of submerged membrane bioreactor process for wastewater treatment. *Desalination*, 146, 451–457.

Li, X.y. and Wang, X.m. (2006). Modelling of membrane fouling in a submerged membrane bioreactor. *Journal of Membrane Science*, 278(1-2), 151–161.

Mannina, G., Di Bella, G., and G., V. (2011). An integrated model for biological and physical process simulation in membrane bioreactor (MBRs). *Journal of Membrane Science*, 376, 56–69.

Merlo, R.P., Adham, S., Gagliardo, P., Trussell, R.S., Trussell, R., and Watson, M. (eds.) (2000). *Application of membrane bioreactor (MBR) technology for water reclamation*, volume 27. Proceedings of the Water Environment Federation, WEFTEC 2000: Session 11 through Session 20, Water Environment Federation.

Naessens, W., Maere, T., Ratkovich, N., S.Vedantam, and Nopens, I. (2012). Critical review of membrane bioreactor models - part 2: Hydrodynamic and integrated models. *Bioresource Technology*, 122, 107–118.

Pimentel, G.A., Dalmau, M., A.Vargas, Comas, J., Rodriguez-Roda, I., and Vande Wouwer, A.R.A. (2015). Validation of a simple fouling model for submerged membrane bioreactor. In *Submitted to MathMod2015*.

Pimentel, G.A., Vande Wouwer, A., Harmand, J., and Rapaport, A. (2014). Design, analysis and validation of a simple dynamic model of a submerged membrane bioreactor. In revision Water Research Journal.

Santos, L., Dewasme, L., Coutinho, D., and Wouwer, A.V. (2012). Nonlinear model predictive control of fed-batch cultures of micro-organisms exhibiting overflow metabolism. *Computers and Chemical Engineering*, 39, 143–151.

Sarioglu, M., Insel, G., Artan, N., and Orhon, D. (2009). Model evaluation of simultaneous nitrification and denitrification in membrane bioreactor operated without an anoxic reactor. *Journal of Membrane Science*, 337, 17–27.

Slotine, J. and Li, W. (1991). *Applied nonlinear control*. Prentice Hall.

Smith, H.L. and Waltman, P. (1995). *The theory of the chemostat*. Cambridge University press.

Wintgens, T., Rosen, J., Melin, T., Brepols, C., Brensla, K., and Engelhardt, N. (2003). Modeling of membrane bioreactor system for municipal wastewater treatment. *Journal of Membrane Science*, 216, 55–65.

Zarragoita-González, A., Schetrite, S., Alliet, M., Jáuregui-Haza, U., and Albasi, C. (2008). Modeling of submerged membrane bioreactor: Conceptual study about link between activated sludge biokinetics, aeration and fouling process. *Journal of Membrane Science*, 325, 612–624.