Professional Documents
Culture Documents
Lecture 19
Fuzzy Logic System: The tipping problem
• Introduction
• Example: The tipping problem
Fuzzy Logic
A computational paradigm that is based on how humans think
Fuzzy Logic looks at the world in imprecise terms, in much the same way
that our brain takes in information (e.g. temperature is hot, speed is slow),
then responds with precise actions.
The human brain can reason with uncertainties, vagueness, and judgments.
Computers can only manipulate precise valuations. Fuzzy logic is an attempt
to combine the two techniques.
FL is in fact, a precise problem-solving methodology.
Fuzzy Logic
A technique that facilitates the control of a complicated system without
knowledge of its mathematical description.
Fuzzy logic differs from classical logic in that statements are no longer black
or white, true or false, on or off. In traditional logic an object takes on a
value of either zero or one. In fuzzy logic, a statement can assume any real
value between 0 and 1, representing the degree to which an element belongs
to a given set.
History of Fuzzy Logic
Fuzzy Logic is one of the most talked-about technologies to hit the embedded
control field in recent years. It has already transformed many product markets in
Japan and Korea, and has begun to attract a widespread following In the United
States. Industry watchers predict that fuzzy technology is on its way to becoming a
multibillion-dollar business.
Sample Applications
For washing machines, Fuzzy Logic control is almost becoming a
standard feature
https://www.samsung.com/in/support/home-appliances/what-is-fuzzy-logic-in-a-washing-machine/
Basic Tipping Problem
To illustrate the value of fuzzy logic, examine both linear(non-
fuzzy) and fuzzy approaches to the following problem:
Below the diagram is the name of the system and the type of inference
used. The default, Mamdani-type inference, is what we'll continue to
use for this example.
Below the name of the fuzzy inference system, on the left side of the
figure, are the pop-up menus that allow you to modify the various
pieces of the inference process.
On the right side at the bottom of the figure is the area that displays the
name of either an input or output variable, its associated membership
function type, and its range.
Basic Tipping Problem: Fuzzy Logic Tool Box
FIS Editor
Basic Tipping Problem: Fuzzy Logic Tool Box
Membership Function Editor
Basic Tipping Problem: Fuzzy Logic Tool Box
Rule Editor
Basic Tipping Problem: Fuzzy Logic Tool Box
Rule Viewer
Basic Tipping Problem: Fuzzy Logic Tool Box
Surface Viewer
Exercise - Conclusions
• Your system is now “complete” and ready to be tested.
1. Try to save the system to your home directory. When you save a fuzzy system to disk, you're saving an ASCII text
FIS file representation of that system with the file suffix .fis. If you do not save your FIS to your disk, but only
save it to the MATLAB workspace, you will not be able to recover it for use in a new MATLAB session.
2. Use the Rule Viewer to test your system with different inputs.
3. Think again about the input and output fuzzy sets. Try to change the shapes and ranges of each (or some) of the
sets to see how this will affect the output.
4. Try to add a new input financial status to the system, which describes the financial status of the customer: ranging
from 0 for poor, to 10 for rich.
5. Think about the new rules you need to construct and add the new rules to the system (e.g. poor financial status
cheap tip, rich financial status generous tip).
6. See how the output is now affected by the new input.
Practice using Python and Matlab
https://pythonhosted.org/scikit-
fuzzy/auto_examples/plot_tipping_problem_newapi.html
https://www.mathworks.com/help/fuzzy/building-systems-with-fuzzy-logic-
toolbox-software.html
https://pythonhosted.org/scikit-
fuzzy/auto_examples/plot_tipping_problem_newapi.html
Thankyou