fuzzy mathematics:an application oriented introduction

329
N.B. Venkateswawrlu AITAM, Tekkali www.ritchcenter.com/nbv [email protected] Formerly at U. of Leeds, UK Also, at BITS, Pilani Fuzzy Mathematics : An application Oriented introduction

Upload: nagasuri-bala-venkateswarlu

Post on 26-Jan-2017

617 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Fuzzy mathematics:An application oriented introduction

N.B. Venkateswawrlu AITAM, Tekkaliwww.ritchcenter.com/[email protected] at U. of Leeds, UKAlso, at BITS, Pilani

Fuzzy Mathematics : An application Oriented introduction

Page 2: Fuzzy mathematics:An application oriented introduction

Thanks a lot for Inviting.

Page 3: Fuzzy mathematics:An application oriented introduction

I am not a Mathematician!!!.I am an Engineering teacher.

Page 4: Fuzzy mathematics:An application oriented introduction

Thus, my talk will be more application oriented!!!. Of course, I am a great Mathematics fan.

Page 5: Fuzzy mathematics:An application oriented introduction

Rather, I can say that I am that group of people who supports practical, example based illustrated teaching. This lecture series is also to request you, Mathematics teachers to explore the possibility of teaching with Engineering examples.

Page 6: Fuzzy mathematics:An application oriented introduction

What am I going to cover?• Introduction and background.• Fuzzy Sets.• Simple Fuzzy Mathematical

operations• Fuzzy Relations.• How to design a Fuzzy control

system?• More Practical Fuzzy Control

examples.

Page 7: Fuzzy mathematics:An application oriented introduction

Do forgive me for not using standardized notations in the presentation.

Page 8: Fuzzy mathematics:An application oriented introduction

The syllabus of your course seems to be too fuzzy!!!!.

A simple satire, do take it in light manner.

Page 9: Fuzzy mathematics:An application oriented introduction

Traditional (Crisp) logicIn 300 B.C. Aristotle formulated the law of the excluded middle, which is now the principle foundation of mathematics.

X must be in a set of A or in a set of not A. In logic, the law of

excluded middle says that a proposition can be either true or false.

Page 10: Fuzzy mathematics:An application oriented introduction

Classical sets

Classical sets are also called crisp (sets). Ex: A = {apples, oranges, cherries,

mangoes} A = {a1,a2,a3 } A = {2, 4, 6, 8, …} Mathematically: A = {x | x is an even natural

number} A = {x | x = 2n, n is a natural

number} Membership or characteristic function

AxAxxA if 0

if 1)(

Page 11: Fuzzy mathematics:An application oriented introduction

Crisp (Traditional) Variables• Crisp variables represent precise

quantities:– x = 3.1415296– A {0,1}

• A proposition is either True or False– A B C

• King(Richard) Greedy(Richard) Evil(Richard)

• Richard is either greedy or he isn't:– Greedy(Richard) {0,1}

29

Page 12: Fuzzy mathematics:An application oriented introduction

Is rose is RED? Is rose is not RED?.

Is rose is not RED?.

Traditional (crisp) logic

Page 13: Fuzzy mathematics:An application oriented introduction

Traditional (crisp) logic

What about this rose?. Is rose is not RED?.

Page 14: Fuzzy mathematics:An application oriented introduction

What color is this leopard?

Page 15: Fuzzy mathematics:An application oriented introduction

Is this glass full or empty?

Page 16: Fuzzy mathematics:An application oriented introduction

Where do tall people start?

A tall guy

Page 17: Fuzzy mathematics:An application oriented introduction

Crisp

Page 18: Fuzzy mathematics:An application oriented introduction

Crisp

Are bowls having oranges?.

Page 19: Fuzzy mathematics:An application oriented introduction

Fuzzy

Are bowls are full of Apples?.

Page 20: Fuzzy mathematics:An application oriented introduction

Thus, fuzzy can be said as imprecise or not clear cut.

Page 21: Fuzzy mathematics:An application oriented 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".

Page 22: Fuzzy mathematics:An application oriented introduction

What is fuzzy logic?A type of logic that recognizes more than simple true and false values. With fuzzy logic, propositions can be represented with degrees of truthfulness and falsehood. For example, the statement, today is sunny, might be 100% true if there are no clouds, 80% true if there are a few clouds, 50% true if it's hazy and 0% true if it rains all day. Fuzzy logic has proved to be particularly useful in expert system and other artificial intelligence applications. It is also used in some spell checkers to suggest a list of probable words to replace a misspelled one.

Page 23: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic “ A form of knowledge representation suitable for notions that cannot be defined precisely, but which depend upon their context. It enables computerized devices to reason more like humans”

Page 24: Fuzzy mathematics:An application oriented introduction

Classical Set (Crisp)• Contain objects that satisfy precise

properties of membership.– Example: Set of heights from 5 to 7

feet

5 6 7 X (height)

c (x) = {A

1 x є A0 x є A

0

1Characteristic Function

Page 25: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets as Possibility Measure

modeling-parameter

Degree of membership to a fuzzy set

1

0

certainly possible values

certainly not possible values

as for known analytical models

more or less possible values

Crisp means,exactly known parameter value, e. g.:

13.21345678953142........

- 3 -

Page 26: Fuzzy mathematics:An application oriented introduction

An example to elucidate possibility (not probability).• Probability is based on chance• Possibility is based on similarity.

Fuzzy set theory is around this.• Take an example where you are in

midst of a desert and thirsty. You found to bottles of water with two ratings on them, probability of good water and possibility of good water. Ratings of first bottle:0.9,0.5 while second bottle is:0.5,0.9. Which one do you pick up and drink and survive?

Page 27: Fuzzy mathematics:An application oriented introduction

Fuzzy Set• Contain objects that satisfy

imprecise properties of membership– Example : The set of heights in the

region around 6 feet

5 6 7 X (height)

(x)є {0-1}A

0

1Membership Function

Page 28: Fuzzy mathematics:An application oriented introduction

Some More Membership functions (figure from Klir&Yuan)

Page 29: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets• What if Richard is only some

what greedy?

• Fuzzy Sets can represent the degree to which a quality is possessed.

• Fuzzy Sets (Simple Fuzzy Variables) have values in the range of [0,1]

• Greedy(Richard) = 0.7 • Question: How evil is

Richard?

Page 30: Fuzzy mathematics:An application oriented introduction

Fuzzy sets: Linguistic Variables• Fuzzy Linguistic Variables are

used to represent qualities spanning a particular spectrum

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

• Membership Function• Question: What is the

temperature?• Answer: It is warm.• Question: How warm is it?

Page 31: Fuzzy mathematics:An application oriented introduction

• Directions For soup preparation: • 1. Empty contents into saucepan;

add 4½ cups (1 L) cold water. • 2. Bring to a boil, stirring

constantly. • 3. Reduce heat; partially cover and

simmer for 15 minutes, stirring occasionally.

Fuzzy Linguistic Variables

Page 32: Fuzzy mathematics:An application oriented introduction

Linguistic variables: Our report to the physician.• High fever • frequent coughing.• Shaking,• Too chilling• Hardly, I can move

Page 33: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic: Motivations• Alleviate difficulties in developing

and analyzing complex systems encountered by conventional mathematical tools.

• Observing that human reasoning can utilize concepts and knowledge that do not have well-defined, sharp boundaries.

Page 34: Fuzzy mathematics:An application oriented introduction
Page 35: Fuzzy mathematics:An application oriented introduction
Page 36: Fuzzy mathematics:An application oriented introduction

Representing Age• Fuzzy sets can be used to represent fuzzy concepts. Let U be a

reasonable age interval of human beings.• U = {0, 1, 2, 3, ... , 100}• Solution 2-1. This interval can be interpreted with fuzzy sets by

setting the universal space for age to range from 0 to 100.• Assume that the concept of "young" is represented by a fuzzy

set Young, whose membership function is given by the following fuzzy set.

• The concept of "old" can also be represented by a fuzzy set, Old, whose membership function could be defined in the following way.

• We define the concept of middle-aged to be neither young nor old. We do this by using fuzzy operators from Fuzzy Logic.

• We can find a fuzzy set to represent the concept of middle-aged by taking the intersection of the complements of our Young and Old fuzzy sets.

• We can now see a graphical interpretation of our age descriptors. From the graph, you can see that the intersection of "not young" and "not old" gives a reasonable definition for the concept of "middle-aged."

Page 37: Fuzzy mathematics:An application oriented introduction
Page 38: Fuzzy mathematics:An application oriented introduction

Membership Functions• How cool is 36 F° ?

50 70 90 1103010

Temp. (F°)

Freezing Cool Warm Hot

0

1

Page 39: Fuzzy mathematics:An application oriented introduction

Membership Functions• How cool is 36 F° ?• It is 30% Cool and 70%

Freezing

50 70 90 1103010

Temp. (F°)

Freezing Cool Warm Hot

0

1

0.7

0.3

Page 40: Fuzzy mathematics:An application oriented introduction

Natural Numbers• Suppose you are asked to define the

set of natural numbers close to 6. There are a number of different ways in which you could accomplish this using fuzzy sets.

• Solution 1. One solution would be to manually create a fuzzy set describing the numbers near 6. This can be done as above.

Page 41: Fuzzy mathematics:An application oriented introduction
Page 42: Fuzzy mathematics:An application oriented introduction
Page 43: Fuzzy mathematics:An application oriented introduction

Choosing a Job• Fuzzy sets can be used to aid in decision making

or management. We illustrate this with an example from Klir and Folger [Klir and Folger, 1988]. Given four jobs (Jobs 1, 2, 3, and 4), our task is to choose the job that will give us the highest salary, given the constraints that the job should be interesting and close to our home.

• Solution. The first constraint of job interest can be represented with the following fuzzy set.

• We can see that Job 3 has the highest membership grade, meaning that Job 3 is the most interesting of the four jobs. Job 1 on the other hand is the least interesting, since it has a membership grade of only 0.4.

Page 44: Fuzzy mathematics:An application oriented introduction

• We can form a fuzzy set for our second constraint in a similar manner. Here is a fuzzy set used to represent the driving distance to the four jobs.

• In the fuzzy set above, the membership grades indicate the length of the drive to work. A high membership grade indicates that it is a short drive to work--a good thing. A small membership grade indicates an undesirable, long drive to work. From the fuzzy set above, we can see that Job 4 is located near our home, while Job 1 is a long way from our home.

Page 45: Fuzzy mathematics:An application oriented introduction
Page 46: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic: Motivations

Page 47: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic: Motivations

Page 48: Fuzzy mathematics:An application oriented introduction

History of Fuzzy Logic•1964: Lotfi A. Zadeh, UC Berkeley, introduced the paper on fuzzy sets.

– Idea of grade of membership was born– Sharp criticism from academic

community• Name!• Theory’s emphasis on imprecision

– Waste of government funds!

Page 49: Fuzzy mathematics:An application oriented introduction

History of Fuzzy Logic• 1965-1975: Zadeh continued to broaden the foundation of fuzzy set theory

– Fuzzy multistage decision-making– Fuzzy similarity relations– Fuzzy restrictions– Linguistic hedges

•1970s: research groups were form in JAPAN

Page 50: Fuzzy mathematics:An application oriented introduction

History of Fuzzy Logic• 1974: Mamdani, United Kingdom, developed the first fuzzy logic controller•1977: Dubois applied fuzzy sets in a comphrensive study of traffic conditions•1976-1987: Industrial application of fuzzy logic in Japan and Europe•1987-Present: Fuzzy Boom

Page 51: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic Applications

“If all motion vectors are almost parallel and their time differential is small, then the hand jittering is detected and the direction of the hand movement

is in the direction of the moving vectors”.

Image Stabilization via Fuzzy Logic

Page 52: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic Applications• Aerospace

– Altitude control of spacecraft, satellite altitude control, flow and mixture regulation in aircraft de-icing vehicles.

• Automotive– Trainable fuzzy systems for idle speed

control, shift scheduling method for automatic transmission, intelligent highway systems, traffic control, improving efficiency of automatic transmissions

Page 53: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic Applications (Cont.)• Business

– Decision-making support systems, personnel evaluation in a large company

• Chemical Industry– Control of pH, drying, chemical distillation

processes, polymer extrusion production, a coke oven gas cooling plant

Page 54: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic Applications (Cont.)• Defense

– Underwater target recognition, automatic target recognition of thermal infrared images, naval decision support aids, control of a hypervelocity interceptor, fuzzy set modeling of NATO decision making.

• Electronics– Control of automatic exposure in video

cameras, humidity in a clean room, air conditioning systems, washing machine timing, microwave ovens, vacuum cleaners.

Page 55: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic Applications (Cont.)• Financial

– Banknote transfer control, fund management, stock market predictions.

• Industrial– Cement kiln controls (dating back to 1982),

heat exchanger control, activated sludge wastewater treatment process control, water purification plant control, quantitative pattern analysis for industrial quality assurance, control of constraint satisfaction problems in structural design, control of water purification plants

Page 56: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic Applications (Cont.)• Manufacturing

– Optimization of cheese production.• Marine

– Autopilot for ships, optimal route selection, control of autonomous underwater vehicles, ship steering.

• Medical– Medical diagnostic support system, control

of arterial pressure during anesthesia, multivariable control of anesthesia, modeling of neuro-pathological findings in Alzheimer's patients, radiology diagnoses, fuzzy inference diagnosis of diabetes and prostate cancer.

Page 57: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic Applications (Cont.)• Mining and Metal Processing

– Sinter plant control, decision making in metal forming.

• Robotics– Fuzzy control for flexible-link manipulators,

robot arm control.• Securities

– Decision systems for securities trading.

Page 58: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic Applications (Cont.)• Signal Processing and

Telecommunications– Adaptive filter for nonlinear channel

equalization control of broadband noise• Transportation

– Automatic underground train operation, train schedule control, railway acceleration, braking, and stopping

Page 59: Fuzzy mathematics:An application oriented introduction

Fuzzy logic & probability theory

• Suppose you are seated at a table on which rest two glasses of liquid.– First glass is described : “having a 95%

chance Of being healthful and good”– Second glass is described : “having a .95

membership in the class of healthful and good”

• Which glass would you select, keeping in mind that the first glass has a 5 % chance of being filled with non-healthful liquids, including poisons [Bezdek 1993]?

Page 60: Fuzzy mathematics:An application oriented introduction

Air conditioner (Mitsubishi)• Conventional air conditioning systems use on-off

controllers. When the temperature drops below a preset level the unit is automatically turned off. When the temperature rises above a preset level the unit is turned on. The former preset value is slightly lower than the latter preset value, providing a dead zone, so that high-frequency on-off cycling (chatter) is avoided. The thermostat in the system controls the on-off action. For example, "when the temperature rises to 25°C, turn on the unit, and when the temperature falls to 20°C, turn off the unit." The Mitsubishi air conditioner controls by using fuzzy rules such as: "If the ambient air is getting warmer, turn the cooling power up a little; if the air is getting chilly, turn the power down moderately, etc." The machine becomes smoother as a result. This means less wear and tear of the air conditioner, more consistent comfortable room temperatures, and increased efficiency (energy savings).

Page 61: Fuzzy mathematics:An application oriented introduction

Vacuum cleaner (Panasonic)• Characteristics of the floor and the amount of

dust are sensed by an infrared sensor, and the microprocessor selects the appropriate power by fuzzy control according to these characteristics. The floor characteristics include the type (hardwood, cement, tile, carpet softness, carpet thickness, etc.). The changing pattern of the amount of dust passing through the infrared sensor is established as well. The microprocessor establishes the appropriate setting of the vacuum head and the power of the motor, using a fuzzy control scheme. Red and green lamps of the vacuum cleaner show the amount of dust left on the floor.

Page 62: Fuzzy mathematics:An application oriented introduction

Automatic transmission system (Nissan, Subaru, Mitsubishi)

• In a conventional automatic transmission system, electronic sensors measure the vehicle speed and throttle opening, and gears are shifted based on the predetermined values of these variables. According to Nissan, this type of system is incapable of uniformly providing satisfactory control performance to a driver because it provides only about three different shift patterns. The fuzzy control transmission senses several variables including vehicle speed and acceleration, throttle opening, the rate of change of throttle opening, engine load, and driving style. Each sensed value is given a weight, and a fuzzy aggregate is calculated to decide whether to shift gears. This controller is said to be more flexible, smooth, and efficient, providing better performance. Also, an integrated system developed by Mitsubishi uses fuzzy logic for active control of the suspension system, four-wheel-drive (traction), steering, and air conditioning.

Page 63: Fuzzy mathematics:An application oriented introduction

Washing machine (Matsushita, Hitachi)• The control system senses both quality and

quantity of dirt, load size, and fabric type, and adjusts the washing cycle and detergent amount accordingly. Clarity of water in the washing machine is measured by light sensors. At the start of the cycle, dirt from clothes will not have yet reached the water, so light will pass through it easily. The water becomes more discoloured as the wash cycle proceeds, and less light will pass through. This information is analyzed and control decisions are made using fuzzy logic.

Page 64: Fuzzy mathematics:An application oriented introduction

Camcorder (Panasonic, Sanyo, Fisher, Canon)• The video camera determines the best focus

and lighting, particularly when several objects are in the picture. Also, it has a digital image stabilizer to remove hand jitter. Fuzzy decision-making is used in these actions. For example, the following scheme is used for image stabilization. The present image frame is compared with the previous frame from memory. A typically stationary object (e.g., house) is identified and its shift coordinates are computed. This shift is subtracted from the image to compensate for the hand jitter. A fuzzy algorithm provides a smooth control/compensation action.

Page 65: Fuzzy mathematics:An application oriented introduction

Other…• Elevator control (Fujitec, Toshiba): A fuzzy scheme

evaluates passenger traffic and the elevator variables (load, speed, etc.) to determine car announcement and stopping time. This reduces waiting time and improves the efficiency and reliability of operation.

• Handheld computer (Sony): A fuzzy logic scheme reads the hand-written input and interprets the characters for data entry.

• Television (Sony): A fuzzy logic scheme uses sensed variables such as ambient lighting, time of day, and user profile, and adjusts such parameters as screen brightness, colour, contrast, and sound.

• Antilock braking system (Nissan): The system senses wheel speed, road conditions, and driving pattern, and the fuzzy ABS determines the braking action, with skid control.

Page 66: Fuzzy mathematics:An application oriented introduction

Other…• Subway train (Sendai): A fuzzy decision scheme is

used by the subway trains in Sendai, Japan, to determine the speed and stopping routine. Ride comfort and safety are used as performance requirements.

• Other applications of fuzzy logic include a hot water heater (Matsushita), a rice cooker (Hitachi), and a cement kiln (Denmark). A fuzzy stock-trading program can manage stock portfolios. A fuzzy golf diagnostic system is able to select the best golf club based on size, characteristics, and swing of a golfer. A fuzzy mug search system helps in criminal investigations by analyzing mug shots (photos of the suspects) along with other input data (say, statements such as "short, heavy-set, and young-looking . . ." from witnesses) to determine the most likely criminal. Gift-wrapped chocolates with fuzzy statements are available for Valentine's Day. Even a Yamaha "fuzzy" scooter was spotted in Taipei.

Page 67: Fuzzy mathematics:An application oriented introduction

Fuzzy Set Definitions

Page 68: Fuzzy mathematics:An application oriented introduction

Fuzzy setsA fuzzy set is a set with a smooth

boundary.

A fuzzy set is defined by a functions that maps objects in a domain of concern into their membership value in a set.

Such a function is called the membership function.

Page 69: Fuzzy mathematics:An application oriented introduction

Features of the Membership Function

• Core: comprises those elements x of the universe such that a (x) = 1.

• Support : region of the universe that is characterized by nonzero membership.

• Boundary : boundaries comprise those elements x of the universe such that 0< a (x) <1

Page 70: Fuzzy mathematics:An application oriented introduction

Features of the Membership Function

(Cont.)• Normal Fuzzy Set : at least one element

x in the universe whose membership value is unity

Page 71: Fuzzy mathematics:An application oriented introduction

Features of the Membership Function

(Cont.)• Convex Fuzzy set: membership values are

strictly monotonically increasing, or strictly monotonically decreasing, or strictly monotonically increasing then strictly monotonically decreasing with increasing values for elements in the universe.

a (y) ≥ min[a (x) , a (z) ]

Page 72: Fuzzy mathematics:An application oriented introduction

Features of the Membership Function

(Cont.)• Cross-over points :

a (x) = 0.5

• Height: defined as max {a (x)}

Page 73: Fuzzy mathematics:An application oriented introduction

Fuzzy Set (figure from Earl Cox)

Page 74: Fuzzy mathematics:An application oriented introduction

Definitions – fuzzy sets (figure from Klir&Yuan)

Page 75: Fuzzy mathematics:An application oriented introduction

Definitions: Fuzzy Sets (figure from Klir&Yuan)

Page 76: Fuzzy mathematics:An application oriented introduction

Fuzzy set (figure from Earl Cox)

Page 77: Fuzzy mathematics:An application oriented introduction

Design Membership Functions

Manual

- Expert knowledge. Interview those who are familiar with the underlying concepts and later adjust. Tuned through a trial-and-error

- Inference- Statistical techniques (Rank ordering)

Page 78: Fuzzy mathematics:An application oriented introduction

Intuition

• Derived from the capacity of humans to develop membership functions through their own innate intelligence and understanding.

• Involves contextual and semantic knowledge about an issue; it can also involve linguistic truth values about this knowledge.

Fuzzy Logic with Engineering Applications: Timothy J. Ross

Page 79: Fuzzy mathematics:An application oriented introduction

Inference• Use knowledge to perform deductive

reasoning, i.e . we wish to deduce or infer a conclusion, given a body of facts and knowledge.

Page 80: Fuzzy mathematics:An application oriented introduction

Inference : Example• In the identification of a triangle

– Let A, B, C be the inner angles of a triangle• Where A ≥ B≥C

– Let U be the universe of triangles, i.e.,• U = {(A,B,C) | A≥B≥C≥0; A+B+C = 180˚}

– Let ‘s define a number of geometric shapes• I Approximate isosceles triangle• R Approximate right triangle• IR Approximate isosceles and right

triangle• E Approximate equilateral triangle• T Other triangles Fuzzy Logic with Engineering Applications: Timothy J. Ross

Page 81: Fuzzy mathematics:An application oriented introduction

Inference : Example• We can infer membership values for

all of these triangle types through the method of inference, because we possess knowledge about geometry that helps us to make the membership assignments.

• For Isosceles,– i (A,B,C) = 1- 1/60* min(A-B,B-C)– If A=B OR B=C THEN i (A,B,C) = 1;– If A=120˚,B=60˚, and C =0˚ THEN i

(A,B,C) = 0. Fuzzy Logic with Engineering Applications: Timothy J. Ross

Page 82: Fuzzy mathematics:An application oriented introduction

Inference : Example• For right triangle,

– R (A,B,C) = 1- 1/90* |A-90˚|– If A=90˚ THEN i (A,B,C) = 1;– If A=180˚ THEN i (A,B,C) = 0.

• For isosceles and right triangle– IR = min (I, R)– IR (A,B,C) = min[I (A,B,C), R (A,B,C)]

= 1 - max[1/60min(A-B, B-C), 1/90|A-90|]

Fuzzy Logic with Engineering Applications: Timothy J. Ross

Page 83: Fuzzy mathematics:An application oriented introduction

Inference : Example• For equilateral triangle

– E (A,B,C) = 1 - 1/180* (A-C)– When A = B = C then E (A,B,C) = 1,

A = 180 then E (A,B,C) = 0

• For all other triangles– T = (I.R.E)’ = I’.R’.E’

= min {1 - I (A,B,C) , 1 - R (A,B,C) , 1 - E (A,B,C)

Fuzzy Logic with Engineering Applications: Timothy J. Ross

Page 84: Fuzzy mathematics:An application oriented introduction

Inference : Example

– Define a specific triangle:• A = 85˚ ≥ B = 50˚ ≥ C = 45˚

R = 0.94 I = 0.916 IR = 0.916 E = 0. 7

T = 0.05 Fuzzy Logic with Engineering Applications: Timothy J. Ross

Page 85: Fuzzy mathematics:An application oriented introduction
Page 86: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets Example

The temperature graduations are related to Johnny’s perception of ambient temperatures.

where:Y : temp value belongs to the set (0<A(x)<1)

Y* : temp value is the ideal member to the set (A(x)=1)

N : temp value is not a member of the set (A(x)=0)

Temp (0C).

COLD COOL PLEASANT WARM HOT

0 Y* N N N N

5 Y Y N N N

10 N Y N N N

12.5 N Y* N N N

15 N Y N N N

17.5 N N Y* N N

20 N N N Y N

22.5 N N N Y* N

25 N N N Y N

27.5 N N N N Y

30 N N N N Y*

Page 87: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets ExampleJohnny’s perception of the speed of the motor is as follows:

where:Y : temp value belongs to the set (0<A(x)<1)

Y* : temp value is the ideal member to the set (A(x)=1)

N : temp value is not a member of the set (A(x)=0)

Rev/sec(RPM)

MINIMAL SLOW MEDIUM FAST BLAST

0 Y* N N N N

10 Y N N N N

20 Y Y N N N

30 N Y* N N N

40 N Y N N N

50 N N Y* N N

60 N N N Y N

70 N N N Y* N

80 N N N Y Y

90 N N N N Y

100 N N N N Y*

Page 88: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets Example• The analytically expressed membership for the

reference fuzzy subsets for the temperature are:

• COLD:for 0 ≤ t ≤ 10 COLD(t) = – t / 10 + 1

• SLOW:for 0 ≤ t ≤ 12.5 SLOW(t) = t / 12.5for 12.5 ≤ t ≤ 17.5 SLOW(t) = – t / 5 + 3.5

• etc… all based on the linear equation:y = ax + b

Page 89: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets ExampleTemperature Fuzzy Sets

00.10.20.30.40.50.60.70.80.9

1

0 5 10 15 20 25 30

Temperature Degrees C

Trut

h Va

lue Cold

CoolPleasentWarmHot

Page 90: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets Example• The analytically expressed membership for the

reference fuzzy subsets for the temperature are:

• MINIMAL:for 0 ≤ v ≤ 30 COLD(t) = – v / 30 + 1

• SLOW:for 10 ≤ v ≤ 30 SLOW(t) = v / 20 – 0.5for 30 ≤ v ≤ 50 SLOW(t) = – v / 20 + 2.5

• etc… all based on the linear equation:y = ax + b

Page 91: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets ExampleSpeed Fuzzy Sets

0

0.2

0.4

0.6

0.8

1

0 10 20 30 40 50 60 70 80 90 100

Speed

Trut

h V

alue

MINIMALSLOWMEDIUMFASTBLAST

Page 92: Fuzzy mathematics:An application oriented introduction

Girl-Student Membership Function for “Young”

xif

xifxxif

xS

400

402515

40251

Page 93: Fuzzy mathematics:An application oriented introduction

Membership Function for “Young”

xif

xifxxif

xB

700

704030

70401

Page 94: Fuzzy mathematics:An application oriented introduction

Rank ordering• Assessing preferences by a single

individual, a committee, a poll, and other opinion methods can be used to assign membership values to a fuzzy variable.

• Preference is determined by pair-wise comparisons, and these determine the ordering of the membership.

Page 95: Fuzzy mathematics:An application oriented introduction

Rank ordering: Example

Page 96: Fuzzy mathematics:An application oriented introduction

Fuzzy Set Operations

Page 97: Fuzzy mathematics:An application oriented introduction

Characteristics of Fuzzy Sets• The classical set theory developed in the late 19th

century by Georg Cantor describes how crisp sets can interact. These interactions are called operations.

• Also fuzzy sets have well defined properties.

• These properties and operations are the basis on which the fuzzy sets are used to deal with uncertainty on the one hand and to represent knowledge on the other.

Page 98: Fuzzy mathematics:An application oriented introduction

Note: Membership Functions• For the sake of convenience, usually a fuzzy set is

denoted as:

A = A(xi)/xi + …………. + A(xn)/xn

where A(xi)/xi (a singleton) is a pair “grade of membership” element, that belongs to a finite universe of discourse:

A = {x1, x2, .., xn}

Page 99: Fuzzy mathematics:An application oriented introduction

Operations of Fuzzy Sets

Intersection Union

Complement

Not A

A

Containment

AA

B

BA BAA B

Page 100: Fuzzy mathematics:An application oriented introduction

Complement• Crisp Sets: Who does not belong to the set?• Fuzzy Sets: How much do elements not belong to the

set?

• The complement of a set is an opposite of this set. For example, if we have the set of tall men, its complement is the set of NOT tall men. When we remove the tall men set from the universe of discourse, we obtain the complement.

• If A is the fuzzy set, its complement A can be found as follows:

A(x) = 1 A(x)

Page 101: Fuzzy mathematics:An application oriented introduction

Containment• Crisp Sets: Which sets belong to which other sets?• Fuzzy Sets: Which sets belong to other sets?

• Similar to a Chinese box, a set can contain other sets. The smaller set is called the subset. For example, the set of tall men contains all tall men; very tall men is a subset of tall men. However, the tall men set is just a subset of the set of men. In crisp sets, all elements of a subset entirely belong to a larger set. In fuzzy sets, however, each element can belong less to the subset than to the larger set. Elements of the fuzzy subset have smaller memberships in it than in the larger set.

Page 102: Fuzzy mathematics:An application oriented introduction

Intersection• Crisp Sets: Which element belongs to both sets?• Fuzzy Sets: How much of the element is in both sets?

• In classical set theory, an intersection between two sets contains the elements shared by these sets. For example, the intersection of the set of tall men and the set of fat men is the area where these sets overlap. In fuzzy sets, an element may partly belong to both sets with different memberships.

• A fuzzy intersection is the lower membership in both sets of each element. The fuzzy intersection of two fuzzy sets A and B on universe of discourse X:

AB(x) = min [A(x), B(x)] = A(x) B(x), where xX

Page 103: Fuzzy mathematics:An application oriented introduction

Union• Crisp Sets: Which element belongs to either set?• Fuzzy Sets: How much of the element is in either set?

• The union of two crisp sets consists of every element that falls into either set. For example, the union of tall men and fat men contains all men who are tall OR fat.

• In fuzzy sets, the union is the reverse of the intersection. That is, the union is the largest membership value of the element in either set. The fuzzy operation for forming the union of two fuzzy sets A and B on universe X can be given as:

AB(x) = max [A(x), B(x)] = A(x) B(x), where xX

Page 104: Fuzzy mathematics:An application oriented introduction

Operations of Fuzzy Sets

Complement

0x

1

( x )

0x

1

Containment

0x

1

0x

1

A B

Not A

A

Intersection

0x

1

0x

A B

Union0

1A B

A B

0x

1

0x

1

BA

BA

( x )

( x )

( x )

Page 105: Fuzzy mathematics:An application oriented introduction

Properties of Fuzzy Sets• Equality of two fuzzy sets• Inclusion of one set into another fuzzy set• Cardinality of a fuzzy set• An empty fuzzy set• -cuts (alpha-cuts)

Page 106: Fuzzy mathematics:An application oriented introduction

Equality• Fuzzy set A is considered equal to a fuzzy set B, IF AND

ONLY IF (iff): A(x) = B(x), xX

A = 0.3/1 + 0.5/2 + 1/3B = 0.3/1 + 0.5/2 + 1/3

therefore A = B

Page 107: Fuzzy mathematics:An application oriented introduction

Inclusion• Inclusion of one fuzzy set into another fuzzy set. Fuzzy

set A X is included in (is a subset of) another fuzzy set, B X:

A(x) B(x), xX

Consider X = {1, 2, 3} and sets A and B

A = 0.3/1 + 0.5/2 + 1/3;B = 0.5/1 + 0.55/2 + 1/3

then A is a subset of B, or A B

Page 108: Fuzzy mathematics:An application oriented introduction

Cardinality• Cardinality of a non-fuzzy set, Z, is the number of

elements in Z. BUT the cardinality of a fuzzy set A, the so-called SIGMA COUNT, is expressed as a SUM of the values of the membership function of A, A(x):

cardA = A(x1) + A(x2) + … A(xn) = ΣA(xi),for i=1..n

Consider X = {1, 2, 3} and sets A and B

A = 0.3/1 + 0.5/2 + 1/3;B = 0.5/1 + 0.55/2 + 1/3

cardA = 1.8 cardB = 2.05

Page 109: Fuzzy mathematics:An application oriented introduction

Empty Fuzzy Set• A fuzzy set A is empty, IF AND ONLY IF:

A(x) = 0, xX

Consider X = {1, 2, 3} and set A

A = 0/1 + 0/2 + 0/3

then A is empty

Page 110: Fuzzy mathematics:An application oriented introduction

Alpha-cut• An -cut or -level set of a fuzzy set A X is an

ORDINARY SET A X, such that:A={A(x), xX}.

Consider X = {1, 2, 3} and set A

A = 0.3/1 + 0.5/2 + 1/3

then A0.5 = {2, 3},A0.1 = {1, 2, 3},A1 = {3}

Page 111: Fuzzy mathematics:An application oriented introduction

Alpha levels, core, support, normal

z

zz z z zz

Page 112: Fuzzy mathematics:An application oriented introduction

Fuzzy Set Normality• A fuzzy subset of X is called normal if there exists at

least one element xX such that A(x) = 1.

• A fuzzy subset that is not normal is called subnormal.

• All crisp subsets except for the null set are normal. In fuzzy set theory, the concept of nullness essentially generalises to sub-normality.

• The height of a fuzzy subset A is the large membership grade of an element in A

height(A) = maxx(A(x))

Page 113: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets Core and Support• Assume A is a fuzzy subset of X:

• the support of A is the crisp subset of X consisting of all elements with membership grade:

supp(A) = {x A(x) 0 and xX}

• the core of A is the crisp subset of X consisting of all elements with membership grade:

core(A) = {x A(x) = 1 and xX}

Page 114: Fuzzy mathematics:An application oriented introduction

Fuzzy Set Math Operations• aA = {aA(x), xX}

Let a =0.5, and A = {0.5/a, 0.3/b, 0.2/c, 1/d}

thenAa = {0.25/a, 0.15/b, 0.1/c, 0.5/d}

• Aa = {A(x)a, xX}Let a =2, and

A = {0.5/a, 0.3/b, 0.2/c, 1/d}then

Aa = {0.25/a, 0.09/b, 0.04/c, 1/d}• …

Page 115: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets Examples• Consider two fuzzy subsets of the set X,

X = {a, b, c, d, e }

referred to as A and B

A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e}and

B = {0.6/a, 0.9/b, 0.1/c, 0.3/d, 0.2/e}

Page 116: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets Examples• Support:

supp(A) = {a, b, c, d }supp(B) = {a, b, c, d, e }

• Core:core(A) = {a}core(B) = {o}

• Cardinality:card(A) = 1+0.3+0.2+0.8+0 = 2.3card(B) = 0.6+0.9+0.1+0.3+0.2 = 2.1

Page 117: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets Examples• Complement:

A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e}A = {0/a, 0.7/b, 0.8/c 0.2/d, 1/e}

• Union:A B = {1/a, 0.9/b, 0.2/c, 0.8/d, 0.2/e}

• Intersection:A B = {0.6/a, 0.3/b, 0.1/c, 0.3/d, 0/e}

Page 118: Fuzzy mathematics:An application oriented introduction

Fuzzy Sets Examples• aA:

for a=0.5aA = {0.5/a, 0.15/b, 0.1/c, 0.4/d, 0/e}

• Aa:for a=2Aa = {1/a, 0.09/b, 0.04/c, 0.64/d, 0/e}

• a-cut:A0.2 = {a, b, c, d}A0.3 = {a, b, d}A0.8 = {a, d}A1 = {a}

Page 119: Fuzzy mathematics:An application oriented introduction

ExerciseFor

A = {0.2/a, 0.4/b, 1/c, 0.8/d, 0/e}B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e}

Calculate the following:- Support, Core, Cardinality, and Complement for A and B independently- Union and Intersection of A and B- the new set C, if C = A2

- the new set D, if D = 0.5B- the new set E, for an alpha cut at A0.5

Page 120: Fuzzy mathematics:An application oriented introduction

SolutionA = {0.2/a, 0.4/b, 1/c, 0.8/d, 0/e}B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e}Support

Supp(A) = {a, b, c, d}Supp(B) = {b, c, d, e}

CoreCore(A) = {c}Core(B) = {}

CardinalityCard(A) = 0.2 + 0.4 + 1 + 0.8 + 0 =

2.4Card(B) = 0 + 0.9 + 0.3 + 0.2 + 0.1 =

1.5Complement

Comp(A) = {0.8/a, 0.6/b, 0/c, 0.2/d, 1/e}

Comp(B) = {1/a, 0.1/b, 0.7/c, 0.8/d, 0.9/e}

Page 121: Fuzzy mathematics:An application oriented introduction

SolutionA = {0.2/a, 0.4/b, 1/c, 0.8/d, 0/e}B = {0/a, 0.9/b, 0.3/c, 0.2/d, 0.1/e}

UnionAB = {0.2/a, 0.9/b, 1/c, 0.8/d, 0.1/e}

IntersectionAB = {0/a, 0.4/b, 0.3/c, 0.2/d, 0/e}

C=A2

C = {0.04/a, 0.16/b, 1/c, 0.64/d, 0/e}D = 0.5B

D = {0/a, 0.45/b, 0.15/c, 0.1/d, 0.05/e}E = A0.5

E = {c, d}

Page 122: Fuzzy mathematics:An application oriented introduction

Formal Definitions

Page 123: Fuzzy mathematics:An application oriented introduction
Page 124: Fuzzy mathematics:An application oriented introduction
Page 125: Fuzzy mathematics:An application oriented introduction
Page 126: Fuzzy mathematics:An application oriented introduction

Numerical Example

Page 127: Fuzzy mathematics:An application oriented introduction
Page 128: Fuzzy mathematics:An application oriented introduction

Some More Formal

Definitions• Definition 1: Let X be some set of objects, with elements noted as x.

• X = {x}. • Definition 2: A fuzzy set A in X is characterized by a

membership function mA(x) which maps each point in X onto the real interval [0.0, 1.0]. As mA(x) approaches 1.0, the "grade of membership" of x in A increases.

• Definition 3: A is EMPTY iff for all x, mA(x) = 0.0. • Definition 4: A = B iff for all x: mA(x) = mB(x) [or, mA =

mB]. • Definition 5: mA' = 1 - mA. • Definition 6: A is CONTAINED in B iff mA mB.• Definition 7: C = A UNION B, where: mC(x) = MAX(mA(x),

mB(x)). • Definition 8: C = A INTERSECTION B where: mC(x) =

MIN(mA(x), mB(x)).

Page 129: Fuzzy mathematics:An application oriented introduction

Operations

A B

A B A B A

Page 130: Fuzzy mathematics:An application oriented introduction

Fuzzy Disjunction• AB max(A, B)• AB = C "Quality C is the

disjunction of Quality A and B"

0

1

0.375

A

0

1

0.75

B

(AB = C) (C = 0.75)

Page 131: Fuzzy mathematics:An application oriented introduction

Fuzzy Conjunction• AB min(A, B)• AB = C "Quality C is the

conjunction of Quality A and B"

0

1

0.375

A

0

1

0.75

B

(AB = C) (C = 0.375)

Page 132: Fuzzy mathematics:An application oriented introduction

Example: Fuzzy Conjunction

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

0

1A

0

1B

.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40

Page 133: Fuzzy mathematics:An application oriented introduction

Example: Fuzzy Conjunction

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

0

1A

0

1B

.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40

Determine degrees of membership:

Page 134: Fuzzy mathematics:An application oriented introduction

Example: Fuzzy Conjunction

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

0

1A

0

1B

.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

0.7

Page 135: Fuzzy mathematics:An application oriented introduction

Example: Fuzzy Conjunction

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

0

1A

0

1B

.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

0.70.9

Page 136: Fuzzy mathematics:An application oriented introduction

Example: Fuzzy Conjunction

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

0

1A

0

1B

.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 ANDAB = min(A, B) = 0.7

0.70.9

Page 137: Fuzzy mathematics:An application oriented introduction
Page 138: Fuzzy mathematics:An application oriented introduction
Page 139: Fuzzy mathematics:An application oriented introduction
Page 140: Fuzzy mathematics:An application oriented introduction
Page 141: Fuzzy mathematics:An application oriented introduction
Page 142: Fuzzy mathematics:An application oriented introduction

2. Fuzzy Number

A fuzzy number A must possess the following three properties:

1. A must be a normal fuzzy set,2. The alpha levels must be closed for every

,3. The support of A, , must be bounded.

)(A ]1,0()0( A

Page 143: Fuzzy mathematics:An application oriented introduction

1

Mem

bers

hip

func

tion is the suport of

z1 is the modal value

is an -level of , (0,1]

Fuzzy Number (from Jorge dos Santos)

' < ' [ ] [ ]z z

, z z

z1zz zz

,[ ] z zz

z

z

Page 144: Fuzzy mathematics:An application oriented introduction

1

A fuzzy number can be given by a set of nested intervals, the -levels:

Fuzzy numbers defined by its -levels (from Jorge dos Santos)

.7

.5

.2

0

z

z 0.2z 0.5z 0.7z 0.7z 0.5z 0.2z z1z

1 0.7 0.5 0.2 0[ ] [ ] [ ] [ ] [ ] z z z z z

Page 145: Fuzzy mathematics:An application oriented introduction

1

Triangular fuzzy numbers

1 ( / / )z z z z

zz 1z

1 1; 0 1, ,[ ] [ ] [ ] [ ]z z z z z z

Page 146: Fuzzy mathematics:An application oriented introduction

Fuzzy Number (figure from Klir&Yuan)

Page 147: Fuzzy mathematics:An application oriented introduction

B. Operations on Fuzzy Sets: Union and Intersection (figure from Klir&Yuan)

Page 148: Fuzzy mathematics:An application oriented introduction

Operations on Fuzzy Sets: Intersection (figure from Klir&Yuan)

Page 149: Fuzzy mathematics:An application oriented introduction

Operations on Fuzzy Sets: Union and Complement (figure from Klir&Yuan)

Page 150: Fuzzy mathematics:An application oriented introduction

C. Operations on Fuzzy Numbers: Addition and Subtraction (figure from Klir&Yuan)

Page 151: Fuzzy mathematics:An application oriented introduction

Operations on Fuzzy Numbers: Multiplication and Division (figure from Klir&Yuan)

Page 152: Fuzzy mathematics:An application oriented introduction

Fuzzy Equations

}, where8.0)(|{:istion interpretaAnother

).(/)()(/)()(/)()(/)(ii)(0,1] )(/)()(/)( i)

:iff existsequation fuzzy theosolution t Then the)].(),([)( and )](),([)( )],(),([)(Let

).()()(:istion interpreta One

~~*~

BbAabaxx

abababababab

xxXbbBaaABXA

BXA

Page 153: Fuzzy mathematics:An application oriented introduction

Example of a Fuzzy Equation (figure from Klir&Yuan)

)()(: that(ii)Verify

5

1232,3128)(

thatso 5

12323128

: that(i)Verify ]1232 ,128[)(

]5 ,3[)(3202for 12/)32(

2012for 8/)12(32 ,12for 0

)(

54for 543for 35 ,3for 0

)(

XX

X

BA

xxxx

xxxB

xxxxxx

xA

Page 154: Fuzzy mathematics:An application oriented introduction

The Extension Principle of Zadeh

Given a formula f(x) and a fuzzy set A defined by,

how do we compute the membership function of f(A) ?

How this is done is what is called the extension principle (of

professor Zadeh). What the extension principle says is that

f (A) =f(A( )). The formal definition is:[f(A)](y)=supx|y=f(x){ }

)(xA

)(xA

Page 155: Fuzzy mathematics:An application oriented introduction

Extension Principle - Example

Let f(x) = ax+b,

23/15/86Then .6 and ,5/3/2 ,3/2/1

BAf(x)xBbAa

Page 156: Fuzzy mathematics:An application oriented introduction
Page 157: Fuzzy mathematics:An application oriented introduction

FUZZY RELATIONS, FUZZY GRAPHS, AND FUZZY ARITHMETIC

Page 158: Fuzzy mathematics:An application oriented introduction

INTRODUCTION3 Important concepts in fuzzy logic• Fuzzy Relations• Fuzzy Graphs

• Extension Principle --} Form the foundation

of fuzzy rules

basis of fuzzy Arithmetic

- This is what makes a fuzzy system tick!

Page 159: Fuzzy mathematics:An application oriented introduction

Fuzzy Relations

• Generalizes classical relation into one that allows partial membership– Describes a relationship that holds

between two or more objects• Example: a fuzzy relation “Friend”

describe the degree of friendship between two person (in contrast to either being friend or not being friend in classical relation!)

Page 160: Fuzzy mathematics:An application oriented introduction

Fuzzy Relations• A fuzzy relation is a mapping

from the Cartesian space X x Y to the interval [0,1], where the strength of the mapping is expressed by the membership function of the relation (x,y)

• The “strength” of the relation between ordered pairs of the two universes is measured with a membership function expressing various “degree” of strength [0,1]

˜ R

˜ R

Page 161: Fuzzy mathematics:An application oriented introduction

Fuzzy Cartesian ProductLet be a fuzzy set on universe X, and be a fuzzy set on universe Y, then

Where the fuzzy relation R has membership function˜ A ˜ B ˜ R X Y

R (x, y) A x B (x, y) min( A

(x), B (y))

˜ A ˜ B

Page 162: Fuzzy mathematics:An application oriented introduction

Fuzzy Cartesian Product: ExampleLet defined on a universe of three discrete temperatures, X = {x1,x2,x3}, and defined on a universe of two discrete pressures, Y = {y1,y2}Fuzzy set represents the “ambient” temperature andFuzzy set the “near optimum” pressure for a certain heat exchanger, and the Cartesian product might represent the conditions (temperature-pressure pairs) of the exchanger that are associated with “efficient” operations. For example, let

˜ A ˜ B

˜ A ˜ B

˜ A 0.2x1

0.5x2

1x3

and

˜ B 0.3y1

0.9y2

} ˜ A ˜ B ˜ R x1

x2

x3

0.2 0.20.3 0.50.3 0.9

y1 y2

Page 163: Fuzzy mathematics:An application oriented introduction

Fuzzy CompositionSuppose is a fuzzy relation on the Cartesian space X x Y, is a fuzzy relation on the Cartesian space Y x Z, and is a fuzzy relation on the Cartesian space X x Z; then fuzzy max-min and fuzzy max-product composition are defined as

˜ R ˜ S ˜ T

˜ T ˜ R ˜ S max min T (x,z)

yY( R (x,y) S

(y,z))

max product T

(x,z) yY

( R (x,y) S

(y, z))

Page 164: Fuzzy mathematics:An application oriented introduction

Fuzzy Composition: Example (max-min)X {x1, x2},

T (x1,z1)

yY( R

(x1,y) S (y,z1))

max[min(0.7,0.9),min(0.5, 0.1)]0.7

Y {y1, y2},and Z {z1,z2, z3}

Consider the following fuzzy relations:

˜ R x1

x2

0.7 0.50.8 0.4

y1 y2

and ˜ S y1

y2

0.9 0.6 0.50.1 0.7 0.5

z1 z2 z3

Using max-min composition,

}321

2

1

5.06.08.05.06.07.0~

zzz

xx

T

Page 165: Fuzzy mathematics:An application oriented introduction

Fuzzy Composition: Example (max-Prod)X {x1, x2},

T (x2, z2 )

yY( R

(x2 , y) S (y, z2))

max[(0.8,0.6),(0.4, 0.7)]0.48

Y {y1, y2},and Z {z1,z2, z3}

Consider the following fuzzy relations:

˜ R x1

x2

0.7 0.50.8 0.4

y1 y2

and ˜ S y1

y2

0.9 0.6 0.50.1 0.7 0.5

z1 z2 z3

Using max-product composition,

} ˜ T x1

x2

.63 .42 .25

.72 .48 .20

z1 z2 z3

Page 166: Fuzzy mathematics:An application oriented introduction

Application: Computer Engineering

Problem: In computer engineering, different logic families are often compared on the basis of their power-delay product. Consider the fuzzy set F of logic families, the fuzzy set D of delay times(ns), and the fuzzy set P of power dissipations (mw).

If F = {NMOS,CMOS,TTL,ECL,JJ},

D = {0.1,1,10,100},

P = {0.01,0.1,1,10,100}

Suppose R1 = D x F and R2 = F x P

~~~~ ~ ~ ~ ~ ~

~~

~

˜ R 1

0.11

10100

0 0 0 .6 10 .1 .5 1 0.4 1 1 0 01 .2 0 0 0

N C T E J

and ˜ R 2

NCTEJ

0 .4 1 .3 0.2 1 0 0 00 0 .7 1 00 0 0 1 .51 .1 0 0 0

.01 .1 1 10 100

Page 167: Fuzzy mathematics:An application oriented introduction

Application: Computer Engineering (Cont)We can use max-min composition to obtain a relation between delay times and power dissipation: i.e., we can compute or

˜ R 3 ˜ R 1 ˜ R 2 R 3 ( R 1

R 2)

˜ R 3

0.11

10100

1 .1 0 .6 .5.1 .1 .5 1 .5.2 1 .7 1 0.2 .4 1 .3 0

.01 .1 1 10 100

Page 168: Fuzzy mathematics:An application oriented introduction

Application: Fuzzy Relation PetiteFuzzy Relation Petite defines the degree by which a person with a specific height and weight is considered petite. Suppose the range of the height and the weight of interest to us are {5’, 5’1”, 5’2”, 5’3”, 5’4”,5’5”,5’6”}, and {90, 95,100, 105, 110, 115, 120, 125} (in lb). We can express the fuzzy relation in a matrix form as shown below:

˜ P

5'5'1"5' 2"5' 3"5' 4"5' 5"5' 6"

1 1 1 1 1 1 .5 .21 1 1 1 1 .9 .3 .11 1 1 1 1 .7 .1 01 1 1 1 .5 .3 0 0.8 .6 .4 .2 0 0 0 0.6 .4 .2 0 0 0 0 00 0 0 0 0 0 0 0

90 95 100 105 110 115 120 125

Page 169: Fuzzy mathematics:An application oriented introduction

Application: Fuzzy Relation Petite

˜ P

5'5'1"5' 2"5' 3"5' 4"5' 5"5' 6"

1 1 1 1 1 1 .5 .21 1 1 1 1 .9 .3 .11 1 1 1 1 .7 .1 01 1 1 1 .5 .3 0 0.8 .6 .4 .2 0 0 0 0.6 .4 .2 0 0 0 0 00 0 0 0 0 0 0 0

90 95 100 105 110 115 120 125

Once we define the petite fuzzy relation, we can answer two kinds of questions:

• What is the degree that a female with a specific height and a specific weight is considered to be petite?

• What is the possibility that a petite person has a specific pair of height and weight measures? (fuzzy relation becomes a possibility distribution)

Page 170: Fuzzy mathematics:An application oriented introduction

Application: Fuzzy Relation Petite Given a two-dimensional fuzzy relation and the possible values of

one variable, infer the possible values of the other variable using similar fuzzy composition as described earlier.

Definition: Let X and Y be the universes of discourse for variables x and y, respectively, and xi and yj be elements of X and Y. Let R be a fuzzy relation that maps X x Y to [0,1] and the possibility distribution of X is known to be Px(xi). The compositional rule of inference infers the possibility distribution of Y as follows:

max-min composition:

max-product composition:

PY(y j ) maxx i

(min(PX (x i),PR (x i , y j)))

PY(y j ) maxx i

(PX (xi) PR(xi , y j ))

Page 171: Fuzzy mathematics:An application oriented introduction

Application: Fuzzy Relation Petite

Problem: We may wish to know the possible weight of a petite female who is about 5’4”.

Assume About 5’4” is defined as About-5’4” = {0/5’, 0/5’1”, 0.4/5’2”, 0.8/5’3”, 1/5’4”, 0.8/5’5”, 0.4/5’6”}Using max-min compositional, we can find the weight possibility distribution of a petite person about 5’4” tall:

Pweight(90)(0 1) (0 1) (.4 1) (.8 1) (1 .8) (.8 .6) (.4 0)

0.8

˜ P

5'5'1"5' 2"5' 3"5' 4"5' 5"5' 6"

1 1 1 1 1 1 .5 .21 1 1 1 1 .9 .3 .11 1 1 1 1 .7 .1 01 1 1 1 .5 .3 0 0.8 .6 .4 .2 0 0 0 0.6 .4 .2 0 0 0 0 00 0 0 0 0 0 0 0

90 95 100 105 110 115 120 125

Similarly, we can compute the possibility degree for other weights. The final result is

Pweight {0.8 / 90,0.8 / 95,0.8 /100,0.8/ 105,0.5 /110,0.4 /115, 0.1/ 120,0 /125}

Page 172: Fuzzy mathematics:An application oriented introduction

Fuzzy Graphs

• A fuzzy relation may not have a meaningful linguistic label.• Most fuzzy relations used in real-world applications do not represent a

concept, rather they represent a functional mapping from a set of input variables to one or more output variables.

• Fuzzy rules can be used to describe a fuzzy relation from the observed state variables to a control decision (using fuzzy graphs)

• A fuzzy graph describes a functional mapping between a set of input linguistic variables and an output linguistic variable.

Page 173: Fuzzy mathematics:An application oriented introduction

Extension Principle

• Provides a general procedure for extending crisp domains of mathematical expressions to fuzzy domains.

• Generalizes a common point-to-point mapping of a function f(.) to a mapping between fuzzy sets.

Suppose that f is a function from X to Y and A is a fuzzy set on X defined as

A A(x1) /(x1) A(x2 )/(x2 ) .....A(xn )/(xn )

Then the extension principle states that the image of fuzzy set A under the mapping f(.) can be expressed as a fuzzy set B,

B f (A) A(x1) /(y1) A(x2 ) /(y2 ) .....A(xn )/(yn )Where yi =f(xi), i=1,…,n. If f(.) is a many-to-one mapping then

B(y) maxxf 1 (y )

A (x)

Page 174: Fuzzy mathematics:An application oriented introduction

Extension Principle: Example Let A=0.1/-2+0.4/-1+0.8/0+0.9/1+0.3/2andf(x) = x2-3

Upon applying the extension principle, we have

B = 0.1/1+0.4/-2+0.8/-3+0.9/-2+0.3/1= 0.8/-3+max(0.4, 0.9)/-2+max(0.1, 0.3)/1= 0.8/-3+0.9/-2+0.3/1

Page 175: Fuzzy mathematics:An application oriented introduction

Extension Principle: Example Let A(x) = bell(x;1.5,2,0.5)and

f(x) = { (x-1)2-1, if x >=0 x, if x <=0

Page 176: Fuzzy mathematics:An application oriented introduction

Extension Principle: Example

Around-4 = 0.3/2 + 0.6/3 + 1/4 + 0.6/5 + 0.3/6 andY = f(x) = x2 -6x +11

Page 177: Fuzzy mathematics:An application oriented introduction

Arithmetic Operations on Fuzzy Numbers Applying the extension principle to arithmetic

operations, we have

Fuzzy Addition:

Fuzzy Subtraction:

Fuzzy Multiplication:

Fuzzy Division:

AB(z) x ,y

x yz

A(x) B (y)

A B(z) x ,y

x yz

A(x) B (y)

AB(z) x ,y

xyz

A(x)B (y)

A / B(z ) x ,y

x / yz

A(x) B (y)

Page 178: Fuzzy mathematics:An application oriented introduction

Arithmetic Operations on Fuzzy Numbers Let A and B be two fuzzy integers defined as

A = 0.3/1 + 0.6/2 + 1/3 + 0.7/4 + 0.2/5B = 0.5/10 + 1/11 + 0.5/12ThenF(A+B) = 0.3/11+ 0.5/12 + 0.5/13 + 0.5/14 +0.2/15 + 0.3/12 + 0.6/13 + 1/14 + 0.7/15 + 0.2/16 + 0.3/13 + 0.5/14 + 0.5/15 + 0.5/16 +0.2/17Get max of the duplicates,F(A+B) =0.3/11 + 0.5/12 + 0.6/13 + 1/14 + 0.7/15 +0.5/16 + 0.2/17

Page 179: Fuzzy mathematics:An application oriented introduction

Summary

• A fuzzy relation is a multidimensional fuzzy set• A composition of two fuzzy relations is an important

technique• A fuzzy graph is a fuzzy relation formed by pairs of

Cartesian products of fuzzy sets• A fuzzy graph is the foundation of fuzzy mapping rules• The extension principle allows a fuzzy set to be

mapped through a function• Addition, subtraction, multiplication, and division of

fuzzy numbers are all defined based on the extension principle

Page 180: Fuzzy mathematics:An application oriented introduction

A peep into Fuzzy Control System

Page 181: Fuzzy mathematics:An application oriented introduction

DO we need FAT?• How do you make a machine

smart?– Put some FAT in it!– A FAT enough machine can model

any process– A FAT system can always turn inputs

to outputs and turn causes to effects and turn questions to answer

• FAT stands for “Fuzzy Approximation Theorem”

Page 182: Fuzzy mathematics:An application oriented introduction

CONVENTIONAL CONTROL

• Closed-loop control takes account of actual output and compares this to desired output

Measurement

DesiredOutput

+-

ProcessDynamics

Controller/Amplifier

OutputInput

• Open-loop control is ‘blind’ to actual output

Page 183: Fuzzy mathematics:An application oriented introduction

Digital Control System Configuration

Page 184: Fuzzy mathematics:An application oriented introduction

CONVENTIONAL CONTROLExample: design a cruise control systemAfter gaining an intuitive understanding of the plant’s dynamics and establishing the design objectives, the control engineer typically solves the cruise control problem by doing the following:1. Developing a model of the automobile dynamics (which may model vehicle and power train dynamics, tire and suspension dynamics, the effect of road grade variations, etc.).2. Using the mathematical model, or a simplified version of it, to design a controller (e.g., via a linear model, develop a linear controller with techniques from classical control).

Page 185: Fuzzy mathematics:An application oriented introduction

CONVENTIONAL CONTROL

3. Using the mathematical model of the closed-loop system and mathematical or simulation-based analysis to study its performance (possibly leading to redesign).

4. Implementing the controller via, for example, a microprocessor, and evaluating the performance of the closed-loop system (again, possibly leading to redesign).

Page 186: Fuzzy mathematics:An application oriented introduction

CONVENTIONAL CONTROL

Mathematical model of the plant:– never perfect– an abstraction of the real system– “is accurate enough to be able to design a controller that will work.”!– based on a system of differential equations

Page 187: Fuzzy mathematics:An application oriented introduction

Can you re-collect gradient descent procedures?Newton-Raphson method?

Page 188: Fuzzy mathematics:An application oriented introduction

Fuzzy ControlFuzzy control provides a formal methodology for representing, manipulating, and implementing a human’s heuristic knowledge about how to control a system.

Page 189: Fuzzy mathematics:An application oriented introduction

Fuzzy Systems

How can fuzzy systems be used in a world where measurements and actions are expressed as crisp

values?

Page 190: Fuzzy mathematics:An application oriented introduction

Fuzzy Systems

Fuzzy Knowledge base

Input Fuzzifier InferenceEngine DefuzzifierOutput

Page 191: Fuzzy mathematics:An application oriented introduction

Fuzzy Systems (Cont.)

90 Degree F.

It is too hot!

Turn the fan on high

Set the fan at 90% speed

Input Fuzzifier Fuzzy System Defuzzifier output

Page 192: Fuzzy mathematics:An application oriented introduction

Fuzzy Control Systems

Fuzzy Knowledge base

Fuzzifier InferenceEngine Defuzzifier Plant Output

Input

Page 193: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic Control• Fuzzy controller design consist of turning

intuitions, and any other information about how to control a system, into set of rules.

• These rules can then be applied to the system. • If the rules adequately control the system, the

design work is done.• If the rules are inadequate, the way they fail

provides information to change the rules.

Page 194: Fuzzy mathematics:An application oriented introduction

Components of Fuzzy system

• The components of a conventional expert system and a fuzzy system are the same.

• Fuzzy systems though contain `fuzzifiers’.– Fuzzifiers convert crisp numbers into fuzzy

numbers,• Fuzzy systems contain `defuzzifiers',

– Defuzzifiers convert fuzzy numbers into crisp numbers.

Page 195: Fuzzy mathematics:An application oriented introduction

Conventional vs Fuzzy system

Components of a ...conventional expert fuzzysystem system

knowledgemodel

physicaldevice

precisevalue

physicaldevice

fuzzymodel

valuefuzzy

valuefuzzy

precisevalue

precise

precise

value

value

fuzzifier

defuzzifier

Page 196: Fuzzy mathematics:An application oriented introduction

In order to process the input to get the output reasoning there are six steps involved in the creation of a rule based fuzzy system:

1. Identify the inputs and their ranges and name them.2. Identify the outputs and their ranges and name them.3. Create the degree of fuzzy membership function for each input and output.4. Construct the rule base that the system will operate under5. Decide how the action will be executed by assigning strengths to the rules6. Combine the rules and defuzzify the output

Page 197: Fuzzy mathematics:An application oriented introduction

Fuzzy Logic ControlType of Fuzzy Controllers:

• Mamdani• Larsen• TSK (Takagi Sugeno Kang)• Tsukamoto• Other methods

Page 198: Fuzzy mathematics:An application oriented introduction

Fuzzy Control Systems

MamdaniFuzzy models

Page 199: Fuzzy mathematics:An application oriented introduction

Mamdani Fuzzy models

• The most commonly used fuzzy inference technique is the so-called Mamdani method.

• In 1975, Professor Ebrahim Mamdani of London University built one of the first fuzzy systems to control a steam engine and boiler combination.

Original Goal: Control a steam engine & boiler combination by a set of linguistic control rules obtained from experienced human operators.

Page 200: Fuzzy mathematics:An application oriented introduction

Mamdani fuzzy inferenceThe Mamdani-style fuzzy inference process is

performed in four steps:

1. Fuzzification of the input variables,

2. Rule evaluation;

3. Aggregation of the rule outputs, and finally

4. Defuzzification.

Page 201: Fuzzy mathematics:An application oriented introduction

Operation of Fuzzy System Crisp Input

Fuzzy Input

Fuzzy Output

Crisp Output

Fuzzification

Rule Evaluation

Defuzzification

Input Membership Functions

Rules / Inferences

Output Membership Functions

Page 202: Fuzzy mathematics:An application oriented introduction

Knowledge as Rules is the basis of FAT

• Every term in one of our rules is Fuzzy

• Every term is vague, hazy, inexact, sloppy

Page 203: Fuzzy mathematics:An application oriented introduction

FAT (cont.)• Fuzzy rule relates fuzzy sets

– If X is A, then Y is B• A and B are fuzzy sets and subset of X

and Y

Page 204: Fuzzy mathematics:An application oriented introduction

Building Knowledge base System

• 3 Steps– Pick the nouns or variables

• Example: X be input and Y be output– Let x be temperature and Y be change in

motor speed• Cause, effect. Stimulus, response!

– Pick the fuzzy sets• Define fuzzy subsets of the nouns X and Y

– Pick the fuzzy rules• Associate output to the input

Page 205: Fuzzy mathematics:An application oriented introduction

Inference Engine

Basil Hamed

Fuzzy Knowledge base

Fuzzy Knowledge base

I nput Fuzzifi er I nferenceEngine Defuzzifier OutputI nput Fuzzifi er I nferenceEngine Defuzzifier Output

Using If-Then type fuzzy rules converts the fuzzy input to the fuzzy output.

Page 206: Fuzzy mathematics:An application oriented introduction

Fuzzy Associative Memory• Which rule “fires” or activates at

which time?– They all fire all the time– They fire in parallel

• All rules fire to some degree• Most fire to zero degree

– The result is a fuzzy weighted average

Page 207: Fuzzy mathematics:An application oriented introduction

Additive Fuzzy System• Stores m fuzzy rules of the form

– “If X = Aj then Y = Bj,” then computes the output by defuzzifiy the summed (MAXed) of the partially fired then-part fuzzy sets B’j

Page 208: Fuzzy mathematics:An application oriented introduction

We examine a simple two-input one-output problem that includes three rules:

Rule: 1 Rule: 1IF x is A3 IF project_funding is adequateOR y is B1 OR project_staffing is smallTHEN z is C1 THEN risk is low

Rule: 2 Rule: 2IF x is A2 IF project_funding is marginalAND y is B2 AND project_staffing is largeTHEN z is C2 THEN risk is normal

Rule: 3 Rule: 3IF x is A1 IF project_funding is inadequateTHEN z is C3 THEN risk is high

Page 209: Fuzzy mathematics:An application oriented introduction

Step 1: Fuzzification■ Take the crisp inputs, x1 and y1 (project funding and

project staffing)■ Determine the degree to which these inputs belong to

each of the appropriate fuzzy sets.

Crisp Inputy1

0.1

0.71

0 y1

B1 B2

Y

Crisp Input

0.20.5

1

0

A1 A2 A3

x1

x1 X

(x = A1) = 0.5

(x = A2) = 0.2

(y = B1) = 0.1

(y = B2) = 0.7

Page 210: Fuzzy mathematics:An application oriented introduction

Fuzzification• Process of making a crisp quantity

fuzzy• Vector representation can be viewed

as either a discrete or an approximation of a continuous set ( use linear interpolation]

Crisp input

Fuzzy Grade

Page 211: Fuzzy mathematics:An application oriented introduction

Example: Fuzzification• Define fuzzy set “near 5”

– S = [ 0:10];– G = [0.0 0.1 0.3 0.5 0.8 1 0.8

0.5 0.3 0.1 0];

0

0.2

0.4

0.6

0.8

1

0 1 2 3 4 5 6 7 8 9 10

Near 50.5

0.9

Page 212: Fuzzy mathematics:An application oriented introduction

• Recommend designer to adopt the following design principles:– Each Membership function overlaps

only with the closest neighboring membership functions;

– For any possible input data, its membership values in all relevant fuzzy sets should sum to 1 (or nearly)

Some Hints while designing Membership Functions in practice.

Page 213: Fuzzy mathematics:An application oriented introduction

Designing Antecedent Membership Functions

A Membership Function Design that violates the second principle

Page 214: Fuzzy mathematics:An application oriented introduction

Designing Antecedent Membership Functions

A Membership Function Design that violates both principle

Page 215: Fuzzy mathematics:An application oriented introduction

Designing Antecedent Membership Functions

A symmetric Function Design Following the guidelines

Page 216: Fuzzy mathematics:An application oriented introduction

Some Hints while designing Membership Functions in practice.

An asymmetric Function Design Following the guidelines

Page 217: Fuzzy mathematics:An application oriented introduction

Step 2: Rule Evaluation• take the fuzzified inputs, (x=A1) = 0.5, (x=A2) = 0.2,

(y=B1) = 0.1 and (y=B2) = 0.7

• apply them to the antecedents of the fuzzy rules.

• If a given fuzzy rule has multiple antecedents, the fuzzy operator (AND or OR) is used to obtain a single number that represents the result of the antecedent evaluation. This number (the truth value) is then applied to the consequent membership function.

Page 218: Fuzzy mathematics:An application oriented introduction

Step 2: Rule Evaluation

To evaluate the disjunction of the rule antecedents, we use the OR fuzzy operation. Typically, fuzzy expert systems make use of the classical fuzzy operation union:

AB(x) = max [A(x), B(x)]

Similarly, in order to evaluate the conjunction of the rule antecedents, we apply the AND fuzzy operation intersection:

AB(x) = min [A(x), B(x)]

Page 219: Fuzzy mathematics:An application oriented introduction

Mamdani-style rule evaluation

A31

0 X

1

y10 Y

0.0

x1 0

0.1C1

1C2

Z

1

0 X

0.2

0

0.2 C11

C2

Z

A2

x1

Rule 3:

A11

0 X 0

1

Zx1

THEN

C1 C2

1

y1

B2

0 Y

0.7

B10.1

C3

C3

C30.5 0.5

OR(max)

AND(min)

OR THENRule 1:

AND THENRule 2:

IF x is A3 (0.0) y is B1 (0.1) z is C1 (0.1)

IF x is A2 (0.2) y is B2 (0.7) z is C2 (0.2)

IF x is A1 (0.5) z is C3 (0.5)

Page 220: Fuzzy mathematics:An application oriented introduction

• Now the result of the antecedent evaluation can be applied to the membership function of the consequent.

• The most common method is to cut the consequent membership function at the level of the antecedent truth.

• This method is called clipping (Max-Min Composition) .• The clipped fuzzy set loses some information.• Clipping is still often preferred because:

• it involves less complex and faster mathematics• it generates an aggregated output surface that is

easier to defuzzify.

Page 221: Fuzzy mathematics:An application oriented introduction

While clipping is a frequently used method, scaling (Max-Product Composition) offers a better approach for preserving the original shape of the fuzzy set.

The original membership function of the rule consequent is adjusted by multiplying all its membership degrees by the truth value of the rule antecedent.

This method, which generally loses less information, can be very useful in fuzzy expert systems.

Page 222: Fuzzy mathematics:An application oriented introduction

Clipped and scaled membership functions

Degree ofMembership1.0

0.0

0.2

Z

Degree ofMembership

Z

C2

1.0

0.0

0.2

C2

Max-Product Composition Max-Min Composition

Page 223: Fuzzy mathematics:An application oriented introduction

Graphical Technique of Mamdani (Max-Min]

Inference• If x1

k is A1k and x2

k is A2k Then Yk is

Bk

Page 224: Fuzzy mathematics:An application oriented introduction

Graphical Technique of Max-Product Inference

• If x1k is A1

k and x2k is A2

k Then Yk is Bk

Page 225: Fuzzy mathematics:An application oriented introduction

Step 3: Aggregation of The Rule Outputs• Aggregation is the process of unification of the

outputs of all rules.

• We take the membership functions of all rule consequents previously clipped or scaled and combine them into a single fuzzy set.

Page 226: Fuzzy mathematics:An application oriented introduction

Aggregation of the rule outputs

00.1

1C1

Cz is 1 (0.1)

C2

00.2

1

Cz is 2 (0.2)

0

0.5

1

Cz is 3 (0.5)

ZZZ

0.2

Z0

C30.5

0.1

Page 227: Fuzzy mathematics:An application oriented introduction

Step 4: Defuzzification• Fuzziness helps us to evaluate the rules, but the

final output of a fuzzy system has to be a crisp number.

• The input for the defuzzification process is the aggregated output fuzzy set and the output is a single number.

Page 228: Fuzzy mathematics:An application oriented introduction

There are several defuzzification methods, but probably the most popular one is the centroid technique.

It finds the point where a vertical line would slice the aggregate set into two equal masses. Mathematically this centre of gravity (COG) can be expressed as:

b

aA

b

aA

dxx

dxxxCOG

Page 229: Fuzzy mathematics:An application oriented introduction

Centroid defuzzification method finds a point representing the centre of gravity of the fuzzy set, A, on the interval, ab.

A reasonable estimate can be obtained by calculating it over a sample of points.

( x )

1.0

0.0

0.2

0.4

0.6

0.8

160 170 180 190 200

a b

210

A

150X

Page 230: Fuzzy mathematics:An application oriented introduction

Centre of gravity (COG):4.67

5.05.05.05.02.02.02.02.01.01.01.05.0)100908070(2.0)60504030(1.0)20100(

COG

1.0

0.0

0.2

0.4

0.6

0.8

0 20 30 40 5010 70 80 90 10060Z

Degree ofMembership

67.4

Page 231: Fuzzy mathematics:An application oriented introduction
Page 232: Fuzzy mathematics:An application oriented introduction

Defuzzification (Cont.)• Centroid Method: the most prevalent

and physically appealing of all the defuzzification methods [Sugeno, 1985; Lee, 1990]– Often called

• Center of area• Center of gravity

Page 233: Fuzzy mathematics:An application oriented introduction

Defuzzification (Cont.)• Max-membership principal

– Also known as height method

Page 234: Fuzzy mathematics:An application oriented introduction

Defuzzification (Cont.)• Weighted average method

– Valid for symmetrical output membership functions

Formed by weighting each functions in the output by its respective maximum membership value

Page 235: Fuzzy mathematics:An application oriented introduction

Defuzzification (Cont.)• Mean-max membership (middle of

maxima)– Maximum membership is a plateau

Z* = a + b2

Page 236: Fuzzy mathematics:An application oriented introduction

Defuzzification (Cont.)• Center of Largest area

– If the output fuzzy set has at least two convex sub-region, defuzzify the largest area using centroid

Page 237: Fuzzy mathematics:An application oriented introduction

Defuzzification (Cont.)• First (or last) of maxima

– Determine the smallest value of the domain with maximized membership degree

Page 238: Fuzzy mathematics:An application oriented introduction
Page 239: Fuzzy mathematics:An application oriented introduction

A simple Fuzzy Control system.• Example: Speed Control• How fast am I going to drive

today?• It depends on the weather.

Page 240: Fuzzy mathematics:An application oriented introduction

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

50 70 90 1103010

Temp. (F°)

Freezing Cool Warm Hot

0

1

Page 241: Fuzzy mathematics:An application oriented introduction

Inputs: Temperature, Cloud Cover• Temp: {Freezing, Cool, Warm, Hot}

• Cover: {Sunny, Partly, Overcast}50 70 90 1103010

Temp. (F°)

Freezing Cool Warm Hot

0

1

40 60 80 100200

Cloud Cover (%)

OvercastPartly CloudySunny

0

1

Page 242: Fuzzy mathematics:An application oriented introduction

Output: Speed• Speed: {Slow, Fast}

50 75 100250

Speed (mph)

Slow Fast

0

1

Page 243: Fuzzy mathematics:An application oriented introduction

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...

Page 244: Fuzzy mathematics:An application oriented introduction

Example Speed Calculation• How fast will I go if it is

– 65 F°– 25 % Cloud Cover ?

Page 245: Fuzzy mathematics:An application oriented introduction

Fuzzification:Calculate Input Membership Levels• 65 F° Cool = 0.4, Warm= 0.7

50 70 90 1103010

Temp. (F°)

Freezing Cool Warm Hot

0

1

Page 246: Fuzzy mathematics:An application oriented introduction

Fuzzification:Calculate Input Membership Levels• 65 F° Cool = 0.4, Warm= 0.7

• 25% Cover Sunny = 0.8, Cloudy = 0.2

50 70 90 1103010

Temp. (F°)

Freezing Cool Warm Hot

0

1

40 60 80 100200

Cloud Cover (%)

OvercastPartly CloudySunny

0

1

Page 247: Fuzzy mathematics:An application oriented introduction

...Calculating...• If it's Sunny and Warm, drive

FastSunny(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

Page 248: Fuzzy mathematics:An application oriented introduction

Defuzzification: Constructing the Output• Speed is 20% Slow and 70% Fast

• Find centroids: Location where membership is 100%

50 75 100250

Speed (mph)

Slow Fast

0

1

Page 249: Fuzzy mathematics:An application oriented introduction

Defuzzification: Constructing the Output• Speed is 20% Slow and 70% Fast

• Find centroids: Location where membership is 100%

50 75 100250

Speed (mph)

Slow Fast

0

1

Page 250: Fuzzy mathematics:An application oriented introduction

Defuzzification: Constructing the Output• Speed is 20% Slow and 70% Fast

• Speed = weighted mean = (2*25+...

50 75 100250

Speed (mph)

Slow Fast

0

1

Page 251: Fuzzy mathematics:An application oriented introduction

Defuzzification: Constructing the Output• Speed is 20% Slow and 70% Fast

• Speed = weighted mean = (2*25+7*75)/(9)= 63.8 mph

50 75 100250

Speed (mph)

Slow Fast

0

1

Page 252: Fuzzy mathematics:An application oriented introduction

Notes: Follow-up Points• Fuzzy Logic Control allows for the

smooth interpolation between variable centroids with relatively few rules

• This does not work with crisp (traditional Boolean) logic

• Provides a natural way to model some types of human expertise in a computer program

Page 253: Fuzzy mathematics:An application oriented introduction

Notes: Drawbacks to Fuzzy logic• 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

Page 254: Fuzzy mathematics:An application oriented introduction
Page 255: Fuzzy mathematics:An application oriented introduction

Example: Build a Fuzzy System

• Design motor speed controller for air conditioner–Step 1: assign input and output

variables• Let X be temperature in

Fahrenheit• Let Y be the change in motor

speed of the air conditioner

Page 256: Fuzzy mathematics:An application oriented introduction

Example: Build a Fuzzy System

• Design motor speed controller for air conditioner–Step 2: Pick fuzzy sets

• Define subsets of the noun X and Y– Say 5 fuzzy sets on X

»Cold, Cool, Just Right, Warm, and Hot

– Say 5 fuzzy sets on Y» Stop, Slow, Medium, Fast, and

Blast

Page 257: Fuzzy mathematics:An application oriented introduction

Example: Build a Fuzzy System

• Input Fuzzy set

Page 258: Fuzzy mathematics:An application oriented introduction

Example: Build a Fuzzy System

• Output Fuzzy set

Page 259: Fuzzy mathematics:An application oriented introduction

Example: Build a Fuzzy System

• Design motor speed controller for air conditioner–Step 3: Assign a motor speed

set to each temperature set

Page 260: Fuzzy mathematics:An application oriented introduction

Example: Build a Fuzzy System

• Rules– If temperature is cold then motor speed stop– If temperature is cool then motor speed slows– If temperature is just right then motor speed is

medium– If temperature is warm then motor speed is

fast– If temperature is hot then motor speed blasts

Page 261: Fuzzy mathematics:An application oriented introduction

Example: Build a Fuzzy System

• Fuzzy Relation

Page 262: Fuzzy mathematics:An application oriented introduction

Example: Build a Fuzzy System

• Fuzzy system with 5 patches

Page 263: Fuzzy mathematics:An application oriented introduction

Example: temp. = 65 degree F. If temperature is just right then motor speed is medium

Page 264: Fuzzy mathematics:An application oriented introduction

Example: temp. = 63 degree F.

– If temperature is cool then motor speed slows

– If temperature is just right then motor speed is medium

Page 265: Fuzzy mathematics:An application oriented introduction

Example: t = 63 degree F. (Cont.)

Page 266: Fuzzy mathematics:An application oriented introduction

Example: t = 63 degree F. (Cont.)• Summed (MAXed) of the partially

fired then-part fuzzy sets

OR OUTPUT

Page 267: Fuzzy mathematics:An application oriented introduction

Example: t = 63 degree F. (Cont.)• Defuzzify to find the output motor

speed

Page 268: Fuzzy mathematics:An application oriented introduction

Defuzzification• Convert fuzzy grade to Crisp output

Page 269: Fuzzy mathematics:An application oriented introduction

Example: Defuzzification• Find an estimate crisp output from the

following 3 membership functions

Page 270: Fuzzy mathematics:An application oriented introduction

Example: Defuzzification• CENTROID

Page 271: Fuzzy mathematics:An application oriented introduction

Example: Defuzzification• Weighted Average

Page 272: Fuzzy mathematics:An application oriented introduction

Example: Defuzzification• Mean-Max

Z* = (6+7)/2 = 6.5

Page 273: Fuzzy mathematics:An application oriented introduction

Example: Defuzzification• Center of largest area

– Same as the centroid method because the complete output fuzzy set is convex

Page 274: Fuzzy mathematics:An application oriented introduction

Example: Defuzzification• First and Last of maxima

Page 275: Fuzzy mathematics:An application oriented introduction

Defuzzification• Of the seven defuzzification methods

presented, which is the best?– It is context or problem-dependent

Page 276: Fuzzy mathematics:An application oriented introduction

Defuzzification: Criteria• Hellendoorn and Thomas specified 5

criteria against which to measure the methods– #1 Continuity

• Small change in the input should not produce the large change in the output

– #2 Disambiguity• Defuzzification method should always result in a

unique value, I.e. no ambiguity– Not satisfied by the center of largest area!

Page 277: Fuzzy mathematics:An application oriented introduction

Defuzzification: Criteria (Cpnt.)

• Hellendoorn and Thomas specified 5 criteria against which to measure the methods– #3 Plausibility

• Z* should lie approximately in the middle of the support region and have high degree of membership

– #4 Computational simplicity• Centroid and center of sum required complex

computation!– #5 Constitutes the difference between

centroid, weighted average and center of sum• Problem-dependent, keep computation simplicity

Page 278: Fuzzy mathematics:An application oriented introduction
Page 279: Fuzzy mathematics:An application oriented introduction

Example: Furnace Temperature Control• Inputs

– Temperature reading from sensor– Furnace Setting

• Output– Power control to motor

Page 280: Fuzzy mathematics:An application oriented introduction

MATLAB: Create membership functions - Temp

Page 281: Fuzzy mathematics:An application oriented introduction

MATLAB: Create membership functions - Setting

Page 282: Fuzzy mathematics:An application oriented introduction

MATLAB: Create membership functions - Power

Page 283: Fuzzy mathematics:An application oriented introduction

If - then - RulesFuzzy Rules for Furnace control

SettingTemp Low Medium High

Cold Low Medium HighCool Low Medium High

Moderate Low Low LowWarm Low Low LowHot low Low Low

Page 284: Fuzzy mathematics:An application oriented introduction

Antecedent Table

Page 285: Fuzzy mathematics:An application oriented introduction

Antecedent Table• MATLAB

– A = table(1:5,1:3);• Table generates matrix represents a table

of all possible combinations

Page 286: Fuzzy mathematics:An application oriented introduction

Consequence Matrix

Page 287: Fuzzy mathematics:An application oriented introduction

Evaluating Rules with Function FRULE

Page 288: Fuzzy mathematics:An application oriented introduction

Design Guideline (Inference)

• Recommend—Max-Min (Clipping) Inference method

be used together with the MAX aggregation operator and the MIN AND method

—Max-Product (Scaling) Inference method be used together with the SUM aggregation operator and the PRODUCT AND method

Page 289: Fuzzy mathematics:An application oriented introduction

Example: Fully Automatic Washing Machine

Page 290: Fuzzy mathematics:An application oriented introduction

Example: Fully Automatic Washing Machine

• Inputs—Laundry Softness—Laundry Quantity

• Outputs—Washing Cycle—Washing Time

Page 291: Fuzzy mathematics:An application oriented introduction

Example: Input Membership functions

Page 292: Fuzzy mathematics:An application oriented introduction

Example: Output Membership functions

Page 293: Fuzzy mathematics:An application oriented introduction

Example: Fuzzy Rules for Washing Cycle

Quantity

SoftnessSmall Medium Large

Soft Delicate Light Normal

NormalSoft

Light Normal Normal

NormalHard

Light Normal Strong

Hard Light Normal Strong

Page 294: Fuzzy mathematics:An application oriented introduction

Example: Control Surface View (Clipping)

Page 295: Fuzzy mathematics:An application oriented introduction

Example: Control Surface View (Scaling)

Page 296: Fuzzy mathematics:An application oriented introduction

Example: Control Surface View

ScalingClipping

Page 297: Fuzzy mathematics:An application oriented introduction

Example: Rule View (Clipping)

Page 298: Fuzzy mathematics:An application oriented introduction

Example: Rule View (Scaling)

Page 299: Fuzzy mathematics:An application oriented introduction
Page 300: Fuzzy mathematics:An application oriented introduction

Building a Fuzzy Expert System: Case Study A service centre keeps spare parts and repairs failed

ones. A customer brings a failed item and receives a spare of

the same type. Failed parts are repaired, placed on the shelf, and thus

become spares. The objective here is to advise a manager of the service

centre on certain decision policies to keep the customers satisfied.

Page 301: Fuzzy mathematics:An application oriented introduction

Process of Developing a Fuzzy Expert System

1. Specify the problem and define linguistic variables.

2. Determine fuzzy sets.

3. Elicit and construct fuzzy rules.

4. Encode the fuzzy sets, fuzzy rules and procedures to perform fuzzy inference into the expert system.

5. Evaluate and tune the system.

Page 302: Fuzzy mathematics:An application oriented introduction

There are four main linguistic variables: average waiting time (mean delay) m, repair utilization factor of the service centre (is the ratio of the customer arrival day to the customer departure rate) number of servers s, and initial number of spare parts n .

Step 1: Specify the problem and define linguistic variables

Page 303: Fuzzy mathematics:An application oriented introduction

Linguistic variables and their rangesLinguistic Va lue Notation Numerical Range (normalised)

Very ShortShortMedium

VSSM

[0, 0.3][0.1, 0.5][0.4, 0.7]

Linguistic Va lue Notation

Notation

Numerical Range (normalised)SmallMediumLarge

SML

[0, 0.35][0.30, 0.70]

[0.60, 1]

Linguistic Va lue Numerical RangeLowMediumHigh

LMH

[0, 0.6][0.4, 0.8][0.6, 1]

Linguistic Va lue Notation Numerical Range (normalised)Very SmallSmallRather SmallMediumRather LargeLargeVery Large

VSS

RSMRLL

VL

[0, 0.30][0, 0.40]

[0.25, 0.45][0.30, 0.70][0.55, 0.75]

[0.60, 1][0.70, 1]

Linguistic Variable: Mean Delay, m

Linguistic Variable: Number of Servers, s

Linguistic Variable: Repair Utilisation Factor,

Linguistic Variable: Number of Spares, n

Page 304: Fuzzy mathematics:An application oriented introduction

Step 2: Determine Fuzzy Sets

Fuzzy sets can have a variety of shapes. However, a triangle or a trapezoid can often provide an adequate representation of the expert knowledge, and at the same time, significantly simplifies the process of computation.

Page 305: Fuzzy mathematics:An application oriented introduction

Fuzzy sets of Mean Delay m

0.10

1.0

0.0

0.2

0.4

0.6

0.8

0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1Mean Delay (normalised)

SVS M

Degree of Membership

Page 306: Fuzzy mathematics:An application oriented introduction

Fuzzy sets of Number of Servers s

0.10

1.0

0.0

0.2

0.4

0.6

0.8

0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

M LS

Degree of Membership

Page 307: Fuzzy mathematics:An application oriented introduction

Fuzzy sets of Repair Utilisation Factor

0.10

1.0

0.0

0.2

0.4

0.6

0.8

0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1Repair Utilisation Factor

M HL

Degree ofMembership

Page 308: Fuzzy mathematics:An application oriented introduction

Fuzzy sets of Number of Spares n

0.10

1.0

0.0

0.2

0.4

0.6

0.8

0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

S RSVS M RL L VL

Degree ofMembership

Number of Spares (normalised)

Page 309: Fuzzy mathematics:An application oriented introduction

Step 3: Elicit and construct fuzzy rulesTo accomplish this task, we might ask the expert to describe how the problem can be solved using the fuzzy linguistic variables defined previously.

Required knowledge also can be collected from other sources such as books, computer databases, flow diagrams and observed human behavior.

The matrix form of representing fuzzy rules is called fuzzy associative memory (FAM).

Page 310: Fuzzy mathematics:An application oriented introduction

m

s

M

RL

VL

S

RS

L

VS

S

M

MVS S

L

M

S

The square FAM representation

Page 311: Fuzzy mathematics:An application oriented introduction

The rule tableRule m s n Rule m s n Rule m s n

1 VS S L VS 10 VS S M S 19 VS S H VL

2 S S L VS 11 S S M VS 20 S S

S

3 M S L VS 12 M S M VS 21 M S

4 VS M L VS 13 VS M M RS 22 VS M H M

M

M

M

5 S M L VS 14 S M M S 23 S M

6 M M L VS 15 M M M VS 24 M M

7 VS L L S 16 VS L M M 25 VS L H

H

H

H

H

H

RL

8 S L

L

L S 17 S L M RS 26 S L

9 M L L VS 18 M L M S 27 M L H RS

Page 312: Fuzzy mathematics:An application oriented introduction

Rule Base 11. If (utilisation_factor is L) then (number_of_spares is S)2. If (utilisation_factor is M) then (number_of_sparesis M)3. If (utilisation_factor is H) then (number_of_sparesis L)

4. If (mean_delay is VS) and (number_of_serversis S) then (number_of_sparesis VL)5. If (mean_delay is S) and (number_of_serversis S) then (number_of_sparesis L)6. If (mean_delay is M) and (number_of_serversis S) then (number_of_sparesis M)

7. If (mean_delay is VS) and (number_of_serversis M) then (number_of_sparesis RL)8. If (mean_delay is S) and (number_of_serversis M) then (number_of_sparesis RS)9. If (mean_delay is M) and (number_of_serversis M) then (number_of_spares is S)

10. If (mean_delay is VS) and (number_of_servers is L) then (number_of_sparesis M)11. If (mean_delay is S) and (number_of_servers is L) then (number_of_sparesis S)12. If (mean_delay is M) and (number_of_servers is L) then (number_of_sparesis VS)

Page 313: Fuzzy mathematics:An application oriented introduction

Cube FAM of Rule Base 2

VS VS VSVS VS VS

VS VS VSVL L M

HS

VS VS VSVS VS VS

VS VS VSM

VS VS VSVS VS VS

S S VSL

s

LVS S M

m

MH

VS VS VSLVS S M

S

m

VS VS VSM

S S VSL

s

S VS VSMVS S M

m

VS S M

m

S

RS S VSM

M RS SL

s

S

M M SM

RL M RSL

s

Page 314: Fuzzy mathematics:An application oriented introduction

Step 4: Encode the fuzzy sets, fuzzy rules and procedures to perform fuzzy inference into the expert systemTo accomplish this task, we may choose one of two options: to build our system using a programming language such as C/C++, Java, or to apply a fuzzy logic development tool such as MATLAB Fuzzy Logic Toolbox or Fuzzy Knowledge Builder.

Page 315: Fuzzy mathematics:An application oriented introduction

Step 5: Evaluate and Tune the SystemThe last task is to evaluate and tune the system. We want to see whether our fuzzy system meets the requirements specified at the beginning.

Several test situations depend on the mean delay, number of servers and repair utilisation factor.

The Fuzzy Logic Toolbox can generate surface to help us analyse the system’s performance.

317

Page 316: Fuzzy mathematics:An application oriented introduction

However, even now, the expert might not be satisfied with the system performance.

To improve the system performance, we may use additional sets Rather Small and Rather Large on the universe of discourse Number of Servers, and then extend the rule base.

Page 317: Fuzzy mathematics:An application oriented introduction

Modified Fuzzy Sets of Number of Servers s

0.10

1.0

0.0

0.2

0.4

0.6

0.8

0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1Number of Servers (normalised)

RS M RL LS

Degree of Membership

Page 318: Fuzzy mathematics:An application oriented introduction

Cube FAM of Rule Base 3

VS VS VS

VS VS VS

VS VS VS

VS VS VS

VS VS VS

VS VS VS

VS VS VS

VS VS VS

VS VS VS

VS VS VS

VS VS VS

VS VS VS

VS VS VS

S S VS

S S VS

VL L M

VL RL RS

M M S

RL M RS

L M RS

HS

M

RL

L

RS

s

LVS S M

m

MH

VS VS VS

VS VS VS

VS VS VS

S S VS

S S VS

LVS S M

S

M

RL

L

RS

m

s

S VS VS

S VS VS

RS S VS

M RS S

M RS S

MVS S Mm

VS S Mm

S

M

RL

L

RS

s

S

M

RL

L

RS

s

Page 319: Fuzzy mathematics:An application oriented introduction

Fuzzy Control Example

Page 320: Fuzzy mathematics:An application oriented introduction

Input Fuzzy Sets• Angle:- -30 to 30 degrees

Page 321: Fuzzy mathematics:An application oriented introduction

Output Fuzzy Sets• Car velocity:- -2.0 to 2.0 meters

per second

Page 322: Fuzzy mathematics:An application oriented introduction

Fuzzy Rules• If Angle is Zero then output ? • If Angle is SP then output ? • If Angle is SN then output ? • If Angle is LP then output ? • If Angle is LN then output ?

Page 323: Fuzzy mathematics:An application oriented introduction

Fuzzy Rule Table

Page 324: Fuzzy mathematics:An application oriented introduction

Extended System• Make use of additional information

– angular velocity:- -5.0 to 5.0 degrees/ second

• Gives better control

Page 325: Fuzzy mathematics:An application oriented introduction

New Fuzzy Rules• Make use of old Fuzzy rules for

angular velocity Zero• If Angle is Zero and Angular vel is

Zero – then output Zero velocity

• If Angle is SP and Angular vel is Zero – then output SN velocity

• If Angle is SN and Angular vel is Zero – then output SP velocity

Page 326: Fuzzy mathematics:An application oriented introduction

Table Format (FAM)

Page 327: Fuzzy mathematics:An application oriented introduction

Complete Table• When angular velocity is opposite to

the angle do nothing– System can correct itself

• If Angle is SP and Angular velocity is SN – then output ZE velocity

• etc

Page 328: Fuzzy mathematics:An application oriented introduction

Example• Inputs:10 degrees, -3.5

degrees/sec• Fuzzified Values

• Inference Rules

• Output Fuzzy Sets

• Defuzzified Values

Page 329: Fuzzy mathematics:An application oriented introduction

Internet resources used.• www.csee.wvu.edu• www.surrey.ac.uk• http://

www.cs.tamu.edu/research/CFL/fuzzy.html

• L. Zadah, “Fuzzy sets as a basis of possibility” Fuzzy Sets Systems, Vol. 1, pp3-28, 1978.

• T. J. Ross, “Fuzzy Logic with Engineering Applications”, McGraw-Hill, 1995.

• K. M. Passino, S. Yurkovich, "Fuzzy Control" Addison Wesley, 1998.