Upload
hoangtu
View
220
Download
3
Embed Size (px)
Citation preview
Fuzzy Control
Dr. Shahram Javadi Assistant Professor of Electrical Engineering dept. [email protected] Subject: FUZZY-CONTROL
Islamic Azad University Central Tehran Branch
1
Text Book
Islamic Azad University Central Tehran Branch
2
3
1- Introduction An Historical Perspective Limitations of Fuzzy Systems Uncertainty and Information Fuzzy Sets and Membership Chance versus Fuzziness
2- Classical Sets and Fuzzy Sets Classical Sets Operations on Classical Sets Properties of Classical (Crisp) Sets Fuzzy Sets
3- Classical Relations and Fuzzy Relations Crisp Relations Composition Fuzzy Relations Fuzzy Cartesian Product and Composition
4- Properties of Membership Functions, Fuzzification, and Defuzzification
Features of the Membership Function Fuzzification Defuzzification to Crisp Sets λ-cuts for Fuzzy Relations Defuzzification to Scalars
Syllabus Outline
4
5- Logic and Fuzzy Systems
Classical Logic Fuzzy Logic Approximate Reasoning Natural Language Linguistic Hedges Fuzzy (Rule-Based) Systems
6- Development of Membership Functions 7- Fuzzy Arithmetic and the Extension Principle
Extension Principle Crisp Functions, Mapping, and Relations Functions of Fuzzy Sets – Extension Principle Fuzzy Transform (Mapping) Fuzzy Arithmetic Approximate Methods of Extension (Vertex Method, DSW Algorithm, Restricted DSW algorithm)
8- Fuzzy Control Systems
Control System Design Problem Control (Decision) Surface Fuzzy Control
Syllabus Outline (cont.)
Islamic Azad University Central Tehran Branch
5
1- INTRODUCTION
6
HISTORICAL PERSPECTIVE
Newtonian mechanics (considered no uncertainty)
Statistical mechanics described by a probability theory
(uncertainty)
The leading theory in quantifying uncertainty in scientific models from the late nineteenth century until the late twentieth century had been
probability theory! The gradual evolution of the expression of uncertainty using probability theory was challenged, first in 1937 by Max Black, with his studies in
Vagueness!
With introduction of fuzzy sets by Lotfi Zadeh in 1965, it had a profound influence on the thinking about uncertainty because it challenged not only probability theory as the sole representation for uncertainty, but the very foundations upon which probability theory was based: classical binary (two-valued) logic.
7
Probability theory dominated the mathematics of uncertainty for over five centuries (1500s-2000s)
The twentieth century saw the first developments of alternatives to probability theory and to classical Aristotelian logic as paradigms to address more kinds of uncertainty than just the random kind
Jan Lukasiewicz developed a multivalued, discrete logic (1930). In the 1960’s Arthur Dempster developed a theory of evidence In 1965 Lotfi Zadeh introduced his seminal idea in a continuous-valued
logic that he called fuzzy set theory. In the 1970s Glenn Shafer extended Dempster’s work to produce a
complete theory of evidence dealing with information from more than one source
Later in the 1980s other investigators showed a strong relationship between evidence theory, probability theory, and possibility theory with the use of what was called fuzzy measures
HISTORICAL PERSPECTIVE (cont.)
8
Uncertainty can be manifested in many forms:
Fuzzy (not sharp, unclear, imprecise, approximate)
Vague (not specific, amorphous)
Ambiguous (too many choices, contradictory)
Ignorance (dissonant, not knowing something)
Natural variability (conflicting, random, chaotic, unpredictable)
Uncertainty
9
Uncertainty can be manifested in many forms:
‘‘I shall return soon’’ is vague not known to be associated with any unit of time (seconds, hours, days)
‘‘I shall return in a few minutes’’ is fuzzy associated with an uncertainty that is at least known to be on the order of minutes.
‘‘I shall return within 2 minutes of 6pm’’ involves an uncertainty which has a quantifiable imprecision
Uncertainty
10
11
12
Fuzzy Logic : An Idea
14
Operates Independently of Probability
Probability theory measures how likely the proposition is to be correct.
Fuzzy logic measures the degree of correctness to which the proposition is correct.
Probability vs. Fuzzy Logic
15
The important distinction between probabilistic information and fuzzy logic is that there is no uncertainty about the fullness of the glass but rather about the degree to which it matches the category ‘full' .
Many terms/fuzzy sets, such as 'tall,' 'rich,' 'famous‘ or ‘full,' are valid only to a certain degree when applied to a particular individual or situation.
Fuzzy logic tries to measure that degree and to allow computers to manipulate such information.
Probability vs. Fuzzy Logic
What is fuzzy?
A dictionary definition 1. Of or resembling fuzz. 2. Not clear; indistinct: a fuzzy recollection of past
events. 3. Not coherent; confused: a fuzzy plan of action. 4. Covered with fuzz.
And so what is a Fuzzy Set? a not clear Set?
16
Why Use Fuzzy Logic?
17
Fuzzy logic is conceptually easy to understand. Fuzzy logic is flexible. Fuzzy logic is tolerant of imprecise data. Fuzzy logic can model nonlinear functions of arbitrary
complexity. Fuzzy logic can be built on top of the experience of experts. Fuzzy logic can be blended with conventional control
techniques. Fuzzy logic is based on natural language.
Fuzzy logic keeps you from bogging down in unnecessary detail. It’s all a matter of perspective. Life is complicated enough already.
18
Fuzzy Sets
Proposed by Ladeh Zadeh in 1965 , "Fuzzy sets," Information and Control, vol. 8, pp. 338--353, 1965.
A generalization of set theory that allows partial membership in a set. Membership is a real number with a range [0, 1]
Membership functions are commonly triangular or Gaussian because ease of computation.
Utility comes from overlapping membership functions – a value can belong to more than one set
19
Definition
As the complexity of a system increases, it becomes more difficult and eventually impossible to make a precise statement about its behavior.
Provides a very precise approach for dealing with uncertainty which grows out of the complexity of human behavior.
20
21
Precise versus fuzzy statement
John is tall John if 180Cm. If John is on the basket ball team:
He is 210Cm. It is cold outside. In the winter
It is -10° C outside. In the summer:
It is 40° C outside. In the summer in northern Canada
It is 20° C outside.
22
Range of logical values in Boolean and fuzzy logic
23
The classical example in fuzzy sets is tall men. The elements of the fuzzy set “tall men” are all men, but their degrees of membership depend on their height.
Degree of MembershipFuzzy
MarkJohnTom
Bob
Bill
11100
1.001.000.980.820.78
Peter
Steven
MikeDavid
ChrisCrisp
1
0000
0.240.150.060.010.00
Name Height, cm
205198181
167
155152
158
172179
208
24
150 210170 180 190 200160Height, cm
Degree ofMembership
Tall Men
150 210180 190 200
1.0
0.0
0.2
0.4
0.6
0.8
160
Degree ofMembership
170
1.0
0.0
0.2
0.4
0.6
0.8
Height, cm
Fuzzy Sets
Crisp Sets
Crisp and fuzzy sets of “tall men”
25
Fuzzy Control
Dr. Shahram Javadi Assistant Professor of Electrical Engineering dept. [email protected]
Islamic Azad University Central Tehran Branch
1
Islamic Azad University Central Tehran Branch
2
2- Classical Sets and Fuzzy Sets
Let X be the universe of discourse and its elements be denoted as x. In
the classical set theory, crisp set A of X is defined as function fA(x) called the characteristic function of A
fA(x): X → {0, 1}, where
∉∈
=AxAx
xf A if0, if 1,
)(
3
Classical set
χA : X → {0, 1}.
A fuzzy set is a set with fuzzy boundaries
In the fuzzy theory, fuzzy set A of universe X is defined by function µA(x) called the membership function of set A
µA(x): X → [0, 1], where µA(x) = 1 if x is totally in A; µA(x) = 0 if x is not in A; 0 < µA(x) < 1 if x is partly in A.
4
Fuzzy set
µA(x): X → [0, 1]
5
Classic set versus Fuzzy set
6
7
Discrete Form of a Fuzzy Set
Continuous Form of a Fuzzy Set
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Operations on Classical set
30
Classical Union
31
Classical Intersection
32
Classical Complement
33
Classical Difference
34
Properties of Classical (Crisp) Sets
35
Properties of Classical (Crisp) Sets
36
Operations in function-theoretic terms
37
Operations on Fuzzy set
38
Operations on Fuzzy set
39
Operations on Fuzzy set
40
41
∩
42
43
44
45
46
Fuzzy Control
Dr. Shahram Javadi Assistant Professor of Electrical Engineering dept. [email protected]
Islamic Azad University Central Tehran Branch
1
Islamic Azad University Central Tehran Branch
2
3- Classical Relations and Fuzzy Relations
3
CARTESIAN PRODUCT
A = {0, 1} B = {a, b, c}
4
CRISP RELATIONS
A subset of the Cartesian product A1 × A2 ×・ ・ ・×Ar is called an r-aray relation over A1,A2, . . . ,Ar
The most common case is for r = 2;
The Cartesian product of two universes X and Y is determined as
5
Sagittal diagram of an unconstrained relation
Relation Matrix
6
Constrained Relation
Let X = {1, 2} and Y = {a, b}
Universal Relation and identity relation
7
Continuous Relation
8
Operations on Crisp Relations
9
Composition
There are two common forms of the composition operation: max–min composition
max–product composition
10
Example
max–min composition:
11
FUZZY RELATIONS
The ‘‘strength’’ of the relation between ordered pairs of the two universes is not measured with the characteristic function, but rather with a membership function expressing various ‘‘degrees’’ of strength of the relation on the unit interval.
12
Operations On Fuzzy relations
13
Properties of Fuzzy relations Just as for crisp relations, the properties of commutativity, associativity, distributivity, involution, and idempotency all hold for fuzzy relations. Moreover, de morgan’s principles hold for fuzzy relations just as they do for crisp (classical) relations, and the null relation, O, and the complete relation, E, are analogous to the null set and the whole set in set-theoretic form, respectively
14
Fuzzy Cartesian Product and Composition
(C) 2001 by Yu Hen Hu 15
Fuzzy Composition Example
Let the two relations R and S be, respectively:
The goal is to compute RoS using both Max-min and Max-product composition rules.
R y1
y2
y3
S z1
z2
x1
0.4 0.6 0 y1
0.5 0.8
x2
0.9 1 0.1 y2
0.1 1
y1
0 0.6
(C) 2001 by Yu Hen Hu 16
MAX-MIN Composition RoS = max{min(0.4,0.5), min(0.6, 0.1), min(0, 0)} = max{ 0.4, 0.1, 0} = 0.4 max{min(0.4,0.8), min(0.6, 1), min(0, 0.6)} = max{ 0.4, 0.6, 0} = 0.6 max{min(0.9,0.5), min(1, 0.1), min(0.1, 0)} = max{ 0.5, 0.1, 0} = 0.5 max{min(0.9,0.8), min(1, 1), min(0.1, 0.6)} = max{ 0.8, 1, 0.1} = 1
=
15.06.04.0
6.0011.08.05.0
1.019.006.04.0
(C) 2001 by Yu Hen Hu 17
MAX-PRODUCT Composition
RoS =
=
145.06.02.0
6.0011.08.05.0
1.019.006.04.0
max{0.40.5, 0.60.1, 00} = max{0.2,0.06,0} = 0.2
max{0.40.8, 0.61, 00.6} = max{0.32, 0.6, 0} = 0.6
max{0.90.5, 10.1, 0.10} = max{0.45, 0.1, 0} = 0.45
max{0.90.8, 11, 0.10.6} = max{0.72, 1, 0.06} = 1
18
Example
fuzzy max–min composition
fuzzy max–product composition
19
Crisp Equivalence Relation
20
Crisp Tolerance Relation
21
22
Fuzzy tolerance and equivalence relations
23
Other forms of the composition operation
Fuzzy Control
Dr. Shahram Javadi Assistant Professor of Electrical Engineering dept. [email protected]
Islamic Azad University Central Tehran Branch
۱
Islamic Azad University Central Tehran Branch
۲
4- Membership Functions, Fuzzification, and
Defuzzification
FEATURES OF THE MEMBERSHIP FUNCTION
The core comprises those elements x of the universe such that
The support comprises those elements x of the universe such that
the boundaries comprise those elements x of the universe such that
۳
VARIOUS FORMS
The most common forms of membership functions are those that are normal and convex
Many operations on fuzzy sets, like extension principle and the union operator both can produce subnormal or non-convex fuzzy sets
Membership functions can be symmetrical or asymmetrical
ordinary membership functions generalized membership functions interval-valued membership function type-2 fuzzy set
۴
Interval-valued membership function
۵
Type-2 fuzzy set
۶
The membership function of a general type-2 fuzzy set is three-dimensional
Type-2 fuzzy sets and systems generalize (type-1) fuzzy sets and systems so that more uncertainty can be handled
Type-2 fuzzy set
۷
The membership function of a general type-2 fuzzy set is three-dimensional
Type-2 fuzzy sets and systems generalize (type-1) fuzzy sets and systems so that more uncertainty can be handled
FUZZIFICATION
۸
Fuzzification is the process of making a crisp quantity fuzzy
In the real world, hardware such as a digital voltmeter generates crisp data, but these data are subject to experimental error
FUZZIFICATION
۹
Membership function representing imprecision in ‘‘crisp voltage reading.’’
FUZZIFICATION
۱۰
Comparisons of fuzzy sets and crisp or fuzzy readings: (a) fuzzy set and crisp reading; (b) fuzzy set and fuzzy reading
DEFUZZIFICATION TO CRISP SETS
۱۱
Any particular fuzzy set A can be transformed into an infinite number of λ-cut sets, because there are an infinite number of values λ on the interval [0 1]
DEFUZZIFICATION
۱۲
Any particular fuzzy set A can be transformed into an infinite number of λ-cut sets, because there are an infinite number of values λ on the interval [0 1]
A discrete fuzzy setA∼
DEFUZZIFICATION - λ cut
۱۳
Lambda-cut sets for λ = 1, 0.9, 0.6, 0.3, 0+, 0.
λ-cut re-scales the memberships to 1 or 0
The properties of λ-cut:
1. (A ∪ B)λ = Aλ ∪ Bλ 2. (A ∩ B)λ = Aλ ∩ Bλ 3. (A’)λ ≠ (Aλ)’ except for x = 0.5 4. Aα ⊆ Aλ ∀ λ < α and 0 < α < 1 A0 = X
Core = A1
Support = A0+
Boundaries = [A0 + A1]
DEFUZZIFICATION - λ cut
0.6 0.3
λ-cuts for fuzzy relations 1 0.8 0 0.1 0.2
0.8 1 0.4 0 0.9
0 0.4 1 0 0
0.1 0 0 1 0.5
0.2 0.9 0 0.5 1
R =
DEFUZZIFICATION - λ cut
We can define λ-cut for relations similar to the one for sets
Rλ = {(x y) | µR(x y) > λ}
1 1 φ
1 φ 1
1
R1 =
1 1 φ
1 φ 1
1 1
R0.9 =
R0 = E
DEFUZZIFICATION - λ cut
λ-cuts on relations have the following properties:
(R ∪ S)λ = Rλ ∪ Sλ
(R ∩ S)λ = Rλ ∩ Sλ
(R’)λ ≠ (Rλ)’
Rα < Rλ ∀ λ ≤ α and 0 ≤ α ≤ 1
DEFUZZIFICATION - λ cut
DEFUZZIFICATION TO SCALARS
۱۸
Defuzzification is the conversion of a fuzzy quantity to a precise quantity, just as fuzzification is the conversion of a precise quantity to a fuzzy quantity
The output of a fuzzy process can be the logical union of two or more fuzzy membership functions defined on the universe of discourse of the output variable
DEFUZZIFICATION TO SCALARS
۱۹
DEFUZZIFICATION TO SCALARS METHODES
۲۰
1. Max membership principle
2. Centroid method
3. Weighted average method
4. Mean max membership
5. Center of sums
6. Center of largest area
7. First (or last) of maxima
1. Max membership principle
۲۱
2. Centroid method
۲۲
3. Weighted average method
۲۳
Unfortunately it is usually restricted to symmetrical output membership functions.
4. Mean max membership (middle-of-maxima)
۲۴
Defuzzification Methods
Example1: A railroad company intends to lay a new rail line in a particular part of a county. The whole area through which the new line is passing must be purchased for right-of-way considerations. It is surveyed in three stretches, and the data are collected for analysis. The surveyed data for the road are given by the sets , where the sets are defined on the universe of right-of-way widths, in meters. For the railroad to purchase the land, it must have an assessment of the amount of land to be bought. The three surveys on the right-of-way width are ambiguous , however, because some of the land along the proposed railway route is already public domain and will not need to be purchased. Additionally, the original surveys are so old (circa 1860) that some ambiguity exists on the boundaries and public right-of-way for old utility lines and old roads. The three fuzzy sets , shown in the figures below, represent the uncertainty in each survey as to the membership of the right-of-way width, in meters, in privately owned land.
We now want to aggregate these three survey results to find the single most nearly representative right-of-way width (z) to allow the railroad to make its initial estimate
3~2~1~BandB,B
3~2~1~BandB,B
Defuzzification Methods
Fuzzy set B1: public right-of-way width (z) for survey 1
Fuzzy set B2: public right-of-way width (z) for survey 2 Fuzzy set B3: public right-of-way width (z) for survey 3
Defuzzification Methods
( ) ( )
( )
meters
dzzdzdzzdzdzzdzdzz
zdzzzdzzdzzzdzzdzzdzzzdzz
dzz
zdzzz
B
B
9.4
)8()5()5(.2
3)3(.3.
85)5(.2
3)3(.)3(.
)(
)(
1
0
6.3
1
4
6.3
5.5
4
6
5.5
7
6
8
7
1
0
6.3
1
4
6.3
5.5
4
6
5.5
7
6
8
7
*
~
~
=
−++−++
−
++÷
−++−++
−
++
=•
=
∫ ∫ ∫ ∫ ∫ ∫ ∫
∫ ∫ ∫ ∫ ∫ ∫ ∫
∫∫
µ
µ
Centroid method:
The centroid method for finding z*.
Defuzzification Methods
Weighted-Average Method: ( ) ( ) ( ) metersz 41.5
15.3.5.6155.5.23.* =
++×+×+×
=
Mean-Max Method: meters5.62/)76( =+
Defuzzification Methods
Example2: Many products, such as tar, petroleum jelly, and petroleum, are extracted from crude oil. In a newly drilled oil well, three sets of oil samples are taken and tested for their viscosity. The results are given in the form of the three fuzzy sets B1, B2, and B3, all defined on a universe of normalized viscosity, we want to find the most nearly representative viscosity value for all three oil samples, and hence find z* for the three fuzzy viscosity sets.
Defuzzification Methods
Defuzzification Methods
Defuzzification Methods
According to the centroid method,
( ) ( ) ( )
( ) ( )
( ) ( ) ( )
( ) ( )5.2
5.5.25.5.
3)1(67.267.
5.5.25.5.
3167.2)67(.
)(
)(
5
3
3
33.2
33.2
2
2
8.1
8.1
5.1
5.1
0
5
3
3
33.2
33.2
2
2
8.1
8.1
5.1
5.1
0
*
~
~
=
−+−+
−+−+−+÷
−+−+
−+−+−+
==
∫∫∫∫∫∫
∫∫∫∫∫∫
∫∫
dzzdzz
dzzdzzdzzdzz
zdzzzdzz
zdzzzdzzzdzzzdzz
dzz
zdzzz
B
B
µ
µ
Defuzzification Methods
The centroid value obtained, z*, is shown in the figure below:
Defuzzification Methods
According to the weighted average method:
( ) ( ) ( ) 25.2111
31215.11* =++
×+×+×=z
5. Center of sums
۳۵
This is faster than many defuzzification methods that are presently in use, and the method is not restricted to symmetric membership functions. This process involves the algebraic sum of individual output fuzzy sets, sayC1 and C2, instead of their union.
Intersecting areas are added twice
The method also involves finding the centroids of the individual membership functions
is the distance to the centroid of each of the respective membership functions
5. Center of sums
۳۶
6. Center of largest Area
۳۷
If the output fuzzy set has at least two convex subregions, then the center of gravity of the convex fuzzy subregion with the largest area is used to obtain the defuzzified value z∗ of the output
Where Cm is the convex subregion that has the largest area making up Ck
6. Center of largest Area
۳۸
7. First (or last) of maxima
۳۹
This method uses the overall output or union of all individual output fuzzy sets Ck to determine the smallest value of the domain with maximized membership degree in Ck.
7. First (or last) of maxima
۴۰
The supremum (sup) is the least upper bound and the infimum (inf) is the greatest lower bound
Other Methods for Defuzzifications:
۴۱ 1: Defuzzification: criteria and classification, from the journal Fuzzy Sets and Systems, Van Leekwijck and Kerre, Vol. 108 (1999), pp. 159-178 [1]
Fuzzy Control
Dr. Shahram Javadi Assistant Professor of Electrical Engineering dept. [email protected]
Islamic Azad University Central Tehran Branch
۱
Islamic Azad University Central Tehran Branch
۲
5- Logic and Fuzzy Systems
1- CLASSICAL LOGIC
۳
Now let P and Q be two simple propositions on the same universe of discourse that can be combined using the following five logical connectives
CLASSICAL LOGIC
۴
Now define sets A and B from universe X
A propositional calculus will exist for the case where proposition P measures the truth of the statement that an element, x, from the universe X is contained in set A and the truth of the statement Q that this element, x, is contained in set B,
CLASSICAL LOGIC
۵
where truth is measured in terms of the truth value
Logical connectives
۶
Logical connectives
۷
The logical implication is analogous to the set-theoretic form!
Logical connectives
۸
Graphically, this implication and the analogous set operation are represented by the Venn diagram
Graphical analog of the classical implication operation; gray area is where implication holds
Logical connectives
۹
Logical connectives
۱۰
Implication operation involving two different universes of discourse: P is a proposition described by set A, which is defined on universe X Q is a proposition described by set B, which is defined on universe Y Then the implication P →Q can be represented in set-theoretic terms by the relation R, where R is defined by
Logical connectives
۱۱
IF A, THEN B
Logical connectives
۱۲
Logical connectives
۱۳
IF A, THEN B
Logical connectives
۱۴
IF A, THEN B ELSE C
Logical connectives
۱۵
IF A, THEN B ELSE C
Tautologies
۱۶
Compound Propositions that are always True !
Example: If A is the set of all prime numbers (A1 = 1, A2 = 2, A3 = 3, A4 = 5,. . .) on the real line universe, X, Then the proposition: ‘‘Ai is not divisible by 6’’ is a tautology.
Tautologies
۱۷
Some common tautologies:
Tautologies
۱۸
Proof:
Contradictions
۱۹
Compound Propositions that are always False !
Example: If A is the set of all prime numbers (A1 = 1, A2 = 2, A3 = 3, A4 = 5,. . .) on the real line universe, X, Then the proposition: ‘‘Ai is a multiple of 4’’ is a contradiction.
Exclusive OR
۲۰
The exclusive or is of interest because it arises in many situations involving natural language and human reasoning.
For example, when you are going to travel by plane or boat to some destination, the implication is that you can travel by air or sea, but not both, i.e., one or the other.
Exclusive OR
۲۱
Exclusive NOR
۲۲
Deductive Inferences
۲۳
Suppose we have a rule of the form IF A, THEN B Can we deduce, in rule form, IF A, THEN B? YES
2- FUZZY LOGIC
۲۴
Many interesting paradoxes over the ages!
Barber of Seville: In the small Spanish town of Seville, there is a rule that all and only those men who do not shave themselves are shaved by the barber. Who shaves the barber?
Ancient Greece Does the liar from Crete lie when he claims, ‘‘All Cretians are liars?’’
‘‘I lie.’’: The statement can not be both true and false
2- FUZZY LOGIC
۲۵
Multivalued Logic:
FUZZY LOGIC
۲۶
Example Suppose we are evaluating a new invention to determine its commercial potential. We will use two metrics to make our decisions regarding the innovation of the idea. Our metrics are the ‘‘uniqueness’’ of the invention, denoted by a universe of novelty scales, X = {1, 2, 3, 4}, and the ‘‘market size’’ of the invention’s commercial market, denoted on a universe of scaled market sizes, Y = {1, 2, 3, 4, 5, 6}. In both universes the lowest numbers are the ‘‘highest uniqueness’’ and the ‘‘largest market,’’ respectively. A new invention in your group, say a compressible liquid of very useful temperature and viscosity conditions, has just received scores of ‘‘medium uniqueness,’’ denoted by fuzzy set A∼ , and ‘‘medium market size,’’ denoted fuzzy set B∼ . We wish to determine the implication of such a result, i.e., IF A∼ THENB∼ We assign the invention the following fuzzy sets to represent its ratings:
FUZZY LOGIC
۲۷
IF A, THEN B
۲۸
APPROXIMATE REASONING
۲۹
OTHER FORMS OF THE IMPLICATION OPERATION
۳۰
NATURAL LANGUAGE
۳۱
LINGUISTIC HEDGES
۳۲
LINGUISTIC HEDGES
۳۳
LINGUISTIC HEDGES
Fuzzy concentration
Fuzzy dilation
۳۴
LINGUISTIC HEDGES
preference table
۳۵
LINGUISTIC HEDGES
Example: ‘‘plus very minus very small’’ should be interpreted as
plus (very (minus (very (small))))
Parentheses may be used to change the precedence order and ambiguities may be resolved by the use of association-to-the-right.
۳۶
LINGUISTIC HEDGES
Example:
۳۷
LINGUISTIC HEDGES
Example: α = ‘‘not very small and not very, very large’’
۳۸
FUZZY (RULE-BASED) SYSTEMS
IF premise (antecedent), THEN conclusion (consequent)
In the field of artificial intelligence (machine intelligence) there are various ways to represent knowledge. Perhaps the most common way to represent human knowledge is to form it into natural language expressions of the type
deductive form.
This form of knowledge representation, characterized as shallow knowledge, is quite appropriate in the context of linguistics because it expresses human empirical and heuristic knowledge in our own language of communication. It does not, however, capture the deeper forms of knowledge usually associated with intuition, structure, function.
۳۹
FUZZY (RULE-BASED) SYSTEMS
۴۰
FUZZY (RULE-BASED) SYSTEMS
۴۱
GRAPHICAL TECHNIQUES OF INFERENCE
Three common methods of deductive inference for fuzzy systems based on linguistic rules: (1)Mamdani systems,
(2) Sugeno models, (3) Tsukamoto models
۴۲
GRAPHICAL TECHNIQUES OF INFERENCE
(1)Mamdani systems:
۴۳
GRAPHICAL TECHNIQUES OF INFERENCE Case 1: Using Max-Min Composition
Truncated
membership functions for each rule
۴۴
GRAPHICAL TECHNIQUES OF INFERENCE Case 2: Using Max-Prod Composition
Scaled membership functions for each
rule
۴۵
GRAPHICAL TECHNIQUES OF INFERENCE
(2): Sugeno method, or the TSK method (Takagi, Sugeno, and Kang) [Takagi and Sugeno, 1985; Sugeno and Kang, 1988],
where z = f (x, y) is a crisp function in the consequent.
Usually f (x, y) is a polynomial function in the inputs x and y, but it can be any general function as long as it describes the output of the system within the fuzzy region specified in the antecedent of the rule to which it is applied.
When f (x, y) is a constant the inference system is called a zero-order Sugeno model, which is a special case of the Mamdani system.
۴۶
GRAPHICAL TECHNIQUES OF INFERENCE
When f (x, y) is a linear function of x and y, the inference
first-order Sugeno model:
۴۷
GRAPHICAL TECHNIQUES OF INFERENCE
Example: first-order Sugeno model
۴۸
GRAPHICAL TECHNIQUES OF INFERENCE
(3): Tsukamoto Method [1979] In this method the consequent of each fuzzy rule is represented by a fuzzy set with a monotonic membership function,
۴۹
GRAPHICAL TECHNIQUES OF INFERENCE
(3): Tsukamoto Method [1979] Advantage: Since each rule infers a crisp output, the Tsukamoto model’s aggregation of the overall output also avoids the time-consuming process of defuzzification. Disadvantage: Because of the special nature of the output membership functions required by the method, it is not as useful as a general approach, and must be employed in specific situations.
۵۰
GRAPHICAL TECHNIQUES OF INFERENCE (3): Tsukamoto Method [1979]
Example:
Fuzzy Inference
۵۱
Contents
Fuzzy Inference • Fuzzification of the input variables • Rule evaluation • Aggregation of the rule outputs • Defuzzification
Mamdani Sugeno
۵۲
Fuzzy Inference
The most commonly used fuzzy inference technique is the so-called Mamdani method.
In 1975, Professor Ebrahim Mamdani of London University built one of the first fuzzy systems to control a steam engine and boiler combination. He applied a set of fuzzy rules supplied by experienced human operators.
۵۳
Mamdani Fuzzy Inference
The Mamdani-style fuzzy inference process is performed in four steps:
1. Fuzzification of the input variables
2. Rule evaluation (inference)
3. Aggregation of the rule outputs (composition)
4. Defuzzification.
۵۴
Mamdani Fuzzy Inference We examine a simple two-input one-output problem that includes three rules: Rule: 1 IF x is A3 OR y is B1 THEN z is C1 Rule: 2 IF x is A2 AND y is B2 THEN z is C2 Rule: 3 IF x is A1 THEN z is C3
Real-life example for these kinds of rules: Rule: 1 IF project_funding is adequate OR project_staffing is small THEN risk is low Rule: 2 IF project_funding is marginal AND project_staffing is large THEN risk is normal Rule: 3 IF project_funding is inadequate THEN risk is high
۵۵
Mamdani Fuzzy Inference We examine a simple two-input one-output problem that includes three rules: Rule: 1 IF x is A3 OR y is B1 THEN z is C1 Rule: 2 IF x is A2 AND y is B2 THEN z is C2 Rule: 3 IF x is A1 THEN z is C3
Real-life examle for these kinds of rules: Rule: 1 IF project_funding is adequate OR project_staffing is small THEN risk is low Rule: 2 IF project_funding is marginal AND project_staffing is large THEN risk is normal Rule: 3 IF project_funding is inadequate THEN risk is high
۵۶
Step 1: Fuzzification
The first step is to take the crisp inputs, x1 and y1 (project funding and project staffing), and determine the degree to which these inputs belong to each of the appropriate fuzzy sets.
Crisp Inputy1
0.1
0.71
0 y1
B1 B2
Y
Crisp Input
0.20.5
1
0
A1 A2 A3
x1
x1 Xµ (x = A1) = 0.5µ (x = A2) = 0.2
µ (y = B1) = 0.1µ (y = B2) = 0.7
57
Step 2: Rule Evaluation
The second step is to take the fuzzified inputs, µ(x=A1) = 0.5, µ(x=A2) = 0.2, µ(y=B1) = 0.1 and µ(y=B2) = 0.7,
and apply them to the antecedents of the fuzzy rules. If a given fuzzy rule has multiple antecedents, the fuzzy operator
(AND or OR) is used to obtain a single number that represents the result of the antecedent evaluation.
RECALL: To evaluate the disjunction of the rule antecedents, we use
the OR fuzzy operation. Typically, fuzzy expert systems make use of the classical fuzzy operation union:
µA∪B(x) = max [µA(x), µB(x)] Similarly, in order to evaluate the conjunction of the rule antecedents,
we apply the AND fuzzy operation intersection: µA∩B(x) = min [µA(x), µB(x)]
۵۸
Step 2: Rule Evaluation
A31
0 X
1
y10 Y0.0
x1 0
0.1C1
1C2
Z
1
0 X
0.2
0
0.2 C11
C2
Z
A2
x1
Rule 3:
A11
0 X 0
1
Zx1
THEN
C1 C2
1
y1
B2
0 Y
0.7
B10.1
C3
C3
C30.5 0.5
OR(max)
AND(min)
OR THENRule 1:
AND THENRule 2:
IF x is A3 (0.0) y is B1 (0.1) z is C1 (0.1)
IF x is A2 (0.2) y is B2 (0.7) z is C2 (0.2)
IF x is A1 (0.5) z is C3 (0.5)
۵۹
Step 2: Rule Evaluation
Now the result of the antecedent evaluation can be applied to the membership function of the consequent.
There are two main methods for doing so: Clipping Scaling
Degree ofMembership1.0
0.0
0.2
Z
Degree ofMembership
Z
C2
1.0
0.0
0.2
C2
clipping scaling 60
Step 2: Rule Evaluation The most common method of correlating the rule consequent with
the truth value of the rule antecedent is to cut the consequent membership function at the level of the antecedent truth. This method is called clipping (alpha-cut).
Since the top of the membership function is sliced, the clipped fuzzy set loses some information.
However, clipping is still often preferred because it involves less complex and faster mathematics, and generates an aggregated output surface that is easier to defuzzify.
While clipping is a frequently used method, scaling offers a better approach for preserving the original shape of the fuzzy set.
The original membership function of the rule consequent is adjusted by multiplying all its membership degrees by the truth value of the rule antecedent.
This method, which generally loses less information, can be very useful in fuzzy expert systems.
۶۱
Step 3: Aggregation of the rule outputs
Aggregation is the process of unification of the outputs of all rules.
We take the membership functions of all rule consequents previously clipped or scaled and combine them into a single fuzzy set.
The input of the aggregation process is the list of clipped or scaled consequent membership functions, and the output is one fuzzy set for each output variable.
00.1
1C1
Cz is 1 (0.1)
C2
00.2
1
Cz is 2 (0.2)
0
0.5
1
Cz is 3 (0.5)ZZZ
0.2
Z0
∑
C30.50.1
62
Step 4: Defuzzification The last step in the fuzzy inference process is defuzzification.
Fuzziness helps us to evaluate the rules, but the final output of a fuzzy system has to be a crisp number.
The input for the defuzzification process is the aggregate output fuzzy set and the output is a single number.
There are several defuzzification methods, but probably the most popular one is the centroid technique. It finds the point where a vertical line would slice the aggregate set into two equal masses. Mathematically this centre of gravity (COG) can be expressed as:
( )
( )∫
∫
µ
µ
= b
aA
b
aA
dxx
dxxx
COG
63
Centroid defuzzification method finds a point representing the centre of gravity of the aggregated fuzzy set A, on the interval [a, b ].
A reasonable estimate can be obtained by calculating it over a sample of points.
Step 4: Defuzzification
64
Sugeno Fuzzy Inference
Mamdani-style inference, as we have just seen, requires us to find the centroid of a two-dimensional shape by integrating across a continuously varying function. In general, this process is not computationally efficient.
Michio Sugeno suggested to use a single spike, a singleton, as the membership function of the rule consequent.
A singleton, or more precisely a fuzzy singleton, is a fuzzy set with a membership function that is unity at a single particular point on the universe of discourse and zero everywhere else.
۶۵
۶۶
Sugeno Fuzzy Inference
The most commonly used zero-order Sugeno fuzzy model applies fuzzy rules in the following form:
IF x is A AND y is B THEN z is k
where k is a constant.
In this case, the output of each fuzzy rule is constant. All consequent membership functions are represented by
singleton spikes.
۶۷
Sugeno Rule Evaluation
A31
0 X
1
y10 Y
0.0
x1 0
0.1
1
Z
1
0 X
0.2
0
0.2
1
Z
A2
x1
IF x is A1 (0.5) z is k3 (0.5)Rule 3:
A11
0 X 0
1
Zx1
THEN
1
y1
B2
0 Y
0.7
B10.1
0.5 0.5
OR(max)
AND(min)
OR y is B1 (0.1) THEN z is k1 (0.1)Rule 1:
IF x is A2 (0.2) AND y is B2 (0.7) THEN z is k2 (0.2)Rule 2:
k1
k2
k3
IF x is A3 (0.0)
A31
0 X
1
y10 Y
0.0
x1 0
0.1
1
Z
1
0 X
0.2
0
0.2
1
Z
A2
x1
IF x is A1 (0.5) z is k3 (0.5)Rule 3:
A11
0 X 0
1
Zx1
THEN
1
y1
B2
0 Y
0.7
B10.1
0.5 0.5
OR(max)
AND(min)
OR y is B1 (0.1) THEN z is k1 (0.1)Rule 1:
IF x is A2 (0.2) AND y is B2 (0.7) THEN z is k2 (0.2)Rule 2:
k1
k2
k3
IF x is A3 (0.0)
۶۸
Sugeno Aggregation of the Rule Outputs
z is k1 (0.1) z is k2 (0.2) z is k3 (0.5) ∑0
1
0.1Z 0
0.5
1
Z00.2
1
Zk1 k2 k3 0
1
0.1Zk1 k2 k3
0.20.5
۶۹
Sugeno Defuzzification
655.02.01.0
805.0502.0201.0)3()2()1(
3)3(2)2(1)1(=
++×+×+×
=µ+µ+µ
×µ+×µ+×µ=
kkkkkkkkkWA
Weighted Average (WA)
0 Z
Crisp Outputz1
z1
70
Mamdani or Sugeno?
Mamdani method is widely accepted for capturing expert knowledge. It allows us to describe the expertise in more intuitive, more human-like manner. However, Mamdani-type fuzzy inference entails a substantial computational burden.
On the other hand, Sugeno method is computationally effective and works well with optimization and adaptive techniques, which makes it very attractive in control problems, particularly for dynamic nonlinear systems.
۷۱
The most commonly used fuzzy inference technique is the so-called Mamdani method. In 1975, Professor Ebrahim Mamdani of London University built one of the first fuzzy systems to control a steam engine and boiler combination. He applied a set of fuzzy rules supplied by experienced human operators.
Fuzzy inference
7/6/2006 73
m
s
M
RL
VL
S
RS
L
VS
S
M
MVS S
L
M
S
The square FAM representation
7/6/2006 74
The rule table Rule m s ρ n Rule m s ρ n Rule m s ρ n
1 VS S L VS 10 VS S M S 19 VS S H VL
2 S S L VS 11 S S M VS 20 S S
S
3 M S L VS 12 M S M VS 21 M S
4 VS M L VS 13 VS M M RS 22 VS M H M
M
M
M
5 S M L VS 14 S M M S 23 S M
6 M M L VS 15 M M M VS 24 M M
7 VS L L S 16 VS L M M 25 VS L H
H
H
H
H
H
RL
8 S L
L
L S 17 S L M RS 26 S L
9 M L L VS 18 M L M S 27 M L H RS
7/6/2006 75
Rule Base 1 1. If (utilisation_factor is L) then (number_of_spares is S)2. If (utilisation_factor is M) then (number_of_spares is M)3. If (utilisation_factor is H) then (number_of_spares is L)
4. If (mean_delay is VS) and (number_of_servers is S) then (number_of_spares is VL)5. If (mean_delay is S) and (number_of_servers is S) then (number_of_spares is L)6. If (mean_delay is M) and (number_of_servers is S) then (number_of_spares is M)
7. If (mean_delay is VS) and (number_of_servers is M) then (number_of_spares is RL)8. If (mean_delay is S) and (number_of_servers is M) then (number_of_spares is RS)9. If (mean_delay is M) and (number_of_servers is M) then (number_of_spares is S)
10. If (mean_delay is VS) and (number_of_servers is L) then ( number_of_spares is M)11. If (mean_delay is S) and (number_of_servers is L) then ( number_of_spares is S)12. If (mean_delay is M) and (number_of_servers is L) then ( number_of_spares is VS)
7/6/2006 76 A
Gui
VS VS VSVS VS VS
VS VS VSVL L M
HS
VS VS VSVS VS VS
VS VS VSM
VS VS VSVS VS VSS S VSL
s
LVS S
m
MH
ρρ
VS VS VSLVS S
S
m
VS VS VSM
S S VSL
s
S VS VSMVS S
m
VS S
m
S
RS S VSM
M RS SL
s
S
M M SM
RL M RSL
s
M
M
M
M
Cube FAM of Rule Base 2
7/6/2006 77 A
Gui
00.2
0.40.6
0.81
0
0.2
0.4
0.6
0.2
0.3
0.4
0.5
0.6
number_of_serversmean_delay
Three-dimensional plots for Rule Base 1
7/6/2006 78 A
Gui
Three-dimensional plots for Rule Base 1
00.2
0.40.6
0.81
0
0.2
0.4
0.6
0.2
0.3
0.4
0.5
0.6
utilisation_factormean_delay
7/6/2006 79 A
Gui
00.2
0.40.6
0.81
0
0.2
0.4
0.6
0.15
0.2
0.25
0.3
0.35
number_of_serversmean_delay
Three-dimensional plots for Rule Base 2
7/6/2006 80 A
Gui
00.2
0.40.6
0.81
0
0.2
0.4
0.6
0.2
0.3
0.4
utilisation_factormean_delay
0.5
Three-dimensional plots for Rule Base 2
7/6/2006 81 A
Gui
VS VS VS
VS VS VS
VS VS VS
VS VS VS
VS VS VS
VS VS VS
VS VS VS
VS VS VS
VS VS VS
VS VS VS
VS VS VS
VS VS VS
VS VS VS
S S VS
S S VS
VL L M
VL RL RS
M M S
RL M RS
L M RS
HS
M
RL
L
RS
s
LVS Sm
MM
Hρρ
VS VS VS
VS VS VS
VS VS VS
S S VS
S S VS
LVS S
S
M
M
RL
L
RS
m
s
S VS VS
S VS VS
RS S VS
M RS S
M RS S
MMVS Sm
VS Sm
S
M
RL
L
RS
s
S
M
M
RL
L
RS
s
Cube FAM of Rule Base 3
7/6/2006 82 A
Gui
00.2
0.40.6
0.81
0
0.2
0.4
0.6
0.15
0.2
0.25
0.3
0.35
number_of_serversmean_delay
Three-dimensional plots for Rule Base 3
7/6/2006 83 A
Gui
00.2
0.40.6
0.81
0
0.2
0.4
0.6
0.2
0.3
0.4
utilisation_factormean_delay
0.5
Three-dimensional plots for Rule Base 3
7/6/2006 84 A
Gui
Tuning fuzzy systems 1. Review model input and output variables, and if
required redefine their ranges.
2. Review the fuzzy sets, and if required define additional sets on the universe of discourse. The use of wide fuzzy sets may cause the fuzzy system to perform roughly.
3. Provide sufficient overlap between neighboring sets. It is suggested that triangle-to-triangle and trapezoid-to-triangle fuzzy sets should overlap between 25% to 50% of their bases.
7/6/2006 85 A
Gui
4. Review the existing rules, and if required add new rules to the rule base.
5. Examine the rule base for opportunities to write hedge rules to capture the pathological behaviour of the system.
6. Adjust the rule execution weights. Most fuzzy logic tools allow control of the importance of rules by changing a weight multiplier.
7. Revise shapes of the fuzzy sets. In most cases, fuzzy systems are highly tolerant of a shape approximation.