fuzzy set, fuzzy logic, and its applicationsfaculty.petra.ac.id/thiang/download/sistem cerdas-fuzzy...

49
Electrical Engineering Department Petra Christian University This document is prepared by Thiang Sistem Cerdas: Fuzzy Set and Fuzzy Logic - 1 Sistem Cerdas (TE 4485) Instructor: Thiang Room: I.201 Phone: 031-2983115 Email: [email protected] Fuzzy Set, Fuzzy Logic, and its Applications

Upload: dangdan

Post on 20-Jul-2019

223 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 1

Sistem Cerdas (TE 4485)

Instructor: ThiangRoom: I.201

Phone: 031-2983115Email: [email protected]

Fuzzy Set, Fuzzy Logic, and its Applications

Page 2: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Introduction

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 2

AA

AA AA

A

A

Group of Apples

Group of Oranges

OO

OO OO

O

O

OA

AA AA

A

A

Group of Apples?

Group of Oranges?

AO

OO OO

O

O

OA

OA AO

O

A

Group of Apples??

Group of Oranges??

AA

OA OA

O

O

Page 3: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Introduction

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 3

Definition: If temperature is higher than 50°C then it is hot

Temperature is 70°C, is it hot?

Temperature is 30°C, is it hot?

Temperature is 51°C, is it hot?

Temperature is 40°C, is it hot??

Temperature is 45°C, is it hot??

Temperature is 49°C, is it hot????

Temperature is 50°C, is it hot??????

Page 4: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Introduction

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 4

Fuzzy Sets theory was introduced by Lotfi A. Zadeh(1965)

Fuzzy Sets are sets with boundaries that are not precise. The membership in a fuzzy set is not a matter of affirmation or denial, but rather a matter of a degree.

Page 5: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Introduction: Crisp set versus Fuzzy set

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 5

The characteristic of Crisp set assigns a value of either 1 or 0 to each individual in the universal set

Fuzzy set assigns a value within a specified range to each individual in the universal set and the value indicates the membership grade of that individual in the set. Larger value denotes higher degree of set membership.

Crisp Fuzzy

0 0 1 1

Page 6: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Introduction: Crisp set versus Fuzzy set

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 6

Page 7: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set notation

Continuous ( )∫= xxF F /µ

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 7

Example: The set, B, of numbers near to two. Membership function of the set is defined as:

( ) ( )25 −−= xB exµ

( )∫ −−= xeB x /25

2 1 3

( )xBµ

1

Page 8: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 8

Fuzzy Set notation

Discrete ( )∑= xxF F /µ

Example: The set, B, of numbers near to two. Membership function of the set is defined as:

5.3/03/2.075.2/3.05.2/4.02/15.1/4.025.1/3.01/2.05.0/0

++++++++=B

2 1 3

( )xBµ

1

Page 9: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: Basic Concept

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 9

Support of fuzzy set

( ) ( ){ }0/ >= xxFSupp Fµ

Core of fuzzy set

( ) ( ){ }1/ == xxFCore Fµ

Height of fuzzy set

( ) ( ){ }xFh Fµmax=

A fuzzy set F is called normal when h(F) = 1; it is calledsubnormal when h(F) < 1

Page 10: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: Basic Concept

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 10

α-cut of fuzzy set

( ){ }αµα ≥= xxF F/

Strong α-cut of fuzzy set

( ){ }αµα >=+ xxF F/

Complement of fuzzy set ( )

( ) ( ) ( )xFhx FF µµ −=

F

Page 11: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: example

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 11

( ) ( )60,202 =ASupp

( ) [ ]45,352 =ACore

( ) 12 =Ah

[ ]5.52,5.2725.0 =A

( )5.52,5.2725.0 =+A

)( colorredareasolidF =

Page 12: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: Basic Concept

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 12

Fuzzy Subset

( ) ( ) xallforxx BA µµ ≤A fuzzy set, A, is said to be a subset of fuzzy set, B, if

Fuzzy Union (Logic “OR”)

( ) ( ) ( ) ( )[ ]xxxx BABABA µµµµ ,max== ∪+

commutative, associative

Page 13: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: Basic Concept

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 13

Fuzzy Intersection (Logic “AND”)

Associativity (1)

( ) ( ) ( ) ( )[ ]xxxx BABABA µµµµ ,min== ∩•

commutative, associative

Min-Max fuzzy logic has intersection distributive over union

( ) ( )xx CABACBA )()()( ⋅+⋅+⋅ = µµ

[ ] [ ]),min(),,min(max),max(,min CABACBA =

Page 14: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: Basic Concept

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 14

Associativity (2)Min-Max fuzzy logic has union distributive over intersection

( ) ( )xx CABACBA )()()( +⋅+⋅+ = µµ

[ ] [ ]),max(),,max(min),min(,max CABACBA =

DeMorgan’s Law (1)Min-Max fuzzy logic obeys DeMorgan’s Law #1

( ) ( )xx CBCB +• = µµ

[ ])1(),1(max),min(1 CBCB −−=−

Page 15: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: Basic Concept

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 15

DeMorgan’s Law (2)Min-Max fuzzy logic obeys DeMorgan’s Law #2

( ) ( )xx CBCB •+ = µµ

[ ])1(),1(min),max(1 CBCB −−=−

The Law of Excluded MiddleMin-Max fuzzy logic fails the law of excluded middle

oAA /≠•0)1,min( ≠− AA

Page 16: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

The Law of ContradictionMin-Max fuzzy logic fails the law of contradiction

UAA ≠+1)1,max( ≠− AA

Fuzzy Set: Basic Concept

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 16

Page 17: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: Basic Concept

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 17

The intersection and union operations can also be used to assign memberships on the Cartesian product of two sets

Consider, as an example, the fuzzy membership of a set, G, of liquids that taste good and the set, LA, of cities far from Los Angeles

µG = 0.0/Swamp Water + 0.5/Radish Juice + 0.9/Grape Juice

µLA = 0.0/LA + 0.5/Chicago + 0.8/New York + 0.9/London

Cartesian Product

Page 18: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: Basic Concept

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 18

We form the set, E, of Liquids that taste good AND cities that are far from Los Angeles

Cartesian Product

LAGE •=

The following table results

Page 19: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: Example

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 19

Determine: 31 AA ∩

)()( 3221 AAAA ∩∪∩

Page 20: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Set: Answers

31 AA ∩

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 20

Page 21: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

)()( 3221 AAAA ∩∪∩

Fuzzy Set: Answers

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 21

Page 22: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Arithmetic: Fuzzy number

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 22

A fuzzy set is a fuzzy number if the fuzzy set meets the following properties:

• The fuzzy set must be a normal fuzzy set

• α-cut of the fuzzy set must be a closed interval

•Support of the fuzzy set must be an open interval

Example of fuzzy number

and fuzzy interval

Page 23: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Arithmetic Operation on Interval

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 23

Four arithmetic operations on closed intervals:

[a, b] + [d, e] = [a + d, b + e]

[a, b] – [d, e] = [a – e, b – d]

[a, b] · [d, e] = [min(ad, ae, bd, be), max(ad, ae, bd, be)]

[a, b] / [d, e] = [min(a/d, a/e, b/d, b/e), max(a/d, a/e, b/d, b/e)]

Example:[-3, 4] + [-1, 2] = [-4, 6][-3, 3] – [-4, 3] = [-6, 7][-4, 2] · [-2, 4] = [-16, 8]

[-1, 3] / [2, 4] = [-0.5, 1.5]

[-3, 4] + [-1, 2] = [?, ?][-3, 3] – [-4, 3] = [?, ?][-4, 2] · [-2, 4] = [?, ?][-1, 3] / [2, 4] = [?, ?]

Page 24: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Arithmetic Operation on Fuzzy Number

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 24

⎪⎩

⎪⎨

≤<−≤<−+

>−≤=

312/)3(112/)1(

310)(

xforxxforx

xandxforxAµ

Fuzzy Number A

⎪⎩

⎪⎨

≤<−≤<−

>≤=

532/)5(312/)1(

510)(

xforxxforx

xandxforxAµ

Fuzzy Number B

Calculate: A + B, A – B, A · B, A / B

Method for developing fuzzy arithmetic is based on interval arithmetic. Let A and B denote fuzzy numbers and * denotes any of four basicarithmetic. Then,

BABA ααα ∗=∗ )(

Example:

Page 25: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Arithmetic Operation on Fuzzy Number

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 25

[ ]ααα 23,12 −−=A [ ]ααα 25,12 −+=B

[ ] ( ]1,048,4)( ∈−=+ αααα forBAAddition:

⎪⎩

⎪⎨

≤<−≤<

>≤=+

844/)8(404/

800)(

xforxxforx

xandxforxBAµ

Membership function of fuzzy number of A + B is:

Page 26: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Arithmetic Operation on Fuzzy Number

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 26

[ ] ( ]1,042,64)( ∈−−=− αααα forBASubtraction:

⎪⎩

⎪⎨

≤<−−−≤<−+

>−≤=−

224/)2(264/)6(

260)(

xforxxforx

xandxforxBAµ

Membership function of fuzzy number of A – B is:

Page 27: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

[ ] ( ][ ] ( ]⎪⎩

⎪⎨⎧

∈+−−

∈+−−+−=⋅

1,5.015164,145.0,015164,5124

)(22

22

αααα

αααααα

forfor

BA

Multiplication:

[ ]

[ ]⎪⎪

⎪⎪

<≤+−

<≤+

<≤−−−

≥−<

=⋅

1532/)1(4302/)1(

052/)4(31550

)(

2/1

2/1

2/1

xforxxforx

xforxxandxfor

xBAµ

Membership function of fuzzy number of A · B is:

Arithmetic Operation on Fuzzy Number

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 27

Page 28: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

[ ] ( ][ ] ( ]⎩⎨⎧

∈+−−−∈+−+−

=1,5.0)12/()23(),25/()12(5.0,0)12/()23(),12/()12(

)/(ααααααααααα

forfor

BA

Division:

⎪⎪⎩

⎪⎪⎨

<≤+−<≤++<≤−−+

≥−<

=

33/1)22/()3(3/10)22/()15(

01)22/()1(310

)(/

xforxxxforxx

xforxxxandxfor

xBAµ

Membership function of fuzzy number of A / B is:

Arithmetic Operation on Fuzzy Number

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 28

Page 29: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Jakarta

Singapore

Kuala Lumpur

Bangkok

Manila

Fuzzy Relation

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 29

Example of crisp relation:

Let X denotes a set of cities in Southeast Asia.

X = {Jakarta, Singapore, Kuala Lumpur, Bangkok, Manila}

Crisp relation that attempts to capture the relational concept near, is represented by the following relation

Jakarta

Singapore

Kuala Lumpur

Bangkok

Manila

Page 30: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Relation

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 30

Using the same example as example of crisp relation, Fuzzy relation that attempts to capture the relational concept near, is represented by the following relation

Jakarta

Singapore

Kuala Lumpur

Bangkok

Manila

Jakarta

Singapore

Kuala Lumpur

Bangkok

Manila

1

0.9

0.6

0.3

0.10.1 0.20.4

0.5

1

Page 31: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Relation: Representations

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 31

Matrices

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

=

15.04.02.01.05.017.05.03.04.07.018.06.02.05.08.019.01.03.06.09.01

R

Consider the previous example, fuzzy relation is concisely represented by the matrix:

J S K B MJ

S

K

B

M

Page 32: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Relation: Representations

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 32

Mapping Diagram

Consider as an example, a set of documents D = {d1, d2, d3, d4, d5} and a set of key terms T = {t1, t2, t3, t4}.

A Fuzzy relation expressing the degree of relevance of each document to each key term can be represented in the following mapping diagram

Page 33: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Relation: Representations

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 33

Directed Graph

Fuzzy relation can be represented by a directed graph.

Page 34: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Relation: Basic Operation

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 34

Inverse of a fuzzy relation (R-1)

Inverse (R-1) of a fuzzy relation (R) represented by a matrix, can be obtained by exchanging the rows of given matrix with the columns. The resulting matrix is called transpose of given matrix.

Example:

Page 35: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Relation: Basic Operation

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 35

Composition of two fuzzy relations

a

b

c

XY

Z

1

2

3

4

A

B

C

P Q

a

b

c

A

B

C

X Z

P ◦ Q

Page 36: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Relation: Basic Operation

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 36

Standard composition of fuzzy relations

Let P = [pij], Q = [qjk], and R = [rik] are matrix representations of fuzzy relations for which R = P ◦ Q. Matrices relation of composition of fuzzy relations is represented by expression:

[rik] = [pij] ◦ [qjk] where rik = max min(pij, qjk)j

Previous example:

⎥⎥⎥

⎢⎢⎢

⎡=

5.010007.09.02.00017.0

P

⎥⎥⎥⎥

⎢⎢⎢⎢

=

4.01008.01003.0005.0

Q

Page 37: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Relation: Basic Operation

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 37

⎥⎥⎥

⎢⎢⎢

⎡=

5.010007.09.02.00017.0

P

⎥⎥⎥⎥

⎢⎢⎢⎢

=

4.01008.01003.0005.0

Q

5.0)]0,0min(),1,0min(),3.0,1min(),5.0,7.0max[min()],min(),,min(),,min(),,max[min(

11

411431132112111111

===

rqpqpqpqpr

⎥⎥⎥

⎢⎢⎢

⎡==

4.08.0107.07.0005.0

QPR o

Page 38: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

⎥⎥⎥

⎢⎢⎢

⎡==

4.08.0107.07.0005.0

QPR o

Fuzzy Relation: Basic Operation

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 38

a

b

c

A

B

C

X Z

P ◦ Q

Result of composition of fuzzy relation P and Q:

Page 39: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Inference

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 39

Crisp Input

Fuzzification

Rules

Defuzzification

Crisp Output

Antecedent

Consequent

InputMembership

Function

OutputMembership

Function

Page 40: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Inference

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 40

• Assume that we need to evaluate student applicants based on their

GPA and GRE score.

• For simplicity, there are three categories for each score [High (H),

Medium (M), and Low (L)].

• Assume that the decision should be Excellent (E), Very Good (VG),

GOOD (G), Fair (F), and Poor (P).

• An expert will associate the decisions to the GPA and GRE score.

They are then tabulated in Fuzzy If-then Rules form.

Example: Student Applicants Evaluation

Page 41: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Inference

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 41

Example of Fuzzy If-Then Rules

If the GRE is HIGH and the GPA is HIGH then the STUDENT will be EXCELLENT

If the GRE is LOW and the GPA is HIGH then the STUDENT will be FAIR

Antecedent

Consequent

Fuzzy Linguistic Variables

Page 42: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Inference

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 42

Fuzzy If-Then Rules Table

Page 43: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Inference

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 43

Membership Function for GRE

1

1200 1600

LOW MEDIUM HIGH

800

µGRE

Typical shapes of membership function are triangular, trapezoidal, and Gaussian

Page 44: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Inference

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 44

Membership Function for GPA

1

3.0 3.8

LOW MEDIUM HIGH

2.2

µGPA

Page 45: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzy Inference

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 45

Membership Function for Consequent (Student)

1

70 80

P

60

µC

90 100

F G VG E

Example:Evaluate a student who has GRE of 900 and GPA of 3.6!

Page 46: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzification

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 46

Convert the crisp inputs (antecedents) into vector of fuzzy membership values

1

1200 1600

LOW MEDIUM HIGH

800

µGRE

0.25

900

0.75

{ }0,25.0,75.0 ==== HMLGRE µµµµResult:

Page 47: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Fuzzification

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 47

0.25

3.6

0.75

{ }75.0,25.0,0 ==== HMLGPA µµµµ

1

3.0 3.8

LOW MEDIUM HIGH

2.2

µGPA

Result:

Page 48: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Rule Evaluation: Min-Max Strategy

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 48

0.75 0.25 0

0

0.25

0.75

0 0 0

0

0

0.25

0.25

0.25

0.75

{ }0,0,25.0,75.0,25.0 ====== EVGGFPC µµµµµµResult:

Page 49: Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy Logic.pdf · Electrical Engineering Department Petra Christian University This

Defuzzification

Electrical Engineering DepartmentPetra Christian University

This document is prepared by ThiangSistem Cerdas: Fuzzy Set and Fuzzy Logic - 49

1

70 80

P

60

µC

90 100

F G VG E

0.25

0.75

Result: Student is Fair

{ }0,0,25.0,75.0,25.0 ====== EVGGFPC µµµµµµ

Center of Area