Fuzzy mathematics:An application oriented introduction
-
Upload
nagasuri-bala-venkateswarlu -
Category
Engineering
-
view
619 -
download
1
Transcript of 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
Thanks a lot for Inviting.
I am not a Mathematician!!!.I am an Engineering teacher.
Thus, my talk will be more application oriented!!!. Of course, I am a great Mathematics fan.
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.
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.
Do forgive me for not using standardized notations in the presentation.
The syllabus of your course seems to be too fuzzy!!!!.
A simple satire, do take it in light manner.
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.
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)(
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
Is rose is RED? Is rose is not RED?.
Is rose is not RED?.
Traditional (crisp) logic
Traditional (crisp) logic
What about this rose?. Is rose is not RED?.
What color is this leopard?
Is this glass full or empty?
Where do tall people start?
A tall guy
Crisp
Crisp
Are bowls having oranges?.
Fuzzy
Are bowls are full of Apples?.
Thus, fuzzy can be said as imprecise or not clear cut.
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".
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.
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”
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
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 -
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?
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
Some More Membership functions (figure from Klir&Yuan)
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?
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?
• 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
Linguistic variables: Our report to the physician.• High fever • frequent coughing.• Shaking,• Too chilling• Hardly, I can move
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.
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."
Membership Functions• How cool is 36 F° ?
50 70 90 1103010
Temp. (F°)
Freezing Cool Warm Hot
0
1
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
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.
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.
• 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.
Fuzzy Logic: Motivations
Fuzzy Logic: Motivations
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!
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
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
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
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
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
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.
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
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.
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.
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
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]?
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).
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.
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.
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.
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.
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.
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.
Fuzzy Set Definitions
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.
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
Features of the Membership Function
(Cont.)• Normal Fuzzy Set : at least one element
x in the universe whose membership value is unity
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) ]
Features of the Membership Function
(Cont.)• Cross-over points :
a (x) = 0.5
• Height: defined as max {a (x)}
Fuzzy Set (figure from Earl Cox)
Definitions – fuzzy sets (figure from Klir&Yuan)
Definitions: Fuzzy Sets (figure from Klir&Yuan)
Fuzzy set (figure from Earl Cox)
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)
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
Inference• Use knowledge to perform deductive
reasoning, i.e . we wish to deduce or infer a conclusion, given a body of facts and knowledge.
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
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
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
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
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
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*
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*
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
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
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
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
Girl-Student Membership Function for “Young”
xif
xifxxif
xS
400
402515
40251
Membership Function for “Young”
xif
xifxxif
xB
700
704030
70401
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.
Rank ordering: Example
Fuzzy Set Operations
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.
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}
Operations of Fuzzy Sets
Intersection Union
Complement
Not A
A
Containment
AA
B
BA BAA B
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)
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.
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
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
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 )
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)
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
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
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
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
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}
Alpha levels, core, support, normal
z
zz z z zz
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))
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}
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}• …
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}
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
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}
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}
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
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}
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}
Formal Definitions
Numerical Example
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)).
Operations
A B
A B A B A
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)
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)
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
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:
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
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
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
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
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
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
1
Triangular fuzzy numbers
1 ( / / )z z z z
zz 1z
1 1; 0 1, ,[ ] [ ] [ ] [ ]z z z z z z
Fuzzy Number (figure from Klir&Yuan)
B. Operations on Fuzzy Sets: Union and Intersection (figure from Klir&Yuan)
Operations on Fuzzy Sets: Intersection (figure from Klir&Yuan)
Operations on Fuzzy Sets: Union and Complement (figure from Klir&Yuan)
C. Operations on Fuzzy Numbers: Addition and Subtraction (figure from Klir&Yuan)
Operations on Fuzzy Numbers: Multiplication and Division (figure from Klir&Yuan)
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
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
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
Extension Principle - Example
Let f(x) = ax+b,
23/15/86Then .6 and ,5/3/2 ,3/2/1
BAf(x)xBbAa
FUZZY RELATIONS, FUZZY GRAPHS, AND FUZZY ARITHMETIC
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!
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!)
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
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
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
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))
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
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
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
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
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
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)
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 ))
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}
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.
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)
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
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
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
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)
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
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
A peep into Fuzzy Control System
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”
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
Digital Control System Configuration
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).
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).
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
Can you re-collect gradient descent procedures?Newton-Raphson method?
Fuzzy ControlFuzzy control provides a formal methodology for representing, manipulating, and implementing a human’s heuristic knowledge about how to control a system.
Fuzzy Systems
How can fuzzy systems be used in a world where measurements and actions are expressed as crisp
values?
Fuzzy Systems
Fuzzy Knowledge base
Input Fuzzifier InferenceEngine DefuzzifierOutput
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
Fuzzy Control Systems
Fuzzy Knowledge base
Fuzzifier InferenceEngine Defuzzifier Plant Output
Input
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.
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.
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
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
Fuzzy Logic ControlType of Fuzzy Controllers:
• Mamdani• Larsen• TSK (Takagi Sugeno Kang)• Tsukamoto• Other methods
Fuzzy Control Systems
MamdaniFuzzy models
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.
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.
Operation of Fuzzy System Crisp Input
Fuzzy Input
Fuzzy Output
Crisp Output
Fuzzification
Rule Evaluation
Defuzzification
Input Membership Functions
Rules / Inferences
Output Membership Functions
Knowledge as Rules is the basis of FAT
• Every term in one of our rules is Fuzzy
• Every term is vague, hazy, inexact, sloppy
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
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
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.
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
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
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
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
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
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
• 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.
Designing Antecedent Membership Functions
A Membership Function Design that violates the second principle
Designing Antecedent Membership Functions
A Membership Function Design that violates both principle
Designing Antecedent Membership Functions
A symmetric Function Design Following the guidelines
Some Hints while designing Membership Functions in practice.
An asymmetric Function Design Following the guidelines
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.
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)]
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)
• 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.
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.
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
Graphical Technique of Mamdani (Max-Min]
Inference• If x1
k is A1k and x2
k is A2k Then Yk is
Bk
Graphical Technique of Max-Product Inference
• If x1k is A1
k and x2k is A2
k Then Yk is Bk
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.
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
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.
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
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
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
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
Defuzzification (Cont.)• Max-membership principal
– Also known as height method
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
Defuzzification (Cont.)• Mean-max membership (middle of
maxima)– Maximum membership is a plateau
Z* = a + b2
Defuzzification (Cont.)• Center of Largest area
– If the output fuzzy set has at least two convex sub-region, defuzzify the largest area using centroid
Defuzzification (Cont.)• First (or last) of maxima
– Determine the smallest value of the domain with maximized membership degree
A simple Fuzzy Control system.• Example: Speed Control• How fast am I going to drive
today?• It depends on the weather.
Inputs: Temperature • Temp: {Freezing, Cool, Warm, Hot}
50 70 90 1103010
Temp. (F°)
Freezing Cool Warm Hot
0
1
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
Output: Speed• Speed: {Slow, Fast}
50 75 100250
Speed (mph)
Slow Fast
0
1
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...
Example Speed Calculation• How fast will I go if it is
– 65 F°– 25 % Cloud Cover ?
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
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
...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
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
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
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
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
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
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
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
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
Example: Build a Fuzzy System
• Input Fuzzy set
Example: Build a Fuzzy System
• Output Fuzzy set
Example: Build a Fuzzy System
• Design motor speed controller for air conditioner–Step 3: Assign a motor speed
set to each temperature set
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
Example: Build a Fuzzy System
• Fuzzy Relation
Example: Build a Fuzzy System
• Fuzzy system with 5 patches
Example: temp. = 65 degree F. If temperature is just right then motor speed is medium
Example: temp. = 63 degree F.
– If temperature is cool then motor speed slows
– If temperature is just right then motor speed is medium
Example: t = 63 degree F. (Cont.)
Example: t = 63 degree F. (Cont.)• Summed (MAXed) of the partially
fired then-part fuzzy sets
OR OUTPUT
Example: t = 63 degree F. (Cont.)• Defuzzify to find the output motor
speed
Defuzzification• Convert fuzzy grade to Crisp output
Example: Defuzzification• Find an estimate crisp output from the
following 3 membership functions
Example: Defuzzification• CENTROID
Example: Defuzzification• Weighted Average
Example: Defuzzification• Mean-Max
Z* = (6+7)/2 = 6.5
Example: Defuzzification• Center of largest area
– Same as the centroid method because the complete output fuzzy set is convex
Example: Defuzzification• First and Last of maxima
Defuzzification• Of the seven defuzzification methods
presented, which is the best?– It is context or problem-dependent
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!
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
Example: Furnace Temperature Control• Inputs
– Temperature reading from sensor– Furnace Setting
• Output– Power control to motor
MATLAB: Create membership functions - Temp
MATLAB: Create membership functions - Setting
MATLAB: Create membership functions - Power
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
Antecedent Table
Antecedent Table• MATLAB
– A = table(1:5,1:3);• Table generates matrix represents a table
of all possible combinations
Consequence Matrix
Evaluating Rules with Function FRULE
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
Example: Fully Automatic Washing Machine
Example: Fully Automatic Washing Machine
• Inputs—Laundry Softness—Laundry Quantity
• Outputs—Washing Cycle—Washing Time
Example: Input Membership functions
Example: Output Membership functions
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
Example: Control Surface View (Clipping)
Example: Control Surface View (Scaling)
Example: Control Surface View
ScalingClipping
Example: Rule View (Clipping)
Example: Rule View (Scaling)
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.
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.
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
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
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.
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
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
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
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)
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).
m
s
M
RL
VL
S
RS
L
VS
S
M
MVS S
L
M
S
The square FAM representation
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
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)
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
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.
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
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.
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
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
Fuzzy Control Example
Input Fuzzy Sets• Angle:- -30 to 30 degrees
Output Fuzzy Sets• Car velocity:- -2.0 to 2.0 meters
per second
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 ?
Fuzzy Rule Table
Extended System• Make use of additional information
– angular velocity:- -5.0 to 5.0 degrees/ second
• Gives better control
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
Table Format (FAM)
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
Example• Inputs:10 degrees, -3.5
degrees/sec• Fuzzified Values
• Inference Rules
• Output Fuzzy Sets
• Defuzzified Values
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.