180
Додаток Б
Процедура оптимізації параметрів функцій належності нечіткої моделі
clc;
global FIS TR_INP TR_OUT VLB VUB
FIS=readfis('KilnModel.fis');
data=load('KilnModelTrainSet.dat');
M = 1; N = 6;
for i = 1 : M
for j = i: N-1
TR_INP(i, j)=data(i, j);
end;
TR_OUT(i,1) = data(i, N);
end;
num_terms=[5 5 3 3 3 7];
vlb_in1_con(1:num_terms(1))=5.0;
vub_in1_con(1:num_terms(1))=20.0;
x0_in1_con(1:num_terms(1))=10.0;
vlb_in2_con(1:num_terms(2))=0.15;
vub_in2_con(1:num_terms(2))=10.0;
x0_in2_con(1:num_terms(2))=2.5;
vlb_in3_con(1:num_terms(3))=10.0;
vub_in3_con(1:num_terms(3))=15.0;
x0_in3_con(1:num_terms(3))=15.0;
vlb_in4_con(1:num_terms(4))=5.0;
vub_in4_con(1:num_terms(4))=25.0;
x0_in4_con(1:num_terms(4))=10.0;
vlb_in5_con(1:num_terms(5))=0.15;
vub_in5_con(1:num_terms(5))=3;
x0_in5_con(1:num_terms(5))=1.35;
vlb_out_con(1:num_terms(6))=4.0;
vub_out_con(1:num_terms(6))=20.0;
x0_out_con(1:num_terms(6))=10.0;
vlb_center=[-60.0 -20.0 20.0 -15.0 -5.0 5.0 40.0 -20.0 3.0 -
80.0 -20.0 0.0 20.0];
vub_center=[-20.0 20.0 40.0 -5.0 5.0 15.0 80.0 20.0 7.0 -
40.0 -0.0 20.0 80.0];
x0_center=[ -30.0 0.0 30.0 -10.0 0.0 10.0 60.0 0.0 5.0 -
60.0 -10.0 0.0 10.0 60.0];
vlb_w=zeros(1, 28); vub_w=ones(1, 28); x0_w=rand(1, 28);
VLB=[vlb_in1_con vlb_in2_con vlb_in3_con vlb_in4_con vlb_in5_con
vlb_out_con vlb_center vlb_w];
VUB=[vub_in1_con vub_in2_con vub_in3_con vub_in4_con vub_in5_con
vub_out_con vub_center vub_w];
x0=[x0_in1_con x0_in2_con x0_in3_con x0_in4_con x0_in5_con x0_out_con
x0_center x0_w];
options = optimset('largescale', 'off');
[xopt options]=fmincon(@Nevyazka, x0, [], [], [], [], VLB, VUB, '',
options);
writefis(FIS, 'KilnModelTrained')