ADVANCED NEURAL NETWORK AND
FUZZY LOGIC
Assignment # 01
MS(CS)-4A
Name: MISBAH RASHID
Enrolment No: 02-243212-001
Course Instructor: DR. YAWAR
Department of Computer Science
Bahria University Karachi Campus
1
QUESTION# 01
Design a fuzzy system on any real-world application.
SOLUTION
Application: Electric Heater
Fuzzification:
For fuzzification I have used Triangular membership function.
Figure 1. Temperature (°C)
In the figure 1:
• The Membership of Cold is High at 20, average at 14 and low at 10
2
• The Membership of Average is High at 26, average at 20 and low at 14
• The Membership of Hot is High at 34, average at 28 and low at 22
Figure 2. Humidity (%)
In the figure 2:
• The Membership of Low is High at 40, average at 20 and low at 0
• The Membership of Average is High at 80, average at 50 and low at 20
• The Membership of High is High at 100, average at 80 and low at 50
Rule Base:
1. If Temperature is Cold & Humidity is LOW than Power will be High
2. If Temperature is Cold & Humidity is AVG than Power will be AVG
3. If Temperature is Cold & Humidity is HIGH than Power will be LOW
4. If Temperature is AVG & Humidity is LOW than Power will be LOW
5. If Temperature is AVG & Humidity is AVG than Power will be LOW
6. If Temperature is AVG & Humidity is HIGH than Power will be LOW
7. If Temperature is HOT & Humidity is LOW than Power will be LOW
8. If Temperature is HOT & Humidity is AVG than Power will be LOW
9. If Temperature is HOT & Humidity is HIGH than Power will be LOW
3
Test Sample 01:
1. Temperature = 14 °C, Humidity is 45% what will be the Power of Electric Heater?
Solution:
• 1st Step: Marking
The value of Temperature 14 is marked on the graph and I have got
two values 0.1 for AVG and 0.5 for LOW.
Figure 3. Temperature Value Marking
The value of Humidity 45 is marked on the graph and I have got 0.9.
Figure 4. Humidity value Marking
Now the Union will be performed between 0.1 and 0.9, and 0.5 and
0.9.
The minimum value between 0.1 and 0.9 is 0.1
The minimum value between 0.5 and 0.9 is 0.5
4
Figure 5. Union Values Marking
• 2nd Step: Chop
0.1 and 0.5 is marked on the Graph and chopped.
Figure 6. Chopped Value
• 3rd Step: Maximum value
The maximum value between 0.1 and 0.5 is 0.5 so we select 0.5
• 4th & Final Step: Defuzzification
For defuzzification I have use Maximum Average Method
The Values for the 0.5 are 0 to 280 on Power Graph. The average of 0
to 280 is 140.
So, The Power of Electric Heater is 140 Watt (W).
The Final Output is shown in the Figure 6.
**********************************************************************************
**********************************************************************************
“The End” “Thank You”
5