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

Unit-II Fuzzy Logic - CS

Fuzzy systems use fuzzy set theory and fuzzy logic to model the uncertainty of real-world systems. They allow intermediate values between digital ones and zeros. A fuzzy logic system has four main parts: fuzzification transforms crisp inputs into fuzzy sets using membership functions, a knowledge base stores fuzzy rules, an inference engine simulates reasoning, and defuzzification outputs crisp values. An example system adjusts air conditioning temperature based on room temperature and target values using linguistic variables and 5-level fuzzy rules and membership functions.

Uploaded by

Raman Naam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Unit-II Fuzzy Logic - CS

Fuzzy systems use fuzzy set theory and fuzzy logic to model the uncertainty of real-world systems. They allow intermediate values between digital ones and zeros. A fuzzy logic system has four main parts: fuzzification transforms crisp inputs into fuzzy sets using membership functions, a knowledge base stores fuzzy rules, an inference engine simulates reasoning, and defuzzification outputs crisp values. An example system adjusts air conditioning temperature based on room temperature and target values using linguistic variables and 5-level fuzzy rules and membership functions.

Uploaded by

Raman Naam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Unit-2

Fuzzy Systems: Fuzzy set theory: Fuzzy sets


and operations, Membership Functions, Concept
of Fuzzy relations and their composition,
Concept of Fuzzy Measures; Fuzzy Logic:
Fuzzy Rules, Inferencing; Fuzzy Control -
Selection of Membership Functions,
Fuzzyfication, Rule Based Design &
Inferencing, Defuzzyfication.
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.
• 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 −

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


the definite output.
Fuzzy Logic - Classical Set Theory
• A set is an unordered collection of different elements. It can be written
explicitly by listing its elements using the set bracket. If the order of the
elements is changed or any element of a set is repeated, it does not make
any changes in the set.
• Example
• A set of all positive integers.
• A set of all the planets in the solar system.
• A set of all the states in India.
• A set of all the lowercase letters of the alphabet.
• Mathematical Representation of a Set
• Sets can be represented in two ways −
• Roster or Tabular Form
• In this form, a set is represented by listing all the elements comprising it.
The elements are enclosed within braces and separated by commas.
• Following are the examples of set in Roster or Tabular Form −
• Set of vowels in English alphabet, A = {a,e,i,o,u}
• Set of odd numbers less than 10, B = {1,3,5,7,9}
• Set Builder Notation
• In this form, the set is defined by specifying a property that elements
of the set have in common. The set is described as A = {x:p(x)}
• Example 1 − The set {a,e,i,o,u} is written as
• A = {x:x is a vowel in English alphabet}
• Example 2 − The set {1,3,5,7,9} is written as
• B = {x:1 ≤ x < 10 and (x%2) ≠ 0}
• If an element x is a member of any set S, it is denoted by x∈S and if
an element y is not a member of set S, it is denoted by y∉S.
• Example − If S = {1,1.2,1.7,2},1 ∈ S but 1.5 ∉ S
• Cardinality of a Set
• Cardinality of a set S, denoted by |S||S|, is the number of elements of
the set. The number is also referred as the cardinal number. If a set
has an infinite number of elements, its cardinality is ∞∞.
• Example − |{1,4,3,5}| = 4,|{1,2,3,4,5,…}| = ∞
• Types of Sets
• Sets can be classified into many types; some of which are finite,
infinite, subset, universal, proper, singleton set, etc.
• Finite Set
• A set which contains a definite number of elements is called a finite
set.
• Example − S = {x|x ∈ N and 70 > x > 50}
• Infinite Set
• A set which contains infinite number of elements is called an
infinite set.
• Example − S = {x|x ∈ N and x > 10}
• Subset
• A set X is a subset of set Y (Written as X ⊆ Y) if every element of X is
an element of set Y.
• Example 1 − Let, X = {1,2,3,4,5,6} and Y = {1,2}. Here set Y is a
subset of set X as all the elements of set Y is in set X. Hence, we can
write Y⊆X.
• Example 2 − Let, X = {1,2,3} and Y = {1,2,3}. Here set Y is a subset
(not a proper subset) of set X as all the elements of set Y is in set X.
Hence, we can write Y⊆X.
• Proper Subset
• The term “proper subset” can be defined as “subset of but not equal to”. A Set X is
a proper subset of set Y (Written as X ⊂ Y) if every element of X is an element of
set Y and |X| < |Y|.
• Example − Let, X = {1,2,3,4,5,6} and Y = {1,2}. Here set Y ⊂ X, since all
elements in Y are contained in X too and X has at least one element which is more
than set Y.
• Universal Set
• It is a collection of all elements in a particular context or application. All the sets in
that context or application are essentially subsets of this universal set. Universal
sets are represented as U.
• Example − We may define U as the set of all animals on earth. In this case, a set of
all mammals is a subset of U, a set of all fishes is a subset of U, a set of all insects
is a subset of U, and so on.
• Empty Set or Null Set
• An empty set contains no elements. It is denoted by Φ. As the number of elements
in an empty set is finite, empty set is a finite set. The cardinality of empty set or
null set is zero.
• Example – S = {x|x ∈ N and 7 < x < 8} = Φ
• Singleton Set or Unit Set
• A Singleton set or Unit set contains only one element. A singleton set is denoted by
{s}.
• Example − S = {x|x ∈ N, 7 < x < 9} = {8}
• Equal Set
• If two sets contain the same elements, they are said to be equal.
• Example − If A = {1,2,6} and B = {6,1,2}, they are equal as every
element of set A is an element of set B and every element of set B is
an element of set A.
• Equivalent Set
• If the cardinalities of two sets are same, they are called equivalent
sets.
• Example − If A = {1,2,6} and B = {16,17,22}, they are equivalent
as cardinality of A is equal to the cardinality of B. i.e. |A| = |B| = 3
Operations on Classical Sets
• Set Operations include Set Union, Set Intersection, Set Difference,
Complement of Set, and Cartesian Product.
• Union
• The union of sets A and B (denoted by A ∪ BA ∪ B) is the set of elements
which are in A, in B, or in both A and B. Hence, A ∪ B = {x|x ∈ A OR x ∈ B}.
• Example − If A = {10,11,12,13} and B = {13,14,15}, then A ∪ B =
{10,11,12,13,14,15} – The common element occurs only once.
• Intersection
• The intersection of sets A and B (denoted by A ∩ B) is the set of elements
which are in both A and B. Hence, A ∩ B = {x|x ∈ A AND x ∈ B}.

Complement of a Set
The complement of a set A (denoted by A′) is the set of elements which
are not in set A. Hence, A′ = {x|x ∉ A}.
More specifically, A′ = (U−A) where U is a universal set which contains
all objects.
Example − If A = {x|x belongs to set of add integers} then A′ = {y|y does
not belong to set of odd integers}
• Cartesian Product / Cross Product
• The Cartesian product of n number of sets A1,A2,…An denoted as A1 ×
A2...× An can be defined as all possible ordered pairs (x1,x2,…xn) where
x1 ∈ A1,x2 ∈ A2,…xn ∈ An
• Example − If we take two sets A = {a,b} and B = {1,2},
• The Cartesian product of A and B is written as − A × B =
{(a,1),(a,2),(b,1),(b,2)}
• And, the Cartesian product of B and A is written as − B × A =
{(1,a),(1,b),(2,a),(2,b)}
• Why 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
• It has four main parts as shown −
• Fuzzification Module − It transforms the system inputs,
which are crisp numbers, into fuzzy sets. It splits the input
signal into five steps such as
• Knowledge Base − It stores IF-THEN rules provided by experts.
• Inference Engine − It simulates the human reasoning process by making
fuzzy inference on the inputs and IF-THEN rules.
• Defuzzification Module − It transforms the fuzzy set obtained by the
inference engine into a crisp value.
• The membership functions work on fuzzy sets of variables.
• Membership Function
• Membership functions allow you to quantify linguistic term and
represent a fuzzy set graphically. A membership function for a
fuzzy set A on the universe of discourse X is defined as μA:X →
[0,1].
• Here, each element of X 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 X to the fuzzy set A.
• x axis represents the universe of discourse.
• y axis represents the degrees of membership in the [0, 1] interval.
• 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.
• All membership functions for LP, MP, S, MN, and LN are shown as
below −
The triangular membership function shapes are most common among
various other membership function shapes such as trapezoidal,
singleton, and Gaussian.
Here, the input to 5-level fuzzifier varies from -10 volts to +10 volts.
Hence the corresponding output also changes.
• Example of a Fuzzy Logic System
• Let us consider an air conditioning system with 5-level fuzzy
logic system. This system adjusts the temperature of air
conditioner by comparing the room temperature and the target
temperature value.
• 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)
• 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.
• Temperature (t) = {very-cold, cold, warm, very-warm, hot}
• Every member of this set is a linguistic term and it can cover
some portion of overall temperature values.
• Step 2 − Construct membership functions for them
• The membership functions of temperature variable are as shown

• Step3 − Construct knowledge base rules
• Create a matrix of room temperature values versus target
temperature values that an air conditioning system is expected
to provide.
• Build a set of rules into the knowledge base in the form of IF-
THEN-ELSE structures.

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.
Step 5 − Perform defuzzification
Defuzzification is then performed according to membership
function for output variable.
Application Areas of Fuzzy Logic
• The key application areas of fuzzy logic are as given −
• Automotive Systems
• Automatic Gearboxes
• Four-Wheel Steering
• Vehicle environment control
• Consumer Electronic Goods
• Hi-Fi Systems
• Photocopiers
• Still and Video Cameras
• Television
• Domestic Goods
• Microwave Ovens
• Refrigerators
• Toasters
• Vacuum Cleaners
• Washing Machines
• Environment Control
• Air Conditioners/Dryers/Heaters
• Humidifiers
• Advantages of FLSs
• 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 FLSs
• 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.
• Fuzzy Logic - Inference System
• Fuzzy Inference System is the key unit of a fuzzy logic
system having decision making as its primary work. It uses the
“IF…THEN” rules along with connectors “OR” or “AND” for
drawing essential decision rules.

Characteristics of Fuzzy Inference System


• Following are some characteristics of FIS −
• The output from FIS is always a fuzzy set irrespective of its
input which can be fuzzy or crisp.
• It is necessary to have fuzzy output when it is used as a
controller.
• A defuzzification unit would be there with FIS to convert fuzzy
variables into crisp variables.
• Functional Blocks of FIS
• The following five functional blocks will help you understand the construction of
FIS −
• Rule Base − It contains fuzzy IF-THEN rules.
• Database − It defines the membership functions of fuzzy sets used in fuzzy rules.
• Decision-making Unit − It performs operation on rules.
• Fuzzification Interface Unit − It converts the crisp quantities into fuzzy quantities.
• Defuzzification Interface Unit − It converts the fuzzy quantities into crisp
quantities. Following is a block diagram of fuzzy interference system.
• Working of FIS
• The working of the FIS consists of the following steps −
• A fuzzification unit supports the application of numerous fuzzification
methods, and converts the crisp input into fuzzy input.
• A knowledge base - collection of rule base and database is formed upon the
conversion of crisp input into fuzzy input.
• The defuzzification unit fuzzy input is finally converted into crisp output.
• Methods of FIS
• Let us now discuss the different methods of FIS. Following are the two
important methods of FIS, having different consequent of fuzzy rules −
• Mamdani Fuzzy Inference System
• Takagi-Sugeno Fuzzy Model (TS Method)
• Mamdani Fuzzy Inference System
• This system was proposed in 1975 by Ebhasim Mamdani. Basically,
it was anticipated to control a steam engine and boiler combination
by synthesizing a set of fuzzy rules obtained from people working
on the system.
• Steps for Computing the Output
• Following steps need to be followed to compute the output from this
FIS −
• Step 1 − Set of fuzzy rules need to be determined in this step.
• Step 2 − In this step, by using input membership function, the input
would be made fuzzy.
• Step 3 − Now establish the rule strength by combining the fuzzified
inputs according to fuzzy rules.
• Step 4 − In this step, determine the consequent of rule by combining
the rule strength and the output membership function.
• Step 5 − For getting output distribution combine all the
consequents.
• Step 6 − Finally, a defuzzified output distribution is obtained.
Takagi-Sugeno Fuzzy Model (TS Method)
This model was proposed by Takagi, Sugeno and Kang in
1985. Format of this rule is given as −
IF x is A and y is B THEN Z = f(x,y)
Here, AB are fuzzy sets in antecedents and z = f(x,y) is a crisp
function in the consequent.
• Fuzzy Inference Process
• The fuzzy inference process under Takagi-Sugeno Fuzzy Model (TS
Method) works in the following way −
• Step 1: Fuzzifying the inputs − Here, the inputs of the system are made
fuzzy.
• Step 2: Applying the fuzzy operator − In this step, the fuzzy operators must
be applied to get the output of the Sugeno Form
• The rule format of Sugeno form is given by −
if 7 = x and 9 = y then output is z = ax+by+c
• Comparison between the two methods
• Let us now understand the comparison between the Mamdani System and
the Sugeno Model.
• Output Membership Function − The main difference
between them is on the basis of output membership
function. The Sugeno output membership functions are
either linear or constant.
• Aggregation and Defuzzification Procedure − The
difference between them also lies in the consequence
of fuzzy rules and due to the same their aggregation
and defuzzification procedure also differs.
• Mathematical Rules − More mathematical rules exist
for the Sugeno rule than the Mamdani rule.
• Adjustable Parameters − The Sugeno controller has
more adjustable parameters than the Mamdani
controller.
Fuzzy Logic - Control System
• Fuzzy logic is applied with great success in various control
application. Almost all the consumer products have fuzzy control.
Some of the examples include controlling your room temperature
with the help of air-conditioner, anti-braking system used in
vehicles, control on traffic lights, washing machines, large economic
systems, etc.

• Why Use Fuzzy Logic in Control Systems


• A control system is an arrangement of physical components
designed to alter another physical system so that this system exhibits
certain desired characteristics. Following are some reasons of using
Fuzzy Logic in Control Systems −
• While applying traditional control, one needs to know about the
model and the objective function formulated in precise terms. This
makes it very difficult to apply in many cases.
• By applying fuzzy logic for control we can utilize the human
expertise and experience for designing a controller.
• The fuzzy control rules, basically the IF-THEN rules, can be best
utilized in designing a controller.
Assumptions in Fuzzy Logic Control (FLC)
Design
• While designing fuzzy control system, the following six basic
assumptions should be made −
• The plant is observable and controllable − It must be assumed that
the input, output as well as state variables are available for
observation and controlling purpose.
• Existence of a knowledge body − It must be assumed that there
exist a knowledge body having linguistic rules and a set of input-
output data set from which rules can be extracted.
• Existence of solution − It must be assumed that there exists a
solution.
• ‘Good enough’ solution is enough − The control engineering must
look for ‘good enough’ solution rather than an optimum one.
• Range of precision − Fuzzy logic controller must be designed within
an acceptable range of precision.
• Issues regarding stability and optimality − The issues of stability
and optimality must be open in designing Fuzzy logic controller
rather than addressed explicitly.
Architecture of Fuzzy Logic Control
• Major Components of FLC
• Followings are the major components of the FLC as shown in the
above figure −
• Fuzzifier − The role of fuzzifier is to convert the crisp input values
into fuzzy values.
• Fuzzy Knowledge Base − It stores the knowledge about all the
input-output fuzzy relationships. It also has the membership
function which defines the input variables to the fuzzy rule base
and the output variables to the plant under control.
• Fuzzy Rule Base − It stores the knowledge about the operation of
the process of domain.
• Inference Engine − It acts as a kernel of any FLC. Basically it
simulates human decisions by performing approximate reasoning.
• Defuzzifier − The role of defuzzifier is to convert the fuzzy values
into crisp values getting from fuzzy inference engine.
• Steps in Designing FLC
• Following are the steps involved in designing FLC −
• Identification of variables − Here, the input, output and state variables must be
identified of the plant which is under consideration.
• Fuzzy subset configuration − The universe of information is divided into number
of fuzzy subsets and each subset is assigned a linguistic label. Always make sure
that these fuzzy subsets include all the elements of universe.
• Obtaining membership function − Now obtain the membership function for each
fuzzy subset that we get in the above step.
• Fuzzy rule base configuration − Now formulate the fuzzy rule base by assigning
relationship between fuzzy input and output.
• Fuzzification − The fuzzification process is initiated in this step.
• Combining fuzzy outputs − By applying fuzzy approximate reasoning, locate the
fuzzy output and merge them.
• Defuzzification − Finally, initiate defuzzification process to form a crisp output.
• Advantages of Fuzzy Logic Control
• Let us now discuss the advantages of Fuzzy Logic Control.
• Cheaper − Developing a FLC is comparatively cheaper than developing
model based or other controller in terms of performance.
• Robust − FLCs are more robust than PID controllers because of their
capability to cover a huge range of operating conditions.
• Customizable − FLCs are customizable.
• Emulate human deductive thinking − Basically FLC is designed to
emulate human deductive thinking, the process people use to infer
conclusion from what they know.
• Reliability − FLC is more reliable than conventional control system.
• Efficiency − Fuzzy logic provides more efficiency when applied in control
system.
• Disadvantages of Fuzzy Logic Control
• We will now discuss what are the disadvantages of Fuzzy Logic Control.
• Requires lots of data − FLC needs lots of data to be applied.
• Useful in case of moderate historical data − FLC is not useful for
programs much smaller or larger than historical data.
• Needs high human expertise − This is one drawback as the accuracy of
the system depends on the knowledge and expertise of human beings.
• Needs regular updating of rules − The rules must be updated with time.

You might also like