Fuzzy Logic: Dr. Savita Kumari
Fuzzy Logic: Dr. Savita Kumari
1
History,
History, State
State of
of the
the Art,
Art, and
and
Future
Future Development
Development
1965 Seminal Paper “Fuzzy Logic” by Prof. Lotfi Zadeh,
1965 Seminal Paper “Fuzzy Logic” by Prof. Lotfi Zadeh,
Faculty in Electrical Engineering, U.C. Berkeley, Sets
Faculty in Electrical Engineering, U.C. Berkeley, Sets
the Foundation of the “Fuzzy Set Theory”
the Foundation of the “Fuzzy Set Theory”
1970 First Application of Fuzzy Logic in Control
1970 First Application of Fuzzy Logic in Control
Engineering (Europe)
Engineering (Europe)
1975 Introduction of Fuzzy Logic in Japan
1975 Introduction of Fuzzy Logic in Japan
1980 Empirical Verification of Fuzzy Logic in Europe
1980 Empirical Verification of Fuzzy Logic in Europe
1985 Broad Application of Fuzzy Logic in Japan
1985 Broad Application of Fuzzy Logic in Japan
1990 Broad Application of Fuzzy Logic in Europe
1990 Broad Application of Fuzzy Logic in Europe
Today, Fuzzy Logic Has 1995 Broad Application of Fuzzy Logic in the U.S.
1995 Broad Application of Fuzzy Logic in the U.S.
Already Become the
2000 Fuzzy Logic Becomes a Standard Technology and Is
Standard Technique for 2000 Fuzzy Logic Becomes a Standard Technology and Is
Also Applied in Data and Sensor Signal Analysis.
Multi-Variable Control ! Also Applied in Data and Sensor Signal Analysis.
Application of Fuzzy Logic in Business and Finance.
Application of Fuzzy Logic in Business and Finance.
Sde 2
Fuzzy Sets
• Extension of Classical Sets
• Not just a membership value of in the set
and out the set, 1 and 0
– but partial membership value, between 1 and 0
3
The crisp set v.s. the fuzzy set
• The crisp set is defined in such a way as to dichotomize(classification)
the individuals in some given universe of discourse into two groups:
members and nonmembers.
– However, many classification concepts do not exhibit this characteristic.
– For example, the set of tall people, expensive cars, or sunny days.
4
Fuzzy Set Theory
38.7°C
38°C
40.1°C 41.4°C
Fuzzy Set Theory:
42°C
39.3°C
“Strong Fever” 38.7°C
37.2°C 38°C
40.1°C 41.4°C
42°C
39.3°C
“Strong Fever”
“More-or-Less” Rather Than “Either-Or” ! 37.2°C
Slide 5
Application
• Application areas
– Fuzzy Control
• Subway trains
• Cement kilns
• Washing Machines
• Fridges
6
Example: Height
• Tall people: say taller than or equal to 1.8m
– 1.8m , 2m, 3m etc member of this set
– 1.0 m, 1.5m or even 1.79999m not a member
7
1.3 Fuzzy sets: basic types
• A membership function:
– A characteristic function: the values assigned to the elements of the
universal set fall within a specified range and indicate the
membership grade of these elements in the set.
– Larger values denote higher degrees of set membership.
• A set defined by membership functions is a fuzzy set.
• The most commonly used range of values of membership functions is
the unit interval [0,1].
• We think the universal set X is always a crisp set.
• Notation:
– The membership function of a fuzzy set A is denoted by : A
A : X [0,1]
– In the other one, the function is denoted by A and has the same form
A : X [0,1]
– In this text, we use the second notation. 8
Member Functions
• Membership function
– better than listing membership values
• e.g. Tall(x) = {1 if x >= 1.9m ,
– 0 if x <= 1.7m
– else ( x - 1.7 ) / 0.2 }
9
Example: Fuzzy Short
• Short(x) = {0 if x >= 1.9m ,
– 1 if x <= 1.7m
– else ( 1.9 - x ) / 0.2 }
10
Fuzzy Set Operators
• Fuzzy Set:
– Union
– Intersection
– Complement
11
Fuzzy Set Union
• Union ( fA(x) and fB(x) ) =
– max (fA(x) , fB(x) )
• Union ( Tall(x) and Short(x) )
12
Fuzzy Set Intersection
• Intersection ( fA(x) and fB(x) ) =
– min (fA(x) , fB(x) )
• Intersection ( Tall(x) and Short(x) )
13
Fuzzy Set Complement
• Complement( fA(x) ) = 1 - fA(x)
• Not ( Tall(x) )
14
Fuzzy Logic Operators
• Fuzzy Logic:
– NOT (A) = 1 - A
– A AND B = min( A, B)
– A OR B = max( A, B)
15
Fuzzy Logic NOT
16
Fuzzy Logic AND
17
Fuzzy Logic OR
18
Fuzzy Controllers
• Used to control a physical system
19
Structure of a Fuzzy Controller
20
Fuzzification
• Conversion of real input to fuzzy set values
• e.g. Medium ( x ) = {
– 0 if x >= 1.90 or x < 1.70,
– (1.90 - x)/0.1 if x >= 1.80 and x < 1.90,
– (x- 1.70)/0.1 if x >= 1.70 and x < 1.80 }
21
Inference Engine
• Fuzzy rules
– based on fuzzy premises and fuzzy consequences
• e.g.
– If height is Short and weight is Light then feet are
Small
– Short( height) AND Light(weight) => Small(feet)
22
Fuzzification & Inference
Example
• If height is 1.7m and weight is 55kg
– what is the value of Size(feet)
23
Defuzzification
• Rule base has many rules
– so some of the output fuzzy sets will have
membership value > 0
24
Fuzzy Control Example
25
Input Fuzzy Sets
• Angle:- -30 to 30 degrees
26
Output Fuzzy Sets
• Car velocity:- -2.0 to 2.0 meters per second
27
Fuzzy Rules
• If Angle is Zero then output ?
29
Extended System
• Make use of additional information
– angular velocity:- -5.0 to 5.0 degrees/ second
• Gives better control
30
New Fuzzy Rules
• Make use of old Fuzzy rules for angular velocity
Zero
• If Angle is Zero and Angular vel is Zero
– then output Zero velocity
• If Angle is SP and Angular vel is Zero
– then output SN velocity
• If Angle is SN and Angular vel is Zero
– then output SP velocity
31
Table format
32
Complete Table
• When angular velocity is opposite to the
angle do nothing
– System can correct itself
• Inference Rules
• Defuzzified Values
34
Fuzzy Reasoning
• Single rule with single antecedent
Rule: if x is A then y is B
Fact: x is A’
Conclusion: y is B’
• Graphic Representation:
A’ A B
w
X Y
A’
B’
X Y
x is A’ y is B’
Fuzzy Reasoning
• Single rule with multiple antecedent
Rule: if x is A and y is B then z is C
Fact: x is A’ and y is B’
Conclusion: z is C’
• Graphic Representation:
A’ A B’ B T-norm C2
w
Z
X Y
A’ B’
C’
Z
x is A’ X y is B’ Y z is C’
Fuzzy Reasoning
• Multiple rules with multiple antecedent
Rule 1: if x is A1 and y is B1 then z is C1
Rule 2: if x is A2 and y is B2 then z is C2
Fact: x is A’ and y is B’
Conclusion: z is C’
• Graphic Representation: (next slide)
Fuzzy Reasoning
• Graphics representation:
A’ A1 B’ B1 C1
w1
Z
X Y
A’ A2 B’ B2 C2
w2
Z
X Y
T-norm
A’ B’
C’
Z
x is A’ X y is B’ Y z is C’
Fuzzy Reasoning: MATLAB
Demo
• >> rule view mam21
Other Variants
• Some terminology:
– Degrees of compatibility (match)
– Firing strength
– Qualified (induced) MFs
– Overall output MF