Вы находитесь на странице: 1из 28

www.Vidyarthiplus.

com

UNIT-4

FUZZY LOGIC CONTROL

www.Vidyarthiplus.com

Fuzzy Membership Functions


Fuzzy Operations
Fuzzy Union
Fuzzy Intersection
Fuzzy Complement
2

www.Vidyarthiplus.com

Some info for LAB


Work on an m-file (open m-file for each task,
write your programme, save the file (e.g.,
lab2task1), then execute the file. Now, this file
has become a function in MATLAB). (see the first
weeks slides - Week 1).
Use help <function> (e.g., help newfis) if you
dont know how to use the function. It gives you
information about how to use the function and
what parameters it requires
3

www.Vidyarthiplus.com

Fuzzy Membership Functions


One of the key issues in all fuzzy sets is how to
determine fuzzy membership functions
The membership function fully defines the fuzzy set
A membership function provides a measure of the
degree of similarity of an element to a fuzzy set
Membership functions can take any form, but there
are some common examples that appear in real
applications

www.Vidyarthiplus.com

Membership functions can


either be chosen by the user arbitrarily, based on
the users experience (MF chosen by two users
could be different depending upon their
experiences, perspectives, etc.)
Or be designed using machine learning methods
(e.g., artificial neural networks, genetic
algorithms, etc.)

There are different shapes of membership


functions; triangular, trapezoidal, piecewiselinear, Gaussian, bell-shaped, etc.

www.Vidyarthiplus.com

Triangular membership function


a, b and c represent the x coordinates of the three vertices
of A(x) in a fuzzy set A (a: lower boundary and c: upper
boundary where membership degree is zero, b: the centre
where membership degree is 1)

A(x)
1

0
x a

A ( x) = b a
c x
c b
0

if a x b

if b x c

if x c

if x a

www.Vidyarthiplus.com

Gaussian membership function


1 xc
A ( x, c, s, m) = exp
2 s
c: centre

s: width
m: fuzzification factor (e.g., m=2)

A(x)

c=5

0.9
0.8
0.7

s=2

0.6
0.5

m=2

0.4
0.3
0.2
0.1
0

10

x
7

www.Vidyarthiplus.com
1
0.9
0.8

c=5

0.7
0.6

s=0.5

0.5
0.4
0.3

m=2

0.2
0.1
0

10

1
0.9

c=5

0.8
0.7
0.6

s=5

0.5
0.4
0.3

m=2

0.2
0.1
0

10

www.Vidyarthiplus.com
1

0.9

c=5

0.8

0.7

s=2

0.6

m=0.2

0.5

0.4

0.3

10

1
0.9

c=5

0.8
0.7
0.6

s=5

0.5
0.4

m=5

0.3
0.2
0.1
0

10

www.Vidyarthiplus.com

Fuzzy Operations
(Fuzzy Union, Intersection, and Complement)
Fuzzy logic begins by barrowing notions from crisp logic, just as
fuzzy set theory borrows from crisp set theory. As in our extension
of crisp set theory to fuzzy set theory, our extension of crisp logic to
fuzzy logic is made by replacing membership functions of crisp
logic with fuzzy membership functions [J.M. Mendel, Uncertain RuleBased Fuzzy Logic Systems, 2001]

In Fuzzy Logic, intersection, union and complement are defined in


terms of their membership functions
This section concentrates on providing enough of a theoretical base
for you to be able to implement computer systems that use fuzzy
logic
Fuzzy intersection and union correspond to AND and OR,
respectively, in classic/crisp/Boolean logic
These two operators will become important later as they are the
building blocks for us to be able to compute with fuzzy if-then rules
10

www.Vidyarthiplus.com

Classic/Crisp/Boolean Logic
Logical AND ()

Logical OR (U)

Truth Table
A
0
0
1
1

B
0
1
0
1

AB
0
0
0
1

A
B

Crisp Intersection

A
0
0
1
1

Truth Table
B
AUB
0
0
1
1
0
1
1
1

A
B

Crisp Union
11

www.Vidyarthiplus.com

Fuzzy Union
The union (OR) is calculated using t-conorms
t-conorm operator is a function s(.,.)
Its features are

s(1,1) = 1, s(a,0) = s(0,a) = a (boundary)


s(a,b) s(c,d) if a c and b d (monotonicity)
s(a,b) = s(b,a) (commutativity)
s(a,s(b,c)) = s(s(a,b),c) (associativity)

The most commonly used method for fuzzy union is to


take the maximum. That is, given two fuzzy sets A and B
with membership functions A(x) and B(x)
AUB ( x) = max( A ( x), B ( x))
12

www.Vidyarthiplus.com

Fuzzy Intersection
The intersection (AND) is calculated using t-norms.
t-norm operator is a function t(.,.)
Its features

t(0,0) = 0, t(a,1) = t(1,a) = a (boundary)


t(a,b) t(c,d) if a c and b d (monotonicity)
t(a,b) = t(b,a) (commutativity)
t(a, t(b,c)) = t(t(a,b),c) (associativity)

The most commonly adopted t-norm is the minimum.


That is, given two fuzzy sets A and B with membership
functions A(x) and B(x)
AB ( x) = min( A ( x), B ( x))
13

www.Vidyarthiplus.com

Fuzzy Complement
To be able to develop fuzzy systems we also have
to deal with NOT or complement.
This is the same in fuzzy logic as for Boolean
logic
For a fuzzy set A, A denotes the fuzzy
complement of A
Membership function for fuzzy complement is
( x) = 1 A ( x)
A

14

www.Vidyarthiplus.com

4.2 Knowledge Base


1. The database provides necessary
definitions that are used to define
linguistic variables and fuzzy data
manipulation in the FLC.
2. The rule base characterizes the
control goals and control policy by
means of a set of linguistic control
rules.
15

www.Vidyarthiplus.com

5.2 Knowledge Base


NL

NM

NS

ZE

PS

PM

-1

-0 .5

0
ERROR

0 .5

PL

De gre e of m e m be rship

0 .8

0 .6

0 .4

0 .2

0
-2

Fig. 4(a)

-1 .5

1 .5

Membership functions for Error

16

www.Vidyarthiplus.com

5.2 Knowledge Base Cont.


NL

NM

NS

ZE

PS

PM

PL

De gre e of m e m be rship

0 .8

0 .6

0 .4

0 .2

0
-0 .5

-0 .4

-0 .3

-0 .2

-0 .1

0 .1

0 .2

0 .3

0 .4

0 .5

C H A N G E IN E R R O R

Fig. 4(b) Membership functions for Change in Error

17

www.Vidyarthiplus.com

5.2 Knowledge Base Cont.


NL

NM

NS

ZE

PS

PM

PL

De gre e of m e m be rship

0 .8

0 .6

0 .4

0 .2

0
-0 .0 3

- 0 .0 2

-0 .0 1
CHANGE

0
IN

0 .0 1

0 .0 2

0 .0 3

OUTPUT

Fig. 4(c) Membership functions for Change in Output


18

www.Vidyarthiplus.com

4.3 Decision Making Logic


Based on the fuzzified inputs and rule
base, fuzzy output is determined by
applying the rules of Boolean Algebra
(Union and Intersection).

19

www.Vidyarthiplus.com

Genetic Algorithms (GA) OVERVIEW


A class of probabilistic optimization algorithms
Inspired by the biological evolution process
Uses concepts of Natural Selection and Genetic
Inheritance (Darwin 1859)
Originally developed by John Holland (1975)
Particularly well suited for hard problems where
little is known about the underlying search space
Widely-used in business, science and engineering

20

www.Vidyarthiplus.com

Classes of Search Techniques


Search Techniqes

Calculus Base
Techniqes

Fibonacci

Enumerative
Techniqes

Guided random search


techniqes

Sort

Tabu Search

DFS

Hill Climbing

Simulated
Anealing

Genetic
Programming

Dynamic
Programming

BFS

Evolutionary
Algorithms

Genetic
Algorithms

21

www.Vidyarthiplus.com

A genetic algorithm maintains a population of


candidate solutions for the problem at hand,
and
makes
it
evolve
by
iteratively applying a set of stochastic
operators.

22

www.Vidyarthiplus.com

Stochastic operators
Selection replicates the most successful solutions
found in a population at a rate proportional to
their relative quality
Recombination (Crossover) decomposes two
distinct solutions and then randomly mixes their
parts to form novel solutions
Mutation randomly perturbs a candidate solution

23

www.Vidyarthiplus.com

Simple Genetic Algorithm


{

initialize population;
evaluate population;
while TerminationCriteriaNotSatisfied
{

select parents for reproduction;


perform recombination and mutation;
evaluate population;
}
}

24

www.Vidyarthiplus.com

The Evolutionary Cycle


parents

selection

modification
modified
offspring

initiate &
evaluate

population

evaluated offspring

evaluation
deleted
members

discard
25

www.Vidyarthiplus.com

GA Cycle

26

www.Vidyarthiplus.com

Crossover

27

www.Vidyarthiplus.com

Mutation

28

Вам также может понравиться