Demand-side flexibility in distribution grids: voluntary versus mandatory contracting

In this paper, we investigate two main schemes for contracting demand-side flexibility by the Distribution System Operator (DSO) at the planning stage: a voluntary demand-side connection agreement where consumers offer their flexibility, i.e., load reduction, to the DSO and a mandatory demand-side connection agreement where the DSO sets the flexibility levels, i.e., load curtailment, to be contracted from residential consumers. A different bilevel equilibrium model is used for each demand connection agreement scheme. In both models, the DSO, in the Upper Level, decides on the flexibility price and network tariffs. Residential consumers react to those signals in the Lower Level. They can be prosumers that invest in solar PV and batteries or passive consumers. The paper answers two regulatory issues. The first is which option to choose for regulators between mandatory and voluntary demand connection agreements. We find that mandatory demand-side connection agreements result in higher welfare gains compared to voluntary ones and a lower price for flexibility. However, such agreements may entail some implementation issues for regulators and different curtailment levels among consumers. This connects with the second issue investigated in this paper on how to implement mandatory demand connection agreements from equity and feasibility perspectives. When introducing a pro-rata constrained mandatory scheme, curtailing consumers equally, we find that welfare levels are still higher than under the voluntary scheme but lower than in the unconstrained mandatory scheme. The difference in welfare and flexibility levels between the two mandatory schemes could represent a potential for a secondary flexibility mechanism, where consumers trade flexibility between themselves.


Introduction
The increasing need for flexible resources in electricity systems requires investigating different forms of flexibility mechanisms. In the EU, one of the mechanisms increasingly used is connection agreements, also called flexible connections. They allow the Distribution System Operators (DSOs) to set up non-firm network access for network users.
Connection agreements have been introduced in different ways with various characteristics. Looking at the practices, most of the experiences are for supply-side connection agreements. Jacobsen and Schröder (2012) investigate voluntary and mandatory curtailment of RES and argue that some levels of supply-side curtailment are optimal. This paper focuses on their use for the demand-side, giving the emergence of new types of loads with customers having variables imports linked to storage, heat pumps and electric vehicle charging. In such agreements, the DSO is allowed to curtail customers' loads for some hours to achieve grid cost reduction (CE and VVA Europe, 2016). For instance, they are used in the UK in areas where traditional unconstrained connections are slow or not cost-efficient ((ENWL, 2021); (SP Energy Networks, 2017)). In what follows, we look at two interrelated characteristics of connection agreements that are equally relevant to the supply and demand side types of agreements. First is the mandatory versus voluntary contracting of flexibility. The second is how the curtailment in the connection agreements is determined.
Regulators, or DSOs, may decide to implement mandatory connection agreements, meaning users are obliged to enter into such agreements if they want to get a grid connection. For instance, in the Walloon region in Belgium, all new electricity production capacities of more than 250 kVA will be subject to a flexible connection, i.e., a non-firm generation connection capacity. In Germany, the 3% curtailment rule by the DSOs applies to all RES connections to distribution networks (Beckstedde et al., 2019). Connection agreements can also be voluntary for network users, meaning that they can agree to have such a constrained connection. We find such practices in the flexible connection proposal in Flanders (Belgium) and the future access agreements in Spain (Beckstedde et al., 2019). In the UK, the Electricity North West DSO offers some flexible connection options for generation and demand customers and is working on additional offers relating to active network management (ENWL, 2021). For demand-side flexibility, most of the current practices of connection agreement are based on voluntary participation ( (Armentero et al., 2020); (IRENA, 2019)). Mandatory load reduction can be applied due to reliability issues. In this paper, we investigated mandatory connection agreements as an explicit demand-side flexibility scheme with a potential to increase welfare. This aims to provide insights for regulators and policy makers on the benefits that such schemes could bring.
The way curtailment is set up by regulators, or DSOs, set up may differ in practice. Most technical reports refer to the ways the curtailment is determined in supply-side connection agreements. Baringa (2017) report for UKPN presents two curtailment rules: Last In First Off (LIFO) and a pro-rata rule. A LIFO rule means that curtailment is applied starting from the last connected user, minimising the risk for the users connecting early. Such a rule was mainly developed for RES projects for which curtailment levels could impact their business plans and does not fit demand-side connection agreements. The last RES projects to connect are curtailed more frequently. In turn, they can benefit from reduced uncertainty regarding the network situation and also possibly reduced investment costs compared to the already connected projects due to technological developments. For the demandside, electricity sales and consumption do not constitute their primary commercial or professional activity. Therefore it would not be feasible to curtail residential customers' electricity consumption based on their order of connection and could raise fairness issues. A pro-rata rule means that curtailment is shared equally across all users during the constraint. The pro-rata curtailment resolves the system constraint with regard to each user's proportional contribution. In turn, such a rule is fit for demand-side connection agreement and will be further investigated in this paper. ENA (2021) study discusses another rule called the curtailment Index. Users with flexible connections receive a forecasted index value and a maximum cap value of curtailment per year. The curtailment index rule is also more suitable for supply-side connection agreements, as it requires certain expertise from the users, as the DSO updates annually them with non-binding estimates on the network situation and the likelihood of curtailment. Figure 1 illustrates the different curtailment rules in smart connection agreements. The three curtailment rules discussed in the previous paragraph are compared with the situation where no specific rule is aplied. We call such a situation an unconstrained smart connection agreement, where the DSO applies curtailment in the most economically efficient way. In order to investigate the characteristics of demand-side connection agreements, we model a voluntary scheme where consumers offer their flexibility to the DSO and a mandatory scheme where the DSO decides on the level of flexibility to be contracted from consumers. In both schemes, the DSO sets the level of compensation in euros per kWh. For these two schemes, we investigate how they impact welfare and at which level demand-side flexibility is priced. This addresses the regulatory option investigated in this paper and aims to guide regulators aiming to implement such schemes, analysing their impact on the welfare and flexibility prices. This paper investigates two curtailment implementation rules for mandatory demand-side connection agreements, among the four discussed in the introduction. These two rules are deemed the most suitable for demand-side agreements. First is a pro-rata scheme, where the customers are curtailed at equal levels in case of a load reduction event. The second is an unconstrained mandatory demandside connection agreement without such constraint. The two schemes are discussed from feasibility and welfare perspectives.
Regulatory implementation: Pro-rata versus unconstrained mandatory demand-side connection agreement; is a pro-rata scheme a fair tradeoff for feasibility and welfare gains?
The remainder of this paper is organised as follows. In section 2, we present the modelling approach. The case study and results are shown in section 3, and conclusions are drawn in section 4.

Modelling approach
This section presents first a literature review on the use of bilevel optimisation models assessing the potential of flexibility in distribution grids. Then, it describes the setup of the two models compared in this paper. Third, it introduces the formulation of the optimisation models.

Bilevel optimisation models for flexibility in distribution grids
Bi-level models are becoming increasingly widespread in game-theoretic modelling and optimisation. They are hierarchical optimisation models, where there is one leader and one or multiple followers. Each of them seeks to maximise its utility by respecting its constraints, with the leader taking into account the followers' responses ( (Dempe, 2002). There are several hierarchical relationships in electricity systems, such as between DSOs and consumers or suppliers and consumers. With the decentralisation of electricity systems and the increasing relevance of such interactions, bi-level models have experienced widespread use in the electricity sector (Gabriel et al., 2013).
Two lines of research on demand-side flexibility are particularly relevant for applying bilevel models in distribution grids. The first one is on the implicit demand-side flexibility, i.e. the design of distribution network tariffs. The second one is investigating different schemes of explicit demand-side flexibility.
The design of network tariffs is subject to the hierarchical positions between DSOs and consumers. The DSO, or the regulator as a leader, sets the components of distribution network tariffs (volumetric, capacity and fixed) and their magnitudes in order to incentivise the prosumers to use their solar PV and batteries efficiently. Based on those tariffs, prosumers as followers react to them by investing in DERs to maximise their individual welfare and minimise their bills.
Schittekatte and Meeus (2020) develop a bilevel model to investigate the design of network tariffs on consumers' investments in DERs and analyse fairness and cost-reflectiveness tariff design constraints. Hoarau and Perez (2019) adopt a similar modelling approach to examine the impact of network tariff design on DERs and EVs under a grid cost recovery constraint. Pediaditis et al. (2021) consider a detailed representation of the network in a bi-level optimisation model that assesses the impacts of different levels of tariff granularity on the economic efficiency of the short-term operating condition.
Explicit demand-side flexibility has also been increasingly investigated through bilevel game theoretical models. This could be either for network planning use cases, e.g., network capacity issues or network operation ones, e.g., network congestion issues. Grimm et al. (2020) develop a bilevel optimisation model where the DSO in the Upper Level (UL) minimises network expansion and network operation costs while the prosumers in the Lower Level (LL) decide on storage investment and operation to maximise their profit. The paper investigates the regulatory choices that can influence the model's outcome, such as the mandatory curtailment of renewable production and a subsidy scheme for storage investments. In Nouicer et al. (2023), we assess the potential of mandatory demand-side flexibility through a bilevel optimisation model. The DSO, in the UL, decides on network investment and demand curtailment levels and sets the network tariff levels. Prosumers in the LL react to the network tariffs and the administratively-set flexibility compensation by investing in DERs and operating them. For the network operation's use case, Askeland et al. (2020) develop a bilevel model where the DSO, in the UL, decides on the design and magnitude of network tariffs and the load to be curtailed while minimising the operational costs. Consumers in the LL, decide on the scheduling of their flexible resources. Torbaghan et al. (2016) also develop a bi-level approach where the DSO sets the flexibility prices and volumes endogenously. However, they do not include network and flexibility costs recovery through network tariffs.
In Nouicer et al. (2022), we investigate a voluntary scheme of demand-side connection agreement. The price of demand-side flexibility is set endogenously by the DSO in order to attract the needed demand-side flexibility from the LL consumers. The consumers, prosumers and passive consumers, shape their electricity consumption in response to the network tariff signals and voluntary offer their flexibility based on the flexibility price set by the DSO. Other relevant works on voluntary demandside flexibility use a single level optimisation model, such as in Morstyn et al. (2018).
This paper extends the bilevel model developed in Nouicer et al. (2023) to include an endogenous calculation of the mandatory demand-side flexibility compensation. We compare its outputs with the bilevel model developed by Nouicer et al. (2022) for voluntary connection agreements. To the best of our knowledge, there are no similar comparisons in the literature informing the benefits and implementation constraints of mandatory versus voluntary contracting of demand-side flexibility. Figure 2 shows a generic schematisation of the two bi-level models used in this paper. In both models, the DSO, in the UL, invests in the network and sets the flexibility price and the network charges levels to recover both network and flexibility costs. In the LL, consumers, which can be prosumers or passive consumers, react to the different signals for flexibility and network charges.

The model setup
The principal difference between mandatory and voluntary demand-side connection agreements lays in who sets the flexibility levels (indicated between parenthesis in Figure 2). For mandatory demand-side connection agreements, the DSO in the UL sets the flexibility levels and other decision variables such as the flexibility compensation and the level of investment in the network. In the LL, prosumers can react to those levels through investing and operating their solar PV and batteries. For voluntary demand-side connection agreements, the DSO sets the flexibility compensation and the level of investment in the network. In the LL, consumers offer their flexibility in kWh in response to the price set by the DSO to maximise their individual welfare. Similarly to the mandatory case, prosumers can rely on the invested DERs for optimising their welfare, while passive consumers can, in this case, optimise their welfare by deciding on the level of flexibility to be offered to the DSO, following the explicit price signals they are subject to. Athir Nouicer, Leonardo Meeus, Erik Delarue

The model formulation
The optimisation models we use in this paper are extended versions of previous work on mandatory and voluntary demand-side flexibility. First, we modify the model for mandatory demand-side connection agreements, developed in Nouicer et al. (2023), to include an endogenously set compensation by the DSO. The second model used is for voluntary demand-side connection agreement, developed by Nouicer et al. (2022). In what follows, we introduce the setup of the mandatory-demand side connection agreement bi-level model. The voluntary demand-side connection agreement model is introduced in Appendix B1, and the steps in solving it are presented in Appendix B2-B3.

The upper-level formulation
The DSO's objective function is to maximise welfare (eq 1). It considers not only its own interest but also the interests of the consumers. The welfare is equal to the gross welfare originating from the electricity consumption and the revenues from flexibility provisions, shown in eq 2, minus the total system costs (eq 4) composed of energy costs (eq 5), DER investment costs (eq 6), flexibility costs (eq 7) and network investment costs (eq 8).

Max
(1) Where: ( 2) is the electricity demand for each consumer representative day, and the hour of the day . Residential consumers can be either active or passive ones. The is the index for the type of load profile days and is 1 for a normal day and M for a critical day, see Figure 3. The demand-side flexibility variable is and represents the load reduction for consumers. It is a decision variable of the DSO in the case of a mandatory scheme and of consumers in a voluntary scheme. VoLL is the Value of Lost Load expressed in €/kWh. The curtailment compensation variable is and is decided by the DSO. is the annualising weighting factor for the representative days, . The full list of parameters and variables is given in Appendix A1.
With (5) The variable for the electricity withdrawn from the grid is while is for the electricity injected into the grid. and are parameters for the energy price for buying electricity from the grid and the Energy price received for injecting it into the grid. They are both flat.

(6)
Eq 6 represents the investment costs in DER for the prosumers. The variable represents the installed solar PV capacity by consumer [kW] while represents the installed battery capacity by consumer i [kWh]. and are the annualised investment cost for solar PV and batteries.
The are a fixed fee and do not interfere with the optimisation process.
is the incremental network expansion cost and is further explained in the case study subsection. The used to calculate the network investment costs in eq 8 is the maximum of the demand and injection peak. We determine it through the following equations (9-11): The constraint, setting the recovery of network investment and flexibility contracting costs through the network tariffs, is given by eq 12. The variable represents the maximum observed capacity of consumer i for withdrawal or injection.

The lowerlevel formulation
In the LL, consumers, that can be prosumers or passive consumers, pursue their self-interests, maximising their individual welfare. This is given by eq 13.
The are divided into four components: energy costs, network charges, DER costs, and fixed costs.
In order to solve the bi-level model, we transform it into a mathematical model with equilibrium constraints (MPEC), see Appendix A1-A2. We solve it using the General Algebraic Modeling Language (GAMS) software in conjunction with the nonlinear KNITRO solver.

Case study and results
This section introduces first the case study data used in the optimisation model. Then, we present the results in the four following subsections.

Case study data
The case study investigated in this paper is similar to the one used in Nouicer et al. (2022). The key parameters are shown in Table 1. They are applied to both models to compare the results.  (17) The domestic VoLL values vary across the Member States. The lowest domestic VoLL is estimated in Bulgaria (1.50 €/kWh), while the highest is in the Netherlands (22.94 €/kWh), according to the CEPA (2018) study prepared for ACER. The Member States with per capita incomes higher than the median levels, e.g., western European Member States, have higher VoLLs. In turn, Eastern European Member States have lower VoLL levels. Also, the Member States with colder climates tend to exhibit higher VoLLs. In our case study, we opt for a VoLL of 9.6 €/kWh, which is in the range of the median VoLL value of the Western European Member States, e.g., France, Belgium and Germany.
Electricity consumption in the EU is usually measured per household. Its values vary as well across the Member States. In 2019, the lowest annual consumption in the EU was in Romania, 1694 kWh, while the highest was in Swede with 9032 kWh. Norway, not an EU Member State, has historically had the highest annual electricity consumption in Europe, with an average of 16241 kWh in 2019 (Odyssee-Mure, 2020). Indeed, Norwegian household energy consumption is much more based on electricity than in other European countries. For instance, building heat systems are predominantly electric, and the Nordic country has the world's largest electric vehicles (EVs) market.
Decarbonizing the EU energy sector goes through the electrification of end uses such as heating and transport with renewable electricity. Therefore the future household annual electricity consumption will likely increase, despite energy efficiency measures (IEA, 2021). An additional heat pump per household would represent an extra annual household consumption of 4000 kWh in the UK (Viessmann, 2022) and 5000 kWh in Germany (Schlemminger et al., 2022). The figure depends on several factors, such as the size of the house, insulation and the efficiency of the heat pump. In France, the average electricity consumption of a 100 m 2 house, which is more likely to have space to install a solar PV, with electrical heating is between 9350 kWh with good insulation and 13650 kWh with poor insulation (Engie, 2021). Households with annual electricity consumption between 5000 kWh and 9900 kWh can typically install between 3 kWp and 6 kWp of solar PV panels depending on the location, modules' cost and electricity prices (Endesa, 2021). The additional household consumption from EVs depends on the type of the EV and its daily usage. With an efficiency of ~7 km/kWh, a Nissan Leaf would annually add around 1400 kWh of electricity consumption (Kobashi and Yarime, 2019). In our case study, we opt for an annual household electricity consumption of 9785 kWh.
The consumers' load profiles are composed of a normal day with a load profile based on the Synergrid (2019) standard load profiles and a critical day with higher consumption in the day and evening peaks, as shown in Figure 3. The normal days have a weight of 355, while the critical days' frequency is 10. Critical weather events threaten the electricity systems and increase the need for flexibility. Such an approach is used to design Critical Peak Pricing (CPP) Programs for demand response. In California, Earle et al. (2009) incorporated 12 critical peak days in their model per year, which is the limit for high electricity rates the consumers are subject to under the CPP program. In our model, we opt for ten critical days per year. The frequency of these days plays an important parameter in the modelling of demand-side flexibility. Our previous work investigated the impact of the critical days' frequency on the potential of demand-side flexibility (Nouicer et al., 2023).

Figure 3. Load profiles for normal and critical days
In our case study, we opt for a greenfield approach to the network. This means that there is no network at the start of the modelling and no sunk costs to be recovered. 100% of network costs are prospective. The incremental network expansion cost, which is a parameter to calculate the network costs, represents the cost per Kw of the increase or decrease in the coincident peak. It is calculated based on the default grid costs, similar to Schittekatte and Meeus (2020) and is set at 400 €/kW. The network costs and flexibility costs are recovered through the network tariffs that are predominantly capacity-based. The DSO, in the UL, sets the capacity-based charges (cnt) and is allowed to set up to 40€ of fixed grid charges (fnt).
The distribution of consumers between prosumers and passive consumers is 50%-50%. The number of prosumers has grown significantly in the past years across Europe as a result of national policy and regulatory incentives. With further European incentives and enabling market design, there is a potential that 89% of the electricity households' demand to be generated by households themselves (PROSEU, 2021). In our model, prosumers can invest up to 4 kWp in solar PV and 6 kWh in batteries. AICS is the investment costs in solar PV, and AICB is the investment costs in batteries. Their values are in line with the current decreasing trends in the costs of DER technologies. In our case study, we set AICS at 1100 €/kWp (Jäger-Waldau, 2019), and AICB value at € 150 per kWh of installed capacity (European Commission, 2020).

Mandatory versus voluntary demand-side connection agreements
We start our analysis by comparing the welfare levels achieved when opting for mandatory versus voluntary demand-side connection agreements. In Figure 4, we show three welfare levels. First, as a benchmark, is the welfare level that is achieved when there is no contracting of explicit demandside flexibility, meaning that only capacity-based network tariffs are used. Second is the welfare level achieved with voluntary demand-side flexibility. Third, we report the levels for mandatory unconstrained demand-side connection agreement, which means that there are no constraints, at this stage, regarding flexibility volume distribution between the different consumers.  Figure 4 is that incorporating explicit demand-side flexibility in distribution grid planning does increase the welfare gains regardless of how it is contracted, either voluntary or mandatory confirming our previous work results in Nouicer et al. (2023) and Nouicer et al. (2022). The DSO contracts demand-side flexibility to save on network investments. Such investments would be very costly if the network is designed to meet the critical days' high demand peaks, which are not so frequent. This is also in line with the existent literature on mandatory flexibility (Tavares and Soares, 2020) and on voluntary flexibility schemes from Spiliotis et al. (2016) and Askeland et al. (2021). Our contribution here is to compare both types of demand-side connection agreements. We find that unconstrained mandatory demand-side connection agreements allow higher welfare gains than voluntary ones. This is because the DSO has the decision-making power under the mandatory demand-side connection agreement and can more optimally decide on the flexibility levels as well as the flexibility price without the risk of having consumers offering less or more flexibility than needed. We further detail the results in Table 2.
The difference between the welfare levels resulting from the optimisation model is relatively slight. This is due to the high VoLL and annual electricity consumption, which makes the impact of the reduction in total system cost (eq. 4), compared to the gross welfare, small in the total net welfare. However, the differences in total system costs averaged per consumer are more pronounced (see Table 2). These costs represent the annualised total consumer expenditure in energy bills and DER investments, averaged between prosumers and active consumers. Consumers would pay 938€ less per year with a voluntary demand-side connection agreement compared to the case where no explicit demand-side flexibility is used. Under a mandatory unconstrained demand-side connection agreement, they would pay 1128€ less. Under the voluntary demand-side connection agreement, the DSO contracts higher levels of flexibility than under the mandatory one (0.79% Vs 0.46%, as a percentage of annual demand). This is also combined with higher prices for the flexibility that are offered to the consumers (1.94 Vs 1.4 €/kWh). Note that the flexibility from the demand-side is only used during the critical days ( Figure 6) that occur ten times a year.
The compensation is set to indemnify the consumers for the curtailed demand and discomfort. The resulting compensation levels are lower than the VoLL, included in the UL objective function, see eq 1-2. Indeed, VoLL is a relevant parameter to inform DSOs on how consumers value the loss of electricity supply, and it can be used as an administrative price to compensate consumers when disconnections occur (CEPA, 2018). In our model, VoLL signals the value the consumers give to undisrupted electricity supply. The compensation price is calculated endogenously to maximise the welfare, see eq 1. As we impose the recovery of the flexibility as well as network investment costs, all these costs are to be recovered via the network tariffs, as it is applied in 16 Member States (ACER, 2021). This limits the flexibility prices' welfare-maximising levels. Indeed, when forcing the model to set compensation close to VoLL, the capacity-based network charges paid by consumers increase, and so do the consumers' electricity bills. In addition, the curtailment levels that occur are limited and do not result in complete load disconnection, which is measured at VoLL. We further investigate this aspect in Nouicer et al. (2022). The compensation is set at a level that partly compensates the consumers for the discomfort from the supply disruption without leading to a strong increase in the distribution network tariffs.
The network investments under voluntary demand-side connection agreements are lower, but the total systems costs are higher mainly due to higher compensation and flexibility over-contracting. The DSO sets a higher compensation price to spur flexibility from the consumers. To maximise their individual welfares, consumers choose to adapt their consumption profiles and set the level, and the timing of the flexibility offered, based on the signals of capacity-based network tariffs and the flexibility price set by the DSO. In the voluntary scheme, the lower welfare levels are due to imperfect price signals for explicit demand-side flexibility and strategic behaviour from prosumers. The signals sent by network tariffs are not perfect either, as we use flat capacity-based rates instead of dynamic ones. However, network tariff imperfection applies to both schemes, unlike explicit demand-side flexibility, whose levels are decided by different agents in each scheme.
With different types of consumers in the LL, prosumers and passive consumers, the DSO has to set an attractive enough compensation for passive consumers. Typically passive consumers value higher the discomfort linked to the reduction of electricity, as they don't have an alternative to selfproduce or store electricity, e.g., solar PV or battery systems. We show, in Figure 5, the distribution of explicit demand-side flexibility contracting between prosumers and passive consumers for voluntary and unconstrained mandatory demand-side connection agreements. Prosumers and passive consumers, which are equally represented with a 50%-50% distribution, contract different levels of demand-side flexibility for each scheme. In both schemes, prosumers are strongly incentivised, through the capacity-based network charges, to invest in solar PV (4 kWp per prosumer) and batteries (6 kWh per prosumer), covering their consumption during the day and evening peaks to avoid paying grid and energy charges. Such installed capacities are the maximum allowed for solar panels and battery batteries by the model. Low DER investment costs combined with high electricity price levels also contribute in making the investment in DERs more attractive.
For the voluntary scheme, prosumers benefit from the relatively high compensation of 1.94 €/kWh set by the DSO for all consumers to provide more flexibility and receive the related compensation. They value less electricity consumption as they can rely on their solar PV and batteries. Out of the 0.79% total demand-side flexibility levels (see Table 2), prosumers offer 53% of it. As shown in Figure 6(a), prosumers use sub-optimally their battery, injecting at hours 19-20 instead of 20-21, which are the evening consumption peaks.
For the mandatory scheme, the distribution of the contracted flexibility among the consumers is different. There is less flexibility contracting from the prosumers than under the voluntary scheme. Indeed, as shown in Figure 5 (right), the DSO gets 20% of the flexibility from the prosumers and 80% from the passive consumers. Under the mandatory scheme, the DSO anticipates the ability of the prosumers to rely on their DER to reduce their consumption peaks and sets lower overall demandside flexibility levels (0.46% for the mandatory scheme Vs 0.79% for the voluntary one) combined with a lower price for flexibility. In Figure 6 (a) & (c), we compare the prosumers' load profiles under both schemes and see that under the mandatory scheme, the curtailment of prosumers is lower and is combined with a more efficient battery output that is more aligned with the evening peak.

Pro-rata mandatory contracting
This subsection investigates the regulatory implementation of a mandatory demand-side connection agreement. We introduce a pro-rata constrained mandatory demand-side connection agreement, meaning that curtailment is shared equally among all types of consumers at the moment of the flexibility event. Such a scheme can be used either because it is not so evident for the DSO to profile the connected consumers as prosumers or passive ones following their behind-the-meter installations or for equity issues. We report in Table 3 the welfare level for the pro-rata constrained scheme and compare it with the previous values. The pro-rata constraint naturally reduces the welfare compared to the unconstrained mandatory scheme. However, the welfare levels remain higher than for the voluntary demand-side connection agreement scheme. Also, the total system costs are slightly higher under the pro-rata scheme compared to the mandatory unconstrained demand-side connection agreement. They are still lower than the voluntary scheme by 177€. The pro-rata scheme results in higher flexibility levels compared to the mandatory unconstrained scheme. Indeed, the DSO is obliged to curtail the consumers equally and is therefore not free to allocate less curtailment on the prosumers. This is also reflected in the annual network investment per consumer. Indeed, even though there is higher flexibility contracting under the pro-rata scheme, the network investments are also higher as the curtailment is less optimally allocated. The compensation under the pro-rata scheme is lower than the unconstrained scheme. This is due to the fact that under the unconstrained scheme, the DSO sets a higher compensation as most of the remuneration is targeted to the passive consumers, while under the pro-rata scheme, the curtailment is higher and less cost-efficient. Therefore a lower compensation is set (1.2 €/kWh) to limit the increase in system costs.

Curtailment profiles for the different demand-side connection agreement schemes
To further analyse the differences between the connection agreement schemes, we report in Figure  7 the curtailment profiles for prosumers and passive consumers. For the voluntary connection agreement, most of the prosumers' flexibility is offered during the evening peak to benefit from the high compensation and increase the prosumers' welfare. Passive consumers offer flexibility for both consumption peaks, as they cannot invest in solar PV to partly cover the day consumption peak like prosumers do in order to reduce the charges paid for network investment. The mandatory unconstrained scheme allows the DSO to curtail the prosumers less, obliging them to rely efficiently on their DER and reducing their strategic behaviours. Passive consumers are curtailed to higher levels while receiving adequate compensation in a way that reduces the network investment and does not increase the network charges much. The pro-rata scheme contracts similar levels from both types of consumers by definition. Most of the curtailment happens during the evening peak when the consumption is higher than during the daytime. The pro-rata constraint results in the highest curtailment levels of prosumers during the day consumption peak across all the schemes. The DSO has to set the same level between prosumer and passive consumers who cannot invest in solar PV. The difference in welfare levels between the unconstrained and the pro-rata constrained mandatory demand-side connection agreements suggests that there is a potential for a secondary flexibility mechanism to fill the welfare difference. Such a mechanism would start from the outcome of the prorata mandatory connection agreement with a 50/50 distribution of flexibility. Then consumers could trade their flexibility in order to reach the flexibility distribution levels of the unconstrained mandatory connection welfare and thereby higher welfare levels.

Battery output for the different schemes -prosumers
The use of battery systems is an important indicator of potential strategic behaviour with the voluntary demand-side connection scheme. We show, in Figure 8, how prosumers discharge their battery systems, maximising their individual welfare. With the voluntary connection agreement, prosumers cover the day peak with the battery output in addition to solar PV and do not offer flexibility then. In the evening, the discharging starts earlier than with the mandatory agreement so that more flexibility is offered during the evening consumption peak to benefit from the corresponding compensation. For the mandatory unconstrained scheme, the battery output is scheduled following the curtailment action by the DSO. Such output is centred on the evening peak, where it is most needed. The DSO sets lower levels of curtailment for the evening peak in a way that incites prosumers to use their battery in an optimal way to cover a large part of the peak. For the pro-rata constrained scheme, prosumers are curtailed by relatively high levels during the day peak. Therefore they do not use their battery then, as solar PV injections suffice. The output of the battery is scheduled around the evening peak to respond to the high electricity demand then.

Conclusion and policy implications
Inherent to its origins, demand-side flexibility is strongly linked with consumer engagement. Its enabling framework can be challenging to refine as it entails a change in consumers' electricity use and a potential loss of comfort. We should pay particular attention to setting suitable mechanisms and incentives to unlock the potential of demand-side flexibility. This paper brings two regulatory contributions related to the contracting of explicit demand-side flexibility.
First, this paper compares two types of demand-side connection agreements: voluntary versus mandatory. In many countries, regulators and DSOs have focused on voluntary schemes for contracting demand-side flexibility, e.g., voluntary demand-side connection agreements. This, as confirmed by our results, allows DSOs to save on their network investments and increase welfare. However, our analysis shows that further benefits can be achieved via mandatory contracting of flexibility instead of a voluntary one. The reason is that with the voluntary demand-side connection agreement, and in the presence of different types of consumers, prosumers behave strategically and oversupply flexibility to benefit from the relatively high compensation. Regulators and DSOs may adapt current regulations to promote mandatory demand-side connection agreements. Such agreements, leading to higher welfare, could be done via remotely controlling heat pumps, electric boilers or other electricity-intensive devices. In addition, the load reductions exerted by the DSO, based on our results, represent a tiny fraction of the consumers' annual demand and happen only during non-frequent consumption peaks. Furthermore, the demand reductions do not disrupt the consumers' consumption habits much and do not result in a complete load disconnection. However, mandatory demand-connection agreements entail different levels of flexibility contracting on consumers, creating equity or feasibility issues. They may, therefore, face low public acceptability.
Second, this paper investigates the implementation of an alternative mandatory demand-side connection agreement. We introduce a pro-rata scheme with a 50/50 curtailment quota constraint between consumers. A pro-rata mandatory agreement leads to lower welfare levels than mandatory unconstrained contracting. However, it is still more beneficial than voluntary contracting and comes with a lower flexibility compensation price per kWh. Regulators and DSOs may consider implementing pro-rata demand-side connection agreements as they are easier to implement. The difference in welfare levels between the unconstrained mandatory scheme and the pro-rata constrained one alludes to the potential of a secondary flexibility mechanism to recover the welfare gap. Such a mechanism would allow consumers to trade their flexibility starting from the prorata outcome, which is more realistic to be introduced, to reach the higher welfare levels of the unconstrained scheme. It also represents an additional revenue stream for consumers willing to participate in such secondary markets. Regulators can also enhance the acceptability of mandatory demand-side connection agreements by providing extra monetary and non-monetary incentives to demand consumers. In addition, disseminating their benefits to consumers and providing smart energy management tools, allowing a seamless reduction in consumers' demand, are also key to the success of such schemes.

VARIABLES (starting with lower-case letters)
Upper Level The coincident peak demand resulting from the model optimisation (the highest value of and ).
The coincident peak demand resulting from the model optimisation The coincident peak injection resulting from the model optimisation (1) Where: The are a fixed fee and do not interfere with the optimisation process.
The cost recovery of grid investment and flexibility procurement costs is imposed by the constraint in Eq.12. The regulated DSO sets the magnitude of the capacity and fixed components of the network tariffs to recover these costs.

Lower Level
The gross consumer surplus is composed of two components and expressed in Eq.14: the first corresponds to the value of electricity consumption for each consumer, and the second is the revenue from the flexibility that every consumer gets based on his offered levels.
The second part of the consumers' objective functions is the total costs paid by each one. They are divided into four components, being energy costs, network charges, DER costs, and fixed costs. They are calculated in the following equations 15 to 17.