Professional Documents
Culture Documents
Part 1
1 1
Part 1
Outline
Introduction to neural networks. Application of neural networks in system identification and control. Implementation of neural networks using Matlab.
2 2
Part 1
3 3
Part 1
4 4
Part 1
5 5
Part 1
6 6
Part 1
7 7
Part 1
j=1
kj
and y k = (u
+ bk
8 8
Part 1
9 9
Part 1
10
Connections
The neurons by themselves are not very powerful in terms of computation or representation. But, their interconnections allows us to encode relations between the variables giving different powerful processing capabilities. In general, three fundamental types of interconnections of neural networks are defined in literature : single-layer feedforward networks, multilayer feedforward networks and recurrent networks. There exist numerous neural network architectures, such as Hopfield nets, Boltzmann machine, etc.
10 10
Part 1
11
11 11
Part 1
12
12 12
Part 1
13
Recurrent Networks
The recurrent network distinguishes itself in that it has at lest one feedback loop. The feedback loop can be either self-feedback loop or global feedback loop.Moreover, the feedback loop and the unit-delay elements result in a nonlinear dynamical behavior of the network.
13 13
Part 1
14
14 14
Part 1
15
Part 1
16
16 16
Part 1
17
17 17
Part 1
18
+
U Plant yp
+ + _
error
ym
Learning Algorithm
18 18
Part 1
19
ym
Plant
yp
_
error
Learning Algorithm
19 19
Part 1
20
Conceptually the simplest approach is direct inverse training [Psaltis et al, 1988] as shown schematically in right figure. The output of the plant is used as input to the neural network. Then, the output of the network is compared with the plants input. The error is used to train the neural network. It is clear that the training procedure will force the network to represent the inverse model of the plant. However, this training method has two drawbacks. First, it is not goal directed [Jordan and Rumelhart, 1991]. Second, if the nonlinear system is not invertible, an incorrect inverse can be obtained.
Dept. of Mechanical Engineering Instructor: Dr. Song
ym
Plant
yp
20 20
Part 1
21
Plant
yp
Learning Algorithm
ym
error
21 21
Part 1
22
The other approach to overcome these problems was known as specialized inverse learning [Psaltis et al, 1988], which is illustrated in right figure. In this approach, the network inverse model precedes the plant. The command signal is fed into this network and the output of the network will be sent to the plant, as well as an established network feedforward model parallel with the plant. The error signal for the training algorithm in this case is the difference between the output of the network feedforward model and the command signal. This approach trends to make unity transfer function from the command signal to the output of the plant.
Dept. of Mechanical Engineering Instructor: Dr. Song
Plant
yp
Learning Algorithm
ym
error
22 22
Part 1
23
23 23
Part 1
24
Plant
yp
24 24
Part 1
25
NN Controller
25 25
Part 1
26
Plant
NN Plant Model
26 26
Part 1
27
Predictive Control
Iterative optimization
Optimal solution
NN Controller
27 27
Part 1
28
28 28
Part 1
29
29 29
Part 1
30
30 30
Part 1
31
Train function trains a network net according to net.trainFcn and net.trainParam. Before start of training, two parameters must be specified.
Net.trainparam.epochs: the upper limit of training iteration. Net.trainparam.goal: the value of performance function.
31 31
Part 1
32
gensim(net,st)
Generate Simulink block of the network. net - Neural network. st - Sample time (default = 1).
32 32
Part 1
33
20
40
60
80
140
160
180
200
5 0 -5 -10 -15
20
40
60
80
100 time
120
140
160
180
200
33 33
Part 1
34
U(k-2)
Input Layer
Output Layer
34 34
Part 1
35
Matlab Code
%Using first 500 data to train the network U=u(1:500);U_delay1=[0 u(1:499)];U_delay2=[0 0 u(1:498)]; Y=y(1:500); %construct the input matrix to the network P=[U;U_delay1;U_delay2]; %define the feedforward neural network with two layers Netexample=newff([minmax(U);minmax(U_delay1);minmax(U_delay2)],[8 1],{'tansig' 'purelin'},'trainlm'); %set up the train parameters Netexample.trainparam.epochs=2000;Netexample.trainparam.goal=0.01; %train the network predictor=train(Netexample,P,Y); %test and verify the network using later 500 data U=u(501:999);U_delay1=u(500:998);U_delay2=u(499:997);P=[U;U_delay1;U_delay2]; NetOutput=sim(Netexample,P);
35 35
Part 1
36
output/prediction
-5
-10
-20
-25 500
550
600
650
850
900
950
1000
36 36