Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
60 views

Unit IV Soft Computing

The document discusses membership functions and fuzzy logic rules. It begins by defining membership functions as mapping elements of a universe of discourse to degrees of membership between 0 and 1. It describes key features of membership functions including core, support, boundary, and crossover points. It then discusses different types of fuzzy sets such as normal, subnormal, and convex sets. The document also covers fuzzy logic connectives like negation, disjunction, conjunction and implication. Finally, it provides an example of defining fuzzy logic rules using IF-THEN statements and calculating the membership function of the implied fuzzy set.

Uploaded by

Anas Siddiqui
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

Unit IV Soft Computing

The document discusses membership functions and fuzzy logic rules. It begins by defining membership functions as mapping elements of a universe of discourse to degrees of membership between 0 and 1. It describes key features of membership functions including core, support, boundary, and crossover points. It then discusses different types of fuzzy sets such as normal, subnormal, and convex sets. The document also covers fuzzy logic connectives like negation, disjunction, conjunction and implication. Finally, it provides an example of defining fuzzy logic rules using IF-THEN statements and calculating the membership function of the implied fuzzy set.

Uploaded by

Anas Siddiqui
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

UNIT IV (Fuzzy Membership, Rules)

Lecture #1 Membership Function


A membership function defines fuzziness in the fuzzy set. It may be discrete or continuous. The
membership function is generally represented graphical form. Standard shapes of membership
functions are maintained over the years. Fuzzy membership functions are determined in practical
problems with opinion of experts.

As we know, a fuzzy set à in the universe of discourse X can be as

= {(x, µÃ(x)): x Є Ã}

Where, µÃ(x) is called membership function. The membership function, µÃ(x) maps
X on the interval [ ]

µÃ(x): X [ ]
The range of the membership function is subset of the non – negative real numbers whose
supremum is finite.

Features of the membership function


Three main basic features of membership function are as shown in figure 1 a

Figure 1 a Feature of membership function


1 CORE The core of a membership function for some fuzzy set ̃ is defined as that region of
the universe that is characterized by complete and full membership in the set ̃ . That is, the core
comprises those elements x of the universe X
such that (x) = 1
2 Support .The support of a membership function for some fuzzy set ̌ is defined as that
region of the universe that is characterized by nonzero membership in the set ̌ . That is, the
support comprises those elements x of the universe X
such that (x) > 0.
3. Boundary. The boundaries of a membership function for some fuzzy set Aare defined as
that region of the universe containing elements that have a nonzero membership but not complete
membership
0< (x) < 0.

4. Normal and Subnormal Fuzzy Sets

A normal fuzzy set is one whose membership function has at least one element x in X the
universe whose membership value is unity. Otherwise it will be subnormal fuzzy set as shown in
figure 1(b) and figure 1(c).

Figure 1(b) Normal Fuzzy set Figure 1(c) Subnormal Fuzzy set

Convex fuzzy set


A convex fuzzy set is described by a membership function whose membership values are strictly
monotonically increasing, or strictly monotonically decreasing, or strictly monotonically
increasing then strictly monotonically decreasing with increasing values for elements in the
universe.
(Said another way, if, for any elements x, y, and z in a fuzzy set A, the relation x < y <z implies
that
µ (y) = min⌊µ ( ), µ ( )⌋
Otherwise set will be non-convex fuzzy set as shown in figure 1(d) and figure 1(e).

Figure 1 (d) convex fuzzy set Figure 1 (e) Norn – convex fuzzy set

Crossover Point
The crossover points of a membership function are defined as the elements in the universe X for
which a particular fuzzy set ̃ has values equal to 0.5, i.e., for which
(x) = 0.5.

Height of a Fuzzy Set

The height of a fuzzy set ̃ is the maximum value of the membership function, i.e.,
height ( ̃ ) = max ( (x))
For subnormal fuzzy set height ( ̃ ) <1
Lecture # 2 Inferences in Fuzzy Logic, Fuzzy IF-THEN
Rules
In crisp logic, the truth values acquired by proposition or predicate are 2-valued, namely True,
False which may be treated numerically equivalent to (0, 1). However, in fuzzy logic, the truth
values are multivalued such as absolutely true, very true, partly true, absolutely false and so on
numerically equivalent to (0-1).
Fuzzy Propositions

A fuzzy proposition is a statement which acquires a fuzzy truth value. Thus, given to be fuzzy
proposition, T ( ) represents the truth value (0-1) attached to . In its simplest form, fuzzy
propositions are associated with fuzzy sets. The fuzzy membership value associated with the
fuzzy set à for P is treated as the fuzzy truth value T ( ).

i.e. T ( ) =µÃ (x) where 0≤ µ ̃ (x) ≤1


Example

: Ram is honest.
T ( ) = 0.8 if P is partly true
T ( ) = 1 if P is absolutely true
Fuzzy Connectives

Fuzzy logic, similar to crisp logic, support following connectives;


(i) Negation ; -
(ii) Disjunction; v
(iii) Conjunction; ^
(iv) Implication; =>
Let and are two fuzzy propositions with relative truth values are T (P) and T (Q) then connectives
can be defined as

Symbol Connective Usage Definition

- Negation 1-T( )

V Disjunction max(T( ), T( ))

^ Conjunction min(T( ), T( ))

=> Implication => Max(1-T( ), T( ))


and are related by ‘=>’ operator are known as antecedent and consequent
respectively. Also, just as in crisp logic, here too, ‘=>’ represent the IF – THEN statement
as
IF x is THEN y is , and is equivalent to
=( × )∪( ×Y) ~

The membership function of is given by

Also for compound implication IF x is A THEN y is B ELSE y is C the relation R is equivalent


to

= =( × )∪( × )
The membership function of R is given by

µ (x, y) =max (min (µ (x), µ (y)), min (1-µ (x), µ (y)))

Example
: Mary is efficient, T ( )) =0.8
: Ram is efficient, T ( ) =0.65

(i) : =Mary is not efficient.


T( ) =1-T ( ) = 1-0.8 =0.2

(ii) ⋀ : Mary is efficient and so is Ram


T( ⋀ ) = min (T ( ), T ( )) = min (0.8, 0.65) = 0.65

(iii) V : Either Mary or Ram is efficient


T ( V ) = max (T ( ), T ( )) = (0.8, 0.65) = 0.8
(iv) => : If Marry is efficient then so Ram is
T ( => ) =max ((1-T ( ), T ( )) =max (0.2, 0.65) =0.65

Example (To understand IF-THEN rule)

Let X= {a, b, c, d}, Y= {1, 2, 3, 4}


and = {(a, 0) (b, 0.8) (c, 0.6) (d, 1)}
= {(1, 0.2) (2, 1) (3, 0.8) (4, 0)}
̃ = {(1, 0) (2, 0.4) (3, 1) (4, 0.8)}

Determine the implication relations


(i) IF x is THEN y is
(ii) IF x is THEN y is ELSE y is

Solution

To determine Part (i)

Compute =( × )∪( ×Y) where


The membership function of is given by
µ (x, y) =max (min (µ (x), µ (y)), 1-µ (x))
where µR(x, y) =max (min (µA(x), µB(y)), 1-µA(x))

1 2 3 4

a 0 0 0 0
× = b 0.2 0.8 0.8 0
c 0.2 06 0.6 0
d 0.2 1 0.8 0
1 2 3 4
and × Y=a 1 1 1 1
b 0.2 0.2 0.2 0.2
c 0.4 0.4 0.4 0.4 1 2 3 4
d 0 0 0 0
a 0 0.4 1 0.8
Here Y is Universe of discourse could be
b 0 0.2 0.2 0.2
viewed as {(1, 1)(2,1)(3,1)(4,1)} a fuzzy set c 0 0.4 0.4 0.4
of all whose elements x have µ(x)=1. × = d 0 0 0 0

Therefore =max (( × )∪( ×Y)


1 2 3 4
= a 1 1 1 1
b 0.2 0.8 0.8 0.2 Therefore = max (( × ), ( × ))
c 0.4 0.6 0.6 0.6 gives
d 0 0 0 0
1 2 3 4
= a 0 0.4 1 0.8
Which represents IF x is ̃ THEN y is
b 0.2 0.8 0.8 0.2
c 0.2 0.6 0.6 0.4
To determine Part II
d 0.2 1 0 0
Compute Also for compound implication IF
The above relation represents IF x is ̃ is Then
x is THEN y is ELSE y is the
y is ELSE y is ̃
relation is equivalent to

=( × )∪( × )
The membership function of R is given by

µ (x, y) =max (min (µ (x), µ (y)), min

((1-µ (x), µ (y)))

1 2 3 4

a 0 0 0 0
b 0.2 0.8 0.8 0
× = c 0.2 06 0.6 0
d 0.2 1 0.8 0
Fuzzy Quantifiers (Not Important from Examination point
of View –for Knowledge You may skip this topic)
Just as in crisp logic where predicates are
quantified by quantifiers, fuzzy logic It can be converted to simplest form

propositions are also quantified by fuzzy


P’: There are Q Z’s in I
quantifiers. The scope fuzzy propositions can
Z is a fuzzy set defined as follows
be extended using fuzzy quantifier. There are
Z is a fuzzy set defined as follows:
two classes of fuzzy quantifiers such as
z (i) F (V (i)) iI
(i) Absolute quantifiers
• Thus, the former proposition is replaced with:
(ii) Relative quantifiers. “There are about 10 high-fluency English
speaking students in a given class”
While absolute quantifiers are defined over R To calculate the truth value of p’ we need to
(Set of real numbers) calculate the cardinality of fuzzy set Z
Example “about to 10, much more than
100, at least about 5” • The cardinality of Z can be calculated as

Relative quantifiers are defined over [0-1].


Ex. “Almost All”, “About Half”, “most”
follows: |Z|=Σi€IµZ(i)= Σi€IµFV(i))
Propositions involved in absolute quantifier:
• Then, we calculate the truth value T (p’)
P; There Q I’s in I such that V (i) in F
- Q is an absolute quantifier T(p’)=µofQ(|Z|)
using the membership function Q

-i am an individual from a given set I


V (i) is a variable associated to individual I
that take value from universe E.
F is a fuzzy set defined over universe E.
Example “There are about 3 students in I
Ex. “There is about 10 students in a given whose fluency in English V (i) is high”
class whose fluency in English V (i) is high’, • I = {Adam, Bob, Cathy, David, Eve}
Q=”about 10” I’s student I class, V(i) • V = Degree of fluency in English
Fluency in English of student I F is a fuzzy set – V(Adam)= 35, V(Bob)=20,
that represents a high degree of fluency in V(Cathy)=80, V(David)=99,
V(Eve)=70
English.
Type #1 fuzzy quantifiers may also appear in
more complex propositions:
p: There are Q i’s in I such that V1 (i) is F1
and
V2 (i) is F2
• Example:
“There are at least about two students in the
class whose fluency in English is high and
are young”
Alternative format for propositions of the
former type:
p’: There is Q Y in I,
Y = T-norm (ìF1 (V1 (i)), ìF2 (V2 (i)))
• Example:
p’: “There are at least about two high-fluency
English-speaking and young students in the
class”
• Obviously Y is the set of “English-speaking
and young students”
Exercise (Homework)
• Calculate the truth value of the proposition:
“There are at least about 3 students in the It is also possible to have propositions
involving relative quantifiers:
class whose fluency in English is high and
p: Among i’s in I such that V1 (i) is F1 there
are young” are Q i’s
in I such that V2 (i) is F2
• Use the data in slide #7 (students) for: I, V
• Example:
(i), ìQ and ìF “Among students in a given class that are
young, there are almost all whose fluency in
• Use the following T-norm: T(x, y) = min(x,
English is high”
y) This kind of propositions can be rewritten as:
p’: Q Y’s are Z’s
• The ages for the different students are: –
Y = ìF1 (VF1 (i)), Z = ìF2 (VF2 (i))
Age(Adam)=23, Age(Bob)=35, • Example:
“Almost all young students in a given class
Age(Cathy)=46, Age(David)=54,
are students whose fluency in English is high”
Age(Eve)=25 • How do we calculate the truth value of such
propositions?
Exercise (Homework) We can rewrite p’ as p’’: W is Q
• Calculate the truth value of the proposition:
“There are at least about 3 students in the • W is the degree of subsethood of Y in Z
class whose fluency in English is high and are
– How do we calculate W?
young”
• Use the data in slide #7 (students) for: I, V
(i), ìQ and ìF –
• Use the following T-norm: T(x, y) = min(x,
y) Once we have obtained W, we can easily calculate
• The ages for the different students are: T (p)
– Age(Adam)=23, Age(Bob)=35,
Age(Cathy)=46,– Age(David)=54,
Age(Eve)=25 –
Lecture #3 Fuzzy Inferences
Fuzzy inference also referred to as approximate reasoning refers to computational procedures
used for evaluating linguistic descriptions. The two important inferring procedures are

(i) GMP (Generalized Modes Ponens


(ii) GMT(Generalized Modes Tollens)

GMP is formally stated as,


IF x is THEN y is

Here , ’, ‘are fuzzy terms. Every fuzzy linguistic statement above the line is
analytically known and what is below is analytically unknown.

To compute the membership function of ’ the max-min composition of fuzzy set ’


with (x, y) which is the known implication relation (IF-THEN) is used. That is,

’= ’o (x, y)

In term of membership function

µ ′ (y) =max (min (µ ′ (x), µ (x, y)))

Where µ ′ (x) is the membership function of ̃ ’ µ (x, y) is the membership function of the
implication relation and µ ′ (y) is the membership function of ’
On the other hand, GMT has the form

IF x is ̃ THEN y is


̃′
To compute the membership function of ’ the max-min composition of fuzzy set ’
with (x, y) which is the known implication relation (IF-THEN) is used. That is,

’= ’o (x, y)

In term of membership function

µ ’(x) =max (min (µ ’(y), µ (x, y)))

Where µ ′ (x) is the membership function of ’ µ (x, y) is the membership function of


the implication relation and µ ′ (y) is the membership function of ’

µ ′ (x) =max (min (µ ′ (y), µ (x, y)))

Solved Example on Fuzzy Inference

Apply the fuzzy Modes Ponens rule to deduce Rotation is quite slow

(i) If the temperature is high then rotation is slow.


(ii) The temperature is very high
Let (High), H (Very High) ̃(Slow) and S (Quite Slow) indicate the associated fuzzy sets as
follows
For X= {30, 40, 50, 60, 70, 80, 90, 100}, the set of temperatures and Y= {10, 20, 30, 40, 50, 60}
the set of rotations per minute
= {(70, 1) (80, 1) (90, 0.3)}
H = {(90, 0.9) (100, 1)}
S = {(10, 1) (20, 0.8)}
̃= ((30, 0.8) (40, 1) (50, 0.6)}

To derive (x, y) representing the implication relation (i), we need to compute

(x, y) =max ( × , ×Y)


10 20 30 40 50 60

30 0 0 0 0 0 0
40 0 0 0 0 0 0
×̃ = 50 0 0 0 0 0 0
60 0 0 0 0 0 0
70 0 0 0.8 1 0.6 0
80 0 0 0.8 1 0.6 0
90 0 0 0.3 0.3 0.3
100 0 0 0 0 0 0

10 20 30 40 50 60

30 1 1 1 1 1 1
×Y= 40 1 1 1 1 1 1
50 1 1 1 1 1 1
60 1 1 1 1 1 1
70 0 0 0 0 0 0
80 0 0 0 0 0 0
90 0.7 0.7 0.7 0.7 0.7 0.7
100 1 1 1 1 1 1

10 20 30 40 50 60

30 1 1 1 1 1 1
40 1 1 1 1 1 1
50 1 1 1 1 1 1
60 1 1 1 1 1 1
(x, y) =max ( × ̃, ×Y) = 70 0 0 0.8 1 0.6 0
80 0 0 0.8 1 0.6 0
90 0.7 0.7 0.7 0.7 0.7 0.7
100 1 1 1 1 1 1

To deduce Rotation is quite slow we make use of the composition

S = o (x, y) (set has membership vales for elements 90, and 100 only that 0.9 and 1
respectively. Membership values for remaining elements are 0)
= [0 0 0 0 0 0 0.9 1] × (x, y) = [1 1 1 1 1 1]
NOTE: (Apply max-min composition on matrices and (x, y))
Lecture # 4 Fuzzification & Defuzzification

Fuzzy Rule Based Systems

Fuzzy linguistic descriptions are formal representations of systems made through fuzzy IF-
THEN rules. They encode knowledge about a system in statement of the form-
IF (a set of conditions) are satisfied THEN (a set of consequent) can be inferred,

Fuzzy IF-then rule is coded in the form


IF(x1 is 1, x2 is 2 …..xn is n) THEN (y1 is 1, y2 is 2….yn is n)

where linguistic variables xi, yj take the values of fuzzy sets ̃ i and j respectively.

Where i, j =1,2, ….,n

Example for fuzzy Rule Base

If there is heavy rain and strong winds


Then there must be severe flood warning.
Here heavy, strong, and severe are fuzzy sets qualifying variables rain, wind, and flood
warning respectively.
A collection of rules referring to a particular system is known as a fuzzy rule base. If the
conclusion C to be drawn from a rule base R is the conjunction of all the individual consequents
Ci of the each rule. Then
C=CI ∩C2 ∩C3…… ∩ Cn

Where µc(y) =min (µc (µc (y1), µc (y2)….. µc (yn)))

∀y∈Y where Y is the universe of discourse.

On the other hand, if the conclusion C to be drawn from a rule base R is the disjunction of the individual
consequents of each rule then
C1∪C2∪C3………………….∪Cn
Where µc(y) =max(c(µc(y1), µc(y2)….. µc (yn))) ∀y∈Y
Fuzzification
Fuzzification is the process of transforming crisp set to a fuzzy set or a fuzzy set to fuzzier set i.
e. crisp quantities converted to fuzzy quantities. This operation translates crisp input values into
linguistic variables. In the real-life world, the quantities may be thought of as crisp, accurate and
deterministic, but actually they are not so. They possess uncertainty within themselves. The
uncertainty may arise due to vagueness, imprecision and ambiguity. In this case the variable is
probably fuzzy and can be represented by a membership function.

For example, when one is told that temperature is 9 C, then person translates the crisp input
value into linguistic variable such as “cold” or “warm” according ones knowledge and then make
a decision about the need to wear jacket. If one fails to fuzzify then it is not possible to take
decision or error decision may be reached.

For a fuzzy set ̃ = { , µ ( ): Є } a common fuzzification algorithm is performed by


keeping µ ( ) constant and being transformed into fuzzy set ( ) depicting the expression
about . The fuzzy set ( ) is kernel of fuzzification.

The fuzzified set ̃ be expressed as

̃ = µ ( ). ( )+ µ ( 2 ). ( 2 ) + ……….+µ ( ). ( ) for I = 1 to n

This Process of fuzzification is called support (s-fuzzification) fuzzification. There is another


method of fuzzification is called g-fuzzification or grade fuzzification. In this method is kept
constant and µ ( ) expressed as a fuzzy set.

Defuzzification-
In many situations, for a system whose output is fuzzy, it is easier to take crisp decision if the
output is represented as a single scalar quantity. This conversion of a fuzzy set to single crisp
value is called defuzification and it the reverse process of fuzzification..
Methods for defuzzification are

(a) Centroid Method


Also known as the centre of gravity or centre of area method, It obtains the centre of area (x*)
occupied by the fuzzy set. The expression for x* is given as
∫ µ(x)xdx
X* = for a continuous membership function,
∫ µ(x)dx

∑ . ( )
and x* = ∑ ( )
for a discrete membership function.

Here n represents the number of elements in the sample, xi“ are the elements, and µ (xi) is its
membership function.

(b)Centre of Sums (COS) Method-


In this method, overlapping area is counted twice whereas in centroid method overlapping area is
counted once. COS builds the resultant membership function by taking the algebraic sum of
outputs from each of the contributing fuzzy sets A1, A2, A3, etc. The defuzzified value x* is
given by

∑ .∑ ( )
X*=
∑ .∑ ( )

Here n is the number of fuzzy sets and N is number of fuzzy variables. COS is actually the most
commonly used defuzzification method. It can be implemented easily and leads to rather fast
inference cycles.

(c) Mean of Maxima (MOM) Defuzzification-


One simple way of defuzzifying the output is to take the crisp value with the highest degree of
membership. In cases with more than one element having the maximum value, the mean value of
the maxima is taken. The equation for defuzzified value x* is given by


X* = Where M= {xi /µ (xi) equal to the height of fuzzy set}
| |

|M| is the cardinality of set M. In the continuous case M, could be defined as


M={x€[c,-c] is equal to the height of fuzzy set}
In such case, the mean of maxima is the arithmetic average of mean value of all intervals
contained in M including o length intervals.
The height of fuzzy set ̃ i.e h ( ̃ ) is the largest membership grade obtained by any element in
the A set.
Example on difuzzification
A 1, A 2, A 3, are three fuzzy sets as shown below in figure 4.1, figure 4.2, and figure 4.3
respectively and aggregate is give in figure 4.4

1.0

µ 0.75

0.5

0.25 0.3

0 1 2 3 4 5 6 7 8
x
Figure 4.1 1

1.0

µ 0.75

0.5 0.5

0.25

0 1 2 3 4 5 6 7 8 x
Figure 4.2 2

1.0 1.0

µ 0.75

0.5

0 1 2 3 4 5 6 7 8 x
Figure 4.3 3
1.0
1.0
µ 0.75

0.5

0.3

0 1 2 3 4 5 6 7 8 x

3.6 5.5

Figure 4.4 Aggregate of fuzzy sets 1, 2, 3

The defuzzification using (1) centroid method (2) COS method and (3) mean of maxima method
is presented below

Centroid Method
To Compute X* the centroid , we view the aggregate fuzzy set as shon in figure. In figure the
aggregate output has been divided into areas for better understanding

1.0
1.0
µ 0.75
7
0.5 4

0.3

5 c 8
2 3 9
1

0 1 2 3 4 5 6 7 8 x

3.6 5.5

Figure 4.5 Aggregated fuzzy sets of 1, 2, 3 viewed as area segments


For computation of x* we use table below

Area segment No AREA (A) A.


1 ×0.3×1 =0.15 0.67 0.1005
2 2.6×0.3 =0.78 2.3 1.794
3 0.3×0.4 = 3.8 3.8 0.456
4 ×0.4×0.2 =0.04 3.8667 0.1546
5 1.5×0.5 = 0.75 4.75 3.5642
6 0.5×0.5 =0.25 5.75 1.4375
7 ×0.5×0.5 =0.125 5.833 0.729
8 1×1 =1 6.5 6.5
9 1/2×1×1 =0.5 7.333 3.665
ΣA=3.715 ΣA. =18.353

Note-Compute area and centroid of each segment separately using mathematical formulae. In
figure 4.5 regions 1, 4, 7 are triangular and remaining are rectangular.
+ + 3
(Centroid for triangular region =

In the table area (A) shows the area of segments of the aggregate fuzzy set and X shows the
corresponding centroid.
Now
∑ . 18.353
X*= ∑
= = 4.9
3.715
Centre of Sums (COS) Method
Here, unlike centroid method the overlapping area is counted not once but twice. Making use of
aggregated fuzzy set shown the centre of sums, x* is given by

1.0
1.0
µ 0.75

0.5

0.3

2 3
1

0 1 2 3 4 5 6 7 8 x
Figure 4.6 –Aggregated fuzzy sets of 1, 2, viewed as area segments overlapping area
counted twice
For computation of x* we use table below

Area segment No AREA (A) A.


1 1 2.5 3.00
×0.3×(3+5)=1.2
2
2 1 5 7.5
×0.5×(4+2)=1.5
2
3 1 6.5 13.0
×2×1×(3+1)=2
2
ΣA=4.7 ΣA. =23.5

ΣA. 23.5
X* = = =5.0
ΣA 4.7

Mean of Maxima (MOM) method

Since the aggregated fuzzy set shown in fig (d) is a continuous set x* the mean of maxima is
computed as x*=6.5.
Here M = {X ∈[6, 7] /µ(x) =1] and the height of the aggregate fuzzy set is 1.
Figure 4.7 below shows the defuzzyfied outputs using above three methods

1.0

µ 0.75

0.5

0.3

0 1 2 3 4 5 6 7 8 x

X*=4.9 Centroid method

X*=5 COS method Xx* x*=6.5 MOM method

Figure 4.7 Defuzzified outputs of the sets of 1, 2, 3


Lecture # 5 Fuzzy Controllers, Industrial Applications –
The working of any fuzzy controller is shown in figure 5.1 below

START CRISP INPUT FUZZIFICATION FUZZY INPUT RULE EVALUATION

END DEFUZZIFICATION
CRISP OUTPUT FUZZY OUTPUT

Figure 5.1 working of fuzzy controllers

Two fuzzy Controllers are

(i) Greg Viot’s Fuzzy Cruise Control System


(ii) Yamakawa,s Air Conditioner Controller
(iii)

Greg Viot, s Fuuzzy Cruise Controller


This controller is used to maintain a vehicle at desired speed. The system consists of two
fuzzy inputs, namely speed difference speed difference and acceleration, one fuzzy output,
namely throttle control as illustrated in figure 5.2

Speed difference
Fuzzy Cruise Control
Throttle Control
Acceleration
Figure 5.2 Fuzzy Cruise Control System

Fuzzy Rule Base

A sample fuzzy rule base R governing the fuzzy cruise Control is as given in table below

Table-1 Fuzzy Rule Base for Cruse Control

Rule 1 If(speed difference is NL) and (acceleration is ZE) then (throttle control is PL)
Rule 2 If(speed difference is ZE) and (acceleration is NL) then (throttle control is PL)

Rule 3 If(speed difference is NM) and (acceleration is ZE) then (throttle control is PL)

Rule 4 If(speed difference is NS) and (acceleration is ZE) then (throttle control is PL)

Rule 5 If(speed difference is PS) and (acceleration is ZE) then (throttle control is PL)
Rule 6 If(speed difference is PL) and (acceleration is ZE) then (throttle control is PL)

Rule 7 If(speed difference is ZE) and (acceleration is ZE) then (throttle control is PL)

Rule 8 If(speed difference is ZE) and (acceleration is ZE) then (throttle control is PL)

Keys
NL – Negative Large NM – Negative Medium, NS - Negative Small, ZE- - Zero
PS – Positive Small, PM - Positive Medium, PL- Positive Large
Fuzzy Sets

The fuzzy sets which characterize the inputs and outputs are as given in figures

NL NM NS ZE PS PM PL
1

Degree of membership

0 31 63 95 127 159 191 223 255

Figure 5.3 Speed difference (Normalized)

NL NM NS ZE PS PM PL
1

Degree of membership

0 31 63 95 127 159 191 223 255

Figure 5.4 Acceleration (Normalized)

NL NM NS ZE PS PM PL
1

Degree of membership

0 31 63 95 127 159 191 223 255

Figure 5.5 Throttle control (Normalized)


Fuzzification of Inputs

For the fuzzification of inputs, that is, to compute the membership for the antecedents, the
formula illustrated in Figure 5.6) is used.
Y
Degree of
membership
MAX

Degree of membership

Slope 1 Slope 2
 Compute
Delta 1=x-point1
and Point 1
X
Delta 2 =point2-x Delta 1 Delta 2 Point 2

Figure 5.6 - Computing of fuzzy membership values

If (Delta 1≤0) or (Delta2≤0)


Then degree of membership = 0
1∗ 1
Else degree of membership=min ∗

Here, x which is the system input has its membership function value computed for all fuzzy sets.
For example, the system input speed difference deal with 7 fuzzy sets, namely NL, NM, NS, ZE,
PS, PM, PL. For a measured value of speed difference x’, the membership function of x, in each
of the seven sets in computed using formula shown in previous figure (l). Let µ̀ 1 , µ̀ 2 , µ̀ 3 , µ̀ 4 ,
µ̀ 5 , µ̀ 6 , µ̀ 7 , , be the seven membership values. Then all values are recorded for the input x’ in
an appropriate data structure.
Similarly, for each of the other system inputs (acceleration in this case), the fuzzy membership
value are recorded.
Example

Let the measured normalized speed difference be 100 and the normalized acceleration is 70, then
the fuzzified inputs after computation of the fuzzy membership values are shown in figure 5.7
below.
Inputs Speed Differnce Acceleration

100 95

0 NL 0 NL
0 NM 0.7813 NM
0.8436 0.2188 NS
0.1563 NSZE 0 ZE
0 PS 0 PS
0 PM 0 PM
0 PL 0 PL

Figure (m)5.7 Recorded values for seven different sets for speed difference =100 and Acceleration=70

The computations of the fuzzy membership values for the given inputs have been shown n figure 5.8
below

NS ZE

Degree of membership

63 95 127 159

X=100
Figure 5.8 Fuzzification of speed difference = 100

For the speed difference (x-=100) the qualifying sets are shown figure. Fuzzy membership function of x
for NS where
Delta 1 100-63=37
Delta 2 127-100=27
Slope 1=1/32=0.03125
Slope 2 =1/32=0.03125

37 × 0.03125
Degree of membership function µNS(x) =min 27 × 0.03125 =0.8438

Fuzzy membership function of x for ZE where


Delta 1 100-95=5
Delta 2 159-100=59
Slope 1=1/32=0.03125
Slope 2 =1/32=0.03125
5 × 0.03125
Degree of membership function µZE(x) =min 59 × 0.01325 =0.1563
1
The membership function of x with the remaining fuzzy sets, namely NL, M, PS, PM, PL is zero.
Similarly for acceleration(x=70) the qualifying fuzzy sets are shown in figure 5.9

NM NS

Degree of membership

31 63 95 127

X=70

Fig 5.9 Fuzzification of Acceleration

The fuzzy membership function of x=70 for NM is µNM =0.7813 and for NS is µNS =0.2188 and
for remaining sets membership value will be zero.
Rule Strength Computation

The rule strength is obtained by computing the minimum of the membership function of the
antecedents.

Example

For the same rule base R given in table, the rule strength using the fuzzy membership value
illustrated in figure
Rule 1: min (0, 0) =0
Rule 2: min (0.1563, 0) =0
Rule 3: min (0, 0) =0
Rule 4: min (0.8438, 0) =0
Rule 5: min (0, 0.2188) =0
Rule 6: min (0, 0) =0
Rule 7: min (0.1563, 0.2188) =0.1563
Rule 8: min (0.1563, 0.7813) =0.1563
(For strength computation use rule from rule base R in Table 1 and for each rule put
corresponding membership values for speed difference and acceleration and then find
minimum for example

Rule 1 If(speed difference is NL) and (acceleration is ZE) then (throttle control is PL)
Here Speed difference is NL as we computed early µNL=0, Acceleration is ZE as we computed
early µZE=0
min (µNL=0, µZE=0) =min (0, 0) =0)

The fuzzy output of the system is the ‘fuzzy OR’ of all fuzzy outputs of the rules with non-zero
strengths. In the event of more than one rule qualifying for the same fuzzy output, the stronger
among them is chosen.

Example

In the given rule base R, the competing fuzzy outputs are those of Rule 7 and 8 with strengths of
each are 0.1563. However, the fuzzy outputs computed here do not aid clear-cut decision on the
throttle control. Hence the need for defuzzyfication arises.
Defuzzification

The centre of gravity method is applied to defuzzify the output. Initially the centroid is computed
for each of computing output membership function. Then, the new output membership areas are
determined by shortening the height of the membership value on the Y axis as dictated by the
rule strength value. Finally, the Centre of Gravity (CG) is computed using the weighted average
of the X-axis centroid points with the newly computed outputs area, the letter serving as weights.
Example

Figure 5.10 illustrates the computation of CG for the two competing outputs of rule 7 and 8 with strength
of 0.1563 each
PS PM

Degree of membership
b1 b2
0.1563 h1

127 159 191 233


a1
a2

Figure 5.10) Computation of entre of Gravity

For the fuzzy set PS

X-axis centroid =159


Rule strength applied to determine output area =0.1563
1
Shaded area =×h× (a1+b1) = 2(0.1563) × (64+63.82) =9.99
For the fuzzy set PM

X-axis centroid point =191


Rule strength applied to determine output area =0.1563
1 1
Shaded area =2.h. (a1+b1) =2. (0.1563)(64+63.82) =9.99
Therefore

9.99×159+9.99×191
Weighted average (CG) = = 175
9.99+9.99

In crisp terms the throttle control (normalized) is to be set as 175.

You might also like