Design of New Hybrid Neural Structure for Modeling and Controlling Nonlinear Systems

T his paper proposes a new structure of the hybrid 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. Weight parameters of the hybrid neural structure with its serial-parallel configuration are adapted by using the Back propagation learning algorithm. The ability of the proposed hybrid neural structure for nonlinear system has achieved a fast learning with minimum number of epoch, minimum number of neurons in the hybrid network, high accuracy in the output without oscillation response as well as useful model for a one step ahead prediction controller for the nonlinear CSTR system that is used in the MATLAB simulation.

the direct inverse neural controller 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. The motivation of this paper is taken from, Putrus, 2011, Jeyachandran and Rajaram, 2014, where the modeling and the controlling for nonlinear CSTR system were still to be challenged. 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 modeling and controller is compared with NARMA-L2 based MLP neural network in terms of:  Leaning speed.  Hidden layer node number.  Hybrid neural network model order.  Oscillation reduction  One step ahead controls action prediction.

IDENTIFICATION OF DYNAMICAL SYSTEMS USING NEURAL NETWORK MODELING
In general, the system identification technique is a very important in the modeling of 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 Autoregressive Moving Average (NARMA) model is an accurate representation for the nonlinear discrete-time dynamic plant. Also, it is used to get exact input-output behavior for a finite-dimensional 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 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 addressed as no required for additionally trained sub-model, the neuro-controllers, such as Model Reference Adaptive Control (MRAC) and Model Predictive Controller (MPC) requires an additional sub-model 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:  -] respectively and the type of the neural network structure is Multi-Layer-Perceptron (MLP). Fig. 2 shows the general structure of the NRAMA-L2 model based on MLP with a serial-parallel configuration to identify the nonlinear system. The network's output yields the prediction error, Zurada, 1992.
: is the actual output of the plant of each step. : is the model output of the plant of each step.
From Fig. 2, the training mechanism of the N1[-] and N2 [-] are applied as supervised learning Back Propagation algorithm in order to reduce the error between the actual output y p (k + 1)and neural model output y m (k + 1)and is equal to zero approximately then the model will complete the same actual output response. When identification of the plant is complete then g [-] can be approximated by ĝ The Jacobian of the plant can be defined as the ĝ [-] neural network and the sign definite in the operation region of the plant to ensure the uniqueness of the plant inverse at that operating region, Jeyachandran and Rajaram, 2014, therefore, a linear relationship between the control effort and the output in the NARMA-L2 model. So the control effort that gives the output equal to the desired value is taken from the control law is as in Eq. (10).

Journal of Engineering Volume 25 February 2019 Number 2
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; 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, the general a th neuron in the hidden layer shown in Fig. 3 is considered. For each n th number of the input nodes of these inputs there is a weight V associated with it. The first calculation is performed within the neuron consists of calculating the weighted sum

H(
Once, hidden layer outputs are got, they will pass it to the output layer where a one linear neuron is used to calculate the weighted sum (neto) of its inputs as in Eq. (13). The one linear neuron passes the sum (neto b ) through a linear function of slope 1 as in Eq. (14).

The proposed hybrid neural network model
The 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 the Modified Elman Neural Network (MENN) is shown in Fig. 4. It consists of four layers as explained below, Medsker and Jain, 2001, Abdulkarim and Garko, 2015.  The input layer which is only a buffer layer "Scale"  The output which represents a linear activation function and it sums the fed signals.  The hidden layer which has nonlinear activation functions such as sigmoidal functions.  The context layer which is used only to memorize the previous activation of the hidden layer. From Fig. 4 it can be seen that the following equations, Al-Araji, et al., 2011. 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 value of an adopted is 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 is used a single linear neuron to calculate the weighted sum ( ) as in Eq. (20).
Where, nh: is the number of the hidden neuro (nodes).
Then the linear activation function in the single neuron in the output lead to pass the sum ( ) as in Eq. (21) The proposed new hybrid NARMA-L2 neural structure based on MENN as shown in Fig. 6 where it is replaced 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 node in the hidden layer, increasing the order of the model lead to reduce the output oscillation and generate the best control action for one step ahead prediction.
The output of the model will be as in Eq. (22).

Learning algorithm:
The back propagation training algorithm is the most commonly used algorithm in training artificial neural networks (ANN), Al-Araji, et al., 2011. It performs gradient descent to adjust the weights of a network such that the overall network error is minimized. Conceptually, an epoch calculates the output of the network using feedforward pass for each training pattern and propagates errors signals back from the output layer towards the input layer to determine weight changes. The learning rate η which is directly proportional to the size of steps taken in the weight space is a very important parameter in the training process. A too small η value may lead to a very slow learning process while a large value may lead to a divergent behavior. A variable learning rate will do better if there are many local and global optima for the objective function, Abdulkarim and Garko, 2015. The equations of the back propagation learning algorithm for the NARMA-L2 mode based MLP neural network are as follows:  The connection matrix between the hidden and output layers is: ( + 1) = ( ) + ∆ ( + 1) (28)  The connection matrix between input and hidden layers is: 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: Journal of Engineering Volume 25 February 2019 Number 2 ( + 1) = ( ) + ∆ ( + 1) (40)  The connection matrix between context and hidden layers is as follows: ( + 1) = ( ) + ∆ ( + 1) (46)  The connection matrix between input layer and hidden layer is:

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 NARMA-L2 neural network by using two structures that were explained in section two. The mathematical model of the CSTR is defined by Eq. (53) and Eq. (54) that have been taken from Al-Araji, 2015; Dagher and Al-Araji, 2013. The parameters of the CSTR model can be defined in nominal operating condition as in Table 1.
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.  Fig. 8, there is an essential need for adding a scaling function at neural network terminals. This function will perfom a conversion between scaled values and actual values and vice versa. This will help to overcome numerical problems that are involved within real values, 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. (53) and Eq. (54), the dynamic model of the CSTR plant is described by Eq. (55) as 3 rd order system depends on the high nonlinear in the dynamic behavior as shown in Since each of N1 [-] and N2 [-] has five inputs based on Eq. (55) and the nodes in the NARNA-L2 neural network structure based on MLP is [5:11:1] where the number of the input node in the input layer, the node number in the hidden layer based on 2n+1and the node number in the output layer respectively while the nodes in the NARNA-L2 neural network structure based on MENN is [5:11:11:1] where the number of the input node in the input layer, the number of node in the hidden layer based on 2n+1, the node number in the context layer and the node number of in the output layer respectively. During the training phase many times in order to find the optimal number of the node in the hidden layer for NARMA-L2 based on MLP model was equal to 9 with the number of epoch was equal to 600 while the optimal number of the node in the hidden layer for NARMA-L2 based on MENN model was equal to 6 and the number of the training cycle was equal to 500, therefore, the number of the nodes in the NARNA-L2 neural network structure based on MLP is [5:9:1] while the numbers 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 MLP neural network model with the actual plant output for learning patterns after 600 epoch and Fig. 9-b shows the excellent response of the NARMA-L2 based MENN model with the actual plant output for learning patterns after 500 epoch. So it can be observed that each model output following actual plant output and without over learning problem occurred in the training cycle. Figs. 10-a, b show the average of ten times of the MSE for the training phase in order to investigate the optimal nodes in the hidden layer for each model. The Jacobian of each model is shown in Fig. 11 where N2 [-]: is sign definite in the region of interest which means that the models are invertable and can be implemented for the controller as the inverse control structure. The Mean Square Error (MSE) calculated for the latest epochs, which is defined by Eq. (8) can be shown in Fig.12-a of the NRMA-L2 based MLP model while Fig.12-b of the NARMA-L2 based MENN model. 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. 14 can be observed that the actual output of the CSTR plant is excellent at tracking the desired output and it has small overshoot without oscillation in the output as well as the steady state error equal to zero when it is used NARMA-L2 based on MENN model while the output of the plant has high overshoot and error in the steady state when it is used NARMA-L2 based on MLP model. Fig. 15 shows the control action of the NARMA-L2 based on MENN model 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.

CONCLUSIONS
The numerical simulation results of a new proposed hybrid NARMA-L2 model based on MENN with BP algorithm is presented in this paper for modeling and controlling the nonlinear CSTR system which shows the following capabilities:  Modifying and improving the performance of the nonlinear model output with no overlearning problem.  Increasing the speed of the learning model by decreasing the number of training cycles.  Minimizing the number of nodes in the hidden layer depending on the context layer.  Increasing the order of the hybrid neural network model depending on the selfconnections.  Reducing the output oscillation.  Best control action generation for one step ahead prediction which leads to excellent set point tracking.