1 Introduction

The distribution system is responsible for the integration, connection, and conversion of multiple types of energy sources, and is transforming towards an intelligent, demand-oriented, and user-driven infrastructure [1]. Under such circumstances, the role of the distribution system operator (DSO) will be more than that of an energy supplier and operation controller, but will be responsible for energy integration, data management and additional services [2]. In other words, the DSO will transform from a neutral regulator to a market facilitator and data manager [3].

In the meantime, participants in modern distribution system are diversified in terms of their role and functionality. Not only do the aggregators arise as third-party participants in energy transactions and demand response (DR), they also design and implement DR programs for their consumers. Meanwhile, the well-informed consumers actively adjust their demands depending on the intensity of DR programs. These factors should be taken into account when the DSO makes the expansion plan of distributed generation (DG) units [4]. Although there have been wide research seeking the cooperation between DG and DR resources from a scheduling perspective [5,6,7,8,9,10,11,12], it only utilizes the existing DG instead of exploiting the DG potential. To make full use of the potential renewable energy in the distribution system [13], a DG planning approach considering the new trend in the distribution system is urgently needed.

Overall consideration of the diversified infrastructure, especially the mutual influences between the DSO, aggregators and consumers, is usually overlooked in the present DG planning studies. Recognizing the diversified infrastructure of the modern distribution system, simulation work for sustainable energy utilization are proposed in [14, 15], which is in accord with the current situation instead of energy utilization optimization. A simplified active energy management model is proposed in [16], which assumes the DSO and aggregators belong to one same entity so there are no transactions between them. It is presumed in [17] that the aggregator sells electricity to consumers at a predefined retail rate. A microgrid optimization model is proposed in [18, 19], which directly assumes the deferrable and interruptible loads as sources of DR but ignores consumer behavior. Demand side flexibility is studied in [20] using a DG planning model combined with a unit commitment and economic dispatch model, but the demand side flexibility is investigated via four enumerated possible cases, which simplified the DR situation and neglected the interaction between the DSO and consumers. In [21], the metamodel proposed automatically considers the interactions among the DG and DR. However, although this metamodel concerns the planning of an integrated energy system, the interactions among the DG and DR are only considered in the operation level instead of the planning level, which poses a limitation on the potential of DG and DR resources.

Moreover, the attention paid to the practicability of demand adjustment is inadequate. For example, an idea to aggregate residential consumers to participate in DR programs in order to shift the coincidental peak load is proposed in [22]. However, the limited types of residential loads considered go through sharp variations, making the effects of DR participation doubtful. An optimal residential DR approach controlling the heating, ventilation and air-conditioning (HVAC) loads to balance the hourly wind power production is provided in [23], in which the value of the critical load is far less than the HVAC load, thus restricting the application of this approach. Although the price-based DR provides a solution to make better use of the renewable energy [24,25,26], the price signal roots in the scheduling stage when the generation mix is settled instead of the planning stage. By contrast, incentive-based DR [27] and direct load control [28] make it possible to intervene with the responsive load profile at the planning stage, if proper actions are carried out actively.

This paper proposes a DG planning model which considers the diversified infrastructure and the mutual influences of different participants to achieve the optimal development route for the potential DG units. The model is built from the perspective of DSO, as the DSO has the authority to control the whole system and has access to the essential information. Moreover, the DSO could make concession on its current profit to achieve the optimal long-term development plan. This approach is significantly superior to the previous studies focusing on the interests of consumers [29, 30] or the profits of retailers [31], as those studies could not avoid falling into sub-optimum due to the short-sightedness of consumers/retailers.

There are mainly two approaches to establish the DG planning model: centralized method and decentralized method [32, 33]. The centralized method [34, 35] provides overall control and is computationally efficient, but usually ignores consumer response or preference. The decentralized approach [36,37,38,39] allows the consumers to manage their own demands, but in the meantime the DSO loses the right of control. This paper combines the advantages of these two approaches and overcomes their drawbacks. The model proposed in this paper uses the profit of the DSO as the objective of the optimization model, and the profit increase rates of the aggregators and consumers as the constraints. The DSO controls the responsive load of the aggregators and consumers with full consideration of the preferences, profits and comfort levels of the aggregators and consumers. Therefore, the optimal plan of DG and DR resources under the response of aggregators and consumers is obtained, with the profits of the DSO, aggregators and consumers all taken into account.

The innovations of this paper are concluded as: ① a DG planning model including the behavior of the DSO, aggregators and consumers is proposed; ② a new idea that the DSO motivates the aggregators’ and consumers’ participation in DR to better utilize the renewable energy is put forward; ③ the optimal strategy to stimulate the potential of demand flexibility is analyzed.

The rest of this paper is organized as follows. The structure of the studied system is introduced in Section 2. The costs, profits and constraints of the DSO, aggregators, and consumers are analyzed in Section 3. The optimization model of DG planning is formulated in Section 4. The obtained results in a case study are discussed in Section 5. Finally, the relevant conclusions are given in Section 6.

2 System structure

The full structure of the system studied is illustrated in Fig. 1. The power flow includes the following parts: the DSO provides electricity to the aggregators by either purchasing electricity from the grid or investing in DGs, and the aggregators sell electricity to their consumers. The information exchange includes the following aspects: the DSO collects information about the DG output, load profile and electricity tariff of the grid, then sets up incentives for load regulation; accordingly, the aggregators launch DR programs, and sign contracts with their consumers; the consumers then adjust their demand to participate in DR programs.

Fig. 1
figure 1

System structure

For clearer comparison between different profit allocation modes and DR programs, it is assumed that the electricity transaction tariffs vary with time but are the same for different scenarios. In this way, this approach is highly dependent on the type of electricity market. The capacity of transmission lines is assumed to be sufficient.

3 Analysis of different participants

The costs, profits, and behavior of the DSO, aggregators and consumers are analyzed in this section.

3.1 Costs and constraints of DSO

The responsibilities of the DSO include: to buy electricity from the grid, to sell electricity to the aggregators and large consumers, and to invest in DG. Some research excludes the investment cost of DG from the cost of DSO, and puts it under the cost of independent DG investors instead [40, 41]. This move undoubtedly reduces the cost of DSO to a large extent, but this provides an over-optimistic anticipation of the investment of DG. In this paper, we consider a more generalized and disadvantageous condition of the investment of DG, i.e., the DSO undertakes the investment cost of DG. Another additional term of the cost of the DSO is the subsidy provided to the aggregators for load profile adjustment.

The total cost of the DSO is formulated as:

$$C^{\text{DSO}} = C_{1}^{\text{DSO}} + C_{2}^{\text{DSO}} + C_{3}^{\text{DSO}} + S_{1}^{\text{DSO}} - R_{1}^{\text{DSO}}$$
(1)

where \(C^{\text{DSO}}\) is the total cost of the DSO; \(C_{1}^{\text{DSO}}\) is the cost of buying electricity from the grid; \(C_{2}^{\text{DSO}}\) is the investment cost of DG units; \(C_{3}^{\text{DSO}}\) is the maintenance and operational cost of DG units; \(S_{1}^{\text{DSO}}\) is the subsidy that the DSO provides to the aggregators; and \(R_{1}^{\text{DSO}}\) is the income of the DSO for selling electricity to the aggregators. The detailed formulations of these terms are:

$$C_{1}^{\text{DSO}} = \sum\limits_{t = 1}^{{N_{\text{T}} }} {\phi_{t}^{\text{g,D}} P_{t}^{\text{g,D}} \Delta t\mu_{t}^{\text{T}} }$$
(2)

where \(N_{\text{T}}\) is the number of sampling steps in the planning horizon; \(P_{t}^{\text{g,D}}\) is the electricity sold by the grid to the DSO at moment \(t\); \(\phi_{t}^{\text{g,D}}\) is the electricity tariff that the grid sells to the DSO at moment t; \(\Delta t\) is the simulation time step; \(\mu_{t}^{\text{T}}\) is the coefficient that transfers the future value of moment \(t\) into the present value. The calculation of \(\mu_{t}^{\text{T}}\), and the following \(\mu_{u}^{\text{U}}\) and \(\mu_{d}^{\text{D}}\) is provided in Appendix A.

$$C_{2}^{\text{DSO}} = \sum\limits_{u = 1}^{{N_{\text{U}} }} {\sum\limits_{i = 1}^{{N_{\text{I}} }} {\left( {C_{i,u}^{\text{V}} - C_{i,u}^{\text{S}} } \right)K_{i,u} } } \mu_{u}^{\text{U}}$$
(3)

where \(N_{\text{U}}\) is the number of months in the planning horizon; \(N_{\text{I}}\) is the number of candidate DG units; \(C_{i,u}^{\text{V}}\) and \(C_{i,u}^{\text{S}}\) are the capital cost and salvage cost of candidate unit \(i\) when it is invested in month u; \(K_{i,u}\) is the decision variable of whether candidate unit \(i\) has been invested in month; and \(\mu_{u}^{\text{U}}\) is the coefficient that transfers the future value of month \(u\) into the present value.

$$C_{3}^{\text{DSO}} = \sum\limits_{u = 1}^{{N_{\text{U}} }} {\left( {\sum\limits_{i = 1}^{{N_{\text{I}} }} {C_{i,u}^{\text{OI}} K_{i,u} } + \sum\limits_{j = 1}^{{N_{\text{J}} }} {C_{j,u}^{\text{OJ}} } } \right)} \mu_{u}^{\text{U}}$$
(4)

where \(C_{i,u}^{\text{OI}}\) and \(C_{j,u}^{\text{OJ}}\) are the operational costs of candidate DG unit \(i\) and existing DG unit \(j\) in month \(u\); and \(N_{\text{J}}\) is the number of existing DG units.

If an aggregator reduces or increases its load level during some certain time intervals, it receives subsidy from the DSO. The subsidy is calculated by:

$$S_{1}^{\text{DSO}} = \sum\limits_{d = 1}^{{N_{\text{D}} }} {\sum\limits_{k = 1}^{{N_{\text{K}} }} {S_{k,d}^{\text{D,a}} \mu_{d}^{\text{D}} } }$$
(5)
$$S_{k,d}^{\text{D,a}} = \sum\limits_{x = 1}^{{N_{\text{X}} }} {\sum\limits_{{t \in \left\{ {T_{d,x}^{\text{P}} } \right\}}} {\psi_{k,x}^{\text{D,a}} \left( {P_{k,t}^{\text{D,a0}} - P_{k,t}^{\text{D,a}} } \right)\Delta t} }$$
(6)

where \(N_{\text{D}}\) is the number of days in the planning horizon; \(N_{\text{K}}\) is the number of aggregators; \(S_{k,d}^{\text{D,a}}\) is the subsidy offered by the DSO to aggregator \(k\) in day \(d\); \(\mu_{d}^{\text{D}}\) is the coefficient transferring the future value of day \(d\) into the present value; \(N_{\text{X}}\) is the number of time intervals during which the load reduction is counted for subsidy; \(T_{d,x}^{\text{P}}\) is the \(x^{\text{th}}\) time interval in day \(d\); \(\psi_{k,x}^{\text{D,a}}\) is the subsidy rate for load reduction provided to aggregator \(k\) at the \(x^{\text{th}}\) time interval; \(P_{k,t}^{\text{D,a0}}\) is the original load profile of aggregator \(k\) at moment \(t\); and \(P_{k,t}^{\text{D,a}}\) is the adjusted load profile of aggregator \(k\) at moment \(t\).

$$R_{1}^{\text{DSO}} = \sum\limits_{t = 1}^{{N_{\text{T}} }} {\sum\limits_{k = 1}^{{N_{\text{K}} }} {\phi_{k,t}^{\text{D,a}} P_{k,t}^{\text{D,a}} \Delta t\mu_{t}^{\text{T}} } }$$
(7)

where \(\phi_{k,t}^{\text{D,a}}\) is the electricity tariff that the DSO sells to aggregator \(k\) at moment \(t\).

The power balance of the DSO under multiple scenarios is formulated as:

$$\sum\limits_{i = 1}^{{N_{\text{I}} }} {P_{i,t}^{\text{I}} K_{i,u} } { + }\sum\limits_{j = 1}^{{N_{\text{J}} }} {P_{j,t}^{\text{J}} } { + }P_{t}^{\text{g,D}} - P_{t}^{\text{cur}} = \sum\limits_{k = 1}^{{N_{\text{K}} }} {P_{k,t}^{\text{D,a}} } - P_{t}^{\text{shed}}$$
(8)
$$\left\{ \begin{aligned} P_{t}^{\text{cur}} \ge 0 \hfill \\ P_{t}^{\text{shed}} \ge 0 \hfill \\ \end{aligned} \right.$$
(9)

where \(P_{i,t}^{\text{I}}\) and \(P_{j,t}^{\text{J}}\) are the power outputs of candidate DG unit \(i\) and existing DG unit \(j\) at moment \(t\); \(P_{t}^{\text{cur}}\) is the curtailed generation at moment \(t\); and \(P_{t}^{\text{shed}}\) is the shed load at moment \(t\).

Similarly, in the original scenario when the demand is exclusively supplied by the grid, the power balance is formulated as:

$$P_{t}^{\text{g,D0}} = \sum\limits_{k = 1}^{{N_{\text{K}} }} {P_{k,t}^{\text{D,a0}} }$$
(10)

where \(P_{t}^{\text{g,D0}}\) is the electricity sold by the grid to the DSO in the original scenario. In the following text, the postfix “0” of the superscript indicates the corresponding parameter/variable in the original scenario.

3.2 Income and constraints of aggregator

The aggregators act as the intermediary between the DSO and the consumers. On the one hand, the electricity demands of consumers are bought in bulk by the aggregators from the DSO then sold to each consumer. On the other hand, the aggregators gather the load profiles of the consumers. If the aggregated load profile meets the requirements of the DSO, the aggregators receive subsidies from the DSO.

The income of aggregator \(k\) in day \(d\) includes the income of selling electricity to its consumers \(R_{1,k,d}^{\text{agg}}\), and the subsidy received from the DSO \(S_{1,k,d}^{\text{agg}}\). The expenditure of aggregator \(k\) includes the cost of buying electricity from the DSO \(C_{1,k,d}^{\text{agg}}\), and the subsidy provided to its consumers \(S_{2,k,d}^{\text{agg}}\). The net income of aggregator \(k\) in day \(d\)\(I_{k,d}^{\text{agg}}\) is formulated as:

$$I_{k,d}^{\text{agg}} = R_{1,k,d}^{\text{agg}} + S_{1,k,d}^{\text{agg}} - C_{1,k,d}^{\text{agg}} - S_{2,k,d}^{\text{agg}}$$
(11)

The four terms in (11) are calculated by:

$$R_{1,k,d}^{\text{agg}} = \sum\limits_{{t = 24\left( {d - 1} \right)/\Delta t + 1}}^{24d/\Delta t} {\sum\limits_{m = 1}^{{N_{{{\text{M}}_{k} }} }} {\phi_{k,m,t}^{\text{a,c}} P_{k,m,t}^{\text{a,c}} \Delta t\mu_{t}^{\text{T}} } }$$
(12)

where \(N_{{{\text{M}}_{k} }}\) is the number of consumers of aggregator \(k\); \(\phi_{k,m,t}^{\text{a,c}}\) is the electricity tariff sold by aggregator \(k\) to its consumer \(m\) at moment t; and \(P_{k,m,t}^{\text{a,c}}\) is the electricity sold by aggregator \(k\) to its consumer \(m\) at moment \(t\).

$$S_{1,k,d}^{\text{agg}} = S_{k,d}^{\text{D,a}}$$
(13)
$$C_{1,k,d}^{\text{agg}} = \sum\limits_{{t = 24\left( {d - 1} \right)/\Delta t + 1}}^{24d/\Delta t} {\phi_{k,t}^{\text{D,a}} P_{k,t}^{\text{D,a}} \Delta t\mu_{t}^{\text{T}} }$$
(14)
$$S_{2,k,d}^{\text{agg}} = \sum\limits_{r = 1}^{{N_{\text{R}} }} {\sum\limits_{m = 1}^{{N_{{{\text{M}}_{k} }} }} {S_{m,r,d}^{\text{a,c}} \mu_{d}^{\text{D}} } }$$
(15)

where \(N_{\text{R}}\) is the number of DR programs; \(S_{m,r,d}^{\text{a,c}}\) is the subsidy that aggregator \(k\) offers to its consumer \(m\) for participation in the \(r^{\text{th}}\) DR program in day \(d\).

Specifically, the aggregators set up \(N_{\text{R}}\) DR programs to encourage the consumers to adjust their load profiles. For instance, the \(r^{\text{th}}\) DR program requires a load reduction of \(P_{r}^{\text{DR}}\) for at least \(H_{r}^{{}}\) consecutive hours, and the subsidy rate is \(\delta_{r}\). A binary variable \(X_{m,r,t}\) is introduced to indicate whether consumer \(m\) participates in the \(r^{\text{th}}\) DR program at moment \(t\), the derivation of which is detailed in Appendix B. The subsidy \(S_{m,r,d}^{\text{a,c}}\) is calculated by:

$$S_{m,r,d}^{\text{a,c}} = \delta_{r} \sum\limits_{{t = 24\left( {d - 1} \right)/\Delta t + 1}}^{24d/\Delta t} {\left( {P_{m,t}^{{{\text{a,c}}0}} - P_{m,t}^{\text{a,c}} } \right)X_{m,r,t} \Delta t}$$
(16)

In the original scenario when the DSO does not subsidize the aggregators and the aggregators do not set up DR programs, the income of aggregator \(k\) is formulated as:

$$I_{k,d}^{\text{agg0}} = R_{1,k,d}^{\text{agg0}} - C_{1,k,d}^{\text{agg0}}$$
(17)
$$R_{1,k,d}^{\text{agg0}} = \sum\limits_{{t = 24\left( {d - 1} \right)/\Delta t + 1}}^{24d/\Delta t} {\sum\limits_{m = 1}^{{N_{{{\text{M}}_{k} }} }} {\phi_{k,m,t}^{\text{a,c0}} P_{k,m,t}^{\text{a,c0}} \Delta t\mu_{t}^{\text{T}} } }$$
(18)
$$C_{1,k,d}^{\text{agg0}} = \sum\limits_{{t = 24\left( {d - 1} \right)/\Delta t + 1}}^{24d/\Delta t} {\phi_{k,t}^{\text{D,a0}} P_{k,t}^{\text{D,a0}} \Delta t\mu_{t}^{\text{T}} }$$
(19)

where \(\phi_{k,m,t}^{\text{a,c0}}\) is the electricity tariff sold by aggregator \(k\) to its consumer \(m\) at moment \(t\) in the original scenario; \(P_{k,m,t}^{\text{a,c0}}\) is the electricity sold by aggregator \(k\) to its consumer \(m\) at moment \(t\) in the original scenario; and \(\phi_{k,t}^{\text{D,a0}}\) is the electricity tariff that the DSO sells to aggregator \(k\) at moment \(t\) in the original scenario.

The power balance of aggregator \(k\) is:

$$P_{k,t}^{\text{D,a}} = \sum\limits_{m = 1}^{{N_{{{\text{M}}_{k} }} }} {P_{k,m,t}^{\text{a,c}} }$$
(20)

In the original scenario, the power balance of aggregator \(k\) is:

$$P_{k,t}^{\text{D,a0}} = \sum\limits_{m = 1}^{{N_{{{\text{M}}_{k} }} }} {P_{k,m,t}^{\text{a,c0}} }$$
(21)

3.3 Expenditure and constraints of consumer

Consumers adjust their load profiles to meet the requirements of the DR programs. The expenditure of a consumer includes the expenditure of buying electricity from the aggregator \(C_{1,m,d}^{\text{cus}}\), and the expenditure converted by the uncomfortableness \(C_{2,m,d}^{\text{cus}}\). Apart from this, the consumer possibly receives subsidy \(S_{1,m,d}^{\text{cus}}\) from the aggregator. Therefore, the net expenditure of consumer \(m\) in day \(d\), \(E_{m,d}^{\text{cus}}\) is formulated as:

$$E_{m,d}^{\text{cus}} = C_{1,m,d}^{\text{cus}} + C_{2,m,d}^{\text{cus}} - S_{1,m,d}^{\text{cus}}$$
(22)
$$C_{1,m,d}^{\text{cus}} = \sum\limits_{{t = 24\left( {d - 1} \right)/\Delta t + 1}}^{24d/\Delta t} {\phi_{m,t}^{\text{a,c}} P_{m,t}^{\text{a,c}} \Delta t\mu_{t}^{\text{T}} }$$
(23)
$$C_{2,m,d}^{\text{cus}} = \sum\limits_{{t = 24\left( {d - 1} \right)/\Delta t + 1}}^{24d/\Delta t} {\phi_{m,t}^{\text{comft}} \left| {P_{m,t}^{\text{a,c}} - P_{m,t}^{\text{a,c0}} } \right|\Delta t\mu_{t}^{\text{T}} }$$
(24)
$$S_{1,m,d}^{\text{cus}} = \sum\limits_{r = 1}^{{N_{\text{R}} }} {S_{k,m,r,d}^{\text{a,c}} \mu_{d}^{\text{D}} }$$
(25)

where \(\phi_{m,t}^{\text{comft}}\) is the expenditure rate converted by the uncomfortableness of consumer \(m\) at moment \(t\). The linearization of the absolute value in (24) is detailed in Appendix C.

Similarly, in the original scenario when consumer \(m\) does not adjust its load profile, the power balance of consumer \(m\) is formulated as:

$$\begin{aligned} E_{m,d}^{\text{cus0}} = C_{1,m,d}^{\text{cus0}} = \hfill \\ \sum\limits_{{t = 24\left( {d - 1} \right)/\Delta t + 1}}^{24d/\Delta t} {\phi_{m,t}^{\text{a,c0}} P_{m,t}^{\text{a,c0}} \Delta t\mu_{t}^{\text{T}} } \hfill \\ \end{aligned}$$
(26)

The power balance of consumer \(m\) is:

$$P_{m,t}^{\text{a,c}} = \sum\limits_{n = 1}^{{N_{\text{N}} }} {P_{m,n,t}^{\text{c,l}} }$$
(27)

where \(N_{\text{N}}\) is number of load types; and \(P_{m,n,t}^{\text{c,l}}\) is the demand of load \(n\) of consumer \(m\) at moment \(t\).

In the original scenario, the power balance of consumer \(m\) is formulated as:

$$P_{m,t}^{{{\text{a,c}}0}} = \sum\limits_{n = 1}^{{N_{\text{N}} }} {P_{m,n,t}^{{{\text{c,l}}0}} }$$
(28)

The uninterruptible load, flexible load, non-deferrable load, and thermostatically controlled load are adjusted following the operational constraints in [42,43,44], respectively. The relationship between the original load profile and the adjusted load profile is therefore concluded by the linear function \(f( \cdot )\) in (29), which is not detailed in this paper.

$$P_{m,n,t}^{\text{c,l}} = f\left( {P_{m,n,t}^{\text{c,l0}} } \right)$$
(29)

3.4 Extension into a multi-scenario model

The model introduced above could be extended into a multi-scenario model to cover the uncertainty of the renewable energy resources, with the conditional value at risk (CVaR) included to represent the possible loss of wind/photovoltaic (PV) curtailment and load shedding. Specifically, the power balance equation (8) is separately exerted on every scenario, which is formulated as:

$$\begin{aligned} & \sum\limits_{w = 1}^{{N_{\text{W}} }} {\sum\limits_{i = 1}^{{N_{\text{I}} }} {P_{i,t.w}^{\text{I}} K_{i,u,w} } } + \sum\limits_{w = 1}^{{N_{\text{W}} }} {\sum\limits_{j = 1}^{{N_{\text{J}} }} {P_{j,t,w}^{\text{J}} } } - \sum\limits_{w = 1}^{{N_{\text{W}} }} {P_{t,w}^{\text{cur}} } \\ & \quad + \sum\limits_{w = 1}^{{N_{\text{W}} }} {P_{t,w}^{\text{g,D}} } = \sum\limits_{k = 1}^{{N_{\text{K}} }} {P_{k,t}^{\text{D,a}} } - \sum\limits_{w = 1}^{{N_{\text{W}} }} {P_{t,w}^{\text{shed}} } \\ \end{aligned}$$
(30)
$$\left\{ \begin{aligned} P_{t,w}^{\text{cur}} \ge 0 \hfill \\ P_{t,w}^{\text{shed}} \ge 0 \hfill \\ \end{aligned} \right.$$
(31)

where \(P_{i,t,w}^{\text{I}}\) and \(P_{j,t,w}^{\text{J}}\) are the power outputs of candidate DG unit \(i\) and existing DG unit \(j\) at moment \(t\) in scenario \(w\); \(K_{i,u,w}\) is the investment decision of scenario \(w\); \(P_{t,w}^{\text{g,D}}\) is the electricity sold by the grid to the DSO at moment \(t\) in scenario \(w\); \(P_{t,w}^{\text{cur}}\) is the curtailed generation at moment \(t\) in scenario \(w\); \(P_{t,w}^{\text{shed}}\) is the shed load at moment \(t\) in scenario \(w\); and NW is the number of scenarios.

Correspondingly, the costs regarding the investment, operation and energy transactions are obtained by multiplying the costs under each scenario by the corresponding probabilities, which are formulated as:

$$C_{1}^{\text{DSO}} = \sum\limits_{w = 1}^{{N_{\text{W}} }} {\sum\limits_{t = 1}^{{N_{\text{T}} }} {\rho_{w} \phi_{t}^{\text{g,D}} P_{t,w}^{\text{g,D}} \Delta t\mu_{t}^{\text{T}} } }$$
(32)
$$C_{2}^{\text{DSO}} = \sum\limits_{w = 1}^{{N_{\text{W}} }} {\sum\limits_{u = 1}^{{N_{\text{U}} }} {\sum\limits_{i = 1}^{{N_{\text{I}} }} {\rho_{w} \left( {C_{i,u}^{\text{V}} - C_{i,u}^{\text{S}} } \right)K_{i,u,w} } } \mu_{u}^{\text{U}} }$$
(33)
$$C_{3}^{\text{DSO}} = \rho_{w} \sum\limits_{w = 1}^{{N_{\text{W}} }} {\sum\limits_{u = 1}^{{N_{\text{U}} }} {\left( {\sum\limits_{i = 1}^{{N_{\text{I}} }} {C_{i,u}^{\text{OI}} K_{i,u,w} } + \sum\limits_{j = 1}^{{N_{\text{J}} }} {C_{j,u}^{\text{OJ}} } } \right)} \mu_{u}^{\text{U}} }$$
(34)

where \(\rho_{w}\) is the probability of scenario \(w\).

The loss of wind/PV curtailment or load shedding \(C_{w}^{\text{LOSS}}\) is calculated by:

$$C_{w}^{\text{LOSS}} = \sum\limits_{t = 1}^{{N_{\text{T}} }} {\left( {\lambda P_{t,w}^{\text{cur}} + \gamma P_{t,w}^{\text{shed}} } \right)}$$
(35)

where \(\lambda\) and \(\gamma\) are the loss rate of wind/PV curtailment and load shedding, respectively.

CVaR of the loss of wind/PV curtailment or load shedding \(C_{\text{CVaR}}^{{}}\) is obtained by solving an auxiliary optimization problem [45]:

$$C_{\text{CVaR}}^{{}} = \hbox{min}\ \eta + \frac{1}{1 - \sigma }\sum\limits_{w = 1}^{{N_{\text{W}} }} {\rho_{w} z_{w}^{{}} }$$
(36)
$$\left\{ \begin{array}{l} C_{w}^{\text{LOSS}} - \eta \le z_{w} \hfill \\ z_{w} \ge 0 \hfill \\ \end{array} \right.$$
(37)

where \(\eta\) and \(z_{w}\) are auxiliary variables; and \(\sigma\) is the confidence coefficient.

Therefore, the loss of wind/PV curtailment and load shedding and CVaR can be integrated into the objective function. The total cost of the DSO is formulated as:

$$\begin{aligned} & C^{\text{DSO}} = C_{1}^{\text{DSO}} + C_{2}^{\text{DSO}} + C_{3}^{\text{DSO}} + \left( {1 - \theta } \right)\sum\limits_{w = 1}^{{N_{\text{W}} }} {\rho_{w} C_{w}^{\text{LOSS}} } \\ & \quad + \theta C_{\text{CVaR}}^{{}} + S_{1}^{\text{DSO}} - R_{ 1}^{\text{DSO}} \\ \end{aligned}$$
(38)

where \(\theta\) is the risk preference parameter.

4 Optimization model

4.1 Objective function

The optimization model takes the cost of the DSO as the objective function \(O\), which is formulated as:

$$O = \hbox{min} \left( {C^{\text{DSO}} } \right) \,$$
(39)

4.2 Constraints

When DR programs are carried out, the aggregators tend to raise their incomes, in the meantime the consumers hope to reduce their expenditures. This trend is expressed by the parameters \(\alpha\) and \(\beta\) in (40), (41). The variations of the incomes/expenditures of the aggregators/consumers are considered in the summation form of \(N_{D}\) days instead of in the daily form, as the daily form is too rigorous.

$$\sum\limits_{d = 1}^{{N_{\text{D}} }} {I_{k,d}^{\text{agg}} } \ge \left( {1 + \alpha } \right)\sum\limits_{d = 1}^{{N_{\text{D}} }} {I_{k,d}^{\text{agg0}} }$$
(40)
$$E_{m,d}^{\text{cus}} \le \left( {1 - \beta } \right)E_{m,d}^{\text{cus0}}$$
(41)

In general, the adjusted load profile should be restricted within a certain scope, as expressed by (42)-(45).

$$\sum\limits_{k = 1}^{{N_{\text{K}} }} {P_{k,t}^{\text{D,a}} } \ge \left( {1 - r_{k}^{\text{agg, - }} } \right)\sum\limits_{k = 1}^{{N_{\text{K}} }} {P_{k,t}^{\text{D,a0}} }$$
(42)
$$\sum\limits_{k = 1}^{{N_{\text{K}} }} {P_{k,t}^{\text{D,a}} } \le \left( {1 + r_{k}^{\text{agg, + }} } \right)\sum\limits_{k = 1}^{{N_{\text{K}} }} {P_{k,t}^{\text{D,a0}} }$$
(43)
$$P_{m,t}^{\text{a,c}} \ge \left( {1 - r_{m}^{{{\text{cus,}} - }} } \right)P_{m,t}^{\text{a,c0}}$$
(44)
$$P_{m,t}^{\text{a,c}} \le \left( {1 + r_{m}^{{{\text{cus,}} + }} } \right)P_{m,t}^{\text{a,c0}}$$
(45)

where \(r_{k}^{{{\text{agg,}} - }}\), \(r_{k}^{\text{agg, + }}\), \(r_{m}^{{{\text{cus,}} - }}\), and \(r_{m}^{\text{cus, + }}\) are coefficients between 0 and 1.

The other constraints include the power balance of the DSO (8), the aggregator (20), and the consumer (27), and the DR participation constraints (A1) and (A2). Apart from this, the optimization model includes a series of technical constraints such as the construction period, installation interval, and other technical installation limits DG units. For lack of space, these constraints are not detailed in this paper.

The key variables of the optimization model include the investment decision of DG units \(K_{i,u}\), the participation status of consumers in DR programs \(X_{m,r,t}\), and the load profiles of the aggregators and consumers (\(P_{k,t}^{\text{D,a}}\) and \(P_{k,m,t}^{\text{a,c}}\)). The given data include the problem scales \(N_{T}\), \(N_{\text{U}}\), \(N_{\text{I}}\), \(N_{\text{J}}\), \(N_{\text{D}}\), \(N_{\text{W}}\), \(N_{\text{K}}\), \(N_{{{\text{M}}_{\text{k}} }}\), \(N_{\text{N}}\), \(N_{\text{X}}\), \(N_{\text{R}}\), and \(\Delta t\); the electricity tariffs \(\phi_{t}^{\text{g,D}}\), \(\phi_{k,t}^{\text{D,a}}\), \(\phi_{k,t}^{\text{D,a0}}\), \(\psi_{k,w}^{\text{D,a}}\), \(\phi_{k,m,t}^{\text{a,c}}\), \(\phi_{m,t}^{\text{a,c0}}\), \(\delta_{r}\), \(\lambda\), \(\gamma\), and \(\phi_{m,t}^{\text{comft}}\); the unit costs of DG \(C_{i,u}^{\text{V}}\), \(C_{i,u}^{\text{S}}\), \(C_{i,u}^{\text{OI}}\) and \(C_{j,u}^{\text{OJ}}\); the parameters \(\alpha\), \(\beta\), \(\sigma\), \(\theta\), \(\rho_{w}\), \(r_{k}^{{{\text{agg}}, - }}\), \(r_{k}^{{{\text{agg}},{ + }}}\), \(r_{m}^{{{\text{cus}}, - }}\), and \(r_{m}^{{{\text{cus}},{ + }}}\); the discount rates \(D_{u}^{\text{RU}}\), \(D_{d}^{\text{RD}}\), and \(D_{t}^{\text{RT}}\); and other technical parameters \(P_{i,t}^{\text{DGI}}\), \(P_{j,t}^{\text{DGJ}}\), \(P_{t}^{\text{g,D0}}\), \(P_{k,t}^{\text{D,a0}}\), \(P_{k,m,t}^{\text{a,c0}}\), \(P_{m,n,t}^{\text{c,l0}}\), \(T_{d,x}^{\text{P}}\), \(P_{r}^{\text{DR}}\), and \(H_{r}^{{}}\). The coefficients \(\mu_{u}^{\text{U}}\), \(\mu_{d}^{\text{D}}\)\(\mu_{t}^{\text{T}}\) are calculated in Appendix B. The other parameters can either be derived from the given data, or be expressed by the variables.

The values of \(\psi_{k,w}^{\text{D,a}}\), \(\delta_{r}\), \(\alpha\), and \(\beta\) are preset in the optimization model. As \(\psi_{k,w}^{\text{D,a}}\) and \(\delta_{r}\) are parameters of the optimization model which define the subsidy rates for aggregators and consumers, and the solution is optimized under every set of \(\psi_{k,w}^{\text{D,a}}\) and \(\delta_{r}\). By contrast, \(\alpha\) and \(\beta\) are the control parameters that regulate the range of the income increase rate of aggregators and the cost decrease rate of consumers. Theoretically, \(\alpha\) and \(\beta\) do not necessarily affect the optimality of the solution. On the contrary, if \(\alpha\) and \(\beta\) are too harsh, the feasible region will shrink and the solution worsened. However, if we preset the values of \(\alpha\) and \(\beta\), specific scenarios can be achieved. In this paper, a variety of combinations of \(\psi_{k,w}^{\text{D,a}}\), \(\delta_{r}\), \(\alpha\), and \(\beta\) are adopted, and the most representative scenarios are analyzed in Section 5.

The parameters \(r_{k}^{{{\text{agg}}, - }}\), \(r_{k}^{{{\text{agg}},{ + }}}\), \(r_{m}^{{{\text{cus}}, - }}\), and \(r_{m}^{{{\text{cus}},{ + }}}\) restrict the extent to which the original load profile is adjusted. Significantly, the optimization model tends to maximize \(P_{k,t}^{\text{D,a}}\) to gain the highest electricity-selling profit, and adjusts \(P_{m,t}^{\text{a,c}}\) to the largest extent to achieve the optimal load profile. Therefore in the case study below, we set \(r_{k}^{{{\text{agg}}, - }}\) = \(r_{k}^{{{\text{agg}},{ + }}}\) = 0 to ensure the same load consumption as the original scenario, and \(r_{m}^{{{\text{cus}}, - }}\) = \(r_{m}^{{{\text{cus}}, - }}\) = 0.2 to guarantee the consumers’ comfort. This is a comparatively harsh requirement for load adjustment, which better reflects the effects of DR in DG planning.

With the nonlinear constraints linearized in Appendix C, the optimization problem turns into a mixed integer linear planning (MILP) problem, which is solved by the commercial solver CPLEX modeled by the toolbox YALMIP on the platform of MATLAB.

5 Case study

5.1 Overview of planning system

A DG planning case of an urban distribution system is studied to test the efficiency of the proposed model. The planning period is ten years from 2018 to 2027. Before 2018, the system demand is exclusively supplied by the grid. Until 2018, the peak load is 29.9 MW, which increases at an annual growth rate of 6.6%, reaching 56.6 MW by 2027. The annual electricity demand is 224.9 GWh in 2018 and reaches 426.1 GWh by 2027.

The studied urban distribution system contains 5 aggregators and 968 consumers, all managed by a central DSO. The numbers of consumers controlled by the five aggregators are 18, 35, 92, 523 and 300, respectively. The consumer data are derived from the OpenEI website [46, 47]. For each consumer, a total number of 13 types of load are considered. The consumer data and a typical load profile are shown in Table D1 of Appendix D.

The potential capacity of distributed renewable generation in this system is 96.5 MW, including 5.9 MW candidate wind power DG units and 90.6 MW candidate PV DG units. The capacities and costs of the candidate DG units are listed in Table D2 of Appendix D.

The electricity tariffs that the DSO buys from the grid, the DSO sells to the aggregators and the aggregators sell to the consumers are 0.0220, 0.0253, 0.0266 $/kWh, respectively.

For the 10-year planning problem, the investment decision of DG units is made each month. One representative day is simulated in each month with the simulation time step of 1 hour. The total solving time of the optimization program is 14 minutes.

As mentioned above, the 5 most representative scenarios are analyzed in this section, including: Scenario A with no subsidy; Scenario B with low subsidy rates for the aggregators and consumers; Scenario C with medium subsidy rates for the aggregators and consumers; Scenario D with high subsidy rates for the aggregators; and Scenario E with high subsidy rates for the consumers. The preset parameters of Scenarios A-E are listed in Table 1. The planning results of Scenarios A-E are compared in Section 5.2, and the abnormality is analyzed in Section 5.3.

Table 1 Values of preset parameters

5.2 Comparison of planning results of Scenarios A-E

The incomes and costs of the DSO are illustrated in Fig. 2, in which the arrows pointing downward indicate the costs and those pointing upward represent the incomes. The costs include the investment and operational costs of the DG units, the cost of buying electricity from the grid, and the subsidy that the DSO offers to the aggregators, as labelled “Cost of DG”, “Cost of grid”, and “Subsidy to agg”, respectively. The annotation “Income of load” indicates the income of the DSO for selling electricity to the aggregators. As \(r_{k}^{{{\text{agg,}} - }}\) and \(r_{k}^{\text{agg, + }}\) in (42), (43) are preset to 0, the total demands in different scenarios are the same, therefore the total incomes of selling electricity to the aggregators in different scenarios are the same.

Fig. 2
figure 2

Costs and incomes of original scenario and Scenarios A-E

The planning results of the original scenario and Scenarios A-E are listed in Table 2. After the optimization calculation, we calculate the actual income increase rate of aggregators and the cost decrease rate of consumers, and listed them in Table 2, denoted as \(\alpha_{1}\) and \(\beta_{1}\). Comparing Table 1 and Table 2, the previous analysis that \(\alpha\) and \(\beta\) do not necessarily affect the optimality of the solution is proved. For example, Scenario B presets \(\alpha\) = \(\beta\) = 0, but the optimization result has \(\alpha_{1}\) = 1.6%, \(\beta_{1}\) = 0.3%. This demonstrates that the optimization model automatically finds the optimal combination of \(\alpha_{1}\) and \(\beta_{1}\) within the preset range, instead of sticking to the exact preset value. Therefore, the correctness and effectiveness of the proposed optimization model is further proved.

Table 2 Costs of original scenario and Scenarios A-E

In the original scenario when the electricity is exclusively supplied by the grid, the income of the DSO is the price spread of selling and buying electricity, which is $10.20 million. Although there is no motivation for aggregators and consumers to adjust their load profiles in Scenario A, the DSO still invests in 47.27 MW DG units. As a result, the cost of buying electricity from the grid is saved by $26.57 million. Offsetting $20.39 million spent on investing and operating the DG units, the total income of Scenario A is increased by $6.18 million.

The installed capacity of DG units in Scenario B is higher than Scenario A, and that of Scenario C is higher than Scenario B. Notably, Scenarios A-C show a reasonable relationship between the costs/incomes, the installed capacity of DG units, and the motivation for aggregators and consumers, that is: the higher the subsidy rates are, the higher capacity of DG units is installed, and the higher net profit the DSO makes.

Interestingly, this trend does not fit Scenario D, which has a remarkably high subsidy rate and income increase rate for the aggregators, and Scenario E, in which the subsidy rate for consumers is extremely high. On the contrary, the net income of Scenario D is $16.16 million, ranking the lowest among Scenarios A-E. For Scenario E, the net income is $90000 lower than Scenario C, with a 4.7% lower installation of DG units than Scenario C.

Table 3 shows the installed capacity of the distributed renewable generation, the extent that aggregators modify their load profiles, and the participation rate of consumers in DR programs of Scenarios A-E. The extent that aggregators modify their load profiles is quantified by:

Table 3 RES installation and aggregator/consumer participation in DR in original scenario and Scenarios A-E
$$R^{\text{Mod}} = \frac{{\sum\limits_{k = 1}^{{N_{\text{K}} }} {\sum\limits_{d = 1}^{{N_{\text{D}} }} {\sum\limits_{{t = 24\left( {d - 1} \right)/\Delta t + 1}}^{24d/\Delta t} {\left| {P_{k,t}^{\text{D,a0}} - P_{k,t}^{\text{D,a}} } \right|} } } }}{{\sum\limits_{k = 1}^{{N_{\text{K}} }} {\sum\limits_{d = 1}^{{N_{\text{D}} }} {\sum\limits_{{t = 24\left( {d - 1} \right)/\Delta t + 1}}^{24d/\Delta t} {P_{k,t}^{\text{D,a0}} } } } }}$$
(46)

The participation rate of consumers in DR programs is measured by:

$$R^{\text{Par}} = \sum\limits_{m = 1}^{{N_{\text{M}} }} {\sum\limits_{r = 1}^{{N_{\text{R}} }} {\sum\limits_{t = 1}^{{N_{\text{T}} }} {X_{m,r,t} } } } /\left( {N_{\text{M}} N_{\text{R}} N_{\text{T}} } \right)$$
(47)

In Table 3, \(R^{\text{Mod}}\) quantifies the extent that the aggregators and consumers modify their load profiles. Although \(R^{\text{Mod}}\) only shows the load modification rate of aggregators literally, the modified load profiles of aggregators are results of the modified load profiles of the consumers. \(R^{\text{Par}}\) shows the extent that consumers participate in DR programs. The installed capacity of the distributed renewable resources, \(R^{\text{Mod}}\) and \(R^{\text{Par}}\) in Scenarios A-E are compared in Table 3. Apparently, the installation of renewable energy has the same trend as \(R^{\text{Mod}}\) and \(R^{\text{Par}}\). In Scenario A, as there is no motivation for aggregators and consumers to adjust their load profiles, \(R^{\text{Mod}}\) = \(R^{\text{Par}}\) = 0. Without the load profiles modified, the installation of renewable energy has the lowest value among the five scenarios, i.e., 47.27 MW. By contrast, Scenario C has the highest installation of renewable energy (52.27 MW), as a result of its highest \(R^{\text{Mod}}\) (1.8%) and \(R^{\text{Par}}\) (6.9%). It is demonstrated that the extent that aggregators and consumers modify their load profiles, and the extent that consumers participate in DR programs have a positive effect on the installation of renewable energy.

To further explore the phenomenon above, we compare the load profiles of five scenarios, as illustrated in Fig. 3. The load profile of Scenario A is used as the benchmark. Significantly, the load of Scenario A goes down to a relatively low level between 11th hour and 15th hour when the output of PV units is high. Therefore, the extent that the load between 11th hour and 15th hour is adjusted is the key to increase the income of DSO.

Fig. 3
figure 3

Comparison of load profiles in Scenarios A-E

In Scenario B, the load between 11th hour and 15th hour is averagely raised by 178 kW. This figure increases to 312 kW in Scenario C. The increased load between 11th hour and 15th hour in Scenario D is slightly lower than Scenario C but higher than Scenario B. By contrast, the load between 11th hour and 15th hour in Scenario E oscillates around the benchmark. In conclusion, regarding the load adjustment effect, the sequence from the scenario with the most significant effect to the one with the least significant effect is: Scenario C, Scenario D, Scenario B, Scenario A, Scenario E. This difference leads to the different costs of the five scenarios.

5.3 Analysis of abnormality in Scenarios D-E

Scenario D and Scenario E represent the scenarios when the aggregators and consumers receive high subsidies. The relationship between the subsidies and the optimized planning result is analyzed in this section, and the reason that the optimization results of Scenarios D and E are worse than that of Scenario C is analyzed.

The subsidies that the DSO offers to the five aggregators in Scenarios C and D are shown in Fig. 4. The subsidy in Scenario D is higher than that of Scenario C. Looking back at Fig. 2, the DSO pays $0.46 million in total to the aggregators in Scenario C, and $0.54 million in Scenario D. This indicates that if the subsidy for aggregators is restricted at a high level, the interests of DSO will be reduced, and the load adjustment effect will be harmed.

Fig. 4
figure 4

Comparison of subsidies provided by DSO to aggregators in Scenarios C and E

To investigate the effects of high subsidy for consumers, we choose a representative consumer, and compare its load profiles and costs in Scenario C and Scenario E. The load profiles in Scenarios A, C, and E are illustrated in Fig. 5. In Scenario C, the load profile of this consumer increases between 12th hour and 13th hour, and decreases after 14th hour as a compensation. By contrast, this consumer obviously does not participate in any DR program in Scenario E, as it does not provide a successive load reduction. Admittedly, if we allow this consumer to make his own decision freely, this situation probably would not happen. However, the optimization model is built from the perspective of DSO, and aims to provide an anticipation of the responsive load for DG planning. Therefore, it is shown that under the subsidy rate for consumers in Scenario E, the DSO and aggregators could hardly maintain their profit if the consumers participate in DR programs to the largest extent. This result essentially shows a tendency that extremely high subsidy for consumers could harm the interests of the DSO and aggregators, thus hindering the ultimate goal of promoting distributed renewable energy integration by motivating DR participation.

Fig. 5
figure 5

Comparison of the load profiles of a representative consumer in Scenarios A, C, and E

Therefore, the abnormality in Scenario D and Scenario E can be concluded as: Scenario D does not reach the full potential of load adjustment due to the high subsidy rate for aggregators, and Scenario E hardly adjust the load profile as a result of the high subsidy rate for consumers.

5.4 Comparison with price-based DR regarding load modification rate and RES installation

In previous studies, the price-based DR is the most common method to encourage consumers to modify their load profiles. Scenario F and Scenario G adopt two time-of-use tariff curves to incentivize load adjustment. The planning results of Scenarios C, F and G are compared in Table 4.

Table 4 Planning results of Scenarios C, F and G

In Scenario F, the load modification rate reaches 1.7%, which is close to that of Scenario C. The installed capacity of the distributed renewable resources is 50.12 MW, i.e., 4% lower than that of Scenario C. The net income of Scenario F is 0.4% lower than that of Scenario C. In all, the planning results of Scenario F are very close to that of Scenario C, but Scenario F is slightly less economic than Scenario C. By contrast, Scenario G—the scenario adopting a different time-of-use tariff curve has different planning results. Although Scenario G has the highest load modification rate of 2.1%, the installed distributed renewable resources in Scenario G are only 49.28 MW. The net income of Scenario is $16.54 million, which is 3.7% higher than that of Scenario C.

The difference in the planning results of Scenarios C, F and G can be explained by the different load profiles and DG generation curves, as illustrated in Fig. 6. In scenario C, the load profile is modified so that the distributed renewable generation is fully utilized. There is a small amount of PV curtailment in Scenario F, but the distributed renewable generation is fully utilized in general. However, in Scenario G, the modified load profile does not coincide with the distributed renewable generation curve. As a result, the installation of more DG is hindered, and the DSO loses some potential profit.

Fig. 6
figure 6

Comparison of load profiles and RES generation curves in Scenarios C, F and G

Therefore, the method proposed in this paper could encourage the load to be modified in accordance with the distributed renewable generation, and the DSO could use the proposed method to intervene with the load modification process. In comparison, the modified load profile under price-based DR depends on the price signal, which does not necessarily encourage DG installation. Therefore, this paper puts forward an effective way to better utilize the renewable energy by motivating the consumers to modify their load profiles.

6 Conclusion

This paper proposes a novel DG planning model incorporating the motivation for diversified participants in the distribution system to fully utilize the renewable energy. In this model, the DSO manages data about the renewable generation, demand, and electricity market, and accordingly encourages the aggregators to adjust the aggregated load profile. The aggregators set up DR programs to stimulate the demand flexibility of consumers to adjust their load profiles. This process means the DSO spares some current profits to exploit the demand flexibility of consumers, in which way the participants (DSO, aggregators and consumers) with contradicting objectives are coordinated to achieve optimal utilization of the distributed renewable energy in the long run, and all the participants make profits from it.

Simulation results show that when the subsidies are within a reasonable range, the subsidies motivate consumers to adjust their load profiles, which improves the utilization of distributed renewable energy and reduces the total cost. Within this range, the higher the subsidies are, the higher profits the DSO, aggregators and consumers make. However, over-high subsidies harm the interests of DSO, which consequently discourage demand flexibility. This paper efficiently analyzes the scope of the motivations, the response of each participant, the mutual influences between each participant, and the final energy supply scenario.

This paper not only acts as an effective tool in DG planning, but also provides useful guidance in policy making, DR program formulation and energy development program analysis. It could be used by the regulator to establish minimum incentives considering the uptake of DR, or by the system planner to decide the optimal DG exploitation scheme considering demand flexibility.