handling uncertainty using fuzzy logicpkalra/siv895/old/fuzzy.pdf · fuzzy logic with engineering...

51
Handling Uncertainty using FUZZY LOGIC

Upload: dinhngoc

Post on 31-Aug-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Handling Uncertainty using

FUZZY LOGIC

Page 2: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering
Page 3: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Conventional (Boolean) Set Theory:

Fuzzy Set Theory

© INFORM 1990-1998 Slide 3

“Strong Fever”

40.1°C

42°C

41.4°C

39.3°C

38.7°C

37.2°C

38°C

Fuzzy Set Theory:

40.1°C

42°C

41.4°C

39.3°C

38.7°C

37.2°C

38°C

“More-or-Less” Rather Than “Either-Or” !

“Strong Fever”

Page 4: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy Variable: Old

1

030 50

Age

75 90

Membership

μ(25)= 0

(33)= 0.15

μ(38)= 0.4

μ(44)= 0.7

μ(72)= 1.0

Page 5: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Crisp Logic vs Fuzzy Logic

Crisp logic needs hard decisions

Fuzzy Logic deals with “membership in group” functions

Page 6: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Probability and Possibility One cupboard A contains a number of bottles, some

containing water, and others containing undesirable products. The label on one of the bottle reads,

“ Probability of water being good is 0.93”.

Another cupboard B contains water from various sources, like mineral water, tap water, rain water, pond water, drain water etc. The label on one of the bottle reads,

“ Possibility of water being good is 0.8”.

Which one would you prefer to open for drinking?

Page 7: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy Logic deals with Possibility measures.

Possibility indicates the extent of belief.

First proposed by Lufti Zadeh.

Lots of applications:

Digital cameras

Camcorders

Washing machines

Braking systems (trains)

Process control

Image processing

Page 8: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Control of automatic exposure in video cameras,

humidity in a clean room,

air conditioning systems,

washing machine timing,

microwave ovens,

vacuum cleaners.

Page 9: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Continuous Fuzzy sets

Page 10: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Discrete Fuzzy set

x = { 0/0, 0.2/1, 0.4/2, 1/ 3, 0.9/4, 0.3/5, 0.1/6 }

Page 11: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Membership function Crisp set representation

Characteristic function

if

if

Fuzzy set representation Membership function

if x is totally in A

if x is not in A

If x is partly in A

( ) : 0,1Af x X

1,( )

0Af x

x A

x A

( ) 1

( ) 0

0 ( ) 1

A

A

A

x

x

x

Page 12: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy set theory basicsFuzzy set operators:

EqualityA = BA (x) = B (x) for all x X

ComplementA’A’ (x) = 1 - A(x) for all x X

ContainmentA BA (x) B (x) for all x X

Page 13: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy set theory basicsFuzzy set operators:

UnionA BA B (x) = max(A (x), B (x)) for all x X

IntersectionA BA B (x) = min(A (x), B (x)) for all x X

Page 14: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

T-norms & co-normsIntersection of two fuzzy sets

t-norm properties:

If b1 < b2, then

Basic t-norms:

Standard intersection -

Bounded sum -

Algebraic product -

( , )

( ,1) ( )

( , ) ( , )

z T a b

T a T a

T a b T a b

1 2( , ) ( , )T a b T a b

( , ) min( , )

( , ) max(0, 1)

( , )

m

b

p

T a b a b

T a b a b

T a b ab

Page 15: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Example fuzzy set operations

15

A’

A B A B

A B

A

Page 16: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Well known Membership Functions

Page 17: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

A given value could have number of possibilities

X has following possibilities

possibility(low) = 0.8

possibility(medium) = 0.4

all others possibilities (high, V.high) =‏‏‏ 0

Page 18: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy Relations

Generalizes classical relation into one that allows partial membership

Describes a relationship that holds between two or more objects

Example: a fuzzy relation “Friend” describe the degree of friendship between two person (in contrast to either being friend or not being friend in classical relation!)

Fuzzy Logic:Intelligence, Control, and Information, J. Yen and R. Langari, PrenticeHall

Page 19: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy Relations

A fuzzy relation is a mapping from the Cartesian space X x Y to the interval [0,1], where the strength of the mapping is expressed by the membership function of the relation (x,y)

The “strength” of the relation between ordered pairs of the two universes is measured with a membership function expressing various “degree” of strength [0,1]

Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill

˜ R

R~

Page 20: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy Cartesian Product

Let

be a fuzzy set on universe X, and

be a fuzzy set on universe Y, then

Where the fuzzy relation R has membership function

Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill

˜ A ˜ B ˜ R X Y

R (x, y) A x B

(x, y) min( A (x), B

(y))

˜ A ˜ B

Page 21: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy Cartesian Product: ExampleLet

defined on a universe of three discrete temperatures, X = {x1,x2,x3}, and

defined on a universe of two discrete pressures, Y = {y1,y2}

Fuzzy set represents the “ambient” temperature and

Fuzzy set the “near optimum” pressure for a certain heat exchanger, and the Cartesian product might represent the conditions (temperature-pressure pairs) of the exchanger that are associated with “efficient”operations. For example, let

Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill

˜ A

˜ B ˜ A ˜ B

˜ A 0.2

x10.5

x21

x3and

˜ B 0.3

y10.9

y2

} ˜ A ˜ B ˜ R

x1

x2

x3

0.2 0.2

0.3 0.5

0.3 0.9

y1 y2

Page 22: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy CompositionSuppose

is a fuzzy relation on the Cartesian space X x Y,

is a fuzzy relation on the Cartesian space Y x Z, and

is a fuzzy relation on the Cartesian space X x Z; then fuzzy max-min and fuzzy max-product composition are defined as

Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill

˜ R ˜ S ˜ T

˜ T ˜ R S

maxmin

T (x,z)

yY( R (x,y) S

(y,z))

max product

T (x,z)

yY(

R (x,y)

S (y, z))

Page 23: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Max-Min Composition The max-min composition of two fuzzy relations R1

(defined on X and Y) and R2 (defined on Y and Z) is

Properties:

Associativity:

Distributive over union:

)],(),([),(2121

zyyxzx RRy

RR

R S T R S R T ( ) ( ) ( )

R S T R S T ( ) ( )

Page 24: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy Composition: Example (max-min)

Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill

X {x1, x2},

T (x1,z1)

yY( R (x1,y) S

(y,z1))

max[min( 0.7,0.9),min(0.5, 0.1)]

0.7

Y {y1, y2},and Z {z1,z2, z3}

Consider the following fuzzy relations:

˜ R x1

x2

0.7 0.5

0.8 0.4

y1 y2

and ˜ S y1

y2

0.9 0.6 0.5

0.1 0.7 0.5

z1 z2 z3

Using max-min composition,

} ˜ T x1

x2

0.7 0.6 0.5

0.8 0.6 0.4

z1 z2 z3

Page 25: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Max-Product Composition The max-product composition of two fuzzy relations R1

(defined on X and Y) and R2 (defined on Y and Z) is

Properties:

Associativity:

Distributive over union:

)],(),([),(2121

zyyxzx RRy

RR

R S T R S R T ( ) ( ) ( )

R S T R S T ( ) ( )

Page 26: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy Composition: Example (max-Prod)

Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill

X {x1, x2},

T (x2, z2 )

yY( R (x2 , y) S

(y, z2))

max[( 0.8,0.6),(0.4, 0.7)]

0.48

Y {y1, y2},and Z {z1,z2, z3}

Consider the following fuzzy relations:

˜ R x1

x2

0.7 0.5

0.8 0.4

y1 y2

and ˜ S y1

y2

0.9 0.6 0.5

0.1 0.7 0.5

z1 z2 z3

Using max-product composition,

} ˜ T x1

x2

.63 .42 .25

.72 .48 .20

z1 z2 z3

Page 27: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Application: Fuzzy Relation Petite

Fuzzy Logic:Intelligence, Control, and Information, J. Yen and R. Langari, PrenticeHall

Fuzzy Relation Petite defines the degree by which a person with

a specific height and weight is considered petite. Suppose the

range of the height and the weight of interest to us are {5’, 5’1”,

5’2”, 5’3”, 5’4”,5’5”,5’6”}, and {90, 95,100, 105, 110, 115, 120,

125} (in lb). We can express the fuzzy relation in a matrix form as

shown below:

˜ P

5'

5'1"

5' 2"

5' 3"

5' 4"

5' 5"

5' 6"

1 1 1 1 1 1 .5 .2

1 1 1 1 1 .9 .3 .1

1 1 1 1 1 .7 .1 0

1 1 1 1 .5 .3 0 0

.8 .6 .4 .2 0 0 0 0

.6 .4 .2 0 0 0 0 0

0 0 0 0 0 0 0 0

90 95 100 105 110 115 120 125

Page 28: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy Logic:Intelligence, Control, and Information, J. Yen and R. Langari, PrenticeHall

˜ P

5'

5'1"

5' 2"

5' 3"

5' 4"

5' 5"

5' 6"

1 1 1 1 1 1 .5 .2

1 1 1 1 1 .9 .3 .1

1 1 1 1 1 .7 .1 0

1 1 1 1 .5 .3 0 0

.8 .6 .4 .2 0 0 0 0

.6 .4 .2 0 0 0 0 0

0 0 0 0 0 0 0 0

90 95 100 105 110 115 120 125

Once we define the petite fuzzy relation, we can answer two

kinds of questions:

• What is the degree that a female with a specific height and a specific

weight is considered to be petite?

• What is the possibility that a petite person has a specific pair of height

and weight measures? (fuzzy relation becomes a possibility

distribution)

Page 29: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Application: Fuzzy Relation Petite

Fuzzy Logic:Intelligence, Control, and Information, J. Yen and R. Langari, PrenticeHall

Given a two-dimensional fuzzy relation and the possible values

of one variable, infer the possible values of the other variable

using similar fuzzy composition as described earlier.

Definition: Let X and Y be the universes of discourse for

variables x and y, respectively, and xi and yj be elements of X

and Y. Let R be a fuzzy relation that maps X x Y to [0,1] and

the possibility distribution of X is known to be Px(xi). The

compositional rule of inference infers the possibility distribution

of Y as follows:

max-min composition:

max-product composition:

PY(yj ) maxx i

(min(PX (xi),PR (xi , yj)))

PY(yj ) maxx i

(PX (xi) PR(xi , yj ))

Page 30: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Application: Fuzzy Relation Petite

Fuzzy Logic:Intelligence, Control, and Information, J. Yen and R. Langari, PrenticeHall

Problem: We may wish to know the possible weight of a petite

female who is about 5’4”.

Assume About 5’4” is defined as

About-5’4” = {0/5’, 0/5’1”, 0.4/5’2”, 0.8/5’3”, 1/5’4”, 0.8/5’5”, 0.4/5’6”}

Using max-min compositional, we can find the weight possibility

distribution of a petite person about 5’4” tall:

Pweight

(90) (0 1) (0 1) (.41) (.81) (1 .8) (.8 .6) (.4 0)

0.8

˜ P

5'

5'1"

5' 2"

5' 3"

5' 4"

5' 5"

5' 6"

1 1 1 1 1 1 .5 .2

1 1 1 1 1 .9 .3 .1

1 1 1 1 1 .7 .1 0

1 1 1 1 .5 .3 0 0

.8 .6 .4 .2 0 0 0 0

.6 .4 .2 0 0 0 0 0

0 0 0 0 0 0 0 0

90 95 100 105 110 115 120 125

Similarly, we can compute the possibility

degree for other weights. The final result is

Pweight {0.8 /90,0.8 /95,0.8 /100,0.8/105,0.5 /110,0.4 /115, 0.1/120,0 /125}

Page 31: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzy Inference Systems Fuzzy logical operations

Fuzzy rules

Fuzzification

Implication

Aggregation

Defuzzification

Fuzzifier Inference Engine De-fuzzification

FuzzyKnowledge base

input output

Page 32: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Fuzzifier

Converts the crisp input to a linguistic variable using the membership functions stored in the fuzzy knowledge base.

Page 33: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Inference Engine Using If-Then type fuzzy rules converts the fuzzy input to

the fuzzy output.

Page 34: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

COMPOSITIONAL RULE OFINFERENCE

In order to draw conclusions from a set of rules (rule base) one needs a mechanism that can produce an output from a collection of rules. This is done using the compositional rule of inference.

B’= A’ o R

“o“ is the composition operator. The inference procedure is called “compositional rule of inference”.

The inference mechanism is determined by two factors:

1. Implication operators: Mamdani: min

Larsen: algebraic product

2. Composition operators: Mamdani: max-min

Larsen: max-product

Page 35: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

35

Rule Evaluation

distance

small

o.55

Clipping approach (others are possible):

Clip the fuzzy set for “slow” (the consequent) at the height given by our belief in the premises (0.55)

We will then consider the clipped AREA (orange) when making our final decision

Rationale: if belief in premises is low, clipped area will be very smallBut if belief is high it will be close to the whole unclipped area

acceleration

slow

Page 36: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

36

Rule Evaluation

Distance is not growing, then keep present acceleration

delta

=

0.75

acceleration

slow present fast fastestbrake

Page 37: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

37

Rule Evaluation

Distance is not growing, then keep present acceleration

delta

=

0.75

acceleration

present

Page 38: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

38

Rule Aggregation

acceleration

present

acceleration

slow

From distanceFrom delta (distance change)

To make a final decision: From each rule we haveObtained a clipped area. But in the end we want a singleNumber output: our desired acceleration

Page 39: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Washing Machine

INPUT:

Load (Quantity)

small, medium, large

Fabric Softness:

Hard, Not so Hard, Soft, Not so soft

OUTPUT: (Wash Cycle)

Light, Normal, Strong

Page 40: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

If

Laundry quantity is large (Fuzzy)

then

wash cycle is strong (Fuzzy)

Page 41: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Washing Machine1

0.6

0.3

1

0

Small Medium Large

Laundry Quantity

Light Normal Strong

.

Wash Cycle

If Laundry quantity is large (Fuzzy) then wash cycle is strong (Fuzzy)

Washing machine needs a NON-fuzzy information.

Page 42: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Rule 1: If Laundry quantity is LARGE and

Laundry softness is HARD then wash cycle is

strong.

Rule 2: If Laundry quantity is MEDIUM and

Laundry softness is NOT SO HARD then wash

cycle is normal.

All rules in rule base get fired

Page 43: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Washing Machine

0.6

0.3

1

0

Small Medium Large

Laundry Quantity

Light Normal Strong

1

0

Hard N.H N.S Soft

Laundry Softness

0.2

.75

Wash Cycle

Rule 1: If Laundry quantity is LARGE and Laundry softness is HARD then wash cycle is strong.

Rule 2: If Laundry quantity is MEDIUM and Laundry softness is NOT SO HARD then wash cycle is normal.

Page 44: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

44

Summary: If-Then rules1. Fuzzify inputs:

Determine the degree of membership for all terms in the

premise.

If there is one term then this is the degree of support for

the consequence.

2. Apply fuzzy operator:

If there are multiple parts, apply logical operators to

determine the degree of support for the rule.

Page 45: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

45

Summary: If-Then rules3. Apply implication method:

Use degree of support for rule to shape output fuzzy set of

the consequence.

How do we then combine several rules?

Page 46: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

46

Multiple rules We aggregate the outputs into a single fuzzy set which

combines their decisions.

The input to aggregation is the list of truncated fuzzy sets and the output is a single fuzzy set for each variable.

Aggregation rules: max, sum, etc.

As long as it is commutative then the order of rule exec is irrelevant.

Page 47: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

47

Defuzzify the output Take a fuzzy set and produce a single crisp number that

represents the set.

Practical when making a decision, taking an action etc.

Center of gravity

Page 48: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Defuzzification

Center of Gravity

Low High

1

0

0.61

0.39

tCrisp output

Max

Min

Max

Min

dttf

dtttf

C

)(

)(

Center of Gravity

Page 49: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Sugeno Fuzzy Models

Also known as TSK fuzzy model

Takagi, Sugeno & Kang, 1985

Goal: Generation of fuzzy rules from a given input-output data

set.

Fuzzy Rules of TSK Model:

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

Fuzzy Sets Crisp Function

Page 50: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

Examples

R1: if X is small and Y is small then z = x +y +1

R2: if X is small and Y is large then z = y +3

R3: if X is large and Y is small then z = x +3

R4: if X is large and Y is large then z = x + y + 2

Page 51: Handling Uncertainty using FUZZY LOGICpkalra/siv895/OLD/fuzzy.pdf · Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill ×R R ~ ... Fuzzy Logic with Engineering

51

Issues with Fuzzy logic How to determine the membership functions? Usually

requires fine-tuning of parameters

How to generate Fuzzy rules?

3 input variables, each can take 4 possible linguistic values

GA can help