Sie sind auf Seite 1von 69

Fuzzy Logic

Pertemuan ke 13

FUZZY LOGIC
Lotfi A. Zadeh Fuzzy Sets, Information and Control, Vol 8, pp.338-353,1965.
Clearly, the class of all real numbers which are much greater than 1, or the class of beautiful women, or the class of tall men, do not constitute classes or sets in the usual mathematical sense of these terms (Zadeh, 1965).

PROF. ZADEH
Fuzzy theory should not be regarded as a

single theory, but rather a methodology to


generalize a specific theory from being

discrete, to being more continuous

WHAT IS FUZZY LOGIC

Fuzzy logic is a superset of conventional (boolean) logic


An approach to uncertainty that combines real values [0,1] and logic operations In fuzzy logic, it is possible to have partial truth values Fuzzy logic is based on the ideas of fuzzy set theory and fuzzy set membership often found in language

WHY USE FUZZY LOGIC ?


An Alternative Design Methodology Which Is Simpler, And Faster Fuzzy Logic reduces the design development cycle Fuzzy Logic simplifies design complexity Fuzzy Logic improves time to market A Better Alternative Solution To Non-Linear Control Fuzzy Logic improves control performance Fuzzy Logic simplifies implementation Fuzzy Logic reduces hardware costs

WHEN USE FUZZY LOGIC


Precision in the model
Mathematical Equation Model free methods

Fuzzy System

Complexity of System

Where few numerical data exist and where only ambiguous or imprecise information maybe available.

FUZZY SET

In natural language, we commonly employ:

classes of old people Expensive cars numbers much greater than 1

Unlike sharp boundary in crisp set, here boundaries seem vague Transition from member to nonmember appears gradual rather than abrupt

CRISP AND FUZZY

FUZZY SET AND MEMBERSHIP FUNCTION


Universal Set X always a crisp set. Crisp set assigns value {0,1} to members in X Fuzzy set assigns value [0,1] to members in X These values are called the membership functions m. Membership function of a fuzzy set A is denoted by :

A: X [0,1] A: [x1/m1, x2/m2, , xn/mn}

HIMPUNAN CRISP DAN FUZZY


Himpunan kota yang dekat dengan Bogor
A = { Jakarta, Sukabumi, Cibinong, Depok } CRISP B = { (Jakarta / 0.7) , (Sukabumi / 0.6) , (Cibinong / 0.9) ,

(Depok/0.8) } FUZZY

Angka 0.6 0.9 menunjukkan tingkat keanggotaan ( degree of membership )

CONTOH
Grade ( m )

1
Dingin Panas

30 oC

30 oC

CRISP

FUZZY

TINGGI BADAN
m
sedang 1

CRISP

150

155

160

tinggi

m
sedang 1 0,5 0
150 155 160 tinggi

FUZZY

SEASONS
Spring Summer Autumn Winter

1 Membership

0.5

0 Time of the year

AROUND 4
1

Membership

0.5

0 0

4 Measurements

AGE
1
young very young old

Membership

0.5

more or less old not very young

0 0 20 40 60 80 100

Age

MEMBERSHIP FUNCTION
1 0.5 0 (a) (d) (g) (j)

1
0.5 0 (b) 1 0.5 0 -100 (e) (h) (k)

0 (c)

100 -100

0 (f)

100 -100

0 (i)

100 -100

0 (l)

100

SET OPERATION
1

A
Membership 0.5

0 0 20 AUB 40 AIB 60 80 AUB 100

SET OPERATION

AB

AB

LINGUISTIC VARIABLES
Linguistic variable is a variable whose values are words or sentences in a natural or artificial language. Each linguistic variable may be assigned one or more linguistic values, which are in turn connected to a numeric value through the mechanism of membership functions.

LINGUISTIC VARIABLES
Fuzzy linguistic terms often consist of two parts:
1) Fuzzy predicate : expensive, old, rare, dangerous, good, etc. 2) Fuzzy modifier: very, likely, almost impossible, extremely unlikely, etc. The modifier is used to change the meaning of predicate and it can be grouped into the following two classes: a) Fuzzy truth qualifier or fuzzy truth value: quite true, very true, more or less true, mostly false, etc. b) Fuzzy quantifier: many, few, almost, all, usually, etc.

FUZZY PREDICATE
Fuzzy predicate If the set defining the predicates of individual is a fuzzy set, the predicate is called a fuzzy predicate Example z is expensive.

w is young.
The terms expensive and young are fuzzy terms. Therefore the sets expensive(z) and young(w) are fuzzy sets

FUZZY PREDICATE
When a fuzzy predicate x is P is given, we can interpret it in two ways : P(x) is a fuzzy set. The membership degree of x in the set P is defined by the membership function mP(x) mP(x) is the satisfactory degree of x for the property P. Therefore, the truth value of the fuzzy predicate is defined by the membership function : Truth value = mP(x)

FUZZY VARIABLES

Variables whose states are defined by linguistic concepts like low, medium, high. These linguistic concepts are fuzzy sets themselves. Very Low High high

Temperature

Trapezoidal membership functions

FUZZY VARIABLES

Usefulness of fuzzy sets depends on our capability to construct appropriate membership functions for various given concepts in various contexts. Constructing meaningful membership functions is a difficult problem GAs have been employed for this purpose.

EXAMPLE
if speed is interpreted as a linguistic variable, then its term set T (speed) could be T = { slow, moderate, fast, very slow, more or less fast, sligthly slow, ..}.
where each term in T (speed) is characterized by a fuzzy set in a universe of discourse U = [0; 100]. We might interpret slow as a speed below about 40 km/h" moderate as a speed close to 55 km/h" fast as a speed above about 70 km/h"

SPEED

Values of linguistic variable speed.

NORMALIZED DOMAIN INPUT


NB (Negative Big), NM (Negative Medium) NS (Negative Small), ZE (Zero) PS (Positive Small), PM (Positive Medium) PB (Positive Big)

A possible fuzzy partition of [-1; 1].

MEMBERSHIP FUNCTION
m

Positive Large

0
Negative Medium

m
NL NM NS ZERO PS PM PL

FUZZY CONTROLLER STRUCTURE

Fuzzification

Scales and maps input variables to fuzzy sets Approximate reasoning Deduces the control action Convert fuzzy output values to control signals

Inference Mechanism

Defuzzification

FUZZY CONTROLLER
Fuzzy Controller

Rule Base Pre processing Fuzzification Inference engine Defuzzification Post Processing

FUZZY CONTROLLER
action Defuzzification Module Fuzzy Controller

Controlled Process

Fuzzy Inference Engine

Fuzzy Rule base

condition

Fuzzification Module

FUZZIFICATION
Transformation from crisp input to fuzzy input.

1 0.6

input

APPROXIMATE REASONING
y = f(x) Then we can make inferences easily

premise y = f(x)
fact x = x -----------------------------consequence y = f( x )

BASIC INFERENCES
x is A AB -----------x is B x is A x is B --------------x is A B and Mary is very young very young young ------------------------Mary is young pressure is not very high pressure is not very low -----------------------------------pressure is not very high

not very low

MAMDANIS IMPLICATION OPERATOR


if x is A then y is B
x is A -----------------------

y is B

INFERENCE
Penarikan kesimpulan dari semua fungsi keanggotaan
yang sudah didefinisikan menggunakan RULE BASE. IF A AND B THEN C RULE 1 : A1 , B1 C1 RULE 2 : A2 , B2 C2 FAKTA : x , Dx ---------------------------------------KESIMPULAN : C

MIN-MAX METHOD
NL A1 B1 PM C1 PL

C1'

NM A2 B2

PS C2

PM

C2'

Dx

C' = C1' U C2' METODE MIN-MAX


37

DEFUZZIFICATION
Transformation from fuzzy output to crisp ouput.
Defuzzification is a process to get a non-fuzzy value that best represents the possibility distribution of an inferred fuzzy control action. There is no systematic procedure for choosing a good defuzzification strategy. Selection of defuzzification procedure depends on the properties of the application.

CENTROID OF THE AREA

EXAMPLE

MEAN OF MAXIMUM

EXAMPLE

HEIGHT METHOD

WEIGHTED AVERAGE

EXAMPLE

BISECTOR OF THE AREA

FIRST/LAST MAXIMA

EXAMPLE

FUZZY SYSTEM

FUZZY SYSTEM

FUZZY SYSTEM

BUILD A FUZZY CONTROLLER

EXAMPLE

LANGKAH KEDUA

AC CONTROLLER

FUZZY RULES

IF Cold then Stop If Cool then Slow

If OK then Medium If Warm then Fast IF Hot then Blast

AC CONTROLER
Air Temperature

Fan Speed

Set Set Set Set Set

Set stop {30, 0, 0} cold {50, 0, 0} Set slow {50, 30, 10} cool {65, 55, 45} just right {70, 65, 60} Set medium {60, 50, 40} Set fast {90, 70, 50} warm {85, 75, 65} Set blast {, 100, 80} hot {, 90, 80}

HIMPUNAN FUZZY INPUT

HIMPUNAN FUZZY OUTPUT

LANGKAH KETIGA

RELASI FUZZY

RELASI DAN RULE

AKTIF RULE

SUHU 65 0F

SUHU 63 0F

SUHU DAN KECEPATAN

TAMBAHKAN OUTPUT

DEFUZZIFIKASI OUTPUT

INVERTED PENDULUM
Goal: maintain stick vertical ! q is measured at time k; Dq is change of q at (k)

q(k), Dq(k)

Action : u(k)

Action is performed by moving cart with force u q(k) Dq (k),u(k)

NB

PB

NB: negative Big, Z: zero, P: positive

FUZZY RULES
q(k) Dq (k) NB N Z P PB NB Z N Z P Z PB

NB

PB

Here, 7 fuzzy relations are enough to get a working minmax-cog fuzzy controller !

Action u(k) in fct of q(k) and Dq (k)

Das könnte Ihnen auch gefallen