Example of a Fuzzy Logic System
Scientists studying neural connections. Programmers writing codes for machine brain. Vector illustration for artificial intelligence, machine learning, data science concepts

Example of a Fuzzy Logic System

Let us consider an air conditioning system with 5-level fuzzy logic system. This system adjusts the temperature of air conditioner by comparing the room temperature and the target temperature value.

Fuzzy Logic AC System

Algorithm

●      Define linguistic variables and terms.

●      Construct membership functions for them.

●      Construct knowledge base of rules.

●      Convert crisp data into fuzzy data sets using membership functions. (fuzzification)

●      Evaluate rules in the rule base. (Inference Engine)

●      Combine results from each rule. (Inference Engine)

●      Convert output data into non-fuzzy values. (defuzzification)

Logic Development                                                     

Step 1: Define linguistic variables and terms

Linguistic variables are input and output variables in the form of simple words or sentences. For room temperature, cold, warm, hot, etc., are linguistic terms.

Temperature (t) = {very-cold, cold, warm, very-warm, hot}

Every member of this set is a linguistic term and it can cover some portion of overall temperature values.

Step 2: Construct membership functions for them

The membership functions of temperature variable are as shown −

MF of AC System

Step3: Construct knowledge base rules

Create a matrix of room temperature values versus target temperature values that an air conditioning system is expected to provide.

RoomTemp. /TargetVery_ColdColdWarmHotVery_Hot
Very_ColdNo_ChangeHeatHeatHeatHeat
ColdCoolNo_ChangeHeatHeatHeat
WarmCoolCoolNo_ChangeHeatHeat
HotCoolCoolCoolNo_ChangeHeat
Very_HotCoolCoolCoolCoolNo_Change

Build a set of rules into the knowledge base in the form of IF-THEN-ELSE structures.

Sr. No.ConditionAction
1IF temperature=(Cold OR Very_Cold) AND target=Warm THENHeat
2IF temperature=(Hot OR Very_Hot) AND target=Warm THENCool
3IF (temperature=Warm) AND (target=Warm) THENNo_Change

Step 4: Obtain fuzzy value

Fuzzy set operations perform evaluation of rules. The operations used for OR and AND are Max and Min respectively. Combine all results of evaluation to form a final result. This result is a fuzzy value.

Step 5: Perform defuzzification

Defuzzification is then performed according to membership function for output variable.

DeFuzzied Value