|
Homework #3
Due: Monday, 10/10/05
1.
Create a fuzzy
toolbox using Matlab or other programming language. The toolbox should
support
the following functionally:
- Define
a fuzzy set (membership function).
- Define
a linguistic variable, assign membership functions to linguistic term
- Fuzzify
a crisp input
- Process
an IF-THEN rule and combine output from multiple rules. A rule may
contain up
to 10 fuzzy premises and one consequent.
- Defuzzify
the output (centroid is required, other methods are optional)
- Select max-min or
max-product inference
Requirements
- You set your own
requirements for
particular
implementation of functions!
- You
cannot use any external library, such
as Fuzzy
Toolbox in Matlab.
- Fuzzy
toolbox should be completely
separate of the
GUI, if such is present
2.Implement a
simple fuzzy controller. Demonstrate a particular solution and a graph
of the
control surface (output vs input).

Position: Left(0,0,10,35),
LeftCenter(30,40,50),
Center(45,50,55), RightCenter(50,60,70), Right(65,90,100,100)

Angle: RBelow(-90,-45,9),
RUpper(-9,23,54), RVertical(36,63,90),
Vertical(72,90,108), LVertical(90,117,144), LUpper(126,157,189),
LBelow(171,225,270)

Output: NegBig(-30,-15), NegMed(-25,-15,-5), NegSm(-12,-6,0),
Zero(-5,0,5),
PosSm(0,6,12), PosMed(5,15,25), PosBig(15,30)
Rules:
|
|
if
position is …
|
and
if angle is …
|
then
output is ..
|
|
1
|
Left
|
RBelow
|
PosSm
|
|
2
|
LeftCenter
|
RBelow
|
PosMed
|
|
3
|
Center
|
RBelow
|
PosMed
|
|
4
|
RightCenter
|
RBelow
|
PosBig
|
|
5
|
Right
|
RBelow
|
PosBig
|
|
6
|
Left
|
RUpper
|
NegSm
|
|
7
|
LeftCenter
|
RUpper
|
PosSm
|
|
8
|
Center
|
RUpper
|
PosMed
|
|
9
|
RightCenter
|
RUpper
|
PosBig
|
|
10
|
Right
|
RUpper
|
PosBig
|
|
11
|
Left
|
RVertical
|
NegMed
|
|
12
|
LeftCenter
|
RVertical
|
NegSm
|
|
13
|
Center
|
RVertical
|
PosSm
|
|
14
|
RightCenter
|
RVertical
|
PosMed
|
|
15
|
Right
|
RVertical
|
PosBig
|
|
16
|
Left
|
Vertical
|
NegMed
|
|
17
|
LeftCenter
|
Vertical
|
NegMed
|
|
18
|
Center
|
Vertical
|
Zero
|
|
19
|
RightCenter
|
Vertical
|
PosMed
|
|
20
|
Right
|
Vertical
|
PosMed
|
|
21
|
Left
|
LVertical
|
NegBig
|
|
22
|
LeftCenter
|
LVertical
|
NegMed
|
|
23
|
Center
|
LVertical
|
NegSm
|
|
24
|
RightCenter
|
LVertical
|
PosSm
|
|
25
|
Right
|
LVertical
|
PosMed
|
|
26
|
Left
|
LUpper
|
NegBig
|
|
27
|
LeftCenter
|
LUpper
|
NegBig
|
|
28
|
Center
|
LUpper
|
NegMed
|
|
29
|
RightCenter
|
LUpper
|
NegSm
|
|
30
|
Right
|
LUpper
|
PosSm
|
|
31
|
Left
|
LBelow
|
NegBig
|
|
32
|
LeftCenter
|
LBelow
|
NegBig
|
|
33
|
Center
|
LBelow
|
NegMed
|
|
34
|
RightCenter
|
LBelow
|
NegMed
|
|
35
|
Right
|
LBelow
|
MegSm
|
Plot the control surface of Mamdani
controller for
the range of values:
-position
0
to 100
-angle
-90
to 270
Repeat for
Larsen controller.
An example of a control surface is given below

Grading criteria:
1. Correctness of fuzzy
inference
2. Satisfaction of
the HW
requirements and
functionality
3. Stability
Note: this
homework is essential for
further studies. You must fully complete it to be able to work on the
homeworks
that follow.
|