Design of New Hybrid Neural Controller for Nonlinear CSTR System based on Identification

T his paper proposes improving the structure of the neural controller based on the identification model for nonlinear systems. The goal of this work is to employ the structure of the Modified Elman Neural Network (MENN) model into the NARMA-L2 structure instead of Multi-Layer Perceptron (MLP) model in order to construct a new hybrid neural structure that can be used as an identifier model and a nonlinear controller for the SISO linear or nonlinear systems. Two learning algorithms are used to adjust the parameters weight of the hybrid neural structure with its serial-parallel configuration; the first one is supervised learning algorithm based Back Propagation Algorithm (BPA) and the second one is an intelligent algorithm namely Particle Swarm Optimization (PSO) algorithm. The numerical simulation results show that the hybrid NARMA-L2 controller with PSO algorithm is more accurate than BPA in terms of achieving fast learning and adjusting the parameters model with minimum number of iterations, minimum number of neurons in the hybrid network and the smooth output one step ahead prediction controller response for the nonlinear CSTR system without oscillation.


INTRODUCTION
Artificial Neural networks (ANN) are a set of neurons that imitate the biologic neural networks of the encephalon of creatures; especially, the neuronal-synaptic techniques that are based on only experimental data where they memorize, learn and recover information.Because of their ability to identify complex functions, they are essentially utilized in machine learning.ANNs can execute perfect performance to learn the input-output relations of nonlinear processes; therefore they are one of the most important fields of artificial intelligence.The output can be evaluated quicker and with preferable qualifications when the network is learned by inserting a sufficient dataset of input-output pairs.ANN-based branches are still in use until these days to cope with different problems in various empirical applications, extending from identification the nonlinear system to process monitoring, adaptive control, processing images, as well as renewable and sustainable energy, medical diagnostics, pattern recognition and the applications that are based on laser Al-Dunainawi, et al., 2017.Generally, the Nonlinear Autoregressive Moving Average (NARMA) neural network model has been applied successfully for identifying and controlling different types of the dynamic systems, George and Basu, 2012, such as: George, 2008, utilized the application of NARMA-L2 for the speed control of Separately Excited DC Motor using the conventional controllers and compared the performance of the suggested controller which is a NARMA-L2 neural network with the traditional one which is sim-power systems based chopper controller DC motor model.Using MATLAB toolbox, the models are simulated and the system modeling is prepared, and in the result, the NARMA-L2 controller has eliminated the chopper and its control circuit also was capable of regulating the speed about the rated value.Also, the authors, Valluru, et al., 2012, compared the execution of the NRMA-L2 Neuro controller with the conventional PID controller, for regulating the speed of a DC motor connected in series.The NARMA-L2 controller showed an excellent speed tracking performance with no overshoot.Hua-Min, et al., 2011, proposed an off-line trained NARMA-L2 neural network to identify the forward dynamics of the nonlinear non-minimum phase system of Unmanned Aerial Vehicle (UAV).The identification is done by redefining and inverting the output to force the real output to approximately track the desired trajectory.A good tracking performance results were achieved by using the proposed control scheme.The author, Putrus, 2011, used different control strategies for jacketed Continuous Stirred Tank Reactor (CSTR) which were conventional feedback control (PI and PID) and neural network (NARMA-L2, and NN Predictive) controller in order to develop the dynamic behavior and the control was done through utilizing two methods for finding the optimum parameters.The results showed that NARMA-L2 is the best controller and it is better than the NN Predictive in terms of Mean Square Error (MSE).Also, the authors Jeyachandran and Rajaram, 2014, showed that in controlling the CSTR process, the NARMA-L2 neural controller is faster and has good setpoint tracking capability as it is compared with the predictive neural and Neuro-Fuzzy controllers.Kananai and Chancharoen, 2012, proposed a stiff PD with the NARMA-L2 controller for a nonlinear arm of the robot mechanical system in order to give a good tracking accuracy.The authors Pedro and Ekoru, 2013, compared the performance of NARMA-L2 controller with a passive linear controller for the vehicle suspension system.The results showed that the NARMA-L2-based active vehicle suspension system performed better than the passive vehicle suspension system.In addition to that, Fourati and Baklouti, 2015, showed that controlling a bioreactor system by NARMA-L2 neural control strategy compared with a direct inverse neural controller is more fruitful, where NARMA-L2 was able to take care of nonlinear aspect and remove the output static error as well as it has a better trajectory tracking ability.Humod, et al., 2016, utilized Direct Torque Control for three phases Permanent Magnet Synchronous Motor to improve the speed and torque dynamic responses.They depend on two controllers to make a comparison and select the better, NARMA-L2 controller and optimal PI controller (PI-PSO), where (NARMA-L2) is trained based on optimal PI controller (PI-PSO) data.The result shows that the NARMA-L2 controller improved the performance of DTC and has superiority over the optimal PI controller for PMSM.Al-Dunainawia, et al., 2017, proposed a NARMA-L2 controller but this time by utilizing ANFIS architecture.The new control disposal involves fuzzy inference system FIS type Sugeno to plot the system's input-output characteristics.They utilized Back-propagation with Least Square Error as a hybrid method to learn the submodels and PSO to find the optimum parameters.By doing a comparison with other controllers, such as PID like controller that tunes fuzzy with GA or with PSO, etc.., the results show that the NARMA-L2 with PSO-ANFIS attained a lot of features and it's too efficient in all manners.The motivation of this paper is taken from, Putrus, 2011 and Jeyachandran and Rajaram, 2014, where the modeling and the controlling for the nonlinear CSTR system are still challenging.The main contribution of this work is the construction of a new hybrid neural network model based on NARMA-L2 with Modified Elman Neural Network structure in order to improve the performance of modeling and controlling of the nonlinear system.The new proposed hybrid NARMA-L2 modeling and controller with PSO algorithm is more accurate compared to hybrid NARMA-L2 with BP learning algorithm in terms of:  Learning speed. Hidden layer node number. Hybrid neural network model order. Least MSE.

 Oscillation reduction
The paper organization consists of the following sections: Section 2 describes the identification model based on the NARMA-L2 neural network and the proposed hybrid neural structure.In section 3, the simulation results are discussed in details.Finally, section 4 contains the conclusions of the entire work.

IDENTIFICATION OF DYNAMICAL SYSTEMS USING NEURAL NETWORK MODELING
In general, the system identification technique is a very important modeling technique for control system applications also it is considered as a very essential step for analysis and controller design of nonlinear processes in many applications.There are five standard steps in the identification model based on neural network, Nells, 2001, as shown in Fig. 1.This section focuses on nonlinear system identification based on the NARMA-L2 neural network model structure.

NARMA-L2 Model:
Nonlinear Auto Regressive Moving Average (NARMA) model is an accurate representation for nonlinear discrete-time dynamic plants.Also, it is used to get exact input-output behavior for a finite-dimensional space in the neighborhood of the equilibrium state.The implementation of such non-linearity in real-time control systems is very difficult and to overcome the computational complexity of the NARMA model, NARMA-L1and NARMA-L2 are introduced, Sharma, 2014.
For practical implementation, NARMA-L2 is more convenient by using multilayer neural networks and it is considered as the most popular neural network control architecture which is used to transform nonlinear system dynamics into linear dynamics by canceling the nonlinearities.The obvious advantage of the NARMA-L2 controller is that there is no need for additional trained sub model.The neuro-controllers, such as Model Reference Adaptive Control (MRAC) and Model Predictive Controller (MPC) required an additional submodel to be trained, Al-Dunainawi, et al., 2017.Taylor expansion is the main difference between these two approximations for NARMA-L1 Taylor expansion is around (y(k), y(k-1), …, y(k-n+1), u(k)=0, u(k-1)=0, …, u(k-n+1)=0) while for NARMA-L2 Taylor expansion is around the scalar u(k)=0.The approximations are given as follows, Sharma, 2014: For the NARMA-L1 model is: For the NARMA-L2 model is: The Jacobian of the plant can be defined as the ĝ [-] neural network and the sign definite in the operation region of the plant is used to ensure the uniqueness of the plant inverse at that operating region, Jeyachandran and Rajaram, 2014, therefore, there is a linear relationship between the control effort and the output in the NARMA-L2 model So the control effort that gives the output which is equal to the desired value is taken from the control law as in Eq. ( 10).
The structure of the multi-layer perceptron (MLP) neural network is shown in Fig. 3, which consists of three layers: the input layer, the hidden layer and the output layer, Zurada, 1992 and Al-Araji, 2009.So the network weights can be defined as follows: an V : is the hidden layer weight matrix.ba W : is the output layer weight matrix.
To illustrate the calculations, ponder the general a th neuron in the hidden layer shown in Fig. 3.

Hidden Layer
The weight matrix, V , represents the weights between the input and hidden layers.Firstly, the weighted sum a net is calculated as in Eq. ( 11), Zurada, 1992 and Al-Araji, 2009.
Where, nh: is the hidden nodes number.Secondly, the neuron output of a h is computed as a continuous sigmoid function of the a net as in Eq. ( 12), Zurada, 1992 and Al-Araji, 2009.

H(
Once, hidden layer outputs are obtained, they will be passed to the output layer where a one linear neuron is used to calculate the weighted sum (neto) of its inputs as in Eq. ( 13).(15) O (k) =Wh (k) (16) Where, V 1: input units weight matrix.V 2: context units weight matrix.W: weight matrix.F: is a non-linear vector function.
The output of the context unit in the modified Elman network is given by Eq. ( 17) as in Fig. 5: (17) Where, ℎ  °(): the j th context unit output; ℎ  (): the j th hidden unit output; : Self-connections feedback gain; :Weight from the hidden units to the context units at the context layer.The adopted value of the same for all self-connections and is not modified by the training algorithm.The value of  and are selected randomly between (0 and 1).A value of  nearer to 1 enables the context unit to aggregate more pattern outputs.To explain the calculations in the hidden layer, firstly, it considers the general j th neuron in the hidden layer with weight V1j,i where the i th is the inputs to this neuron and the j th neuron in the context layer with weight V2j,i.So it is calculating the weighted sum j th net of the inputs as in Eq. ( 18).
Then the output of the neuron ℎ  is calculated as the continuous bipolar sigmoid function of the   as in Eq. ( 19): For single output neural network in the output layer, it uses a single linear neuron to calculate the weighted sum (  )as in Eq. ( 20).
(20) Where, nh: is the number of the hidden neurons (nodes).
Then the linear activation function in the single neuron in the output leads to pass the sum (  ) as in Eq. ( 21): The proposed new hybrid NARMA-L2 neural structure based on MENN is as shown in Fig. 6, where it replaces the MLP neural network by MENN to improve the modeling and controlling of nonlinear system in terms of fast leaning model with minimum number of epoch and minimum number of nodes in the hidden layer, increasing the order of the model which leads to reduce the output oscillation and generate the best control action for one step ahead prediction. (33) The equations of the back propagation learning algorithm for the NARMA-L2 mode based MENN are as follows:  The connection matrix between the hidden and the output layers is: ( + 1) =   () + ∆  ( + 1) (52)

Particle Swarm Optimization (PSO):
In general, the particle swarm optimization (PSO) is one of the most modern and powerful optimization methods that has been empirically shown to execute well on different optimization problems.It is utilized for finding the global best solution in the complex search space.PSO algorithm is inspired from the animal's community that doesn't have leaders in their swarm as fishes and birds so they find the food randomly by following the position of the nearest member to the food.The PSO algorithm preserves multiple potential solutions at one time, so during each iteration, each solution is evaluated by an objective function to determine its fitness, Rini, et al, 2011; Al-Araji, 2014.The PSO notion includes changing the velocity of every particle on the way to its pbest position which is its previous best value and it is associated only with a specific particle and the gbest position which represents the best value of the whole particles in the group at each time step.All the proposed hybrid NARMA-L2 weight parameters which are 158 particles are randomly initialized and their velocities and positions are updated using the equations below, Al-Araji, 2014: Where m = 1, 2, 3....pop; pop is the number of particles;   is the weight of the particle m at iteration k; w: is the factor of weight inertia; c1 is cognition parameter and c2 is social parameter and it represents positive values where c1 and c2 must be less than 4; r1 and r2 are random values between 0 and 1, Al-Araji and Yousif, 2017.
The procedures of the algorithm based on PSO is summarized as follows:  The hybrid NARMA-L2 weight parameters or the Particles (n) are generated randomly as the initial population in the local search. Estimating the proposed cost function by using the mean square error in Eq.( 8) for each particle. Mark the pbest for every particle in the present searching point.The best-estimated value of pbest is taken to be gbest and the particle number with the best value is stored. If the value of pbest is greater than the present pbest, the pbest value is replaced by the present value of the particle and gbest is changed with the best value if the greater value of pbest is greater than the present gbest, and the particle number that had the greater value is stored. By using Eqs.(53 and 54) the updating part for each particle is done. If the present number of iterations is less than its maximum limit of iterations number, revert to step two, else exit.
These steps are repeated for each sample of the on-line optimization algorithm for the hybrid NARMA-L2 parameters.

SIMULATION RESULTS
In this section, the nonlinear Continuous Stirred Tank Reactor (CSTR) process is taken to execute the identification algorithm in order to construct the model and controller design based on the hybrid NARMA-L2 neural network by using two learning algorithms that were explained in section 2. The mathematical model of the CSTR is defined by Eqs. ( 55) and ( 56) that have been taken from Al-Araji, 2015, and Dagher and Al-Araji, 2013.The parameters of the CSTR model can be defined in nominal operating condition as in Table 1.
(56) Where Ca (t): is the product concentration output ; T (t): is the temperature of the reactor; qc (t): is the coolant flow-rate as the control signal.A continuous time model representation is adopted to be numerically solved using the Runge Kuta fourth order method 4RK where the time constant is equal to 1min and the simulation step size for this purpose is equal to 0.1min based on Shanoon theorem.Based on Eq. ( 55) and Eq. ( 56), the dynamic model of the CSTR plant is described by Eq. ( 57) as 3 rd order system depends on the high nonlinear in the dynamic behavior as shown in     The Mean Square Error (MSE) calculated for the latest epochs, which is defined by Eq.( 8) can be shown in Fig. 12       Figure14.The response of the actual plant.
Fig. 15 shows the control action of the hybrid neural controller which has a small spick action of the coolant flow-rate to track the desired concentration output and to minimize the steady-state error to the zero value.
the weight between the hidden neuron a h and the output neuron.The one linear neuron passes the sum (neto b ) through a linear function of slope 1 as in Eq. (14).) ( Proposed Hybrid Neural Network ModelThe NARMA-L2 model with modified Elman neural network structure is used to propose a new hybrid neural network model in order to improve the performance of modeling and controlling of the nonlinear system.Thus, the structure of Modified Elman Neural Network (MENN) is shown in Fig.4.

Figure 4 .From
Figure 4.The structure of modified Elman neural networks.

Figure 5 .
Figure 5.The connection neuron in the hidden layer of MENN.

Fig. 7
Fig.7shows the schematic diagram of the CSTR process and the objective of the operation is to control the concentration Ca (t) by changing a coolant flow-rate qc (t) as a control signal then the temperature of the reactor is changed that leads to the product concentration is controlled Putrus, 2011, Jeyachandran and Rajaram, 2014, and Al-Araji, 2015.

Figure 7 .
Figure 7.The CSTR with a cooling jacket.

Figure 8 -
Figure 8-a.The PRBS input signal used to excite the plant.

Figure 8
Figure 8-b.The open loop response of the plant to the PRBS input signal.
there is an essential need for adding a scaling function at neural network terminals this function will perform a conversation between scaled values and actual values and vice versatile will help to prevail over the numeral problems that are associated with real values.

Fig. 8 .
( + 1) = 1[  (),   ( − 1),   ( − 2), ( − 1), ( − 2)] + 2[  (),   ( − 1),   ( − 2), ( − 1), ( − 2)]() (57) Where N1 [-] and N2 [-] are neural networks which approximate ̂[−]and ̂[−] of Eq. (9), respectively.Since each of N1[-] and N2[-] has five inputs based on Eq. (57) and the nodes in the NARNA-L2 neural network structure based on MENN is [5:11:11:1], where the number of node in the hidden layer based on 2n+1, the node number in the context layer and the node number in the output layer, respectively.During the training phase, many trials were made in order to find the optimal number of the nodes in the hidden layer for NARMA-L2 based on MENN model which was equal to 6 and the number of the training cycles was equal to 500 in the case of BPA, while the number of the training cycles by using PSO was equal to 200, therefore, the number of the nodes in the NARNA-L2 neural network structure based on MENN is [5:6:6:1].Fig. 9-a shows the best response of the NARMA-L2 based MENN model with the actual plant output of pattern's learning after 500 epoch by using BPA andFig.9-b shows the excellent response of the NARMA-L2 based MENN model with the actual plant output for learning patterns after 250 iterations by using PSO.So it can be observed that both model outputs are following actual plant output and without over learning problem occurred in the training cycle.

Figure 10 -
Figure 10-a.The optimal number of nodes to an average of ten times MSE of NARMA-L2 based MENN with BPA.

Figure 10 -
Figure 10-b.The optimal number of nodes to an average of ten times MSE of NARMA-L2 based MENN with PSO.The Jacobian of the proposed hybrid model with PSO and BPA are shown in Fig. 11-a and b where N2[-]: signs definite in the region of interest which means that the models are inevitable and can be implemented for the controller as the inverse control structure.

Figure 11 -
Figure 11-b.The plant Jacobian for learning pattern of NARMA-L2 based on MENN model with PSO.
-a of the NARMA-L2 based MENN model with BPA while Fig.12-b of the NARMA-L2 based MENN model with PSO.

Figure 12 -
Figure 12-a.MSE for an optimal number of nodes (6 nodes) for NARMA-L2 based MENN model with BPA.
Fig. 13-a shows the reasonable response of the NARMA-L2 based MENN neural network model with the actual plant output for testing patterns using BPA while Fig. 13-b shows the excellent response of the NARMA-L2 based MENN model with the actual plant output for the same testing set using PSO.

Figure 12 -
Figure 12-b.MSE for an optimal number of nodes (6 nodes) for NARMA-L2 based MENN model with PSO.

Figure 13 -
Figure 13-a.The response of the NARMA-L2 based MENN model with the actual plant output for the tasting patterns by using BPA.

Figure 13 -
Figure 13-b.The response of the NARMA-L2 based MENN model with the actual plant output for the tasting patterns by using PSO.
Three different values are used as step change desired output during 300 samples in order to confirm the proposed hybrid NARMA-L2 based MENN model has the ability to be a controller for tracking the desired output.Fig.14it can be observed that the actual output of the CSTR is excellent at tracking the desired output and it has small overshoot without oscillation in the output and more accurate as well as the steady state error equal to zero when it is used NARMA-L2 based on MENN model with PSO learning algorithm than NARMA-L2 based on MENN model with BPA.

Figure 15 .
Figure 15.The coolant flow rate control signal based on the PSO algorithm.

Table 1 .
The parameters of the CSTR Operating Condition.