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

FAI unit-3

Fuzzy Logic is a mathematical approach that allows for reasoning with imprecise or uncertain information, utilizing truth values between 0 and 1 to represent partial truths. It consists of four main components: rule base, fuzzification, inference engine, and defuzzification, and is applied in various fields such as control systems, AI, and natural language processing. While it offers advantages like handling noisy data and mimicking human reasoning, it also faces challenges such as ambiguity and potential accuracy compromises.

Uploaded by

art662362
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)
27 views

FAI unit-3

Fuzzy Logic is a mathematical approach that allows for reasoning with imprecise or uncertain information, utilizing truth values between 0 and 1 to represent partial truths. It consists of four main components: rule base, fuzzification, inference engine, and defuzzification, and is applied in various fields such as control systems, AI, and natural language processing. While it offers advantages like handling noisy data and mimicking human reasoning, it also faces challenges such as ambiguity and potential accuracy compromises.

Uploaded by

art662362
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/ 29

Fuzzy Logic | Introduction

The term fuzzy refers to things that are not clear or are vague. In the real world many times we
encounter a situation when we can’t determine whether the state is true or false, their fuzzy logic
provides very valuable flexibility for reasoning. In this way, we can consider the inaccuracies and
uncertainties of any situation.

Fuzzy Logic is a form of many-valued logic in which the truth values of variables may be any real
number between 0 and 1, instead of just the traditional values of true or false. It is used to deal with
imprecise or uncertain information and is a mathematical method for representing vagueness and
uncertainty in decision-making.

Fuzzy Logic is based on the idea that in many cases, the concept of true or false is too restrictive, and
that there are many shades of gray in between. It allows for partial truths, where a statement can be
partially true or false, rather than fully true or false.

Fuzzy Logic is used in a wide range of applications, such as control systems, image processing, natural
language processing, medical diagnosis, and artificial intelligence.

The fundamental concept of Fuzzy Logic is the membership function, which defines the degree of
membership of an input value to a certain set or category. The membership function is a mapping
from an input value to a membership degree between 0 and 1, where 0 represents non-membership
and 1 represents full membership.

Fuzzy Logic is implemented using Fuzzy Rules, which are if-then statements that express the
relationship between input variables and output variables in a fuzzy way. The output of a Fuzzy Logic
system is a fuzzy set, which is a set of membership degrees for each possible output value.

In summary, Fuzzy Logic is a mathematical method for representing vagueness and uncertainty in
decision-making, it allows for partial truths, and it is used in a wide range of applications. It is based
on the concept of membership function and the implementation is done using Fuzzy rules.

In the boolean system truth value, 1.0 represents the absolute truth value and 0.0 represents the
absolute false value. But in the fuzzy system, there is no logic for the absolute truth and absolute
false value. But in fuzzy logic, there is an intermediate value too present which is partially true and
partially false.
ARCHITECTURE

Its Architecture contains four parts :

• RULE BASE: It contains the set of rules and the IF-THEN conditions provided by the experts to
govern the decision-making system, on the basis of linguistic information. Recent
developments in fuzzy theory offer several effective methods for the design and tuning of
fuzzy controllers. Most of these developments reduce the number of fuzzy rules.

• FUZZIFICATION: It is used to convert inputs i.e. crisp numbers into fuzzy sets. Crisp inputs are
basically the exact inputs measured by sensors and passed into the control system for
processing, such as temperature, pressure, rpm’s, etc.

• INFERENCE ENGINE: It determines the matching degree of the current fuzzy input with
respect to each rule and decides which rules are to be fired according to the input field.
Next, the fired rules are combined to form the control actions.

• DEFUZZIFICATION: It is used to convert the fuzzy sets obtained by the inference engine into a
crisp value. There are several defuzzification methods available and the best-suited one is
used with a specific expert system to reduce the error.

Membership function

Definition: A graph that defines how each point in the input space is mapped to membership value
between 0 and 1. Input space is often referred to as the universe of discourse or universal set (u),
which contains all the possible elements of concern in each particular application.

There are largely three types of fuzzifiers:

• Singleton fuzzifier

• Gaussian fuzzifier

• Trapezoidal or triangular fuzzifier

What is Fuzzy Control?

• It is a technique to embody human-like thinkings into a control system.


• It may not be designed to give accurate reasoning but it is designed to give acceptable
reasoning.

• It can emulate human deductive thinking, that is, the process people use to infer conclusions
from what they know.

• Any uncertainties can be easily dealt with the help of fuzzy logic.

Advantages of Fuzzy Logic System

• This system can work with any type of inputs whether it is imprecise, distorted or noisy input
information.

• The construction of Fuzzy Logic Systems is easy and understandable.

• Fuzzy logic comes with mathematical concepts of set theory and the reasoning of that is
quite simple.

• It provides a very efficient solution to complex problems in all fields of life as it resembles
human reasoning and decision-making.

• The algorithms can be described with little data, so little memory is required.

Disadvantages of Fuzzy Logic Systems

• Many researchers proposed different ways to solve a given problem through fuzzy logic
which leads to ambiguity. There is no systematic approach to solve a given problem through
fuzzy logic.

• Proof of its characteristics is difficult or impossible in most cases because every time we do
not get a mathematical description of our approach.

• As fuzzy logic works on precise as well as imprecise data so most of the time accuracy is
compromised.

Application

• It is used in the aerospace field for altitude control of spacecraft and satellites.

• It has been used in the automotive system for speed control, traffic control.

• It is used for decision-making support systems and personal evaluation in the large company
business.

• It has application in the chemical industry for controlling the pH, drying, chemical distillation
process.

• Fuzzy logic is used in Natural language processing and various intensive applications in
Artificial Intelligence.

• Fuzzy logic is extensively used in modern control systems such as expert systems.

• Fuzzy Logic is used with Neural Networks as it mimics how a person would make decisions,
only much faster. It is done by Aggregation of data and changing it into more meaningful
data by forming partial truths as Fuzzy sets.
Difference Between Crisp Set and Fuzzy Set
Crisp Set: Countability and finiteness are identical properties which are the collection objects of crisp
set. ‘X‘ is a crisp set defined as the group of elements present over the universal set i.e. U. In this
case a random element is present that may be a part of X or not that means two ways are possible to
define the set. These are first element would become from set X, or it does not come from X.

Fuzzy Set: The Integration of the elements having a changing degree of membership in the set is
called as fuzzy set. The word “fuzzy” indicates vagueness, On the other hand, we can say that the
replacement among various degrees of the membership implies that the vague and ambiguity of the
fuzzy set. Hence, the measurement of the membership of the elements from the universe in the set
against a function for detecting the uncertainty and ambiguity.

S.No Crisp Set Fuzzy Set

Crisp set defines the value is either 0 Fuzzy set defines the value between 0 and 1
1
or 1. including both 0 and 1.

It specifies the degree to which something is


2 It is also called a classical set.
true.

3 It shows full membership It shows partial membership.

Eg1. She is 18 years old. Eg1. She is about 18 years old.


4
Eg2. Rahul is 1.6m tall Eg2. Rahul is about 1.6m tall.

Crisp set application used for digital


5 Fuzzy set used in the fuzzy controller.
design.

6 It is bi-valued function logic. It is infinite valued function logic

Full membership means totally Partial membership means true to false, yes
7
true/false, yes/no, 0/1. to no, 0 to 1.
Crisp Set

Fuzzy Set

Conclusion:

The part of distinct set theories are fuzzy set and crisp set, where there are no-finite numbers of
logic are implemented in fuzzy set while only two numbers of logic are implemented in crisp set.

Operations on Fuzzy Sets: Theory with Examples


Fuzzy sets extend the concept of classical (crisp) sets by allowing elements to have degrees of
membership, represented by values between 0 and 1. This enables the handling of uncertain or
vague data. Below are some fundamental operations on fuzzy sets.

### 1. **Fuzzy Union (OR operation)**

In classical set theory, the union of two sets involves all elements belonging to either set. In fuzzy set
theory, the degree of membership of an element in the union of two fuzzy sets \( A \) and \( B \) is
the maximum of its degree of membership in each set.

#### Formula:
\[

\mu_{A \cup B}(x) = \max(\mu_A(x), \mu_B(x))

\]

Where:

- \( \mu_A(x) \) is the membership of element \( x \) in fuzzy set \( A \).

- \( \mu_B(x) \) is the membership of element \( x \) in fuzzy set \( B \).

#### Example:

Let \( A \) and \( B \) be two fuzzy sets of "temperature" with membership functions as follows:

- \( A \) (warm): \( \mu_A(20) = 0.2 \), \( \mu_A(30) = 0.6 \), \( \mu_A(40) = 0.8 \)

- \( B \) (hot): \( \mu_B(20) = 0.1 \), \( \mu_B(30) = 0.5 \), \( \mu_B(40) = 0.9 \)

The fuzzy union \( A \cup B \) will have membership values:

- \( \mu_{A \cup B}(20) = \max(0.2, 0.1) = 0.2 \)

- \( \mu_{A \cup B}(30) = \max(0.6, 0.5) = 0.6 \)

- \( \mu_{A \cup B}(40) = \max(0.8, 0.9) = 0.9 \)

### 2. **Fuzzy Intersection (AND operation)**

In classical set theory, the intersection of two sets involves elements that belong to both sets. For
fuzzy sets, the degree of membership of an element in the intersection of two fuzzy sets \( A \) and \(
B \) is the minimum of its membership values in each set.

#### Formula:

\[

\mu_{A \cap B}(x) = \min(\mu_A(x), \mu_B(x))

\]

#### Example:

Using the same fuzzy sets \( A \) and \( B \) from the previous example:
The fuzzy intersection \( A \cap B \) will have membership values:

- \( \mu_{A \cap B}(20) = \min(0.2, 0.1) = 0.1 \)

- \( \mu_{A \cap B}(30) = \min(0.6, 0.5) = 0.5 \)

- \( \mu_{A \cap B}(40) = \min(0.8, 0.9) = 0.8 \)

### 3. **Fuzzy Complement (NOT operation)**

The complement of a fuzzy set represents the "opposite" of the set. The degree of membership of an
element in the complement of a fuzzy set \( A \) is 1 minus the membership value in the original set.

#### Formula:

\[

\mu_{\neg A}(x) = 1 - \mu_A(x)

\]

#### Example:

Let fuzzy set \( A \) be as follows:

- \( \mu_A(20) = 0.2 \)

- \( \mu_A(30) = 0.6 \)

- \( \mu_A(40) = 0.8 \)

The complement \( \neg A \) will have membership values:

- \( \mu_{\neg A}(20) = 1 - 0.2 = 0.8 \)

- \( \mu_{\neg A}(30) = 1 - 0.6 = 0.4 \)

- \( \mu_{\neg A}(40) = 1 - 0.8 = 0.2 \)

### 4. **Fuzzy Difference**


The fuzzy difference of two fuzzy sets \( A \) and \( B \) gives a fuzzy set whose elements are in \( A \)
but not in \( B \).

#### Formula:

\[

\mu_{A - B}(x) = \min(\mu_A(x), 1 - \mu_B(x))

\]

#### Example:

For fuzzy sets \( A \) and \( B \):

The fuzzy difference \( A - B \) will have membership values:

- \( \mu_{A - B}(20) = \min(0.2, 1 - 0.1) = \min(0.2, 0.9) = 0.2 \)

- \( \mu_{A - B}(30) = \min(0.6, 1 - 0.5) = \min(0.6, 0.5) = 0.5 \)

- \( \mu_{A - B}(40) = \min(0.8, 1 - 0.9) = \min(0.8, 0.1) = 0.1 \)

### 5. **Fuzzy Cartesian Product**

The Cartesian product of two fuzzy sets \( A \) and \( B \) is a fuzzy relation \( R \), where each
element \( (x, y) \) has a membership value that is the minimum of the membership values of \( x \)
in \( A \) and \( y \) in \( B \).

#### Formula:

\[

\mu_{R}(x, y) = \min(\mu_A(x), \mu_B(y))

\]

#### Example:

Let:

- \( A \) (temperature): \( \mu_A(30) = 0.5 \), \( \mu_A(40) = 0.8 \)


- \( B \) (humidity): \( \mu_B(20) = 0.7 \), \( \mu_B(30) = 0.6 \)

The fuzzy Cartesian product \( A \times B \) gives the following relation:

- \( \mu_R(30, 20) = \min(0.5, 0.7) = 0.5 \)

- \( \mu_R(30, 30) = \min(0.5, 0.6) = 0.5 \)

- \( \mu_R(40, 20) = \min(0.8, 0.7) = 0.7 \)

- \( \mu_R(40, 30) = \min(0.8, 0.6) = 0.6 \)

### Summary of Operations

1. **Union**: Maximum of membership values.

2. **Intersection**: Minimum of membership values.

3. **Complement**: Subtract membership value from 1.

4. **Difference**: \( \min(\mu_A(x), 1 - \mu_B(x)) \).

5. **Cartesian Product**: \( \min(\mu_A(x), \mu_B(y)) \).

These operations allow fuzzy logic to handle uncertainties in a mathematically precise way, making it
useful in fields like control systems, decision making, and artificial intelligence.

Membership Function
We already know that fuzzy logic is not logic that is fuzzy but logic that is used to describe fuzziness.
This fuzziness is best characterized by its membership function. In other words, we can say that
membership function represents the degree of truth in fuzzy logic.
Following are a few important points relating to the membership function −

• Membership functions were first introduced in 1965 by Lofti A. Zadeh in his first research
paper “fuzzy sets”.

• Membership functions characterize fuzziness (i.e., all the information in fuzzy set), whether
the elements in fuzzy sets are discrete or continuous.

• Membership functions can be defined as a technique to solve practical problems by


experience rather than knowledge.

• Membership functions are represented by graphical forms.

• Rules for defining fuzziness are fuzzy too.

Mathematical Notation

We have already studied that a fuzzy set à in the universe of information U can be defined as a set of
ordered pairs and it can be represented mathematically as −

A˜={(y,μA˜(y))|y∈U}A~={(y,μA~(y))|y∈U}

Here μA˜(∙)μA~(∙) = membership function of A˜A~; this assumes values in the range from 0 to 1,
i.e., μA˜(∙)∈[0,1]μA~(∙)∈[0,1]. The membership function μA˜(∙)μA~(∙) maps UU to the membership
spaceMM.

The dot (∙)(∙) in the membership function described above, represents the element in a fuzzy set;
whether it is discrete or continuous.

Features of Membership Functions

We will now discuss the different features of Membership Functions.

Core

For any fuzzy set A˜A~, the core of a membership function is that region of universe that is
characterize by full membership in the set. Hence, core consists of all those elements yy of the
universe of information such that,

μA˜(y)=1μA~(y)=1

Support

For any fuzzy set A˜A~, the support of a membership function is the region of universe that is
characterize by a nonzero membership in the set. Hence core consists of all those elements yy of the
universe of information such that,

μA˜(y)>0μA~(y)>0

Boundary

For any fuzzy set A˜A~, the boundary of a membership function is the region of universe that is
characterized by a nonzero but incomplete membership in the set. Hence, core consists of all those
elements yy of the universe of information such that,

1>μA˜(y)>01>μA~(y)>0
Fuzzy rule
Fuzzy rules are used within fuzzy logic systems to infer an output based on input variables. Modus
ponens and modus tollens are the most important rules of inference.[1] A modus ponens rule is in the
form

Premise: x is A

Implication: IF x is A THEN y is B

Consequent: y is B

In crisp logic, the premise x is A can only be true or false. However, in a fuzzy rule, the premise x is
A and the consequent y is B can be true to a degree, instead of entirely true or entirely false.[2] This is
achieved by representing the linguistic variables A and B using fuzzy sets.[2] In a fuzzy rule, modus
ponens is extended to generalised modus ponens:.[2]

Premise: x is A*

Implication: IF x is A THEN y is B

Consequent: y is B*

The key difference is that the premise x is A can be only partially true. As a result, the consequent y is
B is also partially true. Truth is represented as a real number between 0 and 1, where 0 is false and 1
is true.

Comparison between Boolean and fuzzy logic rules

[edit]

As an example, consider a rule used to control a three-speed fan. A binary IF-THEN statement may be
then

IF temperature >= 30
THEN fan speed is 3

The disadvantage of this rule is that it uses a strict temperature as a threshold, but the user may
want the fan to still function at this speed when temperature = 29.9. A fuzzy IF-THEN statement may
be

IF temperature is hot

THEN fan speed is fast

where hot and fast are described using fuzzy sets.

Fuzzy rule connectors

[edit]

Rules can connect multiple variables through fuzzy set operations using t-norms and t-conorms.

T-norms are used as an AND connector.[3][4][5] For example,

IF temperature is hot AND humidity is high

THEN fan speed is fast

The degree of truth assigned to temperature is hot and to humidity is high. The result of a t-norm
operation on these two degrees is used as the degree of truth that fan speed is fast.

T-conorms are used as an OR connector.[5] For example,

IF temperature is hot OR humidity is high

THEN fan speed is fast

The result of a t-conorm operation on these two degrees is used as the degree of truth that fan
speed is fast.

The complement of a fuzzy set is used as a negator.[5] For example,

IF temperature is NOT hot

THEN fan speed is slow

The fuzzy set not hot is the complement of hot. The degree of truth assigned to temperature is not
hot is used as the degree of truth that fan speed is slow.

T-conorms are less commonly used as rules can be represented by AND and OR connectors
exclusively.

Fuzzy Inference System (FIS)


A **Fuzzy Inference System (FIS)** is a framework that uses **fuzzy logic** to map inputs to
outputs based on fuzzy sets and linguistic rules. It is the process of formulating mapping from a given
input to an output using fuzzy logic. The mapping provides a basis for decision-making and reasoning
in conditions of uncertainty and vagueness.
Fuzzy inference involves the following key components:

1. **Fuzzification**: Converts crisp inputs into fuzzy values.

2. **Rule Evaluation (Inference)**: Evaluates a set of fuzzy rules.

3. **Aggregation**: Combines the results of the rules.

4. **Defuzzification**: Converts the fuzzy output back to a crisp value.

### **Theory**

#### **Steps in Fuzzy Inference**

1. **Fuzzification**:

- Fuzzification is the process of transforming crisp input values into degrees of membership for
corresponding fuzzy sets. This is done using **membership functions** that represent fuzzy
concepts (e.g., "low", "medium", "high").

2. **Rule Evaluation (Inference)**:

- The core of a FIS is a set of **if-then rules**. These rules are in the form of:

\[

\text{If } x_1 \text{ is } A_1 \text{ and } x_2 \text{ is } A_2, \dots, \text{ then } y \text{ is } B

\]

Where \( x_1, x_2, \dots \) are input variables, \( A_1, A_2, \dots \) are fuzzy sets representing
linguistic terms, and \( B \) is the output fuzzy set.

- Each rule is evaluated by applying **fuzzy logic operations** (AND, OR, NOT) to determine the
degree of truth for the premise. The result is a fuzzy set representing the output.

3. **Aggregation**:

- If more than one fuzzy rule is activated, the results from each rule are combined into a single
fuzzy set. This process is called **aggregation**. In aggregation, the outputs from all rules are
combined using operations like maximum or addition.

4. **Defuzzification**:
- Defuzzification is the process of converting the fuzzy output obtained from the aggregation into a
crisp value. Common defuzzification methods include the **centroid method**, **mean of
maximum**, and **maximum membership** method.

### **Fuzzy Inference Methods**

There are two widely used fuzzy inference methods:

1. **Mamdani Fuzzy Inference**: Proposed by Ebrahim Mamdani in 1975. It uses fuzzy sets for both
inputs and outputs and applies fuzzy operations to evaluate rules.

2. **Sugeno Fuzzy Inference**: Named after Takagi-Sugeno-Kang. It uses fuzzy sets for the inputs but
crisp outputs in the form of a linear function.

### **Example of Fuzzy Inference System**

#### Problem: Fuzzy Control for a Washing Machine

Suppose we are designing a fuzzy control system for a washing machine to determine the **washing
time** based on two inputs: **dirt level** and **cloth load**.

1. **Inputs**:

- Dirt level: Low, Medium, High

- Cloth load: Light, Moderate, Heavy

2. **Output**:

- Washing time: Short, Medium, Long

#### **Step 1: Fuzzification**

We define the fuzzy sets for inputs and outputs using membership functions:

- **Dirt Level**:

- Low (0 - 30% dirt)

- Medium (20 - 70% dirt)

- High (50 - 100% dirt)


- **Cloth Load**:

- Light (0 - 4 kg)

- Moderate (3 - 7 kg)

- Heavy (6 - 10 kg)

- **Washing Time**:

- Short (15 - 30 min)

- Medium (25 - 45 min)

- Long (40 - 60 min)

For example, if the dirt level is 40%, it may partially belong to the "Medium" and "High" fuzzy sets
with membership values \( \mu_{\text{Medium}}(40) = 0.8 \) and \( \mu_{\text{High}}(40) = 0.2 \).

#### **Step 2: Rule Evaluation**

We define a set of fuzzy rules to govern the washing time:

1. **Rule 1**: IF Dirt level is Low AND Cloth load is Light THEN Washing time is Short.

2. **Rule 2**: IF Dirt level is Medium AND Cloth load is Moderate THEN Washing time is Medium.

3. **Rule 3**: IF Dirt level is High AND Cloth load is Heavy THEN Washing time is Long.

Now, suppose the **dirt level is 40%** and the **cloth load is 5 kg**. The degrees of membership
are:

- Dirt level = 40% → Medium (0.8), High (0.2)

- Cloth load = 5 kg → Moderate (0.7), Heavy (0.3)

The **inference engine** evaluates these rules using fuzzy logic. For example, Rule 2 is activated
with \( \mu_{\text{Medium}}(40) = 0.8 \) and \( \mu_{\text{Moderate}}(5) = 0.7 \). The result of Rule
2 is the minimum of these values: \( 0.7 \). Rule 3 is activated with \( \mu_{\text{High}}(40) = 0.2 \)
and \( \mu_{\text{Heavy}}(5) = 0.3 \), resulting in \( 0.2 \).

#### **Step 3: Aggregation**


The outputs from all rules are combined. Suppose:

- Rule 2 gives a medium time with a strength of 0.7.

- Rule 3 gives a long time with a strength of 0.2.

#### **Step 4: Defuzzification**

To convert the fuzzy output to a crisp value, we apply **defuzzification**. Using the **centroid
method**, we calculate the weighted average of the fuzzy outputs, resulting in a crisp washing time
(e.g., 35 minutes).

### **Conclusion**

In this example, the **fuzzy inference system** determines the washing time based on the fuzzy
input variables (dirt level and cloth load) and applies fuzzy rules to infer the appropriate output
(washing time). This approach mimics human reasoning, handling vague and imprecise information
in a flexible way.

Application of Fuzzy Logic in Control Systems

Fuzzy logic has been widely applied in control systems because of its ability to handle
imprecision and uncertainty. Traditional control systems are often based on precise
mathematical models, but fuzzy logic provides a framework for designing controllers using
human-like reasoning, even when system dynamics are not fully known. This makes fuzzy
logic ideal for complex, nonlinear systems where exact models are difficult to obtain.

### **Key Features of Fuzzy Logic Control**

1. **Rule-based control**: Fuzzy logic control relies on a set of "if-then" rules to define the
control strategy.
2. **Handling imprecision**: Unlike conventional control methods, fuzzy logic can work
with imprecise inputs and model uncertainty effectively.
3. **Linguistic variables**: Inputs and outputs are described using linguistic terms (e.g.,
"low," "medium," "high") rather than precise numerical values.
4. **Nonlinear mapping**: Fuzzy logic controllers (FLCs) can handle nonlinear behavior by
capturing it in fuzzy rules.

### **Components of a Fuzzy Logic Control System**

A typical fuzzy logic control system consists of the following parts:


- **Fuzzification**: Converts crisp inputs into fuzzy sets with associated degrees of
membership.
- **Rule base**: Contains a collection of fuzzy "if-then" rules that describe the system’s
behavior.
- **Inference engine**: Evaluates the rules and combines them to generate fuzzy outputs.
- **Defuzzification**: Converts the fuzzy output into a crisp value that can be used to control
the system.

---

### **Applications of Fuzzy Logic in Control Systems**

Fuzzy logic controllers are used in various industrial, consumer, and technological
applications due to their robustness and flexibility.

#### 1. **Temperature Control**

**Example**: Air conditioners and refrigerators.

In air conditioners, fuzzy logic control systems adjust the temperature more efficiently than
traditional controllers. The system takes inputs such as the difference between the desired and
current temperature and adjusts the cooling power based on rules like:
- If the temperature is "slightly high," then the cooling power should be "low."
- If the temperature is "very high," then the cooling power should be "high."

Using fuzzy logic, the controller dynamically adjusts to user preferences and environmental
conditions, providing a more comfortable environment without abrupt changes in
temperature.
#### 2. **Washing Machine Control**

**Example**: Fuzzy logic is widely used in modern washing machines to determine the
washing cycle based on factors like load size, dirt level, and fabric type.

The machine takes inputs like:


- Load weight
- Water turbidity (to assess dirt levels)
- Type of fabric

Fuzzy rules like the following are applied:


- If the load is "heavy" and dirt is "high," set the wash time to "long" and water level to
"high."
- If the load is "light" and dirt is "low," set the wash time to "short" and water level to "low."

By using fuzzy logic, the machine optimizes energy consumption, water usage, and washing
effectiveness.

#### 3. **Automobile Control Systems**

**Example**: Cruise control, automatic braking, and steering control in autonomous


vehicles.

In an autonomous vehicle, fuzzy logic is applied to manage complex driving scenarios where
exact inputs cannot always be predicted. For instance, the system can assess the following
inputs:
- Vehicle speed
- Distance from the car ahead
- Road conditions (wet, dry, etc.)

Fuzzy rules might look like:


- If the car ahead is "very close" and speed is "high," apply "strong braking."
- If the car ahead is "far" and speed is "low," apply "no braking."

Fuzzy logic enables smooth acceleration, braking, and steering, improving safety and comfort
in driving conditions that involve uncertainty.

#### 4. **Robotics**

**Example**: Fuzzy logic is used in robotic control for path planning, obstacle avoidance,
and handling dynamic environments.

In a robotic vacuum cleaner, for example, fuzzy logic helps the robot decide:
- How to navigate around obstacles (e.g., furniture)
- When to increase or decrease speed based on floor type (e.g., carpet vs. tile)

Inputs might include:


- Distance to the nearest obstacle
- Battery level
- Surface type

Fuzzy rules:
- If the obstacle is "very close," then "turn" and "slow down."
- If the battery level is "low," then "return to charging station."

Robots with fuzzy logic can adapt to new environments without requiring a detailed
mathematical model, making them more versatile in unstructured settings.

#### 5. **Traffic Control**

**Example**: Adaptive traffic light control.


Fuzzy logic can be used to control traffic lights based on real-time traffic conditions. Inputs
might include:
- Number of vehicles waiting at the signal
- Time since the light last changed
- Traffic flow on intersecting streets

Fuzzy rules for traffic light control:


- If traffic on the main road is "heavy" and traffic on the side road is "light," keep the light on
the main road "green."
- If traffic on the side road is "heavy," then "switch" the light to green for the side road.

This application leads to reduced traffic congestion and smoother traffic flow without relying
on precise timing intervals.

#### 6. **Industrial Process Control**

**Example**: Chemical reactors, power plants, and manufacturing systems.

In complex industrial processes like controlling the pH level in a chemical reactor, fuzzy
logic controllers handle uncertainties in input variables (temperature, concentration, etc.) to
maintain stability. The fuzzy controller takes inputs such as:
- Current pH level
- Temperature of the mixture
- Concentration of reactants

Fuzzy rules might include:


- If the pH is "too low" and temperature is "high," add a "small amount" of base.
- If the pH is "too high" and temperature is "low," add "no base."

Fuzzy logic helps improve accuracy and safety in industrial applications by dynamically
adjusting the control actions in real time.
---

### **Example of a Fuzzy Logic Control System in Action**

#### **Air Conditioner Example**

- **Inputs**:
- Room temperature (e.g., 28°C)
- Desired temperature (e.g., 24°C)

- **Fuzzy Logic Process**:


- The system determines that the temperature difference is "moderate."
- It evaluates the "if-then" rule: "If the temperature is moderate, then set the cooling power
to medium."

- **Defuzzification**:
- Based on the rules, the system defuzzifies the fuzzy output, setting the cooling power to
60%.

- **Result**:
- The air conditioner operates at 60% power, cooling the room gradually until the desired
temperature is reached, avoiding sudden changes that could lead to discomfort.

---

### **Conclusion**

Fuzzy logic provides a powerful approach for controlling systems that are complex,
nonlinear, or difficult to model mathematically. Its ability to work with linguistic variables
and handle uncertainty makes it suitable for a wide range of real-world applications, from
household appliances to autonomous vehicles and industrial processes. Through fuzzification,
inference, and defuzzification, fuzzy controllers can deliver robust and flexible control
solutions.
Chapter 5
Defuzzification Methods
Fuzzy rule based systems evaluate linguistic if-then rules using fuzzification, inference and composition
procedures. They produce fuzzy results which usually have to be converted into crisp output. To
transform the fuzzy results in to crisp, defuzzification is performed.

Defuzzification is the process of converting a fuzzified output into a single crisp value with respect to a
fuzzy set. The defuzzified value in FLC (Fuzzy Logic Controller) represents the action to be taken in
controlling the process.

Different Defuzzification Methods


The following are the known methods of defuzzification.
 Center of Sums Method (COS)
 Center of gravity (COG) / Centroid of Area (COA) Method
 Center of Area / Bisector of Area Method (BOA)
 Weighted Average Method
 Maxima Methods
o First of Maxima Method (FOM)
o Last of Maxima Method (LOM)
o Mean of Maxima Method (MOM)

Center of Sums (COS) Method


This is the most commonly used defuzzification technique. In this method, the overlapping area is
counted twice.

The defuzzified value is defined as :

∑ . ∑

= ∑ ∑
,

Here, n is the number of fuzzy sets, N is the number of fuzzy variables, μ is the
membership function for the k-th fuzzy set.

Example

1
©Debasis Samanta, Indian Institute of Technology Kharagpur

The defuzzified value is defined as :

∗ ∑
= ∑
,

Here, represents the firing area of rules and k is the total number of rules fired and
represents the center of area.
The aggregated fuzzy set of two fuzzy sets and is shown in Figure 1. Let the area of this two
fuzzy sets are and .
= ½ * [(8-1) + (7-3)] * 0.5 = ½ * 11 * 0.5 = 55/20=2.75
= ½ * [(9-3) + (8-4)] * 0.3 = ½ * 10 * 0.3 = 3/2 =1.5
Now the center of area of the fuzzy set is let say = (7+3)/2= 5 and
the center of area of the fuzzy set is = (8+4)/2=6.
∗ . . . ∗ . ∗
Now the defuzzified value = = = 22.75/4.25 = 5.35
. .

0.5
µ
0.4
A1
0.3

0.2
A2
0.1

0 1 2 3 4 5 6 7 8 9 x

Figure 1 : Fuzzy sets and

Center of gravity (COG) / Centroid of Area (COA) Method


This method provides a crisp value based on the center of gravity of the fuzzy set. The total area
of the membership function distribution used to represent the combined control action is divided
into a number of sub-areas. The area and the center of gravity or centroid of each sub-area is
calculated and then the summation of all these sub-areas is taken to find the defuzzified value for
a discrete fuzzy set.

2
©Debasis Samanta, Indian Institute of Technology Kharagpur

For discrete membership function, the defuzzified value denoted as using COG is defined as:

∗ ∑ .
= ∑
, Here indicates the sample element, μ is

the membership function, and n represents the number of elements in the sample.

For continuous membership function, is defined as :

∗ µ
=
µ

µ 0.5

0.4 2
3
0.3

0.2

0.1 1 4 5

0 1 2 3 4 5 6 7 8 9 x

Figure 2 : Fuzzy sets C1 and C2

Example:

The defuzzified value using COG is defined as:

∗ ∑
= ∑
, Here N indicates the number of sub-areas, and

represents the area and centroid of area, respectively, of sub-area.


In the aggregated fuzzy set as shown in figure 2. , the total area is divided into six sub-areas.
For COG method, we have to calculate the area and centroid of area of each sub-area.
These can be calculated as below.
The total area of the sub-area 1 is ½ * 2 * 0.5 = 0.5
The total area of the sub-area 2 is (7-3) * 0.5 = 4 * 0.5 = 2
The total area of the sub-area 3 is ½ * (7.5-7) * 0.2 = 0.5 * 0.5 *0.2 =.05
The total area of the sub-area 4 is 0.5* 0.3 = .15
The total area of the sub-area 5 is 0.5* 0.3 = .15
The total area of the sub-area 6 is ½ *1* 0.3 = .15
Now the centroid or center of gravity of these sub-areas can be calculated as

3
©Debasis Samanta, Indian Institute of Technology Kharagpur
Centroid of sub-area1 will be (1+3+3)/3 = 7/3 =2.333
Centroid of sub-area2 will be (7+3)/2 = 10/2 = 5
Centroid of sub-area3 will be (7+7+7.5)/3 = 21.5/3 =7.166
Centroid of sub-area4 will be (7+7.5)/2 =14.5/2=7.25
Centroid of sub-are5 will be (7.5+8)/2 =15.5/2 = 7.75
Centroid of sub-area6 will be (8+8+9)/3 = 25/3 = 8.333
Now we can calculate . and is shown in table 1.

Table 1
Sub‐area number Area( ) Centroid of area( ) .
1 0.5 2.333 1.1665
2 02 5 10
3 .05 7.166 0.3583
4 .15 7.25 1.0875
5 .15 7.75 1.1625
6 .15 8.333 1.2499



The defuzzified value will be

. . . . .
=
. . . . .

= (15.0247)/3 =5.008

5.008

Center of Area / Bisector of Area Method (BOA)


This method calculates the position under the curve where the areas on both sides are equal.
The BOA generates the action that partitions the area into two regions with the same area.

μ dx = ∗μ , where α = min {x| x ∈ X} and β = max {x| x ∈ X}

Weighted Average Method


This method is valid for fuzzy sets with symmetrical output membership functions and produces
results very close to the COA method. This method is less computationally intensive. Each
membership function is weighted by its maximum membership value. The defuzzified value is
defined as :

4
©Debasis Samanta, Indian Institute of Technology Kharagpur
∑µ .

= ∑µ
Here ∑ denotes the algebraic summation and x is the element with maximum membership
function.

µ(x)

0.8

0.6

0.4

50 60 70 80 90 100 x

Figure 3: Fuzzy set A

Example:
Let A be a fuzzy set that tells about a student as shown in figure 3 and the elements with
corresponding maximum membership values are also given.
A = {(P, 0.6), (F, 0.4),(G, 0.2),(VG, 0.2), (E, 0)}
Here, the linguistic variable P represents a Pass student, F stands for a Fair student, G
represents a Good student, VG represents a Very Good student and E for an Excellent student.

Now the defuzzified value ∗ for set A will be

∗ ∗ . ∗ . ∗ . ∗ . ∗
=
. . . .
= 98/1.4=70

The defuzzified value for the fuzzy set A with weighted average method represents a Fair
student.

Maxima Methods

5
©Debasis Samanta, Indian Institute of Technology Kharagpur
This method considers values with maximum membership. There are different maxima methods
with different conflict resolution strategies for multiple maxima.
o First of Maxima Method (FOM)
o Last of Maxima Method (LOM)
o Mean of Maxima Method (MOM)

 First of Maxima Method (FOM)


This method determines the smallest value of the domain with maximum membership value.
Example:

The defuzzified value ∗ of the given fuzzy set will be ∗ =4.

µ(x)

1.0

0.8

0.6

0.4

0.2

0 2 4 6 8 10 12 x

 Last of Maxima Method (LOM)


Determine the largest value of the domain with maximum membership value.

In the example given for FOM, the defuzzified value for LOM method will be ∗ = 8

 Mean of Maxima Method (MOM)


In this method, the defuzzified value is taken as the element with the highest membership values.
When there are more than one element having maximum membership values, the mean value of
the maxima is taken.
Let A be a fuzzy set with membership function µ (x) defined over x  X, where X is a universe of

discourse. The defuzzified value is let say of a fuzzy set and is defined as,

6
©Debasis Samanta, Indian Institute of Technology Kharagpur
∑ 

= ,
| |
Here, M = { | μ ( ) is equal to the height of the fuzzy set A} and |M| is the cardinality
of the set M.
Example
In the example as shown in Fig. , x = 4, 6, 8 have maximum membership values and hence
|M| = 3

∑ 

According to MOM method, =
| |

Now the defuzzified value ∗ will be ∗


= = 6.

References:

1. N. Mogharreban and L. F. DiLalla “Comparison of Defuzzification Techniques for Analysis of Non-


interval Data”, IEEE, 06.

2. Jean J. Saade and Hassan B. Diab. “Defuzzification Methods and New Techniques for Fuzzy
Controllers”, Iranian Journal of Electrical and Computer Engineering, 2004.

3. Aarthi Chandramohan, M. V. C. Rao and M. Senthil Arumugam: “Two new and useful
defuzzification methods based on root mean square value”, Soft Computing, 2006.

4. Soft Computing by D.K. Pratihar, Narosa Publication.

7
©Debasis Samanta, Indian Institute of Technology Kharagpur

You might also like