Knowledge-Based Control Systems (SC48) Lecture 2: Fuzzy Sets and Systems lfredo Núñez Section of Railway Engineering CiTG, Delft University of Tecnology Te Neterlands Robert Babuška Delft Center for Systems and Control 3mE, Delft University of Tecnology Te Neterlands a.a.nunezvicencio@tudelft.nl tel: 5-27 89355 r.babuska@tudelft.nl tel: 5-27 857 Classical Set Teory set is a collection of objects wit a common property. Outline. Fuzzy sets and set-teoretic operations. 2. Fuzzy relations. 3. Fuzzy systems 4. Linguistic model, approimate reasoning Classical Set Teory set is a collection of objects wit a common property. Eamples: Set of natural numbers smaller tan 5: = {, 2, 3, 4}
Classical Set Teory set is a collection of objects wit a common property. Eamples: Set of natural numbers smaller tan 5: = {, 2, 3, 4} Unit disk in te comple plane: = {z z C, z } Representation of Sets Enumeration of elements: = {, 2,..., n} Definition by property: = { X as propertyp } Caracteristic function: μ () :X {, } μ () = is member of is not member of Classical Set Teory set is a collection of objects wit a common property. Eamples: Set of natural numbers smaller tan 5: = {, 2, 3, 4} Unit disk in te comple plane: = {z z C, z } line in R 2 : = {(, y) a + by + c =, (, y, a, b, c) R} Set of natural numbers smaller tan 5 2 3 4 5 6 7 8
Fuzzy sets Classical Set pproac set of tall people = { 8} 7 8 9 [cm] Wy Fuzzy Sets? Classical sets are good for well-defined concepts (mats, programs, etc.) Less suitable for representing commonsense knowledge in terms of vague concepts suc as: a tall person, slippery road, nice weater,... want to buy a big car wit moderate consumption If te temperature is too low, increase eating a lot Logical Propositions Jon is tall... true or false Jon s eigt: Jon = 8. μ (8.) = (true) Jon = 79.5 μ (79.5) = (false) 7 8 9 [cm]
Fuzzy Set pproac.6 7 8 9 [cm] is full member of ( 9) μ () = (, ) is partial member of (7 <<9) is not member of ( 7) Subjective and Contet Dependent.6 7 8 9 [cm] tall in Cina tall in Europe tall in NB Fuzzy Logic Propositions Jon is tall... degree of trut Jon s eigt: Jon = 8. μ (8.) =.6 Jon = 79.5 μ (79.5) =.56 Paul = 2. μ (2.) =.6 7 8 9 [cm] Sapes of Membersip Functions triangular trapezoidal bell-saped
Representation of Fuzzy Sets Pointwise as a list of membersip/element pairs: = {μ ()/,...,μ (n)/n} = {μ (i)/i i X} s a list of α-level/α-cut pairs: = {α/α,α 2/α2,...,α n,αn } = {α i/αi α i (, )} Linguistic Variable TEMPERTURE linguistic variable low medium ig linguistic terms µ semantic rule membersip functions 2 3 4 t (temperature) base variable Basic requirements: coverage and semantic soundness Representation of Fuzzy Sets nalytical formula for te membersip function: μ () = + 2, R or more generally μ() = +d(, v). d(, v)... dissimilarity measure Various sortand notations: μ ()...()...a Properties of fuzzy sets
Support of a Fuzzy Set supp() ={ μ () > } supp( ) support is an ordinary set α-cut of a Fuzzy Set α = { μ () >α} or α = { μ () α} -level α is an ordinary set Core (Kernel) of a Fuzzy Set core() ={ μ () =} core( ) core is an ordinary set Conve and Non-Conve Fuzzy Sets conve non-conve B fuzzy set is conve all its α-cuts are conve sets.
Non-Conve Fuzzy Set: an Eample ig-risk age 6 32 48 64 age [years] Hig-risk age for car insurance policy. Fuzzy set-teoretic operations Fuzzy Numbers and Singletons fuzzy number "about 3" fuzzy singleton 3 8 Fuzzy linear regression: y = 3 + 52 Complement (Negation) of a Fuzzy Set μ Ā () = μ ()
Intersection (Conjunction) of Fuzzy Sets B μ B () =min(μ (),μ B ()) Union (Disjunction) of Fuzzy Sets B μ B () =ma(μ (),μ B ()) Oter Intersection Operators (T-norms) Probabilistic and (product operator): μ B () =μ () μ B () Lukasiewicz and (bounded difference): μ B () =ma(,μ ()+μ B () ) Many oter t-norms... [, ] [, ] [, ] Oter Union Operators (T-conorms) Probabilistic or : μ B () =μ ()+μ B () μ () μ B () Lukasiewicz or (bounded sum): μ B () =min(,μ ()+μ B ()) Many oter t-conorms... [, ] [, ] [, ]
Demo of a Matlab tool Linguistic Modifiers: Eample µ() More or less.8.6.4.2 Very μ very() = μ 2 μ More or less() = μ Linguistic Modifiers (Hedges) Modify te meaning of a fuzzy set. For instance, very can cange te meaning of te fuzzy set tall to very tall. Oter common edges: sligtly, more or less, rater, etc. Usual approac: powered edges: μ M p() = μp Linguistic Modifiers more or less small not very small rater big.5 Small Medium Big 5 5 2 25
Fuzzy Set in Multidimensional Domains y = {μ (, y)/(, y) (, y) X Y } Cylindrical Etension 2 Cylindrical Etension 2 Cylindrical Etension 2 et2 () ={μ ()/(,2) (,2) X X2}
proj 2 Projection 2 Projection onto X2 2 2 () ={ sup X μ (,2)/2) 2 X2} Projection onto X 2 proj () ={ sup 2 X2 μ (,2))/ X} Intersection on Cartesian Product Space n operation between fuzzy sets are defined in different domains results in a multi-dimensional fuzzy set. Eample: 2 on X X2: 2 2
Intersection on Cartesian Product Space n operation between fuzzy sets are defined in different domains results in a multi-dimensional fuzzy set. Eample: 2 on X X2: 2 2 Intersection on Cartesian Product Space n operation between fuzzy sets are defined in different domains results in a multi-dimensional fuzzy set. Eample: 2 on X X2: 2 2 Intersection on Cartesian Product Space n operation between fuzzy sets are defined in different domains results in a multi-dimensional fuzzy set. Eample: 2 on X X2: 2 2 Fuzzy Relations Classical relation represents te presence or absence of interaction between te elements of two or more sets. Wit fuzzy relations, te degree of association (correlation) is represented by membersip grades. n n-dimensional fuzzy relation is a mapping R : X X2 X3... Xn [, ] wic assigns membersip grades to all n-tuples (,2,...,n) from te Cartesian product universe.
.5 Fuzzy Relations: Eample Eample: R : y ( is approimately equal to y ) μ R (, y) =e ( y)2.8.6.4.2.2.4.5 y.5.5.5.6.8.8.6.4.2.2.4.6.8 membersip grade y Grapical Interpretation: Crisp Function y crisp argument interval argument y Relational Composition Given fuzzy relation R defined in X Y and fuzzy set defined in X, derive te corresponding fuzzy set B defined in Y : B = R =proj Y (et X Y () R) ma-min composition: μ B (y) =ma min (μ (),μ R (, y)) nalogous to evaluating a function. Grapical Interpretation: Interval Function crisp argument interval argument y y
y Grapical Interpretation: Fuzzy Relation crisp argument fuzzy argument y Fuzzy Systems Ma-Min Composition: Eample μ B (y) =ma min (μ (),μ R (, y)), y [..4... ]....4.8....2........9......8.3. = [...4.4.8 ] Fuzzy Systems Systems wit fuzzy parameters y = 3 + 52 Fuzzy inputs and states ẋ(t) =(t)+bu(t), () = 2 Rule-based systems If te eating power is ig ten te temperature will increase fast
Rule-based Fuzzy Systems Linguistic (Mamdani) fuzzy model If is ten y is B Fuzzy relational model If is ten y is B(.),B2(.8) Takagi Sugeno fuzzy model If is ten y = f() Linguistic Model If is ten y is B is antecedent (fuzzy proposition) y is B consequent (fuzzy proposition) Compound propositions (logical connectives, edges): If is very big and 2 is not small Linguistic Model If is ten y is B is antecedent (fuzzy proposition) y is B consequent (fuzzy proposition) Multidimensional ntecedent Sets 2 on X X2: 2 2
Partitioning of te ntecedent Space 2 conjunctive 2 oter connectives 2 22 23 2 22 23 2 3 2 3 Formal pproac. Represent eac if ten rule as a fuzzy relation. 2. ggregate tese relations in one relation representative for te entire rule base. 3. Given an input, use relational composition to derive te corresponding output. Inference Mecanism Given te if-ten rules and an input fuzzy set, deduce te corresponding output fuzzy set. Formal approac based on fuzzy relations. Simplified approac (Mamdani inference). Interpolation (additive fuzzy systems). Modus Ponens Inference Rule Classical logic Fuzzy logic if is ten y is B if is ten y is B is is y is B y is B
Relational Representation of Rules If ten rules can be represented as a relation, using implications or conjunctions. Classical implication B B ( B) \B R: {, } {, } {, } Fuzzy Implications and Conjunctions Fuzzy implication is represented by a fuzzy relation: R:[, ] [, ] [, ] μ R (, y) =I(μ (),μ B (y)) I(a, b) implication function classical Kleene Diene I(a, b) =ma( a, b) Lukasiewicz I(a, b) =min(, a + b) T-norms Mamdani I(a, b) =min(a, b) Larsen I(a, b) =a b Relational Representation of Rules If ten rules can be represented as a relation, using implications or conjunctions. Conjunction B B \B R: {, } {, } {, } Inference Wit One Rule. Construct implication relation: μ R (, y) =I(μ (),μ B (y))
Inference Wit One Rule. Construct implication relation: μ R (, y) =I(μ (),μ B (y)) 2. Use relational composition to derive B from : B = R Grapical Illustration μ R (, y) =min(μ (),μ B (y)) μ B (y) =ma min (μ (),μ R (, y)) R= min( B, ) Inference Wit Several Rules. Construct implication relation for eac rule i: μ R i (, y) =I(μ i (),μ Bi (y)) 2. ggregate relations Ri into one: μ R (, y) = aggr(μ i ()) Te aggr operator is te minimum for implications and te maimum for conjunctions. 3. Use relational composition to derive B from : B = R R µ B ma(min(,r)) B B y y min(,r) Eample: Conjunction. Eac rule If is i ten ỹ is Bi is represented as a fuzzy relation on X Y : Ri = i Bi μ R i (, y) =μ i () μ Bi (y)
ggregation and Composition 2. Te entire rule base s relation is te union: R = K i= i K Ri μ R (, y) = ma Ri (, y)] 3. Given an input value te output value B is: B = R μ B (y) =ma [μ () μ R(, y)] X R If Flow is Zero ten Level is Zero Eample: Modeling of Liquid Level - If Fin is Zero ten is Zero - IfFin is Med ten is Med F out - IfFin is Large ten is Med Large 2 4 6 8 2 3 R Large R2 If Flow is Medium ten Level is Medium R 2 Large
R3 If Flow is Large ten Level is Medium R 3 Large ggregated Relation Simplified pproac. Compute te matc between te input and te antecedent membersip functions (degree of fulfillment). 2. Clip te corresponding output fuzzy set for eac rule by using te degree of fulfillment. 3. ggregate output fuzzy sets of all te rules into one fuzzy set. Tis is called te Mamdani or ma-min inference metod. R R 2 R 3 Large Water Tank Eample - If Fin is Zero ten is Zero - IfFin is Med ten is Med F out - IfFin is Large ten is Med Large 2 4 6 8 2 3
Mamdani Inference: Eample Large 5 3 6 If Fin is Zero ten... Large 5 3 6 Determine te degree of fulfillment (trut) of te first rule. Mamdani Inference: Eample Large 5 3 6 Given a crisp (numerical) input (Fin). If Fin is Zero ten is Zero Large 5 3 6 Clip consequent membersip function of te first rule.
If Fin is Medium ten... Large 5 3 6 Determine te degree of fulfillment (trut) of te second rule. ggregation Large 5 3 6 Combine te result of te two rules (union). If Fin is Medium ten is Medium Large 5 3 6 Clip consequent membersip function of te second rule. Defuzzification conversion of a fuzzy set to a crisp value y' y (a) center of gravity y' y (b) mean of maima
Center-of-Gravity Metod F μ B (yj)yj j= y = F μ B (yj) j= Fuzzy System Components Defuzzification Large 5 3 6 Compute a crisp (numerical) output of te model (centerof-gravity metod).