Active Distribution System Management: A Dual-Horizon Scheduling Framework for DSO/TSO Interface Under Uncertainty

Active distribution system management (ADSM) aims at optimally operating distribution network assets with a high penetration of distributed energy resources (DERs) while taking into account operational uncertainties, market constraints, and scheduled power flows at the interface with the transmission system. A novel framework for ADSM, which incorporates a dual-horizon rolling scheduling model based on dynamic ac optimal power flow, is proposed in this paper. In the first stage (planning), energy import/export is committed for given times ahead at the grid supply point considering local variable generation and load forecasts. At the second stage (operation) deviations from the schedules are minimised by controlling various assets and DER, including electrical energy storage (EES). We demonstrate how crucial it is to properly consider uncertainties (for instance, associated with forecasts) over different time scales. Case study results on a real U.K. distribution network show that the proposed ADSM approach can provide credible operational strategies to maximise renewable penetration, minimize deviations from time-ahead schedules, and estimate the required level of local reserves from dispatchable generation and EES while realistically accounting for uncertainty. The framework and model formulation proposed can thus be seen as a key tool to facilitate the transition from distribution network operators to distribution system operators and their interaction with transmission system operators.


I. INTRODUCTION
ISTRIBUTION Network Operators (DNOs) are facing multiple challenges in the transition to Distribution System Operators (DSOs). In fact, traditionally DNOs have been managing a largely passive network where demand is inflexible and Distributed Generation (DG) is operated with a fit-and-forget approach. Conversely, DSOs are expected to manage active networks supporting local balancing and actively interact with Transmission System Operators (TSOs), carrying out optimisation policies of the available DER and controllable network assets while preserving system integrity This work has been supported by the Engineering and Physical Sciences Research Council (EPSRC) through the HubNet programme (EP/I013636/1).
A. Saint-Pierre and P. Mancarella are with the School of Electrical and Electronic Engineering, The University of Manchester, Manchester, UK (email: {adrien.saint-pierre, p.mancarella}@manchester.ac.uk). and stability. Therefore, new operational options to exploit the required flexibility, the increased TSO/DSOs/market coordination, and the preventive instead of corrective actions that will be available in Active Distribution System Management (ADSM) [1] have to be investigated.
More specifically, in the future, an increasing number of generating units connected at the distribution level are expected to participate in the day-ahead and intraday markets. ADSM and new business arrangements will then be key to providing flexibility for DSOs to facilitate DG owners' market participation, and comply with agreed market commitment schedules. At the TSO/DSO interface, knowing in advance the expected flows would in turn also facilitate TSO's provision of system balancing and security services. In this sense, optimising the operation of the local network, quantifying the flexibility available at the distribution level, and forecasting local consumption and production, are key tools for short-term operational planning for both more active distribution systems and the transmission system. To operate this transition, a decentralised architecture where the power system is divided in distribution grid areas is for instance presented in [2]. The philosophy is that each distribution area should provide local balancing and voltage control with the purpose of solving problems locally, without affecting negatively the upstream transmission system and even facilitating the TSO's operation, as aforementioned. Each area would then be responsible for local reserves' activation as well as dispatch, assuming similar responsibilities to the TSO. This approach could also help reduce losses as well as mitigate congestion problems more efficiently, enabling a more optimal use of the local resources. Finally, the relatively small size of grid areas would allow practical optimisation control strategies, which would not be computationally affordable under a complete TSO control.
Since distribution networks were designed to be operated in a passive fashion, the radial topology typically encountered at medium and low voltage levels may not provide a comparable level of flexibility to reroute power flows as found in meshed network, thus requiring a careful control of power flows and voltages.
In recent years, different approaches have been investigated such as locational marginal pricing congestion management [3]  D cost of operation, network losses, or penetration of renewables [4]. For instance, in [4] [5] OPF-based techniques are used to evaluate the network capacity to connect DG at distribution and sub-transmission levels. OPF formulations can also be found extensively in energy management systems [7]- [9]. In [10], a Dynamic OPF (DOPF) problem is developed for active network management with wind power, considering intertemporal constraints arising from electrical energy storage and managed flexible demand. In [11], a DOPF formulation is used to schedule available DER 24h-ahead and with different spinning reserve levels based on their location. In [11][12], a DOPF model is used to optimise the control strategy for electrical storage in the presence of renewable generation. Generally, inter-temporal constraints are well handed by these DOPF formulations and while being difficult mathematical problems, the generality and flexibility of their formulation makes them very powerful tools. However, the use of time series for DER scheduling and network assets control in the presence of variable generation may not be adequate to deal with the intrinsic uncertainty. In fact, the time-series based models discussed in the literature do not assess the quality of their proposed strategies as they assume "perfect information". It is then fundamental to go beyond addressing uncertainties in a comprehensive manner, by also assessing the performance of the model as these uncertainties unfold. In [14] and [15], a rolling approach for Unit Commitment (UC) is used to evaluate the flexibility and reserve requirements in windpower rich systems, but the intra-hour variations of wind and demand are not considered. A stochastic programming approach is also frequently adopted for UC problems in presence of wind such as in [16] but it may be impractical for computational reasons when including networks, especially when a full AC formulation is needed. At distribution level, [17] presents a two-stage planning and real-time control ADSM model for LV networks, which focuses on the control of thermostatically controlled loads and Electrical Energy Storage (EES). However, the RES penetration level is low and no potential export to the upstream grid is considered, hence limiting significantly the scope of and need for managing impact of uncertainties in planning and operations. Based on the above, this paper introduces a novel Dual-Horizon Rolling Scheduling framework for ADSM based on a Dynamic AC OPF formulation. The model addresses fundamental issues in the treatment of uncertainties when loads and RES forecasts are involved. The Dynamic AC OPF formulation used at both stages, namely "planning" (e.g., 24h ahead with 1h resolution) and "operational" (e.g., 4h ahead with 15min resolution) stages, is capable of modelling network constraints with accuracy. In addition, the dualhorizon formulation allows proper controlling of intertemporally constrained technologies such as EES. Finally, the dual-horizon formulation offers the advantage to plan operations realistically, as the performance of the planned schedule is assessed in the operational stage. In fact, as aforementioned, DSOs will be expected to be able to balance and optimise networks locally and actively interact with TSOs. The estimation of their balancing capability under different levels of local reserves and different time scales to cope with relevant uncertainties (of variable renewables, in particular) is of paramount importance. In this light, the model proposed here is formulated so as to commit the energy delivered at each time step at the upstream Grid Supply Point (GSP, representing the interface with the transmission system) ahead of delivery (e.g., day ahead) and then to minimise the deviation from the commitment in real time. This approach allows taking full advantage of the flexibility offered by the combination of the different controllable DERs and network assets under uncertainty over different time scales and paves the way to practical techno-economic arrangements that are expected at the TSO-DSO interface.
The paper is structured as follows. Section II discusses the different aspects of the proposed flexible ADSM model with an emphasis on the treatment of uncertainties, as well as the rolling dual-horizon stages. Section III describes the corresponding Nonlinear Programming (NLP) formulations of the planning and operational problems. Section IV presents the results of the model applied to a real UK medium voltage distribution network with wind power, dispatchable DG, EES, reactive power compensation, and on-load tap changer (OLTC) transformers. Case study applications analyse the impact of considering different planning horizons as well as different levels and technology providers of reserve (including EES). Section V concludes the paper.

A. Dealing with Uncertainties
In order to perform operational simulation and optimisation, most studies use simple time series to represent data varying over time (see for instance [18]). However, as much as they provide useful information from a statistical point of view, this approach assumes knowledge of perfect information, which can be very unrealistic in the case of variable and unpredictable renewable energy sources. Consequently, they are not well suited for real-time operations and control strategies. If forecasts are used as an alternative, the longer the forecasted period is, the worse the prediction usually gets and the difference between expectation and realisation increases. As an example, Fig. 1 depicts the 24h-ahead (15min resolution) expected power output for a 15MW wind farm as from [15][16] 1 , along with maximum expected forecast errors based on a 3σ rule (i.e., 99.7% of the values lie within three standard deviations if assuming a normally distributed wind speed error). If the forecasted power output was underestimated, in the worst case, wind could simply be curtailed. However, if the forecasted output were overestimated, the system would face a lack of planned power injection and need to react consequently.
Generally speaking, however, the error of prediction on the power output can remain relatively low and manageable, even for a 24h horizon. Therefore, having a look at the error of prediction on the energy production can give more insights into the importance of forecasting accuracy for RES. In this respect, Fig. 2a shows the actual wind power generated by a 15MW wind farm over 24 hours with a 15min time step against a typical 24h-ahead forecast. Fig. 2b shows the prediction error for the same case and, it can be observed that, while the absolute error does not exceed 5 MW, the cumulative error of prediction reaches 37.97 MWh for a total wind power generation of 109.45 MWh (34.7% error). Fig. 3a and Fig. 3b only differ from Fig. 2a and Fig. 2b by the length of the forecast horizon, which is then 4 hours. It can be observed that the error barely exceeds 2 MW where the cumulative error drops down to 12.86 MWh (11.7%). Based on this, it appears crucial to analyse the consequences of different time horizons and reserve requirements for network planning and operations, as well as to understand which decisions have to be made on both "short" ("operation") and "long" ("planning") term horizons. This applies especially in the presence of inter-temporally constrained devices such as EES, and with the aim of facilitating a smooth interaction between DSO and TSO.  In this paper, a relatively simple and efficient way of representing these uncertainties is introduced. Considering day-ahead operations, 24h-ahead forecasts are used to predict loads and wind power knowing their intrinsic limitations in terms of accuracy. The load forecast is updated once every 24h and the wind power forecast is updated at every time step of the simulation (i.e., one hour for planning, 15min for operations), thus feeding the model only with the most up-todate information. Using a constantly updated rolling forecast is efficient and pragmatic, as it feeds the problem with solely the best real-life available information, leading eventually to more realistic results compared to the "perfect information" approach.
One of the main benefits of such a dual-horizon ADSM is to assess the impact of uncertainties on the control strategy. Any source of uncertainty can be incorporated within this methodology as long as it can be represented as forecasts and realisation time series. In the case of photovoltaic generation embedded in the LV network, for instance, adequate forecasts should be adopted and its controllability should be reflected accordingly as it may lay outside of the DSO control. However, the rationale behind the "short" and "long" term horizons is valid independently of the event forecasted as the different sources of uncertainties are integrated at their own relevant time scale.

B. Algorithm for Dual-Horizon ("planning" and "operational" stages) Rolling Scheduling for ADSM
Inter-temporally constrained technologies such as dispatchable DG or EES, as well as control equipment such as OLTC or VAR compensation, call for different operation and optimisation timescales ranging from minutes to hours. This, together with the fact highlighted above that uncertainty increases with the prediction horizon, leads to considering a multi-horizon approach to ADSM. More specifically, a dualhorizon scheduling formulation applied to distribution systems is proposed here, whereby the problem is decomposed in two stages, namely, a "planning" stage and an "operational" stage. The rationale behind the dual-horizon approach is to plan dispatch (so as to facilitate possible techno-economic arrangements at the TSO-DSO interface) and then control network operations accordingly on a rolling basis. Adopting this approach gives the opportunity to model future network operations and market arrangements with accuracy while integrating the abovementioned technologies. As shown in Fig. 4, the planning model "commits" the generation import and export at the upstream GSP based on the states of the different network assets and DER forecasts on a "long-term" basis according to possible market arrangements. The operational model then "dispatches" the system on a rolling "short-term" basis minimising the deviation from the commitment proposed at the planning stage. Both planning and operational problems are constantly fed with the most upto-date information at the relevant time resolution, as discussed in the previous section. To exemplify the proposed approach, in this paper the planning phase is run on a dayahead basis with a 1h resolution to represent a typical market setting. The operation phase is run on a rolling 4h-ahead basis with a 15min resolution to properly capture the intra-hour variations while keeping sufficient accuracy regarding the forecasting horizon. The rolling operation phase is of paramount importance, as it assesses the feasibility and performance of the proposed planning strategy as uncertainties unfold. It is worth mentioning that planning and operation horizons and resolutions depend solely on the problem modelled, and do not affect the generality of the formulation.

C. System reserves
Reserve needs to be considered at the planning stage to overcome potential shortage of available power from intermittent generation when the objective is, for instance, to minimise energy import at the TSO-DSO interface 2 . In particular, since RES and load forecast errors can be estimated over time, reserve needs to be dynamically calculated as a function of these forecast errors. It should be emphasised that different forecasting approaches will have different error distributions (not necessarily following a Gaussian distribution) and should be integrated accordingly into the reserve calculation. In order to mitigate these errors, dispatchable DG and potentially EES may offer the advantage of being available at any time provided that reserve is adequately scheduled, ramping capabilities are properly taken into account, and EES energy content is properly estimated (in particular, see Section IV.E for EES reserve studies).

D. DER and active network assets 1) Distributed Generation (DG)
There may be several DG technologies connected at distribution networks (and MV in particular, with capacity generally in the order of some to tens of MW), such as onshore wind, medium-scale hydro, industrial and district heating combined heat and power, large photovoltaic farms, and so on. DG sources may be considered dispatchable (in terms of active power output) in the case of conventional generation, and mostly non-dispatchable in the case of variable renewables. Reactive power control can also be considered to different extents for both technologies depending on electric generator characteristics and the network interface (e.g., inverter capability and so on).

2) Electrical Energy Storage (EES)
EES is likely to become a fundamental component of distributed energy systems and, particularly, in presence of variable generation. The most common EES is based on battery technologies whose main characteristics reside in their energy capacity, power ratings, storage periods, and process efficiency.

3) Hybrid Volt-Var-Watt voltage and power flow control
In networks with increasing DG, the voltage profile is substantially affected by the often highly variable local generation. Focusing on MV networks, they are typically connected to HV networks through a transformer (possibly equipped with an OLTC device). In addition, a wide range of reactive compensation devices ranging from bank capacitors to Static Var Compensators (SVCs) can be used to improve the voltage profile. Hence, "hybrid" coordination of OLTC's set points, SVC's reactive power output, and DG's MW and MVar outputs [21] are features that are expected in ADSM schemes to deal with local power flow balancing and voltage regulation. In the proposed model, coordination of all available controllable DER and network assets are considered at both planning and operational stages.

III. ADSM PROBLEM FORMULATION
A. Dynamic AC Optimal Power Flow for ADSM As elaborated above, the focus of the proposed ADSM model is to simulate steady-state operations over different time scales and account for relevant inter-temporal constraints. The model is based on a Dynamic AC OPF (DACOPF) formulation to be able to handle radial MV distribution networks 3 . It is assumed that the three-phase distribution system is reasonably well balanced and can be reduced to its single-phase equivalent where the standard π line model is used (in the case of 3-phase imbalances, the DACOPF formulation would have to be updated without affecting the generality of the framework). As the DACOPF seeks to find the optimal control policy not only for individual steps' setpoints, but also for an inter-temporally constrained sequence of operations, the problem shares properties of both classic OPF (as network constraints are accounted for) and scheduling or generation scheduling (as inter-temporal constraints and cost characteristics are accounted for) formulations. In the formulation illustrated below, control options are evaluated and optimised while taking into account network and inter-temporal constraints. Therefore, the same DACOPF algorithm can be used indifferently for both planning and operational stages, while only objective functions, control options (decision variables in the optimisation problem), and of course time scales (horizons and resolutions, indicated in the following formulation as T and t, respectively) differ. In the following formulation, the subscript denotes the subset of planning stage variables and the denotes the subset of operational stage variables. When none of these subscripts are used, that constraint holds for both planning and operation, where only horizon and resolution differ. Planning and operational stages' objective functions

1) Planning stage
In the planning problem, the system is optimised taking into account long-term forecasts. The planning phase is based on the complete DACOPF formulation. This approach, while more complex than a scheduling problem without network constraints, enables proposing a credible long-term strategy at the planning stage. In this work, the objective function (1) minimises the import of electricity at the grid upstream connection point: where denotes the subset of planning stage variables, is the time index (1h resolution), is the time horizon (24h ahead), denotes the bus index, and is the vector of decision variables for the planning stage, , , , , and , , , define the GSP, DG and RES active and reactive power, , , defines the EES charge/discharge, , , defines the reactive power from compensation devices, and , , defines the tap position of OLTC on branch . This objective function corresponds to seeking the minimisation of electricity import and to export electricity, if possible. However, alternative objective functions could readily be considered too (and our model is totally flexible to do so), in the light of possible arrangements between TSOs and DSOs and development of the DSOs' activities and business [22].

2) Operational stage
The operational phase optimises the system taking into account both short-term forecasts and the planning policies suggested in the long-term. The operational phase is also based on the complete DACOPF formulation. The objective function (2) minimises the deviation from the import-export commitment at the upstream level proposed at the planning stage: where denotes the subset of operational stage variables, is the time index (15min resolution), is the time horizon (4h ahead), and is the vector of decision variables for the operational stage, , , , , , , , , , , , , , define the GSP, DG, and RES active and reactive power, , , defines the EES charge/discharge, , , defines the reactive power output from compensation devices, and , , defines the OLTC tap position on branch .

B. Problem constraints 1) Power Flow Equations
Equations (3) and (4) define the active and reactive power flow balance where , and , represent the net active and reactive load demands respectively. , , , , , , and , represent the voltages and angles at bus and . , , and , , are the admittance and susceptance matrices, whose formulation (not detailed for brevity) can be found in [23]. , represents the apparent power on branch at time . Equation (5) and (6) , ≤ ,

2) On-Load Tap Changers
The position of the taps for each OLTC transformer is optimally set during both the planning and operation optimisation phases (assumed here as continuous variable as commonly used). Equation (7) sets the limits for the tap positions.
, is included in the formulation of admittance and susceptance matrices.

3) Reactive Power Compensation
The quantity of reactive power delivered by the available compensation devices is calculated optimally. Equation (8) sets the limits for the inductive or capacitive reactive power delivered.

4) Dispatchable DG
The amount of electricity delivered by dispatchable DG can be adjusted within operating limits. Equation (9) defines the electrical power output constrained with reserve at the planning stage. Equations (10) and (11) set the electrical generating limits. Equations (12) and (13) define the power factor limits and the ramping constraints, respectively.

5) Renewable Energy Sources
RES are modelled as non-dispatchable active power injections , , following a forecasted power output. The only control option is to curtail the amount of active power injected with respect to actual power generated , , , as shown in (14). Equation (15) defines the power factor limits.

6) Electrical Energy Storage
EES is considered as a load (with positive sign) or a generator (with negative sign) depending on its charging or discharging state, respectively, as defined in equation (16). Equation (17) and (18) set the limits for charging and discharging rates, respectively. Equation (19) sets limits on the minimum and maximum storage levels. Equation (20) allows setting an initial loading level. Equation (21) ensures the continuity of the state of charge (SOC) of storage through inter-temporal constraints, where ℎ and ℎ stand for the charging and discharging storage efficiencies. Using this formulation, charging and discharging states can mathematically occur at the same time. However, as the round-trip efficiency is smaller than one, an optimal solution will choose to either charge or discharge [10]. At the planning stage, EES may be allocated to reserve or used for energy balancing, depending on the strategy adopted (see below). Subsequently, at the operation stage EES is used for energy balancing, or to provide reserve if planned to do so.

7) Reserve
Reserve requirements are calculated at the planning stage based on the load and RES expected forecast errors (ε , , and ε , , , respectively) over the relevant time horizon. Reserve can be provided by dispatchable DG ( , ) assuming fulltime availability, as well as, in case, by EES too. In particular, three alternative formulations for provision of reserve are assessed in this paper, depending on the control strategy used for EES to provide reserve. More specifically, in (22.1) storage is not included in the reserve provision at the planning stage, and all the committed reserve is supplied by dispatchable DG. In (22.2), the EES is considered for reserve provision in terms of "available power" at time t, so that the required reserve is provided by the combination of the committed dispatchable DG and the power that EES can provide at time ; hence, in principle, all the energy available in the storage (EES SOC) could be used for reserve provision at time t, subject to the discharge rate limit , , ℎ , and a limit on minimum energy level in EES, , , . In (22.3), storage is again included in the reserve provision but with an emphasis on "available energy", whereby the total energy available in the EES is spread evenly over the remaining time periods of the planning horizon ; hence, only a share of the total EES SOC could be used for provision of reserve at time t, again subject to EES discharge rate and minimum energy level. Therefore, the reserve , to be provided by dispatchable DG in the three cases is expressed as

A. Case study description
The case study application used to demonstrate the proposed ADSM model consists of a real 11 kV mediumvoltage UK distribution network as shown in Fig. 5. The total nominal load of the network is 3.9 MW and 1.28 MVar. The system consists of the two wind farms, namely WF1 (bus 17) and WF2 (bus 21), and a dispatchable gas turbine (GT, at bus 3), which is also used for reserve. Reactive power compensation is installed at buses 17 and 21. EES is installed at bus 11. Table I shows the case study parameters. All input data for the following case studies can be found online for reproducibility purpose 4 .
Three case studies are analysed under different wind levels characterised by their capacity factors cf, namely: for low-wind, = 0.21 for medium-wind, and ℎ ℎ = 0.31 for high-wind. The following scenarios are considered in each case study: 1) Perfect information, Single Horizon: in this scenario, the import at the GSP is minimised over a week with perfect information for the wind power at 1h resolution. This corresponds to a single-horizon DOPF where uncertainties are ignored. Consequently, there is no reserve allocated, as there is no potential error of forecasting considered.
2) 24h-ahead commitment, Dual Horizon: in this scenario, the import at the GSP is minimised with 24h-ahead planning (1h resolution) and repeated every 24h over a week. The operation phase is run on a rolling 4h horizon at a 15min resolution minimising deviation from the objective set by the planning policy. As the scenario takes into account wind power and load forecasting uncertainty, four levels of reserve are considered, namely, no reserve, 1σ, 2σ and 3σ of the 24hahead forecasted value. These reserve levels are used to study the impact on both the energy import/export policy at the planning stage and the potential mismatches during the rolling operational stage.
3) 8h-ahead commitment, Dual Horizon: this scenario is similar to scenario 2, but the import at the GSP is minimised with 24h-ahead planning (1h resolution) and repeated every 8h over a week. The commitment period is therefore reduced to 8h-ahead as it allows quantifying benefits of more frequent planning with lower errors of prediction. The operation phase remains unchanged (rolling 4h horizon, 15min resolution). 4) 4h-ahead commitment, Dual Horizon: similarly to scenario 2 and 3, the import at the GSP is minimised with 24hahead planning (1h resolution) and repeated every 4h over a week. The operation phase remains unchanged (rolling 4h horizon, 15min resolution).   Fig. 6 shows the wind power generated by the two wind farms under the three wind levels over a week. Fig. 7 shows the weekly load profiles and day-ahead forecasts. The model is run for a one-week time window with the (20.1) reserve control strategy (i.e., EES does not provide reserve). The other reserve control strategies are investigated in Section IV.E. The problem is implemented in the optimisation programming language AIMMS and is solved with the interior-point solver KNITRO on a standard Intel Core i5 desktop PC. The average computational time is 210 seconds per 24h of simulation (this slightly varies depending on the inputs, especially the RES production pattern).

B. Load and Wind Power Forecasts
Individual residential LV loads have been generated and aggregated at each busbar [24], bringing realistic diversity in demand profiles. A load forecast was synthetized assuming the normality of errors for the day ahead with a 10% RMSE [25]. Fig. 8 shows the 24h-ahead aggregated load forecast for the MV network presented (15-min resolution) along with maximum expected forecast error based on a 3σ rule. The wind speed time-series for a single-location were generated following [26] and a stochastic wind speed forecast was synthetized assuming the normality and autocorrelation of errors over time (from 3% RMSE 1h-ahead to 15% RMSE 24h-ahead) [15] [21]. The wind speeds (actual and forecast) are then converted to wind power using an S-curve [28].

C. General results
As the planning stage finds the best possible strategy for a given horizon, and the operational stage finds the best possible control strategy to achieve it, when it is not possible for the operational stage to meet the goal set by the planning stage (e.g. minimise import), the quantified mismatch gives very valuable information about the performance of the system under uncertainty for different levels of reserve and different planning horizons. For instance, the optimal level of reserve to commit can be found for a given mismatch tolerance at the TSO/DSO interface, leading to more economic operations. Results for energy export at GSP, energy mismatch relative to the committed level, and wind power curtailment under the four different scenarios and for each of the wind case studies are shown in Table II with respect to the level of committed reserve. Results for energy produced (wind farms, dispatchable DG), consumed energy (loads, losses), energy exported, and energy mismatch are shown in Fig. 9. From Table II and Fig. 9, it can be observed that independently of the level of wind power generated, the dual-horizon scenarios are never able to match the "perfect information" scenario on the total energy exported and wind power integration, while suffering from energy mismatches with no or low levels of reserve allocated. Reducing the commitment period from 24h to 4h-ahead shows a net increase in the total energy exported, and a significant reduction of energy mismatch, as potential errors of prediction are less severe on a shorter term. The 24hahead and 8h-ahead scenarios see no mismatch from a 2σ reserve level upwards, and the 4h-ahead scenario from a 1σ reserve level upwards. Further, increasing the level of reserve beyond the "no-mismatch" point is not beneficial as both the levels of power exported and wind power injected decrease significantly. This demonstrates that a too conservative attitude towards the reserve sizing may degrade results significantly, as even the wind power injection is reduced. It is very important to note that the "perfect information" results differ more significantly from the "Dual-Horizon" results as the horizon increases; consequently, reducing the planning period reduces the need for higher levels of committed reserve. These results demonstrate the ability of the proposed approach to quantify the trade-off between the import minimisation strategy and the need for committed reserve.
Depending on the TSO's tolerance to mismatch, the most suitable level of reserve could therefore be scheduled. In addition, without loss of generality, and in the context of the general framework proposed here, other objective functions could also be considered, depending on the specific market arrangements that may be in place. One example could be minimising operational cost at the planning stage (i.e., when participating in the day-ahead market), and then minimising operational cost at the operation stage while applying a penalty for mismatch.

D. Case study temporal details
Several examples are provided in this section to demonstrate the capability of the model to capture the time series characteristics of the system operation. Fig. 10a shows temporal details of the power committed by the "24h-ahead Dual-Horizon No Reserve" planning for High-wind case day 3 (in dashed line), as well as the power delivered at the GSP from the rolling operations (in black). Since no reserve is committed, when shortage of wind power resulting from errors of prediction occur, the committed power cannot be delivered and the planned targets cannot be met resulting in a mismatch. Fig. 10b shows the planned and actual dispatchable DG production, as well as the wind power injected. Since no reserve is committed, the dispatchable DG is planned to be operating at full capacity. Fig. 10c shows the wind power available, the 24h-ahead wind power forecasted, the wind power curtailed, and the actual and forecasted load. The exports and mismatches in Fig. 10a are directly correlated to the wind power forecast, as the influence of load is negligible. Fig. 10d shows the EES state of charge over time: the charging and discharging patterns are also directly correlated with the errors of prediction, as it helps reducing the mismatches while not being sufficient to eliminate them. This suggests that storage is undersized for these purposes. Storage is mainly charged during periods with wind power surplus and discharged during shortages. Similarly to the previous case, Fig. 11a shows the power Reserve planning analysis committed by the "4h-ahead Dual-Horizon 1σ Reserve" planning again for High-wind case day 3 (in dashed line), the power delivered at the GSP from the rolling operations (in black), and also the power committed at the GSP when not considering thermal constraints (in clear dashed line). In this case, since enough reserve is committed in combination with adequate storage capacity and a shorter planning horizon, shortages of wind power are perfectly managed and the committed power can be delivered as planned with minimum mismatches. This can be seen in Fig. 11a where the power delivered matches perfectly the power committed. The export objective when not considering thermal constraints in Fig. 11a is directly correlated to the wind power curtailment observed in Fig. 11c, showing congestion expected and avoided at the planning stage. In this case study, congestion remains marginal, happening solely during high-wind/high-load periods, demonstrating the adequacy of the local resources (wind power, dispatchable DG, and EES) to meet the planning objective. At the operation stage, congestion is not likely to be observed as the export goal has already been set considering thermal constraints.

E. Reserve Planning Analysis
The three reserve formulations (22.1), (22.2), and (22.3) presented in Section III.C.7 (with specific reference to EES participation in reserve provision at the planning stage) are implemented and compared here for the Medium-wind day 1 case study under the 24h-ahead Dual-Horizon scenario and considering 1σ, 2σ, and 3σ levels of reserve. As shown in Fig.  12, the largest daily energy mismatch is observed for formulation (22.2), when storage is used to provide as much reserve as possible at a given time t. The second largest mismatch is observed for formulation (22.3), when storage committed for reserve at the planning stage operates by spreading its contribution over multiple time steps in the planning horizon, starting from the time t. Finally, the smallest mismatch is observed for formulation (22.1), when storage is not included in reserve provision and adequate reserve from dispatchable DG is therefore scheduled to reduce potential mismatches. The worst performance of formulation (22.2) is explained by the strongly auto-correlated nature of wind and load forecasts errors, as explored in [27] and as discussed above. In fact, when storage is called to mitigate prediction errors according to (22.2), it can be discharged at a certain time t regardless of the potentially future upcoming deviations, thus affecting negatively its future availability and ability to provide further reserve in successive time steps. In contrast to formulation (22.2), in formulation (22.3) the EES energy available for reserve at time t is spread over the planning horizon's successive time periods: considering the strong correlation between mismatches in adjacent time-steps, this helps cope with sustained deviations from the forecasts over different time steps in a more effective way, as the EES contribution to reserve is lower and so more dispatchable DG is committed which can flexibly provide reserve. Generally, speaking, as the cumulative error can be significant over a day in both cases (22.2) and (22.3) (see also Fig. 2 and Fig. 3), the decision of discharging the EES to mitigate deviations from the forecasts might lead to situations where the storage's SOC is eventually too low and, at the same time, not enough dispatchable generation has been committed for reserve which leads to some mismatch from the committed schedule. Conversely, in formulation (22.1) all reserve can be provided by flexible dispatchable DG, while storage still provides energy balance support by storing and releasing energy when needed to mitigate deviations. Accordingly, the results indicate that it may be advisable not to include storage in the reserve provision with the given case study's settings, and suggest that, in order to reduce the need for dispatchable generation as reserve (and possibly allow further integration of renewable energy) a substantially larger EES installed capacity might be required. This is object of ongoing investigations.

V. CONCLUSIONS
Within the general context of the transformation of distribution networks into distribution systems and of developing operational tools for the emerging role of DSO, this paper has presented a general dual-horizon rolling scheduling model for flexible ADSM based on a DACOPF formulation. The planning stage optimises dispatch on a "long-term" horizon committing imports and exports at the GSP (i.e., the interface between the TSO and DSOs). At the operation stage, network operations are controlled on a rolling "short-term" basis minimising deviations from the objective set at the planning stage.
The importance of time horizon and reserve for commitment involving variable generation has been discussed and quantified. In particular, it has been demonstrated that the "perfect information" approach for ADSM planning with variable generation yields unrealistic results whereas the Dual-Horizon rolling approach offers a better treatment of forecasting and planning uncertainties. In this respect, the benefits of using shorter planning horizons have also been quantified alongside the sizing of reserve and the technology providing this reserve (in particular, dispatchable DG and EES), demonstrating again the importance of considering uncertainties relative to the "perfect information" approach used in much of the literature. Furthermore, it has been shown that, if forecasting errors can be corrected by committed reserve, the effects of autocorrelations at the energy level may be severe and should not be neglected. This is particularly important if EES is used to provide reserve, as it might lead to situations where there is shortage of reserve. Therefore, as shown in the case study, it might be more beneficial to use storage to provide energy balance at the operation stage only and use dispatchable DG for reserve. Moreover, the DACOPF formulation adopted has proven capable of modelling the distribution network operations realistically, capturing for instance congestion issues.
Within the framework proposed for ADSM, the model developed has proven to be able to perform a Dual-Horizon scheduling with a full dynamic AC OPF. The novelty of this approach lies in the possibility of not only planning operations, but also controlling its feasibility and performance through the rolling operations phase. The framework developed could subsequently be used to estimate the performance of real active distribution systems operations in presence of various DER. This can facilitate the transition of DNOs towards the DSO role, and the planning of TSO-DSO interactions as it allows estimating the balancing capabilities of distribution networks under different levels of local reserves and different time horizons with a comprehensive treatment of uncertainties.
Applications under current investigation include optimal design of active distribution system assets to deal with long term uncertainties in planning.