Comparison of Mamdani Fuzzy Inference System Results Between MATLAB and Python Implementations
DOI:
https://doi.org/10.26740/inajet.v8n2.p9-16Keywords:
fuzzy inference system, Mamdani, MATLAB 2016b, Python, scikit-fuzzy, production optimization, code generation, error correction, Google ColabAbstract
Planning in determining the amount of production decision-making for the next period depends on the remaining inventory from the previous period and also the estimated amount of demand in the next period. Total demand and supply are uncertain. Fuzzy logic is a technique to analyze uncertainty. The purpose of this study is to compare the results of a Mamdani fuzzy inference system for determining the optimal production quantity of chocolate products on two computing platforms: MATLAB and Python. Both implementations used an identical system design, consisting of the same membership functions, rule base, input-output ranges, aggregation method, and defuzzification method, and the Python implementation was executed with the Scikit-Fuzzy library on Google Colab. The test scenario used input values of production cost of Rp 800.00 per pack and product demand of 45,000 packs. MATLAB produced a crisp output of 64,100 packs, while Python resulted in 80,000 packs. This study shows an output difference of 24.8%, which is attributed to differences in numerical resolution of the universe of discourse and library-specific implementation of the aggregation and centroid defuzzification operations between the two platforms. These findings indicate that Python, using the open-source Scikit-Fuzzy library, offers an accessible and cost-effective alternative for fuzzy modeling, while careful verification of the implementation details remains necessary to ensure numerical consistency between platforms. As this comparison is based on a single test scenario, further validation using additional test cases is recommended.
References
Azadegan, A. et al. (2011) “Fuzzy logic in manufacturing: A review of literature and a specialized application,” IEEE Transactions on Systems, Man, and Cybernetics Part C: Applications and Reviews, 41(2), pp. 258–270.
Campagner, A. and Ciucci, D. (2025) “softpy: A user-friendly Python library for soft computing,” Proceedings of the Genetic and Evolutionary Computation Conference Companion (GECCO 2025), pp. 115–118.
Castillo, O. and Melin, P. (2008) Type-2 Fuzzy Logic: Theory and Applications. Berlin, Heidelberg: Springer (Studies in Fuzziness and Soft Computing).
Dyczkowski, K. and others (2024) “Python library for interval-valued fuzzy inference,” SoftwareX, 26, p. 101730.
Kalaiarasi, K. and Swathi, S. (2024) “Optimization of fuzzy inventory management in industrial processes using deep learning algorithms: A hybrid approach for enhancing demand forecasting and supply chain efficiency,” Advanced Engineering Letters, 3(4), pp. 141–153.
Kusumadewi, S. et al. (2025) “Implementation of decision tree and Mamdani fuzzy inference system for Erythropoietin resistance prediction,” Biomedical Signal Processing and Control, 104, p. 107496.
Kusumadewi, S. and Purnomo, H. (2010) “Aplikasi Logika Fuzzy untuk Pendukung Keputusan,” Yogyakarta : Graha Ilmu, 2.
Macioł, A., Macioł, P. and Mrzygłód, B. (2020) “Prediction of forging dies wear with the modified Takagi–Sugeno fuzzy identification method,” Materials and Manufacturing Processes [Preprint]. Available at: https://www.tandfonline.com/doi/abs/10.1080/10426914.2020.1747627 (Accessed: June 14, 2024).
Onukwulu, E.C. et al. (2023) “Transforming supply chain logistics in oil and gas: best practices for optimizing efficiency and reducing operational costs,” Journal of Advance Multidisciplinary Research, 2(2), pp. 59–76.
Roh, J., Hong, P. and Min, H. (2014) “Implementation of a responsive supply chain strategy in global complexity: The case of manufacturing firms,” International Journal of Production Economics, 147, pp. 198–210. Available at: https://doi.org/10.1016/j.ijpe.2013.04.013.
Ross, T.J. (2009) Fuzzy Logic with Engineering Applications. Hoboken, NJ: Wiley.
Sharma, Y.K., Ahmed, G. and Saini, D.K. (2025) “Comparative performance analysis of Mamdani and Sugeno fuzzy inference systems for sustainable cluster formation in WSNs,” Journal of Intelligent and Fuzzy Systems, 49(5), pp. 1306–1332.
Wang, J. (2025) “Role of human collaboration in artificial intelligence with fuzzy based mathematical models and decision making problems,” Scientific Reports, 15(1), p. 34029.
Wawan, W., Zuniati, M. and Setiawan, A. (2021) “Optimization of national rice production with fuzzy logic using Mamdani method,” Journal of Multidisciplinary Applied Natural Science, 1(1), pp. 36–43.
Zhang, Z. and Valeo, C. (2025) “Fuzzy-based input method for uncertainty quantification in a deterministic model comparison with ChatGPT for peak flow prediction,” Journal of Hydrology X, 28–29, p. 100208.
Downloads
Published
How to Cite
Issue
Section
Abstract views: 19
,
PDF Downloads: 19









