Risk-constrained offering strategies for a large-scale price-maker electric vehicle demand aggregator

: In this study, the problem of an electric vehicle (EV) aggregator participating in a three-settlement pool-based market is presented. In addition to energy procurement, it is assumed that EVs can sell electricity back to the markets. In order to obtain optimised solutions, the aggregator is considered as a price-maker agent who tries to minimise the cost of purchasing energy from the markets by offering price-energy bids in the day-ahead market and only energy bids in both adjustment and balancing markets. Since the problem is heavily constrained by equality constraints, the number of binary variables for a 24-hour market horizon is too large which leads to intractability when solved by traditional mathematical algorithms like the interior point. Therefore, an evolutionary metaheuristic algorithm based on genetic algorithms (GAs) is proposed to deal with the intractability. In this regard, first, the stochastic problem is formulated as a mixed-integer linear programming problem, and as a non-linear programming problem to be solved by CPLEX and GA, respectively. The former is used to ensure that the GA is tuned properly, and helps to avoid converging to local extremums. Furthermore, the solutions of the two formulations are compared in simulations to demonstrate GA could be faster in obtaining better results.


Risk measure
α confidence level β weighting factor η ω scenario-specific auxiliary variable ξ continuous auxiliary variable

Introduction
Electric vehicles (EVs) are viewed as important components in the future smart grids. The utilisation of EVs in the power networks has opened up various areas of research, focusing on the technical and economic aspects of EV integration. This is mainly due to this fact that the proper management of these vehicles under high penetrations of EVs, can have significant effects on both the customer and network [1].

Motivation
The research on EVs usually considers an aggregation agent which is responsible for managing the charging schedules of EVs and acts at the interface between the electricity markets and the EV owners [2]. EVs are equipped with batteries that enable them to store energy in off-peak hours (G2V) and supply it back to the network in peak hours (V2G). Therefore, the main problem of the aggregator is to procure enough energy for the EVs at the minimum cost and probably sell excess energy to the markets. It enforces possible limitations on customers, for example, at the time periods when they need to charge their vehicles or feed energy back to the system. On the other hand, the contracts between the aggregator and EV owners can offer certain benefits to the customers through lower electricity costs or free battery replacements. From the grid perspective, an EV aggregator is similar to the other demand-side aggregators which utilise the flexibility in time shiftable loads and act on behalf of a large number of small loads in the electricity markets [3]. The underlying assumption for such an aggregator is to schedule the on/off or charging/discharging of the loads based on the off-peak/peak hours or time periods of low/ high energy prices. This allows them to participate in various market structures and to offer bids in the markets.
Most of the current literature considers EV aggregators as pricetaker agents [4]. In papers that price-maker aggregators are considered, if the problem could be intractable, simplifying assumptions are applied to facilitate solving the problem with available tools. For instance, literature work [5] is limited to timeshiftable loads that can only be charged in three hours of the day, otherwise, its proposed algorithm is intractable. Additionally, price-maker agents could be modelled through self-schedule bidding where the aggregator only submits its energy bids to the market. To our best knowledge, there are no existing studies which address the problem of a price-maker economic bidding agent when the conventional mathematical algorithms are intractable. In this paper, we aim to propose a metaheuristic approach to tackle the intractability of the problem and show the outperformance of the presented method.

Literature survey
EV aggregation has been studied in different publications. Momber et al. [2] introduced a methodology for maximising the profit of an aggregator that participates in the day-ahead and balancing markets. Bidding strategies in both day-ahead and regulation markets are discussed in [6]. The authors in [7] consider the bidding strategy of the aggregators as a bi-level problem. The lower level problem addresses the market-clearing problem and the upper-level minimises the charging cost. Vayá and Andersson [8] solved the EV charging problem in coordination with system operator and discussed the necessary adoptions that are needed in day-ahead markets to introduce EV aggregators. In [9] a mechanism is developed to coordinate independent EV aggregators via a third-party coordinator to avoid the unnecessary rise of market prices.
In addition, the coordinated operation of aggregated EVs with renewable resources, especially wind power producers, has been investigated in several studies [10][11][12][13]. This joint operation can mitigate the inherent uncertainties in the power generation of these resources and facilitate their integration in the power system. Furthermore, they can constitute a virtual power plant that acts on their behalf in the markets [14].
Various sources of uncertainty in the power system such as market prices or the generation of renewable resources introduce risk to the decision making of the agents in the electricity markets. Regarding the EV aggregators, this problem has been addressed in several publications. Momber et al. [2] models the uncertainties using a set of scenarios and hedges the risk by adding the conditional value-at-risk (CVaR) measure to the problem. Other approaches use Monte-Carlo simulation [15] and robust optimisation [5,16].
If the amount of traded energy of an aggregator can influence market prices, the aggregator is considered as a price-maker agent.
Recently, a few studies have paid attention to this issue since the advancement in new technologies in demand-side allow providing a higher amount of demand response from the customer side. In particular, the authors in [17] address the effect of time-shiftable loads on energy prices. In this study, generic models for such flexible loads are proposed and included in the optimisation problem to investigate their effect on market settlement. A large price-maker agent can have impact on both market cleared energy and the cleared price. In [18][19][20] only the impact of market participant on energy has been considered. This type of pricemaker agent is called self-scheduling. On the other hand, the methodologies in [17,21,22] consider both energy and price bids for price-maker participant which makes it as a price-maker economic bidding agent.
Compared to the preliminary conference version [21], this study has the following major improvements: (i) The two pool-based markets in [21] are extended to three markets, and the number of considered EVs is significantly increased. (ii) In the current work, two types of solution methods are considered and compared. The two approaches are a mathematical algorithm based on the traditional CPLEX tool and a metaheuristic one; whereas the authors in [21] only solve the problem through CPLEX algorithm. (iii) The large number of EVs and a 24-hour market horizon are the main challenges of the CPLEX approach in the sense that the problem becomes intractable when the number of EVs, time slots and scenarios are increased. In fact, the proposed model in [21] is not practical due to the small number of EVs in the case study. To address this issue, in this paper, a metaheuristic methodology based on GAs is proposed, where the problem is reformulated as a nonlinear optimisation problem to be solved by GA. Therefore, in contrast with [21], here the problem is formulated twice, (i) as a mixed-integer programming problem to be solved by CPLEX and (ii) as a non-linear programming problem which is solved by GA.
(iv) As far as we know, previous studies including [21], in which a price-maker economic bidding problem is modelled, use simplified assumptions to make the problem tractable. This paper, on the other hand, proposes a GA-based methodology through which the problem is solved without simplification. Specifically, it should be noted that, due to the number of binary variables, the price-maker economic bidding problems are mathematically more complicated than price-taker and/or self-schedule ones. Accordingly, the solution of such formulation is better optimised, as demonstrated in this paper. Therefore, this paper serves as a reference where the price-maker economic bidding problem is handled without simplification. (v) The numerical results are extended to present the application of economic bidding method and GA.

Contributions
Compared with the home appliances, EVs usually need more electricity and also have this unique ability to store energy. These features along with the significant increase in the number of EVs allow aggregating a large number of vehicles which possibly can act as a price-maker in the electricity market. Therefore, in this paper we extend the price maker concept to an aggregator who coordinates a large fleet of EVs and acts as an economic bidding agent in the day-ahead market.
Although EV aggregator problem has been reported in prior literature, some challenging issues still remain that should be addressed properly. In particular, there is a great need for a methodology to deal with the intractability of price-maker economic bidding EV aggregators. Moreover, a few studies are available that investigate the application of metaheuristic algorithms in replacing conventional methods to increase the problem solving speed. However, none of these studies have modelled the price-maker economic bidding aggregator. For example, The authors in [23] proposed a methodology to reduce the solution computing time of market clearing problem. Compared to our work, both papers use GA to reduce the solution time of the problem in question. While the exact methods can successfully solve the problem in this paper, in our work the problem is intractable when solved by the traditional mathematical approaches in CPLEX. The contributions of the present work are as follows: (i) The proposed optimisation framework includes a price-maker agent participating in a three-settlement pool-based market. The considered agent is a price-maker EV aggregator who participates in the day-ahead market by offering price-energy bids (economic bidding) and in adjustment and balancing markets by offering only energy bids (self-schedule). The price-maker problem is non-linear which is properly transformed into a mixed-integer linear problem (MILP). (ii) The problem is benchmarked against self-schedule scheme where the EV aggregator participates in the day-ahead market by offering energy bids only. (iii) From implementation point of view, the MILP problem can be time consuming, seeing as the exponential relationship between the number of variables and the time that it takes to solve a mixedinteger problem. Accordingly, an evolutionary metaheuristic algorithm based on GA is proposed to cope with problem intractability. To this end, the problem is reformulated to be solved by GA. One novel aspect of the formulation is that the selection of energy and prices from price quota curves (PQCs) is done through Roulette wheel selection (RWS). Besides, a novel selection method is used in 'Selection' step of GA which enables it to find feasible solutions.
(iv) Finally, the problem is formulated as a risk-averse optimisation problem by adding a CVaR risk measure to the objective function.

Paper organisation
The remaining sections are organised as follows. Section 2 describes the market framework and explains two different strategies which are used for solving the problem. The mathematical formulation of the problem and the formulation which is used in the genetic algorithm (GA) are proposed in Section 3. Section 4 is dedicated to numerical results of the problem based on Iberian electricity market data. Section 5, provides a concluding discussion.

Problem description
The problem under consideration is the minimisation of the costs of an EV aggregator who participates in a three-settlement poolbased market including the day-ahead, adjustment and balancing markets, on a short-term basis. It is assumed that EVs can sell electricity back to the network. The considered aggregator offers price-energy bids in the day-ahead market and only offers energy bids in the adjustment and balancing markets. The objective function consists of the difference between the cost of purchasing energy from the markets and the profit of selling energy back to the market, along with the cost of battery degradation and CVaR risk criterion. The problem constraints are composed of two parts: (i) technical constraints of EVs' batteries and (ii) the corresponding market constraints. Finally, the problem is formulated as a stochastic programming problem. Main sources of uncertainty are market prices which are modelled via scenarios using PQCs. The problem is non-linear but it can be transformed into a MILP problem as it is explained in the following sections. Fig. 1 illustrates the problem of the paper. The aggregator, after collecting EVs' demands, uses an optimiser to offer energy and price bids to the pool market. After the market is cleared, the cleared energy and prices are available to the aggregator. Then the aggregator submits the charging and discharging schedules to EV owners. In this work, 'optimiser' is modelled via two different approaches, a CPLEX-based mathematical algorithm and an evolutionary metaheuristic one based on GA. The latter is proposed to deal with the intractability impediment of the former and consequently increase the speed of the solving process.

Market framework
The aggregator is considered as a price-maker agent. Since the dayahead market is the main trading floor of which the aggregator purchases most of its energy, it participates in this market by offering both energy and price bids.
In order to determine the relationship between price and energy, PQCs are used. Usually, the amount of power that a price maker produces or consumes is known as the quota of that price-maker. For a given hour, the market-clearing price can change based on the quota of the price maker. In this respect, the curve that shows the market clearing price as a function of the price maker quota is called PQC or residual demand curve as shown in Fig. 2. For a price maker consumer (producer), the hourly PQCs are step-wise monotonically increasing (decreasing) with respect to consumption level. These curves show how market clears and can be obtained using forecasting procedures [20]. Fig. 2a shows an economic bidding offer and a self-schedule offer. In the self-schedule offer, the offered energy will be cleared with the respective price, no matter how high the price can be. However, in the economic bidding offer, the cleared price and energy are limited to the offered energy and price, respectively. For example, the PQC in Fig. 2a shows a high level of offered energy with a low offered price. Therefore, the maximum allowed energy that will be cleared with this offered price is q t, ω th which is less than x t . So, the cost of purchasing q t, ω th amount of energy from the dayahead market will be: q t, ω th ⋅ p t . On the other hand, in the second PQC shown in Fig. 2b, the offered price is high enough to allow the offered energy to be cleared. However, the cleared price will be obtained based on the offered energy, i.e. λ t, ω, s < p t . Accordingly, the cost of purchasing x t will be: λ t, ω, s ⋅ x t .

Problem-solving strategies
The problem is heavily constrained by equality constraints including binary variables. It can lead to problem intractability as the number of variables increases. Therefore, in this paper, an evolutionary metaheuristic algorithm based on GAs along with the main mathematical algorithm is proposed and the results are compared. As mentioned earlier, the problem is non-linear. In the mathematical approach, there is no choice but to use binary auxiliary variables in order to transform the non-linear problem into a mixed-integer one. However, GA can solve both linear and non-linear problems without the need for those auxiliary variables of the mathematical approach. Accordingly, the number of variables will be reduced, and the solving process will be easier. Fig. 3 represents the overall schematic of this study. The problem of a price-maker EV aggregator is formulated as a pricemaker agent who participates in the day-ahead market by offering price and energy bids (economic bidding). Offering price bids in addition to that of energy lead to better-optimised solutions. The formulated problem is non-linear and therefore, it is linearised in order to be solved by the mathematical algorithm in CPLEX. Moreover, the primary non-linear problem is transformed into another non-linear form to be solved by GA. The linear model is used to solve a small-sized problem by considering some simplified assumptions [In order to reduce the number of variables, hence the size of the problem, it is assumed that the number of time slots is <24, e.g. 5.]. Next, the results are utilised to fine-tune GA and minimise the possibility of converging to local minimums. Finally, by considering all variables, the problem is solved using GA.

Optimisation problem
Let ω indicate the index of the scenario, and t represent the index of time. At each time slot t and scenario ω the considered optimisation problem can be formulated as the following: Technical constraints of EVs In this objective function, π ω is the probability of scenario ω and q t, ω , g t, ω and y t, ω are the energies purchased energy from dayahead, adjustment and balancing markets, respectively. q ⋅ λ represents the cost of energy procurement from day-ahead market. γ ⋅ g and Λ ⋅ y show the cost of purchasing energy from adjustment and balancing markets, respectively. Battery degradation is denoted by BD t, ω and only considered for selling energy to the market. The next term indicates the profit obtained by selling energy at a fixed price, P. Finally, the last term stands for the CVaR formula. Constraints (2) enforce the energy balance, meaning that the total purchased energy must be equal to the total charge of EVs. The problem is also constrained to the technical constraints of EVs which will be explained in the next section.

Problem formulation
First of all, the constraints of aggregated EVs will be presented.
The considered vehicle constraints are as follows: Constraints (4) are total batteries charge and discharge limitation, where Ē represents maximum charge/discharge rate. ϱ t, ω + and ϱ t, ω − are the total charges and discharges of vehicles at time slot t and scenario ω. Constraints (5) represent the state of charge (SOC) at each time slot and scenario. ϱ t, ω SOC is the total SOC of all batteries and ρ t, ω indicates all the energy loss due to the movement of vehicles. Constraints (6) impose the maximum and minimum limitations of SOC. Constraint (7) describes the final value of SOC.
In the following, the problem formulation for both strategies will be presented.

Mathematical optimisation format
The presented objective function in the previous section is nonlinear. In order to replace non-linear parts with linear mixed-integer terms, the following reformulation is performed.
The cost of buying energy from the day-ahead market, C t, ω , is defined as Therefore, based on the explanations in the previous section about the clearing process by means of PQCs and following the approach introduced in [17], C t, ω can be written as: the piecewise function of C t, ω can be written in the following mixed-integer form: ∀t, ω: q t, ω ≤ x t , ∀t, ω: q t, ω ≤ q t, ω th , ∀t, ω: q t, ω ∀t, ω: ∀t, ω, s: 0 ≤ a t, ω, s ≤ u t, ω, s a t, ω, s max , ∀t, ω, s: ∀t, ω: ∑ ∀t, ω, s: θ t, ω , u t, ω, s , z t, ω, s ∈ {0, 1}, where constraints (10)-(13) represent the conditions of the piecewise function, i.e. x t < q t, ω th or x t ≥ q t, ω th , and the binary variable θ t, ω decides which condition is held. The next four constraints determine C t, ω based on θ t, ω . Constraints (18)- (20) select the value of q t, ω th , p t and x t from their respective PQCs. Two other non-linear terms, i.e. γ t, ω ⋅ g t, ω and Λ t, ω ⋅ y t, ω can be replaced with: ∀t, ω, s: h t, ω, s , w t, ω, s ∈ {0, 1} .
Finally, the formulation of MILP problem is s.t.

Evolutionary metaheuristic format
As discussed in Section 1, due to a large number of variables, the computation time for solving the problem can significantly rise. Therefore, this paper proposes an evolutionary metaheuristic approach based on GA to solve this problem. GAs are global optimisation methods inspired by the Darwinian concept of survival [24,25]. In this concept, individuals with better capability of environmental adaptation will have a better chance to survive. GAs are free-derivative technics and their chance of being caught in the local optimum is low. Therefore, GAs have the potential of obtaining near global solutions, while including the constraints [26]. Constraints (10)-(32) in the previous subsection are introduced in order to deal with the non-linearity of stepwise function of PQCs. For GA, a selection mechanism based on RWS will be proposed to be replaced by the mentioned constraints. In GA, RWS is used for selecting potentially useful solutions for recombination. It works by generating a uniform random number and then, the span that includes the generated number is selected. For instance, in Fig. 4, P 2 is selected if r = U(0, 1) is greater than P 1 and less than P 1 + P 2 . Now, in a given PQC, if the stepwise function is mapped to one axis, the result will be like RWS (Fig. 5). Therefore, the selection of price/energy can be done by RWS.
To select the offered price and energy of day-ahead market, the following process is used: • x t and p t are randomly generated by means of a uniform distribution shown by U(a, b). a and b are the start and endpoint of the respective PQC. • x t determines the limitation for the cleared price, λ t, ω, s , as shown in Fig. 6. Similarly, p t determines the limitation for cleared energy, q t, ω th , which is equal to X t, ω, s min in Fig. 6. • Finally, the minimum value of price and energy will be cleared.
For example, considering the second PQC in Fig. 1 price would not be >€20/MWh. On the other hand, the offered price is €35/MWh, i.e. p t = 35 which is greater than λ t, ω, s . So, the cleared price will be €20/MWh. In other words, clearedprice = min {p t , λ t, ω, s } as shown in Fig. 6.
For the adjustment and balancing markets, only the selection of offered energy is needed, which is also the cleared energy (selfschedule). In these markets, RWS is used to determine the respective price as illustrated by Fig. 7. The values of g t, ω and y t, ω are not generated independently, due to the equality imposed by the constraints (2). In order to ensure that these constraints remain to be maintained, the following formulations are adopted: where χ t, ω, j = U(0, 1). Therefore, the constraints (10)-(32) are replaced with four RWS. Finally, the reformulated form of the problem for GA is ∀t, ω: ϱ t, ω ∀ω: ∑ t = 1 T C t, ω + γ t, ω, s g t, ω + Λ t, ω, s y t, ω ∀ω: η ω ≥ 0.
It should be noted that ϱ t, ω SOC is not an independent variable and its value is calculated using constraint (43) which is subsequently used in constraints (44). So, it is not generated by GA process.
In the following, the definition of the penalty function, crossover and mutation methods, and selection technique of GA is explained.

Penalty function:
In order to include inequality constraints of the problem, two forms of penalty function are considered in the GA.  For each constraint involving non-negative conditions, the following penalty function is added to the objective function: Note that all variables of the problem are non-negative. For each constraint involving 'smaller than or equal to' conditions, the following penalty function is added to the objective function

Crossover and mutation:
Arithmetic crossover technic is used for crossover. The percentages of crossover and mutation are 0.8 and 0.3, respectively.

Selection:
In order to select the next generation, the following procedure is followed: the total population of parents and offspring is divided into two, feasible and infeasible, matrices. The feasible matrix has priority. The individuals in the feasible matrix are sorted based on their objective function while, the individuals in the infeasible matrix are sorted based on their penalty function (Fig. 8).

Benchmark scheme
In order to compare the results of self-schedule and economic bidding offers in the day-ahead market, a modified version of the problem formulation is presented. Here, the offers become selfschedule. To this end, it is sufficient to replace the objective function (33) with (59) and constraints (10)-(25) with constraints (60)-(63), respectively, as the following:

Numerical results
This section is divided into two subsections. In the first subsection, considering some assumptions which make the problem tractable, the results of the mathematical formulation are presented. In this subsection, the impact of different factors such as economic and self-schedule bidding in the day-ahead market, risk and battery degradation are evaluated. In the second subsection, the results of metaheuristic and mathematical methods are compared, without considering the simplifying assumptions.
In order to deal with the potential problem that GA converges to local extremum points, two methods are employed: (i) Regardless of its intractability, the problem is run by CPLEX. As opposed to finding the best possible solution, it does not take long for CPLEX to find a suboptimal solution. This suboptimal point is used as an initial point for GA to reduce the possibility of converging to local minimums. (ii) GA is run more than once, using several initial points, to ensure it does not converge to local extremums. After applying these techniques, our simulation results show that the problem achieves better optimal solutions.
PQCs are estimated by using Iberian electricity market data [27]. In the following subsection, seven price scenarios are considered. The characteristics of 1000 identical EVs and parameters of CVaR measure are:

Mathematical algorithm
In this subsection, it is assumed that EVs can only be charged at 8 h of the day, seeing as the process of solving the problem through mathematical algorithms is intractable, considering all 24 h. This practical assumption reduces the number of variables, especially in the economic bidding method. Five factors affect the results: initial and final SOCs, risk criteria, economic bidding or self-schedule scheme, the period when vehicles are charged and battery degradation. Table 1 reflects the effect of all of the above factors except battery degradation. In this table, two different final SOCs are considered, 'not set' and '6 kWh' (half of the batteries' capacity). When the final SOC is not set, it automatically becomes zero at the end of the day. This is because the program tries to sell whatever energy is stored in the batteries to gain profit. Therefore, one can understand that the final SOC is set to zero in the first case. Similarly, two cases of initial SOCs are considered by setting SOC(0) to 0 or 6 kWh. Furthermore, two cases of charging time are considered: from the beginning of the day through 08:00 am, and from 10:00 pm to 06:00 am of the next day. It means that EV owners are limited to charge their vehicles at these specified time spans. The purpose is to investigate the effect of the charging time on the profit. For instance, when SOC(0) = 0 and final SOC is not set, which means final SOC will be zero to reach a more optimised result, EVs have to buy energy to utilise or sell. On the other hand, when final and initial SOCs are set to 6 kWh, EVs have to buy the exact amount of energy that they have used or sold to reach final SOC of 6 kWh at the end of the day. Therefore, in both cases, EVs buy exactly the amount of energy that they used and sold. However, as it can be seen from Table 1, if final and initial SOCs are 6 kWh, the results are better than the cases when the two SOCs are set to zero. Therefore, the presented model is helpful to determine the initial and final battery SOC.
The third factor that impacts the results is how the aggregator participates in the day-ahead market, i.e. via economic bidding or self-schedule offers. Finally, the last factor is weighting factor of β to control CVaR risk measure. Since the program tries to minimise the objective function, it can be seen that with the increase of β the expected values increase as expected. On the other hand, economic bedding results are more optimised than that of self-schedule in all cases where other factors are identical, i.e. β, initial and final SOCs, and charging time. For example, for charging time of 00:00 to 08:00 when SOC(0) = 0 and β = 0, the expected value of the economic bidding approach is equal to 635.62, while that of selfschedule method is equal to 831.61. Moreover, it can be seen that the expected values drop as SOC(0) increases. The reason is when SOC(0) = 6 the batteries are half-charged at the beginning of the time horizon and, therefore, EVs buy less energy than the case of SOC(0) = 0. Also, in case that the final SOC is not set and the initial SOC is set to 6 kWh, the results are negative. It means that EV owners are earning money, and the optimal solution is obtained when final SOC becomes zero. Hence, average battery charge dropped from 6 to 0 kWh. A portion of it is used by vehicle's movement, and the rest is sold to the markets. Only those who need >6 kWh energy for their trips buy electricity. Table 2 shows the effect of battery degradation. Considering the battery degradation will increase the costs, however, it accounts for a small amount of the total costs. Case A corresponds to Case #1 in Table 1 with initial and final SOCs equal to zero. Similarly, Case B accords with Case #2 in Table 1 with initial and final SOCs equal to 6 kWh. Note that all results are obtained considering the economic bidding approach where β = 0.5. Fig. 9 shows the impact of risk. As can be seen from this figure, by increasing β, the value of CVaR decreases and the value of objective/cost function increases. β = 0 corresponds with the riskneutral problem, and in β = 1 case, the risk is completely included in the problem. From β = 0.4 to β = 1.0 there is not much of improvement in terms of risk management, while the objective function rapidly deteriorates.

Genetic algorithm
In this subsection, the results of solving the problem with both GA and CPLEX are reported. These results are obtained using a computer with Intel ® Core TM i7-6700k CPU and 32.0 GB RAM. In solving the problem with CPLEX under GAMS, eight cores (threads) are used, and with GA, with the help of Parallel Computing Toolbox of MATLAB, four cores (workers) are utilised.
It takes a significantly long time for CPLEX to solve the problem of a price-maker economic bidding EV aggregator that participates in a three-settlement pool-based market with the 24hour market horizon. Therefore, the problem is reformulated to be solved by GA. In this respect, the size of the problem is reduced to enable CPLEX to solve it in a reasonable time. The size-reduction is done by considering a few number of time slots and scenarios. Next, the outcomes of CPLEX is used to fine-tune GA in two ways: (i) CPLEX results serve as an initial point for GA, and (2) GA parameters are adjusted to approximately reach the same results as CPLEX. Thus, CPLEX helps GA avoid local minimums as much as possible. Finally, the number of scenarios and time slots are gradually increased to find the point where CPLEX becomes intractable, and also to compare the performance of GA and the CPLEX algorithm. In addition, for the sake of simplicity, all results are obtained by setting β = 0. Also, the final SOC is set to zero, but the influence of initial SOC is investigated. Five different cases are studied to investigate the effect of the number of scenarios and time slots on the performance of the methods. The GA parameters for each case are reported in Table 3. It is worth mentioning that with a small number of scenarios and time slots, the problem can be solved via both CPLEX and GA. However, by increasing the number of scenarios and time slots, GA results become more optimised. In the following, the details of the five different cases are reported. Table 1 Obtained results with economic bidding and self-schedule schemes    (3 × 3): We start by considering only three PQC scenarios and three time slots, i.e. hours in this study. Here, the initial SOC is zero. The obtained mean cost with CPLEX is -€12.4916. The average result by running GA three times is €7.28. (3 × 3): Again there are three time slots and PQC scenarios, but the initial SOC is 6 kWh for each vehicle. The obtained mean cost with CPLEX is -€570.4916 and the average result by running GA five times is -€556.98. (5 × 5): In this case, the number of both PQC scenarios and hours are increased to five. The considered initial SOC is 6 kWh for each vehicle. The obtained mean cost with CPLEX is -€576.2818 and the average result by running GA five times is -€517.27.

Five scenarios and five time slots
The above three cases are used to tune the GA algorithm, and to show that GA can reach almost the same solution as CPLEX. In the following two cases, CPLEX becomes intractable. This is why we adopt GA in this paper. The presented GA algorithm can be used in any stochastic programming where a large number of equality constraints and binary variables lead to intractability.

5 scenarios and 12 time slots (5 × 12):
The initial SOC is 6 kWh for each vehicle. The obtained mean cost with CPLEX is -€477.2371 and the average result by running GA five times is -€504.89.
Note that in this case, it takes a longer time for CPLEX to reach the final optimal answer. Therefore, the program was interrupted by the user after 775 s CPU time. The CPU time for GA was 680 s to reach the maximum number of iterations. Therefore, GA reached a more optimised solution faster than CPLEX. It is true that GA's solution might not be the best result, but there is a trade-off between the favourable solution, computing time, and the usage of hardware resources. The computing speed of CPLEX dramatically decreases when the number of variables and the dimensions of the problem increase, whilst GA's speed is less affected by these factors.

5 scenarios and 24 time slots (5 × 24):
The initial SOC is 6 kWh for each vehicle. In this case, the problem was not solved with CPLEX because it can take a long time to respond, especially in worst-case scenarios. The average result by running GA five times is -€200.38.
The lower profit than previous cases is due to the fact that vehicles have less movement in the initial hours of the day, i.e. first 12 hours, compared to the second 12 hours.
It is notable that cases #4 and #5 are added to emphasise why GA is used. Long run-time of CPLEX in mixed-integer problems is an obstacle which is resolved by using GA. Fig. 10 shows one of the five runs of GA. There are some fluctuations before NFE ≃ 0.5 × 10 6 . It happens as the solution is infeasible and GA tries to find a feasible one. This is owing to the sorting technic that is used. Actually, GA finds the first feasible solution after around 400 iterations out of 2000 total iterations. Tables 4 and 5 show the detailed results of GA and CPLEX for the Cases 2 and 4, respectively. Each of these tables represents the expected cost per scenario obtained with both GA and CPLEX. As mentioned, for each of these cases, GA is run five times. The result of each run is presented per scenario along with the average value of all GA executions. As stated earlier, the results of CPLEX in Case 4 are not optimal solutions.
It merits mentioning here that since the considered time horizon in Table 1 is different from that of Tables 4 and 5, the results are not comparable. Fig. 11 illustrates the obtained results of solving the problem using GA and CPLEX. In the first four cases, where the number of variables is not big, the results of CPLEX are better. However, in other cases, where more scenarios and variables appear, GA is not only faster than CPLEX, but also has better solutions. The results are obtained by generating different scenarios, setting initial SOC to 6 kWh and final SOC to 0 kWh. The figure clearly demonstrates the inefficiency of CPLEX when the problem is highly complicated and constrained. Table 6 shows the obtained results by CPLEX and GA as the numbers of hours and scenarios are gradually increased. For comparison purposes, the results for initial SOC set to 0 or 6 kWh  Table 4 Case #2: Three times slots and three scenarios and GA is run five times for each scenario Table 5 Case #4: 12 times slots and five scenarios and GA is run five times for each scenario  is presented. On the other hand, final SOC is set zero for all cases. As it can be seen, in the first four rows of the table, CPLEX outperforms GA. Both computation time and optimised cost of CPLEX are better than GA in these four cases. However, these cases are impractical due to small number of scenarios and time slots. In the rest of the table, the number of scenarios and time slots are large enough to make CPLEX slower than GA or intractable. The empty rows under 'CPLEX computation time' and 'CPLEX cost' correspond to intractable cases where GAMS stopped by user. In the two cases where SOC(0) = 0, 'GA cost' is positive. This is because final SOC is set to zero, therefore, EVs have to buy electricity for their trips. However, if they do not intend to use their vehicles, they can buy energy during off-peak hours and feed it back to the network in peak hours. Consequently, the total cost is not too high.

Conclusion
A risk constrained stochastic programming problem is formulated in this paper for a price-maker economic bidding EV aggregator who participates in a three-settlement pool-based market, namely, day-ahead, adjustment and balancing markets. Given a large number of variables, the problem could be easily intractable. In order to address this issue, an evolutionary metaheuristic algorithm based on GAs is proposed, along with the mathematical optimisation method. In this regard, the problem is formulated separately for GA and mathematical method. To investigate the performance of our work, a detailed illustrative case study based on the Iberian electricity market data is presented. In this vein, three different categories of assessments are presented. First, the impact of the economic bidding strategy on the optimisation is evaluated by benchmarking the economic bidding offers of day-ahead market against self-schedule ones in this very market. The results show that the economic bidding approach transcends the self-schedule one. Second, the effect of risk is investigated by changing the weighting parameter of β. Lastly, the performance of the GA and mathematical approach are examined. We demonstrated that the mathematical algorithm is intractable when solving the problem of a price-maker economic bidding EV aggregator without simplifying assumptions. Instead, the proposed methodology based on GA is used to solve the problem. Moreover, in order to resolve the issue of the GA converging to local extremum points, we ran the program several times and considered the average as the solution.
Finally, the problem of this paper can be extended by considering the cost of parking lots as well as by adding rival aggregator whose offered prices affect on another. On the other hand, the offered methodology can be applied in modelling a virtual power plant consisting of EV aggregators and wind power producers.