Sei sulla pagina 1di 65

DREAM

DREAM
IDEA
IDEA
PLAN
PLAN
IMPLEMENTATION
IMPLEMENTATION
1
Fuzzy
Fuzzy Sets
Sets and
and Fuzzy
Fuzzy Logic
Logic
Present to:
Amirkabir University of Technology (Tehran Polytechnic) &
Semnan University

Dr. Kourosh Kiani


Email: kkiani2004@yahoo.com
Email: Kourosh.kiani@aut.ac.ir
Web: www.kouroshkiani.com 2
Lecture 01

Introduction to Fuzzy Sets and Fuzzy Logic

3
Course Information

Text/Reference Books
- Timothy J. Ross Fuzzy Logic with Engineering Application

4
Course Information

Objective
To provide a basic understanding of the artificial Neural network, Fuzzy Logic ,
Genetic algorithm, Particle Swarm Optimization, Simulated annealing, Ant Colony
optimization

Pre-requisites
Calculus

5
Simple Rules
Simple rules
Rule #1 : Do not miss your lessons
Attend all your classes. Why? See Rule #2.

Rule #2 : Be punctual
Classes will usually start on time. You will miss a great deal if you were to
arrive late because missing the very first few minutes of class may result in
you not being able to follow the rest of the lesson.

Rule #3 : Be attentive
Please do not read non-course materials, like newspapers, while anyone is
addressing the class. Do not carry on conversations while anyone is
addressing the class. I do not care if you eat or drink, just do not make a lot
of noise.

6
Simple Rules
Simple rules (cont.)
Rule #4 : Ask if you do not know
Ask if you have a question in mind. Often, if you have a simple question
everyone else does as well. So please ask questions in class, or send me an
email. If I think that the questions are taking too much time, I will suggest that
we discuss it during consultation hours.
Furthermore, if you should find any mistakes in the lecture material,
do not hesitate to inform me.

-Rule #5 : Do not ask for tips


The lecturers are not at the liberty of giving tips for the final exam.
Have faith in your own ability. Hard work pays.

Rule #6 : Enjoy the lessons


Try to like the subject. I know the mathematics and formulas can be
intimidating at times; but if you can enjoy the lessons, half the battle is
won.
7
Why
Why Fuzzy
Fuzzy
Based on intuition and judgment

No need for a mathematical model

Provides a smooth transition between members and


nonmembers

Relatively simple, fast and adaptive

Less sensitive to system fluctuations

Can implement design objectives, difficult to express


mathematically, in linguistic or descriptive rules.
8
Why
Why Fuzzy
Fuzzy
Complex, ill-defined processes difficult for description and
analysis by exact mathematical techniques
Approximate and inexact nature of the real word;
vague concepts easily dealt with by humans in daily life
Tolerance of imprecision in return for tractability, robustness,
and short computation time

Thus, we need other technique, as supplementary to


conventional quantitative methods, for manipulation of
vague and uncertain information, and to create systems that
are much closer in spirit to human thinking. Fuzzy logic is a
strong candidate for this purpose.

9
Fuzzy
Fuzzy system
system applications
applications
Pattern recognition and classification
Fuzzy clustering
Image and speech processing
Fuzzy systems for prediction
Fuzzy control
Monitoring
Diagnosis
Optimisation and decision making
Group decision making
10
Some
Some Interesting
Interesting Applications
Applications
Ride smoothness control

Camcorder auto-focus and jiggle control

Braking systems

Copier quality control

Rice cooker temperature control

High performance drives

Air-conditioning systems 11
Boolean/Crisp set A is a mapping for the elements of S to the
set {0, 1}, i.e., A: S {0, 1}
Characteristic function:

{
1 if x is an element of set A
A(x) = 0 if x is not an element of set A

Fuzzy set F is a mapping for the elements of S to the interval


[0, 1], i.e., F: S [0, 1]
Characteristic function: 0 F(x) 1
1 means full membership, 0 means no membership and anything in
between, e.g., 0.5 is called graded membership
12
Definition of a fuzzy set
Classical set A in X is
a set of ordered pairs
A x, I A x x X ,
defined by indicator
function I A x 0,1

Fuzzy set A in X is as
a set of ordered pairs
A x, A x x X ,
defined by membership
function 0 A x 1

13
One can define the crisp set circles as:

The fuzzy set circles can be defined as:

14
Fuzzy
Fuzzy Linguistic
Linguistic variables
variables
Examples of fuzzy measures include:
close, heavy, light, big, small, smart, fast, slow, hot, cold,
Tall, Short, ....,
Fuzzy sets and concepts are commonly used in natural language

John is tall
Dan is smart
Alex is happy
The class is hot

15
Crisp
Crisp membership
membership function
function
Crisp membership functions ( ) are either one or zero.
e.g. Numbers greater than 10.

A ={x | x>10}

A ( x )

10 16
Fuzzy
Fuzzy membership
membership function
function
The set, B, of numbers near to 2 can be represented by a
membership function:

17
Fuzzy
Fuzzy membership
membership function
function

18
Crips & Fuzzy Membership functions

19
Fuzzy Membership functions: S-function
The S-function can be used to define fuzzy sets
S(x, a, b, c) =
0 for x a
2(x-a/c-a)2 for a x b
1 2(x-c/c-a)2 for b x c
1 for x c

a b c

20
Fuzzy Membership functions: Function
(x, a, b) =
S(x, b-a, b-a/2, b) for x b
1 S(x, b, b+a/2, a+b) for x b

E.g., close (to a)


a

b-a b-a/2 a b+a/2 b+a 21


Linguistic Hedges
Modifying the meaning of a fuzzy set using
hedges such as very, more or less, slightly, etc.
tall
Very F = F2
More or less F = F1/2
etc.
More or less tall
Very tall

22
Fuzzy
Fuzzy membership
membership function
function

23
Fuzzy
Fuzzy membership
membership function
function

24
Fuzzy
Fuzzy membership
membership function
function

25
Fuzzy
Fuzzy membership
membership function
function

26
Fuzzy
Fuzzy membership
membership function
function

27
Fuzzy
Fuzzy membership
membership function
function

28
Fuzzy
Fuzzy membership
membership function
function

The list of MFs introduced here is by no means


exhaustive

Other specialized MFs can be created for specific


applications if necessary

Any type of continuous probability distribution


functions can be used as an MF

29
Fuzzy
Fuzzy membership
membership function
function ??

Subjective evaluation: The shape of the functions


is defined by specialists
Ad-hoc: choose a simple function that is suitable
to solve the problem
Distributions, probabilities: information extracted
from measurements
Adaptation: testing
Automatic: algorithms used to define functions
from data
30
Properties
Properties of
of Fuzzy
Fuzzy set
set

A ( x )
1

Height
Core
0
Boundary Boundary

Support

31
Properties
Properties of
of Fuzzy
Fuzzy set
set

A ( x )
1

Height
Core
0
Boundary Boundary

Support

Core: Comprises those elements x of the Universe


Such that: A ( x) 1
core ( A) {x X | A ( x) 1} 32
Properties
Properties of
of Fuzzy
Fuzzy set
set

A ( x )
1

Height
Core
0
Boundary Boundary

Support

Support: Comprises those elements x of the Universe


Such that: A ( x) 0
Support ( A) {x X | A ( x) 0} 33
Properties
Properties of
of Fuzzy
Fuzzy set
set

A ( x )
1

Height
Core
0
Boundary Boundary

Support

Boundary: Comprises those elements x of the


Universe Such that: 0 A ( x) 1
Boundary ( A) {x X | 0 A ( x) 1} 34
Properties
Properties of
of Fuzzy
Fuzzy set
set

Normal Subnormal
Properties
Properties of
of Fuzzy
Fuzzy set
set

36
Properties
Properties of
of Fuzzy
Fuzzy set
set

37
Fuzzy Variable

A fuzzy variable is defined by the quadruple


V = { x, l, u, m}
X is the variable symbolic name: temperature
L is the set of labels: low, medium and high
U is the universe of discourse
M are the semantic rules that define the meaning of
each label in L (membership functions).

38
Fuzzy Variable Example

X = Temperature
L = {low, medium, high}
U = {xX | -70o <= x <= +70o}
M= low medium high
1.0

0.0

-70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70

39
Fuzzy Variable
Completude: A variable is complete if for any x
X there is a fuzzy set such as (x)>0

Complete

1.0

Incomplete
0.0
-70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70

40
Fuzzy
Fuzzy membership
membership function
function

41
Fuzzy
Fuzzy membership
membership function
function

42
Example: Short, Medium height and Tall

Medium
1.0
Short Tall

5 56 6 66 7

Note:Short(x)+Medium(x)+Tall(x)1.
Someone who is 61 is simultaneously short, of medium height
and tall in various degrees which dont add to 1. 43
Partition of Unity

A fuzzy variable forms a partition of unity if for


each input value x
p


i=1
Ai (x) 1

where p is the number of sets to which x belongs


There is no rule to define the overlapping degree
between two neighbouring sets
A rule of thumb is to use 25% to 50%

44
Partition of Unity

1,0

Partition of
0,5
Unity
0,0

-70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70

1,0
No Partition
0,5
of
Unity
0,0

-70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70

45
Partition of Unity cont

Any complete fuzzy variable may be


transformed into a partition of unity using
the equation

A (x)
A (x) = p
i
for i = 1, , p

i
Aj (x)
j=1

46
Example: Light, Medium weight and
Heavy
Medium
1.0
Light Heavy

60 70 80 90 100
Weight (Kg)

47
A. B ( x) min( A ( x) , B ( x))
Example: Medium and Tall

Medium
1.0
Short Tall


Medium and Tall

5 56 6 66 7

Note:Nooneisafullmemberofthisset.
48
Fuzzy
Fuzzy Logic
Logic Operations
Operations

Fuzzy union operation or fuzzy OR :

A B ( x) max( A ( x) , B ( x))
Fuzzy intersection operation or fuzzy AND

A. B ( x) min( A ( x) , B ( x))
Complement operation

A ( x) 1 A ( x)
49
A. B ( x) min( A ( x) , B ( x))

50
A. B ( x) min( A ( x) , B ( x))

51
A B ( x) max( A ( x) , B ( x))

52
A B ( x) max( A ( x) , B ( x))

53
A B ( x) max( A ( x) , B ( x))

Medium
1.0
Short Medium or Tall

Tall

5 56 6 66 7

54
A ( x) 1 A ( x)

A (x)

A (x)

A (x) A (x)

55
A ( x) 1 A ( x)

Negation: A ( x) 1 A ( x )

1.0
Not Tall Tall

5 56 6 66 7

56
Fuzzy
Fuzzy Logic
Logic Operations
Operations

57
Discrete
Discrete fuzzy
fuzzy subset
subset
A simple example of a discrete universe and a discrete fuzzy subset
of it, is:

X={-3, -2, -1, 0, 1, 2, 3, 4}

A= 0.6/-3 + 0.0/-2 + 0.3/-1 + 0.6/0 + 1.0/1 + 0.6/2 + 0.3/3 + 0.5/4

58
A. B ( x) min( A ( x) , B ( x))
Let A and B be fuzzy subsets of the universe X={-3, -2, -1, 0, 1, 2, 3, 4}
A= 0.6/-3 + 0.0/-2 + 0.3/-1 + 0.6/0.0 + 1.0/1 + 0.6/2 + 0.3/3 + 0.5/4
B= 0.2/-3 + 0.6/-2 + 0.4/-1 + 0.6/0.0 + 0.5/1 + 0.4/2 + 0.5/3 + 0.3/4
AB = 0.2/-3 + 0.0/-2 + 0.3/-1 + 0.6/0.0 + 0.5/1 + 0.4/2 + 0.3/3 + 0.3/4

59
Possible
Possible operators
operators for
for AND
AND in
in fuzzy
fuzzy logic
logic

A ( x) B ( x)
A ( x) B ( x)
A ( x) B ( x) A ( x) B ( x)
max{0, A ( x ) B ( x ) 1}
A ( x) B ( x)
2 [ A ( x ) B ( x ) A ( x ) B ( x )]
60
A B ( x) max( A ( x) , B ( x))

Let A and B be fuzzy subsets of the universe X={-3, -2, -1, 0, 1, 2, 3, 4}


A= 0.6/-3 + 0.0/-2 + 0.3/-1 + 0.6/0.0 + 1.0/1 + 0.6/2 + 0.3/3 + 0.5/4
B= 0.2/-3 + 0.6/-2 + 0.4/-1 + 0.6/0.0 + 0.5/1 + 0.4/2 + 0.5/3 + 0.3/4
AB = 0.6/-3 + 0.6/-2 + 0.4/-1 + 0.6/0.0 + 1.0/1 + 0.6/2 + 0.5/3 + 0.5/4

61
Possible
Possible operators
operators for
for OR
OR in
in fuzzy
fuzzy logic
logic

A ( x) B ( x) A ( x) B ( x)
A ( x ) B ( x ) 2 A ( x ) B ( x )
1 A ( x) B ( x)

A ( x) B ( x)
1 A ( x ) B ( x )]

min{1, A ( x ) B ( x )}
62
A ( x) 1 A ( x)
Let A be fuzzy subset of the universe
X={-3, -2, -1, 0, 1, 2, 3, 4}

A = 0.6/-3 + 0.0/-2 + 0.3/-1 + 0.6/0.0 + 1.0/1 + 0.6/2 + 0.3/3 + 0.5/4

A = 0.4/-3 + 1.0/-2 + 0.7/-1 + 0.4/0.0 + 0.0/1 + 0.4/2 + 0.7/3 + 0.5/4

63
Questions? Discussion?
Suggestions ?
65

Potrebbero piacerti anche