# Optimization of PV and Battery Energy Storage Size in Grid-Connected Microgrid
###### Abstract  
This paper proposes a new method to determine the optimal size of a photovoltaic (PV) and battery energy storage system (BESS) in a grid-connected microgrid (MG). Energy cost minimization is selected as an objective function. Optimum BESS and PV size are determined via a novel energy management method and particle swarm optimization (PSO) algorithm to obtain minimum total cost. The MG was designed to use its own energy as much as possible, which is produced from renewable energy resources. Since it is a grid-connected system, it can demand energy from the grid within the determined limit with penalty. It differs from the studies in the literature in terms of optimizing both parameters such as PV and BESS size, being a grid-connected self-contained MG structure and controlling the grid energy by an energy management algorithm and optimizing the parameter via PSO with an energy management system (EMS). Results are compared for different PV and BESS. Moreover, effectiveness of the novel energy management method with PSO is compared with the genetic algorithm, which is the one of the well-known optimization algorithms. The results show that the proposed algorithm can achieve optimum PV and BESS size with minimum cost by using the new energy management method with the PSO algorithm. energy management; energy storage; microgrid; particle swarm optimization; photovoltaic systems +
Footnote †: journal: Applied Sciences  
as an effective solution for this problem [3]. A BESS can be advantageous to maintain the balance between supply and demand with its fast dynamic response characteristics compared to conventional generators or other types of energy storage systems [6]. Particularly modern distribution networks are attracting attention for the solution of nanogrid (NG) and microgrid (MG) challenges. Hereby, BESSs are considered as a significant element of modern MGs and smart grids [7]. The MG is a concept that enables effective integration of distributed generation (DG) resources [8]. It is a controllable small network that combines RESs, conventional sources and loads in both grid-connected (on-grid) and island mode (off-grid) [9]. Figure 1 demonstrates a typical MG with these two operation modes [10]. Since DGs' power output characteristics are different from conventional generation systems, the MG should handle power quality problems by itself such as unpredicted fluctuation, robustness of reactive power support, resilience and a reliable system. The BESS is a good choice for maintaining resiliency and reliability with fast and adaptable characteristics. BESS can store the remaining power for later use, thus compensating for unexpected power outages and fluctuations in the RES. Although BESSs and PVs have great advantages in the MG system, they also have some disadvantages. Size and cost are gaining importance as high capacity causes increases in cost and size, while low capacity may not be enough to prevent unexpected power problems and may not meet load demand. Consequently, BESS size must be carefully calculated to determine the optimum size for a given system [8]. Moreover, research has shown that BESSs that are optimally sized for the current loads provide the best performance [11]. Thus, system designers need to find the optimal BESS size according to the specific system to obtain an efficient, reliable, and economical MG system [9]. In the literature, generally one parameter is kept constant and the other parameter is optimized in PV and BESS optimization studies. In most PV and BESS systems, the PV size is kept constant and the BESS size is optimized. A similar approach is used for structures with an energy management system (EMS), and most of them are proposed  
Figure 1: The structure of an AC microgrid. for island mode operation. BESS sizing is performed according to the system parameters with various methods. Some of the methods can be performed identically to any sized system [10]. Mathematical-based optimization methods are also used for sizing problems.