An Introduction to Fuzzy Reasoning Theory and applications










































- Slides: 42

An Introduction to Fuzzy Reasoning: Theory and applications Constantinos Siettos School of Applied Mathematics & Physics National Technical University of Athens, Greece

OUTLINE • What is Fuzzy Reasoning • Basic elements of Fuzzy Set Theory • Basic structure of a fuzzy inference system • Fuzzy control systems • Fuzzy Decision Making: Classification and Clustering

FUZZY REASONING The Butterfly Problem : Classify the points in 2 D into 4 sets Χ 2 Χ 1 …. But what happens for points in between?

FUZZY REASONING “as the complexity of a system increases, our ability to make precise and yet significant statements about its behavior diminishes until a threshold is reached beyond which precision and significance (or relevance) become almost mutually exclusive characteristics”. L. A. Zadeh, 1973 The theory of fuzzy sets was introduced by him in 1965. Fuzzy Reasoning, based on theory of fuzzy sets, is a new approach to complex systems theory and decision processes. It encompasses Artificial Intelligence, information processing and theories from logic to pure and applied mathematics. Its applications range from production, finance, marketing and other decision-making problems to micro-controller based systems in home appliances and large-scale process control systems

BENCHMARKS IN THE HISTORY OF FUZZY REASONING First paper on fuzzy systems (Zadeh, 1965) Linguistic approach (Zadeh, 1972) Fuzzy Logic controller (Assilian & Mamdani, 1974) Table-Based Controller (Mamdani, 1977) Heat Exchanger based on fuzy logic (Οstergaard, 1977) Self-organizing fuzzy controller (Mamdani, 1977, Procyk & Mamdani, 1979) Fuzzy logic control for cement production (Holmblad & Ostergaard, 1982) Fuzzy controllers on Tokyo subway shuttles (Hitachi, 1984) Fuzzy Chip (Togai & Watanabe, 1985) Ηardware implementation of fuzzy system (Yamakawa & Miki, 1986) Hybrid Neural-Fuzzy systems (Kosko, 1990)

FUZZY LOGIC: BASIC CONCEPTS

THE NOTION OF MEMBERSHIP Let X denote the universe of discourse of a fuzzy set A. A is completely characterized by its membership function μA : X [0, 1] and is defined as a set of pairs: A = {(x, μA (x))}. The most commonly used membership functions are the following (Dubois and Prade, 1980, Zimmermann, 1996; Pappis & Siettos, 2004): Triangular membership function Trapezoid membership function Linear membership function Sigmoidal membership function Π – type membership function Gaussian membership function

THE NOTION OF MEMBERSHIP: MOST COMMON TYPES “COMFORTABLE ROOM TEMPERATURE a=10, β=30 a=10, β=18, γ=23, δ=30 THE SET OF “TALL” PERSONS THE SET OF “SHORT” ONES a=1. 50 cm, β=1. 75, γ=1. 90

An example: The Set of “Fast” Cars Lets use the Power (in PS) as a measure. Then we Could assign the following membership to the set of “Fast Cars” A question: What about cars with Horse-Power more than 150 PS? Why they have a zero membership in the Fuzzy Set “Fast Cars”? …. These Cars are not longer “Fast” but …. . “Very Fast”

An example: Room Temperature The problem: For an Air-Conditioning System Design it is asked the Description of the variable “In-Room Temperature” Task #1: What is the “Universe of Discourse” for the variable “In-Room Temperature” Lets say it is 0<T<40 Task # 2: Define the number and the character of the Fuzzy sets that will be used to define the variable Let us choose 5 fuzzy sets with triangular MFs T-F F N C T-C

FUZZY SET OPERATIONS

FUZZY SET OPERATIONS

Examples on Fuzzy Operations Intersection Let two Fuzzy Sets Α={0/1+ 0. 2/2 + 0. 8/3 + 1/ 4 + 1/ 5}, Β={ 0. 1/1 + 0. 4/2 + 0. 5/3 + 0. 7/4 + 0. 3/ 5) Α Β ={0/1 + 0. 2/ 2 + 0. 5/ 3 + 0. 7/4 + 0. 3/5 ) (Min operation) Α Β= {0/1 + 0. 08/2 + 0. 4/3 + 0. 7/4 + 0. 3/5} (Product operation) Union A Β={0. 1/1 + 0. 4/2 + 0. 8/3 +1/4 + 1/5} (Max operator) Complement A’ = {1/1 + 0. 8/2 + 0. 2/ 3 + 0/4 + 0/5} Β’ ={0. 9/1 +0. 6/2 +0. 5/3 + 0. 3/4+ 0. 7/5) (A Β)’ = ? = A’ Β’= {1/1 + 0. 8/2 + 0. 5/3 + 0. 3/4 + 0. 7/5) (min operation)

TRANSFORMATION OPERATORS The transformation operator acts on a membership function to modify the concept of the linquistic term that describes the fuzzy set. For example, in the clause “number very close to 10”, the transformation operator “very” acts on the linguistic term “close to 10” which corresponds to a fuzzy set.

Cartesian Inner Product of Fuzzy Sets

Example on Cartesian Inner Product of Fuzzy Sets In a Chemical Reactor is asked to be found the optimal operational conditions In terms of Pressure and Temperature. The Temperature and Pressure can take the following values T={T 1, T 2, T 3, T 4}, P={P 1, P 2, P 3} While the optimal temprature is given by the following fuzzy set: Α = 0. 1/ Τ 1 + 0. 6/Τ 2 + 1/Τ 3 + 0. 2/T 4 and the optimal pressure by the fuzzy set Β = 0. 5 / P 1 + 0. 9/ P 2 + 0. 1/ P 3 AXB= P 1 P 2 P 3 T 1 0. 1 T 2 0. 5 0. 6 0. 1 T 3 0. 5 0. 9 0. 1 T 4 0. 2 0. 1

Fuzzy Relations Let U 1 and U 2 be two universes of discourse and the membership function μR: U 1 x. U 2 ->[0, 1]. Then a fuzzy relation R on U 1 x. U 2 is defined as (Zimmerman, 1995; Pappis and Siettos, 2005): R= R= An example if U 1 , U 2 are continuous if U 1, U 2 are discrete. Lets the Universe of Discourse U= {2, 3, 4} The Fuzzy Relation: “Almost Equal numbers” R= 1 (2, 2) + 1(3, 3) +1 (4, 4) + 0. 6 (2, 3) + 0. 6 (3, 2) + 0. 6 (3, 4 ) + 0. 6 (4, 3) + 0. 2 (2, 4) + 0. 2 (4, 2) or: R =

Fuzzy Composition Let R 1 and R 2 be two fuzzy relations on U 1 x. U 2 and U 2 x. U 3 respectively, Then the composition C of R 1 and R 2 is a fuzzy relation defined as follows: An example

FUZZY IMPLICATION Let Α and Β be two fuzzy sets in U 1 , U 2 respectively. The implication I: Α=>Β U 1 x. U 2 is defined as (Ross, 1994, Zimmerman, 1995): Let the two discrete fuzzy sets A= {(ui, μA (ui)), i=1, . . , , n} defined on U and B= {(vj, μB (vj)), j=1, …, m} defined on V. Then the implication Α=>Β is a fuzzy relation R R= {((ui, vj), μR (ui, vj)), i=1, . . , n, j=1, …, m } defined on Ux. V, whose membership function μR (ui, vj) is given by:

Example on FUZZY IMPLICATION If e(t) is Positive Big Then u(t) is Positive Big Let the universe of discourses of e(t) and u(t) U= [-5, -1, 0, 1, 5] (mvolts) and Ω =[-1, 0, 1] (mvolts) The FS: “Positive Big” is defined for e(t) as PS(e) = [0, 0, 0, 0. 4, 1] So if e(t 0)= 5 mvolts The FS: “Positive Big” is defined for u(t) as PS(e) = [0, 0, 1]. Then the implication R=Ax. B= 0 0 1 0 0 0 0. 4 0 0 0. 4 1 0 0 1 u(t 0) = {-1/0, 0/0, 1/1} If e(t 0)= 1 mvolts u(t 0) = {-1/0, 0/0, 1/0. 4}

INFERENCE RULES Let R be a fuzzy relation on U 1 x. U 2 and Α be a fuzzy set in U 1. The composition ΑοR=B is a fuzzy set in U 2, which represents the conclusion made from the fuzzy set Α (fact) based on the implication R (rule).

An example on INFERENCE RULES R 1: IF e(t) is Positive THEN u(t) is Positive R 2: IF e(t) is Zero THEN u(t) is Zero R 3: IF e(t) is Negative THEN u(t) is Negative e(t): U= [-5, -1, 0, 1, 5] (mvolts) u(t): Ω =[-5, -1, 0, 1, 5] (mvolts) Fuzzy Sets for e(t) and u(t) P(e)=[-5/0, -1/0, 0/0, 1/0. 4, 5/1] P(u)=[-5/0, -1/0, 0/0, 1/0. 4, 5/1] Z(e)=[-5/0, -1/0. 5, 0/1, 1/0. 5, 5/0] Z(u)=[-5/0, -1/0. 5, 0/1, 1/0. 5, 5/0] N(e)=[-5/1, -1/0. 4, 0/0, 1/0, 5/0]. N(u)= [-5/1, -1/0. 4, 0/0, 1/0 , 5/0]. Let e(t) = -1 Then the Fuzzy Set N(e) takes the value of 0. 4

An example on INFERENCE RULES R 1: IF e(t) is Positive THEN u(t) is Positive R 2: IF e(t) is Zero THEN u(t) is Zero R 3: IF e(t) is Negative THEN u(t) is Negative e(t): U= [-5, -1, 0, 1, 5] (mvolts) u(t): Ω =[-5, -1, 0, 1, 5] (mvolts) Fuzzy Sets for e(t) and u(t) P(e)=[-5/0, -1/0, 0/0, 1/0. 4, 5/1] Z(e)=[-5/0, -1/0. 5, 0/1, 1/0. 5, 5/0] N(e)=[-5/1, -1/0. 4, 0/0, 1/0, 5/0]. P(u)=[-5/0, -1/0, 0/0, 1/0. 4, 5/1] Z(u)=[-5/0, -1/0. 5, 0/1, 1/0. 5, 5/0] N(u)= [-5/1, -1/0. 4, 0/0, 1/0 , 5/0]. Let e(t) = -1 and the Implication R 3: [-5/0. 4, -1/0. 4, 0/0, 1/0, 5/0] For R 2: [-5/0, -1/0. 5, 0/0. 5, 1/0. 5, 5/0] For R 1: [-5/0, -1/0, 0/0, 1/0, 5/0] Hence: u(t 0) = [-5/0. 4, -1/0. 5, 0/0. 5, 1/0. 5, 5/0]

BASIC STRUCTURE OF A FUZZY INFERENCE SYSTEM A data base defining the number, labels and types of the membership functions the fuzzy sets used as values for each system variable A rule base, which essentially maps fuzzy values of the inputs to fuzzy values of the outputs. This actually reflects the decision-making policy Rule i: IF x is Ai and y is Bi THEN z is Ci The fuzzy reasoning unit performs various fuzzy logic operations to infer the output (decision) from the given fuzzy inputs.

AN EXAMPLE OF FUZZY INFERENCE SYSTEM Assume that there are two input variables, e (error) and ce (change of error), one output variable, cu (change of output) and two rules: Rule 1: If e is Α 1 AND ce is Β 1 THEN the cu is C 1 Rule 2: If e is Α 2 AND ce is Β 2 ΤHEN cu is C 2. In the Max-Min inference method, the fuzzy operator AND (intersection) means that the minimum value of the antecedents is taken: μΑ AND μΒ = min { μΑ, μΒ}, while for the Max-product one the product of the antecedents is taken: μΑ AND μΒ = μΑ* μΒ

AN EXAMPLE OF FUZZY INFERENCE SYSTEM MAX-MIN MAX-DOT

Defuzzification Unit Deffuzification typically involves weighting and combining a number of fuzzy sets resulting from the fuzzy inference process in a calculation which gives a single risp value for each output. The most prevalent and physically appealing among the defuzzification methods are those of mean of maximum, centroid, and center of sum of areas. (Lee, 1990, Ross, 1995, Lee, 1990; Drianov et al. , 1993)

Mean of maximum defuzzification technique where n is the number of rules in a MISO system, Ηi be the maximum value of the membership function of the output fuzzy set which corresponds to rule I, αi is the degree that the rule i is fired.

Centroid deffuzification technique This is the most prevalent and physically appealing among the defuzzification methods (Lee, 1990, Ross, 1995). This method takes the center of gravity of the final fuzzy space in order to produce a result sensitive to all rules; it is described by the following equation (Ross, 1995): where Μi is the value of the membership function of the output fuzzy set of rule i, A is corresponding surface, αi is the degree that the rule i is fired. Note that the overlapping areas are merged (figure 7 a). In the case of continuous space the output value is given by (Ross, 1994; Taprantzis et al. , 1997) u=

Center of sums deffuzification technique A similar to the centroid technique but computationally more efficient in terms of speed technique is that if the center of sums. The difference is that the overlapping-betewwn the output fuzy sets-areas are not merged (figure 7 b). The discrete value of the output is given by (Lee, 1990; Drianov et al. , 1993):

FUZZY CONTROL RULE BASE Two are the main approaches in the design of rule bases (Yan et al. , 1994): The Heuristic approach The systematic approach Heuristic approaches (Yan et al. , 1994, King and Mamdani, 1977) provide a convenient way to build fuzzy control rules in order to achieve the desired output response, requiring only qualitative knowledge for the behaviour of the system under stydy. For a two-input (e and ce) one-output variable (cu) system these rules are of the form: IF e is P (Positive) AND ce is N (Negative) THEN cu is P (Positive) IF e is N (Negative) AND ce is P (Positive) THEN cu is N (Negative) The reasoning for the construction of the fuzzy control rules can be summarized as follows: ·If the system output has the desired value and the change of the error (ce) is zero then keep the control action constant. ·If the system output diverges from the desired value then the control action changes with respect to the sign and the magnitude of the error e and the change of error ce.

An example: Fuzzy control of a CSTR χ1 Dimensionless Concentration χ2 Dimensionless Temperature Dα Damkohler Number Β b Reaction Heat Transfer coefficient The control objective is to maintain the control variable, which is the composition of the reacting mixture, within the desired operational settings eliminating mostly input concentration disturbances. The manipulated variable is taken to be the coolant temperature.

Fuzzy control of a CSTR: The controller Design e(t) = r(t) - y(t), ce(t)=e(t)-e(t-1), cu(t)= [u(t)-u(t-1)], Variables: where: r(t) is the set point at time t, y(t) is the process output at time t, e(t), ce(t) are the error and the change of error at time t. FUZZIFICATION: THE FUZZY RULES The output is below the set point . . And the error is getting smaller Given the fact that a reduction in the coolant temperature decreases the output concentration, and inversely,

Fuzzy control systems PI-like Fuzzy controller PD-like Fuzzy controller

PI-like Fuzzy controller The PI controller in the z-Domain has the following form (Stephanopoulos, 1984): In the time domain the above can be rewritten as cu = Kc ce + (Kc. K)e where ce the change in error, and u the control output signal. In order to generate an equivalent fuzzy controller, the same inputs e, and the same output, cu, will be used in its design. ce Based on the above, a two-input-single-output FLC is derived with the following variables: input variables: e(t) = r(t) y(t) ce(t) = e(t) e(t-1) output variable: cu(t) = u(t)-u(t-1) In a general form the control action cu can be represented as a nonlinear function of the input variables e(t), ce(t): cu = f(e', ce', t) = f (GE e, GCE ce, t) For small perturbations δe, δce around an equilibrium, the above equation is approximated by Finally one obtains the simplified discretized equation cu(t) = GE e(t) + GCE ce(t)

PD-like Fuzzy controller u(t) = GE e(t) + GCE ce(t)

A case study: Fuzzy control of a plug-flow tubular reactor

The control objective: to maintain the control variable, which is the composition of the reacting mixture at the output of the reactor, within the desired operational settings and particularly to keep the A reactant concentration at the output, below its nominal steady state value, eliminating mostly input concentration disturbances The manipulated variable is taken to be the coolant temperature. The incremental fuzzy controller, a two-input-single-output FLC is derived with the following variables: e(t)=r(t)-y(t), ce(t)=e(t)-e(t-1), cu(t)=u(t)-u(t-1), where: r(t) is the set point at time t (set point moisture), y(t) is the process output at time t (output moisture), e(t), ce(t) are the error and the change of error at time t.

Fuzzification For the fuzzification of the input -output variables, seven fuzzy sets are defined for each variable, e(t), ce(t) and cu(t) with fixed triangular shaped membership functions normalized in the same universe of discourse as it is shown in the figure

RULE -BASE Given the fact that a reduction in the coolant temperature decreases the output concentration, and inversely, the reasoning for the construction of the fuzzy control rules is as follows: · Keep the output of the FLC constant if the output has the desired value and the change of error is zero. · Change the control action of the FLC according to the values and signs of the error, e and the change of error, ce: . If the error is negative (the process output is above the set point) and the change of error is negative (at the previous step the controller was driving the system output upwards), then the controller should turn its output downwards. Hence, considering negative feedback, the change in control action should be positive, i. e. cu>0, since u(t)=u(t-1) +cu. . If the error is positive (the process output is below the set point) and the change of error is positive (at the previous step the controller was driving the system output downwards), then the controller should turn its output upwards. Hence, considering negative feedback, the change in control action should be negative, i. e. cu<0, since u(t)=u(t-1) +cu.

. If the error is positive (the process output is below the set point) and the change of error is negative, implying that at the previous step the controller was driving the system output upwards, trying to correct the control deviation, then the controller need not to take any further action. . If the error is negative (the process output is above the set point) and the change of error is positive, implying that at the previous step the controller was driving the system output downwards, then the controller need not to take any further action.

Performance Comparison of the Fuzzy and the PI controller tuned by the process reaction method (PI 1), by minimising the IAE criterion (PI 2)