Professional Documents
Culture Documents
MODULE 6:
Empirical Modeling and Control of Amira Three Tank
System Using Artificial Neural Networks (ANN)
q1 q2
Tank 3
Tank 2
H1
q13 q32
Pump
Pump
H3 𝑺𝒑 , 𝝁 𝟐
H2
1
2
𝑺𝒑 , 𝝁 𝟏 𝑺𝒑 , 𝝁𝟑
d1 d3 d2 q20
The change in the levels of water inside tanks 1, 2 and 3 are modeled by ODE:
𝒅𝒉𝟏 (6.50)
𝑨 = 𝝁𝟏 . 𝑺𝒑 . √𝟐𝒈. 𝒔𝒈𝒏(𝒉𝟏 − 𝒉𝟑 ). √|𝒉𝟏 − 𝒉𝟑 | + 𝒒𝟏 − 𝒅𝟏
𝒅𝒕
𝒅𝒉𝟐 (6.51)
𝑨 = 𝝁𝟑 . 𝑺𝒑 . √𝟐𝒈. 𝒔𝒈𝒏(𝒉𝟑 − 𝒉𝟐 ). √|𝒉𝟑 − 𝒉𝟐 |
𝒅𝒕
𝒅𝒉𝟑 (6.52)
𝑨 = 𝝁𝟏 . 𝑺𝒑 . √𝟐𝒈. 𝒔𝒈𝒏(𝒉𝟏 − 𝒉𝟑 ). √|𝒉𝟏 − 𝒉𝟑 |
𝒅𝒕
Linearizing Equations (6.50-6.52), and taking the leaks 𝑑𝑖 = 0 yields the following
𝒉𝟏
𝒉 𝟏 𝟎 𝟎 𝒉
[ 𝟏] =[ ] [ 𝟐]
𝒉𝟐 𝟎 𝟏 𝟎
𝒉𝟑 (6.54)
Where:
𝟎. 𝟎𝟎𝟔𝟕𝟏 𝟎
𝑩=[ 𝟎 𝟎. 𝟎𝟎𝟔𝟕𝟏]
𝟎 𝟎
For the purpose of deriving control models, the SIMULINK model of the
The input signal 𝑞1 was designed to have a mean value of 28 cm3/sec and a
variance of 200 while 𝑞2 was designed with a mean value of 43 cm3/sec and a
variance of 1000. The switching time for both inputs was chosen as 200 seconds.
By sampling the process at every 1 second, 20000 data were collected and
plotted in Figure . Of the 20000 data collected, the first 14000 were used for
identification, the next 3000 for validation while the last 3000 were used for
testing.
70 40
60
30
50
Height 1[cm]
Height 2[cm]
40
20
30
20
10
10
0 0
0 0.5 1 1.5 2 0 0.5 1 1.5 2
4 4
x 10 x 10
70
80
60
Pump 1 flow [cm3/s]
40
40
30
20
20
10 0
0 0.5 1 1.5 2 0 0.5 1 1.5 2
T ime[Samples] 4 T ime[Samples] 4
x 10 x 10
Due to the inability of the linear model to represent the process, a FFNN
perceptron (MLP) neural network model with the following topology is hereby
chosen with 8 inputs, 7 hidden layers and 2 output layer, as shown in Figure .
Using the data set collected in Figure , a MLP ANN model was trained for the
process using the MATLAB ANN toolbox. The training algorithm chosen is
as shown in together with the computed MSE=0.0083 showed that the FFNN
where
𝜓(𝑘 − 1) =
[ℎ1 (𝑘 − 1) ℎ2 (𝑘 − 1) ℎ1 (𝑘 − 2) ℎ2 (𝑘 − 2) 𝑞1 (𝑘 − 1) 𝑞2 (𝑘 − 1) 𝑞1 (𝑘 − 2) 𝑞2 (𝑘 −
2
𝑓ℎ (𝑥 ) = ( −1
1+𝑒 −2𝑥 )
𝒉𝟏 (𝒌 − 𝟏)
𝒉𝟐 (𝒌 − 𝟏)
𝒉𝟏 (𝒌 − 𝟐)
𝒉𝟏 (𝒌)
𝒉𝟐 (𝒌 − 𝟐)
𝒒𝟏 (𝒌 − 𝟏)
𝒉𝟐 (𝒌)
𝒒𝟐 (𝒌 − 𝟏)
𝒒𝟏 (𝒌 − 𝟐)
𝒒𝟐 (𝒌 − 𝟐)
RNN was equally considered for the control of the tank process, with its topology
Using the data set collected in Figure , a RNN model was trained for the process
using the MATLAB ANN toolbox. The training algorithm chosen is Levenberg-
Marquardt. A comparison of the process output with the RNN output as shown in
together with the computed MSE=0.1493 showed that the RNN gives a good
where
2
𝑓ℎ (𝑥 ) = ( −1
1+𝑒 −2𝑥 )
A comparison is made among the three model types considered for the control of
FFNN gives the best accuracy with the lowest MSE of 0.0083, followed by RNN
with MSE of 0.1493, the linearized model gives the least accuracy with a MSE of
1.85.
Figure 6.40a: Block diagram for implementing ANN model based NMPC
With both the identified FFNN and RNN models as the prediction models; and
designed and implemented on the Simulink model of the tank system, with 𝑢(𝑘),
plotted in Figures 6.40(b) and 6.41 show an excellent setpoint tracking with no
overshoot and undershoot. The results are better than that of LMPC.
ℎ1 (𝑘 + 1) ℎ2 (𝑘 + 1)
ℎ1 (𝑘) ℎ2 (𝑘)
ℎ1 (𝑘 − 1) ℎ2 (𝑘 − 1)
[𝑞̂1 (𝑘) 𝑞̂2 (𝑘)] = 𝑓𝑖𝑛𝑣−𝑓𝑓𝑛𝑛 (6.56)
ℎ1 (𝑘 − 2) ℎ2 (𝑘 − 2)
𝑞1 (𝑘 − 1) 𝑞2 (𝑘 − 1)
(𝑞1 (𝑘 − 2) 𝑞2 (𝑘 − 2))
The input layers were selected as 12, the hidden layers 6 and the output layers 2
with its topology in Figure 6.42a. The final FFNN model obtained after training is:
where
2
𝑓ℎ (𝑥 ) = ( −1 (6.59)
1+𝑒 −2𝑥 )
Simulink block diagram (Fig. 6.42b) was used for the implementation of this
control scheme while Figure 6.43 gives the simulation results which are quite
satisfactory.
It is implemented here a nonlinear IMC strategy which uses FFNN model for
prediction and Inverse FFNN model as the controller (Figure 6.44a). The
simulation results obtained are shown in Figure 6.44b. The results are quite
𝒉𝟏 (𝒌 + 𝟏)
𝒉𝟏 (𝒌)
𝒉𝟏 (𝒌 − 𝟏)
𝒉𝟏 (𝒌 − 𝟐)
𝒒𝟏 (𝒌 − 𝟏)
𝒒𝟏 (𝒌 − 𝟐)
̂𝟏 (𝒌)
𝒒
𝒒𝟐 (𝒌 − 𝟐)
𝒒𝟐 (𝒌 − 𝟏) ̂𝟐 (𝒌)
𝒒
𝒉𝟐 (𝒌 − 𝟐)
𝒉𝟐 (𝒌)
inverse-FFNN model
𝒉𝟐 (𝒌 + 𝟏)
M=ANN model
C=ANN-Inverse Model
P=Plant
F=Filter
Figure 6.44b: Process inputs and outputs using FFNN nonlinear IMC
Obafemi Awolowo University 37
Chemical Engineering
Experimental Results
system. The experimental results obtained were plotted as Figures 6.45 – 6.49.
It is noteworthy that the experimental results were very similar to the simulation
results except for the Inverse-ANN controller and ANN-NIMC whose control
signals were changing very rapidily. This is because discrete time inverse-model
based controllers are always very sensitive to process noise and sampling time.
These results also confirm the practical implementability of the developed model-