# Scenario Reduction for Stochastic Optimization Applied to Short-Term Trading of PV Power

Isaias Gomes, Rui Melicio, Victor Mendes

► To cite this version:

Isaias Gomes, Rui Melicio, Victor Mendes. Scenario Reduction for Stochastic Optimization Applied to Short-Term Trading of PV Power. 11th Doctoral Conference on Computing, Electrical and Industrial Systems (DoCEIS), Jul 2020, Costa de Caparica, Portugal. pp.246-255, 10.1007/978-3-030-45124-0_23. hal-03741529

HAL Id: hal-03741529

https://inria.hal.science/hal-03741529v1

Submitted on 1 Aug 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
<figure><img src="image_2.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
# Scenario Reduction for Stochastic Optimization Applied to Short-term Trading of PV Power

Isaias L.R. Gomes¹,², Rui Melicio¹,², V.M.F. Mendes¹,³

¹ICT, Universidade de Évora, Escola de Ciências e Tecnologia, Departamento de Física

²IDMEC, Instituto Superior Técnico, Universidade de Lisboa, Lisbon

³CISE, Electromechatronic Systems Research Centre, Universidade da Beira Interior, Portugal

ruimelicio@gmail.com

**Abstract.** This paper addresses the scenario reduction for stochastic optimization applied to short-term trading of photovoltaic (PV) power. Stochastic optimization becomes a useful technique when leading with problems involving uncertainty. Short-term trading of PV power in electricity markets is an example of a problem involving a high level of uncertainty, namely uncertain parameters as PV power and market prices. As the level of uncertainty raises and the optimization problem becomes more complex, the prerequisite of scenario reduction becomes crucial without losing the representativeness of the original scenarios. Thus, in this paper is proposed an effective scenario reduction algorithm based on backward method in order to obtain a profitable trading of PV power in electricity markets. The scenario reduction method is applied to a two-period scenario tree, i.e., a scenario fan including uncertainty on day-ahead market (DAM) prices, on imbalance prices and on PV power. Through a case study is analyzed the performance of the scenario reduction algorithm and the comparison with the original set of scenarios. The results show that the reduced set of scenarios still has a very high level of accuracy.

**Keywords:** Scenario reduction; backward method; stochastic optimization; PV power; electricity markets.

## 1 Introduction

Short-term trading of PV power in electricity markets is an example of a decision-making problem where a high level of uncertainty exists [1]. Therefore, becomes even more important the necessity for making optimum and consistent choices under scenarios of this level of uncertainty. Although uncertainty can be included easily in decision-making problems, the inclusion of the exact probability distribution usually implies nonlinearity and additional efforts for numerical integration in the model [2]. Therefore, some approaches include a limited quantity of scenarios representing the uncertainty distribution by discretizing the probability of those scenarios, namely stochastic optimization [3]. In approaches as stochastic optimization the solution obtained is reached considering all the possible scenarios. Generally, a large quantity of scenarios is needed to emulate the uncertainty of the high number of uncertain
parameters present in a decision-making problem, resulting in large-scale problems that are hard to solve due to limitations of computational resources [2]. Thus, becomes essential to determine a set of representative scenarios that best represent the initial set of scenarios. The determination of these representative scenarios leads to an important branch in decision-making problems under uncertainty which is scenario reduction. The scenario reduction concept proposed by [4] and by [5] aims to define a subset of scenarios and define optimum rearrangement of probabilities of conserved scenarios. The idea in [4] and [5] arises from quantitative stability results in terms of a probability metric, resulting in two scenario reduction heuristics, the forward selection and backward reduction. Additionally, [5] outspreads the initial idea developed by [4], and refines the iterative method, resulting in two new versions: a new version of forward selection, the fast forward selection; and a new version of the backward reduction, the simultaneous backward reduction. While stochastic optimization has been widely applied in decision-making problems, the need to use representative scenarios through scenario reduction methods has received limited attention from researchers in the past [4-6]. Due to its importance, scenario reduction is applied in the most diverse areas of knowledge, namely in supply chain [7] and particularly in the scope of this research, in electricity markets [4]. In power systems, most applications of scenario reduction methods focus on unit commitment and short-term operation [8-10]. This paper addresses the scenario reduction in a two-stage stochastic optimization applied to the short-term trading of PV power in a DAM, reformulated as a mixed-integer linear programming approach. The paper has as contribution, in the scope of short-term trading of power in electricity markets, the analysis of scenario reduction based on backward method over a two-period scenario tree, i.e., a scenario fan including uncertainty on DAM prices, on imbalance prices and on PV power.

The rest of this paper is organized as follows: Relationship of this paper to Innovation for Life Improvement in Section 2. Theoretical basis of Scenario Reduction are described in Section 3. The proposed Backward Scenario Reduction Method is presented in Section 4. The Problem Formulation of Short-term Trading of PV power in electricity markets is presented in Section 5. The Case Studies and the results are discussed in Section 6. Conclusion is presented in Section 7.

## 2 Relationship to Innovation for Life Improvement

The paradigm shift to a clean, energy-efficient and climate-resilient economy will demand a more decentralized, open system with the participation of all sectors of society [11]. The power system, and the electricity industry in general, is under a huge change paradigm, changing from the dominance of large companies' incumbents of large-scale and centralized technological projects to a paradigm where the innovation of the consumers is from great importance. In the upcoming years consumer must be at the center of the energy system: demanding competitive low-carbon solutions; participating as producer and manager of decentralized energy networks; acting as an investor, through decentralized platforms; and driving change through user innovation [11]. Europe Union claims that a more bottom-up, user-centered energy system is a driver for more innovation [11]. From our point of view the innovation is the key for the sustainable development. Apart of the innovation of the consumers, this
innovation is based on other innovations, namely, the digitization of the core aspects of transportation and electricity markets and electricity industry in general. Achieving more and more this level of modernization, the local community and the small start-up can all participate and even lead in the development energy innovations. For instance, the aggregation of micro-power sources, and loads of end-users, while increasing size and dimension to take part in electricity markets as a single entity, can produce at the same time energy efficiency and even profits as result of an optimal management. The consideration of smart systems will probably increase the data to be processed by machines and humans. Thus, as in the scope of this paper, the scenario reduction, i.e., the reduction of cardinality of a set of data, is from great importance in the transition to the new paradigm in the context of smart cities and smart grids.

## 3 Scenario Reduction

Stochastic optimization is one of the most used methodologies in problems involving uncertainties, having the advantage of considering a set of possible realizations of a parameter, the so-called scenarios. A variable changing over time is said to be a stochastic process. Assume a probability distribution $P$ of a $n$-dimensional stochastic process $\xi$ with $n$ components as photovoltaic power, DAM prices and imbalance prices with finite possible realizations $\xi = \{\xi_s\} = \{\xi_1 \dots \xi_s\}, s = 1, \dots, S$. To each realization $\xi_s$ is associated a probability $\pi_s$, where $\sum_{1}^{S} \pi_s = 1$. Now assume another probability distribution $P'$ of another $n$-dimensional stochastic process $\xi_{s'}$ with $n$ components with finite possible realizations $\xi = \{\xi_s\} = \{\xi_1 \dots \xi_{s'}\}, s' = 1, \dots, S'$. To each realization $\xi_{s'}$ is associated a probability $\pi_{s'}$, where $\sum_{1}^{S'} \pi_{s'} = 1$. Assume that $\xi_s$ is the possible realizations of the $n$-dimensional stochastic process representing the stochasticity present in a problem formulation of a trading PV power in competitive electricity markets. Now consider that each uncertain parameter has $S_*$ scenarios each one. Considering that the number of uncertain parameters is 3, the number of the scenarios of the problem is $S = S_{PV} \times S_{DA} \times S_I$. Theoretically the number of possible scenarios is huge. This implies large-scale problems and eventually high computational requirements. In addition, the difficulty of the analysis of the simulation results of large-scale problems may increase. Here appears the necessity of reduction of the number of scenarios, i.e., reduce the cardinality of the initial set of scenarios. Hence, due to the computational requirements, the initial $n$-dimensional stochastic process $\xi_s$ is approximated by a new $n$-dimensional stochastic process $\xi_{s'}$, which represents a subset of the initial number of scenarios. Likewise, the initial probability distance $P$ is approximated by a new probability distribution $P'$ which represents a subset of the initial number of scenarios. A scenario reduction algorithm aims the reduction of the number of the initial data without losing the representativeness of the original scenarios. In other words, a scenario reduction algorithm aims to reduce a scenario set while keeping as intact as possible the stochastic information included in it [12]. The aim of the scenario reduction is the to
find a new distribution that minimizes de Kantorovich distance from the probability distribution of the original scenario tree [4].

The scenario reduction algorithms developed in [4] and [5] determine a scenario subset and allocate new probabilities to the conserved scenarios such that the corresponding reduced probability $P'$ is the closest to the original measure $P$ in terms of a certain probability distance Dist between $P$ and $P'$. The probability distance Dist trades off scenario probabilities and distances of scenario values. One of the most used probability distances in stochastic programming is the Kantorovich distance Dist$_K$. For two-stage problems and the Kantorovich distance can be stated as follows [12]:

$$Dist_K(P, P') = \sum_{s \in S \setminus S'} \pi_s \min_{s' \in S'} c(\xi_s, \xi_{s'}) \quad (1)$$

In (1) $\pi_s$ is the scenario probability and $c(\xi_s, \xi_{s'})$ is often referred to as cost function based on the norm between two random vectors. $c(\xi_s, \xi_{s'})$ is stated as follows:

$$c(\xi_s, \xi_{s'}) = \|\xi_s - \xi_{s'}\| \quad (2)$$

The Dist$_K(P, P')$ expressed in (1) can be used to derive several heuristics in order to obtain a smaller quantity of scenarios without losing the representativeness of the initial set of scenarios. Next to the reduction is applied the so-called optimal redistribution rule, where the probability of a conserved scenario is equal to the sum of its previous probability and the probability of all removed scenarios that were close to it before the reduction with respect to the cost function $c(\xi_s, \xi_{s'})$. In this paper the scenario reduction method used is the backward reduction method.

## 4 Backward Scenario Reduction Method

The backward scenario reduction method is based on the recursive elimination of scenarios of the initial set of scenarios until the minimum value of Dist$_K$ is reached. An extensive description the backward scenario reduction method is available in [4]. The backward scenario reduction method works as follows:

Step 1: Compute the distances of each scenario pairs $(\xi_s, \xi_j)$

$$c_{sj} = c(\xi_s, \xi_j), s, j = 1, \dots, S. \quad (3)$$

$$S^D = \emptyset. \quad (4)$$

Step i: Compute

$$c_{ss'}^i = \min_{j \neq s} c_{sj}, s \in S^{Ri-1} \text{ and select } s' \text{ that } \min_{s' \in S^{Ri-1}} c_{sj} \text{ with respect to a } s \quad (5)$$

$$z_{ss'}^1 = \sum_{s' \in S^{Ri-1}} \pi_{s'} c_{ss'}^1 . \quad (6)$$
$$ \text{select } s_i \in \arg \min_{s \in S^{Ri-1}} z_{ss'}^i. \qquad (7) $$

$$ \text{Add the deleted scenarios to the set } S^{Di} = S^{Di-1} \cup \{s_i\}. \qquad (8) $$

$$ \text{Remove the deleted scenarios from the set } S^{Ri} = S^{Ri-1} \setminus s_i. \qquad (9) $$

Final step: update the scenario probabilities

$$ \pi_{s'} = \pi_{s'} + \pi_{s_i}. \qquad (10) $$

The backward scenario reduction method defines a subset of scenarios that is the closest to the initial set of scenarios using the Kantorovich distance and calculate the new probabilities of the conserved scenarios. The Kantorovich distance weigh the scenario probabilities and the distances between scenario values. Discarded scenarios have probability zero. The method stops the process when the number of reduced scenarios defined by the user is reached or when a predefined distance is reached.

# 5 Problem Formulation – Short-term Trading of PV Power

This section summarizes the mathematical formulation of short-term trading of PV Power in electricity markets. Despite this formulation is applied to short-term trading of PV power, can be applied as well for other variable-renewables, namely wind power. Complete formulation can be found in [13]. The stochastic linear programming to support the bidding strategies of a PV power producer is stated as follows:

$$ \max \text{Profit} = \sum_{s'=1}^{S'} \sum_{t=1}^{T} \pi_{s'} (\lambda_{ts'}^{DM} P_t^{PV} + \lambda_{ts'}^{DM} p r_{ts'}^{+} d_{ts'}^{+} - \lambda_{ts'}^{DM} p r_{ts'}^{-} d_{ts'}^{-}) \qquad (11) $$

Subject to:

$$ 0 \le P_t^{PV} \le P^{\max}. \qquad (12) $$

$$ d_{ts'} = P_{ts'}^{PV} - P_t^{PV}. \qquad (13) $$

$$ d_{ts'} = d_{ts'}^{+} - d_{ts'}^{-}. \qquad (14) $$

$$ 0 \le d_{ts'}^{+} \le P_{ts'}^{PV}. \qquad (15) $$

$$ 0 \le d_{ts'}^{-} \le P^{\max}. \qquad (16) $$

In (11) the three terms are: the revenue associated with the bid in DAM at scenario s and period t; the income associated with the excess of energy in the imbalance market at scenario s and period t; and the cost associated with the deficit of energy in the balancing market at scenario s and period t. In (12) the upper bound off the bid is set to be the rated power of the PV power plant. In (13) the energy deviation is defined as the difference between the PV power at scenario s and the bid in DAM. In (14) the energy deviation is divided in two nonnegative deviations. In (15) and (16) the upper bounds associated with the positive and the negative deviations are set.
# 6 Case Studies

*Inputs*: The effectiveness of the application of the scenario reduction based on the backward scenario reduction is evaluated using a PV system of rated power of 100 MW located in Iberian Peninsula. The day-ahead energy prices $\lambda_{ts}^{DM}$ and the price ratios $pr_{ts}^{+}$, $pr_{ts}^{-}$, are obtained from [14]. PV power scenarios are obtained from [15]. The simulation is carried out using GAMS/SCENRED performing the fast backward reduction method. The initial set of scenarios are 10 for PV power, 10 for DAM prices and 10 for positive and negative price ratios, a total of 1000 initial scenarios, correspond to the all possible combinations between the 3 set of uncertain parameters. The DAM price scenarios and the price ratios scenarios are shown in Fig. 1.

<figure><img src="image_3.png" /><figcaption>**Fig 1.** Left, DAM scenarios (blue) and average – (black). Right, price ratios: positive (blue), negative (black).</figcaption></figure>

The PV power scenarios are shown in Fig. 2.

<figure><img src="image_4.png" /><figcaption>**Fig 2.** PV power scenarios (blue) and average scenario (black).</figcaption></figure>

*Case Studies and Results*: The case studies are based on the analysis of stability of the application of the fast backward scenario reduction method applied to the short-term trading of PV power, namely the effect that the definition of a certain number of
scenarios by the decision-maker can make on the optimal values of the decision variables of the problem formulated in section 5.

**Case1 – The effect of the number of reduced scenarios on the expected profit:** This case study makes the comparison between the effect of the definition of S different number of reduced scenarios by the decision-maker on the expected profit and the expected profit without scenario reduction (initial set of scenarios equal to 1000). The expected profit as function of the number of scenarios is shown in Fig. 3.

<figure><img src="image_5.png" /><figcaption>Fig 3. Expected profit as function of the quantity of reduced scenarios.</figcaption></figure>

In Fig. 3 it is possible to conclude that for the value of the quantity of reduced scenarios equal to s = 10, the profit reaches a high value. However, this result may not be optimal as the increase in the quantity of reduced scenarios stabilizes the expected profit value. Reducing the number of scenarios by half the value, i.e. s = 500, reduces profit by only 0.06%, a value considered insignificant. Further, reducing the number of scenarios even further s = 300 still ensures a good approximation of the actual value, i.e. without scenario reduction. Therefore, reducing scenarios for a reasonable set for this application does not guarantee a significant change in the expected profit value.

**Case2 – The effect of the number of reduced scenarios on the bid and on the positive and negative deviations:** This case study makes the comparison between the effect of the definition of S different number of reduced scenarios by the decision-maker on the bid and on the positive and negative energy deviations and respective values without scenario reduction, i.e., considering the initial set of scenarios equal to 1000. The bid in the DAM and the energy deviations as function of the quantity of reduced scenarios are shown in Fig. 4.
<figure><img src="image_6.png" /><figcaption>Fig 4. Left, bid in the DAM as function of the quantity of reduced scenarios. Right, positive and negative energy deviations as function of the number of scenarios.</figcaption></figure>

In Fig. 4 left it can be concluded that for a reduced number of scenarios s = 10, the total daily supply in the daily market is high. However, this value may not be ideal, since by increasing the supply value to higher values closer to s = 400 the market supply begins to stabilize by settling on a range of values [706,715]. This range of values is considered a small value considering the volume of energy that is traded. In Fig. 4 right it can be concluded that as more scenarios are considered during the optimization problem, the negative energy deviations decrease, and the positive energy deviations increases as an expected profit of the short-term trading of PV power is calculated that hedges the system against more the non-profitable scenarios. Therefore, as the bid decreases the expected profit decreases considerably. Contrary, when the bid decreases the absolute value of the energy deviations increases. The main advantage of fast backward method over fast forward method and other backward methods is the computational performance for huge scenario trees. Thus, this paper takes advantage of the best expected performance with respect with running time of the fast backward method.

## 7 Conclusion

The application of a scenario reduction method for stochastic optimization applied to the short-term trading of PV power is proposed in this paper. The transaction of energy from renewable sources in the electricity market requires a convenient consideration of uncertainty, which tends to be increased. Thus, in this paper it is proposed the scenario reduction based on a backward reduction method. The case studies show that the consideration of an incorrect number of reduced scenarios can lead to undesirable results and losses in the producer's expected profit. Thus, whenever possible, such an analysis is advisable in formulating the decision-making problem in problems that include a considerable number of uncertainties in order to
obtain a firm basis of the correct number of scenarios to consider. The case study analyzing the effect of considering a certain quantity of scenarios on the expected profit of the producer demonstrates that reducing the number of scenarios by 90% leads to a profit that does not consider the worst scenarios, so the energy transaction in market can be done erroneously. The case study that analyzes the effect of considering a certain number of scenarios on the amount of energy traded and the energy deviations shows that reducing the number of scenarios by up to 60% leads to high values of negative imbalances as a result of high energy offers in the market. Therefore, considering the results of deviations to lower scenario reduction values, this practice is not recommended.

**Acknowledgments.** This work was supported by: Bolsas Camões, I.P./Fundação Millennium BCP through the Programa Empresa Promotora da Língua Portuguesa; European Union through the European Regional Development Fund, included in the COMPETE 2020 (Operational Program Competitiveness and Internationalization) through the ICT project (UID/GEO/04683/2019) with the reference POCI010145FEDER007690; FCT, through IDMEC, under LAETA, project UIDB/50022/2020; Portuguese Foundation for Science and Technology (FCT) under Project UID/EEA/04131/2019.

## 8 References

1. Gomes, I.L.R., Melicio, R., Mendes, V.M.F., Pousinho, H.M.I.: Decision making for sustainable aggregation of clean energy in DAM: uncertainty and risk. Renewable Energy 133, 602-702 (2019)

2. Li, Z., Li, Z.: Linear programming-based scenario reduction using transportation distance. Computers and Chemical Engineering 88, 50-58 (2016)

3. Silvente, J., Papageorgiou, L.G., Dua, V.: Scenario tree reduction for optimization under uncertainty using sensitivity analysis. Computers and Chemical Engineering 125, 449-459 (2019)

4. Dupacova, J., Growe-Kuska, N., Romisch, W.: Scenario reduction in stochastic programming. Mathematical Programming 95(3), 493-511 (2003)

5. Heitsch, H., Romisch, W.: Scenario reduction algorithms in stochastic programming. Computational Optimization and Applications 24 (2-3), 187-206 (2003)

6. Karuppiah, R., Martín, M., Grossmann, I.E.: A simple heuristic for reducing the number of scenarios in two-stage stochastic programming. Computers and Chemical Engineering 34(8), 1246-1255 (2010)

7. Paulo, H., Cardoso-Grilo, T., Relvas, S., Barbosa-Póvoa, A.P.: Designing integrated biorefineries supply chain: combining stochastic programming models with scenario reduction methods. Computer Aided Chemical Engineering 40, 901-906 (2017)

8. Aravena, I., Gil, E.: Hydrological scenario reduction for stochastic optimization in hydrothermal power systems. Applied Stochastic Models in Business and Industry 31(2), 231-240 (2015)

9. Xiong, G., Liu, X., Chen, D., Zhang, J., Hashiyama, T.: PSO algorithm-based scenario reduction method for stochastic unit commitment problem. IEEJ Transactions on Electrical and Electronic Engineering 12, 206-213 (2016).
10. Yilidz, C. et. al: A day-ahead wind power scenario generation, reduction and quality test tool. Sustainability 9(5), 1–15 (2017).

11. European Commission: Communication from the Commission to the European parliament, the council, the European economic and social committee, the committee of the regions, and the European investment bank – Accelerating clean energy Innovation. Available at: https://ec.europa.eu/ (2019)

12. Conejo, A.J., Carrión, M., Morales, J.M.: Decision making under uncertainty in electricity markets, Springer, 2010

13. Gomes, I.L.R., Pousinho, H.M.I, Melicio, R., Mendes, V.M.F.: Stochastic coordination of joint wind and photovoltaic systems with energy storage in DAM. Energy 124, 310–320 (2017)

14. REE-Red Eléctrica de España. Available at: http://www.esios.ree.es/web-publica/.

15. CGE-Centro de Geofísica de Évora. Available at: http://www.cge.uevora.pt.