# Optimal Energy Management within a Microgrid: A Comparative Study
## 1 Introduction  
Nowadays, continuous technological advances have caused a remarkable reduction in prices of electricity generation systems powered by renewable energy resources. This fact and the high level of efficiency achieved in small generating plants, availability of technology for generation from renewable resources, and the release of the electricity market have promoted the integration of Distributed Generation (DG) at the distribution level. Distributed generation sources provide energy directly to the distribution network or supplied directly to a set of consumers [1]. Technological innovation, enabling policies, and the drive to address climate change have placed renewables at the centre of the global energy transformation [2]. Accordingly, renewable energy systems have taken a core position for electric power distributed generation. Due to its fast technological development, the commonly installed distributed generators are photovoltaic and wind turbine systems. The integration of these renewable DG systems refreshes the electric distribution networks and provides new opportunities and benefits. Its integration, however, brings new challenges for the protection, control, and operationof these electric networks [3]. For example, traditional electric distribution networks were designed, controlled, and operated as passive systems, whereas the integration of DG transforms them into active power networks where the energy flow is now bidirectional. One of the main challenges for the integration of renewable DG systems is the intermittent power generation, i.e., their power production depends on weather conditions. The intermittency of these sources produces a power generation that requires a robust control system to fit the profile of the load demand. Moreover, it makes the balance of the network and planning reserves more complex [4]. The microgrid concept was introduced precisely as a solution for the reliable integration of DG systems [5]. The U.S. Department of Energy (DOE) defines a microgrid as \"a group of interconnected loads and distributed energy resources within clearly defined electrical boundaries that acts as a single controllable entity with respect to the grid. A microgrid can connect and disconnect from the grid to enable it to operate in both grid-connected or island mode [6].\" Currently, many other organizations and research groups define microgrids with very similar definitions, including the concept of a system having Points of Common Coupling (PCC), of multiple controllable loads and distributed generation, energy storage, of islanding from the grid, and, recently included, the concept of a power system cell [3]. A microgrid must accomplish certain special needs, such as improving local security, reducing loss connection, supporting local tensions, correcting the voltage drop, or providing uninterruptible power supplies, etc. In addition, the microgrid must have the ability to respond in seconds to the system requirements and final consumers [7; 8; 9]. According to the aforementioned definition, a microgrid has two operation modes: grid-connected mode, where the microgrid is connected to the main network to a low or medium voltage level through one or more PCC, and island mode, where the microgrid works without connection with the main grid [10]. The operational requirements for each mode of operation as well as the specifications and stability control are different [11]. However, in either mode of operation, controlling the microgrid is performed by a hierarchical control of three levels: primary control, secondary control, and tertiary control systems [5]. This work focuses on the control task of tertiary control for microgrids operating in grid-connected mode. The tertiary control is the lowest control level in the hierarchical structure of the microgrid control system. The control task of the tertiary control considers the economical concerns in the optimal operation of the microgrid, and manages the power flow between the microgrid and the main grid in grid-connected mode [12].