Electricity Portfolio Optimization for Large Consumers: Iberian Electricity Market Case Study

: Electricity markets are nowadays ﬂooded with uncertainties that rise from renewable energy applications, technological development, and fossil fuel prices ﬂuctuation, among others. These aspects result in a lumpy electricity prices for consumers, making it necessary to come up with risk management tools to help them hedge this associated risk. In this work a portfolio optimization applied to electricity sector, is proposed. A mixed integer programming model is presented to characterize the electricity portfolio of large consumers. The energy sources available for the portfolio characterization are the day-ahead spot market, forward contracts, and self-generation. The study novelty highlights the energy portfolio characterization for players denoted as large consumers, which has been overlooked by the scientiﬁc community and, focuses on the Iberian electricity market as a real case study. A multi-objective methodology is explored, using a weighted-sum approach. The expected cost and the conditional value-at-risk (CVaR) minimization are used as objective function. Three case studies illustrate the model applicability through the characterization of how the portfolio evolves with di ﬀ erent demand proﬁles and how to take advantage from seasonality characteristic in the spot market. A scenario analysis is explored to reﬂect the uncertainty on the price of the spot market. The expected cost and CVaR are optimized for each case study and the portfolio analysis for each risk posture is characterized. The results illustrate the advantage to reduce costs and risk if the prices seasonality is considered, triggering to an adaptive seasonal behavior, which support the decision-maker decision towards its goals.


Introduction
One of the main issues for any industry is to fulfill its energy needs in the smartest way possible. However, the management of an energy portfolio should simultaneously: reduce the cost, manage the risk associated and satisfy the demand, increasing the management complexity. These aspects are often a concern in the literature given the many opportunities, the different methods and tools that can be used.
In addition, the energy sector is characterized by many risks, opportunities, given the technology and renewable energy developments, which allow the energy portfolio manager to take advantage of. Hence, one of today's challenge is to use the energy resources available efficiently and towards to improvement of performance indicators as: cost, risk and renewable energy.

Portfolio Optimization with Downside Risk: Conditional Value-at-Risk
The modern portfolio theory era was first started by [23] and, since then become the most common way for investors to deal with expected returns, costs and uncertainty for a large number of problems. The portfolio optimization problem was first formulated looking at the expected return and risk, with focus in the expected return variability, which found a high popularity in finance sector. The nature of the multi-objective portfolio problems was presented in [16], with mixed integer linear programming multi-objective portfolio optimization approaches were discussed. Portfolio optimization has found popularity in the energy sector since it exploits the diversification idea through the "cancellation effect" [1].
Among the several techniques proposed to tackle the problem of portfolio selection, the risk measures became relevant and the downside risk is one of them [24]. As shown in works of [24,25], the portfolio formulation has enabled the two most popular financial engineering percentile risk measures, value-at-risk (VaR) and conditional value-at-risk (CVaR) to be used. Downside risk reflects the negative deviations from the expected return, focusing on the side that takes loss, opposite to the mean variance [23], that assesses in the same way upside and downside risks [26]. Initially introduced by [27], the CVaR deals with the "conditional expectation of losses in the top 100 × (1-α)%" assuming a specific level of α. The CVaR denotes the average of worst-cases loss scenarios for a specific level. While the VaR defines the "threshold level for losses in the top 100 × (1-α)%" [28] for a specific level of α. Common values considered for α are 0.90, 0.95 and 0.99 [29]. CVaR's popularity has grown significantly in the literature [30][31][32][33] mostly due to VaR's undesirable properties [34]. The author of [30] solved the portfolio optimization problem using a multi-objective approach and the VaR measure. The work [31] considers three different bi-objective formulations to explore the portfolio problem. First formulation considers the use of percentile risk measure, VaR, through a mixed integer linear programming. The second formulation considers the measure, CVaR using linear programming. The last one explores symmetric measure of risk, like in Markowitz [23] portfolio.

Energy and Electricity Portfolios
As previously stated, modern portfolio theory has seen its popularity growing in the energy sector in the last years, mostly on the planner's side, standing as a widely accepted methodology to solve the long-term investment decisions in energy planning.
The planners´considered in the literature review can be buyers or sellers in a liberalized market, as defined by [1,2]. These stakeholders need to allocate their electricity among different instruments, such as the day-ahead, real time markets and bilateral forward contracts. Hence, these agents can take advantage of portfolio optimization by diversifying throughout these instruments, as well as by choosing among generation technologies [34].
As examples of portfolio theory applications to the buyer's perspective, there is the works of [6] and of [35]. Recently [36] examines a fuzzy multi-objective decision making structure established for optimization of renewable energy project portfolios. The energy portfolios were constructed [37] and three problems were analyzed. The first problem minimizes the worst cases volatility, with a certain fixed maximum expected energy costs [37]. The second minimize the worst cases expected costs, with certain fixed maximum of volatility for the energy costs [37]. While the third problem combine the expected and volatility of the costs and is weighted by a risk aversion parameter [37]. These portfolio models are formulated as quadratic, second order cone programming and semi definite programming, so that robust optimization tools have be implemented.
In work [38] the portfolio optimization is developed for an optimal scheduling strategy in a microgrid take part in an unstable electricity market. The modern portfolio theory [39] is enabled to define the efficient frontier of optimal variable renewable energy portfolios that summarize the geographical smoothing effect for future power system. Article [40] considers power portfolio optimization in a medium term, for a power producer in a competitive electricity market, considering electricity prices and risk management. The methodology developed considers the multivariate Energies 2020, 13, 2249 5 of 21 stochastic evolution of electricity prices and, the construction of a scenario tree to represent its evolution. Work [41] presents a portfolio optimization composed by end-use consumers, through the Markowitz Theory. An overview of a multi-agent system for electricity markets is also presented. Authors [42] propose two modern portfolio theory models. The first considers the Mean Variance Criterion and the second explores the CVaR. The electricity portfolio models are combined with a generalized autoregressive conditional heteroskedastic prediction technique to optimally diversify their energy portfolio.
In work [43] authors present a comprehensive study of mean-variance, downside and semi-variance methods for portfolio optimization in electricity markets and the corresponding approaches for maximization of the return, while risk is minimized. Optimization of the electricity markets under modern portfolio theory has a crucial role for financial decision-makers [43]. Power suppliers in deregulated electricity markets need to optimize their generation capacities and bidding strategies to effectively play a part in bilateral contract and spot markets. Market players must deal with continuously changes of electricity prices, in the competitive electricity market environment during their daily routine [43]. Despite electricity cannot be stored it can be generated and consumed simultaneously.
Authors [44] are focuses on more sustainable aspects, like the impact of renewable portfolio standards and emissions trading on the electricity market.
Work [45] presents a review and extend the stochastic Levelized Cost of Electricity (LCOE) portfolio theory and, the mean-risk analysis of electricity generation investment portfolios, taking into account the relation between risk and deviation risk measures in the purpose of shaping the risk distribution.

Scenario Analysis
Scenarios have become a fundamental part of foresight science and scenario planning is recognized as the most widely used method in the futures field.
Again, since the planner's side is generally more developed, most of scenario analysis application are done on the planner's perspective, which [46,47] are examples of.
From the buyer's perspective we have the works of [48], that built a scenario tree as a tool to reflect the uncertainty shown in the price of the spot market.

Literature Review Summary
Overall conclusions are taken from the literature review: • Bi-objective optimization is popular among the portfolio analysis given its easiness to present and conduct to the results; as a MOO method weighted sum is the most popular and consensual.

•
As a risk measure for energy portfolio, mean-variance was preferred through time, however the more recent literature starts applying conditional value-at-risk and value-at-risk.

•
The literature in electricity portfolios focuses mainly of the planner's problems and challenges and there is a lack of work from the buyer perspective.

Methodology
The methodology undertaken in this work follows several steps and explores several methodologies. The first step identifies, in the literature review, the gap that remains to be fulfilled, considering the energy portfolio optimization of large consumer, from buyers' perspective. Followed by the stakeholder's identification and its roll characterization, mainly electricity suppliers' options and large consumer needs. The Iberian Market is explored, as large consumer stakeholder. Three electricity suppliers' options are considered: day-ahead market, forward contract and self-generation.
The forward contract will be set in a specific time and its output will be divided in 4 blocks of energy, each with a specific price. The self-generation energy implies a long-term investment, Energies 2020, 13, 2249 6 of 21 providing a constant energy throughout every hour of the planning horizon. A long-term investment aversion from the decision-maker must be considered. Its energy is divided in 4 blocks, each with a different price as well. The day-ahead market trading stands as the factor that brings uncertainty into the decision-making.
Data collecting and screening for further analysis and data characterization is performed. 48 weeks is considered as a final sample. However, this step is of high importance to grab the sector characteristics and feed the model with accurate information. Based on that, a deeper analysis over seasonality patterns identification is undertaken, such as: yearly, weekly and daily. Data categorization is undertaken according to their average spot price, in three categories: valley, shoulder and peak hours. Some parameters are estimated, and some information is omitted due confidentiality reasons.
The aim of this work is to explore the energy portfolio optimization considering simultaneously the cost and the risk, which trigger to a multi-objective approach. The trade-off between the two objectives is explored through the weighed-sum approach and its results characterized using the Pareto Font representation. An economic indicator, as costs is used as one of the objective functions, while a risk measure, as CVaR is explored to mitigate the risk.
Another relevant aspect is the electricity market variability/uncertainty. Its behavior is characterized through a Scenario Tree approach [49], as defined in Figure 1. The scenario tree has 3 branches leaving each node and 3 nodes, resulting in 3 3 = 27 scenarios. Each branch denotes one week, with a total planning horizon of 3 weeks. On each node decisions regarding weekly forward contracts and spot market trading are done and exclusively on the first node, the decisions regarding 3-week Contract and self-generation production are taken.
Energies 2020, 13, x FOR PEER REVIEW 6 of 22 different price as well. The day-ahead market trading stands as the factor that brings uncertainty into the decision-making. Data collecting and screening for further analysis and data characterization is performed. 48 weeks is considered as a final sample. However, this step is of high importance to grab the sector characteristics and feed the model with accurate information. Based on that, a deeper analysis over seasonality patterns identification is undertaken, such as: yearly, weekly and daily. Data categorization is undertaken according to their average spot price, in three categories: valley, shoulder and peak hours. Some parameters are estimated, and some information is omitted due confidentiality reasons.
The aim of this work is to explore the energy portfolio optimization considering simultaneously the cost and the risk, which trigger to a multi-objective approach. The trade-off between the two objectives is explored through the weighed-sum approach and its results characterized using the Pareto Font representation. An economic indicator, as costs is used as one of the objective functions, while a risk measure, as CVaR is explored to mitigate the risk.
Another relevant aspect is the electricity market variability/uncertainty. Its behavior is characterized through a Scenario Tree approach [49], as defined in Figure 1. The scenario tree has 3 branches leaving each node and 3 nodes, resulting in 3 3 = 27 scenarios. Each branch denotes one week, with a total planning horizon of 3 weeks. On each node decisions regarding weekly forward contracts and spot market trading are done and exclusively on the first node, the decisions regarding 3-week Contract and self-generation production are taken.

Problem Statement
A portfolio optimization for a large consumer is conducted, from a buyer´s perspective, mitigating expected cost and risk. The mixed integer linear programming formulation is extended from [40,48] and Iberian electricity market is used as large consumer.
Three different electricity supply options are considered: forward contracts, self-generation facilities and pool market trading. In the forward contracts a specific quantity of energy is purchase in advance, for a specific price, to be delivered in a specific time. The pool market trades in the dayahead market. While the self-generation the decision-maker must embrace an investment to pursue this option.
Hence, given sources price, scenarios and its probability, demand to be satisfied, the aversion to long term investment from the decision-maker and the confidence level for the CVaR calculation.

Problem Statement
A portfolio optimization for a large consumer is conducted, from a buyer´s perspective, mitigating expected cost and risk. The mixed integer linear programming formulation is extended from [40,48] and Iberian electricity market is used as large consumer.
Three different electricity supply options are considered: forward contracts, self-generation facilities and pool market trading. In the forward contracts a specific quantity of energy is purchase in advance, for a specific price, to be delivered in a specific time. The pool market trades in the day-ahead market. While the self-generation the decision-maker must embrace an investment to pursue this option.
Hence, given sources price, scenarios and its probability, demand to be satisfied, the aversion to long term investment from the decision-maker and the confidence level for the CVaR calculation.
The model determines: procurement of electricity on each of the electricity options, the optimized scheduled and the non-dominate solution, allowing the trade-off between the expected cost and the CVaR, for several risk postures.
It is subject to: expected cost and CVaR minimization.

Mathematical Formulation
This work is extended from [48], with the aim of support the large consumer, from a buyer perspective, in the electricity portfolio optimization. A mixed integer linear program (MILP) based on [48] is proposed to simultaneously minimize the cost and risk. The forward contracts use weekly intervals and deliver the same quantity of energy each hour over the contract horizon and can be set on single or multiple week's bases. The energy available in each contract, c, for a block, b, must verify its capacity, Equation (1).

Forward Contract
The E C c,b,w quantify the amount of energy contracted in contract c, for block b, in scenario w. The binary variable s C c,w is equal to 1, if contract c is assigned in scenario w, 0 otherwise. The parameters E Cmax c,b and E Cmin c,b define the maximum and minimum amounts of electricity, respectively.
Its cost is quantified in variable C C w in Equation (2). The parameter P C c,b defines the price for the block b, in contract c, which is available in week s, CD s and, at hour t CT t .
In forward contracts, the dependency between different scenarios regarding contract decisions is guaranteed through non-anticipativity constraints. Scenarios that are equal until a certain decision stage, should have the same decisions made until that stage, which is guaranteed by Equation (3). As done in [34], using a matrix of 0 s and 1 s where A(w, k) is equal to 1 scenario w and w+1 are equal up to stage k, 0 otherwise. Hence, the matrix's size is (N w − 1) × (N k − 1), which in our case is a 26 × 3 matrix. Using A we can formulate the constraint as done in (3). The K c defines the stage at which a decision on contract, c is undertaken.

Self-Generation Facilities
Self-generation facilities are a source of electricity, which must satisfy the minimum and maximum self-generation capacities, as in Equation (4).
Energies 2020, 13, 2249 9 of 21 The E G g,b quantifies the amount of energy self-generated in the facility g. The binary variable s G g takes the value 1, if the self-generated facility g is installed, 0 otherwise. The E Gmax defines, respectively, the maximum and the minimum energy self-generated, The cost of the self-generation facilities is given by Equation (5), with the H as the planning horizon and, P G g,b the price per energy unit.

Day-Ahead Spot Market and Energy Balance
In the day-ahead spot market is assumed that the costumer is a price-taker and, by that, its trades don´t impact in the market-clearing price. There is no real need to constrain the trade in the spot market. However, is necessary to guarantee the consumer only interacts as a buyer and guarantee that the self-generated electricity is not sold (partial self-generation are not allowed). Must be guranted that the energy procured from the day-ahead market, E P s,d,t,w , must be positive by Equation (6).
The cost is defined by Equation (7), the parameter, P P s,d,t,w , quantify the price, per energy unit.
The energy balance constraint, Equation (8), ensures the energy available per hour, from the three different sources: self-generated, forward contracted and the spot market, must satisfy the demand D d,t .

Conditional Value-at-Risk Definition
The mitigation of risk cost variability is performed using the conditional value-at-risk as in Equation (9). The Equation (9) denotes the expected cost of the (1-α) × 100% scenarios with greatest cost. The variables ζ and η w characterize the Value-at-Risk and conditional value-at-risk, respectively, used in Equations (10) and (11). The variable π w , defines the scenarios probability. The formulation followed is based on [48].

Objective Function
The objective function (OF) is defined though the weighted sum approach. The aim is to minimize the cost and risk of the portfolio, as in Equation (12). The weights used in the trade-off are defined through the value of the risk aversion factor β. This factor defines the decision-maker's propensity towards risk. If β became equal to 0, the OF only considers the cost, representing 100% of OF, but if β takes the value 5, the weight associated to the cost term of the OF is 1/6 and the remaining related to the CVaR term, as 5/6.
The decision-maker aversion to long-term investment is characterized by the parameter, λ. This parameter aims to countering or favoring the production of self-generated energy based on the willingness to contract technology with high fixed costs and long-life span.
The objective function is defined in Equation (12), which minimizes the costs and risk, based on

Data Collection and Parameter Estimation
The electricity data explored in the work is from Iberian Operator database [7], over one year (September 2018 to August 2019). The year considered is representative of the Iberian electricity market. However, data screening was performed and 48 weeks is considered as a final sample. The seasonality and daily market variability are shown in Figures 2 and 3.

Data Collection and Parameter Estimation
The electricity data explored in the work is from Iberian Operator database [7], over one year (September 2018 to August 2019). The year considered is representative of the Iberian electricity market. However, data screening was performed and 48 weeks is considered as a final sample. The seasonality and daily market variability are shown in Figures 2 and 3.
Along the day, the spot market prices follow a high variability, triggering a very high data volume. To overcome this drawback, the hourly price values for the planning horizon over the 24 h in the 48 weeks, are averaged, as shown in Figure 2. The variability pattern in 24 h, denotes amplitude of 12.97 €, with its maximum of 61,02€ at 10 p.m. and a minimum of 48,23€ at 5 a.m. Considering this pattern, the data are categorized according to their average spot price, in three categories: valley, shoulder and peak hours. Those categories are associated to low, medium and high price, respectively. The valley hours define the hours with an average market value lower than 54 €, the peak define the hours with an average market value higher than 58 € and the shoulder define the hours with values in between.

Scenario Generation
In the scenario generation, a representative period of three weeks data are used to characterize the scenario: optimistic, pessimistic and expected week, as shown in Table 1.
The weeks with the highest and lowest average price are chosen as pessimistic and optimistic scenario, respectively. The expected week takes the median of the average value. In scenario tree, Figure 1, three branches leave each node, optimistic, expected and pessimistic, leading to 27 scenarios, for the three weeks. The probabilities for each scenario are based on the Along the day, the spot market prices follow a high variability, triggering a very high data volume. To overcome this drawback, the hourly price values for the planning horizon over the 24 h in the 48 weeks, are averaged, as shown in Figure 2. The variability pattern in 24 h, denotes amplitude of 12.97 €, with its maximum of 61.02 € at 10 p.m. and a minimum of 48.23 € at 5 a.m. Considering this pattern, the data are categorized according to their average spot price, in three categories: valley, shoulder and peak hours. Those categories are associated to low, medium and high price, respectively. The valley hours define the hours with an average market value lower than 54 €, the peak define the hours with an average market value higher than 58 € and the shoulder define the hours with values in between. For 9, 10, 11, 12, 13, 19, 20, 21, 22} Other relevant data are to define the price for each day of the week, denoted from now on as, weekly day price. The weekly day price pattern results from the difference between the average price of each day of the week over the 48 weeks and the year average, shown in Figure 3. The weekly day pattern has its highest value on Tuesday and the lowest on Saturday and Sunday. This pattern is directly related with the electricity spot market prices variability.

Scenario Generation
In the scenario generation, a representative period of three weeks data are used to characterize the scenario: optimistic, pessimistic and expected week, as shown in Table 1. The weeks with the highest and lowest average price are chosen as pessimistic and optimistic scenario, respectively. The expected week takes the median of the average value.
In scenario tree, Figure 1, three branches leave each node, optimistic, expected and pessimistic, leading to 27 scenarios, for the three weeks. The probabilities for each scenario are based on the probability assigned to each branch over the 3 weeks. The scenarios' probability characterization used the 48 weeks data, to consider yearly seasonality. Using the three weeks average values as a benchmark, the remaining weeks of the data set were divided in 3 sets, based on their average value. Each week is assigned to the set (characterized pessimist, average optimist), which as the closest value to the benchmark. The probabilities of each week shown in Table 2, is the ration between the numbers of weeks in each set by the total set of 48 weeks. Finally, each scenario probability is obtained using the conditional probability and assuming independence between the events (multiplying the probabilities associated to the three branches leading to that scenario).

Forward Contract Data
The forward contract explores two different contracts: weekly and 3-week. Beyond that, a map of contract is also considered, Table 3. The contracts will either set on the 24 h of the weeks they are settled on, denoted as base contracts or on one of the 3 sets of hours of the day, defined above: valley, shoulder and peak, denoted from now one as time-of-day contracts. Therefore 16 contracts are considered, as shown in Table 3. Each contract is characterized in 4 blocks based on electricity prices and its electricity availability (maximum and minimum). Each block has 20 MWh available, which adds up to 80 MWh of electricity available per hour in each contract. If a contract is signed, it must have a minimum output of 20 MWh per hour.
The prices of the blocks are assigned to represent the behavior of a price-maker, similar methodology was followed by [50].
The prices assigned to the block 2 contract, is used as a baseline. Its values were defined considering the average price of each of these times in the spot market (e.g., the valley contracts have the lowest price per energy unit and peak contracts the highest). The prices in blocks 3 and 4 are increased by 5% and 10%, respectively, using the baseline. The baseline price was decreased by 2% to characterize the block 1. The price of the base contracts set is obtained through the prices of the valley, shoulder and peak contracts and the fraction of the day they represent. The resulting prices are shown in Table 4. The price of the second block for the 3-week contracts is determined by decreasing the values of the corresponding weekly contract in 2%. The price for the other blocks is calculated following the same methodology as the one used in the weekly contracts.

Self-Generation Facility
The self-generation case explores the implementation of a single renewable electricity source, with a levelized electricity price to characterize the fixed and variable costs. The levelized electricity price assumes the price per energy unit produced throughout the entire expected lifetime of the equipment. This way, it is possible to put the long-term investment into perspective, enabling a comparison with the electricity spot market prices, which allows an analysis of trade-off of the two.
Data were taken from study conducted by Fraunhofer Institute for Solar Energy Systems [51]. The installation of a PV technology is assumed. The levelized price is 35.5 €/MWh. This will be the price for the first block of energy. The following blocks' prices are obtained by subsequently increasing in 10% the value of the original block, shown in Table 5. This method represents other costs that arise as the investment grows, e.g., cost of space for the PV panels. Each block has 15 MWh of energy available and there is a minimum of 15 MWh, if this source is chosen.

Case Studies
To illustrate and explore the model's applicability of portfolio optimization three case studies are considered: case a) explores constant demand profile; case b) a cyclic daily demand comparison between nominal operating starting time and its optimization; case c) explores the weekly day price pattern over the two situations: with and without daily order optimization. To highlight each portfolio characteristics, different electricity demand profile is used. The confidence level used is 0.95. The general algebraic modeling system (GAMS) is used and the problems solved with an Intel Core i7 processor, until optimality is reached.

Case a): Constand Demand Profile
The portfolio characterization requires the aversion factor to long-term investment characterization. A constant hourly demand of 200 MWh, throughout the planning horizon is used.

Aversion Factor to Long-Term Generation Investment Value Characterization
The long-term generation investment is capital intensive and by nature has risk associated, requiring a deeper analysis for its characterization. The aversion factor value for long-term generation investment (λ) penalize or favor the use of self-generation facility. To diminish the impact this investment could have, considering a short-term decision-making model, this factor is multiplied by the cost obtained from the levelized electricity price, to become competitive between other options. Furthermore, a deeper analysis is undertake to define the λ value considering different risk postures, as shown in Table 6, for different values of β and λ.  Table 6 illustrates how sensitive is the value of λ facing different risk postures. The cases where λ takes the extreme values (1 and 2) illustrate: on the former the electricity contracted from this source is at the maximum available value for all the values of risk aversion (60 €/MWh), which became very attractive compared to the other options; on the latter, however no self-generation investment is suggested for any risk posture, reflecting that the price is not competitive at all (0 €/MWh). For the cases where the factor is 1.3 and 1.6, the electricity generation are sensitive to different values of risk aversion. However, the model has higher sensitivity with λ =1.3, showing higher variability (from 30 to 60), which enables the self-generation facility more attractive to different risk postures. Therefore, the value of λ = 1.3 is selected to characterize the long-term generation investment.

Expected Cost vs. Conditional Value-at-Risk
To define the non-dominated solution and its Pareto front characterization, a trade-off between the conditional value-at-risk (CVaR) and the expected cost is explored, as shown in Table 7. The solution for β = 0 reached the lowest expected cost and highest CVaR, while β = 5 reached lowest CVaR and highest expected cost. For β = 0 the OF term regarding risk is not taken into account, considering only expect cost minimization, while β = 5 the OF prioritizes the risk reduction. Hence, a reduction of the CVaR comes with an increase of the expected cost. It is relevant to notice β = 1, decrease 16.2% in the CVaR with a minor increase of the expected cost (4.88%).

Portfolio Evolution
The portfolio characterization makes use of different electricity supply options, with different prices and, different risk levels. The portfolio evolution for the 3 weeks contract over several levels of β is characterized in Figure 4 (figures are made by resorting the expected value of procurement over all scenarios). As Figure 4 illustrates the use of four types of electricity supply options: day-ahead market, self-production, weekly contracts and 3-week contracts in the portfolio characterization.
The portfolio characterization makes use of different electricity supply options, with different prices and, different risk levels. The portfolio evolution for the 3 weeks contract over several levels of β is characterized in Figure 4 (figures are made by resorting the expected value of procurement over all scenarios). As Figure 4 illustrates the use of four types of electricity supply options: dayahead market, self-production, weekly contracts and 3-week contracts in the portfolio characterization.
One of the most noticeable result is how the weekly and 3-week contracts increases as the value of β increases, reflecting conservative behavior (risk aversion) of the maker-decision, handling riskfree decision, triggering the increase of expected cost. Simultaneously, the self-generated electricity portfolio also increases, based on the same behavior of the decision-maker. The 3-week contracts are always higher than the weekly contracts. However, the electricity procured from the day-ahead market drops massively as the risk aversion increases, going from an 85% share, to 0% when β = 5.

Forward Contracts
Forward contracts and self-generation facility are able to hedge risk from the spot market. However, the risk behavior has impact in the selection of which and type of contacts for the portfolio. Specifically, for the forward contracts is necessary to analyze, how the contracting is developed from time-of-day contracts base, to weekly contracts, as the risk aversion increases.
The characterization of the several scenarios of forward contract over the sets, valley, shoulder and peak is shown in Table 8. The results show as risk aversion increases, higher energy contracted for peak and shoulder hours increase compared with valley. Since this latter have higher spot market price, so contracts are done to hedge this risk. One of the most noticeable result is how the weekly and 3-week contracts increases as the value of β increases, reflecting conservative behavior (risk aversion) of the maker-decision, handling risk-free decision, triggering the increase of expected cost. Simultaneously, the self-generated electricity portfolio also increases, based on the same behavior of the decision-maker. The 3-week contracts are always higher than the weekly contracts. However, the electricity procured from the day-ahead market drops massively as the risk aversion increases, going from an 85% share, to 0% when β = 5.

Forward Contracts
Forward contracts and self-generation facility are able to hedge risk from the spot market. However, the risk behavior has impact in the selection of which and type of contacts for the portfolio. Specifically, for the forward contracts is necessary to analyze, how the contracting is developed from time-of-day contracts base, to weekly contracts, as the risk aversion increases.
The characterization of the several scenarios of forward contract over the sets, valley, shoulder and peak is shown in Table 8. The results show as risk aversion increases, higher energy contracted for peak and shoulder hours increase compared with valley. Since this latter have higher spot market price, so contracts are done to hedge this risk. Although, the behavior over the three sets are the similar for β = 0 and β = 5, none and the maximum forward contract, respectively. However, the forward contract increases as the risk aversion increases (β = 5). For the same values of β, the contact over shoulder and peak hours decrease, with its minimum in the base contact, while the valley denotes higher variability.
The electricity from forward contracts during the valley hours comes mainly from base contracts, while for shoulder and peak hours comes mainly from average forward energy/week and time-of-day contracts rather than from base. This behavior is justified due the price of the base contract is defined based on the prices of the 3 times of day. Although, it may be advantageous, since it can represent a lower price option in peak and shoulder hours, triggering an overpay in valley hours.

Case b): Cyclic Daily Demand over Optimized and Non-Optimized Starting Time
This case study follows a cyclic daily demand (24-h cycle) of a multipurpose batch plant [52] campaign production, which repeats itself continuously for the campaign duration. As previously identified and characterized the spot market prices seasonality over the hour of the day (Valley, shoulder and peak hours) is explored in this context.
The aim is to analyze how the facility can take advantage from daily seasonality. Case b) is split into two smaller situations: the starting time of the cycle is optimized vs. non optimize (the starting time is defined at hour 0 of the series). The comparison and results illustrate the impact on the trade-off between expect cost vs. risk. A mixed demand pattern is used for the cycle, with minimum, maximum and average consumption of 170 MWh, of 250 MWh and of 200 MWh, respectively.

Starting Time Formulation
To formulate this behavior the aforementioned formulation is extended, with equations Equations (13) and (14). Equation (13) guarantees that only one starting time is chosen, while Equation (14) selects the right schedule to be used considering the energy balance Equation (8).
An extended formulation considers a starting times index, θ and parameter for the demand, where the demand profiles along the hours, t, is shifted for all the possible starting times θ, ND t, θ . The binary variable became s θ =1, if θ is the starting time chosen, 0 otherwise. The parameter D d,t of Equation Energies 2020, 13, 2249 16 of 21

Expect Cost vs. CVaR Comparison
The Pareto front characterization and its results for with and without starting time optimization are shows in Figure 5 and Table 9, respectively.

Procurement Analyses: Valley, Shoulder and Peak Hours
The portfolio characterization over the three sets (valley, shoulder and peak) and its comparison between with or without start time optimization is shown in Table 10. Analyzing the pattern from the sets in non-optimized versus optimized shows: an increase of energy procurement in the valley set in the optimized rather and non-optimized and, an opposite behavior decreases in the shoulder and peak sets. This behavior is justified by the starting time optimization avoids matching the hours with higher demand (peak hours) and rather takes advantage from the valley hours. This resulted on a drop of 12.24% in the electricity procurement in peak hours, on average from every value of β and an increase of 26.5% in the valley hours.

Case c): Weekly Optimization
The third case explores the price pattern of each day of the week, week seasonality ( Figure 3). The scheduling of activities is optimized according the trade-off between minimization of expected cost and risk. However, this case uses a representative sample of seven days of energy demand, denote further on, as series, which are allocated to an optimal day of the week.  The starting time optimization has a lower expected cost than the non-optimized, for the same values of β, as shown in Figure 5. However, the trade-off between the expected cost and the risk shows the starting time varies depending on the risk behavior. If the decision-maker takes β = 0, the starting time is 7 h. However, for β = 1, the optimized starting time is 6 h and, for the remains values of β = 1.5, 2, 5 is 8 h. As in previous analyzes, the expected cost increases in both scenarios with the increment of the risk aversion factor and the CVaR decreases.

Procurement Analyses: Valley, Shoulder and Peak Hours
The portfolio characterization over the three sets (valley, shoulder and peak) and its comparison between with or without start time optimization is shown in Table 10. Analyzing the pattern from the sets in non-optimized versus optimized shows: an increase of energy procurement in the valley set in the optimized rather and non-optimized and, an opposite behavior decreases in the shoulder and peak sets. This behavior is justified by the starting time optimization avoids matching the hours with higher demand (peak hours) and rather takes advantage from the valley hours. This resulted on a drop of 12.24% in the electricity procurement in peak hours, on average from every value of β and an increase of 26.5% in the valley hours.

Case c): Weekly Optimization
The third case explores the price pattern of each day of the week, week seasonality ( Figure 3). The scheduling of activities is optimized according the trade-off between minimization of expected cost and risk. However, this case uses a representative sample of seven days of energy demand, denote further on, as series, which are allocated to an optimal day of the week.
Seven representative days of demand are randomly selected to be scheduled within the week, defined in Table 11. Based on the 24 h information of these days the demand profiles are characterized. Its statistics are shown in Table 11. The 6th series has the highest variability (CV=18.2%), while the 1th the lowest. Being the 7th and the 4th series with the highest maximum values. The schedule defined is repeated for the 3 weeks under study. For the weekly optimization and based on aforementioned formulation, the formulation is extended with constraints Equations (15)- (17). Equation (15) guarantees that only one-day demand profile (from Table 11) is assigned to each day of the week, through the binary s s d,λ . Equation (16) guarantees that all day demand profiles are assigned to a day of the week. Equation (17) defines the final demand profile.
A new index, γ, is used as an alias of d; the parameter, EED t,γ , characterize the 7-day profiles. The demand profile, D d,t , is obtained in Equation (17) to be used in Equation (8).

Pareto Front Characterization
The Pareto front is defined for with and without order optimization, followed by the day order scheduling analysis, in Figure 6 and Table 12, respectively.

Pareto Front Characterization
The Pareto front is defined for with and without order optimization, followed by the day order scheduling analysis, in Figure 6 and Table 12, respectively.  Both situations have a similar behavior. The expected cost increases and the CVaR decreases with the increase aversion towards risk (β). However, the order optimization allows more favorable trade-offs between the two objective functions, for every β.

Day Order Scheduling Analysis
The day order optimization considers how the price seasonality of the day of the week (Figure 3), impact in the energy purchase, based on data from Table 11. The analysis is performed for several aversion to risk patterns and the results are shown in Table 2. Figure 3 identifies the days with lower electricity prices are: Sunday, Wednesday and Saturday, respectively. The result of the weekly day optimization in Table 12, shows the impact the daily price seasonality has. All risk aversion values, except β = 5, the day-series for Saturday and Sunday are the 7th and 4th, respectively. These results from the 4th and 7th series have the highest and second higher mean value, being assigned to the days with the lowers electricity price, Sunday and Saturday, respectively. The remaining days of the week, from Monday to Friday, shows a difference price pattern, although less relevant (Figure 3), where the days' difference to average was very similar.

Conclusions
This work proposes a mixed integer linear formulation for the energy portfolio optimization problem for large consumer in a buyer perspective. A multi-objective approach is explored to deploy several options to the decision-maker based on its risk pattern. A weighted sum formulation is presented for the expected cost and risk minimization. The binary variables define the procurement decisions and the continuous variables define the electricity procured, cost of each electricity supplier options, as well as the value of the CVaR.
The Iberian electricity market is considered as a case study. The data analysis and screening are developed and are highlighted and used in the cases studies for price seasonality, weekly and daily bases. The electricity supply options explored for the portfolio characterization are pool market, forward contract and self-generation.
The portfolio characterization and the decision-maker behavior towards to risk is developed exploring three cases. Case a) uses constant demand profile; case b) explores manufacturing aspect, considering a cyclic daily demand and a comparison between nominal operating starting time and its optimization is developed, while case c) explores the weekly day price seasonality. In all cases different values of the risk aversion factor are explored.
Some practical guidelines may be drawn from the results. From case a) the pool market procurement reveals more suitable for decision-maker with pattern taker to risk, while risk averted decision-maker prefer forward contracts and self-generated energy. These different postures lead to a higher CVaR and lower expected cost for the risk taker decision-maker and lower CVaR and higher expected cost for the risk averted decision-maker.
The seasonality effect is explored in cases b) and c). The results from case b), which consider the hour seasonality, avoid the high price hours and favor the low-price hours. In case c) the week seasonality is considered and the tendency is favoring low price days rather than high price. The advantage from using the hour price seasonality (case b) shows better results in terms of objective than case c). As a guideline for the decision-maker, the demand allocation considering the hours of the day, reveled more effective in price reduction than solely paying attention to the day of the week.
Three aspects should be considered as further work. The self-generated energy should be explored not only from the buyers, but also the seller perspective. The use of converting temporarily the electricity in some other form, taking advantage from the low price, so as to be used in the short term. In addition, data analytics approaches, to deal with more detailed information and real-time optimization. Funding: This research was partly supported by AGH subsidy for maintenance and development of the research potential.