Fuzzy Logic 4
Fuzzy Logic 4
ETF
Beograd
Fuzzy Logic
Developing Fuzzy Expert Systems
1
27.12.2023.
Fuzzy sets are defined both for input and output variables!
2
27.12.2023.
0 Y* N N N N
0.9
0.8
5 Y Y N N N
0.7
Degree of Membership
COLD(temp)
0< (temp)<1 10 N Y N N N
0.6
COOL(temp)
0.5 PLEASANT(temp)
12.5 N Y* N N N
0.4
WARM(temp)
HOT(temp)
15 N Y N N N
0.3
0.2
17.5 N N Y* N N
0.1
20 N N N Y N
0
0 5 10 15 20 25 30
temp [ oC]
22.5 N N N Y* N
25 N N N Y N
(temp)=0 (temp)=1
27.5 N N N N Y
30 N N N N Y*
0 Y* N N N N0.9
10 Y N N N N
0.8
0.7
Degree of Membership
MINIMAL(speed)
20 Y Y N N N0.6 SLOW(speed)
MEDIUM(speed)
30 N Y* N N N
0.5
FAST(speed)
0.4
BLAST(speed)
40 N Y N N N0.3
50 N N Y* N N0.1
0.2
60 N N N Y N0 0 10 20 30 40 50 60 70 80 90 100
speed [rpm]
70 N N N Y* N
80 N N N Y Y
90 N N N N Y
100 N N N N Y*
3
27.12.2023.
4
27.12.2023.
10
10
5
27.12.2023.
0.9
0.8
0.7
Degree of Membership
COLD(temp)
0.6
COOL(temp)
For temp = 16, 0.5 PLEASANT(temp)
0.2
0.1
0
0 5 10 15 20 25 30
temp [ oC]
11
Other rules are not affected; their antecedent truth degree is 0.0
and they produce empty fuzzy sets on the output universe! 12
12
6
27.12.2023.
• Aggregation
0.3 R2(speed)
speed
0 20 40 60 80 100
𝜇𝐴𝐺𝐺 𝑠𝑝𝑒𝑒𝑑 = max [𝜇𝑅1 𝑠𝑝𝑒𝑒𝑑 , 𝜇𝑅2 (𝑠𝑝𝑒𝑒𝑑) , 1
MEDIUM(speed)
𝜇𝑅3 𝑠𝑝𝑒𝑒𝑑 , 𝜇𝑅4 𝑠𝑝𝑒𝑒𝑑 , 𝜇𝑅5 (𝑠𝑝𝑒𝑒𝑑)]
= max [𝜇𝑅2 𝑠𝑝𝑒𝑒𝑑 , 𝜇𝑅3 𝑠𝑝𝑒𝑒𝑑 ] 0.4
R3(speed)
speed
(since 𝜇𝑅1 𝑠𝑝𝑒𝑒𝑑 , 𝜇𝑅4 𝑠𝑝𝑒𝑒𝑑 , and 𝜇𝑅5 𝑠𝑝𝑒𝑒𝑑 are 0 20 40 60 80 100
empty fuzzy sets = zero flat-lined over output universe) 1
0.4 AGG(speed)
0.3
• Defuzzification 0 20 40 60 80 100
speed
𝑛 𝑛
𝜇𝐴𝐺𝐺 𝑠𝑝𝑒𝑒𝑑𝑗 × 𝑠𝑝𝑒𝑒𝑑𝑗 × Δ𝑠𝑝𝑒𝑒𝑑 𝜇𝐴𝐺𝐺 𝑠𝑝𝑒𝑒𝑑𝑗 × 𝑠𝑝𝑒𝑒𝑑𝑗
𝑗=1 𝑗=1
𝒔𝒑𝒆𝒆𝒅𝑪𝑶𝑮 ≈ 𝑛 = 𝑛 Δ𝑠𝑝𝑒𝑒𝑑 = 2.5, 𝑛 = 41
𝜇𝐴𝐺𝐺 𝑠𝑝𝑒𝑒𝑑𝑗 × Δ𝑠𝑝𝑒𝑒𝑑 𝜇𝐴𝐺𝐺 𝑠𝑝𝑒𝑒𝑑𝑗
𝑗=1 𝑗=1
0 0 + 2.5 + ⋯ + 10 + 0.125 12.5 + 0.3 17.5 + 20 + ⋯ 42.5 + 0.4 45 + 47.5 + ⋯ 55 + 0.25 57.5 + 0 60 + ⋯ + 100
=
0 × 5 + 0.125 × 1 + 0.25 × 1 + 0.3 × 11 + 0.4 × 5 + 0.25 × 1 + 0 × 17
= 𝟒𝟓. 𝟓𝟒 𝑹𝑷𝑴
13
13
90
80
70
60
fan-speed
50
40
30
20
10
0
0 5 10 15 20 25 30
temp
14
7
27.12.2023.
15