Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Laporan Kedua

Pratek Sistem Kendali Cerdas

“Fuzzy Operation”

Oleh

Aldi

19130003

Program Study Teknik Elektro Industri

Jurusan Teknik Elektro

Falkutas Tekknik

Universitas Negri Padang

2022
I. Tujuan :

1. Mampu memahami jenis-jenis operasi pada fuzzy , penampilan hasil dan pemrograman dengan
MATLAB.
2. Mampu menerapkan perangkat lunak Matlab untuk perancangan dan analisis sistem kendali
cerdas.

II. Alat dan Bahan

1. Personal Computer

2. Software Matlab 7.5.0(2007b)

III. Teori Singkat


Operasi Fuzzy Set
1. Union : AUB = C atau C = A OR B
µC(x) = max(µA(x), µB(x)) = µA(x) V µB(x))

2. Intersection (conjunction) : A∩B =C atau C = A AND B


µC(x) = min(µA(x), µB(x)) = µA(x) Λ µB(x))

3. Complement (negation) : A (¬A, NOT A)


µA(x) 1- µA(x)

Contoh1. Operasi fuzzy set


x = (0:1:100)';
A = gbellmf(x, [20, 4, 40]);
B = gaussmf(x, [20, 70]);

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"');

Contoh 2. Illustration of subsets in fuzzy sets


x = 0:100;
B = gbellmf(x, [30, 2, 50]);
A = 0.9*gaussmf(x, [15, 60]);
%subplot(221);
plot(x, A, x,
B);
axis([-inf inf 0 1.2]);
title('A Is Contained in
B'); ylabel('Membership
Grades');
%set(gca, 'xticklabels', []);
text(25, 1.0, 'B');
text(42, 0.75, 'A');
IV. Tugas
1. Jika kita memiliki dua (discrete) fuzzy sets:

A = 0.4/1+0.6/2+0.7/3+0.8/4

B = 0.3/1+0.65/2+0.4/3+0.1/4

a. Gambarkan intersection, union antara set A dan set B,


Answer
Program
x=[0 1 2 3 4 ];
A=[0 0.4 0.6 0.7 0.8];
B=[0 0.3 0.6 0.4 0.1];
subplot(211);
plot(x,min(A,B));
axis([-inf inf 0 1.2]);
title('intersection set A dan B')
subplot(212);
plot(x,max(A,B));
axis([-inf inf 0 1.2]);
title ('union set A ,B');
Run

b. Gambarkan komplemen dari hasil intersection (A dan B).


Answer
Program
x=[0 1 2 3 4];
A=[0 0.4 0.6 0.7 0.8];
B=[0 0.3 0.6 0.4 0.1];
C=min(A,B);
plot(x,1-C);
Run
2. Diberikan dua fuzzy sets A dan B

a. Gambarkan fuzzy set A dan B dalam bentuk grafik

b. Gambarkan union antara set A dan set B

c. Gambarkan intersection antara set A dan set B

d. Gambarkan komplemen dari hasil union ( A dan B)


Answer
Program
x=[-2:4];
A=[0 0.3 0.6 1 0.6 0.3 0];
B=[0 0.1 0.4 0.7 1 0.5 0];

subplot(221);plot(x,A,x,B);
set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');

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


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

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


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

C=max(A,B);
subplot(224);plot(x,1-C)
set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(d) Fuzzy Set "not (A or B)"');

Run
3. Diberikan dua fuzzy set A dan B dalam bentuk

a. Gambarkan fuzzy set A dan B dalam bentuk grafik

b. Gambarkan union antara set A dan set B

c. Gambarkan intersection antara set A dan set B

d. Gambarkan komplemen dari set B


Answer
Program
x=0 :0.1: 21;
A=gbellmf(x,[4 2 0]);
B=gbellmf(x,[3 2 10]);

subplot(221);plot(x,A,x,B);
set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Sets A and B');

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


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

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


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

subplot(224); plot(x, 1-B);


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

Run

4 . Gambarkan dua fuzzy set A dan B dalam bentuk trapezoid dan triangular , kemudian tentukan
a. Union antara set A dan set B (trapezoid).

b. Intersection antara set A dan set B (trapezoid).

c. Komplemen dari hasil intersection antara set( A dan B) (trapezoid).


Answer
Program
%bentuk trapezoid
x=0 :0.1: 21;
A=trapmf(x,[4 10 16 22]);
B=trapmf(x,[1 7 14 20]);

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


set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(0) Fuzzy Sets A and B');

%Union Set A ,B
subplot(222); plot(x, max(A,B));
set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Set "A OR B"');

%Intersecction Set A ,B
subplot(223); plot(x, min(A,B));
set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(b) Fuzzy Set "A AND B"');

%Komplemen dari hasil intersection antara set( A dan B)


C=min(A,B);
subplot(224); plot(x, 1-C);
set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(c) Fuzzy Set "not (A and B"');

Run
d. Union antara set A dan set B (triangular).

e. Intersection antara set A dan set B (triangular).

f. Komplemen dari hasil intersection antara set( A dan B) (triangular).

Answer
Program
%bentuk tringular
x=0 :0.1: 21;
A=trimf(x,[4 10 16]);
B=trimf(x,[1 7 14]);

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


set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(0) Fuzzy Sets A and B');

%Union Set A ,B
subplot(222); plot(x, max(A,B));
set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(a) Fuzzy Set "A OR B"');

%Intersecction Set A ,B
subplot(223); plot(x, min(A,B));
set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(b) Fuzzy Set "A AND B"');

%Komplemen dari hasil intersection antara set( A dan B)


C=min(A,B);
subplot(224); plot(x, 1-C);
set(gca, 'xticklabels', []);
axis([-inf inf 0 1.2]);
title('(c) Fuzzy Set "not (A and B"');

Run

You might also like