You are on page 1of 24

Fuzzy Logic and Fuzzy Modeling

Fuzzy Logic:

Fuzzy logic deals with fuzzy sets. A fuzzy set or subset is a generalization of an ordinary
or crisp set. A fuzzy subset can be seen as a predicate whose truth values are drawn from
the unit interval , I =[0,1] rather than the set {0,1} as in the case of an ordinary set. Thus
the fuzzy subset has as its underlying logic a multivalued logic. The fuzzy set allows for
the description of concepts in which the boundary between a property and not having a
property is not sharp.

Ex:-
A set of heights forms a fuzzy set and its subsets include heights that can be categorized
as tall, medium and short, here the property is height. All the temperatures in a year can
be clustered into three groups (or fuzzy subsets) that belong to hot, moderate and cold.
Here the property is temperature. In both these examples, the highest value of the
property is taken as unity and the rest lie with in the interval [0, 1].

Membership function:-

Let X be the universe of discourse (the domain of a property). A subset of A of X is


associated with a membership function.

A : x→ [0, 1]

Where  A (x) for each x indicates the degree to which x is a member of the set A. I t is
also called the degree of association of x in A.
Depending on the variation of x in the set A, one can choose a particular shape for the
membership function. Some of the shapes are described in the following.

A triangular membership function (MF) is specified by three parameters {a, b, c} as


follows:



 0, x  a
 x  a
Triangular (x; a, b, c) =  ,a  x  b
b  a
cx
 c  b ,b  x  c

 0, c  x

A trapezoidal MF is specified by four parameters {a, b, c, d} as follows:





 0, x  a
 x  a
Trapezoid (a; a, b, c, d) =  ,a  x  b
ba
d  x
d  c ,c  x  d

0, d  x

A Gaussian MF is specified by two parameters {c,  }

x c
2
1/ 2
Gaussian (x; c,  ) = e   
A generalized bell MF is specified by three parameters {a, b, c}

1
Bell (x ; a ,b,c) =
xc
2b

1
a

where the parameter b is usually positive.


Fuzzy Set:-

If X is a collection of objects denoted generally by x, then a fuzzy set A in X is defined as


a set of ordered pairs:

A = {[x,  A (x) ] | x  X }

Where  A (x) is the MF for the fuzzy set A. Usually x is referred to as the universe of
discourse or simply the universe.
Ex :

Let X=R+ be the set of possible ages for human beings then the fuzzy set B= “about 50
years old “may be expressed as
Support:
The support of fuzzy set A is the set of all points x in A such that  A (x) >0:

Support (A) = {x │  A (x) >0}

Core:
The core of a fuzzy set A is the set of all points x in X such that  A (x) =1

Core (A) = {x │  A (x) =1}

Crossover point:
A crossover point of a fuzzy set A is a point x  X
At which  A (x) = 0.5

Crossover (A) = {x │  A (x) =0.5}

Fuzzy singleton:
A fuzzy set whose support is a single point in x with  A (x) = 1 is called fuzzy singleton.
α­cut, strong α­cut:
The α-cut or α-level set of a fuzzy set A is a crisp set defined by
Aα = {x │  A (x) ≥α}
Strong αcut or strong α-level are defined similarly
Aα’ = {x │  A (x) >α

Normality:
A fuzzy set A is normal if its core is nonempty.
In other words, we can always find a point x  X such that  A (x) = 1

Convexity:
A fuzzy set is convex if and only if for any x1,x2  X and any λ  [0,1] ,  A {λx1 + (1-

λ)x2 }  min {  A (x1),  A (x2) }


Alternatively, A is convex if all its α –level sets are convex.

Fuzzy number:
A fuzzy number A is a fuzzy set in the real line (R) that satisfies the conditions for
normality and convexity.

Fuzzy set operations:


Before introducing the fuzzy set operations, first we shall define the notation of
containment, which plays a central role in fuzzy sets.

Containment or subset:
A fuzzy set A is contained in set B (or, equivalent A is α subset of B) if and only if  A

(x) ≤  B (x) for all. In symbols,

A  B   A (x) ≤  B (x)

Union (disjunction):
The union of two fuzzy sets A and B is a fuzzy set C , written as C=A  B or C=a or B,
whose MF is related to those of A and B by
C (x)= max{  A (x),  B (x)}=  A (x)   B (x) it is the “smallest” fuzzy set
containing both A and B.

Intersection (conjunction):
The interconnection of two fuzzy sets A and B is a fuzzy set C written as C=A  B or C=
A and B whose MF is related to those of A and B by
C (x) = min {  A (x),  B (x)}=  A (x)   B (x)
It is the “largest” fuzzy set, which is contained in both A and B.

Complement (negation):

The complement of a fuzzy set A is denoted by A


A  1 A

MFs of two Dimensions:

Some times it is necessary to use MFs with two inputs, each on a different universe of
discourse. MFs of this kind are generally referred to as two-dimensional MFs, where as
ordinary MFs are referred to as one-dimensional MFs. One natural way to extend one-
dimensional MF to two-dimensional ones is via cylindrical extension.

Cylindrical extension of one-dimensional fuzzy sets:

If A is a fuzzy set in X, then its cylindrical extension in X x Y is a fuzzy set c(A) defined
by

C (A) = 
XxY
 A /(x,y)
Usually, A is referred to as a base set. The operation of projection on the other hand
decreases the dimension of a given (multidimensional) MF.

Projection of fuzzy sets:

Let R be a two dimensional fuzzy set on XxY. Then the projection of R onto X and Y are
defined as

Rx =  [max y  R (x,y)]/x
x

Ry =  [max x  R (x,y)]/y
y

respectively.

T and S operators:

The four conditions: commutativity, associativity, monotonicity and respective identities


have been used to characterize the T and S operators which in turn define the general
class of intersection and union.
An operator T: [ 0,1] x [ 0,1] 
 [ 0,1 ]
Is called a t-norm operator if
(1) T (a, b) = T (b, a) Commutativity
(2) T( a,T( b,c)) = T(T ( a,b ),c) Associativity
(3) T (a, b) ≥ T (c,d) if a ≥ c and b ≥ d Monotonicity
(4) T(a,1) = a One identity

To see that the T reduces to the crisp intersection we note that (4) implies T(0,1) =0 and
T (1,1) =1.
Condition (1) implies T(0,1) = T(1,0) = 0. Finally, this fact along with condition (3)
implies that T (0,0) = 0.
We note that the Min and product operators are examples of these t-norm operators. Part
of the uniqueness of the Min operator as a choice for the implementation of the
intersection operator is based on the fact that the Min operator is the largest of possible t-
norms, T(a,b) ≤ Min (a,b).

t-co norm or s operator:


An operator s: [0,1] x [0,1]  [ 0,1]
Is called a t-conorm operator if
(1) s(a,b)= s(b,a) Commutativity
(2) s(a, s(b,c)) = s(s(a,b),c) Associativity
(3) s(a,b) ≥ s(c,d) if a ≥ c and b ≥ d Monotonicity
(4) s(a,0) = a Zero identity

It can be seen that the above conditions imply


s(1,1) = s(1,0) = s(0,1) = 1
s(0,0) = 0

We note that the Max and the a + b – ab operators are examples of these t- conorm
operators. Another example of the t- conorm is the bounded sum Min [1, a+b]. part of the
uniqueness of the max operator as a choice for the implementation of the union operator
is based on the fact that the Max operator is the smallest of all the t-co norms, for all s:
Max(a,b) ≤ s(a,b).

It should be noted that the only distinction between the T and S operators is in conditions
(4) and (4’). These conditions can be seen as the defining characteristics of the respective
operators. Essentially condition (4) implies that the smallest argument is the most
influential in the formulation of the “AND”, while condition (4’) implies that the biggest
argument is the most influential in the formulation of the “OR”.
The following is a short table of some commonly encountered t-co norm and t-co norm
duals:
t-norm t- conorm
Min (a,b) Max (a,b) Min/Max
ab a+b-ab product/probabilistic sum
Max(0,a+b-1) Min(1,a+b) Bold union/Bounded sum

Extension Principle:
The extension principle is a basic concept of fuzzy set theory that provides a general
procedure for extending crisp domains of mathematical expressions to fuzzy domains.

This procedure generalizes a common point – to –point mapping of a function f ( . ) to a

mapping between fuzzy sets. More specifically, suppose that f is a function from X to Y
and A is a fuzzy on x defined as
A   A ( x1 ) / x1   A ( x2 ) / x2  .........   A ( xn ) / xn

Then the extension principle states that the image of fuzzy set A under the mapping f ( . )

can be expressed as a fuzzy set B,

B  f ( A)   A ( x1 ) / y1   A ( x2 ) / y2  .........   A ( xn ) / yn

W here y2 = f( xi ), i =1,…,n. In other words, the fuzzy set B can be defined through the

values of f ( . ) in x1 ,………… xn .
Ex :-
Application of the extension principle to fuzzy sets with discrete universes
Let A = 0.1/ -2 + 0.4 / -1 +0.8/0 + 0.9 / 1 +0.3 /2
And f(x) = x 2 -3

Upon applying the extension principle, we have


B= 0.1/1 + 0.4/ -2 + 0.8/ -3 + 0.9/-2 + 0.3/1
= 0.8/ -3 + (0.4  0.9)/ -2 +(0.1  0.3)/1
= 0.8/ -3 +0.9/-2+0.3/1

Where  represents max

Fuzzy relations:-

Binary fuzzy relations are fuzzy sets in XxY which map element in XxY to a
membership grade between 0 and 1.
In particular, unary fuzzy relations are fuzzy sets with one –dimensional MFs and so on.
Applications of fuzzy relations include areas such as fuzzy control and decision making.

Binary fuzzy relation:

Let X and Y be the two universes of discourse. Then

R ={((x,y),  R (x,y)) │(x,y)  XxY}


Is a binary relation in XxY.

Ex :-
Let X= Y = R + (the positive real line) and R = “Y is much greater than X”. The MF of
the fuzzy relation R can be subjectively defined as
 yx
,yx
 R (x, y) =  x  y  2
 yx
 0,

If x = { 3, 4, 5} and y = {3, 4,5,6, 7}, then it is convenient to express the


fuzzy relation R as a Relation matrix:

0 0.111 0.2 0.273 0.333


R  0 0 0.091 0.167 0.231
0 0 0 0.077 0.143

Where the elements at row i and column j is equal to the membership grade between
i th element of x and j th element of y.

Max- Min composition :

Let R1 and R2 be two fuzzy relations defined on XxY and YxZ respectively. The Max-

Min composition of R1 and R2 is a fuzzy set defined by


max min

R R1 2
= [ R1 ( x, y) , R2 ( y, z ) ]
y

=  yy [ R1 ( x, y )  R2 ( y, z ) ]

Where  and  represent max and min, respectively


Or
R1  R2  {[( x, z ), max y min( R1 ( x, y), R2 ( y, z))] | x  X , y Y , z  Z}

When R1 and R2 are expressed as relation matrices, the calculation of R1  R2 is almost


the same as the matrix multiplication, except that X and + replaced by  and 
respectively. For this reason, max-min composition is also called the max-min product.
Max-product composition: It is defined as follows:

R  R ( x, z)  max y [R ( x, y) R ( y, z)]


1 2 1 2

Max-Min and max-product composition

Let R1 = “x is relevant to y”

R2 = “y is relevant to z”
Be two fuzzy relations defined on X xY and Yx Z, respectively , where X = { 1,2,3} , Y
= { ,  ,  ,  } , and Z = {a, b}. Assume that R1 and R2 can be expressed as the following
relation matrices:
 0.1 0.3 0.5 0.7 
R1  0.4 0.2 0.8 0.9 
0.6 0.8 0.3 0.2 

 0.9 0.1
 0.2 0.3
R2  
 0.5 0.6 
 
0.7 0.2 

Now we want to find R1  R2 , which can be interpreted as a derived fuzzy relation “x is

relevant to z” based on R1 and R2 . For simplicity suppose that we are only interested in
the degree of relevance between 2 (  X) and a (  Z). If we adopt max- min composition,
then

 R  R (2, a) =max ( 0.40.9,0.20.2,0.80.5,0.90.7


1 2

= max (0.4, 0.2, 0.5, 0.7)


= 0.7

On the other hand if we choose the max- product composition we have :


R R (2, a)  max(0.4  0.9,0.2  0.2,0.8  0.5,0.9  0.7)
1 2

=max (0.36, 0.04, 0.40, 0.63)


= 0.63

This figure shows that the relation between element 2 in X and element a in Z is built up
via 4 possible paths connecting these two elements.

The degree of relevance between 2 and a is the maximum of these 4 paths, while each
path’s strength is the minimum (or product) of the strengths of its consistent links.

Linguistic Variables:

These are used to describe information in qualitative terms when we are unable to
qualify the information.
If age is interpreted as a linguistic variable, then its term set T (age) could be

T (age) = (young ,not young ,very young, middle aged ,not middle aged ,….old , not old
, very old ,more or less old, ……….)
where each term in T(age) is characterized by a fuzzy set of a universe of discourses X
= [0,100]. Usually we use “age is young” to denote the assignment of the linguistic value
“young” to the linguistic variable “age”.
From the above example we can see that the term set of several primary terms (young,
middle, aged, old) modified by the negation (“not”) and /or the hedges (very ,more or
less, quite, extremely, and so forth),, and then linked by connectives such as and, or,
either and neither, We treat the connectives, the hedges, and the negation as operators
that change the meaning of operands in a specified ,context independent fashion.

The figure below displays some of the typical membership functions of primary terms
and their hedges associated with linguistic variable “age”.

Concentration and Dilation:

Let A be a linguistic value characterized by a fuzzy set with membership function  A (.) ,

then AK is interpreted as a modified version of the original linguistic value expressed as


AK   [  A ( x)]k / x
X

In particular, the operation of concentration is defined as

CON (A) = A2

While that of dilation is expressed by

DIL (A) = A0.5


Note that CON (A) and DIL (A) are the results of applying hedges : “very” and “ more
or less”, to the linguistic term A.

Fuzzy If –Then Rules:

A fuzzy if-then rule (also known as fuzzy rule, fuzzy implication or fuzzy conditional
statement) assumes the form :
If x is A then y is B
Where A and B are linguistic values defined by fuzzy sets on universes of discourse X
and Y respectively. Often “x is A ” is called the antecedent and “y is B” is called the
consequence (or consequent).
Ex :- Some fuzzy rules
- If pressure is high, then volume is small
- If road is slippery, then driving is dangerous.
- If tomato is red, then it is ripe.
- If the speed is high, then apply the brake a little.
-
Fuzzy reasoning:

The basic rule of inference in traditional two-valued logic is modus ponens, according to
which we can infer the truth of a proposition B from the truth of A and the implication
AB. That is
Premise (fact): x is A
Premise 2 (rule): if x is A then y is B
Consequent: y is B

Assume that A  B is expressed as a fuzzy relation R on X  Y .


Then B = A  R  A  ( A  B)  B( y)  Vx ( A( x)R( x, y))

= proj y G; where G  AR .

Approximate reasoning:

Suppose A' is close to A and B ' is close to B. then we have

Premise 1 (fact) : x is A'


Premise 2 (rule) : if x is A then y is B
Consequent: y is B '
Then B'  ( A'  R' )  A'  ( A  B)
Single rule with multiple antecedents
Premise 1 (fact): x is A' and y is B '
Premise 2 (rule): if x is A and y is B then z =C
Consequent Z is C '
C '  ( A'  B ' )  ( A  B  C )
Accordingly
C ' ( Z )  Vx , y [  A' ( x) B' ( y )][  A ( x) B ( y ) C ( z )]
 Vx , y {[  A' ( x) B' ( y ) A ( x)  B ( y )]}C ( z )
 {Vx [  A' ( x) A ( x)]}{[VY  B' ( y )  B ( y )]}C ( z )
 ( w1w2 )C ( z )
 Firing strength
Multiple rules with multiple antecedents:

premise1( fact ) : If x is A' and y is B '


premise2(rule1) : If x is A1 and y is B1 then z is C1
premise3(rule2) : If x is A2 and y is B2 then z is C2
consequent : z is C '

C '  ( A'  B ' )  ( R1  R2 )


 [( A'  B ' )  R1 ]  [ A'  B ' )  R2
 C1'  C2'

The graphical representation of the above equation is shown in figure


Fuzzy models:

A fuzzy inference system is known by other names ,such as fuzzy –rule based system
,fuzzy model , fuzzy associative memory, and simply fuzzy system. The basic structure
of a fuzzy inference system consists of a three conceptual components : a rule base,
which contains a selection of fuzzy rules; a database which defines the membership
functions used in the fuzzy rules; and a reasoning mechanism, which performs the
inference procedure upon the rules and given facts to derive a reasonable output or
conclusion. A fuzzy inference system implements a nonlinear mapping from its input
space to output space. This mapping is accomplished by a number of if-then rules, each
of which describes the local behavior of the mapping. In particular, the antecedent
defines a fuzzy region in the input space, while the consequent specifies the output in the
fuzzy region. We need a method of defuzzification to extract a crisp value that best
representations the fuzzy set of the out put. The following block diagram shows a fuzzy
inference system.

The aggregator combines the fuzzy rules in the rule base to yield fuzzy output, which is
converted into a crisp output by a defuzzifier.

Mamdani fuzzy model:

The Mamdani fuzzy interference system uses min and max for T-norm and T-conorm
operators, respectively. The rules in this system are of the form:
If x is A1 and y is B1 then z is C1

If x is A2 and y is B2 then z is C2
These figures illustrate how to obtain the crisp output of the above rules using max-min
composition.

Ex:-
If x is small and y is small then z is negative large
If x is large and y is small then z is positive small
The crisp output is obtained as the centroid of area , COA of Z.

 F ( z ) zdz
ZCOA = z
where  F ( z ) is the aggregated output MF , i.e., C ' .

z
F ( z )dz

" F " is the fuzzy set of universe of discourse Z.

Derivation:

The fuzzy relation Ri is given by the Cartesian product

Ri  Ai  Bi  Ci
 Ai ( x)  Bi ( y)  Ci ( z )

 Ai ( x)  Bi ( y)  Ci ( z)
2
R   Ri (As there are only two variables)
i 1

 i Ri  i21[ Ai ( x)  Bi ( y)  Ci ( z)]

Let A and B be the given input fuzzy sets. The fuzzy output F ( z ) is obtained by
extending the max-min rule of inference to the case of two inputs by aggregating the
rules.
F ( z)  ( A( x), B( y))  R

  x, y [ A( x)  B( y)  R( x, y, z)]

2 
  x , y  A( x)  B( y)  Ri ( x, y, z ) 
 i 1 
2
 [ x , y A( x)  B( y )  Ai ( x)  Bi ( y )  Ci ( z )]
i 1

2
 [ x { A( x)  Ai ( x)}]  [ y {B( y)  Bi ( y)}]  Ci ( z )
i 1

2
  Poss[ Ai | A]  Poss[ Bi | B]  Ci ( z )
i 1

2
  i  Ci ( z )
i 1

(  is for max,  is for min and replace min by product for max product case)
where  i is the degree of firing or firing strength of the ith rule. The crisp output is
obtained from

 z
z
F ( z )dz
z COA =
 z
F ( z )dz

where  F ( z ) is the membership function of fuzzy set F ( z ) . The above formulation can
be extended to any number of inputs and rules.
Takagi-Sugeno (TS) model

A typical fuzzy rule in a TS fuzzy model has the form:

If x is A and y is B then z=f(x,y)

where A and B are fuzzy sets in the antecedent, while z= f(x,y) is a crisp function in the
consequent. Usually f(x,y) is a polynomial in the input variables x and y, but it can be any
function as long as it can appropriately describe the output of model within the fuzzy
region specified by the antecedent of the rule. When f(x,y) is the first order polynomial,
the resulting fuzzy inference system is called first order TS fuzzy model. When f is
constant, we then have a zero order TS fuzzy model, which can be viewed as a special
case of the Mamdani fuzzy inference system, in which case the rule's consequent is
specified by fuzzy singleton ( or a pre - defuzzified consequent).
The following figure shows the fuzzy reasoning procedure for a first order TS fuzzy
model for two rules:
Min or product:
If x is A1 and y is B1,then z1  p1 x  q1 y  r1
If x is A2 and y is B2, then z 2  p2 x  q2 y  r2
The weighted average is given by:
w1 z1  w2 z 2
z
w1  w2
Each of the linear functions in the rule consequents can be regarded as a linear model
with crisp inputs x and y, crisp output zi and parameters pi, qi and ri. The crisp output
z inferred by the TS fuzzy model is defined by the weighted average of crisp outputs
zi of individual linear subsystems:
2 2

 i z i  i ( pi x  qi y  ri )
z i 1
2
= i 1
2

 i
i 1

i 1
i
Where  i is the degree of firing (DOF) of the ith rule for the crisp inputs, given by:

 i  Ai ( x)  Bi ( y)

Geometrically, the rules of TS fuzzy model correspond to an approximation of


mapping XY  Z by a piecewise linear function. Here Ai  X and Bi  Y .In
a more general setting the linear functions in the consequents of the rules can be
replaced by non linear ones.

You might also like