1. Introduction
Electricity generated from large-scale photovoltaic (PV) plants currently represents a significant part of the total generation in many countries. The proliferation of PV plants has been particularly prominent in regions with high solar irradiance, such as eastern Turkey [
1] and northern Chile [
2]; however, technological advances such as solar trackers for PV panels can improve the performance of PV systems and help on expanding PV generation to regions with less favorable irradiance conditions [
3]. From an economic perspective, PV plants have become attractive not only in energy markets with feed-in tariffs such as Iran [
4], but also in deregulated energy markets such as Spain [
5,
6].
In the deregulated Spanish market, electricity is traded in regular settlement periods, during which participating energy producers commit to delivering a certain amount of energy for future periods in hour blocks. The energy commitment price for each block is settled as
pay-as-cleared before the actual time of delivery. At the time of delivery, i.e., in real-time, the power produced by a given generator may deviate from the plan considered at the moment of commitment due to unforeseen contingencies or variations with respect to the forecast of energy production considered during the settlement period. Producers failing to deliver the committed energy may generate a net imbalance in the system. System regulators must cover this imbalance by buying energy available from other generators participating in the market [
7]. Energy bought to cover an imbalance is paid at an imbalance price, which is higher than the settled price agreed to in advance for the same block, and it is charged to the market participants that are generating the imbalance via a penalty. Therefore, system imbalances are economically detrimental for producers unable to fulfill their commitment and beneficial for producers with surplus energy available for selling at the time of the imbalance [
8].
The variable nature of solar irradiation during a day prevents PV plants from providing a constant power supply [
9]. Therefore, it is difficult to guarantee a constant energy delivery for a block of several hours without the risk of breaching this commitment. A typical solution for this issue is integrating battery energy storage systems (BESS), which enable energy accumulation during periods in which real-time production is higher than the commitment. The battery storage, can be of different technologies and be integrated into the PV system either in DC or AC side, with AC coupling being easier to use in retrofit projects and providing higher flexibility during operation [
10]. On the other hand, lithium-ion batteries are considered more suitable for market-oriented applications [
11,
12]. Other applications include the suppression of power fluctuations according to the grid codes’ requirements [
13], frequency regulation [
14] or integration of different renewable energy sources [
15,
16].
The energy accumulated in the batteries can be, in turn, delivered to the system during periods in which the real-time energy production from the PV panels is lower than the committed energy. Moreover, producers can sell energy stored in the battery at a higher imbalance price. Considering that the price of committed energy, imbalance price, and the penalties vary for each settlement period, the energy stored in the batteries will have a dynamic relative value, and then the profits obtained by PV energy producers will depend on the adequate choice of intervals to charge or discharge the batteries. Therefore, to maximize the economic benefits obtained from PV plants, producers must implement optimized control strategies to manage the state of charge (SoC) in real-time, considering forecasts of both PV production and energy prices in the corresponding electricity market [
14,
17].
Multiple authors have tackled the problem of maximizing profits from photovoltaic power plant with battery energy storage system (PV+BESS) in deregulated electricity markets using Model Predictive Control (MPC) [
6,
16,
18]. MPC strategies use prediction models of the system and operational variables to decide the times to charge or discharge the batteries considering estimations of future energy generation and market prices. To this end, MPC schemes must optimize a cost function subject to operational constraints at each sampling interval [
19,
20]. In our target application, battery efficiency and sometimes market prices are modeled as piece-wise functions, which naturally lead to a Mixed-Integer Linear Programming (MILP) formulation for the optimization problem.
In [
6], the authors formulate an optimization problem to maximize profits from a PV+BESS plant in the Spanish market. In this case, the cost function depends on the imbalance price and penalty, which have a piece-wise representation that leads to an MILP formulation. Authors argue that solving an MILP problem in each control interval is computationally prohibitive for real-time operation, and thus they apply ad hoc heuristics to derive an equivalent LP formulation, showing the effectiveness of the control approach using simulations that consider a sampling time of four minutes. Although effective for incrementing profits, authors only consider a simplified model for the battery that omits the piece-wise function that represents the charging and discharging efficiency, which we argue is a relevant aspect for accurate decision-making to maximize profits from energy sales. The work in [
18] proposes an MPC scheme for a PV+BESS system operating in the PJM Energy Market (
www.pjm.com, accessed on 30 August 2022) with a price scheme that results in a linear objective function. This work does consider the BESS efficiency in the optimization model; however, the authors propose a configuration that uses two storage devices with independent charging signals generated through power spectral density (PSD) decomposition, which allows for simultaneous charging and discharging of the different storage devices. Hence, the proposed configuration avoids needing a binary variable and MILP formulation. The resulting optimization problem is solved in two steps, using a standard LP solver, considering the operational constraints, to generate references that are followed using MPC with a quadratic cost function and a standard Quadratic Programming (QP) solver. From the optimization perspective, the problem is simpler as no binary variables arise, but it requires a complex and unconventional BEES with multiple storage devices. In [
16], the authors derive an MILP formulation to manage the BESS in a hybrid plant containing both photovoltaic and wind power generators. This work optimizes profits using a model that integrates the income from energy sales and the cost associated with under or oversupply, battery efficiency, and forecasting models for energy generation. This case considers fixed ratio between positive and negative imbalance costs; moreover, the complexity of the plant and the aggregation of forecasts in the optimization problem do not allow quantifying the benefit associated with modeling the battery’s efficiency.
In a related application, multiple works have used MILP solvers to optimize microgrids’ design, operational costs, and energy consumption; however, these problems consider simpler tariff schemes than our target scenario. The work in [
21] proposes an MPC strategy that uses MILP to optimize the operational efficiency of a microgrid comprising PV panels, wind turbines, a diesel generator, and BESS. Results using data from an experimental plant in Greece show that the control strategy optimizes the use of diesel generators to reduce operational costs. The work in [
22] tackles a similar problem, but using a more sophisticated optimization approach that considers MILP and particle swarm optimization. In [
23,
24], the objective is to design a control algorithm to satisfy the electrical demand and maximize self-consumption. In [
25], the focus is on optimal asset (i.e., PV panels and BESS) planning to minimize the total associated energy-consumption cost for prosumers along the project’s horizon.
This paper presents a novel MPC scheme with an MILP formulation to maximize revenues from a PV+BESS generation plant participating in a deregulated electricity market. The proposed approach enables integrating piece-wise functions in the cost functional and restrictions of the optimization problem, facilitating the direct incorporation of a rate-based variable efficiency model of the battery efficiency and tariff schemes represented with integer variables. Using simulations that consider the Spanish market rules described in [
6] as a case study, we show that the proposed MILP formulation that accounts for the efficiency of the BESS allows the MPC scheme to make better decisions about the time intervals to charge or discharge the batteries. In the simulated scenario, the proposed method increments the revenues by 21% with respect to the formulation in [
6] that assumes ideal batteries. Evaluations of the execution time for the proposed MILP-based MPC scheme using the CPLEX solver report a worst-case execution time of around 45 milliseconds for a control loop, which is orders of magnitude below the typical required periods in the target application [
6,
18].
The results provide evidence of the effectiveness of MILP-based MPC schemes in optimizing the real-time operation of PV plants participating in electricity markets without requiring ad hoc simplifications [
6] or unconventional BESS infrastructure [
18]. Moreover, the reported execution times indicate that the approach can scale to incorporate more integer variables to accommodate more complex objective functions and different market rules.
The rest of the paper is organized as follows:
Section 2 presents the MPC strategy for a PV+BESS plant operating in the Spanish market and its solution using an LP formulation with an ideal battery as described in [
6];
Section 3 presents the proposed MILP formulation for the same problem that allows incorporating the rate-based efficiency of the battery in the functional cost;
Section 4 compares the projected economic benefits obtained with the existing and the proposed approach using a reference scenario; finally,
Section 5 and
Section 6 discuss the main results and conclude the paper.
2. Materials and Methods
This section provides an overview of the main concepts related to MPC and its use in the optimization of economic gains from PV+BESS plants participating in electricity markets. In specific, the following paragraphs formalize the problem of maximizing revenues from PV+BESS plants following the assumptions presented in [
6], which uses the regulations of the Spanish electricity market as a case study. The main theoretical contribution of [
6] that allows presenting the associated optimization problem as an LP problem is described in detail. This formulation provides the baseline for validating and comparing the advantages of using the novel approach proposed in this paper.
2.1. Overview of Model Predictive Control
MPC is an advanced control strategy that, using a model of the target system and the (measured or estimated) value of the system’s states at a given sampling time t, is able to determine the optimal value of the control inputs to make the system’s output follow a reference along a number of N future samples while respecting operational constraints in the states and outputs.
The basic operation of MPC for a linear system can be summarized as follows, see, e.g., [
19,
20]:
At each sampling time t, the current output is determined, and a dynamic model of the target system is used to forecast the future outputs along a prediction horizon of N sampling intervals.
The forecast of system behavior at current interval t is used to calculate the optimal control signals that optimize a cost function for the entire prediction horizon. The cost function also imposes constraints on system states and outputs.
An optimization algorithm is used to determine the sequence of control input signals that optimize the cost function for the prediction horizon; however, only the first element of the optimal control sequence is applied to the process. This approach is called Receding horizon.
At the next sampling interval , a new forecast is calculated, and the process is repeated.
The cost function to be optimized at each iteration of the MPC algorithm is specific for each problem and must consider the model of the controlled system and constraints.
2.2. Problem Specification
Plants participating in deregulated electricity markets must regularly commit a constant-by-hours power production some hours before the real-time delivery instant. The commitment is performed when the actual PV production is still unknown and can only be approximated with a certain degree of accuracy. In this context, when the delivery time arrives, it might happen that it is not possible to deliver the committed power if the actual PV generation is insufficient since low solar irradiation or the BESS are completely discharged. Therefore, it is convenient to have adequate decisions to manage the energy in the BESS to supply the committed power.
The objective of our application is to define a control strategy to manage the generation of a grid-tied PV power plant that takes part in the electricity market. Using short-term predictions for a horizon of N time intervals starting from current time t, we expect the control algorithm will indicate the actions of injecting energy from the battery to the grid, storing energy in the BESS, or leaving the battery idle, considering the optimization of economic return.
The problem of interest is represented in the diagram of
Figure 1. Here, and in the rest of this document, the subscripts
, with
, will symbolize a set of values for a given variable that expands
samples starting from the current time interval
t. In the diagram,
is the total power delivered to the grid, corresponding to the sum of the power generated from the PV plant (
) and the power from the battery system (
). In the system, a positive value of
indicates a power flows from the BESS into the connection node and, therefore, into the grid. Conversely, a negative value of
indicates a power flow into the BESS. The value and direction of
depend on the decision to either store energy or inject power into the grid (
) reached by the MPC algorithm. For simplicity, we consider
.
The MPC block uses the information of the commitment of constant hourly power to be injected into the grid
, the prediction of the energy production from the PV plant
, the amount of energy stored in the battery
, and energy prices. The variable
and the prices are known in advance and
can be measured. The prediction
can be obtained from statistical information about the behavior of the solar radiation and PV system performance. Particularly, in Europa and Asia, a proper tool is the PhotoVoltaic Geographic Information System (PVGIS) [
26]. The energy prices incorporate information about the market structure and the scheduling of settlement periods, which depend on the specific regulations for the given target market.
In the case of the Spanish electricity market, there is a daily market (one day ahead) where an amount of delivered power committed paid at a market price is agreed upon, which can be adjusted in an intraday market divided into six sessions of three, four, and five hours to consider variations in the demand forecast and supply contingencies. On the one hand, the intraday market defines the commitment of and for the following session. On the other hand, imbalances due to excess or shortage of generation are assigned two different prices around that are fixed by the system operator and apply to the difference between the scheduled and actually generated energy. When there is a deviation in the sense of an excess of injected power, the price assigned to this imbalance is , with . On the other hand, when there is a negative difference between the injected power and the committed power, i.e., the producer fails to fulfill his contract, a penalty price is applied, with . To adjust the imbalances, the system operator purchases from generators capable of supplying the missing energy, and the penalty price is imposed on the producer who generated the imbalance to cover this cost. The programming of the production market and the price of energy can be obtained in real-time through information provided by the system operator.
As is shown in the zooming part of
Figure 1, for every time instant
t, the block MPC uses the energy prices, the commitment power, and the prediction of the PV production along the entire prediction horizon, i.e.,
,
,
, and
. Combining this information with the amount of energy stored in the battery and a set of constraints over the decision variables, the MPC strategy obtains an optimal control vector by solving a constrained optimization problem. Then, only the first element
of this vector is applied to the system.
2.3. Mathematical Formulation for the Cost Function for the MPC Scheme
To maximize the economic revenue from PV generation, the cost function should account for the following situations:
If the PV plant generates more than the committed energy, then the excess energy can be either delivered to the grid or stored in the BESS for future delivery. The energy stored in the BESS can be delivered to the grid in excess during periods when the energy prices are higher or used to attenuate economic penalties when the PV production is lower than the committed.
If the PV is anticipated to generate less than the committed energy during some time intervals, then the control algorithm should use the energy stored in the BESS to cover the deficit or shift the failure to moments when the economic penalties are lower.
The decision to charge the battery with energy from the PV plant, inject energy from the battery to the grid, or leave the battery idle is taken at every time interval targeting maximization of the economic revenue considering the forecast of energy prices, expected energy production, and state of charge of the battery along the prediction horizon.
Considering the behavior above, authors in [
6] specify the following cost function:
where
is the imbalance settlement price that at any given instant adopts a different value depending on the imbalance sign (see Equation (2));
T is the sampling period of the system in which the MPC’s control signal should be available;
is a weighting parameter,
represents the energy remaining in the BESS after the prediction horizon and
is the price assigned to it. The first term of
sums the expected economic revenues obtained from power delivered to the grid for each interval in the prediction horizon, giving more relevance to the projected economic benefits obtained from time intervals further away from the current time. The second term in the cost function that gives an economic value to the remaining energy stored in the BESS after the prediction horizon. If the parameter
is close to
, then the control action will favor the accumulation of energy for future sale; conversely, if the value is closer to
, then the control action will favor the delivery of energy from the BESS to the grid in the current time interval.
The restriction in Equation (3) indicates that the power delivered to the grid corresponds to the sum of the estimated power of photovoltaic panels and the power exchanged with the BESS. Equation (4) models the energy stored in the BESS on the whole prediction horizon. Equation (5) indicates that the power taken from the panels or delivered to the grid from the BESS is limited by the rated power capacity of the converter, and Equation (6) restricts the state of charge of the battery bank to avoid its accelerated degradation or damage. The selection of the sampling time (
T) varies depending on the application of interest. The main factors that intervene in the appropriate selection of
T depend on the size of the problem and the time constraints. In previous works that apply MPC strategies for controlling similar power generation systems, authors have proposed values of
min [
21,
23] and
min [
6] to satisfy the control objectives.
The piece-wise expression for the cost in Equation (2) precludes using standard Linear Programming or Quadratic Programming solvers to find the solution. The authors in [
6] identify this as a big limitation to achieving the required solving time of 4 min. Then they propose ad hoc simplifications to represent the cost function in an LP form that can be efficiently solved with standard solvers. Notice that the piece-wise constraints in Equation (2) are common in many applications such as [
27,
28], where there are variables that can take different values depending on whether a condition is met.
2.4. Representation as an LP Problem
In [
6], the authors introduce two different variables to represent the power delivered to the grid depending on its value compared to the committed power:
Using the change of variables and considering the recursive computation of Equation (4), it is possible to rewrite the optimization problem in the following equivalent form [
6]:
Although the non-linear constraint in Equation (15) still precludes us from directly using traditional LP solvers, the authors in [
6] argue that this product constraint is redundant when the other constraints are satisfied and
for all time intervals within the prediction horizon, which is a natural condition in the target scenario. Therefore, it is possible to just omit this constraint, and the resulting optimization problem involves only linear cost function and linear constraints, i.e., an LP problem that can be efficiently solved using traditional tools.
Nevertheless, this solution involves an ad hoc transformation and is not directly applicable for a related problem that includes some other non-linearities such rate-based variable battery efficiency. Additionally, the work in [
6] does not show the development with sufficient detail to directly reproduce the reported results. For completeness and, in order to compare our proposal with [
6], we provide details in
Appendix B to solve the optimization problem in Equation (8). It is noted that this problem cannot be solved directly with an available linear optimization solver, so it is necessary to rewrite it in the standard form of linear programming problems as follows:
where
summarizes the imbalance costs and the stored energy price over the prediction horizon. The vector
contains the decision variables
and
with
. The vector
and the matrix
define the constraints in Equations (9)–(14). The definitions of
,
,
, and
are given in
Appendix B. As can be seen, the problem posed by Equations (16) and (17) has the form of an LP optimization problem, where the upper and lower bound constraints of the decision variables have been rewritten as inequality constraints.
2.5. Implementation of the MPC Schemes and Measurement of Execution Time
To implement and compare the reference LP formulation for the optimization problem described previously and the new MILP formulation introduced in the next section, we use Matlab-Simulink to simulate the system described in
Figure 1, including the CPLEX optimization toolbox [
29] to solve the optimization problem for each MPC iteration. To estimate the execution time, we use the
tic-toc functionality in Matlab to measure the elapsed time between two points of interest in the code. We measure the required time of the solver to get the optimal input vector for 165 MPC iterations. The worst-case value of the elapsed time is reported to show that our proposal is competitive to solve each MPC optimization problem in the required time. All tests were executed on a desktop computer with an Intel Core i7-8700 CPU @ 3.20 GHz processor, 16 GB of RAM, running Windows 11 and MATLAB 2019b.
4. Results
The response of the MPC-LP, as described in
Section 2.4, and the proposed MPC-MILP control algorithms, when applied to a system model with non-ideal charge and discharge efficiency, are shown. The initial conditions are the same as in the previous section.
Figure 4 shows the comparison of the results obtained using the MPC-LP and MPC-MILP control algorithms. As can be seen, the system’s dynamic performance with the MPC-MILP control algorithm and a BESS model with a rate-based variable efficiency is notably better.
Figure 4a shows how the performance of the MPC-MILP algorithm does not completely discharge the battery, unlike MPC-LP. Although both algorithms satisfy the output power needed to avoid a penalty, i.e.,
, the power transients are less aggressive using the strategy MPC-MILP, as shown in
Figure 4b. This is a direct consequence of making decisions about the charging and discharging cycles in the batteries, as shown in
Figure 4c. It is also noted that reducing charge and discharge cycles contributes to extending the BESS’s health. The improvements obtained in the simulation results are understandable from a physical point of view. When considering a simplified battery model, the algorithm described in
Section 2.4 estimates the charging and discharging processes with less precision because it does not consider the losses associated with the power exchanged with the BESS. This fact translates into a poor decision to store energy in the BESS or sell it to the power grid. While the MPC-LP algorithm acts aggressively, the MPC-MILP algorithm performs better in making decisions to supply power, charge the batteries or disconnect them from the system.
Figure 4d shows how the proposed control algorithm obtains a bigger
over time compared with the MILP-LP, which is the main control objective, i.e., it makes the PV plant’s market participation more profitable. The computation of the cost function
using the optimal control signal of each time instant shows that the increment in the economic revenues obtained using our proposal is close to 21% with respect to the MPC-LP approach.
Furthermore, the execution time of the model that considers the rate-based variable efficiency increases with respect to the highly efficient MPC-LP method proposed in [
6]. However, the solution of the MPC-MILP algorithm in the worst case was found in 55 milliseconds, which is still small enough for
min. Additionally, the measurements for both MPC-LP and MPC-MILP, in the worst case, were about 18 and 46 milliseconds, respectively.
Influence of the Solar Radiation Estimation in the Control Scheme
In this section, a study of the influence of solar estimation on the performance of the control algorithm is carried out. As mentioned above, the database provided by PVGIS is used in this work. However, the estimated data could differ from the actual radiation due to the presence of meteorological phenomena, causing the stochastic behavior of this energy source. Estimated solar radiation data will become more accurate as parameter estimation techniques evolve. It should be considered that an inaccurate
estimation model could lead to penalties in the market under the aforementioned conditions. An experiment is then carried out to assess how much the difference between the estimated
power used in the control algorithm and the actual
power can affect.
Figure 5a shows an example of the difference in solar radiation on a slightly cloudy day.
Under these conditions, the actual
is less than the model used in the algorithm. In this test, the approach described in the
Section 2.4 and the one proposed in
Section 3.3 are compared. The
Figure 5b shows the objective function for both control algorithms. As can be seen, the MPC-MILP approach proposed in this work continues to generate higher economic returns compared to the MPC-LP approach.
5. Discussion
The use of the MPC strategy has increased in recent years for electric power generation due to its advantages. In particular, it allows optimal decision-making considering the physical and operational constraints of the system. The proposal incorporated can implement more realistic models of the storage system, including its efficiency, leading to better performance of the control loop than a previous method found in the literature, translating into higher earnings for the market participant.
This article provides a detailed methodology for the mathematical formulation of the optimization problem using the paradigm of Mixed Integer Linear Programming. Additionally, some measurements of the computational burden of this method are provided, showing that although higher than the alternative method found in [
6], it is sufficiently low for the problem of interest, given the computational capability of modern desktop computers. Future work may consider integrating other energy sources, whether renewable or non-renewable, and applying the control algorithm to plants integrating different generation technologies to minimize energy production costs. Further, the proposed methodology can be adapted to different problems with similar characteristics.
This is very important, as rules in regulated markets are different from country to country and may change with new regulations. For example, the operating procedure through the provisions of P.O.-14.1 in the Spanish market has undergone recent modifications, where now there are four situations in which participating agents can incur in the market. However, we emphasize that the proposed control scheme can be directly applied to the new circumstances because it can adequately consider the value of in the constraints of the optimization problem for each situation.