Title: MatLab Fuzzy Logic Toolbox An End User Programming Environment
1MatLab Fuzzy Logic Toolbox - An End User
Programming Environment
- Presented By
- Karlene Williams
2Agenda
- What is Fuzzy Logic?
- What is MatLab Fuzzy Logic Toolbox For?
- Who is MatLab Fuzzy Logic Toolbox For?
- Overview Fuzzy Inference Systems
- Fuzzy Set Concept
- Fuzzy Rules
- Membership functions
- How it works
- Building Systems An Example
- Demo
- Discussion
3What Is Fuzzy Logic?
As complexity rises, precise statements lose
meaning and meaningful statements lose
precision
- Lotfi Zadeh
4What Is Fuzzy Logic? (Cont.)
- Fuzzy logic is all about the relative importance
of precision How important is it to be exactly
right when a rough answer will do?
5What Is Fuzzy Logic?(Cont.)
- Fuzzy logic trades off between significance and
precision - The Fuzzy Logic Toolbox for use with MATLAB is a
tool for solving problems with fuzzy logic. - Fuzzy logic is a convenient way to map an input
space to an output space. E.g. Tell me how good
your service was at a restaurant, and Ill tell
you what the tip should be.
6What Is MatLab Fuzzy Logic Toolbox For?
- The Fuzzy Logic Toolbox allows you to create and
edit fuzzy inference systems. - Systems can be created using
- Graphical tools or
- Command-line functions
- Features
- High-level script language with interpreter.
- Huge library of functions and scripts.
- Act as an computing environment that combines
numeric computation, advanced graphics and
visualization.
7More Features
- Underlying data structure is a multi-dimensional
array (e.g., scalar, vector, or matrix) - Case sensitive variables
- Operator precedence. E.g. logical (AND, OR, NOT,
etc) - Object oriented capabilities
- Variable number of input and output arguments
- Use interactively or as programming language
(interpreted or compiled)
8More Features
- Can link to other languages (e.g., compiled C
code) - Comprehensive help facility
- Conditionals, looping, functions, globals, etc
- Fast prototyping
- Large number of included examples
- Typically not for real-time operation
- Data analysis visualisation
- GUI interaction
9Who Is MatLab Fuzzy Logic Toolbox For?
- Ideal for engineers, researchers and educators!
- Experienced fuzzy logic designers should find it
easy to use the system to research, model, test,
and visualize highly complex systems.
10Overview Fuzzy Inference Systems
- Fuzzy inference - process of formulating the
mapping from a given input to an output using
fuzzy logic. - The mapping provides a basis from which decisions
can be made, or patterns discerned. - DOMAIN Fuzzy inference systems have been
successfully applied in fields such as automatic
control, data classification, decision analysis
and expert systems.
11Fuzzy Set Concept
- A fuzzy set is a set without a crisp, clearly
defined boundary. It can contain elements with
only a partial degree of membership. E.g.
classifying the weekend days
12Fuzzy Rules
If-Then Rules statements are used to
formulate the conditional statements that
comprise fuzzy logic. E.g. If service is
poor or the food is rancid, then tip is cheap
13Membership Functions
- A membership function (MF) is a curve that
defines how each point in the input space is
mapped to a membership value (or degree of
membership) between 0 and 1.
14How It Works
- Four Steps
- Step 1. Fuzzify inputs (fuzzification)
- Step 2. Rule evaluation
- Step 3. Aggregation of rule outputs
- Step 4. Defuzzify
15 Step 1 Fuzzify Inputs
- Take crisp inputs and determine the degree to
which they belong to each of the appropriate
fuzzy sets (via membership functions).
Thus the food is delicious to the degree 0.7
16 Step 2 Rule Evaluation
- Process of mapping one or more input(s) to a
single number that represents the result of the
evaluation.This number is then applied to the
output membership function.
17Step 3 Aggregate All Outputs
- Aggregation is the process by which the outputs
of all rules are unified. - The membership functions that represent the
outputs of each rule are combined into a single
fuzzy set.
18Aggregate All Outputs (Cont)
19Step 4 Defuzzify
- The final output of the fuzzy system must be
- a crisp number. For this process
- The input ? aggregate output from step 3
- The output ? a single number
20Defuzzification (Cont)
21Building Systems With the Fuzzy Logic Toolbox
22Building Systems With the Fuzzy Logic Toolbox
(Cont.)
- There are five GUI tools
- The Fuzzy Inference System or FIS Editor
- Handles the high-level issues How many input and
output variables? What are their names? - The Membership Function Editor
- Used to define the shapes of membership functions
associated with each variable. - The Rule Editor
- for editing the list of rules that defines the
behavior of the system.
23Building Systems With the Fuzzy Logic Toolbox
(Cont.)
- 4. The Rule Viewer
- Shows which rules are active, or how individual
membership function shapes are influencing the
results. - 5. The Surface Viewer
- Generates and plots an output surface map for the
system.
24Building Systems An Example
The Basic Tipping Problem Given a number
between 0 and 10 that represents the quality of
service at a restaurant (where 10 is excellent),
and another number between 0 and 10 that
represents the quality of the food at that
restaurant (again, 10 is excellent), what
should the tip be?
25Step 1 Define Rules
- 1. If the service is poor or the food is rancid,
then tip is cheap. - 2. If the service is good, then tip is average.
- 3. If the service is excellent or the food is
delicious, then tip is - generous.
- Assume that
- an average tip is 15,
- a generous tip is 25, and
- a cheap tip is 5.
26User Interface Layout Getting Started
27User Interface Layout FIS Editor
28UI Layout MF Editor - Service
29UI Layout MF Editor - Food
30UI Layout MF Editor - Tip
31User Interface Layout Rule Editor
32User Interface Layout Rule Viewer
33User Interface Layout Surface Viewer
34DEMO ?
35Questions ?
36Discussion Points
- System features supplement cognitive resources
- (design features can be used effectively by
users with different levels of - cognitive resources ).
37Notes
- Low viscosity a single change usually Requires
no further actions to restore consistency. The
GUIs are dynamically linked, in that changes you
make to the FIS using one of them, are
automatically propagated across the others. - Hard mental operations
- The use of the variable Params is not clear.
Im still trying to figure exactly what it means. - Cant figure out how to undo changes made to
membership functions. Hace to exit without saving
and open FIS again. - Must specify MF Range before entering Params
(otherwise strange things happen!)
38A Note on Usability
- Ease of use
- - learning (easy to learn)
- - remembering (facilitates a high level of
recall) -
- Effectiveness
- - time (rapid development)
- - errors (few errors)
- - usefulness (can achieve its desired goal)
39The End