Fuzzy Logic Theory

download Fuzzy Logic Theory

of 51

Transcript of Fuzzy Logic Theory

  • 8/3/2019 Fuzzy Logic Theory

    1/51

    Institute of Intelligent Power Electronics IPEPage 1

    Fuzzy Logic Theory

    Dr. Xiao-Zhi Gao

    Department of Electrical Engineering

    Helsinki University of Technology

    [email protected]

  • 8/3/2019 Fuzzy Logic Theory

    2/51

    Institute of Intelligent Power Electronics IPEPage 2

    Outline

    Fuzzy set theory

    Basic concepts in fuzzy sets

    Operations on fuzzy sets

    Fuzzy rules and reasoning

    Fuzzy inference systems

    Mamdani fuzzy systems

    Sugeno fuzzy systems

  • 8/3/2019 Fuzzy Logic Theory

    3/51

    Institute of Intelligent Power Electronics IPEPage 3

    Primer of Fuzzy Sets

    From classical crisp sets to fuzzy sets

    Change of range of membership functions

    Notions of fuzzy sets

    Representation, support, cut, convexity ...

    Fuzzy set operations Intersection, union, complement, etc.

    Share almostthe same mathematicsfoundamentals with those of classical sets

  • 8/3/2019 Fuzzy Logic Theory

    4/51

    Institute of Intelligent Power Electronics IPEPage 4

    Basics of Fuzzy Sets Classical sets

    two-valuemembership functions

    An element either belongs to or does not belong

    to a given classical set (sharp boundary) Fuzzy sets

    Extend the degrees of membership:

    An element partiallybelongs to and partiallydoes not belong to a given fuzzy set

    Smooth and Gradual boundary

    Membership functions Assignment of membership functions is subjective

    { } ]1,0[1,0

  • 8/3/2019 Fuzzy Logic Theory

    5/51

    Institute of Intelligent Power Electronics IPEPage 5

    Father of Fuzzy Logic: Lotfi A. Zadeh

    Lotfi Asker Zadeh is a Professor in the GraduateSchool, Computer Science Division, Departmentof EECS, University of California, Berkeley. In

    addition, he is serving as the Director of BISC(Berkeley Initiative in Soft Computing).

    http://en.wikipedia.org/wiki/Lotfi_Asker_Zadeh

    http://www-bisc.cs.berkeley.edu/

  • 8/3/2019 Fuzzy Logic Theory

    6/51

    Institute of Intelligent Power Electronics IPEPage 6

    Four Typical Membership Functions

    0 20 40 60 80 1000

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Memb

    ershipGrades

    (a) Triangular MF

    0 20 40 60 80 1000

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Memb

    ershipGrades

    (b) Trapezoidal MF

    0 20 40 60 80 1000

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Mem

    bershipGrades

    (c) Gaussian MF

    0 20 40 60 80 1000

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Mem

    bershipGrades

    (d) Generalized Bell MF

  • 8/3/2019 Fuzzy Logic Theory

    7/51

    Institute of Intelligent Power Electronics IPEPage 7

    Supports

    Core

    Crossover points

    Height

    Fuzzy singleton

    A fuzzy singleton is a crispset

    A fuzzy set that has only one element

    x0

    Definitions in Fuzzy Sets

    (x0) = 1

    (x) > 0

    (x) =1

    (x) = 0.5

    max A(x)[

  • 8/3/2019 Fuzzy Logic Theory

    8/51

    Institute of Intelligent Power Electronics IPEPage 8

    Definitions in Fuzzy Sets

    FuzzySingleton

  • 8/3/2019 Fuzzy Logic Theory

    9/51

    Institute of Intelligent Power Electronics IPEPage 9

    Representations of

    Membership Functions

    Discrete Fuzzy Sets Universe of discourse is discrete

    Continuous Fuzzy Sets Universe of discourse is continuous

  • 8/3/2019 Fuzzy Logic Theory

    10/51

    Institute of Intelligent Power Electronics IPEPage 10

    Discrete and Continuous

    Fuzzy Sets

    0 1 2 3 4 5 60

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    X = Number of Children

    MembershipGrades

    (a) MF on a Discrete Universe

    0 10 20 30 40 50 60 70 80 90 1000

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    X = Age

    Mem

    bershipGrades

    (b) MF on a Continuous Universe

  • 8/3/2019 Fuzzy Logic Theory

    11/51

    Institute of Intelligent Power Electronics IPEPage 11

    Cuts of Fuzzy Sets

    (a constant) cut of a fuzzy set is a

    crispset

    Strong cuts

    { } = )(xxA Aa

    { } >= )(xxA Aa

    support(A) = A0

    core(A) =A1

  • 8/3/2019 Fuzzy Logic Theory

    12/51

    Institute of Intelligent Power Electronics IPEPage 12

    Resolution Principle

    A fuzzy membership function can be

    expressed in terms of the characteristicfunctions of its cuts

    An example of decomposing a fuzzy setwith discrete objects

    =

    3

    3.0,2

    2.0,1

    1.0A

    ],min[max)( AxA =

    R l i P i i l

  • 8/3/2019 Fuzzy Logic Theory

    13/51

    Institute of Intelligent Power Electronics IPEPage 13

    Resolution Principle

    33.0

    22.0

    11.0

    3)3.0,2.0,1.0max(

    2)2.0,1.0max(

    11.0

    3

    3.03.0

    32.0

    22.02.0

    3

    1.0

    2

    1.0

    1

    1.01.0

    3

    13

    1

    2

    13

    1

    2

    1

    1

    1

    3.0

    2.0

    1.0

    3.0

    2.0

    1.0

    ++=

    ++=

    =

    +=

    ++=

    =

    +=

    ++=

    A

    A

    A

    A

    A

    A

    A

  • 8/3/2019 Fuzzy Logic Theory

    14/51

    Institute of Intelligent Power Electronics IPEPage 14

    Resolution Principle

    0 10 20 30 40 50 60 70 80 90 1000

    0.2

    0.4

    0.6

    0.8

    1

    1.2Resolution Principle

    x

    Mem

    bershipGrades

  • 8/3/2019 Fuzzy Logic Theory

    15/51

    Institute of Intelligent Power Electronics IPEPage 15

    Extension Principle

    Extending crispdomains of mathematicalexpressions to fuzzydomains

    Suppose fis a function mapping from Xto Y, and A is a fuzzy set:

    we have image of A under f:n

    nAAA

    xx

    xx

    xxA )()()(

    2

    2

    1

    1 +++= L

    )()(

    )()(

    )()()(

    2

    2

    1

    1

    n

    nAAA

    xfx

    xfx

    xfxAfB +++== L

  • 8/3/2019 Fuzzy Logic Theory

    16/51

    Institute of Intelligent Power Electronics IPEPage 16

    Extension Principle

    An example of extension principle

    2

    3.0

    1

    9.0

    0

    8.0

    1

    4.0

    2

    1.0+++

    +

    =A

    3)( 2 =xxf

    1

    3.0

    2

    9.0

    3

    8.0

    1

    )3.01.0(

    2

    )9.04.0(

    3

    8.0

    13.0

    29.0

    38.0

    24.0

    11.0

    +

    +

    =

    +

    +

    =

    +

    +

    +

    +=B

    E t i P i i l

  • 8/3/2019 Fuzzy Logic Theory

    17/51

    Institute of Intelligent Power Electronics IPEPage 17

    Extension Principle

  • 8/3/2019 Fuzzy Logic Theory

    18/51

    Institute of Intelligent Power Electronics IPEPage 18

    Convex Fuzzy Sets Convexity of fuzzy sets

    where and are two arbitrary elements

    in A, and is an arbitrary constantx1 x2

    C d N F

  • 8/3/2019 Fuzzy Logic Theory

    19/51

    Institute of Intelligent Power Electronics IPEPage 19

    Convex and Nonconvex Fuzzy

    Membership Functions

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    MembershipG

    rades

    (a) Two Convex Fuzzy Sets

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    MembershipGrades

    (b) A Nonconvex Fuzzy Set

  • 8/3/2019 Fuzzy Logic Theory

    20/51

  • 8/3/2019 Fuzzy Logic Theory

    21/51

    Institute of Intelligent Power Electronics IPEPage 21

    Operations on Fuzzy Sets

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2(a) Fuzzy Sets A and B

    A B

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2(b) Fuzzy Set "not A"

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2(c) Fuzzy Set "A OR B"

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2(d) Fuzzy Set "A AND B"

    A

    A IBA U B

    and B

  • 8/3/2019 Fuzzy Logic Theory

    22/51

    Institute of Intelligent Power Electronics IPEPage 22

    Operations on Fuzzy Sets Subset

    Equality

    andA B B A

  • 8/3/2019 Fuzzy Logic Theory

    23/51

    Institute of Intelligent Power Electronics IPEPage 23

    Concept of A B

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2A Is Contained in B

    Memb

    ershipGrades

    B

    A

    Li i ti V i bl

  • 8/3/2019 Fuzzy Logic Theory

    24/51

    Institute of Intelligent Power Electronics IPEPage 24

    Linguistic Variables

    Modeling of human thinking Numerical values are not sufficient

    Linguistic variables exist in real world

    e.g, chatting with a stranger on the phone

    Estimation of your partners age:

    (40? probability of 40? About middle-aged?) Linguistic variables are characterized by linguistic

    values (Age:[Young, Old, Very Old, etc.])

    Linguistic values are described by their fuzzymembership functions

  • 8/3/2019 Fuzzy Logic Theory

    25/51

    Institute of Intelligent Power Electronics IPEPage 25

    Membership Functions For Linguistic Values

    Young, Middle Aged, and Old

    0 10 20 30 40 50 60 70 80 900

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    X = Age

    MembershipGrades

    Young Middle Aged Old

    Age:

    LinguisticVariable

    Young, Middle

    Aged, and Old:Linguistic Values

    Membership Functions For Primary

  • 8/3/2019 Fuzzy Logic Theory

    26/51

    Institute of Intelligent Power Electronics IPEPage 26

    Membership Functions For Primary

    and Composite Linguistic Values

    0 10 20 30 40 50 60 70 80 90 1000

    0.2

    0.4

    0.6

    0.8

    1

    X = age

    Members

    hipGrades

    (a) Primary Linguistic Values

    OldYoung

    0 10 20 30 40 50 60 70 80 90 1000

    0.2

    0.4

    0.6

    0.8

    1

    X = age

    M

    embershipGrades

    (b) Composite Linguistic Values

    Not Young and Not Old

    More or Less Old

    Extremely Old

    Young but

    Not Too Young

    Extremely Old

    = Old4

  • 8/3/2019 Fuzzy Logic Theory

    27/51

    Institute of Intelligent Power Electronics IPEPage 27

    Fuzzy IF-THEN Rules

    A fuzzy IF-THEN rule is expressed as

    IF xis A THEN yis B

    A and B are fuzzy membership functions

    A fuzzy IF-THEN rule associatesfuzzyinput and output membership functions

    Premise Part Consequent Part

  • 8/3/2019 Fuzzy Logic Theory

    28/51

    Institute of Intelligent Power Electronics IPEPage 28

    Fuzzy Reasoning

    Fuzzy reasoning derives conclusionsbased on givenfuzzy IF-THEN rules

    and knownfacts

    An example:

    Given a fuzzy rule: IF bath is very hot THENadd a lot of cold water

    Known fact: bath is a little hot

    Conclusion: how much cold water should beadded?

  • 8/3/2019 Fuzzy Logic Theory

    29/51

    Institute of Intelligent Power Electronics IPEPage 29

    Fuzzy Reasoning

    Premise 1: IF X is A THEN Y is B

    Premise 2: IF X is

    Conclusion: THEN Y is

    First, measure the similaritybetween A and

    Second, projectthis similarity to B

    There are a few composition operations

    used in fuzzy reasoning procedure Max-Minis most widely employed

    AB

    A

    Fuzzy Reasoning for Single Rule

  • 8/3/2019 Fuzzy Logic Theory

    30/51

    Institute of Intelligent Power Electronics IPEPage 30

    Fuzzy Reasoning for Single Rulewith Single Antecedent

    IntersectionIF X is A THEN Y is B

    W

    Known Fact: X is A

    Fuzzy Reasoning for Single Rule

  • 8/3/2019 Fuzzy Logic Theory

    31/51

    Institute of Intelligent Power Electronics IPEPage 31

    Fuzzy Reasoning for Single Rule

    with Multiple Antecedents

    w=min(w1, w2)or

    w=w1*w2

    IF X is A and Y is B THEN Z is C

    Known Facts: X is Aand Y is B

    Fuzzy Reasoning For Multiple Rules

  • 8/3/2019 Fuzzy Logic Theory

    32/51

    Institute of Intelligent Power Electronics IPEPage 32

    Fuzzy Reasoning For Multiple Rules

    with Multiple Antecedents

    Aggregation

    If X is A1 and Y is B1 Then Z is C1If X is A2 and Y is B2 Then Z is C2

    Known Facts:

    X is A

    Y is B

  • 8/3/2019 Fuzzy Logic Theory

    33/51

    Institute of Intelligent Power Electronics IPEPage 33

    Fuzzy Logic SystemsFuzzification

    Interface

    Inference

    Engine

    Fuzzy Rule

    Base

    Defuzzification

    InterfaceCrisp

    Input

    Crisp

    Output

    Rules

    Fuzzy

    Input

    Fuzzy

    Output

    Mamdani and Sugeno Fuzzy Inference Systems

  • 8/3/2019 Fuzzy Logic Theory

    34/51

    Institute of Intelligent Power Electronics IPEPage 34

    Fuzzification

    Converts a crispvalue (from sensors,devices, measurement meters, etc.) into

    a fuzzyvalue

    A crisp value = A fuzzy singleton (no

    fuzziness is introduced)

    x0: Crisp Value

    Fuzzy singleton

    A(x)

    A(x)

    x0

    1

  • 8/3/2019 Fuzzy Logic Theory

    35/51

    Institute of Intelligent Power Electronics IPEPage 35

    Mamdani Fuzzy Inference Systems

    Mamdani fuzzy inference systems

    IF x is A THEN y is B Both premise and consequent parts

    consist of fuzzy membership functions

    Max-Mincomposition can be applied infuzzy reasoning procedure

    Mamdani Fuzzy Inference Systems

  • 8/3/2019 Fuzzy Logic Theory

    36/51

    Institute of Intelligent Power Electronics IPEPage 36

    Mamdani Fuzzy Inference Systems

    If X is A1 and Y is B1 THEN Z is C1

    If X is A2 and Y is B2 THEN Z is C2

    x and y are two input values

    Defuzzification Methods

  • 8/3/2019 Fuzzy Logic Theory

    37/51

    Institute of Intelligent Power Electronics IPEPage 37

    Defuzzification Methods

    D f ifi ti M th d

  • 8/3/2019 Fuzzy Logic Theory

    38/51

    Institute of Intelligent Power Electronics IPEPage 38

    Defuzzification Methods

    Centroid of Area (COA)

    where is a crisp output

    Bisector of Area (BOA)

    where is a crisp output

    ZCOA*

    =

    A (xi)xii=1

    n

    A (x i)i=1

    n

    A (xi)i=1

    M

    = A (x j)j=M+1

    n

    ZBisec t* = xM

    *

    COAZ

    Defuzzification Methods

  • 8/3/2019 Fuzzy Logic Theory

    39/51

    Institute of Intelligent Power Electronics IPEPage 39

    Defuzzification Methods

    Mean of Maximum (MOM)

    where reaches maximal values of

    MOM could generatate wrong discreteoutputs in certain cases

    Different defuzzification methods mayhave similarperformances [Lee 88]

    ZMOM* =

    xi*

    i

    N

    N

    A (xi*) A (x)

    Mamdani F Model An E ample

  • 8/3/2019 Fuzzy Logic Theory

    40/51

    Institute of Intelligent Power Electronics IPEPage 40

    Mamdani Fuzzy Model: An Example

    A Two-Input and Single-Output Mamdanifuzzy logic system with four rules

    IF X is small and Y is small THEN Z is large negative

    IF X is small and Y is large THEN Z is small negative

    IF X is large and Y is small THEN Z is small positive

    IF X is large and Y is large THEN Z is large positive

    Fuzzy Input and Output

  • 8/3/2019 Fuzzy Logic Theory

    41/51

    Institute of Intelligent Power Electronics IPEPage 41

    y p p

    Membership Functions

    -5 -4 -3 -2 -1 0 1 2 3 4 50

    0.5

    1

    X

    MembershipGrades small large

    -5 -4 -3 -2 -1 0 1 2 3 4 50

    0.5

    1

    Y

    Mem

    bershipGrades small large

    -5 -4 -3 -2 -1 0 1 2 3 4 50

    0.5

    1

    Z

    MembershipGrades large negative small negative small positive large positive

    Mamdani Input/Output Surface

  • 8/3/2019 Fuzzy Logic Theory

    42/51

    Institute of Intelligent Power Electronics IPEPage 42

    Mamdani Input/Output Surface

    -5

    0

    5

    -5

    0

    5

    -3

    -2

    -1

    0

    1

    2

    3

    XY

    Z

    NonlinearInput/Output

    Surface

    Sugeno Fuzzy Inference Systems

  • 8/3/2019 Fuzzy Logic Theory

    43/51

    Institute of Intelligent Power Electronics IPEPage 43

    Sugeno Fuzzy Inference Systems

    Sugeno fuzzy inference systems

    IF x is A THEN y = f(x)

    Only premisepart employs fuzzymembership functions

    Consequent output is a functionof inputvariables

    First order = linear consequent part

    Higher orders = nonlinear consequent part

    Sugeno Fuzzy Inference Systems

  • 8/3/2019 Fuzzy Logic Theory

    44/51

    Institute of Intelligent Power Electronics IPEPage 44

    Sugeno Fuzzy Inference Systems

    If X is A1 and Y is B1

    THEN Z = p1x+q1y+c1

    If X is A2 and Y is B2THEN Z = p2x+q2y+c2

    First Order Sugeno Inference System

    Z: Output

    S F I f S t

  • 8/3/2019 Fuzzy Logic Theory

    45/51

    Institute of Intelligent Power Electronics IPEPage 45

    Sugeno Fuzzy Inference Systems

    Advantages:

    Nodefuzzification method is needed Easy to analyze

    linearwith respect to consequent parameters

    (only first order consequent part case)

    Disadvantages

    Difficult to interpret practical meanings ofconsequent part

    Sugeno Fuzzy Model: An Example

  • 8/3/2019 Fuzzy Logic Theory

    46/51

    Institute of Intelligent Power Electronics IPEPage 46

    Sugeno Fuzzy Model: An Example

    A Two-Input and Single-Output Sugeno

    fuzzy logic system with four rules

    IF X is small and Y is small THEN z = -x+y+1

    IF X is small and Y is large THEN z = -y+3 IF X is large and Y is small THEN z = -x+3

    IF X is large and Y is large THEN z = -x+y+2

    Fuzzy Input Membership Functions

  • 8/3/2019 Fuzzy Logic Theory

    47/51

    Institute of Intelligent Power Electronics IPEPage 47

    Fuzzy Input Membership Functions

    -5 -4 -3 -2 -1 0 1 2 3 4 50

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    X

    M

    embershipGrades

    Small Large

    -5 -4 -3 -2 -1 0 1 2 3 4 50

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    Y

    MembershipGrades

    Small Large

    Sugeno Input/Output Surface

  • 8/3/2019 Fuzzy Logic Theory

    48/51

    Institute of Intelligent Power Electronics IPEPage 48

    Sugeno Input/Output Surface

    -5

    0

    5

    -5

    0

    5

    -2

    0

    2

    4

    6

    8

    10

    XY

    Z NonlinearInput/Output

    Surface

    Diagram of A Fuzzy Logic System

  • 8/3/2019 Fuzzy Logic Theory

    49/51

    Institute of Intelligent Power Electronics IPEPage 49

    Diagram of A Fuzzy Logic System

    Conclusions

  • 8/3/2019 Fuzzy Logic Theory

    50/51

    Institute of Intelligent Power Electronics IPEPage 50

    Conclusions

    Background knowledge of fuzzy sets isintroduced

    Concept of fuzzy sets is basically anaturalgeneralization of classical sets

    Fuzzy sets have some characteristicsdifferent from classical sets

    Fuzzy inference systems are used tomodel human thinking

    Conclusions

  • 8/3/2019 Fuzzy Logic Theory

    51/51

    Institute of Intelligent Power Electronics IPEPage 51

    Two fuzzy logic systems: Mamdani andSugeno types

    Engineering potential is more importantthan pure theoretical research

    Applications of fuzzy logic and fusion

    with neural networks will be discussedlater

    Fuzzy control and fuzzy signal filtering Fuzzy neural networks