SlideShare a Scribd company logo
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy Logic: Principles and Applications
ISS0023 Intelligent Control Systems
Sergei Astapov
Laboratory for Proactive Technologies
Department of Computer Control
Tallinn University of Technology, Estonia
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Self Introduction
Engineer at the Laboratory for Proactive Technologies
(ProLab)
PhD student at the Department of Computer Control
Research topics
Band-limited signal analysis
Signal processing and data mining algorithms
Classification and decision-making algorithms
Room: U02-305
E-mail: sergei.astapov@ttu.ee
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Lecture Overview
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Why Go Fuzzy?
Fuzzy logic models human expertise and knowledge in some
task or application
Consider conventional binary logic
Variables may take values of TRUE or FALSE (0 or 1)
Try then to answer a simple question with binary logic
What do you consider warm temperature?
How to answer?
You could try to give a value or interval of “warm” temperature
But then when does the temperature become cold or hot?
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
The Fuzzy Way of Thinking
t (°C)
μ(t)
10 20 30 40
0
-10
-20
-30
-40
1 hot
warm
warm hot
t (°C)
μ(t)
10 20 30 40
0
-10
-20
-30
-40
1
cool
chilly
cold
freezing
freezing cold chilly cool
Binary logic
Fuzzy logic
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
The Concept of Fuzzy Logic
Fuzzy logic variables have a range of truthfulness from 0 to 1
Fuzzy logic operates with linguistic variables, like
“temperature” instead of t(◦C)
Each variable has a specific number of linguistic values, like
“hot” or “cold”
Fuzzy inference is performed using linguistic rules, e.g.
IF temperature is cold THEN dress warm
The linguistic values and their truth degree are quantified
using membership functions (MF)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
A Little Bit of History
1964 : Lotfi A. Zadeh, UC Berkeley, introduced the paper on fuzzy sets
Idea of grade of membership
Imperfection and noise in the real world
Sharp criticism from academic community
1965–1975 : Zadeh continued to broaden the foundation of fuzzy set theory
Fuzzy multistage decision-making
Fuzzy similarity relations
Fuzzy restrictions, linguistic hedges
1970s : Research was mainly centered in Japan
1974 : E. H. Mamdani, UK, developed the first fuzzy logic controller
1977 : Dubois applied fuzzy sets in a comprehensive study of traffic conditions
1976–1987 : Industrial application of fuzzy logic in Japan and Europe
1987–Present : Widespread application
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Conventional and Fuzzy Sets
Let X be a space of objects and x be a generic element of X. A
classical set A, A ⊆ X, is defined as a collection of elements
x ∈ X, such that each element x can either belong or not belong
to the set A.
The classical set thus can be characterized as A = {x | x ∈ X} .
By defining a characteristic function for each x, we can represent
the classical set A by a set of ordered pairs (x, 0) or (x, 1), which
indicate x /
∈ A or x ∈ A respectively.
In a fuzzy set the characteristic function is allowed to have values
of membership between 0 and 1.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy Set Definition
Definition 1 (Fuzzy set)
If X is a collection of objects x, then a fuzzy set A in X is
defined as a set of ordered pairs:
A = {(x, µA(x)) | x ∈ X} , (1)
where µA(x) is called the membership function (MF) for the
fuzzy set A.
In fuzzy set theory classical sets are referred to as crisp sets and
the values as crisp values.
X is usually referred to as the universe of discourse. It represents
the range of values the fuzzy variables may take.
Universes of discourse may be either discrete or continuous.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Linguistic Variables and Values
Fuzzy sets usually carry names appealing in our daily linguistic usage
The universe is called a linguistic variable and its sets are called
linguistic values
The universe of discourse X is partitioned into several fuzzy sets,
with MFs covering X in a more or less uniform manner
Example 1
Consider the universe X of linguistic variable “temperature”. The
universe may be defined differently, depending on the application. We
may set it from the lowest to the highest temperature a typical human
being can live in, e.g. [−50, 50] ◦
C.
We partition the universe into 6 fuzzy sets: “freezing”, “cold”, “chilly”,
“cool”, “warm”, “hot”. These sets are characterized by MFs
µfreezing(x), µcold(x), µchilly(x), µcool(x), µwarm(x), µhot(x).
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Relevant Properties of Fuzzy Sets
Definition 2 (Support)
The support of a fuzzy set A is the set of all points x ∈ X, such that
µA(x) > 0:
support(A) = {x | µA(x) > 0} . (2)
Definition 3 (Core)
The core of a fuzzy set A is the set of all points x ∈ X, such that
µA(x) = 1:
core(A) = {x | µA(x) = 1} . (3)
Definition 4 (Crossover points)
A crossover point of a fuzzy set A is a point x ∈ X, at which
µA(x) = 0.5:
crossover(A) = {x | µA(x) = 0.5} . (4)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Relevant Properties of Fuzzy Sets Continued
Definition 5 (Normality)
A fuzzy set A is normal if its core is nonempty, i.e. we can always
find a point x ∈ X, such that µA(x) = 1.
Definition 6 (Fuzzy singleton)
A fuzzy set, the support of which is a single point in X with
µA(x) = 1 is called a fuzzy singleton.
Definition 7 (Symmetry)
A fuzzy set A is symmetric if its MF is symmetric around a
certain point x = c, namely, µA(c + x) = µA(c − x), ∀x ∈ X.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Relevant Properties of Fuzzy Sets Continued
Definition 8 (Open left, open right, closed sets)
A fuzzy set A is:
open left if limx→−∞ µA(x) = 1, limx→+∞ µA(x) = 0;
open right if limx→−∞ µA(x) = 0, limx→+∞ µA(x) = 1;
and closed if limx→−∞ µA(x) = limx→+∞ µA(x) = 0.
warm hot
x
μ(x)
10 20 30 40
0
-10
-20
-30
-40
1
0.5
freezing cold chilly cool
core
crossover points
support
all are normal
symmetric
open left open right
temperature is 25 °C
singleton
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Containment
Definition 9 (Containment or subset)
Fuzzy set A is contained in fuzzy set B (or A is a subset of B),
iff µA(x) ≤ µB(x) for all x:
A ⊆ B ⇐⇒ µA(x) ≤ µB(x). (5)
x
μ(x)
1
A
B
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Complement
Definition 10 (Complement or negation)
The complement of a fuzzy set A, denoted by A or ¬A, or
NOT A is defined as
µA(x) = 1 − µA(x). (6)
x
μ(x)
1
A
x
μ(x)
1
NOT A
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Union
Definition 11 (Union or disjunction)
The union of two fuzzy sets A and B is a fuzzy set C, written as
C = A ∪ B or C = A OR B, the MF of which is related to those
of A and B by
µC(x) = max (µA(x), µB(x)) = µA(x) ∨ µB(x). (7)
x
μ(x)
1
A B
x
μ(x)
1
A OR B
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Intersection
Definition 12 (Intersection or conjunction)
The intersection of two fuzzy sets A and B is a fuzzy set C,
written as C = A ∩ B or C = A AND B, the MF of which is
related to those of A and B by
µC(x) = min (µA(x), µB(x)) = µA(x) ∧ µB(x). (8)
x
μ(x)
1
A B
x
μ(x)
1
A AND B
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Cartesian Product and Co-product
Definition 13 (Cartesian product and co-product)
Let A and B be fuzzy sets in X and Y , respectively. The
Cartesian product of A and B, denoted by A × B, is a fuzzy set
in the product space X × Y with the membership function
µA×B(x, y) = min (µA(x), µB(y)) . (9)
Similarly, the Cartesian co-product A + B is a fuzzy set with the
membership function
µA+B(x, y) = max (µA(x), µB(y)) . (10)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Preface
A fuzzy set is completely characterized by its MF
As the universe most often consists of real values, X ⊆ R, it
is convenient to define MFs as continuous functions
For a single linguistic variable the MFs are one-dimensional
Combining the universes of different linguistic variables, MFs
of higher dimensions may be derived
Here the most commonly applied MF types are presented
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Straight-Line MF:Triangular MF
Definition 14 (Triangular MF)
A triangular MF is specified by three parameters {a, b, c} as follows:
triangle (x; a, b, c) =









0, x ≤ a.
x−a
b−a , a ≤ x ≤ b.
c−x
c−b , b ≤ x ≤ c.
0, c ≤ x.
(11)
It may also be described by min and max as
triangle (x; a, b, c) = max

min

x − a
b − a
,
c − x
c − b

, 0

. (12)
The parameters a and c locate the “feet” of the triangle and b — its
peak.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Straight-Line MF: Trapezoidal MF
Definition 15 (Trapezoidal MF)
A trapezoidal MF is specified by four parameters {a, b, c, d} as follows:
trapezoid (x; a, b, c, d) =















0, x ≤ a.
x−a
b−a , a ≤ x ≤ b.
1, b ≤ x ≤ c.
d−x
d−c , c ≤ x ≤ d.
0, d ≤ x.
(13)
An alternative expression using min and max is
trapezoid (x; a, b, c, d) = max

min

x − a
b − a
, 1,
d − x
d − c

, 0

. (14)
The parameters a and d locate the “feet” of the trapezoid and b and c —
its “shoulders”.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Smooth MF: Gaussian and Bell MF
Definition 16 (Gaussian MF)
A Gaussian MF is specified by two parameters {c, σ} as follows:
gaussian (x; c, σ) = e−1
2 (x−c
σ )
2
. (15)
The parameter c represents the MF center and σ determines the
MF width.
Definition 17 (Generalized bell MF)
A generalized bell MF is specified by three parameters {a, b, c}
as follows:
bell (x; a, b, c) =
1
1 + x−c
a
2b
, (16)
where b is usually positive (if b  0, then the MF becomes an
upside-down bell).
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
MATLAB MF Examples
0 20 40 60 80 100
0
0.2
0.4
0.6
0.8
1
Membership
Grades
(a) Triangular MF: trimf(x,[20,60,80])
0 20 40 60 80 100
0
0,2
0,4
0,6
0,8
1
Membership
Grades
(b) Trapezoidal MF: trapmf(x,[10,20,60,95])
0 20 40 60 80 100
0
0.2
0.4
0.6
0.8
1
Membership
Grades
(c) Gaussian MF: gaussmf(x,[20,50])
0 20 40 60 80 100
0
0.2
0.4
0.6
0.8
1
Membership
Grades
(d) Generalized Bell MF: gbellmf(x,[20,4,50])
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Changing the Parameters of Bell MF
−10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
(a) Changing ’a’
−10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
(b) Changing ’b’
−10 −5 0 5 10
0
0,2
0,4
0,6
0,8
1
(c) Changing ’c’
−10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
(d) Changing ’a’ and ’b’
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Straight-line and Smooth MFs: Analysis
What are the advantages and drawbacks of straight-line and
smooth MFs?
Straight-line MFs
Simple formulas: computational efficiency
Zero points strictly defined:
Good, when boundary strictness is needed
Bad, when fuzzy sets cannot be adequately characterized by
sudden drops to zero membership
Limitations due to linearity
Simple for manual tuning, unsuited for automated tuning
Smooth MFs:
Non-linear: higher flexibility
Best for automated tuning (adaptive systems)
Less straight-forward: more problems during initial design
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Open Membership Functions
Definition 18 (Sigmoidal MF)
A sigmoidal MF is specified by two parameters {a, c} as follows:
sig (x; a, c) =
1
1 + e−a(x−c)
, (17)
where a controls the slope of the crossover point c.
An open triangular MF is obtained by specifying ± inf as a left or right
“foot” parameter, e.g. trimf(x,[3,7,inf])
−5 0 5 10 15
0
0.2
0.4
0.6
0.8
1
Membership
Grades
(a) Sigmoidal MF: sigmf(x,[1,5])
−5 0 5 10 15
0
0.2
0.4
0.6
0.8
1
Membership
Grades
(b) Triangular MF: trimf(x,[3,7,inf])
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Asymmetric Membership Functions
There are numerous ways to get asymmetric smooth MFs. One way
is taking the difference |y1 − y2| and product y1y2 of sigmoid MFs:
−10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
y1
y2
(a) y1 = sig(x;1,−5); y2 = sig(x;2,5)
−10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
(b) |y1 − y2|
−10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
y1 y3
(c) y1 = sig(x;1,−5); y3 = sig(x;−2,5)
−10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
(d) y1*y3
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Asymmetric MF: Left-Right MF
Definition 19 (Left-right MF)
A left-right MF is specified by three parameters {α, β, c} as
LR (x; α, β, c) =
(
FL
c−x
α

, x ≤ c,
FR

x−c
β

, x ≥ c,
(18)
where FL(x) and FR(x) are monotonically decreasing functions
defined on [0, ∞) with FL(0) = FR(0) = 1 and
limx→∞ FL(x) = limx→∞ FR(x) = 0.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Asymmetric MF: Left-Right MF Example
Example 2
Let FL(x) =
p
max (0, 1 − x2), FR = e−|x|3
. Then applying (18)
we can generate different curves, e.g. (a) lr_mf(x,60,10,65);
and (b) lr_mf(x,10,40,25);
0 20 40 60 80 100
0
0.2
0.4
0.6
0.8
1
Membership
Grades
(a)
0 20 40 60 80 100
0
0.2
0.4
0.6
0.8
1
Membership
Grades
(b)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Asymmetric MF: Two-Sided Gaussian MF
Definition 20 (Two-sided Gaussian MF)
A two-sided Gaussian MF is defined by four parameters {c1, σ1, c2, σ2}
as
gaussian2 (x; c1, σ1, c2, σ2) =







exp
h
−1
2

x−c1
σ1
i
, x ≤ c1,
1, c1  x ≤ c2,
exp
h
−1
2

x−c2
σ2
i
, c2 ≤ x,
(19)
where c1, σ1 are the parameters of the left-most curve and c2, σ2 are the
parameters of the right-most curve.
The two-sided Gaussian is essentially a mixture of two Gaussian
functions defined by (15). It is computed in MATLAB using the
gauss2mf function.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Remarks on Membership Functions
The presented MFs are only the most common ones
For a full glossary of available MFs refer to the MATLAB
Fuzzy Toolbox manual and other sources
Be creative! Nobody forbids you from inventing your own MFs
Non-normality and other properties of MFs can be achieved
by mathematical manipulations on existing MFs or by defining
one’s own MFs
Two-dimensional MFs are not discussed here, for further study
please refer to literature
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy IF-THEN Rules
Definition 21 (Fuzzy if-then rule)
A fuzzy if-then rule, also known as a fuzzy rule, fuzzy implication, or
fuzzy conditional statement, assumes the form
IF x is A THEN y is B, (20)
where A and B are linguistic values defined by fuzzy sets on universes of
discourse X and Y , respectively. The expression x is A is called the
antecedent or premise, while y is B is called the consequence or
conclusion.
Expression (20), which is abbreviated as A → B, can be defined as a binary
fuzzy relation R on the product space X × Y : R = A → B. R can be viewed
as a fuzzy set of two-dimensional MF
µR(x, y) = f (µA(x), µB(y)) ,
where the function f is called the fuzzy implication function, that transforms
the membership degrees of x in A and y in B into those of (x, y) in A → B.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Multiple Input Multiple Output Rules
Let premise linguistic variables xi, i = 1, 2, . . . , n and consequence
linguistic variables yj, j = 1, 2, . . . , m take on values of their universes of
discourse Xi and Yj, respectively. Let xi be characterized by a set of
linguistic values
Ai =

Ak
i : k = 1, 2, . . . , Ni ,
and yj be characterized by a set of linguistic values
Bj =

Bl
j : l = 1, 2, . . . , Mi .
Then a MIMO rule with number of inputs n and number of outputs m
can be written as
IF x1 is Ap
1 AND x2 is Aq
2 AND . . . AND xn is Ar
n
THEN y1 is Bs
1 AND y2 is Bu
2 AND . . . AND ym is Bv
m.
(21)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Linguistic Operators
A large number of operators may be applied to linguistic
terms in fuzzy rules
Negation, e.g. “not warm”
Connectives: and, or, either, neither, etc.
Hedges: too, very, more or less, quite, extremely, etc.
For example “more or less warm but not too warm”
Here only not, and, or operators are discussed as they are
most common and sufficient in the majority of applications
In practice we will use only the and operator
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy Inference Systems
A fuzzy inference system (FIS) or, as it is also known in different
application areas, fuzzy expert system, fuzzy model, fuzzy
associative memory and fuzzy logic controller (FLC), is a
computing framework based on the concepts of fuzzy theory, fuzzy
if-then rules and fuzzy reasoning.
FIS have many application areas
Automatic control and robotics
Classification and clustering
Pattern recognition
Decision analysis and expert systems
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Generic FIS Structure
Defuzzification
Fuzzification
Inference
mechanism
Rule-base
...
...
x1
x2
xn
y1
y2
yn
Crisp
inputs
Crisp
outputs
Fuzzified
inputs
Fuzzified
conclusions
Fuzzification: transformation of crisp values to fuzzy sets
Rule-base: contains a selection of fuzzy rules
Inference mechanism: performs a certain inference procedure
upon the rules and derives a conclusion
Defuzzification: transformation of output fuzzy sets to crisp
values
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
What Will Be Discussed
Defuzzification
Fuzzification
Inference
mechanism
Rule-base
Reference input
r(t)
Process
Inputs
u(t)
Outputs
y(t)
Fuzzy logic controller
We investigate two most common FIS types:
Mamdani and Takagi-Sugeno fuzzy models
An example of a fuzzy control system is provided along the
coarse of investigation
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Controlled Process: Inverted Pendulum
θ
F
x
r(t)
Inverted
pendulum
u(t) y(t)
Fuzzy logic
controller
d
dt
Σ
-
+
r(t) — reference θ angle
u(t) — force (N)
y(t) — θ angle (rad)
e(t) = r(t) − y(t)
e(t)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Mamdani Type FIS
Was proposed as the first attempt to control a steam engine
and boiler combination by a set of linguistic control rules
obtained from experienced human operators
The most straight-forward cognitive approach to transferring
knowledge into fuzzy models
Design steps
Choose controller inputs and outputs (linguistic variables)
Assign linguistic values to every variable
Derive control rules for every possible scenario
Choose proper MF for every linguistic value
Specify the parameters of the inference mechanism
Test, observe behavior, tune
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
FIS Linguistic Variables and Values
For our inverted pendulum example we choose the following
inputs and outputs:
“error” describes e(t) = r(t) − y(t)
“change-in-error” describes d
dt e(t)
“force” describes u(t)
The linguistic variables take on the following values:
“negative large” or “neglarge”, represented by “-2”
“negative small” or “negsmall”, represented by “-1”
“zero”, represented by “0”
“positive small” or “possmall”, represented by “1”
“positive large” or “poslarge”, represented by “2”
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy Rules
Recall the general MIMO rule structure (15). Substituting mathematical
characters with our assigned linguistic labels and values, we get rules of
the following structure:
(a) IF error is neglarge AND change-in-error is neglarge THEN force is poslarge
(b) IF error is zero AND change-in-error is possmall THEN force is negsmall
(c) IF error is poslarge AND change-in-error is negsmall THEN force is negsmall
F F F
(a) (b) (c)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy Rule-Base
The number of rules for a MISO FIS is at most
Qn
i=1 Ni, where Ni
is the number of linguistic values for the i-th linguistic premise
variable. (All possible combinations of premise linguistic values.)
In our case the number of rules is equal to 5 · 5 = 25.
Continuing the logic of the previous three rule cases, we can derive
the rule-base, presented as a table.
force change-in-error
-2 -1 0 1 2
error
-2 2 2 2 1 0
-1 2 2 1 0 -1
0 2 1 0 -1 -2
1 1 0 -1 -2 -2
2 0 -1 -2 -2 -2
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Membership Functions
e(t) (rad)
π/4
0
-π/4
-π/2
zero
negsmall
neglarge possmall poslarge
π/2
de(t)/dt (rad/s)
zero
negsmall
neglarge possmall poslarge
u(t) (N)
10 20
0
-10
-20
zero
negsmall
neglarge possmall poslarge
-30 30
π/8
0
-π/8
-π/4 π/4
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzification
Singleton fuzzification: apply a fuzzy singleton µfuz
Ai
(x) to the
premise variable universe, perform intersection.
This method is applied when measurement noise is not accounted for — the
crisp input values are certain. In “Gaussian fuzzification” a Gaussian is used as
a fuzzification function, which accounts for inconsistency in the input signal.
e(t) (rad)
π/4
0
-π/4
-π/2
zero
negsmall
neglarge possmall poslarge
π/2
de(t)/dt (rad/s)
zero
negsmall
neglarge possmall poslarge
π/8
0
-π/8
-π/4 π/4
e(t) = -9π/20
de(t)/dt = 9π/80
Crisp input e(t) = −9π/20:
µ 
neglarge
(e) = min µneglarge(e), µfuz
1 (e)

=
min(0.75, 1) = 0.75;
µ 
negsmall
(e) = min µnegsmall(e), µfuz
1 (e)

=
min(0.25, 1) = 0.25; all other zero.
Crisp input ė(t) = 9π/80:
µ d
zero(ė) = min µzero(ė), µfuz
2 (ė)

=
min(0.125, 1) = 0.125;
µ 
possmall
(ė) = min µpossmall(ė), µfuz
2 (ė)

=
min(0.875, 1) = 0.875; all other zero.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Mamdani Inference Mechanism Steps
Calculate the firing strength for each rule in the rule-base
Determine which rules are on using the firing strengths
Determine implied fuzzy sets — perform fuzzy implication
Determine overall implied fuzzy set — perform fuzzy
aggregation*
*Performed in case of applying specific types of defuzzification.
If defuzzification uses implied fuzzy sets, the step is not performed.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Firing Strength of a Premise
The firing strength of a rule is the degree of certainty that the rule premise
holds for the given inputs. Its calculation depends on the linguistic operators
used in the structure of a premise.
For any linguistic variables x1 and x2 the typical operators are the following:
Fuzzy complement (NOT):
Defined in (6) as µÂk
1
(x1) = 1 − µÂk
1
(x1)
Fuzzy union (OR):
Defined in (7) as maximum µÂk
1 ∪Âl
2
(x1, x2) = max

µÂk
1
(x1) , µÂl
2
(x2)

Alternative: algebraic sum
µÂk
1 ∪Âl
2
(x1, x2) = µÂk
1
(x1) + µÂl
2
(x2) − µÂk
1
(x1) µÂl
2
(x2)
Fuzzy intersection (AND):
Defined in (8) as minimum µÂk
1 ∩Âl
2
(x1, x2) = min

µÂk
1
(x1) , µÂl
2
(x2)

Alternative: algebraic product µÂk
1 ∩Âl
2
(x1, x2) = µÂk
1
(x1) µÂl
2
(x2)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Firing Strength: More Complex Premises
In premises with more complex logic, the firing strength is calculated by
partitioning the premise into simpler terms.
Example 3
The premise
IF x1 is Â2
1 AND x2 is Â1
2 AND x3 is NOT Â5
3 OR x4 is Â3
4
yields the firing strength
µpremise (x1, x2, x3, x4) =
max
h
min

µÂ2
1
(x1) , µÂ1
2
(x2) , 1 − µÂ5
3
(x3)

, µÂ3
4
(x4)
i
.
Also there exists an option to use a “rule certainty” weight. This way, for
the i-th rule, the firing strength is multiplied by the weight wi, which
specifies how certain we are in this specific rule compared to other rules.
Keep in mind that there are more alternatives to AND and OR
operations, you can also specify your custom ones.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Which Rules Are On
The rule is considered being “on” if its premise is non-zero:
µpremise (x1, x2, . . . , xn)  0
An optional step, that reduces the number of computations
Alternatively, perform fuzzy implication over the whole
rule-base, but you will be doing a large number of operations
over zero values
Example 4
Consider a FIS with 3 inputs and 10 MFs per input. The number of rules
is then at most 103
= 1000. With the universes partitioned by so many
rules, the number of “on” rules at any given time will be quite small. If
for example 10 rules are on, then mark those rules and perform later
steps with 10 sets of parameters, instead of using the whole rule-base and
performing 100 times more computations, mainly with zeros.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Implied Fuzzy Sets: Fuzzy Implication
The implied fuzzy set of an output yj for a rule i, which has a
consequent Bk
j , and a premise degree of membership equal to
µpremise(i) (x1, x2, . . . , xn), is characterized by
µB̂k
j
(yj) = min

µpremise(i) (x1, x2, . . . , xn) , µBk
j
(yj)

.
Alternatively the algebraic product can be defined as the
implication operation:
µB̂k
j
(yj) = µpremise(i) (x1, x2, . . . , xn) µBk
j
(yj) .
An implied fuzzy set is computed for every rule that is “on”.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Overall Implied Fuzzy Set: Fuzzy Aggregation
The overall implied fuzzy set B̂j of an output yj, which
incorporates the implied fuzzy sets
n
B̂k
j , B̂l
j, . . . , B̂p
j
o
is
characterized by
µB̂j
(yj) = max

µB̂k
j
(yj) , µB̂l
j
(yj) , . . . , µB̂p
j
(yj)

.
Alternatively the algebraic sum can be defined as the aggregation
operation:
µB̂j
(yj) = µB̂k
j
(yj) + µB̂l
j
(yj) + · · · + µB̂p
j
(yj) −
− µB̂k
j
(yj) µB̂l
j
(yj) . . . µB̂p
j
(yj) .
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Mamdani Inference: Example
e(t) (rad)
π/4
0
-π/4
-π/2
zero
negsmall
neglarge possmall poslarge
π/2
de(t)/dt (rad/s)
zero
negsmall
neglarge possmall poslarge
π/8
0
-π/8
-π/4 π/4
e(t) = -9π/20
de(t)/dt = 9π/80
u(t) (N)
10 20
0
-10
-20
zero
negsmall
neglarge possmall poslarge
-30 30
u(t) (N)
10 20
0
-10
-20
zero
negsmall
neglarge possmall poslarge
-30 30
u(t) (N)
10 20
0
-10
-20
zero
negsmall
neglarge possmall poslarge
-30 30
Apply implication (min)
Apply
AND
(min)
u(t) (N)
10 20
0
-10 30
Apply aggregation (max)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Mamdani Inference: Example Computations
From the fuzzification stage we have established that we have four fuzzy values:
µ 
neglarge
(e) = 0.75; µ 
negsmall
(e) = 0.25; µ d
zero(ė) = 0.125;
µ 
possmall
(ė) = 0.875. Thus the rules that are on are:
IF error is neglarge AND change-in-error is zero THEN force is poslarge (red)
IF error is neglarge AND change-in-error is possmall THEN force is possmall (orange)
IF error is negsmall AND change-in-error is zero THEN force is possmall (green)
IF error is negsmall AND change-in-error is possmall THEN force is zero (blue)
Compute the firing strengths of the four rules using min for the AND operator:
µpremise(1) (e, ė) = min(µ 
neglarge
(e), µ d
zero(ė)) = min(0.75, 0.125) = 0.125;
µpremise(2) (e, ė) = min(µ 
neglarge
(e), µ 
possmall
(ė)) = min(0.75, 0.875) = 0.75;
µpremise(3) (e, ė) = min(µ 
negsmall
(e), µ d
zero(ė)) = min(0.25, 0.125) = 0.125;
µpremise(4) (e, ė) = min(µ 
negsmall
(e), µ 
possmall
(ė)) = min(0.25, 0.875) = 0.25.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Mamdani Inference: Example Computations Continued
Implied fuzzy sets are derived from the rule premises using min as:
µ 
poslarge(1)
(u) = min µpremise(1) (e, ė) , µposlarge (u)

=
= min(0.125, 1) = 0.125;
µ 
possmall(2)
(u) = min µpremise(2) (e, ė) , µpossmall (u)

=
= min(0.75, 1) = 0.75;
µ 
possmall(3)
(u) = min µpremise(3) (e, ė) , µpossmall (u)

=
= min(0.125, 1) = 0.125;
µ d
zero(4) (u) = min µpremise(4) (e, ė) , µzero (u)

= min(0.25, 1) = 0.25.
The overall implied fuzzy set is obtained by fuzzy aggregation using max as:
µ 
overall
(u) =
max

µ 
poslarge(1)
(u) , µ 
possmall(2)
(u) , µ 
possmall(3)
(u) , µ d
zero(4) (u)

.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Mamdani Inference: Principle Justification
The choice of linguistic operator functions, fuzzy inference and
fuzzy aggregation operations is based on the assertions that:
We can be no more certain in our premises than we are certain in
our data.
We can be no more certain in our conclusions than we are certain
in our premises.
u(t) (N)
10 20
0
-10
-20
zero
negsmall
neglarge possmall poslarge
-30 30 u(t) (N)
10 20
0
-10 30
Aggregation (max)
Inference (product)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification
The result of fuzzy inference is the implied fuzzy set (or sets). For
the systems, where a crisp value is required from the FIS, the
operation called defuzzification is applied to the implied sets.
A number of defuzzification strategies exist, and it is not hard to
invent more, suiting your specific application.
Each provides a means to choose a crisp output ycrisp
j based on
either the implied fuzzy sets or the overall implied fuzzy set.
Reviewed defuzzification methods:
Center of gravity (COG)
Center-average
Maximum criterion: mean of maximum (MOM), smallest of
maximum (SOM), largest of maximum (LOM)
Center of area (COA)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification on IFS: Center of Gravity
Definition 22 (Center of gravity)
In Center of gravity (COG) defuzzification the output ycrisp
j is
computed using the center of area and area of each implied fuzzy set:
ycrisp
j =
PR
i=1 bj
i
´
Yj
µB̂i
j
(yj) dyj
PR
i=1
´
Yj
µB̂i
j
(yj) dyj
, (22)
where R is the number or rules, bj
i is the center of area of the MF of Bp
j
associated with the implied fuzzy set B̂i
j for the i-th rule and
ˆ
Yj
µB̂i
j
(yj) dyj
denotes the area under µB̂i
j
(yj).
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification on IFS: Center of Gravity
The COG is easy to compute if you have simple areas under
implied fuzzy set MFs, e.g. triangles with tops chopped off while
using triangle MFs and min for implication.
Notice though, that for this method to be reliable the fuzzy system
must be defined such that
R
X
i=1
ˆ
Yj
µB̂i
j
(yj) dyj 6= 0
for all xi. This is achieved if for every possible combination of
inputs the consequent fuzzy sets all have nonzero area.
Also areas must be computable, thus we cannot use open MFs for
output fuzzy sets.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification on IFS: Center-Average
Definition 23 (Center-average)
In Center-average defuzzification the output ycrisp
j is computed using
the centers of each of the output MFs and the maximum certainty of
each of the implied fuzzy sets:
ycrisp
j =
PR
i=1 bj
i supyj
n
µB̂i
j
(yj)
o
PR
i=1 supyj
n
µB̂i
j
(yj)
o , (23)
where supyj
denotes the supremum (i.e. the least upper bound) of the
implied fuzzy set µB̂i
j
(yj).
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification on IFS: Center-Average
The center-average is easy to compute if implied fuzzy set MFs
have a single maximum, e.g. reduced triangles while using triangle
MFs and product for implication — in this case
sup
yj
n
µB̂i
j
(yj)
o
= max

µB̂i
j
(yj)

.
Notice though, that the fuzzy system must be defined such that
R
X
i=1
sup
yj
n
µB̂i
j
(yj)
o
6= 0
for all xi. This is achieved as in the case of COG.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification on IFS: Center-Average
If using normal MFs for output fuzzy sets, then for many inference
strategies we have
sup
yj
n
µB̂i
j
(yj)
o
= µpremise(i) (x1, x2, . . . , xn) ,
which is the firing strength of rule i. The formula for
defuzzification is then given by
ycrisp
j =
PR
i=1 bj
i µpremise(i) (x1, x2, . . . , xn)
PR
i=1 µpremise(i) (x1, x2, . . . , xn)
, (24)
where
PR
i=1 µpremise(i) (x1, x2, . . . , xn) 6= 0, ∀xi must be ensured.
The shape of the output MFs does not matter, as bounds of
supremum subsets can be defined using singletons.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification on The Overall IFS: Maximum Criterion
For the MOM, SOM and LOM defuzzification the crisp output is
chosen as a point on the output universe Yj, for which the overall
implied fuzzy set B̂j reaches its maximum:
ycrisp
j ∈
(
arg sup
Yj
n
µB̂j
(yj)
o
)
.
MOM, SOM and LOM differ in the strategy of choosing the crisp
value from this subset.
u(t) (N)
10 20
0
-10 30
supremum
MOM
LOM
SOM
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification on The Overall IFS: MOM
Definition 24 (Mean of maximum)
Define a fuzzy set B̂∗
j ⊆ Yj with a MF defined as
µB̂∗
j
(yj) =
(
1, µB̂j
(yj) = supYj
n
µB̂j
(yj)
o
,
0, otherwise.
Then the crisp output of mean of maximum (MOM) defuzzification is
defined as
ycrisp
j =
´
Yj
yjµB̂∗
j
(yj) dyj
´
Yj
µB̂∗
j
(yj) dyj
, (25)
where the fuzzy system must be defined so
´
Yj
µB̂∗
j
(yj) dyj 6= 0, ∀xi.
Notice that if µB̂∗
j
(yj) = 1 lies in a single interval
h
yleft
j , yright
j
i
⊆ Yj,
then ycrisp
j =

yleft
j + yright
j

/2.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification on The Overall IFS: SOM and LOM
Definition 25 (Smallest of maximum)
In smallest of maximum (SOM) defuzzification the output ycrisp
j is
computed as the minimal argument of the output universe Yj, for which
the the overall implied fuzzy set B̂j reaches its maximum:
ycrisp
j = min

arg sup
Yj
n
µB̂j
(yj)
o
#
. (26)
Definition 26 (Largest of maximum)
In largest of maximum (LOM) defuzzification the output ycrisp
j is
computed as the maximal argument of the output universe Yj, for which
the the overall implied fuzzy set B̂j reaches its maximum:
ycrisp
j = max

arg sup
Yj
n
µB̂j
(yj)
o
#
. (27)
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification on The Overall IFS: Center of Area
Definition 27 (Center of area)
In center of area (COA) defuzzification the output ycrisp
j is computed
over the area of the MF of the overall implied fuzzy set B̂j as
ycrisp
j =
´
Yj
yjµB̂j
(yj) dyj
´
Yj
µB̂j
(yj) dyj
, (28)
where the fuzzy system must be defined so
´
Yj
µB̂j
(yj) dyj 6= 0, ∀xi.
Computationally expensive: overlapping implied fuzzy sets may
result in a overall implied fuzzy set with a sophisticated shape.
Computing the area of such shapes in real-time is not an easy task.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification: Example
For our symmetrical triangular MFs the area and center of area of the
implied fuzzy sets are easily calculated. If a symmetric triangle has a
height 1 and base width w :
The area of a triangle with the top “chopped off” at height h is
equal to w

h − h2
2

The area of a triangle with height h is equal to 1
2 wh
Here w is the support length of B̂i
j and h is µpremise(i) (x1, x2, . . . , xn).
10 20
0 10 20
0
min implication product implication
w w
h h
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification: COG Example
For implication defined by min:
ucrisp =
bpl
´
U µb
pl(1)
(u)du+bps
´
U µc
ps(2)(u)du+bps
´
U µc
ps(3)(u)du+bz
´
U µb
z(4)(u)du
´
U µb
pl(1)
(u)du+
´
U µc
ps(2)(u)du+
´
U µc
ps(3)(u)du+
´
U µb
z(4)(u)du
=
= (20)(1.1719)+(10)(4.6875)+(10)(1.1719)+(0)(2.1875)
1.1719+4.6875+1.1719+2.1875 = 82.032
9.2188 = 8.90
For implication defined by product:
ucrisp =
bpl
´
U µb
pl(1)
(u)du+bps
´
U µc
ps(2)(u)du+bps
´
U µc
ps(3)(u)du+bz
´
U µb
z(4)(u)du
´
U µb
pl(1)
(u)du+
´
U µc
ps(2)(u)du+
´
U µc
ps(3)(u)du+
´
U µb
z(4)(u)du
=
= (20)(0.625)+(10)(3.75)+(10)(0.625)+(0)(1.25)
0.625+3.75+0.625+1.25 = 56.25
6.25 = 9.0
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Defuzzification: Center-Average Example
For implication defined by product:
ucrisp =
bpl supu
n
µb
pl(1)
(u)
o
+bps supu{µc
ps(2)(u)}+bps supu{µc
ps(3)(u)}+bz supu{µb
z(4)(u)}
supu
n
µb
pl(1)
(u)
o
+supu{µc
ps(2)(u)}+supu{µc
ps(3)(u)}+supu{µb
z(4)(u)}
=
= (20)(0.125)+(10)(0.75)+(10)(0.125)+(0)(0.25)
0.125+0.75+0.125+0.25 = 11.25
1.25 = 9.0
The supremum of a reduced triangular MF its its single peak which is
equal to µpremise(i) (x1, x2, . . . , xn).
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
FIS Input-Output Curve
Portrays the dependency of FIS output on its inputs. MATLAB command: gensurf
−1.5
−1
−0.5
0
0.5
1
1.5
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
−15
−10
−5
0
5
10
15
error
errorDot
force
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Mamdani Fuzzy Control of Inverted Pendulum
0 2 4 6 8 10 12 14 16 18 20
−0.2
−0.1
0
0.1
0.2
Mamdani fyzzy control of inverted pendulum
Angle
(rad)
0 2 4 6 8 10 12 14 16 18 20
−1.5
−1
−0.5
0
0.5
Position
(m)
0 2 4 6 8 10 12 14 16 18 20
−20
−10
0
10
20
Time (s)
Force
(N)
Position
PositionDot
Theta
ThetaDot
Control influence
Interference
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
FIS Design in MATLAB: Editor Main
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
FIS Design in MATLAB: MF Editor
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
FIS Design in MATLAB: Rule Viewer
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
FIS Design in MATLAB: Input-Output Curve
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Takagi-Sugeno FIS
Takagi-Sugeno or simply Sugeno-type FIS has a different way of
computing the consequence and defuzzification.
A general Sugeno rule has a form
IF x1 is Ak
1 AND x2 is Al
2 AND . . . AND xn is Ap
n THEN zi = fi(·).
Here z = f(·) may be any function (even another mapping, like
neural network, or another FIS)
Usually zi = fi (x1, x2, . . . , xn) is used. If this function is a first
order polynomial, i.e.
zi = anx1 + an−1x2 + · · · + a1xn + a0,
the inference system is called a first-order Sugeno FIS. When f is
a constant, the system is called a zero-order Sugeno FIS.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Sugeno Inference Principles
The premises µpremise(i) (x1, x2, . . . , xn) are computed as in the
Mamdani FIS, incorporating fuzzification and linguistic operators.
The defuzzification is usually performed using weighted average:
ycrisp
=
PR
i=1 ziµpremise(i) (x1, x2, . . . , xn)
PR
i=1 µpremise(i) (x1, x2, . . . , xn)
, (29)
where the fuzzy system is defined so that
PR
i=1 µpremise(i) (x1, x2, . . . , xn) 6= 0, ∀xi.
Thus the Sugeno FIS can be used as a general mapper for a wide
variety of applications.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Sugeno FIS Example
We will not define the whole rule-base of the inverted pendulum
controller for the Sugeno FIS. Lets specify zi = fi (e, ė) for the
rules that are on in our example:
z1 = −5e + 4ė + 3 for the red rule;
z2 = −4e + 2ė + 2 for the orange rule;
z3 = −2e + 1ė + 1 for the green rule;
z4 = −0.5e + 0.5ė + 0 for the blue rule.
For the values e = − 9
20π and ė = 9
80π the functions take on values
z1 = −5 − 9
20π

+ 4 9
80π

+ 3 = 11.482
z2 = −4 − 9
20π

+ 2 9
80π

+ 2 = 8.362
z3 = −2 − 9
20π

+ 1 9
80π

+ 1 = 4.181
z4 = −0.5 − 9
20π

+ 0.5 9
80π

+ 0 = 0.884
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Sugeno FIS Example
Then the FIS crisp output will be
ycrisp
=
P4
i=1 ziµpremise(i) (e, ė)
P4
i=1 µpremise(i) (e, ė)
=
11.482 · 0.125 + 8.362 · 0.75 + 4.181 · 0.125 + 0.884 · 0.25
0.125 + 0.75 + 0.125 + 0.25
= 9.03
Notice, that no implication and aggregation is used. This simplifies
the inference process a lot.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Sugeno Input-Output Curve
−0.2
−0.1
0
0.1
0.2
0.3
−1
−0.5
0
0.5
1
−20
−15
−10
−5
0
5
10
15
20
in1
in2
out
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Sugeno Fuzzy Control of Inverted Pendulum
0 2 4 6 8 10 12 14 16 18 20
−2
−1
0
1
2
Sugeno fyzzy control of inverted pendulum
Position
(m)
0 2 4 6 8 10 12 14 16 18 20
−0.4
−0.2
0
0.2
0.4
Angle
(rad)
0 2 4 6 8 10 12 14 16 18 20
−10
−5
0
5
10
Time (s)
Force
(N)
Ref. position
Act. position
Theta
Control influence
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
FIS Design in MATLAB: Sugeno FIS Editor
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
FIS Design in MATLAB: Sugeno Rules
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
FIS Tuning
As was mentioned, the testing and tuning is the last step of FIS
development. If testing fails, the FIS has to be tuned or even redesigned.
r(t)
Process
u(t) y(t)
Fuzzy logic
controller
d
dt
Σ
-
+
g1
g2
h
External FIS tuning is performed via input and output scaling gains. The
gain values may be either constant or functions of some sort, e.g. bell or
Gaussian functions.
Internal tuning is performed by reviewing the membership functions and
the rule-base. Trying out different inference and defuzzification
operations is also a good practice.
The MATLAB FIS editor is a good tool for debugging. There you can
observe the reaction of your rule firing strengths, input-output curves,
etc. to the changes you make.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy PID Controller
The term Fuzzy PID controller can be understood in two ways:
A fuzzy FIS, which has the inputs e(t), d
dte(t),
´
e(t)dt
A crisp PID controller, the KP , KI and KD coefficients of
which are tuned by a fuzzy expert system
A tunable PID controller allows to:
Increase the robustness of the typical PID controller
Increase its dynamic range
Account for different scenarios of system operation
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy PID Controller Example 1
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy PID Controller Example 2
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy PID Control Simulation
0 5 10 15 20 25 30 35 40
0
1
2
3
4
5
Fuzzy PID Control of Tank System
0 5 10 15 20 25 30 35 40
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Time (s)
Control influence: PID
Control influence: Fuzzy PID
Set value
Upper limit
Lower limit
Liquid level: PID
Liquid level: Fuzzy PID
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Making Anything Fuzzy
If you have some time variant system with parameters that
cannot be statically specified...
If you cannot describe parameter variation mathematically but
you intuitively know how they should be changed...
Introduce a fuzzy expert or control system to do it!
We have seen it in the fuzzy PID example
It is generally applicable to any linear or nonlinear dynamic
system model
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy Predictor
Having a discrete time series θ1, θ2, . . . , θk, the task of a prediction
algorithm is to determine the next values of the given time series
θ̂k+1, θ̂k+2, . . . , θ̂k+l.
The time series possesses certain dynamical properties θk+1 = θk + ωk,
where ωk is the system perturbation of unknown distribution.
The observed value may be affected by external interference
θ̃k = θk + νk, where νk is referred to as observation noise.
The Kalman (exponential average) predictor is given by the recurrence
θ̂k+1 = αθ̂k + (1 − α)θ̃k,
where θ̂k+1 is the predicted value of the time series, θ̂k is the last known
predicted value, θ̃k is the last observed value and α ∈ [0, 1] is the weight
parameter.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy Predictor Continued
Basic logic tells us that:
If the system is steady, θ̃k influences prediction more and α → 0.
On the other hand, if the system is not steady or noisy, θ̃k is less
reliable than θ̂k and α → 1.
Specify the FIS input as error ek = θ̂k − θ̃k , then develop rules, e.g.
IF error is small THEN α is large
IF error is medium THEN α is medium
IF error is large THEN α is small
And, well, you know the rest.
P.S. Think, how introducing the change-in-error into the FIS will improve
the situation.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
General Linear Dynamic Model
The linear discrete-time dynamic system model takes the form
xk = Ak−1xk−1 + qk−1
yk = Hk−1xk + rk−1
,
where xk is the system state vector at time step k, yk is the measurement
vector at k, Ak−1 is the transition matrix of the dynamic model, Hk−1 is the
measurement matrix, qk−1 ∼ N (0, Qk−1) is the process noise with covariance
Qk−1 and rk−1 ∼ N (0, Rk−1) is the measurement noise with covariance Rk−1.
For the majority of applications it is assumed that the noise has fixed
variance and a normal distribution
What to do, if noise is time variant and has varying distribution?
One solution is the to develop a fuzzy system, which will estimate noise
parameters and tune the controller, filter, etc. online
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Adaptive Neuro-Fuzzy Inference System
Adaptive Neuro-Fuzzy Inference System (ANFIS) is a representation of
the Sugeno FIS in a form of a feed-forward neural network.
A11
A12
A21
A22
x1
x2
Π
Π
N
N
f1
f2
Σ
x2
x1
x2
x1
y
Layer 1 Layer 2 Layer 3 Layer 4 Layer 5
w1
w2
w2
w1
f1
w1
f2
w2
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
ANFIS Architecture
The first-order Sugeno system r-th rule takes the form
IF x1 is Ak
1 AND x2 is Al
2 AND . . . AND xn is Ap
n
THEN fr = pn,rx1 + pn−1,rx2 + · · · + p1,rxn + p0,r
Lets take a system with two inputs x1, x2, one output y, and two rules:
Rule1 : IF x1 is A1
1 AND x2 is A1
2 THEN f1 = p2,1x1 + p1,1x2 + p0,1
Rule2 : IF x1 is A1
2 AND x2 is A2
2 THEN f2 = p2,2x1 + p1,2x2 + p0,2
Layer 1: Every i∗
-th node is an adaptive node with a function
O1,i∗ = µAk
i
(xi) , i∗
= i × k : i = 1, 2; k = 1, 2.
The parameters of the node’s MF are called premise parameters.
A11
A12
A21
A22
x1
x2
Π
Π
N
N
f1
f2
Σ
x2
x1
x2
x1
y
Layer 1 Layer 2 Layer 3 Layer 4 Layer 5
w1
w2
w2
w1
f1
w1
f2
w2
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
ANFIS Architecture Continued
Layer 2: Every i∗
-th node is a fixed node, which calculates the firing
strengths for each rule:
O2,i∗ = wi∗ = µAk
1
(x1) µAk
2
(x2) , i∗
= k = 1, 2.
Besides product, other operations for the linguistic AND may be used.
Layer 3: Every i∗
-th node is a fixed node, which computes the ratio of
the i∗
-th firing strength to the sum of all R rules firing strengths:
O3,i∗ = wi∗ =
wi∗
PR
r=1 wr
, i∗
= 1, 2.
The outputs of this layer are called normalized firing strengths.
A11
A12
A21
A22
x1
x2
Π
Π
N
N
f1
f2
Σ
x2
x1
x2
x1
y
Layer 1 Layer 2 Layer 3 Layer 4 Layer 5
w1
w2
w2
w1
f1
w1
f2
w2
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
ANFIS Architecture Continued
Layer 4: Every i∗
-th node is an adaptive node with a function
O4,i∗ = wrfr = wr (p2,rx1 + p1,rx2 + p0,r) , i∗
= r = 1, 2.
The parameters {p2,r, p1,r, p0,r} are called consequent parameters.
Layer 5: The single node is a fixed node, which computes the overall
output as a summation of all incoming values:
O5,1 = y =
R
X
r=1
wrfr =
PR
r=1 wrfr
PR
r=1 wr
.
A11
A12
A21
A22
x1
x2
Π
Π
N
N
f1
f2
Σ
x2
x1
x2
x1
y
Layer 1 Layer 2 Layer 3 Layer 4 Layer 5
w1
w2
w2
w1
f1
w1
f2
w2
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
ANFIS Training
ANFIS is trained by a hybrid learning algorithm. Each iteration makes
two passes:
During the forward pass node outputs go forward until layer 4 and
the consequent parameters are identified by the least-squares method
In the backward pass the error signals (i.e. reference minus layer 4
output) propagate backward and the premise parameters are
updated by gradient descent
Forward pass Backward pass
Premise parameters Fixed Gradient descent
Consequent parameters Least-squares estimator Fixed
Signals Node outputs Error signals
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
MATLAB ANFIS Editor: anfisedit
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Adaptive FIS Applications
The advantage of adaptive fuzzy systems compared to, e.g.
Artificial Neural Networks (ANN) is that they are gray box as
opposed to ANN, which are black box systems.
The application range is no less than of ANN:
Nonlinear system identification
Adaptive control (process control, inverse kinematics, etc.)
Adaptive machine scheduling
Clustering, classification and pattern recognition
Adaptive expert systems, predictors
Adaptive noise cancellation
And others!
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Direct Adaptive Control
r(t)
Process
u(t) y(t)
Reference model,
fuzzy expert system
Controller
Adaptation
mechanism
Controller
parameters
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Indirect Adaptive Control
r(t)
Process
u(t) y(t)
Adaptive mapper:
ANFIS or other
System
identification
Controller
Controller
parameters
Controller
designer
Process
parameters
Fuzzy expert system
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy Clustering and Classification
Fuzzy clustering and fuzzy classification differ from conventional crisp clustering
and classification approaches in that:
In crisp clustering each element of a dataset has a degree of belonging 1 to
its assigned cluster and 0 to all other clusters
In fuzzy clustering each element of a dataset has a degree of belonging
ranging from 0 to 1 to each of the clusters
In crisp classification a classified pattern belongs to one of the pre-specified
classes with certainty 1 and with certainty 0 to all other classes
In fuzzy classification a classified pattern belongs to each of the
pre-specified classes with certainty ranging from 0 to 1
The most common fuzzy clustering algorithm is Fuzzy C-means clustering.
Fuzzy classification is performed applying any of the adaptive FIS structures,
e.g. ANFIS, ARIC, GARIC, NNDFR, NEFCLASS, etc.
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy C-Means: MATLAB GUI findcluster
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Fuzzy Clustering Demo: fcmdemo
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Outline
1. Concepts of Fuzzy Logic
1.1 Introduction
1.2 Fuzzy Sets
1.3 Fuzzy Set Operations
1.4 Membership Functions
1.5 Fuzzy Rules
2. Fuzzy Inference Systems
2.1 Introduction
2.2 Mamdani FIS
2.3 Mamdani Inference
2.4 Defuzzification
2.5 Mamdani FIS Editor
2.6 Takagi-Sugeno FIS
2.7 Sugeno FIS Editor
3. Applications
3.1 Fuzzy PID Controller
3.2 Fuzzy %Anything%
3.3 Adaptive FIS
3.4 Adaptive Control
3.5 Clustering and Classification
3.6 Discussion
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Mamdani vs Sugeno FIS
Advantages of the Mamdani Method
It is intuitive
It has widespread acceptance
It is well suited for human input
Advantages of the Sugeno Method
It is computationally more efficient
It works well with linear techniques (e.g. PID control)
It works well with optimization and adaptive techniques
It has guaranteed continuity of the output surface
It is well suited for mathematical analysis
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Criticism of Mamdani Fuzzy Control
Fuzzy control methods are “parasitic:” they simply implement
trivial interpolations of control strategies obtained by other means
99% of fuzzy feedback control applications deal with
essentially 1st or 2nd-order, overdamped, SISO systems
Attempt to emulate or duplicate human control behavior?
Human is a very poor controller for complex, multi-variable,
marginally stable dynamic plants
Very hard to generate multidimensional if-then rule tables
No guarantees of closed-loop stability, stability-robustness and
of performance in presence of uncertainty
Cannot generate “differential equation” controller rules
M. Athans, Crisp Control Is Always Better Than Fuzzy Feedback Control, EUFIT ’99 debate with prof. L.A. Zadeh
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Criticism of Sugeno Fuzzy Control
Approach developed to overcome criticism regarding
closed-loop stability guarantees
Design full-state feedback controllers for each linear model
(using crisp control methods) and “interpolate” using
membership functions
Given that a state space model is necessary, why bother to
introduce fuzzy ideas when conventional crisp control
methods can deal with the design problem directly?
Current methodology does not address stability-robustness
and performance-robustness issues
Current methodology does not address output feedback
requiring dynamic compensator designs
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Look on the Bright Side
The answers to some of the critical claims can be found in
Passino, Chapter 8
Although there are many unsolved problems with fuzzy
control, everyone may try and decide for himself, whether the
methodology suits him or not
Fuzzy systems are useful in many other fields of intelligent
computer systems besides process control
It is good to have this tool in your pocket
If you cannot express your view in equations, but you can
verbally — go fuzzy!
Concepts of Fuzzy Logic Fuzzy Inference Systems Applications
Useful Literature
K. M. Passino and S. Yurkovich, Fuzzy Control.
Addison Wesley Longman, Menlo Park, CA, 1998
J.-S. R. Jang, C.-T. Sun and E. Mizutani,
Neuro-fuzzy and Soft Computing: A Computational
Approach to Learning and Machine Intelligence.
Prentice Hall, 1997

More Related Content

Similar to Sergei_Astapov_Fuzzy_Control_lecture_slides.pdf (20)

PDF
Optimization using soft computing
Purnima Pandit
 
PDF
Unit-II -Soft Computing.pdf
Ramya Nellutla
 
PDF
50120140504018
IAEME Publication
 
PPTX
53158699-d7c5-4e6e-af19-1f642992cc58-161011142651.pptx
saadurrehman35
 
PPTX
Fuzzy Logic.pptx
ImXaib
 
PPTX
Fuzzy sets
ABSARQURESHI
 
PPTX
FL-01 Introduction.pptx
SourabhRuhil4
 
PPT
Fuzzy Set Theory
AMIT KUMAR
 
PDF
Lecture notes
graciasabineKAGLAN
 
PDF
9. MA Hashemi.pdf
BRNSS Publication Hub
 
PDF
9. MA Hashemi.pdf
BRNSS Publication Hub
 
PPTX
Fuzzy Logic ppt
Ritu Bafna
 
PDF
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
Wireilla
 
PDF
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
ijfls
 
PDF
1 s2.0-s1574035804702117-main
Govindappa Navalagi
 
PDF
Complete l fuzzy metric spaces and common fixed point theorems
Alexander Decker
 
PDF
International Journal of Mathematics and Statistics Invention (IJMSI)
inventionjournals
 
PPT
Fuzzy logic and fuzzy time series edited
Prof Dr S.M.Aqil Burney
 
PDF
WEEK-1.pdf
YASHWANTHMK4
 
PPTX
Resources
butest
 
Optimization using soft computing
Purnima Pandit
 
Unit-II -Soft Computing.pdf
Ramya Nellutla
 
50120140504018
IAEME Publication
 
53158699-d7c5-4e6e-af19-1f642992cc58-161011142651.pptx
saadurrehman35
 
Fuzzy Logic.pptx
ImXaib
 
Fuzzy sets
ABSARQURESHI
 
FL-01 Introduction.pptx
SourabhRuhil4
 
Fuzzy Set Theory
AMIT KUMAR
 
Lecture notes
graciasabineKAGLAN
 
9. MA Hashemi.pdf
BRNSS Publication Hub
 
9. MA Hashemi.pdf
BRNSS Publication Hub
 
Fuzzy Logic ppt
Ritu Bafna
 
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
Wireilla
 
APPROXIMATE CONTROLLABILITY RESULTS FOR IMPULSIVE LINEAR FUZZY STOCHASTIC DIF...
ijfls
 
1 s2.0-s1574035804702117-main
Govindappa Navalagi
 
Complete l fuzzy metric spaces and common fixed point theorems
Alexander Decker
 
International Journal of Mathematics and Statistics Invention (IJMSI)
inventionjournals
 
Fuzzy logic and fuzzy time series edited
Prof Dr S.M.Aqil Burney
 
WEEK-1.pdf
YASHWANTHMK4
 
Resources
butest
 

Recently uploaded (20)

PDF
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
PDF
IEEE EMBC 2025 「Improving electrolaryngeal speech enhancement via a represent...
NU_I_TODALAB
 
PDF
POWER PLANT ENGINEERING (R17A0326).pdf..
haneefachosa123
 
PDF
SMART HOME AUTOMATION PPT BY - SHRESTH SUDHIR KOKNE
SHRESTHKOKNE
 
PPTX
File Strucutres and Access in Data Structures
mwaslam2303
 
PDF
13th International Conference of Networks and Communications (NC 2025)
JohannesPaulides
 
PPTX
Unit II: Meteorology of Air Pollution and Control Engineering:
sundharamm
 
PPTX
00-ClimateChangeImpactCIAProcess_PPTon23.12.2024-ByDr.VijayanGurumurthyIyer1....
praz3
 
PPTX
ISO/IEC JTC 1/WG 9 (MAR) Convenor Report
Kurata Takeshi
 
PPT
Hazard identification and risk assessment PPT
SUNILARORA51
 
PPTX
GitHub_Copilot_Basics...........................pptx
ssusera13041
 
PPTX
Abstract Data Types (ADTs) in Data Structures
mwaslam2303
 
PDF
BEE331-Week 04-SU25.pdf semiconductors UW
faemoxley
 
PDF
MOBILE AND WEB BASED REMOTE BUSINESS MONITORING SYSTEM
ijait
 
PPTX
Dolphin_Conservation_AI_txhasvssbxbanvgdghng
jeeaspirant2026fr
 
PPTX
Unit-1&2,mdngmnd,mngmdnmgnmdnfmngdf.pptx
jayarao21
 
PPTX
Sensor IC System Design Using COMSOL Multiphysics 2025-July.pptx
James D.B. Wang, PhD
 
PDF
Non Text Magic Studio Magic Design for Presentations L&P.pdf
rajpal7872
 
PDF
A presentation on the Urban Heat Island Effect
studyfor7hrs
 
PDF
Introduction to Robotics Mechanics and Control 4th Edition by John J. Craig S...
solutionsmanual3
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
IEEE EMBC 2025 「Improving electrolaryngeal speech enhancement via a represent...
NU_I_TODALAB
 
POWER PLANT ENGINEERING (R17A0326).pdf..
haneefachosa123
 
SMART HOME AUTOMATION PPT BY - SHRESTH SUDHIR KOKNE
SHRESTHKOKNE
 
File Strucutres and Access in Data Structures
mwaslam2303
 
13th International Conference of Networks and Communications (NC 2025)
JohannesPaulides
 
Unit II: Meteorology of Air Pollution and Control Engineering:
sundharamm
 
00-ClimateChangeImpactCIAProcess_PPTon23.12.2024-ByDr.VijayanGurumurthyIyer1....
praz3
 
ISO/IEC JTC 1/WG 9 (MAR) Convenor Report
Kurata Takeshi
 
Hazard identification and risk assessment PPT
SUNILARORA51
 
GitHub_Copilot_Basics...........................pptx
ssusera13041
 
Abstract Data Types (ADTs) in Data Structures
mwaslam2303
 
BEE331-Week 04-SU25.pdf semiconductors UW
faemoxley
 
MOBILE AND WEB BASED REMOTE BUSINESS MONITORING SYSTEM
ijait
 
Dolphin_Conservation_AI_txhasvssbxbanvgdghng
jeeaspirant2026fr
 
Unit-1&2,mdngmnd,mngmdnmgnmdnfmngdf.pptx
jayarao21
 
Sensor IC System Design Using COMSOL Multiphysics 2025-July.pptx
James D.B. Wang, PhD
 
Non Text Magic Studio Magic Design for Presentations L&P.pdf
rajpal7872
 
A presentation on the Urban Heat Island Effect
studyfor7hrs
 
Introduction to Robotics Mechanics and Control 4th Edition by John J. Craig S...
solutionsmanual3
 
Ad

Sergei_Astapov_Fuzzy_Control_lecture_slides.pdf

  • 1. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy Logic: Principles and Applications ISS0023 Intelligent Control Systems Sergei Astapov Laboratory for Proactive Technologies Department of Computer Control Tallinn University of Technology, Estonia
  • 2. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Self Introduction Engineer at the Laboratory for Proactive Technologies (ProLab) PhD student at the Department of Computer Control Research topics Band-limited signal analysis Signal processing and data mining algorithms Classification and decision-making algorithms Room: U02-305 E-mail: [email protected]
  • 3. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Lecture Overview 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 4. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 5. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Why Go Fuzzy? Fuzzy logic models human expertise and knowledge in some task or application Consider conventional binary logic Variables may take values of TRUE or FALSE (0 or 1) Try then to answer a simple question with binary logic What do you consider warm temperature? How to answer? You could try to give a value or interval of “warm” temperature But then when does the temperature become cold or hot?
  • 6. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications The Fuzzy Way of Thinking t (°C) μ(t) 10 20 30 40 0 -10 -20 -30 -40 1 hot warm warm hot t (°C) μ(t) 10 20 30 40 0 -10 -20 -30 -40 1 cool chilly cold freezing freezing cold chilly cool Binary logic Fuzzy logic
  • 7. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications The Concept of Fuzzy Logic Fuzzy logic variables have a range of truthfulness from 0 to 1 Fuzzy logic operates with linguistic variables, like “temperature” instead of t(◦C) Each variable has a specific number of linguistic values, like “hot” or “cold” Fuzzy inference is performed using linguistic rules, e.g. IF temperature is cold THEN dress warm The linguistic values and their truth degree are quantified using membership functions (MF)
  • 8. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications A Little Bit of History 1964 : Lotfi A. Zadeh, UC Berkeley, introduced the paper on fuzzy sets Idea of grade of membership Imperfection and noise in the real world Sharp criticism from academic community 1965–1975 : Zadeh continued to broaden the foundation of fuzzy set theory Fuzzy multistage decision-making Fuzzy similarity relations Fuzzy restrictions, linguistic hedges 1970s : Research was mainly centered in Japan 1974 : E. H. Mamdani, UK, developed the first fuzzy logic controller 1977 : Dubois applied fuzzy sets in a comprehensive study of traffic conditions 1976–1987 : Industrial application of fuzzy logic in Japan and Europe 1987–Present : Widespread application
  • 9. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 10. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Conventional and Fuzzy Sets Let X be a space of objects and x be a generic element of X. A classical set A, A ⊆ X, is defined as a collection of elements x ∈ X, such that each element x can either belong or not belong to the set A. The classical set thus can be characterized as A = {x | x ∈ X} . By defining a characteristic function for each x, we can represent the classical set A by a set of ordered pairs (x, 0) or (x, 1), which indicate x / ∈ A or x ∈ A respectively. In a fuzzy set the characteristic function is allowed to have values of membership between 0 and 1.
  • 11. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy Set Definition Definition 1 (Fuzzy set) If X is a collection of objects x, then a fuzzy set A in X is defined as a set of ordered pairs: A = {(x, µA(x)) | x ∈ X} , (1) where µA(x) is called the membership function (MF) for the fuzzy set A. In fuzzy set theory classical sets are referred to as crisp sets and the values as crisp values. X is usually referred to as the universe of discourse. It represents the range of values the fuzzy variables may take. Universes of discourse may be either discrete or continuous.
  • 12. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Linguistic Variables and Values Fuzzy sets usually carry names appealing in our daily linguistic usage The universe is called a linguistic variable and its sets are called linguistic values The universe of discourse X is partitioned into several fuzzy sets, with MFs covering X in a more or less uniform manner Example 1 Consider the universe X of linguistic variable “temperature”. The universe may be defined differently, depending on the application. We may set it from the lowest to the highest temperature a typical human being can live in, e.g. [−50, 50] ◦ C. We partition the universe into 6 fuzzy sets: “freezing”, “cold”, “chilly”, “cool”, “warm”, “hot”. These sets are characterized by MFs µfreezing(x), µcold(x), µchilly(x), µcool(x), µwarm(x), µhot(x).
  • 13. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Relevant Properties of Fuzzy Sets Definition 2 (Support) The support of a fuzzy set A is the set of all points x ∈ X, such that µA(x) > 0: support(A) = {x | µA(x) > 0} . (2) Definition 3 (Core) The core of a fuzzy set A is the set of all points x ∈ X, such that µA(x) = 1: core(A) = {x | µA(x) = 1} . (3) Definition 4 (Crossover points) A crossover point of a fuzzy set A is a point x ∈ X, at which µA(x) = 0.5: crossover(A) = {x | µA(x) = 0.5} . (4)
  • 14. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Relevant Properties of Fuzzy Sets Continued Definition 5 (Normality) A fuzzy set A is normal if its core is nonempty, i.e. we can always find a point x ∈ X, such that µA(x) = 1. Definition 6 (Fuzzy singleton) A fuzzy set, the support of which is a single point in X with µA(x) = 1 is called a fuzzy singleton. Definition 7 (Symmetry) A fuzzy set A is symmetric if its MF is symmetric around a certain point x = c, namely, µA(c + x) = µA(c − x), ∀x ∈ X.
  • 15. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Relevant Properties of Fuzzy Sets Continued Definition 8 (Open left, open right, closed sets) A fuzzy set A is: open left if limx→−∞ µA(x) = 1, limx→+∞ µA(x) = 0; open right if limx→−∞ µA(x) = 0, limx→+∞ µA(x) = 1; and closed if limx→−∞ µA(x) = limx→+∞ µA(x) = 0. warm hot x μ(x) 10 20 30 40 0 -10 -20 -30 -40 1 0.5 freezing cold chilly cool core crossover points support all are normal symmetric open left open right temperature is 25 °C singleton
  • 16. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 17. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Containment Definition 9 (Containment or subset) Fuzzy set A is contained in fuzzy set B (or A is a subset of B), iff µA(x) ≤ µB(x) for all x: A ⊆ B ⇐⇒ µA(x) ≤ µB(x). (5) x μ(x) 1 A B
  • 18. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Complement Definition 10 (Complement or negation) The complement of a fuzzy set A, denoted by A or ¬A, or NOT A is defined as µA(x) = 1 − µA(x). (6) x μ(x) 1 A x μ(x) 1 NOT A
  • 19. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Union Definition 11 (Union or disjunction) The union of two fuzzy sets A and B is a fuzzy set C, written as C = A ∪ B or C = A OR B, the MF of which is related to those of A and B by µC(x) = max (µA(x), µB(x)) = µA(x) ∨ µB(x). (7) x μ(x) 1 A B x μ(x) 1 A OR B
  • 20. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Intersection Definition 12 (Intersection or conjunction) The intersection of two fuzzy sets A and B is a fuzzy set C, written as C = A ∩ B or C = A AND B, the MF of which is related to those of A and B by µC(x) = min (µA(x), µB(x)) = µA(x) ∧ µB(x). (8) x μ(x) 1 A B x μ(x) 1 A AND B
  • 21. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Cartesian Product and Co-product Definition 13 (Cartesian product and co-product) Let A and B be fuzzy sets in X and Y , respectively. The Cartesian product of A and B, denoted by A × B, is a fuzzy set in the product space X × Y with the membership function µA×B(x, y) = min (µA(x), µB(y)) . (9) Similarly, the Cartesian co-product A + B is a fuzzy set with the membership function µA+B(x, y) = max (µA(x), µB(y)) . (10)
  • 22. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 23. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Preface A fuzzy set is completely characterized by its MF As the universe most often consists of real values, X ⊆ R, it is convenient to define MFs as continuous functions For a single linguistic variable the MFs are one-dimensional Combining the universes of different linguistic variables, MFs of higher dimensions may be derived Here the most commonly applied MF types are presented
  • 24. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Straight-Line MF:Triangular MF Definition 14 (Triangular MF) A triangular MF is specified by three parameters {a, b, c} as follows: triangle (x; a, b, c) =          0, x ≤ a. x−a b−a , a ≤ x ≤ b. c−x c−b , b ≤ x ≤ c. 0, c ≤ x. (11) It may also be described by min and max as triangle (x; a, b, c) = max min x − a b − a , c − x c − b , 0 . (12) The parameters a and c locate the “feet” of the triangle and b — its peak.
  • 25. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Straight-Line MF: Trapezoidal MF Definition 15 (Trapezoidal MF) A trapezoidal MF is specified by four parameters {a, b, c, d} as follows: trapezoid (x; a, b, c, d) =                0, x ≤ a. x−a b−a , a ≤ x ≤ b. 1, b ≤ x ≤ c. d−x d−c , c ≤ x ≤ d. 0, d ≤ x. (13) An alternative expression using min and max is trapezoid (x; a, b, c, d) = max min x − a b − a , 1, d − x d − c , 0 . (14) The parameters a and d locate the “feet” of the trapezoid and b and c — its “shoulders”.
  • 26. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Smooth MF: Gaussian and Bell MF Definition 16 (Gaussian MF) A Gaussian MF is specified by two parameters {c, σ} as follows: gaussian (x; c, σ) = e−1 2 (x−c σ ) 2 . (15) The parameter c represents the MF center and σ determines the MF width. Definition 17 (Generalized bell MF) A generalized bell MF is specified by three parameters {a, b, c} as follows: bell (x; a, b, c) = 1 1 + x−c a 2b , (16) where b is usually positive (if b 0, then the MF becomes an upside-down bell).
  • 27. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications MATLAB MF Examples 0 20 40 60 80 100 0 0.2 0.4 0.6 0.8 1 Membership Grades (a) Triangular MF: trimf(x,[20,60,80]) 0 20 40 60 80 100 0 0,2 0,4 0,6 0,8 1 Membership Grades (b) Trapezoidal MF: trapmf(x,[10,20,60,95]) 0 20 40 60 80 100 0 0.2 0.4 0.6 0.8 1 Membership Grades (c) Gaussian MF: gaussmf(x,[20,50]) 0 20 40 60 80 100 0 0.2 0.4 0.6 0.8 1 Membership Grades (d) Generalized Bell MF: gbellmf(x,[20,4,50])
  • 28. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Changing the Parameters of Bell MF −10 −5 0 5 10 0 0.2 0.4 0.6 0.8 1 (a) Changing ’a’ −10 −5 0 5 10 0 0.2 0.4 0.6 0.8 1 (b) Changing ’b’ −10 −5 0 5 10 0 0,2 0,4 0,6 0,8 1 (c) Changing ’c’ −10 −5 0 5 10 0 0.2 0.4 0.6 0.8 1 (d) Changing ’a’ and ’b’
  • 29. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Straight-line and Smooth MFs: Analysis What are the advantages and drawbacks of straight-line and smooth MFs? Straight-line MFs Simple formulas: computational efficiency Zero points strictly defined: Good, when boundary strictness is needed Bad, when fuzzy sets cannot be adequately characterized by sudden drops to zero membership Limitations due to linearity Simple for manual tuning, unsuited for automated tuning Smooth MFs: Non-linear: higher flexibility Best for automated tuning (adaptive systems) Less straight-forward: more problems during initial design
  • 30. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Open Membership Functions Definition 18 (Sigmoidal MF) A sigmoidal MF is specified by two parameters {a, c} as follows: sig (x; a, c) = 1 1 + e−a(x−c) , (17) where a controls the slope of the crossover point c. An open triangular MF is obtained by specifying ± inf as a left or right “foot” parameter, e.g. trimf(x,[3,7,inf]) −5 0 5 10 15 0 0.2 0.4 0.6 0.8 1 Membership Grades (a) Sigmoidal MF: sigmf(x,[1,5]) −5 0 5 10 15 0 0.2 0.4 0.6 0.8 1 Membership Grades (b) Triangular MF: trimf(x,[3,7,inf])
  • 31. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Asymmetric Membership Functions There are numerous ways to get asymmetric smooth MFs. One way is taking the difference |y1 − y2| and product y1y2 of sigmoid MFs: −10 −5 0 5 10 0 0.2 0.4 0.6 0.8 1 y1 y2 (a) y1 = sig(x;1,−5); y2 = sig(x;2,5) −10 −5 0 5 10 0 0.2 0.4 0.6 0.8 1 (b) |y1 − y2| −10 −5 0 5 10 0 0.2 0.4 0.6 0.8 1 y1 y3 (c) y1 = sig(x;1,−5); y3 = sig(x;−2,5) −10 −5 0 5 10 0 0.2 0.4 0.6 0.8 1 (d) y1*y3
  • 32. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Asymmetric MF: Left-Right MF Definition 19 (Left-right MF) A left-right MF is specified by three parameters {α, β, c} as LR (x; α, β, c) = ( FL c−x α , x ≤ c, FR x−c β , x ≥ c, (18) where FL(x) and FR(x) are monotonically decreasing functions defined on [0, ∞) with FL(0) = FR(0) = 1 and limx→∞ FL(x) = limx→∞ FR(x) = 0.
  • 33. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Asymmetric MF: Left-Right MF Example Example 2 Let FL(x) = p max (0, 1 − x2), FR = e−|x|3 . Then applying (18) we can generate different curves, e.g. (a) lr_mf(x,60,10,65); and (b) lr_mf(x,10,40,25); 0 20 40 60 80 100 0 0.2 0.4 0.6 0.8 1 Membership Grades (a) 0 20 40 60 80 100 0 0.2 0.4 0.6 0.8 1 Membership Grades (b)
  • 34. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Asymmetric MF: Two-Sided Gaussian MF Definition 20 (Two-sided Gaussian MF) A two-sided Gaussian MF is defined by four parameters {c1, σ1, c2, σ2} as gaussian2 (x; c1, σ1, c2, σ2) =        exp h −1 2 x−c1 σ1 i , x ≤ c1, 1, c1 x ≤ c2, exp h −1 2 x−c2 σ2 i , c2 ≤ x, (19) where c1, σ1 are the parameters of the left-most curve and c2, σ2 are the parameters of the right-most curve. The two-sided Gaussian is essentially a mixture of two Gaussian functions defined by (15). It is computed in MATLAB using the gauss2mf function.
  • 35. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Remarks on Membership Functions The presented MFs are only the most common ones For a full glossary of available MFs refer to the MATLAB Fuzzy Toolbox manual and other sources Be creative! Nobody forbids you from inventing your own MFs Non-normality and other properties of MFs can be achieved by mathematical manipulations on existing MFs or by defining one’s own MFs Two-dimensional MFs are not discussed here, for further study please refer to literature
  • 36. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 37. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy IF-THEN Rules Definition 21 (Fuzzy if-then rule) A fuzzy if-then rule, also known as a fuzzy rule, fuzzy implication, or fuzzy conditional statement, assumes the form IF x is A THEN y is B, (20) where A and B are linguistic values defined by fuzzy sets on universes of discourse X and Y , respectively. The expression x is A is called the antecedent or premise, while y is B is called the consequence or conclusion. Expression (20), which is abbreviated as A → B, can be defined as a binary fuzzy relation R on the product space X × Y : R = A → B. R can be viewed as a fuzzy set of two-dimensional MF µR(x, y) = f (µA(x), µB(y)) , where the function f is called the fuzzy implication function, that transforms the membership degrees of x in A and y in B into those of (x, y) in A → B.
  • 38. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Multiple Input Multiple Output Rules Let premise linguistic variables xi, i = 1, 2, . . . , n and consequence linguistic variables yj, j = 1, 2, . . . , m take on values of their universes of discourse Xi and Yj, respectively. Let xi be characterized by a set of linguistic values Ai = Ak i : k = 1, 2, . . . , Ni , and yj be characterized by a set of linguistic values Bj = Bl j : l = 1, 2, . . . , Mi . Then a MIMO rule with number of inputs n and number of outputs m can be written as IF x1 is Ap 1 AND x2 is Aq 2 AND . . . AND xn is Ar n THEN y1 is Bs 1 AND y2 is Bu 2 AND . . . AND ym is Bv m. (21)
  • 39. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Linguistic Operators A large number of operators may be applied to linguistic terms in fuzzy rules Negation, e.g. “not warm” Connectives: and, or, either, neither, etc. Hedges: too, very, more or less, quite, extremely, etc. For example “more or less warm but not too warm” Here only not, and, or operators are discussed as they are most common and sufficient in the majority of applications In practice we will use only the and operator
  • 40. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 41. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy Inference Systems A fuzzy inference system (FIS) or, as it is also known in different application areas, fuzzy expert system, fuzzy model, fuzzy associative memory and fuzzy logic controller (FLC), is a computing framework based on the concepts of fuzzy theory, fuzzy if-then rules and fuzzy reasoning. FIS have many application areas Automatic control and robotics Classification and clustering Pattern recognition Decision analysis and expert systems
  • 42. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Generic FIS Structure Defuzzification Fuzzification Inference mechanism Rule-base ... ... x1 x2 xn y1 y2 yn Crisp inputs Crisp outputs Fuzzified inputs Fuzzified conclusions Fuzzification: transformation of crisp values to fuzzy sets Rule-base: contains a selection of fuzzy rules Inference mechanism: performs a certain inference procedure upon the rules and derives a conclusion Defuzzification: transformation of output fuzzy sets to crisp values
  • 43. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications What Will Be Discussed Defuzzification Fuzzification Inference mechanism Rule-base Reference input r(t) Process Inputs u(t) Outputs y(t) Fuzzy logic controller We investigate two most common FIS types: Mamdani and Takagi-Sugeno fuzzy models An example of a fuzzy control system is provided along the coarse of investigation
  • 44. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Controlled Process: Inverted Pendulum θ F x r(t) Inverted pendulum u(t) y(t) Fuzzy logic controller d dt Σ - + r(t) — reference θ angle u(t) — force (N) y(t) — θ angle (rad) e(t) = r(t) − y(t) e(t)
  • 45. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 46. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Mamdani Type FIS Was proposed as the first attempt to control a steam engine and boiler combination by a set of linguistic control rules obtained from experienced human operators The most straight-forward cognitive approach to transferring knowledge into fuzzy models Design steps Choose controller inputs and outputs (linguistic variables) Assign linguistic values to every variable Derive control rules for every possible scenario Choose proper MF for every linguistic value Specify the parameters of the inference mechanism Test, observe behavior, tune
  • 47. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications FIS Linguistic Variables and Values For our inverted pendulum example we choose the following inputs and outputs: “error” describes e(t) = r(t) − y(t) “change-in-error” describes d dt e(t) “force” describes u(t) The linguistic variables take on the following values: “negative large” or “neglarge”, represented by “-2” “negative small” or “negsmall”, represented by “-1” “zero”, represented by “0” “positive small” or “possmall”, represented by “1” “positive large” or “poslarge”, represented by “2”
  • 48. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy Rules Recall the general MIMO rule structure (15). Substituting mathematical characters with our assigned linguistic labels and values, we get rules of the following structure: (a) IF error is neglarge AND change-in-error is neglarge THEN force is poslarge (b) IF error is zero AND change-in-error is possmall THEN force is negsmall (c) IF error is poslarge AND change-in-error is negsmall THEN force is negsmall F F F (a) (b) (c)
  • 49. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy Rule-Base The number of rules for a MISO FIS is at most Qn i=1 Ni, where Ni is the number of linguistic values for the i-th linguistic premise variable. (All possible combinations of premise linguistic values.) In our case the number of rules is equal to 5 · 5 = 25. Continuing the logic of the previous three rule cases, we can derive the rule-base, presented as a table. force change-in-error -2 -1 0 1 2 error -2 2 2 2 1 0 -1 2 2 1 0 -1 0 2 1 0 -1 -2 1 1 0 -1 -2 -2 2 0 -1 -2 -2 -2
  • 50. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Membership Functions e(t) (rad) π/4 0 -π/4 -π/2 zero negsmall neglarge possmall poslarge π/2 de(t)/dt (rad/s) zero negsmall neglarge possmall poslarge u(t) (N) 10 20 0 -10 -20 zero negsmall neglarge possmall poslarge -30 30 π/8 0 -π/8 -π/4 π/4
  • 51. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzification Singleton fuzzification: apply a fuzzy singleton µfuz Ai (x) to the premise variable universe, perform intersection. This method is applied when measurement noise is not accounted for — the crisp input values are certain. In “Gaussian fuzzification” a Gaussian is used as a fuzzification function, which accounts for inconsistency in the input signal. e(t) (rad) π/4 0 -π/4 -π/2 zero negsmall neglarge possmall poslarge π/2 de(t)/dt (rad/s) zero negsmall neglarge possmall poslarge π/8 0 -π/8 -π/4 π/4 e(t) = -9π/20 de(t)/dt = 9π/80 Crisp input e(t) = −9π/20: µ neglarge (e) = min µneglarge(e), µfuz 1 (e) = min(0.75, 1) = 0.75; µ negsmall (e) = min µnegsmall(e), µfuz 1 (e) = min(0.25, 1) = 0.25; all other zero. Crisp input ė(t) = 9π/80: µ d zero(ė) = min µzero(ė), µfuz 2 (ė) = min(0.125, 1) = 0.125; µ possmall (ė) = min µpossmall(ė), µfuz 2 (ė) = min(0.875, 1) = 0.875; all other zero.
  • 52. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 53. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Mamdani Inference Mechanism Steps Calculate the firing strength for each rule in the rule-base Determine which rules are on using the firing strengths Determine implied fuzzy sets — perform fuzzy implication Determine overall implied fuzzy set — perform fuzzy aggregation* *Performed in case of applying specific types of defuzzification. If defuzzification uses implied fuzzy sets, the step is not performed.
  • 54. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Firing Strength of a Premise The firing strength of a rule is the degree of certainty that the rule premise holds for the given inputs. Its calculation depends on the linguistic operators used in the structure of a premise. For any linguistic variables x1 and x2 the typical operators are the following: Fuzzy complement (NOT): Defined in (6) as µÂk 1 (x1) = 1 − µÂk 1 (x1) Fuzzy union (OR): Defined in (7) as maximum µÂk 1 ∪Âl 2 (x1, x2) = max µÂk 1 (x1) , µÂl 2 (x2) Alternative: algebraic sum µÂk 1 ∪Âl 2 (x1, x2) = µÂk 1 (x1) + µÂl 2 (x2) − µÂk 1 (x1) µÂl 2 (x2) Fuzzy intersection (AND): Defined in (8) as minimum µÂk 1 ∩Âl 2 (x1, x2) = min µÂk 1 (x1) , µÂl 2 (x2) Alternative: algebraic product µÂk 1 ∩Âl 2 (x1, x2) = µÂk 1 (x1) µÂl 2 (x2)
  • 55. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Firing Strength: More Complex Premises In premises with more complex logic, the firing strength is calculated by partitioning the premise into simpler terms. Example 3 The premise IF x1 is Â2 1 AND x2 is Â1 2 AND x3 is NOT Â5 3 OR x4 is Â3 4 yields the firing strength µpremise (x1, x2, x3, x4) = max h min µÂ2 1 (x1) , µÂ1 2 (x2) , 1 − µÂ5 3 (x3) , µÂ3 4 (x4) i . Also there exists an option to use a “rule certainty” weight. This way, for the i-th rule, the firing strength is multiplied by the weight wi, which specifies how certain we are in this specific rule compared to other rules. Keep in mind that there are more alternatives to AND and OR operations, you can also specify your custom ones.
  • 56. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Which Rules Are On The rule is considered being “on” if its premise is non-zero: µpremise (x1, x2, . . . , xn) 0 An optional step, that reduces the number of computations Alternatively, perform fuzzy implication over the whole rule-base, but you will be doing a large number of operations over zero values Example 4 Consider a FIS with 3 inputs and 10 MFs per input. The number of rules is then at most 103 = 1000. With the universes partitioned by so many rules, the number of “on” rules at any given time will be quite small. If for example 10 rules are on, then mark those rules and perform later steps with 10 sets of parameters, instead of using the whole rule-base and performing 100 times more computations, mainly with zeros.
  • 57. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Implied Fuzzy Sets: Fuzzy Implication The implied fuzzy set of an output yj for a rule i, which has a consequent Bk j , and a premise degree of membership equal to µpremise(i) (x1, x2, . . . , xn), is characterized by µB̂k j (yj) = min µpremise(i) (x1, x2, . . . , xn) , µBk j (yj) . Alternatively the algebraic product can be defined as the implication operation: µB̂k j (yj) = µpremise(i) (x1, x2, . . . , xn) µBk j (yj) . An implied fuzzy set is computed for every rule that is “on”.
  • 58. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Overall Implied Fuzzy Set: Fuzzy Aggregation The overall implied fuzzy set B̂j of an output yj, which incorporates the implied fuzzy sets n B̂k j , B̂l j, . . . , B̂p j o is characterized by µB̂j (yj) = max µB̂k j (yj) , µB̂l j (yj) , . . . , µB̂p j (yj) . Alternatively the algebraic sum can be defined as the aggregation operation: µB̂j (yj) = µB̂k j (yj) + µB̂l j (yj) + · · · + µB̂p j (yj) − − µB̂k j (yj) µB̂l j (yj) . . . µB̂p j (yj) .
  • 59. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Mamdani Inference: Example e(t) (rad) π/4 0 -π/4 -π/2 zero negsmall neglarge possmall poslarge π/2 de(t)/dt (rad/s) zero negsmall neglarge possmall poslarge π/8 0 -π/8 -π/4 π/4 e(t) = -9π/20 de(t)/dt = 9π/80 u(t) (N) 10 20 0 -10 -20 zero negsmall neglarge possmall poslarge -30 30 u(t) (N) 10 20 0 -10 -20 zero negsmall neglarge possmall poslarge -30 30 u(t) (N) 10 20 0 -10 -20 zero negsmall neglarge possmall poslarge -30 30 Apply implication (min) Apply AND (min) u(t) (N) 10 20 0 -10 30 Apply aggregation (max)
  • 60. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Mamdani Inference: Example Computations From the fuzzification stage we have established that we have four fuzzy values: µ neglarge (e) = 0.75; µ negsmall (e) = 0.25; µ d zero(ė) = 0.125; µ possmall (ė) = 0.875. Thus the rules that are on are: IF error is neglarge AND change-in-error is zero THEN force is poslarge (red) IF error is neglarge AND change-in-error is possmall THEN force is possmall (orange) IF error is negsmall AND change-in-error is zero THEN force is possmall (green) IF error is negsmall AND change-in-error is possmall THEN force is zero (blue) Compute the firing strengths of the four rules using min for the AND operator: µpremise(1) (e, ė) = min(µ neglarge (e), µ d zero(ė)) = min(0.75, 0.125) = 0.125; µpremise(2) (e, ė) = min(µ neglarge (e), µ possmall (ė)) = min(0.75, 0.875) = 0.75; µpremise(3) (e, ė) = min(µ negsmall (e), µ d zero(ė)) = min(0.25, 0.125) = 0.125; µpremise(4) (e, ė) = min(µ negsmall (e), µ possmall (ė)) = min(0.25, 0.875) = 0.25.
  • 61. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Mamdani Inference: Example Computations Continued Implied fuzzy sets are derived from the rule premises using min as: µ poslarge(1) (u) = min µpremise(1) (e, ė) , µposlarge (u) = = min(0.125, 1) = 0.125; µ possmall(2) (u) = min µpremise(2) (e, ė) , µpossmall (u) = = min(0.75, 1) = 0.75; µ possmall(3) (u) = min µpremise(3) (e, ė) , µpossmall (u) = = min(0.125, 1) = 0.125; µ d zero(4) (u) = min µpremise(4) (e, ė) , µzero (u) = min(0.25, 1) = 0.25. The overall implied fuzzy set is obtained by fuzzy aggregation using max as: µ overall (u) = max µ poslarge(1) (u) , µ possmall(2) (u) , µ possmall(3) (u) , µ d zero(4) (u) .
  • 62. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Mamdani Inference: Principle Justification The choice of linguistic operator functions, fuzzy inference and fuzzy aggregation operations is based on the assertions that: We can be no more certain in our premises than we are certain in our data. We can be no more certain in our conclusions than we are certain in our premises. u(t) (N) 10 20 0 -10 -20 zero negsmall neglarge possmall poslarge -30 30 u(t) (N) 10 20 0 -10 30 Aggregation (max) Inference (product)
  • 63. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 64. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification The result of fuzzy inference is the implied fuzzy set (or sets). For the systems, where a crisp value is required from the FIS, the operation called defuzzification is applied to the implied sets. A number of defuzzification strategies exist, and it is not hard to invent more, suiting your specific application. Each provides a means to choose a crisp output ycrisp j based on either the implied fuzzy sets or the overall implied fuzzy set. Reviewed defuzzification methods: Center of gravity (COG) Center-average Maximum criterion: mean of maximum (MOM), smallest of maximum (SOM), largest of maximum (LOM) Center of area (COA)
  • 65. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification on IFS: Center of Gravity Definition 22 (Center of gravity) In Center of gravity (COG) defuzzification the output ycrisp j is computed using the center of area and area of each implied fuzzy set: ycrisp j = PR i=1 bj i ´ Yj µB̂i j (yj) dyj PR i=1 ´ Yj µB̂i j (yj) dyj , (22) where R is the number or rules, bj i is the center of area of the MF of Bp j associated with the implied fuzzy set B̂i j for the i-th rule and ˆ Yj µB̂i j (yj) dyj denotes the area under µB̂i j (yj).
  • 66. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification on IFS: Center of Gravity The COG is easy to compute if you have simple areas under implied fuzzy set MFs, e.g. triangles with tops chopped off while using triangle MFs and min for implication. Notice though, that for this method to be reliable the fuzzy system must be defined such that R X i=1 ˆ Yj µB̂i j (yj) dyj 6= 0 for all xi. This is achieved if for every possible combination of inputs the consequent fuzzy sets all have nonzero area. Also areas must be computable, thus we cannot use open MFs for output fuzzy sets.
  • 67. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification on IFS: Center-Average Definition 23 (Center-average) In Center-average defuzzification the output ycrisp j is computed using the centers of each of the output MFs and the maximum certainty of each of the implied fuzzy sets: ycrisp j = PR i=1 bj i supyj n µB̂i j (yj) o PR i=1 supyj n µB̂i j (yj) o , (23) where supyj denotes the supremum (i.e. the least upper bound) of the implied fuzzy set µB̂i j (yj).
  • 68. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification on IFS: Center-Average The center-average is easy to compute if implied fuzzy set MFs have a single maximum, e.g. reduced triangles while using triangle MFs and product for implication — in this case sup yj n µB̂i j (yj) o = max µB̂i j (yj) . Notice though, that the fuzzy system must be defined such that R X i=1 sup yj n µB̂i j (yj) o 6= 0 for all xi. This is achieved as in the case of COG.
  • 69. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification on IFS: Center-Average If using normal MFs for output fuzzy sets, then for many inference strategies we have sup yj n µB̂i j (yj) o = µpremise(i) (x1, x2, . . . , xn) , which is the firing strength of rule i. The formula for defuzzification is then given by ycrisp j = PR i=1 bj i µpremise(i) (x1, x2, . . . , xn) PR i=1 µpremise(i) (x1, x2, . . . , xn) , (24) where PR i=1 µpremise(i) (x1, x2, . . . , xn) 6= 0, ∀xi must be ensured. The shape of the output MFs does not matter, as bounds of supremum subsets can be defined using singletons.
  • 70. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification on The Overall IFS: Maximum Criterion For the MOM, SOM and LOM defuzzification the crisp output is chosen as a point on the output universe Yj, for which the overall implied fuzzy set B̂j reaches its maximum: ycrisp j ∈ ( arg sup Yj n µB̂j (yj) o ) . MOM, SOM and LOM differ in the strategy of choosing the crisp value from this subset. u(t) (N) 10 20 0 -10 30 supremum MOM LOM SOM
  • 71. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification on The Overall IFS: MOM Definition 24 (Mean of maximum) Define a fuzzy set B̂∗ j ⊆ Yj with a MF defined as µB̂∗ j (yj) = ( 1, µB̂j (yj) = supYj n µB̂j (yj) o , 0, otherwise. Then the crisp output of mean of maximum (MOM) defuzzification is defined as ycrisp j = ´ Yj yjµB̂∗ j (yj) dyj ´ Yj µB̂∗ j (yj) dyj , (25) where the fuzzy system must be defined so ´ Yj µB̂∗ j (yj) dyj 6= 0, ∀xi. Notice that if µB̂∗ j (yj) = 1 lies in a single interval h yleft j , yright j i ⊆ Yj, then ycrisp j = yleft j + yright j /2.
  • 72. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification on The Overall IFS: SOM and LOM Definition 25 (Smallest of maximum) In smallest of maximum (SOM) defuzzification the output ycrisp j is computed as the minimal argument of the output universe Yj, for which the the overall implied fuzzy set B̂j reaches its maximum: ycrisp j = min arg sup Yj n µB̂j (yj) o # . (26) Definition 26 (Largest of maximum) In largest of maximum (LOM) defuzzification the output ycrisp j is computed as the maximal argument of the output universe Yj, for which the the overall implied fuzzy set B̂j reaches its maximum: ycrisp j = max arg sup Yj n µB̂j (yj) o # . (27)
  • 73. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification on The Overall IFS: Center of Area Definition 27 (Center of area) In center of area (COA) defuzzification the output ycrisp j is computed over the area of the MF of the overall implied fuzzy set B̂j as ycrisp j = ´ Yj yjµB̂j (yj) dyj ´ Yj µB̂j (yj) dyj , (28) where the fuzzy system must be defined so ´ Yj µB̂j (yj) dyj 6= 0, ∀xi. Computationally expensive: overlapping implied fuzzy sets may result in a overall implied fuzzy set with a sophisticated shape. Computing the area of such shapes in real-time is not an easy task.
  • 74. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification: Example For our symmetrical triangular MFs the area and center of area of the implied fuzzy sets are easily calculated. If a symmetric triangle has a height 1 and base width w : The area of a triangle with the top “chopped off” at height h is equal to w h − h2 2 The area of a triangle with height h is equal to 1 2 wh Here w is the support length of B̂i j and h is µpremise(i) (x1, x2, . . . , xn). 10 20 0 10 20 0 min implication product implication w w h h
  • 75. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification: COG Example For implication defined by min: ucrisp = bpl ´ U µb pl(1) (u)du+bps ´ U µc ps(2)(u)du+bps ´ U µc ps(3)(u)du+bz ´ U µb z(4)(u)du ´ U µb pl(1) (u)du+ ´ U µc ps(2)(u)du+ ´ U µc ps(3)(u)du+ ´ U µb z(4)(u)du = = (20)(1.1719)+(10)(4.6875)+(10)(1.1719)+(0)(2.1875) 1.1719+4.6875+1.1719+2.1875 = 82.032 9.2188 = 8.90 For implication defined by product: ucrisp = bpl ´ U µb pl(1) (u)du+bps ´ U µc ps(2)(u)du+bps ´ U µc ps(3)(u)du+bz ´ U µb z(4)(u)du ´ U µb pl(1) (u)du+ ´ U µc ps(2)(u)du+ ´ U µc ps(3)(u)du+ ´ U µb z(4)(u)du = = (20)(0.625)+(10)(3.75)+(10)(0.625)+(0)(1.25) 0.625+3.75+0.625+1.25 = 56.25 6.25 = 9.0
  • 76. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Defuzzification: Center-Average Example For implication defined by product: ucrisp = bpl supu n µb pl(1) (u) o +bps supu{µc ps(2)(u)}+bps supu{µc ps(3)(u)}+bz supu{µb z(4)(u)} supu n µb pl(1) (u) o +supu{µc ps(2)(u)}+supu{µc ps(3)(u)}+supu{µb z(4)(u)} = = (20)(0.125)+(10)(0.75)+(10)(0.125)+(0)(0.25) 0.125+0.75+0.125+0.25 = 11.25 1.25 = 9.0 The supremum of a reduced triangular MF its its single peak which is equal to µpremise(i) (x1, x2, . . . , xn).
  • 77. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications FIS Input-Output Curve Portrays the dependency of FIS output on its inputs. MATLAB command: gensurf −1.5 −1 −0.5 0 0.5 1 1.5 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 −15 −10 −5 0 5 10 15 error errorDot force
  • 78. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Mamdani Fuzzy Control of Inverted Pendulum 0 2 4 6 8 10 12 14 16 18 20 −0.2 −0.1 0 0.1 0.2 Mamdani fyzzy control of inverted pendulum Angle (rad) 0 2 4 6 8 10 12 14 16 18 20 −1.5 −1 −0.5 0 0.5 Position (m) 0 2 4 6 8 10 12 14 16 18 20 −20 −10 0 10 20 Time (s) Force (N) Position PositionDot Theta ThetaDot Control influence Interference
  • 79. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 80. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications FIS Design in MATLAB: Editor Main
  • 81. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications FIS Design in MATLAB: MF Editor
  • 82. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications FIS Design in MATLAB: Rule Viewer
  • 83. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications FIS Design in MATLAB: Input-Output Curve
  • 84. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 85. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Takagi-Sugeno FIS Takagi-Sugeno or simply Sugeno-type FIS has a different way of computing the consequence and defuzzification. A general Sugeno rule has a form IF x1 is Ak 1 AND x2 is Al 2 AND . . . AND xn is Ap n THEN zi = fi(·). Here z = f(·) may be any function (even another mapping, like neural network, or another FIS) Usually zi = fi (x1, x2, . . . , xn) is used. If this function is a first order polynomial, i.e. zi = anx1 + an−1x2 + · · · + a1xn + a0, the inference system is called a first-order Sugeno FIS. When f is a constant, the system is called a zero-order Sugeno FIS.
  • 86. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Sugeno Inference Principles The premises µpremise(i) (x1, x2, . . . , xn) are computed as in the Mamdani FIS, incorporating fuzzification and linguistic operators. The defuzzification is usually performed using weighted average: ycrisp = PR i=1 ziµpremise(i) (x1, x2, . . . , xn) PR i=1 µpremise(i) (x1, x2, . . . , xn) , (29) where the fuzzy system is defined so that PR i=1 µpremise(i) (x1, x2, . . . , xn) 6= 0, ∀xi. Thus the Sugeno FIS can be used as a general mapper for a wide variety of applications.
  • 87. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Sugeno FIS Example We will not define the whole rule-base of the inverted pendulum controller for the Sugeno FIS. Lets specify zi = fi (e, ė) for the rules that are on in our example: z1 = −5e + 4ė + 3 for the red rule; z2 = −4e + 2ė + 2 for the orange rule; z3 = −2e + 1ė + 1 for the green rule; z4 = −0.5e + 0.5ė + 0 for the blue rule. For the values e = − 9 20π and ė = 9 80π the functions take on values z1 = −5 − 9 20π + 4 9 80π + 3 = 11.482 z2 = −4 − 9 20π + 2 9 80π + 2 = 8.362 z3 = −2 − 9 20π + 1 9 80π + 1 = 4.181 z4 = −0.5 − 9 20π + 0.5 9 80π + 0 = 0.884
  • 88. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Sugeno FIS Example Then the FIS crisp output will be ycrisp = P4 i=1 ziµpremise(i) (e, ė) P4 i=1 µpremise(i) (e, ė) = 11.482 · 0.125 + 8.362 · 0.75 + 4.181 · 0.125 + 0.884 · 0.25 0.125 + 0.75 + 0.125 + 0.25 = 9.03 Notice, that no implication and aggregation is used. This simplifies the inference process a lot.
  • 89. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Sugeno Input-Output Curve −0.2 −0.1 0 0.1 0.2 0.3 −1 −0.5 0 0.5 1 −20 −15 −10 −5 0 5 10 15 20 in1 in2 out
  • 90. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Sugeno Fuzzy Control of Inverted Pendulum 0 2 4 6 8 10 12 14 16 18 20 −2 −1 0 1 2 Sugeno fyzzy control of inverted pendulum Position (m) 0 2 4 6 8 10 12 14 16 18 20 −0.4 −0.2 0 0.2 0.4 Angle (rad) 0 2 4 6 8 10 12 14 16 18 20 −10 −5 0 5 10 Time (s) Force (N) Ref. position Act. position Theta Control influence
  • 91. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 92. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications FIS Design in MATLAB: Sugeno FIS Editor
  • 93. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications FIS Design in MATLAB: Sugeno Rules
  • 94. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications FIS Tuning As was mentioned, the testing and tuning is the last step of FIS development. If testing fails, the FIS has to be tuned or even redesigned. r(t) Process u(t) y(t) Fuzzy logic controller d dt Σ - + g1 g2 h External FIS tuning is performed via input and output scaling gains. The gain values may be either constant or functions of some sort, e.g. bell or Gaussian functions. Internal tuning is performed by reviewing the membership functions and the rule-base. Trying out different inference and defuzzification operations is also a good practice. The MATLAB FIS editor is a good tool for debugging. There you can observe the reaction of your rule firing strengths, input-output curves, etc. to the changes you make.
  • 95. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 96. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy PID Controller The term Fuzzy PID controller can be understood in two ways: A fuzzy FIS, which has the inputs e(t), d dte(t), ´ e(t)dt A crisp PID controller, the KP , KI and KD coefficients of which are tuned by a fuzzy expert system A tunable PID controller allows to: Increase the robustness of the typical PID controller Increase its dynamic range Account for different scenarios of system operation
  • 97. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy PID Controller Example 1
  • 98. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy PID Controller Example 2
  • 99. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy PID Control Simulation 0 5 10 15 20 25 30 35 40 0 1 2 3 4 5 Fuzzy PID Control of Tank System 0 5 10 15 20 25 30 35 40 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time (s) Control influence: PID Control influence: Fuzzy PID Set value Upper limit Lower limit Liquid level: PID Liquid level: Fuzzy PID
  • 100. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 101. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Making Anything Fuzzy If you have some time variant system with parameters that cannot be statically specified... If you cannot describe parameter variation mathematically but you intuitively know how they should be changed... Introduce a fuzzy expert or control system to do it! We have seen it in the fuzzy PID example It is generally applicable to any linear or nonlinear dynamic system model
  • 102. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy Predictor Having a discrete time series θ1, θ2, . . . , θk, the task of a prediction algorithm is to determine the next values of the given time series θ̂k+1, θ̂k+2, . . . , θ̂k+l. The time series possesses certain dynamical properties θk+1 = θk + ωk, where ωk is the system perturbation of unknown distribution. The observed value may be affected by external interference θ̃k = θk + νk, where νk is referred to as observation noise. The Kalman (exponential average) predictor is given by the recurrence θ̂k+1 = αθ̂k + (1 − α)θ̃k, where θ̂k+1 is the predicted value of the time series, θ̂k is the last known predicted value, θ̃k is the last observed value and α ∈ [0, 1] is the weight parameter.
  • 103. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy Predictor Continued Basic logic tells us that: If the system is steady, θ̃k influences prediction more and α → 0. On the other hand, if the system is not steady or noisy, θ̃k is less reliable than θ̂k and α → 1. Specify the FIS input as error ek = θ̂k − θ̃k , then develop rules, e.g. IF error is small THEN α is large IF error is medium THEN α is medium IF error is large THEN α is small And, well, you know the rest. P.S. Think, how introducing the change-in-error into the FIS will improve the situation.
  • 104. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications General Linear Dynamic Model The linear discrete-time dynamic system model takes the form xk = Ak−1xk−1 + qk−1 yk = Hk−1xk + rk−1 , where xk is the system state vector at time step k, yk is the measurement vector at k, Ak−1 is the transition matrix of the dynamic model, Hk−1 is the measurement matrix, qk−1 ∼ N (0, Qk−1) is the process noise with covariance Qk−1 and rk−1 ∼ N (0, Rk−1) is the measurement noise with covariance Rk−1. For the majority of applications it is assumed that the noise has fixed variance and a normal distribution What to do, if noise is time variant and has varying distribution? One solution is the to develop a fuzzy system, which will estimate noise parameters and tune the controller, filter, etc. online
  • 105. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 106. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Adaptive Neuro-Fuzzy Inference System Adaptive Neuro-Fuzzy Inference System (ANFIS) is a representation of the Sugeno FIS in a form of a feed-forward neural network. A11 A12 A21 A22 x1 x2 Π Π N N f1 f2 Σ x2 x1 x2 x1 y Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 w1 w2 w2 w1 f1 w1 f2 w2
  • 107. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications ANFIS Architecture The first-order Sugeno system r-th rule takes the form IF x1 is Ak 1 AND x2 is Al 2 AND . . . AND xn is Ap n THEN fr = pn,rx1 + pn−1,rx2 + · · · + p1,rxn + p0,r Lets take a system with two inputs x1, x2, one output y, and two rules: Rule1 : IF x1 is A1 1 AND x2 is A1 2 THEN f1 = p2,1x1 + p1,1x2 + p0,1 Rule2 : IF x1 is A1 2 AND x2 is A2 2 THEN f2 = p2,2x1 + p1,2x2 + p0,2 Layer 1: Every i∗ -th node is an adaptive node with a function O1,i∗ = µAk i (xi) , i∗ = i × k : i = 1, 2; k = 1, 2. The parameters of the node’s MF are called premise parameters. A11 A12 A21 A22 x1 x2 Π Π N N f1 f2 Σ x2 x1 x2 x1 y Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 w1 w2 w2 w1 f1 w1 f2 w2
  • 108. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications ANFIS Architecture Continued Layer 2: Every i∗ -th node is a fixed node, which calculates the firing strengths for each rule: O2,i∗ = wi∗ = µAk 1 (x1) µAk 2 (x2) , i∗ = k = 1, 2. Besides product, other operations for the linguistic AND may be used. Layer 3: Every i∗ -th node is a fixed node, which computes the ratio of the i∗ -th firing strength to the sum of all R rules firing strengths: O3,i∗ = wi∗ = wi∗ PR r=1 wr , i∗ = 1, 2. The outputs of this layer are called normalized firing strengths. A11 A12 A21 A22 x1 x2 Π Π N N f1 f2 Σ x2 x1 x2 x1 y Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 w1 w2 w2 w1 f1 w1 f2 w2
  • 109. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications ANFIS Architecture Continued Layer 4: Every i∗ -th node is an adaptive node with a function O4,i∗ = wrfr = wr (p2,rx1 + p1,rx2 + p0,r) , i∗ = r = 1, 2. The parameters {p2,r, p1,r, p0,r} are called consequent parameters. Layer 5: The single node is a fixed node, which computes the overall output as a summation of all incoming values: O5,1 = y = R X r=1 wrfr = PR r=1 wrfr PR r=1 wr . A11 A12 A21 A22 x1 x2 Π Π N N f1 f2 Σ x2 x1 x2 x1 y Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 w1 w2 w2 w1 f1 w1 f2 w2
  • 110. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications ANFIS Training ANFIS is trained by a hybrid learning algorithm. Each iteration makes two passes: During the forward pass node outputs go forward until layer 4 and the consequent parameters are identified by the least-squares method In the backward pass the error signals (i.e. reference minus layer 4 output) propagate backward and the premise parameters are updated by gradient descent Forward pass Backward pass Premise parameters Fixed Gradient descent Consequent parameters Least-squares estimator Fixed Signals Node outputs Error signals
  • 111. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications MATLAB ANFIS Editor: anfisedit
  • 112. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Adaptive FIS Applications The advantage of adaptive fuzzy systems compared to, e.g. Artificial Neural Networks (ANN) is that they are gray box as opposed to ANN, which are black box systems. The application range is no less than of ANN: Nonlinear system identification Adaptive control (process control, inverse kinematics, etc.) Adaptive machine scheduling Clustering, classification and pattern recognition Adaptive expert systems, predictors Adaptive noise cancellation And others!
  • 113. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 114. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Direct Adaptive Control r(t) Process u(t) y(t) Reference model, fuzzy expert system Controller Adaptation mechanism Controller parameters
  • 115. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Indirect Adaptive Control r(t) Process u(t) y(t) Adaptive mapper: ANFIS or other System identification Controller Controller parameters Controller designer Process parameters Fuzzy expert system
  • 116. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 117. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy Clustering and Classification Fuzzy clustering and fuzzy classification differ from conventional crisp clustering and classification approaches in that: In crisp clustering each element of a dataset has a degree of belonging 1 to its assigned cluster and 0 to all other clusters In fuzzy clustering each element of a dataset has a degree of belonging ranging from 0 to 1 to each of the clusters In crisp classification a classified pattern belongs to one of the pre-specified classes with certainty 1 and with certainty 0 to all other classes In fuzzy classification a classified pattern belongs to each of the pre-specified classes with certainty ranging from 0 to 1 The most common fuzzy clustering algorithm is Fuzzy C-means clustering. Fuzzy classification is performed applying any of the adaptive FIS structures, e.g. ANFIS, ARIC, GARIC, NNDFR, NEFCLASS, etc.
  • 118. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy C-Means: MATLAB GUI findcluster
  • 119. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Fuzzy Clustering Demo: fcmdemo
  • 120. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Outline 1. Concepts of Fuzzy Logic 1.1 Introduction 1.2 Fuzzy Sets 1.3 Fuzzy Set Operations 1.4 Membership Functions 1.5 Fuzzy Rules 2. Fuzzy Inference Systems 2.1 Introduction 2.2 Mamdani FIS 2.3 Mamdani Inference 2.4 Defuzzification 2.5 Mamdani FIS Editor 2.6 Takagi-Sugeno FIS 2.7 Sugeno FIS Editor 3. Applications 3.1 Fuzzy PID Controller 3.2 Fuzzy %Anything% 3.3 Adaptive FIS 3.4 Adaptive Control 3.5 Clustering and Classification 3.6 Discussion
  • 121. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Mamdani vs Sugeno FIS Advantages of the Mamdani Method It is intuitive It has widespread acceptance It is well suited for human input Advantages of the Sugeno Method It is computationally more efficient It works well with linear techniques (e.g. PID control) It works well with optimization and adaptive techniques It has guaranteed continuity of the output surface It is well suited for mathematical analysis
  • 122. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Criticism of Mamdani Fuzzy Control Fuzzy control methods are “parasitic:” they simply implement trivial interpolations of control strategies obtained by other means 99% of fuzzy feedback control applications deal with essentially 1st or 2nd-order, overdamped, SISO systems Attempt to emulate or duplicate human control behavior? Human is a very poor controller for complex, multi-variable, marginally stable dynamic plants Very hard to generate multidimensional if-then rule tables No guarantees of closed-loop stability, stability-robustness and of performance in presence of uncertainty Cannot generate “differential equation” controller rules M. Athans, Crisp Control Is Always Better Than Fuzzy Feedback Control, EUFIT ’99 debate with prof. L.A. Zadeh
  • 123. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Criticism of Sugeno Fuzzy Control Approach developed to overcome criticism regarding closed-loop stability guarantees Design full-state feedback controllers for each linear model (using crisp control methods) and “interpolate” using membership functions Given that a state space model is necessary, why bother to introduce fuzzy ideas when conventional crisp control methods can deal with the design problem directly? Current methodology does not address stability-robustness and performance-robustness issues Current methodology does not address output feedback requiring dynamic compensator designs
  • 124. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Look on the Bright Side The answers to some of the critical claims can be found in Passino, Chapter 8 Although there are many unsolved problems with fuzzy control, everyone may try and decide for himself, whether the methodology suits him or not Fuzzy systems are useful in many other fields of intelligent computer systems besides process control It is good to have this tool in your pocket If you cannot express your view in equations, but you can verbally — go fuzzy!
  • 125. Concepts of Fuzzy Logic Fuzzy Inference Systems Applications Useful Literature K. M. Passino and S. Yurkovich, Fuzzy Control. Addison Wesley Longman, Menlo Park, CA, 1998 J.-S. R. Jang, C.-T. Sun and E. Mizutani, Neuro-fuzzy and Soft Computing: A Computational Approach to Learning and Machine Intelligence. Prentice Hall, 1997