Fuzzy Logic Systems
Mamdani
Traditional fuzzy logic with linguistic rules and centroid defuzzification
Sugeno
Linear consequent functions with weighted average output
Tsukamoto
Monotonic membership functions with height defuzzification
Mamdani Fuzzy System
The Mamdani system is the most intuitive fuzzy logic implementation, using linguistic rules and producing fuzzy outputs that are defuzzified.Basic Setup
Membership Functions
Mamdani supports multiple membership function types:- Triangular
- Trapezoidal
- Gaussian
- Singleton
Defining Rules
Evaluation
Defuzzification Methods
Sugeno Fuzzy System
Sugeno systems use linear functions in the consequent part, making them computationally efficient and suitable for adaptive control.Basic Setup
Linear Output Functions
Sugeno Evaluation
Tsukamoto Fuzzy System
Tsukamoto systems use monotonic membership functions, allowing direct calculation of crisp outputs.Basic Setup
Monotonic Membership Functions
Complete Example: HVAC Control
API Reference
Common Methods (All Fuzzy Systems)
| Method | Description |
|---|---|
addInputVariable(name, min, max) | Define input variable |
addOutputVariable(name, min, max) | Define output variable |
addFuzzySet(varIndex, isInput, name, type, params) | Add membership function |
addRule(vars, sets, count, outVar, outSet, useAND) | Add fuzzy rule |
evaluate(inputs) | Process inputs and get outputs |
setDefuzzificationMethod(method) | Set defuzzification type |
setDebugMode(enable) | Enable/disable debug output |
clearVariables() | Remove all variables |
clearRules() | Remove all rules |
hasError() | Check for errors |
getErrorMessage() | Get error description |
Membership Function Types
TRIANGULAR- Three parameters: [start, peak, end]TRAPEZOIDAL- Four parameters: [start, left_peak, right_peak, end]GAUSSIAN- Two parameters: [mean, sigma]SINGLETON- One parameter: [value]MONOTONIC_INCREASING- For Tsukamoto outputMONOTONIC_DECREASING- For Tsukamoto output
Defuzzification Methods
CENTROID- Center of gravity (most common)BISECTOR- Value that divides area in halfMOM- Mean of Maximum valuesSOM- Smallest of MaximumLOM- Largest of Maximum