Anda di halaman 1dari 13

LAPORAN PRAKTIKUM

MATA KULIAH PRAKTIK SISTEM CERDAS

OPERASI LOGIKA DALAM HIMPUNAN FUZZY

Disusun Oleh : Kelompok 5


● Muhammad Imam (20502241026)
● Muhammad Asyam (20502244004)
● Rakha Maulana (20502244007)
● Rahmiathul Anisa (20502244017)

Kelas A2

PRODI PENDIDIKAN TEKNIK ELEKTRONIKA

JURUSAN PENDIDIKAN TEKNIK ELEKTRONIKA DAN INFORMATIKA

FAKULTAS TEKNIK

UNIVERSITAS NEGERI YOGYAKARTA

2022
A. TUJUAN
1. Mahasiswa dapat menjelaskan operasi dasar himpunan Fuzzy Logic
2. Mahasiswa dapat menjelaskan bagaimana mengoperasikan logika pada
himpunan Fuzzy
3. Mahasiswa dapat menjelaskan berbagai Operasi Logika (biasa/himpunan
crsip) yang berlaku dan tidak berlaku dalam himpunan Fuzzy

B. DASAR TEORI
Tidak seperti logika boelan (biner-digital) yang memiliki dua buah nilai true (1) dan
false (0), fuzzy logic mempunyai nilai input bilangan real antara 0 dan 1 tergantung
pada derajat keanggotannya. Bagaimana cara kita melakukan operasi logika dalam
fuzzy ? Untuk operasi AND kita menggunakan operasi min. Dengan menggantikan A
AND B dengan min(A,B) kita akan mendapatkan operasi yang kita inginkan.
Sementara itu operasi logika A OR B digantikan dengan operasi max(A,B). Akhirnya
operasi not A digantiakan dengan I-A.

Lebih luas lagi dalam fuzzy logic kita mengenal ini sebagai: fuzzy intersection atau
conjunction (AND), fuzzy union or disjunction (OR), dan fuzzy complement (NOT).
Intersection dari dua buah set fuzzy A dan Bdikenal dengan istilah T norm,
A B(x) = T( A(x), B(x))
Sebagaimana fuzzy intersection, fuzzy union operator dikenal dengan S-norm (T-co
norm):
A B(x) = S( A(x), B(x))
C. ALAT/INSTRUMENT/APARATUS/BAHAN
● Personal Computer (PC)
● Software MATLAB
D. KESELAMATAN KERJA
● Pastikan personal computer (PC) telah terinstall dengan baik
● Jangan mengubah-ubah setting pada system operasi PC

E. LANGKAH KERJA
1) Hidupkan komputer dan siapkan software matlab, fuzzy logic toolbox.
2) Pilih new M-file. Dan ketik perintah dibawah:
x = (0:1:100)';
A = gbell_mf(x, [20, 4, 40]);
B = gauss_mf(x, [70, 20]);

subplot(221); plot(x, A, x, B);


%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');
text(40, 1.1, 'A');
text(70, 1.1, 'B');

subplot(222); plot(x, 1-A);


%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(b) Fuzzy Set "not A"');

subplot(223); plot(x, max(A,B));


%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(c) Fuzzy Set "A OR B"');

subplot(224); plot(x, min(A,B));


%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "A AND B"');
Lalu simpan dengan nama tertentu.
3) Eksekusi file yang telah anda buat pada langkah 2!
4) Amati dan gambarlah hasil eksekusi tsb!
5) Ulangi langkah di atas untuk 2 MF yang berbeda !
6) Buktikan dengan gambar (menggunakan matlab) bahwa operasi berikut
berlaku pada fuzzy logic:
a. A∩A’ =Ø
b. A U A’ = 1
c. A∩B = B∩A
d. A ∩( B U C ) = ( A∩ B) U ( A∩ C)
e. A U ( B∩ C ) = ( A U B) ∩ ( A U C)
f. AU(A∩B)=A
g. (A ∩ B) ‘ = A’ U B’
h. (A U B)’ = A’ ∩ B’

F. HASIL PERCOBAAN
● langkah kerja 1-5
x = (0:1:100)';
A = gbellmf(x, [20, 4, 40]);
B = gaussmf(x, [70, 20]);
subplot(221); plot(x, A, x, B);
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');
text(40, 1.1, 'A'); text(70, 1.1, 'B');
subplot(222); plot(x, 1-A);
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(b) Fuzzy Set "not A"');
subplot(223); plot(x, max(A,B));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(c) Fuzzy Set "A OR B"');
subplot(224); plot(x, min(A,B));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "A AND B"');

langkah kerja 6
a. A∩A’ =Ø
x = (0:1:100)';
A = gbellmf(x, [20, 4, 40]);
B = gaussmf(x, [70, 20]);
subplot(221); plot(x, A, x, B);
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');
text(40, 1.1, 'A');
text(70, 1.1, 'B');
subplot(222); plot(x, min(1-A,A));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "A AND Ainv"');
b. A U A’ = 1
x = (0:1:100)';
A = gbellmf(x, [20, 4, 40]);
B = gaussmf(x, [70, 20]);
subplot(221); plot(x, A, x, B); %set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');
text(40, 1.1, 'A');
text(70, 1.1, 'B');
subplot(222); plot(x, max(A,1-A));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(c) Fuzzy Set "A OR Ainv"');
c. A∩B = B∩A
x = (0:1:100)';
A = gbellmf(x, [20, 4, 40]);
B = gaussmf(x, [70, 20]);
subplot(221); plot(x, A, x, B);
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');
text(40, 1.1, 'A');
text(70, 1.1, 'B');
subplot(223); plot(x, min(A,B));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "A AND B"');
subplot(224); plot(x, min(B,A));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "B AND A"');
d. A ∩( B U C ) = ( A∩ B) U ( A∩ C)
x = (0:1:100)';
A = gbellmf(x, [20, 4, 40]);
B = gaussmf(x, [70, 20]);
C = gbellmf(x, [20, 7, 50]);
subplot(221); plot(x, A, x, B, x, C);
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');
text(40, 1.1, 'A');
text(70, 1.1, 'B');
text(100, 1.1, 'C');
subplot(223); plot(x, min(A,max(B,C)));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "A AND (B OR C)"');
subplot(224); plot(x, max(min(A,B),min(A,C)));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "(A AND B) OR (AAND C)"');

e. A U ( B∩ C ) = ( A U B) ∩ ( A U C)
x = (0:1:100)';
A = gbellmf(x, [20, 4, 40]);
B = gaussmf(x, [70, 20]);
C = gbellmf(x, [20, 7, 50]);
subplot(221); plot(x, A, x, B, x, C);
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');
text(40, 1.1, 'A');
text(70, 1.1, 'B');
text(100, 1.1, 'C');
subplot(223); plot(x, max(A,min(B,C)));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "A OR (B AND C)"');
subplot(224); plot(x, min(max(A,B),max(A,C)));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "(A OR B) AND (A OR C)"');

f. AU(A∩B)=A x = (0:1:100)';
A = gbellmf(x, [20, 4, 40]);
B = gaussmf(x, [70, 20]);
subplot(221); plot(x, A, x, B);
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');
text(40, 1.1, 'A'); text(70, 1.1, 'B');
subplot(223); plot(x, A);
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A');
subplot(224); plot(x, max(A,min(A,B)));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "A OR (AAND B)"');

g. (A ∩ B) ‘ = A’ U B’ x = (0:1:100)';
A = gbellmf(x, [20, 4, 40]);
B = gaussmf(x, [70, 20]);
subplot(221); plot(x, A, x, B);
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');
text(40, 1.1, 'A');
text(70, 1.1, 'B');
subplot(223); plot(x, 1-min(A,B));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "A AND B"inv');
subplot(224); plot(x, max(1-A,1-B));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "Ainv OR Binv"');

h. (A U B)’ = A’ ∩ B’
x = (0:1:100)';
A = gbellmf(x, [20, 4, 40]);
B = gaussmf(x, [70, 20]);
subplot(221); plot(x, A, x, B);
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');
text(40, 1.1, 'A');
text(70, 1.1, 'B');
subplot(223); plot(x, 1-max(A,B));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "A OR B"inv');
subplot(224); plot(x, min(1-A,1-B));
%set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "Ainv AND Binv"')

G. KESIMPULAN
Dari percobaan yang telah dikakukan dapat ditarik beberapa kesimpulan sebagai
berikut.
1. Pada fuzzy intersection (AND), garis yang diambil oleh logika fuzzy adalah
garis yang mendekati logika 1 dan dapat dilakukan dengan menggunakan
operasi min pada matlab.
2. Pada fuzzy union (OR), garis yang diambil oleh logika fuzzy adalah garis
yang mendekati logika 0 dan dapat dilakukan dengan menggunakan operasi
max pada matlab.
3. Pada fuzzy complement (NOT), garis yang dihasilkan oleh logika fuzzy
terbalik dari sebelum diberi logika tersebut dan dapat dilakukan dengan
menambahkan “1-” pada logika yang diinginkan pada matlab.

Anda mungkin juga menyukai