## 2 The Role of Optimization in Demand Side Management (DSM) of DER  
Smart power grids are the result of a system of technologies, which are able to anticipate the needs of consumers based on an accurate prediction of their energy usage profiles over a specified period of time. With regard to buildings and microgrids, the optimization of parameters related to energy demand, energy pricing for time-of-use (ToU) patterns, and weather information (with regard to renewable sources) can allow consumers to minimize both the amount paid for electricity and the effect of distributed generation on the environment. Therefore, there is the need for reliable algorithms that are capable of ensuring that these smart grids balance usability with cost-effectiveness. A lot of research has focused on the application of optimization techniques to the distributed generation of electricity. However, not much work has analyzed the results of these optimizers in order to determine whether or not they are likely to translate to cost-effective physical implementations. This real-life scenario implementation problem has been highlighted by [PERSON] et al. and [PERSON] et al. in [PERSON] _et al._ (2012); [PERSON] _et al._ (2013). The following are some approaches that have been adopted to issues relating to load scheduling, optimal DER combination and scheduling, and capacity expansion. The effect of capacity expansion strategies on long-term economic performance for a rural mini-grid operator was investigated by [PERSON] et al. in [PERSON] _et al._ (2013). The research proposed a linear bottom-up model, and used DER-CAM to implement the capacity investment model. The results of the research revealed that a cost-optimized model alone is likely not the best long-term investment solution., another optimal DER combination for rural areas in Nigeria was considered by [PERSON] et al. [PERSON] _et al._ (2013). The Hybrid Optimization Model for Electric Renewables (HOMER) was used to analyze various combinations of renewable energy sources for six randomly selected rural communities across the country. It was found that for a sensitivity of $1.1 and $1.3/1 of diesel, the PV/diesel/battery combination was the most cost-effective solution. This model was the most effective in terms of fuel consumption and CO\({}_{2}\) reduction. A trade-off between grid expansion and standalone electricity generation from renewable sources was considered by [PERSON] & [PERSON] [PERSON] and [PERSON] (2013). An off-grid, remote village in the state of Chhattisgarh in India was used as a case study, and the electricity demand profile included domestic  
Figure 1: Steps involved in the process of optimization. consumption, as well as industrial, commercial, and agricultural purposes. The research outcome proposed a least-cost combination of small hydropower, solar PV, biodiesel, and batteries. However, it has concluded that the reliability of the proposed system was likely to reduce in the winter season, with less availability of hydropower. A mixed integer linear programming (MILP) model was adopted by [PERSON] & [PERSON] in [24] for DSM with renewable sources, including an optimally scheduled injection from electric vehicles (while they were parked). The aim of this work was to reduce reliance on the main electricity grid by scheduling consumer demand. The DSM schedule included time-shiftable and power-shiftable appliances, and also the contribution of EVs in V2G mode while parked. Compared with a base case with no EV injection and no home DSM, the proposed model provided the best energy and cost-savings model for the consumer. A scheduling algorithm based on the optimal stopping rule (OSR) technique was proposed by [PERSON] et al. in [25]. OSR uses a sequence of reward functions to select an optimal time slot in the search process, which either minimizes total cost or maximizes expected return.