Optimal Charging of Electric Vehicles with Trading on the Intraday Electricity Market

Trading on the energy market is a possible way to reduce the electricity costs of charging electric vehicles at public charging stations. In many European countries, it is possible to trade electricity until shortly before the period of delivery on so called intraday electricity markets. In the present work, the potential for reducing the electricity costs by trading on the intraday market is investigated using the example of the German market. Based on simulations, the authors reveal that by optimizing the charging schedule together with the trading on the intraday electricity market, the costs can be reduced by around 8% compared to purchasing all the required energy from the energy supplier. By allowing the charging station operator to resell the energy to the intraday electricity market, an additional cost reduction of around 1% can be achieved. Besides the potential cost savings, the impacts of the trading unit and of the lead time of the intraday electricity market on the costs are investigated. The authors reveal that the achievable electricity costs can be strongly affected by the lead time, while the trading unit has only a minor effect on the costs.


Introduction
The increasing penetration of electric vehicles (EVs) makes the operation of public charging stations-for example, at shopping malls-a more and more interesting business case.In the literature, different approaches for reducing the operating costs of such charging stations are proposed, like providing capacity to the frequency regulation market [1][2][3], using the batteries of the EVs to shave the peak of an additional base load [4,5], employing renewable energy resources [6,7] or shifting electricity consumption to off-peak periods of time-of-use (TOU) electricity rates [8,9].
A further approach to reducing the operating costs is the participation in the electricity market.Numerous publications investigate the charging of EVs with trading on the day-ahead market [10][11][12][13][14][15].An intelligent trading on the day-ahead market can lead to a significant reduction of the electricity costs arising from charging EVs.However, it is hard to realize in practice, since it requires the knowledge or at least a good prediction of the energy requirements of the EVs that have to be charged on the next day.Especially for public charging stations, the prediction of the next day's usage can be very challenging.
In many European countries, like Germany, it is possible to trade electricity until shortly before the period of delivery on so called intraday electricity markets.For example, the German intraday market of the European Power Exchange (EPEX SPOT) [16] allows the trading of 15-min contracts until 30 min before delivery.This makes it possible to reduce the costs of EV charging by trading on the intraday market without the need to predict future charging demands.However, EV charging with trading on the intraday market has been paid much less attention in the literature than EV charging with trading on the day-ahead market.Goebel and Jacobsen [17] proposed an approach for the control of EV charging with the provisioning of negative reserves to the regulation market and with trading of electricity on the intraday market.In this approach, the trading of electricity is not optimized with respect to the costs.Instead, required electricity is ordered as late as possible, regardless of the electricity prices.Sánchez-Martín et al. [18] describe a two-stage approach to EV charging with trading on the electricity market: In the first stage, electricity is traded on the day-ahead market based on forecasts of EV staying patterns.In the second stage, deviations from the forecasts are handled by trading on the intraday market.Sánchez-Martín et al. assume the intraday electricity market prices for the different delivery periods to be constant and they do not consider that previously bought electricity can be resold.In practice, the price for a certain delivery period can vary over the time, what can make the reselling of energy profitable.
In the present work, we assume a scenario where the operator or aggregator of multiple charging stations can receive energy from two different sources: from the energy supplier for an invariant price and from the intraday electricity market.Technically and legally such a scenario can be realized.However, this requires the approval of the energy supplier, for example, in exchange for an extra fee.Energy bought from the intraday market can be resold before it is delivered.In this way it is not only possible to benefit from periods of low market prices, but additionally, to gain profit from changes in the prices without the need for speculating on them.The trading decisions are solely based on currently available information.No forecasts of charging demands or prices are used.Since it is assumed that the charging stations belong to the control area of the energy supplier, no balancing charges have to be considered.
We formulate the problem of cost-optimal scheduling of EV charging and energy trading for the described scenario in the form of a mixed-integer linear program (MILP).In a simulation study, the proposed approach for reducing the costs for EV charging is evaluated on data from the German intraday market and is compared to a baseline scenario without the possibility of reselling energy and to a scenario completely without trading on the energy market.Additionally, we investigate how a reduction of the lead time and the trading unit of the intraday market affect the potential cost savings, since such a reduction may happen in the future.Furthermore, we discuss practical aspects of a realization of the proposed approach, including an evaluation of the compute intensity.
The rest of the paper is organized as follows: Section 2 explains the German intraday market.In Section 3, the problem is described more in detail and a MILP formulation of it is presented.Section 4 discusses the simulations and its results.Section 5 discusses aspects regarding a realization of the proposed approach and finally, Section 6 provides a conclusion and outlook.

The Intraday Electricity Market
The German EPEX SPOT intraday market allows the trading of electricity on an hourly, as well as on a 30-min and 15-min basis.The latter means, that electricity for 96 delivery periods (corresponding to 0:00-0:15, 0:15-0:30, and so on) can be traded.The trading for the 15-min periods of a day starts at 4 p.m. on the previous day and each period can be traded until 30 min before the start of the period.The trading unit is 100 kW, corresponding to 25 kWh of energy for 15-min trades.
The trading is done by placing buy or sell orders for certain amounts of electricity, certain delivery intervals and certain maximum and minimum prices, respectively, on the market.Orders that are fulfilled, are removed from the market.The trading is continuous, meaning that whenever two active orders match each other, the corresponding transaction is immediately processed.Orders can be partially processed.For example, if a buy order A for 1000 kW matches a sell order B for 600 kW, then 600 kW are traded and the quantity of the order A is updated to 400 kW.
Since the market offers are not accessible free of charge, we assume a simplified model of the market in the present work: On the EPEX SPOT website [19], statistics about transactions are available for each delivery period.This includes the minimum, maximum, and average price of the transactions so far.Furthermore, the price of the last transaction is provided and is updated at intervals of around 10 min.We assume that this "last price" is a fixed price for buying and selling electricity at the corresponding point in time.This simplification is not far from reality, since shortly before, there existed buy and sell offers with this price on the market.
Figure 1 exemplarily illustrates the workings of the intraday market under the simplifying assumptions.There are different electricity prices for each full quarter of an hour of the day and the price for an individual quarter can change until 30 min before the quarter starts.In the given example, it would be for instance possible to buy at 9:00 a.m.energy for the delivery period 10:00-10:15 at a price of 20.5 euros per MWh.At 9:15 a.m., it is possible to resell the purchased energy at a price of 22.6 euros per MWh.If the energy is not resold until 9:30 a.m., it has to be consumed between 10:00 a.m. and 10:15 a.m.

Problem Formulation
We consider an operator of multiple charging stations with a certain maximum charging power P max , each.The day is divided into T scheduling intervals t = 1, . . ., T of length ∆t.Distributed over the day, N EVs arrive at the charging stations and want to charge.Each EV n has a start interval s n in which it starts charging, an energy requirement E n and a deadline interval f n by which the required energy has to be charged.The deadline interval must not be earlier than the earliest possible deadline f e n = s n + E n P max •∆t .We assume f n < T for all EVs n.The energy for charging the arriving EVs can be either received from the energy supplier at a fixed price p supl or can be bought from the intraday market.Additionally, it is possible to resell energy on the energy market.The goal is to compute at the start of each interval t with N t > 1 connected EVs a cost-optimal schedule of the charging rates for the connected EVs in the intervals t to T, including the decision how much of the charged energy is bought from the intraday market and how much energy is resold.The resulting decisions for trading on the intraday market are immediately implemented.This is illustrated in Figure 2.
The left hand side shows the schedule for two EVs at the beginning of an interval t.For the intervals t to t + 3, a portion of the charged energy is received from the intraday market.For interval t + 4, the complete energy is received from the energy supplier since the intraday market price is high.The right hand side shows the schedule at the beginning of the next interval t + 1.The energy bought in interval t is now available for the charging in intervals t + 1 to t + 3.However, since the market prices changed compared to interval t, it is decided to resell the energy that was previously bought for interval t + 3 and to compensate this by buying energy for interval t + 4. The charging plans for the two EVs are adjusted accordingly.As described in Section 2, the trading on the intraday market has to be done in units u of 100 kW (respectively 25 kWh for 15-min trades).Furthermore, trades have to be done with a lead time L of at least 30 min before delivery.These constraints have to be regarded by the scheduling.
The scheduling problem in a certain interval t c can be formulated as MILP as follows: min P supl,t ≥ 0, P sell,t ≥ 0, P buy,t ≥ 0 ∀t = t c , . . ., T The nomenclature used for the MILP formulation can be found in Table 1.Constraint (2) ensures that the energy required by all connected EVs is charged by their deadlines.Constraint (4) expresses that the energy charged in an interval has to be bought from the supplier or from the intraday market, or has to be already available because it was bought from the intraday market in a previous time step t < t c .P avail,t denotes the power that was already bought for interval t and that is not resold so far.Constraints ( 5) and (6) ensure that the power traded on the intraday market is a multiple of the trading unit u.The constraints ( 7) and ( 8) set the upper bounds for the number of trading units sold and bought on the intraday market.The upper bound for the sold energy is the amount of available energy.The energy bought for an interval t must not exceed the energy that can be consumed at the maximum by the EVs connected in interval t minus the already available energy for interval t.The usage of the binary variable Sell t in ( 7) and ( 8) ensures that energy is not bought and sold simultaneously for the same interval.The lead time is regarded by constraint (9).
In simulations, we evaluated the charging of EVs with trading on the intraday electricity market according the given MILP formulation.This is discussed in the following section.

Use Case
The charging of multiple EVs on 35 different days is simulated.For the intraday market prices, we use data obtained from the EPEX SPOT website on 35 days between January and April 2018.Since in Germany several taxes and levies have to be paid for electricity, we add 10 euro cent per kWh (7 cent renewable energy apportionment, 2 cent taxes and 1 cent additional levies) to the intraday market prices.For the price p supl for electricity from the energy supplier, we assume 15 euro cent per kWh, which is at the time of writing (2018) a realistic electricity price for industrial consumers in Germany [20].
We simulated the charging for different numbers (10, 20, 50 and 100) N of EVs per day.Each EV has a battery capacity of 120 kWh.The arrival times of the EVs are chosen normally distributed with a mean of 12 p.m. (interval 48) and a standard deviation of two hours (8 intervals).The initial states of charge of the EVs are drawn uniformly distributed from [0.3, 0.7] and it is assumed that all EVs have to be fully charged.The deadline interval of an EV n is set to the earliest possible deadline, plus two hours (8 intervals): f n = f e n + 8.In the simulations, a maximum charging power P max of 50 kW is assumed.
Three scenarios are investigated in the simulation study: The main scenario as described in Section 3, a baseline scenario in which reselling energy to the intraday market is not possible, and a scenario without trading on the electricity market.The optimization problem in the baseline scenario is analogous to that in the main scenario (Equations ( 1)-( 11)) with the exception that the number S t of sold trading units is set to 0 for all intervals t.In the scenario without trading on the electricity market, all the charged energy has to be obtained from the energy supplier resulting in electricity costs of ∑ N n=1 E n • p supl for the charging on a day.As solver for the MILP problems, SCIP (Solving Constraint Integer Programs) version 5.0.0 [21] is used in the study.

Simulation Results
Figure 3 shows the average daily costs of charging different numbers of EVs per day for the three considered scenarios.The lead time and trading unit in the main and baseline scenario are set according to the current policies of the German intraday market.One can see that the trading on the intraday market can notably decrease the costs compared to purchasing all the energy from the energy supplier.With 100 EVs per day, the average costs in the main scenario are about 77 euros lower than in the scenario without energy market trading.This is a cost reduction of about 8.6%.The maximum cost reduction over the 35 considered days is 278 euros.The costs in the main scenario are lower than those in the baseline scenario.However, the differences (see Figure 4) are small.With 100 EVs per day the average daily costs in the main scenario are about 5.7 euros (0.7%) lower than those in the baseline scenario.The reason the difference is comparatively small is not that only little energy is resold.This can be seen in Figure 5, which shows the power bought and sold in the main scenario for the different delivery intervals averaged over the 35 considered days with 100 EVs.One can see that a high amount of energy is resold.On average, a power of 7.6 MW (or an energy of 1.9 MWh, respectively) is sold per day.However, the average savings resulting from this selling are only 5.7 euros.The variance of the electricity price for an individual delivery interval is too small to achieve higher savings.Additionally, the trading unit and lead time constraints might obstruct higher savings.
To investigate the impact of the trading unit on the costs, we repeated the simulations with trading units of 25, 50, and 75 kW.The average daily savings with these trading units compared to a trading unit of 100 kW are shown in Figure 6 for the main and the baseline scenario for different numbers of EVs per day.With an increasing number of EVs per day, the savings tend to decrease because with a higher number of EVs it is easier to fulfill the constraint of a trading unit of 100 kW.Furthermore, in most cases the savings are higher for the baseline scenario than for the main scenario.However, all in all one can say that decreasing the trading unit has only a minor impact on the charging costs.In a further study, the effect of decreasing the lead time is investigated.Figure 7 shows the savings obtained by setting the lead time to 0 and 1 interval(s) (0 and 15 min, respectively) compared to a lead time of 2 intervals (30 min).The trading unit is set to 100 kW.One can see that a decrease of the lead time yields a notable reduction of the costs in the main scenario.For the baseline scenario, there are only minor savings.Figure 8 shows the average daily savings with the main scenario compared to the baseline scenario with a lead time of 0 intervals and a trading unit of 100 kW.With 100 EVs per day, the costs in the main scenario are about 15 euros lower than in the baseline scenario.This corresponds to a cost reduction of about 1.8%.Compared to the scenario without trading on the intraday market, the costs are around 88 euros (10.2%) lower in the main scenario.

Discussion of Aspects Regarding a Realization
The realization of the described approach requires the monitoring of the charging stations and charging processes.Data relevant for the scheduling, like the number of connected EVs, their states of charge (SoCs) and the intraday market data, has to be transferred to a central scheduler.The intraday market data can be retrieved over special APIs provided by real time data vendors [22].To enable a customer to specify her/his requirements (desired SoC and target deadline), an adequate interface is required.This can be a user interface at the charging station or in the EV, or a mobile application, which directly sends the data to the central scheduler.The communication between the controller in the EV and the charging station can be done over the ISO/IEC 15118 protocol [23].For the transfer of data between charging stations and a central back-end, the IEC 62196 standard or the Open Charge Point Protocol (OCPP) can be used [23].The latter is an open standard defined by the Open Charge Alliance-a consortium of different operators and manufacturers of EV charging infrastructure.It does not only allow the transfer of status information from charging stations to the back-end, but also the setting of charging profiles for individual charging stations.An overview over different standards for communication in the context of EV charging can be found in a study by ElaadNL [24].
Another important aspect besides the transfer and availability of input data is the compute intensity of the optimizations.In each scheduling interval with at least one connected EV, an optimization has to be performed.Thus, the runtime of an optimization must not exceed the length of a scheduling interval.The time required for solving a given MILP problem highly depends on the used solver [25] and the solver's parameter settings (SCIP has more than 1600 parameters).However, in order to convey a sense of the compute intensity of the proposed approach, we measured the runtime of different optimizations on a machine with a Core i5-4460-CPU (3.2 GHz) and 8 GB RAM.The parameter heuristics/emphasis of SCIP is set to "fast" in the optimizations and all other parameters are left to their default values.The results of the measurements are summarized in Table 2.For up to 200 EVs per day, the runtimes are in an acceptable range.With 200 EVs per day the optimizations of a complete day take on average around 7 s.With 300 EVs per day the runtimes are significantly higher than with 200 EVs.These runtimes might be too high for a practical realization.However, as already pointed out, there is potential for reducing the runtimes by choosing other parameter settings or another solver.

Conclusions
In the present work, the charging of electric vehicles with trading on the intraday electricity market is investigated and a mixed-integer linear programming formulation of the resulting optimization problem is provided.The proposed approach does not rely on forecasts of future charging demands or electricity prices.Simulation studies have shown that purchasing energy from the German intraday market can notably reduce the electricity costs compared to purchasing all the required energy from the energy supplier.In the considered use case the costs for charging 100 EVs reduce on average by 72 euros (8%).An additional cost reduction of around 6 euros results from reselling energy on the intraday market.A reduction of the lead time, which is currently 30 min, would enable further cost reductions, especially if energy is resold (around 10 euros for 100 EVs per day).A decrease of the trading unit yields only minor cost reductions.
However, it has to be assumed that the energy supplier charges an additional fee for making it possible to consume energy simultaneously from the supplier and from the market.
As future work we plan to investigate if the costs can be further reduced by improving the optimization.By the usage of mixed-integer linear programming it is ensured that all subproblems are optimally solved.However, usually there are multiple global optima for a subproblem and the choice of the solution has an impact on the results of the subsequent subproblems.Thus, it is not ensured that the total costs over a day are optimal.For example, with the help of further constraints, it might be possible to enforce that solutions are chosen that lead to daily costs lower than those observed in the described studies.
A further topic of future work can be the tuning of parameters of SCIP in order to increase the scalability of the optimizations regarding the number of EVs.This can be done with help of tools for automated parameter tuning like irace [26] or SMAC [27].The use of irace for the automated tuning of SCIP parameters on benchmark problems is already described by López-Ibáñez and Stützle [28].

Figure 1 .
Figure 1.Illustration of the (simplified) workings of the intraday electricity market.

Figure 3 .
Figure 3. Costs arising from charging different numbers of EVs per day averaged over 35 days.The costs are shown for the three considered scenarios.A lead time of 30 min (2 intervals) and a trading unit of 100 kW is assumed for the intraday market trading.

Figure 4 .
Figure 4. Average daily savings with the main scenario compared to the baseline scenario for a lead time of 2 intervals and a trading unit of 100 kW.

Figure 5 .
Figure 5. Energy market transactions and power purchased from the energy supplier in the main scenario for the different delivery intervals of the day averaged over 35 days with a lead time of 2 intervals, a trading unit of 100 kW and 100 EVs.

Figure 6 .
Figure 6.Average daily savings with trading units of 25, 50 and 75 kW compared to a trading unit of 100 kW.

Figure 7 .
Figure 7. Average daily savings with lead times of 0 and 1 interval(s) compared to a lead time of 2 intervals.The trading unit is set to 100 kW.

Figure 8 .
Figure 8.Average daily savings with the main scenario compared to the baseline scenario for a lead time of 0 intervals and a trading unit of 100 kW.
Schedule of the charging of two EVs at the start of two subsequent intervals t and t + 1.

Table 1 .
Nomenclature.Intraday market electricity price for delivery interval t at time k in money units per kWh P supl,t Power received from the energy supplier in interval t in kW P buy,t Power bought on the intraday market for delivery in interval t in kW P sell,t Power sold on the intraday market for delivery in interval t in kW P avail,t Available power (i.e., power bought in previous intervals) for interval t in kW P n,t Charging power for the n-th connected EV in interval t in kW S t Number of trading units sold for delivery interval t B t Number of trading units bought for delivery interval t Sell t Flag indicating if energy is sold for delivery interval t

Table 2 .
Runtime of the optimizations that have to be performed for the charging scheduling in the main scenario on one day for different numbers of EVs per day.Shown are the minimum, average and maximum values over the 35 days.The lead time is set to 2 intervals and the trading unit to 100 kW.