# Mamdani Fuzzy Inference System – Concept

Inference means to reach a particular conclusion based on some evidence associated with a logic

In 1975, Professor Ebrahim Mamdani of London University built one of the first fuzzy systems to control a steam engine and boiler combination.

He applied a set of fuzzy rules supplied by experienced human operators.

Mamdani fuzzy inference system operates as follow:

- Determining a set of fuzzy rules
- Fuzzifying the inputs using the input membership functions
- Combining the fuzzified inputs according to the fuzzy rules to establish a rule strength (Fuzzy Operations)
- Finding the consequence of the rule by combining the rule strength and the output membership function (implication)
- Combining the consequences to get an output distribution (aggregation)
- Defuzzifying the output distribution (this step is only if a crisp output (class) is needed).

There are two types of Mamdani fuzzy inference systems:

- Max-Min inference method
- Max-Product inference method

## Max-Min Inference Method:

Consider the following rules:

Rule 1: IF x_{1} is A_{1}^{1} **and** x_{2} is A_{2}^{1} THEN y^{1} is B^{1}

Rule 2: IF x_{1} is A_{1}^{2} **or** x_{2} is A_{2}^{2} THEN y^{2} is B^{2}

let us compute the output for x_{1} = 2.5 and x_{2} = 3

Membership functions for given rules are shown below:

The fuzzy value corresponding to x1 and x2 in both input fuzzy sets is shown in the following figure. Its corresponding membership in the output function is also depicted. As it is a Max-Min inference method, the highest membership value from two input sets is assigned to the corresponding output set.

The calculation of fuzzified value for input crisp value is discussed in later half of this article.

For the first rule, the fuzzy membership value for x1 would be 0.8 and for x2 it would be 0.4. Propositions in the first IF-THEN rule are connected using **and **connective. So we have to take the intersection of fuzzy values, which returns the minimum of them. So the output y1 will have membership 0.4 in the fuzzy output set B^{1}.

For the second rule, the fuzzy membership value for x1 would be 0.3 and for x2 it would be 0.7. Propositions in the second IF-THEN rule are connected using **or **connective. So we have to take the union of fuzzy values, which returns a maximum of them. So the output y2 will have membership 0.7 in the fuzzy output set B^{2}.

To compute the final crisp output, we shall aggregate the fuzzy output functions as shown in the figure.

We can apply any defuzzification technique as discussed earlier to find the final crisp output for given case.

## Max-Product Inference Method

We will consider the same inputs we used in the max-min inference system. In the max-product inference method, the output function is scaled down to the assigned fuzzy output value, rather than simply clipping the output function as discussed. The rest of the procedures are identical to the max-min inference method

The mapping of the assigned fuzzy value to the output function and the scaling of the output fuzzy function are described in the following figure.

To compute the final crisp output, we shall aggregate the fuzzy output functions as shown in the figure.

We can apply any defuzzification technique as discussed earlier to find the final crisp output for given case.

## Watch on YouTube:

## Popular Fuzzy Inference Systems:

Following are widely accepted and practically used fuzzy inference systes to design fuzzy controller:

- Mamdani Fuzzy Inference System
- Takagi-Sugeno Fuzzy Inference System

There is an error in rule2 in this article :

Rule 2: IF x1 is A12 and x2 is A22 THEN y2 is B2

the logical operator (and ) must be (or)

Corrected dear. Thanks for bringing to notice. Your observation Will surely be useful to others. Thanks

You might be interested in playlist on fuzzy logic: https://www.youtube.com/playlist?list=PLUVnh0w_cCjIzH0i8B6yQcXs567mST9cQ