Dynamic Power Purchase Agreement

This paper deals with the problem of defining the Power Purchase Agreement (PPA) that enables power exchange between two or multiple parties. Generally, PPA is a long-term contract with predefined price and power profiles. Energy reliability risk needs to be properly considered to make PPA more attractive to a potentially interested party. That is the reason, why we decided to propose the concept of a so-called dynamical power purchase agreement. The method provides short-term contracts where parameters can change as often as needed. Dynamical PPA should allow each party to selfishly minimize its cost or maximize its revenue while producing a consensus solution. The dynamic PPA is formulated as a model predictive control optimization problem in a multi-objective fashion, solved by the Pareto front and method of global criterion. Results show the potential of such an agreement to react to the power market conditions and still satisfy the needs of each involved party.


I. INTRODUCTION
A Power Purchase Agreement (PPA) has become popular recently because it ensures power transfer between two parties under favorable conditions. The PPA specifies the price, quantity, delivery schedule, payment terms, and other conditions under which the two parties will agree to cooperate. Typically, the exchanged power is renewable-based and the agreed-upon price is reduced compared to the utility price. The "green" energy and negotiable price motivate the business sector to pursue PPAs as stated in [1]. An International Energy Agency reports in [2] a more than five-fold increase in corporate PPA volumes between 2015 to 2022 (4.7 GW in 2015, 25 GW in 2022. This shows that sustainability has moved from mere public relations to a core value for companies. Generally, the PPAs are managed in literature by introducing preferences. For instance, in [3], the electricity seller's benefit is preferred over the buyer's (in terms of PPA), while in [4], the perspective is reversed. This type of prioritization can be justified from a practical point of view, but in reality, the preference is difficult to define. Authors of [5] proposed a methodology for each party's interests to be acknowledged. However, while the seller's financial benefits are considered, the buyer's perspective is only on energy reliability.
This paper is concerned with optimizing the parameters of a PPA, which stipulate business terms under which two or multiple parties exchange electric energy. The exchange terms are made of two quantities: the amount of energy traded and the unit energy price. In conventional PPAs, the energy price is kept constant throughout the duration of the contract [6], which may be as long as 25 years. In this paper, we aim at so-called "dynamic PPAs", which are short-term contracts whose parameters can change as often as on a daily basis. In addition, the energy price in dynamic PPAs is time-varying even throughout the duration of the contract. This yields more business flexibility and increases the willingness of involved parties to exchange energy on more favorable terms. Such dynamic PPAs allow each involved party to monetize its temporary or permanent excess of own-generated energy and to compensate, at favorable economic terms, temporary spikes in local power demand.
Naturally, each party wants to optimize the PPA terms in a selfish manner, i.e., minimizing its cost and maximizing its revenues. This selfish approach, however, makes it difficult for the parties to agree on one joint agreement. Our goal, therefore, is to devise an optimization-based procedure that takes as inputs the technical expectations of each party (e.g., the expected local energy demand, expected local energy production, variability in energy demand/production, etc.) and synchronizes them in a way of achieving consensus between their contradicting objectives (e.g., the energy importer naturally wants the energy price to be low while the exporter wants to maximize the price). The output from our procedure is a time-varying profile of exchanged energy, accompanied by a time-varying energy price.
The problem at hand is nontrivial because of two main reasons. First, it is a multi-objective optimization problem where each party wants to achieve its selfish goals. These goals, however, are interconnected in a business sense. The second reason is that the total cost of energy, which each party wants to minimize individually, is naturally given as the product of the energy amount and the energy price. Thus the cost functions involve bilinear terms. Thus, from a mathematical point of view, the problem is a non-convex multi-objective optimization setup.
Besides devising a mutually acceptable profiles of exchanged energy and its price, an added benefit of our method is that it explicitly accounts for the stochastic nature of energy production and consumption. This is of imminent importance when renewable energy sources (photovoltaics, wind turbines) are part of the play. Energy production of these assets is subject to quickly varying environmental conditions, which are difficult to predict. Thus, our approach operates with confidence intervals that dictate the lower/upper bounds of achievable energy production. A scenario-based sampling is then used to inform the optimization problem about the fluctuations. As an important feature, our method supports battery energy storage systems that can be used to temporarily store energy at one moment in time and to supply the stored energy at a later time, thus allowing energy production and consumption to be shifted in time.

II. MICROGRID SYSTEM
In our setup, each party involved in the dynamic PPA optimization is represented by a microgrid with its own energy production (typically from renewable sources such as sun or wind) and energy consumption. Moreover, each microgrid is assumed to be connected to the main utility grid, from which it can import and export energy at pre-specified financial terms. In addition, each microgrid might be equipped with energy storage that is capable of shifting energy utilization in time. Finally, microgrids can exchange energy through the PPA contract. At each point in time, each microgrid must maintain the produced (or imported) power in balance with the consumed (or exported) power. Therefore, the following power balance equation must be satisfied at all times Here, P imp (t) is the amount of power drawn from the utility grid at time instant t, P prod denotes own power production, P dis is the power discharged from the energy storage, P PPA is the power exchanged through the PPA contract, P exp is the power exported to the utility grid, P cons is the own consumption of the microgrid, and P char denotes the power charged into the energy storage. All power quantities are non-negative with the exception of P PPA , which is positive if power is imported, and negative if power is exported. In addition, the energy storage unit is assumed to have a limited energy capacity, represented by known quantities E min and E max . The energy storage is a dynamic system whose internal state E(t) represents the amount of energy held by the storage at time t. The time evolution of the state is given byĖ where η char and η dis are the charging and discharging efficiencies, respectively. Note that most energy storage systems (e.g., battery-based) do not allow simultaneous charging and discharging, thus the following constraint must be imposed: The economics of the microgrid operation is represented by the cost function J, which is composed of the following terms: (i) the cost of energy imported from the utility grid c imp (t)P imp (t), (ii) the profit from exporting energy to the utility grid c exp (t)P exp (t), (iii) term c PPA (t)P PPA (t) representing the cost (if P PPA is positive) or profit (if P PPA is negative) of energy exchange through the PPA. Note that c imp and c exp , although time-varying, are assumed to be a-priori known quantities. On the other hand, the import/exported/exchanged powers P imp , P exp , P PPA , as well as the PPA energy unit cost c PPA , are to be determined by the PPA optimization.
Since the PPA decision-making needs to optimize the cost function and enforce satisfaction of constraints, we propose to formulate the problem as a Model Predictive Control (MPC) setup, which considers the current conditions along with the forecasted future behavior of the microgrid. In simple terms, the MPC problem of each microgrid can be formulated as where t f denotes a finite prediction horizon. The problem's optimization variables that need to be determined are (i) microgrid variables P imp , P exp , P char , P dis , (ii) consensus variables P PPA , c PPA . The other variables (c imp , c exp , P prod , P cons ) are assumed to be known a-priori as they are either dictated by long-term contracts with the utility grid operator (in the case of c imp , c exp ), or a location-dependent (in the case of P prod and P cons ). To arrive at a computationally tractable problem formulation, we discretize the continuous-time MPC problem with a fixed sampling time ∆.
The MPC structure of the problem is motivated by the fact that it employs a prediction of certain parameters and optimizes the system's performance with respect to a given cost function, which is formulated over a fixed time window into the future. Additionally, since the properties of dynamic purchase agreement naturally change in time, the optimization is repeated on a periodic basis. This is precisely what MPC, implemented in the receding horizon fashion, achieves.

III. OUR APPROACH
The difficulty of calculating the profile of exchange power P PPA (t) and the associated price c PPA (t) from the MPC problem stems from two crucial points: own production and own consumption at each microgrid is often stochastic in nature, which means that the respective quantities P prod and P cons can only be forecasted to a certain extent, represented by respective confidence intervals. Thus, the MPC problem needs to operate with forecasting intervals instead of one concrete evolution.
Each microgrid minimizes its own objective in a selfish manner. This means that the microgrid that wants to import energy from the other PPA party naturally wants the associated price c PPA to be low. On the other hand, the microgrid that has a surplus of energy naturally wants the PPA price to be high. Therefore, it is necessary to coordinate the various parties, which gives rise to a multi-objective optimization setup.

A. Forecast Scenarios
To address challenge number 1, we suggest employing a scenario-based approach where each uncertain quantity (P prod and P cons ) is represented by a set of possible evolutions. Thus, instead of having one particular forecasted trajectory P prod (t) and P cons (t), we consider a whole set of trajectories (i.e., scenarios) P prod (s, t), P cons (s, t), where s is the scenario index. In the following paragraphs, we will show the procedure of obtaining prediction and, subsequently, scenario generation on the production signal.
First, we forecast production with a recurrent neural network (RNN) that was trained using historical measurements and weather data w(t) aŝ for all t ∈ {1, . . . , N }. This RNN model is built to provide a confidence interval due to the presence of inevitable uncertainties. The confidence interval is determined by using the maximum likelihood method. This method separates the variable of interest into its expected value,P prod (t), and the noise component. This allows for estimating the total prediction variance, σ 2 (t), which considers both model uncertainty and measurement noise. Second RNN is trained to predict the total varianceσ 2 (t). The upper and lower bounds are then calculated as where S f is the scaling factor. Scenarios are then generated within given bounds with normal distribution ω d ∼ N (0.5, σ 2 d ) and additional white noise ω n (t) ∼ N (0, σ 2 n (t)) as Forecast scenarios for energy consumption of the microgrid are generated using the same procedure, but instead of RNN, the seasonal autoregression model is used to provideP cons (t) values for the whole prediction horizon.
Once the scenarios are generated, the cost function in the MPC problem needs to be changed to account for the expected value of the financial representation of the cost function, i.e.: If all scenarios appear with the same probability, the expected value E can be replaced by the average 1

B. Risk Management
Generally, the microgrid in the exporter role seeks to increase its profit by agreeing to exchange as much power as possible expressed by cost c PPA (s, t)P PPA (s, t). However, the uncertainties in predictions add to the risk of the potential inability to deliver the agreed power quantity. Moreover, it yields additional exporter expenses because residual energy must be bought from the utility grid for market prices. Since generated scenarios represent the possible outcomes, we use them to evaluate the reliability risk. As illustrated in Fig. 1, there are two possible situations. First, for any scenario s in time step t, the microgrid produces more power (green-dashed line) and then is exported (black line). Here, no penalization is considered because no risk is present, and the excessive power can be stored in the battery or sold on the energy market. Second, if the microgrid produces less energy (red-dashed line) than is agreed to export, residual energy is bought from the utility grid resulting in increased variable P imp (s, t). The risk is represented by the amount of extra power imported to the microgrid and the price on the energy market c imp (t)P imp (s, t).
The risk in this form can only be taken into account through scenario-based MPC. It is important to mention that additional restrictions exist in our MPC formulation. Essentially, all scenarios must produce same power P PPA (s, t) and price c PPA (s, t) profiles.

C. Multi-objective Optimization
To address the second challenge, we first deliberately restrict ourselves to just two parties in the PPA optimization. Note that such a restriction is based purely to simplify the exposition and all results of this paper can be directly extended to support multiple parties.
First, note that the PPA optimization problem that needs to be solved can be stated as where x i aggregates the optimization variables that are local to each microgrid (i.e., x i = [P imp (t), P exp (t), P char (t), P dis (t)]). Important to notice is that the optimization objective is vectorvalued where the task is to minimize each term individually while taking into account that individual objectives are coupled with the PPA parameters (the prices c PPA (t) and the power profiles P PPA (t)). It is well known that multi-objective optimization problems of such a form give rise to a Pareto optimal front that describes all optimal solutions [7].

D. Pareto Front
The Pareto front is the set of solutions called Pareto optimal solutions as introduced in [8] that represents the best trade-off between multiple objectives. It consists of all possible combinations of objective values which cannot be improved upon without sacrificing another objective. Typically, the Pareto front provides a solution to a multi-objective optimization problem in the form where y ∈ R n represents vector of optimized variables, Y is the feasible set of decision variables, and M ≥ 2 is a number of considered objectives f i (y). A feasible solution . The solution y ⋆ ∈ Y is considered Pareto optimal if there is no other solution that dominates it [9]. There are multiple ways how to evaluate the Pareto front. One simple approach is to transform multi-objective cost to mono-objective using weights α i . This approach is called scalarization. Each weight α i gives relative importance to the objective f i (y) in an overall solution as presented in [10]. The mono-objective optimization problem is mathematically defined as where J represents linear combination of all objectives with α i ≥ 0 and M i=1 α i = 1. The problem (11) is solved multiple times for a different combination of α i values. Solutions to (11) are declared as Pareto optimal, and they define the shape of the Pareto front.
In PPA terms, the Pareto front is evaluated as a solution to subject to original constraints of both parties, where α 1 , α 2 are non-negative and satisfies α 1 + α 2 = 1.

E. Solving Multi-objective Optimization
Once we have constructed the Pareto front, we need to select one final solution while knowing it will not be better than others. Since there is no difference in overall cost, the presence of a decision-maker is often demanded. The methods for solving multi-objective optimization are categorized based on the role of a decision-maker into four groups, as shown in [11]. Since, we want to solve optimization problems without any preference, we will focus on the frequently used method of global criterion from the no-preference methods category.

F. Method of Global Criterion
The method of the global criterion was introduced in [12]. The main idea is to obtain a single solution from the Pareto front that is closest to the ideal objective vector z ⋆ ∈ R M calculated as z ⋆ = [f 1 , . . . , f M (y)] ⊤ , where f i = min y∈Y f i (y) as stated in [13]. The final solution depends on chosen L p space. The problem is mathematically defined as The solution to (13) is Pareto optimal as proved in [14] and serves as the single final solution to our multi-objective optimization problem. To find one exact solution to the PPA optimization problem, we apply the method of global criterion to problem (9) in the following manner subject to the original constraints of each party. The ideal objective vector z ⋆ is gained as again including original constraints. The square of 2-norm was chosen to formulate an optimization problem to find the minimal distance d between the ideal solution and Pareto front while avoiding mathematical problems with roots.

IV. CASE STUDY
In this paper, we focused on the PPA agreement, where one microgrid was insufficient in covering its consumption. Therefore, it made a pack with a second microgrid (power producer) to deliver the remaining green power. Furthermore, the agreement stated that the prices and amounts of exchange energy would be defined as an output of an offline optimization problem, including risks in the form of scenario penalization.

A. First Party
The first party (buyer) in our showcase represents a foundry fabric. The site consists of a photovoltaic system with a maximum 150kW peak power and a battery storage system with dimensions 50kW/150kWh, which supports the foundry's power needs. The factory buys electricity from the grid, so the energy market gives c 1,imp . The maximal amount of imported/exported energy is based on structure capacity. The grid connection is bidirectional, meaning the site can feed in spare power.

B. Second Party
Grid-connected power producer owns a photovoltaic panel system with a maximum 500kW peak. It is supplemented with two battery storage systems with dimensions of 50kW/150kWh. The import price c 1,imp is given by market prize, but for showcase purposes, we consider different profiles for both buyer and seller. For showcase purposes, the second party (seller) only generates energy and does not report any consumption. However, the presented approach can handle any setup (with/without consumption, with/without battery), even with multiple parties.

C. Exchange Conditions
The limitations on exchanged power and price are given by both parties and must be included in the PPA optimization problem in the form of minimum and maximum constraints. First, the maximum exchanged power depends on the connection capacity between the two parties. Second, the buyer desires to purchase power from the cheapest source, which implies he is not willing to pay more than the grid price. Therefore, the upper boundary on export price is defined as 85% of grid price resulting in c PPA ≤ 0.85 · c 1,imp . On the other hand, the seller does not tolerate prices lower than investments and operating costs per time unit. We calculated it to 0.2C/kWh resulting in c PPA ≤ 0.2.

D. Offline Optimization
After each party was modeled in terms of model predictive control in form (4) creating two objectives of multi-objective optimization, the Pareto front was gained by solving (12) for each α 1 ∈ {0, 0.1, 0.2, . . . , 0.9, 1}, where α 2 = 1 − α 1 . Finding (15) enabled to solve multi-objective PPA optimization problem defined in (14). This problem was evaluated in discrete time for prediction horizon N = 96 representing one day with ∆ = 15 minutes sampling time. For solving PPA in the form of stochastic model predictive control, we generated 20 scenarios for each prediction with a 90% confidence interval, where all parties must agree upon one final exchanged power and price profile.

V. RESULTS
The approach proposed in this paper highly depends on the prediction's quality. Fig. 2 shows all generated scenarios with upper and lower bounds over 24 hours for our case study (first party -buyer, second party -power producer). These scenarios are then used in multi-objective optimization.
The Pareto front for optimization problem (9) is visualized in Fig. 3. The ideal solution is marked with a green star, but there exists no combination of objectives that produce it. Therefore, the goal is to find the closest solution possible. Blue circles represent Pareto optimal solutions found using different weights of individual objectives. The final solution obtained by the method of global criterion is illustrated as a yellow circle. As we can see, the algorithm converged to one of the closest solutions.
The solution representing the amount of exchanged power and the associated price is illustrated in Fig. 4. The exchanged power is shown in the top subplot as a red curve. The green area represents the space defined by scenarios. The bottom subplot shows the evaluation of prices. The red curve represents the exchange price, the light green area portrays the feasible region, and the black dashed-dot line evolution of c 2, imp penalizes risk in the exporter objective. As we can see, when c 2, imp is high, the consensus is to increase the PPA price since the risk for the exporter arises. However, it still satisfies the importer price limit. On the other hand, if c 2, imp is lower, the exchange price is at its lower bound. This behavior is justified since the exporter undergoes a higher risk of additional cost in the first case and a lower risk in the second. Subsequently, when the c 2, imp is higher than the upper bound on c PPA , the exchanged power is reduced considering possible evaluations. The reason is simple. Higher penalization causes exporter to risk less and offer conservative decisions about the exchanged amount of power. Blue areas on both graphs represent daytime, where no spare energy is generated. Thus there is no exchanged power, and the price value is unimportant. The red area identifies the region where the lower and upper bounds collide, creating an infeasible solution. Since there is no price consensus, the amount of exchanged power is kept at zero. Note that the situation is handled by slack variables and binary optimization variables. Furthermore, we can see that the PPA price is still on the feasible region boundary. It is caused by problem formulation since using weighting in the Pareto front provides results either on the upper or lower limit based on preferences set by α. On the other hand, the green line visualizes cost/profit if the agreed price was at the lower bound of the feasible region resulting in the buyer's cost profit but the lowest seller's. Our approach does not prioritize seller over buyer or vice versa, but it offers the solution in the form of compromise to ensure the economical operation of both parties.

VI. CONCLUSION
This paper proposes a dynamic power purchase agreement to ensure business flexibility and provide favorable terms for involved parties. First, we deal with the optimization problem of PPA as model predictive control, where each party maximizes its satisfaction. Since the resulting problem is in the form of multi-objective optimization, we review and implement the Pareto front. Subsequently, we use the global criterion method to yield one final solution. As results show, a consensus in terms of both parties satisfaction can be achieved. Moreover, it can be evaluated at any time considering every limitation the involved parties specify. Based on the results, our approach offers a no-preference solution to achieve the economical operation of each involved subject. Another benefit is the ability of the proposed procedure to take into account multiple parties.
We see the space for future improvements. For example, we would like to include bonuses ensuring preference for so-called "clean" instead of "dirty" energy. We would also like to switch from the centralized approach of solving multiobjective PPA optimization problems to a more safe and computationally less demanding distributed/decentralized domain.