Course: B.Tech CSE, 4th Year
Subject: Soft Computing
Student Name: Shivam Indore
Roll No.: 2023BTCSE016
Assignment: Module 1, Fuzzy Logic Practicals (Practicals 1 to 10)
This repository contains the complete practical implementations for Module 1 (Fuzzy Logic) of Soft Computing. Each practical is implemented as a standalone Jupyter Notebook (.ipynb) with comprehensive markdown explanations, mathematical formulations, code implementations, and visualization plots using numpy, matplotlib, scipy, and scikit-fuzzy.
| # | Notebook File | Practical Title | Key Concepts & Functions |
|---|---|---|---|
| 01 | 01_fuzzy_sets.ipynb |
Fuzzy Sets using Membership Values | Crisp vs. Fuzzy sets, Universe of discourse, Degree of membership |
| 02 | 02_membership_functions.ipynb |
Membership Functions | Triangular (fuzz.trimf), Trapezoidal (fuzz.trapmf), and Gaussian (fuzz.gaussmf) membership curves |
| 03 | 03_fuzzy_operations.ipynb |
Fuzzy Set Operations | Fuzzy Union ( |
| 04 | 04_fuzzy_relation.ipynb |
Fuzzy Relations & Composition | Cartesian product ($R(x, y) = \min(A(x), B(y))$), Max-Min Composition ( |
| 05 | 05_linguistic_variables.ipynb |
Fuzzy Linguistic Variables | Linguistic variables (e.g., Temperature with terms Low, Medium, High), Fuzzification of crisp values |
| 06 | 06_fuzzy_rules.ipynb |
Fuzzy IF-THEN Rules | Rule structure (Antecedents & Consequents), Firing strength clipping, Aggregation of outputs |
| 07 | 07_mamdani_fis.ipynb |
Mamdani Fuzzy Inference System | End-to-end Mamdani FIS using skfuzzy.control (Quality & Service |
| 08 | 08_sugeno_fis.ipynb |
Sugeno (TSK) Fuzzy Inference System | Takagi-Sugeno-Kang fuzzy model, Linear output functions ( |
| 09 | 09_defuzzification.ipynb |
Defuzzification Methods | Comparison of Centroid (centroid), Bisector (bisector), and Mean of Maximum (mom) on aggregated fuzzy sets |
| 10 | 10_fuzzy_logic_controller.ipynb |
Complete Fuzzy Logic Controller (FLC) | Full closed-loop FLC (Error & Change in Error |
- Python 3.10+ (Tested on Python 3.14)
- Core Libraries:
numpy— Array manipulations and universe of discourse gridsmatplotlib— 2D and 3D visualization of membership curves and control surfacesscipy— Numerical routines and interpolationnetworkx— Graph dependencies used byskfuzzy.controlscikit-fuzzy— Fuzzy logic functions, control systems, and defuzzificationnotebook/nbconvert/ipykernel— Interactive notebook execution
git clone https://github.com/indoreshivam2006/Soft-Computing-Module-1.git
cd Soft-Computing-Module-1On Windows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1On Linux / macOS:
python3 -m venv .venv
source .venv/bin/activatepython -m pip install numpy matplotlib scikit-fuzzy scipy networkx notebook nbconvert- Open any notebook (e.g.
01_fuzzy_sets.ipynb) in your editor. - Select your Python kernel (or
.venv) at the top right. - Click Run All or press
Shift + Enterto run individual cells.
python -m notebookThis opens the Jupyter file browser in your default web browser where you can open and execute each notebook.
To run and execute all 10 notebooks in-place:
python -m nbconvert --to notebook --execute --inplace *.ipynbSoft-Computing-Module-1/
│
├── .gitignore
├── README.md
├── 01_fuzzy_sets.ipynb
├── 02_membership_functions.ipynb
├── 03_fuzzy_operations.ipynb
├── 04_fuzzy_relation.ipynb
├── 05_linguistic_variables.ipynb
├── 06_fuzzy_rules.ipynb
├── 07_mamdani_fis.ipynb
├── 08_sugeno_fis.ipynb
├── 09_defuzzification.ipynb
└── 10_fuzzy_logic_controller.ipynb
- Shivam Indore (Roll No:
2023BTCSE016) - GitHub: @indoreshivam2006
- Repository: Soft-Computing-Module-1