Fuzzy Logic Basics PDF
Fuzzy Logic Basics PDF
Andrew Kusiak
Intelligent Systems Laboratory
2139 Seamans Center
The University of Iowa
Iowa City, IA 52242 1527
[email protected]
@
http://www.icaen.uiowa.edu/~ankusiak
Fuzzy Logic
Fuzzy
Fuzzy logic may be viewed as a bridge
between the excessively wide gap between
the precision of classical crisp logic and
the imprecision of both the real world and
its human interpretation
Paraphrasing L. Zadeh
Fuzzy Logic
Fuzzy Sets
Knowledge is subjective
Experts may bounce between extreme points
of view:
Have problems with structuring the knowledge,
knowledge or
Too aware in his/her expertise, or
Tend to hide knowledge, or ...
Venn Diagrams
Fuzzy Sets
Modeling a Function
Modeling a Function
Standard mathematical approach of curve fitting
((more or less satisfactory
y fit))
Modeling a Function
Example 1
Consider modeling two different functions by
fuzzy rules
y
Example 1
Example 1
IF x is medium THEN y is
medium.
IF x is large THEN y is low.
Example 2
Example 1
These rules define three large rectangular patches
that cover the functions. They are shown in the
next slide together with two possible
approximators for each function.
Example 2
Example 2
Even more,
more our expertise or understanding of
some functional dependencies is often not a
structured piece of knowledge at all.
We typically perform complex tasks without being
able to express how they are executed.
executed
Car Example
Example 2
Th steps
The
t
in
i fuzzy
f
modeling
d li are always
l
the
th same.
Explain to your colleague in the form of IFTHEN rules how to ride a bike.
Car Example
Car Example
iii) Choose the shapes and the positions of fuzzy
subsets, i.e.,
Membership functions, i.e., attributes
INPUTS: D = DISTANCE,
INPUTS
DISTANCE v = SPEED
OUTPUT: B = BRAKING FORCE
Car Example
Car Example
D
Velocity
Low
Braking Force
Medium High
v
120 (km/h) 0
10
Analyze the rules for a given distance D and for
different velocity v, i.e., B = f(v)
100 (%)
Car Example
Car Example
Braking Force
100
Braking Force
100
High
High
The fuzzy
Th
f
patch
Medium
Low
Medium
The fuzzy
patches
Low
(%)
(%)
Velocity
Velocity
10
120
Small Medium High
The University of Iowa
10
120
Small Medium High
Intelligent Systems Laboratory
Car Example
100
Braking Force
Low
(%)
Velocity
Caar Examplee
High
Medium
Three possible
dependencies
p
between the Velocity
and Breaking force.
High
Medium
Low
0
100
Each of us drives
differently
(%)
Velocity
10
120
Small Medium High
10
120
Small Medium High
Intelligent Systems Laboratory
Example:
Room Temperature Control
SURFACE OF KNOWLEDGE
Fuzzy Control of the Distance Between Two Cars
Braking Force
Cold Warm
90
Hot
80
Fan Speed
Room Temperature
70
60
50
40
0
30
20
100
10
200
80
Speed100
40
20
50
Room Temperature
Cold
Warm
100 (%)
Example:
Room Temperature Control
30 (oC)
Room Temperature
Fan Speed
Hot
10
100 (%)
Distance
Example:
Room Temperature Control
Cold Warm
30 (oC)
10
60
150
Fan Speed
Hot
10
30 (oC)
0
100 (%)
If Room Temperature is Cold, then Fan Speed is Slow
If Room Temperature is Warm, then Fan Speed is Medium
The University of Iowa
Example:
Room Temperature Control
Room Temperature
Cold
Warm
Fan Speed
Hot
Fan Speed
1
100
Example:
Room Temperature Control
Fast
The fuzzy
Th
f
patches
Medium
Slow
(%)
10
30 (oC)
0
100 (%)
If Room Temperature is Cold, then Fan Speed is Slow
Room
Temperature
Example:
Room Temperature Control
Fan Speed
30 (oC)
Intelligent Systems Laboratory
Example:
Room Temperature Control
Fan Speed
100
100
Fast
Fast
The fuzzy
patches
Medium
Slow
Slow
0
(%)
Room
Temperature
10
The University of Iowa
The fuzzy
patches
Medium
(%)
Room
Temperature
10
30 (oC)
Intelligent Systems Laboratory
30 (oC)
Example:
Example:
VL
O
U
T
P
U
T
12
If there was no
overlapping.
one would
obtain the
stepwise
p
function as
shown next
10
VS
0
0
VS
2
S
4
VL
10
INPUT
Warm
12
Hot
10
22
30 (oC)
O
U
T
P
U
T
VB
B
10
VS
VS
0
0
100 (%)
M
6
INPUT
B
8
VB
10
12
Example:
Room Temperature Control
After the fuzzy modeling is done there is an
operational phase:
Compute the fan speed when the room
temperature = 22 oC
NOTE
NOTE: 22 oC belongs
b l
to
t the
th subsets
b t Warm
W
andd
Hot
Warm
Fan Speed
Hot
Room Temperature
Cold
Warm
Fan Speed
Hot
0.6
0.6
0.3
10
30 (oC))
22
100 ((%))
10
22
30 (oC))
100 ((%))
Cold
Warm
Defuzzification
Fan Speed
Hot
Fan Speed
0.6
0
0.3
10
22
30 (oC)
100 (%)
60
100
(%)
= Car angle
(INPUT 1)
(INPUT 2)
v = 10.0 m/s
- Developed in Matlab
- User friendly
- Multiple inputs
Start
Conclusions
Conclusions