PRES22_0231.docx DOI: 10.3303/CET2294127 Paper Received: 14 April 2022; Revised: 08 May 2022; Accepted: 11 May 2022 Please cite this article as: De Mel I., Klymenko O.V., Short M., 2022, Complementarity Reformulations for Designing Distributed Energy Systems within Unbalanced Distribution Networks, Chemical Engineering Transactions, 94, 763-768 DOI:10.3303/CET2294127 CHEMICAL ENGINEERING TRANSACTIONS VOL. 94, 2022 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Yee Van Fan, Jiří J. Klemeš, Sandro Nižetić Copyright © 2022, AIDIC Servizi S.r.l. ISBN 978-88-95608-93-8; ISSN 2283-9216 Complementarity Reformulations for Designing Distributed Energy Systems within Unbalanced Distribution Networks Ishanki De Mel, Oleksiy V. Klymenko, Michael Short* Department of Chemical and Process Engineering, University of Surrey, Guildford, United Kingdom GU2 7XH m.short@surrey.ac.uk Increasing deployment of renewable energy resources for power generation has been playing a pivotal role in reducing carbon emissions associated with electrical power systems. Distributed Energy Systems (DES) enable the integration of small-scale renewable energy resources and storage technologies within low-voltage (LV) distribution networks, which supply power to residential and commercial consumers. Care must be taken when designing these systems, as they could potentially impair the operation and infrastructure of existing power networks. While nonlinear balanced optimal power flow formulations have historically been incorporated into oversimplified Mixed-Integer Linear Programming (MILP) DES design models, these do not accurately model the distribution networks to which most DES are connected. Low-voltage radial distribution networks are most closely represented by nonconvex multi-phase formulations, which are computationally complex and difficult to solve. The exclusion of these constraints within DES design models could, however, lead to infeasible designs, i.e., designs which are incompatible with the existing network and its operations. This study proposes a novel optimisation algorithm, capable of solving the large-scale and combined problem of designing DES with multiphase optimal power flow. A large-scale Nonlinear Programming (NLP) model with full power flow constraints and reformulated complementarity constraints for DES operation is used to find a feasible upper bound, if the lower bound proposed by the MILP for DES design is infeasible. The algorithm is tested using a residential case study based on a section of the IEEE EU LV network. Results for this case study show that the proposed algorithm finds a feasible DES design and operational schedule by installing three times the battery capacity initially recommended by the MILP. The MILP design remains infeasible with respect to the multiphase power flow constraints. This framework could be used to support the increase of local renewable energy generation and consumption, and the subsequent reduction of carbon intensity in existing power networks. 1. Introduction Countries, organisations, and individuals around the world are pledging their commitment to achieving Net Zero goals by 2050, to minimise the negative impacts of anthropogenic emissions on the natural environment and climate. In light of this, the integration of low-carbon distributed energy resources (DERs) is gaining more attention as a feasible alternative to the existing carbon-intensive centralised power systems. This has led to the increased uptake of small-scale low-carbon generation and storage technologies, such as solar photovoltaics (PVs) and battery systems, especially in residential settings, which operate symbiotically with existing power networks. A collection of such technologies is known as a DES. Note that DES may be connected to a variety of networks to meet different demands, such as electricity, heating, and/or cooling. DES could be used to combat rising energy costs, as consumers could contribute low-carbon power to the electrical grid and earn an income in the process. Optimal design of DES is paramount to ensure a symbiotic relationship between the centralised grid and DES, where adverse impacts on power quality and network longevity are reduced. The design of DES has been historically modelled and solved as Mixed-Integer Linear Programming (MILP) problems, which capture a multi-faceted set of constraints related to design and operation, as well as the socio- economic and environmental impacts of implementing them. Previous work has illuminated that most MILP models in literature have oversimplified the representation of the underlying distribution network associated with grid-connected DES by using the linear DC approximation (De Mel et al., 2022). This is due to the increasing 763 emphasis on achieving globally optimal solutions, often at the cost of feasibility of the design and operational schedule with respect to the distribution network. The active and reactive power flows in low-voltage (LV) distribution networks are most closely represented by multi-phase formulations, which are used in a separate class of models known as Multiphase Optimal Power Flow (MOPF) (Araujo et al., 2013). These are nonlinear, nonconvex, and cumbersome to solve on their own, so they do not include detailed constraints related to energy storage and generation technologies. Combined with the discrete and continuous decision-making structure of DES design, the complexity of the combined DES and MOPF problem grows rapidly. The absence of these complex power flow constraints in DES frameworks could lead to DES designs that exacerbate network imbalances and reduce power quality. Previous work primarily focused on combining DES design models with balanced Optimal Power Flow (OPF). These studies primarily use either unscalable linear approximations (Mashayekh et al., 2017) and mixed-integer nonlinear programming methods (Jordehi et al., 2021), or use metaheuristics that produce approximate solutions and often require extensive tuning (Morvaj et al., 2016) to find a solution without any guarantee on optimality. The use of external power flow simulation tools for post-optimisation power flow checks has also been proposed (Morvaj et al., 2016), but such calculations do not have any influence on design decisions within the optimisation problem. The balanced power flow approximation used in these studies also does not hold for LV radial distribution networks, which are unbalanced due to unequal load connections. Dunham et al. (2021) propose a DES design model that uses iterative linear approximations for multiphase power flow (Bernstein and Dall’anese, 2017), but these require a priori knowledge of the design to feed the linear approximation with a feasible initial point. With a significant lack of DES-MOPF studies in literature, such limitations can only be overcome with a new framework that incorporates nonlinear MOPF within DES design, where there is no reliance on a priori knowledge of the solutions of the design or power flow problems. This is the contribution of this study, where a novel optimisation algorithm is proposed for solving the DES-MOPF problem using deterministic optimisation methods. This algorithm proposes complementarity reformulations for discrete decision making, which improves the solvability of the combined model. The battery reformulation by Nazir and Almassalkhi (2021) has inspired this work. Note that the reformulations proposed in this study are more general and do not simplify battery efficiencies as done in Nazir and Almassalkhi (2021), which could compromise accuracy. The study aims to support better design of DES with respect to LV distribution networks, by studying the feasibility and impacts of implementing DES in a residential setting and comparing results to a conventional MILP framework. 2. Methodology The new algorithm for the combined DES-MOPF framework is presented in Figure 1. It solves the MILP formulation for the DES first, which includes the commonly-used linear DC approximation. This is followed by solving a NLP, which includes nonlinear MOPF constraints and linear DES design and operational constraints. Figure 1: New algorithm for solving the DES optimisation problem with MOPF Solve the MILP model for DES Remove DC power flow constraints and add MOPF constraints Ini�alise NLP by solving with fixed binary topology Solve NLP Unfix opera�onal binary variables Add reformulated constraints with small posi�ve parameter 𝜇𝜇 Is the solu�on locally op�mal? Perturb 𝜇𝜇 Decrease 𝜇𝜇 𝜇𝜇 ≤ Tolerance? Solu�on found Stop Y Y N N 764 Binary decisions made by solving the MILP are fixed to enable the initialisation of the nonlinear programming (NLP) model. This provides a feasible initial point for both the design and the power flow problems without relying on external power flow simulation tools or any a priori knowledge from the modeller. Note that DES design models typically consider operational constraints related to different DERs and networks, to ensure that the decisions, such as capacities and locations of the technologies, can meet the operational requirements. Some operational constraints, such as those preventing the simultaneous electricity purchasing and selling or battery charging and discharging, include binary variables to avoid bilinear terms which cannot be solved in an MILP framework. These can be generally represented as shown in Eq(1) and Eq(2) below, where 𝑥𝑥𝑖𝑖,𝑡𝑡 and 𝑦𝑦𝑖𝑖,𝑡𝑡 are nonnegative continuous variables, while 𝑍𝑍𝑖𝑖,𝑡𝑡 is a binary variable, with respect to sets 𝑖𝑖 ∈ 𝐼𝐼 for residences (or consumers) and 𝑡𝑡 ∈ 𝑇𝑇 for discretised time. Note that a𝑖𝑖,𝑡𝑡 and b𝑖𝑖,𝑡𝑡 are parameters, which either represent time- varying demand parameters or a large value, as found in big-M constraints. 𝑥𝑥𝑖𝑖,𝑡𝑡 ≤ a𝑖𝑖,𝑡𝑡�1 − 𝑍𝑍𝑖𝑖,𝑡𝑡� (1) 𝑦𝑦𝑖𝑖,𝑡𝑡 ≤ b𝑖𝑖,𝑡𝑡 ⋅ 𝑍𝑍𝑖𝑖,𝑡𝑡 (2) Such constraints can be replaced by an equivalent nonlinear complementarity constraint, as shown in Eq(3): 𝑥𝑥𝑖𝑖,𝑡𝑡𝑦𝑦𝑖𝑖,𝑡𝑡 = 0 (3) These constraints cannot be solved using commercial NLP solvers due to their numerical instability at the origin. A regularisation method can be used to improve the numerical stability, where a small positive parameter 𝜇𝜇 is introduced and iteratively driven down to zero (Stein et al., 2004): 𝑥𝑥𝑖𝑖,𝑡𝑡𝑦𝑦𝑖𝑖,𝑡𝑡 ≤ 𝜇𝜇 (4) These steps are portrayed in Figure 1, where the solution obtained at each iteration is checked for feasibility and local optimality. If the solution obtained is infeasible, the parameter 𝜇𝜇 is perturbed and the NLP is solved again. The final solution is found when 𝜇𝜇 reaches a value below a pre-specified tolerance that is appropriately close to zero. The aim of such reformulations is to increase the degrees of freedom in the NLP, increasing the number of variables which the MOPF constraints can influence. This is superior to using post-optimisation calculations for power flow, where there are no degrees of freedom available to the power flow constraints to influence the design and operational decisions. It also has an advantage over linear approximations, where the solutions are less reliable when compared to using the original nonconvex constraints. NLPs also tend to be much more tractable and scalable, when compared with MINLPs. The DES formulation used in this study has been presented in previous work (De Mel et al., 2021), where total annualised cost of the system (𝑇𝑇𝑇𝑇𝑇𝑇) is minimised. This includes total investment 𝑇𝑇𝐺𝐺 𝐼𝐼𝐼𝐼𝐼𝐼and operational 𝑇𝑇𝐺𝐺 𝑂𝑂𝑂𝑂 costs of the DERs (denoted by 𝐺𝐺 ∈ 𝐷𝐷𝐷𝐷𝐷𝐷), total electricity purchasing costs 𝑇𝑇𝑔𝑔𝑔𝑔𝑖𝑖𝑔𝑔, and total income 𝑇𝑇𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖 from power generation: min 𝑇𝑇𝑇𝑇𝑇𝑇 = � 𝑇𝑇𝐺𝐺 𝐼𝐼𝐼𝐼𝐼𝐼 + 𝑇𝑇𝐺𝐺 𝑂𝑂𝑂𝑂 𝐺𝐺∈𝐷𝐷𝐷𝐷𝐷𝐷 + 𝑇𝑇𝑔𝑔𝑔𝑔𝑖𝑖𝑔𝑔 − 𝑇𝑇𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖 (5) This formulation considers some of the most commonly used DERs: solar PVs for electricity generation, lithium- ion batteries for electricity storage, and gas boilers for heat generation. Note that heat generation is decoupled from electricity generation and consumption in this work, but the impacts of electrifying heating systems can be readily studied in future work using our formulation. The formulation considers the hourly operation of these over 24-h profiles for each season. The main multiphase power flow formulations for active power 𝑃𝑃𝑖𝑖,𝑡𝑡 𝜙𝜙 and reactive power 𝑄𝑄𝑖𝑖,𝑡𝑡 𝜙𝜙 at each node 𝑛𝑛 ∈ 𝑁𝑁, phase 𝜙𝜙 ∈ Φ, and time 𝑡𝑡 ∈ 𝑇𝑇 are summarised in Eq(6) and Eq(7). 𝑃𝑃𝑖𝑖,𝑡𝑡 𝜙𝜙 = 𝑉𝑉𝑖𝑖,𝑡𝑡 𝜙𝜙 � � 𝑉𝑉𝑖𝑖,𝑡𝑡 𝜙𝜙 �gmn 𝜙𝜙𝜙𝜙 cos �𝜃𝜃𝑖𝑖,𝑡𝑡 𝜙𝜙 − 𝜃𝜃𝑖𝑖,𝑡𝑡 𝜙𝜙 � + bmn 𝜙𝜙φ sin �𝜃𝜃𝑖𝑖,𝑡𝑡 𝜙𝜙 − 𝜃𝜃𝑖𝑖,𝑡𝑡 𝜙𝜙 �� 𝜙𝜙∈Φ 𝑖𝑖∈𝐼𝐼 (6) 𝑄𝑄𝑖𝑖,𝑡𝑡 𝜙𝜙 = 𝑉𝑉𝑖𝑖,𝑡𝑡 𝜙𝜙 � � 𝑉𝑉𝑖𝑖,𝑡𝑡 𝜙𝜙 �gmn 𝜙𝜙φ sin �𝜃𝜃𝑖𝑖,𝑡𝑡 𝜙𝜙 − 𝜃𝜃𝑖𝑖,𝑡𝑡 𝜙𝜙 � − bmn 𝜙𝜙φ cos �𝜃𝜃𝑖𝑖,𝑡𝑡 𝜙𝜙 − 𝜃𝜃𝑖𝑖,𝑡𝑡 𝜙𝜙 �� 𝜙𝜙∈Φ𝑖𝑖∈𝐼𝐼 (7) The bus voltage magnitude at each phase is represented by 𝑉𝑉𝑖𝑖,𝑡𝑡 𝜙𝜙 , while 𝜃𝜃𝑖𝑖,𝑡𝑡 𝜙𝜙 is the voltage angle. The parameters gmn 𝜙𝜙𝜙𝜙 and bmn 𝜙𝜙φ are conductance and susceptance at each branch, obtained using the calculations for the multiphase admittance matrix. Other constraints include lower and upper bounds for voltage magnitude, as specified by power networks, and ensuring that there are no power injections at connecting buses that do not 765 generate nor consume power. The active and reactive powers at each bus in the MOPF formulation are also linked using constraints to the net power injections from the DES, which take power imports and exports into account. 3. Results and Discussion The algorithm uses the commercial MILP solver CPLEX (IBM, 2018) and NLP solver CONOPT (Drud, 1985). The resulting NLP model for the combined DES-MOPF framework contains 331,420 continuous variables and 459,064 constraints for the residential case study outlined below. The models have been formulated and solved on Python using Pyomo (Hart et al., 2011). 3.1 Case study The residential case study has been adapted from a section of the 906-bus IEEE EU LV Test Feeder (IEEE, 2020). The network considered here consists of 11 loads or consumers connected to one of the three phases, as shown in Figure 2. The slack bus is the primary tap of a Delta-Wye step-down transformer, which supplies power to the consumers at a line-to-line voltage of 416 V. Network-specific inputs include cable lengths and parameters such as resistance and reactance, which are used to calculate the three-phase admittance matrix. The DERs, which include PVs, batteries, and boilers, are to be installed at these consumer locations. Seasonal 24-h demand profiles for electricity and heat consumption, discretised to hourly timestamps, have been derived based on the electricity profile provided for one day in 1-min intervals in the original test case (IEEE, 2020) and average seasonal trends for electricity and heating. Solar irradiance profiles, low-carbon generation and export tariffs, electricity purchasing tariffs for daytime and night-time have all been considered as deterministic inputs to the model. Technology parameters include the available surface area for PV installation on rooftops (35 m2), space available for battery installation (0.5 m3), efficiencies, rated capacities, capacity and maintenance costs, and battery-specific parameters such as maximum depth of discharge. Figure 2: The LV distribution network with 11 loads, extracted from the IEEE EU LV Test Feeder (IEEE, 2020) 3.2 Results The results for the DES-MOPF framework obtained by using the algorithm proposed in this study are presented in Table 1 alongside the results for a conventional MILP formulation which includes the DC approximation in place of MOPF. The MILP is also tested using a post-optimisation power flow simulation for comparison, where the design and operational variables are all fixed (removing the degrees of freedom for the MOPF), and multiphase active and reactive power flows are calculated. All the costs provided in Table 1 are annualised. These results highlight that the MILP initially predicts the lowest total annualised cost, but the power flow simulation confirms that this solution is infeasible with respect to the network constraints. The DES-MOPF objective, on the other hand, is a mere 0.7 % higher than the initial MILP prediction, but the overall DES design is different to that of the MILP to ensure feasibility with respect to the distribution network. The differences in design are indicated in Table 1 by the lower PV investment cost and higher battery investment cost in the DES- MOPF result. The proposed algorithm also has a higher computational expense, as shown in Table 1, resulting in a longer computational time compared to the MILP and the post-optimisation simulation. It is, however, capable of finding a feasible solution upfront, which the MILP combined with the power flow calculation fails to achieve in this instance. The reasons behind the differing designs and operational schedules are further explored and exemplified in Figure 3, which captures the voltages and powers exported to the grid by Bus 249 during the summer, at peak solar irradiation. Note that the dimensionless per-unit (p.u.) system has been used in these models as commonly done in electrical engineering, and the voltages are reported in p.u. In Figure 3a, the post-optimisation check confirms that voltage constraints are violated by the MILP design and operational schedule, while the DES- 70 34 225 73 & 74 47 83 178 248 & 249 208 Key Phase A Phase B Phase C ∆-Y Transformer 11 kV - 0.416 kV Bus 0 766 MOPF evades such violations due to the existence of MOPF constraints influencing the design and operational decisions. Note that, in the MILP solution, several other consumers violate voltage constraints as well. The MILP chooses to not install a battery at Bus 249, and instead profit from exporting more power to the grid, as shown in Figure 3b. This is ill-suited, as the network cannot accept large power exports without violating the constraints placed to protect the infrastructure and power quality, especially as other consumers would be exporting power during peak PV production times as well. The DES-MOPF model achieves a feasible solution by installing batteries or increasing battery capacities at these nodes and storing more power, as opposed to exporting as much excess power as possible. In this case study, the higher battery investment costs and lower power exports do not significantly increase the total annualised cost of the DES-MOPF model when compared to that of the MILP. This is because the stored power is used later in the day by the consumers themselves, increasing the proportion of renewable energy used locally and minimising high daytime electricity purchasing costs. Table 1: Results from a conventional MILP, followed by a post-optimisation power flow calculation (MILP+PF simulation), and the proposed framework (DES-MOPF) Breakdown MILP MILP+PF simulation DES-MOPF Total annualised cost (objective) (£) 12,536 - 12,629 Grid electricity cost (£) 2,805 - 2,683 PV investment cost (£) 9,711 - 9,291 PV operational cost (£) 688 - 658 Boiler investment cost (£) 1,963 - 1,963 Boiler operational cost (£) 8,065 - 8,065 Battery investment cost (£) 48 - 125 Battery operational cost (£) 20 - 52 Electricity export income (£) 3,089 - 2,877 Electricity generation income (£) 7,674 - 7,329 Time taken (s) 55 1,490 2,662 Solver termination status Optimal Infeasible Locally Optimal Figure 3: a) The voltages (in the per-unit system) at phase B and b) electricity exported to the grid by Bus 249 in summer. The benefits of using the DES-MOPF framework and the new algorithm for designing DES are evident from these results. The reformulated complementarity constraints allow the MOPF constraints to have greater influence on the DES operation and design variables. In this instance, the algorithm is capable of finding an objective value very similar to that of the original MILP prediction, without violating network constraints. The algorithm also has a clear advantage over post-optimisation power flow checks, where the latter cannot find a feasible solution without a method to iteratively revise the design and operation proposed by the MILP. Although the results from the proposed method are not globally optimal, they are locally optimal and can guarantee feasibility with respect to the more complex representations of real-world physical systems, such as the low- voltage distribution network. In summary, the framework can significantly contribute to greater generation and 767 consumption of locally generated renewable energy resources connected to low-voltage distribution networks, while protecting existing network infrastructure. 4. Conclusions The study proposes a new algorithm for finding feasible solutions to the complex and combined problem of designing DES, with respect to multiphase and unbalanced power flow in low-voltage distribution networks. The feasibility of the design is ensured by incorporating MOPF constraints that influence DES design and operational decisions, and by using complementarity reformulations in place of binary variables for DES operational constraints to increase the degrees of freedom. Solutions of this framework and algorithm are compared with conventional methods of solving the combined problem, such as an MILP model which excludes multiphase power flow, and the use of power flow calculations post-optimisation. The results for a residential case study demonstrate that the algorithm has significant advantages over existing methods. It finds a feasible DES design and operational schedule without violating network constraints, where its objective value has a less than 1 % percentage difference to that of the MILP. The MILP solution proves to be infeasible when tested with post- optimisation power flow calculations. The proposed method opts for greater local renewable energy consumption by installing 3 times more battery storage compared with the MILP for this case study, as opposed to exporting nearly 6 % more excess power to the network. The scalability of this method is to be tested further in future work, as the proposed framework has a higher computational burden due to the additional complexity. The framework could extensively support the achievement of Net Zero targets, as it enables greater integration and use of local renewable energy resources while preserving existing distribution network infrastructure. Acknowledgments We thank Dr. Kyri Baker for recommending the use of the per-unit system for the MOPF model. References Araujo L.R., De Penido D.R.R., Vieira F.D.A., 2013, A multiphase optimal power flow algorithm for unbalanced distribution systems, International Journal of Electrical Power & Energy Systems, 53(1), 632–642. Bernstein A., Dall’anese E., 2017, Linear power-flow models in multiphase distribution networks, IEEE PES Innovative Smart Grid Technologies Conference Europe, ISGT-Europe 2017 – Proceedings, 2018-January, 1–6. De Mel I., Klymenko O.V., Short M., 2021, Optimal Design of Distributed Energy Systems Considering the Impacts on Electrical Power Networks, Arxiv preprint, arxiv.2109.11228. De Mel I., Klymenko O.V., Short M., 2022, Balancing accuracy and complexity in optimisation models of distributed energy systems and microgrids with optimal power flow: A review, Sustainable Energy Technologies and Assessments, 52, 102066. Drud A., 1985, CONOPT: A GRG code for large sparse dynamic nonlinear optimization problems, Mathematical Programming, 31(2), 153–191. Dunham H., Cutler D., Mishra S., Li X., 2020, Cost-optimal evaluation of centralized and distributed microgrid topologies considering voltage constraints, Energy for Sustainable Development, 56, 88–97. Hart W.E., Watson J.P., Woodruff D. L., 2011, Pyomo: Modeling and solving mathematical programs in Python, Mathematical Programming Computation, 3(3), 219–260. IBM, 2018, IMB ILOG CPLEX Optimization Studio V12.8, , accessed 28.09.2020. IEEE, 2020, IEEE PES Test Feeder – Resources, , accessed 12.11.2021. Mashayekh S., Stadler M., Cardoso G., Heleno M., 2017, A mixed integer linear programming approach for optimal DER portfolio, sizing, and placement in multi-energy microgrids, Applied Energy, 187, 154–168. Morvaj B., Evins R., Carmeliet J., 2016, Optimization framework for distributed energy systems with integrated electrical grid constraints, Applied Energy, 171, 296–313. Nazir N., Almassalkhi M., 2021, Guaranteeing a physically realizable battery dispatch without charge-discharge complementarity constraints, IEEE Transactions on Smart Grid (Early Access), 10.1109/TSG.2021.3109805. Jordehi A.R., Javadi M.S., Catalão, J.P.S., 2021, Optimal placement of battery swap stations in microgrids with micro pumped hydro storage systems, photovoltaic, wind and geothermal distributed generators, International Journal of Electrical Power and Energy Systems, 125, 106483. Stein O., Oldenburg J., Marquardt W., 2004, Continuous reformulations of discrete–continuous optimization problems, Computers & Chemical Engineering, 28(10), 1951–1966. 768 PRES22_0262.pdf Complementarity Reformulations for Designing Distributed Energy Systems within Unbalanced Distribution Networks