Você está na página 1de 13

Fuzzy Logic Toolbox

Analysis and Design

Contents
Introducing Fuzzy Systems
Fuzzy Sets and Membership Functions
Fuzzy Function
Introducing Fuzzy Logic
Fuzzy Operand
IF-THEN Rule
Fuzzy Inference
Matlab Fuzzy Logic Toolbox
FIS Editor
Simulink Fuzzy Controller
Summery

1
What is Fuzzy Logic?
How important is it to be exactly right when a rough
answer will do?
So far as the laws of mathematics refer to reality, they are
not certain. And so far as they are certain, they do not refer to
reality. Albert Einstein
As complexity rises, precise statements lose meaning and
meaningful statements lose precision. Lotfi Zadeh

Fuzzy Systems
Fuzzy Systems are most human oriented knowledge-
based systems
Fuzzy variables : Linguistic variables
Fuzzy Propositions
IF-THEN Rules

Mathematical representation of a Fuzzy variable is a


Fuzzy Set:
Near to Tehran:
Saveh 0.9
varamin 0.8
Tehran 1
Ahvaz 0

2
Membership Function
Deterministic variable
1 x A
A ( x) =
0 x A
Fuzzy variable
A = set of tall men A (x)
1

0 170 185 200

Membership Function of a Set describes degree of


membership of a value to that set

Fuzzy Function

Membership function changes to a surf for Fuzzy


Functions:
Distance Tehran Ahvaz
Yazd 0.45 0.65
Tehran 1 0.05
x2 y2
or ( 2 + 2 )
F ( x, y ) = e a b

Composition of Fuzzy Functions


FoG ( x, z ) = max (T ( F ( x, y ), G ( y, z )))
yV

3
Fuzzy Logic
Fuzzy Operands:
Fuzzy Complement
C (0) = 1, C (1) = 0
C ( A ) = A
a < b C (a ) > C (b)
Fuzzy Aggregation
S (0, a ) = S ( a,0) = a, S (1, a ) = 1
S ( a, b) = S (b, a )

S ( A , B ) = AU B
a < a ' , b < b ' S ( a , b ) < S ( a ' , b ' )
S ( S (a, b), c) = S (a, S (b, c))
Fuzzy Companion
T (1, a ) = T ( a,1) = a, T (0, a ) = 0
T ( a, b) = T (b, a )
T ( A , B ) = AI B

a < a ' , b < b ' T ( a , b ) < T ( a ' , b ' )
T (T ( a, b), c) = T ( a, T (b, c))

Fuzzy Logic
Some examples of Fuzzy Operands:
Fuzzy Complement
1
CW (a ) = (1 aW ) W

Fuzzy Aggregation
1
SW ( a, b) = min(1, ( aW + bW ) W )

Fuzzy Companion
1

TW (a, b) = 1 min 1, ((1 a)W + (1 b)W ) W

4
Fuzzy Linguistic variables
A Fuzzy phrase consist of :
Fuzzy Variable such as Hot, Tall, Fast,
Fuzzy Adverbs such as Very , More or less,
we can define:

very A = ( A ) 2

more / less A = A

Fuzzy phrase Connectors such as AND, OR, NOT


we use S-Norm for OR
T-Norm for AND
Complement for NOT

IF-THEN Rules

IF-THEN Rules are the mathematical representation of


human knowledge
Each IF-THEN Rule consist of a Premise and a Conclusion
Both Premise and Conclusion are Fuzzy phrases
Admitting traditional representation of IF-THEN rule as:
( p q) ( p q)
We have :
IF (x is A) THEN (y is B) S (C ( A ( x) ), B ( y ) )

But we can say: T ( A ( x), B ( y ) )

5
Fuzzy Inference
Deterministic Logic have its Inferences such as:
1- IF ( x is A ) THEN ( y is B )
2- x is A
So:
y is B

Fuzzy Inferences is an Approximative reasoning :


1- IF ( x is A ) THEN ( y is B )
2- x is C
So:
y is D
Where:
as C goes closer to A D goes closer to B

Fuzzy System Summery


Fuzzy System is the best way to Implement human
knowledge
Fuzzy variables are Linguistic variables and could be
described by Membership Functions
Fuzzy Propositions are the material of a Fuzzy System that
consist of Variables, Adverbs and Connectors
IF-THEN Rules demonstrates the way Human Thinks
Fuzzy Inferences are just the same as the human does his
conclusions with no determination
If we have a set of rules, there are tow way to make result :
Inferences obtained from Combination of Rules
Combination of Inferences makes result

6
Matlab Fuzzy Toolbox
Matlab Fuzzy Toolbox consist of tow useful Tools:
FIS Editor:
This Editor in combination with 4 other editors
provides a powerful environment to define and
modify Fuzzy Inference System (FIS) variable

Fuzzy Controller:
This is a block in Fuzzy Toolbox Library in Simulink
environment. This Block admits FIS variable produced
by FIS Editor and implements the desirable rules

Fuzzy Inference System


Change and Modify
IF-THEN rules Inference settings
Define/Modify

Modifying Input/Output
Membership functions

Visualization of

Easy test for Membership Func.

Input/Output In 2 inputs system

Relationship

7
FIS Diagram
To implement a Fuzzy Inference System, five steps must
be followed :
1. Fuzzification using input membership functions
2. Apply Fuzzy Operand
3. Apply Implication method on each rule
4. Aggregate all Outputs
5. Defuzzification of output set

FIS Editor
Double Click to load other Editors

Add or Remove
Input or Output

Change or
Modify
Inference
settings

8
Membership Function Editor
Change parameter by dragging and scrolling

Add or Remove
Membership
Functions
to or from any
Input or Output

Set Membership
Function
parameters
Manually

Rule Editor

Rule
List

Outputs
Membership
Functions
Inputs
Membership
Functions

Connectors

9
Rule Viewer
Output
Input Values
Values

Output
Sets

Scroll to
Change
Input Values

Surface Viewer

Change
Surface
View settings

Output
Selector

Input
Selector

10
FIS Editor Benefits
Easily Define and modify a Fuzzy system
Simply Add or Remove Inputs and/or Outputs
Set or modify Inference methodes
Simply add or remove Membership functions and easy
management of functions parameters
Easy Rule definition and modification
Great visualization area for FIS Diagram
2-D visualization of Inference for any Input pairs to any Output

Offers tow Inference Engines


Mamdani
Sugeno in which rule syntaxes became:
IF ( x is A ) or ( y is B ) THEN ( z = k1 )

Mamdani against Sugeno


Advantages of the Mamdani method
Its intuitive
It has widespread acceptance
Its well-suited to human input

Advantages of the Sugeno method


Its computationally efficient
It works well with linear techniques (e.g., PID control)
It works well with optimization and adaptive techniques
It has guaranteed continuity of the output surface
Its well-suited to mathematical analysis
Easily developed for Neuro-Fuzzy systems

11
ANFIS Editor
Input Data and
Trained results

Training
Data to be
Parameters
Loaded

Simulink Fuzzy Controller


Fuzzy Controller System Model

Feedback
Path

12
Summery
Prof. Lotfi Zadeh says : In almost every case you can
build the same product without fuzzy logic, but fuzzy is
faster and cheaper
When using Fuzzy?
fuzzy logic is a convenient way to map an input space to an output
space. If you find its not convenient, try something else
When you know Input/Output relationship clearly, FIS
Editor and 4 other editors help you to implement your
knowledge, using simulink Fuzzy controller block
If you just know some distinct Input/Output points, ANFIS
Editor helps you to train your Membership functions
parameters to adjust all desired points

13

Você também pode gostar