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.
p
= control signal given to the pump
v
= valve position
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 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.
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.
First take values for 'a', 'b' and 'c'. Then Integral Square Error (ISE) for those values can be calculated using the following function.
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.
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.
|
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 |
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
Post a Comment