Documente Academic
Documente Profesional
Documente Cultură
Pendahuluan
Gambarkan fuzzy set untuk pengautran kecepatan fan dengan ketentuan sbb;
Program matlab
if option == 1,
out = sum(mf.*x)/sum(mf);
elseif option == 2,
total_area = sum(mf);
tmp = 0;
for k=1:data_n,
tmp = tmp + mf(k);
if tmp > total_area/2,
break;
end
end
out = (x(k) + x(k-1))/2;
elseif option == 3,
index = find(mf == max(mf));
out = mean(x(index));
else
error('Unknown defuzzification option!');
end
x=[0:1:120]; %temperatur
y=[0:1:10]; % fan speed
%temperatur
cool_mf=trapmf(x,[0 0 30 50]);
moderate_mf =trimf(x,[30 55 80])
hot_mf=trapmf(x,[60 80 120 120])
antecendent_mf=[cool_mf;moderate_mf;hot_mf];
plot(x,antecendent_mf)
title('cool,moderat and hot temperatur')
xlabel('Temperatur')
ylabel('Membership')
text(25,.8,'Cool')
text(50,.8,'moderate')
text(80,.8,'hot')
0.9
0.7
0.6
Membership
0.5
0.4
0.3
0.2
0.1
0
0 20 40 60 80 100 120
Temperatur
%fan speed
low_mf=trapmf(y,[0 0 2 5]);
medium_mf =trapmf(y,[2 4 6 8])
high_mf=trapmf(y,[5 8 10 10])
consequent_mf=[low_mf;medium_mf;high_mf];
plot(y,consequent_mf)
title('Low,Medium and High fan speed')
xlabel('Fan speed')
ylabel('Membership')
text(2,.8,'Low')
text(5,.8,'Medium')
text(8,.8,'High')
0.9
0.7
0.6
Membership
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
Fan speed
Jika diinginkan temperatur 720 C , berapakah kecepatan fan ?
temp=72
dof1=cool_mf(find(x==temp))
dof2=moderate_mf(find(x==temp))
dof3=hot_mf(find(x==temp))
DOF=[dof1;dof2;dof3]
DOF =
0
0.3200
0.6000
Proses implikasi
consequent1=min(low_mf,dof1);
consequent2=min(medium_mf,dof2);
consequent3=min(high_mf,dof3);
plot(y,[consequent1;consequent2;consequent3]);
axis([0 10 0 1.0])
title('Consequent Fuzzy set')
xlabel('Fan Speed')
ylabel('Membership')
0.9
0.8
0.7
0.6
Membership
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
Fan Speed
Proses agregasi
output_mf=max([consequent1;consequent2;consequent3]);
plot(y,output_mf)
axis([0 10 0 1])
title('Consequent Fuzzy set')
xlabel('Fan Speed')
ylabel('Membership')
%output=centroid(y,output_mf)
output = defuzzy(y, output_mf, 1)
Consequent Fuzzy set
1
0.9
0.8
0.7
0.6
Membership
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
Fan Speed
output =
7.1047
Contoh 2.Sistem kendali temperatur dengan 2 input dan 1 output dengan rule sebagai berikut :
x=[0:5:100]
y=[0:1:10];
z=[0:1:10]
%temperature
cool_mf=trapmf(x,[0 0 30 50]);
moderate_mf=trimf(x,[30 55 80]);
hot_mf=trapmf(x,[60 80 100 100]);
antecendent=[cool_mf;moderate_mf;hot_mf];
plot(x,antecendent)
axis([-inf inf 0 1.2])
title ('antecendent MF for temperature')
text(10, 1.1, 'cool')
text(50, 1.1, 'moderate')
text(90, 1.1, 'hot')
xlabel('temperatur')
ylabel('Membership')
figure
low_act=trapmf(y,[0 0 2 8])
high_act = trapmf(y,[2 8 10 10])
antecendent_a=[low_act;high_act];
plot(y,antecendent_a);
axis([-inf inf 0 1.2]);
title('antecendent MF for activity')
text(1, 1.1, 'Low');text(8, 1.1, 'high')
xlabel('activity Level');ylabel('membership')
figure
%activitas
act=6.1;
mua1=trapmf(act,[0 0 2 8]);
mua2=trapmf(act,[ 2 8 10 10]);
mu_a=[mua1;mua2]
DOF1=min([mu_t(1),mu_a(1)]);
DOF2=min([mu_t(1),mu_a(2)]);
DOF3=min([mu_t(2),mu_a(1)])
DOF4=min([mu_t(2),mu_a(2)]);
DOF5=min([mu_t(3),mu_a(1)]);
DOF6=min([mu_t(3),mu_a(2)])
antecendent_DOF=[DOF1;DOF2;DOF3;DOF4;DOF5;DOF6]
stem(consequent_mf,antecendent_DOF)
axis([0 11 0 .7]);
title('consequent firing strength')
xlabel('fan speed');
ylabel('firing strength');
text(0.2, antecendent_DOF(1)+.02,'very_low');
text(1.5, antecendent_DOF(2)+.04,'low');
text(3.0, antecendent_DOF(3)+.02,'low_medium');
text(5.1, antecendent_DOF(4)+.02,'Low_medium');
text(1.5, antecendent_DOF(5)+.02,'medium');
text(3.2, antecendent_DOF(6)+.02,'high');
output_y =
7.6432
0.8 0.8
Membership
membership
0.6 0.6
0.4 0.4
0.2 0.2
0 0
0 10 20 30 40 50 60 70 80 90 100 0 1 2 3 4 5 6 7 8 9 10
temperatur activity Level
1
0.5
firing strength
0.8
0.4
membership
0.4 0.2
0.2 0.1
Tugas
Diharapkan dengan aturan tersebut motor akan berputar dengan kecepatan yang stabil pada 270
rpm. Ketika kecepatan motor 285 rpm, dimana lebih besar dari kecepatan yang diinginkan yaitu
260 rpm, berapakah tegangan yang dikeluarkan kontroler agar motor berputar pada kecepatan
normalnya (260 rpm)?
1. Sebuah mesin cuci dengan MF input dan output sebagai berikut:
0 20 40 60
Wash-time
2. Sistem kontrol dibawah ini dengan input : suhu udara (0C) dan kelembaban tanah (%).Output
: waktu penyiraman (menit),
0 20 40 60
Durasi penyiraman
Tentukan lamanya waktu penyiraman dengan model mamdani dan sugeno untuk suhu 240C
dengan kelembaban tanah 15 % . Aturan fuzzy untuk sistem kontrol penyiraman air
kelembaban
Dry Long long Long Long Long
Moist Long Medium Medium Medium Medium