24.08.2013 Views

fuzzy system

fuzzy system

fuzzy system

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Fakultät ETIT Institut für Automatisierungstechnik, Professur für Prozessleittechnik<br />

26.01.2010<br />

Dr. Engin YEŞİL<br />

Introduction to<br />

Fuzzy Modeling & Control


Fuzzy Systems:<br />

•<br />

•<br />

A static or dynamic <strong>system</strong> which makes use of <strong>fuzzy</strong><br />

sets or <strong>fuzzy</strong> logic and of the corresponding<br />

mathematical framework is called a <strong>fuzzy</strong> <strong>system</strong>. <strong>system</strong><br />

There are a number of ways <strong>fuzzy</strong> sets can be<br />

involved in a <strong>system</strong>, such as:<br />

1. In the description of the <strong>system</strong>,<br />

2. In the specification of the <strong>system</strong>’s parameters,<br />

3. The input, output and state variables of a <strong>system</strong> may<br />

be <strong>fuzzy</strong> sets.<br />

Folie 2


1.<br />

•<br />

•<br />

In the description of the <strong>system</strong>:<br />

A <strong>system</strong> can be defined, for instance, as a collection<br />

of IF-THEN IF THEN rules with <strong>fuzzy</strong> predicates, or as a <strong>fuzzy</strong><br />

relation.<br />

An example of a <strong>fuzzy</strong> rule describing the relationship<br />

between a heating power and the temperature trend<br />

in a room may be:<br />

If the heating power is high<br />

then the temperature will increase fast<br />

Folie 3


2.<br />

•<br />

In the specification of the <strong>system</strong>’s parameters:<br />

The <strong>system</strong> can be defined by an algebraic or<br />

differential equation, in which the parameters are<br />

<strong>fuzzy</strong> numbers instead of real numbers.<br />

“Almost<br />

3”<br />

“About<br />

3 5<br />

•Fuzzy numbers express the uncertainty in the<br />

parameter values.<br />

5”<br />

Folie 4


3.<br />

•<br />

•<br />

The input, output and state variables of a <strong>system</strong><br />

may be <strong>fuzzy</strong> sets:<br />

Fuzzy inputs can be readings from unreliable sensors<br />

(“noisy” data), or quantities related to human<br />

perception, such as comfort, beauty, etc.<br />

Fuzzy <strong>system</strong>s can process such information, which is<br />

not the case with conventional (crisp) <strong>system</strong>s.<br />

Folie 5


Crisp and <strong>fuzzy</strong> information in <strong>system</strong>s<br />

Folie 6


Fuzzy Systems<br />

•<br />

•<br />

•<br />

Fuzzy <strong>system</strong>s can be regarded as a generalization of<br />

interval-valued <strong>system</strong>s, which are in turn a<br />

generalization of crisp <strong>system</strong>s.<br />

Note that a function f:XY can be regarded as a<br />

subset of the Cartesian product X x Y , i.e., as a<br />

relation.<br />

The evaluation of the function for a given input<br />

proceeds in three steps:<br />

1. extend the given input into the product space X x Y<br />

2. find the intersection of this extension with the<br />

relation,<br />

3.project this intersection onto Y.<br />

Folie 7


crisp function<br />

interval function<br />

<strong>fuzzy</strong> function<br />

Folie 8


•<br />

•<br />

•<br />

•<br />

Fuzzy Systems<br />

Most common are <strong>fuzzy</strong> <strong>system</strong>s defined by means of<br />

if-then rules: rule-based <strong>fuzzy</strong> <strong>system</strong>s.<br />

In the rest of this lecture we will focus on these<br />

<strong>system</strong>s only.<br />

Fuzzy <strong>system</strong>s can serve different purposes, such as<br />

– modeling,<br />

– data analysis,<br />

– prediction or<br />

– control.<br />

Here, a <strong>fuzzy</strong> rule-based <strong>system</strong> is for simplicity called<br />

a <strong>fuzzy</strong> model, model regardless of its eventual purpose.<br />

Folie 9


Input<br />

Scaling<br />

Factor<br />

Components of a Fuzzy Systems<br />

CRISP<br />

Fuzzifier<br />

Fuzzy Rule-Base<br />

Fuzzy<br />

Inference<br />

Engine<br />

FUZZY FUZZY<br />

Defuzzifier<br />

CRISP<br />

Output<br />

Scaling<br />

Factor<br />

Folie 10


•<br />

•<br />

•<br />

In <strong>fuzzy</strong> <strong>system</strong>s, the relationships between variables are<br />

represented by means of <strong>fuzzy</strong> “IF-THEN” rules of the<br />

following general form:<br />

IF antecedent proposition<br />

THEN consequent proposition<br />

The antecedent proposition is always a <strong>fuzzy</strong> proposition of<br />

the type “x is A” where x is a linguistic variable and A is a<br />

linguistic term.<br />

The proposition’s truth value (a real number between zero<br />

and one) depends on the degree of match (similarity)<br />

between x and A.<br />

Folie 11


•<br />

<br />

<br />

<br />

<br />

Depending on the form of the consequent, four types of<br />

rule-based <strong>fuzzy</strong> models are distinguished:<br />

Mamdani (Linguistic) <strong>fuzzy</strong> model,<br />

Singleton <strong>fuzzy</strong> model,<br />

Takagi-Sugeno (T-S) <strong>fuzzy</strong> model,<br />

(Tsukamoto <strong>fuzzy</strong> model).<br />

Folie 12


•<br />

Mamdani (Linguistic) <strong>fuzzy</strong> model:<br />

The linguistic <strong>fuzzy</strong> model (Zadeh, 1973; Mamdani, 1977)<br />

has been introduced as a way to capture available (semi-)<br />

qualitative knowledge in the form of if–then rules:<br />

The input<br />

(antecedent)<br />

linguistic variable<br />

The antecedent<br />

linguistic terms<br />

The consequent<br />

linguistic terms<br />

The output (consequent)<br />

linguistic variable<br />

Folie 13


More examples?<br />

•<br />

•<br />

•<br />

•<br />

If<br />

the pressure is HIGH then<br />

If you are CLOSE to the other car then<br />

If the room is VERY COLD then<br />

to FULL<br />

the volume is SMALL<br />

brake is MAX<br />

switch on the heater<br />

If the error is ZERO and the change of the error is<br />

ZERO then the change in control signal is ZERO<br />

Folie 14


•<br />

•<br />

•<br />

Fuzzy logic operators, such as the conjunction,<br />

disjunction and negation (complement), can be used to<br />

combine the propositions.<br />

A MIMO model can be written as a set of MISO models.<br />

Therefore, for the ease of notation, we will write the<br />

rules for MISO <strong>system</strong>s.<br />

Most common is the conjunctive form of the antecedent,<br />

which is given by:<br />

Folie 15


Example<br />

Max-min composition<br />

R1<br />

R2<br />

R3<br />

: If X is small then Y is small<br />

: If X is medium then Y is medium<br />

: If X is large then Y is large<br />

and centroid<br />

X = input [10, 10]<br />

Y = output [0, 10]<br />

defuzzification were used.<br />

Overall input-output curve<br />

Folie 16


Example<br />

Max-min composition<br />

X,<br />

Y,<br />

Z <br />

[5, 5]<br />

R1: If X is small and Y is small then Z is negative large<br />

R2: If X is small and Y is large then Z is negative small<br />

R3: If X is large and Y is small then Z is positive small<br />

R4: If X is large and Y is large then Z is positive large<br />

and centroid<br />

defuzzification were used.<br />

Overall input-output curve<br />

Folie 17


•<br />

•<br />

Singleton <strong>fuzzy</strong> model:<br />

A special case of the linguistic <strong>fuzzy</strong> model is obtained<br />

when the consequent <strong>fuzzy</strong> sets Bi are singleton <strong>fuzzy</strong><br />

sets.<br />

These sets can be represented simply as real numbers,<br />

yielding the following rules:<br />

Folie 18


•<br />

•<br />

Takagi-Sugeno <strong>fuzzy</strong> model:<br />

The Takagi–Sugeno (T-S) <strong>fuzzy</strong> model (Takagi and<br />

Sugeno, 1985), uses crisp functions in the consequents.<br />

Hence, it can be seen as a combination of linguistic and<br />

mathematical regression modeling in the sense that the<br />

antecedents describe <strong>fuzzy</strong> regions in the input space in<br />

which consequent functions are valid. The T-S rules have<br />

the following form:<br />

Folie 19


•<br />

•<br />

The functions fi are typically of the same structure, only<br />

the parameters in each rule are different.<br />

Generally, fi is a vector-valued function, but for the ease of<br />

notation we will consider a scalar fi in the sequel. A simple<br />

and practically useful parameterization is the affine (linear<br />

in parameters) form, yielding the rules:<br />

What happens when a i is ZERO?<br />

Folie 20


60<br />

50<br />

40<br />

30<br />

20<br />

10<br />

0<br />

1.2<br />

1<br />

0.8<br />

0.6<br />

0.4<br />

0.2<br />

f 2(x)<br />

How do you define this function?<br />

f 1(x)<br />

0 1 2 3 4 5 6 7<br />

Small Big<br />

0<br />

0 1 2 3 4 5 6 7<br />

RULE 1:<br />

IF x is Small<br />

RULE 2:<br />

IF x is Big<br />

THEN y(x)=f1(s) THEN y(x)=f2(s) Folie 21


Example<br />

R1: If X is small then Y = 0.1X + 6.4<br />

R2: If X is medium then Y = 0.5X + 4<br />

R3: If X is large then Y = X – 2<br />

X = input <br />

unsmooth<br />

[10, 10]<br />

Folie 22


Example<br />

R1: If X is small then Y = 0.1X + 6.4<br />

R2: If X is medium then Y = 0.5X + 4<br />

R3: If X is large then Y = X – 2<br />

X = input [10, 10]<br />

If we have smooth membership functions (<strong>fuzzy</strong> rules) the<br />

overall input-output curve becomes a smoother one.<br />

Folie 23


Example<br />

X, Y [5, 5]<br />

R1: if X is small and Y is small then z = x +y +1<br />

R2: if X is small and Y is large then z = y +3<br />

R3: if X is large and Y is small then z = x +3<br />

R4: if X is large and Y is large then z = x + y + 2<br />

Folie 24


What defines the size of the rule-base?<br />

An example:<br />

# of inputs 3: A, B, C<br />

# of outputs 1: D<br />

# of membership functions for each inputs:<br />

• A 5<br />

• B 3<br />

• C 4<br />

How many rules do you need?<br />

Folie 25


MIMO -<br />

•<br />

MISO<br />

Note that the above model is a special case of<br />

as the <strong>fuzzy</strong> set Ai in (1) is obtained as the Cartesian<br />

product of <strong>fuzzy</strong> sets.<br />

Folie 26


•<br />

•<br />

•<br />

A set of rules in the conjunctive<br />

antecedent form divides the input<br />

domain into a lattice of <strong>fuzzy</strong><br />

hyperboxes, parallel with the axes.<br />

Each of the hyperboxes is an Cartesian<br />

product-space intersection of the<br />

corresponding univariate <strong>fuzzy</strong> sets.<br />

The number of rules in the conjunctive<br />

form, needed to cover the entire<br />

domain.<br />

K<br />

<br />

<br />

p<br />

i1<br />

p is the dimension of the input space, and Ni is the number of linguistic<br />

terms of the ith antecedent variable.<br />

N<br />

i<br />

Folie 27


•<br />

•<br />

By combining<br />

– conjunctions,<br />

– disjunctions,<br />

– negations<br />

various partitions of the antecedent<br />

space can be obtained.<br />

The boundaries are, however,<br />

restricted to the rectangular grid<br />

defined by the <strong>fuzzy</strong> sets of the<br />

individual variables.<br />

<br />

β <br />

1<br />

μ A ( x1<br />

) μ A ( x 2 )<br />

13 21<br />

<br />

Folie 28


•<br />

•<br />

•<br />

•<br />

The antecedent form with multivariate<br />

membership functions is the most general<br />

one, as there is no restriction on the<br />

shape of the <strong>fuzzy</strong> regions.<br />

The boundaries between these regions can<br />

be arbitrarily curved and opaque to the<br />

axes.<br />

Also the number of <strong>fuzzy</strong> sets needed to<br />

cover the antecedent space may be much<br />

smaller than in the previous cases.<br />

Hence, for complex multivariable <strong>system</strong>s,<br />

this partition may provide the most<br />

effective representation.<br />

Folie 29


Decomposition<br />

•<br />

•<br />

•<br />

Another way to reducing the complexity of<br />

multivariable <strong>fuzzy</strong> <strong>system</strong>s is the decomposition into<br />

sub<strong>system</strong>s with fewer inputs per rule base.<br />

The sub<strong>system</strong>s can be inter-connected in a<br />

hierarchical (multi-layer) structure.<br />

This cascade connection will lead to the reduction of<br />

the total number of rules.<br />

Folie 30


Fuzzification<br />

•<br />

•<br />

•<br />

The first stage in the <strong>fuzzy</strong> <strong>system</strong> computations is to<br />

transform the numeric inputs into <strong>fuzzy</strong> sets.<br />

This operation is called fuzzification.<br />

fuzzification<br />

A Fuzzifier, Fuzzifier F, converts a numeric value, x* into a<br />

<strong>fuzzy</strong> set. We require that the <strong>fuzzy</strong> set fulfills the<br />

following axioms:<br />

Folie 31


Types of fuzzifiers:<br />

1.<br />

2.<br />

Singleton Fuzzifiers:<br />

Non-Singleton Fuzzifiers:<br />

•<br />

•<br />

•<br />

Triangular<br />

Gaussian<br />

…<br />

• The singleton fuzzifier is predominant in <strong>fuzzy</strong> control.<br />

• The main reason for this is that this fuzzifier simplifies the<br />

computations in the <strong>fuzzy</strong> <strong>system</strong> considerably.<br />

Folie 32


Defuzzification<br />

•<br />

•<br />

•<br />

The result of the inference process is an output<br />

represented by a <strong>fuzzy</strong> set. As discussed previously,<br />

the output of the <strong>fuzzy</strong> <strong>system</strong> should be a numeric<br />

value.<br />

The transformation of a <strong>fuzzy</strong> set into a numeric value<br />

is called defuzzification.<br />

defuzzification<br />

A Defuzzifier<br />

Defuzzifier, D, maps a <strong>fuzzy</strong> set into a numeric<br />

value y*. We require the defuzzification operation to<br />

fulfill the following axiom:<br />

Folie 33


•<br />

1.<br />

Types of defuzzifiers:<br />

Several defuzzification operations have been suggested in<br />

the literature.<br />

The Center of Gravity<br />

(COG) defuzzifier specifies the<br />

numeric value to be the center of gravity of the <strong>fuzzy</strong> set.<br />

Folie 34


Types of defuzzifiers:<br />

2.<br />

The Center Average<br />

(CA) defuzzifier specifies the<br />

numeric value to be the weighted average of the centers,<br />

ў (l) of the individual consequent <strong>fuzzy</strong> sets.<br />

The weights, w (l) are equal to the height of the respective<br />

<strong>fuzzy</strong> sets.<br />

Folie 35


Types of defuzzifiers:<br />

3.<br />

Maximum defuzzifiers determines y* as a point in the<br />

interval IM where the <strong>fuzzy</strong> set has its maximum<br />

value.<br />

Since the defuzzifier should infer a unique output,<br />

there are three different Maximum defuzzifiers<br />

Folie 36


Types of defuzzifiers:<br />

There are several factors which can influence the choice of<br />

defuzzifier. We may for instance require that the defuzzifier<br />

produces a plausible result in computationally simple<br />

way.<br />

Folie 37


Scaling Factors<br />

•<br />

•<br />

The input/output scaling factors may be used for<br />

normalization of the input/output.<br />

For the design of a <strong>fuzzy</strong> controller, the scaling factors<br />

act like the controller gains. Therefore, they have an<br />

important effect on the <strong>system</strong> performance and<br />

stability.<br />

Folie 38


Fuzzy System (Overview)<br />

A <strong>fuzzy</strong> <strong>system</strong> of class , consists of<br />

a rule base<br />

a fuzzifier<br />

an inference engine<br />

a defuzzifier<br />

Folie 39


Let’s design a Fuzzy System!!!<br />

Folie 40


Folie 41


Time<br />

Distance<br />

Close Average Far<br />

A bit late Medium Little Little<br />

Late High High Medium<br />

Folie 42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!