Lecture 06 Fuzzy Rule-based System (Fuzzy Inference System)
Fuzzy Inference System vfuzzy inference is the process of formulating the mapping from a given input to an output using fuzzy logic.
Fuzzy Inference System v Find a crisp control action z 0 from the fuzzy rule-base and from the actual crisp inputs x 0 and y 0 :
Fuzzy Inference System v The inputs of fuzzy rule-based systems should be given by fuzzy sets, and therefore, we have to fuzzify the crisp inputs. v The output of a fuzzy system is always a fuzzy set, and therefore to get crisp value we have to defuzzify it. v Fuzzy logic control systems usually consist of four major parts: Fuzzification interface, Fuzzy rulebase, Fuzzy inference engine Defuzzification interface.
Fuzzy Inference System vfuzzification transforming crisp data into fuzzy sets. In most of the cases we use fuzzy singletons as fuzzifiers --- x 0 is a crisp input value from a process. Remark: A single pair (x,μ(x)) is called a fuzzy singleton x = {( x,1)} 0 0
Fuzzy Inference System vfuzzy Rule Base
Fuzzy Inference System vfuzzy Inference Engine The consequence is computed by That is, taking into consideration that and fuzzy singletons
Fuzzy Inference System The computation of the membership function of C is for all w W. The procedure for obtaining the fuzzy output of such a knowledge base can be formulated as Firing strength of the i-th rule : Output of the i-th rule : Overall system output :
Fuzzy Inference System vdefuzzification The output of the inference process so far is a fuzzy set, specifying a possibility distribution of control action. In the on-line control, a nonfuzzy (crisp) control action is usually required. Consequently, one must defuzzify the fuzzy control action (output) inferred from the fuzzy control algorithm, namely: where z 0 is the nonfuzzy control output and defuzzifier is the defuzzification operator.
Fuzzy Inference System v The most often used defuzzification operators: Centroid method Maxima Middle-of-Maxima
Fuzzy Inference System First-of-Maxima Last-of-Maxima max z 0
Example: A Tipping Problem ( 小费问题 )
Example :A Tipping Problem vthe Basic Tipping Problem Input 1 Service (0-10) Input 2 Food (0-10) Rule 1: If service is poor or food is bad, then tip is cheap. Rule 2: If service is good, then tip is average. Rule 3: If service is excellent or food is delicious, then tip is generous. Output Tip (5-25%) The inputs are crisp numbers limited to a specific range. All rules are evaluated in parallel using fuzzy reasoning. The results of the rules are combined and defuzzified. The result is a crisp number.
Example :A Tipping Problem vfuzzy inference process comprises of five parts: fuzzification of the input variables application of the fuzzy operator (AND or OR) in the antecedent implication from the antecedent to the consequent aggregation of the consequents across the rules defuzzification.
Example :A Tipping Problem vstep 1. Fuzzify Inputs Determine the degree to which the inputs belong to each of the appropriate fuzzy sets via membership functions Fuzzification of the input amounts to either a table lookup or a function evaluation
Example :A Tipping Problem Fuzzification using a table lookup Service Poor Good Excellent 0 1 0 0 1 1 0 0 2 0.8 0.2 0 3 0.6 0.6 0 4 0.4 0.8 0.1 5 0.2 1 0.2 6 0.1 0.8 0.4 7 0 0.6 0.6 8 0 0.2 0.8 9 0 0 1 10 0 0 1
Example :A Tipping Problem Fuzzification using a membership function
Example :A Tipping Problem vstep 2. Apply Fuzzy Operator After the inputs are fuzzified, you know the degree to which each part of the antecedent is satisfied for each rule. If the antecedent of a given rule has more than one part, the fuzzy operator is applied to obtain one number that represents the result of the antecedent for that rule. two or more membership values from fuzzified input variables Fuzzy Operator a single truth value
Example :A Tipping Problem As is described in Logical Operations section, any number of well-defined methods can fill in for the AND operation or the OR operation. The mostly used AND methods: minimum: min(a,b) product: prod(a,b)=a*b The mostly used OR methods: maximum: max(a,b) probabilistic: probor(a,b)=a+b-ab
Example :A Tipping Problem The following figure shows the OR operator max at work, evaluating the antecedent of the rule 3 for the tipping calculation.
Example :A Tipping Problem vstep 3. Apply Implication Method Determine the rule's weight. Generally, this weight is 1. When you may want to weight one rule relative to the others, you can change its weight value to something other than 1( 可手动为每条规则设置不同的置信系数 ). Determine the implication method. A consequent is a fuzzy set represented by a membership function. The consequent is reshaped using a function associated with the antecedent (a single number).
Example :A Tipping Problem The input for the implication process is a single number given by the antecedent, and the output is a fuzzy set. If service is excellent or food is delicious then tip is generous
Example :A Tipping Problem
Example :A Tipping Problem vstep 4. Aggregate All Outputs Because decisions are based on the testing of all of the rules in a FIS, the rules must be combined in some manner in order to make a decision. Aggregation is the process by which the fuzzy sets that represent the outputs of each rule are combined into a single fuzzy set. The input of the aggregation process is the list of truncated output functions returned by the implication process for each rule. The output of the aggregation process is one fuzzy set for each output variable.
Example :A Tipping Problem bad All three rules is combined, or aggregated, into a single fuzzy set whose membership function assigns a weighting for every output (tip) value.
Example :A Tipping Problem vstep 5. Defuzzify The input for the defuzzification process is a fuzzy set (the aggregate output fuzzy set) and the output is a single number. Centroid Other defuzzifers?
Example :A Tipping Problem vinformation flows through the fuzzy inference diagram
Example :A Tipping Problem vthe full-size fuzzy inference diagram
Universal Approximator veffectivity of fuzzy logic systems Using the Stone-Weierstrass theorem, Wang (1992) showed that fuzzy logic systems of the form are universal approximators with
Universal Approximator
Universal Approximator Universal approximators mean they can approximate any continuous function on a compact set to arbitrary accuracy. Theorem 1 (Wang, 1992). For a given real-valued continuous function g on the compact set U and arbitrary > 0, there exists a fuzzy logic system with output function f such that
Universal Approximator Castro in 1995 showed that Mamdani s fuzzy logic systems are also universal approximators with
Universal Approximator
Fuzzy Logic Systems can be used in many fields System Identification ---Fuzzy Modeling Control Design --- Fuzzy Logic Controller (FLC)
Conventional Control v Conventional controllers are derived from control theory techniques based on mathematical models of the openloop process, called system, to be controlled. v The purpose of the feedback controller is to guarantee a desired response of the output y. v The process of keeping the output y close to the setpoint (reference input) y, despite the presence disturbances of the system parameters, and noise measurements, is called regulation. v The output of the controller (which is the input of the system) is the control action u.
Conventional Control v The general form of the discrete-time control law is providing a control action that describes the relationship between the input and the output of the controller. -
Fuzzy Logic Controller v In a fuzzy logic controller (FLC), the dynamic behavior of a fuzzy system is characterized by a set of linguistic description rules based on expert knowledge. v The expert knowledge is usually of the form IF (a set of conditions are satisfied) THEN (a set of consequences can be inferred). Since the antecedents and the consequents of these IF-THEN rules are associated with fuzzy concepts (linguistic terms), they are often called fuzzy conditional statements.
Fuzzy Logic Controller v Basically, fuzzy control rules provide a convenient way for expressing control policy and domain knowledge. v Furthermore, several linguistic variables might be involved in the antecedents and the consequences of these rules. When this is the case, the system will be referred to as a multiinput-multi-output (MIMO) fuzzy system.
Fuzzy Logic Controller v For example, in the case of two-input-single-output (MISO) fuzzy systems, fuzzy control rules have the form: x, y --- linguistic variables, z --- control variable, A i, B i, and C i --- linguistic values of x, y and z in U, V and W, also --- an implicit sentence connective links the rules into a rule-base.
Fuzzy Logic Controller v We can represent the FLC in a form similar to the conventional control law ---- the function F is described by a fuzzy rulebase. v The knowledge-based nature of FLC dictates a limited usage of the past values of the error e and control u. because it is rather unreasonable to expect meaningful linguistic statements for e(k 3), e(k 4),..., e(k τ).
Fuzzy Logic Controller v A typical FLC describes the relationship between the change of the control and the error e(k) and the change of e(k) v Such a control law can be formalized as and is a general FLC expression with τ = 1.
Fuzzy Logic Controller v The actual output of the controller u(k) is obtained from the previous value of control u(k 1) that is updated by Δu(k). v This type of controller was suggested originally by Mamdani and Assilian in 1975 and is called the Mamdani-type FLC.
Fuzzy Logic Controller v A prototypical rule-base of a simple FLC realizing the control law above is listed in the following µ () e e