Fuzzy Control - ctrl.cinvestav.mxyuw/file/sa14.pdf · De–nition: fuzzy set De–nition (fuzzy...

Preview:

Citation preview

Fuzzy Control

Wen Yu

Departamento de Control AutomáticoCINVESTAV-IPN

A.P. 14-740, Av.IPN 2508, México D.F., 07360, México

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 1 / 43

History

Lofti A. Zadeh. Fuzzy sets, Inf. Control 8, 338-353, 1965

US and certain parts of Europe ignored it. Mathematic?

fuzzy logic was excepted with open arms in Japan, China and mostOriental countries.

The world�s largest number of fuzzy researchers are in China withover 10,000 scientists.

The popularity of fuzzy logic in the Orient re�ects the fact thatOriental thinking more easily accepts the concept of "fuzziness".

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 2 / 43

De�nition: fuzzy set

De�nition(fuzzy set) Let X be a nonempty set. A fuzzy set A in X is characterizedby its membership function µA : X ! [0, 1] and µA is interpreted as thedegree of membership of element x in fuzzy set A for each x 2 X .

Crisp set assigns value {0,1} to members in X

Fuzzy set assigns value [0,1] to members in X

Frequently we will write A(x) instead of µA(x).

A fuzzy set is totally characterized by a membership function (MF).

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 3 / 43

Examples

ExampleThe membership function of the fuzzy set of real numbers �close to 1�, iscan be de�ned

A(t) = e� (t�1)2

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 4 / 43

Examples

ExampleSomebody is "tall"

MFs

Heights5’10’’

.5

.8

.1

“tall”in Asia

“tall”in the US

“tall”in NBA

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 5 / 43

Triangular membership function

µA = A (x) =

8<:1� a�x

α α� a � x � a1� x�c

β a � x � a+ β

0 otherwise

supp (A) = [a� α, a+ β] , [A]γ = [a� (1� γ) α, a+ (1� γ) β],γ 2 [0, 1].

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 6 / 43

Trapezoidal membership function

µA = A (x) =

8>><>>:1� a�x

α α� a � x � a1 a � x � b

1� x�cβ b � x � b+ β

0 otherwise

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 7 / 43

Gaussian membership function

­4 ­2 0 2 4

0.5

1.0

x

y

µA (x) = e� (x�1)2

4 = e�(x�a)2

σ2

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 8 / 43

Bell membership function

µA (x) =1

1+�� x�cb

��2b

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 9 / 43

Advantages of Fuzzy Systems

Conceptually straightforward to understand.

The mathematical concepts behind fuzzy reasoning are simple.

Flexible:You can modify and add on fuzzy rules without starting fromscratch.

Tolerant of imprecise data. Everything is imprecise if you look closelyenough, but more than that, many things are imprecise even at �rstglance

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 10 / 43

Advantages of Fuzzy Systems

Can model nonlinear functions of arbitrary complexity.

Can create a fuzzy system to match any set of input/output data.

Can be built on top of the experience of experts.

close to natural language.

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 11 / 43

Disadvantages of Fuzzy Systems

Creating the fuzzy rules base can be troublesome

It is di¢ cult to create the fuzzy rules base from input/output data ifno fuzzy rule extraction technique is used

Accuracy of the inference depends directly on the number of fuzzyrules used in complex problem

Increasing input variables and fuzzy membership fns used will increasethe number of fuzzy rules exponentially.

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 12 / 43

Fuzzy IF-THEN rules: product rule

IF <fuzzy proposition>, THEN <fuzzy proposition>

Atomic:x is A

Compound (AND, OR, NOT)

x is A AND x is not B

Compound fuzzy proposition is fuzzy relations

AND ! intersections

OR ! unions

NOT ! complents

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 13 / 43

Fuzzy IF-THEN rules

Example

F = (x is A and x is not B) or (x is C )

its membership function is

µF = s ft [µA, c (µB )] , µC g

for exampleµF = µA � (1� µB ) + µC

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 14 / 43

Clsssical IF-THEN operation

For classical proposition

If pressure is high THEN volume is small

Classical method (production rule)

(IF p THEN q)) (p ! q)

By logic table (p ! q) = p _ q or ((p ^ q) _ p)

p q p ! q1 1 10 1 10 0 11 0 0

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 15 / 43

Fuzzy IF-THEN operation

IF p THEN q

how to operate µp and µq1 Larsen

µQM = µpµq2 Mamdani

µQM = min�

µp , µq

�or µQM = µpµq

3 ×ukasiewiczµQM = min

�1� µp , µq

�4 Kleene-Dienes

µQM = max�1� µp , µq

�5 Godel

µQM =

�1 µp � µq

µq otherwise

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 16 / 43

Fuzzy rule base

De�nitiona fuzzy rule base consists of a set of fuzzy IF-THEN rules

Rl : IF x1 is Al1 and � � � and xn is Aln, THEN y is B l

where Ali and Bl are fuzzy sets in Ui and V , respectively, and xi and y are

linguistic variable, l = 1, � � � ,M. It is also called canonical fuzzy IF-THENrules

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 17 / 43

Fuzzy rule base: Lemma

LemmaThe canonical fuzzy IF-THEN rules include

1 Partial rules: m < n

Rl : IF x1 is Al1 and � � � and xm is Alm , THEN y is B l

2 Or rulesRl : IF x1 is Al1 or x2 is A

l2, THEN y is B

l

3 Single fuzzy statement : Rl : y is B l

4 Gradual rules

Rl : The samller the x, the bigger the y

5 No fuzzy rules: conventional product rules

Rl : IF x1 is Al1 and � � � and xn is Aln, THEN y is B l(CINVESTAV-IPN) Fuzzy Control March 9, 2020 18 / 43

Fuzzy rule base: proof

1 it is equivalent to

Rl : IF � � � xm+1 is I and � � � and xn is I , THEN y is B l

where I si fuzzy set with µI = 12 it is equivalent to two rules

Rl :IF x1 is Al1 THEN y is B

l

IF x2 is Al2, THEN y is Bl

3 it is equivalent to

Rl : IF x1 is I and � � � and xn is I , THEN y is B l

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 19 / 43

Fuzzy rule base: proof

4 it is equivalent to

Rl : IF x is S THEN y is B

where µS =1

1+e5�(x+2), µB =

11+e�5(y�2)

52.50­2.5­5

1

0.75

0.5

0.25

0

x

y

x

y

52.50­2.5­5

1

0.75

0.5

0.25

0

x

y

x

y

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 20 / 43

Fuzzy rule base: proof

5 if Ali and Bl can only take values 1 or 0, they become non-fuzzy rules

Rl : IF x1 is Al1 and � � � and xn is Aln, THEN y is B l

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 21 / 43

Property: complete

De�nitionA set of fuzzy IF-THEN rules is complete if for any x 2 U, there exists atleast one rule such that µAli

6= 0

Example2-input 1-output fuzzy system, 3 membership function for x1, 2membership function for x2, in order for a fuzzy rule base to be complete,it must contain 3� 2 = 6 rules

R1 : IF x1 is S1 and x2 is S2, THEN y is B1

R2 : IF x1 is S1 and x2 is L2, THEN y is B2

R3 : IF x1 is M1 and x2 is S2, THEN y is B3

R4 : IF x1 is M1 and x2 is L2, THEN y is B4

R5 : IF x1 is L1 and x2 is S2, THEN y is B5

R6 : IF x1 is L1 and x2 is L2, THEN y is B6

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 22 / 43

Property: complete

x� = (1, 0) when R2 is missed

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 23 / 43

Property: consistent, continuous

De�nitionA set of fuzzy IF-THEN rules is consistent if there are no rules with sameIF parts, but di¤erent THEN parts

De�nitionA set of fuzzy IF-THEN rules is continuous if there do not exist suchneighboring rules whose THEN part fuzzy sets have empty intersection(smooth)

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 24 / 43

Compositional rule of inference

If we know y = f (x) , x = a, then b = f (a)If we know "IF x is A THEN y is B"

µQ = µAµB

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 25 / 43

Compositional rule of inference

! If x is A0, what is B 0

µA\Q = t�µA, µQ

�the projection of A\Q on V is µB 0

µB 0 = supx2U

t�µA, µQ

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 26 / 43

Fuzzy inference engine

Combine the fuzzy IF-THEN rules into a mapping from fuzzy set A in Uto a fuzzy set B in V

Composition based inference

Individual-rule based inference

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 27 / 43

Fuzzy inference engine: Composition based inference

All rules are combined into a single fuzzy IF-THEN rule

Union: the rules are independentIntersection: the rules are strongly coupled (strange)

Rl : IF x1 is Al1 and � � � and xn is Aln, THEN y is B l

1 For rule l , the "and" has fuzzy relation

µAl1�����Aln = µAl1� . . . � µAln

where "�" represents t-norm operator2 implication "!", Mandani µAl1�����AlnµB l3 Union

QM = [Ml=1R l , µQM = µR 1+ . . . +µR l

where "+" represents s-norm operator4 For any input C , the fuzzy inference engine give output D as(Mandani)

µD = supx2U

thµC , µQM

i(CINVESTAV-IPN) Fuzzy Control March 9, 2020 28 / 43

Fuzzy inference engine: Individual-rule based inference

Each rule determines an output, step 1 and setp 2 are the same

3 Generalized modus ponens

µD l = supx2U

t [µC , µR l ]

where "+" represents s-norm operator

4 For any input C , the fuzzy inference engine give output D as(Mandani)

µD = µD 1+ . . . +µDM

Product inference engine

µD = maxl

(supx2U

"(µC )

n

∏i=1

µAli

!(µB l )

#)

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 29 / 43

Product inference engine

LemmaIf the fuzzy set C is a fuzzy singleton,

µC =

�1 x = x�

0 otherwise

then

µD = maxl

( n

∏i=1

µAli

!(µB l )

)

The most di¢ cult supx2U dispears

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 30 / 43

Fuzzi�ers

From real valued point x� 2 U to a fuzzy set A in U

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 31 / 43

Fuzzi�ers

Singleton

µA =

�1 x = x�

0 otherwise

Gaussian

µA = e(x�x�)2

σ2

Triangular

µA =

(1� jx�x �j

α jx � x�j � a0 otherwise

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 32 / 43

Fuzzi�ers: summary

The singleton fuzzi�er greatly simpli�es the computation

If the membership function are Gaussian or traiangular, Gaussian ortraiangular fuzzi�er alos simplify the computation

Gaussian or traiangular fuzzi�er can suppress noise in the input

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 33 / 43

Defuzzi�ers

From a fuzzy set B in V to crisp point y � 2 V (best represents the fuzzyset B), similar to the mean value of a random variable

Center of gravity

y � =

RyµBdyRµBdy

Center average

y � =∑Ml=1 y

lwl∑Ml=1 wl

Maximum, y � is the point at which µB archieves its maximum value

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 34 / 43

Example

R1 : IF x1 is A1 and x2 is A2, THEN y is A1R2 : IF x1 is A2 and x2 is A1, THEN y is A2

where

µA1 =

�1� jx j jx j � 10 otherwise

µA2 =

�1� jx � 1j 0 � x � 2

0 otherwise

If (x�1 , x�2 ) = (0.3, 0.6) , y?

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 35 / 43

Example

We use singleton

µB 0 = maxl

( n

∏i=1

µAli

!(µB l )

)= max

nµA1 (0.3) µA2 (0.6) µA1 (y) , µA2 (0.3) µA1 (0.6) µA2 (y)

o= max

n0.42µA1 (y) , 0.12µA2 (y)

oCenter average

y � =0 � 0.42+ 1 � 0.120.42+ 0.12

= 0.22

Center of gravity: 0.187Maximum: 0.5

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 36 / 43

Example

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 37 / 43

Fuzzy system as nonlinear mappings

LemmaFuzzy set has the form of

Rl : IF x1 is Al1 and � � � and xn is Aln, THEN y is B l

the center of B l is y l , then with product inference engine, singletonfuzzi�er, and center average defuzzi�er, the fuzzy system has the followingform

y =

∑Ml=1 y

l

n

∏i=1

µAli

!

∑Ml=1

n

∏i=1

µAli

!

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 38 / 43

Fuzzy system as nonlinear mappings: poof

Product inference engine with singleton fuzzi�er

µB 0 =Mmaxl

( n

∏i=1

µAli

!(µB l )

)

The center of B l is y l , for x�i the height of k�th fuzzy set isn

∏i=1

µAli(x�) µB l

�y l�=

n

∏i=1

µAli(x�), the center average defuzzi�er

y =∑Ml=1 y

lw l

∑Ml=1 w l

It islingustic rules ! nonlinear mapping

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 39 / 43

Fuzzy system: example

Fuzzy rules

R j : IF x1 is Aj1 AND � � � xn is Ajn THEN y is B j

(1) Fuzzi�er (singleton)

µ =

�1 if x = x�

0 otherwise

so �xi is A

ji

�! µAji

(x�i )

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 40 / 43

Fuzzy system: example

(2) Fuzzy operation: (x1 is Aj1 AND� � � xn is A

jn)

n

∏i

µAji(x�i )

Mamdani implications (product inference engine)

n

∏i

µAji(x�i ) µB j (y)

l�rules p is "OR"

µp = maxl

"n

∏i

µAji(x�i ) µBj (y)

#

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 41 / 43

Fuzzy system: example

(3)Defuzzi�er, suppose y j is center of Bj , the height of the lthe fuzzy set

isn

∏i

µAji(x�i ) µB j

�y j�, and µB j

�y j�= 1 (normal fuzzy set), so center

average is

y � =

m

∑j=1y j

n

∏i

µAji(x�i )

!m

∑j=1

n

∏i

µAji(x�i )

!

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 42 / 43

Fuzzy system as universal approximators

TheoremThe fuzzy system with product inference engine, singleton fuzzi�er, andcenter average defuzzi�er, and Gaussian membership functions areuniversal approximators

supx2U

jf (x)� g (x)j < ε

for any real countinuous function g (x) , any ε > 0

f (x) =

∑Ml=1 y

l

n

∏i=1ali exp

��� xi�x li

σli

�2�!

∑Ml=1

n

∏i=1ali exp

��� xi�x li

σli

�2�!

(CINVESTAV-IPN) Fuzzy Control March 9, 2020 43 / 43

Recommended