*3.4. Optimization*

In this part, a set of the mathematical formulation is proposed for the aggregator model to choose the most optimal DR solution. The formulation is related to linear programming with the objective of DR cost minimization from the aggregator standpoint. As mentioned before, all consumers participating in DR programs have a contractual reduction limit as well as a remuneration tariffs associated with each program.

Equation (1) shows the objective function of the proposed linear programming, which aims to minimize the costs related to the DR programs. In this model, technical specifications of the grid, such as load balance, voltage control, etc. are not considered as it is assumed that the network operator is accountable for them. Furthermore, it is presumed aggregator will not sell/buy electricity to/from consumers, and it is only responsible for DR program implementation and provide these flexibilities to the market negotiations. So, the focus of these formulations is only given to economic aspects of DR programs from aggregator standpoint.

$$\mathbf{M} \text{fminużze}$$

$$DR\ COST = \sum\_{t=0}^{\lambda} \sum\_{c=1}^{C} \left[ P\_{DR \ S\_{(t,c)}} \times I\_{DR\_{(t,c)}} \right] \tag{1}$$

The proposed objective function is modeled as a linear programming optimization problem using Rstudio® tool (www.rstudio.com), using a computer with Intel® Xeon® CPU @2.10 GHz, and 16 GB RAM. The linear and convex problem implemented, which includes in the present case study 4860 variables, can be solved by brute-force, heuristics, and others. There are several constraints that are applied to this objective function. Equation (2) shows the limitation of each DR resource in terms of minimum and the maximum capacity of them. Also, Equation (3) presents that the sum of capacity in available schedulable and non-schedulable DR resources (*PDR S* − *PDR N*) during the event should be higher than the reduction baseline in addition to the forecast margin error. This means that aggregator is always counting on an extra reduction capacity higher than the defined baseline to prevent the possible failures if some consumers opted out during the event. However, there is a limit for this extra capacity, and if the reduction goes higher than this limit, the additional capacity is not being paid. This is shown by Equation (4).

$$0 \le P\_{DR\_{(t,c)}} \le P\_{DR\_{(t,c)}}^{\max} \qquad \forall t \in [\theta : \lambda], \quad \forall c \in \{1, \ldots, C\}, \tag{2}$$

$$\sum\_{c=1}^{\mathcal{C}} P\_{\text{DR } S\_{(t,c)}} + \sum\_{c=1}^{\mathcal{C}} P\_{\text{DR } N\_{(t,c)}} \ge \sigma + \Delta E \qquad \forall t \in [\theta : \lambda] \tag{3}$$

$$\sum\_{\varepsilon=1}^{\mathbb{C}} P\_{\text{DR } S\_{(t\varepsilon)}} + \sum\_{\varepsilon=1}^{\mathbb{C}} P\_{\text{DR } N\_{(t\varepsilon)}} \le \psi \qquad \forall t \in [\theta : \lambda] \tag{4}$$

In sum, this section presented the developed aggregator model with a focus on the DR timeline and aggregator's responsibility during the ramp period before the DR event is started. In the next section, a case study is proposed in order to validate and survey the functionalities of the presented model using an actual methodology and real infrastructures.
