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

Lesson5 Fuzzy - Logic.

Uploaded by

Vince Alcazar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Lesson5 Fuzzy - Logic.

Uploaded by

Vince Alcazar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Fuzzy Logic

Systems
COSC105 – Intelligent Systems
What is Fuzzy Logic?
⬡ Fuzzy Logic (FL) is a method of reasoning that
resembles human reasoning. The approach of FL
imitates the way of decision making in humans
that involves all intermediate possibilities
between digital values YES and NO.
⬡ The conventional logic block that a computer can
understand takes precise input and produces a
definite output as TRUE or FALSE, which is
equivalent to human’s YES or NO.
What is Fuzzy Logic?
⬡ The inventor of fuzzy logic, Lotfi Zadeh, observed that unlike
computers, the human decision making includes a range of
possibilities between YES and NO, such as −

CERTAINLY YES
POSSSIBLY YES
CANNOT SAY
POSSIBLY NO
CERTAINLY NO

⬡ The fuzzy logic works on the levels of possibilities of input to


achieve the definite output.
What is Fuzzy Logic?
⬡ Implementation of Fuzzy Logic can be done in
various ways:

⬡ It can be implemented in systems with


various sizes and capabilities ranging from
small micro-controllers to large, networked,
workstation-based control systems.

⬡ It can be implemented in hardware,


software, or a combination of both.
What is Fuzzy Logic?
⬡ Fuzzy logic is useful for commercial and practical
purposes.

⬡ It can control machines and consumer


products.

⬡ It may not give accurate reasoning, but


acceptable reasoning.

⬡ Fuzzy logic helps to deal with the


uncertainty in engineering.
Fuzzy Logic
Systems
Architecture
Fuzzy Logic Systems Architecture
⬡ A Fuzzy Logic System has four main parts:
⬡ Fuzzification Module − It transforms the
system inputs, which are crisp numbers,
into fuzzy sets. It splits the input signal into
five steps such as −

LP Large Positive
MP Medium Positive
S Small
MN Medium Negative
LN Large Positive
Fuzzy Logic Systems Architecture
⬡ Knowledge Base – stores IF-THEN rules
provided by the experts

⬡ Inference Engine – simulates the human


reasoning process by making fuzzy
inference on the inputs and IF-THEN rules

⬡ Defuzzification Module – transforms the


fuzzy set obtained by the inference engine
into a crisp value
Fuzzy Logic Systems Architecture
⬡ A fuzzy logic system works on a certain architecture as shown:

Rules

Crisp Crisp
Fuzzifier Defuzzifier
Input Output

Intelligence
Fuzzy Logic Systems Architecture
⬡ A fuzzy logic system must also define its membership
functions to work on fuzzy sets of variables.
⬡ Membership functions allow you to quantify linguistic
term and represent a fuzzy set graphically.
⬡ In the fuzzy theory, fuzzy set 𝐴 of universe 𝑋 is
defined by function 𝜇𝐴 𝑥 , which is called the
membership function of set 𝐴
𝜇𝐴 𝑥 : 𝑋 → [0, 1]
⬡ Where: 𝜇𝐴 𝑥 = 1 if 𝑥 is totally in 𝐴
𝜇𝐴 𝑥 = 0 if 𝑥 is not in 𝐴

0 < 𝜇𝐴 𝑥 < 1 if 𝑥 is partly in 𝐴


Fuzzy Logic Systems Architecture
⬡ Note:

𝜇𝐴 𝑥 : 𝑋 → [0, 1]
⬡ This formula reads:

The degree of membership of set A of x such that


universe X approaches 0 or 1
Fuzzy Logic Systems Architecture
⬡ Here, each element of 𝑋 is mapped to
a value between 0 and 1. It is called
membership value or degree of
membership.
⬡ It quantifies the degree of membership
of the element in 𝑋 to the fuzzy set 𝐴.
∙ x axis represents the universe of
discourse.
∙ y axis represents the degrees of
membership in the [0, 1] interval
⬡ The graph shows all membership
functions for LP, MP, S, MN, and LN
Fuzzy Logic Systems Architecture
⬡ There can be multiple membership
functions applicable to fuzzify a
numerical value.
⬡ Simple membership functions are used
as use of complex functions does not
add more precision in the output.
⬡ The triangular membership function
shapes are most common among
various other membership function
shapes.
⬡ Other shapes include trapezoidal,
singleton, and Gaussian.
Fuzzy Logic Systems Architecture
⬡ A common fuzzy logic system uses the following algorithm:
⬡ Define linguistic Variables and terms (start)
⬡ Construct membership functions for them. (start)
⬡ Construct knowledge base of rules (start)
⬡ Convert crisp data into fuzzy data sets using membership
functions. (fuzzification)
⬡ Evaluate rules in the rule base. (Inference Engine)
⬡ Combine results from each rule. (Inference Engine)
⬡ Convert output data into non-fuzzy values. (defuzzification)
Fuzzy Logic Systems Architecture
⬡ A good example of this is an air
conditioning system.
⬡ The air conditioner will keep the room
cool and will stop the compressor once it
reached the desired temperature.
⬡ Once the sensor detected that the room
is not cool enough, it will then turn on
the compressor again.
⬡ Some models heat up the room slightly
when it detected that the temperature is
lower than the desired one.
Fuzzy Logic Systems Architecture
⬡ The fuzzy logic system architecture of an air conditioner is as follows:

Room
Air Conditioner
Fuzzy
Target Temp Logic
System

Command:
• Heat
• Cool Room Temp
• No Change
Fuzzy Logic
Systems
Development
Steps
Fuzzy Logic Systems Development
⬡ In order for us to create our own system
that uses fuzzy logic, we must follow the
following steps.
⬡ For this example, let’s say we’ll create
an air conditioning system which can
cool the room down to 0°C and can heat
the room up to 40°C.
⬡ We’ll also assume that the air
conditioner will adjust the temperature
automatically.
⬡ When the temperature is cooler than the
target, the air conditioner will heat up.
When the temperature is hotter than the
target, the air conditioner will cool down.
Fuzzy Logic Systems Development
⬡ STEP 1 – Define linguistic variables and terms
⬡ Linguistic variables are input and output
variables in the form of simple words or
sentences.
⬡ For room temperature, cold, warm, hot, etc.,
are linguistic terms.
Temp (t) = {very-cold, cold, warm, hot, very-hot}

⬡ Every member of this set is a linguistic term


and it can cover some portion of overall
temperature values.
Fuzzy Logic Systems Development
⬡ STEP 2 – Construct membership functions for the
variables and terms
⬡ We’ll use the triangular membership function
shape for the temperature. It will be as follows:

very-cold cold warm hot very-hot

Input
0 10 20 30 40 Temperature
Fuzzy Logic Systems Development
⬡ STEP 3 – Construct knowledge base rules
⬡ Create a matrix of room temperature values
versus target temperature values that an air
conditioning system is expected to provide.
Room Temp
Very-Cold Cold Warm Hot Very-Hot
Target Temp

Very-Cold No-change Heat Heat Heat Heat

Cold Cool No-change Heat Heat Heat

Warm Cool Cool No-change Heat Heat

Hot Cool Cool Cool No-change Heat

Very-Hot Cool Cool Cool Cool No-change


Fuzzy Logic Systems Development
⬡ STEP 3 – Construct knowledge base rules
⬡ After creating the matrix, we’ll build the set of
rules into the knowledge base in the form of
IF-THEN-ELSE structures

Rule no. Condition Action

IF RoomTemp = (Cold OR Very-Cold)


1 Heat
AND TargetTemp = Warm THEN

IF RoomTemp = (Hot or Very-Hot)


2 Cool
AND TargetTemp = Warm THEN

IF RoomTemp = Warm
3 No-change
AND TargetTemp = Warm THEN
Fuzzy Logic Systems Development
⬡ STEP 4 – Obtain fuzzy value
⬡ Fuzzy set operations perform
evaluation of rules.
⬡ The operations used for OR and AND
are Max and Min respectively.
⬡ Combine all results of evaluation to
form a final result. This result is a fuzzy
value.
Fuzzy Logic Systems Development
⬡ STEP 5 – Perform Defuzzification
⬡ Defuzzification is then performed according to
membership function for output variable.
⬡ Example:
RoomTemp: 37°C (Hot)
TargetTemp: 28°C (Hot)

very-cold cold warm hot very-hot

LEGEND

Output (to
reach target)

Exact value

Input
0 10 20 30 40 Temperature
Fuzzy Logic Systems Development
⬡ Fuzzy Logic are also applied on different areas,
such as:
⬡ Automotive Systems such as automatic
gearboxes, Four-Wheel Steering and
Vehicle Environment Control
⬡ Consumer Electronics such as Hi-Fi Systems,
Photocopiers, Video Cameras and TVs
⬡ Domestic Goods such as Microwave Ovens,
Refrigerators, Toasters, Vacuum Cleaners
and Automatic Washing Machines
⬡ Environment Control such as humidifiers
and air conditioners/heaters/dryers
Advantages
and
Disadvantages
Advantages of Fuzzy Logic Systems
⬡ Mathematical concepts within fuzzy reasoning
are very simple.
⬡ You can modify a FLS by just adding or deleting
rules due to flexibility of fuzzy logic.
⬡ Fuzzy logic Systems can take imprecise,
distorted, noisy input information.
⬡ FLSs are easy to construct and understand.
⬡ Fuzzy logic is a solution to complex problems in
all fields of life, including medicine, as it
resembles human reasoning and decision
making.
Disadvantages of Fuzzy Logic Systems
⬡ There is no systematic approach to fuzzy system
designing.
⬡ They are understandable only when simple.
⬡ They are suitable for the problems which do not
need high accuracy.

You might also like