Increasing distributed generation hosting capacity in distribution systems via optimal coordination of electric vehicle aggregators

This work presents a novel strategy, designed from the distribution system operator viewpoint, aimed at estimating the hosting capacity in electric distribution systems when controllable plug-in electric vehicles are in place. The strategy seeks to determine the maximum wind-based distributed generation penetration by coordinating, on a forecast basis, the dispatch of electric vehicle aggregators, the operation of voltage regulation devices, and the active and reactive distributed generation power injections. Different from previous works, the proposed approach leverages controllable features of electric vehicles taking into account technical electric vehicle characteristics, driving behaviour of electric vehicle owners, and electric vehicle energy requirements to accomplish their primary purpose. The presented strategy is formulated as a two-stage stochastic mixed-integer linear programming problem. The ﬁrst stage maximises the distributed generation installed capacity, while the second stage minimises the energy losses during the planning horizon. Probability density functions are used to describe the uncertainties associated with renewable distributed generation, conventional demand, and electric vehicle driving patterns. Obtained results show that controlling the power dispatched to electric vehicle aggregators can increase the distributed generation hosting capacity by up to 15% (given


INTRODUCTION
Aiming for a low-carbon economy, many governments are setting targets for electricity supply from renewable-based generation. To achieve these targets, energy markets are being liberalised to incentivise the participation of independent investors in the deployment of renewable-based distributed generation (DG) [1]. Under this scenario, distribution system operators (DSOs) must be prepared to accommodate increasing DG penetration levels in the electric distribution system (EDS), irrespective of the size and location of DG units. This condition gives rise to the concept of hosting capacity, defined as the maximum amount of DG that can be installed in an EDS without violating operational limits. The DSO, responsible of ensuring an economical, secure, and reliable EDS operation fully exploiting the available system infrastructure, is motivated to seek strategies to increase the DG penetration in the EDS. In general, the hosting capacity in EDSs is constrained by voltage and thermal limits, which can be violated depending on the DG penetration level, the variability of power production, and the lack of correlation of power production with demand. An approach to increase the hosting capacity consists in applying active network management (ANM) schemes to solve infeasible conditions during the system operation stage. In the literature, most strategies to estimate the hosting capacity of EDSs are formulated as optimisation algorithms that simulate the coordinated application of ANM schemes based on forecasts of generation and demand [2]. For example, [3] proposes a deterministic optimal power flow-based technique for evaluating the hosting capacity of wind-based generation. This strategy includes ANM schemes such as voltage control through voltage regulators (VRs), adaptive DG power factor and generation curtailment. In [4], the strategy in [3] was upgraded to explore the potential benefits of dynamic network reconfiguration on the hosting capacity. Santos et al. [5] include the operation of energy storage systems in a multistage stochastic model formulated to estimate the hosting capacity of wind and solar-based DG. In [6], a two-stage robust optimisation approach is proposed to take into account the operation of static-VAr compensators and capacitor banks, when seeking the maximum penetration of photovoltaic (PV) DG. Other technologies have been incorporated into the hosting capacity problem including active medium-voltage and low-voltage transformers [7] and open unified power quality conditioner [8].
In the context of EDS optimisation, demand side management (DSM) techniques have been proved effective for different applications, such as load shifting, peak shaving and valley filling, implemented to satisfy the operational constraints [9]. Nevertheless, in the above-discussed works [3]- [8], the potential benefits of DSM are not explored in the hosting capacity problem. According to the developed literature review, only [10] and [11] address this alternative through strategies in which the consumption of controllable loads is managed by the DSO.
Regarding controllable loads, plug-in electric vehicles (EVs) have an important potential for DSM due to their increasing penetration in EDSs. In the United States only, the EV population is expected to growth to more than 2.7 million by 2023 [12]. To take advantage of this potential, several strategies for DSM using EVs have been proposed. For instance, a two-level optimal EVs charging coordination algorithm for preventing line congestion, voltage drops, and transformer congestion was presented in [13]. Shafie-Khah et al. [14] propose a two-level optimisation model to coordinate the operation of plug-in EVs and renewable-based DG to allow parking lot operators to participate in energy, reserve, and regulation distribution markets. In [15], the EV active and reactive power outputs are coordinated in a hierarchical framework that minimises EV load curtailment, power losses, and load shifting. A management framework that uses EVs with vehicle to grid (V2G) technology to reduce the residential operation cost and the PV generation curtailment is developed in [16].
Although a comprehensive range of applications for plug-in EVs is proposed in [13][14][15][16], few works investigate the implications of considering EVs in the hosting capacity problem [17] and [18]. The strategy in [17] consists in an optimisation model that evaluates the hosting capacity using second-use EV batteries. In this work, retired batteries from EVs are connected to PV systems to smooth the output power by coordinating the charging and discharging of such batteries. Since EV batteries are considered as static energy storage systems, the complexities introduced by the driving behaviour of EV owners are not taken into account. In [18], the behaviour of EV drivers is incorporated into the hosting capacity problem by modelling the batteries state of charge (SOC) and arriving and departing times using a probabilistic approach. This work models EVs as uncontrollable loads and, thus, their contribution to increase the hosting capacity is marginal as discussed in the results section. It is worth mentioning that, an appropriate analysis of hosting capacity with controllable EV consumption, in addition to considering the driving behaviour of EV owners, should also seek to satisfy the energy needs of EVs to accomplish their primary purpose. In addition, in [19] it is shown that there exists a trade-off between DG penetration level and EDS energy losses. Therefore, strategies developed to increase the hosting capacity should also take into account the effect of procuring large DG penetration levels on EDS energy losses.
Filling the void existing in the literature, this work presents a novel strategy for DG hosting capacity assessment in EDSs, which simultaneously considers the integration of controllable plug-in EVs. This strategy is designed from the DSO viewpoint and aims at estimating the maximum wind-based DG penetration in an EDS, maintaining a suitable operation (avoiding voltage and thermal limit breaches and reducing energy losses). Different from [17] and [18], this strategy leverages controllable features of EVs taking into account technical EV characteristics, the driving behaviour of EV owners and the condition of satisfying the energy needs of individual EVs. To reduce the complexity of the problem, the EV population is considered clustered at specific EDS nodes that represent EV aggregators. The maximum wind-based DG penetration is estimated by coordinating, on a forecast basis, the power dispatch of EV aggregators, the operation of VRs and on-load tap changers (OLTCs), and the active/reactive power injection from DG units.
The proposed approach is based on a two-stage stochastic mixed-integer linear programming (MILP) formulation. Here, the first stage maximises the DG installed capacity, and the decision variables are associated with the DG size at specified locations and OLTC/VR tap positions. The second stage simulates the operating reaction of the system to the firststage decisions. This stage minimises the energy losses during the planning horizon, while complying with system constraints, by adjusting the EV aggregators dispatch, DG reactive power and DG active power curtailment. In addition, probability density functions (PDFs) are used to describe the uncertainties associated with conventional demand, wind-based power generation, EV arrival and departure times, and EV daily travel mileage. From these PDFs a large set of scenarios is generated and later reduced using a backward reduction technique. The primary contributions of the presented work are twofold: • A novel strategy for the hosting capacity assessment in EDSs that leverages the controllable features of EVs to enable higher DG penetrations ensuring a suitable system operation. Unlike existing literature, the power dispatch of aggregated EVs is controlled taking into account technical EV characteristics, EV driving patterns, and the condition of satisfying the energy needs of individual EVs. • A two-stage stochastic MILP model formulated to coordinate the power dispatch of EV aggregators, the operation of VRs/OLTCs and the active/reactive power injection from DG units. This model can be used as a tool to assist the DSO in the decision-making process applied to estimate the amount of DG that can be connected in an EDS. Decisions are made on a forecast basis taking into account forecast errors related to DG power production, conventional load demand, and EV owners behaviour.

PROBLEM DESCRIPTION
In this work, the DG penetration in EDSs is maximised by optimally coordinating EV aggregators, VRs, OLTCs, and active and reactive power injection from DG units. The proposed approach to tackle this problem is through a two-stage stochastic formulation that takes into account the uncertainties associated with forecasted wind power generation, conventional demand, and EV owner's behaviours.
In this section, a PDF-based uncertainty characterisation is presented. While PDFs can successfully capture uncertain behaviours, the use of continous PDFs leads to cumbersome formulations hard to solve. Therefore, a scenario generation process that allows the approximation of PDFs into a finite number of uncertainty realisations (scenarios) is later introduced. In addition, a model for EV aggregators is presented. Finally, the two-stage stochastic problem is formulated as an MILP model.

Uncertainty characterisation
The DG hosting capacity problem involves several uncertain parameters related to wind availability, load demand, and EV driving patterns. If uncertainties are not taken into account, the planning decisions can result in infeasible system operating conditions and increased operating costs. In this work, PDFs are duly used to cope with this issue, and is presented as follows.

Wind power uncertainty
The power output of a wind-based DG unit directly depends on the wind speed. An expression commonly used to model the uncertain behaviour of wind speed at a given location is the Rayleigh PDF [20], expressed as follows: Equation (1) models for each time interval t the occurrence of wind speed values v t when a certain valuev t has been forecasted. The relationship between the standard deviation t and v t is determined by t = √ 2v t . For a realisation of the wind speed at a time interval t (v t ), the normalised wind power (relative to the installed capacity) is estimated using (2), which is a linear approximation of the wind turbine performance curve [19].
where v ci , v r and v co , respectively, indicate the cut-in, rated, and cut-off speeds of the wind turbine.

Conventional demand uncertainties
The uncertain behaviour of the power demanded by conventional loads connected into the EDS is modelled using a normal PDF. More specifically, the realisations of power demand are assumed to be normally distributed around the predicted value with standard deviation equal to 2%. Similar to g t for the wind power, the term d t is used to represent the realisations of the conventional demand.

Uncertainty in EV driving patterns
The daily travel pattern of individual EVs is characterised according to the data obtained from the national household travel behaviour survey conducted by the U.S. Department of Transportation -Federal Highway Administration [21]. A statistical probability method is used to deduce the underlying PDFs of travel behaviours as described in [22]. The times when the EVs first plug out of the grid and last plug into the grid in 1 day are modelled with segmented normal distributions, as presented in (3) and (4). In addition, the daily travel mileage of EVs is modelled in (5) using a logarithmic normal distribution.
In this work, (3)(4)(5) are employed to determine the occurrence probability of departure time (t dep m ), arrival time (t arr m ), and travel mileage (x m ), respectively, for an EV m. The shape of these PDFs ( f r (t ), f e (t ), and f d (x)) is defined by the following values: r = 8.92, r = 3.24, e = 17.47, e = 3.41, d = 2.98,

Scenario generation process
The accuracy with which a set of scenarios approximates the PDFs increases with the number of scenarios [23]. However, increasing the number of scenarios also implies increasing the computational complexity of the optimisation problem. Therefore, it becomes necessary a mean to obtain a set of representative scenarios that efficiently approximate the PDFs, allowing the solution of the optimisation problem using viable computational capabilities.
In this work, the process of generating representative scenarios to approximate the PDFs that describe the uncertain parameters in the hosting capacity problem consists of two steps: 1. The first step consists in obtaining a large set S of scenarios with equal probabilities, randomly generated from the PDFs presented in Subsection 2.1. A scenarioŝ, contained in S , includes a profile of: (i) wind power ( g t,ŝ ), (ii) conventional demand ( d t,ŝ ), and (iii) EV arrival and departure times and travel mileage denoted by t arr m,ŝ , t dep m,ŝ , and x m,ŝ , respectively. 2. The second step uses the simultaneous backward reduction technique described in [24] to reduce the set S to a more tractable set S . This technique calculates for each scenario s within S a probability of occurrence s . The accuracy with which the reduced set of scenarios approximates the initial set (and, therefore, the true PDFs) was tested in [24] via numerical simulations.

Modelling of EV aggregators
As mentioned in Section 1, controllable characteristics of EVs have been employed to improve the operation of EDSs. Nevertheless, the complexity of centralised EV charging coordination algorithms increases with the size of the EV population. Hence, certain applications have considered the EV population as clustered at specific nodes to achieve manageable computational efforts [14,25,26]. The proposed approach takes advantage of the clustered EV features to increase the penetration of DG. Thus, the charging scheme of individual EVs remains out of the scope, as it is assumed to be determined in a distributed manner, either by commercial aggregators, the DSO, or by parking lot operators. Hereafter, the entity that manages a collection of EVs clustered at a specific node will be referred as an aggregator.
Applied to the hosting capacity problem, the proposed approach assumes that the DSO decides the amount of power to be drawn from or injected into the EDS by each EV aggregator at each time interval. Later, EV aggregators will define individual charging schedules for all EVs, while satisfying EV energy needs. Figure 1 illustrates this hierarchical interaction. Note that, the EV aggregators should convey to consume or inject the power defined by the DSO. The DSO determines the amount of power to be injected or drawn by each EV aggregator cognizant of the number of EVs plugged into the grid (participating in charging/discharging) and the aggregated SOC. Given the uncertain behaviour of EVs, the number of EVs plugged into the grid and the aggregated SOC at each time interval must be dealt with in a probabilistic manner.
As explained in Subsection 2.1.3, PDFs are used to model the uncertainties associated with EVs. From these PDFs, scenarios of connection status and SOC are generated for each EV. Based on these data, the power and energy limits of each aggregator, for each time interval and scenario of uncertainty, are calculated by the set (6-10). Further, these limits are incorporated by DSO into the optimisation process to determine the EDS hosting capacity. By taking into account the information of individual EVs, the DSO make decisions in a way that enables aggregators to later attend individual EV energy needs.
In the above formulation, the indices j ; t ; s correspond to the sets N ; T ; S , respectively. The maximum storage capacity (E max j,t,s ) of the aggregator at bus j is calculated in (6) (for each time interval t and scenario s) in terms of the EV individual battery capacities (E cap m ). In the same fashion, the maximum powers that can be drawn and injected (P EV+ j,t,s , P EV− j,t,s ) by the aggregator at node j are calculated in (7) and (8) (for each time interval t and scenario s) in terms of the charging and discharging powers of individual EVs. The binary parameter f m,t,s in (6-8) represents the connection status of each EV m, at time interval t and scenario s, and is equal to 1 when the EV is plugged into the network and 0 otherwise. The value assumed by f m,t,s depends on the times when the EV m plugs into the grid (t arr m,s ) and plugs out of the grid (t dep m,s ). These two times are uncertain parameters described by the PDFs defined in (3) and (4).
The total increase (E arr j,t,s ) and drop (E dep j,t,s ) in the energy stored by the aggregator at node j due to EVs arriving and departing at time interval t are calculated in (9) and (10), respectively. In  (x m,s ), which is also a uncertain parameter described by the PDF defined in (5). In (10), the EVs are considered to depart with the battery fully charged. By doing so, the DSO ensures that aggregators are capable of satisfying individual EV charging needs.
Different from a conventional demand, the formulation in (6-10) models each aggregation of EVs as a virtual storage device with dynamic and uncertain power and energy capacities. These virtual storage devices can consume power when charging EVs and inject power using V2G capabilities. Therefore, by dispatching power for the aggregators within the bounds, the DSO can leverage the EV control features to increase the DG penetration.

Mathematical model
In this work, the DG hosting capacity problem in EDSs is initially formulated as a two-stage stochastic MILP model. Figure 2 illustrates the structure of the proposed approach, where: 1. The first stage maximises the DG capacity installed in predefined locations and minimises the expectation of the optimal values of total energy losses (obtained from the second stage) evaluated over all uncertainty realisations described by the PDFs presented in Subsection 2.1. In this stage, the decision variables are the DG installed capacity at each bus (P ic j ) and the OLTC/VR tap position (tap j,t ) at each time interval. The OLTC/VR tap positions are considered as first-stage decisions because the response time of OLTC/VR devices does not allow them to adjust their settings to follow the fast variations of the uncertain parameters. Therefore, the OLTC/VR tap positions are optimised to satisfy all uncertainty realisations during each time interval. 2. The second stage simulates the operating reaction of the system to the first-stage decisions and seeks to minimise the energy losses during the planing horizon, while complying with system constraints. For each uncertainty realisation, the second stage reacts by adjusting the dispatch of EV aggregators, the DG reactive power, and the DG active power curtailment.
The use of continuous PDFs to describe the random parameters in the problem formulation leads to an infinite number of possible realisations of uncertainties and, consequently, to an intractable problem. The standard approach to solving this kind of problems is to approximate the PDFs with a finite number of scenarios [23]. By applying this approximation, the original problem can be written as an MILP model that can be solved using classical optimisation techniques. In the proposed approach, the PDFs that describe the uncertainties associated to the DG hosting capacity problem are approximated using the set S , as explained in Section 2.1. Hence, the mathematical formulation that approximates the original problem is modelled by the objective function (11), subject to the set (12-39).
P i j,t,s = P p i j,t,s − P n i j,t,s , ∀i j, t, s, P G j,t,s = P av j,t,s − P curt j,t,s , ∀ j, t, s, P av j,t,s = g t,s P ic j , ∀ j, t, s, Where, the indices i j; i, j ; s; t correspond to the sets L; N ; S ; T , respectively. In this formulation, the objective function (11) simultaneously maximises the total DG installed capacity (first term) and minimises the expected value of energy losses evaluated over all scenarios s ∈ S with probability s (second term).
To define the priority of each objective, 1 and 2 are assigned as weighting factors. This objective function is subject to the set (12-39). Constraints, (12-23) represent the EDS steady-state operation and technical limits. The active and reactive power balances are defined in (12) and (13). From these expressions, the active and reactive power demands ( d P d and d Q d ) are modelled using the uncertain parameter d (described by a normal PDF) that models the customers behaviour and the peakload demand (P d and Q d ). The voltage drop at EDS branches is defined by (14), while (15-21) model the magnitude squared of the current. The expressions (15)(16)(17)(18)(19)(20)(21) are the result of approximating V 2 I sqr = P 2 + Q 2 ; where the left term is linearised using the nominal voltage magnitude (V n ), and the right term via a piecewise linearisation, wherēdefines the maximum number of segments to be used [27]. Since operating conditions of an EDS must be fulfilled, (22) and (23) define the maximum current flow allowed in branches and voltage magnitude limits, respectively. For each node j where a VR/OLTC device is located, expressions (24-28) are used. The regulated voltage magnitude, which depends of the step of voltage variation (Δtap) and the tap position (tap), is determined in (24). The range of variation of the tap position of a VR/OLTC device is defined in constraint (25). In (26)(27)(28), the switching operations of a VR/OLTC device are limited to a maximum number allowed during the planning horizon.
Constraints (29-33) model the DG operation. Where, (29) defines the active power injected by a wind-based DG unit (P G ) in terms of the available active power (P av ) and the curtailed power (P curt ). Meanwhile, (30) calculates P av as the product between the installed DG capacity (P ic ) and the generation level relative to that capacity ( g ), which is an uncertain parameter dependent on the wind speed as discussed in Subsection 2.1. Constraint (31) limits the curtailed power at each time interval and scenario to be less than the available power. In (32), the generation curtailment during the planning horizon is limited for each DG unit to a maximum percentage (denoted by c ) of its available generation. The allowed energy curtailment is to be distributed throughout the planning horizon in order increase the connected DG capacity by alleviating voltage and thermal limit violations. The value of c is defined via contract between DG developers and the DSO prior to the optimisation, as stated in [3]. In (33) the reactive power capability of generators is limited to a power factor range determined by the maximum leading and lagging power factor angles.
Moreover, the operation of EV aggregators is modelled in (34-39). Equation (34) models the dynamic energy balance of EV aggregators. According to that model, at each time interval t , the stored energy of an aggregated collection of EVs (E j,t,s ) is defined in terms of the energy stored at time interval t − 1 (E j,t −1,s ), the energy increase due to EVs arriving (E arr j,t,s ), the energy drop due to EVs departing (E dep j,t,s ), the energy drawn from the grid ( P EV + j,t,s ) and the energy injected into the grid ( P EV − j,t,s ∕ ). In (35) it is stated that the stored energy at the time interval t 0 that precedes the first time interval of a day, is equal to the stored energy at the last time interval t lt of the same day. In addition, (36-38) limit the stored energy (E j,t,s ), power draw (P EV + j,t,s ), and power injection (P EV − j,t,s ) of the EVs aggregated at bus j to maximum values estimated according to the procedure presented in Subsection 2.3. To avoid drawing and injecting power at the same time interval t , the logical constraint (39) is employed.

CASES AND SIMULATION RESULTS
In this section, assumptions, test cases, and numerical results, are presented. The optimisation model was coded in AMPL and solved using CPLEX.

Case description
The performance of the proposed approach is assessed on simulations using a 33-bus distribution system obtained from [28]. This is a 12.66 kV system, with nominal load of 3.715 MW and substation transformer with capacity of 5 MVA. In addition, the maximum and minimum voltage limits are set at 1.05 and 0.95 p.u., respectively. As illustrated in Figure 3, three buses (14, 26 and 31) are considered as candidate locations for wind-based DG allocation. For the tests performed here, an OLTC is installed at the main substation, capable of regulating ±5% of the input voltage in steps of Δtap 0 = 0.0125 p.u. The maximum number of switching operations for the 48 time intervals was set at 16. In addition, DG units are operated between a 0.9 lagging and 0.9 leading power factor range and a maximum generation curtailment of 7% can be applied to overcome system limit violations. The cut-in, rated, and cut-off speeds of the wind turbines are 4, 14, and 25 m/s, respectively [20].
Regarding the EVs, Nissan Leaf EVs with 24 kWh battery capacity, 4 kW charging power, 2 kW discharging power,   [29]. Further, the EV population is clustered in the same proportion at nodes 8, 18, 22 and 33. The locations were chosen at the end of distribution lines and close to DGs to magnify the impact of EVs on system's voltages and power flows. Although different locations for EV aggregators may impact the results for hosting capacity, they have no impact on the efficiency of the proposed optimisation strategy.
The planning horizon is 1 year represented by 2 days, divided into 24 time intervals each. These two days represent the two characteristic seasons of tropical climate countries, and contain predicted information regarding the general behaviour of demand hourly variations, wind speed, and EV driving patterns. The accuracy with which these two days represent the 1-year planning horizon depends on the prediction method. The adoption of sophisticated prediction methods is beyond the scope of this work, here the demand and wind speed profiles shown in Figure 4 are used. The daily EV driving patterns are subject to the PDFs presented in Subsection 2.1, and are considered to be the same for the two representative days. It is worth mentioning that, the proposed approach is generic and can be applied to countries with different climate conditions, for which additional data on demand, wind speed, and EV driving patterns should be added.
As mentioned in Subsection 2.2, one scenario is defined as the state of (i) wind speed; (ii) conventional demand, and (iii) EV connection status and SOC; for all time intervals within the whole study period. Here, a set S of 1000 scenarios is randomly generated from the PDFs presented in Subsection 2.1. Later, S is reduced to a set S of 30 scenarios using simultaneous backward reduction technique.

Test cases and numerical results
To assess the advantages of applying the proposed approach, the DG hosting capacity and overall losses are optimised considering two different analysis. In the first analysis, the EV penetration level is gradually increased and, by applying control strategies, the maximum DG hosting capacity of the 33-bus distribution system is determined. The second analysis compares the performances of the proposed stochastic approach and the deterministic counterpart.

Analysis by increasing the EV penetration level
For a comprehensive analysis, EV penetrations of 20%, 40% and 60% (representing 188, 376, and 564 EVs, respectively) are assessed under three different test conditions. In this work, the EV penetration level is expressed as the ratio between the peak load demand and the rated charging power of the EV population. The test cases are defined as follows: 1. Case I: once plugged into the grid, EVs are charged at maximum rate without any charging coordination scheme. 2. Case II: considers that the aggregators can adjust their power draw by coordinating the EV charging. 3. Case III: considers EVs with V2G capabilities and, therefore, the aggregators can adjust their power draw and injection by coordinating the EVs charging and discharging. Figure 5 shows the DG installed capacity (a) and expected energy losses (b) for each case considering the stated EV penetration levels. According to Figure 5a, with a 20% EV penetration level, the uncoordinated EV charging strategy in Case I resulted in a DG installed capacity of 5.05 MW. Meanwhile, the possibility of coordinating the EV charging in Case II and the EV charging and discharging in Case III increased such capacity by 2.70% and 7.34%, respectively. When the EV penetration level was increased to 40%, Case I resulted in a DG installed capacity of 5.02 MW. Comparing this result with the obtained with 20% EV penetration level, it is evident that a larger EV population does not necessarily lead to an increased DG hosting capacity if its charging is not properly coordinated. However, when the conditions established in Cases II and III are considered, the DG hosting capacities are greater than those obtained with a 20% EV penetration level. For Case II, the increase was 2.5% while for Case III it was 5.5%. Moreover, at 60% EV penetration, in Case I, yields infeasible operating conditions due to a large inflexible load that triggers voltage and thermal limit violations. On the other hand, the strategies in Cases II and III ensure the feasible system operation and enable improved access for DG integration. When compared with the previous scenario (40% EV penetration level), Cases II and III obtained 2.25% and 4.35% more DG installed capacity, respectively. In addition to showing the total DG installed capacity for each case and EV penetration level, Figure 5a also illustrates the contribution of each candidate bus to this total. Due to its proximity to the main substation, a largest DG capacity was allocated at bus 26. Figure 5b presents, for all cases, the expected energy losses over all simulated scenarios, obtained from the second term of (11). From Figure 5a,b it is observed that, for all EV penetration levels, even with higher DG installed capacity, Cases II and III lead to lower energy losses than Case I. Results of Case I, with 20% and 40% EV penetration level, evidence that a larger uncoordinated EV population entails increased energy losses. In Case II, energy losses reach a minimum value (approximately 673 MWh) that is independent of the EV penetration level and it is conditioned by the limitations of the only charging scheme. In contrast, Case III improves energy losses as EV penetration level increases.
To maximise the DG hosting capacity, the proposed approach defines the dispatch of EV aggregators for each time interval and uncertainty realisation. Figure 6 shows, for the 40% EV penetration level, the expected values of power injected and drawn by the EV aggregators together with the power injected by the DG units. As shown in Figure 6a, in Case I, without coordination, the EV population demand concentrates between time intervals 13-24 and 37-48. This behaviour is determined by the EV arriving times and initial SOC of batteries, whose patterns Differently, in Case II, the EV population demand is relocated to those time intervals with higher DG power injection as shown in Figure 6b. From Figure 6c it can be observed, that when V2G technology is enabled, the general behaviour of the EV population is to adjust the power draw and injection to follow the DG power production. Note, that the operation status of EV aggregators is also dependent on local system conditions; therefore, it is possible to have some EV aggregators injecting power into the grid while others draw power from the grid at the same time interval. This situation is illustrated in Figure 6c, where EV power injection and draw coincide at some time intervals.

Comparative analysis of stochastic and deterministic approaches
For a comprehensive analysis, the deterministic counterpart of Case III under 40% of EV penetration level was solved. The deterministic case is evaluated using the demand and wind profiles shown in Figure 4, together with a scenario of arriving  Table 1 summarises, for each case, the installed DG capacity, average values of energy losses and power flow through the substation, and the risk indices of voltage and thermal limit violations. The risk indices of upper and lower voltage limit violations are calculated using (40) and (41), respectively. Meanwhile, (42) is used to calculate the thermal limit violation index. Table 1 shows that Case III.dt installed a greater DG capacity than Case III.st. The reason for this is that, Case III.dt determines the maximum hosting capacity based on a single predicted scenario; whereas a more conservative solution is provided by Case III.st to account for the forecast errors. A greater DG installed capacity in Case III.dt is naturally reflected in greater energy losses because of the increased power flows in the system lines, which also result in higher energy exports to the upstream system as shown in Table 1. In both cases, III.st and III.dt, the solutions under evaluation do not lead to upper voltage and thermal limit violations. Lower voltage limit violations were obtained in both cases; however, in Case III.st this  value is significantly smaller than in Case III.dt. These results show that, for all uncertainty realisations the system response, in terms of readjustment of the EV aggregator dispatch, DG reactive power support, and generation curtailment, is effective in solving thermal limit violations. However, since OLTC tap positions must be maintained for all uncertainty realisations, voltage violations are prone to occur.
In Figure 7, each boxplot summarises, for each time interval, the voltage magnitudes at bus 33 obtained for the 1200 scenarios used to evaluate the solutions of cases III.st and III.dt. According to Figure 7a, Case III.st was effective in preventing upper and lower voltage limit violations, with only a few scenarios presenting voltage values slightly below the lower limit. On the other hand, from Figure 7b, Case III.dt does not exhibit upper voltage limit violations; however, the first quartile at several time intervals presents voltage values significantly below the lower limit. These voltage violations are explained by the deterministic nature of Case III.dt, which determines the configuration of DG sizes and OLTC tap settings based on a single scenario. In this sense, since Case III.dt accommodates the DG capacity based on the information provided by a single scenario, the OLTC tap positions tends to be lower than those determined in Case III.st, whose solutions also depend on information related to forecast errors. From Figures 7b and 8 it is observed that Case III.dt presents lower voltage limit violations at time intervals with OLTC tap positions lower than in Case III.st. Note, that results shown in Figure 7 are consistent with the values of upper and lower voltage limit violations indices presented in Table 1.
Overall, the above results demonstrate that the configuration of DG sizes and OLTC tap settings obtained with the stochastic approach ensures, to a greater extent, a secure system operation, which in this analysis is conditioned by the scenarios selected to represent the realisation of the uncertain parameters. Conversely, when considering the solution of the deterministic approach, the system operator would need to resort to corrective actions to ensure the secure system operation. These actions could lead, for example, to higher percentage of generation curtailment and number of OLTC switching operations than the values established in the planning stage.

CONCLUSION
In this manuscript, a stochastic approach to increase the hosting capacity of wind-based distributed generation (DG) in distribution systems is proposed. This approach involves the development of an optimisation model that maximises the DG installed capacity and minimises energy losses relying on the active participation of electric vehicle (EV) aggregators, traditional voltage control devices, and DG units. Probability distribution functions are used to describe the uncertainties related to wind power production, load demand, and EV driving patters. Numerical results demonstrate that increasing the EV penetration level does not necessarily lead to a greater DG hosting capacity if the EV operation is not properly coordinated. Moreover, under a 60% EV penetration level, the uncoordinated approach resulted in infeasible operating conditions. Nevertheless, when the EV aggregators are dispatched considering that they can coordinate the charging or charging/discharging of EVs, the DG hosting capacity increases with the EV penetration level, the energy losses are reduced, and the secure EDS operation is ensured. When the EV penetration level is increased from 20% to 60%, the DG hosting capacity increased 4.8% and 10.1% for the coordinated charging and charging/discharging approaches, respectively.
The Monte Carlo method was applied to assess the performance of the solutions obtained with the proposed stochastic approach in comparison to its deterministic counterpart. Results show that there is a high risk of undervoltage violations if solutions of the deterministic formulation are adopted. On the other hand, solutions of the proposed stochastic approach were effective in preventing voltage and thermal limit violations.