Инструменты синтеза нейросетевых регуляторов matlab
Embed Size (px)
TRANSCRIPT
Microsoft Word - 04.09_MATLAB. Neural network tools_Ed1d.doc :
MATLAB
.
: Simulink
.
R2015a Simulink.
Simulink .
• , . , . , , .
• , .
• , , . , , .
,
[Error! Reference
source not found.]:
• (NN Predictive Controller) , .
• , (Nonlinear Autoregressive - Moving Average — NA R-MA-L2) . , .
• (NN Reference Controller) . , , .
Simulink MATLAB (, nntool) , , newff, train, sim. MATLAB (Elman), (Hopfield), (Perceptron), (Probabilistic), (Self organizing map) .
• ; • ; • ; • ; • . ( ).
P T.
, -1 +1, .
. • ; • .
; • ;
3
• , , trainlm ( ). .
: >> net=newff(minmax(P),[21,15,3],{'logsig' 'logsig' 'purelin'},'trainlm');
net mat .
; • .
.
P T: % : >> net.performFcn='sse'; % >> net.trainParam.goal=0.01; % () >> net.trainParam.epochs=1000; %
>> [net,tr]=train(net,P,T); % net >> nntraintool %
‘Neural Network Training (nntraintool)’ Performance, ‘Training State’ Regression.
, , .
>> Y_test = sim(net, P_test); % net P_test >> [m,b,r] = postreg(Y_test, T); %
MATLAB P_in
>> Y=sim(net, P); % net P_in
4
net Simulink
>> gensim(net);
nftool
1. >> nftool
2. Next ‘Select Data’ . ‘Neural Network Start’ ‘Fitting app’ >> nnstart ‘Fitting app.
3. Input Targets Workspace mat .
4. Next ‘Select Data’ ‘Validation and Test Data’ - ( ) (Input Target) (Training) (Validation) (Testing). 70%, 15%, 15% .
5. Next ‘Validation and Test Data’ ‘Network Architecture’ - , ( ). Input Target .
6. Next Train Network Train.
7. ‘Neural Network Training’, . Performance ( ), Training State ( ), Error Histogram ( ), Regression ( , ), Fit ( ).
8. ‘Evaluate Network’ , .
9. ‘Deploy Solution’ m- – MATLAB myNeuralNetworkFunction Simulink: Function Fitting Neural Network.
10. ‘Save Results’ nftool.
5
( ) ( 1) . ( ) yo y . y y u ( ) u.
u’
y
e’
1. Simulink .
1
2. ( Plant Identification) .
6
,
,
25%
3. Simulink .
Simulink .
>> predcstr
Simulink. . NARMA. , , , .
Simulink > Neural Network Toolbox > Control Systems :
( ) .
7
>> narmamaglev
, . () . .
4. y y. (, ). : . () . . , y ( ) y .
4. Simulink.
, Performance , ( Train controller), (Generate Data) (Import Data).
Simulink .
>> mrefrobotarm
8
0
, , , [3]
))(2arctan()()()( txtutxt ++−= (1)
Simulink 6.
6. Simulink (1). .
6 7. Gain, Gain1 ‘Transfer Fcn’ , , 8. , , .
9
8. 7.
10
9. Simulink - . ( ) ( ) .
MATLAB , , (nonlinear inductor) Simulink ( 10) power_hysteresis ( 11) MATLAB.
11
F lu
, , , .
, , ( 17) . ( 12) . ( 13).
12
12. : 0,3 (), 1 2 ().
13. , 2 () 5 (). .
1. Simulink 7.
2.
0.05 . 8.
13
2. .
1. Simulink, Hysteresis
7.
14. Hysteresis.
‘PID Controller’ ( 14) Tune.. – . c , . , , , . 15.
15. ( 14) 0.05; 0,55; 0,1
(Filter coefficient) N=10. = 0,05 .
: ode1 (Euler).
3. .
1. Simulink ,
( 16).
16. -
.
4. .
1. ( 17).
( Hysteresis) , 7.
17. Simulink .
2. ( 7.)
.
3. ( 16)
.
4. ‘Model Reference Controller’
( 17). (. ) ‘Plant
Identification’ ‘Model
Reference Control’. 3.
16
(. 3)
(. 2) , .
5. ‘Plant Identification’.
– ‘Generate Training Data’.
. .
6. ‘Plant Input’ ‘Plant Output’ ,
‘Accept Data’ .
Workspace mat ,
‘Export Data’.
7. ‘Train Network’ ‘Plant Identification’
.
8. Performance, ‘Training State’
Regression, ‘Newral Network
Training’:
17
10. ‘Model Reference Control’.
– ‘Generate Training
Data’. .
11. ‘Reference Model Output’
‘Reference Model Input’ , ‘Accept Data’
.
Workspace mat , ‘Export Data’.
12. ‘Train Controller’ .
13. Performance, ‘Training State’,
‘Error Histogram’ Regression, .
18
Target
O u
tp u
.
Apply OK ‘Model Reference Control’.
15. ( 17)
-0,8 +0,8 10 .
.
. ‘Model reference controller’ Simulink , , .
.
19
18.
. ,
7%.
16. ( 18)
( 16)
( 8).
5.
. .
N4.
1. Simulink ( 7), .
20
3. ( ‘Generate Training Data‘).
4. ( ‘Train Network’). .
5. .
6. ( 18)
( 8).
21
. N4.
7. Simulink ( 7), .
8. ‘NN Predictive Controller’:
22
9. ( ‘Generate Training Data‘).
10. ( ‘Train Network’). .
11. .
23
12.
, ( 18)
( 8).
1. ?
2. MATLAB?
3. ?
.
: Simulink
.
R2015a Simulink.
Simulink .
• , . , . , , .
• , .
• , , . , , .
,
[Error! Reference
source not found.]:
• (NN Predictive Controller) , .
• , (Nonlinear Autoregressive - Moving Average — NA R-MA-L2) . , .
• (NN Reference Controller) . , , .
Simulink MATLAB (, nntool) , , newff, train, sim. MATLAB (Elman), (Hopfield), (Perceptron), (Probabilistic), (Self organizing map) .
• ; • ; • ; • ; • . ( ).
P T.
, -1 +1, .
. • ; • .
; • ;
3
• , , trainlm ( ). .
: >> net=newff(minmax(P),[21,15,3],{'logsig' 'logsig' 'purelin'},'trainlm');
net mat .
; • .
.
P T: % : >> net.performFcn='sse'; % >> net.trainParam.goal=0.01; % () >> net.trainParam.epochs=1000; %
>> [net,tr]=train(net,P,T); % net >> nntraintool %
‘Neural Network Training (nntraintool)’ Performance, ‘Training State’ Regression.
, , .
>> Y_test = sim(net, P_test); % net P_test >> [m,b,r] = postreg(Y_test, T); %
MATLAB P_in
>> Y=sim(net, P); % net P_in
4
net Simulink
>> gensim(net);
nftool
1. >> nftool
2. Next ‘Select Data’ . ‘Neural Network Start’ ‘Fitting app’ >> nnstart ‘Fitting app.
3. Input Targets Workspace mat .
4. Next ‘Select Data’ ‘Validation and Test Data’ - ( ) (Input Target) (Training) (Validation) (Testing). 70%, 15%, 15% .
5. Next ‘Validation and Test Data’ ‘Network Architecture’ - , ( ). Input Target .
6. Next Train Network Train.
7. ‘Neural Network Training’, . Performance ( ), Training State ( ), Error Histogram ( ), Regression ( , ), Fit ( ).
8. ‘Evaluate Network’ , .
9. ‘Deploy Solution’ m- – MATLAB myNeuralNetworkFunction Simulink: Function Fitting Neural Network.
10. ‘Save Results’ nftool.
5
( ) ( 1) . ( ) yo y . y y u ( ) u.
u’
y
e’
1. Simulink .
1
2. ( Plant Identification) .
6
,
,
25%
3. Simulink .
Simulink .
>> predcstr
Simulink. . NARMA. , , , .
Simulink > Neural Network Toolbox > Control Systems :
( ) .
7
>> narmamaglev
, . () . .
4. y y. (, ). : . () . . , y ( ) y .
4. Simulink.
, Performance , ( Train controller), (Generate Data) (Import Data).
Simulink .
>> mrefrobotarm
8
0
, , , [3]
))(2arctan()()()( txtutxt ++−= (1)
Simulink 6.
6. Simulink (1). .
6 7. Gain, Gain1 ‘Transfer Fcn’ , , 8. , , .
9
8. 7.
10
9. Simulink - . ( ) ( ) .
MATLAB , , (nonlinear inductor) Simulink ( 10) power_hysteresis ( 11) MATLAB.
11
F lu
, , , .
, , ( 17) . ( 12) . ( 13).
12
12. : 0,3 (), 1 2 ().
13. , 2 () 5 (). .
1. Simulink 7.
2.
0.05 . 8.
13
2. .
1. Simulink, Hysteresis
7.
14. Hysteresis.
‘PID Controller’ ( 14) Tune.. – . c , . , , , . 15.
15. ( 14) 0.05; 0,55; 0,1
(Filter coefficient) N=10. = 0,05 .
: ode1 (Euler).
3. .
1. Simulink ,
( 16).
16. -
.
4. .
1. ( 17).
( Hysteresis) , 7.
17. Simulink .
2. ( 7.)
.
3. ( 16)
.
4. ‘Model Reference Controller’
( 17). (. ) ‘Plant
Identification’ ‘Model
Reference Control’. 3.
16
(. 3)
(. 2) , .
5. ‘Plant Identification’.
– ‘Generate Training Data’.
. .
6. ‘Plant Input’ ‘Plant Output’ ,
‘Accept Data’ .
Workspace mat ,
‘Export Data’.
7. ‘Train Network’ ‘Plant Identification’
.
8. Performance, ‘Training State’
Regression, ‘Newral Network
Training’:
17
10. ‘Model Reference Control’.
– ‘Generate Training
Data’. .
11. ‘Reference Model Output’
‘Reference Model Input’ , ‘Accept Data’
.
Workspace mat , ‘Export Data’.
12. ‘Train Controller’ .
13. Performance, ‘Training State’,
‘Error Histogram’ Regression, .
18
Target
O u
tp u
.
Apply OK ‘Model Reference Control’.
15. ( 17)
-0,8 +0,8 10 .
.
. ‘Model reference controller’ Simulink , , .
.
19
18.
. ,
7%.
16. ( 18)
( 16)
( 8).
5.
. .
N4.
1. Simulink ( 7), .
20
3. ( ‘Generate Training Data‘).
4. ( ‘Train Network’). .
5. .
6. ( 18)
( 8).
21
. N4.
7. Simulink ( 7), .
8. ‘NN Predictive Controller’:
22
9. ( ‘Generate Training Data‘).
10. ( ‘Train Network’). .
11. .
23
12.
, ( 18)
( 8).
1. ?
2. MATLAB?
3. ?