Sei sulla pagina 1di 56

KT6264

Soft Computing for Engineering Applications


(Fuzzy Logic)
Anuar Mikdad Muad (mikdad@eng.ukm.my)
Department of Electrical, Electronic and Systems Engineering, Faculty of Engineering and Built Environment,
Universiti Kebangsaan Malaysia,
43600 UKM Bangi, Selangor, MALAYSIA.
Introduction
Experts rely on common sense when solving problems.
How to represent expert knowledge that uses vague and
ambiguous terms in a computer? Fuzzy logic.
Fuzzy logic is not logic that is fuzzy, but logic that is used
to describe fuzziness.
Fuzzy logic is the theory of fuzzy sets (sets that calibrate
vagueness).
Fuzzy logic is based on the idea that all things admit of
degrees. Temperature, height, speed, distance, beauty.
The motor is running really hot. Ahmad is a very tall guy.

2
Boolean logic uses sharp/hard distinctions. It
forces us to dray lines between members of a
class and non-members. For example, Ahmad is
tall because his height is 181 cm. If we drew a line
at 180 cm, we would find that Jaafar, who is 179
cm, is short. Is Jaafar really a short guy or we
have just drawn an arbitrary line.
Fuzzy logic reflects how people think. It attempts
to model our sense of words, our decision
making, and our common sense. As a result, it is
leading to new, more human, intelligent systems.
3
4
Fuzzy logic reflects real-life scenario
Plato (427347? BC) saw
degrees of truth everywhere
and recoiled from them. No
chair is perfect, it is only a
chair to a certain degree.
Charles Sanders Peirce (1839
1914) laughed at the sheep and
goat separators who split the
world into true and false. All that
exists is continuous and such
continuums govern knowledge.
Bertrand Russell (18721970)
Both vagueness and precision
are features of language, not
reality. Vagueness clearly is a
matter of degree.
Jan Lukasiewicz (18781956)
proposed a formal model of
vagueness, a logic based on more
values than TRUE or FALSE. 1 stands
for TRUE, 0 stands for FALSE, 1/2
stands for possible. Actually the
three-valued logic by Lukasiewicz
stayed just one step away from the
multivalued fuzzy logic by Zadeh
and can be considered as its closest
relative.
Max Black (190989) proposed a
degree as a measure of vagueness.
Albert Einstein (18791955): So far
as the laws of mathematics refer to
reality, they are not certain. And so
far as they are certain, they do not
refer to reality.
5
Lotfi Zadeh (1923 ) introduced fuzzy sets
and logic theory. As the complexity of a
system increases, our ability to make
precise and significant statements about its
behaviour diminishes until a threshold is
reached beyond which precision and
significance (or relevance) become almost
mutually exclusive characteristics... A
corollary principle may be stated succinctly
as, The closer one looks at a real-world
problem, the fuzzier becomes its solution.
The father of fuzzy logic.
6
Brief history of fuzzy logic
1965 - Seminal Paper by Prof. Lotfi Zadeh on Fuzzy Sets
1966 - Fuzzy Logic (P.Marinos, Bell Labs)
1972 - Fuzzy Measure (M. Sugeno, TIT)
1974 - Fuzzy Logic Control (E.H. Mamdani, London Q.
Mary)
1980 - Control of Cement Kiln (F.L. Smidt, Denmark)
1987 - Sendai Subway Train Experiment, Japan (Hitachi)
1988 - Stock Trading Expert System (Yamaichi
Securities)
1989 - LIFE (Lab for International Fuzzy Eng.) Japanese
Govt. provides US$70million on Fuzzy research
7
Brief history of fuzzy logic (cont.)
1989 - First Fuzzy Logic Air-Conditioner
1990 - First Fuzzy Logic Washing Machine
1990~1994 - Japanese Companies develops Fuzzy
Logic application in a big way
1994 - Japanese companies sold over
US$34billion of fuzzy logic consumer products
1992 ~ 1998 - Research on neuro-fuzzy
techniques
2000 - ?
8
Introduction
What is Fuzziness?
blurred, fluffy, frayed or indistinct. (Oxford English
Dictionary).

Some important points
Fuzziness is deterministic uncertainty.
Fuzziness is connected with the degree to which
events occur rather than the likelihood of their
occurrence(probability).
For example, the degree to which a person is young is
a fuzzy event rather than a random event.
9
Fuzzy logic
Fuzzy logic is a type of computer logic that is
supposed to imitate the way that humans think,
for example by adapting to changing
circumstances rather than always following the
same procedure. Collins Dictionary
10
How does fuzzy logic resembles
human intelligence?
Clustering and classification
It reflects some forms of human reasoning
process.
Hypothetical rules
Inferencing
Logic reasoning
Eg. If hot then dont touch.
It can handle a certain level of imprecision and
uncertainty.
11
Example of differences between fuzzy logic and crisp logic
CRISP FUZZY
Precise properties Imprecise properties
Full membership
Yes or No
True or False
0 or 1

Partial membership
Yes No
True False
0 1
Crisp sets
Students age 15 years
People 1.8m tall
Fuzzy sets
Students about 15 years
People about 1.8m tall.
Crisp models
Crisp relations
Fuzzy models
Fuzzy relations
12
13
A classical example in fuzzy sets is tall men. The elements of the
fuzzy set tall men are all men, but their degrees of
membership depend on their height.
Fuzzy logic can handle some level of uncertainty and imprecision
Example of sources of uncertainty
Data measurement
Errors and blunders
Resolution limits
Incomplete and missing data.

Random occurrences

Linguistic imprecision
Ambiguous
Imprecise
Vagueness.
14
The success of fuzzy logic is mainly due to its
introduction into consumer products
Early applications started in Japan since 1980s,
some examples are:
Sendai Subway System
Temperature controlled in showers
Air conditioners, washing machines, camcorders,
refrigerators, TVs, rice cookers, heaters.
Brake control of vehicles.

15
Fuzzy logic reflects real-life scenario
16
Example of linguistic imprecision
How was the weather like yesterday?
Oh! It was rainy with 97% humidity and hot
with temperature of 36.7 deg. C.
Oh! It was very humid and really hot.
17
Example of fuzzy rules in washing machines
If transmittance is high
and load is heavy then
extend washing cycle
medium
If transmittance is low and
load is heavy then extend
washing cycle longer
18
Fuzzy Logic Automatic Gear Shift Control in Vehicles
Fuzzy logic is used
to determine the
best gear position
in difficult
conditions
Example of the Rules
IF Road is Too Winding AND Brake is applied Many Times THEN Gear is Low
If Road is Normal AND No Brake is Applied THEN Gear is Normal
19
Diagrams for (a) crisp set boundary and (b) fuzzy set boundary.
20
CLASSICAL (CRISP) SETS
21
22
Union of sets A and B (logical or).
Intersection of sets A and B.
Complement of set A. Difference operation A | B.
23
Properties of Classical (Crisp) Sets
Commutativity
A B = B A
A B = B A
Associativity
A (B C) = (A B) C
A (B C) = (A B) C
Distributivity
A (B C) = (A B) (A C)
A (B C) = (A B) (A C)
Idempotency
A A = A
A A = A
Identity
A = A A X = A
A = A X = X
Transitivity
If A B and B C, then A C
Involution
24
25
Mapping of Classical (Crisp) Sets to Functions
A crisp set, A, can be defined as a
set which consists of elements with
either full or no membership at all in
the set.
Each item in its universe is either in
the set, or not.
26
27
Rule method: Take only the members which satisfy the rule.
Rule: Take only the houses higher than 15 m.
Crisp Sets
Two sets, A and B, on the universe X.
28
FUZZY SETS
Fuzzy sets allow the elements in its set to have
partial membership.
Membership from 0 to 1.
Thus, a fuzzy set is a generalization of an
ordinary set by allowing a degree (or grade) of
membership for each element.
29
FUZZY SETS NOTATIONS
X is called the universe of discourse and x represents a generic
element of X.
A fuzzy set in a universe of discourse X is characterized by a
membership function,
A
A fuzzy set in X is usually represented as a set of ordered
pairs of elements x and grade of membership value:
( )
( ) { }
A
A= , x x x X e
| |
A
: 0,1 X
A
30
FUZZY SETS NOTATIONS
A notation convention for fuzzy sets when the universe of
discourse, X, is discrete and finite, is as follows for a fuzzy set,
A
When the universe, X, is continuous and infinite, the fuzzy set
is denoted by
A
( )
( )
( )
( ) { }
1 A 1 2 A 2
A= , , , , x x x x
We could also write the notation as:
31
Universe of Discourse
Defined as a collection of objects all having
the same characteristics.
Notation: U or X, and elements in the
universe of discourse are: u or x.
Some examples:
Voltages of actuators
Speed of cars
Errors
Etc.
32
Example
In the universe of discourse, the fuzzy set labelled integer
approximately equal to 5 may be defined as:
0.1 0.4 0.85 1.0 0.85 0.4 0.1
A
2 3 4 5 6 7 8

= + + + + + +
`
)
Similarly, the fuzzy subset labelled integer close to 4 may
be defined as:
0.4 0.8 1.0 0.8 0.4 0.1 0.0
A
2 3 4 5 6 7 8

= + + + + + +
`
)
The fuzzy subset can be written in the following form:
( ) ( ) ( ) ( ) ( ) ( ) ( ) { }
A 2, 0.4 , 3, 0.8 , 4,1.0 , 5, 0.8 , 6, 0.4 , 7, 0.1 , 8, 0.0 =
A
A
A
33
34
Rule method: Take only the members which satisfy the rule.
Rule: Take only the houses high houses.
Fuzzy Sets
35
Membership function about 3
36
Fuzzy Set Operations
37
38
39
Properties of Fuzzy Sets
40
Example: Two discrete fuzzy sets, namely, and
A B
41
( )
A
0 x >
Support set
The support set of a fuzzy set is
the crisp set of all points x in X
such that
A
( ) ( )
{ }
A
A 0 S x X x = e >
42
Crossover point
The element x in X at which is
called the crossover point when
( )
A
0.5 x =
Example
Consider a set of five pencils located in the box. Determine a fuzzy set of
short pencils A as

A= {pencil1/0.2, pencil2/0.5, pencil3/1.0, pencil4/1.0, pencil5/0.9}
pencil3 and pencil4 are exactly short, pencil5 is almost short, pencil2
is more or less short and pencil1 is almost exactly not short.
43
Fuzzy singleton
A fuzzy set whose support is a single point in X is referred to
as a fuzzy singleton.
44
Example
Consider a set of five pencils

A= {pencil1/0.2, pencil2/0.5, pencil3/1.0, pencil4/1.0, pencil5/0.9}

The 0.5-level set contains {pencil2, pencil3, pencil4, pencil5}
The 0.8-level set contains {pencil3, pencil4, pencil5}
o-cut set of a fuzzy set
The o-cut set of a fuzzy set, labelled
with o by convention, is the crisp
set of all points x in X such that
Note that an o-set discards the point
whose membership values are lower
than o.
( )
{ }
A
A x X x
o
o = e >
A
A
45
46
o-cut set of a fuzzy set
47
Normalization
This process simply involves re-scaling
the membership function so that its
maximum value is 1, that is:
( )
( )
( )
( )
( )
A
NORM A
A
max
x
x x X
x

= e
Membership Functions
Two ways to define the membership for fuzzy
sets:
Numerical
Functional.

48
Example of a numerical definition:
0.4 0.8 1.0 0.8 0.4 0.1 0.0
A
2 3 4 5 6 7 8

= + + + + + +
`
)
Example of a functional definition:
( )
( )
2
1
1 5
f x
x
=
+
We may use standard functions to represent
fuzzy sets.
The membership functions which are often
used in practice include:
s-function
t-function
Triangular function
Trapezoid function
Exponential function
Gaussian function.
49
50
s-membership function
t-membership function
51
0

( )

0
A
if u a
u a
if a u b
b a
u
c u
if b u c
c b
if u c


s s

=
`


s s


>
)
a
b
c
u

A

1
0
Triangular membership function
52
Example
Let the universe of discourse be the interval [0,100] with Y interpreted as
age. A fuzzy set F of Y labelled middle age may be defined as :
What are the implications of the term middle-age?
A person aged 45 is often considered to be middle-aged. However, what
about someone of 38 say? What about other ages? It seems plausible
that the required fuzzy set should have a maximum at around 45, and
go to zero below 30 and above 60. Usually, a Gaussian-function or T-
function gives a good description in such circumstances.
( ) ( ) { }
,
F
F y y y Y = e
53
The fuzzy set F might be defined using a T-function as :
54
Gaussian membership function

A
(x)
(
(


=
m
A
s
c x
m s c x
2
1
exp ) , , , (
0 1 2 3 4 5 6 7 8 9 10
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
x
c=5
s=2
m=2
c: centre
s: width
m: fuzzification factor (e.g., m=2)
55
Exercise
Write down the mathematical
expression of this membership
function.
Write down the mathematical
expression of this membership
function.
56
Exercise
Suppose a membership function to show young is described by
the following equation:
Base on this membership function, write down the membership
values of the ages for 10, 20, 25, 30, 35, 40, 50 in this set.

Draw the graph for this membership function to show youngness.

Potrebbero piacerti anche