This section presents a case study to demonstrate how to model the simulation of the MIBEL day-ahead market for an entire month using EMS and the Spine Toolbox. The case study considers public data gathered from the OMIE’s data repository (Curvas agregadas de oferta y demanda del mercado diario | OMIE [Internet] 2022) to set the players and respective bids for each day of the month. The month selected was February 2019. The data collected keeps the players anonymous, not being possible to know which tranches belong to each player. For this reason, in the present study, each tranche represents a bid from a player. Such resulted in a minimum of 2659 and a maximum of 3736 bids per period. Further, the number of buy and sell bids is not constant throughout the days and their hourly periods.
To ease the results interpretation and simplify their verification, the authors decided to reduce the number of players/bids per period to 2500. Despite reducing the number of players, such number still demonstrates the scalability of EMS comparing to the actual number of players of MIBEL. For instance, if we pick the maximum number of tranches per period of February 2019 (i.e., 3736) and consider that at least half these bids (i.e., 1868) were composed by two tranches per period, the number of player bids for this period would be 2802 (i.e., 1868 + 1868/2). However, in the period of February 2019 the maximum number of players per day in MIBEL was 1327 on the 25th (see file “cab_201902.zip” at (Cabecera de las ofertas al mercado diario | OMIE [Internet] 2022)). Complex conditions were also not considered. On the one hand, the complex conditions submitted by players are not publicly available. On the other hand, the aim of the case study is to demonstrate how to model and execute the simulation of an EM model publicly available at EMS within the Spine Toolbox and not analyzing specific player strategies. Considering the number of sellers is significantly lower than the number of buyers in each period, the authors decided to use all seller bids available for each period of each day, completing the remaining positions with buyer bids.
The following section demonstrates how the case study was modeled and configured in the Spine Toolbox. After, the case study scenario is presented, and the results are analyzed for a specific buyer, seller, and market operator. Monthy results are also provided and interpreted.
Methodology
EMS allows simulating a market session at a time for each wholesale EM available. To execute the day-ahead session of MIBEL for each day of February 2019, the authors used the Spine Toolbox to automate this process. To this end, two types of elements were used, namely the Data Connection and the Tool items. Figure 5 illustrates the Spine Toolbox configuration in the Design View at the center.
The Data Connection item, named “february_2019”, allows importing the players’ data for each session of MIBEL’s day-ahead market. It imports the data gathered from OMIE’s data repository converted into 28 JSON files, one per day, for each day-ahead session of MIBEL, making it available for the next Tool item, i.e., the “run_EMS_MIBEL_Feb2019” item.
The “run_EMS_MIBEL_Feb2019” item is the core of this example, as it enables the simulation of MIBEL using EMS for the whole month. This item allows coding scripts in Python, Julia, and GAMS, or even to run executable files. In this specific example, a Python script was used to automate the execution of MIBEL day-ahead market in EMS for the 28 days of February 2019. Figure 6 presents a snippet of the “run_EMS_MIBEL_Feb2019” item’s Pyhon script.
To run MIBEL’s day-ahead market for each day, this Python script uses the “EMS_BASE_URL” (see the script’s line 7) concatenated with the “mibel” endpoint, which is declared in the input file of this Spine Toolbox project. Another option would be to declare the complete EMS MIBEL URL in the script. However, this way allows us to run different EMS EMs using the same Spine Toolbox project. This Python script handles the input/output data workflow, saving the results in JSON format. These results are then sent to the next Tool item.
Finally, the “create_charts” Tool receives the previous item’s JSON output to generate the output charts to ease the analysis and interpretation of the results. This item generates charts for each player and the market operator regarding each session (day) and the aggregated results of the month (market operator only). The charts’ generation is also supported by a Python script, which stores them in the project’s folder.
Results
As previously stated, the results are provided from different perspectives. From the market operator’s point of view, the results are seen as the overall session outcomes and the market’s social welfare, as well as the monthly results overview. From each player’s standpoint, the results are seen individually according to his outcomes in each trading session.
To facilitate the interpretation of the simulation results, this subsection starts by analyzing the simulation outcomes from the market operator’s perspective of a randomly chosen day, i.e., 17th February 2019, followed by the analysis of the results achieved by a buyer and a seller, namely Buyer 1391 and Seller 3. This day-ahead session counted a total of 1330 buyers and 884 sellers. The monthly aggregated results are also presented.
Figure 7 presents the overall session results for the day-ahead session of 17th February 2019. It must be noticed that, being a day-ahead session, the simulation is, actually, determining the market-clearing for the next day, i.e., 18th February.
From Fig. 7, the total demand and supply submitted per day can be observed. The different color tones identify the satisfied (dark colors in the bottom) and unsatisfied (light colors on the top) demand (orange) and supply (green). The blue line, in turn, represents the market price set for each trading period. A closer look at periods 9–19 seems that there was no negotiation in those periods, but there was, as will be shown next. Such has to do with the granularity. In this chart, the energy unit is GWh, and the traded energy is not enough to be seen in this dimension.
Figure 8 shows the session results achieved by Buyer 1391.
As it is possible to see, Buyer 1391 only submitted bids for the first 16 hourly periods. Unfortunately, for this player, his demand was only satisfied from periods 12 to 16. It means this player submitted lower prices in the first periods of the day (from 1 to 11) than the last seller to sell (although not perceptible from the chart between periods 1 and 6), not being able to trade. This chart also proves that there was trading from periods 12 to 16, at least. But, as shown by Fig. 8, the maximum amount of traded energy for this player was near 8 MWh in period 16.
Figure 9 displays Seller 3’s session results.
Regarding the results of Seller 3, this player submitted bids for all trading periods. However, he was only able to sell his supply in 13 periods out of 24, meaning the prices offered in his bids, from period 9 to period 19, were a bit higher than the market price (which is zero in those periods). In the remaining periods, this player was able to sell all of his supply.
Finally, Fig. 10 presents the overall market results for each day of the month from the perspective of the market operator.
Analyzing Fig. 10, one can see the aggregated demand and supply for each day of February 2019, similar to Fig. 7 regarding the satisfied and unsatisfied power. However, in this case, the blue line represents the average market price for each day. It is also visible that the amount of supply is significantly higher than the demand. It is clearly a consequence of the way data was selected for this specific scenario. It is also interesting to observe the average market price variation along the days of the month. The highest average price was settled on the 19th of February (16.76 €/MWh), while the lowest was on the 1st (0.0 €/MWh).
Using the Spine Toolbox, we modeled a whole month of the Iberian day-ahead wholesale market using the publicly available MIBEL EM model of EMS. Besides, using the Spine Toolbox also allowed to automatically generate charts from the different stakeholders’ points of view for a more comprehensive study and analysis of the market sessions’ outcomes, as well as for an overall monthly perspective. While the daily results returned by the EMS are directly stored locally and used to generate daily charts, the monthly aggregated data is calculated using the Python script of the “create_charts” Tool item.