0% found this document useful (0 votes)
21 views

Fuzzy Control and Neural Networks: Dr. Nam H. Nguyen Department of Automatic Control School of Electrical Engineering

The document discusses fuzzy control and neural networks. It provides an overview of fuzzy logic concepts including fuzzy sets, membership functions, and fuzzy set operations. It also outlines the contents which include fuzzy logic, fuzzy controllers, and neural networks and applications. Sections cover fuzzy sets and membership functions in detail with examples of different types of membership functions.

Uploaded by

Hùng
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Fuzzy Control and Neural Networks: Dr. Nam H. Nguyen Department of Automatic Control School of Electrical Engineering

The document discusses fuzzy control and neural networks. It provides an overview of fuzzy logic concepts including fuzzy sets, membership functions, and fuzzy set operations. It also outlines the contents which include fuzzy logic, fuzzy controllers, and neural networks and applications. Sections cover fuzzy sets and membership functions in detail with examples of different types of membership functions.

Uploaded by

Hùng
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Fuzzy Control and Neural Networks

Dr. Nam H. Nguyen


Department of Automatic Control
School of Electrical Engineering

https://sites.google.com/view/n2c

9/15/2020 2:52 PM Dr. Nam H. Nguyen 1


References

• [1]. Lý thuyết điều khiển mờ, Phan Xuân Minh và Nguyễn


Doãn Phước.
• [2]. Fuzzy Logic Toolbox User’s Guide, R2014b.
• [3]. Fuzzy Logic – Controls, Concepts, Theories and
Applications, Elmer P. Dadios
• [4]. Neural network design, Martin Hagan.
• [5]. Neural Network Toolbox User’s Guide.
• [6]. Fuzzy control and neural network

9/15/2020 2:52 PM Dr. Nam H. Nguyen 2


Contents

• I. Fuzzy logic
• II. Fuzzy controller
• III. Neural networks and applications

9/15/2020 2:56 PM Dr. Nam H. Nguyen 3


Chapter 1 Fuzzy set and fuzzy logic

• 1.1 Fuzzy set and membership function


• 1.2 The basic operation of fuzzy set
• 1.3 Linguistic variable and fuzzy rules
• 1.4 Defuzzification methods

9/15/2020 2:52 PM Dr. Nam H. Nguyen 4


1.1 Fuzzy set and membership function

• 1.1.1 History
• 1.1.2 Set and membership function
• 1.1.3 Operations
• 1.1.4 Fuzzy set

9/15/2020 2:52 PM Dr. Nam H. Nguyen 5


1.1.1 History

• Fuzzy set theory has been developed since 1965 by Lotfi A.


Zadeh [1].
• First fuzzy controller was made in 1975 by E. H. Mamdami
[2].

[1] http://www.cs.berkeley.edu/~zadeh/ [2] http://www.iis.ee.ic.ac.uk/~amamdani/

9/15/2020 2:52 PM Dr. Nam H. Nguyen 6


1.1.2 Crisp Set

• A classical (crisp) set is normally defined as a collection of


elements or objects.
• If an element 𝑥 belongs to the set A then we denote 𝑥 ∈ 𝑨.
• If an element 𝑥 does not belong to the set A then we denote
𝑥 ∉ 𝑨.

9/15/2020 2:52 PM Dr. Nam H. Nguyen 7


1.1.2 Crisp Set

• A classical (crisp) set can be described in different ways:


➢ Enumerate the elements that belong to the set
Example 1.1: A set of female students in a class 𝐴 =
𝐻𝑜𝑎, 𝑀𝑎𝑖, 𝑃ℎượ𝑛𝑔 … , 𝑇ℎ𝑎𝑛ℎ
➢ State conditions for membership
Example 1.2: A set of positive error that is lesser than 0.01
𝐵 = 𝑒|0 < 𝑒 < 0.01
➢ Use the characteristic function
1, 𝑖𝑓 𝑥 > 0
Example 1.3: 𝑓(𝑥) = ቊ
0, 𝑖𝑓 𝑥 ≤ 0

9/15/2020 2:52 PM Dr. Nam H. Nguyen 8


1.1.2 Crisp Set

• Empty set: Φ
A set has no element.
Example 1.4: A set of real roots of the equation 𝑥 2 + 1 = 0
• Subset: 𝐴 ⊂ 𝐵 ⟺ ∀𝑥, 𝑥 ∈ 𝐴 ⟹ 𝑥 ∈ 𝐵
- If A is not included in B, then we represent as 𝐴 ⊄ 𝐵
- 𝐴 = 𝐵 ⟺ 𝐴 ⊂ 𝐵 𝑎𝑛𝑑 𝐵 ⊂ 𝐴 (equal sets)
Example 1.5: The set of integers is a subset of the real number
set

9/15/2020 2:52 PM Dr. Nam H. Nguyen 9


1.1.2 Crisp Set

• Properties:
✓ A ⊂ A for every A.
✓ If A ⊂ B and B ⊂ C then A ⊂ C
✓ Φ ⊂ A for every A.
• Membership function: Figure 1.1 Subset property
1, 𝑖𝑓 𝑥 ∈ 𝐴
𝜇𝐴 𝑥 = ቊ
0, 𝑖𝑓 𝑥 ∉ 𝐴
Example 1.6: A set of cool temperatures
𝐴 = 𝑥|20 𝑜𝐶 ≤ 𝑥 ≤ 25 𝑜𝐶
1, 𝑛ế𝑢 𝑥 ∈ 𝐴
𝜇𝐴 𝑥 = ቊ
0, 𝑛ế𝑢 𝑥 ∉ 𝐴 Figure 1.2 Membership function for
the set A
9/15/2020 2:52 PM Dr. Nam H. Nguyen 10
1.1.3 Operation of crisp sets
• A) Intersection: 𝐴 ∩ 𝐵 = 𝑥|𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∈ 𝐵
𝜇𝐴∩𝐵 𝑥 = 𝜇𝐴 𝑥 . 𝜇𝐵 𝑥 or
= min(𝜇𝐴 𝑥 , 𝜇𝐵 (𝑥))
Example 1.7: Given 𝐴 = 𝑥|1 < 𝑥 < 3 and B = 𝑥|2 < 𝑥 < 4
𝐴 ∩ 𝐵 = 𝑥|2 < 𝑥 < 3

Figure 1.3 Membership functions


9/15/2020 2:52 PM Dr. Nam H. Nguyen 11
1.1.3 Operation of crisp sets

• B) Union
𝐴 ∪ 𝐵 = 𝑥|𝑥 ∈ 𝐴 𝑂𝑅 𝑥 ∈ 𝐵
𝜇𝐴∪𝐵 𝑥 = 𝜇𝐴 𝑥 + 𝜇𝐵 𝑥 − 𝜇𝐴 𝑥 . 𝜇𝐵 𝑥 or
= max(𝜇𝐴 𝑥 , 𝜇𝐵 (𝑥))
Example 1.8: 𝜇𝐴∪𝐵 𝑥 = 𝑥|1 < 𝑥 < 4

Figure 1.4 Membership function


9/15/2020 2:52 PM 12
Dr. Nam H. Nguyen
1.1.3 Operation of crisp sets
• C) Complement
Assume 𝐴 ⊂ 𝑈, the complement set of 𝐴 is defined as
𝐴𝑐 = 𝑥|𝑥 ∈ 𝑈 𝑎𝑛𝑑 𝑥 ∉ 𝐴 (c: complement)
1, 𝑛ế𝑢 𝑥 ∉ 𝐴
𝜇𝐴𝑐 𝑥 = ቊ = 1 − 𝜇𝐴 𝑥
0, 𝑛ế𝑢 𝑥 ∈ 𝐴
Example 1.9: 𝐴𝑐 = 𝑥|𝑥 < 1 𝑜𝑟 𝑥 > 3

Figure 1.5 Membership functions


9/15/2020 2:52 PM Dr. Nam H. Nguyen 13
1.1.3 Operation of crisp sets

• Some operational characteristics of intersection


✓ Commutativity: 𝐴 ∩ 𝐵 = 𝐵 ∩ 𝐴
✓ Associativity: 𝐴 ∩ 𝐵 ∩ 𝐶 = 𝐴 ∩ 𝐵 ∩ 𝐶
✓ Distributivity: 𝐴 ∩ (𝐵 ∪ 𝐶) = (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶)
✓ De Morgan’s law: (𝐴 ∩ 𝐵)𝑐 = 𝐴𝑐 ∪ 𝐵𝑐
• Some operational characteristics of union
✓ Commutativity: 𝐴 ∪ 𝐵 = 𝐵 ∪ 𝐴
✓ Associativity: 𝐴 ∪ 𝐵 ∪ 𝐶 = 𝐴 ∪ 𝐵 ∪ 𝐶
✓ Distributivity: 𝐴 ∪ 𝐵 ∩ 𝐶 = (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶)
✓ De Morgan’s law: (𝐴 ∪ 𝐵)𝑐 = 𝐴𝑐 ∩ 𝐵𝑐

9/15/2020 2:52 PM Dr. Nam H. Nguyen 14


1.1.4 Fuzzy set

• Definition: Given a universal set U, a fuzzy set F is described


by a membership function:
𝜇𝐹 𝑥 : 𝑈 → 0; 1 , 𝑥 ∈ 𝑈
• Example 1.10: A fuzzy set F has a membership function as
follows

−100𝑥 + 1, 𝑖𝑓 0 ≤ 𝑥 < 0.01


• 𝜇𝐹 𝑥 = ቐ100𝑥 + 1, 𝑖𝑓 − 0.01 < 𝑥 < 0
0, 𝑜𝑡ℎ𝑒𝑟𝑠

Figure 1.6 Membership function


of the fuzzy set F

9/15/2020 2:52 PM Dr. Nam H. Nguyen 15


1.1.4 Fuzzy set

• Types of membership functions:


Trimf (TRIangular Membership Function)

0, 𝑖𝑓 𝑥 ≤ 𝑎
𝑥−𝑎
, 𝑖𝑓 𝑎 ≤ 𝑥 < 𝑏
𝜇𝐹 𝑥 = 𝑏𝑐 −
−𝑥
𝑎
, 𝑖𝑓 𝑏 ≤ 𝑥 < 𝑐
𝑐−𝑏
0, 𝑖𝑓 𝑐 ≤ 𝑥

9/15/2020 2:52 PM Dr. Nam H. Nguyen 16


1.1.4 Fuzzy set

• Trapmf (TRAPezoidal Membership Function)

0, 𝑖𝑓 𝑥 ≤ 𝑎
𝑥−𝑎
, 𝑖𝑓 𝑎 ≤ 𝑥 < 𝑏
𝑏−𝑎
𝜇𝐹 𝑥 = 1, 𝑖𝑓 𝑏 ≤ 𝑥 ≤ 𝑐
𝑑−𝑥
, 𝑖𝑓 𝑐 ≤ 𝑥 < 𝑑
𝑑−𝑐
0, 𝑖𝑓 𝑑 ≤ 𝑥
• 𝜇𝐹 𝑥 = 𝑡𝑟𝑎𝑝𝑚𝑓(𝑥, [𝑎; 𝑏; 𝑐; 𝑑])

9/15/2020 2:52 PM Dr. Nam H. Nguyen 17


1.1.4 Fuzzy set

Gbellmf (Generalized BELL Membership Function)


1
𝜇𝐹 𝑥 =
𝑥 − 𝑐 2𝑏
1+ 𝑎
a – width
𝑏 > 0 slope
c – center

9/15/2020 2:52 PM Dr. Nam H. Nguyen 18


1.1.4 Fuzzy set

• Gaussmf (GAUSSian Membership Function)


1 𝑥−𝑐 2

𝜇𝐹 𝑥 = 𝑒 2 𝜎
c – center
𝜎 – width

9/15/2020 2:52 PM Dr. Nam H. Nguyen 19


1.1.4 Fuzzy set

• Gauss2mf
1 𝑥−𝑐1 2
− ,𝑖𝑓 𝑥≤𝑐1
𝑒 2 𝜎
𝜇1 𝑥 = ቐ 1

1, 𝑖𝑓 𝑥 > 𝑐1
1 𝑥−𝑐2 2
− ,𝑖𝑓 𝑥≥𝑐2
𝑒 2 𝜎2
𝜇2 𝑥 = ቐ
1, 𝑖𝑓 𝑥 < 𝑐2
𝜇𝐹 𝑥 = 𝜇1 𝑥 *𝜇2 𝑥

9/15/2020 2:52 PM Dr. Nam H. Nguyen 20


1.1.4 Fuzzy set

• Sigmf (SIGmoid Membership Function)


1
𝜇𝐹 𝑥 = = 𝑠𝑖𝑔(𝑥, 𝑎, 𝑐), a – shape
1+𝑒 −𝑎(𝑥−𝑐)
• Dsigmf ∶ 𝜇𝐹 𝑥 = |𝑠𝑖𝑔 𝑥, 𝑎1 , 𝑐1 − 𝑠𝑖𝑔 𝑥, 𝑎2 , 𝑐2 |
• Psigmf ∶ 𝜇𝐹 𝑥 = 𝑠𝑖𝑔 𝑥, 𝑎1 , 𝑐1 ∗ 𝑠𝑖𝑔 𝑥, 𝑎2 , 𝑐2 |

9/15/2020 2:52 PM Dr. Nam H. Nguyen 21


1.1.4 Fuzzy set
• Zmf (Z-shaped curve MF)
1, 𝑖𝑓 𝑥 ≤ 𝑥1
2
𝑥 − 𝑥1 𝑥1 + 𝑥0
1−2 , 𝑖𝑓 𝑥1 ≤ 𝑥 <
𝑥0 − 𝑥1 2
𝜇𝐹 𝑥 = 2 = 𝑧𝑚𝑓(𝑥1 , 𝑥0 )
𝑥 − 𝑥1 𝑥1 + 𝑥0
2 , 𝑖𝑓 ≤ 𝑥 ≤ 𝑥0
𝑥0 − 𝑥1 2
0, 𝑖𝑓 𝑥0 ≤ 𝑥

• Smf (S-shaped curve MF): 𝜇𝐹 𝑥 = 1 − 𝑧𝑚𝑓(𝑥1 , 𝑥0 ) =


s𝑚𝑓(𝑥1 , 𝑥0 )
• Pmf (Pi-shaped curve MF): 𝜇𝐹 𝑥 = s𝑚𝑓 𝑥1 , 𝑥2 ∗ z𝑚𝑓(𝑥3 , 𝑥4 )

9/15/2020 2:52 PM Dr. Nam H. Nguyen 22


1.2 Operation of fuzzy set

• Complement
μ𝐴𝑐 x = 1 − μA x (Zadeh)
𝑣 1/𝑣
μ𝐴𝑐 x = 1 − μA x (Yager)

9/15/2020 2:52 PM Dr. Nam H. Nguyen 23


1.2 Operation of fuzzy set

• Example 1.11:
1
𝜇𝐴 𝑥 =
1 + 𝑥2
= Gbellmf (1, 1, 0)
𝑥2
𝜇𝐴𝑐 𝑥 =
1 + 𝑥2

9/15/2020 2:52 PM Dr. Nam H. Nguyen 24


1.2 Operation of fuzzy set

• Union
μA⋃B x = max μA x , μB x for every x, Zadeh

μA⋃B x = μA x + μB x − μA x . μB x

μA⋃B x = min 1, μA x + μB x , Lukasiewicz

9/15/2020 2:52 PM Dr. Nam H. Nguyen 25


1.2 Operation of fuzzy set

• Example 1.12: Union of two fuzzy sets using Zadeh’s method

9/15/2020 2:52 PM Dr. Nam H. Nguyen 26


1.2 Operation of fuzzy set

• Intersection
μA∩B x = min μA x , μB x , ∀x ∈ U, Zadeh

μA∩B x = μA x . μB x , ∀x ∈ U

μA∩B x = max(μA x + μB x − 1,0), ∀x ∈ U, Lukasiewicz

9/15/2020 2:52 PM Dr. Nam H. Nguyen 27


1.2 Operation of fuzzy set

Example 1.13:

9/15/2020 2:52 PM Dr. Nam H. Nguyen 28


1.3 Linguistic variable

• Linguistic variables: A linguistic variable is characterized by


a quintuple (y, T(y),U,Gr,Ru)
- y: the name of the variable (for example, temperature, level,
speed)
- T(y): a set of names of linguistic values of y (small, big, …)
- U: a universal set, which is associated with the base variable u
- Gr: a syntactic rule for generating the names of linguistic
values (terms)
- Ru: a semantic rule for associating with each term a fuzzy set

9/15/2020 2:52 PM Dr. Nam H. Nguyen 29


1.3 Linguistic variable

9/15/2020 2:52 PM Dr. Nam H. Nguyen 30


1.3 Linguistic variable

• Example 1.14:
• y: error
• T(y): very big, big, small, very small, very very small
• U: 0; 10
• Gr: very
• Ru: associate with each value of linguistic variable a fuzzy set
μ𝑣𝑒𝑟𝑦 𝑏𝑖𝑔 𝑥 = 𝑡𝑟𝑖𝑚𝑓 𝑥, 7,5 10 12
μ𝑏𝑖𝑔 𝑥 = 𝑡𝑟𝑖𝑚𝑓 𝑥, 5 7,5 10
μ𝑠𝑚𝑎𝑙𝑙 𝑥 = 𝑡𝑟𝑖𝑚𝑓 𝑥, 2,5 5 7,5
μ𝑣𝑒𝑟𝑦 𝑠𝑚𝑎𝑙𝑙 𝑥 = 𝑡𝑟𝑖𝑚𝑓 𝑥, 0 2,5 5
μ𝑣𝑒𝑟𝑦 𝑣𝑒𝑟𝑦 𝑠𝑚𝑎𝑙𝑙 𝑥 = 𝑡𝑟𝑖𝑚𝑓 𝑥, −2 0 2,5
9/15/2020 2:52 PM Dr. Nam H. Nguyen 31
1.3 If-then rules

• If-then rule
R: If 𝜒 is A Then 𝛾 is B
• The if-then rule is called the fuzzy implication or fuzzy
conditional statement.
• χ is A: called the antecedent or premise
• γ is B: called the consequence or conclusion
• The if-then rule can be abbreviated as
𝑅: 𝐴 ⟶ 𝐵

9/15/2020 3:07 PM Dr. Nam H. Nguyen 32


1.3 If-then rules

• R can be viewed as a fuzzy set with a two-dimensional


membership function
μ𝑅 𝑥, 𝑦 = 𝑓(μ𝐴 𝑥 , μ𝐵 𝑦 )
𝑓: called the fuzzy implication function

𝑓 μ𝐴 𝑥 , μ𝐵 𝑦 = min( μ𝐴 𝑥 , μ𝐵 𝑦 𝑀𝑎𝑚𝑑𝑎𝑛𝑖

𝑓 μ𝐴 𝑥 , μ𝐵 𝑦 = μ𝐴 𝑥 . μ𝐵 𝑦 Larsen - PROD

9/15/2020 3:07 PM Dr. Nam H. Nguyen 33


1.3 Compositional Rule of Inference

• R: If 𝜒 is A Then 𝛾 is B
• A•⊂ X, B ⊂ Y, x ∈ 𝑋 and y ∈ 𝑌
• When the input A’ is given to the inference system, the output
B’ is obtained through the inference operation denoted by the
composition operator “o”.
B’ = A’ o R
• This inference procedure is called as the “compositional rule
of inference”

9/15/2020 3:07 PM Dr. Nam H. Nguyen 34


1.3 Compositional Rule of Inference

• Case 1: Singleton input, 𝑥 = 𝑥0


• Let 𝛼0 = μ𝐴 𝑥0
• 𝑎𝑛𝑑 μ𝑅 𝑥0 , 𝑦 = μ𝐵′ 𝑦 .
• 𝛼0 : called matching degree
• μ𝐵′ 𝑦 = min(𝛼0 , μ𝐵 𝑦 ) using Mamdani

• Case 2: Fuzzy input, A’


• 𝛼0 = max(min μ𝐴 𝑥 , μ𝐴′ 𝑥 )
• μ𝐵′ 𝑦 = min(𝛼0 , μ𝐵 𝑦 )

9/15/2020 3:07 PM Dr. Nam H. Nguyen 35


1.3 Compositional Rule of Inference

• Using Larsen’s method.

9/15/2020 3:07 PM Dr. Nam H. Nguyen 36


1.3 Compositional Rule of Inference

• Fuzzy inference with rule base


𝑅1 : If 𝜒 is 𝐴1 Then 𝛾 is 𝐵1 OR
𝑅2 : If 𝜒 is 𝐴2 Then 𝛾 is 𝐵2 OR

𝑅𝑛 : If 𝜒 is 𝐴𝑛 Then 𝛾 is 𝐵𝑛

• B’ = A’ o ⋃𝑛𝑖=1 𝑅𝑖 = ⋃𝑛𝑖=1 A’ o 𝑅𝑖
• μ𝑅 𝑥, 𝑦 = ⋃𝑛𝑖=1 μ𝑅𝑖 𝑥, 𝑦

9/15/2020 3:07 PM Dr. Nam H. Nguyen 37


1.3 Compositional Rule of Inference

• The connective OR can be implemented as a MAX or SUM


operations
• The composition operator maybe:
❑ MAX – MIN
❑ MAX – PROD
❑ SUM – MIN
❑ SUM - PROD

9/15/2020 3:07 PM Dr. Nam H. Nguyen 38


1.3 Compositional Rule of Inference

• Example 1.15:
• μ𝐴1 𝑥 = 𝑡𝑟𝑖𝑚𝑓(𝑥, [1 2 3]),
• μ𝐴2 𝑥 = 𝑡𝑟𝑖𝑚𝑓(𝑥, [2 3 4]),
• μ𝐵1 𝑦 = 𝑡𝑟𝑖𝑚𝑓(𝑦, [1 3 5]),
• μ𝐵2 𝑦 = 𝑡𝑟𝑖𝑚𝑓(𝑦, [3 5 7]),
• Rule base:
𝑅1 : If 𝜒 is 𝐴1 Then 𝛾 is 𝐵1 OR
𝑅2 : IF 𝜒 is 𝐴2 Then 𝛾 is 𝐵2
• Determine μ𝑅 𝑥0 , 𝑦 using the composition operation MAX –
MIN, given 𝑥0 = 2.75.

9/15/2020 3:07 PM Dr. Nam H. Nguyen 39


1.3 Compositional Rule of Inference

• 𝛼1 = μ𝐴1 𝑥0 = 3 − 2,75 = 0,25


• μ𝑅1 2,75, 𝑦 = min(0,25, μ𝐵1 𝑦 )
• 𝛼2 = μ𝐴2 𝑥0 = 2,75 − 2 = 0,75
• μ𝑅2 2,75, 𝑦 = min(0,75, μ𝐵2 𝑦 )
• μ𝑅 𝑥, 𝑦 =
𝑀𝐴𝑋{min 0,25, μ𝐵1 𝑦 , min 0,75, μ𝐵2 𝑦 }
• problem_fuzzy_rule.m

9/15/2020 3:07 PM Dr. Nam H. Nguyen 40


1.3 Compositional Rule of Inference
1 1
A1 B1
A2 B2
0.5 0.5

0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 1 2 3 4 5 6 7 8

1 1
A1 Mu1
Do thoa man B1
0.5 0.5

0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 1 2 3 4 5 6 7 8

1 1
A2 Mu2
Do thoa man B2
0.5 0.5

0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 1 2 3 4 5 6 7 8

1
MuR

0.5

0
0 1 2 3 4 5 6 7 8

9/15/2020 3:07 PM Dr. Nam H. Nguyen 41


1.3 Compositional Rule of Inference

1 1
A1 B1
A2 B2
0.5 0.5

0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 1 2 3 4 5 6 7 8

1 1
A1 Mu1
Do thoa man B1
0.5 0.5

0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 1 2 3 4 5 6 7 8

1 1
A2 Mu2
Do thoa man B2
0.5 0.5

0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 1 2 3 4 5 6 7 8

1
MuR

0.5

0
0 1 2 3 4 5 6 7 8

9/15/2020 3:07 PM Dr. Nam H. Nguyen 42


1.3 Compositional Rule of Inference

• The IF THEN rule for MISO system.


𝑅1 : IF 𝜒1 is 𝐴1,1 AND 𝜒2 is 𝐴2,1 THEN 𝛾 is 𝐵1
This is equivalent to
𝑅1,1 : IF 𝜒1 is 𝐴1,1 THEN 𝛾 is 𝐵1 AND
𝑅1,2 : 𝜒2 is 𝐴2,1 THEN 𝛾 is 𝐵1
where the connective “AND” is an intersection operator, which
works as a MIN function
Thus:
μ𝑅1 𝑥1 , 𝑥2 , 𝑦 = 𝑀𝐼𝑁(μ𝑅1,1 𝑥1 , 𝑦 , μ𝑅1,2 𝑥2 , 𝑦 )
Let μ𝑅1 𝑥1 , 𝑥2 , 𝑦 = μ𝑅1 𝑦 = μ𝐵1′ 𝑦

9/15/2020 3:07 PM Dr. Nam H. Nguyen 43


1.3 Compositional Rule of Inference

• Singleton inputs: 𝑥1 = 𝑥1,0 𝑎𝑛𝑑 𝑥2 = 𝑥2,0


Let 𝛼1,1 = μ𝐴1,1 𝑥1,0 𝑎𝑛𝑑 μ𝐵′1,1 𝑦 = μ𝑅1,1 𝑥1,0 , 𝑦 .
μ𝐵′1,1 𝑦 = min(𝛼1,1 , μ𝐵1 𝑦 ) ---- Zadeh

Let 𝛼1,2 = μ𝐴2,1 𝑥2,0 𝑎𝑛𝑑 μ𝐵′1,2 𝑦 = μ𝑅1,2 𝑥2,0 , 𝑦 .


μ𝐵′1,2 𝑦 = min(𝛼1,2 , μ𝐵1 𝑦 ) ---- Zadeh

μ𝐵1′ = 𝑀𝐼𝑁( μ𝐵′1,1 𝑦 , μ𝐵′1,2 𝑦 )

9/15/2020 3:07 PM Dr. Nam H. Nguyen 44


1.3 Compositional Rule of Inference

μ𝐵1′ = 𝑀𝐼𝑁[min(𝛼1,1 , μ𝐵1 𝑦 ), min 𝛼1,2 , μ𝐵1 𝑦 ]


=𝑀𝐼𝑁[𝑚𝑖𝑛(𝛼1,1, 𝛼1,2 ), μ𝐵1 𝑦 ] ------ Zadeh

• Conclusion:
✓ The matching degree (MISO) is
𝛼𝑖 = 𝑀𝐼𝑁(𝛼𝑖,1 , 𝛼𝑖,2 ,…𝛼𝑖,𝑗 , …)
𝛼𝑖,𝑗 = μ𝐴𝑖,𝑗 (𝑥𝑗 )

9/15/2020 3:07 PM Dr. Nam H. Nguyen 45


1.3 Compositional Rule of Inference
• The rule base for MISO system.
𝑅1 : IF 𝜒1 is 𝐴1,1 AND 𝜒2 is 𝐴2,1 AND … AND 𝜒𝑚 is 𝐴𝑚,1
THEN 𝛾 is 𝐵1 OR
𝑅2 : IF 𝜒1 is 𝐴1,2 AND 𝜒2 is 𝐴2,2 AND … AND 𝜒𝑚 is 𝐴𝑚,2
THEN 𝛾 is 𝐵2 OR

𝑅𝑛 : IF 𝜒1 is 𝐴1,𝑛 AND 𝜒2 is 𝐴2,𝑛 AND … AND 𝜒𝑚 is 𝐴𝑚,𝑛
THEN 𝛾 is 𝐵𝑛
𝑛

μ𝑅 𝒙, 𝑦 = ራ μ𝑅𝑖 𝑦
𝑖=1
𝒙 = x1 x2 … x𝑚
9/15/2020 3:07 PM Dr. Nam H. Nguyen 46
1.3 Compositional Rule of Inference

• μ𝑅𝑖 𝑦 = min 𝛼𝑖 , μ𝐵𝑖 𝑦 --- Zadeh


• 𝛼𝑖 = 𝑀𝐼𝑁(𝛼𝑖,1 , 𝛼𝑖,2 ,…𝛼𝑖,𝑚 ) – matching degree for the rule 𝑅𝑖
• 𝛼𝑖,𝑗 = μ𝐴𝑗,𝑖 (𝑥𝑗 )
• μ𝑅 𝒙, 𝑦 = 𝑀𝐴𝑋 μ𝑅1 𝑦 , μ𝑅2 𝑦 , … , μ𝑅𝑚 𝑦

9/15/2020 3:07 PM Dr. Nam H. Nguyen 47


Example
μ𝐴1,1 𝑥1 = 𝑡𝑟𝑖𝑚𝑓(𝑥1 , [1 2 3]),
μ𝐴1,2 𝑥1 = 𝑡𝑟𝑖𝑚𝑓(𝑥1 , [2 3 4]),
μ𝐴2,1 𝑥2 = 𝑡𝑟𝑖𝑚𝑓(𝑥2 , [−3 − 2 − 1]),
μ𝐴2,2 𝑥2 = 𝑡𝑟𝑖𝑚𝑓(𝑥2 , [−4 − 3 − 2]),
μ𝐵1 𝑦 = 𝑡𝑟𝑖𝑚𝑓(𝑦, [1 3 5]), μ𝐵2 𝑦 = 𝑡𝑟𝑖𝑚𝑓(𝑦, [3 5 7]),
𝑅1 : IF 𝜒1 is 𝐴1,1 AND 𝜒2 is 𝐴2,1 THEN 𝛾 is 𝐵1 OR
𝑅2 : IF 𝜒1 is 𝐴1,2 AND 𝜒2 is 𝐴2,2 THEN 𝛾 is 𝐵2
Find μ𝑅 𝒙𝟎 , 𝑦 using composition operator MAX - MIN,
Given 𝒙𝟎 = [2.75; −2.5]

9/15/2020 3:07 PM Dr. Nam H. Nguyen 48


Example

• μ𝐴1,1 𝑥1 = 3 − 𝑥1 𝑓𝑜𝑟 2 < 𝑥1 < 3


• 𝑥1,0 = 2.75
• 𝛼1,1 = μ𝐴1,1 𝑥1,0 = 3 − 2.75 = 0.25
• μ𝐴2,1 𝑥2 = 𝑥2 + 3 𝑓𝑜𝑟 − 3 < 𝑥2 < −2
• 𝑥2,0 = −2.5
• 𝛼1,2 = μ𝐴2,1 𝑥2,0 = −2.5 + 3 = 0.5
• 𝛼1 = min 𝛼1,1 , 𝛼1,2 = min 0.25,0.5 = 0.25
• μ𝑅1 𝒙𝟎 , 𝑦 = min(0.25, μ𝐵1 𝑦 )

9/15/2020 3:07 PM Dr. Nam H. Nguyen 49


Example

• μ𝐴1,2 𝑥1 = 𝑥1 − 2 𝑓𝑜𝑟 2 < 𝑥1 < 3


• 𝑥1,0 = 2.75
• 𝛼2,1 = μ𝐴1,2 𝑥1,0 = 2.75 − 2 = 0.75
• μ𝐴2,2 𝑥2 = −2 − 𝑥2 𝑓𝑜𝑟 − 3 < 𝑥2 < −2
• 𝑥2,0 = −2.5
• 𝛼2,2 = μ𝐴2,2 𝑥2,0 = −2 − (−2.5) = 0.5
• 𝛼2 = min 𝛼2,1 , 𝛼2,2 = min 0.5,0.75 = 0.5
• μ𝑅2 𝒙𝟎 , 𝑦 = min(0.5, μ𝐵2 𝑦 )

9/15/2020 3:07 PM Dr. Nam H. Nguyen 50


1.4 Example
• μ 𝑅 𝒙𝟎 , 𝑦 =
𝑀𝐴𝑋(min(0.25, μ𝐵1 𝑦 ), min(0.5, μ𝐵2 𝑦 ))
1 1 1
A11 A21 Mu1
0.8 alpha11 0.8 alpha12 0.8
B1
0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0
0 1 2 3 4 5 -5 -4 -3 -2 -1 0 0 1 2 3 4 5 6 7 8

1 1 1
A12 A22 Mu1
0.8 alpha21 0.8 alpha22 0.8
B2
0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0
0 1 2 3 4 5 -5 -4 -3 -2 -1 0 0 1 2 3 4 5 6 7 8

1
MuR
0.8

0.6

0.4

0.2

0
0 1 2 3 4 5 6 7 8

9/15/2020 3:07 PM Dr. Nam H. Nguyen 51


1.4 Defuzzification

• The process of finding a non-fuzzy value y’ from μ𝑅 𝒙, 𝑦 is


called defuzzification.
• Three methods of defuzzification:
✓Maximum
✓Centroid (Center of area)
✓Bisector of area
• Maximum
𝐻 = max(μ𝑅 𝒙, 𝑦 )
𝐺 = 𝑦 ⊂ 𝑌|(μ𝑅 𝑦 = 𝐻
Let 𝑦1 = min(𝐺) and 𝑦2 = m𝑎𝑥(𝐺).

9/15/2020 3:07 PM Dr. Nam H. Nguyen 52


1.4 Defuzzification

• Three options to determine y’:


➢ MOM – mean value of maximum

𝑦1 + 𝑦2
𝑦 =
2
➢ SOM – smallest value of maximum
𝑦′ = 𝑦1
➢ LOM – largest value of maximum
𝑦′ = 𝑦2

9/15/2020 3:07 PM Dr. Nam H. Nguyen 53


1.4 Defuzzification

• Centroid
Let S = 𝑦 ∈ 𝑌|μ𝑅 𝑦 > 0

′ ‫𝑦 𝑆׬‬μ𝑅 𝑦 𝑑𝑦
𝑦 =
‫ 𝑆׬‬μ𝑅 𝑦 𝑑𝑦

• BISECTOR
y’ satisfies the condition
𝑦′ 𝑏
න μ𝑅 𝑦 𝑑𝑦 = න μ𝑅 𝑦 𝑑𝑦
𝑎 𝑦′
a = min(𝑆) và b = m𝑎𝑥(𝑆)

9/15/2020 3:07 PM Dr. Nam H. Nguyen 54


1.4 Defuzzification
• Example:
μ𝐴1,1 𝑥1 = 𝑡𝑟𝑖𝑚𝑓(𝑥1 , [1,2,3]),
μ𝐴1,2 𝑥1 = 𝑡𝑟𝑖𝑚𝑓(𝑥1 , [2,3,4]),
μ𝐴2,1 𝑥2 = 𝑡𝑟𝑖𝑚𝑓(𝑥2 , [−3, −2, −1]),
μ𝐴2,2 𝑥2 = 𝑡𝑟𝑖𝑚𝑓(𝑥2 , [−4, −3, −2]),
μ𝐵1 𝑦 = 𝑡𝑟𝑖𝑚𝑓(𝑦, [1,3,5]), μ𝐵2 𝑦 = 𝑡𝑟𝑖𝑚𝑓(𝑦, [3,5,7])
𝑅1 : IF 𝜒1 is 𝐴1,1 AND 𝜒2 is 𝐴2,1 THEN 𝛾 is 𝐵1 OR
𝑅2 : IF 𝜒1 is 𝐴1,2 AND 𝜒2 is 𝐴2,2 THEN 𝛾 is 𝐵2
Find y’ using composition operator MAX - MIN,
given 𝒙𝟎 = [2.75, −2.5]

9/15/2020 3:07 PM Dr. Nam H. Nguyen 55


1.4 Defuzzification

• μ𝐴1,1 𝑥1 = 3 − 𝑥1 𝑓𝑜𝑟 2 < 𝑥1 < 3


• 𝑥1,0 = 2.75
• 𝛼1,1 = μ𝐴1,1 𝑥1,0 = 3 − 2.75 = 0.25
• μ𝐴2,1 𝑥2 = 𝑥2 + 3 𝑓𝑜𝑟 − 3 < 𝑥2 < −2
• 𝑥2,0 = −2.5
• 𝛼1,2 = μ𝐴2,1 𝑥2,0 = −2.5 + 3 = 0.5
• 𝛼1 = min 𝛼1,1 , 𝛼1,2 = min 0.25,0.5 = 0.25
• μ𝑅1 𝒙𝟎 , 𝑦 = min(0.25, μ𝐵1 𝑦 )

9/15/2020 3:07 PM Dr. Nam H. Nguyen 56


1.4 Defuzzification

• μ𝐴1,2 𝑥1 = 𝑥1 − 2 𝑓𝑜𝑟 2 < 𝑥1 < 3


• 𝑥1,0 = 2.75
• 𝛼2,1 = μ𝐴1,2 𝑥1,0 = 2.75 − 2 = 0.75
• μ𝐴2,2 𝑥2 = −2 − 𝑥2 𝑓𝑜𝑟 − 3 < 𝑥2 < −2
• 𝑥2,0 = −2.5
• 𝛼2,2 = μ𝐴2,2 𝑥2,0 = −2 − (−2.5) = 0,5
• 𝛼2 = min 𝛼2,1 , 𝛼2,2 = min 0.5,0.75 = 0.5
• μ𝑅2 𝒙𝟎 , 𝑦 = min(0.5, μ𝐵2 𝑦 )

9/15/2020 3:07 PM Dr. Nam H. Nguyen 57


1.4 Defuzzification
• μ 𝑅 𝒙𝟎 , 𝑦 =
𝑀𝐴𝑋(min(0.25, μ𝐵1 𝑦 ), min(0.5, μ𝐵2 𝑦 ))
1 1 1
A11 A21 Mu1
0.8 alpha11 0.8 alpha12 0.8
B1
0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0
0 1 2 3 4 5 -5 -4 -3 -2 -1 0 0 1 2 3 4 5 6 7 8

1 1 1
A12 A22 Mu1
0.8 alpha21 0.8 alpha22 0.8
B2
0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0
0 1 2 3 4 5 -5 -4 -3 -2 -1 0 0 1 2 3 4 5 6 7 8

1
MuR
0.8

0.6

0.4

0.2

0
0 1 2 3 4 5 6 7 8

9/15/2020 3:07 PM Dr. Nam H. Nguyen 58


1.4 Defuzzification

Maximum:
H = max(μR 𝐱 𝟎 , y )=0.5
G = y ⊂ Y|(μR y = H = y ⊂ Y 4 ≤ y ≤ 6
y1 = min G = 4
y2 = max G = 6
Thus, y’ can be:
y’ = 4, or
y’ = 6, or
Y’ = 5
Centroid:

9/15/2020 3:07 PM Dr. Nam H. Nguyen 59


1.4 Defuzzification

• S = 𝑦 ∈ 𝑌|μ𝑅 𝑦 > 0 = 𝑦 ∈ 𝑌|1 < 𝑦 < 7


7
• 𝑆𝑑 = ‫ 𝑆׬‬μ𝑅 𝑦 𝑑𝑦 = ‫׬‬1 μ𝑅 𝒙𝟎 , 𝑦 𝑑𝑦
• = 0.5 ∗ 0.5 ∗ 0.25 + 2 ∗ 0.25 + 0.5 ∗ 0.25 + 0.5 ∗ 0.5 + 2 ∗
0.5 + 0.5 ∗ 0.5 = 2
7
• 𝑆𝑛 = ‫ 𝑆׬‬yμ𝑅 𝑦 𝑑𝑦 = ‫׬‬1 𝑦μ𝑅 𝑦 𝑑𝑦 =
1.5 3.5
‫׬‬1 𝑦 ∗ 0.5 ∗ (𝑦 − 1)𝑑𝑦 + ‫׬‬1.5 𝑦 ∗ 0.25𝑑𝑦 +
4 6
‫׬‬3.5 𝑦 ∗ 0.5 ∗ (𝑦 − 3)𝑑𝑦 + ‫׬‬4 𝑦 ∗ 0.5𝑑𝑦 +
7
‫׬‬6 𝑦 ∗ 0.5 ∗ (7 − 𝑦)𝑑𝑦 = 8.625
• y’ = Sn/Sd = 4.3125

9/15/2020 3:07 PM Dr. Nam H. Nguyen 60


1.5 Sugeno fuzzy model

𝑅1 : IF 𝜒1 is 𝐴1,1 AND 𝜒2 is 𝐴2,1 AND … AND 𝜒𝑚 is 𝐴𝑚,1


THEN 𝑦 = 𝑔1 (𝒙) OR
𝑅2 : IF 𝜒1 is 𝐴1,2 AND 𝜒2 is 𝐴2,2 AND … AND 𝜒𝑚 is 𝐴𝑚,2
THEN y = 𝑔2 (𝒙) OR

𝑅𝑛 : IF 𝜒1 is 𝐴1,𝑛 AND 𝜒2 is 𝐴2,𝑛 AND … AND 𝜒𝑚 is 𝐴𝑚,𝑛
THEN y = 𝑔𝑛 (𝒙)
𝒙 = x1 x2 … x𝑚
𝑔𝑖 (𝒙) polynomial functions of 𝒙

9/15/2020 3:07 PM Dr. Nam H. Nguyen 61


1.5 Sugeno fuzzy model

The non-fuzzy output:


Weighted average – wtaver

𝛼1 𝑦1 + 𝛼2 𝑦2 + ⋯ + 𝛼𝑛 𝑦𝑛
𝑦 =
𝛼1 + 𝛼2 + ⋯ + 𝛼𝑛
𝑦𝑖 = 𝑔𝑖 (𝑥1 , 𝑥2 , … , 𝑥𝑚 )
• 𝛼𝑖 = 𝑀𝐼𝑁(𝛼𝑖,1 , 𝛼𝑖,2 ,…𝛼𝑖,𝑚 ) matching degree (firing strength)
• 𝛼𝑖,𝑗 = μ𝐴𝑖,𝑗 (𝑥𝑗 )
• Weighted sum - wtsum
𝑦 ′ = 𝛼1 𝑦1 + 𝛼2 𝑦2 + ⋯ + 𝛼𝑛 𝑦𝑛

9/15/2020 3:07 PM Dr. Nam H. Nguyen 62


1.5 Sugeno fuzzy model

• Example
μ𝐴1,1 𝑥1 = 𝑡𝑟𝑖𝑚𝑓(𝑥1 , [1,2,3]),
μ𝐴1,2 𝑥1 = 𝑡𝑟𝑖𝑚𝑓(𝑥1 , [2,3,4]),
μ𝐴2,1 𝑥2 = 𝑡𝑟𝑖𝑚𝑓(𝑥2 , [−3, −2, −1]),
μ𝐴2,2 𝑥2 = 𝑡𝑟𝑖𝑚𝑓(𝑥2 , [−4, −3, −2]),
𝑅1 : IF 𝜒1 is 𝐴1,1 AND 𝜒2 is 𝐴2,1 THEN 𝑦 = 𝑔1 𝑥1 , 𝑥2 OR
𝑅2 : IF 𝜒1 is 𝐴1,2 AND 𝜒2 is 𝐴2,2 THEN 𝑦 = 𝑔2 𝑥1 , 𝑥2
Find y’, given 𝒙𝟎 = 2.75, −2.5 , 𝑔1 𝑥1 , 𝑥2 = 3 and
𝑔2 𝑥1 , 𝑥2 = 5

9/15/2020 3:07 PM Dr. Nam H. Nguyen 63


1.5 Sugeno fuzzy model

• μ𝐴1,1 𝑥1 = 3 − 𝑥1 𝑓𝑜𝑟 2 < 𝑥1 < 3


• 𝑥1,0 = 2.75
• 𝛼1,1 = μ𝐴1,1 𝑥1,0 = 3 − 2.75 = 0.25
• μ𝐴2,1 𝑥2 = 𝑥2 + 3 𝑓𝑜𝑟 − 3 < 𝑥2 < −2
• 𝑥2,0 = −2.5
• 𝛼1,2 = μ𝐴2,1 𝑥2,0 = −2.5 + 3 = 0.5
• 𝛼1 = min 𝛼1,1 , 𝛼1,2 = min 0.25,0.5 = 0.25

9/15/2020 3:07 PM Dr. Nam H. Nguyen 64


1.5 Sugeno fuzzy model

• μ𝐴1,2 𝑥1 = 𝑥1 − 2 𝑓𝑜𝑟 2 < 𝑥1 < 3


• 𝑥1,0 = 2.75
• 𝛼2,1 = μ𝐴1,2 𝑥1,0 = 2.75 − 2 = 0.75
• μ𝐴2,2 𝑥2 = −2 − 𝑥2 𝑓𝑜𝑟 − 3 < 𝑥2 < −2
• 𝑥2,0 = −2.5
• 𝛼2,2 = μ𝐴2,2 𝑥2,0 = −2 − (−2.5) = 0,5
• 𝛼2 = min 𝛼2,1 , 𝛼2,2 = min 0.5,0.75 = 0.5

9/15/2020 3:07 PM Dr. Nam H. Nguyen 65


1.5 Sugeno fuzzy model

• 𝛼1 = 0.25
• 𝛼2 = 0.5
𝛼1 𝑦1 +𝛼2 𝑦2 0.25∗3 + 0.5∗5 3.25
• 𝑦′ = 𝛼1 +𝛼2
= 0.25+0.5
= 0.75 = 4.33 – wtaver
• 𝑦 ′ = 𝛼1 𝑦1 + 𝛼2 𝑦2 = 3.25 - wtsum
• Find y’ when 𝑔1 𝑥1 , 𝑥2 = 𝑥1 + 𝑥2 − 1 and 𝑔2 𝑥1 , 𝑥2 = 𝑥1 −
𝑥2 + 1

9/15/2020 3:07 PM Dr. Nam H. Nguyen 66

You might also like