# Stateflow-Based Energy Management Strategy for Hybrid Energy System to Mitigate Load Shedding
## 1 Introduction  
Distributed power generation technologies are becoming popular to combat the problem of frequent outages. In addition to this, they minimize adverse environmental impacts, reduce or eliminate the losses and costs associated with the transmission and distribution lines, decrease the planning and construction time, and reduce the reliance on the grid. In this regard, various set-ups of renewable energy sources (RES) have been installed according to the localized availability of renewable energy. Among the RES, the PV power system is globally recognized as the most promising due to its abundance and environment-friendly nature. The PV system is simple to install, low in maintenance, quiet, and doesnot require fuel to sustain its operation [1]. However, weather-dependent variations and the intermittency of the sun have become a hindrance for PV to become a fully dependable distributed power generator. Under these circumstances, the integration of battery banks becomes essential to improve the reliability of such systems [2]. In most cases, the backup generators are also used to increase the availability and resiliency of the system [3]. These systems are called HES as they combine both renewable and non-renewable energy sources. Furthermore, the innovative concept of hybridization capitalizes on the benefits of the conventional and non-conventional (RES) sources [4]. The HES can operate in standalone mode (for supplying electricity to remote areas) or in a grid-connected mode (for supplying electricity to communities where the grid is readily available) [5; 6]. To achieve an efficient and stable operation of HES, an effective energy management system is needed. Its primary function is to manage the energy production and utilization such that uninterrupted power flow from various sources to the load is ensured. In addition, other objectives, such as reducing the system cost, optimizing the usage of the HES components, and maximizing the efficiency, may be set according to the localized requirements [7]. Several research works dedicated to energy management strategies of HES have been published, with a few of them focusing on ensuring the power balance and the demand satisfaction [6; 7; 8]. However, the control strategies for the grid-connected system differs from the off-grid system. Depending on the system configuration, the off-grid system needs to have sufficient storage capacity to handle power variations from the alternative energy sources [9]. The storage (battery, hydrogen) absorbs the transients and allows the power balance to be maintained by remaining between the minimum and maximum state of charge (SOC) limits. The diesel generator (if incorporated) works as a tertiary backup to operate in the worst-case scenarios. Such systems can be considered as microgrids with their own generation sources and loads, as well as power electronic interfaces to control voltage and frequency and ensure proper load sharing among its sources. Conversely, for the grid-connected system, there is no need for battery storage systems or their capacity can be smaller as the grid can be used as a system backup [9]. The grid, being the active part of the system, maintains the power balance by supplying or absorbing energy. Ideally, grid-connected configurations allow more flexibility and energy security than off-grid configurations. However, the system becomes more vulnerable if the grid is weak and subjected to load shedding--a condition whereby the utility disconnects the electricity supply to specific customers on a time-sharing basis. The load shedding is commonly used in countries or regions in which the supply of electricity is inadequate [10]. These scheduled disruptions can complicate the HES control because the system has to undergo frequent transitions between different operating modes to sustain the load demand.