Vous êtes sur la page 1sur 51

What is Fuzzy Logic?

As complexity rises, precise statements lose


meaning and meaningful statements lose
precision
- Lotfi Zadeh
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.
Degree of Membership
Fuzzy
Mark
John
Tom
Bob
Bill
1
1
1
0
0
1.00
1.00
0.98
0.82
0.78
Peter
Steven
Mike
David
Chris
Crisp
1
0
0
0
0
0.24
0.15
0.06
0.01
0.00
Name Height, cm
205
198
181
167
155
152
158
172
179
208
150 210 170 180 190 200 160
Height, cm
Degree of
Membership
Tall Men
150 210 180 190 200
1.0
0.0
0.2
0.4
0.6
0.8
160
Degree of
Membership
170
1.0
0.0
0.2
0.4
0.6
0.8
Height, cm
Fuzzy Sets
Crisp Sets
If X is a collection of objects denoted
generically by x then Fuzzy set A in X is
defined as A={(x, A(x))/ x E X}
Where X is universe of Discourse
Support (A)={(x /A(x)>0)
Core (A) ={(x /A(x)=1)
Cross over points ={(x /A(x)=0.5)
Fuzzy Singleton single point in support A(x)=1
Alpha cut (A) ={(x /A(x) Alpha)
Strong Alpha cut (A) ={(x /A(x)> Alpha)


Alpha Cuts
( )
{ }
A
A x X x
o
o = e >
( )
{ }
A
A x X x
o
o
+
= e >
Strong Alpha Cut
Alpha Cut
0 o =
0.2 o = 0.5 o = 0.8 o = 1 o =
9
Open left and open right
Symmetry
Linguistic Variables
Triangular membership function
a, b and c represent the x coordinates of the three
vertices of
A
(x) in a fuzzy set A (a: lower boundary
and c: upper boundary where membership degree is
zero, b: the centre where membership degree is 1)

>
s s

s s

s
=
c x if
c x b if
b c
x c
b x a if
a b
a x
a x if
x
A
0


0
) (
a
b
c
x

A
(x)
1
0
Gaussian membership function


c: centre
s: width
m: fuzzification factor (e.g., m=2)

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
Membership Function Examples
Trapezoida
l
Triangular
( )
( )
1
, ,
1
smf
a x c
f x a c
e

=
+
Sigmoid
( )
( )
2
2
2
; ,
x c
gmf
f x c e
o
o

=
Gaussian
( ) ; , , , max min , 1, , 0
x a d x
f x a b c d
b a d c
| |
| |
=
| |

\ .
\ .
( ) ; , , max min , , 0
x a c x
f x a b c
b a c b
| |
| |
=
| |

\ .
\ .
15
Linguistic Hedges
Operate on the Membership Function (Linguistic
Variable)
1. Expansive (Less, Very Little)
2. Restrictive (Very, Extremely)
3. Reinforcing/Weakening (Really, Relatively)
( )
Less x =
( )
4
Very Little x =
( ) ( )
2
Very x =
( ) ( )
4
Extremely x =
( ) ( )
A A
x x c
16
The intersection of two fuzzy sets A and B is specified in general by a binary
mapping T, which aggregates two membership functions as follows.

AB
(x) = T(
A
(x),
B
(x))
For example, the binary operator T may represent the multiplication of . These
fuzzy intersection operators, which are usually referred to as T-norm (Triangular
norm) operators, meet the following basic requirements.
A T-norm operator is a binary mapping T( ) satisfying
boundary: T(0, 0) = 0, T(a, 1) = T(1, a) = a
monotonicity: T(a, b) <= T(c, d) if a <= c and b <= d
commutativity: T(a, b) = T(b, a)
associativity: T(a, T(b, c)) =T(T(a, b), c)

Like fuzzy intersection, the fuzzy union operator is specified in general by a binary
mapping S.
AB
(x) = S(
A
(x),
B
(x))
For example, the binary operator S can represent the addition of . These fuzzy
union operators, which are often referred to as T-conorm (or S-norm) operators,
must satisfy the following basic requirements.
A T-conorm (or S-norm) operator is a binary mapping S( ) satisfying
boundary: S(1, 1) = 1, S(a, 0) = S(0, a) =a
monotonicity: S(a, b) <= S(c, d) if a <= c and b <=d
commutativity: S(a, b) =S(b, a)
associativity: S(a, S(b, c)) = S(S(a, b), c)

t
w

s
w

Drastic product
Drastic sum
t
w
(A,B) = min (A,B) if max (A,B) = 1, else = 0
s
w
(A,B) = max (A,B) if min (A,B) = 0, else = 1
t
1

s
1

Bounded
difference
Bounded sum
t
1
(A,B) = max (0, A + B - 1)
s
1
(A,B) = min (1, A + B)
t
1.5

s
1.5

Einstein product
Einstein sum
t
1.5
(A,B) = (AB/(2 - [ A + B - AB])
s
1.5
(A,B) = (A + B)/ (1 + AB)
t
2

s
2

Algebraic product
Probabilistic sum
t
2
(A,B) = AB
s
2
(A,B) = A + B - AB
t
2.5

s
2.5

Hamacher product
Hamacher sum
t
2.5
(A,B) = (AB)/(A + B - AB)
s
2.5
(A,B) = (A + B - 2AB)/(1 - AB)
t
3

s
3

Minimum
Maximum
t
3
(A,B) = min (A,B)
s
3
(A,B) = max (A,B)
A few well known couples of T-norms and S-norms
t
w
<= t
1
<= t
1.5
<= t
2
<= t
2.5
<= t
3

s
3
<= s
2.5
<= s
2
<= s
1.5
<= s
1
<= s
w

They have the following relationship
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- especially linguistic labels

Clustering and Classification
Bivalent and Multivalent Logics
Bivalent (Aristotelian) logic uses two logical values
true and false.
Multivalent logics use many logical values often in a
range of real numbers from 0 to 1.
Important to note the difference between multivalent
logic and probability P(A) = 0.5 means that A may be
true or may be false a logical value of 0.5 means
both true and false at the same time.

Linguistic Variables
Variables used in fuzzy systems to express
qualities such as height, which can take
values such as tall, short or very tall.
These values define subsets of the universe
of discourse.

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.

Fuzzy logic provides a simple way to arrive at a definite
conclusion based upon vague, ambiguous, imprecise,
noisy, or missing input information.

Fuzzy logic is a convenient way to map an input space to
an output space


Why Fuzzy Logic?
Fuzzy logic is conceptually easy to understand.

The mathematical concepts behind fuzzy reasoning are very simple

Fuzzy logic is flexible.

Fuzzy logic can model nonlinear functions of arbitrary complexity.

Fuzzy logic can be built on top of the experience of experts.

In direct contrast to neural networks, which take training data and
generate opaque, impenetrable models, fuzzy logic lets you rely on
the experience of people who already understand your system.

Fuzzy logic can be blended with conventional control techniques.
Fuzzy logic is based on natural language.
Fuzzy is not a solution for all kind of problems
Block diagram of Fuzzy logic controller
Plant
Fuzzification
Inference mechanism
Defuzzification
Rule base
Reference input
r(t)
Input u(t)
output y(t)
Fuzzy controller
Fuzzy control provides a formal methodology for
representing, manipulating, and implementing a humans
heuristic knowledge about how to control a system.
Fuzzy Logic Controller
Fuzzification
Take crisp inputs and determine the degree to which
they belong to each of the appropriate fuzzy sets (via
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.
Membership Functions
Z-shaped MF
Triangular MF Trapezoidal MF
Sigmoidal MF
S-shaped MF Prod. Sigmoidal MF
Pi-shaped MF
Generalized Bell MF
Gaussian 2 MF Gaussian MF
Diff. Sigmoidal MF
Rule Base
The rule-base holds the knowledge, in the form of a set
of rules, of how best to control the system. It
characterizes the control goals and control policy of the
domain experts by means of a set of linguistic control
rules.

IF (a set of conditions are satisfied) THEN (a set of
consequences can be inferred).

if x is A then y is B,

if x is A , and y is B, then z is C,,


Inference
Fuzzy inference is the process of formulating the
mapping from a given input to an output using fuzzy
logic. The mapping then provides a basis from which
decisions can be made, or patterns discerned.

You can implement two types of fuzzy inference systems
in the toolbox

Mamdani-type
Sugeno-type.

These two types of inference systems vary somewhat in
the way outputs are determined.
Mamdani Approach
Most commonly used approach to developing fuzzy logic
models for control applications.

Uses expert knowledge to generate rule set.

Uses membership functions for both input and output
variables.
if x is A , and y is B, then z is C,

Computationally intensive compared to Sugeno approach

It is well suited to human input.
Sugeno Approach
In this output membership functions are either linear or
constant.

The rule in a first order Sugeno model may be expressed
as:
if x is A and y is B then z = p*x + q*y + r
where p, q, and r are constants.

Computationally efficient.

Well suited to optimization/adaptation
Defuzzification
Basically, Defuzzification is a mapping from a space of
fuzzy control actions defined over an output universe of
discourse into a space of nonfuzzy (crisp) control
actions.

There are five built-in methods supported:
Centroid (which returns the center of area under the curve , Most
popular method)
Bisector
Middle of Maximum (the average of the maximum value of the output set),
Largest of maximum (LOM)
Smallest of maximum (SOM)

Defuzzification Example
A railroad company surveyed in three stretches to lay a new rail line
The three fuzzy sets, shown in the figures below, represent the
uncertainty in each survey as to the membership of the right-of-way
width, in meters, in privately owned land. We now want to aggregate
these three survey results to find the single most nearly
representative right-of-way width (z) to allow the railroad to make its
initial estimate
Weighted-Average Method:
Mean-Max Method:
What is Fuzzy control Toolbox?
The Fuzzy Logic Toolbox allows you to create and edit
fuzzy information system.

Systems can be created using

Graphical tools (GUI) or
Command-line functions

Ideal for engineers, researchers and educators!



Experienced fuzzy logic designers should find it easy to
use the system to research, model, test, and visualize
highly complex systems

Fuzzy inference systems have been successfully applied
in fields such as automatic control, data classification,
decision analysis and expert systems
Fuzzy logic Toolbox Consist of 3 Blocks
Membership
Functions
MF
Fuzzy Logic
Controller
with Ruleviewer
Fuzzy Logic
Controller
Building Systems With the Fuzzy
Logic Toolbox
FIS of MATLAB
There are five GUI tools :

1. The Fuzzy Inference System or FIS Editor
Handles the high-level issues: How many input and output
variables? What are their names?

2. The Membership Function Editor
Used to define the shapes of membership functions
associated with each variable.

3. The Rule Editor
for editing the list of rules that defines the behavior of the
system.


4. The Rule Viewer

Shows which rules are active, or how individual
membership function shapes are influencing the results.

5. The Surface Viewer

Generates and plots an output surface map for the
system.
How it works
Four Steps:
Step 1. Fuzzify inputs (fuzzification): Take crisp inputs and
determine the degree to which they belong to each of the
appropriate fuzzy sets (via membership functions).

Step 2. Rule evaluation : Process of mapping one or more input (s)
to a single number that represents the result of the evaluation.
This number is then applied to the output membership function

Step 3. Aggregation of rule outputs: Aggregation is the process by
which the outputs of all rules are unified. The membership
functions that represent the outputs of each rule are combined
into a single fuzzy set

Step 4. Defuzzify : The final output of the fuzzy system must be
a crisp number
Building Systems: An Example
The Basic Tipping Problem:

Given a number between 0 and 10 that represents the
quality of service at a restaurant (where 10 is excellent),

and another number between 0 and 10 that represents
the quality of the food at that restaurant (again, 10 is
excellent),

what should the tip be?


The starting point is to write down the three golden rules
of tipping, based on years of personal experience in
restaurants.

1. If the service is poor or the food is rancid, then tip is
cheap.
2. If the service is good, then tip is average.
3. If the service is excellent or the food is delicious,
then tip is generous.

Assume that an
average tip is 15%,
a generous tip is 25%,
and a cheap tip is 5%.
User Interface Layout: Getting Started
FIS Editor
Membership Function Editor
Membership Function Editor
Membership Function Editor
Rule Editor
Rule Viewer
Surface Viewer

Vous aimerez peut-être aussi