# Optimized Dissolved Oxygen Fuzzy Control for Recombinant _Escherichia coli_ Cultivations
## 2 Theory and Software
### Fuzzy Logic Toolbox  
The development of the fuzzy controller (which encompasses the establishment of linguistic variables, membership functions--with their adjusted parameters, and the fuzzy rules) was achieved via Fuzzy Inference System (FIS) and Adaptive Neuro-Fuzzy Inference System (ANFIS) tools, both from MATLAB's Fuzzy Logic toolbox. It provides users with predefined functions and applications in MATLAB language to analyze, design, and simulate fuzzy logic-based systems [48].  
The FIS application allows users to create, edit, and visualize fuzzy inference systems based on graphic tools. First, the number of linguistic inputs and outputs, each nomenclature, classification (Mamdani or Takagi-Sugeno), and the aggregation/defuzzification methods are stablished in Fuzzy Logic Designer. Under the Membership Function Editor, users can edit and visualize input and output membership functions (and their parameters). It is also possible to determine the membership functions ranges and their type (trapezoidal, triangular, gaussian, and others). Finally, the Rule Editor focuses on the fuzzy rules that define the behavior of the system. Users can establish the rules (based on completeness and consistency principles) and attribute weights to each rule. Under the visualization tab, both Rule Viewer and Surface Viewer are considered diagnostic tools. In the first, users can evaluate the active rules and how a specific membership function impacts the final result. The second one, in its turn, evaluates the output dependency in relation to two inputs, described by a response surface [48].  
In FIS, the parameter values and membership functions shape are defined by users. However, when it is not possible to define them by expert's knowledge, ANFIS is a practical tool. Created by [PERSON] [49], it adjusts fuzzy parameters by mapping inputs and outputs based on process data and a feedforward neural network with a hybrid learning technique, that is, the parameter adjustments allow the system to learn from the data. In the first pass (forward pass), the consequent parameters are calculated by the least square method, whilst, in the second pass (backward pass), the error is back propagated, and the premises parameters are updated based on the gradient descent method, as shown in Equation (2) [49].  
\[\Delta\alpha=-\eta\ \frac{\partial E}{\partial\alpha}. \tag{2}\]  
\(\alpha\) is a generic parameter to be optimized, \(\eta\) is the learning rate, and \(E\) is the measured error.  
To create a neuro fuzzy inference system, MATLAB provides the Neuro Fuzzy Designer application. First, input and output data of the process to be modeled are pre-processed (with each line been a pair of input-output data) and loaded in the application. Then, the basic fuzzy inference structure is determined by the user (number of linguistic variables and membership function parameters) and further processed via grid partition method. The FIS training is based on backpropagation or a hybrid learning. Finally, it is possible to test the FIS with a separate dataset [48].  
Figure 1: Decision tree for air and oxygen flow rates manipulation in SUPERSYS_HCDC.