# Bacterial Foraging-Based Algorithm for Optimizing the Power Generation of an Isolated Microgrid
## 1 Introduction  
Currently, one of the most critical issues is the efficient use of available energy sources. Therefore, in rural or remote geographic locations, the generation and distribution of energy is a significant challenge for many areas of engineering such as control, power electronics or planning, among others. In recent years, microgrids (MGs) have been a reliable solution for the power supply in separate areas, provided that there is adequate operational planning of the MG energy sources [1]. In general, an MG is composed of energy storage systems (ESS),hybrid power generation systems (HPGS) from renewable energy sources (RES) and conventional generation systems (CGS); with all elements working in a coordinated way for the power generation. It is important to highlight that CGSs have a high operating cost due to the materials and transportation logistics. Moreover, ESSs are integrated by costly devices requiring a safe manner operation, thus guaranteeing a long service life. Finally, uncertainty in the appropriate operation of the RES due to the origin of wind and sunlight must take into account. These theoretical considerations are some of the reasons why optimal management of power generation resources for the appropriate operation of the MG is required. In isolated microgrids (IMGs), a hybrid power generation system (HPGS) is responsible for the generation of reliable energy. This is done by integrating into the IMG at least one of the RES, CGS, and ESS systems such as a wind turbine generator, solar generator, diesel generator, or battery storage systems. However, due to the RES generation intermittency, the ESS become the main factor in the steady performance of the IMGs [2; 3; 4]. When a steady state is reached, the best performance of the whole system is obtained. HPGSs have been studied by several authors [5; 6; 7], describing conditions of remote localities having variable demand and power dispatch by generators minimizing the cost of generation, while maintaining a balance between the generation of energy and the load. Usually, the power supply to the load in an IMG can be calculated as an economic dispatch function for generators at a large-scale power level [8]. This cost function should be minimized, subject to constraints related to the generator's capacity and the energy balance between generation and load demand. The load demand must be computed for a 24 h period in an IMG, and several scenarios can be presented in the HPGS such as: (1) RESs cannot produce energy for 24 h; (2) all the RES in the IMG can always dispatch energy, but not the total demand capacity of the load; (3) the main costs are the fuel costs and the generation of the diesel generator; and (4) the operation cost of the HPGSs are non-linear, generally due to the cost of the diesel generator. On the other hand, there is a kind of problems, specifically in real-world applications, where it is impossible to find an optimal solution using a viable amount of resources employing traditional techniques such as numerical methods or graphic analysis. These cases correspond to the hard optimization category and have a similar nature to the NP (nondeterministic polynomial time) decision problems since they can not be solved in an optimal way or up to a guaranteed point using deterministic methods in polynomial time. Metaheuristics are an alternative to find feasible and optimal solutions to NP problems, where any problem modeled as a constrained numerical optimization problem (CNOP) can have at least one optimal feasible solution. A CNOP also known as a general problem of non-linear programming can be defined as: minimize \(f(\vec{x})\) subject to: \(g_{i}(\vec{x})\leq 0\), \(i=1,\ldots,m\) or \(h_{j}(\vec{x})=0,j=1,\ldots,p\).