Soft Computing

Chapter 4
Fuzzy Logic, Approximate Reasoning and Control

Post Graduate Program in AI and ML
Soft Computing   •   Post Graduate

Fuzzy Logic, Approximate Reasoning and Control

Introduction and Context

Classical logic represents propositions as either true or false, and classical control commonly depends on precise mathematical models. Many real systems, however, are described by imprecise concepts such as warm, high speed, nearly full, or moderate risk. Human experts routinely reason with such concepts without assigning sharp boundaries. Fuzzy logic provides a mathematically disciplined framework for representing linguistic knowledge and computing with gradual degrees of truth.

Fuzzy systems are especially valuable when measurements are uncertain, the plant is nonlinear, an exact model is unavailable, or interpretability is important. A fuzzy controller can encode statements such as “If temperature is high and humidity is low, then increase fan speed” and transform them into a numerical control action.

This chapter develops the design and analysis of Mamdani, Sugeno, and Tsukamoto inference systems. It also addresses rule-base construction, approximate reasoning, defuzzification, tuning, validation, limitations, and responsible deployment.

Learning Objectives

By the end of this chapter, a learner should be able to:

  1. Explain fuzzy sets, membership functions, linguistic variables, and fuzzy relations.
  2. Perform fuzzification, rule evaluation, aggregation, and defuzzification.
  3. Design Mamdani, Sugeno, and Tsukamoto inference systems.
  4. Construct interpretable rule bases from expert knowledge and data.
  5. Tune membership functions and evaluate controller performance.
  6. Distinguish fuzzy uncertainty from probability and measurement error.
  7. Validate fuzzy models for accuracy, robustness, interpretability, and safety.

1. Foundations of Fuzzy Sets

1.1 Crisp and fuzzy sets

In a crisp set, an element either belongs to the set or does not. A fuzzy set permits partial membership. For universe X, a fuzzy set A is represented by a membership function:

μA(x): X → [0,1]

Here, x is an element of X and μ_A(x) is the degree to which x belongs to A. The value 0 means no membership, 1 means full membership, and intermediate values represent gradual membership. Membership is not necessarily a probability; it expresses compatibility with a concept.

A triangular membership function with parameters a ≤ b ≤ c is:

μA(x) = max(min((x − a)/(b − a), (c − x)/(c − b)), 0)

The formula assumes b − a > 0 and c − b > 0. It gives membership 0 at or below a, 1 at b, and 0 at or above c. A trapezoidal function replaces the single peak with a plateau:

μA(x) = max(min((x − a)/(b − a), 1, (d − x)/(d − c)), 0)

where a < b ≤ c < d. Gaussian membership functions are smooth and useful for optimization:

μA(x) = exp(−(x − m)2/(2σ2))

where m is the centre and σ > 0 controls spread. The input and parameter units must be the same, so (x − m)/σ is dimensionless.

1.2 Linguistic variables

A linguistic variable has a name, numerical universe, and linguistic terms. For example, the variable temperature may have terms {low, medium, high}. Each term is represented by a membership function. Terms should overlap sufficiently to avoid abrupt transitions, but excessive overlap can reduce discrimination.

Important properties include:

  • Support: values for which membership is greater than zero.
  • Core: values for which membership equals one.
  • Height: maximum membership value.
  • Normal set: a fuzzy set with height one.
  • Convex set: a set whose membership does not fall and then rise between two points.

1.3 Fuzzy operations

Common operators include the minimum or product t-norm for conjunction and the maximum t-conorm for disjunction:

μA ∩ B(x) = min(μA(x), μB(x))
μA ∪ B(x) = max(μA(x), μB(x))

The standard complement is:

μ¬A(x) = 1 − μA(x)

These are modelling choices, not universal laws. Product conjunction, algebraic sum, bounded sum, and other operators may be selected when their behaviour is justified and validated.

2. Approximate Reasoning

A fuzzy rule generally has the form:

IF x is A AND y is B THEN z is C.

For an input x₀, the antecedent membership values are calculated. With minimum conjunction, the rule firing strength is:

α = min(μA(x₀), μB(y₀))

With product conjunction:

α = μA(x₀) × μB(y₀)

The choice affects the resulting inference and must remain consistent throughout design and evaluation.

In Mamdani inference, the consequent fuzzy set is clipped or scaled according to α. Using minimum implication:

μC′(z) = min(α, μC(z))

Multiple rule outputs are commonly aggregated using maximum:

μout(z) = maxi μCi′(z)

Approximate reasoning therefore consists of four transformations: numerical inputs are fuzzified, rules are evaluated, consequents are combined, and the resulting fuzzy output is converted into a usable numerical value.

3. Mamdani Inference Systems

A Mamdani system uses fuzzy consequents. It is highly interpretable because its rules resemble expert statements.

3.1 Architecture

The standard stages are:

  1. Fuzzification: map each crisp input to membership degrees.
  2. Rule evaluation: calculate each rule’s firing strength.
  3. Implication: modify the consequent fuzzy set.
  4. Aggregation: combine all modified consequents.
  5. Defuzzification: produce a crisp output.

The centroid, or centre-of-area, defuzzifier is:

z* = (∫ z μout(z) dz) / (∫ μout(z) dz)

The denominator must be nonzero. For sampled output values z_k with spacing sufficiently fine for the application, the discrete approximation is:

z* ≈ (∑k zk μout(zk)) / (∑k μout(zk))

The output has the same units as z. Centroid defuzzification is smooth but can be computationally more expensive than maximum-based methods and may be influenced by low-membership tails.

Other methods include mean of maxima, smallest of maxima, and largest of maxima. They should be selected according to continuity, safety, and application requirements.

3.2 Worked Mamdani example

Consider a fan controller with inputs temperature and humidity and output fan speed. At a particular instant:

  • μ_high-temperature = 0.7
  • μ_high-humidity = 0.4

Rules are:

  • R1: IF temperature is high AND humidity is high THEN fan speed is fast.
  • R2: IF temperature is high AND humidity is not high THEN fan speed is medium.

Using minimum conjunction, R1 fires at α₁ = min(0.7, 0.4) = 0.4. If the degree of “not high humidity” is 0.6, R2 fires at α₂ = min(0.7, 0.6) = 0.6. The fast output set is clipped at 0.4 and the medium output set at 0.6. Their maximum forms the aggregated output. A centroid calculation over the defined output universe then supplies the fan command. The numerical result depends on the actual membership functions; firing strengths alone do not determine the final speed.

This example illustrates an important design discipline: never report a crisp output without specifying output membership functions, output range, implication, aggregation, and defuzzification.

4. Sugeno Inference Systems

Sugeno systems use numerical functions rather than fuzzy output sets. A zero-order rule has a constant consequent:

IF x is A AND y is B THEN z = c.

A first-order rule has a linear consequent:

zi = pi x + qi y + ri

The final output is a weighted average:

z* = (∑i=1n wi zi) / (∑i=1n wi)

where w_i is the firing strength of rule i and the denominator must be positive. With product conjunction, w_i is the product of antecedent memberships; with minimum conjunction, it is their minimum.

Sugeno systems are computationally efficient, well suited to optimization, and convenient for adaptive neuro-fuzzy learning. Zero-order systems often provide smooth interpolation among constants, while first-order systems can approximate nonlinear functions with local linear models. Their limitation is reduced linguistic richness in the consequent: “fan speed is fast” is usually more immediately interpretable than “fan speed = 0.8 temperature + 2 humidity − 15.”

5. Tsukamoto Inference Systems

In a Tsukamoto system, every rule consequent is a monotonic fuzzy set. For each rule, the firing strength α_i is used to determine a crisp rule output z_i by solving:

μCi(zi) = αi

The final output is:

z* = (∑i=1n αi zi) / (∑i=1n αi)

The monotonicity requirement makes the inverse mapping well defined, at least over the relevant range. Tsukamoto inference can be more interpretable than a purely numerical consequent and more computationally direct than centroid defuzzification, but it restricts consequent membership functions and is less common in modern industrial software than Mamdani and Sugeno systems.

Comparison of inference models

CharacteristicMamdaniSugenoTsukamoto
ConsequentFuzzy setConstant or functionMonotonic fuzzy set
Final calculationUsually centroidWeighted averageWeighted average of rule outputs
InterpretabilityVery highHigh in antecedents; variable in consequentsHigh, subject to monotonicity
OptimizationModerateStrongModerate
Computational costRelatively highLowModerate
Typical useExpert control and explanationAdaptive modelling and embedded controlStructured rule-based decision systems

6. Building a Rule Base

A rule base is more than a list of plausible sentences. It is a model of the relationship between inputs and outputs.

6.1 Knowledge acquisition

Sources include expert interviews, operating manuals, historical data, physical laws, and observations of skilled operators. Experts should be asked for boundary cases, exceptions, safety constraints, and the reasoning behind actions—not merely for labels.

6.2 Coverage and consistency

A rule base should cover the region of the input space that the system will actually encounter. A rule may be considered active in a region when at least one antecedent has meaningful membership, although the exact threshold is application-specific. Uncovered regions can cause zero firing strength or undesirable interpolation.

Check for:

  • Conflicting rules: similar antecedents produce incompatible actions.
  • Redundant rules: one rule adds no meaningful behaviour.
  • Dominated rules: a more specific rule is always overridden.
  • Gaps: no rule fires for a realistic input.
  • Combinatorial explosion: if m inputs each have k terms, a full grid may contain up to k^m combinations.

Sparse rule bases, hierarchical fuzzy systems, and dimensionality reduction can control this growth.

6.3 Interpretability

Use meaningful variable names, ordered terms, moderate numbers of sets, consistent overlap, and rules that domain specialists can inspect. A highly accurate system with opaque or unstable rules may be unsuitable where decisions require explanation or audit.

7. Fuzzy Control Design

A fuzzy controller commonly uses error and change in error as inputs. If the desired value is r(t) and measured output is y(t), then:

e(t) = r(t) − y(t)

For sampled control with sampling interval Δt:

Δe(k) = e(k) − e(k−1)

The controller computes u(k) from fuzzy rules. Scaling factors may normalize variables:

eN = Ke e, ΔeN = KΔe Δe, u = Ku uN

The gains K_e, K_{Δe}, and K_u must preserve units and be tuned to the sensor, actuator, and safe operating range.

A proportional fuzzy controller may use rules such as:

  • IF error is positive large AND change in error is positive, THEN control is negative medium.
  • IF error is near zero AND change in error is near zero, THEN control is zero.
  • IF error is negative large AND change in error is negative, THEN control is positive medium.

The sign convention must be defined explicitly. Reversing the definition of error without reversing the rules can create positive feedback and instability.

Stability and safety

Fuzzy rules do not automatically guarantee stability. Validation should include closed-loop simulation, disturbance tests, actuator saturation, sensor faults, sampling delays, and worst-case initial conditions. Where safety is critical, fuzzy control should be combined with supervisory limits, conventional fallback control, formal constraints, or a verified safety layer.

8. Tuning and Validation

Tuning changes membership parameters, rule weights, scaling factors, consequents, or operators. Approaches include:

  • expert adjustment based on observed trajectories;
  • grid or random search;
  • gradient-based optimization where the model is differentiable;
  • evolutionary optimization;
  • ANFIS-style hybrid learning for Sugeno systems.

A generic performance objective may combine tracking error and control effort:

J = ∑k=1N [λe e(k)2 + λu u(k)2]

Here N is the evaluation horizon, λ_e ≥ 0 weights tracking error, and λ_u ≥ 0 penalizes control effort. The squared terms require consistent scaling; otherwise one term may dominate merely because of its units. Constraints such as actuator limits and safety violations should be handled explicitly rather than hidden inside an arbitrary penalty.

Validation should use separate development and test data or operating conditions. Relevant measures include mean absolute error:

MAE = (1/N) ∑k=1N |yk − ŷk|

and root mean square error:

RMSE = √[(1/N) ∑k=1N (yk − ŷk)2]

For control, also examine overshoot, settling time, rise time, steady-state error, energy use, constraint violations, robustness to noise, and rule activation patterns. Accuracy alone is insufficient: a controller can achieve low average error while producing unsafe transient behaviour.

9. Illustrative Case: Fuzzy Greenhouse Ventilation

This is an illustrative case, not a report of a specific commercial installation.

Background

A greenhouse must maintain temperature and humidity within ranges suitable for a crop. A detailed thermal model is difficult because solar radiation, wind, plant transpiration, and door openings change continuously.

Problem

A conventional fixed-threshold controller opens vents whenever temperature exceeds 28 °C. This causes repeated switching near the threshold and may reduce humidity too aggressively.

Analysis

Use temperature error relative to a target and humidity error as inputs. Linguistic terms such as negative, zero, and positive are defined with overlapping triangular or trapezoidal membership functions. The output is vent opening, with terms closed, small, medium, and large.

Approach

A Mamdani controller is selected because operators need to inspect the rules. Representative rules are:

  • IF temperature is high AND humidity is high, THEN vent opening is large.
  • IF temperature is high AND humidity is acceptable, THEN vent opening is medium.
  • IF temperature is near target AND humidity is high, THEN vent opening is small.
  • IF temperature is low, THEN vent opening is closed.

The design includes a minimum and maximum actuator limit, a rate limit to prevent abrupt movement, and a fallback mode when sensors disagree. Historical data are divided into tuning and validation periods. The controller is tested under sunny, cloudy, and sudden-weather scenarios.

Outcome

The expected outcome is smoother actuation, fewer threshold oscillations, and improved environmental regulation. Claims of improvement must be supported by measured comparison against the baseline using identical weather periods or controlled experiments. The design should not be accepted solely because its rules appear intuitive.

Learning points

The case demonstrates that fuzzy control is useful when expert concepts are available but a precise plant model is difficult. It also shows why rule coverage, actuator constraints, sensor validation, and comparative testing are essential.

10. Limitations, Governance, and Contemporary Developments

Fuzzy logic does not remove uncertainty; it represents some forms of vagueness. It should not be confused with probability. Probability describes uncertainty about events or parameters, whereas membership describes the degree to which an object fits a concept. A value μ_high-temperature = 0.7 does not, by itself, mean there is a 70% probability that the temperature is high.

Other limitations include subjective membership design, rule explosion, sensitivity to scaling, hidden interactions among rules, and weak guarantees for stability or generalization. Data-driven tuning can improve accuracy but may distort linguistic meaning, overfit historical conditions, or encode discriminatory operational practices.

In safety- or rights-sensitive applications, governance should include documentation of data and assumptions, version control, traceability of rules, human override, monitoring for distribution shift, incident reporting, and periodic revalidation. If a fuzzy model supports a consequential decision, affected users may need an understandable explanation of inputs, rules, and limitations.

Contemporary systems increasingly combine fuzzy inference with neural networks, reinforcement learning, optimization, and digital twins. Neuro-fuzzy methods learn parameters from data while retaining a rule structure. The principal research challenge is balancing approximation power with transparent semantics, robustness, and verifiable constraints. Hybrid designs should not be described as interpretable merely because they contain the word “fuzzy”; interpretability must be demonstrated through stable, meaningful, and auditable behaviour.

Best-Practice Checklist

  1. Define variable ranges, units, sign conventions, and sampling rates.
  2. Use membership functions that reflect domain meaning and measured resolution.
  3. Specify conjunction, implication, aggregation, and defuzzification operators.
  4. Test rule coverage, conflict, redundancy, and boundary behaviour.
  5. Include actuator, safety, and sensor-fault constraints.
  6. Separate tuning data from validation data or scenarios.
  7. Report both performance and interpretability evidence.
  8. Monitor deployed systems for drift and unexpected rule activation.
  9. Preserve expert review and human override where consequences are significant.

Chapter Summary

Fuzzy logic represents gradual membership in linguistic concepts and supports approximate reasoning with incomplete or imprecise descriptions. A fuzzy inference system fuzzifies inputs, evaluates rules, combines their consequences, and produces an output through defuzzification or weighted averaging. Mamdani systems use fuzzy consequents and are highly interpretable; Sugeno systems use constants or functions and are efficient for optimization; Tsukamoto systems use monotonic consequents and weighted crisp rule outputs.

Effective fuzzy controllers require carefully scaled variables, complete and consistent rule bases, appropriate operators, safety constraints, and systematic validation. Tuning may use expert knowledge, optimization, or neuro-fuzzy learning, but increased accuracy must be balanced against interpretability and robustness. Fuzzy membership is not probability, and fuzzy rules alone do not guarantee stability. Responsible deployment therefore requires testing, traceability, monitoring, human oversight, and explicit treatment of limitations.

Key Terms

Fuzzy set: A set whose elements have membership degrees from 0 to 1.

Membership function: A function assigning a degree of membership to each input.

Linguistic variable: A variable described by qualitative terms represented by fuzzy sets.

Fuzzification: Conversion of crisp inputs into membership degrees.

Firing strength: The degree to which a rule antecedent is satisfied.

T-norm: An operator for fuzzy conjunction, such as minimum or product.

T-conorm: An operator for fuzzy disjunction, commonly maximum.

Implication: Modification of a consequent according to rule firing strength.

Aggregation: Combination of outputs from multiple rules.

Defuzzification: Conversion of an aggregated fuzzy output into a crisp value.

Mamdani inference: Inference using fuzzy-set consequents.

Sugeno inference: Inference using constant or functional consequents.

Tsukamoto inference: Inference using monotonic fuzzy consequents.

Rule base: A structured collection of fuzzy IF–THEN rules.

Centroid method: Defuzzification based on the centre of area.

Scaling factor: A gain used to normalize or rescale a controller variable.

Rule coverage: The extent to which realistic inputs activate rules.

Neuro-fuzzy system: A system combining fuzzy rules with data-driven learning.

Approximate reasoning: Reasoning that produces graded conclusions from imprecise premises.

Interpretability: The extent to which humans can understand and audit model behaviour.

Review Questions

5 Short Answer Questions

  1. What is the difference between a crisp set and a fuzzy set?
  2. Define fuzzification and defuzzification.
  3. Why must Tsukamoto consequent membership functions be monotonic?
  4. State one important difference between Mamdani and Sugeno inference.
  5. Why is fuzzy membership not equivalent to probability?

5 Long Answer Questions

  1. Explain the complete Mamdani inference process, including implication, aggregation, and centroid defuzzification.
  2. Compare Mamdani, Sugeno, and Tsukamoto systems in terms of representation, computation, interpretability, and applications.
  3. Describe a systematic procedure for constructing and auditing a fuzzy rule base.
  4. Explain how scaling factors, error definitions, actuator constraints, and sampling affect fuzzy-controller design.
  5. Discuss the benefits and risks of tuning a fuzzy model with data-driven optimization.

3 Analytical / Application Questions

  1. Design a two-input Mamdani controller for room temperature using temperature error and change in error. Specify linguistic terms, five representative rules, and a validation plan.
  2. A Sugeno system has two rules with firing strengths 0.3 and 0.7 and consequents 20 and 40, respectively. Calculate the output and explain the assumption required for the weighted average.
  3. A deployed fuzzy controller performs well on average but violates actuator limits during rapid disturbances. Diagnose possible causes and propose technical and governance controls.

Multiple Choice Questions with Answers

Question 1

Which expression defines the standard complement of a fuzzy set A?

A. μ_A(x)

B. 1 − μ_A(x)

C. 1 + μ_A(x)

D. μ_A(x)^2

Correct Answer: B. 1 − μ_A(x)

Question 2

Using minimum conjunction, what is the firing strength when two antecedent memberships are 0.7 and 0.4?

A. 0.28

B. 0.55

C. 0.4

D. 1.1

Correct Answer: C. 0.4

Question 3

Which inference model normally uses fuzzy sets in its consequents?

A. Mamdani

B. Zero-order Sugeno only

C. Tsukamoto only

D. Linear regression

Correct Answer: A. Mamdani

Question 4

In a Sugeno system, the final output is commonly calculated as:

A. The maximum rule consequent

B. A weighted average of rule outputs

C. The smallest input value

D. The sum of membership degrees without normalization

Correct Answer: B. A weighted average of rule outputs

Question 5

What is required of a Tsukamoto consequent membership function?

A. It must be random

B. It must be monotonic over the relevant range

C. It must always be triangular

D. It must have two separate peaks

Correct Answer: B. It must be monotonic over the relevant range

Question 6

For a Mamdani system, what does centroid defuzzification use?

A. The centre of area of the aggregated output

B. Only the highest input membership

C. The first rule in the rule base

D. The median input measurement

Correct Answer: A. The centre of area of the aggregated output

Question 7

If μ_A(x) = 0.8 and μ_B(y) = 0.5, what is their product-conjunction firing strength?

A. 0.3

B. 0.625

C. 0.4

D. 1.3

Correct Answer: C. 0.4

Question 8

Which is a likely consequence of excessive rule-base growth as the number of inputs increases?

A. Reduced need for validation

B. Rule explosion and maintenance difficulty

C. Guaranteed stability

D. Elimination of uncertainty

Correct Answer: B. Rule explosion and maintenance difficulty

Question 9

What does e(t) = r(t) − y(t) represent in a conventional fuzzy-controller design?

A. Actuator saturation

B. Tracking error

C. Membership height

D. Rule coverage

Correct Answer: B. Tracking error

Question 10

Which statement about fuzzy membership is correct?

A. A membership degree is always a probability

B. A membership degree expresses compatibility with a concept

C. Membership values must be negative for uncertainty

D. Membership functions cannot overlap

Correct Answer: B. A membership degree expresses compatibility with a concept

Soft Computing
Chapter 4 of 15