Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 66

Fuzzification

Basic Structure of Fuzzy Systems

X
Fuzzifier
 ( X) Inference
Inference  (Y) Defuzzifier Y
Fuzzifier Engine Defuzzifier
Engine

Fuzzy
Fuzzy
Knowledge
Knowledge
Base
Base
Fuzzification

Fuzzification
 is the process of changing a real scalar value into a fuzzy value.
 achieved with the different types of fuzzifiers (membership
functions).

Fuzzy Linguistic Variables are used to represent qualities spanning


a particular spectrum
Fuzzification

Temp: {Freezing, Cool, Warm, Hot}


Degree of Truth or "Membership"

Freezing Cool Warm Hot


1

0
10 30 50 70 90 110
Temp. (F°)

Membership Functions
Fuzzification

How cool is 36 F° ?
It is 30% Cool and 70% Freezing

Freezing Cool Warm Hot


1

0.7

0.3

0
10 30 50 70 90 110
Temp. (F°)
Fuzzification

Membership Functions

• piecewise linear functions


• the Gaussian distribution function
• the sigmoid curve
• quadratic and cubic polynomial curves
Fuzzification

Membership Functions
The simplest membership functions are formed using straight lines.
The simplest is the triangular membership function, and it has the
function name trimf.
The trapezoidal membership function, trapmf, has a flat top and
really is just a truncated triangle curve. These straight line membership
functions have the advantage of simplicity.
Fuzzification

Membership Functions
Two membership functions are built on the Gaussian distribution
curve: a simple Gaussian curve and a two-sided composite of two
different Gaussian curves. The two functions are gaussmf and
gauss2mf. The generalized bell membership has the function name
gbellmf.

Because of their smoothness and concise notation, Gaussian and bell


membership functions are popular methods for specifying fuzzy sets.
Both of these curves have the advantage of being smooth and nonzero
at all points.
Fuzzification

Membership Functions
Although the Gaussian membership functions and bell membership
functions achieve smoothness, they are unable to specify asymmetric
membership functions, which are important in certain applications.

the sigmoidal membership function is defined, which is either open


left or right. Asymmetric and closed (i.e. not open to the left or right)
membership functions can be synthesized using two sigmoidal
functions, so in addition to the basic sigmf, you also have the
difference between two sigmoidal functions, dsigmf, and the product
of two sigmoidal functions psigmf.
Fuzzification

Membership Functions
Polynomial based curves account for several of the membership
functions in the toolbox.
Three related membership functions are the Z, S, and Pi curves, all
named because of their shape. The function zmf is the asymmetrical
polynomial curve open to the left, smf is the mirror-image function
that opens to the right, and pimf is zero on both extremes with a rise
in the middle.
Fuzzy Logic Rule Base

Basil Hamed 10
Remarks

Basil Hamed 11
Fuzzy Logic Rule Base

Basil Hamed 12
Fuzzy Logic Rule Base

Basil Hamed 13
Fuzzy Logic Rule Base

Basil Hamed 14
EXAMPLE

Basil Hamed 15
EXAMPLE

Basil Hamed 16
Fuzzy Logic Rule Base

Basil Hamed 17
Fuzzy Logic Rule Base

Basil Hamed 18
Fuzzy Logic Process
“Crisp” Input Fuzzification
“Fuzzy” Input

Fuzzy Logic
-or-
F.A.M.

“Fuzzy” Output
De-Fuzzification “Crisp” Output
Basil Hamed 19
Fuzzy Inference Systems
Fuzzy inference (reasoning) is the actual
process of mapping from a given input to an
output using fuzzy logic.

The process involves all the pieces that we


have discussed in the previous sections:
membership functions, fuzzy logic operators,
and if-then rules
Fuzzy Inference Systems
Fuzzy inference systems have been successfully applied in fields
such as automatic control, data classification, decision analysis,
expert systems, and computer vision.

Because of its multi-disciplinary nature, the fuzzy inference


system is known by a number of names, such as
fuzzy-rule-based system,
fuzzy expert system,
fuzzy model,
fuzzy associative memory,
fuzzy logic controller,
and simply fuzzy system.
Fuzzy Inference Systems
The Architecture of
Fuzzy Inference Systems

Inference
Input Fuzzifier Defuzzifier Output
Engine

Fuzzy
Knowledge base
Fuzzy Inference Systems
Input Fuzzifier
Inference
Defuzzifier Output
Engine

Fuzzy
Knowledge base

The steps of fuzzy reasoning (inference operations upon fuzzy IF–THEN rules)
performed by FISs are:
1. Compare the input variables with the membership functions on the antecedent
part to obtain the membership values of each linguistic label. (this step is often
called fuzzification.)

2. Combine (usually multiplication or min) the membership values on the premise


part to get firing strength (deree of fullfillment) of each rule.

3. Generate the qualified consequents (either fuzzy or crisp) or each rule depending
on the firing strength.

4. Aggregate the qualified consequents to produce a crisp output. (This step is called
defuzzification.)
Fuzzy Knowledge Base
Inference
Input Fuzzifier Defuzzifier Output
Engine

Fuzzy
Knowledge base

The rule base and the database are jointly referred to as the knowledge
base.
•a rule base containing a number of fuzzy IF–THEN rules;
•a database which defines the membership functions of the fuzzy sets
used in the fuzzy rules
Fuzzifier
Inference
Input Fuzzifier Defuzzifier Output
Engine

Fuzzy
Knowledge base

Converts the crisp input to a linguistic variable using


the membership functions stored in the fuzzy
knowledge base.
Inference

Inference Engine
Input Fuzzifier Defuzzifier Output
Engine

Fuzzy
Knowledge base

Using If-Then type fuzzy rules converts the fuzzy


input to the fuzzy output.
Defuzzifier
Inference
Input Fuzzifier Defuzzifier Output
Engine

Fuzzy
Knowledge base

Converts the fuzzy output of the inference engine


to crisp using membership functions analogous to
the ones used by the fuzzifier.
Defuzzifier
Inference
Input Fuzzifier Defuzzifier Output
Engine

Fuzzy
Knowledge base

• Converts the fuzzy output of the inference


engine to crisp using membership functions
analogous to the ones used by the fuzzifier.
• Five commonly used defuzzifying methods:
– Centroid of area (COA)
– Bisector of area (BOA)
– Mean of maximum (MOM)
– Smallest of maximum (SOM)
– Largest of maximum (LOM)
Min Inference
• Cut at 0.8
Min Inference
Min Inference
• Corresponding fuzzy set
o MF = {(0,0),(1,0.2),(2,0.4),(3,0.6),(4,0.8),(5,0.8),
(6,0.8),(7,0.6),(8,0.4),(9,0.2),(10,0), (25,0)}
Min Inference
• Degree of support of 0.4
Min Inference
Min Inference
• Corresponding set
o MF = {(0,0),(1,0.2),(2,0.4),(3,0.4),(4,0.4),(5,0.4),
(6,0.4),(7,0.4),(8,0.4),(9,0.2),(10,0), (25,0)}
Fuzzy Inference
• How are things different if we use product
inferencing?
Product Inference
Product Inference
• Corresponding set
o MF = {(0,0),(1,0.16),(2,0.32),(3,0.48),(4,0.64),
(5,0.8),(6,0.64),(7,0.48),(8,0.16),(9,0.16),(10,0),
(25,0)}
Product Inference
• Degree of support of 0.4
Product Inference
• Corresponding set
o MF = {(0,0),(1,0.08),(2,0.16),(3,0.24),(4,0.32),
(5,0.4),(6,0.32),(7,0.24),(8,0.16),(9,0.08),(10,0),
(25,0)}
Defuzzification
 Convert the fuzzy value obtained from composition
into a “crisp” value. This process is often complex since
the fuzzy set might not translate directly into a crisp
value. Defuzzification is necessary, since controllers of
physical systems require discrete signals.
 Defuzzification is the conversion of a fuzzy quantity to a
precise quantity, just as fuzzification is the conversion of a
precise quantity to a fuzzy quantity.
 The output of a fuzzy process can be the logical union of
two or more fuzzy membership functions defined on the
universe of discourse of the output variable.

Basil Hamed 40
DEFUZZIFICATION
Defuzzification strategy is aimed at producing a non-fuzzy control
action, or can say defuzzification means the conversion of the
fuzzy output values into crisp values. For example, if we say "the
output force must be large" and large variable takes the values
between (70, 90) N, then what is the force will be needed 75 or 80
or …N, we can know what is the force we want by using
defuzzification method. There are different types of
defuzzification methods.

Basil Hamed 41
Inference
Input Fuzzifier Defuzzifier Output
Engine

Defuzzification
Fuzzy
Knowledge base

• Converts the fuzzy output of the inference


engine to crisp using membership functions
analogous to the ones used by the fuzzifier.
• Some commonly used defuzzifying methods:
– Centroid of area (COA)
– Weighted average method
– Mean of maximum (MOM)
– Smallest of maximum (SOM)

Basil Hamed 42
Inference

Defuzzification
Input Fuzzifier Defuzzifier Output
Engine

Fuzzy
Knowledge base

Basil Hamed 43
Inference

Defuzzification
Input Fuzzifier Defuzzifier Output
Engine

Fuzzy
Knowledge base

 A ( z ) zdz
zCOA  Z
,

Z
A ( z )dz

 zdz
z BOA  zMOM  Z
,
  A ( z )dz    A ( z )dz ,
Z
 dz
zBOA

where Z   {z;  A ( z )   *}
Basil Hamed 44
Centroid
 It finds the point where a vertical line would slice
the aggregate set into two equal masses.
Mathematically this centre of gravity (COG) can be
expressed as:

  x  x dx
A

COG  a
b

  x  dx
a
A
 Centroid defuzzification method finds a point
representing the centre of gravity of the fuzzy set, A,
on the interval, ab.
 A reasonable estimate can be obtained by
calculating it over a sample of points.
(x)
1.0
0.8

0.6 A

0.4

0.2
a b
0.0 X
150 160 170 180 190 200 210
Centre of gravity (COG):
(0  10  20)  0.1  (30  40  50  60)  0.2  (70  80  90  100)  0.5
COG   67.4
0.1  0.1  0.1  0.2  0.2  0.2  0.2  0.5  0.5  0.5  0.5

Degree of
Membership
1.0

0.8

0.6

0.4

0.2

0.0
0 10 20 30 40 50 60 70 80 90 100
67.4 Z
Centroid

Basil Hamed 48
Defuzzification Methods

Max-membership principle

1
c(Z*)  c(z)  z  Z

z* z

Centroid principle

1
  c ( z )  zdz
z 
*

  c ( z )dz

z* z

Basil Hamed 49
Defuzzification Methods

Weighted average method


(Only valid for symmetrical output membership functions)

 c ( z )  z .9
z 
* ~

 c ( z ) .5
~

0 a b z

Formed by weighting each functions in the


output by its respective maximum membership
value
Produces results very close to centroid method
Less computational intensive
Basil Hamed 50
Defuzzification Methods


Mean-max membership
(middle-of-maxima method)
1

z *  a  b  2
0 a z* b z

Basil Hamed 51
Defuzzification Methods
Example 4.3:
A railroad company intends to lay a new rail line in a particular part of a
county. The whole area through which the new line is passing must be
purchased for right-of-way considerations. It is surveyed in three stretches,
and the data are collected for analysis. The surveyed data for the road are
given by the sets B~ 1,B~ 2 and B~ 3 , where the sets are defined on the universe of
right-of-way widths, in meters. For the railroad to purchase the land, it must
have an assessment of the amount of land to be bought. The three surveys
on the right-of-way width are ambiguous , however, because some of the
land along the proposed railway route is already public domain and will not
need to be purchased. Additionally, the original surveys are so old (circa
1860) that some ambiguity exists on the boundaries and public right-of-way
for old utility lines and old roads. The three fuzzy sets B~ 1,B~ 2 and B~ 3 , 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
Basil Hamed 52
Defuzzification Methods

Basil Hamed 53
Defuzzification Methods
Centroid method:

z *

  ( z )  zdz
B
~

  ( z )dz
B
~

 1 4  z 3 
   
3.6 5.5 6 7 8
 0 (. 3 z ) zdz  1 (. 3 z ) dz  3.6  2  4
  zdz  (. 5) zdz  5.5 z  5 zdz  6 zdz  7 8  z zdz 
 
 1 4  z 3 
   .3 z dz   (.3)dz   
3.6 5.5 6 7 8
 dz   (.5)dz   ( z  5)dz   dz   (8  z )dz 
0 1 3.6
 2  4 5.5 6 7

 4.9meters

Basil Hamed 54
Defuzzification Methods

Weighted-Average Method:

z *

.3  2.5  .5  5  1 6.5
 5.41meters
.3  .5  1

Mean-Max Method: (6  7) / 2  6.5meters

Basil Hamed 55
Defuzzification Methods

Example 4.4. Many products, such as tar, petroleum jelly,


and petroleum, are extracted from crude oil. In a newly
drilled oil well, three sets of oil samples are taken and tested
for their viscosity. The results are given in the form of the
three fuzzy sets B1, B2, and B3, all defined on a universe of
normalized viscosity, as shown in Figures below. we want to
find the most nearly representative viscosity value for all
three oil samples, and hence find z∗ for the three fuzzy
viscosity sets.

Basil Hamed 56
Defuzzification Methods

Basil Hamed 57
Defuzzification Methods

Basil Hamed 58
Defuzzification Methods

According to the centroid method,

z *

  ( z ) zdz
B
~

  ( z)dz
B
~

 1.5 (.67 z ) zdz  1.82  .67 z zdz  2 z  1zdz  2.33 3  z zdz 


 0 1.5 1.8 2 
 3 
 2.33 .5 z  .5zdz  3 2.5  .5 z zdz
5

 1.5 .67 z dz  1.82  .67 z dz  2 ( z  1)dz  2.33 3  z dz 
  0 1.5 1.8 2 
 3 
 2.33 .5 z  .5dz  3 2.5  .5 z dz
5

 2.5
Basil Hamed 59
Defuzzification Methods

The centroid value obtained, z*, is shown in the figure


below:

Basil Hamed 60
Defuzzification Methods

According to the weighted average method:

z *

1 1.5  1 2   1 3
 2.25
111

Basil Hamed 61
Defuzzification Methods

Three other popular methods are available because of


their appearance in some applications:(Hellendoorn
and Thomas, 1993)
The Center of Sums,
Center of Largest Area,
First of Maxima Methods

Basil Hamed 62
Defuzzification Methods
Center of sums Method
Faster than any defuzzification method
Involves algebraic sum of individual output fuzzy sets,
instead of their union
Drawback: intersecting areas are added twice.

 z C z dz
n

z k 1
z *
 ~k

 C z dz
n

z k 1 ~k

It is similar to the weighted average method, but the


weights are the areas, instead of individual membership
values.
Basil Hamed 63
Defuzzification Methods

Center of largest area: If the output fuzzy set has at least two
convex sub regions, then the center of gravity (i.e., z∗ is
calculated using the centroid method) of the convex fuzzy sub
region with the largest area is used to obtain the defuzzified
value z∗ of the output

Basil Hamed 64
First (or last) of maxima: This method uses the overall output
or union of all individual output fuzzy sets Ck to determine
the smallest value of the domain with maximized
membership degree in Ck.

See Examples 4.5, and 4.6( Page 108)

Basil Hamed 65
Picking a Method

Which of these methods is the right one?


There's no simple answer. But if you want to get
started quickly, generally the centroid method is
good enough. Later you can always change your
defuzzification method to see if another method
works better.

Basil Hamed 66

You might also like