64
FUZZY LOGIC Ekin ERAY Emre GÖKYİĞİT 1 Management Mathematics Assoc. Prof. Dr. Gül Polat TATAR

Fuzzy Logic

Embed Size (px)

Citation preview

Page 1: Fuzzy Logic

1

FUZZY LOGIC

Ekin ERAYEmre GÖKYİĞİT

Management MathematicsAssoc. Prof. Dr. Gül Polat TATAR

Page 2: Fuzzy Logic

2

Content

• Introduction• History of Aristo Logic and Fuzzy logic• Stages of fuzzy modeling• An Academic example• Conclusion• References

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 3: Fuzzy Logic

3

• ARİSTO LOGIC

• FUZZY LOGIC

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 4: Fuzzy Logic

4

Triangle Type Fuzzy Functions

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 5: Fuzzy Logic

5

Trapeze Type Fuzzy Functions

a1 a4

A(x)

x

1

a2 a3

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 6: Fuzzy Logic

6ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 7: Fuzzy Logic

7

Assingment of Membership Degree

• Intuition• Logic • Experience

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 8: Fuzzy Logic

8

How to Create a Fuzzy Functions?

• Discuss with people who know about the subject and than make an arrangement

• Trial and error• Use the data directly and make arrangement.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 9: Fuzzy Logic

9

Fuzzy Set Operations

• μAUB(x) = maks {μA(x) , μB(x)}• μA∩B(x) = min {μA(x) , μB(x)}

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 10: Fuzzy Logic

10

Stages of Fuzzy Modeling

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 11: Fuzzy Logic

11

Rule Base

• AND A B = min (μA, μB) ∧• OR A B = maks (μA, μB) ∨

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 12: Fuzzy Logic

12

Example

• The users of the heating system wants- Less fuel consumption- Easy to use- Inexpensive- More warranty period

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 13: Fuzzy Logic

13

• There is;• 5 different company (A-E)• 4 different consumer needs

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 14: Fuzzy Logic

14

1st need: FUEL

• Company A: Fuel consumption is good• Company B: Fuel concumption is high• Company C: Fuel consumption is low• Company D: Fuel consumption is normal• Company E: Fuel consumption is good

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 15: Fuzzy Logic

15

2nd need: USAGE

• Company A: Usage is quite hard• Company B: Usage is quite easy• Company C: Usage is easy• Company D: Usage is easier• Company E: Usage is hard

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 16: Fuzzy Logic

16

3th need: WARRANTY

• Company A: 7 years.• Company B: 8 years.• Company C: 5 years.• Company D: 6 years.• Company E: 8 years

edcbaG /8,0/6,0/5,0/8,0/7,0

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 17: Fuzzy Logic

17

4th need: COST

• Company A: 40 M• Company B: 50 M• Company C: 60 M• Company D: 20 M• Company E: 45 M

0,8 0,8

0,6

0,55

0,4

0,5

c e

a d

Ü(x)

x

1,0

b

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 18: Fuzzy Logic

18

• Intersections of all sets.

• We should choose the max mambership value from this set.

• Best heating system company is D.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

edcbaG /8,0/6,0/5,0/8,0/7,0

Page 19: Fuzzy Logic

19

Most Common Defuzzification Process

• Maximum membership method• The center of gravity method• Weighted average method • Avarage maximum membership method.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 20: Fuzzy Logic

20

Mamdani Type Fuzzy Inference System

• All inputs and outputs are fuzzy functions. • can easily create • compatible with human behavior

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 21: Fuzzy Logic

21

• Most comman defuzzification system for this model is the center of gravity method

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 22: Fuzzy Logic

22

Sugeno Type Fuzzy Inference System

• Duductive part (THEN) of the system is a simple mathematical function of the premise part.

• It can be a constant or a linear function.• IF x=A AND y=B THEN z=f(x,y)=px+qy+r

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 23: Fuzzy Logic

23

• ADVANTAGES• Easy to compute• Works well with the other techniques• suitable for mathematical analysis

• DISADVANTAGES• Not compatible with human behavior

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 24: Fuzzy Logic

24ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 25: Fuzzy Logic

25ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 26: Fuzzy Logic

26

A Fuzzy Logic Implementation

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 27: Fuzzy Logic

27

Thesis• Modeling Bid Mark-up of

International Construction Projects with Fuzzy Logic

Genç, A., 2012 Uluslararası İnşaat Projelerinde Katkı Payının Bulanık Mantık ile Modellenmesi, İTÜ Yapı İşletmesi.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 28: Fuzzy Logic

28

Goal of the Thesis• The goal of the survey is determining

importance levels of factors that affects amount of bid mark-up.

• The other goal is to create a fuzzy logic model to estimate amount of bid mark-up in the light of the obtained datas.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 29: Fuzzy Logic

29

Amount of Bid Mark-up

• Bid mark-up is a component of bidding price which is prepared by construction companies in bidding period.

Amount of bid mark-up. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 30: Fuzzy Logic

30

Factor Titles

• 61 factors which is contained with the literature survey are divided into 5 titles.

• 1-Factors associated with the employer• 2-Factors associated with the project• 3-Factors associated with the firm• 4-Factors associated with the bidding period

and the contract• 5-Factors associated with the economical milieu

and the riskITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 31: Fuzzy Logic

31

Survey

• 16 firms with 39 different project participated to survey.

• The questionnaire which is generally answered by bidding department managers, is provided a reliable database.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 32: Fuzzy Logic

32

Ranking

• The factors that affects amount of bid mark-up, ranked on an importance scale from 1 to 5 by the company representatives.

• 1: very low• 2: low• 3: medium• 4: high• 5: very high

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 33: Fuzzy Logic

33

Fuzzy Logic Modeling

• “As complexity rises, precise statements lose meaning and meaningful statements lose precision” Lotfi Zadeh

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 34: Fuzzy Logic

34

Fuzzy Logic Modeling

• Fuzzy logic modeling doesn’t need any acceptation contrary to statistical and stochastic processes. This is the most important advantage of fuzzy logic modeling.

• In order to create this kind of model, the

logical relations between input and output datas should be exposed.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 35: Fuzzy Logic

35

Method of Working

• 5 input data for the fuzzy logic model (Employer Factor, Project Factor, Firm Factor, Bidding Period and Contract Factors, Economical Milieu and Risk Factors)

• and an output data (Total estimated amount of bid mark-up which is estimated as a percentage of construction cost).

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 36: Fuzzy Logic

36

Method of Working

• Mamdani type of fuzzy logic modeling method is used because of easily creating and its compatibility with the human behaviour and senses.

• MATLAB package program was used for creation of the model.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 37: Fuzzy Logic

37

Method of Working

Mamdani type of fuzzy logic model. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 38: Fuzzy Logic

38

Method of Working

• Fuzzification- First of all, fuzzification of input and output datas is required in order to create a fuzzy logic model.- The fuzzification comprises the process of transforming crisp values into grades of membership for linguistic terms of fuzzy sets. The membership function is used to associate a grade to each linguistic term.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 39: Fuzzy Logic

39

Method of Working

• Forming fuzzy rule base- The second step is forming a fuzzy rule base.- The fuzzy rule base is formed by rules like IF-THAN which connects input variables to the output.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 40: Fuzzy Logic

40

Method of Working

• Fuzzy inference process- The relations that formed in fuzzy rule base between input and output fuzzy sets are collected in this process.- The process of fuzzy inference provides to get one result from the system- The form of the output is determined by all inferences of rules that are contained.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 41: Fuzzy Logic

41

Method of Working

• Defuzzification- Defuzzification is the final step of fuzzy logic modeling which converts fuzzy datas to precise results. - Defuzzification is the process of producing a quantifiable result in fuzzy logic, given fuzzy sets and corresponding membership degrees.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 42: Fuzzy Logic

42

Fuzzification

• Şen (2009) states that personal feelings, logic and experiences are prominent references for assigning degree of membership and membership functions. It’s quite helpful to overcome so many problems.

• Therefore, the assignments was made according to this principle. Input values assigned to membership functions and fuzzificated through expert opinions in this study.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 43: Fuzzy Logic

43

Fuzzification• In survey study, input datas ranked in 1-5 interval. According

to this scale: value 1 is “very low”, value 2 is “low”, value 3 is “medium”, value 4 is “high” and value 5 is “very high”.

• In model study, 5 levels are handled again for fuzzification of input datas. Input datas are fuzzificated with the same sets.

Membership function of input variable. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 44: Fuzzy Logic

44

Fuzzification

• Output variable(bid mark-up) is also fuzzificated into 5 level.• Triangle membership function is used at 4 set.• Trapeze membership function is used at 1 set.

Membership function of output variable. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 45: Fuzzy Logic

45

Fuzzification• “Very low” set: Full membership (μ=1) for 10 value. μ=0 for 17.5 value.• “Low” set: Parameters of the set are [13.5, 18.75, 24].• “Medium” set: Parameters of the set are [20.5, 25.75, 31].• “High” set: Parameters of the set are [27.5, 32.75, 38].• “Very high” set: Trapeze membership function. Starts from 35 value. μ=1 from 40 to 50

values.

Membership function of output variable. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 46: Fuzzy Logic

46

Creating Rule Base

• A systematic has developed by considering possible combinations. The rules are based on this systematic.

• 675 IF-THEN rule has written down for the model.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 47: Fuzzy Logic

47

Creating Rule Base

• The distribution of the rules by output fuzzy sets:

The distribution of the rules by output fuzzy sets. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 48: Fuzzy Logic

48

Creating Rule Base

• For an example, randomly selected 2 rules are shown.

• 1) IF “Employer Factors” is LOW and “Project Factors” is VERY LOW and “Firm Factors” is LOW and “Bidding Period – Contract Factors” is VERY LOW and “Economical Milieu – Risk Factors” is HIGH then “Bid Mark-up” is VERY LOW.

• 2) IF “Employer Factors” is HIGH and “Project Factors” is VERY HIGH and “Firm Factors” is VERY HIGH and “Bidding Period – Contract Factors” is LOW and “Economical Milieu – Risk Factors” is LOW then “Bid Mark-up” is HIGH.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 49: Fuzzy Logic

49

Fuzzy Inference Engine & Defuzzification

• In the light of the given datas fuzzy inference engine provides the calculations for finding the answers of the problems.

• Fuzzy Inference Engine applies intersection (MIN) or union (MAX) processes for input datas according to structure of rule.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 50: Fuzzy Logic

50

Fuzzy Inference Engine & Defuzzification

• Deffuzification is re-quantification of fuzzificated linguistic datas.

• The composite output fuzzy set is built by taking the union of all output fuzzy sets.

• Deffuzification is a kind of interpolation that requires approximate solution and smoothing a lot.

• The most commonly used defuzzification method for Mamdani type of fuzzy systems is center of gravity method.

• This method is also usable for asymmetrical membership functions.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 51: Fuzzy Logic

51

Fuzzy Inference Engine & Defuzzification

Overview of the model(MATLAB). Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 52: Fuzzy Logic

52

Fuzzy Inference Motor & Defuzzification

Fuzzy inference system. Genç, A., (2012)

Employer=2.5 Project=2.5 Firm=2.5 İhale=2.5 Risk=2.5 Bid Mark-up=22.3

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 53: Fuzzy Logic

53

The Results of Fuzzy Logic Model

Comparing the survey with the real system. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 54: Fuzzy Logic

54

The Results of Fuzzy Logic Model

Comparing the survey with the real system. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 55: Fuzzy Logic

55

The Results of Fuzzy Logic Model

• As a result of comparison of fuzzy logic model and estimated amount of bid mark-up, the mean absolute error is determined as 7.77%

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 56: Fuzzy Logic

56

The Results of Fuzzy Logic Model

Comparison between model estimations and survey datas. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 57: Fuzzy Logic

57

The Results of Fuzzy Logic Model

Distribution graph of model estimations and survey datas. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 58: Fuzzy Logic

58

The Results of Fuzzy Logic Model

• R2 value which determined between data sets, is calculated as 0,916.

• This result tells us that there is a strong correlation between bid mark-up values which comes from the survey and estimated bid mark-up values which comes from fuzzy logic model.

• This point should be emphasized in terms of success of the model.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 59: Fuzzy Logic

59

The Results of Fuzzy Logic Model

Distribution of model and survey datas on x=y line. Genç, A., (2012)

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 60: Fuzzy Logic

60

The Results of Fuzzy Logic Model

• x=y line shows R2=1 condition.

• In other words if the estimations of model were totally true, the blue dots would be on the line.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 61: Fuzzy Logic

61

Conclusion

• Fuzzy logic provides an alternative way to represent linguistic and subjective attributes of the real world in computing.

• It is compatible with human behavior and human logic.

• It doesn’t need a mathematical model for its applications.

• The software is easy and economical. • It’s easy to learn, flexible than other techniques.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 62: Fuzzy Logic

62

Conclusion

• Because of the complex and uncertain charachter of construction sector, fuzzy logic is a better solution for decision-making phase.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 63: Fuzzy Logic

63

References

• Şen, Z., 2009. Bulanık Mantık ilkeleri ve Modelleme, 3. Baskı, Su Vakfı Yayınları, İstanbul, Türkiye

• Genç,A., 2012, Uluslararası inşaat projelerinde katkı payının bulanık mantık ile modellenmesi, Yüksek Lisans Tezi, İstanbul Teknik Üniversitesi Fen Bilimleri Enstitüsü, İstanbul

• Subaşı, S., Beycicioğlu, A., Emiroğlu,M., 2008, Hafif betonlarda donatı aderansı dayanımının bulanık mantık yöntemiyle modellenmesi, Yapı Eğitimi Bölümü Teknik Eğitim Fakültesi Düzce Üniversitesi, DÜZCE

• Sarı, M., Murat, Y.Ş., Kırabalı, M., Fuzzy modeling approach and applications

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic

Page 64: Fuzzy Logic

64

Thank You.

ITU Graduate School of Science Engineering & Technology Construction Management - Fuzzy Logic