## Materials and Methods
### Control System  
#### 2.2.1 Control Theory  
The first step in the development of a control theory is to select the control objective. Different control theories express control objectives in different ways. To develop a control system for a batch bioreactor, a special version of MRAC was used, called Adaptive Model-Following Control (AMFC). The proposed AMFC is based on Linear Model-Following Control (LMFC), which uses an explicit model [22]. In the case of LMFC, the control system includes an auxiliary dynamic system called the reference model, which is excited by the same external inputs as the controlled plant. The outputs and/or the state-variables of the reference model represent the necessary control target. AMFC appears like a natural extension of the LMFC with an explicit model when an adaptive design must be considered. To design AMFC systems, an MRAC system was used, with parallel configuration and signal synthesis. A parallel AMFC system with signal-synthesis adaptation can be  
known and constant parameters \(\mathbf{A}_{\text{p}}\) and \(\mathbf{B}_{\text{p}}\) by generating the controlled plant input \(\mathbf{u}_{\text{p}}(t)\). This part of the control system is called the Linear Model-Following Controller (LMFC). The solution for \(\mathbf{K}_{\text{p}}\), \(\mathbf{K}_{\text{m}}\), and \(\mathbf{K}_{\text{u}}\), which leads to the perfect model-following control, exists if, and only if, [22]:  
\[\text{rank }\mathbf{B}_{\text{p}}=\text{rank }\big{[}\mathbf{B}_{\text{p}}, \mathbf{A}_{\text{m}}-\mathbf{A}_{\text{p}}\big{]}=\text{rank }\big{[}\mathbf{B}_{\text{p}},\mathbf{B}_{\text{m}}\big{]} \tag{19}\]  
This means that a solution exists if the column vectors of the difference matrix \(\big{(}\mathbf{A}_{\text{m}}-\mathbf{A}_{\text{p}}\big{)}\) and the matrix \(\mathbf{B}_{\text{m}}\) are linearly dependent on the column vectors of the matrix \(\mathbf{B}_{\text{p}}\). A class of solutions can be obtained using the Penrose pseudo-inverse of \(\mathbf{B}_{\text{p}}\) denoted by \(\mathbf{B}_{\text{p}}^{+}\). Using \(\mathbf{B}_{\text{p}}^{+}\), the sufficient conditions for the existence of solutions for the perfect model-following control can be written as:  
\[\big{(}\mathbf{I}-\mathbf{B}_{\text{p}}\mathbf{B}_{\text{p}}^{+}\big{)}\big{(} \mathbf{A}_{\text{m}}-\mathbf{A}_{\text{p}}\big{)}=\mathbf{0} \tag{20}\]  
\[\big{(}\mathbf{I}-\mathbf{B}_{\text{p}}\mathbf{B}_{\text{p}}^{+}\big{)} \mathbf{B}_{\text{m}}=\mathbf{0} \tag{21}\]  
The conditions (20) and (21) are known as [PERSON]'s condition for perfect model-following control [22]. If these conditions are satisfied, then \(\mathbf{K}_{\text{m}}-\mathbf{K}_{\text{p}}\) and \(\mathbf{K}_{\text{u}}\) can be computed directly using Equations (22) and (23):  
\[\mathbf{K}_{\text{m}}-\mathbf{K}_{\text{p}}=\mathbf{B}_{\text{p}}^{+}\big{(} \mathbf{A}_{\text{m}}-\mathbf{A}_{\text{p}}\big{)} \tag{22}\]  
\[\mathbf{K}_{\text{u}}=\mathbf{B}_{\text{p}}^{+}\mathbf{B}_{\text{m}} \tag{23}\]  
The feedback gain matrix \(\mathbf{K}_{\text{p}}\) can be computed independently of the perfect model-following conditions. For example, it can be computed using linear optimal control in order to minimise the effect of state disturbances acting on the plant. However, \(\mathbf{K}_{\text{p}}\) must be such that the resulting \(\mathbf{K}_{\text{m}}\), which leads to satisfaction of (22), also assures that the matrix \(\big{(}\mathbf{A}_{\text{m}}-\mathbf{B}_{\text{p}}\mathbf{K}_{\text{m}}\big{)}\) is a Hurwitz matrix [22]. In cases when the controlled plant parameters \(\mathbf{A}_{\text{p}}\) and \(\mathbf{B}_{\text{p}}\) are uncertain and changeable, the \(\mathbf{u}_{\text{p}1}(t)\) does not assure perfect model-following. The additional controlled plant input \(\mathbf{u}_{\text{p}2}(t)\) must be generated in this case. The \(\mathbf{u}_{\text{p}2}(t)\) represents the output of the adaptation mechanism, which will assure that the generalised state error \(\mathbf{e}(t)\) goes to zero under certain conditions.