A generic multi-period optimal power ﬂow framework for combating operational constraints via residential ﬂexibility resources

In low voltage networks, the majority of distributed energy resources are customer owned. As such, it is harder for the distribution system operator to control its system and maintain acceptable operating conditions. Even if residential ﬂexibility is available, it should be employed without signiﬁcant disturbances to customer-driven device proﬁle patterns. Here a generic tool is developed to assist the distribution system operator in making informed decisions regarding its best course of action to combat operational issues with a limited amount of customer-driven ﬂexibility. The proposed tool relies on a novel and versatile multi-period optimal power ﬂow model for centralised control of low voltage distribution systems. Various scenarios of ﬂexibility resources controllability are examined, coupled with a number of novel modelling approaches and customer-driven restrictions for the distribution system operator. For most scenarios, the multi-period optimal power ﬂow model is amenable to nonlinear programming (NLP) problems, though there are cases that end up as mixed-integer nonlinear programming (MINLP) problems. For the latter, a heuristic approach is employed to approximate the MINLP into a sequence of size-decreasing mixed-integer linear programming (MILP) and a ﬁnal NLP problem. The proposed formulation and approximation are applied to two low voltage networks of 18 nodes and 308 nodes, respectively.


Motivation and literature review
Until recently, low voltage (LV) distribution networks were designed under the passive status assumption, that is, they would host customer loads and a few small local generators [1]. In recent years, there has been a massive, customer-driven deployment of distributed energy resources (DER), transforming distribution networks into highly active systems [2]. Networks that utilise outdated infrastructure appear to be very weak to handle the uncoordinated, massive penetration of DER. In such cases, because most devices are customer owned and distribution system operators (DSOs) rarely have adequate observability and control over individual feeders, serious voltage and thermal issues can be observed [3].
In ensuring the reliable operation of distribution systems, there are so-called 'active' approaches which take advantage of system flexibility, such as demand response, centralised control of distributed storage, or RES curtailment [4]. However, they require intense customer involvement and/or DSO ownership of interconnected devices. The latter assumptions are somewhat unrealistic, due to the technical and legal barriers.
Overvoltages arise at significant PV penetrations. The issue is most commonly combated through (centralised or distributed) PV curtailment or local power factor adjustment [5]. Undervoltages arise when intense electricity-consuming DER, are deployed. The centralised control of distributed PVs coupled with ESS is proposed by [6] to achieve bidirectional voltage regulation. Strong integration of hybrid EVs fleets is achieved in [7] by means of an aggregator-based, multi-step, demandside management approach. The authors of [8] propose a dynamic, full-controlability (centralised) scheme for managing residential electrical and thermal loads. Thermal overloads (lines/transformers) are also common, and a major concern for DSOs, as they translate to substantial maintenance and reinforcement costs [9].
The management of voltages issues and congestions is usually performed via deterministic multi-period optimal power flow (MP-OPF) [10]. Since the pioneering paper [10], various MP-OPFs have been proposed for active distribution grids, the vast majority adopting a deterministic approach, except [11], which treats uncertainty via robust optimisation. Uncertainty has also been tackled in more specialised settings. The authors of [12] solve (iteratively) an adaptive, robust MP-OPF in an urban setting, considering day-ahead flexibility reservation and deterministic flexibility activation. In [13], the uncertainties of renewables are tackled by considering temporal and spatial correlations, to define the set-points of 'static' devices such as capacitors or transformer taps. In almost all cases, full or at least substantial controllability over the system is assumed.
On top of individual distributed devices, a great source of concentrated flexibility is the smart nearly zero energy (nZE) building, hereby referred to as smart sustainable building (SSB) [14]. Their operation is planned by their EMS, their primary objective being to maximise their owners' profit while maintaining energy self-sufficiency year round. SSBs are strongly pushed by current E.U. directives, because of their low environmental impact, see [15], and ability to provide support through a wide range of flexibility options. However, given the environmental constraints of SSBs, their devices must be coordinated in unison, rather than individually.

Paper contributions
Throughout the literature, tailored techniques have been developed to address individual issues, or their entirety by allowing the DSO high degrees of controllability. This motivates us to develop a generic and versatile MP-OPF model for active distribution systems to assist the DSO in ascertaining the efficiency of common residential flexibility resources (FRs) to jointly manage operational issues. The main contributions of this work can be summarised as follows: • It constructs a generic mathematical framework to provide information on unlocking the flexibility potential of LV networks. The framework is reproducible, adaptable to different problem setups and easy to use as a basis for more sophisticated developments. • It proposes a novel algorithm, combining a series of sizedecreasing MILPs and a final NLP computation, for optimally managing multiple shiftable loads (SLs) in the MP-OPF setting. • It includes a number of novel elements such as the remuneration schemes for flexibility provision, the modelling of FRs with respect to their original, user-driven profiles (a contrast to most works, in which DSOs can freely define the operation of most devices), and the modelling of SSBs as independent units, whose flexibility provision is subject to environmental constraints (daily energy neutrality) by which the DSO has to abide. • It provides an extensive analysis of available residential flexibility options for the optimal management of LV distribution systems, under various levels of DSO controllability. • Given how underaddressed the topic is in the literature, it proposes a first crude DSO/customer collaboration framework through which the DSO can utilise residential devices to achieve better system management. This is crucial, given the DSO's traditionally minimal involvement in supervising the operation of LV systems.
The remainder of this work is structured as follows. The mathematical model and main assumptions are given in Section 2. The case study results are given in Section 3. Conclusions and future work plans are offered in Section 4.

Main assumptions
For the sake of clarity, we lay out the main problem assumptions. This is day-ahead (planning), multi-period (24-h horizon, hourly resolution), centralised control optimisation problem, where the DSO has partial controllability of the available flexibility resources (FRs) within an LV feeder. The DSO uses a most-likelyto-occur forecast scenario for weather-dependent resources. The forecast is assumed accurate or sufficiently stochastic; either way, real-time deviations are considered negligible or able to be addressed with very low real-time costs (with respect to the dayahead costs) [16]. We assume the existence of a digital platform through which customers inform the DSO of their expected schedule, and receive new set-points; they are remunerated based on the forecasted deviations from the expected profiles. All necessary control/observation tools are assumed to be pre-installed [17].
The work fits within the general MP-OPF framework originally developed in [10]. Solely for the sake of simplicity, we assume that the examined LV feeders are well-balanced, that is, the single-phase representation can be reliably used. Nonetheless, the formulation is generic and easily extendable to unbalanced systems (and any optimisation horizon/resolution).

Cost modelling based on customer-driven flexibility
The DSO's goal is to maintain acceptable operating conditions across its system, for the entire optimisation horizon, in a cost-optimal manner. As the DSO owns no devices of its own (except the substation transformer), it may only resort to customer-based flexibility for combating operational issues. In the latter case, the DSO incurs so-called congestion management costs (1). They are made up of a variable component (2), a fixed component (3) and a slack violation (SV) component (4). The latter is added to avoid cases of infeasibility and to quantify the amount of constraints violation: The variable cost (VC) encompasses the import/export cost (5), the PV curtailment cost (6), the FL alteration cost (7), the ESS alteration cost (8) and the SSB alteration cost (9): As was made apparent from the literature review, most past works 'hand over' full controlability of all devices to the DSO. As such, the DSO is allowed tremendous leeway in deciding the profile of each device. Some works even go as far as leaving the scheduling of loads, EVs or ESS completely up to the DSO's discretion; the customer has effectively no say in the matter.
A key difference of the proposed approach is that it is much less intrusive, since all variable costs above depend on how much the DSO requires the optimal profiles to deviate from their original, customer-driven pattern.
In general, we model the deviation of any flexible asset f from its original, customer-desired profile as P f = P or where P or f is the original active power consumption, and the non-negative variables P O f , P U f represent the operation above and below the original, respectively. The latter can represent a variety of states such as reduced FL demand, decreased EV charging or increased ESS discharge to name a few (more details in Section 2.3).
As will be explained (Section 2.3), the DSO has somewhat limited controllability over each device; system planning becomes much more challenging. In short, the customers set the general operational trend of the system. The limited flexibility that they provide is largely based on how each device was supposed to behave. This is what we define as customer-driven flexibility.
The fixed cost (FC) encompasses the EV commitment cost (10), the SL commitment cost (11) and the ESS commitment cost (12): The concept of customer-driven flexibility is again prevalent. Contrary to other devices, EVs, SLs and ESS follow more rigid profiles due to also needing to respect hard temporal constraints. As such, each customer has a very specific schedule in mind for these devices. Should the DSO seek to alter said schedule in any capacity (e.g., change an EV's charging pattern or shift the SL to a different operating horizon), regardless of the impact, it pays a one-time, device-rate-dependent commitment cost. This is similar to the concept of availability remuneration for ancillary services. The modelling of ESS utilisation is unique: it carries the lowest utilisation cost and the highest commitment cost. The DSO must carefully consider each option, as even the smallest 'disturbances' to customer-driven profiles may be associated with significant costs.
To circumvent the use of binary variables for the modelling of EV and ESS commitment costs, a barrier function pricing is proposed. The barrier sensitivity factor, , must be carefully selected so as not to create numerical issues [18]. For SLs, if their original operation is shifted across the optimisation horizon ( s,t 0 s = 0 or s,(t 0 s +CT s ) = 0) then the commitment cost is activated.
On a final note, it should be mentioned that utilisation price per FR is chosen based on a desired activation priority order (PO). The PO is empirically constructed, based on a combination of factors such as ease of flexibility activation (for the DSO), disruption of customer comfort, or environmental targets. Depending on the context, the PO could change. The applied prices (

2.3
Customer-driven device modelling

Photovoltaics
PV solar generation can be curtailed (at the inverter level) up to an agreed-upon percentage, M PV , (13). It is also assumed that PV inverters are able to provide reactive power support by injecting or absorbing reactive power, Q PV p,t , by up to a certain percentage, M Q , of the injected active power (14) [19]. PV reactive support is a device technical mandate and is thus not penalised in the objective function:

Shiftable loads
SLs (e.g., washing machines or dryers) must operate for a fixed time duration, that is, their cycle time (CT), (15), maintain an uninterrupted operation while doing so (16) and remain 'offline' during specific time-frames (17). This work adopts the SL modelling proposed in [20], as it leads to fewer equations:

Flexible loads
Based on the DSO's needs, FLs (e.g., AC units) may engage in slight 'overdemand' or 'underdemand' (18). For example, an 'overdemand' of 0.1 kW means that the DSO requires the FL to increase (with respect to its original profile) its consumption level by 0.1 kW. This time, there is no need for energy shifting, as in the SL case. These slight alterations are based upon a small agreed-upon percentage, M FL , and should be compliant with the residents' comfort level [21]. Parameter M FL is assumed to take that mandate into account (19). Do note that the simultaneous activation of 'overdemand' and 'underdemand' would deteriorate the value of the objective, see Equation (7), thus cannot occur, similarly to [10]. A power factor (pf) of 0.95 is assumed:

Electric vehicles
Based on the DSO's needs, EVs may 'overcharge' or 'undercharge' with respect to their original, customer-desired profiles, that is, consume more or less than originally programmed (exact same logic as for FLs). It is enforced that EV charging occurs only when the resident is home (20), to that the EV is fully charged by the start of the workday (21), and that the 'overcharging' and 'undercharging' do not cause any technical limit violations (22) and (23). Being based on deviations management, and since the EV cannot go above its originally designed final charge, the constructed model applies regardless of the EV's charging efficiency. Simultaneous 'overcharging' and 'undercharging' can occur, and so only their difference is considered (this is possible due to the absence of the charging efficiency). For simplicity, a pf of 1 is assumed:

Energy storage systems
The small-scale ESS that are considered in this work are residential and privately owned. For each ESS b and period t we define the total active profile P tot b,t , taking into account the customerdriven active profile P 0 b,t and the DSO-driven 'overcharge' or 'undercharge' (similarly to EVs). Depending on the ESS's customer-driven status (charge or discharge), two different versions of the total active profile are defined, in order to respect the customer's original decisions (24). Charging/discharging is represented by a positive/negative sign. The original customer-driven ESS status must be respected and cannot be changed: The 'over/undercharging' are always positive (25) and must not cause any violations of the ESS's technical characteristics (26). The SoC of an ESS is limited between agreed-upon percentages of its full capacity (27). The ESS should also 'open' and 'close' the day with the exact same SoC (28). For simplicity, a pf of 1 is assumed: The SoC change between periods periods is described by (29), depending on the ESS status. Lastly, constraint (24) essentially represents each ESS by a combination of a positive power (charging) and negative power (discharging) generator, as developed in [10]. As such, simultaneous 'overcharging' and 'undercharging' are again guaranteed to not occur. Contrary to the EV model, the charging efficiency is required here; the ESS postoptimisation energy exchange amount could be different from its original amount. As such, accurate tracking of the SoC is mandatory:

Handling of SSBs
An SSB is not simply a collection of FRs, but rather a smallscale microgrid (or nanogrid as referred to by some in industry). Its yearly operational profile is determined by its EMS; the aim is to maximise the owner's profit while satisfying the nZE directive. However, to 'comply' with the DSO's planning time-frame, the yearly profile is broken down into its daily components. It is assumed that the DSO can request small alterations to the SSB's daily active and reactive power profile while respecting the EMS-driven SSB status (30) and (31). The DSO, however, does not know from which devices is the SSB comprised of. As such, said alterations are governed by the EMS-driven parameter, M SSB . This parameter ensures that the EMS can comply with the DSO's request, and that the curtailment of the owner's renewable sources is a last resort. The customer's profit is also assumed to not be significantly altered due to the remuneration that is received from the DSO.
For the daily (derivative of the yearly) nZE directive to not be violated, the daily active power alterations must be at least energy neutral (32), that is, they cannot lead to decreased selfconsumption:

Power system constraints
The classic power system constraints hold ∀t ∈  , ∀i, j ∈  : i ≠ j, ∀b ∈ , ∀e ∈ , ∀p ∈ , ∀s ∈ . Equations (33) and (34) describe the nodal power balance constraints. The branch power flow formulas are described by (35) and (36). The technical limitations on voltage magnitudes, transformer power and line current limits are described, respectively, by (37) and (39):

Type of problem
The full MP-OPF problem is described by . Depending on which FRs are uncontrollable, appropriate sets of equations can be removed. When load shifting is possible (SLs), binary variables appear in the problem formulation, leading to an MINLP problem. In all other cases, the proposed model leads to a (far more tractable) NLP problem. In any case, this remains an operational planning problem; the main concern is not computation speed per se but rather the added value for the DSO in assessing the potential of each FR in coping with operational issues under a customer-driven flexibility setup.

Divergence from 'typical' approaches
A differentiation from previous works is that the calculated FR profiles are derivative of the original, customer-driven profiles. Most past works offer (unrealistically) full controllability to the DSO. We seek to also (implicitly) minimise the deviations between optimal and customer-driven profiles. The DSO builds upon the prevalent system conditions rather than applying globally optimal set-points.

Comparison to 'typical' approaches
The three examined FR commitment costs have not been explored in detail in the literature. Instead, similarly to ancillary service treatment, a 'reservation' cost is usually paid, regardless of whether the FR ends up being activated. Different objectives and problem setups are usually defined for such cases, and so, a direct comparison would be unfair.

The MINLP OPF problem
As was explained, the inclusion of SLs in the problem formulation leads to an MINLP problem. While this is not a major issue for small test systems, situation is not the same for larger systems. While this is a planning problem (and as such computational speed is not the primary focus), models that are intractable are not very practical.
Being represented by large number of binary variables, SLs present a major computational challenge. They are also 'burdened' by the continuity mandate (16), which concerns temporal aspects of SLs, further complicating the problem.
Approximation algorithms and relaxations have previously been proposed to handle OPF-based MINLP problems, see [22][23][24][25], for example. However, the presented problem is inherently different in nature, hence the motivation to construct the described heuristic algorithm. The major differences are, in brief, the continuous and discrete inter-temporal constraints (problem decomposition is not easy, as in [22,23]), the discontinuous objective function terms stemming from the proposed 'commitment' costs, and the structure of the power system and of the various devices, which are kept in their original form (no approximations), contrary to many past works (progressive rounding [23], successive linearisations [24], constraint relaxations [25]. Furthermore, contrary to the proposed approach, the obtained solutions from most approximation techniques are not guaranteed to be feasible for the original system.

SL pattern estimation
Solving a full MINLP problem or an NLP problem with progressive rounding are not viable options. While SLs rank low in the desired PO, it has been observed that, for heavily stressed systems, they are very cost-effective [20]. This, coupled with the associated computational complexity, motivates their estimation before transitioning to continuous control variables.
The main idea is to, instead of solving a complex MINLP problem or an approximated NLP problem for the entire ALGORITHM 1 Single SL pattern estimation algorithm system, split the problem into two parts: an iterative MILP problem to estimate the optimal behaviour of all SLs (maintaining their binary aspects) and a final NLP problem (with SLs fixed) to estimate the optimal behaviour of all other FRs (maintaining an accurate representation of the power system). The proposed MILP iterative process (see Algorithm 1) is described for a single SL, s, with a cycle time CT s . However, in practice, it is applied simultaneously for all SLs.
At every iteration, we solve a modified version of the original MP-OPF: all continuous control variable are ignored. At iteration c = 1, we enforce that only a single time period t * c may have an associated positive binary variable s,t * . This is the most critical time period for the SL to be 'ON.' It also becomes the first element of the set, Φ, of all periods whose binary variables will be positive. Now, remember that the SL must adhere to the continuity mandate (16). As such, the set, Ω, of all periods that are further than CT s from t * c , that is., {1, … , (t * c − CT s ), (t * c + CT s ), … , T }, only contains periods whose binary variables will by definition be zero. The above are constraints in further iterations.
For subsequent iterations, the value T * c and the sets Ω, Φ are calculated/enriched in similar fashion. However, from now on, due to the continuity mandate, we also know that all periods between t * c and t * c−1 will by definition have associated positive binary variables. As such, the set Φ is further enriched with these in-between values. When the set Φ contains as many elements as the CT s then the pattern of the SL has been estimated and algorithm terminates. Said pattern is considered fixed for subsequent steps.
To ensure that the SL commitment cost is accurately reflected during the iterative process, it is also updated in every iteration. This is very important to properly define; in past works, SLs have no associated control costs and as such the proposed heuristics start from a much simpler basis. This is, to the authors' knowledge, the first work to address the issue. After defining the set Δ s = { s,t 0 , … , s,(t 0 +CT s ) }, and its sum of elements Δ * s , the new commitment cost for SLs, C SL * , is described by (40):

Linear approximation of non-linear constraints
Despite the simplifications, the several non-linearities could cause the iterative approach to also be intractable. Thus, just for the SL pattern estimation process, the problem is simplified by adopting approximations (41-44) for the power flow equations, originally proposed in [26]. They are based on the assumptions that (a) the angle difference of neighboring nodes, i j,t is very small and that (b) the absolute value of all voltages is close to 1 p.u. While the second assumption may not be very realistic for heavily stressed distribution systems, the main focus here is not accuracy per se, but rather to get an indication of the system's behaviour so as to estimate the SL pattern. The indication is considered sufficient to make the required decisions: Finally, to make the problem fully MILP, constraints (38) and (39) are relaxed by adopting a linear version of power flowonly limit for both lines and transformers (45). Adopting a power flow-only constraint for branches is a common research approach. Despite this constraint being (in general) more conservative, it is reminded that the focus is on getting proper indications of the system's behaviour, which is assumed to be sufficiently achieved: In short, instead of solving a large MINLP problem that includes the cumbersome continuity mandate, we solve an iterative MILP problem of ever-decreasing complexity (the number of binary variables is drastically reduced per iteration), where the continuity mandate is implicitly enforced. From that point on, all binary variables have been estimated; a one-time NLP MP-OPF is finally solved to determine the settings of the remaining FRs.

A simple illustration
To illustrate the application of the SL pattern estimation algorithm, a simple example is presented, of an imaginary SL with CT = 4, which normally operates between periods t 8 − t 11 . The algorithm application is presented in Figure 1, and the process hereby explained. At iteration 1, t 11 is deemed as the most critical period for the SL to operate (fixed for next operation). The SL's commitment cost is not yet active, given that the SL could still, in theory, end up operating between t 8 − t 11 . For the next iteration, given that CT = 4, the possible operating range is t 8 − t 14 . For iteration 2, t 13 is deemed as the second most critical period. t 12 is also automatically fixed, given that the SL must operate for consecutive periods. The commitment cost is also activated, given that the SL is guaranteed to be shifted. For iteration 3, t 14 is deemed as the fourth and final most critical period. With the four consecutive SL operating periods having been determined and the commitment cost having been activated, the subsequent NLP problem is solved with the SL's operation fixed between periods t 11 − t 14 .

Test systems, FRs and controllability scenarios
The proposed approach is tested on modified versions of the benchmark CIGRE 18-node (5 customer nodes) LV feeder [27] ( Figure 2) and of a real 308-node (23 customer nodes) UK feeder [28]. The former is used for proof-of-concept validation and the latter for tractability evaluation. The feeders host four different modern customer types: 1. Customer with high load flexibility (node 18): This customer invests in state-of-the-art devices, being equipped with an FL and an SL. It can offer a wide range of decisions with respect to consumption pattern modification.

Customer investing in rule-based sustainability (node 11):
This customer is environmentally conscious and follows an intuitive self-sufficiency strategy, charging an ESS during  For all individual FRs, the profiles presented in [3] are adopted, though the rates of loads and PVs are scaled up to better demonstrate the different flexibility scenarios. The main device characteristics are available in Table 2. For SSBs, the EMS coordinates the behaviour of all internal devices in order to achieve their yearly nZE mandate. The daily SSB profile is completely derivative of its yearly profile. For simplicity, but without loss of generality, a random value is chosen per period, following a normal distribution with = 0.1 kW and = 0.6 kW (nZE). For the 308 node the percentage distribution of customer types is equal and random.
Different flexibility scenarios are examined, where the DSO's range of controlability progressively expands to include more FRs or greater FR control. The different scenarios are available in Table 3. These are representative flexibility scenarios; other combinations can however be devised.
The voltage at the feeder head is kept steady at 1.05 p.u. (a common industry practice). The conditions are representative of systems with very high penetrations of the studied technologies. Having said that, it should be stressed that we do not go for a purposefully bad system design. The MINLP, MILP and NLP   problems are solved by BONMIN [29], CBC and IPOPT [30], respectively, in GAMS [31]. The default solver characteristics were kept intact. All simulations were performed on a PC of 2.7-GHz and 8-GB RAM.

18-node feeder
The maximum and minimum voltage profiles across the network are presented in Figures 3 and 4  system is not designed to accommodate high penetrations of residential DER.
As more FR controllability is added, the severity of voltage issues decreases, and the impact on the voltage profile across the network is contained. This can be seen in Figure 5, which presents the total daily voltage violations. Increased load controllability (S 2 ) mitigates undervoltages almost entirely and also slightly reduces overvoltages. Allowing for PV curtailment (S 3 ) is clearly a not-desirable method of eliminating overvoltages. A combination of the measures above proves very effective (S 4 ), though PV curtailment remains a necessity. ESS do achieve some improvement (S 5 ), though their impact is limited (remember that by default they already 'counter' most of the PV production by customer design, so the DSO cannot alter much). Finally, when all FRs work in unison (S 6 ), all voltages issues are eliminated, avoiding all PV curtailment and achieving a daily improvement of 1.82 p.u. and 2.79 p.u. in combating overvoltages and undervoltages, respectively.
The various flexibility utilisation costs are presented in Figure 6. Clearly, when the system is left uncontrollable, the operational issues are extremely heavy (slack violation cost-SV = 2308 € ). All flexibility scenarios achieve promising improvements, except for S 5 (SV = 1248 € ), due to the ESS profile being heavily restricted by customer decisions. An interesting observation that FRs with otherwise high, one-time commitment costs (e.g., SLs, EVs) are very effective in mitigating operational issues, by both alleviating consumption-heavy periods and 'filling' production-heavy periods. This makes them very cost-effective. They are however somewhat limited by their customer-driven 'no work' time-frames. FRs that are traditionally considered good options (e.g., ESS) can be heavily impacted by customer-driven decisions. When all FRs are combined (S 6 ), some are not utilised at all (FLs, ESS), or provide some cost-effective service (PV) reactive management. Another interesting observation is that scenarios with SSB involvement (S 4 , S 6 ) have very low violation costs, with SSB costs being close to zero. This is despite the fact that SSBs provide extensive local support.
Lastly, the behaviour of ESS (state of charge) and SSB (active profile) for the various scenarios are presented in Figures 7  and 8, respectively. Some interesting observations can again be made. First, for ESS, while the charging intensity is increased in the afternoon, the remaining differences between scenarios are not significant. As was mentioned, the ESS profile is already restricted by customer-driven decisions, and as such, the DSO has very limited options. Second, for SSBs, they have a very active participation in managing operational issues. In fact, the provided SSB support achieves (on average) an increase of onsite production, increasing the 'greenness' of the building even more. The SSB flexibility cost is very small (due to the energy neutrality mandate), while the provided support is very effective (see Figure 6). While not shown, SSB nodes are amongst the least stressed customer nodes. The combination of all above observations clearly support the adoption of more SSBs in distribution feeders.

308-node feeder
For the sake of space, only the various flexibility costs per scenario are presented for the 308-node system (see Figure 9). Note that the presented results for the MINLP scenarios S 2 , S 6 have been obtained using the proposed solution approach. It should also be pointed out that despite the seemingly very large violation costs, the 'normalised' operational issues (per node) are comparable to those observed for the 18-node system. The higher costs are the expected consequence of dealing with larger systems. The similarities with the results of the 18-node system are staggering. First, the exact same scenario cost order is observed for both cases. On top of that, the utilisation of each FR (per scenario) appears to be very similar across systems. The one difference appears in S 6 , where contrary to the 18-node case we do observed PV utilisation costs. While the reactive capabilities of PVs are once again fully utilised, this time they are insufficient in containing overvoltages. As such, the DSO must also engage in slight PV curtailment. It is important to understand that in the smaller system all FRs were closely located and could support each other much better. In larger systems, the location of each device has a much larger impact on how operational issues are distributed and on how well each FR can compliment each other.
Two observations for the 18-node system seem to be repeated here. First, the ESS are not as effective as they are usually reported to be. This is because, again, the customerdriven decisions place significant restrictions on the DSO's control and as such the flexibility support is somewhat limited. Furthermore, scenarios that involve SSBs have very low costs, with SSBs once again being very cost-effective and excellently regulating neighbouring nodes, providing very good local support. The final important observation is that, in the end, even this large and, initially, very highly stressed system (for S 1 SV = 66,709 € ) has virtually no operational issues when all FRs are employed in unison.

Individual FRs congestion management potential
On top of the representative scenarios, additional, 'extreme' scenarios are proposed to explore the full flexibility potential of individual FRs, under conditions that provide the DSO with unrestricted planning freedom. The intent is to explore the extent to which individual FRs could, under such ideal conditions, contribute to the management of operational constraints in LV networks that are heavily loaded with an extensive range of devices. The following 'extreme' scenarios are examined (a single controllable FR): • S pv : The DSO has absolute controllability over PVs and can curtail as much production as deemed necessary. The available reactive power support range is extended. • S ev : The DSO has absolute controllability over EVs and can define their charging from scratch. • S fl : The DSO has absolute controllability over FLs and can modify them as in whatever way is deemed necessary. • S sl : The DSO has absolute controllability over SLs and may shift their operation to any time range. • S ssb : The DSO has absolute controllability over SSBs and can modify their profiles as deemed necessary. The environmental constraints (daily energy neutrality) are also lifted. • S ess : The DSO has absolute controllability over ESS and define their charging and discharging profile from scratch.
Since each scenario represents 'extreme' conditions within the DSO-customer collaboration framework (full controllability of a single FR), the defined pricing schemes (see Section 2) may be too crude for the solution to have sufficient meaning from a financial perspective. As such, in the above scenarios, all flexibility costs are ignored, with only the import/export cost and the violation penalties maintained. Since these scenarios apply under different assumptions than the representative scenarios, a direct comparison would not be meaningful.
The purpose of this approach is to get an understanding of how effective each FR is in containing violations at a local and at system-wide level. This information can prove valuable towards the transition to DSO-customer collaboration frameworks (such as the one described here) and in designing more comprehensive and fair pricing schemes for individual FRs, depending on their performance (with respect to flexibility provision).

18-node feeder (extreme scenarios)
The violations and solution times for the extreme scenarios of the 18-node system are presented in Figure 10. The brown bars represent the system-wide technical limit violations (with respect to those recorded in S 1 ) and the blue bars represent the violations that correspond to the nodes that host the controllable FRs (with respect to S 1 ). As expected for smaller-scale systems, the unrestricted controllability of individual FRs significantly contributes to the management of constraints violations. System-wide violations are reduced from 40% by up to 80%. Nodal violations follow a similar, yet slightly more favourable trend; their reduction ranges between 40% and 98%. The impact of FLs and ESS at smaller-scale systems (where device proximity plays a major role) is significant. Contrary to other FRs, they can increase/decrease their demands unrestrictedly and throughout the entire optimisation horizon (neither FRs is bound to time-related or weather-related events, ESS have much more freedom in re-scheduling their profiles than EVs). One aspect not directly shown but worth stating is that the performance of individual FRs is also directly correlated to their actual impact on the system. For example, standalone PVs, EVs, and FLs are the causes of most operational issues, hence they have a high flexibility potential by default. FRs such as SSBs on the other hand are much more grid-friendly (much lower local stress) by design. They cannot, however, counteract every other device on the system on their own. This is further indication that the coordination of multiple FRs is a necessity.
The solutions times are consistently low, averaging at less than af second (as expected based on the system size). The sole exception is the S sl scenario, that requires about 7 s to solve (MINLP problem). However, when the proposed approach for handling SLs is employed (consecutive MILPs + NLP), the solution time is reduced by 68%. In comparing the MINLP and the proposed approach, the objective functions and operations of SLs are identical.

308-node feeder (extreme scenarios)
The violations and solution times for the extreme scenarios of the 308-node system are presented in Figure 11. The situation for larger-scale systems is somewhat different, as compared to

FIGURE 11
Violations management under extreme scenarios (308 nodes) the 18-node case. The reduced proximity of customer nodes results in different observations for certain FRs. Some FRs such as SSBs and SLs demonstrate similar behaviour, reducing by about 20% the already few operational issues on a local level (though their impact on a system-wide level is somewhat limited). FRs such as EVs and ESS cannot effectively cooperate with distant nodes and even though they engage in significant re-scheduling, their flexibility contributions are limited (about 5-10% for system-wide and local issues for EVs, about 60% for ESS). FLs face the same issues, and even though their flexibility contribution is non-negligible (about 60%), it is not as significant as for the 18-node system. Despite facing the same issues, PVs demonstrate impressive results, achieving a 95% reduction of operational issues, with S pv proving the second most effective controllability scenario (second only to S 6 ). However, said effectiveness is based on extensive curtailment of active power and the saturation of reactive capabilities at almost all periods. In short, the only way for PVs to be effective on their own is for them to essentially behave as synchronous capacitors.
Regarding the solution times of the problem, they are generally low (averaging at about 40 s) despite the system size. This is due to the small number of controllable elements per extreme scenario, which significantly reduces the complexity. The slowest case (about 80 s) is the S ev scenario, which includes both inter-temporal constraints and the highest violations; higher system stress tends to translate to slower solution time. Despite SLs being the only controllable FR, in the S sl scenario, no solution is returned even after an hour (in fact, approximately 2.5 h are required for a solution to be returned), owing to the number of binary variables (144). When the proposed approach is employed, the solution time is approximately 50 s, rivaling that of the remaining NLP problems. In comparing the MINLP and the proposed approach, the objective functions and operations of SLs are once again identical, further highlighting the effectiveness of the proposed approach.

Comparison with local controls
Finally, for comprehensiveness, a comparison between the proposed centralised approach and a simple local approach is performed. While there is no universally accepted optimal local control strategy for any device (highly system dependent), especially when multiple devices interact in the same node strategies: PVs adjust their power factor based on generated power [19], EVs adjust their charging based on nodal voltage sensitivities [32], ESS adjust their charging/discharging based on their specs and net nodal demand [33]. PVs react before ESS and EVs. • L 2 : Similar to L 1 : PVs adjust their curtailment based on their nodal voltage [19]. • L 3 : Similar to L 1 ; PVs react after ESS, EVs.
At this point, it is worth stating that, from a holistic perspective (infrastructure deployment and application of optimisation scheme), the costs of centralised optimisation may or may not be higher than that of local control. However, this is difficult to quantify at the moment, given that LV networks are not currently facing extensive issues in voltage quality or very high penetration of FRs. The hosting of an ever-increasing number of 'active' customers is foreseen for the years to come, and as such, much higher degrees of oversight may be required than those provided by local control schemes. Besides, the increased involvement of system operators at the LV level is one of the visions for the future smart grid (see, e.g., [34]). In that light, we re-state that all the necessary tools and regulations required to centrally supervise the system described setup have already been established and are considered as the norm for future LV networks.
The comparison between the centralised approach and some standard local control approaches are presented in Figures 12  and 13 for the 18-node system and 308-node system, respectively. Across both networks, consistent observations can be made. From the five approaches examined, the centralised approach has the lowest objective function cost, 'beating' all local approaches by significant margins (for reference, the most successful local approaches have 65% and 8% higher costs). Apart from having the lowest total costs, the centralised approach also has the least violations in most cases. On the few occasions when the local approaches produce less total violations, the expenses for procuring flexibility are extensive (usually more than double of the ones observed in the centralised approach), throwing into question the long-term financial sense of utilising flexibility through standard local control schemes.
The above observations are consistent with the generally accepted weak points of generic local control schemes (that are not adjusted to the needs of the networks through machine learning). PVs are very sensitive to changes in produced power or voltage, usually overreacting in their response and being used inefficiently. The behaviour of ESS is highly tied to that of PVs, meaning their operation is either negatively impacted (if ESS react after PVs) or having very low correlation with local operating issues (if ESS react before PVs). Designing local controls for EVs is already challenging enough, given that a specific state of charge must eventually be reached. The employed local scheme does alleviate stressful periods for the network, but most of that stress is effectively shifted to different hours of the day, resulting in minimal gains from a holistic perspective. The issues described are further aggravated by the fact that multiple FRs are connected to the same node. Without some highly sophisticated scheme that dictates their synergy, designing an effective reactionary scheme is very challenging. In short, while local schemes may be easier (and faster) to implement, unless they are adjusted to the specific requirements of the network, they still leave a lot to be desired.

Computational effort
The main characteristics of the original optimisation problem (no simplifications) are available in Table 4. For the small system, the NLP problems perform well, providing quick solutions, as expected for problems of these size. The MINLP problems (S 2 , S 6 ) are inherently less efficient, as expected. The story is a bit different for the larger system. In this case, there are  some scenarios that scale quite well and others that require more time than would be desirable. The MINLP scenarios fail to return a solution within 1 h. The above are somewhat expected and can be attributed to the large number of binary variables (shown in parentheses Table 4) and the increased complexity introduced by temporal constraints and the modelling of the novel commitment costs, which require several barrier functions (prone to numerical instability [20]). It is important to understand that the current stage of the work is exploratory, the goal being for the developed tool to provide some insight to the DSO on the performance of various flexibility schemes. Hence, despite the good performances of the original formulation (for NLP problems) and the proposed solution approach (for MINLP problems), it should be re-stated that tractability on large-scale systems is not the primary concern.

Evaluation of SL management approach
The proposed SL management approach is applicable to scenarios that involve load shifting as a flexibility option (S 2 , S 6 ). Its main focus is obviously the larger test system. However, even for the 18-node feeder, the approach demonstrates its effectiveness. For both scenarios in question, the exact same objective value is calculated, requiring five iterations in total for the SL estimation and the final NLP problem. Furthermore, if the total times per iteration are added up (Table 5), the total solution times for S 2 , S 6 are reduced by 48% and 74%, respectively (when compared to the original centralised solution times). To recapitulate, instead of solving the full MINLP problem (full energy mandate and continuity mandate), we instead solve an simple, iterative MILP problem (linearised power flows, relaxed energy mandate, no continuity mandate) of decreasing complexity per iteration (as dictated by the decreasing number of binary variables per iteration). For the 308-node feeder, the proposed approach has increased importance due to the general intractability of the MINLP formulation. Again, five iterations (this is completely by chance) are required to calculate the final approximated solution. While the full MINLP did not return any solution after the 60-min mark, the proposed approach returned an estimated solution after 193.7 and 211.7 s for the two scenarios, respectively. While there is no benchmark against the MINLP case, judging from the 18-node case (exact same objective value for the two scenarios), the proposed approach is assumed to have performed within expectations. In conclusion, when studying very complex flexibility utilisation problems in large systems, MINLP problems are non-viable options. The proposed approach estimates the patterns of SLs in a simple and effective manner and returns an acceptable solution within a reasonable time-frame.

CONCLUSIONS
This paper presents a novel, generic, and versatile MP-OPF framework including various residential flexibility resources (FRs) which can easily be incorporated into flexibility schemes.
Although not the primary goal, attention has been paid to modelling aspects that keep the MP-OPF model tractable, in most cases the optimisation problem boiling down to a nonlinear program (i.e., when SLs are not a controllable FR). In cases where shiftable loads are present, we proposed an original heuristic algorithm to solve the resulting MINLP MP-OPF problem in an accurate and tractable manner, that returns feasible solutions. For any distribution system setting, the developed model can assist a DSO in understanding the potential of each FR in contributing towards managing operational constraints.
The presented work addresses a timely issue, within a setting where the DSO usually has very limited controllability over the LV feeders. The developed model aims at achieving costoptimal operation by considering practical issues such as limited FR controllability, or minimising 'disruptions' of the customerdesired operation of each device. It is shown that through various forms of cooperation with the customer,for example, 'sharing' of available storage, acceptable operating conditions can be maintained without the DSO having to install its own devices in the system (which is often technically and legally cumbersome). The numerical results also show that for feeders with large penetration of DER, all potential sources of flexibility have to be mobilised to combat operational constraints and reliable operation conditions cannot be achieved without PV curtailment. As all FRs primarily evolve around altering the active power injected into (or withdrawn from) the grid, their technical efficiency is rather similar, depending only on their relative location. This supports establishing a cost-based priority list by the DSO, as postulated in this work.