Guidelines for laboratory work on the topic: “Fuzzy logical conclusion. fuzzy sets

concept fuzzy inference occupies an important place in fuzzy logic Mamdani algorithm, Tsukamoto algorithm, Sugeno algorithm, Larsen algorithm, Simplified fuzzy inference algorithm, Refinement methods.

The fuzzy inference mechanism used in various kinds of expert and control systems basically has a knowledge base formed by experts in the subject area in the form of a set of fuzzy predicate rules of the form:

P1: if X is A 1 , then at is B 1 ,

P2: if X is A 2 , then at have B 2 ,

·················································

P n: If X There is An, Then at have B n, Where X- input variable (name for known data values), at- output variable (name for the data value to be calculated); A and B are membership functions defined, respectively, on x And at.

An example of such a rule

If X- low then at- high.

Let's give a more detailed explanation. Expert knowledge A → B reflects a fuzzy causal relationship between the premise and the conclusion, so it can be called a fuzzy relationship and denoted by R:

R= A → B,

where "→" is called a fuzzy implication.

Attitude R can be considered as a fuzzy subset of the direct product X×Y full set of prerequisites X and conclusions Y. Thus, the process of obtaining the (fuzzy) result of the conclusion B" using this observation A" and knowledge A → B can be represented as a formula

B" \u003d A "ᵒ R\u003d A "ᵒ (A → B),

where "o" is the convolution operation introduced above.

Both the operation of composition and the operation of implication in the algebra of fuzzy sets can be implemented in different ways (in this case, of course, the final result obtained will also differ), but in any case, the general logical conclusion is carried out in the following four stages.

1. Fuzziness(introduction of fuzziness, fuzzification, fuzzifica-tion). The membership functions defined on the input variables are applied to their actual values ​​to determine the degree of truth of each premise of each rule.

2. logical conclusion. The computed truth value for the premises of each rule is applied to the conclusions of each rule. This results in one fuzzy subset to be assigned to each output variable for each rule. As inference rules, only min (MINIMUM) or prod (MULTIPLICATION) operations are usually used. In the MINIMUM logical inference, the membership function of the inference is "cut off" in height, corresponding to the calculated degree of truth of the premise of the rule (fuzzy logic "AND"). In the MULTIPLICATION inference, the membership function of the inference is scaled by the computed degree of truth of the premise of the rule.

3. Composition. All fuzzy subsets assigned to each output variable (in all rules) are combined together to form one fuzzy subset for each output variable. With such a union, the operations max (MAXIMUM) or sum (SUM) are usually used. With MAXIMUM composition, the combined derivation of a fuzzy subset is constructed as a pointwise maximum over all fuzzy subsets (fuzzy logic "OR"). When SUMMARY is composed, the combined inference of a fuzzy subset is constructed as a pointwise sum over all fuzzy subsets assigned to the inference variable by the inference rules.

4. In conclusion (optional) - clearing(defuzzification), which is used when it is useful to convert a fuzzy set of outputs into a crisp number. There are a large number of sharpening methods, some of which are discussed below.

Example.Let some system be described by the following fuzzy rules:

P1: if X is A, then ω have D,

P2: if at is B, then ω there is E

P3: if z is C, then ω is F, where x, y And z— names of input variables, ω is the name of the output variable, and A, B, C, D, E, F are the given membership functions (triangular shape).

The procedure for obtaining a logical conclusion is illustrated in Fig. 1.9.

It is assumed that the input variables have taken some specific (clear) values ​​− x o,yO And z O.

In accordance with the above steps, at step 1 for these values ​​and based on the membership functions A, B, C, the degrees of truth are found α (x o), α (at o)And α (z o) for the premises of each of the three given rules (see Fig. 1.9).

At stage 2, the membership functions of the conclusions of the rules (i.e. D, E, F) are “cut off” at the levels α (x o), α (at o) And α (z o).

At stage 3, the membership functions truncated at the second stage are considered and they are combined using the operation max, resulting in a combined fuzzy subset described by the membership function μ ∑ (ω) and corresponding to the logical conclusion for the output variable ω .

Finally, at the 4th stage - if necessary - a clear value of the output variable is found, for example, using the centroid method: the clear value of the output variable is determined as the center of gravity for the curve μ ∑ (ω), i.e.

Consider the following most commonly used modifications of the fuzzy inference algorithm, assuming, for simplicity, that the knowledge base is organized by two fuzzy rules of the form:

P1: if X is A 1 and at is B 1 , then z is C 1 ,

P2: if X is A 2 and at is B 2 , then z is C 2 , where x And at— names of input variables, z- output variable name, A 1, A 2, B 1, B 2, C 1, C 2 - some given membership functions, with a clear value z 0 to be determined based on the information provided and clear values x 0 and at 0 .

Rice. 1.9. Illustration for the inference procedure

Mamdani algorithm

This algorithm corresponds to the considered example and Fig. 1.9. In the situation under consideration, it can be mathematically described as follows.

1. Fuzziness: there are degrees of truth for the premises of each rule: A 1 ( x 0), A 2 ( x 0), B 1 ( y 0), B 2 ( y 0).

2. Fuzzy inference: "cutoff" levels are found for the preconditions of each of the rules (using the MINIMUM operation)

α 1 = A 1 ( x 0) ˄ B 1 ( y 0)

α 2 = A 2 ( x 0) ˄ B 2 ( y 0)

where “˄” denotes the operation of the logical minimum (min), then the “truncated” membership functions are found

3. Composition: using the MAXIMUM operation (max, hereinafter referred to as "˅"), the found truncated functions are combined, which leads to obtaining final fuzzy subset for an output variable with a membership function

4. Finally, reduction to clarity (to find z 0 ) is carried out, for example, by the centroid method.

Tsukamoto algorithm

The initial premises are the same as in the previous algorithm, but in this case it is assumed that the functions C 1 ( z), С 2 ( z) are monotonic.

1. The first stage is the same as in the Mamdani algorithm.

2. At the second stage, first (as in the Mam-dani algorithm) the “cut-off” levels α 1 and α 2 are found, and then by solving the equations

α 1 = C 1 ( z 1), α 2 = C 2 ( z 2)

- clear values ​​( z 1 And z 2 ) for each of the original rules.

3. A clear value of the output variable is determined (as a weighted average z 1 And z 2 ):

in the general case (discrete version of the centroid method)

Example. Let we have A 1 ( x 0) = 0.7, A 2 ( x 0) = 0.6, B 1 ( y 0) = 0.3, V 2 ( y 0) = 0.8, corresponding cutoff levels

a 1 = min (A 1 ( x 0), B 1 ( y 0)) = min(0.7; 0.3) = 0.3,

a 2 = min (A 2 ( x 0), B 2 ( y 0)) = min(0.6; 0.8) = 0.6

and values z 1 = 8 and z 2 = 4 found as a result of solving equations

C 1 ( z 1) \u003d 0.3, C 2 ( z 2) = 0,6.


Rice. 1.10. Illustrations for the Tsukamoto algorithm

At the same time, the clear value of the output variable (see Fig. 1.10)

z 0 \u003d (8 0.3 + 4 0.6) / (0.3 + 0.6) \u003d 6.

Sugeno algorithm

Sugeno and Takagi used a set of rules in the following form (as before, here is an example of two rules):

R 1: if X is A 1 and at is B 1 , then z 1 = A 1 X + b 1 y,

R 2: if X is A 2 and at is B 2 , then z 2 = a 2 x+ b 2 y.

Algorithm representation

2. At the second stage are α 1 = A 1 ( x 0) ˄ B 1 ( y 0), α 2 \u003d A 2 ( x 0) ˄ В 2 ( at 0) and individual rule outputs:

3. In the third stage, a clear value of the output variable is determined:

Illustrates the algorithm in Fig. 1.11.

Rice. 1.11. Illustration for the Sugeno algorithm

Larsen algorithm

In the Larsen algorithm, fuzzy implication is modeled using the multiplication operator.

Description of the algorithm

1. The first stage is like in the Mamdani algorithm.

2. At the second stage, as in the Mamdani algorithm, the values ​​are first found

α 1 = A 1 ( x 0) ˄ B 1 ( y 0),

α 2 \u003d A 2 ( x 0) ˄ В 2 ( y 0),

and then private fuzzy subsets

α 1 C 1 ( z), a 2 C 2 (z).

3. The final fuzzy subset with the membership function is found

µs(z)= WITH(z)= (a 1 C 1 ( z)) ˅ ( a 2 C 2(z))

(in general n rules).

4. If necessary, reduction to clarity is performed (as in the previously considered algorithms).

The Larsen algorithm is illustrated in Fig. 1.12.


Rice. 1.12. An illustration of the Larsen algorithm

Simplified Fuzzy Inference Algorithm

The initial rules in this case are given in the form:

R 1: if X is A 1 and at is B 1 , then z 1 = c 1 ,

R 2: if X is A 2 and at is B 2 , then z 2 = With 2 , Where c 1 and since 2 are some ordinary (clear) numbers.

Description of the algorithm

1. The first stage is like in the Mamdani algorithm.

2. At the second stage, the numbers α 1 = A 1 ( x 0) ˄ B 1 ( y 0), α 2 = A 2 ( x 0) ˄ B 2 ( y 0).

3. At the third stage, a clear value of the output variable is found according to the formula

or - in the general case of the presence n rules - according to the formula

An illustration of the algorithm is shown in fig. 1.13.


Rice. 1.13. Illustration of a simplified fuzzy inference algorithm

Refinement methods

1. One of these methods has already been considered above - troid. We present the corresponding formulas again.

For continuous option:

for the discrete option:

2. The first maximum (First-of-Maxima). The clear value of the output variable is found as the smallest value at which the maximum of the final fuzzy set is reached, i.e. (see fig. 1.14a)


Rice. 1.14. Illustration for methods of reduction to definition: α - the first maximum; b - average maximum

3. Average maximum (Middle-of-Maxima). A clear value is found by the formula

where G is the subset of elements that maximize C (see Figure 1.14 b).

Discrete option (if C is discrete):

4. The maximum criterion (Max-Criterion). A clear value is chosen arbitrarily among the set of elements that deliver the maximum C, i.e.

5. Heightdefuzzification. Elements of the domain of definition Ω for which the values ​​of the membership function are less than a certain level α are not taken into account, and a clear value is calculated using the formula

where Сα is a fuzzy set α -level (see above).

Top-Down Fuzzy Inference

The fuzzy inferences considered so far are bottom-up inferences from the premises to the conclusion. In recent years, top-down inferences have begun to be used in diagnostic fuzzy systems. Let's consider the mechanism of such a conclusion using an example.

Let's take a simplified model for diagnosing a car malfunction with variable names:

X 1 - battery failure;

x 2 - working off engine oil;

y 1 - difficulty starting;

y 2 - deterioration in the color of exhaust gases;

y 3 - lack of power.

Between x i And y j there are unclear causal relationships rij= x iy j, which can be represented as some matrix R with elements rijϵ . Specific inputs (premises) and outputs (conclusions) can be considered as fuzzy sets A and B on the spaces X And Y. The relations of these sets can be denoted as

IN= AR,

where, as before, the sign "o" denotes the composition rule for fuzzy inferences.

In this case, the inference direction is the reverse of the inference direction for the rules, i.e. in the case of diagnostics, there is (given) a matrix R(expert knowledge), exits observed IN(or symptoms) and inputs are defined A(or factors).

Let the knowledge of an expert auto mechanic have the form

and as a result of the inspection of the car, its condition can be assessed as

IN= 0,9/y 1 + 0,1/at 2 + 0,2/at 3 .

It is required to determine the cause of this condition:

A =a 1 /x 1 + a 2 /x 2 .

The ratio of the introduced fuzzy sets can be represented as

or, transposing, in the form of fuzzy column vectors:

When using (max-mix)-composition, the last ratio is converted to the form

0.9 = (0.9 ˄ α 1) ˅ (0.6 ˄ α 2),

0.1 = (0.1 ˄ α 1) ˅ (0.5 ˄ α 2),

0.2 = (0.2 ˄ α 1) ˅ (0.5 ˄ α 2).

When solving this system, we note first of all that in the first equation the second term on the right side does not affect the right side, therefore

0.9 \u003d 0.9 ˄ α 1, α 1 ≥ 0.9.

From the second equation we get:

0.1 ≥ 0.5 ˄ α 2 , α 2 ≤ 0.1.

The resulting solution satisfies the third equation, so we have:

0.9 ≤ α 1 ≤ 1.0, 0 ≤ α 2 ≤ 0.1,

those. it is better to replace the battery (α 1 is the battery failure parameter, α 2 is the engine oil waste parameter).

In practice, in tasks similar to the one considered, the number of variables can be significant, different compositions of fuzzy inferences can be used simultaneously, the inference scheme itself can be multi-stage. At the present time, apparently, there are no general methods for solving such problems.

Design and Simulate Fuzzy Logic Systems

Fuzzy Logic Toolbox™ provides MATLAB ® functions, applications, and a Simulink ® block for analyzing, designing, and simulating fuzzy logic systems. The product guides you through the steps of developing fuzzy inference systems. Functions are provided for many common techniques, including fuzzy clustering and adaptive neuro-fuzzy learning.

The toolbox allows you to behave a complex model system using simple logical rules, and then implement those rules in a fuzzy inference system. You can use it as a standalone fuzzy inference engine. You can also use fuzzy inference blocks in Simulink and model fuzzy systems in a comprehensive model of the entire dynamic system.

Beginning of work

Learn the basics of Fuzzy Logic Toolbox

Fuzzy system inference modeling

Create Fuzzy Inference Systems and Fuzzy Trees

Fuzzy System Output Tuning

Customize Membership Functions and Rules of Fuzzy Systems

Data clustering

Find clusters in input/output data using fuzzy c-means or subtractive clustering

  • 5. Fuzzy logic. Brief historical information. Aspects of incomplete information
  • 6. Definitions of crisp and fuzzy sets. Definition of a fuzzy set. Membership function. Examples of fuzzy discrete and continuous sets.
  • 7. Basic properties of fuzzy sets. Fuzzy number and fuzzy interval.
  • *7. Basic properties of fuzzy sets. Fuzzy number and fuzzy interval.
  • *7. Basic properties of fuzzy sets. Fuzzy number and fuzzy interval.
  • 8. Concepts of fuzzification, defuzzification, linguistic variable. Example.
  • 9. Operations with fuzzy sets (equivalence, inclusion, fuzzy operation "and", "or", "not").
  • 10. Generalization of operations of intersection and union in the class of t-norms and s-conorms.
  • 11. Fuzzy relationships. Composition rules (max-min) and (max-prod). Examples.
  • 12. Fuzzy algorithms. Generalized scheme of fuzzy inference procedure.
  • 13. Fuzzy algorithms. The maximum-minimum method (Mamdani method) as a method of fuzzy logical inference (the presentation must be accompanied by an example).
  • 14. Fuzzy algorithms. The maximum-product method (Larsen method) as a fuzzy inference method (the presentation must be accompanied by an example).
  • 15. Defuzzification methods.
  • 16. Procedure (scheme) of fuzzy logical inference. An example of fuzzy inference to execute multiple rules. Advantages and disadvantages of systems based on fuzzy logic.
  • 17. Artificial neural networks. Features of a biological neuron. Artificial neuron model.
  • 18. Definition of an artificial neural network (ins). Single-layer and multilayer perceptrons.
  • 19. Classification ins. Tasks solved with the help of neural networks.
  • 20. The main stages of neural network analysis. Classification of known neural network structures according to the type of connections and type of learning and their application.
  • 21. Supervised learning algorithm for a multilayer perceptron
  • 22. Algorithms for learning neural networks. Backpropagation Algorithm
  • 23. Problems of learning ns.
  • 24. Kohonen networks. Statement of the clustering problem. Clustering algorithm.
  • 25. Transformation of the clustering algorithm for the purpose of implementation in a neural network basis. Structure of the Kohonen network
  • 26. Unsupervised learning algorithm for Kohonen networks. Generalized Procedure
  • 27. Unsupervised learning algorithm for Kohonen networks. Convex combination method. Graphic interpretation
  • 28. Self-organizing maps (juice) Kohonen. Features of learning juice. Building maps
  • 29. Problems of learning ins
  • 30. Genetic algorithms. Definition. Appointment. The essence of natural selection in nature
  • 31. Basic concepts of genetic algorithms
  • 32. Block diagram of the classical genetic algorithm. Features of initialization. Example.
  • 33. Block diagram of the classical genetic algorithm. Chromosome selection. Roulette method. Example.
  • 33. Block diagram of the classical genetic algorithm. Chromosome selection. Roulette method. Example.
  • 34. Block diagram of the classical genetic algorithm. Application of genetic operators. Example.
  • 35. Block diagram of the classical genetic algorithm. Checking the stop condition ha.
  • 36. Advantages of genetic algorithms.
  • 37. Hybrid these and their types.
  • 38. Structure of a soft expert system.
  • 39. Methodology for the development of intelligent systems. Types of prototypes of expert systems.
  • 40. Generalized structure of the main stages of development of expert systems.
  • 1. Identification.
  • 2. Conceptualization.
  • 3. Formalization
  • 4. Programming.
  • 5. Testing for completeness and integrity
  • 16. Procedure (scheme) of fuzzy logical inference. An example of fuzzy inference to execute multiple rules. Advantages and disadvantages of systems based on fuzzy logic.

    Fuzzification is the process of moving from a crisp set to a fuzzy one.

    Aggregation of prerequisites - for each rule, a -cut and clipping levels.

    Activation of rules - activation is made for each of their rules based on min-activation (Mamdani), prod-activation (Larsen)

    Inference accumulation - composition, union of the found truncated fuzzy sets using the max-disjunction operation.

    A linguistic variable is a variable whose values ​​are terms (words, phrases in natural language).

    Each value of a linguistic variable corresponds to a certain fuzzy set with its own membership function.

    Scope of fuzzy logic:

    1) Insufficiency or uncertainty of knowledge, when obtaining information is a difficult or impossible task.

    2) When there is difficulty in processing uncertain information.

    3) Transparency of modeling (unlike neural networks).

    Scope of fuzzy logic:

    1) When designing support systems and decision-making based on expert systems.

    2) When developing fuzzy controllers used in the management of technical systems.

    "+": 1) Solution of weakly formalized tasks.

    2) Application in areas where it is desirable to express the values ​​of variables in a linguistic form.

    "-": 1) The problem of choosing a membership function (it is solved when creating hybrid intelligent systems)

    2) The formulated set of rules may be incomplete and inconsistent.

    *16.Procedure (scheme) of fuzzy logical inference. An example of fuzzy inference to execute multiple rules. Advantages and disadvantages of systems based on fuzzy logic.

    The final result depends on the choice of the NLP method and defuzzification.

    P1: If Temperature (T) is low AND Humidity (F) is medium, then the valve is half open.

    P2: If Temperature (T) is low AND Humidity (F) is high, the valve is closed.

    NLV: max-min method (Mamdani);

    Defuzzification: The method of average of the maximums.

    17. Artificial neural networks. Features of a biological neuron. Artificial neuron model.

    Neural networks are computational structures that model simple biological processes commonly associated with those of the human brain. The human nervous system and brain consist of neurons interconnected by nerve fibers that are capable of transmitting electrical impulses between neurons.

    A neuron is a nerve cell that processes information. It consists of a body (nucleus and plasma) and processes of two types of nerve fibers - dendrites, through which impulses are received from the axons of other neurons, and its own axon (at the end it branches into fibers), through which it can transmit an impulse generated by the cell body. At the ends of the fibers are synapses that affect the strength of the impulse. When an impulse reaches the synaptic terminal, certain chemicals called non-protransmitters are released that either excite or inhibit the receiver neuron's ability to generate electrical impulses. Synapses can learn depending on the activity of the processes in which they participate. The weights of synapses can change over time, which also changes the behavior of the corresponding neuron.

    Artificial neuron model

    x 1 …x n – neuron input signals coming from other neurons. W 1 …W n are synaptic weights.

    Multipliers (synapses) - carry out communication between neurons, multiply the input signal by a number characterizing the strength of the connection.

    Totalizer - addition of signals coming through synaptic connections from other neurons.

    *17. Artificial neural networks. Features of a biological neuron. Artificial neuron model.

    Nonlinear Converter - implements a nonlinear function of one argument - the output of the adder. This function is called activation function or transfer function neuron.
    ;

    Neuron model:

    1) Calculates the weighted sum of its inputs from other neurons.

    2) There are excitatory and inhibitory synapses at the inputs of the neuron

    3) When the sum of inputs exceeds the threshold of the neuron, an output signal is generated.

    Types of activation functions:

    1) threshold function: range (0;1)

    "+": ease of implementation and high speed of calculation

    2) Sigmoidal (logistic function)


    As a decreases, the segment becomes flatter, with a=0 it becomes a straight line.

    "+": a simple expression of its derivative, as well as the ability to amplify weak signals better than large ones and prevent saturation from large signals.

    "-": area of ​​value is small (0.1).

    3) Hyperbolic tangent: range (-1,1)


    In 1965, L. Zade's work was published in the journal Information and Control under the title "Fuzzy sets". This name is translated into Russian as fuzzy sets. The motive was the need to describe such phenomena and concepts that are ambiguous and inaccurate. Previously known mathematical methods, using classical set theory and two-valued logic, did not allow solving problems of this type.

    Using fuzzy sets, one can formally define inexact and ambiguous concepts, such as “high temperature” or “big city”. To formulate the definition of a fuzzy set, it is necessary to set the so-called area of ​​reasoning. For example, when we estimate the speed of a car, we will limit ourselves to the range X = , where Vmax is the maximum speed that the car can reach. It must be remembered that X is a crisp set.

    Basic concepts

    fuzzy set A in some non-empty space X is the set of pairs

    Where

    - membership function of the fuzzy set A. This function assigns to each element x the degree of its membership in the fuzzy set A.

    Continuing the previous example, consider three imprecise formulations:
    - "Low vehicle speed";
    - "Average vehicle speed";
    - "High speed of the car."
    The figure shows fuzzy sets corresponding to the above formulations using membership functions.


    At a fixed point X=40km/h. the membership function of the fuzzy set "low vehicle speed" takes the value 0.5. The membership function of the fuzzy set "average car speed" takes the same value, while for the set "high car speed" the value of the function at this point is 0.

    A function T of two variables T: x -> is called T-norm, If:
    - is non-increasing with respect to both arguments: T(a, c)< T(b, d) для a < b, c < d;
    - is commutative: T(a, b) = T(b, a);
    - satisfies the connection condition: T(T(a, b), c) = T(a, T(b, c));
    - satisfies the boundary conditions: T(a, 0) = 0, T(a, 1) = a.

    Direct fuzzy inference

    Under fuzzy inference is understood as a process in which some consequences, possibly also fuzzy, are obtained from fuzzy premises. Approximate reasoning underlies a person's ability to understand natural language, read handwriting, play games that require mental effort, and in general, make decisions in a complex and incompletely defined environment. This ability to reason in qualitative, imprecise terms distinguishes human intelligence from the intelligence of a computer.

    The main rule of inference in traditional logic is the modus ponens rule, according to which we judge the truth of statement B by the truth of statements A and A -> B. For example, if A is the statement "Stepan is an astronaut", B is the statement "Stepan flies into space", then if the statements "Stepan is an astronaut" and "If Stepan is an astronaut, then he flies into space" are true, then the statement "Stepan flies into space" is also true. space".

    However, unlike traditional logic, the main tool of fuzzy logic will not be the modus ponens rule, but the so-called compositional inference rule, a very special case of which is the modus ponens rule.

    Suppose there is a curve y=f(x) and the value x=a is given. Then from the fact that y=f(x) and x=a we can conclude that y=b=f(a).


    We now generalize this process by assuming that a is an interval and f(x) is a function whose values ​​are intervals. In this case, to find the interval y=b corresponding to the interval a, we first construct the set a" with base a and find its intersection I with the curve whose values ​​are the intervals. Then we project this intersection onto the OY axis and obtain the desired value of y as the interval b. Thus, from the fact that y=f(x) and x=A is a fuzzy subset of the OX axis, we obtain the value of y as a fuzzy subset B of the OY axis.

    Let U and V be two universal sets with base variables u and v, respectively. Let A and F be fuzzy subsets of the sets U and U x V. Then the compositional inference rule states that the fuzzy set B = A * F follows from the fuzzy sets A and F.

    Let A and B be fuzzy statements and m(A), m(B) be the membership functions corresponding to them. Then the implication A -> B will correspond to some membership function m(A -> B). By analogy with traditional logic, it can be assumed that

    Then

    However, this is not the only generalization of the implication operator; there are others.

    Implementation

    To implement the direct fuzzy inference method, we need to choose an implication operator and a T-norm.
    Letting T-norm be the minimum function:

    and the implication operator will be the Gödel function:


    The input data will contain knowledge (fuzzy sets) and rules (implications), for example:
    A = ((x1, 0.0), (x2, 0.2), (x3, 0.7), (x4, 1.0)).
    B = ((x1, 0.7), (x2, 0.4), (x3, 1.0), (x4, 0.1)).
    A => B.

    The implication will be represented as a Cartesian matrix, each element of which is calculated using the selected implication operator (in this example, the Gödel function):

    1. def compute_impl(set1, set2):
    2. """
      Computing implication
      """
    3. relation = ()
    4. for i in set1.items():
    5. relation[i] = ()
    6. for j in set2.items():
    7. v1 = set1.value(i)
    8. v2 = set2.value(j)
    9. relation[i][j] = impl(v1, v2)
    10. return relation

    For the data above it would be:
    Conclusion:
    A => B.
    x1 x2 x3 x4
    x1 1.0 1.0 1.0 1.0
    x2 1.0 1.0 1.0 0.1
    x3 1.0 0.4 1.0 0.1
    x4 0.7 0.4 1.0 0.1
    1. def conclusion (set, relation):
    2. """
      Conclusion
      """
    3. conl_set =
    4. for i in relation:
    5. l =
    6. for j in relation[i]:
    7. v_set = set.value(i)
    8. v_impl = relation[i][j]
    9. l.append(t_norm(v_set, v_impl))
    10. value = max(l)
    11. conl_set. append((i, value))
    12. return conl_set

    Result:
    B" = ((x1, 1.0), (x2, 0.7), (x3, 1.0), (x4, 0.7)).

    Sources

    • Rutkovskaya D., Pilinsky M., Rutkovsky L. Neural networks, genetic algorithms and fuzzy systems: Per. from Polish. I. D. Rudinsky. - M.: Hot line - Telecom, 2006. - 452 p.: ill.
    • Zadeh L. A. Fuzzy Sets, Information and Control, 1965, vol. 8, s. 338-353

    The concept of fuzzy inference is central to fuzzy logic and fuzzy control theory. Speaking about fuzzy logic in control systems, we can give the following definition of a fuzzy inference system.

    Fuzzy inference system is the process of obtaining fuzzy conclusions about the required control of an object based on fuzzy conditions or prerequisites, which are information about the current state of the object.

    This process combines all the basic concepts of fuzzy set theory: membership functions, linguistic variables, fuzzy implication methods, etc. The development and application of fuzzy inference systems includes a number of stages, the implementation of which is carried out on the basis of the provisions of fuzzy logic considered earlier (Fig. 2.18).

    Fig.2.18. Diagram of the process of fuzzy inference in fuzzy ACS

    The rule base of fuzzy inference systems is designed to formally represent the empirical knowledge of experts in a particular subject area in the form fuzzy production rules. Thus, the base of fuzzy production rules of a fuzzy inference system is a system of fuzzy production rules that reflects the knowledge of experts about the methods of managing an object in various situations, the nature of its functioning in various conditions, etc., i.e. containing formalized human knowledge.

    Fuzzy production rule is an expression of the form:

    (i):Q;P;A═>B;S,F,N,

    Where (i) is the name of the fuzzy product, Q is the scope of the fuzzy product, P is the applicability condition for the core of the fuzzy product, A═>B is the core of the fuzzy product, in which A is the kernel condition (or antecedent), B is the conclusion of the kernel (or consequent), ═> is the sign of a logical sequence or consequence, S is a method or method for determining the quantitative value of the degree of truth of the conclusion of the core, F is the coefficient of certainty or certainty of the fuzzy production, N is the postconditions of the production.

    The scope of fuzzy products Q describes explicitly or implicitly the subject area of ​​knowledge that a separate product represents.

    The applicability condition of the production kernel P is a logical expression, usually a predicate. If it is present in the production, then the activation of the core of the production becomes possible only if this condition is true. In many cases, this product element can be omitted or introduced into the core of the product.

    The kernel A═>B is the central component of the fuzzy production. It can be presented in one of the more common forms: "IF A THEN B", "IF A THEN B"; where A and B are some expressions of fuzzy logic, which are most often represented in the form of fuzzy statements. Compound logical fuzzy statements can also be used as expressions, i.e. elementary fuzzy statements connected by fuzzy logical connectives, such as fuzzy negation, fuzzy conjunction, fuzzy disjunction.

    S is a method or method for determining the quantitative value of the degree of truth of the conclusion B based on the known value of the degree of truth of the condition A. This method defines a fuzzy inference scheme or algorithm in production fuzzy systems and is called composition method or activation method.

    The confidence factor F expresses a quantitative assessment of the degree of truth or the relative weight of fuzzy products. The confidence factor takes its value from the interval and is often called the weighting factor of the fuzzy production rule.

    The fuzzy production postcondition N describes the actions and procedures that must be performed in the case of the implementation of the production core, i.e. obtaining information about the truth of B. The nature of these actions can be very different and reflect the computational or other aspect of the production system.

    A consistent set of fuzzy production rules forms fuzzy production system. Thus, a fuzzy production system is a domain-specific list of fuzzy production rules “IF A THEN B”.

    The simplest version of the fuzzy production rule:

    RULE<#>: IF β 1 "IS ά 1" THEN "β 2 IS ά 2"

    RULE<#>: IF " β 1 IS ά 1 " THEN " β 2 display:block IS ά 2 ".

    The antecedent and consequent of the fuzzy production core can be complex, consisting of the connectives “AND”, “OR”, “NOT”, for example:

    RULE<#>: IF "β 1 IS ά" AND "β 2 IS NOT ά" THEN "β 1 IS NOT β 2"

    RULE<#>: IF « β 1 IS ά » AND « β 2 IS NOT ά » THEN « β 1 IS NOT β 2 ».

    Most often, the base of fuzzy production rules is presented in the form of a structured text that is consistent with respect to the used linguistic variables:

    RULE_1: IF "Condition_1" THEN "Conclusion_1" (F 1 t),

    RULE_n: IF "Condition_n" THEN "Conclusion_n" (F n),

    where F i ∈ is the certainty factor or the weighting factor of the corresponding rule. Consistency of the list means that only simple and compound fuzzy statements connected by binary operations “AND”, “OR” can be used as conditions and conclusions of the rules, while in each of the fuzzy statements the membership functions of the term set values ​​for each linguistic variable must be defined. As a rule, the membership functions of individual terms are represented by triangular or trapezoidal functions. The following abbreviations are commonly used to name individual terms.

    Table 2.3.


    Example. There is a bulk tank (tank) with a continuous controlled flow of liquid and a continuous uncontrolled flow of liquid. The rule base of the fuzzy inference system, corresponding to the expert's knowledge of which liquid inflow should be chosen so that the liquid level in the tank remains average, will look like this:

    RULE<1>: And "fluid consumption is large" TO "fluid inflow large medium small »;
    RULE<2>: IF "liquid level is low" And "fluid consumption is average" TO "fluid inflow large medium small »;
    RULE<3>: IF "liquid level is low" And "fluid consumption is small" TO "fluid inflow large medium small »;
    RULE<4>: And "fluid consumption is large" TO "fluid inflow large medium small »;
    RULE<5>: IF "liquid level is medium" And "fluid consumption is average" TO "fluid inflow large medium small »;
    RULE<6>: IF "liquid level is medium" And "fluid consumption is small" TO "fluid inflow large medium small »;
    RULE<7>: And "fluid consumption is large" TO "fluid inflow large medium small »;
    RULE<8>: IF "liquid level is high" And "fluid consumption is average" TO "fluid inflow large medium small »;
    RULE<9>: IF "liquid level is high" And "fluid consumption is small" TO "fluid inflow large medium small ».

    Using the designations ZP - "small", PM - "medium", PB - "large", this base of fuzzy production rules can be represented in the form of a table, in the nodes of which there are corresponding conclusions about the required fluid inflow:

    Table 2.4.

    Level
    ZP PM PB
    ZP 0 0 0
    PM 0.5 0.25 0
    PB 0.75 0.25 0
    Fuzzification(introduction of fuzziness) is the establishment of a correspondence between the numerical value of the input variable of the fuzzy inference system and the value of the membership function of the corresponding term of the linguistic variable. At the stage of fuzzification, the values ​​of all input variables of the fuzzy inference system, obtained by a method external to the fuzzy inference system, for example, using sensors, are associated with specific values ​​of the membership functions of the corresponding linguistic terms, which are used in the conditions (antecedents) of the fuzzy production rule kernels that make up the base of the fuzzy production rules of the fuzzy inference system. Fuzzification is considered completed if the degrees of truth μ A (x) of all elementary logical statements of the form " β IS ά " included in the antecedents of fuzzy production rules are found, where ά is a certain term with a known membership function μ A (x) , a is a clear numerical value belonging to the universe of the linguistic variable β .

    Example. The formalization of the description of the liquid level in the tank and the liquid flow rate was carried out using linguistic variables, the tuple of which contains three fuzzy variables each, corresponding to the concepts of small, medium and large values ​​of the corresponding physical quantities, the membership functions of which are shown in Fig. 2.19.



    Triangular Trapezoidal Z-linear S-linear
    Triangular Trapezoidal Z-linear S-linear
    Current level:


    Triangular Trapezoidal Z-linear S-linear
    Triangular Trapezoidal Z-linear S-linear
    Triangular Trapezoidal Z-linear S-linear
    Current consumption:

    Fig.2.19. Membership functions of tuples of linguistic variables corresponding to fuzzy concepts of small, medium, large level and fluid flow, respectively

    If the current level and flow rate of the liquid are 2.5 m and 0.4 m 3 /sec, respectively, then with fuzzification we obtain the degrees of truth of elementary fuzzy statements:

    • "liquid level is small" - 0.75;
    • "liquid level is average" - 0.25;
    • "liquid level is high" - 0.00;
    • "liquid flow rate is small" - 0.00;
    • “fluid consumption is average” - 0.50;
    • “Large fluid flow” - 1.00.

    Aggregation is a procedure for determining the degree of truth of conditions for each of the rules of the fuzzy inference system. In this case, the values ​​of the membership functions of the terms of linguistic variables obtained at the stage of fuzzification, which make up the above conditions (antecedents) of the kernels of fuzzy production rules, are used.

    If the condition of a fuzzy production rule is a simple fuzzy statement, then the degree of its truth corresponds to the value of the membership function of the corresponding term of the linguistic variable.

    If the condition represents a compound statement, then the degree of truth of the compound statement is determined on the basis of the known truth values ​​of its constituent elementary statements using previously introduced fuzzy logical operations in one of the predetermined bases.

    For example, taking into account the truth values ​​of elementary propositions obtained as a result of fuzzification, the degree of truth of the conditions for each composite rule of the fuzzy inference system for controlling the liquid level in the tank, in accordance with the definition of the fuzzy logical "AND" of two elementary propositions A, B according to Zade: T(A ∩ B)=min(T(A);T(B)) , will be as follows.

    RULE<1>: antecedent - “liquid level is small” AND “liquid flow is large”; degree of truth
    antecedent min(0.75 ;1.00 )=0.00 .

    RULE<2>: antecedent - "liquid level is small" AND "liquid flow is medium"; degree of truth
    antecedent min(0.75 ;0.50 )=0.00 .

    RULE<3>: antecedent - “liquid level is small” AND “liquid flow is small”, degree of truth
    antecedent min(0.75 ;0.00 )=0.00 .

    RULE<4>: antecedent - “fluid level is medium” AND “liquid flow is large”, degree of truth
    antecedent min(0.25 ;1.00 )=0.00 .

    RULE<5>: antecedent - “fluid level is average” AND “fluid flow is average”, degree of truth
    antecedent min(0.25 ;0.50 )=0.00 .

    RULE<6>: antecedent - “fluid level is medium” AND “liquid flow is small”, degree of truth
    antecedent min(0.25 ;0.00 )=0.00 .

    RULE<7>: antecedent - “liquid level is large” AND “liquid flow is large”, degree of truth
    antecedent min(0.00 ;1.00 )=0.00 .

    RULE<8>: antecedent - “high liquid level” AND “medium liquid flow”, degree of truth
    antecedent min(0.00 ;0.50 )=0.00 .

    RULE<9>: antecedent - “liquid level is large” AND “liquid flow is small”, degree of truth
    antecedent min(0.00 ;0.00 )=0.00 .

    Level
    0.75 0.25 0
    0 0 0 0
    0.5 0.5 0.25 0
    1 0.75 0.25 0

    Activation in fuzzy inference systems, it is a procedure or process of finding the degree of truth of each of the elementary logical statements (subconclusions) that make up the consequents of the kernels of all fuzzy production rules. Since the conclusions are made about the output linguistic variables, the degrees of truth of elementary sub-conclusions are associated with elementary membership functions during activation.

    If the conclusion (consequent) of a fuzzy production rule is a simple fuzzy statement, then the degree of its truth is equal to the algebraic product of the weight coefficient and the degree of truth of the antecedent of this fuzzy production rule.

    If the conclusion is a compound statement, then the degree of truth of each of the elementary statements is equal to the algebraic product of the weight coefficient and the degree of truth of the antecedent of the given fuzzy production rule.

    If the weight coefficients of the production rules are not explicitly specified at the stage of generating the rule base, then their default values ​​are equal to one.

    The membership functions μ (y) of each of the elementary subconclusions of the consequents of all production rules are found using one of the fuzzy composition methods:

    • min-activation – μ (y) = min ( c ; μ (x) ) ;
    • prod-activation - μ (y) =c μ (x) ;
    • average-activation – μ (y) =0.5(c + μ (x)) ;

    Where μ (x) and c are, respectively, the membership functions of the terms of linguistic variables and the degree of truth of fuzzy statements that form the corresponding consequences (consequences) of the kernels of fuzzy production rules.

    Example. If the description of the liquid inflow in the tank is formalized using a linguistic variable, the tuple of which contains three fuzzy variables corresponding to the concepts of small, medium and large values ​​of the liquid inflow, the membership functions of which are presented in Fig. 2.19, then for the production rules of the fuzzy inference system for controlling the liquid level in the tank by changing the liquid inflow, the membership functions of all subconclusions with min activation will look as follows (Fig. 2.20 (a), (b)).

    Fig.2.20(a). Membership function of a tuple of linguistic variables corresponding to the fuzzy concepts of small, medium, large liquid inflow into the tank and min-activation of all subconclusions of the fuzzy production rules of the liquid level control system in the tank

    Fig.2.20(b). Membership function of a tuple of linguistic variables corresponding to the fuzzy concepts of small, medium, large liquid inflow into the tank and min-activation of all subconclusions of the fuzzy production rules of the liquid level control system in the tank

    Accumulation(or storage) in fuzzy inference systems is the process of finding the membership function for each of the output linguistic variables. The purpose of accumulation is to combine all degrees of truth of the subconclusions to obtain a membership function for each of the output variables. The accumulation result for each output linguistic variable is defined as the union of fuzzy sets of all subconclusions of the fuzzy rule base with respect to the corresponding linguistic variable. The union of membership functions of all subconclusions is usually carried out classically ∀ x ∈ X μ A ∪ B (x) = max ( μ A (x) ; μ B (x) ) (max-union), the operations can also be used:

    • algebraic union ∀ x ∈ X μ A+B x = μ A x + μ B x - μ A x ⋅ μ B x ,
    • boundary union ∀ x ∈ X μ A B x = min( μ A x ⋅ μ B x ;1) ,
    • drastic union ∀ x ∈ X μ A ∇ B (x) = ( μ B (x) , e c l and μ A (x) = 0, μ A (x) , e c l and μ B (x) = 0, 1, otherwise,
    • and also λ-sums ∀ x ∈ X μ (A+B) x = λ μ A x +(1-λ) μ B x ,λ∈ .

    Example. For the production rules of the fuzzy inference system for controlling the liquid level in the tank by changing the liquid inflow, the membership function of the linguistic variable "liquid inflow", obtained as a result of the accumulation of all subconclusions with max-union, will look like this (Fig. 2.21).

    Fig. 2.21 Membership function of the linguistic variable "fluid inflow"

    Defuzzification in fuzzy inference systems, this is the process of transition from the membership function of the output linguistic variable to its clear (numerical) value. The purpose of defuzzification is to use the results of the accumulation of all output linguistic variables to obtain quantitative values ​​for each output variable that is used by devices external to the fuzzy inference system (actuators of intelligent ACS).

    The transition from the membership function μ (x) of the output linguistic variable obtained as a result of accumulation to the numerical value y of the output variable is performed by one of the following methods:

    • center of gravity method(Centre of Gravity) is to calculate area centroid y = ∫ x min x max x μ (x) d x ∫ x min x max μ (x) d x , where [ x max ; x min ] is the carrier of the fuzzy set of the output linguistic variable; (in Fig. 2.21 the result of defuzzification is indicated by the green line)
    • center area method(Centre of Area) consists in calculating the abscissa y dividing the area bounded by the membership function curve μ (x), the so-called area bisector ∫ x min y μ (x) d x = ∫ y x max μ (x) d x ; (in Fig. 2.21, the result of defuzzification is indicated by a blue line)
    • left modal value method y= x min ;
    • right modal value method y=xmax

      Example. For the production rules of the fuzzy inference system for controlling the liquid level in the tank by changing the liquid inflow, the defuzzification of the membership function of the linguistic variable "liquid inflow" (Fig. 2.21) leads to the following results:

    • center of gravity method y= 0.35375 m 3 /sec;
    • method of the center of the area y \u003d 0, m 3 / s
    • left modal value method y= 0.2 m 3 /sec;
    • right modal value method y= 0.5 m 3 /sec

    The considered stages of fuzzy inference can be implemented in an ambiguous way: aggregation can be carried out not only in the basis of Zadeh's fuzzy logic, activation can be carried out by various methods of fuzzy composition, at the accumulation stage, the union can be carried out in a way different from max-combining, defuzzification can also be carried out by various methods. Thus, the choice of specific ways to implement individual stages of fuzzy inference determines one or another fuzzy inference algorithm. At present, the question of criteria and methods for choosing a fuzzy inference algorithm, depending on a specific technical problem, remains open. At the moment, the following algorithms are most often used in fuzzy inference systems.

    Algorithm Mamdani (Mamdani) found application in the first fuzzy automatic control systems. It was proposed in 1975 by the English mathematician E. Mamdani to control a steam engine.

    • The formation of the rules base of the fuzzy inference system is carried out in the form of an ordered agreed list of fuzzy production rules in the form “IF A THEN B ”, where the antecedents of the kernels of the fuzzy production rules are built using logical connectives “AND”, and the consequents of the kernels of the fuzzy production rules are simple.
    • Fuzzification of input variables is carried out in the manner described above, just as in the general case of constructing a fuzzy inference system.
    • Aggregation of subconditions of fuzzy production rules is carried out using the classical fuzzy logical operation "AND" of two elementary statements A, B: T(A ∩ B) = min( T(A);T(B) ) .
    • Activation of subconclusions of fuzzy production rules is carried out by the min-activation method μ (y) = min(c; μ (x) ) , where μ (x) and c are, respectively, the membership functions of the terms of linguistic variables and the degree of truth of fuzzy statements that form the corresponding consequences (consequents) of the kernels of fuzzy production rules.
    • The accumulation of subconclusions of fuzzy production rules is carried out using the classical fuzzy logic max-union of membership functions ∀ x ∈ X μ A B x = max( μ A x ; μ B x ) .
    • Defuzzification is carried out using the center of gravity or center of area method.

    For example, the case of tank level control described above corresponds to the Mamdani algorithm if, at the defuzzification stage, a clear value of the output variable is sought by the center of gravity or area method: y= 0.35375 m 3 /sec or y= 0.38525 m 3 /sec, respectively.

    Algorithm Tsukamoto (Tsukamoto) formally looks like this.

    • Aggregation of subconditions of fuzzy production rules is carried out similarly to the Mamdani algorithm using the classical fuzzy logical operation "AND" of two elementary statements A, B: T(A ∩ B) = min( T(A);T(B) )
    • The activation of subconclusions of fuzzy production rules is carried out in two stages. At the first stage, the degrees of truth of conclusions (consequences) of fuzzy production rules are found similarly to the Mamdani algorithm, as an algebraic product of the weight coefficient and the degree of truth of the antecedent of this fuzzy production rule. At the second stage, in contrast to the Mamdani algorithm, for each of the production rules, instead of constructing membership functions of subconclusions, the equation μ (x) = c is solved and a clear value ω of the output linguistic variable is determined, where μ (x) and c are, respectively, the membership functions of the terms of linguistic variables and the degree of truth of fuzzy statements that form the corresponding consequences (consequents) of the cores of fuzzy production rules.
    • At the defuzzification stage, for each linguistic variable, a transition is made from a discrete set of crisp values ​​( w 1 . . . w n ) to a single crisp value according to the discrete analogue of the center of gravity method y = ∑ i = 1 n c i w i ∑ i = 1 n c i ,

      where n is the number of rules of fuzzy production, in the subconclusions of which this linguistic variable appears, c i is the degree of truth of the subconclusion of the production rule, w i is the clear value of this linguistic variable obtained at the activation stage by solving the equation μ (x) = c i , i.e. μ (w i) = c i , and μ (x) represents the membership function of the corresponding term of the linguistic variable.

    For example, the Tsukamoto algorithm is implemented if, in the tank level control case described above:

    • at the activation stage, use the data in Fig. 2.20 and graphically solve the equation μ (x) = c i for each production rule, i.e. find pairs of values ​​(c i , w i): rule1 - (0.75 ; 0.385), rule2 - (0.5 ; 0.375), rule3- (0 ; 0), rule4 - (0.25 ; 0.365), rule5 - (0.25 ; 0.365),
      rule6 - (0 ; 0), rule7 - (0 ; 0), rule7 - (0 ; 0), rule8 - (0 ; 0), rule9 - (0 ; 0), there are two roots for the fifth rule;
    • at the stage of defuzzification for the linguistic variable "fluid inflow" to carry out the transition from a discrete set of clear values ​​( ω 1 . . . ω n ) to a single clear value according to the discrete analogue of the center of gravity method y = ∑ i = 1 n c i w i ∑ i = 1 n c i , y= 0.35375 m 3 /sec

    Larsen's algorithm formally looks like this.

    • The formation of the rule base of the fuzzy inference system is carried out similarly to the Mamdani algorithm.
    • Fuzzification of input variables is carried out similarly to the Mamdani algorithm.
    • Activation of subconclusions of fuzzy production rules is carried out by the prod-activation method, μ (y)=c μ (x) , where μ (x) and c are respectively the membership functions of the terms of linguistic variables and the degree of truth of fuzzy statements that form the corresponding consequences (consequents) of the kernels of fuzzy production rules.
    • The accumulation of subconclusions of the fuzzy production rules is carried out similarly to the Mamdani algorithm using the classical fuzzy logic max-union of membership functions T(A ∩ B) = min( T(A);T(B) ) .
    • Defuzzification is carried out by any of the methods discussed above.

    For example, Larsen’s algorithm is implemented if, in the case of tank level control described above, at the activation stage, the membership functions of all subconclusions according to prod-activation are obtained (Fig.2.22(a),(b)), then the membership function of the linguistic variable “liquid inflow”, obtained as a result of the accumulation of all subconclusions with max-union, will look like this (Fig.2.22(b)), and the defuzzification of the membership function of the linguistic variable “liquid inflow” leads to the following results: the center of gravity method y= 0.40881 m 3 /s, center of area method y= 0.41017 m 3 /s

    Fig. 2.22(a) Prod-activation of all subconclusions of the fuzzy production rules of the liquid level control system in the tank

    Fig. 2.22(b) Prod-activation of all subconclusions of the fuzzy production rules of the liquid level control system in the tank and the membership function of the linguistic variable "liquid inflow" obtained by max-union

    ,Sugeno algorithm as follows.

    • The rule base of the fuzzy inference system is formed in the form of an ordered consistent list of fuzzy production rules in the form “IF A AND B THEN w = ε 1 a + ε 2 b ”, where the antecedents of the kernels of fuzzy production rules are built from two simple fuzzy statements A, B using logical connectives “AND”, a and b are clear values ​​of input variables corresponding to statements A and B, respectively, ε 1 and ε 2 are weight coefficients , which determine the coefficients of proportionality between the crisp values ​​of the input variables and the output variable of the fuzzy inference system, w is the crisp value of the output variable, defined in the conclusion of the fuzzy rule as a real number.
    • Fuzzification of the input variables that define statements and is carried out similarly to Mamdani's algorithm.
    • Aggregation of subconditions of fuzzy production rules is carried out similarly to the Mamdani algorithm using the classical fuzzy logical operation "AND" of two elementary statements A, B: T(A ∩ B) = min( T(A);T(B) ) .
    • “Activation of subconclusions of fuzzy production rules is carried out in two stages. At the first stage, the degrees of truth c of the conclusions (consequences) of the fuzzy production rules that associate the output variable with real numbers are found similarly to the Mamdani algorithm, as an algebraic product of the weight coefficient and the degree of truth of the antecedent of this fuzzy production rule. At the second stage, in contrast to Mamdani's algorithm, for each of the production rules, instead of constructing the membership functions of subconclusions in an explicit form, a clear value of the output variable w = ε 1 a + ε 2 b is found. Thus, each i-th production rule is assigned a point (c i w i) , where c i is the degree of truth of the production rule, w i is the exact value of the output variable defined in the consequent of the production rule.
    • The accumulation of the conclusions of the fuzzy production rules is not carried out, since at the activation stage discrete sets of crisp values ​​have already been obtained for each of the output linguistic variables.
    • Defuzzification is carried out as in the Tsukamoto algorithm. For each linguistic variable, a transition is made from a discrete set of crisp values ​​( w 1 . . . w n ) to a single crisp value according to the discrete analogue of the center of gravity method y = ∑ i = 1 n c i w i ∑ i = 1 n c i linguistic variable, established in the consequent of the production rule.

    For example, Sugeno's algorithm is implemented if, in the case of liquid level control in the tank described above, at the stage of forming the rule base of the fuzzy inference system, the rules are set based on the fact that while maintaining a constant liquid level, the numerical values ​​of the inflow w and flow rate b must be equal to each other ε 2 =1, and the capacity filling rate is determined by the corresponding change in the proportionality coefficient ε 1 between the inflow w and the liquid level a . In this case, the rule base of the fuzzy inference system, corresponding to the expert’s knowledge of which fluid inflow w = ε 1 a + ε 2 b should be chosen in order for the liquid level in the tank to remain average, will look like this:

    RULE<1>: IF “liquid level is small” AND “liquid flow is large” THEN w=0.3a+b;

    RULE<2>: IF “liquid level is low” AND “liquid flow is medium” THEN w=0.2a+b;

    RULE<3>: IF “liquid level is low” AND “liquid flow is small” THEN w=0.1a+b ;

    RULE<4>: IF “liquid level is medium” AND “liquid flow is large” THEN w=0.3a+b;

    RULE<5>: IF “liquid level is average” AND “liquid flow is average” THEN w=0.2a+b;

    RULE<6>: IF “liquid level is medium” AND “liquid flow is small” THEN w=0.1a+b;

    RULE<7>: IF “liquid level is large” AND “liquid flow is large” THEN w=0.4a+b;

    RULE<8>: IF “liquid level is large” AND “liquid flow is average” THEN w=0.2a+b;

    RULE<9>: IF “liquid level is large” AND “liquid flow is small” THEN w=0.1a+b.

    With the previously considered current level and flow rate a= 2.5 m and b= 0.4 m 3 /sec, respectively, as a result of fuzzification, aggregation and activation, taking into account the explicit definition of clear values ​​of the output variable in the consequents of production rules, we obtain pairs of values ​​(c i w i) : rule1 - (0.75 ; 1.15), rule2 - (0.5 ; 0.9), rule3 - (0 ; 0.65), rule 4 - (0.25 ; 1.15), rule5 - (0.25 ; 0.9), rule6 - (0 ; 0.65), rule7 - (0 ; 0), rule7 - (0 ; 1.14), rule8 - (0 ; 0.9), rule9 - (0 ; 0.65) . At the stage of defuzzification for the linguistic variable “fluid inflow”, the transition is made from a discrete set of clear values ​​( w 1 . . . w n ) to a single clear value according to the discrete analog of the center of gravity method y = ∑ i = 1 n c i w i ∑ i = 1 n c i , y= 1.0475 m 3 /sec

    Simplified Fuzzy Inference Algorithm is formally specified in exactly the same way as the Sugeno algorithm, only when explicitly specifying clear values ​​in the consequents of production rules, instead of the relation w= ε 1 a+ ε 1 b, the direct value of w is explicitly specified. Thus, the formation of the rules base of the fuzzy inference system is carried out in the form of an ordered consistent list of fuzzy production rules in the form “IF A AND B THEN w=ε ”, where the antecedents of the kernels of fuzzy production rules are built from two simple fuzzy statements A, B using logical connectives “AND”, w is a clear value of the output variable, defined for each conclusion of the i -th rule, as a real number ε i .

    For example, A simplified fuzzy inference algorithm is implemented if, in the case of liquid level control in the tank described above, at the stage of forming the rule base of the fuzzy inference system, the rules are specified as follows:

    RULE<1>: IF “liquid level is small” AND “liquid flow is large” THEN w=0.6;

    RULE<2>: IF “liquid level is low” AND “liquid flow is average” THEN w=0.5;

    RULE<3>: IF “liquid level is low” AND “liquid flow is small” THEN w=0.4;

    RULE<4>: IF “liquid level is medium” AND “liquid flow is large” THEN w=0.5;

    RULE<5>: IF “liquid level is average” AND “liquid flow is average” THEN w=0.4;

    RULE<6>: IF “liquid level is medium” AND “liquid flow is small” THEN w=0.3;

    RULE<7>: IF “liquid level is large” AND “liquid flow is large” THEN w=0.3;

    RULE<8>: IF “liquid level is large” AND “liquid flow is average” THEN w=0.2;

    RULE<9>: IF “liquid level is large” AND “liquid flow is small” THEN w=0.1.

    With the current level and flow rate already considered and, accordingly, as a result of fuzzification, aggregation and activation, taking into account the explicit definition of clear values ​​of the output variable in the consequents of production rules, we obtain pairs of values ​​(c i w i): ; 0.4), rule6 - (0 ; 0.3),
    rule7 - (0 ; 0.3), rule7 - (0 ; 0.3), rule8 - (0 ; 0.2), rule9 - (0 ; 0.1) . At the stage of defuzzification for the linguistic variable “fluid inflow”, the transition from a discrete set of clear values ​​( w 1 . . . w n ) to a single clear value according to the discrete analogue of the center of gravity method y = ∑ i = 1 n c i w i ∑ i = 1 n c i , y= 1.0475 m 3 /sec, y= 0.5 m 3 /sec