• 沒有找到結果。

第06章-模糊推論與應用

N/A
N/A
Protected

Academic year: 2021

Share "第06章-模糊推論與應用"

Copied!
43
0
0

加載中.... (立即查看全文)

全文

(1)

Fuzzy Inference and It’

s

Applications

模糊推論與應用

國立臺南大學 黃國禎

數位學習科技系 教授

資訊教育研究所 所長

理工學院 院長

(2)

Fuzzy set and Fuzzy Logic

why “

Fuzzy Subset”?

Ordinary set -- the foundation of present day

mathematics.(S)

S : a set

e5 : an element

But in real world , the relation is usually “

fuzzy”!

John is 170 cm John : an element } , , , { 2 3 5 6 5 S e e e e e   } | { x x is tall or  

(3)

S = {x|x is tall} 180cm 高的人 S ? Yes 179cm 高的人 S ? Yes (179 和180只差 1cm) 178cm 高的人 S ? Yes (178 和179 只差 1cm) • • • 170cm 高的人 S ? Yes (170 和171 只差 1cm) 169cm 高的人 S ? Yes No (169 和170 只差 1cm) • • • 120cm 高的人 S ? Yes (120 和121 只差 1cm) Why? 既然170是, 為何169不是?

(4)

S ={x|x is tall} 假如找100個人投票,互相推選屬於S和不屬於S的人 150cm 160cm 170cm 180cm 0 0 1 0.5

John is 180cm  John S with degree 1.0 John is 165cm  John S with degree 0.5 John is 150cm  John S with degree 0

(5)

ordinary set is a particular case of the

theory of fuzzy subset.

let E be a set and A be a subset of E

A

E

Characteristic function

(x)

x)

= 1

if x

A

(yes)

x)

= 0

if x

A

(no)

e.g. E={x1,x2,x3,x4,x5}

let A = {x2,x3,x5}

x

1

) = 0,

x

2

) = 1,

x

3

)= 1

x

4

) = 0,

x

5

) = 1

(6)

A different representation

A = {(x1,0),(x2,1),(x3,1),(x4,0),(x5,1)}  AA= 0 A A= E  IF x A , x A (x)= 1, A(x)= 0 consider A ={x2,x3,x5}

A(x1) = 1, A(x2) = 0, A(x3) = 0 A(x4) = 1, A(x5) = 0

(7)

Given two subsets A and B (x) = 1, if x A = 0, if x A (x) = 1, if x B = 0, if x  AB(x)= 1, if x AB = 0, if x AB  AB(x)= (x) •(x)  0 1 0 1 0 0 0 1 Boolean product

(8)

Union AB (x)= 1, if x AB = 0, if x AB AB (x)= (x) (x) Boolean sum e.g. E = {x1,x2,x3,x4,x5} two subsets A and B

A={x2,x3,x5}, B={x1,x3,x5} AB = {(x1,0 1),(x2,1 0), (x3,1 1),(x4,0 0),(x5,1 1)} = {(x1,1),(x2,1),(x3,1),(x4,0),(x5,1)} 0 1 0 1 0 1 1 1              

(9)

•The concept of Fuzzy Subset

x

i

of E



或多或少

是A的元素

A = {(x1|0.2),(x2|0),(x3|0.3),(x4|1),(x5|0.8)}

Fuzzy Subset x1屬於A的 程度 (可能由0~1.0)

A E  A is a Fuzzy Subset of E x2A A E x1, x2, x3 0.2 0 0.3 membership    通常是主觀的認定,但至少 表達了Xis之間的相對程度

(10)

Zadehs definition of Fuzzy subset

Let E be a set, denumerable or not, let x be an element of E. Then Fuzzy subset A of E is a set of ordered pairs {(x|(x)},

xE.

Where (x) : grade of membership of x in A

(x) takes its values in a set M (membership set)

x M

IF M={0,1}

fuzzy subsetof A will be a nonfuzzy subset  (or ordinary set)

mapping

(11)

E.g.

Let N be the set of natural numbers

N = {0,1,2,3,4,5,6,...}

consider the fuzzy set A of

small

natural

numbers

A = {(0/1),(1/0.8),(2/0.6),(3/0.4),(4/0.2),(5/0),(6/0),...}

用傳統的ordinary set很難表達

A = {(0,1),(1,1),(2,1),(3,1),(4,1),(5,0),(6,0),...}

(12)

S- Function

S (x; )= 0 for x  2[(x- )/()]2 for x 1- 2[(x- )/()]2 for x 1 for x 1 0.5 0   

(13)

Membership Function

A membership Function for the Fuzzy Set TALL

1.0 0.9 0.5 6.5 Height in Feet6 7

TALL

S (x;





)=

0 for x  2[(x- 5)/(7)]2 = [(x- 5) 2/2] for 5x 1- 2[(x- 7)/(7)]2 =1-[(x- 7) 2 /2] for 6x 1 for x

(14)

close(x;  1

1

2

(

x

)

with crossover points x =  1.0 0.5    x

Close- Function

close(x; 

(15)

E = { x|x= 價格合理的牛排 ?} 220NT 120 =220NT =120NT 0.5 1.0 220NT 100 340 close(x; 

(16)

x

for

x

S

x

for

x

S

x

)

,

,

;

(

1

)

,

,

;

(

)

,

;

(

2 2

function

0.5   1  x

(17)

價格合理的牛排         220 ) 420 , 320 , 220 ; ( 1 220 ) 220 , 120 , 20 ; ( ) 200 , 220 ; ( x for x S x for x S x











 





0.5 1 220NT 120 320      

(18)

Fuzzy Database systems

找一個停車容易,且價格合理的餐廳 以停車為優先考慮 E = {x|x = 離火車站近的餐館}









Km

d1 d2 d5 d4 d3

(19)

Fuzzy Logic

Binary Logic: The logic associated with the Boolean theory of set Fuzzy Logic : The Logic associated with the same manner with the

theory of fuzzy subsets

dialogue

(20)

A(x) : membership function of the element x in the fuzzy subset A

M = [0,1]

Let A, B be two fuzzy subsets of E and x is an element of E a = A(x) , b = A(x) a,b,...M = [0,1]

)

(

)

(

1

)

,

(

)

,

(

b

a

b

a

b

a

a

a

b

a

MAX

b

a

b

a

MIN

b

a

(21)

Commutativity

Associativity

~ ~ ~ ~ ~ ~ ~ ~

a

b

b

a

a

b

b

a

)

(

)

(

)

(

)

(

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

c

b

a

c

b

a

c

b

a

c

b

a

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

)

(

1

1

1

)

(

)

(

)

(

)

(

)

(

)

(

a

a

a

a

a

a

a

a

c

a

b

a

c

b

a

c

a

b

a

c

b

a

Distributivity

(22)

DeMorgan s Law

~ ~ ~ ~ ~ ~ ~ ~

b

a

b

a

b

a

b

a

(23)

50 0.00 54 0.08 58 0.32 60 0.50 64 0.82 68 0.98 70 1.00

Tall Not Short

50 0.00 54 0.08 58 0.32 60 0.50 64 0.82 68 0.98 70 1.00

(24)

Tall Not Tall 50 0.00 54 0.08 58 0.32 60 0.50 64 0.82 68 0.98 70 1.00

Complementation

50 1.00 54 0.92 58 0.68 60 0.50 64 0.18 68 0.02 70 0.00

(25)

Not Tall Not Short Middle-Sized 50 1.00 54 0.92 58 0.68 60 0.50 AND 64 0.18 68 0.02 70 0.00 50 0.00 54 0.08 58 0.32 60 0.50 64 0.82 68 0.98 70 1.00 50 0.00 54 0.08 58 0.32 60 0.50 64 0.18 68 0.02 70 0.00

(26)

Linguistic Hedge Operation- Scalar

Ura(x) = rUa(x) r=0.7 r=0.5 r=0.3 

(27)

Uar(x) = ((Ua(x))r

r = 0.5 r = 2

r = 4 

(28)

UA =supUA(X)

NORM(A) A

(29)

Ucon(A) = UA2(X)

A CON(A)

(30)

UDIL(A)(X) = UA0.5(X) DIL A   

(31)

UINT(A)(X) = 2(UA(X)) 2 0 UA(X) 0.5 1-2(1-UA(X))2 0.5 UA(X) 1.0

INT(A) A   

(32)

Very A = CON(A)

More Or less A = DIL(A)

Slightly A = NORM(A and not (very A))

Sort of A = NORM(not (CON(A)

2

and DIL(A))

Pretty A = NORM(INT(A) and not INT(CON(A)))

Rather A = NORM(INT(A))

(33)

True

Very true

More or less true

Completely true

False

Very False

More or less false

Completely false

Unknown

Undefined

(34)

Fuzzy Proposition

Mr.Wang is young.” is true.

Mr.Wang is young.”

is very true.

(35)

Tall

Height Degree of membership 50 0.0 54 0.1 58 0.3 60 0.5 64 0.8 68 0.9 70 1.00

VERY Tall

Height Degree of membership 50 0.0 54 0.01 58 0.09 60 0.25 64 0.64 68 0.81 70 1.00

(36)

~

A

~

A 1 0.5 0 X Figure 5-12 Fuzzy Complement A A = min ( A(X), A(X)) 0.5 A A E

~ ~

~

~

~

~

~

 A A  A A = max ( (X), (X) 0.5     

~

~ ~

(37)

Maximum and Moments Methods

R1: IF MIX is too-wet

THEN Add sand and coarse aggregate R2: IF MIX is Workable

THEN Leave alone R3: IF MIX is too-stiff

THEN Decrease sand and coarse aggregate .

cement water

sand

(38)

Fuzzy Production Rule Antecedents for Concrete Mixture Process

TOO STIFF WORKABLE TOO WET

3 4 5 6 7 8 9

Concrete Slump (inches)

1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0 Membership Grade

(39)

IF Concrete-slump = 6

THEN MIX = 0.0/Too-stiff + 1.0/workable + 0.0/Too-wet IF Concrete-slump = 7

THEN MIX = 0.0/Too-stiff + 0.3/workable + 0.0/Too-wet

IF Concrete-slump = 4.8

THEN MIX = 0.05/Too-stiff + 0.2/workable +0.0/Too-wet

.

.

.

(40)

R1: IF MIX is too-wet

THEN Add sand and coarse aggregate

R2: IF MIX is Workable

THEN Leave alone

R3: IF MIX is too-stiff

THEN Decrease sand and coarse

aggregate

(41)

Fuzzy Production Rule Consequence for Concrete Mixture Process Control

Membership Grade

DECREASE SAND AND COARSE AGGREGATE

-20 -10 0 +10 +20

Change in sand and Coarse Aggregate (%)

1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0

(42)

Fuzzy Inference

Rule 1 : If the car is in short distance and is at a low speed Then keep the speed

Rule 2 : If the car is in short distance and is at a high speed Then decrease the speed

Rule 3 : If the car is in long distance and is at a low speed Then increase the speed

Rule 4 : If the car is in long distance and is at a high speed Then keep the speed

Short distances long distances low speed high speed decrease speed keep speed increase speed

(43)

low speed 10 20 30 30 50 70 -10 0 10 10 20 30 30 50 70 -10 0 10 10 20 30 10 20 30 30 50 70 30 50 70 -10 0 10 -10 0 10 Mass Center -10 0 10 Distance: 15m Speed: 60KM/h

short distance low speed keep the speed

short distance High speed

decrease the speed

long distance

long distance High speed keep the speed increase the speed 0.8 0.4 0.75 0.3 0.3 (0.4*0+0.75*(-10)+0.3*10+0.3*0)/ (0.4 +0.75+0.3+0.3))=-2.57 0.8 0.8 0.3 0.3 0.75 0.75 0.4 0.4 miles miles miles miles meter meter meter meter % % % %

參考文獻

相關文件

國立政治大學應用數學系 林景隆 教授 國立成功大學數學系 許元春召集人.

C7 國立台中護理專科學校護理科 台中市 主任 C8 中臺科技大學老人照顧系 台中市 助理教授 C9 中山醫學大學公共衛生學系 台中市 助理教授 C10

「倍思科學」教育系統,是由國內長期推動科學教育的專家學者和優秀的中小學教師共同規

國立高雄師範大學數學教育研究所碩士論文。全國博碩士論文資訊網 全國博碩士論文資訊網 全國博碩士論文資訊網,

配合小學數學科課程的推行,與參與的學校 協作研究及發展 推動 STEM

二、 學 與教: 第二語言學習理論、學習難點及學與教策略 三、 教材:.  運用第二語言學習架構的教學單元系列

屏東科技大學森林系陳美惠教授帶領的社區林業研究團隊長期深 耕,陪伴墾丁國家公園(台 26 線)及屏北原鄉部落(台 24 線),建立森 林與部落的生態旅遊推動模式,研究成果於 2008

Adelaide, South Australia: Dulwich Centre Publications. 香港理工大學應用社會科學系 25