You are on page 1of 4

SYS735 Intelligent Control Systems KaCC

FUZZY INFERENCE SYSTEMS – MAMDANI METHOD


FUZZY RULES

“If-Then” rules are the most commonly used fuzzy logic statements. A single antecedent-single
consequence (one input – one output) “If-Then” rules has the form:
Rule1. If x is A1 then y is B1
Rule2. If x is A2 then y is B2
Rule3. If x is A3 then y is B3

Antecedent Consequent
Compounded-antecedent-single consequence (2 input – 1 output) rules take the form
Rule1. If x is A1 and/or y is B1 then z is C1
Rule2. If x is A2 and/or y is B2 then z is C2
Rule3. If x is A3 and/or y is B3 then z is C3

Antecedent Consequent
The inference steps for interpreting these rules can be illustrated as

2. Fuzzy 3. Implication
operation
µ A1 ( x) µB1 ( y ) µC1 ( z )
1 1
1
A1 B1 C1
and/or
0 0
0 z
x y
µC 2 ( z )
µA2 ( x) µB2 ( y ) 1
1 1
C2
A2 and/or B2
0
0 0 z
x y
1 µC3 ( z)
1 µA3 ( x ) 1 µB3 ( y) C3
A3 and/or B3
0
0 z
0
x y 4. Aggregation

1. 1.Fuzzification µC Aggregrate ( z)
1
x0 y0
CAgregate
0
z
5. Defuzzification
FL2 - Mamdani Fuzzy Inference System 1 z0 3-Feb-01
SYS735 Intelligent Control Systems KaCC

1. FUZZIFICATION
Convert numerical values (such as x = x0 , y = y0 ) on numeric scales (x & y axes) into membership
values; e.g., µ A1 ( xo ), µA2 (x o ), µ A3 ( x o), µB 1( yo ), µB 2 ( yo ), µB 3 ( yo )

2. FUZZY OPERATION IN ANTECEDENTS (Strength of Antecedents)


Let’s suppose currently that x = x0 and y = y0 . We can evaluate the antecedents of
Rule1. If x is A1 and y is B1 then z is C1
Rule2. If x is A2 and y is B2 then z is C2
Rule3. If x is A3 and y is B3 then z is C3

as
µAi ( x0 ) and µBi ( y0 ) i = 1, 2, 3
where the fuzzy operation for “AND” discussed earlier can be applied. This gives us the strength of the
antecedents,
(
si ( x0 ) = min µ Ai ( x0 ), µ Bi ( y0 ) ) or si ( x0 ) = µA i (x0 ) * µ Bi ( y0 )

Similarly, if the antecedents require “OR” operation, say


If x is Ai or y is Bi then z is Ci

Then the strength of the antecedents becomes

(
si ( x0 ) = max µ Ai ( x0 ), µ Bi ( y0 ) ) or si ( x0 ) = µ Ai (x0 ) + µ Bi (y0 ) −µ Ai (x0 ) *µ Bi (y0 )

3. IMPLICATION OF EACH RULE (Mamdani’s method)

Each rule will contribute to the fuzzy consequence as follows:

(
Di ( z ) = min si ( x0 ), µCi ( z ) ) or Di ( z ) = si ( x0 ) * µCi ( z )

The resultant consequence Di ( z ) of each rule is a modified function of the membership Ci (z ) .

4. AGGREGATION OF IMPLIED CONSEQUENCES FROM EACH RULE


(Combined Strength of All Rules)

Aggregation of implied consequences from the individual rules can be evaluated using any of these
methods:
C Aggregate ( z) = max ( D1 ( z), D2 ( z ), D 3 (z ) )
C Aggregate ( z) = sum ( D1 ( z ), D 2 ( z), D3 ( z ) ) = D1( z) + D2 ( z ) + D3 ( z)
C Aggregate ( z) = probor ( D1( z), D2 ( z), D3 (z ) )

5. DEFUZZIFICATION
Defuzzification translates the C Aggregate (z ) function to a crisp output value z0 . One may use any suitable
method. Centroid, Bisector, Max, etc.

FL2 - Mamdani Fuzzy Inference System 2 3-Feb-01


SYS735 Intelligent Control Systems KaCC

SUMMARY OF MATH OPERATIONS FOR THE ABOVE THREE RULE FUZZY


LOGIC

1. Fuzzification. Given x = x0 and y = y0 , determine

µ A1 ( x0 ), µ A2 ( x0 ), µ A3 ( x0 ), µ B1( y0), µ B2 ( y0), µ B3 ( y0 ),

2. Strength. Compute the strength of each antecedent

For AND using MIN For OR using MAX


(
s1( x0 ) = min µ A1 ( x0 ), µB1 ( y0 )) (
s1( x0 ) = max µ A1 ( x0 ), µB1 ( y0 ))
s2 ( x0 ) = min ( µ A ( x0 ), µB ( y0 ) )
2 2
s2 ( x0 ) = max ( µ A ( x0 ), µB ( y0 ) )
2 2

s3 ( x0 ) = min ( µA ( x0 ), µB ( y0 ) )
3 3
s3 ( x0 ) = max ( µA ( x0 ), µB ( y0 ) )
3 3

For AND using PRODUCT For OR using PROBOR


s1( x0 ) = µ A1 (x0 ) * µB1 ( y0 ) s1( x0 ) = µ A1 (x0 ) + µ B1 (y 0 ) −µ A
1
(x 0 ) *µ B1 (y 0 )
s2 ( x0 ) = µ A2 (x0 ) * µB2 ( y0 ) s2 ( x0 ) = µ A2 (x0 ) + µ B2 (y0 ) −µA2 (x0 ) * µB2 ( y0 )
s3 ( x0 ) = µA3 (x0 ) * µB3 ( y0 ) s3 ( x0 ) = µA3 (x0 ) + µB3 (y0 ) −µA3 (x0 ) * µB3 (y0 )

3. Implication. Compute the implication/contribution of each rule

For IMPLICATION using MIN


For IMPLICATION using PROD
(
D1 ( z ) = min s1( x0 ), µC1 ( z ) ) D1 ( z ) = s1( x0 ) * µC1 ( z )
D2 ( z ) = min ( s 2 ( x0 ), µC ( z ) )
2
D2 ( z ) = s2 ( x0 ) * µC 2 ( z )

D3 ( z ) = min ( s3 ( x0 ), µC ( z ) )
3
D3 ( z ) = s3 ( x0 ) * µC3 ( z)

4. Aggregation. Compute the total contribution of all the rules

For AGGREGATION using MAX For AGGREGATION using SUM


C Agg ( z) = max ( D1( z), D2 ( z ), D 3 (z ) ) C Agg ( z) = D1 ( z ) + D2 ( z ) + D3 ( z )

5. Defuzzification. Compute a crisp output value from the aggregated contribution

For DEFUZZIFICATION using CENTROID


For DEFUZZIFICATION using BISECTOR
z0 =
∫ z×C Agg ( z )dz
=
∑ z ×C i Agg ( zi )
(
z0 = median z× C Agg ( z ) )
∫C Agg ( z ) dz ∑C Agg ( zi )

For DEFUZZIFICATION using MAX


(
C AggMax , iMax  = max C Agg (z )
  )
z0 = z (iMax )

FL2 - Mamdani Fuzzy Inference System 3 3-Feb-01


SYS735 Intelligent Control Systems KaCC

FUZZY LOGIC WITH SINGLETON CONSEQUENCE.


Singletons are simple pole -like shape that represents the membership functions for the outputs.
The result is a straightforward centroid calculation for the defuzzification. For example:

Rule1. If x is A1 and y is B1 then z is C1.


Rule2. If x is A2 or y is B2 then z is C2.

2. Fuzzy 3. Implication
operation
µ A1 ( x) µB1 ( y ) µC1 ( z )
1 AND 1 1
A1 B1 C1
(MIN)
0 0 0 s1
x z
y z1
µA2 ( x) µC 2 ( z )
1 1 µB2 ( y ) 1 C2
OR
(MAX) B2 s2
A2
0 0 0
x y z
z2
1.Fuzzificati
x0 y0

1
4. Aggregation
s1 = min( µ A1 ( x0 ), µ B1 ( y0 )) s2
µCAggregrate ( z ) = s1 @ z1 + s2@ z2 0
s2 = max( µ A2 ( x0 ), µB2 ( y0 )) s1 z

s1z1 + s2 z2
z0 =
5. Defuzzification s1 + s2

Now if we equate AND with PRODUCT, and OR with PROBALISTIC OR, then we can write the fuzzy
inference as
s1 = µA1 ( x0) * µ B1 ( y0)
s2 = µ A2 ( x0 ) + µ B2 ( y0 ) −µ A2 (x0 ) *µ B2 ( y0 )
s1 z1 + s2 z 2
z0 =
s1 + s2

The calculation is indeed very straightforward.

FL2 - Mamdani Fuzzy Inference System 4 3-Feb-01

You might also like