Identification of a Delayed System for Control Design by Numerical Simulation Method


Mathematical modelling of dynamic systems is very important for process controlling. Controllers for most of the systems can be designed easily without modelling. Mathematical model of the system is useful to control  complex and highly robust systems. The mathematical model can be used to predict control reference or noise of the system.

There are several methods of modelling dynamic systems.

  •          Modelling based on fundamentals
  •          Modelling based on experimental data (Empirical modelling)


Let’s consider the water level of a tank system which has a controllable feed pump and an outlet valve, as an example. The change of the water level can be described by the following function. 
Here 'ap' is input water flow rate and   is output water flow rate of the tank.


h = height to the water level from the bottom of the tank
p = control signal given to the pump
v = valve position
a,b = constants

Integrating by time,

When valve position is constant for t1<t<t2

If we know the correlation of the control signal and flowrate of the pump, the constant ‘a’ can be evaluated. If we can evaluate outlet flowrate by valve position and height of water level, then we can find ‘b’. Step response method is not feasible to evaluate this system. Therefore,  to identify the system, we can get a time series dataset of the real system and fine tune ‘a’ and ‘b’ parameters to match with realistic data with the output of a SIMULINK model .
As data of a real system are not avilable, I used data of a simulation. The SIMULINK model used is shown below.

As this is a delayed system, a moving average algorithm was used to get the delay in the simulation.



Constant 'a',  'b'  and 'FG' are set to 0.3, 0.5. and 2. Control signal and height of water are  exported to the workspace.

A sample of exported data are as follows.

Time (s)
Height
Process Variable
0 30 40
0.01 29.97262 40.81047788
0.02 29.98524 41.46145866
0.03 30.02533 42.00073398
0.04 30.08437 42.46075406
0.05 30.15656 42.86355952
0.06 30.23796 43.22412798
0.07 30.3259 43.55264488
0.08 30.41854 43.85604436
0.09 30.51462 44.13905485
0.1 30.61329 44.40490849

Now these data should be fit to a simulated model which has 'a', 'b' and 'FG' as unknown variables. This model also same as the model used to get data, but 'a', 'b' and 'FG' are unknown.


Now different values should be used for data observed and tested with this simulation to find out what values for 'a', 'b' and 'FG' gives the characteristics closest to the first system.

Characteristics of the first system which is used to get data
First take values for 'a', 'b' and 'c'. Then Integral Square Error (ISE) for those values can be calculated using the following function.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
function y=fitErr(x)
warning('off');
assignin('base','a',[0,x(1)]);
assignin('base','b',[0,x(2)]);
assignin('base','c',abs([0,x(3)]));
sim('FitModel');

hgh2=get(h2,'data');
h1= evalin('base', 'h');
hgh1=get(h1,'data');
e=0;
s=size(hgh1);
for inx=1:s
    err=hgh2(inx)-hgh1(inx);
    e=e+abs(err);
end

y=e;

end

The values for 'a', 'b' and 'c' can be found by minimizing ISE. For this an optimization algorithm can be used. The result got by genetic algorithm is shown below.


The comparison of actual values and the values observed by the genetic algorithm for 'a', 'b', 'c' parameters are.
Parameter
Actual  Value
Observed Value
a
0.3
0.312
b
0.5
0.062
c
2
30.384

So the values given by the genetic algorithm are not exactly the values of the original system. But following graph shows that these values also gives a system which is close to the original system.

Comments