Available via license: CC BY-NC-ND 4.0
Content may be subject to copyright.
Journal Pre-proof
Application of a GA-Optimized NNARX Controller to Nonlinear Chemical and
Biochemical Processes
Bijan Medi, Ayyob Asadbeigi
PII: S2405-8440(21)01949-6
DOI: https://doi.org/10.1016/j.heliyon.2021.e07846
Reference: HLY 7846
To appear in: HELIYON
Received Date: 1 May 2021
Revised Date: 9 August 2021
Accepted Date: 18 August 2021
Please cite this article as: B. Medi, A. Asadbeigi, Application of a GA-Optimized NNARX
Controller to Nonlinear Chemical and Biochemical Processes, HELIYON, https://doi.org/10.1016/
j.heliyon.2021.e07846.
This is a PDF file of an article that has undergone enhancements after acceptance, such as the addition
of a cover page and metadata, and formatting for readability, but it is not yet the definitive version of
record. This version will undergo additional copyediting, typesetting and review before it is published
in its final form, but we are providing this version to give early visibility of the article. Please note that,
during the production process, errors may be discovered which could affect the content, and all legal
disclaimers that apply to the journal pertain.
© 2021 The Author(s). Published by Elsevier Ltd.
1
Application of a GA-Optimized NNARX Controller to Nonlinear
1
Chemical and Biochemical Processes
2
Bijan Media*, Ayyob Asadbeigib
3
a Department of Chemical Engineering, Hamedan University of Technology, P.O. Box 65155-
4
579, Hamedan, Iran.
5
b Department of Electrical Engineering, Islamic Azad University, Hamedan Branch,
6
Hamedan, Iran.
7
*Correspondence to: medi@hut.ac.ir
8
Abstract
9
Chemical and biochemical processes generally suffer from extreme nonlinearities with respect to
10
internal states, manipulated variables, and also disturbances. These processes have always
11
received special technical and scientific attention due to their importance as the means of large-
12
scale production of chemicals, pharmaceuticals, and biologically active agents. In this work, a
13
general-purpose genetic algorithm (GA)-optimized neural network (NNARX) controller is
14
introduced, which offers a very simple but efficient design. First, the proof of the controller
15
stability is presented, which indicates that the controller is bounded-input bounded-output
16
(BIBO) stable under simple conditions. Then the controller was tested for setpoint tracking,
17
handling modeling error, and disturbance rejection on two nonlinear processes that is, a
18
continuous fermentation and a continuous pH neutralization process. Compared to a
19
conventional proportional-integral (PI) controller, the results indicated better performance of the
20
controller for setpoint tracking and acceptable action for disturbance rejection. Hence, the GA-
21
optimized NNARX controller can be implemented for a variety of nonlinear multi-input multi-
22
output (MIMO) systems with minimal a-priori information of the process and the controller
23
structure.
24
25
Keywords: Chemical, Biochemical, Nonlinear, Controller, Neural Network, Genetic Algorithm.
26
27
1 Introduction
28
Chemical and biochemical processes are among some of the most vital and yet nonlinear
29
modern industrial processes under technical and scientific considerations. A variety of chemicals
30
Journal Pre-proof
2
and active biological agents are produced in such systems [5, 6], while they are operated under
31
extreme working standards to comply with stringent production regulations and a competitive
32
global market.
33
Control of chemical and biochemical processes is a challenging task due to nonlinearities
34
associated with their internal states, manipulated variables, and also disturbances [26] as well as
35
their time variability [6], which is inherent to many chemical and biochemical systems [3, 27].
36
The controller design for nonlinear processes has been studied in numerous works. Fernández et
37
al. [10] studied a simple but efficient technique for tracking optimal profiles with error
38
minimization for nonlinear biochemical processes, which was based on linear algebra for the
39
calculation of control actions. The performance of the designed controller was tested through
40
simulations by adding parametric uncertainty and perturbations in the initial conditions.
41
Aguilar-López et al. [1] introduced an uncertainty-based observer with a polynomial structure
42
capable of estimating the unknown modeling error of a continuous bioreactor coupled to a linear
43
input-output controller. In Mailleret et al. [19], a nonlinear adaptive control and the global
44
asymptotic stability of closed-loop system were investigated for a bioreactor with unknown
45
kinetics. They verified their approach on a real-life wastewater treatment plant.
46
Artificial neural networks (ANNs) are general-purpose modeling tools that can be used for
47
various applications, including static and dynamic modeling, clustering, and pattern recognition
48
[8, 9, 30, 35]. ANN is useful in particular when modeling with fundamental governing equations
49
is costly, time-consuming or both [11, 22].
50
Naregalkar and Subbulekshmi [25] proposed a novel approach using NARX (nonlinear auto-
51
regressive with exogenous input) model and enhanced moth flame optimization (EMFO) for pH
52
neutralization of wastewater. They evaluated their method in terms of integral squared error
53
(ISE), integral absolute error (IAE), mean squared error (MSE), settling time, and peak
54
overshoot.
55
del Rio-Chanona et al. [7] utilized an ANN model for dynamic modeling and optimization of a
56
15-day fed-batch process for cyanobacterial C-phycocyanin production. To generate additional
57
datasets, they artificially introduced random noise to the original dataset. They also chose the
58
change of state variables as training data output.
59
The lack of online information on some bioprocess variables and the presence of model and
60
parametric uncertainties are important challenges for the control of such processes. To address
61
these issues, Rómoli et al. [29] proposed an online state estimator based on a Radial Basis
62
Journal Pre-proof
3
Function (RBF) neural network that feeds information to a controller, which was derived via a
63
linear algebra-based design strategy.
64
Intelligent methods can also be used to control nonlinear chemical and biochemical processes.
65
These approaches can compensate modeling errors, tackle the occurrence of disturbances, and
66
advise optimal operation scenarios as control actions. Ünal et al. [33] reviewed different aspects
67
of using artificial intelligence and evolutionary algorithms i.e., genetic algorithm (GA) and ant
68
colony (AC) for PID controller tuning on real-time experimental setups. The performances of
69
these three techniques were compared with each other using the criteria of overshoot, rise time,
70
settling time, and root mean square (RMS) error of the trajectory. It was observed that the
71
performances of GA and AC are better than that of Ziegler-Nichols technique.
72
Latha et al. [17] used particle swarm optimization (PSO) algorithm for tuning of a proportional-
73
integral-derivative (PID) controller for a class of time-delayed stable and unstable process
74
models. The dimension of the search space was only three tuning parameters of conventional
75
PID controllers. They tested their approach in real-time on a nonlinear spherical tank system.
76
The real-time result with PSO-tuned PID offered better results for reference tracking, multiple
77
reference tracking, and disturbance rejection problems.
78
More recently, intensive studies have been conducted for designing the NARX network
79
architecture to enhance modeling accuracy and versatility. In this regard, various methods have
80
been proposed for activation function selection and network weights and biases tuning via
81
optimization by different algorithms. Liu et al. [18] considered NARX neural networks for
82
analysis and identification of noisy nonlinear magnetorheological (MR) damper systems. The
83
accuracy of their results supports the use of this modeling technique for identifying irregular
84
nonlinear models of MR dampers and similar devices. Rankovic et al. [28] developed a nonlinear
85
model predictive control (NMPC) scheme, with the assumption that the object model is
86
unknown. Therefore, they used a digital recurrent network (DRN) model instead to predict the
87
future evolution of the system, which is essential for model predictive control. From their
88
framework, one can infer that designing the network structure is crucial and complex.
89
Combination of NARX models with genetic algorithm has been used for forecasting, which
90
subsequently can be used for decision making. Han et al. [13] utilized a NARX network for
91
bitcoin price forecasting and concluded that genetic algorithm was effective to decide the
92
architecture of the NARX neural network better than some other information criteria.
93
In a similar study to our work, Hernández-Alvarado et al. [14] used a neural NARX network to
94
optimize PID controller gains for an underwater remotely operated vehicle in simulation and also
95
Journal Pre-proof
4
in a real-time manner. They took into consideration two criteria to assess the performance of the
96
controllers: position tracking error and energy consumption, leading to the conclusion that the
97
proposed method obtained the best performance with less energy.
98
In this work, we propose a general-purpose neural network-based NARX controller, which
99
does not rely on a predefined form of any conventional controller, but can emulate a PI action.
100
We will show that the controller can be tuned on some simple data sets, and hence might be
101
tuned in an online manner similar to Ziegler-Nichols closed-loop tuning procedure [32]. We
102
evaluated the controller performance on a continuous fermentor model as a nonlinear single-
103
input single-output (SISO) process. Furthermore, as the importance of pH in chemical and
104
biochemical processes cannot be overemphasized, it has also been taken into consideration in
105
this study as a highly nonlinear multi-input multi-output (MIMO) system.
106
After introducing the controller structure and elaborating on its stability conditions, the tuning
107
procedure is described, which was done using genetic algorithm optimization of the network
108
weights. In the results section, the performance of the controller is tested for setpoint tracking,
109
modeling error, and disturbance rejection scenarios, and compared with a conventional PI
110
controller.
111
112
2 NARX formulation
113
The nonlinear autoregressive model with exogenous input (NARX) is a time series model,
114
which is represented as a function of the model output and one or more independent inputs all at
115
several past time steps. In the predictive form, a NARX model can be represented by:
116
( 1) ( ), , ( ), ( ), ( 1), ( )
( ) 0,1, ,
( ) 0,1, ,
i
j
y k f y k y k n u k u k u k m
y i y i n
u j u j m
(1)
where y is the network output, u is the network input, and f can be any linear or nonlinear
117
analytic function.
118
Journal Pre-proof
5
119
Fig. 1: General structure of a NNARX feedforward neural network with tapped delay lines.
120
3 Neural network structure
121
Artificial neural networks appear in a variety of architectures [30]. Specifically, the feedforward
122
ANNs can be readily extended to the NARX networks with the introduction of tapped delay lines
123
at the network input or even between layers, as shown in Fig. 1. In this regard, the new
124
architecture is called a neural NARX or NNARX network. In addition, such networks may have
125
one or more feedback lines from outputs or hidden layers enclosing several layers of the
126
network, which are not shown in Fig. 1 since such feedback lines are not included in our
127
NNARX approach. This structure offers several interesting characteristics including time series
128
prediction and nonlinear input-output realization of dynamic systems.
129
It is worthy of attention that this network is fully connected, which means there is a connection
130
between every input and every neuron in each layer. The importance of these connections is
131
controlled by the weight parameters, while bias parameters shift the network output to a suitable
132
position. Typically, all weights and biases are regulated by any convenient optimization
133
algorithm.
134
It must be also noted that Fig. 1 refers to a specific structure of NARX networks that do not
135
directly receive y output(s) as their inputs. In our case, y as the controller output (manipulated
136
variable) is resolved in the closed-loop response of the process and does not directly appear as
137
the network input.
138
In fact, many control schemes are a stable subset of linear or nonlinear dynamic systems.
139
Therefore, a NNARX model can be utilized as a nonlinear parametric controller. As we will see
140
T
D
L
1()ut
(1,1)
IW
T
D
L
2()ut
1
(1,2)
IW
T
D
L
1,1()at
n
b
( 1, )nn
LW
1
b
()yt
Inputs Hidden Layer 1 Output Layer
Journal Pre-proof
6
in the results section, this structure may add integral effect to the control action, while it acts as
141
an efficient nonlinear predictor. When combined together, these effects can be considered an
142
inverse model controller with integral effect.
143
144
3.1 Proof of BIBO stability
145
According to the Gronwall Lemma [15], if
,,
n n n
f g h
are real nonnegative sequences for
0n
146
1
0
n
n n k k
k
h f g h
(2)
147
148
Then
149
11
01
exp( )
nn
n n k k j
k j k
h f g f g
(3)
150
151
Theorem 1. The system (1) is bounded-input bounded-output (BIBO) stable with the initial
152
conditions
() p
y p y
for
,...,p k k n
if it is Lipchitz with the constants
i
L
,
i
L
and
153
0,...,in
,
0,...,jm
.
154
Proof.
155
Consider
()
k
y y k
and
()
k
u u k
for simplification. Hence:
156
11 ( ,..., , ,..., ) ( ,..., , ,..., )
k p k k n k k m p p n p p m
y y f y y u u f y y u u
(4)
157
158
0 0 0
k i p i k i ki pi
n m k
ii
i i i i
y y u u hL L g f
(5)
159
Here
1
0k i p
m
m j k
ii
fuuLf
and
ii
gL
,
,,
k i k i p i
h y y
1, 1 1k i k i p i
h y y
,
160
1 1,0 1 1k k k p
h h y y
,
,0k k k p
h h y y
,
,i k i k i p i
h h y y
.
161
From the Gronwall Lemma we have
162
0 0 1
11 0exp( )
k p k i p i k l
k k i k
i i i j
i i l i
lj
p
y Ly u u LuuLL
. (6)
163
Since we supposed that the initial condition is bounded, we easily obtain
164
0 0 1
11 0exp( )
k p k i p i k l
k k i k
i i i j
i i l i
lj
p
y Ly u u LuuLL
(7)
165
166
which according to the assumptions all terms are bounded, and this yields the required result.
167
Journal Pre-proof
7
168
4 NNARX Controller tuning
169
Genetic algorithm (GA) is a heuristic optimization method inspired by the so-called evolution
170
process in nature [12, 23] as it mimics the evolutionary operators: selection, crossover, and
171
mutation to achieve a fitter population of solutions (individuals) over iterations (generations).
172
The main advantages of this algorithm are that GA does not require calculating any derivatives.
173
Hence in the case of the current problem, any sort of network topology and transfer function can
174
be used without a-priori assumption on their exact formulations, which otherwise were needed
175
for differentiation. On the other hand, as there are no derivates involved, the controller structure
176
is not significantly affected by the noise effects if implemented on an actual process. Moreover,
177
the error term(s) can be arbitrarily defined as a function of closed-loop response as utilized in
178
this work. It must be emphasized that for higher-order systems (more delays and/or MIMO
179
systems), the solution space grows tremendously, rendering classical gradient-based optimization
180
methods inefficient.
181
The objective function for tuning is defined as the weighted sum of the mean squared errors
182
(MSE) of the tracking tasks over time as:
183
2
11
()
mN
ii
ik
w e k
MSE N
(8)
184
( ) ( ) ( )
i spi mi
e k y k y k
(9)
185
where ei is the tracking error and ymi and yspi are the ith measured output and its respective
186
setpoint. wis are arbitrary weights, which regulate the importance of the error terms. They are set
187
to unity in this work.
188
It must be emphasized that ei is the input to the NNARX controller, while the manipulated
189
variables are the network outputs. On the other hand, the GA-optimizer receives MSE values for
190
every individual, and returns the NNARX weight (and bias) values (x in Fig. 2) to the network.
191
The overall scheme of the closed-loop diagram is shown in Fig. 2. Hence, the optimizer calls the
192
closed-loop system model for a sufficiently large number of times until it concludes that no
193
better solution can be found.
194
Journal Pre-proof
8
195
Fig. 2: General closed-loop structure of the control scheme with the GA-optimized NNARX.
196
5 PI controller tuning
197
For the sake of comparison, a PI controller is selected and tuned by model parameters. In this
198
regard, a first-order plus time delay (FOPTD) model is fitted to the open-loop step response of
199
the selected processes. The tests data and the results are given in Table 1. The regression was
200
implemented via the sequential quadratic programming (SQP) approach to minimize MSE,
201
which is defined similar to Eq. 8 but without the weight parameters. It must be emphasized that
202
only process gain and time constant are fitted as the process time delay is considered to be equal
203
to one sample time, which is a reasonable assumption, considering the response time of the
204
measurement sensors.
205
206
Table 1: Step response test parameters, regression results, and PI controller tuning parameters.
207
Parameter
Fermentation Process
Neutralization
process (Level)
Neutralization
process (pH)
Step size
-0.01 (Dilution rate)
+5 ml/s (Acid)
+5 ml/s (Base)
Sample time
0.1 h
1 s
1 s
Process gain (kp)
-31.9
0.92
0.60
Process time constant (
)
5.24 h
196.2 s
33.2 s
Process time delay (
D
t
)
0.1 h
1 s
1 s
MSE
1.15×10-4
1.50×10-6
1.76×10-3
Proportional gain (
c
k
)
-0.274
53.2
13.9
Integral time (
I
)
2.4
16
16
Derivative time (
D
)
-
-
-
208
According to the Skogestad’s SIMC PID tuning rule [31], the following formulas are suggested
209
based on the FOPTD model parameters:
210
1
cp c D
kkt
(10)
211
NNARX
Controller Process
ym
yp
Measurement
ysp
e
GA
Optimizer
x
y
Journal Pre-proof
9
min ,4
I c D
t
(11)
212
where kp, τ, and tD are process gain, time constant, and time delay, respectively. Also, kc and τI
213
are controller proportional gain and integral time, respectively. It is apparent that the suggested
214
controller is in the PI mode. Hence the derivative mode is deactivated (
0
D
).
215
On the other hand, τc is the desired closed-loop time constant and the only tuning degree of
216
freedom. Skogestad [31] suggests that a good trade-off can be obtained by choosing τc equal to
217
process time delay. Hence, the values of 0.1 h and 1 s were initially used for the closed-loop time
218
constant of the continuous fermentation and pH neutralization processes, respectively. However,
219
these settings make the closed-loop response of both processes unstable. Hence, these values
220
were modified to 0.5 h and 3 s as the closed-loop time constants of the studied processes,
221
respectively.
222
6 Modeling
223
We have considered two typical nonlinear chemical and biochemical processes. The first process
224
is a continuous fermentor in which the biomass (cell-mass) concentration in g/l is the controlled
225
variable (plant output), while the manipulated variable (plant input) is the dilution rate,
226
representing a nonlinear SISO system.
227
A rather simplified but general form of the process is shown in Fig. 3 and represented by the
228
following equations [16]:
229
230
X DX X
(12)
/s
1
fx
S D S S X
Y
(13)
P DP X
(14)
2
1
/
mm
mi
P P S
K S S K
(15)
where D is the dilution ratio, X is the cell-mass concentration, S is the substrate concentration,
231
which is consumed by the microorganism, and Sf is the substrate concentration in the feed
232
stream. P is the product concentration and Pm is the product saturation constant.
/sx
Y
is the cell-
233
mass yield. α and β are kinetic parameters of the fermentation reaction. µ is the growth rate and
234
µm is the maximum growth rate. Km and Ki are substrate saturation and inhibition constants,
235
respectively [16]. The nominal parameter values are given in Table 2.
236
Journal Pre-proof
10
237
Fig. 3: Fermentation process diagram. X is the cell-mass concentration (measured variable), S is
238
the substrate concentration, and P is the product concentration.
239
Table 2: The nominal parameter values for the continuous fermentation process [16].
240
Parameter
Value
Unit
D
0.202
1/h
Ki
22
g/l
Km
1.2
g/l
P
19.14
g/l
Pm
50
g/l
S
5.0
g/l
Sf
20.0
g/l
X
6.0
g/l
Yx/s
0.4
g/g
α
2.2
g/g
β
0.2
1/h
µm
0.48
1/h
241
The second example is a neutralization process in which the liquid level of the tank and the
242
effluent pH are the controlled variables, while acid and base flow rates are the manipulated
243
variables. It is clear that this system is a MIMO process, as shown in Fig. 4.
244
The governing equations are given as follows:
245
0.5
1 2 3
1V
h q q q C h
A
(16)
246
4 1 4 1 2 4 2 3 4 3
1
a a a a a a a
W W W q W W q W W q
Ah
(17)
247
4 1 4 1 2 4 2 3 4 3
1
b b b b b b b
W W W q W W q W W q
Ah
(18)
248
249
where h is the liquid level in the neutralization tank, and A is the tank cross-section. CV is the
250
outlet valve discharge coefficient, which is a constant in this work. q1, q2, and q3 are acid, buffer,
251
X
,,X S P
NNARX
Controller
f
S
Journal Pre-proof
11
and base flow rates, respectively. Wa1 to Wa4 and Wb1 to Wb4 are reaction invariants as described
252
in Hu and Rangaiah [16].
253
The relation of pH with other variables is given by the following implicit algebraic equation
254
[16]:
255
256
2
12
14
44
1 2 10
10 10 0
1 10 10
pH pK
pH pH
ab
pK pH pH pK
WW
(19)
257
However, to circumvent the solution of such a nonlinear algebraic equation, the first derivative
258
of Eq. 19 was calculated and simplified with respect to the derivative of pH. In this regard,
259
another differential equation was added to the set of state equations:
260
44
1( / )
ab
pH N D
gWW
(20)
261
where:
262
2
()
1 2 10 pH Pk
N
(21)
263
12
( ) ( )
1 10 10
Pk pH pH Pk
D
(22)
264
12
( ) ( )
( 2)
4
( 14) ( )
2
2 10 10 10
log(10) 10 10
Pk pH pH Pk
pH Pk
b
pH pH
W D N
gD
(23)
265
266
The nominal parameters for the neutralization process are given in Table 3.
267
268
Fig. 4: Continuous pH neutralization process diagram.
269
270
271
Journal Pre-proof
12
Table 3: The nominal parameter values for the continuous pH neutralization process [16].
272
Parameter
Value
Unit
A
207
cm2
CV
8.75
ml/cm/s
pK1
6.35
-
pK2
10.25
-
Wa1
3×10-3
M
Wa2
-3×10-2
M
Wa3
-3.05×10-3
M
Wa4
-4.32×10-4
M
Wb1
0
M
Wb2
3×10-2
M
Wb3
5×10-5
M
Wb4
5.28×10-4
M
q1
16.6
ml/s
q2
0.55
ml/s
q3
15.6
ml/s
h
14.0
m
pH
7.0
-
273
274
7 Simulation
275
The preliminary NNARX network structure was constructed by the Neural Network Toolbox-
276
Simulink code generation facility [21]. The network was then modified in Simulink to suit the
277
design required as a MIMO controller. The overall network structural parameters are given in
278
Table 4. As shown in this table and earlier in Fig. 1, several delays were introduced at the input
279
layer. It is worthy of attention that this network is fully connected, which means there is a
280
connection between every input and every neuron in each layer. As mentioned earlier, the
281
importance of these connections is controlled by the weight parameters, which are regulated by
282
the GA-optimizer. On the other hand, as the controller is designed around the steady state
283
conditions for which
0e
, and in order to reduce the number of optimizing parameters, all bias
284
parameters were permanently set to zero.
285
Using one hidden layer is conventional in working with artificial neural networks [4] unless
286
problem complexity necessitates adding one or more hidden layers [2]. The number of neurons is
287
selected based on some trial and error. The number of delays is also selected based on the
288
complexity of the process. It must be emphasized that the poles and zeros of the controller in the
289
linear analogy are allocated by these delays, while they can generate integral and derivative
290
actions, for which at least three delayed instances of the error are required.
291
Journal Pre-proof
13
292
It must be noted that this network requires just a few neurons in the hidden layer to obtain
293
satisfactory results. This feature makes the optimization task faster and more efficient. The
294
completed closed-loop structure was implemented and simulated in Simulink.
295
Table 4: NNARX structural parameters.
296
Parameter
Fermentation process
Neutralization Process
Number of hidden layers
1
1
Number of input delays
4 (0:3)
3 (1:3)
Number of hidden layer neurons
2
2
Hidden layer transfer function
tansig
tansig
Output layer transfer function
purelin
purelin
Preprocessing function
mapminmax
mapminmax
Postprocessing function
mapminmax_reverse
mapminmax_reverse
Sample time
0.1 h
1s
297
The MATLAB Global Optimization Toolbox was used for the optimization task [20]. The
298
optimizer parameters are given in Table 5. For optimization and simulation, MATLAB and
299
Simulink 2014a on a laptop with an Intel Core i5-3380 M (2.90 GHz) CPU with 6 GB RAM
300
were used. It is worthy of attention that the number of optimizing parameters equals the weights
301
of the designed NNARX controller. The lower and upper bounds on the optimizing parameters
302
were set by some trial and error.
303
304
The summary of the optimization results is given Fig. 5. For the continuous fermentation
305
process, the optimization has terminated in exactly 50 generations (iterations) with the criterion
306
that the average change in the fitness (objective function) values has fallen below a predefined
307
limit (10-6). Similarly, for the neutralization process, the variations in the fitness values have
308
reached a minimum in about 50 generations. However, the termination criterion (average change
309
in the fitness values) has been satisfied after 88 generations. The variations in most of the
310
weights have also dropped in about 50 generations. Careful tuning of genetic algorithm
311
parameters (e.g., population size, selection function, crossover, and mutation operators) helps in
312
finding at least the area in which the global optimum is expected to be found, and this is
313
sufficient as long as the controller performance is concerned.
314
315
316
317
Journal Pre-proof
14
318
Table 5: GA-Optimization parameters.
319
Parameter
Fermentation Process
Neutralization Process
Number of optimizing parameters
10
16
Population size
50
50
Crossover fraction
0.15
0.15
Crossover function
crossovertwopoint
crossovertwopoint
Elite-count
2
2
Selection operator
Tournament
Tournament
Lower bound on weights
-1
-2
Upper bound on weights
1
4
Termination criteria
Average distance
Average distance
320
8 Results
321
In this section, the performance of the NNARX controller is assessed on the two nonlinear
322
systems mentioned earlier. As for the case studies, first, setpoint tracking is investigated on both
323
processes. Further, a modeling error is introduced to the formulation of the fermentation process.
324
Finally, a disturbance in the form of an unwanted change in the buffer flow rate (q2) is
325
introduced in the neutralization process. These changes are introduced at time
0.t
326
327
8.1 Setpoint tracking
328
For the first analysis of the controller performance on the continuous fermentor, a square pulse
329
train with a period of 50 h and amplitude of 0.5 g/l is introduced to the setpoint of cell-mass
330
concentration with respect to its steady state value, as shown in Fig. 6a. As can be seen, the
331
tracking error is remarkably small, and the output (cell-mass concentration) promptly follows the
332
setpoint with a slight overshoot incomparable to that of the PI controller.
333
A similar test was carried out on the neutralization process in which a square pulse train with a
334
period of 1000 s and amplitude of unity was introduced with respect to the steady state values of
335
level and pH (Fig. 6b). It is apparent that here also, the controller response is quite fast, and the
336
offset is very small, while the overshoot is much smaller compared to that of the PI controller.
337
338
339
Journal Pre-proof
15
340
341
342
Fig. 5: Evolution of weights, change in fitness (objective function) values, and change in average
343
distance between individuals (solutions) for the fermentation process (a, c, and e) and
344
neutralization process (b, d, and f).
345
346
347
(a)
(b)
(a)
(b)
(c)
(d)
(e)
(f)
Generation
Generation
Weights
Weights
Journal Pre-proof
16
It is important to note that this offset-free response may suggest the integral action of the
348
NNARX controller considering that an integral action in the discrete form is very similar to the
349
NNARX structure with a linear transfer function.
350
The variations in the manipulated variables (controller outputs) for the setpoint tracking problem
351
are shown in Fig. 7. The prompt setpoint tracking action of the NNARX controller for the
352
fermentation process has come at the cost of aggressive changes in the manipulated variable
353
(dilution rate in Fig. 7a). However, for the neutralization process, the NNARX controller offers
354
even smoother controlling actions compared to the PI controller, as can be seen in Fig. 7b.
355
Moreover, there is no sustained fluctuation in the manipulated variables, which is a desired
356
behavior.
357
358
359
360
Fig. 6: Setpoint tracking results for: (a) fermentation process, (b) neutralization process.
361
3
4
5
6
7
8
020 40 60 80 100
Cell Mass (g/l)
Time (h)
NNARX
PI
(a)
0
5
10
15
20
25
0500 1000 1500 2000
Process Outputs
Time (s)
NNARX
PI
Level
pH
(b)
Journal Pre-proof
17
362
363
Fig. 7: Variations in the controller outputs for the setpoint tracking problem for: (a) fermentation
364
process, (b) neutralization process.
365
366
8.2 Modeling error
367
For a test of modeling error, it is here assumed that the growth rate (
) is wrongfully calculated
368
from the following equation instead of Eq. 15 based on which the NNARX controller was
369
trained:
370
m
m
S
KS
(24)
371
372
The simulation results are given in Fig. 8. From this figure, one can infer that although the
373
controller quickly reduces the tracking error, there has remained a small offset over time. Hence,
374
for this problem, the PI controller is obviously superior.
375
-1
-0.5
0
0.5
1
020 40 60 80 100
Controller Ouput
Time (s)
NNARX
PI
(a)
-400
-300
-200
-100
0
100
200
0500 1000 1500 2000
Controller Outputs
Time (s)
NNARX-Acid
NNARX-Base
PI-Acid
PI-Base
(b)
Journal Pre-proof
18
376
Fig. 8: Results of including a modeling error in the fermentation process model.
377
8.3 Disturbance rejection
378
For another investigation, a disturbance in the form of an unmeasured change in the buffer flow
379
rate (q2) is applied at time
0t
. At this moment, the buffer flow rate is reduced to 50% of its
380
nominal value. It is noteworthy that a decrease in buffer value in any neutralization process
381
increases process sensitivity, causing the controlling task more tedious. The results are shown in
382
Fig. 9. It is apparent from Fig. 9a that the deviation from the setpoint value is small, but it must
383
be admitted that the integral effect is slightly compromised. The changes in the manipulated
384
variables (acid and base flow rates) are shown in Fig. 9b, which shows mild fluctuations. Based
385
on these results, the NNARX controller is able to tackle the relatively large unmeasured
386
disturbance.
387
388
5
5.5
6
6.5
7
7.5
010 20 30 40
Cell Mass (g/l)
Time (s)
NNARX
PI
Setpoint
Journal Pre-proof
19
389
390
Fig. 9: Results of including a disturbance as an unmeasured change in the buffer flow rate (-50%
391
of the nominal value) for the neutralization process: (a) process variables, (b) controller outputs.
392
8.4 Quantitative analysis
393
A quantitative analysis was carried out based on the integral absolute error (IAE) criterion:
394
0()
IAE e t dt
(25)
395
As given in Table 6, the IAE values for the proposed NNARX controller are significantly smaller
396
compared to the PI controller for setpoint tracking, especially for the neutralization process.
397
However, the IAE values for modeling error and disturbance rejection are smaller for the PI
398
controller due to the perfect integral action of this controller.
399
400
401
402
403
0
2
4
6
8
10
12
14
16
020 40 60 80 100
Process Outputs
Time (s)
NNARX
PI
Level
pH
(a)
-0.05
0
0.05
0.1
0.15
0.2
0.25
0.3
020 40 60 80 100
Controller Outputs
Time (s)
NNARX-Acid
NNARX-Base
PI-Acid
PI-Base
(b)
Journal Pre-proof
20
404
Table 6: Integral absolute error (IAE) values for all the case studies.
405
Process
Case study
IAE (NNARX)
IAE (PI)
Fermentation
process
Setpoint tracking
4.926
6.688
Modeling error
21.25
1.62
Neutralization
process
Setpoint tracking
(Level)
248.5
764.2
Setpoint tracking
(pH)
323.4
1095
Disturbance
rejection (Level)
9.962
0.1639
Disturbance
rejection (pH)
8.398
0.0544
406
9 Conclusion
407
In this work, a neural network-based nonlinear controller was tested on two nonlinear chemical
408
and biochemical processes. The controller was tuned using genetic algorithm by running the
409
closed-loop models for a sufficiently large number of times. There are at least two advantages of
410
using GA as the training algorithm: 1) it does not require any knowledge of the neuron transfer
411
function properties as opposed to gradient-based methods, which require exact derivatives of the
412
transfer functions for back propagation, 2) GA is heuristically a global optimization method, and
413
as we have seen in this problem, it is efficient in training dynamic neural networks, which are
414
generally hard to train to an acceptable level of accuracy in a limited time.
415
The results indicated that the proposed NNARX controller enjoys a relatively simple but
416
versatile structure. Moreover, it can be readily and quickly tuned with the minimum degree of
417
richness in the information provided to the tuning algorithm. In this regard, the authors believe
418
that the proposed method can be implemented in an online manner as well [24, 34]. In other
419
words, it is possible that the process is started up without a-priori knowledge of the process, but
420
the controller is tuned as the real-time process is in operation.
421
The NNARX controller action was not perfect for disturbance rejection for significant modeling
422
errors. However, we expect that with the introduction of the measured disturbances as
423
independent inputs to the controller, and also real-time optimization of the controller as it “flies”,
424
the above-mentioned problems be alleviated.
425
426
Journal Pre-proof
21
References
427
1. R. Aguilar-López, E.N. Tec-Caamal, and M.I. Neria-González, Observer-Based Control
428
for Uncertain Nonlinear Systems Applied to Continuous Biochemical Reactors, Math.
429
Probl. Eng. 2020 (2020) 6417860. doi: https://doi.org/10.1155/2020/6417860.
430
2. M. Akhtar, M.U.G. Kraemer, and L.M. Gardner, A dynamic neural network model for
431
predicting risk of Zika in real time, BMC Med. 17 (2019) 171-171. doi: 10.1186/s12916-
432
019-1389-3.
433
3. J.S. Alford, Bioprocess control: Advances and challenges, Comput. Chem. Eng. 30
434
(2006) 1464-1475. doi: https://doi.org/10.1016/j.compchemeng.2006.05.039.
435
4. H. Alimohammadi, B.B. Alagoz, A. Tepljakov, K. Vassiljeva, and E. Petlenkov, A NARX
436
model reference adaptive control scheme: improved disturbance rejection fractional-
437
order PID control of an experimental magnetic levitation system, Algorithms. 13 (2020)
438
201. doi: 10.3390/a13080201.
439
5. B. Bennett and G. Cole, Pharmaceutical Production: An Engineering Guide,Institution of
440
Chemical Engineers, 2003.
441
6. D. Bonvin and G. François, Chapter 11 - Control and Optimization of Batch Chemical
442
Processes, in: Coulson and Richardson's Chemical Engineering (Fourth Edition), S.
443
Rohani (Eds.), Butterworth-Heinemann, 2017, pp. 441-503.
444
7. E.A. del Rio-Chanona, E. Manirafasha, D. Zhang, Q. Yue, and K. Jing, Dynamic
445
modeling and optimization of cyanobacterial C-phycocyanin production process by
446
artificial neural network, Algal Res. 13 (2016) 7-15. doi:
447
https://doi.org/10.1016/j.algal.2015.11.004.
448
8. V. Derhami and O. Mehrabi, Action Value Function Approximation Based on Radial
449
Basis Function Network for Reinforcement Learning, J. Control. 5 (2011) 50-63. doi:
450
http://dorl.net/dor/20.1001.1.20088345.1390.5.1.4.9.
451
9. A. Fatemi Moghadam, A. Sharifi, and M. Teshnelab, Prediction and Identification of
452
Nonlinear Rotary Cement Kiln System with Neuro-Fuzzy ANFIS Network by Using
453
Feature Selection with Genetic Algorithm, J. Control. 5 (2011) 22-33. doi:
454
http://dorl.net/dor/20.1001.1.20088345.1390.5.2.4.1.
455
10. C. Fernández, N. Pantano, S. Rómoli, D. Patiño, O. Ortiz, and G. Scaglia. Controller
456
design for tracking paths in nonlinear biochemical processes. in 2016 IEEE Biennial
457
Congress of Argentina (ARGENCON). 2016. IEEE doi:
458
https://doi.org/10.1109/ARGENCON.2016.7585277.
459
11. M. Forgione and D. Piga, Continuous-time system identification with neural networks:
460
Model structures and fitting criteria, Eur. J. Control. 59 (2021) 69-81. doi:
461
https://doi.org/10.1016/j.ejcon.2021.01.008.
462
12. D.E. Goldberg, Genetic Algorithms in Search, Optimization and Machine
463
Learning,Addison-Wesley, Boston, 1989.
464
13. J.-B. Han, S.-H. Kim, M.-H. Jang, and K.-S. Ri, Using genetic algorithm and NARX
465
neural network to forecast daily bitcoin price, Comput. Econ. (2019) 1-17. doi:
466
https://doi.org/10.1007/s10614-019-09928-5.
467
14. R. Hernández-Alvarado, L.G. García-Valdovinos, T. Salgado-Jiménez, A. Gómez-
468
Espinosa, and F. Fonseca-Navarro, Neural Network-Based Self-Tuning PID Control for
469
Underwater Vehicles, Sensors (Basel). 16 (2016) 1429. doi:
470
https://doi.org/10.3390/s16091429.
471
15. J.M. Holte. Discrete Gronwall lemma and applications. in MAA-NCS meeting at the
472
University of North Dakota. 2009.
473
Journal Pre-proof
22
16. Q. Hu and G.P. Rangaiah, Adaptive internal model control of nonlinear processes, Chem.
474
Eng. Sci. 54 (1999) 1205-1220. doi: https://doi.org/10.1016/S0009-2509(98)00543-0.
475
17. K. Latha, V. Rajinikanth, and P. Surekha, PSO-based PID controller design for a class of
476
stable and unstable systems, ISRN Artificial Intelligence. 2013 (2013). doi:
477
https://doi.org/10.1155/2013/543607.
478
18. Q. Liu, W. Chen, H. Hu, Q. Zhu, and Z. Xie, An Optimal NARX Neural Network
479
Identification Model for a Magnetorheological Damper With Force-Distortion Behavior,
480
Front. Mater. 7 (2020) 10. doi: https://doi.org/10.3389/fmats.2020.00010.
481
19. L. Mailleret, O. Bernard, and J.-P. Steyer, Nonlinear adaptive control for bioreactors
482
with unknown kinetics, Automatica. 40 (2004) 1379-1385. doi:
483
https://doi.org/10.1016/j.automatica.2004.01.030.
484
20. Mathworks, Global Optimization Toolbox 3.2.5 User Guide, 2014, The MathWorks Inc.
485
21. Mathworks, Neural Network Toolbox 8.2, 2014, The MathWorks Inc.
486
22. B. Medi, A. Bahramian, and V. Nazari, Synthesis and Characterization of Conducting
487
Polyaniline Nanostructured Thin Films for Solar Cell Applications, JOM. 73 (2020)
488
504–514. doi: https://doi.org/10.1007/s11837-020-04361-8.
489
23. B. Medi, M.-K. Kazi, and M. Amanullah, Nonlinear direct inverse method: a shortcut
490
method for simultaneous calibration and isotherm determination, Adsorption. 19 (2013)
491
1007-1018. doi: https://doi.org/10.1007/s10450-013-9511-x.
492
24. Z. Michalewicz, C.Z. Janikow, and J.B. Krawczyk, A modified genetic algorithm for
493
optimal control problems, Comput. Math. with Appl. 23 (1992) 83-94. doi:
494
https://doi.org/10.1016/0898-1221(92)90094-X.
495
25. A. Naregalkar and D. Subbulekshmi, NARX-EMFO Based Controller Optimization for
496
pH Neutralization in Wastewater Treatment, in: Advances in Smart Grid Technology, N.
497
Zhou and S. Hemamalini (Eds.), Springer, 2020, pp. 403-417.
498
26. J. Oravec, M. Horváthová, and M. Bakošová, Multivariable robust MPC design for
499
neutralisation plant: Experimental analysis, Eur. J. Control. 58 (2021) 289-300. doi:
500
https://doi.org/10.1016/j.ejcon.2020.07.012.
501
27. R. Pörtner, O. Platas Barradas, B. Frahm, and V.C. Hass, Advanced Process and Control
502
Strategies for Bioreactors, in: Current Developments in Biotechnology and
503
Bioengineering, C. Larroche, M.Á. Sanromán, G. Du, and A. Pandey (Eds.), Elsevier,
504
2017, pp. 463-493.
505
28. V. Rankovic, J. Radulovic, N. Grujovic, and D. Divac, Neural network model predictive
506
control of nonlinear systems using genetic algorithms, Int. J. Comput. Commun. 7 (2014)
507
540-549. doi.
508
29. S. Rómoli, M. Serrano, F. Rossomando, J. Vega, O. Ortiz, and G. Scaglia, Neural
509
Network-Based State Estimation for a Closed-Loop Control Strategy Applied to a Fed-
510
Batch Bioreactor, Complexity. 2017 (2017) 9391879. doi: 10.1155/2017/9391879.
511
30. J. Schmidhuber, Deep learning in neural networks: An overview, Neural Netw. 61 (2015)
512
85-117. doi: https://doi.org/10.1016/j.neunet.2014.09.003.
513
31. S. Skogestad, Simple analytic rules for model reduction and PID controller tuning, J.
514
Process Control. 13 (2003) 291-309. doi: https://doi.org/10.1016/S0959-1524(02)00062-
515
8.
516
32. G. Stephanopoulos, Chemical process control: an introduction to theory and
517
practice,Prentice-Hall, 1984.
518
33. M. Ünal, A. Ak, V. Topuz, and H. Erdal, Optimization of PID controllers using ant
519
colony and genetic algorithms. Vol. 449, Springer, 2012.
520
34. F. Varasteh, M.S. Nazar, A. Heidari, M. Shafie-khah, and J.P.S. Catalão, Distributed
521
energy resource and network expansion planning of a CCHP based active microgrid
522
Journal Pre-proof
23
considering demand response programs, Energy. 172 (2019) 79-105. doi:
523
https://doi.org/10.1016/j.energy.2019.01.015.
524
35. A. Zohoori Zangeneh, M. Teshnehlab, and M. Ahmadieh Khanesar, Proposing Interval
525
Activation Functions in Radial Basis Function Neural Network to Predict Nonlinear
526
dynamic systems, J. Control. 9 (2016) 1-25. doi:
527
http://dorl.net/dor/20.1001.1.20088345.1394.9.4.1.0.
528
529
530
Journal Pre-proof