Fuzzy Set, Fuzzy Logic, and its Applicationsfaculty.petra.ac.id/thiang/download/Sistem Cerdas-Fuzzy...

Post on 20-Jul-2019

222 views 1 download

transcript

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: thiang@petra.ac.id

Fuzzy Set, Fuzzy Logic, and its Applications

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

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??????

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.

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

Introduction: Crisp set versus Fuzzy set

Electrical Engineering DepartmentPetra Christian University

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

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

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

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

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

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 =

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

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 =

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 −−=−

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

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

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

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

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 ∩∪∩

Fuzzy Set: Answers

31 AA ∩

Electrical Engineering DepartmentPetra Christian University

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

)()( 3221 AAAA ∩∪∩

Fuzzy Set: Answers

Electrical Engineering DepartmentPetra Christian University

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

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

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] = [?, ?]

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:

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:

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:

[ ] ( ][ ] ( ]⎪⎩

⎪⎨⎧

∈+−−

∈+−−+−=⋅

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

[ ] ( ][ ] ( ]⎩⎨⎧

∈+−−−∈+−+−

=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

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

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

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

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

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.

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:

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

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

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

⎥⎥⎥

⎢⎢⎢

⎡==

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:

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

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

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

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

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

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

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!

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:

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:

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:

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