Sunteți pe pagina 1din 51

INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014

Contents
Fuzzy Inference
Fuzzification of the input variables
Rule evaluation
Aggregation of the rule outputs
Defuzzification
Mamdani
Sugeno
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Fuzzy Inference
The most commonly used fuzzy inference technique is the so-
called Mamdani method.

In 1975, Professor Ebrahim Mamdani of London University built
one of the first fuzzy systems to control a steam engine and
boiler combination. He applied a set of fuzzy rules supplied by
experienced human operators.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Mamdani Fuzzy Inference
The Mamdani-style fuzzy inference process is performed in
four steps:

1. Fuzzification of the input variables

2. Rule evaluation (inference)

3. Aggregation of the rule outputs (composition)

4. Defuzzification.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Mamdani Fuzzy Inference
We examine a simple two-input one-output problem that includes
three rules:

Rule: 1 Rule: 1
IF x is A3 IF project_funding is adequate
OR y is B1 OR project_staffing is small
THEN z is C1 THEN risk is low

Rule: 2 Rule: 2
IF x is A2 IF project_funding is marginal
AND y is B2 AND project_staffing is large
THEN z is C2 THEN risk is normal

Rule: 3 Rule: 3
IF x is A1 IF project_funding is inadequate
THEN z is C3 THEN risk is high
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
TABLE 2.1 Mathematical Characterization of
Triangular Membership Functions
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
TABLE 2.2 Mathematical Characterization of
Gaussian Membership Functions
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Step 1: Fuzzification
The first step is to take the crisp inputs, x1 and y1 (project
funding and project staffing), and determine the degree to which
these inputs belong to each of the appropriate fuzzy sets.
Crisp Input
y1
0.1
0.7
1
0
y1
B1 B2
Y
Crisp Input
0.2
0.5
1
0
A1 A2 A3
x1
x1 X

(x = A1)
= 0.5

(x = A2)
= 0.2

(y = B1)
= 0.1

(y = B2)
= 0.7
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Step 2: Rule Evaluation
The second step is to take the fuzzified inputs,
(x=A1)
=
0.5,
(x=A2)
= 0.2,
(y=B1)
= 0.1 and
(y=B2)
= 0.7, and apply them to
the antecedents of the fuzzy rules.

If a given fuzzy rule has multiple antecedents, the fuzzy operator
(AND or OR) is used to obtain a single number that represents
the result of the antecedent evaluation.

This number (the truth value) is then applied to the consequent
membership function.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Step 2: Rule Evaluation (cont)
RECAL:
To evaluate the disjunction of the rule antecedents, we use the OR
fuzzy operation. Typically, fuzzy expert systems make use of the
classical fuzzy operation union:


AB
(x) = max [
A
(x),
B
(x)]

Similarly, in order to evaluate the conjunction of the rule
antecedents, we apply the AND fuzzy operation intersection:


AB
(x) = min [
A
(x),
B
(x)]
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
A3
1
0
X
1
y1
0
Y
0.0
x1
0
0.1
C1
1
C2
Z
1
0
X
0.2
0
0.2
C1
1
C2
Z
A2
x1
Rule 3:
A1
1
0
X
0
1
Z x1
THEN
C1 C2
1
y1
B2
0
Y
0.7
B1
0.1
C3
C3
C3
0.5 0.5
OR
(max)
AND
(min)
OR THEN Rule 1:
AND THEN Rule 2:
IF x is A3 (0.0) y is B1 (0.1) z is C1 (0.1)
IF x is A2 (0.2) y is B2 (0.7) z is C2 (0.2)
IF x is A1 (0.5) z is C3 (0.5)
Step 2: Rule Evaluation (cont)
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Now the result of the antecedent evaluation can be applied to
the membership function of the consequent.

There are two main methods for doing so:
Clipping
Scaling
Step 2: Rule Evaluation (cont)
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
The most common method of correlating the rule consequent
with the truth value of the rule antecedent is to cut the
consequent membership function at the level of the antecedent
truth. This method is called clipping (alpha-cut).

Since the top of the membership function is sliced, the clipped
fuzzy set loses some information.

However, clipping is still often preferred because it involves less
complex and faster mathematics, and generates an aggregated
output surface that is easier to defuzzify.
Step 2: Rule Evaluation (cont)
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
While clipping is a frequently used method, scaling offers a
better approach for preserving the original shape of the fuzzy
set.

The original membership function of the rule consequent is
adjusted by multiplying all its membership degrees by the truth
value of the rule antecedent.

This method, which generally loses less information, can be
very useful in fuzzy expert systems.
Step 2: Rule Evaluation (cont)
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Step 2: Rule Evaluation (cont)
Degree of
Membership
1.0
0.0
0.2
Z
Degree of
Membership
Z
C2
1.0
0.0
0.2
C2
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Step 3: Aggregation of the rule outputs
Aggregation is the process of unification of the outputs of all
rules.

We take the membership functions of all rule consequents
previously clipped or scaled and combine them into a single
fuzzy set.

The input of the aggregation process is the list of clipped or
scaled consequent membership functions, and the output is one
fuzzy set for each output variable.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
0
0.1
1
C1
C z is 1 (0.1)
C2
0
0.2
1
C z is 2 (0.2)
0
0.5
1
C z is 3 (0.5)
Z Z Z
0.2
Z 0

C3
0.5
0.1
Step 3: Aggregation of the rule outputs (cont)
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Step 4: Defuzzification
The last step in the fuzzy inference process is defuzzification.

Fuzziness helps us to evaluate the rules, but the final output of a
fuzzy system has to be a crisp number.

The input for the defuzzification process is the aggregate output
fuzzy set and the output is a single number.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
There are several defuzzification methods, but probably the
most popular one is the centroid technique. 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:
Step 4: Defuzzification (cont)
( )
( )
}
}

=
b
a
A
b
a
A
dx x
dx x x
COG



INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Step 4: Defuzzification (cont)
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.0
0.2
0.4
0.6
0.8
160 170 180 190 200
a b
210
A
150
X
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Step 4: Defuzzification (cont)
1.0
0.0
0.2
0.4
0.6
0.8
0 20 30 40 50 10 70 80 90 100 60
Z
Degree of
Membership
67.4
4 . 67
5 . 0 5 . 0 5 . 0 5 . 0 2 . 0 2 . 0 2 . 0 2 . 0 1 . 0 1 . 0 1 . 0
5 . 0 ) 100 90 80 70 ( 2 . 0 ) 60 50 40 30 ( 1 . 0 ) 20 10 0 (
=
+ + + + + + + + + +
+ + + + + + + + + +
= COG
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Sugeno Fuzzy Inference
Mamdani-style inference, as we have just seen, requires us to
find the centroid of a two-dimensional shape by integrating
across a continuously varying function. In general, this process
is not computationally efficient.

Michio Sugeno suggested to use a single spike, a singleton, as
the membership function of the rule consequent.

A singleton, or more precisely a fuzzy singleton, is a fuzzy set
with a membership function that is unity at a single particular
point on the universe of discourse and zero everywhere else.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Sugeno-style fuzzy inference is very similar to the Mamdani
method. Sugeno changed only a rule consequent. Instead of a
fuzzy set, he used a mathematical function of the input variable.
The format of the Sugeno-style fuzzy rule is

IF x is A
AND y is B
THEN z is f(x, y)

where x, y and z are linguistic variables; A and B are fuzzy sets
on universe of discourses X and Y, respectively; and f(x, y) is a
mathematical function.
Sugeno Fuzzy Inference (cont)
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
The most commonly used zero-order Sugeno fuzzy model
applies fuzzy rules in the following form:

IF x is A
AND y is B
THEN z is k

where k is a constant.

In this case, the output of each fuzzy rule is constant. All
consequent membership functions are represented by singleton
spikes.
Sugeno Fuzzy Inference (cont)
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Sugeno Rule Evaluation
A3
1
0
X
1
y1
0
Y
0.0
x1
0
0.1
1
Z
1
0
X
0.2
0
0.2
1
Z
A2
x1
IF x is A1 (0.5) z is k3 (0.5)
Rule 3:
A1
1
0
X
0
1
Z x1
THEN
1
y1
B2
0
Y
0.7
B1
0.1
0.5 0.5
OR
(max)
AND
(min)
OR y is B1 (0.1) THEN z is k1 (0.1) Rule 1:
IF x is A2 (0.2) AND y is B2 (0.7) THEN z is k2 (0.2)
Rule 2:
k1
k2
k3
IF x is A3 (0.0)
A3
1
0
X
1
y1
0
Y
0.0
x1
0
0.1
1
Z
1
0
X
0.2
0
0.2
1
Z
A2
x1
IF x is A1 (0.5) z is k3 (0.5)
Rule 3:
A1
1
0
X
0
1
Z x1
THEN
1
y1
B2
0
Y
0.7
B1
0.1
0.5 0.5
OR
(max)
AND
(min)
OR y is B1 (0.1) THEN z is k1 (0.1) Rule 1:
IF x is A2 (0.2) AND y is B2 (0.7) THEN z is k2 (0.2)
Rule 2:
k1
k2
k3
IF x is A3 (0.0)
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Sugeno Aggregation of the Rule Outputs
z is k1 (0.1) z is k2 (0.2) z is k3 (0.5)

0
1
0.1
Z
0
0.5
1
Z
0
0.2
1
Z k1 k2 k3
0
1
0.1
Z k1 k2 k3
0.2
0.5
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Sugeno Defuzzification
Weighted Average (WA)
65
5 . 0 2 . 0 1 . 0
80 5 . 0 50 2 . 0 20 1 . 0
) 3 ( ) 2 ( ) 1 (
3 ) 3 ( 2 ) 2 ( 1 ) 1 (
=
+ +
+ +
=
+ +
+ +
=
k k k
k k k k k k
WA
0 Z
Crisp Output
z1
z1
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Mamdani or Sugeno?
Mamdani method is widely accepted for capturing expert
knowledge. It allows us to describe the expertise in more
intuitive, more human-like manner. However, Mamdani-type
fuzzy inference entails a substantial computational burden.

On the other hand, Sugeno method is computationally effective
and works well with optimisation and adaptive techniques, which
makes it very attractive in control problems, particularly for
dynamic nonlinear systems.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Takagi-Sugeno Fuzzy Systems
The fuzzy system defined in the previous sections will be referred to as a
standard fuzzy system.

In this section we will define a functional fuzzy system, of which the Takagi-
Sugeno fuzzy system is a special case.

For the functional fuzzy system, that uses singleton fuzzification, and the i
th
MISO rule has the form
where simply represents the argument of the function g
i
and the b
i
are
not output membership function centers. The premise of this rule is defined
the same as it is for the MISO rule for the standard fuzzy system
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
choose o may want t instance, for
possible, are others many but functions affine and linear discuss will we Below,
. considered being n applicatio on the depends function the of choice The
used. be also may variables
other but 2 1 , terms the contains of argument often the that Notice
function. membership
associated an have not does that system) fuzzy l functiona name the (hence
( ) function a use we consequent in the function, membership associated an with
term linguistic a of Instead however. different, are rules the of s consequent The
, , . . ., n , i u g
g b
i i
i i
=
=
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
For the functional fuzzy system, we can use an appropriate operation for
representing the premise (e.g., minimum or product), and defuzzification
may be obtained using
where
i
is defined in Equation bellow:
It is assumed that the functional fuzzy system is defined so that no matter
what its inputs are, we have

One way to view the functional fuzzy system is as a nonlinear interpolator
between the mappings that are defined by the functions in the
consequents of the rules.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
An Interpolator Between Linear Mappings

In the case where
mappings. linear between ion interpolat nonlinear a
performs y essentiall system fuzzy Sugeno - Takagi that the see we Overall,
e. convenienc for mapping
linear a as mapping affine the refer to will we standard, is as however, Often,
affine. called is mapping
then the , 0 if and mapping linear a is mapping ( ) then the , 0 If
system. fuzzy Sugeno - Takagi a
as to referred is system fuzzy functional the numbers real are the where
0 0
= =
i, i i,
i,j
a g a
a
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
As an example, suppose that n = 1, R = 2, and that we have rules
have we ,
~
represents and
~
represents that so 2.5 Figure in given for discourse of universe with the
2
1 2
1
1
1 1
A A
u


For u
1
> 1,
1
= 0, so y = 1+u
1
, which is a line. If u
1
< 1,
2
= 0, so y = 2+u
1
,
which is a different line.

Between 1 u
1
1, the output y is an interpolation between the two lines.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Figure 2.5 Membership functions for Takagi-Sugeno fuzzy system example.
Finally, it is interesting to note that if we pick
(i.e., a
i,j
= 0 for j > 0), then the Takagi-Sugeno fuzzy system is equivalent to
a standard fuzzy system that uses center-average defuzzification with
singleton output membership functions at a
i,0
.

It is in this sense that the Takagi-Sugeno fuzzy systemor, more generally,
the functional fuzzy systemis sometimes referred to as a general fuzzy
system.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
An Interpolator Between Linear Systems

It is important to note that a Takagi-Sugeno fuzzy system may have any linear
mapping (affine mapping) as its output function, which also contributes to its
generality.

One mapping that has proven to be particularly useful is to have a linear
dynamic system as the output function so that the i
th
rule has the form
system. fuzzy the input to l dimensiona
- the is )] ( ., . . ), ( ), ( [ ) ( and dimension, e appropriat of matrices
input and state the are 2 1 , and input, model l dimensiona
- the is )] ( ., . . ), ( ), ( [ ) ( inputs, of number the y) necessaril
not is (now state l dimensiona - the is )] ( ., . . ), ( ), ( [ ) ( Here,
T
2 1
T
2 1
T
2 1
p t z t z t z t z
, . . ., R , i B A
m t u t u t u t u
n n t x t x t x t x
p
i i
m
n
=
=
=
=
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
This fuzzy system can be thought of as a nonlinear interpolator between
R linear systems, it takes the input z(t) and has an output
If R = 1, we get a standard linear system.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
rules with 2 and , 1 ), ( ) ( that suppose example, an As
)]. ( ), ( [ ) (
sometimes or ), ( ) ( choose instance, for ), ( for possible are choices Many
output. the to contribute and
on turn will rules certain only ), ( of e given valu a and 1 for Generally,
= = = = =
=
=
>
R m n p t x t z
t u t x t z
t x t z t z
t z R
). with
2.5 Figure of axis horizontal the relabel we (i.e., ly respective ,
~
and
~
for
functions membership the as 2.5 Figure from and use that we Suppose
1
2
1
1
1
2 1
x
A A

INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
In this case the output equation above becomes
If x
1
(t) > 1, then
1
= 0 and
2
= 1, so the behavior of the nonlinear system is
governed by
which is the linear system specified by the second rule above.
However, if x
1
(t) < 1, then
1
= 1 and
2
= 0, so the behavior of the nonlinear
system is governed by
which is the linear system specified by the first rule above.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Takagi-Sugeno fuzzy system interpolates between the two linear systems.
We see that for changing values of x
1
(t), the two linear systems that are in the
consequents of the rules contribute different amounts.

We think of one linear system being valid on a region of the state space that
is quantified via
1
and another on the region quantified by
2
(with a fuzzy
boundary in between).

For the higher-dimensional case, we have premise membership functions for
each rule quantify whether the linear system in the consequent is valid for a
specific region on the state space.

As the state evolves, different rules turn on, indicating that other combinations
of linear models should be used.

Overall, we find that the Takagi-Sugeno fuzzy system provides a very intuitive
representation of a nonlinear system as a nonlinear interpolation between R
linear models.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Figure 2.6: Commonly used fuzzy if-then rules and fuzzy mechanism.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Lets consider the nonlinear system below:



The goal is to derive a T-S fuzzy model from the above given nonlinear system
equations by the sector nonlinearity approach as if the response of the T-S
fuzzy model in the specified domain exactly match with the response of the
original system with the same input u.
The following steps should be taken to derive the T-S fuzzy model of above
equation. For simplicity, we assume that x1 [0.5, 3.5] and x2 [-1, 4]. Here x1
and x2 are nonlinear terms in the equations in the last equations so we make
them as our fuzzy variables.
Generally they are denoted as z1, z2 and are known as premise variables that
may be functions of state variables, input variables, external disturbances
and/or time. Therefore z1 = x1 and z2 = x2. Equation above can be written as
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
where x(t) = [x1(t) x2(t)]T. The first step for any kind of fuzzy modeling is to
determine the fuzzy variables and fuzzy sets or so-called membership
functions. Although there is no general procedure for this step and it can be
done by various methods predominantly trial and error, in exact fuzzy modeling
using sector nonlinearity, it is quite routine. It is assumed that the premise
variables are just functions of the state variables for the sake of simplicity. This
assumption is needed to avoid a complicated defuzzification process of the
fuzzy controllers [9].
To acquire membership functions, we should calculate the minimum and
maximum values of z1(t) and z2(t) which under x1 [0.5, 3.5] and x2 [-1. 4],
they are obviously obtained as follows:
max z1(t) = 3.5; min z1(t) = 0.5;
max z2(t) = 4; min z2(t) = -1:
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Figure 2.7: Membership functions M1(z1(t)), M2(z2(t)), N1(z2(t)) and N2(z2(t)).
We name the membership functions "Positive", "Negative," "Big," and "Small,"
respectively. Figure 2.7 shows these membership functions.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Here, we can generalize that the i
th
rule of the continuous T-S fuzzy models
are of the following forms:
Model Rule i:
IF z1(t) is Mi1 and and zp(t) is Mip,
Here, Mij is the fuzzy set and r is the number of model rules; x(t) is the state
vector, u(t) is the input vector, y(t) is the output vector, Ai is the square matrix
with real elements and z1(t),..,zp(t) are known premise variables as
mentioned before. Each linear consequent equation represented by Aix(t) +
Biu(t) is called a subsystem.
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Therefore, the nonlinear system equation previous is modeled by the
following fuzzy rules (we don't consider input u(t) in this stage):
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
Therefore, if z1 = x1 = 2.75 and z2 = x2 = 0.25, the T-S fuzzy modeling
implication can be derived as:
Figure 2.8: Given the value of z1 = 2.75 and z2 = 0.25 to the membership
functions
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014
INTELLIGENT CONTROL SYSTEM (ICS) Semester2 session 20132014

S-ar putea să vă placă și