You are on page 1of 44

Dr.(Mrs.

) Lini Mathew
Associate Professor
NITTTR, Sector 26
Chandigarh
Fuzzy Logic
Multi-valued logic that follows intermediate values
to be defined between 0 and 1
Based on natural language
Initiated in 1965 by Lofti Zadeh, Professor,
Computer Science, University of California,
Berkeley.
Conceptually easy to understand
Flexible
Tolerant of imprecise data
Nonlinear functions of arbitrary complexity
can be modeled
Built on top of the experience of experts
Blended with conventional control techniques
Fuzzy Logic
Fuzzy Logic starts with the concept of
fuzzy set.
A fuzzy set is a set without a crisp, clearly
defined boundary.
It can contain elements with a partial
membership function
A classical set has a clearly defined
boundary that wholly includes or excludes
any given element.
Fuzzy Set
Fuzzy Set vs Crisp Set
Crisp Set Fuzzy Set
Fuzzy Set vs Crisp Set
X is a set of all real numbers from 1 to 10
Universe of Discourse
A is a set of real numbers between 5 and 8
Crisp or Classical Set
Membership Value 1 or 0
Fuzzy Set vs Crisp Set
B is a set of young people
Membership values between 0 and 1 Fuzzy Set

Age 65 27 17 32 22 25
B 0 0.3 1 0 0.8 0.5
Fuzzy Set
Another example of Fuzzy
Set
What season is it right
now?
Using the astronomical
definitions for season, we
get sharp boundaries.
What we experience as
seasons varies more or
less continuously
Membership Functions
Membership function (MF) is a curve that defines how
each point in the input space is mapped to a
membership value (or degree of membership) between 0
and 1 and is often given the designation of .

A
(x) is called the membership function (or MF) of x in A.
The figure above illustrates a linguistic variable seasons
with four associated linguistic terms namely spring",
"summer", "fall and winter". Each of these linguistic
terms is associated with a fuzzy set defined by a
corresponding membership function.
Thus membership functions are subjective measures for
linguistic terms.
There are many types of membership functions.
Types of Membership Functions
Membership Functions
Membership functions may include multiple subsets
each representing a different degree of the
linguistic term or value.
Multiple overlapping membership functions which
span the entire universe of discourse are useful.
Fuzzy Set Operations
There are three basic operation on fuzzy sets: negation,
intersection, and union
Negation
membership_value(not x)= 1- membership_value(x)
where x is the fuzzy set being negated
Intersection
membership_value(x and y) = minimum{membership_value(x),
membership_value(y)}
where x and y are the fuzzy sets involved in the intersection
Union
membership_value(x or y) = maximum{membership_value(x),
membership_value(y)}
where x and y are the fuzzy sets involved in the union

minimum operator for intersection and the
maximum operator for union
Fuzzy Set Operations
Let A be a fuzzy interval between 5 and 8
B be a fuzzy number about 4.

Fuzzy Set Operations
Union of A and B
A OR B
Intersection of A and B
A AND B
Fuzzy Set Operations
Negation of A
De Morgans Laws
B A B A
B A B A
=
=
Fuzzy Set Operations
100
0
80
0
40
0
20
4 0
10
7 0
1
1
+ + + + + =
. .
A
100
0
80
2 0
40
5 0
20
0 1
10
0 1
1
3 0
+ + + + + =
. . . . .
B
B A B A vi
B A B A v
B iv
A iii
B A ii
B A i
=
=

) (
) (
) (
) (
) (
) (
Fuzzy Relations
A crisp relation between two sets X, Y is a
binary relation.
Binary relations are represented by relation
matrices and also by sagittal diagrams.
R={(1,a) (2,c) (3,b) (4,c)}
Sagittal Diagram
Relation Matrix

1 0 0 4
0 1 0 3
1 0 0 2
0 0 1 1
c b a
Fuzzy Relations
Relation between two or more fuzzy sets is
obtained by the Cartesian product.
( ) ( ) ( ) ( ) ( ) y x y x y x
B A AxB R
, min , , = =
3 2 1
x
1
+
x
5 0
+
x
2 0
= A
. .
2 1
y
9 0
+
y
3 0
= B
. .
9 0 3 0 x
5 0 3 0 x
2 0 2 0 x
y y
3
2
1
2 1
. .
. .
. .
Fuzzy Relations
Let us describe the relationship between the
colour of a fruit, x and the grade of maturity, y.
x= {green, yellow, red}
y={verdant, half-mature, mature}
Considering the relation between the linguistic
terms red and mature, and representing them
by the membership functions, a fruit can be
characterized by the property of red and
mature.
Fuzzy Relations
Characteristics of a red and mature fruit
4 . 0 8 . 0
5 . 0 7 . 0 =
2
1
2 1
x
x
y y
R
Fuzzy Compositions
T = R o S - max-min composition


T = R S - max-product composition


Chain-strength analogy for max-min composition
5 . 0 7 . 0 1 . 0
2 . 0 6 . 0 9 . 0 =
2
1
3 2 1
y
y
z z z
S
( ) ( ) ( ) ( ) { }
z y y x z x
S R T
, , , min max = ,
( ) ( ) ( ) ( ) { }
z y y x z x
S R T
, , max = ,
22
Composition of fuzzy relations
23
Example
(1, ) max[min(0.1, 0.9), min(0.2, 0.2), min(0.0, 0.8), min(1.0, 0.4)]
max[0.1, 0.2, 0.0, 0.4] 0.4
S R
o =
= =
Composition of fuzzy relations
24
Example
(1, ) max[min(0.1, 0.0), min(0.2,1.0), min(0.0, 0.0), min(1.0, 0.2)]
max[0.0, 0.2, 0.0, 0.2] 0.2
S R
| =
= =
Composition of fuzzy relations
25
Composition of fuzzy relations
Fuzzy Relations
Three variables of interest in power transistors are the
amount of current that can be switched, the voltage that can
be switched, and the cost. The following membership
functions for power transistors were developed from
hypothetical components catalog:

Average current

Average voltage

Power is defined by the algebraic operation P = VI
(a) Let us find the Cartesian Product P = VxI.
{ }
2 1
6 0
+
1 1
8 0
+
1
1
+
9 0
7 0
+
8 0
4 0
=
.
.
.
.
.
.
.
.
I
{ }
90
7 0
+
75
9 0
+
60
1
+
45
8 0
+
30
2 0
=
. . . .
V
Fuzzy Relations
The Cartesian Product expresses the relationship between
V
i
and I
j ,
where V
i
and I
j
are individual elements in the
fuzzy set V and I.
Now let us define a fuzzy set for the cost C in rupees, of a
transistor

(b)Using a fuzzy Cartesian Product, find T = IxC.
(c) Using max-min composition find E = PoT
(d) Using max-product composition find E = PoT


{ }
7 0
5 0
+
6 0
1
+
5 0
4 0
=
.
.
. .
.
C
Fuzzy Control
Using a procedure originated by Ebrahim
Mamdani in the late 70s, three steps are taken
to create a fuzzy controlled machine:
Fuzzification (Using membership functions to
graphically describe a situation)
Rule Evaluation (Application of fuzzy rules)
Defuzzification (Obtaining the crisp results)
Fuzzy Control
Fuzzification is the process of making a crisp
quantity fuzzy.
Membership functions characterize the fuzziness in
a fuzzy set.
Six procedures to build membership functions
Intuition
Inference
Rank Ordering
Neural Networks
Genetic Algorithm
Inductive Reasoning
Fuzzy Control
Defuzzification is the conversion of a fuzzy quantity to a
precise quantity.
Output of a fuzzy process can be the logical union of
two or more fuzzy membership functions defined on the
universe of discourse. .
Methods of defuzzification
Max-membership principle
Centroid method
Weighted average method
Mean max membership
Center of sums
Center of largest area
First (or last) of maxima
The Inverted Pendulum.
Here, the problem is to balance a pole on
a mobile platform that can move in only
two directions, to the left or to the right.
Inputs of the system (i) The angle
between the platform and the pendulum
(ii) The angular velocity of this angle
Output of the system The speed of the
platform.
The Inverted Pendulum
Fuzzification
The different levels of output (high speed, low
speed etc.) of the platform is defined by
specifying the membership functions for the
fuzzy sets, the different angles between the
platform and the pendulum and the angular
velocities of specific angles are also defined
The Inverted Pendulum
Fuzzification
Fuzzification
The Inverted Pendulum
Rule Evaluation
The fuzzy rules are merely a series of if-then statements. These
statements are usually derived by an expert to achieve optimum
results.
Some examples of these rules are:
i) If angle is zero and angular velocity is zero then speed is also
zero.
ii) If angle is zero and angular velocity is negative low then the
speed shall be negative low.
iii) If angle is zero and angular velocity is positive high then the
speed shall be positive high.
iv) If angle is negative high and angular velocity is zero then the
speed shall be negative high.
v) If angle is positive high and angular velocity is zero then the
speed shall be positive high.
vi) If angle is positive low and angular velocity is negative low
then the speed shall be zero.
The Inverted Pendulum
Rule Evaluation
Speed
Angle

negative
high
negative
low
zero
positive
low
positive
high
v negative
e high
------- --------
negativ
e high
------- -------
l negative
o low
------- -------
negativ
e low
zero -------
c zero
negative
high
negative
low
zero
positive
low
positive
high
i positive
t low
------ zero
positiv
e low
------- ------
y positive
high
----- -------
positiv
e high
------- ------
The Inverted Pendulum
Rule Evaluation
An application of these rules is shown using specific values
for angle and angular velocities.
The values are seen in the following graphs
The Inverted Pendulum
Rule Evaluation
The result patch yielded by the rule "if angle is zero and angular
velocity is zero, the speed is zero", is shaded up to that area
The Inverted Pendulum
Rule Evaluation
The result patch yielded by the rule "if angle
is zero and angular velocity is negative low,
the speed is negative low"
The result patch yielded by the rule "if
angle is positive low and angular velocity is
zero, then speed is positive low"
The result patch yielded by the rule "if
angle is positive low and angular velocity
is negative low, the speed is zero.
The Inverted Pendulum
Defuzzification
The four result patches are overlapped and is reduced to:
The result of the fuzzy controller so far is a fuzzy set (of speed). To
choose an appropriate representative value as the final output (crisp
value), defuzzification must be done. The most common
defuzzificztion method used is the center of gravity of the set.
Fuzzy Control-Conclusion
Fuzzy control system design is based on empirical
methods, basically a methodical approach to trial-
and-error.
The general process is as follows:
Document the system's operational
specifications and inputs and outputs.
Document the fuzzy sets for the inputs.
Document the rule set.
Determine the defuzzification method.
Run through test suite to validate system,
adjust details as required.
Complete document and release to
production.
Fuzzy Logic Toolbox of MATLAB
FIS Editor Membership Function Editor
Fuzzy Logic Toolbox of MATLAB
Rule Editor Rule Viewer
Defuzzification Methods
Centroid defuzzification
returns the center of area
under the curve.
Bisector is the vertical line
that will divide the region
into two sub-regions of
equal area.
MOM, LOM, SOM -
Middle, Smallest, and
Largest of Maximum
THANKYOU

You might also like