You are on page 1of 34

FUZZY LOGIC

Ms. Sehar Zehra


MS (Computer Science)
2009- MS ( CS )-006

06/07/10 Sir Syed University of Engneering & Technology 1


CONTENTS
F • Introduction of Fuzzy Logic
U • Example of Fuzzy Logic
Z • Fuzzy Measures & Membership
Function
Z
• Operation of Fuzzy System
Y
• Fuzzy System Basic Component
• Fuzzification
L
• Rule Evaluation/Inference
O
• Defuzzification
G
• Examples of Fuzzy System
I • Conclusions
C
06/07/10 Sir Syed University of Engineering & Technology 2
WHY FUZZY LOGIC ?
F • Natural language is bounded with
U vague and imprecise concepts
Z  Example:
Z  “Animal A is fast”
Y Slow Fast
 “Today is a very hot day”
• This statements are difficult to translate
L
into more precise language
O  How “fast ” is fast ?
G
I
 How “hot”is very Shot?
lo w e S lo Fa st Fa ste
• st w st
C
06/07/10 Sir Syed University of Engineering & Technology 3
FUZZY LOGIC
F • Fuzzy Logic was initiated in 1965 by
U Professor Lotfi Zadeh.
Z
Z
• It is basically a multi-valued logic that
Y
allows intermediate Values to be
defined between conventional
L Boolean logic like true/false, yes/no,
O black/white.
G • Human-like way of thinking e.g. warm,
I hot, very hot
C
06/07/10 Sir Syed University of Engineering & Technology 4
FUZZY LOGIC
REPRESENTATIO
F N S lo w e st
U
• For every [ 0.0 – 0.25 ]

Z problem must
Z represent in S lo w
Y terms of fuzzy [ 0.25 – 0.50 ]

sets. Fa st
L
• What are fuzzy [ 0.50 – 0.75 ]
O
sets?
G
Fa ste st
I

[ 0.75 – 1.00 ]
C
06/07/10 Sir Syed University of Engineering & Technology 5
DIFFERENCE B / W
CRISP VS FUZZY
F CRSIP LOGIC  FUZZY LOGIC
U • Precise properties • Imprecise properties
Z • Full membership • Partial membership
Z  – YES or NO  – YES ---> NO
Y  – TRUE or  – TRUE ---> FALSE
FALSE  – 1 ---> 0
L – 1 or 0 • Fuzzy Sets

O • Crisp Sets  – she is about 18


G  – she is 18 years years old
I old  – man about 1.6m
C  – man 1.6m tall tall
06/07/10 Sir Syed University of Engineering & Technology 6

EXAMPLE OF
FUZZY LOGIC
F
U  Example
Z  “ The girl is tall ”

Z  but how tall is tall?


Y
 what do you mean by tall?
L  is 5’ 3” is tall ?
O • A particular height is tall to one
G person but
I  is not for another
C

06/07/10 Sir Syed University of Engineering & Technology 7
FUZZY MEASURES
F
U
Z
Z
Y

L
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 8
MEMBERSHIP
FUNCTION
F
U
Z
Very Short Medium Tall Very
Z 1. Short Tall
0
Y

L
O
G 4’ 5’ 6’ 7’
Shor Medium
I t Tall
= [ 0, 1, 0 , = [ 0, 0, 0.5 ,
C 0 , 0 ] 0.5,0 ]
06/07/10 Sir Syed University of Engineering & Technology 9
FUZZY LOGICAL
OPERATIONS
F • Fuzzy Union Operation or Fuzzy OR
U 

Z
• Fuzzy Intersection Operation or
Z
Y
 Fuzzy AND

L • Fuzzy Complement Operation
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 10
FUZZY SYSTEM BASIC
COMPONENTS
F
U
Z
Z
Y

L
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 11
STEP 1 : FUZZIFICATON
F • Fuzzifier converts a crisp input into a
U fuzzy variable.
Z • Definition of the membership functions
Z must
Y  – reflects the designer's knowledge
 – provides smooth transition between
L member
O  and nonmembers of a fuzzy set
G  – simple to calculate
I
C • Typical shapes of the membership
function are
06/07/10 Sir Syed University of Engineering & Technology 12
EXAMPLE
F
U • Assume we want to evaluate the
Z health of
Z  a person based on his height and
Y weight.
• The input variables are the crisp
L
O
numbers of the person’s height
G
and weight.
I • Fuzzification is a process by which
C the numbers are changes into
06/07/10
linguistic words
Sir Syed University of Engineering & Technology 13
FUZZIFICATION OF
HEIGHT
F
U
Z 1.
Very Short Medium Tall Very
Short Tall
Z 0

L 4’ 5’ 6’ 7’
O VS = very
short
G S = Short
M = Medium
I T = Tall
C VT = Very
06/07/10
Tall
Sir Syed University of Engineering & Technology 14
FUZZIFICATION OF
WEIGHT
F
U
Very Slim Medium Heavy Very Heavy
Z 1. Slim
Z 0

L 150l 200l 250l 300l


O b b b b

G VS = very slim
H = Heavy
I S = Slim VH = Very Heavy
M = Medium
C
06/07/10 Sir Syed University of Engineering & Technology 15
STEP 2 : RULES
F • Rules reflect experts decisions.
U • Rules are tabulated as fuzzy words
Z • Rules can be grouped in subsets
Z • Rules can be redundant
Y • Rules can be adjusted to match desired
results
L • Rules are tabulated as fuzzy words
O  – Healthy (H)
G  – Somewhat healthy (SH)
I  – Less Healthy (LH)
C  – Unhealthy (U)
• Rule function f = { U , LH , SH , H }
06/07/10 Sir Syed University of Engineering & Technology 16
FUZZIFIED DECISION
F
U
Z
1 U LH SH H
Z
Y

L
O
G
0. 0.4 0. 0.8 1
I Decisi
2 6 on
C
06/07/10 Sir Syed University of Engineering & Technology 17
FUZZY RULES TABLE
F
U
Z
Z
Y

L
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 18
STEP 3 : CALCULATE
F • For a given person, compute the
U membership of his/her weight and
Z height
Z
Y
• Example:
L – Assume that a person height is
O 6’ 1”
G
I
 – Assume that the person’s
C weight is 140 lb
06/07/10 Sir Syed University of Engineering & Technology 19
MEMBERSHIP OF
HEIGHT
F
U
Z Very Short Medium Tall Very
1.
Z 00 . Short Tall
Y 7
0.
3
L
4’ 5’ 6’ 7’
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 20
MEMBERSHIP OF
WEIGHT
F
U
Very Slim Medium Heavy Very Heavy
Z 1.
Slim
0.
Z 8
Y
0.
2
L 150l 200l 250l 300l
O b b b b

G
I
C
06/07/10 Sir Syed University of Engineering & Technology 21
SUBSTITUTE
MEMBERSHIP VALUES
F
U
Z
Z
Y

L
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 22
PERFORM MIN
OPERATION
F
U
Z
Z
Y

L
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 23
COMPUTE DECISION
FUNCTION
F
U
Z
Z
Y

L
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 24
DEFUZZIFICATION
• Use the fuzzified rules to compute the final
F
decision.
U
Z
• Two methods are often used.
Z
 –Maximum Method –Centroid
Y • One of the most commonly used
defuzzification method is call (COG) or
L centroid method.
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 25
MAXIMUM METHOD
F • Fuzzy set with the largest membership
U value is
Z  selected.
Z
• Fuzzy decision:
Y

L 

O • Final Decision (FD) = Less Healthy


G • If two decisions have same membership
I
max,
C
 use the average of the two
06/07/10 Sir Syed University of Engineering & Technology 26
MAXIMUM METHOD
F
U
Z
Z
Y

L
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 27
CENTORID METHOD
F
U
Z
Z
Y

L
Crisp Decision Index ( D) = 0.4429
O
G
I
C
06/07/10 Sir Syed University of Engineering & Technology 28
FUZZIFIED DECISION
F
U
Z
Z
Y

L
O
G Crisp Decision Index (D) is the centorid
I = 0.4429
C
06/07/10 Sir Syed University of Engineering & Technology 29
FUZZIFIED DECISION
INDEX
F
U
Z
Z
Y

L
O
G Fuzzy Decision Index (D)
75% in Less Healthy group
I 25% in Somewhat Healthy
C group
06/07/10 Sir Syed University of Engineering & Technology 30
EXAMPLE OF FUZZY
SYSTEMS
F • Fuzzy logic success is mainly due to its
U introduction in consumer products
Z
such as :
Z
―temperature controlled in showers
Y ―Air conditioner
―Washing machines
L ―Refrigerators
O ―Photocopier
G ―Camcorder
I ―Heater
C ―Rice cooker
06/07/10 Sir Syed University of Engineering & Technology 31
CONCLUSION
F • Fuzzy logic decision making is used in
U many applications
Z – Implemented using fuzzy sets
Z operations ( If_ Then_Else
statements & logical operators)
Y
– Resembles human decision making
with its ability to work from
L
approximate data and find a precise
O solutions
G
– It is able to be applied to control
I systems and other applications in
C order to improve the efficiency
06/07/10 Sir Syed University of Engineering & Technology 32
and simplicity of the design
QUESTIONS ?

06/07/10 Sir Syed University of Engineering & Technology 33


THE END

06/07/10 Sir Syed University of Engineering & Technology 34

You might also like