# A Fuzzy Logic Model for Hourly Electrical Power Demand Modeling

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

- Knowing the behavior of financial expenses for fuel acquisition in the hourly electrical power demand.
- Anticipating changes in electrical networks, substations, and transmission lines.
- Applying new measures for saving.

## 2. Fuzzy Logic Model Approach

- Both the fuzzy logic model referred to in this document and the radial basis mapping model use the same aggregation method (namely, either weighted average or weighted sum) to derive their overall outputs.
- The rules number in the fuzzy logic model is equal to the unit number in the radial basis mapping model.
- Each membership mapping of the fuzzy rule antecedent in the fuzzy logic model is equal to each radial basis mapping of the radial basis mapping model. One way to achieve this is to use Gaussian membership mappings with the same variance as in the fuzzy rule and to apply additions to calculate the firing strength.
- They should have the same constant terms (for the zero-order fuzzy logic model and original radial basis mapping model) or linear equations (for the first order fuzzy logic model and extended radial basis mapping model).

- (1)
- Terms are initialized randomly.
- (2)
- Forward propagation is implemented to obtain $h(x)$.
- (3)
- The value of the cost $J({\theta}_{1},\hspace{0.17em}{\theta}_{2})$ is obtained.
- (4)
- Backward propagation is implemented by using the descending gradient and the mini-lots approach described in the following two subsections.
- (5)
- The descending gradient is employed to optimize the terms $({\theta}_{1},\hspace{0.17em}{\theta}_{2})$.

#### 2.1. Descending Gradient

#### 2.2. Descending Gradient with Mini-Lots

- (1)
- For each epoch.
- (2)
- Calculate the gradient on each of the mini-lots $1,\hspace{0.17em}2,\dots ,\hspace{0.17em}p$$$\begin{array}{c}{\theta}_{1}={\theta}_{1}-\alpha \left\{\left[({z}_{3}-y){\theta}_{2}\left({\scriptscriptstyle \frac{{\scriptscriptstyle \frac{c-{z}_{2}}{{\sigma}^{2}}}{e}^{-{\scriptscriptstyle \frac{{({z}_{2}-c)}^{2}}{2{\sigma}^{2}}}}}{\sigma \sqrt{2\pi}}}\right)\right]\hspace{0.17em}{a}_{1}\right\}\\ {\theta}_{2}={\theta}_{2}-\alpha ({z}_{3}-y){a}_{2}\end{array}$$
- (3)
- $\alpha $ is the constant factor which is chosen with a value between $0$ and $1$, and $y$ is the plant output.
- (4)
- Repeat for the next epoch.

- It is not necessaryto use all the data to find a good direction of descent. A small number of mini-lots may be enough for agood model.
- Calculating the descending gradient using the entire training dataset is computationally inefficient.

## 3. Simulations

- Dry bulb temperature.
- Dew point.
- Time of the day.
- Weekday.
- Mark indicating a holiday or weekend.
- Average demand of the past day.
- Demand of the same time and the past day.
- Demand of the same time and same day of the past week.

**Remark**

**1.**

#### 3.1. The Fuzzy Logic Model

#### 3.2. The Comparison Results

## 4. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Abd-Elazim, S.M.; Ali, E.S. Load frequency controller design of a two-area system composing of PV grid and thermal generator via firefly algorithm. Neural Comput. Appl.
**2018**, 30, 607–616. [Google Scholar] [CrossRef] - Jordan-Martinez, L.A.; Figueroa-Garcia, M.G.; Perez-Cruz, J.H. Modeling and Optimal Controller Based on Disturbance Detector for the Stabilization of a Three-link Inverted Pendulum Mobile Robot. Electronics
**2020**, 9, 1821. [Google Scholar] [CrossRef] - Marciano, M.; Matute, J.A.; Lattarulo, R.; Marti, E.; Perez, J. Low speed longitudinal control algorithms for automated vehicles in simulations and real platforms. Complexity
**2018**, 2018, 1–9. [Google Scholar] [CrossRef] - Chaudhary, N.I.; Zahoor Raja, M.A.; Aslam, M.S.; Ahmed, N. Novel generalization of Volterra LMS algorithm to fractional order with application to system identification. Neural Comput. Appl.
**2018**, 29, 41–58. [Google Scholar] [CrossRef] - Chen, B.; Xing, L.; Xu, B.; Zhao, H.; Principe, J.C. Insights into the Robustness of Minimum Error Entropy Estimation. IEEE Trans. Neural Netw. Learn. Syst.
**2018**, 29, 731–737. [Google Scholar] [CrossRef] [PubMed] - Fontenla-Romero, O.; Perez-Sanchez, B.; Guijarro-Berdiñas, B. LANN-SVD: A Non-Iterative SVD-Based Learning Algorithm for One-Layer Neural Networks. IEEE Trans. Neural Netw. Learn. Syst.
**2018**, 29, 3900–3905. [Google Scholar] [PubMed] - Campo, L.V.; Ledezma, A.; Corrales, J.C. Optimization of coverage mission for lightweight unmanned aerial vehicles applied in crop data acquisition. Expert Syst. Appl.
**2020**, 149, 113227. [Google Scholar] [CrossRef] - Fu, G.Z.; Li, Y.F.; Tao, Y.; Huang, H.Z. Augmented Lagrange Programming Neural Network for Localization Using Time-Difference-of-Arrival Measurements. J. Intell. Fuzzy Syst.
**2018**, 34, 2503–2511. [Google Scholar] [CrossRef] - Han, Z.; Leung, C.S.; So, H.C.; Constantinides, A.G. Augmented Lagrange Programming Neural Network for Localization Using Time-Difference-of-Arrival Measurements. IEEE Trans. Neural Netw. Learn. Syst.
**2018**, 29, 3879–3884. [Google Scholar] [CrossRef] - Armaghani, D.J.; Hasanipanah, M.; Mahdiyar, A.; Abd Majid, M.Z.; Amnieh, H.B.; Tahir, M.M.D. Airblast prediction through a hybrid genetic algorithm-ANN model. Neural Comput. Appl.
**2018**, 29, 619–629. [Google Scholar] [CrossRef] - Aydin, I.; Karakose, M.; Karakose, E.; Akin, E. A new fault diagnosis approach for induction motor using negative selection algorithm and its real-time implementation on FPGA. J. Intell. Fuzzy Syst.
**2018**, 34, 689–701. [Google Scholar] [CrossRef] - Mikaeil, R.; Haghshenas, S.S.; Haghshenas, S.S.; Ataei, M. Performance prediction of circular saw machine using imperialist competitive algorithm and fuzzy clustering technique. Neural Comput. Appl.
**2018**, 29, 283–292. [Google Scholar] [CrossRef] - Alzubaidi, L.; Fadhel, M.A.; Al-Shamma, O.; Zhang, J.; Duan, Y. Deep Learning Models for Classification of Red Blood Cells in Microscopy Images to Aid in Sickle Cell Anemia Diagnosis. Electronics
**2020**, 9, 427. [Google Scholar] [CrossRef] [Green Version] - Corrales, D.C.; Ledezma, A.; Corrales, J.C. A case-based reasoning system for recommendation of data cleaning algorithms in classification and regression tasks. Appl. Soft Comput.
**2020**, 90, 106180. [Google Scholar] [CrossRef] - Corrales, D.C.; Ledezma, A.; Corrales, J.C. From Theory to Practice: A Data Quality Framework for Classification Tasks. Symmetry
**2018**, 10, 248. [Google Scholar] [CrossRef] [Green Version] - Iglesias, J.A.; Ledezma, A.; Sanchis, A.; Angelov, P. Real-Time Recognition of Calling Pattern and Behaviour of Mobile Phone Users through Anomaly Detection and Dynamically-Evolving Clustering. Appl. Sci.
**2017**, 7, 798. [Google Scholar] [CrossRef] [Green Version] - Skrjanc, I.; Andonovski, G.; Ledezma, A.; Sipele, O.; Iglesias, J.A.; Sanchis, A. Evolving cloud-based system for the recognition of drivers’ actions. Expert Syst. Appl.
**2018**, 99, 231–238. [Google Scholar] [CrossRef] - Yoon, K.-M.; Kim, W. Small-FootprintWake up Word Recognition in Noisy Environments Employing Competing-Words-Based Feature. Electronics
**2020**, 9, 2202. [Google Scholar] [CrossRef] - Khalid, R.; Javaid, N.; Al-zahrani, F.A.; Aurangzeb, K.; Qazi, E.-H.; Ashfaq, T. Electricity Load and Price Forecasting Using Jaya-Long Short Term Memory (JLSTM) in Smart Grids. Entropy
**2020**, 22, 10. [Google Scholar] [CrossRef] [Green Version] - Ruiz, L.G.B.; Rueda, R.; Cuellar, M.P.; Pegalajar, M.C. Energy consumption forecasting based on Elman neural networks with evolutive optimization. Expert Syst. Appl.
**2018**, 92, 380–389. [Google Scholar] [CrossRef] - Yang, Y.; Shang, Z.; Chen, Y.; Chen, Y. Multi-Objective Particle Swarm Optimization Algorithm for Multi-Step Electric Load Forecasting. Energies
**2020**, 13, 532. [Google Scholar] [CrossRef] [Green Version] - Bouktif, S.; Fiaz, A.; Ouni, A.; Serhani, M.A. Multi-Sequence LSTM-RNN Deep Learning and Metaheuristics for Electric Load Forecasting. Energies
**2020**, 13, 391. [Google Scholar] [CrossRef] [Green Version] - Chapagain, K.; Kittipiyakul, S.; Kulthanavit, P. Short-Term Electricity Demand Forecasting: Impact Analysis of Temperature for Thailand. Energies
**2020**, 13, 2498. [Google Scholar] [CrossRef] - Real AJd Dorado, F.; Durán, J. Energy Demand Forecasting Using Deep Learning: Applications for the French Grid. Energies
**2020**, 13, 2242. [Google Scholar] [CrossRef] - Son, N.; Yang, S.; Na, J. Deep Neural Network and Long Short-Term Memory for Electric Power Load Forecasting. Appl. Sci.
**2020**, 10, 6489. [Google Scholar] [CrossRef] - Amber, K.P.; Ahmad, R.; Aslam, M.W.; Kousar, A.; Usman, M.; Khan, M.S. Intelligent techniques for forecasting electricity consumption of buildings. Energy
**2018**, 157, 886–893. [Google Scholar] [CrossRef] - Lindberga, K.B.; Seljomc, P.; Madsend, H.; Fischere, D.; Korpas, M. Long-term electricity load forecasting: Current and future trends. Utilities Policy
**2019**, 58, 102–119. [Google Scholar] [CrossRef] - Mir, A.A.; Alghassab, M.; Ullah, K.; Khan, Z.A.; Lu, Y.; Imran, M. A Review of Electricity Demand Forecasting in Low and Middle Income Countries: The Demand Determinants and Horizons. Sustainability
**2020**, 12, 5931. [Google Scholar] [CrossRef] - Salais-Fierro, T.E.; Saucedo-Martinez, J.A.; Rodriguez-Aguilar, R.; Vela-Haro, J.M. Demand Prediction Using a Soft-Computing Approach: A Case Study of Automotive Industry. Appl. Sci.
**2020**, 10, 829. [Google Scholar] [CrossRef] [Green Version] - Hussain, S.; Ahmed, M.A.; Lee, K.-B.; Kim, Y.-C. Fuzzy Logic Weight Based Charging Scheme for Optimal Distribution of Charging Power among Electric Vehicles in a Parking Lot. Energies
**2020**, 13, 3119. [Google Scholar] [CrossRef] - Luca, F.D.; Calderaro, V.; Galdi, V. A Fuzzy Logic-Based Control Algorithm for the Recharge/V2G of a Nine-Phase Integrated On-Board Battery Charger. Electronics
**2020**, 9, 946. [Google Scholar] [CrossRef] - Vivas, F.J.; Segura, F.; Andújar, J.M.; Palacio, A.; Saenz, J.L.; Isorna, F.; López, E. Multi-Objective Fuzzy Logic-Based Energy Management System for Microgrids with Battery and Hydrogen Energy Storage System. Electronics
**2020**, 9, 1074. [Google Scholar] [CrossRef] - Avatefipour, O.; Nafisian, A. A novel electric load consumption prediction and feature selection model based on modified clonal selection algorithm. J. Intell. Fuzzy Syst.
**2018**, 34, 2261–2272. [Google Scholar] [CrossRef] - Ferreira, R.P.; Martiniano, A.; Ferreira, A.; Ferreira, A.; Sassi, R.J. Study on Daily Demand Forecasting Orders Using Artificial Neural Network. IEEE Latin Am. Trans.
**2016**, 14, 1519–1525. [Google Scholar] [CrossRef] - Liu, D.; Zhang, X.; Gao, C.; Yang, M.; Li, Q.; Li, M. Cost management system of electric power engineering project based on project management theory. J. Intell. Fuzzy Syst.
**2018**, 34, 975–984. [Google Scholar] [CrossRef] - Rajavel, R.; Iyer, K.; Maheswar, R.; Jayarajan, P.; Udaiyakumar, R. Adaptive neuro-fuzzy behavioral learning strategy for effective decision making in the fuzzy-based cloud service negotiation framework. J. Intell. Fuzzy Syst.
**2019**, 36, 2311–2322. [Google Scholar] [CrossRef] - Jang, J.S.R.; Sun, C.T.; Mizutani, E. Neuro-Fuzzy and Soft Computing. In Englewood Cliffs; Prentice-Hall: Upper Saddle River, NJ, USA, 1996. [Google Scholar]
- Hornik, K. Multilayer feedforward networks are universal approximators. Neural Netw.
**1989**, 2, 359–366. [Google Scholar] [CrossRef] - Rumeihart, D.E.; McClelland, J.L. On Learning the Past Tenses of English Verbs. In Parallel Distributed Processing: Explorations in the Microstructure of Cognition, Vol. 2: Psychological and Biological Models; MIT Press: Cambridge, MA, USA, 1985. [Google Scholar]
- Dekel, O.; Shamir, O.; Xiao, L. Optimal Distributed Online Prediction Using Mini-Batches. J. Mach. Learn. Res.
**2012**, 13, 165–202. [Google Scholar] - Park, S.; Lee, J.; Kim, H. Hardware Resource Analysis in Distributed Training with Edge Devices. Electronics
**2020**, 9, 28. [Google Scholar] [CrossRef] [Green Version] - Available online: https://www.mathworks.com/videos/electricity-load-and-price-forecasting-with-matlab-81765.html (accessed on 1 July 2018).

Count | Mean | Std | Min | 25% | 50% | 75% | Max | |
---|---|---|---|---|---|---|---|---|

BulbT | 7000 | 50.0716 | 18.5104 | −7 | 36 | 51 | 65 | 96 |

dewPoint(Â°F) | 7000 | 38.3980 | 19.6439 | −24 | 24 | 40 | 55 | 75 |

Hour | 7000 | 12.4984 | 6.9224 | 1 | 6 | 12 | 18 | 24 |

Day | 7000 | 4 | 2.0003 | 1 | 2 | 4 | 6 | 7 |

Weekend | 7000 | 0.6890 | 0.4629 | 0 | 0 | 1 | 1 | 1 |

PaverageLoad | 7000 | 15,218.2727 | 2972.5212 | 9152 | 12,950 | 15,411 | 17,085 | 28,130 |

LoadPreviousD | 7000 | 15,214.8604 | 2975.7433 | 9152 | 12,938.25 | 15,418 | 17,087.5 | 28,130 |

LoadPreviousW | 7000 | 15,211.0955 | 1739.9369 | 509.5833 | 14,053.5520 | 14,953.0416 | 16,125.9791 | 23,479.4583 |

ActualLoad | 7000 | 15,214.9935 | 2976.1711 | 9152 | 12,936 | 15,420 | 17,089 | 28,130 |

Neural Model | Fuzzy Logic Model | |
---|---|---|

J of training | 0.0716 | 0.0512 |

J of generalization | 0.0543 | 0.0419 |

Neural Model | Fuzzy Logic Model | |
---|---|---|

J of training | 0.0804 | 0.0737 |

J of generalization | 0.0652 | 0.0294 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Islas, M.A.; Rubio, J.d.J.; Muñiz, S.; Ochoa, G.; Pacheco, J.; Meda-Campaña, J.A.; Mujica-Vargas, D.; Aguilar-Ibañez, C.; Gutierrez, G.J.; Zacarias, A.
A Fuzzy Logic Model for Hourly Electrical Power Demand Modeling. *Electronics* **2021**, *10*, 448.
https://doi.org/10.3390/electronics10040448

**AMA Style**

Islas MA, Rubio JdJ, Muñiz S, Ochoa G, Pacheco J, Meda-Campaña JA, Mujica-Vargas D, Aguilar-Ibañez C, Gutierrez GJ, Zacarias A.
A Fuzzy Logic Model for Hourly Electrical Power Demand Modeling. *Electronics*. 2021; 10(4):448.
https://doi.org/10.3390/electronics10040448

**Chicago/Turabian Style**

Islas, Marco Antonio, José de Jesús Rubio, Samantha Muñiz, Genaro Ochoa, Jaime Pacheco, Jesus Alberto Meda-Campaña, Dante Mujica-Vargas, Carlos Aguilar-Ibañez, Guadalupe Juliana Gutierrez, and Alejandro Zacarias.
2021. "A Fuzzy Logic Model for Hourly Electrical Power Demand Modeling" *Electronics* 10, no. 4: 448.
https://doi.org/10.3390/electronics10040448