A rolling horizon approach for real-time trading and portfolio optimization of end-user flexibilities

Flexible energy consumption patterns represent a significant potential for end-users to reduce their energy costs due to the increasing price volatility in the electricity spot markets. However, a simple and exhaustive description of flexibilities is needed to efficiently coordinate multiple flexible components. In this paper, we propose a simple and complete method to describe the end-user flexibility potential. The proposed method describes flexibilities of the end-user technologies as a combination of inflexible loads and virtual batteries with variable capacities. This technique allows to describe the flexible components (such as heat pumps and boilers) with the exclusive use of linear relationships which can be implemented in mixed integer optimization problems. Furthermore, a rolling horizon optimization framework is used to define the operating strategy of the end-user components and the trades at the Day-Ahead and the Intraday spot markets. Moreover, we apply our proposed methods to a reallife use case in Austria with measured data to prove their effectiveness, validity and reliability. The results show that trading energy in the Day-Ahead and the Intraday spot markets can lead the enduser to a reduction of the energy procurement costs of 8%, but at the same time increases its energy consumption by 3.21%. © 2020 Elsevier Ltd. All rights reserved.


Introduction
In recent years, share of renewable energy sources in global electricity generation has grown rapidly [1]. Some of the most commonly claimed effects that the growing share of the mainly subsidized renewable energy sources has on the wholesale electricity spot markets are the drop in the average electricity prices and a significant increase in price volatility [2]. Price volatility is the measure of the observed price fluctuations over a certain period. Studies such as [3] and [4] show how the increase of wind power and solar photovoltaic generation amplify price volatility in European electricity wholesale spot markets. Higher price volatility inevitably implies higher profit opportunities for flexible end-users [5]. Flexibility is the capability of electrical systems to alter their scheduled injection and/or consumption in reaction of external signals (e.g. spot market prices). The purpose of flexibilities are manifold, e.g. the provision of service for the energy system or the gain of monetary benefits [6]. The interest in operational flexibility of electric power systems increases with the  Price of x at the time step t for the time step z p x t,z Power of x traded at the time step t for the time step z P x Price of x and virtual batteries with variable capacities. This approach allows to describe the flexibilities of an end-user with the exclusive use of linear relationships which can be implemented in a mixed integer optimization problem. The rolling horizon optimization framework is modeled using the Python toolbox Pyomo [11]. The paper is organized as follows. Section 2 provides an overview of the state of the art in scientific literature. Section 3 presents the mathematical representation of the end-user technologies in the optimization problem and its objective function which aims to minimize the total costs. Section 4 provides the description of a real-life use case in Austria with measured data for which the rolling horizon optimization framework is simulated. Section 5 presents the comprehensive results of the case study. Finally, Section 6 concludes the paper and elaborates on possible directions for future research.

State of the art
As more renewable energy resources as wind and solar photovoltaic are integrated into a power system, the volatility of electricity generation quantities increases dramatically [12]. For this reason, the active participation of the demand side is of considerable interest for the creation of new business models [13] and for the European transition to a carbon-free energy sector [6]. However, a simple and exhaustive description of flexibilities is needed to efficiently coordinate and aggregate multiple flexible components.
In the studies [14,15] and [16] frameworks for defining and measuring flexibility in power systems are proposed, in order to evaluate the variation range of uncertainty in electricity generation that a power system can accommodate. [17] presents a method for generalizing the characteristics and the restrictions of flexible demand. [18] defines the technically available operational flexibility of individual power system units (e.g. storage systems, generators and loads) to promote the grid integration of large shares of fluctuating renewable energy generation.
In [19] the potential of EVs and their considerable temporal flexibility are used to increase the consumption of fluctuating renewable energy sources. [20] investigates the flexibility of operating electric boilers, applying different tariff structures. Furthermore, [21] investigates the flexibility potential of heating systems combined with storage systems. In particular, [22] reviews the demand flexibility of residential HPs. [23] and [24] defines a virtual battery model which provides a simple and intuitive tool to aggregate the flexibility of distributed loads. In particular, [23] presents a method to describe the flexibilities of different technologies like HPs, BATs and EVs as virtual batteries, while in [25] the flexibility of a collection of thermostatically controlled loads is modeled as a stochastic battery. [26] shows a simple and succinct virtual battery model to capture the flexibility of more complex loads.
In addition, low predictability and variability of electricity consumption and renewable electricity generation increase the importance of sequential short-term trading. In [9] the relevance of Intraday spot markets to achieve a market-compatible integration of renewable energy is analyzed. The achievable profit by trading in the Day-Ahead and Intraday spot markets is investigated in several studies. [27] demonstrates that demand-side flexibility can yield significant cost reductions on the spot markets. The extent of the costs reductions are influenced by the volatility of the spot market prices and the time spans across which loads can be shifted. Moreover, [28] show that the Intraday spot market is expected to gain more significance in future as a result of the growing share of grid-connected renewable energy sources and their volatilities.
In [29] a rolling horizon optimization is used for the Day-Ahead and Intraday spot markets bidding, in order to maximize the profit of the production of a wind farm combined with an energy storage system. [30] and [31] consider the rolling scheduling in the Intraday spot market in order to maximize the profits from the flexible operation of thermostatically controlled loads combined with renewable generation.
In this paper, the flexibilities of end-user technologies such as BATs, EVs, HPs, Bs and PVs are defined and implemented in a rolling horizon optimization framework in order to maximize the profits of the end-user in the Day-Ahead and Intraday spot markets. The main contributions of this paper beyond the state of the art are as follows.
• Presentation of different methods to formulate flexibilities of different technologies (such as HPs and Bs) as virtual batteries.
• A data-based method for the linear representation of a HP, which is typically characterized by highly non-linear relationships.
• Presentation of a rolling horizon optimization framework to schedule the components consumption and to plan the Day-Ahead and Intraday spot market trades.
• Application of the methods to a real-life use case in Austria with measured data.

Methods
In general, an exact description of the technical operation of flexible end-user components is complex and characterized by non-linear relationships leading to nonscalability of the calculations. [32] presents the twelve reasons why non-linear models are much more difficult to optimize in comparison to linear models. In non-linear models, it is hard to distinguish a local optimum from a global optimum since the feasible regions may not be restricted to extreme points and therefore there may be multiple different feasible regions. This could lead to an increment of the required computational time and to different final solutions.
In this section, a method to represent the different end-users technologies as linear systems is presented. In the operation of end-user technologies, errors are inevitably made in load or generation forecasts, which often far exceed the inaccuracies caused by linearization.
In the following, the flexible end-user consumption is implemented in a rolling horizon optimization framework. A mixed integer optimization problem is solved each time step in order to schedule the components consumption and to plan the spot markets trades. In this work, forecast errors of generation and consumption were not considered.

Flexibility modeling framework
A simple and comprehensive characterization of the flexible end-user technologies is needed in order to efficiently describe several components in a single linear optimization algorithm. The main idea of the proposed method is to implement EVs, Bs and HPs as virtual batteries with variable capacity in a mixed integer optimization problem. In other words, the technical properties of flexible components (such as Bs and HPs) are defined with the same mathematical formulas of a battery. The simple mathematical formulation of virtual batteries enables the optimal allocation of the power flows of the flexible end-user components using a linear optimization model.
The different end-user components are connected to a common grid connection point which is limited by a maximum grid connection power. High loads can therefore represent bottlenecks for end-user flexibility. The power flowing through the grid connection point is traded in the different markets (Day-Ahead and Intraday spot markets). A graphical representation of a flexible end-user and the associated power flows are shown in Fig. 1.
In this work, time is considered as discrete and the time range T is divided into a number of constant time intervals ∆t.
Kirchhoff's law requires that the sum of all power flows at the grid connection point node is equal to zero. The power balance equations of the flexible end-user can be described as follows. Furthermore the grid connection point has power restrictions given by (3).
The mathematical expressions defining the physical limits of the end-user technologies are described below.

Inflexible load
Inflexible loads describe the consumption which cannot be flexibilised in the optimization (e.g. the consumption of a dishwasher, electric stove, lamps, etc.). However, the inflexible loads are defined through an exogenous time-series of predicted loads as described below.
As mentioned above, the components of a flexible end-user are connected to a common grid connection point, which is limited by a maximum grid connection capacity and hence, inflexible high loads can represent a hitch for the use of flexibility.

Solar photovoltaic panel
The use of advanced power electronics allows to curtail the solar photovoltaic electricity generation. Hence, we consider a solar photovoltaic panel as a flexible component. The curtailment of photovoltaic generation can be economically convenient in different cases, e.g. when there are negative prices in the market and no electricity is needed by the end-user to cover its load.
In order to implement the solar photovoltaic panels in the optimization framework we consider an exogenous time-series of predicted photovoltaic generation output, defined as follows.
Since in this work no forecast errors are considered, we can define the constraint for the optimal photovoltaic generation as depicted below.
Therefore, the flexibility of a photovoltaic panel is given by its predicted generation p PV pred,t and its efficiency η PV . According to the constraints, the optimization algorithm defines the optimal generation of the photovoltaic panel p PV t in each time step.

Battery
The flexible operation of a battery is confined at its physical limits. The maximum input and output power (p BAT ,in max and p BAT ,out max ) are limited as described below.
The initial state of charge (soc BAT Start ) and the battery capacity (E BAT ) represent physical limits, which are implemented by the following constraints in the optimization framework.
The energy equilibrium of a battery, considering the charging and discharging efficiency (η BAT ,in and η BAT ,out ) and the standbylosses percentage (K BAT,sl % ) can be defined in each time period as follows.
In accordance with the constraints, the optimization algorithm determines the optimal battery operation, defining the optimal input and output power (p

Electric vehicle
The physical limits of the electric vehicle batteries charge are similar to the ones of a normal battery, with the only difference that the electric vehicle batteries are only available for a limited period of time. Furthermore, in this paper the vehicle-to-grid operation mode is not taken into consideration.
In order to implement the physical constraints of the electric vehicle charge in the optimization problem we consider the predicted starting time of the charging process (t = S EV ), the disconnection time of the electric vehicle (t = D EV ) and the predicted energy needed at the end of the charging process (E EV ). Hence, the state of charge of an electric vehicle battery (soc EV t ) is defined in the following equations.
The maximum input power during the charging process is given by the maximum power of the charging station (p EV max ). Therefore, the optimal charging power is bounded as follows.
Furthermore, when the electric vehicle is not connected to the charging station the input power is set to 0.
The energy equilibrium of a charging process of an electric vehicle, considering the charging efficiency (η EV ) and the standbylosses percentage (K EV,sl % ) is defined for each time period as described below.
According to the physical restrictions, the optimization algorithm determines the optimal input power (p EV t ) and the state of charge of an electric vehicle battery (soc EV t ) in each time step.

Boiler
The main idea is to flexibilise the electrical consumption of a boiler and to heat the water when the electricity prices are low, taking into account the heat losses and ensuring the possibility of using hot water at any time. However, the heat exchanges inside a boiler are characterized by highly non-linear relationships. The non-linear relationships lead to nonscalability of the calculations. In order to linearize the equations describing the heat exchanges inside a boiler, it is necessary to make appropriate assumptions. In the calculations the following simplifications have been assumed.
• The internal temperature of the boiler (T B t ) is homogeneous. Hence, the heat transfer coefficient (K B,loss ) is constant and can be defined as follows.
where A is the heat exchange surface of the boiler (e.g. for a cylindrical boiler: A = 2π r · h + 2π r 2 ), α is the convective coefficient of the air, λ is the thermal conductivity and d the thickness of the boiler isolation material.
The hot water load is defined as an exogenous time-series of predicted power output as described below.
In order to implement a boiler as a virtual battery in the optimization framework, it is necessary to define its capacity bounds, given by the temperature limits (T B min and T B max ). The internal temperature of the boiler (T B t ) must be within those capacity bounds, as described in (20).
The boiler typically has the On/Off-functionality. With the On/Off-functionality, the electrical power of the boiler may only have two values: the maximum electrical power (p B max ) or 0. Therefore, the electrical power of a boiler is bounded as follows.
where σ B t is a binary variable and guarantees the boiler's On/Offfunctionality. In order to relate the power flows over the time in temperature changes, a conversion factor (cf B ) is needed. In general, the relationship between thermal energy variation (Q th ) of a sample of H 2 O and its resulting temperature changes (∆T ) is expressed as below.
Hence, the conversion factor for a boiler (cf B ) is defined as follows.
where c H 2 O p is the heat capacity, ρ H 2 O the density and V H 2 O the volume of the water in the boiler. The energy equilibrium of a boiler, considering the electrical efficiency (η B ), is defined in each time period in (24) and (25).
According to the above mentioned physical constraints, the optimization algorithm determines the optimal operation of a boiler, defining the electrical power (p B t ) and the internal temperature (T B t ) in each time period.

Heat pump
In this section the linear modeling of a generic air-to-air heat pump for heating is presented. The aim of this study is to flexibilise its electrical consumption, ensuring an appropriate, pre-set temperature range within the heated building or room. In order to achieve linearity of the equations describing the heat exchanges following assumptions have been made.
• The indoor temperature of the heated building or room (T indoor t ) is homogeneous.
• The coefficient of performance (cop HP t ) is linearly related to the outdoor temperature (T outdoor t ).
• The heat losses (K HP,loss t ) are linearly related to the temperature difference between the inside and the outside (T indoor t -T outdoor t ).
In order to determine the coefficient of performance (cop HP t ), the heat losses (K HP,loss t ) and the conversion factor (cf HP ), two different regression analyses were performed, using historical data of the modeled heat pump. The historical time periods are indicated with t * . The regression analyses are resumed in (26) and (27).
The factor ∆T indoor,hist t * ,t * −x represents the indoor temperature difference between the time period t * and the time period t * − x. Hence, the linearized coefficient of performance (cop HP t ), the linearized heat losses (K HP,loss t ) and the conversion factor (cf HP ) are defined as below.
cop HP In order to optimize the consumption of the heat pump in the optimization framework, an exogenous time-series of predicted outdoor temperatures (T outdoor T ) is required.
In this optimization framework, the heat pump is modeled as a virtual battery and therefore it is necessary to define its capacity bounds given by the indoor temperature limits (T indoor min and T indoor max ). The indoor temperature of the building or room (T indoor t ) must be calibrated within those temperature bounds as described in (32).
The heat pump operates between two electrical power limits. The minimum power (p HP min ) and the nominal power (p HP max ). Hence, the electrical power of the heat pump is bounded as follows in the optimization framework.
The energy equilibrium of the heated building or room can be defined in each time period as in (34) and (35) with the consideration of the electrical efficiency (η HP ) and the linearized coefficient of performance (cop HP t ).
According to the physical restrictions, the optimization framework determines the optimal consumption of the heat pump (p HP t ) and the resulting indoor temperature (T indoor t ) in each time step.

Rolling horizon optimization framework
The consumption and the energy trades of the flexible enduser are scheduled based on a rolling horizon optimization approach. The rolling horizon optimization approach is more realistic than traditional models which consider perfect knowledge of generation/consumption/market prices for the entire optimized period. As shown in Fig. 1, the Day-Ahead and the Intraday spot markets are considered. An optimization takes place every hour and a mixed integer optimization problem is solved in order to schedule the components consumption and to plan the market trades. The Day-Ahead spot market auction for the next day takes place every day at 12 a.m. The Day-Ahead spot market prices are defined as an exogeneous time-series as described below.
The energy traded at the Day-Ahead spot market for a generic time t A graphical representation of the optimization framework's chronological operation is shown in Fig. 2.
In the Intraday spot market it is possible to trade the energy products for the next 3 h (δ ID ) at the respective bid and ask prices. This enables the end-user to profit from the short-term price fluctuations in the Intraday spot market through its flexibility. However, the time-series of the scheduled trades at the Intraday spot market at the time t for the period (t, t + τ ) are defined by the optimization algorithm every time step as described below.
Therefore, the resulting costs in the Intraday spot market at a generic time t (C ID t ) are defined by the difference between the Intraday spot market purchases and sales for the time t (C ID,Buy t and C ID,Sell t ).
In general, the grid costs (C Grid ) consist of three components and depend on the grid level: an energy-related component The objective function of the mixed integer optimization problem which is settled every hour, is the minimization of the costs within the horizon τ and is defined as follows.
The total costs (C Total ) are given by the sum of all the trades and the grid costs within the time periods T as shown in (55).

Description of the case study
The end-user considered in this work is a wastewater treatment plant in Großschönau, Austria. The simulated period covers two winter weeks: from 06.01.2020 until 20.01.2020. At this site, the grid connection point is limited to 40 kW and the considered grid tariffs are those applied in Austria (according to the Austrian electricity regulator [33]).
The end-user has two photovoltaic systems with a total installed capacity of 82.33 kW P . The energy generated within the simulated period is 490 kWh. Furthermore, the wastewater treatment plant includes two EVs-charging stations with 11 kW nominal power each. The EVs parameters used in the simulations are the actual measured values at the wastewater treatment plan. The installed storage is a lithium-iron-phosphate battery model ''BYD BATTERY-BOX HV'' with an external inverter. The usable capacity of the storage is 11.52 kWh and consists of 9 modules (each 1.28 kWh). The maximum charging power is 6.4 kW, while the maximum discharging power is 5 kW. The HP installed in Großschönau is an air-to-air heat pump model ''TERRA SW Basic''. The indoor temperature limits are set to 20 • C and 25 • C. The minimum power is 2 kW while the nominal power is 2.78 kW. The boiler installed is the model ''Electrical Stand Storage VS 300'', which has a water content of 300 liters and a nominal power of 6.6 kW. In this case the temperature limits are set to 40 • C or 95 • C. In addition, the end-user has different inflexible loads with a total consumption of 1.39 MWh during the simulated period. The generation and consumption data are actually measured data of the studied wastewater treatment plant in Großschönau, Austria.
This case study, both the Day-Ahead and the Intraday spot markets at the European Power Exchange (EPEX) are considered. The Day-Ahead spot market auction for the next day takes place every day at 12 a.m., while the trades in Intraday spot market take place hourly for the next 3 h with a 15 min resolution. Therefore, an optimization takes place every hour as shown in Fig. 2. The updated Intraday spot market prices are included every hour in the rolling horizon optimization framework as input.
In the investigated case study, perfect forecast of load, generation and outdoor temperature have been assumed. Moreover, it has been assumed that the operations of the managed components are performed through automated technologies, considering an optimal communication between the operating components.

Results
In this section, the results of the simulations are presented. In order to raise the potential of marketing flexibilities in the Intraday spot market, three different simulations are performed.
• Energy Optimal or Baseline simulation • Day-Ahead simulation • Day-Ahead and Intraday simulation The ''Energy Optimal simulation'' or ''Baseline simulation'' is performed considering a constant electricity price. In this way, no market signals are considered when optimizing the operation of the individual components, whereas their physical limits are considered (e.g. limited power, capacities, etc.). The result is a technical optimal schedule with minimum energy losses and thus with the lowest energy consumption. After the power flows of the individual components are determined by the optimization algorithm, the energy trades are calculated with the Day-Ahead spot market prices at the EPEX at respective times. This simulation is considered as a baseline to assess the potential of the remaining two simulations where spot market prices are considered in the rolling optimization process.
In the ''Day-Ahead simulation'', the optimization is based solely on the varying Day-Ahead spot market prices at the EPEX. Energy is purchased when prices are low, so as to avoid buying it when prices are high. The objective of the optimization in this case is to minimize the overall costs of the end-user trading energy at the Day-Ahead spot market.
The ''Day-Ahead and Intraday simulation'' is performed considering both the Day-Ahead and Intraday spot market at EPEX. A mixed integer optimization problem is solved every hour in order to schedule the components consumption and to plan the market trades for the next 24 h. The Intraday spot market prices are updated every hour for the next 3 h with a quarterly resolution and entered in the optimization framework as input. The trades for the next 3 h (at the respective bid/ask prices) will be made in the Intraday spot market. The bid price is the highest price a trader would pay to buy energy. The ask price refers to the lowest price a trader is willing to sell. This enables short-term price fluctuations in the Intraday spot market to be exploited. In the interests of clarity, two sequential steps of the rolling horizon planning process of the ''Day-Ahead and Intraday simulation'' at time step t and time step t + k are shown in Fig. 3 and Fig. 4 respectively. As already visible in Fig. 2, the parameter k represents the rolling period. In Fig. 3 and in Fig. 4, the traded energy at the spot markets, the boiler operation, the heat pump operation, the battery operation and the spot market prices are shown from top to bottom. For the sake of space, the inflexible loads, the photovoltaic generation and the charging of electric vehicles have been omitted in these graphs.
In Fig. 3 it is observable that the Day-ahead spot market auction already occurred (at 12 a.m. of the previous day). Therefore, the required energy for the 8th of January is already traded and the operation schedules of the components provided. However, the volatile Intraday spot market prices offer an opportunity to reduce the overall costs of the end-user despite the grid costs. Hence, the energy is traded at the Intraday spot market and new operation schedules of the components are provided. The operation schedules of the end-user components are pursued for a rolling period k.
At time step t + k the Intraday spot market prices are updated and a new mixed integer optimization problem is solved. As observable in Fig. 4, a new amount of energy is traded at the Intraday spot market. This is because the energy is being traded at a low price at the Intraday spot market, probably due to an unexpected overproduction or an unexpected underconsumption in the grid. However, trading energy at the Intraday spot market at time step t +k is the optimal solution to minimize the overall costs of the end-user. The operation schedules of the components are redefined in order to optimize the consumption of the traded energy. As shown in Fig. 4, the planned operations The energy that was already traded at the Day-Ahead spot market and that was planned to heat the boiler water is stored in the battery. The plan for heating by the heat pump is also altered so as to achieve the lowest total costs. The results of the three different rolling horizon optimization simulations for the two winter weeks, from 06.01.2020 until 20.01.2020, are shown in Fig. 5.
The ). In the Day-Ahead and Intraday simulation 48 kWh are sold for 6.01 e . The power-related grid costs C Grid,P (in light blue) and the flat rate C Grid,FR (in red) remain unchanged because the power peaks are not optimized and the flat rate is not dependent on the energy consumption. The energy-related grid costs ( Fig. 6. Comparison of the achievable costs reduction and the consumption increase for the two simulated winter weeks. are shown in magenta and increase by 1.51% in the Day-Ahead simulation and 5.04% in the Day-Ahead and Intraday simulation, because of the energy consumption increase. The total costs difference to the Energy Optimal simulation and the total consumption increment compared to the Energy Optimal simulation are shown in black. The total costs ( ∑ T t=1 C Total t ) decrease by 0.34% in the Day-Ahead simulation and 0.78% in the Day-Ahead and Intraday simulation, while the amount of energy consumed increases by 1.18% in the Day-Ahead simulation and 3.21% in the Day-Ahead and Intraday simulation. Fig. 6 shows the total costs and energy consumption differences of the ''Day-Ahead simulation'' and the ''Day-Ahead and Intraday simulation'' to the ''Energy Optimal simulation''.
In general, the percentage of total costs reduction is slight, since most of the costs depend on the grid charges. In fact, the energy procurement costs in the ''Day-Ahead and Intraday simulation'' decrease by 8% compared to the ''Energy Optimal simulation''. It should be also noted that the relative cost reduction correlates with the relative consumption increase.
Furthermore, it has to be pointed out that in the Day-Ahead and Intraday simulation the battery usage or the battery's number of charging cycles increases by 14.6% compared to the Day-Ahead simulation. This causes a more rapid reduction of the State-of-Health of the battery, which implies faster deterioration and consequently, higher investment costs for the long-term operation.
Since the optimized time span is two winter weeks, the results are not scaled up to one year. Upscaling the results to one year would not be representative, since electricity consumption (in particular the electricity consumption of boilers and heat pumps) is considerably higher in winter.

Conclusion and outlook
In this paper, the value that different end-user flexible components (such as BATs, EVs, HPs, Bs and PVs) may create if trading energy in the Day-Ahead and the Intraday spot markets is investigated. The end-user technologies are represented as a combination of non-flexible loads and virtual batteries with variable capacities, in order to describe the flexibilities of an end-user with the exclusive use of linear relationships and implement them in mixed integer optimization problems. Furthermore, a rolling horizon optimization framework is used to define the operating strategy of the end-user components and minimize the overall costs of the end-user trading in the Day-Ahead and the Intraday spot markets.
The methods presented to obtain the linearity of the equations that describe the heat exchanges of Bs and HPs have achieved high accuracy. With respect to the total measured consumption in the two considered winter weeks, they achieved an accuracy of 98% in the case of the boiler and 95.7% in the case of the heat pump. Hence, it can be stated that the proposed method is suitable for the implementation of boilers and heat pumps in mixed integer optimization problems.
The simulations have shown that trading energy in the Day-Ahead and the Intraday spot markets can lead to a reduction of the total costs of 0.78% compared to the technical optimal operation of the end-user flexible components. In particular, the energy procurement costs decreased by 8%. This leaded to an energy consumption increase of 3.21%, which caused an increase in energy-related grid costs of 1.51% This study shows that price fluctuations in the spot markets, caused largely by grid-connected renewable energy sources, implies profit opportunities for flexible end-users. Hence, marketoriented optimization of end-user flexibilities could become more important in the future with the increase of grid-connected renewable energy sources and the associated increase in price volatility.
Moreover, the size of electric vehicle batteries is growing significantly nowadays. The increasing capacity of the individual EVs batteries ensures greater operational flexibility available to the end-user who in the future could be further incentivized to apply a market-oriented optimization of its flexibilities.
Furthermore, it has to be noted that the simulations did not take into account the investment costs which would make the coordinated operation of flexible end-user components possible, e.g. a communication infrastructure between the end-user, the spot markets and a local device for controlling the end-user flexible components.
Finally, the simulations are performed without considering any forecast errors of generation and consumption. Hence, the total costs reduction could decrease and the additional consumption could increase. Therefore, one of the future challenge is to investigate to what extent the quality of the forecasts can influence the total costs reduction.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.