You are on page 1of 54

FUZZY LOGIC

Amit Raj Satyal Bigyan Sapkota Krishna Paudyal Simon Shrestha Subash Paudyal
14 February 2012

Todays Contents 1
2 3 4
Overview of Fuzzy Logic Fuzzy Sets and Operations Fuzzy Variables

Fuzzy Example
Applications and Conclusion

Overview of Fuzzy Logic


- Amit Raj Satyal (Roll No: 01)

Origin
Traces back to Ancient Greece Lotfi Asker Zadeh ( 1965 )
First to publish ideas of fuzzy logic. Professor from UC, Berkeley to model the uncertainty of Natural Language.

Professor Toshire Terano ( 1972 )


Organized the world's first working group on fuzzy systems.

F.L. Smidth & Co. ( 1980 )


First to market fuzzy expert systems.

Introduction
What is Fuzzy logic?
Fuzzy logic is a superset of conventional(Boolean) logic that has been extended to handle the concept of partial truth- truth values between "completely true" and "completely false". A way to represent variation or imprecision in logic A way to make use of natural language in logic Notions like rather warm or pretty cold can be formulated mathematically and processed by computers a means to model the uncertainty of NL

Fuzzy logic is an attempt to combine the two techniques.

Characteristics
In fuzzy logic, exact reasoning is viewed as a limiting case of approximate reasoning. In fuzzy logic everything is a matter of degree. Any logical system can be fuzzified In fuzzy logic, knowledge is interpreted as a collection of elastic or, equivalently , fuzzy constraint on a collection of variables Inference is viewed as a process of propagation of elastic constraints.

Voice from Expert - Rhineharts


He says You take a bite out of the apple. Is it still an apple? You take another bite out of the apple. Now, is it still an apple? And another bite. And then, another bite. At some point, people will no longer perceive it as an apple. Fuzzy logic can represent this process, It becomes less of an apple as you move along. Fuzzy logic can assign percentages of belongingness to the process. Its not a digital sort of situation where its either a one (1) or a zero (0). Its either an apple, or its not.'
Heads the chemical engineering school at Oklahoma State University.

Fuzzy Sets and Operation


- Bigyan Sapkota (Roll No. 03)

Fuzzy sets
Conventional Sets A set is any collection of objects which can be treated as a whole. Example: The set of non-integer Fuzzy sets: Following Zadeh many sets have more than an eitheror criterion for membership. Take example the set of young people. A one year old baby clearly be a member of set, and a 100 years old person will not be a member of this set, But what about people at the age of 20,30, and 40 years?

Contd..
Zadeh proposed a grade of membership, such that the transition from membership to non-membership is gradual rather than abrupt. An items grade of membership is normally a real number between 0 and 1, denoted by . The grade of membership for all its members thus describes a fuzzy sets. Example: Ram ate X eggs for breakfast where XU= (1,2,38) U= [ 1 2 3 4 5 6 7 8] =[1 1 1 1 .8 .6 .4 .2]

Membership Functions
The function that ties a number to each element { of the universe is called the membership function

Temp: {Freezing, Cool, Warm, Hot} Degree of Truth or "Membership"


1 Freezing Cool Warm Hot

0 10 30 50
Fuzzy Logic Temp.

70 (F)

90

110
11

Example Membership Functions


How cool is 36 F ?

Freezing

Cool

Warm

Hot

0 10 30 50 70 90 110 Temp. (F)


Fuzzy Logic 12

Membership Functions
How cool is 36 F ? It is 30% Cool and 70% Freezing
1 Freezing Cool Warm Hot

0.7

0.3
0 10 30 50 70 90 110 Temp. (F)
Fuzzy Logic 13

Fuzzy logic connectives


Fuzzy Conjunction, Fuzzy Disjunction, Fuzzy negation, p if then if and only if

Operate on degrees of membership in fuzzy sets


Fuzzy Logic 14

Fuzzy Disjunction
AB max(A, B) AB = C "Quality C is the disjunction of Quality A and B"
A
1 1 0.75

0.375

(AB = C) (C = 0.75)
Fuzzy Logic 15

Fuzzy Conjunction
AB min(A, B) AB = C "Quality C is the conjunction of Quality A and B"
A
1 1 0.75

0.375

(AB = C) (C = 0.375)
Fuzzy Logic 16

Example: Fuzzy Conjunction


Calculate AB given that A is .4 and B is 20
A
1 1

.1 .2 .3 .4 .5 .6 .7 .8 .9

1 5 10 15 20 25 30 35 40

Fuzzy Logic

17

Example: Fuzzy Conjunction


Calculate AB given that A is .4 and B is 20
A
1 1

.1 .2 .3 .4 .5 .6 .7 .8 .9

1 5 10 15 20 25 30 35 40

Determine degrees of membership:

Fuzzy Logic

18

Example: Fuzzy Conjunction


Calculate AB given that A is .4 and B is 20
A
1 1

0.7

.1 .2 .3 .4 .5 .6 .7 .8 .9

1 5 10 15 20 25 30 35 40

Determine degrees of membership: A = 0.7

Fuzzy Logic

19

Example: Fuzzy Conjunction


Calculate AB given that A is .4 and B is 20
A
1 1

0.9 0.7

.1 .2 .3 .4 .5 .6 .7 .8 .9

1 5 10 15 20 25 30 35 40

Determine degrees of membership: A = 0.7 B = 0.9

Fuzzy Logic

20

Example: Fuzzy Conjunction


Calculate AB given that A is .4 and B is 20
A
1 1

0.9 0.7

.1 .2 .3 .4 .5 .6 .7 .8 .9

1 5 10 15 20 25 30 35 40

Determine degrees of membership: A = 0.7 B = 0.9 Apply Fuzzy AND AB = min(A, B) = 0.7

Fuzzy Logic

21

For the instance

Proposition
Student of NCIT are happy Teachers of NCIT are happy

Truth value
0.8 0.4

It means student are happy most of the time It means teacher are happy slightly less than half of their time.

Fuzzy Logic

22

Truth value of Negation of propositon in Fuzzy logic:


1 minus the truth value of propostion

Example : what is the truth value of statement

Negation of Proposition

Truth value

Student of NCIT are not happy Teachers of NCIT are happy

1- 0.8 = 0.2 1-0.4 = 0.6

Fuzzy Logic

23

Fuzzy Variables
- Krishna Prasad Paudel (Roll No. 11)

Linguistic variable
Just like an algebraic variable takes numbers as values, a linguistic variable takes words or sentences as values (Zadeh in Zimmermann, 1991). set of values that it can take is called its term set. Each value in the term set is a Fuzzy variable defined over a base variable

Contd
Linguistic variable->Fuzzy variable->base variable Example: Tank example If the level is low Here, Low is a fuzzy variable, and defined with degree of membership [0,1] a value of the linguistic variable is level {high,low)

Contd..
Fuzzy linguistic terms often consist of two parts: 1.Fuzzy predicate (primary term) If the set defining the predicates of individual is a fuzzy set, the predicate is called a fuzzy Predicate Example z is expensive. w is young. Terms expensive and young are fuzzy terms. So, the sets expensive(z) and young(w) are fuzzy sets When a fuzzy predicate x is P is given, we can interpret it P(x) is a fuzzy set. The membership degree of x in the set P is defined by the membership function P(x)
Example: expensive, old, rare, dangerous, good, etc.

2. Modifiers
It is an operation that modifies the meaning of a term Example: The sentence very close to 0, the word very modifies Close to 0 which is a fuzzy set. very, likely, almost impossible, extremely unlikely, etc
A new term can be obtained when we add a modifier very to a primary term
very young(u) = (young(u))2

Logic Process
n

Fuzzy Example
- Simon Shrestha (Roll No. 26)

Fuzzy Control
Fuzzy Control combines the use of fuzzy linguistic variables with fuzzy logic Example: Speed Control How fast am I going to drive today? It depends on the weather. Disjunction of Conjunctions

Fuzzy Logic

31

Inputs: Temperature
Temp: {Freezing, Cool, Warm, Hot}

Freezing

Cool

Warm

Hot

0 10 30 50 70 90 110 Temp. (F)

Fuzzy Logic

32

Inputs: Temperature, Cloud Cover


Temp: {Freezing, Cool, Warm, Hot}
1 Freezing Cool Warm Hot

0 10 30 50 70 90 110 Temp. (F)

Cover: {Sunny, Partly, Overcast}


1 Sunny Partly Cloudy Overcast

0 0 20 40 60 80 100 Cloud Cover (%)

Fuzzy Logic

33

Output: Speed
Speed: {Slow, Fast}
1 Slow Fast

0 0 25 50 75 100 Speed (mph)

Fuzzy Logic

34

Rules
If it's Sunny and Warm, drive Fast
Sunny(Cover)Warm(Temp) Fast(Speed)

If it's Cloudy and Cool, drive Slow


Cloudy(Cover)Cool(Temp) Slow(Speed)

Driving Speed is the combination of output of these rules...


Fuzzy Logic 35

Speed Calculation
How fast will I go if it is
65 F 25 % Cloud Cover ?

Steps Involved
Fuzzification Calculation Defuzzification

Fuzzification
65 F Cool = 0.4, Warm= 0.7
1 Freezing Cool Warm Hot

0 10 30 50 70 90 110 Temp. (F)

Fuzzification
25% Cover Sunny = 0.8, Cloudy = 0.2
1 Sunny Partly Cloudy Overcast

0 0 20 40 60 80 100 Cloud Cover (%)

Calculation
If it's Sunny and Warm, drive Fast Sunny(Cover)Warm(Temp)Fast(Speed) 0.8 0.7 = 0.7 Fast = 0.7 If it's Cloudy and Cool, drive Slow Cloudy(Cover)Cool(Temp)Slow(Speed)

0.2 0.4 = 0.2 Slow = 0.2

Defuzzification
Speed is 20% Slow and 70% Fast
1 Slow Fast

0 0 25 50 75 100 Speed (mph)

Find centroids where membership is 100%


1 Slow Fast

0 0 25 50 75 100 Speed (mph)

Defuzzification
Speed = weighted mean = (2*25+...
1 Slow Fast

0 0 25 50 75 100 Speed (mph)

Speed

= (2*25+7*75)/(9) = 63.8 mph


1 Slow Fast

0 0 25 50 75 100 Speed (mph)

Fuzzy Applications
- Subash Paudyal

Applications
Industrial control Quality control Elevator control and scheduling Train control Traffic control Loading crane control Reactor control Automobile transmissions Automobile climate control

Applications
Automobile body painting control Automobile engine control Paper manufacturing Steel manufacturing Power distribution control Software engineering Expert systems Operation research Decision analysis

Applications
Financial engineering Assessment of credit-worthiness Fraud detection22.Mine detection Pattern classification Oil exploration Geology Civil Engineering Chemistry Mathematics Medicine Biomedical instrumentation Health-care products

Rule Base
Air Temperature
Set cold {50, 0, 0} Set cool {65, 55, 45} Set just right {70, 65, 60} Set warm {85, 75, 65} Fan Speed Set hot {, 90, 80} Set stop {30, 0, 0} Set slow {50, 30, 10} Set medium {60, 50, 40} Set fast {90, 70, 50} Set blast {, 100, 80}

Rules
Air Conditioning Controller Example:
IF Cold then Stop If Cool then Slow If OK then Medium If Warm then Fast IF Hot then Blast

Fuzzy Air Conditioner


0 100 90 80 70 60 50 40 30 20 10 0 if Cold then Stop

s Bla

If Hot then Blast If Warm then Fast

Fa st

Med ium

If Just Right then Medium IF Cool then Slow

Slo w

Co ol

0 45 50 55 60 65 70 75 80 85 90

Jus Rig t ht

Ho t

ar

o St p
1

Co ld

Mapping Inputs to Outputs


1 0 100 90 80 70 60

st Bla

Fa s

Med iu
50 40 30 20 10 0

Sl

ow

ol

0 45 50 55 60 65 70 75 80 85 90

Jus Rig t ht

W ar

Co

Ho

o St p
1

Co ld

Ongoing Research
Hybrid Intelligent Systems.

Drawbacks
Requires tuning of membership functions Fuzzy Logic control may not scale well to large or complex problems Deals with imprecision, and vagueness, but not uncertainty

Summary
Provides way to calculate with imprecision and vagueness Used to represent some kinds of human expertise Provides an alternative way to represent linguistic and subjective attributes of the real world in computing. Able to be applied to control systems and other applications in order to improve the efficiency and simplicity of the design process.

REFERENCES
Fuzzy Logic - Making Inferences with Imprecise
Concepts

http://aaai.org/AITopics/FuzzyLogic Fuzzy Logic From wikipedia http://en.wikipedia.org/wiki/Fuzzy_logic This slide deck and related resources: <hyperlink here>

QUESTIONS?

You might also like