## 3 Design of Adaptive Nonlinear PID Controller
### Proposed Adaptive NPID Controller  
This subsection presents an adaptive NPID control scheme, where the three gains in (19) are adjusted adaptively. Assuming that the sampling time is small, the discrete time equation for the NPID controller is expressed by the following formula:  
\[u(k)=K_{p}e(k)+K_{j}\Delta t\sum_{j=0}^{k}v(j)+K_{d}\frac{e(k)-e(k-1)}{\Delta t}\,, \tag{29}\]  
Figure 7: Optimal Pareto fronts of NPID and PID controllers: (**a**) \(L/T=0.01\); (**b**) \(L/T=0.1\); (**c**) \(L/T=0.5\); (**d**) \(L/T=1\).  
where \(\Delta t\) is the sampling time, \(t=k\cdot\Delta t\), and \(e(k)\) is the error defined as  
\[e(k)=y_{r}(k)-y(k). \tag{30}\]  
In (30), \(y_{r}(k)\) is the desired temperature and \(y(k)\) is the measured output temperature. We rearrange the discrete time formula as follows:  
\[u(k)=K_{p}u_{1}(k)+K_{i}u_{2}(k)+K_{d}u_{3}(k). \tag{31}\]  
where the three input components are as follows:  
\[u_{1}(k)=e(k), \tag{32a}\] \[u_{2}(k)=\Delta t{\sum_{j=0}^{k}v(j)},\] (32b) \[u_{3}(k)=\frac{e(k)-e(k-1)}{\Delta t}. \tag{32c}\]  
The RBFNN then adjusts the controller gains to minimize the following performance index:  
\[J=\frac{1}{2}e^{2}(k) \tag{33}\]  
By adopting the gradient method, the updating equations for the NPID controller gains are  
\[\Delta K_{p}(k)=-\eta_{p}\frac{\partial J}{\partial K_{p}}=-\eta_{p}\frac{ \partial J}{\partial y}\frac{\partial y}{\partial u}\frac{\partial u}{ \partial K_{p}}=\eta_{p}e(k)\frac{\partial y}{\partial u}u_{1}(k), \tag{34}\]  
\[\Delta K_{i}(k)=-\eta_{i}\frac{\partial J}{\partial K_{i}}=-\eta_{i}\frac{ \partial J}{\partial y}\frac{\partial y}{\partial u}\frac{\partial u}{ \partial K_{i}}=\eta_{i}e(k)\frac{\partial y}{\partial u}u_{2}(k), \tag{35}\]  
\[\Delta K_{d}(k)=-\eta_{d}\frac{\partial J}{\partial K_{d}}=-\eta_{d}\frac{ \partial J}{\partial y}\frac{\partial y}{\partial u}\frac{\partial u}{ \partial K_{d}}=\eta_{d}e(k)\frac{\partial y}{\partial u}u_{3}(k), \tag{36}\]  
where \(\eta_{p}\), \(\eta_{i}\), and \(\eta_{d}\) are the rates of change for the proportional, integral, and derivative gains, respectively, and \(\partial y/\partial u\) denotes the Jacobian matrix, which measures the sensitivity of the output to changes in the control input. As time progresses, the RBFNN identifier resembles the CSTR process, so \(\partial y/\partial u\) is calculated using the RBFNN presented in Section 2 as  
\[\frac{\partial y}{\partial u}\approx\frac{\partial y_{N}}{\partial u}=\frac{ \partial}{\partial u}{\sum_{j=1}^{m}w_{j}h_{j}}={\sum_{j=1}^{m}w_{j}h_{j}} \frac{c_{i1}-p_{1}}{b_{j}^{2}}, \tag{37}\]  
where \(p_{1}\) is the first element of the network input vector, so \(p_{1}=u(k)\).  
Finally, the adaptation algorithm adjusts the three gains of the NPID controller as follows:  
\[K_{p}(k)=K_{p}(k-1)+\Delta K_{p}(k) \tag{38}\]  
\[K_{i}(k)=K_{i}(k-1)+\Delta K_{i}(k) \tag{39}\]  
\[K_{d}(k)=K_{d}(k-1)+\Delta K_{d}(k) \tag{40}\]  
Figure 8 shows the proposed adaptive NPID control scheme based on the RBFNN, where \(q^{-1}\) denotes the delay operator.  
The pseudocode representation of the proposed adaptive NPID controller, incorporating an RBFNN, is as Algorithm 1:  
```
Step 1: Initialize the adaptive NPID controller gains and RBFNN parameters and set other necessary parameters; Step 2: Set time \(k=0\);  While <Termination condition is not met> do Steps 3-9 Step 3: Update the NPID controller gains using (34)-(40); Step 4: Calculate the NPID control input using (19)-(20) and (25); Step 5: Numerically integrate the CSTR model in (4) to obtain \(y(k)\) at the \(k\)th instant; Step 6: Calculate the output of the RBFNN using (7) and update its weights, centers and widths using (11), (15) and (17); Step 7: Calculate the Jacobian matrix \(\partial y/\partial u\) using (37); Step 8: Update time \(k=k+1\); Step 9: Output \(y(k)\); end
```  
**Algorithm 1** The pseudocode representation with RBFNN