The use of renewable energy sources in the power grid has increased in the last decade. Despite the environmental benefits, the installation of renewable energy sources in the electricity distribution networks is challenging from a technical point of view. The production units that use renewable energy sources are usually of a limited size. In order to integrate more smaller units into the power grid, they are called distributed generation (DG). Due to the variable intensity of primary energy from renewable sources, the implementation of battery storage systems (BESS) is also increasingly present in the smart grid concept of the power system [
1]. The use of the DG and BESS units in synergy work aims to exploit the available intensity of the energy sources as much as possible. However, using the maximum available energy from DG sources is not always optimal from the point of view of power/energy losses in the power distribution system. Various algorithms for controlling the output of DG and BESS are described in the literature [
2]. In [
3], the optimal allocation of photovoltaic (PV) DG with BESS is determined by metaheuristic optimization and using daily variable data of PV production and load shape. The authors of [
4] use the voltage value of the node of the BESS system in the power grid to determine the BESS operating state (charging or discharging) with the goal of controlling the voltage in the system. The use of BESS for frequency control in a power grid with a high penetration of PV DG is presented in [
5]. In [
6], BESS is used for peak shaving of load of industrial consumers. In [
7], the daily load changes are considered in the optimization problem of allocation and power distribution of BESS, with the aim of minimizing the losses and smoothing the voltage profile in the system. The metaheuristic optimization technique, namely the genetic algorithm (GA), is used to solve the problem. The optimal BESS allocation and control is solved in [
8] by the metahueuristic African buffalo optimization (ABO) method. The optimization method comprises two stages (outside and inside) and considers changes in DG production and consumer load at the daily level with hourly resolution. In [
9], the algorithm for controlling the voltage profile by multiple BESS units is presented considering daily input data. The authors of [
10] use a mathematical programming approach to solve the optimization problem of the energy management system in a smart grid consisting of different types of DG, BESS and electric vehicles (EVs). The objective of the optimization problem is to minimize the cost of importing energy into the smart grid. The mathematical programming formulation is also used in [
11] to control the power DG outputs to control the voltage and reactive power in the power grid. In [
12], particle swarm optimization (PSO) is used to find an optimal allocation of BESS, and a deterministic strategy for the charge/discharge profile of BESS is proposed. The daily DG production and load profiles are used for optimization, and the cost of BESS installation and operation is considered as an objective function. The various methods of computational intelligence, artificial neural network, fuzzy logic, and metaheuristic optimization are used in [
13] to predict the production of DG based on weather data, define the operational state of the microgrid (grid-connected or islanded), and dynamically control the microgrid in islanded mode. For a recent review of the application of computational intelligence techniques to PV system modeling, see [
14]. In [
15], the metaheuristic optimization methods are applied to optimize the parameters of the PID controller of the DC-DC boost converter. The techno-economic optimization of DG sources for the case study of the Great Canary Island using the HOMER energy software is presented in [
16]. The study presents the prediction of renewable energy production for the projected future demand growth for different scenarios. In [
17], the optimal allocation of PV DG for hourly data is solved at the daily level, where minimizing losses is the objective function. In [
18], the authors use a co-simulation approach and a metaheuristic optimization method to solve the optimization problem with the objective of minimizing losses at constant load values. In [
19], a co-simulation approach and metaheuristic optimization are also used to solve the optimal DG allocation as well as the DG power factor and output considering the variable load. The application of fuzzy systems for battery storage control is used for various applications of battery storage systems. In [
20], the fuzzy controller is used to dynamically control the battery storage system while driving an electric vehicle to improve vehicle autonomy. The fuzzy controller combined with metaheuristic optimization is used in [
21] for dynamic thermal control of a Li-ion battery. In [
22], a hybrid neurofuzzy-genetic method for controlling the electric current with the goal of optimizing the battery temperature is presented. In [
23], a fuzzy logic controller is used to dynamically control the flow of energy generated by renewable sources to the battery storage system and/or the grid. Usually, a certain local input variable is used as a control variable to control the output of BESS and DG. In the smart grid concept of the modern power distribution system, the application of a power/energy management system (PMS/EMS) is proposed [
24]. In such a management system, various measurable variables can be collected and used as input variables for decision making on the output amount of BESS and DG in the power grid. As can be seen from the research on the application of BESS in power distribution, a local variable of the network node where BESS is installed is usually used to control the power and operating conditions of BESS. In this study, a method for solving the complex optimization problem of simultaneous optimization of DG and BESS allocation and power management system parameters is investigated. The objective of the optimization problem is to minimize the annual active energy losses in the power distribution system. The optimization considers an annual period with an hourly resolution of input and output data. Due to this approach, there are 8760 cases for which the optimal steady-state operation of the power generation and battery storage systems must be found, which further increases the complexity of the problem. Moreover, the developed method finds the optimal type of measurable variables for the inputs of the power management block. The study proposes a fuzzy inference system (FIS) based optimization system for power/energy management. The study proposes the use of a simulation approach that combines power system simulation and metaheuristic optimization tools. The FIS-based energy management system generates power factor and power values of DG as well as the operating condition (charging/discharging) and power of BESS. During the optimization process, the FIS block acts as a learning agent for which the optimal parameters are tuned by the optimization procedure. In the previous study, daily profiles were generally used when variable input data (DG production, load) were used in the model. Here, we use variable data at the annual level with hourly resolution. This study is the continuation of the earlier research of the author [
25,
26]. The rest of the article is organized as follows. In the second section, the mathematical modeling and the description of the optimization problem are presented. In the third section, a brief overview of the co-simulation approach and simulation tools used is given.
Section 4 presents the proposed method based on metaheuristic optimization and a co-simulation approach.
Section 5 presents the results of implementing the method in the test network. The last section summarizes the conclusions.