Chapter 4 Simulation Results
4.1 Influence of The Sampling Time
The influence resolves itself into the following two points: one is the influence of the sampling time to learning result; the other is the abilities of two neural network structures to adapt different sampling times. The first point will be discussed in the following paragraph.
In the first order difference equation, it showed that the fitness increases as the sampling time decreases. It is concerned whether the fitness of the two neural network structures increase as the sampling time decrease like the first order difference equation. There remains a second question about whether the sampling time affects the success rate of the learning result or not. Here, the GS and SST are trained under the sampling time 0.01 and 0.001. Fig.
4.1.1 shows the learning result of the GS when the training data are under sampling time 0.01 at 1st, 3rd, and 5th time. Fig 4.1.2 shows the variation of negative fitness, sum of the error, during the learning process of the GS when the training data are under sampling time 0.01 at 1st, 3rd, and 5th time. Similarly, the objective of Fig. 4.2.1 and Fig 4.2.2 is the SST under the sampling time 0.01, the objective of Fig. 4.3.1 and Fig 4.3.2 is the GS under the sampling time 0.001, and the objective of Fig. 4.4.1 and Fig 4.4.2 is the SST under the sampling time 0.001. Table 4.1 presents the learning results whose initial individual are all given randomly.
We define the learning as success learning while the average of the error is smaller than 0.05, and show the result in the Table 4.2.1 and Table 4.2.2. Every case is learned by starting with three different initial random individuals.
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time(sec) response
real system output 1st NN system output (1) 3rd NN system output (2) 5th NN system output (3)
Figure 4.1.1 the learning result of the GS under sampling time 0.01
0 20 40 60 80 100 120
0 10 20 30 40 50 60 70 80 90
generation
error
the error
1st training (1) 3rd training (2) 5th training (3)
Figure 4.1.2 the change of the sum of the error of the GS under sampling time 0.01 (1)
(2) (3)
(2) (1) (3)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time(sec) response
real system output 1st NN system output (1) 3rd NN system output (2) 5th NN system output (3)
Figure 4.2.1 the learning result of the SST under sampling time 0.01
0 20 40 60 80 100 120 140
0 5 10 15 20 25 30 35 40
generation
error
the error
1st training (1) 3rd training (2) 5th training (3)
Figure 4.2.2 the change of the sum of the error of the SST under sampling time 0.01 (1)
(2) (3)
(1)
(2) (3)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time(sec) response
real system output 1st NN system output (1) 3rd NN system output (2) 5th NN system output (3)
Figure 4.3.1 the learning result of the GS under sampling time 0.001
0 20 40 60 80 100 120 140
0 100 200 300 400 500 600 700 800 900
generation
error
the error
1st training (1) 3rd training (2) 5th training (3)
Figure 4.3.2 the change of the sum of the error of the GS under sampling time 0.001 (1)
(2)
(3)
(3) (2) (1)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0
0.2 0.4 0.6 0.8 1 1.2 1.4
time(sec) response
real system output 1st NN system output (1) 3rd NN system output (2) 5th NN system output (3)
Figure 4.4.1 the learning result of the SST under sampling time 0.001
0 10 20 30 40 50 60 70 80
0 100 200 300 400 500 600 700 800
generation
error
the error
1st training (1) 3rd training (2) 5th training (3)
Figure 4.4.2 the change of the sum of the error of the SST under sampling time 0.001 (1)
(3) (2)
(1)
(2) (3)
Table 4.1 the results of learning with different sampling times
∆T = 0.01 ∆T = 0.001
generation length learning time generation length learning time
GS SST GS SST GS SST GS SST
1st 78 89 01:34:55 00:08:13 62 47 01:21:54 00:33:07 2nd 36 88 00:50:07 00:09:01 485 27 15:27:51 00:16:57 3rd 102 66 01:50:32 00:09:27 86 76 01:12:17 00:55:54 4th 81 38 01:32:53 00:12:34 94 53 01:43:28 00:39:49 5th 54 133 01:34:51 00:07:21 127 34 04:42:18 00:28:33 average 70 83 01:28:40 00:09:19 171 47 04:53:34 00:24:52
Table 4.2.1 the error and the accurate rate of learning with sampling time 0.01
∆T = 0.01
Sum of error average of error (10-2) Success/Fail
GS SST GS SST GS SST
1st 0.0740 0.1784 0.01480 0.03568 S S
2nd 0.2939 0.1538 0.05878 0.03076 S S
3rd 1.5743 0.2525 0.31486 0.05050 S S
4th 1.8689 0.4242 0.37378 0.08484 S S
5th 0.1782 0.1291 0.03564 0.02582 S S
average 0.7979 0.2276 0.15957 0.04552 Success rate(%) 100 100
Table 4.2.2 the error and the accurate rate of learning with sampling time 0.001
∆T = 0.001
Sum of error average of error (10-2) Success/Fail
GS SST GS SST GS SST
1st 61.3104 85.9001 1.22621 1.71800 S S
2nd 144.4808 118.1299 2.88962 2.36260 S S
3rd 374.9141 4.1978 7.49828 0.08396 F S
4th 131.3523 32.7474 2.62705 0.65495 S S
5th 570.8313 15.3980 11.41663 0.30550 F S
average 256.5779 51.2746 5.13156 1.02500 Success rate(%) 60 100
The Fig 4.1.1 and Fig. 4.2.1 show that the learning results are almost the same with the system response when the sampling time is 0.01. Fig. 4.3.1 and Fig. 4.4.1 show that the learning results have some error from the first order LTI system response when the sampling time is 0.001, although the direction of the trend is the same. It means the fitness of the proposed neural network structures increases as the sampling time decrease. Besides, Table 4.1, Table 4.2.1, and Table 4.2.2 tell that the error has no relationship with generation length, and the learning time is independent with the value of the generation length. The Table 4.1 also shows that the learning time increases as the sampling time decrease in the same neural network structure, and the average learning time of the SST is shorter than the GS. Table 4.2.1 and Table 4.2.2 indicate that the larger sampling time produce smaller fitness. It is similar with the first order difference equation. Besides, compared to the success rate, it is clear that the success rate of the GS decreases as the sampling time decreases.
Since the simulation results show errors are small, i.e. fitness are large, take the best individual with ∆T=0.01 to test the dynamic of the NN system. Here, two significant conditions for a system are variable for validation: the one is the initial condition y(0) of the system, and the other is the input function. Let the initial condition y(0) be 0.5, 2, and -2, and the input function be 2p(t), -2 p(t), and sine function where p(t) is a unit step function. The testing results of the initial conditions are shown in Fig. 4.5.1 to Fig. 4.5.3, and the testing results of the input functions are shown in Fig. 4.6.1 to Fig. 4.6.3.
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
time(sec) system response
input
real system output (1) output of GS (2) output of SST (3)
Figure 4.5.1 testing result when initial condition y(0) is 0.5 (1)
(2) (3)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 1
1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
time(sec) system response
input
real system output (1) output of GS (2) output of SST (3)
Figure 4.5.2 testing result when initial condition y(0) is 2
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-2 -1.5 -1 -0.5 0 0.5 1
time(sec) system response
input
real system output (1) output of GS (2) output of SST (3)
Figure 4.5.3 testing result when initial condition y(0) is -2 (1)
(2) (3)
(1) (2)
(3)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0
0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time(sec) system response
input
real system output (1) output of GS (2) output of SST (3)
Figure 4.6.1 testing result when input function u = 2p(t)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-2 -1.8 -1.6 -1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2 0
time(sec) system response
input
real system output (1) output of GS (2) output of SST (3)
Figure 4.6.2 testing result when input function u = -2p(t) (1)
(2) (3)
(1) (2)
(3)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -1
-0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
time(sec) system response
input
real system output (1) output of GS (2) output of SST (3)
Figure 4.6.3 testing result when input function u = sin(2t)
Fig 4.5.1 to Fig 4.6.3 indicate the neural networks using evolution strategies don't just learn as a specific curve, but the input-output relationship of the objective system. In another words, the learned neural network system behaves similar with the first order LTI system no matter what the initial condition or the input function is. Thus, these results lead to the conclusion that that the neural network using evolution strategies could learn well as a first order LTI system.
Since the influence of the sampling time to the fitness does exist, the abilities of two structures to adapt different sampling times must be recalled here. To verify the abilities, take the best learning result under the sampling time 0.01, to test the system under the smaller sampling time 0.005 whose result is shown as Fig. 4.7, and to test under the much smaller sampling time 0.001 whose result is shown as Fig. 4.8.
(1) (2)
(3)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0
0.2 0.4 0.6 0.8 1 1.2 1.4
time(sec) system response
input
real system output (1) output of GS (2) output of SST (3)
Figure 4.7 the testing result with ∆T=0.005 of the learned neural network with ∆T =0.01
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 0.2 0.4 0.6 0.8 1 1.2 1.4
time(sec) system response
input
real system output output of GS output of SST
Figure 4.8 the testing result with ∆T=0.001 of the learned neural network with ∆T=0.01 (1)
(3) (2)
The Fig 4.7 tells that the GS fails, but the SST successes. Fig. 4.7 and Fig. 4.8 indicate that the GS can only be used under a fixed sampling time, but the SST can be used under larger range near the sampling time of the training data. Therefore, the SST is trained with different sampling times, 0.01, 0.001, and 0.0001 using evolution strategies, and then the results will show in Fig. 4.9 and Fig 4.10.1 to Fig. 4.10.3. It demonstrates that the SST can adapt larger rage of the sampling time when it is trained under larger range. It concludes that the SST is better than the GS concerning about the sampling time for learning the first order LTI system.
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 0.2 0.4 0.6 0.8 1 1.2 1.4
time(sec) system response
input
real system output (1)
output of SST: sampling time 0.01 (2) output of SST: sampling time 0.001 (3) output of SST: sampling time 0.0001 (4)
Figure 4.9 the learning result of the SST with sampling time 0.01, 0.001, 0.0001 (1)
(2) (3)
(4)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0
0.2 0.4 0.6 0.8 1 1.2 1.4
time(sec) system response
input
real system output
output of SST: sampling time 0.00001 output of SST: sampling time 0.00005
Figure 4.10.1 the testing result under the sampling time smaller than trained sampling time
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time(sec) system response
input
real system output (1)
output of SST: sampling time 0.0005 (2) output of SST: sampling time 0.005 (3)
Figure 4.10.2 the testing result under the sampling time between trained sampling time (1)
(2) (3)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time(sec) system response
input
real system output
output of SST: sampling time 0.05 output of SST: sampling time 0.5
Figure 4.10.3 the testing result under the sampling time larger than trained sampling time