Você está na página 1de 28

Fuzzy Concepts

Fuzziness is probability in disguise. I can design a controller with probability that could
do the same thing that you could do with fuzzy logic.
-Professor Myron Tribus, on hearing of the fuzzy-logic control of the Sendai subway
system IEEE Institute, may 1988.

The Fuzzy Logic Concept


The way that people think is inherently fuzzy. The way that we perceive the world is
continually changing and cannot always be defined in true or false statements. Take for
example the set of all the apples and all the apple cores in the world. Now take one of
those apples; it belongs to the set of all apples. Now take a bite out of that apple; it is still
an apple right? If so, it still belongs to the set of apples. After several more bites have
been taken and you are left with an apple core and it belongs to the set of apple cores. At
what point did the apple cross over from being an apple to being an apple core? What if
you could get one more bite out of that apple core, does that move it into a different set?

www.sxc.hu
The definition of the apple and apple core sets are too strictly defined when looking at
the process of eating an apple. The area between the two sets is not clearly defined since
1

the object cannot belong to the set of apples and apple cores because, by definition, an
apple core is NOT an apple. The sets defining apples and apple cores need to be redefined
as fuzzy sets.
A fuzzy set allows for its members to have degrees of membership. If the value of 1 is
assigned to objects entirely within the set and a 0 is assigned to objects outside of the set,
then any object partially in the set will have a value between 0 and 1. The number
assigned to the object is called its degree of membership in the set. So an apple with one
bite out of it may have a degree of membership of 0.9 in the set of apples. This does not
mean that it has to have a degree of membership of 0.1 in the set of apple cores though.
However as the apple is eaten it looses its membership in the fuzzy set of apples and
gains membership in the fuzzy set of apple cores.

Application areas

Automobile and other vehicle subsystems, such as automatic transmissions, ABS


and cruise control (e.g. Tokyo monorail)
Air conditioners
The Massive engine used in the Lord of the Rings films, which helped show huge
scale armies create random, yet orderly movements
Cameras
Digital image processing, such as edge detection
Rice cookers
Dishwashers
Elevators
Washing machines and other home appliances
Video game artificial intelligence
Language filters on message boards and chat rooms for filtering out offensive text
Pattern recognition in Remote Sensing
Fuzzy logic has also been incorporated into some microcontrollers and
microprocessors, for instance, the Freescale 68HC12.

Defining Fuzzy Sets


In mathematics a set, by definition, is a collection of things that belong to some
definition. Any item either belongs to that set or does not belong to that set. Let us look at
another example; the set of tall men. We shall say that people taller than or equal to 6 feet
are tall. This set can be represented graphically as follows:

The function shown above describes the membership of the 'tall' set, you are either in it or
you are not in it. This sharp edged membership functions works nicely for binary
operations and mathematics, but it does not work as nicely in describing the real world.
The membership function makes no distinction between somebody who is 6'1" and
someone who is 7'1", they are both simply tall. Clearly there is a significant difference
between the two heights. The other side of this lack of distinction is the difference
between a 5'11" and 6' man. This is only a difference of one inch, however this
membership function just says one is tall and the other is not tall.
The fuzzy set approach to the set of tall men provides a much better representation of the
tallness of a person. The set, shown below, is defined by a continuously inclining
function.

The membership function defines the fuzzy set for the possible values underneath of it on
the horizontal axis. The vertical axis, on a scale of 0 to 1, provides the membership value
of the height in the fuzzy set. So for the two people shown above the first person has a
membership of 0.3 and so is not very tall. The second person has a membership of 0.95
and so he is definitely tall. He does not, however, belong to the set of tall men in the way
that bivalent sets work; he has a high degree of membership in the fuzzy set of tall men.

Defining Fuzzy Sets Mathematically


Fuzzy sets were first proposed by Lofti A. Zadeh in his 1965 paper entitled none other
than: Fuzzy Sets. This paper laid the foundation for all fuzzy logic that followed by
mathematically defining fuzzy sets and their properties. The definition of a fuzzy set then,
from Zadeh's paper is:
Let X be a space of points, with a generic element of X denoted by x.
Thus X = {x}.
A fuzzy set A in X is characterized by a membership function fA(x)
which associates with each point in X a real number in the interval
[0,1], with the values of fA(x) at x representing the "grade of
membership" of x in A. Thus, the nearer the value of fA(x) to unity,
the higher the grade of membership of x in A.
from Fuzzy Sets, by Lofti A. Zadeh

This definition of a fuzzy set is like a superset of the definition of a set in the ordinary
sense of the term. The grades of membership of 0 and 1 correspond to the two
possibilities of truth and false in an ordinary set. The ordinary boolean operators that are
used to combine sets will no longer apply; we know that 1 AND 1 is 1, but what is 0.7
AND 0.3? This will be covered in the fuzzy operations section.
Membership functions for fuzzy sets can be defined in any number of ways as long as
they follow the rules of the definition of a fuzzy set. The Shape of the membership
function used defines the fuzzy set and so the decision on which type to use is dependant
on the purpose. The membership function choice is the subjective aspect of fuzzy logic, it
allows the desired values to be interpereted appropriatly. The most common membership
functions are shown below:

www.mathworks.com

The things of the universe are not sliced off from one another with a hatchet, neither the
hot from the cold nor the cold from the hot.
-Anaxagoras-

Defining Fuzzy Operations


Traditional Bivalent logic uses the boolean operators AND, OR, and NOT to perform the
intersect, union and complement operations. These operators work well for bivalent sets
and can be essentially defined using the following truth table:
x

x AND y

x OR y

NOT x

The truth table above works fine for bivalent logic but fuzzy logic does not have a finite
set of possibilities for each input; this makes for an infinitely large truth table. The
operators need to be defined as functions for all possible fuzzy values, that is, all real
numbers from 0 to 1 inclusive. Fuzzy logic is actually a superset of bivalent logic since it
includes the bivalent options (0,1) as well as all reals in between, so a generalized form of
these operators will be usefull. The generalized form for these three operators are:
x AND y

min(x,y)

x OR y

max(x,y)

NOT x

1-x

Using these definitions they can be applied to all of the bivalent combinations above as
well as some fuzzy number combinations. The truth table for this can be seen below:
x

min(x,y)

max(x,y)

1-x

0.2 0.5

0.2

0.5

0.8

0.7 0.2

0.2

0.7

0.3

0.6 0.6

0.6

0.6

0.4

Contents
6

1 Fuzzy degrees of truth


o 1.1 Applying fuzzy truth values
o 1.2 Fuzzy linguistic variables
2 An example of fuzzy reasoning
o 2.1 Other examples

Fuzzy logic
Fuzzy logic is a form of multi-valued logic derived from fuzzy set theory to deal with
reasoning that is approximate rather than precise. Just as in fuzzy set theory the set
membership values can range (inclusively) between 0 and 1, in fuzzy logic the degree of
truth of a statement can range between 0 and 1 and is not constrained to the two truth
values {true, false} as in classic predicate logic.[1] And when linguistic variables are used,
these degrees may be managed by specific functions, as discussed below.
Fuzzy set theory was first introduced in 1965 by Lotfi Zadeh at the University of
California, Berkeley and fuzzy logic was derived from it for use in applications.[2] It has
been applied to diverse fields from control theory to artificial intelligence, yet still
remains controversial among most statisticians who prefer probabilistic logic and some
control engineers who prefer traditional two valued logic.

Fuzzy degrees of truth


Both fuzzy degrees of truth and probabilities range between 0 and 1 and hence may seem
similar at first. However, they are distinct conceptually; fuzzy truth represents
membership in vaguely defined sets, not likelihood of some event or condition as in
probability theory. For example, if a 100-ml glass contains 30 ml of water, then, for two
fuzzy sets, Empty and Full, one might define the glass as being 0.7 empty and 0.3 full.
Note that the concept of emptiness would be subjective and thus would depend on the
observer or designer. Another designer might equally well design a set membership
function where the glass would be considered full for all values down to 50 ml. A
7

probabilistic setting would first define a scalar variable for the fullness of the glass, and
second, conditional distributions describing the probability that someone would call the
glass full given a specific fullness level. Note that the conditioning can be achieved by
having a specific observer that randomly selects the label for the glass, a distribution over
deterministic observers, or both. While fuzzy logic avoids talking about randomness in
this context, this simplification at the same time obscures what is exactly meant by the
statement the 'glass is 0.3 full'.

Applying fuzzy truth values


A basic application might characterize subranges of a continuous variable. For instance, a
temperature measurement for anti-lock brakes might have several separate membership
functions defining particular temperature ranges needed to control the brakes properly.
Each function maps the same temperature value to a truth value in the 0 to 1 range. These
truth values can then be used to determine how the brakes should be controlled.

In this image, cold, warm, and hot are functions mapping a temperature scale. A point on
that scale has three "truth values" one for each of the three functions. The vertical line
in the image represents a particular temperature that the three arrows (truth values) gauge.
Since the red arrow points to zero, this temperature may be interpreted as "not hot". The
orange arrow (pointing at 0.2) may describe it as "slightly warm" and the blue arrow
(pointing at 0.8) "fairly cold".

Fuzzy linguistic variables


While variables in mathematics usually take numerical values, in fuzzy logic
applications, the non-numeric linguistic variables are often used to facilitate the
expression of rules and facts.[3]
A linguistic variable such as age may have a value such as young or its opposite defined
as old. However, the great utility of linguistic variables is that they can be modified via
linguistic operations on the primary terms. For instance, if young is associated with the
value 0.7 then very young is automatically deduced as having the value 0.7 * 0.7 = 0.49.
And not very young gets the value (1 - 0.49) , i.e. 0.51.
In this example, the operator very(X) was defined as X * X, however in general these
operators may be uniformly, but flexibly defined to fit the application, resulting in a great
deal of power for the expression of both rules and fuzzy facts.

An example of fuzzy reasoning


Fuzzy Set Theory defines Fuzzy Operators on Fuzzy Sets. The problem in applying this is
that the appropriate Fuzzy Operator may not be known. For this reason, Fuzzy logic
usually uses IF/THEN rules, or constructs that are equivalent, such as fuzzy associative
matrices.
Rules are usually expressed in the form:
IF variable IS set THEN action
For example, an extremely simple temperature regulator that uses a fan might look like
this:
IF temperature IS very cold THEN stop fan
IF temperature IS cold THEN turn down fan
IF temperature IS normal THEN maintain level
IF temperature IS hot THEN speed up fan
Notice there is no "ELSE". All of the rules are evaluated, because the temperature might
be "cold" and "normal" at the same time to differing degrees.
The AND, OR, and NOT operators of boolean logic exist in fuzzy logic, usually defined
as the minimum, maximum, and complement; when they are defined this way, they are
called the Zadeh operators, because they were first defined as such in Zadeh's original
papers. So for the fuzzy variables x and y:
NOT x = (1 - truth(x))
x AND y = minimum(truth(x), truth(y))
x OR y = maximum(truth(x), truth(y))
There are also other operators, more linguistic in nature, called hedges that can be
applied. These are generally adverbs such as "very", or "somewhat", which modify the
meaning of a set using a mathematical formula.
In application, the programming language Prolog is well geared to implementing fuzzy
logic with its facilities to set up a database of "rules" which are queried to deduct logic.
This sort of programming is known as logic programming.
Once fuzzy relations are defined, it is possible to develop fuzzy relational databases. The
first fuzzy relational database, FRDB, appeared in Maria Zemankova's dissertation. After,
some other models arose like the Buckles-Petry model, the Prade-Testemale Model, the
Umano-Fukami model or the GEFRED model by J.M. Medina, M.A. Vila et al. In the
context of fuzzy databases, some fuzzy querying languages have been defined,
highlighting the SQLf by P. Bosc et al. and the FSQL by J. Galindo et al. These
languages define some structures in order to include fuzzy aspects in the SQL statements,
9

like fuzzy conditions, fuzzy comparators, fuzzy constants, fuzzy constraints, fuzzy
thresholds, linguistic labels and so on.

Other examples

If a man is 1.8 meters, consider him as tall:

IF male IS true AND height >= 1.8 THEN is_tall IS true; is_short IS false

The fuzzy rules do not make the sharp distinction between tall and short, that is
not so realistic:

IF height <= medium male THEN is_short IS agree somewhat


IF height >= medium male THEN is_tall IS agree somewhat
In the fuzzy case, there are no such heights like 1.83 meters, but there are fuzzy values,
like the following assignments:
dwarf male = [0, 1.3] m
short male = (1.3, 1.5]
medium male = (1.5, 1.8]
tall male = (1.8, 2.0]
giant male > 2.0 m
For the consequent, there are also not only two values, but five, say:
agree not = 0
agree little = 1
agree somewhat = 2
agree a lot = 3
agree fully = 4
In the binary, or "crisp", case, a person of 1.79 meters of height is considered medium. If
another person is 1.8 meters or 2.25 meters, these persons are considered tall.
The crisp example differs deliberately from the fuzzy one. We did not put in the
antecedent
IF male >= agree somewhat AND ...
as gender is often considered as a binary information. So, it is not so complex as being
tall.

10

Fuzzy Expert Systems


To date, fuzzy expert systems are the most common use of fuzzy logic. They
are used in several wide-ranging fields, including:

Linear and nonlinear control.


Pattern recognition.
Financial systems.

and many others.

What is a Fuzzy Expert System?


Put as simply as possible, a fuzzy expert system is an expert system that uses
fuzzy logic instead of Boolean logic. In other words, a fuzzy expert system
is a collection of membership functions and rules that are used to reason
about data. Unlike conventional expert systems, which are mainly symbolic
reasoning engines, fuzzy expert systems are oriented toward numerical
processing.
The rules in a fuzzy expert system are usually of a form similar to the
following:
if x is low and y is high then z = medium
where x and y are input variables (names for know data values), z is an
output variable (a name for a data value to be computed), low is a
membership function (fuzzy subset) defined on x, high is a membership
function defined on y, and medium is a membership function defined on z.
The part of the rule between the "if" and "then" is the rule's _premise_ or
_antecedent_. This is a fuzzy logic expression that describes to what degree
the rule is applicable. The part of the rule following the "then" is the rule's
_conclusion_ or _consequent_. This part of the rule assigns a membership
function to each of one or more output variables. Most tools for working
with fuzzy expert systems allow more than one conclusion per rule.
A typical fuzzy expert system has more than one rule. The entire group of
rules is collectively known as a rulebase or knowledge base.

11

12

The Inference Process


With the definition of the rules and membership functions in hand, we now
need to know how to apply this knowledge to specific values of the input
variables to compute the values of the output variables. This process is
referred to as [inferencing]. In a fuzzy expert system, the inference process
is a combination of four subprocesses: [fuzzification], [inference],
[composition], and [defuzzification]. The defuzzification subprocess is
optional.
For the sake of example in the following discussion, assume that the
variables X, Y, and Z all take on values in the interval [ 0, 10 ], and that we
have the following membership functions and rules defined below.
low(t) = 1 - t / 10
high(t) = t / 10

; 0 <= t <= 10

Fig. 1: Membership functions for LOW and HIGH fuzzy sets.


rule
rule
rule
rule

1:
2:
3:
4:

if
if
if
if

X
X
X
X

is
is
is
is

low and Y is low then Z is high


low and Y is high then Z is low
high and Y is low then Z is low
high and Y is high then Z is high
13

Notice that instead of assigning a single value to the output variable Z, each
rule assigns an entire fuzzy subset (low or high).
Notes:
1. In this example, low(t)+high(t)=1.0 for all t. This is not required, but it
is fairly common.
2. The value of t at which low(t) is maximum is the same as the value of
t at which high(t) is minimum, and vice-versa. This is also not
required, but fairly common.
3. The same membership functions are used for all variables. This isn't
required, and is also not common.

Solved Example
Let: X = 0.0 and Y = 3.2
Find the fuzzy membership function of the output variable Z, and hence find
its crisp value.
To solve this example, the following four steps should be done in sequence.

Step 1: Fuzzification
In the fuzzification subprocess, the membership functions defined on the
input variables are applied to their actual values, to determine the degree of
truth for each rule premise. If a rule's premise has a nonzero degree of truth
(if the rule applies at all...) then the rule is said to [fire].
Degree of
Membership

1.00

0.0

0.68

0.32

Note that to compute L(X) and L(Y) we substitute in the equation {low(t)
= 1 - t / 10} using values of {t} equals 0.0 and 3.2, respectively. Similarly, to
compute H(X) and H(Y) we substitute in the equation { high(t) = t / 10}
using the same values of {t}. Sometimes it is easier to have the membership
functions in a tabulated form, and you just look-up the given tables.

14

Step 2: Inference
In the inference subprocess, the truth value for the premise of each rule is
computed, and applied to the conclusion part of each rule. This results in one
fuzzy subset to be assigned to each output variable for each rule. The
table below shows that we get H(Z) = 0.68 from rule 1, and L(Z) = 0.32
from rule 2.
Activated Rules

ANDing of Antecedents

L(Z)

H(Z)

min(1.00, 0.68)

0.68

min(1.00, 0.32)

0.32

There are two [inference methods] or [inference rules]: [MIN] and


[PRODUCT].
In MIN inferencing, the output membership function is clipped off at
a height corresponding to the rule premise's computed degree of truth.
This corresponds to the traditional interpretation of the fuzzy logic
AND operation.
In PRODUCT inferencing, the output membership function is scaled
by the rule premise's computed degree of truth.
For example, let's look at rule 1 for x = 0.0 and y = 3.2. As shown in the
table above, the premise degree of truth works out to 0.68. For this rule,
MIN inferencing will assign z the fuzzy subset defined by the membership
function (refer also to Fig. 2):
(Z) {from rule1} = { Z / 10, if Z <= 6.8; and = 0.68, if Z >= 6.8 }
Note: In most texts, the term "inference method" is used to mean the
combination of the things I'm referring to separately here as "inference" and
"composition." Therefore, you'll see terms such as "MAX-MIN inference"
and "SUM-PRODUCT inference" in the literature. They mean the
combination of MAX composition and MIN inference, or SUM composition
and PRODUCT inference respectively, to use my terminology. You'll also
see the reverse terms "MIN-MAX" and "PRODUCT-SUM" - these mean the
same things as the reverse order. I think it's clearer to describe the two
processes separately.
15

Using the MIN inferencing method, the components of (Z) obtained from
both rule 1 and rule 2 are shown in Fig. 2. Both rule 3 and rule 4 are
not fired because their premises has a zero degree of truth, and hence
they will not add any component to (Z). The following are the
equations for the four components of the output membership
function (Z).
(Z) {from rule1}
(Z) {from rule2}
6.8 }
(Z) {from rule3}
(Z) {from rule4}

= { Z / 10, if Z <= 6.8; and = 0.68, if Z >= 6.8 }


= { 0.32,
if Z <= 6.8; and =1 - Z / 10, if Z >=
= 0.0
= 0.0

Fig. 2: Membership function of the output Z using rule #1, #2 with MIN
inference.
For the same conditions (rule 1: x = 0.0 and y = 3.2), PRODUCT
inferencing will assign Z the fuzzy subset defined by the membership
function:
(Z) {from rule1} = 0.68 * high(Z); and = 0.068 * Z

16

Step 3- Composition
In the composition subprocess, all of the fuzzy subsets assigned to each
output variable are combined together to form a single fuzzy subset for each
output variable.
There are two common composition rules: MAX composition and SUM
composition.
In MAX composition, the combined output fuzzy subset is
constructed by taking the pointwise maximum over all of the fuzzy
subsets assigned to the output variable by the inference rule.
In SUM composition the combined output fuzzy subset is constructed
by taking the pointwise sum over all of the fuzzy subsets assigned to
the output variable by the inference rule.
Note that the SUM composition can result in truth values greater than one!
For this reason, SUM composition is only used when it will be followed by a
defuzzification method, such as the CENTROID method, that doesn't have a
problem with this odd case.
MAX composition would result in the following fuzzy subset (Fig.3).
(Z) = { 0.32,
Z / 10,
0.68,

if Z <= 3.2
if 3.2 <= Z <= 6.8
if Z >= 6.8 }

{Solution using MIN inference and MAX composition}


After completing the MIN inference process, we proceed to compose the
membership function (F) of the variable Z. From step 2 we find that:
1. The maximum value of L(Z) is 0.32, then we draw the first
component of the required membership function (Z) by clamping
the function L(Z) at level 0.32.
2. The maximum value of H(Z) is 0.68, then we draw the second
component of the required membership function (Z) by clamping
the function H(Z) at level 0.68.
3. The required membership function of the output (Z) is obtained by
taking the maximum values of the above-mentioned two components.
17

Fig. 3: Membership function of the output Z using rules #1, 2, 3, 4.


{Using MIN inference and MAX composition}

Alternative Solution
An alternative solution for steps 2 (Inference) and 3 (Composition) is to use
PRODUCT inference with MAX composition. This solution is shown in Fig.
4 and Fig. 5, respectively. These diagrams are obtained as follows:
PRODUCT inferencing would assign the following four fuzzy subsets
to Z:
(Z) {from rule1}
(Z) {from rule2}
(Z) {from rule3}
(Z) {from rule4}

= 0.068 * Z
= 0.32 - 0.032 * Z
= 0.0
= 0.0

SUM composition would result in the fuzzy subset:


(Z) = 0.32 + 0.036 * Z

18

Fig. 4: Membership function of the output Z using rule #1, #2 with


PRODUCT inference.

Fig. 5: Membership function of the output Z using rules #1, 2, 3, 4.


{Using PRODUCT inference and SUM composition}

19

Step 4- Defuzzification
Sometimes it is useful to just examine the fuzzy subsets that are the result of
the composition process, but more often, this fuzzy value needs to be
converted to a single number - a crisp value. This is what the defuzzification
subprocess does.
There are many defuzzification methods and there is a short paper that
compared roughly thirty defuzzification methods. Two of the more common
techniques are the CENTROID and MAXIMUM methods.
In the CENTROID method, the crisp value of the output Z is obtained
by computing the centroid of the area under the composed
membership curve. Approximately the centroid can be computed from
the following formula, where (x) represents the values on the
horizontal X-axis, and represents the corresponding values on the
vertical Y-axis.

C = { x . (x) } / (x)
In the MAXIMUM method, one of the variable values at which the
fuzzy subset has its maximum truth value is chosen as the crisp value
for the output variable. There are several variations of the
MAXIMUM method that differ only in what they do when there is
more than one variable value at which this maximum truth value
occurs. One of these, the AVERAGE-OF-MAXIMA method, returns
the average of the variable values at which the maximum truth value
occurs.
For example, go back to our previous examples. The following table shows
the output crisp value as computed using four different methods (refer to
Fig. 3 and Fig. 5). It is clear that the centroid methods give decent values for
both inference methods.
{Inference / Composition}
MIN / MAX
PRODUCT / SUM

CENTROID
Z = 5.88
Z = 5.624

20

Average of Maxima
Z = (6.8+10)/2 = 8.4
Z = 10

Note: sometimes the composition and defuzzification processes are


combined, taking advantage of mathematical relationships that simplify the
process of computing the final output variable values.

Second Solved Example


Fuzzy Temperature Control
A fuzzy controller adjusts the cold air flow according to the size (V: volume) of the
controlled room and its ambient temperature (T). The air flow is adjusted by controlling
the angle (F) of a shutter inside the intake pipe that supplies cold air. Partial flow is
proportional to the shutter angle. An angle of 90o allows maximum air flow, while an
angle of 0o completely closes the shutter and stops the air flow. This is depicted in the
following diagram.
Intake Pipe
F

Cold Air Flow

The table to the right shows the


input and output variables of the
fuzzy controller. The fuzzy
knowledge base is shown below.

Input Variables

Room Size: V
Ambient Temperature: T

Output Variable

Angle of Cold Air Flow: F

Fuzzy Knowledge Base


1
2
3
4
5
6
7

IF (V is low AND T is low) THEN F is low


IF (V is low AND T is medium) THEN F is medium
IF (V is low AND T is high) THEN F is high
IF (V is medium AND T is low) THEN F is medium
IF (V is medium AND T is medium) THEN F is medium
IF (V is medium AND T is high) THEN F is high
IF (V is high AND T is low) THEN F is medium

21

8
9

IF (V is high AND T is medium) THEN F is high


IF (V is high AND T is high) THEN F is high

The fuzzy sets low, medium, and high are defined next for each one of the input
and output variables.

22

1) Room Size: V

23

2) Ambient Temperature: T

3) Angle of Cold Air Flow: F

24

Example Problem
In the above-mentioned fuzzy controller, the room size is 45 cubic meters and the
ambient temperature is 30o.
1. Use the MIN/MAX method to find the fuzzy membership function for the shutter
angle (F).
2. Use the center of gravity method to find the crisp value of F.

Solution
The solution steps are as follows:
1. Fuzzification of the input variables.
2. Inference from the fuzzy knowledge base, based on the degree of membership in
the considered fuzzy sets for all input variables. This inference determines which
rules in the fuzzy knowledge base will be activated, and hence for each activated
rule there will be a corresponding degree of membership for the output variable(s)
in every considered fuzzy set.
3. Composition of the resultant membership function for the output variable(s).
4. Defuzzification of the resultant membership function to obtain a crisp value of
the output variable.

Step 1: Fuzzification
Degree of
Membership

Room size, V

0.25

0.75

0.0

Temperature, T

0.0

0.25

0.75

To get the degrees of membership for the input variable V draw a vertical line at the value
of this variable (here it is at V=45), and find its intersection with the three fuzzy
membership functions (low, medium, and high). Repeat the same thing for the other input
variable T.
Alternatively if you have a table giving numerical values of the fuzzy membership
functions, you can directly read the required value () from the table, or interpolate its
value if it is not explicitly given in the table. For example, the fuzzy membership
functions for the temperature T are shown next.
To get a value for L(13) from this table, we only have a value of 0.5 at T=12 and 0.25 at
T=14. By interpolation (assume straight line between the two points) we can calculate the
value at T=13 to be (0.5+0.25)/2 = 0.375. Therefore L(13) = 0.375

25

Fuzzy membership functions for the temperature (T)


T
0
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40

low(T)
1
1
1
1
1
0.75
0.5
0.25
0
0
0
0
0
0
0
0
0
0
0
0
0

medium(T)
0
0
0
0
0
0.25
0.5
0.75
1
1
1
1
1
0.75
0.5
0.25
0
0
0
0
0

high(T)
0
0
0
0
0
0
0
0
0
0
0
0
0
0.25
0.5
0.75
1
1
1
1
1

Step 2: Inference
Activated Rules

ANDing of Antecedents

L(F)

M(F)

H(F)

min(0.25, 0.25)

0.25

min(0.25, 0.75)

0.25

min(0.75,0.25)

0.25

min(0.75, 0.75)

0.75

26

Step 3: Composition

Here we shall use the MIN inference with MAX composition method. After completing
the inference process, we proceed to compose the membership function of the shutter
angle (F). From step 2 we find that:
1. The maximum value of M(F) is 0.25, then we draw the first component of the
required membership function (F) by clamping the function M(F) at level 0.25.
2. The maximum value of L(F) is 0.75, then we draw the second component of the
required membership function (F) by clamping the function L(F) at level 0.75.
3. The required membership function of the shutter angle (F) is obtained by adding
the above-mentioned two components.

27

Step 4: Defuzzification

The above diagram shows the resulting fuzzy membership function for the shutter angle
after inference and composition. As mentioned before, there are many methods for
obtaining a crisp value for the output. Two methods are considered here.
The average of maxima method
In this method the maximum values of the composed output (shutter angle)
membership function are recorded, and their average is computed to be the crisp
value. In the above diagram, the maximum values range from 70 o to 90o and
hence their average is 80o.
The center of gravity method (centroid)
The crisp value of the output (shutter angle) is obtained by computing the
centroid of the area under the composed membership curve. Approximately the
centroid can be computed from the following formula, where (x) represents the
values on the horizontal X-axis, and represents the corresponding values on the
vertical Y-axis. The computed value of the centroid is 65o, which is the crisp value
for the shutter angle.
C = { x . (x) } / (x)

28

Você também pode gostar