Upload
kumiko
View
19
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Fuzzy Logic. Homework 6. Membership Function. Min. “Temperature is low” AND “Temperature is middle”. Max. “Temperature is low” OR “Temperature is middle”. Homework 6. Fuzzy Logic. Membership Function. Algebraic product. “Temperature is low” AND “Temperature is middle”. Algebraic sum. - PowerPoint PPT Presentation
Citation preview
Lecture 9
Introduction to Neural Networksand Fuzzy Logic
President University Erwin Sitompul NNFL 9/1
Dr.-Ing. Erwin SitompulPresident University
http://zitompul.wordpress.com2 0 1 3
President University Erwin Sitompul NNFL 9/2
( )T T( )Tl T ( )Tm T
( C)T
1
“Temperature is low” AND “Temperature is middle”( )T T
( )Tl T ( )Tm T
( C)T
1
“Temperature is low” OR “Temperature is middle”
Min
Max
Membership FunctionFuzzy Logic
Homework 6
President University Erwin Sitompul NNFL 9/3
( )T T( )Tl T ( )Tm T
( C)T
1
“Temperature is low” AND “Temperature is middle”( )T T
( )Tl T ( )Tm T
( C)T
1
“Temperature is low” OR “Temperature is middle”
Algebraic product
Algebraic sum
Homework 6Membership FunctionFuzzy Logic
President University Erwin Sitompul NNFL 9/4
( )T T( )Tl T ( )Tm T
( C)T
1
“Temperature is low” AND “Temperature is middle”( )T T
( )Tl T ( )Tm T
( C)T
1
“Temperature is low” OR “Temperature is middle”
Bounded product
Bounded sum
Homework 6Membership FunctionFuzzy Logic
President University Erwin Sitompul NNFL 9/5
Further Fuzzy Set Operations
2
1/ 2
3
( ) ( )( ) ( )( ) ( )
very A A
morl A A
extremely A A
x xx xx x
1/3
( ) 1 ( )( ) ( )
not A A
slightly A A
x xx x
Fuzzy ControlFuzzy Logic
Dilation
Concentration
President University Erwin Sitompul NNFL 9/6
Fuzzy Control LoopFuzzy ControlFuzzy Logic
President University Erwin Sitompul NNFL 9/7
Prior to fuzzy control, the followings must be defined: Fuzzy membership functions Fuzzy logic operators Fuzzy rules, including fuzzy linguistic value and
linguistic variable The processing steps in a fuzzy control include:
Fuzzification Implication / Inference Core Accumulation Defuzzification
Fuzzy ControlFuzzy Logic
Fuzzy Inference
President University Erwin Sitompul NNFL 9/8
Fuzzy ControlFuzzy Logic
Fuzzy Rules Example of a fuzzy rule while “Driving a Car”:
“IF the distance to the car in front is small, AND the distance is decreasing slowly, THEN decelerate quite big”
The question that arises:Given a certain distance and a certain change of distance, what (crisp) value of acceleration should we select?
President University Erwin Sitompul NNFL 9/9
Definition of Fuzzy Membership Functions
v. small
Distance
small perfect big v. big moderate
Distance decrease
slow fast very fastv. slow
Acceleration
–small zero+small +big–big
Fuzzy ControlFuzzy Logic
President University Erwin Sitompul NNFL 9/10
FuzzificationObservation/measurement
Observation/measurement
• Distance between small and perfect
• Distance decrease can be moderate or fast
• What acceleration should be applied?
Fuzzy ControlFuzzy Logic
v. small
Distance
small perfect big v. big moderate
Distance decrease
slow fast very fastv. slow
Acceleration
–small zero+small +big–big
10 m 4m s
President University Erwin Sitompul NNFL 9/11
RULE 1:IF distance is small THEN decelerate small
0.55
Inference core: ClippingClip the fuzzy membership function of “–small” at the height given by the premises (0.55). Later, the clipped area will be considered in the final decision
Implication of RulesFuzzy ControlFuzzy Logic
v. small
Distance
small perfect big v. big
Observation/measurement
Acceleration
–small zero +small +big–big
10 m
President University Erwin Sitompul NNFL 9/12
RULE 2:IF distance decrease is moderate THEN keep the speed
Inference core: ClippingClip the fuzzy membership function of “zero” at the height given by the premises (0.7). Later, the clipped area will be considered in the final decision
Implication of RulesFuzzy ControlFuzzy Logic
Observation/measurement
Acceleration
–small zero+small +big–bigmoderate
Distance decrease
slow fast very fastv. slow
0.7
4m s
President University Erwin Sitompul NNFL 9/13
From each rule, a clipped area is obtained. But, in the end only one single output is wanted. How do we make a final decision?
–small zero+small +big–big
Acceleration
Accumulation
Rule 1Rule 2
Fuzzy ControlFuzzy Logic
In the accumulation (aggregation) step, all clipped areas are merged into one merged area (taking the union).
Rules with high premises will contribute large clipped area to the merged area. These rules will “pull” that merged area towards their own central value.
President University Erwin Sitompul NNFL 9/14
–small zero+small +big–big
Acceleration
In this last step, the returned value is the wanted acceleration.
Out of many possible ways, the center of gravity is the commonly used method in defuzzification.
Crisp value
2. . 2.3m si e Center of gravity
Fuzzy ControlFuzzy Logic
Defuzzification
President University Erwin Sitompul NNFL 9/15
0.55
acceleration
1. Clipping approach:
0.55
acceleration
2. Scaling approach:
Impl , ( ) min , ( )A B A By y
A
( )B y
Fuzzification value Membership function
Impl , ( ) ( )A B A By y
A
( )B y
Min-Operator
Algebraic Product
Fuzzy ControlFuzzy Logic
Inference Core There are two approaches that can be used for
inference core:
President University Erwin Sitompul NNFL 9/16
Rectangle Triangle
Fuzzy ControlFuzzy Logic
Review on Center of Gravity
President University Erwin Sitompul NNFL 9/17
Isosceles Trapezoid Trapezoid
Fuzzy ControlFuzzy Logic
Review on Center of Gravity
President University Erwin Sitompul NNFL 9/18
Summary of Fuzzy ControlFuzzy ControlFuzzy Logic
1. Fuzzify inputs, determine the degree of membership for all terms in the premise.
2. Apply fuzzy logic operators, if there are multiple terms in the premise (min-max, algebraic, bounded).
3. Apply inference core (clipping, scaling, etc.)4. Accumulate all outputs (union operation i.e. max,
sum, etc.)5. Defuzzify (center of gravity of the merged outputs,
max-method, modified center of gravity, height method, etc)
President University Erwin Sitompul NNFL 9/19
Limitations of Fuzzy ControlFuzzy ControlFuzzy Logic
Definition and fine-tuning of membership functions need experience (covered range, number of MFs, shape).
Defuzzification may produce undesired results (needs redefinition of membership functions).
President University Erwin Sitompul NNFL 9/20
Homework 7
v. small
Distance to next car [m]
small perfect big v. big
0 5 10 15 20 25
1
Speed change [m/s2]
constant growingdeclining
–small zero +small +big–big
Acceleration adj. [m/s2] –2 –1 0 1 2
1
–10 –5 0 5 10
1
Fuzzy ControlFuzzy Logic
A fuzzy controller is to be used in driving a car. The fuzzy membership functions for the two inputs and one output are defined as below.
President University Erwin Sitompul NNFL 9/21
Homework 7 (Cont.)Fuzzy ControlFuzzy Logic
A fuzzy controller is to be used in driving a car. The fuzzy rules are given as follows.Rule 1: IF distance is small AND speed is declining,
THEN maintain acceleration.Rule 2: IF distance is small AND speed is constant,
THEN acceleration adjustment negative small.Rule 3: IF distance is perfect AND speed is declining,
THEN acceleration adjustment positive small.Rule 4: IF distance is perfect AND speed is constant,
THEN maintain acceleration.
President University Erwin Sitompul NNFL 9/22
Homework 7 (Cont.)Fuzzy ControlFuzzy Logic
Using Min-Max as fuzzy operators, clipping as inference core, union operator as accumulator, and center of gravity method as defuzzifier, find the output of the controller if the measurements confirms that distance to next car is 13 m and the speed is increasing by 2.5 m/s2.
President University Erwin Sitompul NNFL 9/23
Homework 7AFuzzy ControlFuzzy Logic
A driver of an open-air car determine how fast he drives based on the air temperature and the sky conditions. The corresponding fuzzy membership functions can be seen here.
50 70 90 1103010Temperature (°F)
Freezing Cool Warm Hot
0
1
0 40 60 80 100200Cloud Cover (%)
OvercastPartly CloudySunny
0
1
50 75 100250Speed (km/h)
Slow Fast
0
1
President University Erwin Sitompul NNFL 9/24
Homework 7A (Cont.)Fuzzy ControlFuzzy Logic
After years of experience, he summarizes his personal driving rules as follows:Rule 1: IF it is sunny AND warm, THEN drive fast.Rule 2: IF it is partly cloudy AND hot, THEN drive slow.Rule 3: IF it is partly cloudy, THEN drive fast.
You are now assigned to design a fuzzy control with the following requirements: Fuzzy logic operators: algebraic sum / product Inference core: scaling Accumulator: union operator Defuzzification: center of gravity method
The speed limit is 120 km/h. How fast will the driver go if in one day the temperature is 65 °F and the cloud cover is 25 %?