adaptive control using neural networks and approximate ...dynamic systems is proposed. the proposed...

13
Research Article Adaptive Control Using Neural Networks and Approximate Models for Nonlinear Dynamic Systems Khadija El Hamidi , 1 Mostafa Mjahed , 2 Abdeljalil El Kari, 1 and Hassan Ayad 1 1 Laboratory of Electric Systems and Telecommunications, Cadi-Ayyad University, Marrakesh 4000, Morocco 2 Mathematics and Systems Department, Royal School of Aeronautics, Marrakesh 40000, Morocco Correspondence should be addressed to Khadija El Hamidi; [email protected] Received 19 August 2019; Revised 22 June 2020; Accepted 13 August 2020; Published 26 August 2020 Academic Editor: Michele Calì Copyright © 2020 Khadija El Hamidi et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. In this research, a comparative study of two recurrent neural networks, nonlinear autoregressive with exogenous input (NARX) neural network and nonlinear autoregressive moving average (NARMA-L2), and a feedforward neural network (FFNN) is performed for their ability to provide adaptive control of nonlinear systems. Three dynamical nonlinear systems of dierent complexity are considered. The aim of this work is to make the output of the plant follow the desired reference trajectory. The problem becomes more challenging when the dynamics of the plants are assumed to be unknown, and to tackle this problem, a multilayer neural network-based approximate model is set up which will work in parallel to the plant and the control scheme. The network parameters are updated using the dynamic backpropagation (BP) algorithm. 1. Introduction Linear control methods are based on the existence of an ana- lytical model of the system. However, most physical systems have nonlinearity, and their mathematical model is unknown or partially known and variable in time. So, conventional methods suer some limitation in terms of stabilization and performance [1, 2]. With the considerable development of articial intelligence, which is found to be more suitable in handling such complex processes, the articial neural net- work (ANN) is one of the powerful tools that has been recog- nized for tracking highly nonlinear dynamic and complex systems [25]. In the eld of control engineering for a class of nonlinear discrete-time systems, a neural network has recently emerged as adjustable approximators capable of reproducing the com- plex behavior of nonlinear systems. Articial neural net- works have been eectively used as tracking controllers for unknown linear and nonlinear dynamic plants [6, 7]. ANNs have been employed in various elds, like time series predic- tion, system identication and control, and function approx- imation [8]. It has been shown that ANNS can eciently approximate dynamics without requiring detailed knowledge of the plant [8, 9]. Another advantage of ANNs is their pos- sibility of learning, which can reduce the human eort during the design of the controllers and allows discovering more eective control structures than those already known. There are dierent types of ANNs proposed in the litera- ture: feedforward neural networks (FFNNs), Kohonen self- organizing network, radial basis function (RBF), and recur- rent neural network [1012]. In fact, two classes of neural networks are the most popular in practical applications and have received considerable attention in the area of articial neural networks in recent years: multilayer feedforward neu- ral networks and recurrent networks. Multilayer feedforward neural networks have an ability to model any nonlinear func- tion and have proven extremely successful in pattern recog- nition tasks [13, 14] while recurrent networks have been used in associative memories as well as for the solution of optimization problems, and it constitutes also a powerful computational tool for sequence modeling and prediction. Both of these networks have common characteristics like Hindawi Modelling and Simulation in Engineering Volume 2020, Article ID 8642915, 13 pages https://doi.org/10.1155/2020/8642915

Upload: others

Post on 26-Apr-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

Research ArticleAdaptive Control Using Neural Networks and ApproximateModels for Nonlinear Dynamic Systems

Khadija El Hamidi ,1 Mostafa Mjahed ,2 Abdeljalil El Kari,1 and Hassan Ayad1

1Laboratory of Electric Systems and Telecommunications, Cadi-Ayyad University, Marrakesh 4000, Morocco2Mathematics and Systems Department, Royal School of Aeronautics, Marrakesh 40000, Morocco

Correspondence should be addressed to Khadija El Hamidi; [email protected]

Received 19 August 2019; Revised 22 June 2020; Accepted 13 August 2020; Published 26 August 2020

Academic Editor: Michele Calì

Copyright © 2020 Khadija El Hamidi et al. This is an open access article distributed under the Creative Commons AttributionLicense, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work isproperly cited.

In this research, a comparative study of two recurrent neural networks, nonlinear autoregressive with exogenous input (NARX)neural network and nonlinear autoregressive moving average (NARMA-L2), and a feedforward neural network (FFNN) isperformed for their ability to provide adaptive control of nonlinear systems. Three dynamical nonlinear systems of differentcomplexity are considered. The aim of this work is to make the output of the plant follow the desired reference trajectory. Theproblem becomes more challenging when the dynamics of the plants are assumed to be unknown, and to tackle this problem, amultilayer neural network-based approximate model is set up which will work in parallel to the plant and the control scheme.The network parameters are updated using the dynamic backpropagation (BP) algorithm.

1. Introduction

Linear control methods are based on the existence of an ana-lytical model of the system. However, most physical systemshave nonlinearity, and their mathematical model is unknownor partially known and variable in time. So, conventionalmethods suffer some limitation in terms of stabilization andperformance [1, 2]. With the considerable development ofartificial intelligence, which is found to be more suitable inhandling such complex processes, the artificial neural net-work (ANN) is one of the powerful tools that has been recog-nized for tracking highly nonlinear dynamic and complexsystems [2–5].

In the field of control engineering for a class of nonlineardiscrete-time systems, a neural network has recently emergedas adjustable approximators capable of reproducing the com-plex behavior of nonlinear systems. Artificial neural net-works have been effectively used as tracking controllers forunknown linear and nonlinear dynamic plants [6, 7]. ANNshave been employed in various fields, like time series predic-tion, system identification and control, and function approx-

imation [8]. It has been shown that ANNS can efficientlyapproximate dynamics without requiring detailed knowledgeof the plant [8, 9]. Another advantage of ANNs is their pos-sibility of learning, which can reduce the human effort duringthe design of the controllers and allows discovering moreeffective control structures than those already known.

There are different types of ANNs proposed in the litera-ture: feedforward neural networks (FFNNs), Kohonen self-organizing network, radial basis function (RBF), and recur-rent neural network [10–12]. In fact, two classes of neuralnetworks are the most popular in practical applications andhave received considerable attention in the area of artificialneural networks in recent years: multilayer feedforward neu-ral networks and recurrent networks. Multilayer feedforwardneural networks have an ability to model any nonlinear func-tion and have proven extremely successful in pattern recog-nition tasks [13, 14] while recurrent networks have beenused in associative memories as well as for the solution ofoptimization problems, and it constitutes also a powerfulcomputational tool for sequence modeling and prediction.Both of these networks have common characteristics like

HindawiModelling and Simulation in EngineeringVolume 2020, Article ID 8642915, 13 pageshttps://doi.org/10.1155/2020/8642915

Page 2: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

parallelism in their operation, generalization, and learningcapability, which make them suitable candidates for the con-trol of nonlinear systems [2]; there are compelling reasons toview them in a unified fashion.

Various structures of neural networks have been pro-posed in the literature. In [2], the authors have applied adiagonal recurrent neural network (DRNN) as a controllerfor both single-input single-output (SISO) and multiple-input multiple-output (MIMO) plants. The responses ofplants obtained with DRNN are compared with thoseobtained when a multilayer feedforward neural network isused as a controller. In [15], recurrent neural networks havebeen used for providing speed control to the nonlinearmotor-drive system using a model-following control scheme.In [4], an adaptive controller for a class of unknown nonlin-ear discrete-time systems based on a multi-input fuzzy rulesemulated network (MIFREN) is introduced; the neural net-work is assigned to identify the unknown system under con-trol. The authors in [3] designed a nonlinear autoregressivemoving average (NARMA-L2) controller, which is based onan adaptive neurofuzzy inference system. The NARMA-L2controller for a single-link manipulator has also been usedin [16, 17]. A Lyapunov function-based neural networktracking (LNT) strategy for SISO discrete-time nonlineardynamic systems is proposed. The proposed scheme usestwo Lyapunov function neural networks operating as thecontroller and estimator. In [18], both the feedforward andrecurrent neural network approaches are proposed, tested,and compared.

The main contribution of this paper is to propose astrong nonlinear adaptive controller of unknown nonlineardynamical systems based on the approximate models.Another objective is to present a prescriptive method forthe dynamic adjustment of the parameters based on backpro-pagation. The big advantage of the proposed control systemis that it does not require previous knowledge of the model.Our ultimate goal is to determine the control input usingonly the values of the input and output.

In our research study, the strong learning capability ofthe dynamic neural network in identification and control iscombined with the functionality of the approximate modelcontroller structure to propose a novel online NN-basedcontroller for nonlinear single-input single-output (SISO)dynamical systems. The main issues in the field of ANN-based control are the choice of neural network structure tobe used as a controller. In our paper, an attempt has beenmade to compare the three types of neural networks: tworecurrent neural networks, nonlinear autoregressive withexogenous input (NARX) neural network and nonlinearautoregressive and moving average (NARMA-L2), and afeedforward neural network (FFNN). The control systemconfiguration employed in our paper consists of an ANN-based controller in cascade with the plant, and the trainingis performed online.

This study differentiates from the studies in the literaturein terms of mathematically obtaining nonlinear SISO con-troller parameters. Thus, the main novelty of this paper isthat the parameters of the nonlinear SISO controller can beidentified as neural network expressions for nonlinear SISO

systems. All neural network simulations are performed in aMatlab environment. The results indicate that the onlineNARMA-L2, NARX, and FFNN controllers attain goodmodeling and control performances.

The remainder of the paper is organized as follows: Sec-tion 2 includes a brief introduction about NARX, NARMA-L2, and FFNN models and their mathematical formulation.Section 3 includes the discussion on the adaptive control ofnonlinear systems. Section 4 contains the simulation study.In Section 5, the conclusion of the paper is given.

2. Neural Network Approximate Models andTheir Mathematical Formulation

Generally, there are many different neural networks (NN) ofnonlinear models. In this research study, the recurrent andfeedforward neural networks are presented. Since a lot of lit-erature exists on NARX, NARMA-L2, and FFNN, in this sec-tion, a brief introduction regarding their mathematicalformulation is given. Figures 1–3 show the structures ofFFNN, NARX, and NARMA-L2 models, respectively.

2.1. Feedforward Neural Network Model. In a feedforwardneural network, the information moves only in one direction,from the input layer to the output layer, but not vice versa aspresented in Figure 1 [19]. The input vector of FFNN at any kth time instant is denoted by XðkÞ = fx1ðkÞ, x2ðkÞ,⋯xpðkÞg.Thus, there are p numbers of inputs. The weighted sums ofinputs of hidden neurons are denoted by the vector SðkÞwhere SðkÞ = fS1ðkÞ, S2ðkÞ,⋯SqðkÞg. The output of hiddenneurons is denoted by a vector aðkÞ = fa1ðkÞ, a2ðkÞ,⋯aqðkÞg. Further, a tangent hyperbolic function is used as anactivation function for hidden neurons and a linear activa-tion function for output neuron. The input weight vectorWðIÞðkÞ shows the connection weight between the externalapplied inputs and the neurons of a hidden layer. The adjust-able output weight vector, WOðkÞ = fW1OðkÞ,W2OðkÞ,⋯WqOðkÞg, represents the hidden to the output layer connec-tions, and yFFNNðk + 1Þ denotes the FFNN output. Themathematical model of FFNN is given by

Sj kð Þ = 〠p

i=1W Ið Þ

ij xi kð Þ + bj j = 1⋯ q,

aj kð Þ = f Sj kð Þ� �,

yFFNN k + 1ð Þ = 〠q

j=1aj kð ÞW oð Þ

1j kð Þ + bj:

ð1Þ

2.2. NARX Model. The NARX model represents a genericrecurrent neural network having one step ahead output, yNARXðk + 1Þ, depending upon the present and past values ofthe input which are called the exogenous inputs, namely,fuðkÞ, uðk − 1Þ,⋯uðk − du + 1Þg, as well as on its delayedvalues of the output, that is, fyNARX ðkÞ, yNARX ðk − 1Þ,⋯yNARX ðk − dy + 1Þg [10]. In the NARX neural networkmodel, the internal architecture that performs this approxi-mation is the multilayer perceptron (MLP). The dynamic

2 Modelling and Simulation in Engineering

Page 3: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

behavior of the NARX model may be written in the followingform:

yNARX k + 1ð Þ = g

〠N

h=1W oð Þ

h f 〠du

i=1W Ið Þ

ih u k − j + 1ð Þ

+

〠dy

j=1W Ið Þ

jh yNARX k − j + 1ð Þ + b

!2666664

3777775: ð2Þ

Note that in Figure 2, we have assumed that the two delayline memories du and dy are both equal to the order of theplant or different with du ≤ dy, where f and g are a hyper-bolic tangent and a linear activation function characterizingthe hidden and output layers of the MLP, respectively, andN denotes the number of hidden layers.

Output neuron withlinear activationfunction

Output layerHidden layerInput layer

Input vector

Hidden layer with tangenthyperbolic activation function

yFFNN (k+1)

Wo1(k)

Wo(k)WI(k)

a1(k)

a2(k)

a3(k)

aq(k)

x1(k)

x2(k)

x3(k)

xp(k)

Wo2(k)

Wo3(k)

Woq(k)

Figure 1: A feedforward neural network structure.

Multilayerperceptron

z–1

u(k)

u(k–1)

u(k–2)

u(k–n+1)

yNARX(k–n+1)

yNARX(k+1)

yNARX(k–1)

yNARX(k)

z–1

z–1

z–1

z–1

z–1

Figure 2: Nonlinear autoregressive with exogenous input (NARX) model.

Learningalgorithm

yNARMA-L2(k+1)N1

N2

Plantu(k)

z–1

z–1

z–n+1

z–n+1

y(k+1)

+

Figure 3: Nonlinear autoregressive and moving average.

3Modelling and Simulation in Engineering

Page 4: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

2.3. NARMA-L2 Model. The nonlinear autoregressive mov-ing average (NARMA) (Figure 3) is one of the most certi-fied representations of general discrete-time nonlinearsystems. This model representation is used in the form ofthe past, the current, and the future system parameters, asshown in [3]

y k + dð Þ =Φ y kð Þ, y k − 1ð Þ,⋯y k − n + 1ð Þ, u kð Þ,½u k − 1ð Þ,⋯u k − n + 1ð Þ�, ð3Þ

where yðkÞ and uðkÞ are the input and output of the system,respectively, the relative degree d represents the delay of thesystem from control effort u to the output y, and Φ½·� is anonlinear function. This model is not convenient for find-ing a control signal uðkÞ. To overcome this problem, an effi-cient method is proposed by Narendra and Mukhopadhyayby introducing approximation models. Two classes of theNARMA model have been proposed, namely, NARMA-L1and NARMA-L2. It was found that the second class involv-ing two subapproximation functions is more efficient and

TDL

Referencemodel

Nonlinearplant

ControllerNNC

NNapproximate

modelTDL ++

y⁎(k+1)

yr(k+1)

r(k+1)

y(k+1)u(k)

TDL

TDL

Used in the case ofFFNN netwrok

Unknown nonlinearfunctions

ei

ec

Figure 4: Adaptive control using neural network approximate models.

0–4

–2

0

2

4

6

8

y (k

) and

yr(k

)

20 40 60 80 100Time (s)

Reference model outputResponse of a plant

(a)

Time (s)0

–4

–2

0

2

4

yp(k

) and

yr(k

)

20 40 60 80 100

y

yr

(b)

0–4

–2

0

2

u(k

)

20 40 60Time (s)

FFNN controller output

80 100

(c)

0–2

–1

0

2

20 40 60Time (s)

Error = yr–y

80 100

1

×10–3

(d)

Figure 5: Example 1: (a) response for no control action (with r = u = sin ð2πk/25Þ + sin ð2πk/10Þ), (b) outputs of the reference model and theplant with control action, (c) FFNN controller output, and (d) control error.

4 Modelling and Simulation in Engineering

Page 5: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

0–4

–2

0

2

4

Reference model

yr(k

)

20 40 60 80 100

(a)

0–4

–2

0

2

4

yr(k

) and

y(k

)

20 40 60 80 100

y

yr

(b)

0

–4

–2

0

2

u(k

)

20 40 60 80 100NARX controller output

(c)

0–2

–1

0

1

2

20 40 60

×10–3

80 100

Error = yr–y

(d)

Figure 6: Example 1: (a) response of the reference model, (b) outputs of the reference model and the plant with control action, (c) NARXcontroller output, and (d) control error.

0–4

–1

0

2

yr(k

)

20 40 60 80 100

1

Reference model

(a)

0–2

–1

0

1

2

yr(k

) and

y(k

)

20 40 60 80 100

y

yr

(b)

0

–2

0

2

u(k

)

20 40 60 80 100

–1

1

NARMA-L2 controller output

(c)

0

–0.5

0.5

1

2

20 40 60 80 100

0

Error = yr–y

(d)

Figure 7: Example 1: (a) response of the reference model, (b) outputs of the reference model and the plant with control action, (c) NARMA-L2 controller output, and (d) control error.

5Modelling and Simulation in Engineering

Page 6: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

adequate in the identification and adaptation of controlcontexts [20].

yNARMA−L2 k + dð Þ= f0 y kð Þ, y k − 1ð Þ,⋯y k − n + 1ð Þ,½u k − 1ð Þ,⋯u k − n + 1ð Þ�+ g0 y kð Þ, y k − 1ð Þ,⋯y k − n + 1ð Þ,½u k − 1ð Þ,⋯u k − n + 1ð Þ�u kð Þ,

ð4Þ

yNARMA−L2 k + dð Þ=N1 y kð Þ, y k − 1ð Þ,⋯y k − n + 1ð Þ,½½u k − 1ð Þ,⋯u k − n + 1ð Þ�+N2 y kð Þ, y k − 1ð Þ,⋯y k − n + 1ð Þ,½½u k − 1ð Þ,⋯u k − n + 1ð Þ�u kð Þ:

ð5Þ

The NARMA-L2 is obtained by

yNARMA−L2 k + dð Þ

= g

"〠h1

h=1W 1oð Þ

h f

〠du

i=1W 1Ið Þ

ih u k − j + 1ð Þ

+ 〠dy

j=1W 1Ið Þ

jh yp k − j + 1ð Þ + b1

!#

+ g

"〠h2

h=1W 2oð Þ

h f

〠du

i=1W 2Ið Þ

ih u k − j + 1ð Þ

+ 〠dy

j=1W 2Ið Þ

jh yp k − j + 1ð Þ + b2

!#,

ð6Þ

where f and g are, respectively, the activation functions ofthe hidden layers and the linear layers of the networks N1and N2.

Equations (5) to (7) represent single-input single-output(SISO) systems. As it can be seen from equation (4),NARMA-L2 consists of two nonlinear functions, f0 and g0,

which can be approximated using two subnetworks (N1and N2) as presented in equation (5). To design the neuro-controller, the number of delayed plant inputs and outputsis chosen based on a structural model. The size of the hiddenlayer is chosen such that the network can accurately approx-imate the nonlinearity of the system. There are two steps toconstruct the NARMA-L2 controller: identification andcontrol.

The two subfunctions, N1 and N2, are used in the identi-fication phase as well as to compute a signal as follows:

where yr ðk + dÞ is the reference signal to follow. This con-troller can be implemented using the model of theNARMA-L2 system previously identified. If the system isprecisely approximated, the output of the system will beequal to the output of the reference model.

3. Controller Design

The control configuration based on the NN approximatemodel is shown in Figure 4. In this control scheme, a NNmodel is utilized to approximate the nonlinear function of

the unmodeled dynamics. The system model is consideredunknown. The use of neural networks is justified by thisabsence of a model. In this case, three approaches predomi-nate. In the two approaches based on the FFNN and NARXmodels, a single network is used for system control. The thirdapproach based on the NARMA-L2model uses two networksto deduce the controller adaptation law.

3.1. Learning Algorithm. The process of training consists inmodifying the weights in an organized way using an appro-priate algorithm. During the training process, a specified

Table 1: Comparison of the performance index of the proposedcontroller and other controllers (example 1).

Controller MSE Nbr. of iterations Learning rate

RBFN [9] 0.012 2000 0.005

DRNN [2] 0.0253 2000 0.0154

FFNN 1:6366 × 10−31 100 0.1

NARX 5:1093 × 10−19 100 0.1

NARMA-L2 0.25 100 0.1

0

0

2

4

6

8

10

20 40 60Time (s)

80 100

yr(k

) and

y(k

)

yr = referencey = plant output

Figure 8: Plant output and reference model response for n =m = 1.

u kð Þ = yr k + dð Þ −N1 y kð Þ,⋯y k − n + 1ð Þ, u k − 1ð Þ,⋯, u k − n + 1ð Þð Þ½ �N2 y kð Þ,⋯, y k − n + 1ð Þ, u k − 1ð Þ,⋯, u k − n + 1ð Þð Þ , ð7Þ

6 Modelling and Simulation in Engineering

Page 7: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

number of inputs and their desired output are introduced inthe network. Then, the weights are tuned so that the neuralnetwork produces an output close to the target values. The

fundamental training algorithm for multilayer networks isthe backpropagation (BP) algorithm [20]. This algorithm isof iterative type, and it is based on the minimization of a

00

2

4

6

y = plant output

8

20 40 60 80 100

y⁎(k

) and

y(k

)

y⁎ = network output

(a)

00

2

4

6

8

20 40 60 80 100

yr(k

) and

y(k

)

yr = referenceyp = plant output

(b)

0

0

0.5

1

1.5

20 40 60Time (s)

80 100

u(k

)

Controller output

(c)

Time (s)0

0

1

2

3

4

20 40 60 80 100

ec = yr–y

(d)

Figure 9: Example 2: (a) response of an ANN-NARX identification model, (b) response of the plant under the NARX controller, (c) NARXcontroller output, and (d) control error with the NARX model (using n = 3 and m = 2).

0

2

4

6

20 40 60 80 100

yr(k

)

Reference model

(a)

yr(k

) and

y(k

)

0

2

4

6

20 40 60 80 100yr

y

(b)

NARMA-L2 controller output

0

0.5

0

1

1.5

20 40 60 80 100

u(k

)

(c)

Error = y–yr

0

0

5

10

20 40 60 80 100

× 10–3

(d)

Figure 10: Example 2: (a) response of the reference model, (b) response of the plant under the NARMA-L2 controller, (c) NARMA-L2controller output, and (d) control error with the NARMA-L2 model (using n = 3 and m = 2).

7Modelling and Simulation in Engineering

Page 8: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

sum-squared error (MSE) utilizing the optimization gradientdescent method. The MSE is used as the cost function whichis a function of error, which is defined as follows:

E kð Þ = 12〠

N

k=1yr kð Þ − y kð Þð Þ2, ð8Þ

where yrðkÞ and yðkÞ are the desired output of the networkand the actual response of the network on the given inputpattern uðkÞ, respectively, and N is the dimension of thetraining set. The modification of the weights of the jth neu-ron in the μth layer is performed according to the formula:

Wμij k + 1ð Þ =Wμ

ij kð Þ − η∂E∂Wμ

ij

,

bμi k + 1ð Þ = bμi kð Þ − η∂E∂bμi

,

8>>><>>>:

ð9Þ

where

∂E∂Wμ

ij

= ∂E∂Sμij

×∂Sμij∂Wμ

ij

,

∂E∂bμi

= ∂E∂Sμij

×∂Sμij∂bμi

,

Sμij = 〠μ−1

j=1Wμ

ijaμ−1j + bμi :

8>>>>>>>>>>><>>>>>>>>>>>:

ð10Þ

Therefore, aμ = f μðSμijÞ, ∂Sμi /∂Wμij = aμ−1j , and ∂Sμi /∂b

μi = 1:

If we define ∂E/∂Sμij = δμi , then, ∂E/∂W

μij = δ

μi a

μ−1j .

Thus, each element in WμðkÞ and bμðkÞ can be updatedas

Wμij k + 1ð Þ =Wμ

ij kð Þ − ηδμi a

μ−1j ,

bμi k + 1ð Þ = bμi kð Þ − ηδμi :

(ð11Þ

The error δ is defined as follows:

where f ðμÞðxÞ = tan hðxÞ = ðex − e−xÞ/ðex + e−xÞ and f μ+1ðxÞ= x.

4. Results and Discussion

Simulation studies have been carried out using the Matlabsoftware environment to verify the performance of the pro-posed methods. Three different nonlinear dynamical systemsare presented to evaluate the performance of the NN control-lers. Two hidden layers are used with H1NN = 20 and H2NN = 10 (thus, 20 neurons are present in the first and 10 neu-rons in the second hidden layers).

4.1. Example 1. Consider the nonlinear discrete time which isdescribed by the third-order difference equation [19]:

y k + 1ð Þ = 5yp kð Þyp k − 1ð Þ1 + y2p kð Þ + y2p k − 1ð Þ + y2p k − 2ð Þ+ u kð Þ + 0:8u k − 1ð Þ:

ð13Þ

The system can be reformulated as

y k + 1ð Þ = h y kð Þ, y k − 1ð Þ, y k − 2ð Þð Þ + u kð Þ + 0:8u k − 1ð Þ:ð14Þ

A reference model is described by the third-order differ-ence equation:

yr k + 1ð Þ = 0:32yr kð Þ + 0:64yr k − 1ð Þ − 0:5yr k − 2ð Þ� + r kð Þ,ð15Þ

where rðkÞ is a bounded reference input. The function h isconsidered to be unknown; it can be estimated using neuralnetwork Nh. The control input to the plant at any instant kis computed using Nhð−Þ in place of h.

If yðk + 1Þ = yrðk + 1Þ, then,

u kð Þ = −Nh y kð Þ, y k − 1ð Þ, y k − 2ð Þ½ � − 0:8u k − 1ð Þ+ 0:32yr kð Þ + 0:64yr k − 1ð Þ − 0:5yr k − 2ð Þ + r kð Þ,

ð16Þ

δμj kð Þ =

−f ′ Sμj kð Þ� �

e kð Þ, for μ =M OLð Þ,

f ′ Sμj kð Þ� �

〠μ+1

p=1δμ+1p kð ÞWμ+1

pj

� �, for μ = 1,⋯,M − 1 HLð Þ,

8>>><>>>:

δμj kð Þ =

−e kð Þ, for μ =M OLð Þ,1 − a2j kð Þ� �

δμ+1 kð ÞWμ+1ij

� �, for μ = 1,⋯,M − 1 HLð Þ,

8<:

ð12Þ

8 Modelling and Simulation in Engineering

Page 9: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

whereas for NARMA-L2 the control signal is generated basedon equation (7):

u kð Þ = yr k + dð Þ − f0 y kð Þ, y k − 1ð Þ, y k − 2ð Þ, u k − 1ð Þð Þ½ �g0 y kð Þ, y k − 1ð Þ, y k − 2ð Þ, u k − 1ð Þð Þ :

ð17Þ

N1 and N2 are used to learn f0ð·Þ and g0ð−Þ; then,

u kð Þ = yr k + dð Þ −N1 y kð Þ, y k − 1ð Þ, y k − 2ð Þ, u k − 1ð Þð Þ½ �N2 y kð Þ, y k − 1ð Þ, y k − 2ð Þ, u k − 1ð Þð Þ :

ð18Þ

The simulation reported in Figures 5–7 indicates stableand efficient online control. The improvements in theresponses, when the neural networks in the approximatemodel are used to generate the control input to the plant,are evident from the figure. The outputs of the controlledplant and the reference model are shown and indicate thatthe output error is almost zero. All three neural networks

FFNN-, NARX-, and NARMA-L2-based controllers pro-vided satisfactory results.

The performance index of the different controllers withvarious neural network models is given in Table 1. We cannotice that all the designed controllers give better perfor-mance. Nevertheless, the performance of the FFNN andNARX indicated better attainment regarding the perfor-mance indices (MSE).

4.2. Example 2. Consider the nonlinear discrete-time system[1, 17]:

y k + 1ð Þ = sin y kð Þ½ � + u kð Þ 5 + cos y kð Þu kð Þ½ �ð Þ, ð19Þ

where yðkÞ stands for the system output and uðkÞ is the con-trol input at time index k. The output yðk + 1Þ is required totrack the desired trajectory yrðk + 1Þ given in

yr kð Þ = sin 2πk10

� �+ sin 2πk

25

� �� �× r kð Þ: ð20Þ

The order of the plant is n = 1, so the inputs for the FFNNcontroller are yrðkÞ and yðkÞÞ and the inputs for theNARMA-L2 controller are yðkÞ and uðkÞÞ, and NARXmodels are y∗ðkÞ, yðkÞ,and uðkÞÞ.

The control results for different epochs and learning ratesalong with control error are shown in Figure 8. As we can seefrom the results, the network is unstable using n =m = 1 inthe delayed input/output (not enough information).

Table 2: Comparison of the performance index of the proposedcontroller (example 2).

Controller MSE Nbr. of iterations Learning rate

FFRN 0.0698 100 0.01

NARX 1:0027 × 10−13 300 0.01

NARMA-L2 2:99 × 10−6 100 0.01

yr(k

) and

y⁎(k

)

0

2

4

6

8

50 100

yr

y⁎

(a)

yr(k

+1) a

nd y

(k+1

)

0

2

4

6

8

50 100yr

y

(b)

FFNN controller output

u(k

)

0

0.5

0

1

1.5

2

50 100

(c)

ec

0

–1

0

1

50 100

(d)

Figure 11: Example 2: (a) response of an ANN-FFNN identification model, (b) response of the plant under the FFNN controller, (c) FFNNcontroller output, and (d) control error with the FFNN model (using n = 3 and m = 2).

9Modelling and Simulation in Engineering

Page 10: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

The model of discrete-time plants introduced here can bealso described by the following nonlinear difference equations:

y k + 1ð Þ = h y kð Þ, y k − 1ð Þ,⋯, y k − n + 1ð Þ½ � + 〠m−1

i=0βu k − ið Þ:

ð21Þ

The same proposed scheme in Figure 4 is considered. Toapproximate the unknown h, an FNN-based identificationmodel is used:

y∗ k + 1ð Þ =Nh y kð Þ, y k − 1ð Þ½ � + u kð Þ: ð22Þ

The control action is required to get yrðkÞ = yðkÞ.In this example, performance comparisons of the BP-

NNs are carried out with the three approximate models,FFNN, NARX, and NARMA-L2. The results are shown inFigures 9–11. Also, notice that after sufficient online trainingof the plant, it has also converged to the desired response.The result during the training is presented in the figures. Itcan be seen from these figures that the control error (ec)reduces quickly to zero in the case of the NARX andNARMA-L2 controllers as compared to the control errorobtained with FFNN. This suggests the strong learning abilityof recurrent NN models over FFNN in this example.

The numerical parameters used in the second system arepresented in Table 2, as well as the mean square error (MSE)obtained with different controllers.

4.3. Example 3. The second-order differential equation whichdescribes the dynamics of a single-link robotic manipulator isgiven as

ml2d2y tð Þdt2

+Ddy tð Þdt

+mgl cos y tð Þð Þ = u tð Þ: ð23Þ

The angular position of the robotic manipulator arm isrepresented by yðtÞ. The other parameters include link lengthwhich is denoted by l. Also, the term DðdyðtÞ/dtÞ quantifiesthe viscous friction torque, and g = 9:8m/s2 is the accelera-tion due to gravity. For simplicity, the values of m = l =D =1 are used in this paper. Further, u ðtÞ is the control torqueexerted on the robotic arm. The corresponding state spacerepresentation of the above differential equation is given by

_y

€y

" #=

0 1−g cos yð Þ

l−Dml2

24

35 y

_y

" #+

01ml2

24

35 u½ �: ð24Þ

The difference equation of the one-link robotic manipu-lator with a sampling period is given by

y k + 1ð Þ = h y kð Þ, y k − 1ð Þ½ � + T2u k − 1ð Þ, ð25Þ

where the nonlinear function h is

h y kð Þ, y k − 1ð Þ½ � = 2 − Tð Þy kð Þ + y k − 1ð Þ T − 1ð Þ− 9:8T2 cos y k − 1ð Þð Þð :

ð26Þ

The desired reference model dynamics is given by the fol-lowing difference equation:

yr k + 1ð Þ = yr kð Þ 2 − 1:5Tð Þ + yr k − 1ð Þ� −1 − 2:5T2 + 1:5T� �

+ T2r k − 1ð Þ, ð27Þ

where rðkÞ = sin ðkTÞ is the externally applied input.Before control action, the sampling period T should be

chosen with care. It is taken to be T = 0:4. In this part, the

0

–2

–1

0

1

20 40 60Time (s)

80 100

y(k

) and

yr(k

)

Reference model outputResponse of a plant

Figure 12: Reference model and open-loop response of the plant without a controller (example 3).

Table 3: Comparison of the performance index of the proposedcontroller and other controllers (example 3).

Controller MSE Nbr. of iterations Learning rate

RBFN [9] 0.1427 2000 0.027

DRNN [2] 0.0288 800 0.0354

FFNN 9:644 × 10−32 1000 0.05

NARX 2:1077 × 10−31 500 0.1

NARMA-L2 1:802 × 10−31 100 0.01

10 Modelling and Simulation in Engineering

Page 11: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

Reference model output

0

–1

0

1

20 40 60 80 100

yr(k

)

(a)

0

–1

–2

0

1

2

20 40 60 80 100

yr(k

) and

y(k

)

yr

y

(b)

FFNN controller output

0

0

5

10

20 40 60 80 100

u(k

)

(c)

Error = yr–y

× 10–3

0

–1

–2

0

1

2

20 40 60 80 100

(d)

Figure 13: Example 3: (a) response of the reference model, (b) response of the plant under the adaptive controller, (c) FFNN controlleroutput, and (d) control error (using n = 2 and m = 2) (online learning).

yr = reference model output

0

–1

0

1

20 40 60 80 100

yr(k

)

(a)

yr

y

0

–1

0

1

20 40 60 80 100

yr(k

) and

y(k

)

(b)

NARX controller output

0

0

5

10

20 40 60 80 100

u(k

)

(c)

ec = yr–y

0

–0.5

–1

0

0.5

1

20 40 60 80 100

(d)

Figure 14: Example 3: (a) response of the reference model, (b) response of the plant under the adaptive controller, (c) NARX controlleroutput, and (d) control error (using n = 2 and m = 2).

11Modelling and Simulation in Engineering

Page 12: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

control is to make the robotic link output follow the referencetrajectory signal. The response of the plant without control isshown in Figure 12. Clearly, the plant’s output is not follow-ing the reference input. So, the control scheme is set up andthe training is continued for 100 epochs, and each epoch con-tains 100 training samples.

In the simulation studies, N1 and N2 were multilayerneural networks chosen with three-layer networks with pinputs, 20 neurons in the first hidden layer, 10 neurons inthe second hidden layer, and one output neuron.

From equation (25), the control input uðkÞ can be com-puted from acknowledging yðk + 1Þ and its past values as

u kð Þ = −f y kð Þ, y k − 1ð Þ½ � + y k + 1ð Þ½ � × 1T2 ,

u kð Þ = −f y kð Þ, y k − 1ð Þ½ � + y kð Þ 2 − 1:5Tð Þ + y k − 1ð Þ½� −1 − 2:5T2 + 1:5T� �

+ T2r k − 1ð Þ� × 1T2 ,

r kð Þ = sin 2πk25

� �+ sin 2πk

10

� �:

ð28Þ

The mean square error (MSE) obtained with differentcontrollers for example 3 is presented in Table 3. From thetable, it can be seen that the MSE obtained with FFNN,NARX, and NARMA-L2 is minimum as compared to theMSE obtained with the RBFN- and DRNN-based controllers.

In this study, all the three methods provide simultaneousstructure and parameter learning within the approximatemodels. The learning rate, η, is taken to be 0.01. FromFigures 13–15, it can be seen that the response of the roboticlink is successfully controlled.

5. Conclusions

This paper describes the application of NN models as a con-troller. Both feedforward and two recurrent NARX andNARMA-L2 predictors are proposed, tested, and compared.The method for the adjustment of parameters in generalizedneural networks is treated, and the concept of dynamic backpropagation is introduced. The training of all the three neuralnetworks is done online. Simulation and comparative studiesdemonstrate the superior performance of the proposedapproaches. It can be concluded that the ANNs can be suc-cessfully utilized for controlling different nonlinear dynamicsystems. In addition, future works will explore the adaptiveneural network control for nonlinear MIMO systems underdisturbances using the hybrid learning method.

Data Availability

No data were used to support this study.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Reference model output

yr(k

)

0

–0.5

0

0.5

20 40 60 80 100

(a)

yr = Referencey = plant output

yr(k

) and

y(k

)

0

–0.5

0

0.5

20 40 60 80 100

(b)

NARMA-L2 controller output

u (k

)

0

0

5

10

20 40 60 80 100

(c)

× 10–3

0

–1

–2

0

1

2

20 40 60 80 100

Error = yr–y

(d)

Figure 15: Example 3: (a) response of the reference model, (b) response of the plant under the adaptive NARMA-L2 controller, (c) controlleroutput, (d) control error (using n = 2 and m = 2).

12 Modelling and Simulation in Engineering

Page 13: Adaptive Control Using Neural Networks and Approximate ...dynamic systems is proposed. The proposed scheme uses two Lyapunov function neural networks operating as the controller and

References

[1] A. Askarzadeh, “A novel metaheuristic method for solving con-strained engineering optimization problems: crow search algo-rithm,” Computers and Structures, vol. 169, pp. 1–12, 2016.

[2] R. Kumar, S. Srivastava, and J. R. P. Gupta, “Diagonal recur-rent neural network based adaptive control of nonlineardynamical systems using Lyapunov stability criterion,” ISATransactions, vol. 67, pp. 407–427, 2017.

[3] Y. Al-dunainawi, M. F. Abbod, and A. Jizany, “A new MIMOANFIS-PSO based NARMA-L2 controller for nonlineardynamic systems,” Engineering Applications of Artificial Intel-ligence, vol. 62, pp. 265–275, 2017.

[4] C. Treesatayapun, “Nonlinear discrete-time controller withunknown systems identification based on fuzzy rules emulatednetwork,” Applied Soft Computing, vol. 10, no. 2, pp. 390–397,2010.

[5] K. El Hamidi, M. Mjahed, A. El Kari, and H. Ayad, “Neuraland fuzzy based nonlinear flight control for an unmannedquadcopter,” International Review of Automatic Control,vol. 11, no. 3, pp. 98–106, 2018.

[6] X. L. Li, C. Jia, D. X. Liu, and D. W. Ding, “Adaptive control ofnonlinear discrete-time systems by using OS-ELM neural net-works,” Abstract and Applied Analysis, vol. 2014, Article ID267609, 11 pages, 2014.

[7] K. El Hamidi, M. Mjahed, A. El Kari, and H. Ayad, “Quadcop-ter attitude and altitude tracking by using improved PD con-trollers,” International Journal of Nonlinear Dynamics andControl, vol. 1, no. 3, pp. 287–303, 2019.

[8] Z. Cömert and A. F. Kocamaz, “A study of artificial neural net-work training algorithms for classification of cardiotocographysignals,” Bitlis Eren University Journal of Science and Technol-ogy, vol. 7, no. 2, pp. 93–103, 2017.

[9] R. Kumar, S. Srivastava, and J. R. P. Gupta, “Comparativestudy of neural networks for control of nonlinear dynamicalsystems with lyapunov stability-based adaptive learning rates,”Arabian Journal for Science and Engineering, vol. 43, no. 6,pp. 2971–2993, 2018.

[10] S. Haykin and N. Network, “A comprehensive foundation,”Neural Networks, vol. 2, no. 2004, p. 41, 2004.

[11] K. Patan, Artificial Neural Networks for the Modelling andFault Diagnosis of Technical Processes, Springer, 2008.

[12] H. Wu, Y. Zhou, Q. Luo, and M. A. Basset, “Training feedfor-ward neural networks using symbiotic organisms search algo-rithm,” Computational intelligence and neuroscience, vol. 2016,Article ID 9063065, 14 pages, 2016.

[13] K. S. Narendra and K. Parthasarathy, “Identification and con-trol of dynamical systems using neural networks,” IEEE Trans-actions on Neural Networks, vol. 1, no. 1, pp. 4–27, 1990.

[14] E. Diaconescu, “The use of NARX neural networks to predictchaotic time series,”Wseas Transactions on computer research,vol. 3, no. 3, pp. 182–191, 2008.

[15] K. Nouri, R. Dhaouadi, and N. B. Braiek, “Adaptive control ofa nonlinear dc motor drive using recurrent neural networks,”Applied Soft Computing, vol. 8, no. 1, pp. 371–382, 2008.

[16] R. Celikel, “NARMA-L2 controller for single link manipula-tor,” in 2018 International Conference on Artificial Intelligenceand Data Processing (IDAP), pp. 1–6, Malatya, Turkey, 2018.

[17] M. S. Aftab and M. Shafiq, “Neural networks for tracking ofunknown SISO discrete-time nonlinear dynamic systems,”ISA Transactions, vol. 59, pp. 363–374, 2015.

[18] Y. Gao and M. J. Er, “NARMAX time series model prediction:feedforward and recurrent fuzzy neural network approaches,”Fuzzy sets and systems, vol. 150, no. 2, pp. 331–350, 2005.

[19] R. G. S. Asthana, “Evolutionary algorithms and neural net-works,” in Soft Computing and Intelligent Systems, pp. 111–136, Elsevier Inc., 2000.

[20] M. T. Hagan, H. B. Demuth, M. H. Beale, and O. De Jess, Neu-ral Network Design, vol. 20, Pws Pub, Boston, 1996.

13Modelling and Simulation in Engineering