  Citation: Zulueta, A.; Ispas-Gil, D.A.; Zulueta, E.; Garcia-Ortega, J.; Fernandez-Gamiz, U. Battery Sizing Optimization in Power Smoothing Applications. Energies 2022, 15, 729. https://doi.org/10.3390/en15030729 Academic Editors: Teuvo Suntio and Sheldon Williamson Received: 15 November 2021 Accepted: 7 January 2022 Published: 19 January 2022 Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affil- iations. Copyright: © 2022 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 (https:// creativecommons.org/licenses/by/ 4.0/). energies Article Battery Sizing Optimization in Power Smoothing Applications Asier Zulueta 1 , Decebal Aitor Ispas-Gil 2 , Ekaitz Zulueta 2, *, Joseba Garcia-Ortega 2 and Unai Fernandez-Gamiz 1 1 Department of Nuclear and Fluid Mechanics, University of the Basque Country (UPV/EHU) Nieves Cano, 12, 01006 Vitoria-Gasteiz, Spain; azulueta@arrasate.eus (A.Z.); unai.fernandez@ehu.eus (U.F.-G.) 2 System Engineering & Automation Control Department, University of the Basque Country (UPV/EHU) Nieves Cano, 12, 01006 Vitoria-Gasteiz, Spain; dispas001@ikasle.ehu.eus (D.A.I.-G.); jgarcia395@ikasle.ehu.eus (J.G.-O.) * Correspondence: ekaitz.zulueta@ehu.eus; Tel.: +34-945-014-066 Abstract: The main objective of this work was to determine the worth of installing an electrical battery in order to reduce peak power consumption. The importance of this question resides in the expensive terms of energy bills when using the maximum power level. If maximum power consumption decreases, it affects not only the revenues of maximum power level bills, but also results in important reductions at the source of the power. This way, the power of the transformer decreases, and other electrical elements can be removed from electrical installations. The authors studied the Spanish electrical system, and a particle swarm optimization (PSO) algorithm was used to model battery sizing in peak power smoothing applications for an electrical consumption point. This study proves that, despite not being entirely profitable at present due to current kWh prices, implanting a battery will definitely be an option to consider in the future when these prices come down. Keywords: swarm optimization; battery sizing; power smoothing; battery management system 1. Introduction In this work, the authors propose an electrical battery model. Furthermore, the authors have modelled the electrical consumption and the consequent bills with reference to the different penalties that apply when the maximum power level is exceeded. This battery model is cognizant of the state of health losses via a charge and discharge policy for managing the reduction in maximum power. Therefore, the authors introduce a power smoothing technique. Despite the fact that there is other research work related to energy storage policies, all of them are developed from the electric energy producer’s point of view [13]. Generally, these works do not study the problem considering multiple distributed little electrical energy consumption points. The authors propose a model that is optimized by employing a particle swarm opti- mization algorithm. Sandhu et al. [4] employed this type of optimizer in power smoothing applications for sizing the battery energy storage system according to the level of smooth- ing power requirement. The optimization attempts to reduce electrical bills by making maximum power consumption cuts using an electrical battery as a power smoother. There are similar optimization problems that are solved by conventional algorithms [5], but they prove that intelligent algorithms must be utilized in order to apply real-world non-linear restrictions. The most important conventional optimization is the gradient descent-based optimization. This algorithm is widely applied in artificial neural network training [6,7], and it has different versions, such as stochastic descent gradient [8,9] or batch gradient de- scent [10]. This algorithm appropriately solves the neural network training problem as the loss functions are mathematically known, continuous and derivable. Usually, the gradient descent algorithm does not manage restrictions. However, restrictions are introduced when modifying the loss function with regularization techniques, such as L1 and L2, or batch Energies 2022, 15, 729. https://doi.org/10.3390/en15030729 https://www.mdpi.com/journal/energies