Innovative Application of Model-Based Predictive Control for Low-Voltage Power Distribution Grids with Signiﬁcant Distributed Generation

: In past decades, the deployment of renewable-energy-based power generators, namely solar photovoltaic (PV) power generators, has been projected to cause a number of new difﬁculties in planning, monitoring, and control of power distribution grids. In this paper, a control scheme for ﬂexible asset management is proposed with the aim of closing the gap between power supply and demand in a suburban low-voltage power distribution grid with signiﬁcant penetration of solar PV power generation while respecting the different systems’ operational constraints, in addition to the voltage constraints prescribed by the French distribution grid operator (ENEDIS). The premise of the proposed strategy is the use of a model-based predictive control (MPC) scheme. The ﬂexible assets used in the case study are a biogas plant and a water tower. The mixed-integer nonlinear programming (MINLP) setting due to the water tower ON/OFF controller greatly increases the computational complexity of the optimisation problem. Thus, one of the contributions of the paper is a new formulation that solves the MINLP problem as a smooth continuous one without having recourse to relaxation. To determine the most adequate size for the proposed scheme’s sliding window, a sensitivity analysis is carried out. Then, results given by the scheme using the previously determined window size are analysed and compared to two reference strategies based on a relaxed problem formulation: a single optimisation yielding a weekly operation planning and a MPC scheme. The proposed problem formulation proves effective in terms of performance and maintenance of acceptable computational complexity. For the chosen sliding window, the control scheme drives the power supply/demand gap down from the initial one up to 38%.


Introduction
In recent years, the growing penetration of distributed generation (DG) into power distribution grids has been having a deep impact on these grids [1]. The deployment of distributed generators results in bidirectional power flow [2] and is projected to worsen voltage fluctuations and increase the risk of power backflow from low-voltage power distribution grids to medium-voltage ones. This is mainly due to wind and solar, which are intermittent energy sources depending on geographical locations and weather conditions [3].
Power distribution grid operators are contractually required to provide safe and reliable service to their customers and, as a result, are complying with several regulations, mainly on voltage constraints, voltage drop gradients, and current levels [4]. However, deployment of distributed generators is expected to make compliance with such constraints increasingly difficult. In addition, it triggers plenty of safety and quality issues, including short-circuits, power outages, and equipment damage [5,6]. The penetration of distributed generation into power distribution grids is also behind planning, legal, and regulatory issues [7].
The smart grid paradigm was conceived to tackle monitoring and control problems in power distribution grids [2]. Its building blocks include boosting grid observability through forecasting of grid load [8] and distributed generation [9], deployment of an advanced metering infrastructure (for instance, through the smart meter Linky in France), and smart management schemes which aim to balance out power supply and demand. Optimal power flow [10][11][12][13][14][15], demand-side management [16][17][18][19][20][21], and multi-agent systems [22][23][24][25][26] are some of the most abundant techniques in the scientific literature. Depending on the application, which can range from dimensioning and planning of power grid infrastructure to real-time monitoring and control, and the technical and computational constraints, one technique may be more appropriate than another. For instance, the voltage levels in the power distribution grid at hand determine which of these techniques is the best suited when it comes to developing a control scheme. A survey of smart management tools for power distribution grids with prolific distributed generation is provided by the present paper's authors in [27].
Modern power distribution grids group several distributed generators and storage devices. Therefore, it stands to reason to use these generators and storage devices to balance power supply and demand. The problem to solve can then be formulated as a minimisation one, where the aim is to minimise the cumulated difference between power supply and demand over a time horizon. The proposed strategy combines flexible asset management approach [28][29][30] and implicit model-based predictive control (MPC) [31][32][33][34]. Because power distribution grids are subject to intermittent renewable-energy-based power generation as well as stochastic electricity demand, the suitability of MPC to the monitoring and control of these power grids is plain. Such disturbances can provoke more or less serious failures and low-voltage power distribution grids, because of their weakly meshed (often radial) structure, are especially prone to cascading failures. Economic convenience edged out the extra layer of safety at the planning stage of these power grids, but, in the context of growing distributed generation, this choice has not aged well. As a consequence, anticipation of future issues that may affect the considered system is paramount [27].
In this paper, a MPC-based strategy taking advantage of distributed generators and non-electrical power storage systems owned by third parties (a biogas plant and a water tower) has been developed by PROMES-CNRS ("Processes, Materials and Solar Energy") in order to balance power supply and demand and limit instances of voltage overflow in a lowvoltage power distribution grid in southern France, while upholding the assets' operational constraints [35,36]. The case study is a simulated one. This work falls under the ADEME (the French agency for ecological transition) "Smart Occitania" project which responds to a concrete need expressed by ENEDIS for smart management tools and computationallytractable algorithms for rural and suburban low-voltage power distribution grids with prolific distributed generation. One of the objectives of the project is to evaluate the potential of MPC for upper-level power flow management and curtailment of voltage fluctuations in low-voltage power distribution grids. In addition, ENEDIS and PROMES-CNRS investigate in the considered case study the use of a biogas plant and a water tower owned by third parties as flexible assets in the control scheme. The biogas plant is controlled by a continuous signal. However, the operation of the water tower is subject to an ON/OFF controller and the discrete nature of the water tower's control signal makes the problem to solve a mixed-integer nonlinear programming (MINLP) one. MINLP problems have received a great deal of attention in the past few years with a wide range of contributions from researchers in applied mathematics on theoretical, algorithmic, and computational aspects. MINLP is a challenging research field and existing solvers able to tackle it have significant limitations [37], further worsened in the case of nonconvex constraints [38]. When the problem is convex, quite effective algorithms, including heuristic algorithms, are available in the literature. However, non-convex MINLP problems, which are much more difficult to solve, arise in several areas of engineering, in particular energy resource management [39][40][41][42]. For further information on the available algorithms and software one can use to solve MINLP problems, the reader is referred to [43][44][45][46]. A survey of non-convex MINLP (optimisation tools, algorithms, etc.) is provided in [38,47]. The main difficulty in modelling the problem addressed by PROMES-CNRS as a MINLP one comes from the fact that it is both nonlinear and non-convex. This is due to the nonlinear non-convex hard constraints representing Kirchhoff's laws, which are polynomial equality constraints (see Equation (22)). While several techniques from the literature could be implemented and tested, a relaxation of the problem, whether at the modelling stage or the resolution stage, is the usual route to bypass the difficulties related to MINLP [38,47,48]. Instead, we propose a problem formulation that allows us to bypass the MINLP framework of the optimisation problem without relaxing the ON/OFF constraint of the water tower controller. This formulation, dubbed switch control, takes the problem out of its MINLP setting and makes it a continuous nonlinear optimisation one. In fact, by optimising the instants at which the water tower's controller switches from one state to the next, the discrete control signal is modelled as a continuous one.
The paper is organised as follows. In Section 2, the case study is presented, an overview of the proposed control strategy is given. and models of the considered low-voltage power distribution grid and the two flexible assets used in the case study are formulated. Section 3 provides an explanation of the proposed model-based predictive control strategy. Then, the MINLP problem formulation is presented and the new formulation proposed in this paper is introduced. In Section 4, a sensitivity analysis is performed in order to highlight the most adequate sliding window size. Afterwards, results given by the proposed control strategy are compared with those of two reference strategies. The first reference strategy is a weekly operation planning which provides a heuristic lower bound for the objective function final value (i.e., cumulated difference between power supply and demand). The second reference strategy is a MPC scheme based on a relaxed problem formulation. The paper ends with a conclusion and an outlook to future works (Section 5). The post-treatment algorithms are detailed in Appendix A.

Materials and Methods
In this section, the case study, the principles of the proposed control strategy, and the models of the low-voltage power distribution grid and flexible assets used in this case study are presented.

Case Study
The simulated case study presented herein is carried out on a low-voltage power distribution grid composed of a suburban residential neighbourhood of approximately 120 households located in the Occitania region (south of France), 50 household PV installations of 4 kW each (approximately 20 m 2 ), amounting to a total power capacity of 200 kW, a biogas plant (power capacity is 100 kW), and a water tower (power capacity is 100 kW). The considered solar PV power generation capacity is in reality a fourfold increase from the current installed capacity in the considered power distribution grid. The current capacity not being high enough to disrupt the smooth functioning of the power distribution grid, this increase in capacity was decided on to demonstrate the predictive control strategy's ability to close a significant gap between power supply and demand, while maintaining the voltage levels within prescribed margins (in France, 10% for power distribution grids).
Grid load is measured at the medium-voltage/low-voltage (MV/LV) transformer level of the residential neighbourhood. Data are provided by CAHORS group, which is involved in the Smart Occitania project, and ENEDIS. Because grid load data show that the portion of reactive power remains under 5% of the apparent power, both the inductive and capacitive aspects of the power grid components are neglected. Solar PV power generation is inferred from global horizontal irradiance (GHI) measurements taken by a pyranometer installed at PROMES-CNRS, located just a few kilometres from the residential neighbourhood. Grid load and solar PV power generation data used in the case study are presented in Figure 1. Both the biogas plant and the water tower used herein match the characteristics of two real installations located in the Occitania region.  Figure 1. The grid load (transformer-level measurements of power consumption in a suburban neighbourhood composed of approximately 120 households) and solar PV power generation (50 household PV panels) over four "season-typical" weeks: a spring week (a); a summer week (b); an autumn week (c); and a winter week (d).

Overview of the Proposed Control Strategy
In this section, the MPC-based strategy, dubbed switch control strategy, proposed for the smart management of low-voltage power distribution grids is introduced. The principle upon which MPC is based is quite simple: a dynamic model of the system's inner-workings, coupled with forecasts of stochastic quantities, is used to solve a constrained optimisation problem, herein the one described in Section 3.2, over a sliding window. During each timeslot, only the setpoints corresponding to the next time step are implemented. This process is reiterated at each time step. The strength of model-based predictive control is in its ability to incorporate in real time forecasts of disturbances impacting grid's stability, namely solar PV power generation and grid load, for anticipating emerging constraints as best as possible.
In contrast to a classic operation planning where a single optimisation problem is solved and its solution implemented over a fixed horizon (e.g., a week), the rolling horizon of a MPC controller, which allows a perpetual adaptation to the enhancement of forecasts, is suitable for real-time control as the optimisation problem to be solved over a predefined sliding window is much less expensive. In addition, power distribution grids contain several stochastic quantities whose forecasts degrade quickly as the forecast horizon expands. Figure 2 summarises the proposed MPC-based strategy. At each time step, the lowvoltage power distribution grid model assimilates data coming from both the forecast module and the metering infrastructure concerning the biogas production at the biogas plant, water consumption affecting the stored water level in the water tower, solar PV power generation and the grid load. Then, the model evaluates the voltage constraints created in the grid and sends this information to the optimisation algorithm which attempts to find a solution for the flexible assets' setpoints. Once the optimisation problem is solved, the first setpoint (for the following time step) is implemented. The entire process reiterates at every time step.
Model-based predictive controller Low-voltage (LV) grid Figure 2. Synoptic scheme of the proposed MPC-based strategy for smart management of a low-voltage power distribution grid using flexible assets. Let Q w,out , GHI, P cons , V w , and V b be measurements of water demand, global horizontal irradiance, grid load, water volume, and biogas volume, respectively. Let P * w , P * b be optimal setpoints of water tower power consumption and biogas plant power generation, respectively. Let GHI, P cons , and Q w,out be forecasts of global horizontal irradiance, grid load, and power demand, respectively. Let P s b and P s w be candidate setpoints of biogas plant power generation and water tower power consumption, respectively, and V s b and V s w be biogas volume and water volume corresponding to those candidate setpoints, respectively.
The proposed MPC-based control strategy, dubbed switch control strategy, is detailed in Section 3. The MINLP problem is presented and the novel formulation that solves this problem as a smooth continuous one without having recourse to relaxation is introduced.

Models
In accordance with the model-based predictive control scheme proposed in this paper for the smart management of a low-voltage power distribution grid, the models of the flexible assets (a biogas plant and a water tower) are formulated over a prediction horizon H. In the following, and for all time-dependant quantities, t ∈ {1, . . . , H p }, where H p is the integer number of time slots within the prediction horizon.

Biogas Plant
Biogas plants, which are connected to low-voltage power distribution grids, are composed of bioreactors (where methane-rich biogas is produced in order to be used as fuel), storage units, and power generators.
The biogas volume in the storage unit (in m 3 ) is described as: where T is the time step (T = 10 min) and Q b,in (in m 3 h −1 ) and Q b,out (in m 3 h −1 ) are the flow rates of biogas production entering the storage unit and biogas consumption by the power generator, respectively. Q b,out is formulated as follows: where P b (in W) is the plant's active power output, η is the generator's efficiency, and LHV (in kWh m −3 ) is the lower heating value of the stored biogas. P b is subject to the following constraint: where P b,min and P b,max are the minimal and maximal power generation of the biogas plant, respectively.
Regarding the biogas volume in the storage unit (V b ), it is subject to the following constraint: where V b,min and V b,max are the minimal and maximal biogas storage capacities of the biogas plant, respectively.

Water Tower
Water towers, which are connected to low-voltage power distribution grids, provide pressurised potable water supply and emergency water storage for fire protection. The volume in the storage tank (in m 3 ) is described as follows: where T = 10 min is the time step and Q w,in (in m 3 h −1 ) and Q w,out (in m 3 h −1 ) are the flow rates of water entering the storage tank and water consumption, respectively. Q w,in is formulated as follows: where P w (in W) is the water pump's active power consumption, η w is the water pump's efficiency, ρ (in kg m −3 ) is the water density, g (in m s −2 ) is the gravitational acceleration, and h (in m) is the water level in the storage tank. Let P w,min and P w,max be the minimum and maximum power consumption values of the water tower, respectively. P w can only be set following ON/OFF commands, i.e., it is subject to the following constraint: The water volume in the storage tank (V w ) is subject to the following constraint: where V w,min and V w,max are the minimal and maximal storage capacities of the water tank, respectively.

Low-Voltage Power Distribution Grid Model
The proposed control scheme operates at the MV/LV transformer level of a small-scale power distribution grid, whose equivalent electrical circuit is shown in Figure 3, in order to minimise the gap between power supply and demand. Therefore, performance of the control scheme is independent of the dispatching of distributed generation throughout the power grid.
For a given branch [qj], the voltage drop between nodes q and j is given by Kirchhoff's law: where U q ∈ R H p , ∀q ∈ {1, . . . , N}, and U j ∈ R H p , ∀j ∈ {1, . . . , N}, are the voltages at nodes q and j, respectively; z qj ∈ R H p , ∀q, j ∈ {1, . . . , N}, is the line impedance between nodes q and j; and I qj ∈ R H p , ∀q, j ∈ {1, . . . , N}, is the current flowing between nodes q and j. N is the number of nodes in the considered power distribution grid. Under the assumption that reactive power is negligible, U q is proportional to the active power consumed/produced at that node: where P q ∈ R H p , ∀q ∈ {1, . . . , N}, is the active power consumed/produced at node q and I q ∈ R H p , ∀q ∈ {1, . . . , N}, is the current injected into/absorbed by node q.
In France, in low-voltage power distribution grids, the nominal voltage values for single-phase and three-phase connections are 230 V and 400 V, respectively [2]. In addition, measurements-made at the transformer level of the power distribution grid-used throughout this study correspond to means over each time step (herein T = 10 min). Because voltage means must at all times remain within prescribed margins, ∀q ∈ {1, . . . , N}: where U n is the nominal single-phase voltage value for all grid nodes and δU is the prescribed margin of voltage variations with respect to the nominal value (in France, 10% for power distribution grids). Here, U n = 230V and δU is set to be 10% of U n , that is δU = 23V.
Hereinafter, let us define the following bounds: and For the equivalent electrical circuit of the low-voltage power distribution grid of the case study (Figure 3), Equations (9) and (10) lead to the following equation set: where P PV and P cons are the solar PV power generation and the grid load, respectively.

Control Strategy
In this section, the switch control strategy and the reference strategies-these strategies are based on a relaxation of the MINLP problem-are presented. Because solar PV power generation and grid load forecasting errors are assumed null, the difference in performance between these strategies can only be traced back to differences in problem formulations, since data are identical. The switch control strategy is taken because the focus of this paper is to demonstrate the efficiency of the new problem formulation and to evaluate its performance.
This section starts with formulating the problem as a standard MINLP one. Then, the new problem formulation allowing to treat the optimisation problem as a smooth continuous one without having recourse to relaxation is introduced. The section ends with a presentation of the two reference strategies with which the proposed scheme's performance is evaluated.

MINLP Formulation
In the scope of this work, the flexible assets are operated by third parties. The water tower is operated using an ON/OFF controller, a hard constraint by which the power distribution grid control scheme must abide. The integer values of the water tower control setpoint makes the problem a MINLP one [43]. In this section, the aforementioned MINLP problem formulation is presented. In the following, and for all time-dependant quantities, t ∈ {1, . . . , H p }. Let H be the prediction horizon such that H = H p · T, where H p is the integer number of time slots within the prediction horizon, P cons ∈ R H p is the grid load (in W), and P PV ∈ R H p is the solar PV power generation (in W). The decision variables are P b ∈ R H p and P w ∈ R H p , which represent the active power setpoints for the biogas plant generation and the water tower consumption. The standard way of integrating acceptable voltage fluctuation margins into the problem would be to write the Kirchhoff laws dictating them as nonlinear constraints. However, in this paper, things are done differently. Voltage variables are introduced so the optimisation model solves the solution for power setpoints and the voltage values across the low-voltage power distribution grid at the same time.
Moreover, voltages are incorporated as optimisation variables and nonlinear constraints described by Kirchhoff laws are turned into linear ones. This version of the problem alleviates its complexity by reducing the number of nonlinear constraints it contains. The voltage variation between nodes q and j of a power distribution grid at time step t is described as follows, ∀q, j ∈ {1, . . . , N}: Kirchhoff laws ensure that, at every time step, the following condition is verified, ∀q, j ∈ {1, . . . , N}: Current variables are eliminated using Kirchhoff's laws. As a result, K t is defined to represent voltage variations across the power distribution grid at a given time step t as a function of the powers injected/absorbed at each node in the following manner: such that where M is the number of vertices in the connected loopless graph equivalent to the electrical circuit in question and B is made up of M non-redundant elements B qj . Now, let X be the following matrix: The problem aims to close the gap between power supply and demand in a power distribution grid. To do so, third-party-owned biogas plant and water tower must be managed in such a way that their power generation/consumption balances out the discrepancies in the grid's supply/demand equilibrium.
As a result, the objective function is formulated as follows: The optimisation problem that takes into account the ON/OFF controller specificity of the water tower is: with biogas plant setpoint boundaries and voltage boundaries, ∀q ∈ {1, . . . , N} subject to the following constraints: • Water tower setpoint constraint • Linear inequality constraints, ∀q ∈ {1, . . . , N} • Nonlinear equality constraints

Switch Control
In this section, the new problem formulation proposed by PROMES-CNRS, allowing the ON/OFF control of the water tower without using MINLP, is introduced. A posttreatment is then presented (the post-treatment algorithms are detailed in Appendix A) to make the solution more suitable for real implementation. Lastly, an explanation is provided of the addition of constraints into the problem in favour of the reduction of the number of variables. The problem as formulated in Section 3.1 presents a major challenge in the form of the MINLP setting due to the water tower ON/OFF controller. This setting is complex and computationally expensive, an especially troublesome trait for real-time applications such as the one addressed in this paper. The usual route taken in the literature to bypass the difficulties of MINLP are relaxation techniques [38,47,48]. Instead, the approach presented in this paper does not relax the problem but proposes a different formulation that allows the mixed-integer problem to be solved as a smooth nonlinear optimisation by optimising the timing of the integer variable's transition from one integer value to another. To the authors' knowledge, even though this technique comes from parameterised optimal control theory, it has not yet been implemented for this type of application. However, a similar approach was implemented by Salas et al. [49] to determine optimal planning strategies for concentrated solar power plants via pre-scenarios. The reader can note that the constraints given by Equation (33) are non-convex. Therefore, only local optimality can be expected, even if the integer constraints (29) are relaxed. As a result, optimality bounds and analysis of the results must be considered under this setting as heuristic results.
The MINLP setting due to the water tower ON/OFF controller greatly increases the computational complexity of the optimisation problem. To circumvent this issue, this work proposes a new formulation of the optimisation problem in order to solve it as a continuous one. This is done by exchanging the discrete optimisation variable P w with a real-valued onet ∈ R H p that designated the instant between two time steps at which the water tower's setpoint switches between its two discrete values (i.e., P w,min and P w,max ). It follows that, at the same instant, the biogas plant's setpoint also switches between two values within the interval [P b,min , P b,max ].
Let us denote X = P b,ON P b,OFFt U ON,q U OFF,q T , where P b,ON ∈ R H p and P b,OFF ∈ R H p form the biogas plant setpoint as follows: U ON,q ∈ R (H p ·N) and U OFF,q ∈ R (H p ·N) , ∀q ∈ {1, . . . , N}, form the voltages in the grid: At each time step, the problem can be solved assuming that the first state of the water tower is always ON. In some extreme cases, this assumption may induce some issues of implementability with volume constraints, which are tackled in a post-treatment phase (see Appendix A). However, this simplification reduces the complexity of the model without sacrificing much performance. Figure 4 gives an example of what the water tower and biogas plant setpoints would look like with the switch control formulation. Note that the transition between states does not only occur at the beginning of each time step.  The objective function is formulated as follows: and The problem is then formulated as follows: subject to, ∀i ∈ {1, . . . , H p } and ∀q ∈ {1, . . . , N}: • Biogas plant power bounds and • Switch time bounds • Biogas volume constraints • Water volume constraints • Voltage constraintst K t , which is formulated as a function of the power injected or absorbed by the power grid nodes, as defined in Equation (22), deals with voltage variations across the low-voltage power distribution grid. Two sets of constraints guarantee that Kirchhoff's laws are upheld in both sub-intervals of each time step (Equations (45) and (46)). The equation set depicting voltage variations across the power distribution grid is multiplied byt i (Equation (45)) and by T −t i (Equation (46)) using for each interval appropriate values of biogas plant and water tower setpoints, with the aim of ensuring that only one constraint is activated in case of extreme values oft i . Ift i = 0, Equation (45) is removed. This reflects the fact that the water tower is turned off at the beginning of time step i. Ift i = T, Equation (46) is removed since the water tower remains on for the whole duration of time step i.
Two other sets of constraints account for voltage variations in both states of the power distribution grid within each time step (Equations (47) and (48)). While depicting the same physical constraints, this optimisation problem formulation has a bigger feasible set than the mixed-integer nonlinear programming one (see Section 3.1). As a consequence, the global optimum of this formulation is guaranteed to be equal or better than the one of the MINLP formulation.

Post-Treatment
The problem treated in this section splinters the regularly-split time horizon into uneven intermediate intervals. As a result, the power setpoints provided by the optimisation algorithm may present very small pulses which perfect the objective function minimisation aspect but compromise the implementability of the solution. Moreover, small pulses may also appear when trying to set the switch time to an extreme value. For all intents and purposes, a water tower setpoint which stipulates that the pump be turned on for 30 s, for instance, makes little to no practical sense. This issue calls for a post-treatment to eliminate small pulses, while still upholding all constraints.
At each iteration i of the optimisation process, the determined switching timet i is examined: if the pulse during which the pump is turned on is too short with respect to a pre-defined threshold, then the pulse is eliminated, provided that the volume constraints would still hold. Analogously, if said pulse surpasses the post-treatment threshold, the algorithm attempts to extend it to the full 10-min interval, if volume constraints permit it. Moreover, a second post-treatment is applied to join two adjacent pulses when possible. This enhances the implementability of the solution as the algorithm tries to minimise the number of transitions of the water tower setpoint from one state to another, when the volume constraints allow it. The post-treatment algorithms are detailed in Appendix A.

Additional Constraints
In the remainder of this section, all quantities written in a bold font are time-dependent. However, for clarity's sake, notations do away with time indices and time dependency is implicit. To alleviate the computational burden of the problem, it is advantageous to reduce the number of optimisation variables. In this case study, this is rendered possible by the reformulation of Equations (14)- (18), which can then be written as follows: and such that where Equations (51)-(53) are solutions to Equations (14)-(16), respectively. The discarded solutions to the quadratic equations are the ones that would provide voltage values that make no physical sense. At this stage, it becomes clear that there are merely two voltage variables (U 1 and U 3 ) in the optimisation problem. However, in reality, voltages U 2 , U 4 , and U 5 are still expected to be within the bounds described in Equation (11). As a result, these bounds infer additional constraints on variables U 1 and U 3 . In the following, these constraints are determined.

•
Constraints inferred by bounds of U 2 : from Equation (51), it is trivial that U 2 U 1 . As a result, U 2 U max is redundant. As for the lower bounds, using Equation (51): Since 2U min U max , 2U min − U 1 0. Then: • Constraints inferred by bounds of U 4 : from Equation (52), it is trivial that U 4 U 3 . As a result, U 4 U min is redundant. As for the upper bound, using Equation (52): • Constraints inferred by bounds of U 5 : analogously to the constraints inferred by U 4 , and by using Equation (53), it can be easily demonstrated that U 5 U min is redundant. As a result:

Reference Strategies
In this section, the two reference strategies (i.e., an operation planning of the flexible assets over the considered one-week periods, see Section 3.3.1, and a relaxed MPC scheme, see Section 3.3.2) are briefly presented. Both strategies are based on a relaxation of the MINLP problem described in Section 3.1.
By relaxing the problem formulation, the ON/OFF constraint of the water tower controller is lifted, and it is assumed that water consumption may have any value within a feasible interval. Therefore, the relaxed problem is formulated in the same way as the MINLP one except for Equation (29), representing the ON/OFF characteristic of the water tower setpoint. Equation (29) is replaced by:

Weekly Planning
The first reference strategy is an operation planning of the flexible assets over the one-week periods considered in this paper. Over an entire week, the relaxed optimisation problem is solved once and then the solution is implemented. Although this type of planning strategies is not frequently used, it is not uncommon for installations such as biogas plants. In this paper, solar PV power generation and grid load forecasting errors are assumed null (the difference in performance between the considered strategies can therefore only be traced back to differences in problem formulations). The purpose of using this weekly planning strategy, assuming forecasting errors to be null, is to serve as an upper bound for the efficiency of the control strategy in closing the power supply/demand gap.

Relaxed MPC Scheme
The second reference strategy is a MPC scheme based on the relaxed problem formulation. In this case, the proposed MPC scheme, based on a new formulation of the problem described herein, is compared to a relaxed MPC scheme that is given ample freedom to change the water tower setpoint between its two extreme values (i.e., P w,min and P w,max ).

Results and Analysis
In this section, a performance analysis of the switch control strategy (see Section 3.2) is carried out. These performances are compared to those of the weekly planning strategy and the MPC scheme based on the relaxed optimisation problem, both explained in Section 3.3.
First, the results yielded by the weekly planning using all four datasets are presented. Then, a sensitivity analysis is conducted in order to assess the impact of the MPC's sliding window length on its performance. Lastly, a sliding window is chosen based on the aforementioned sensitivity analysis and a detailed examination of its results is done. All results presented in this paper were obtained using MATLAB 2018a (MathWorks, Natick, MA, USA).

Weekly Planning Performance
The weekly planning of the flexible assets' operation is conducted in four different scenarios: each corresponding to a "season-typical" week (see Figure 1). Results displayed hereinafter showcase the reduced gap between supply and demand obtained through this planning, as well as flexible asset setpoints and corresponding storage volumes, compared to the initial case.
It is interesting to note that the dimensioning of flexible asset storage units is an influential factor in itself. As it stands, the hard volume constraints of storage units are prioritised by the algorithm over the minimisation of the supply/demand gap. As a result, when the upper bound of stored biogas volume is reached, the generator kicks in to burn the extra biogas to avoid discarding it into the atmosphere or increasing the storage unit pressure. When the lower bound is reached, the setpoint of power generation is reduced in order to maintain the minimum required volume in storage. Similarly, the water tower's pump is automatically triggered when the lower volume bound is reached in order to maintain the minimum required volume in storage and is automatically shut down when the maximum water volume is reached. This can sometimes be in conflict with the grid stability's best interest, as it may be necessary to turn on the distributed generator when the grid is already experiencing overvoltage due to excess energy flowing through its lines. It may also be necessary for the storage system to consume electricity at times when the grid is at risk of experiencing undervoltage phenomena. Asset dimensioning is not addressed in this paper, but several works exist in the literature to tackle the question of optimal dimensioning and allocation of distributed generators in power distribution grids [28,50,51]. Table 1 recapitulates the values of the power supply/demand gap procured by the weekly planning with all four sets of data, where f obj,initial and f obj, f inal are the initial and final objective function values, respectively. When formulating the optimisation problem, the square of the objective function is used to ensure that the algorithm suppresses sharp fluctuations of its values and gives as smooth a variation as possible. The results show that, in all four cases, there is a significant reduction in the supply/demand gap with respect to the initial case, the biggest of which occurs during winter. Depending on the season, the initial gap between supply and demand within the considered low-voltage power distribution grid (modelled by the objective function value) differs: the gap is higher in warmer seasons (spring and summer) as the solar resource, and therefore solar PV power generation, is substantial. This is typical for the Mediterranean climate. Indeed, the results show that the power distribution grid is unable to absorb the excess of power generation during spring and summer, as the final objective function is reduced by 26.5% and 26.1%, respectively, whereas it is reduced by 46.9% for winter and 41.5% for autumn. The weekly planning scheme presented in this section, using the relaxed problem formulation and assuming perfect forecasts, is considered as the "ideal case" throughout the rest of the paper.

Sensitivity Analysis
To assess the impact of the sliding window size on the MPC-based strategy's performance, both the relaxed problem and the switch control are implemented with sliding window size ranging from 1 to 24 h over four season-representative weeks. The results of these simulations are discussed herein. The interesting question being investigated is: What is the most appropriate length of this sliding window that would allow efficient control of the power distribution grid without taking on unnecessary computational burdens? To determine an answer, a sensitivity analysis of the impact of the sliding window size on the performance of the MPC algorithm is carried out. The considered metrics are the objective function's final value and the computational complexity, measured in the total number of objective function evaluations needed for the algorithm to reach a solution. Figure 5 displays the evolution of the power supply/demand gap with respect to lengths of the sliding window ranging from one to 24 h, for both the relaxed problem and the switch control. The weekly planning obtained through the relaxed problem assuming perfect forecasts serves as a reference point to evaluate the MPC scheme's accuracy. For all four seasons, it can be seen that the same behaviour is reproduced. As the sliding window length increases, the final objective function value decreases and moves towards the ideal value without reaching it. For small window lengths, the switch control provides identical values to those of the relaxed problem. For larger windows, however, the switch control's values still follow the relaxed problem's quite well but a small gap starts to appear between the two.
Considerable reductions in the power supply/demand gap are already obtained with a 1-h sliding window size for the MPC scheme, followed by gradual improvements as the window size increases. These improvements seem, at first glance, to stabilise relatively quickly. A closer look is provided by Figure 6, revealing a more pronounced difference between results of MPC schemes with various sliding window sizes, though the incremental change remains small when compared to reductions made to the power supply/demand gap using the 1-h window with respect to the initial values.
The scheme's goal is real-time monitoring and control of low-voltage power distribution grids. Thus, it stands to reason that computational cost would be a cardinal criterion. Therefore, a compromise must be made between the algorithm's qualitative results and its computational cost. To do so, an examination of the evolution of the computational cost required by the optimisation algorithm is carried out with respect to the length of the sliding window of the MPC-based strategy. Figure 7 shows the computational cost of the implementation of an iteration of the MPC scheme with varying lengths of the sliding window in order to assess the computational burden for the relaxed problem and the switch control. Herein, as opposed to simply registering the time consumed by the MPC scheme's implementation, the computational complexity is quantified by the overall number of objective function evaluations per window. This metric is provided as an output argument of the optimisation function fmincon of MATLAB, which has been selected because it provided the best compromise between quality of results, computational cost, and simplicity of implementation. fmincon is based on interior point algorithm. The application aims at real-time control of power distribution grid, with a time step of 10 min. As a result, strict limitations are imposed on the sophistication of the numerical solver. Of course, fmincon does not guarantee convergence to a global minimum. However, for this type of applications, a local minimum that allows satisfactory enhancement of the objective function's final value is acceptable (herein, this translates into reduction of the unbalance between power supply and demand within the considered low-voltage power distribution grid).  For a given computer and given operating conditions, the algorithm's speed mirrors a combination of two criteria: the number of function evaluations it performs and the number of optimisation variables, which is proportional to the length of the sliding window. This allows for a more objective rendering of the algorithm's computational complexity that is not clouded by the characteristics of a specific computer. Figure 7 shows that the switch control's computational complexity remains underneath that of the relaxed problem up to a certain window length, then it surpasses it. Which means that, up to a certain, relatively large, window length, the switch control is not only more realistic but is also less computationally expensive than the relaxed problem.
Despite the presence of some outliers, the growing tendency of computational complexity is clear and expected. Its main cause is the number of optimisation variables, which is proportional to the length of the sliding window. The main observation is that, for longer windows, a high percentage of the function evaluations serves to improve upon values given by the previous windows by only a small fraction of the objective function's initial value. In gradient-based descendant methods, particularly interior-point methods, this is very common due to the trade-off between convergence criteria and accuracy. For further details about convergence rates and computational complexity of interior-point methods, the reader is referred to [52] (and the references therein).
As of the 14-h sliding window, the improvement of the final objective function value with respect to the initial value is practically constant. To avoid undue computational burden caused by enlarging the sliding window size with little performance gain, the 14-h sliding window is chosen going forward as the best compromise between the aforementioned performance criteria.

Switch Control Performance
In this section, the results provided by the switch control scheme are examined. A 14-h sliding window is considered. The initial case represents the classical operation modes of both flexible assets: through the water tower ON/OFF controller that allows the pump the system is equipped with to fill the tank whenever it is at a lower threshold and stops when reaching the upper threshold, and constant power generation for the biogas plant, in line with the facility's steady flow of biogas production. Table 2 details the objective function's final values given by the proposed switch control scheme with a 14-h sliding window, with respect to the objective function's initial values. Figure 8 shows the gap between power demand and supply in the considered lowvoltage power distribution grid before and after implementing the switch control scheme with a 14-h sliding window with respect to the initial case and the planning strategy. The results are observed for four "season-typical" weeks, with varying behaviours of grid load and solar PV power generation, as illustrated in Figure 1. For all four considered weeks, significant smoothing of the supply/demand gap is observed with respect to the initial case. This is especially visible for the warm seasons (April and July) where the large midday peaks due to high levels of solar PV power generation are remarkably reduced, although some previously inexistent dips are created. It should be noted that the influence of the post-treatment algorithm on performance is evaluated. In fact, the post-treatment algorithm is called, on average, 96% of the time during a one-week simulation to eliminate or extend a pulse in the water tower's setpoint at the following time step. Although this procedure results in smoother setpoints for the flexible assets, thus boosting the solution's implementability, it has little impact on the power supply/demand gap, which is degraded by about 4%.
The fact that the scheme that uses a post-treatment algorithm provides smoother setpoints than the one that does not while the supply/demand curve for both schemes remain virtually identical suggests that the main contribution of this post-treatment is in fact in flipping the order of the states within a time-step to have a more implementable overall setpoint. More details about the inner-workings on the post-treatment algorithm are provided in Appendix A. Another noteworthy observation is that the computational burden is increased by 12%, on average, by the post treatment.
The deployment of distributed generation and its penetration in low-voltage power distribution grids is creating new challenges in terms of monitoring and control. That being said, this type of power generation opens the door to new ways of guaranteeing the grid stability and quality of service. To this end, advanced metering infrastructures and forecasting algorithms are particularly valuable tools.

Conclusions and Outlook
In this paper, a control strategy, dubbed switch control, is proposed for smart management of suburban low-voltage power distribution grids with significant penetration of solar photovoltaic power generation. A simulated case study is carried out on a residential neighbourhood located in the Occitania region (southern France). Two flexible assets-a biogas plant and a water tower-are operated. This strategy consists in a model-based predictive control (MPC) scheme aiming to close the gap between power supply and demand, in accordance with voltage constraints and the flexible assets' operational constraints.  The mixed-integer nonlinear programming (MINLP) setting due to the water tower ON/OFF controller greatly increases the computational complexity of the optimisation problem. Thus, one of the contributions of this paper is the new formulation allowing the MINLP problem to be solved as a smooth continuous one without having recourse to relaxation. In addition, the analysis of the results proves the control strategy's potential for closing the power supply/demand gap. In fact, this gap is significantly lower than the one observed using the flexible assets' default operating strategies (without any optimisation). In this sense, the strategy proposed herein is a step towards low-voltage power distribution grids capable of integrating renewable-energy-based power generation, whose aim is meeting power demand while maintaining stability and quality of service. In addition, the results highlight that MPC has potential for upper-level power flow management and curtailment of voltage fluctuations in low-voltage power distribution grids.
Improvements upon this work include the modification of the objective function to smooth out the flexible assets' setpoints without having recourse to a post-treatment algorithm. In addition, forecasts of disturbances, namely solar PV power generation and grid load, impacting grid's stability will be incorporated, in real time, with the aim of better anticipating emerging constraints. Gaussian process regression models have been developed. The MPC scheme's robustness to forecasting errors will be investigated.

Acknowledgments:
The authors would like to thank the French agency for ecological transition for its financial support. We also thank all the academic and industrial entities involved in the Smart Occitania project for their contribution to this work and the Universidad de O'Higgins for its financial support during the stay of Nouha Dkhili in Chile. Powered@NLHPC: This research was partially supported by the supercomputing infrastructure of the NLHPC (ECM-02).

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript:

Appendix A. Post-Treatment Algorithm
To ensure the implementability of the flexible asset setpoints, particularly the water tower that switches between two extreme setpoint values, a post-treatment algorithm is carried out. Please refer to the nomenclature list for the meaning of the variables used in equations.
Throughout the Appendix, all quantities written in a bold font are time-dependent, but, for clarity's sake, notations do away with time indices. Moreover, the procedure presented herein is implemented at each time step. Thus, time-dependent variables correspond to the current time step, except for V b and V w , which correspond to the biogas volume and the water volume at the end of the precedent time step, i.e., at time step t, V b and V w correspond to V b (t − 1) and V w (t − 1). In other words, V b and V w are treated as the initial conditions for the current time step.
At each iteration i of the optimisation process, the determined switching timet i is examined: if the pulse during which the pump is turned on is too short with respect to a pre-defined threshold, then the pulse is eliminated, provided that the volume constraints would still hold. Analogously, if said pulse surpasses the post-treatment threshold, the algorithm attempts to extend it to the full 10-min interval, if volume constraints permit it. Different quantities are introduced for the biogas plant volume constraints. These quantities are listed hereinafter.
• V b,down is the stored biogas volume in the biogas plant's storage unit at the end of the current time step if the pulse is eliminated, i.e., if in case the pump is not turned on in the current time step. with: is the stored biogas volume in the biogas plant's storage unit at switching timet i of the current time step if the duration of the pulse is extended to equal the pre-defined threshold, i.e., ift i = .
• V end b,up is the stored biogas volume in the biogas plant's storage unit at the end of the current time step if the duration of the pulse is extended to equal the pre-defined threshold, i.e., ift i = .
• V b,up is the stored biogas volume in the biogas plant's storage unit at the end of the current time step if the pulse is extended, i.e., if the pump is turned on during the entire time step.
• V middle b,down is the stored biogas volume in the biogas plant's storage unit at switching timet i of the current time step if the duration of the pulse could not be extended and is shortened tot i = 1 − .
• V end b,down is the stored biogas volume in the biogas plant's storage unit at the end of the current time step if the duration of the pulse could not be extended and is shortened tot i = 1 − .
The following quantities are introduced for the water tower volume constraints: • V w,down is the stored water volume in the water tower's tank at the end of the current time step if the pulse is eliminated, i.e., in the case the pump is not turned on in the current time step.
is the stored water volume in the water tower's tank at switching timet i of the current time step if the duration of the pulse is extended to equal the pre-defined threshold, i.e., ift i = .
V middle w,up with: • V end w,up is the stored water volume in the water tower's tank at the end of the current time step if the duration of the pulse is extended to equal the pre-defined threshold, i.e., ift i = .
V end w,up = V w − Q w,out T 60 + 100 K w (A11) • V w,up is the stored water volume in the water tower's tank at the end of the current time step if the pulse is extended, i.e., if the pump is turned on during the entire time step.
V w,up = V w − Q w,out T 60 + 100K w (A12) • V middle w,down is the stored water volume in the water tower's tank at switching timet i of the current time step if the duration of the pulse could not be extended and is shortened tot i = 1 − .
• V end w,down is the stored water volume in the water tower's tank at the end of the current time step if the duration of the pulse could not be extended and is shortened tō At each time step, the first setpoint undergoes a treatment before it is implemented and later fed to the controller for future time steps. The treatment concerns the switching timet i ∈ [0, 1] and infers modifications of the other setpoint variables: if the switching timē t i is smaller than the pre-defined threshold , it may be set to three possible values, i.e., zero, , ort i , in that order of priority. The steps made in this case are given by Algorithm A1. If the switching timet i is bigger than the pre-defined threshold , it may be set to three possible values: 1, 1 − , ort i , in that order of priority. The steps made in this case are given by Algorithm A2. This choice depends on whether the volume constraints of both flexible assets hold. These constraints are guaranteed to hold in the last case by the preceding optimisation algorithm. Then, to further increase implementability of the solution, the possibility of re-arranging the positions of pulses within their respective time steps is studied. This stems from the fact that, within a time step, the optimisation variable is the duration of the pulse and not its position. In other words, within a time step, as long as the water tower is turned on for the same amount of time as what has been determined thus far, whether it is turned on in the beginning of the time step or at its end makes no difference to the problem at hand. Analogously, the same goes for the functioning of the biogas plant.
The pulses are therefore "flipped" (t i is replaced by 1 −t i , and ON/OFF states are inverted) alternately to form a smoother control signal, provided that the flexible assets' volume constraints would still hold.
These constraints only need to be verified at the new switching time 1 −t i for the new ON/OFF operation, since, at the initial and final times of the time step, they hold thanks to the preceding optimisation algorithm. In conclusion, the following potential state values are introduced: and V middle w, f lip = V w + (1 −t i ) Q out,w T 60 (A17) The extreme cases wheret i = 0 andt i = 1 are handled differently. The former case means that the water tower's pump is never turned on during the time step. As a result, the algorithm will not flip the control setpoint of the next time step, provided the volume constraints hold, in order to glue the "OFF periods" together. In the latter case, the water tower's pump is turned on during the entirety of the time step. Thus, the algorithm will flip the control setpoint of the next time step, if the volume constraints hold in order to glue the "ON periods" together.
The steps undertaken by the post-treatment algorithm to smooth the control signal by flipping switch time value within their corresponding time steps are further illustrated in Algorithm A3.