Fuzzy Logic
Fuzzy Logic
1
Fuzzy
Fuzzy Logic
Logic
Fuzzy logic is a multivalued logic that allows intermediate
values to be defined between binary evaluations (such as
either “warm” or “cold”). In fuzzy logic, notions such as
“rather warm” or “pretty cold” can be formulated
mathematically, and thus can be processed by computers. By
enabling computers to process such imprecise notions, it may
be possible to develop machines that mimic human-like
thinking.
2
Why
Why Fuzzy
Fuzzy
• Based on intuition and judgment
4
Boolean/Crisp set A is a mapping for the elements of S to the
set {0, 1}, i.e., A: S {0, 1}
Characteristic function:
{
1 if x is an element of set A
A(x) = 0 if x is not an element of set A
Fuzzy set A in X is as
a set of ordered pairs
A x, A x x X ,
defined by membership
function 0 A x 1
6
One can define the crisp set “circles” as:
7
Fuzzy
Fuzzy Linguistic
Linguistic variables
variables
Examples of fuzzy measures include:
close, heavy, light, big, small, smart, fast, slow, hot, cold,
Tall, Short, ....,
•Fuzzy sets and concepts are commonly used in natural language
John is tall
Dan is smart
Alex is happy
The class is hot
8
Crisp
Crisp membership
membership function
function
Crisp membership functions ( µ) are either one or zero.
• e.g. Numbers greater than 10.
A ={x | x>10}
μA( x )
10 9
Fuzzy
Fuzzy membership
membership function
function
The set, B, of numbers near to 2 can be represented by a
membership function:
10
Fuzzy
Fuzzy membership
membership function
function
11
Crips & Fuzzy Membership functions
12
Linguistic Hedges
Modifying the meaning of a fuzzy set using
hedges such as very, more or less, slightly, etc.
tall
Very F = F2
More or less F = F1/2
etc.
More or less tall
Very tall
13
Fuzzy
Fuzzy membership
membership function
function
Triangular MF
14
Fuzzy
Fuzzy membership
membership function
function
Trapezoidal MF
15
Fuzzy
Fuzzy membership
membership function
function
Gaussian MF
16
Fuzzy
Fuzzy membership
membership function
function
17
Fuzzy
Fuzzy membership
membership function
function
18
Fuzzy
Fuzzy membership
membership function
function
19
Fuzzy
Fuzzy membership
membership function
function
20
Properties
Properties of
of Fuzzy
Fuzzy set
set
μA( x )
1
Height
Core
0
Boundary Boundary
Support
21
Properties
Properties of
of Fuzzy
Fuzzy set
set
μA( x )
1
Height
Core
0
Boundary Boundary
Support
μA( x )
1
Height
Core
0
Boundary Boundary
Support
μA( x )
1
Height
Core
0
Boundary Boundary
Support
Normal Subnormal
Properties
Properties of
of Fuzzy
Fuzzy set
set
26
Fuzzy Variable
27
Fuzzy Variable Example
• X = Temperature
• L = {low, medium, high}
• U = {xX | -70o <= x <= +70o}
• M= low medium high
1.0
0.0
28
Fuzzy Variable
• Completude: A variable is complete if for any x
X there is a fuzzy set such as (x)>0
Complete
1.0
Incomplete
0.0
-70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70
29
Fuzzy
Fuzzy membership
membership function
function
30
Fuzzy
Fuzzy membership
membership function
function
31
Example: Short, Medium height and Tall
Medium
1.0
Short Tall
5’ 5’6” 6’ 6’6” 7’
μ
i=1
Ai (x) 1
33
Partition of Unity
1,0
Partition of
0,5
Unity
0,0
1,0
No Partition
0,5
of
Unity
0,0
34
Partition of Unity cont
μ A (x)
μ Aˆ (x) = p
i
for i = 1, , p
μ
i
Aj (x)
j=1
35
Example: Light, Medium weight and
Heavy
Medium
1.0
Light Heavy
60 70 80 90 100
Weight (Kg)
36
A.B ( x) min( A ( x) , B ( x))
Example: Medium and Tall
Medium
1.0
Short Tall
Medium and Tall
5’ 5’6” 6’ 6’6” 7’
A B ( x) max( A ( x) , B ( x))
Fuzzy intersection operation or fuzzy AND
A ( x) 1 A ( x)
38
A.B ( x) min( A ( x) , B ( x))
39
A.B ( x) min( A ( x) , B ( x))
40
A B ( x) max( A ( x) , B ( x))
41
A B ( x) max( A ( x) , B ( x))
42
A B ( x) max( A ( x) , B ( x))
Medium
1.0
Short Medium or Tall
Tall
5’ 5’6” 6’ 6’6” 7’
43
A ( x) 1 A ( x)
A (x)
A (x)
A (x) A (x)
44
A ( x) 1 A ( x)
Negation: A ( x) 1 A ( x)
1.0
Not Tall Tall
5’ 5’6” 6’ 6’6” 7’
45
Fuzzy
Fuzzy Logic
Logic Operations
Operations
46
Discrete
Discrete fuzzy
fuzzy subset
subset
A simple example of a discrete universe and a discrete fuzzy subset
of it, is:
47
A.B ( x) min( A ( x) , B ( x))
Let A and B be fuzzy subsets of the universe X={-3, -2, -1, 0, 1, 2, 3, 4}
A= 0.6/-3 + 0.0/-2 + 0.3/-1 + 0.6/0.0 + 1.0/1 + 0.6/2 + 0.3/3 + 0.5/4
B= 0.2/-3 + 0.6/-2 + 0.4/-1 + 0.6/0.0 + 0.5/1 + 0.4/2 + 0.5/3 + 0.3/4
AB = 0.2/-3 + 0.0/-2 + 0.3/-1 + 0.6/0.0 + 0.5/1 + 0.4/2 + 0.3/3 + 0.3/4
48
Possible
Possible operators
operators for
for AND
AND in
in fuzzy
fuzzy logic
logic
A ( x) B ( x)
A ( x) B ( x)
A ( x) B ( x) A ( x) B ( x)
max{0, A ( x ) B ( x ) 1}
A ( x) B ( x)
2 [ A ( x ) B ( x ) A ( x ) B ( x )]
49
A B ( x) max( A ( x) , B ( x))
50
Possible
Possible operators
operators for
for OR
OR in
in fuzzy
fuzzy logic
logic
A ( x) B ( x) A ( x) B ( x)
A ( x ) B ( x ) 2 A ( x ) B ( x )
1 A ( x) B ( x)
A ( x) B ( x)
1 A ( x ) B ( x )]
min{1, A ( x ) B ( x )}
51
A ( x) 1 A ( x)
Let A be fuzzy subset of the universe
X={-3, -2, -1, 0, 1, 2, 3, 4}
52
Methods
Methods of
of Deductive
Deductive inference
inference
•• Mamdani
Mamdani systems
systems
•• Sugeno
Sugeno models
models
•• Tsukamoto
Tsukamoto models
models
53
Methods
Methods of
of Deductive
Deductive inference
inference
54
Defuzzification
Defuzzification methods
methods
55
Defuzzification
Defuzzification methods
methods
56
Defuzzification
Defuzzification methods
methods
57
Defuzzification
Defuzzification methods
methods
58
Defuzzification
Defuzzification methods
methods
59
Defuzzification
Defuzzification methods
methods
60
Defuzzification
Defuzzification methods
methods
61
Example
Example
62