Sie sind auf Seite 1von 21

SKEM 4173 Artificial Intelligence

Chapter 2
Fuzzy Logic Control
Dr. Mohamad Hafis Izran B Ishak
CMED
Faculty of Electrical Engineering
Universiti Teknologi Malaysia
hafis@fke.utm.my

Topic 2: Fuzzy Logic Control


(9 hours) 3 weeks
Fuzzy sets and fuzzy systems
Definitions, fuzzy set operations,
fuzzy relations & fuzzy reasoning
Fuzzy logic control systems &
applications
Components of FLCS, design of FLCS
During Class

One/Two students will be called to:


Introduce yourself
Your name/family etc.
Your academic background
Your hometown/country
Your experience with any AI machine(s)
What your expectation from this course
Talk about 5 minutes.
Extra bonus marks will be given
Any volunteer for today?

Introduction
What is Fuzziness?
According to the Oxford English Dictionary,
The word fuzzy means blurred, fluffy, frayed or indistinct.

In Malay, fuzzy is kabur or samar or kurang jelas.

Some important points to note:


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.
4
How Does Fuzzy Logic
Resembles Human Intelligence?

Rule Base System (reflects some forms of


the Human Reasoning Process)
Handling certain levels of Imprecision and
Uncertainty
Clustering and Classification

Example of Differences Between


Fuzzy Logic and Crisp Logic

Precise Imprecise
Properties Properties

Full Membership Partial Membership


Yes or No Yes --> No
True or False True --> False
1 or 0 1 ---> 0

Crisp Sets Fuzzy Sets


Girls age 13 yrs Girls about 13yrs
People 1.5m tall People about 1.5m tall

Crisp Models Fuzzy Models


Crisp relations Fuzzy relations

6
Features of Fuzzy Logic

Example of Linguistic Imprecision


Unusual and Real-Life Quotes
How was the weather like yesterday?
Oh! It was rainy with 98% humidity and hot with
temperature of 35.5 deg C
Oh! It was very humid and really hot.

Fuzzy logic can handle such linguistic


imprecision
where other techniques have difficulty in
handling
7

Fuzzy logic can handle linguistic imprecision


where other techniques have difficulty in
handling

When you are at 10 metres from the junction start


braking at 50% pedal level.

When you are near the junction, start braking slowly.

8
Why Fuzzy Logic?
Fuzzy Logic can:
Represent vague language
naturally
Enrich not replace crisp sets
Allow flexible engineering
design
Improve model performance
Are simple to implement
And best of all they often
work!

What are the Advantages of


using Fuzzy Logic in Systems
Design?

10
More Questions!
What are fuzzy sets?
Why fuzzy sets?
What is the difference between a fuzzy set
and a crisp set?
Properties of fuzzy sets?
Relation of fuzzy sets to the real world?
How do you operate a fuzzy set on to another
fuzzy set similarly for fuzzy relations?
How could fuzzy sets be used in a real-world
application?

11

Fuzzy Sets: An Overview

12
With Fuzzy Logic, Rules Can Be
Written in a More Natural Way.
Eg. of Rule-based System Eg. of Rule-based System
without Fuzzy Logic with Fuzzy Logic
-------------------------- --------------------------
If Temperature is 30oC If Temperature is HIGH
Then Switch ON Then Switch ON
Condenser to 80% Condenser HIGH

If Traffic has more than If Traffic is HEAVY Then


20 Cars Then Extend Green Should be
Green Light by 20 secs Extended LONGER

13

Definition of Fuzzy Sets


Definition of Fuzzy Sets
Fuzzy Sets compared with Crisp sets
A crisp set, A, can be defined
as a set which consists of mA
elements with either full or no Crisp set, A
membership at all in the set. 1.0

Each item in its universe is


0
either in the set, or not. u

14
Definition of Fuzzy Sets
Some Facts on 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.

15

A fuzzy set uses a common function such as triangular,


trapezoidal, gaussian, etc. called membership functions
to support the membership value of its elements.

mA
Membership value

1.0 Fuzzy set A


Membership function

Universe of u
discourse

16
Compare the Crisp Set and
Fuzzy Set

mA mA

Membership value
1.0
A A
1.0

0
u Universe of discourse u

17

Definition of Fuzzy Sets


Fuzzy Set Notations
U is called the universe of discourse and u represents a
generic element of U.
A fuzzy set F in a universe of discourse U is
characterized by a membership function,

F : U 0, 1

A fuzzy set F in U is usually represented as a set of


ordered pairs of elements u and grade of membership

F u, m F u u U
value:

18
Definition of Fuzzy Sets

When U is continuous, a fuzzy set F can be written


concisely as:
F m F u / u
u

When U is discrete, a fuzzy set F is represented


as:

F m F ui / ui
or

F m F u I / u I m F u2 / u2 ... m F u N / u N

F mF , uI ,......
19

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
Error

20
Example of Universe of
Discourse for Persons Height
Membership Value,

1 Short Medium Tall


mH

HEIGHT,
140 150 160 170 180 H(cm)

21

A A A
idempotence
A A A
A (U [0,1]) A
identity
A A
A

A (U [0,1]) (U [0,1])
A B B A
commutativity
A B B A

Fuzzy Sets: ( A B ) C A ( B C )
associativity
( A B ) C A ( B C )
Properties A ( B C ) ( A B) ( B C )
distributivity
A ( B C ) ( A B) ( B C )
A A double complementation
A B A B
De Morgan' s law
A B A B
22
Video: Fuzzy Systems - What is Fuzzy
Logic?

Definition of Fuzzy Sets


Example 1
In the universe of discourse, the fuzzy set F labeled
integer approximately equal to 5 may be defined as:

F= 0.1/2+0.4/3+0.85/4+1.0/5+0.85/6+0.4/7+0.1/8

Similarly, the fuzzy subset F labeled integer close to 4 may


be defined as:
F=0.4/2+0.8/3+1/4+0.8/5+0.4/6+0.1/7+0.0/8

As discussed, fuzzy set F can be written in the following


form:
F={(2,0.4), (3,0.8), (4,1), (5,0.8), (6,0.4), (7,0.1), (8,0)}

24
Definition of Fuzzy Sets
mF
Support set Support set
The support set of a fuzzy set F is the 1.0
crisp set of all points u in U such that

m F u 0 u
mA
Crossover point
1.0 Crossover point
The element u in U at which is
called the crossover point
0.5
when
m F u 0.5
u

Fuzzy singleton mA
A fuzzy singleton
A fuzzy set whose support is a
single point in U is referred to as a
fuzzy singleton.

u 25

Definition of Fuzzy Sets


mA
a -cut set of a fuzzy set. a-cut set
The a -cut set of a fuzzy set F, labeled
with F a by convention, is the crisp set of 1
all points u in U such that. a
m F u a
Note that an a-set discards the point
0
whose membership values are lower u
than a.

Normalization mA
This process simply involves re- NORM(A)
scaling the membership function so 1
that its maximum value is 1, that is: A

m NORM A u m A u / maxm A u u U
0
u

26
Membership Functions

Two ways to define the membership for fuzzy sets:


numerical and functional.

Example of a numerical definition.

F= 0.1/2+0.4/3+0.85/4+1.0/5+0.85/6+0.4/7+0.1/8

Example of a functional definition:

1
f ( x)
1 ( x 5) 2

27

Membership Functions

We may use standard functions to represent fuzzy


sets.

The membership functions which are often used in


practice include:
s-function.
p-function.
triangular form.
trapezoid form.
exponential form.
gaussian.

28
Membership Functions

S-membership function
mA
0 for u a 1.0
2u a / b a 2 for a u b

S u; a, b, c
1 2u c / c b
2
for b u c 0.5

1 for u c
a b c u

mA
P - membership function 1.0

S u; c-b, c-b/ 2 , c for u c


p u; b, c 0.5
b
1-S u; c, c b/ 2 , c b for u c
c-b c-b/2 c c+b/2 c+b u

29

Membership Functions

Trapezoidal membership function m


0 for u a
u a / a for a u 1

P (u;a , , , ) 1 for u
u / for u
0 U
0 for u a

Triangular membership function


mA
0 for u a 1.0
u a / b a for a u b

T u; a, b, c
c u / c b for b u c
0 for u c
a b c u
30
Membership Functions

Exercise 1 m
1
(1). Write down the mathematical
expression for the L-membership
0 U
a
function shown?
L-membership function

1
(2). Write down the mathematical
expression of this membership
function.
-1 0 2 4 5

31

Example 2
Let the universe of discourse be the interval [0,100] with Y
interpreted as age. A fuzzy set F of Y labeled middle age
may be defined as :

F y, m F y y y
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.

32
The fuzzy set F might be defined using a T-function as :

0 for 0 y 30
y 30 / 15 for 30 y 45

mF y
60 y / 15 for 45 y 60
0 for 60 y 120

1.0

30 45 60

33

Exercise 2
Suppose a membership function to show young is
described by the following equation:

1.0 for 0 x 25
1
m( x ) for x 25
1 x 525 2

Based 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.

34
Youngness

35

Fuzzy Sets Operations


Operations on Classical Sets
Basic fuzzy set operations
Fuzzy set operations for
modifying membership functions
Some advanced fuzzy set operations

36
Operations on Classical Sets
We can use Venn Diagrams to show
operations on classical sets.
Consider 2 sets: A and B on the
universe X.
X

A B

37

A B x | x Aor x B
Union:
X
B
A

A B x | x A and x B
Intersection:
X
B
A

38
Excluded Middle Laws
Law of the Excluded Middle

A A X
where X is the universe

Law of Contradiction
A A f
where f is an empty set or null set

Draw Venn Diagrams proofing these laws?


39

De Morgans Laws

X
A B A B A
B

X
B
A B A B
A

Draw Venn Diagrams showing these laws?


40
Mapping Sets to Functions

Set-Theoretic Forms Function-Theoretic Forms.


f: X Y can be defined by:

1, x A
c A ( x)
0, x A
where cA expresses membership in set A for the
element x in the universe.

41

Operations for Function-theoretic Terms

Consider 2 sets: A and B, on the universe X.


Union: A B c A B ( x) c A c B maxc A , c B

Intersection:
A B c A B ( x) c A c B min c A , c B

Complement: A c A ( x) 1 c A ( x)

Containment: A B c A ( x) c B ( x)
42

Das könnte Ihnen auch gefallen