# Feature-Driven Strategies for Trading
Wind Power and Hydrogen

Emil Helgren, Jalal Kazempour, and Lesia Mitridati
Department of Wind and Energy Systems, Technical University of Denmark, Kgs.
Lyngby, Denmark
<EMAIL_ADDRESS>{jalal<EMAIL_ADDRESS>
###### Abstract

This paper develops a feature-driven model for hybrid power plants, enabling
them to exploit available contextual information such as historical forecasts
of day-ahead prices and wind power, and make optimal wind power and hydrogen
trading decisions in the day-ahead stage. For that, we develop different
variations of feature-driven linear policies. In addition, we propose a real-
time adjustment strategy for hydrogen production. Our numerical results show
that the final profit obtained from our proposed feature-driven trading
mechanism in the day-ahead stage together with the real-time adjustment
strategy is very close to that in an ideal benchmark with perfect information.

###### Index Terms:

Hybrid power plants, trading decisions, feature-driven model, linear policies,
real-time adjustment strategy.

##  I Introduction

Hybrid power plants, comprising an electrolyzer and wind turbines, are
expected to be largely installed in many countries, such as Denmark [1]. The
plant operator, aiming to maximize their profit, can either allocate the
entire generated wind power for hydrogen production, sell the whole or part of
generated wind power to the grid, or buy power from the grid to produce more
hydrogen. The plant operator should make informed decisions for trading power
and hydrogen in a forward stage, when neither day-ahead and balancing prices
nor the true wind power generation are realized. This requires developing a
trading strategy, which is the focus of this paper.

There are many papers in the literature that develop trading strategies for
wind power producers (wind power as the sole product) under price and wind
uncertainty. Among others, [2] solves a newsvendor problem, [3] develops a
two-stage stochastic programming, [4] devises a range of robust optimization
models, and finally [5] develops a distributionally robust model. While all
these methods outperform the deterministic counterpart, they require (i)
knowledge of probabilistic forecasting, (ii) generating a set of scenarios, an
uncertainty set, or a family of probability distributions, and then (iii)
developing a stochastic optimization model for decision making. The trading
problem is even more challenging for hybrid power plants, where hydrogen is
also a product in addition to wind power. Although one may expect large
companies to have great expertise in making trading decisions under
uncertainty, it might be more challenging for a small-scale hybrid power plant
operator. Therefore, the aim of this paper is to develop a pragmatic trading
approach, which outperforms the deterministic model by enabling the hybrid
power plant to learn from historical data, without the need for the plant to
use probabilistic forecasting and complex stochastic solutions.

Aligned with [6], we propose a prescriptive analytics framework for hybrid
power plants, where forecasting and decision-making steps are integrated. In
this data-driven approach, we exploit contextual information, so-called
features, such as historical (deterministic) forecasts of wind power and day-
ahead electricity prices. In the training stage, the hybrid power plant
operator learns feature-driven policies based on historical features and
uncertainty realizations. In the decision-making stage, the learned policies
and available features lead to the trading decisions. A few papers in the
literature, e.g., [7], [8] and [9], develop feature-driven trading models for
renewable power producers. To the best of our knowledge, this is the first
paper that develops such a model for hybrid power plants trading both wind
power and hydrogen, which is a more complicated problem. Besides, this paper
extends these previous works by investigating various model architectures,
including price- and time-dependent policies, and feature vectors. In
addition, we propose a pragmatic rule-based adjustment strategy for real-time
hydrogen production. Using an out-of-sample simulation, we show how the
resulting profit from feature-driven trading in the day-ahead stage and the
adjustment strategy in real time is very close to that in an ideal benchmark
(oracle).

The rest of the paper is organized as follows. Section II explains the
decision-making framework. Section II details the feature-driven trading
strategy model in the day-ahead stage. Section IV presents the proposed real-
time adjustment strategy. Section V provides numerical results. Finally,
Section VI concludes the paper.

##  II Decision-Making Framework

We consider an electrolyzer and a wind turbine, together forming a behind-the-
meter hybrid power plant. The wind power generation can be exported to the
grid or directed to the electrolyzer to produce hydrogen with a constant
efficiency coefficient. The electrolyzer has also the possibility to buy power
directly from the grid. The produced hydrogen is sold through a bilateral
contract at a fixed hydrogen price. As part of the contract, there is a
minimum amount of hydrogen that should be produced in a daily basis. The
hydrogen production thus needs to be scheduled for the whole day in order to
ensure fulfilling this minimum production requirement. Any real-time
adjustment should likewise account for the imposed hydrogen production quota.

The hybrid power plant aims to maximize the total profit from electricity
trading and hydrogen sales. This leads to two stages for decision making:

Day-ahead decision making: Given the available (deterministic) wind power
forecast, the hybrid power plant must decide how much electricity to trade
(buy or sell) in the day-ahead market and how to schedule the operation of the
electrolyzer for each hour of the following day, depending on hourly day-ahead
market prices and the fixed hydrogen price. Recall the minimum daily hydrogen
production requirement needs to be accounted for. In Nord Pool, all these
decisions for every hour $t\in\mathcal{T}$ of day $\rm{D}$ should be made
before noon of day $\rm{D}\\!-\\!1$.

Real-time decision making: The hybrid power plant must settle imbalances
arising from deviations in wind power production (compared to the day-ahead
schedule) in the balancing market. Therefore, at the time of delivery, i.e.,
in every hour $t$ of day $\rm{D}$, the plant must decide how to adjust the
schedule of the electrolyzer based on the realized wind power production and
electricity balancing prices, while ensuring the minimum daily hydrogen
production requirement is fulfilled.

##  III Day-Ahead Bidding

We first define a feature-driven model for making power and hydrogen trading
decisions in the day-ahead stage. Next, we explain feature vectors, and then
elaborate on architecture of linear policies. We eventually provide an
optimization model for training the proposed feature-driven model.

###  III-A Model Definition

The main challenge for the hybrid power plant in the day-ahead, is to account
for the uncertainty on the day-ahead and balancing electricity prices and wind
power production.

Aiming to develop a feature-driven trading strategy in the day-ahead stage, we
first define the vector of available features with $N$ elements corresponding
to hour $t$ as

$\displaystyle\textbf{X}_{t}=\Big{[}X^{1}_{t},...,X^{N}_{t}\Big{]}\ \ \forall
t\in\mathcal{T}.$ (1)

The features should be those contextual information for hour $t$ of the
following day that the plant has access to when making day-ahead decisions. An
example of available features for the hybrid power plant at the day-stage
stage is the deterministic forecast of wind power generation.

Let variable $p^{\rm DA}_{t}$ denote the electricity traded (bought or sold)
in the day-ahead market for hour $t$ of the next day. In addition, variable
$p^{\rm H}_{t}$ is the electricity consumption schedule of the electrolyzer
for the same hour. We exploit linear decision rules [10], so called linear
policies, to define $p^{\rm DA}_{t}$ and $p^{\rm H}_{t}$ as a function of
features $\textbf{X}_{t}$, such that

$\displaystyle p^{\rm DA}_{t}=\textbf{q}^{\rm{DA}}\ \textbf{X}^{\top}_{t}$
$\displaystyle\forall t\in\mathcal{T}$ (2a) $\displaystyle p^{\rm
H}_{t}=\textbf{q}^{\rm{H}}\ \textbf{X}^{\top}_{t}$ $\displaystyle\forall
t\in\mathcal{T},$ (2b)

where $(.)^{\top}$ is the transpose operator. Vectors
$\textbf{q}^{\rm{DA}}\in\mathbb{R}^{N}$ and
$\textbf{q}^{\rm{H}}\in\mathbb{R}^{N}$ are the policies, so called q-policies,
to be learned from historical data in the training stage.

If the model is designed and trained appropriately, $\textbf{q}^{\rm{DA}}$ and
$\textbf{q}^{\rm{H}}$ will reflect relations between the input features and
the decision variables $p^{\rm DA}_{t}$ and $p^{\rm H}_{t}$ that persist into
the future, such that the model will produce well-performing trading decisions
for new feature vectors.

Feature Vectors: The day-ahead market allows for simultaneously placing
multiple independent price-quantity bids $\\{\lambda_{b},p_{b}\\}_{b=1,...,B}$
for each hour of the following day. Therefore, we can model the electricity
traded in the day-ahead market $p^{\rm DA}_{t}$ as a function of the day-ahead
price at hour $t$. This is achieved by introducing an unknown price variable
$\lambda\\!\in\\!\mathbb{R}$ in the feature vector $\textbf{X}_{t}$. Since all
other values in the feature vector are known at the time of decisions, this
results in $p^{\rm DA}_{t}$ being a linear function of this unknown variable
$\lambda$. In practice, the day-ahead price-quantity bids are then derived by
discretizing this linear function and approximating it as a stepwise function
with arbitrary step size, as illustrated in Fig. 1.

Figure 1: The discretization of $p^{\rm DA}_{t}=$
$\textbf{q}^{{\rm{DA}}}\textbf{X}^{\top}_{t}$ to create piece-wise price-
quantity bids $\\{\lambda_{b},p_{b}\\}_{b=1,...,B}$.

Each step $b$ of the resulting stepwise function will represent one pair of
price-quantity bids $\\{\lambda_{b},p_{b}\\}_{b=1,...,B}$. Since the
electricity traded in the day-ahead market and the power consumption $p^{\rm
H}_{t}$ of the electrolyzer are interdependent, $p^{\rm H}_{t}$ is also
expressed as a linear function of the day-ahead electricity price at hour $t$.

All feature vectors investigated in this paper will have the form
$\textbf{X}_{t}=\Big{[}\tilde{\textbf{X}}_{t},\lambda,1\Big{]}$, where the
constant feature $1$ provides an intercept and
$\tilde{\textbf{X}}_{t}\in\mathbb{R}^{N-2}$ is the vector of remaining
features. The remaining features can include any relevant data that are
expected to be related with the uncertain parameters, i.e. the wind production
(e.g., weather forecasts), and the day-ahead and balancing prices (e.g.,
electricity price and demand forecasts and imbalance forecasts). Note that the
plant has usually access to an extensive database, including historical values
of these features and corresponding realized values of the uncertain
parameters.

Architecture of Linear Policies: Several approaches can be used regarding the
architecture of the q-policies. The simplest but restrictive architecture, so-
called general architecture, considers constant policies $\textbf{q}^{\rm
DA}\in\mathbb{R}^{N}$ and $\textbf{q}^{\rm H}\in\mathbb{R}^{N}$ for every hour
$t$.

It is widely acknowledged that daily patterns exist in the day-ahead prices.
Accounting for these patterns could remarkably increase the performance of the
model. This can be achieved by introducing an hourly architecture, where the
q-policies in (2) are specific to the hour of the day and denoted as
$\textbf{q}^{\rm DA}_{h_{t}}\in\mathbb{R}^{N}$ and $\textbf{q}^{\rm
H}_{h_{t}}\in\mathbb{R}^{N}$ for $h_{t}=t\mod 24$, with $\mod$ representing
the modulo operator. This hourly architecture allows the model to learn daily
patterns. However, it results in $24$ times as many q-policies to train as in
the general architecture, and thus requires a larger training dataset. The
trade-off between these factors will be empirically studied later in our case
study.

Besides, in order to capture more complex and non-linear dependencies between
the features $\textbf{X}_{t}$ and decision variables $p^{\rm DA}_{t}$ and
$p^{\rm H}_{t}$, multiple sets of model parameters can be introduced, each
covering one domain of the features. In particular, we introduce $M$ price
domains $\mathcal{D}\\!=\\!\\{\mathcal{D}_{1},...,\mathcal{D}_{M}\\}$, each
defined as a range of prices
$\mathcal{D}_{i}=\big{[}\lambda_{i-1},\lambda_{i}\big{]}$ with
$\lambda_{i-1}<\lambda_{i}$ for all $i\in\\{1,...,M\\}$. Over each price
domain, we define q-policies as $\textbf{q}^{\rm DA}_{i}$ and $\textbf{q}^{\rm
H}_{i}$. As a result, the decision variables $p^{\rm DA}_{t}$ and $p^{\rm
H}_{t}$ are expressed as piece-wise linear functions of the day-ahead prices,
such that

$\displaystyle p^{\rm DA}_{t}=\textbf{q}^{\rm DA}_{i}\ \textbf{X}^{\top}_{t}$
$\displaystyle\text{ if }\lambda\in\mathcal{D}_{i},\hskip 28.45274pt$
$\displaystyle\forall t\in\mathcal{T}$ (3a) $\displaystyle p^{\rm
H}_{t}=\textbf{q}^{\rm H}_{i}\ \textbf{X}^{\top}_{t}$ $\displaystyle\text{ if
}\lambda\in\mathcal{D}_{i},\hskip 28.45274pt$ $\displaystyle\forall
t\in\mathcal{T}.$ (3b)

Note that a trade-off between complexity and flexibility can be achieved, if
optimal domains can be chosen based on statistical characteristics of the
data. For example, a natural threshold where it might be beneficial to divide
the model into different trading strategies is when the day-ahead electricity
price is equal to the hydrogen price $\lambda^{\rm H}$.

###  III-B Optimization Model for Training Stage

In the training stage we determine the adequate values of the q-policies using
a batch learning mechanism. The training of the q-policies can be represented
as an optimization problem, in which the profit of the plant is maximized over
a historical dataset, containing values of the feature vectors along with
corresponding realizations of the uncertain parameters for all
$t\in\mathcal{T}^{\rm hist}$. This optimization problem, formulated as a
mixed-integer linear program (MILP), reads as

$\displaystyle\max_{\Omega}$ $\displaystyle\sum_{t\in\mathcal{T}^{\rm
hist}}\Big{[}\lambda^{\rm
DA}_{t}\textbf{q}^{\rm{DA}}\textbf{X}^{\top}_{t}+\lambda^{\rm H}\rho^{\rm
H}\textbf{q}^{\rm{H}}\textbf{X}^{\top}_{t}$ $\displaystyle+\lambda^{\rm
UP}_{t}o_{t}-\lambda^{\rm DW}_{t}u_{t}\Big{]}$ (4a) s.t. $\displaystyle
o_{t}-u_{t}=P^{\rm
W}_{t}-\textbf{q}^{\rm{DA}}\textbf{X}^{\top}_{t}-\textbf{q}^{\rm{H}}\textbf{X}^{\top}_{t}$
$\displaystyle\hskip 7.11317pt\forall t\in\mathcal{T}^{\rm hist}$ (4b)
$\displaystyle 0\leq o_{t}\leq M(1-b_{t})$ $\displaystyle\hskip
7.11317pt\forall t\in\mathcal{T}^{\rm hist}$ (4c) $\displaystyle 0\leq
u_{t}\leq Mb_{t}$ $\displaystyle\hskip 7.11317pt\forall t\in\mathcal{T}^{\rm
hist}$ (4d) $\displaystyle
0\leq\textbf{q}^{\rm{H}}\textbf{X}^{\top}_{t}\leq\overline{P}^{\rm H}$
$\displaystyle\hskip 7.11317pt\forall t\in\mathcal{T}^{\rm hist}$ (4e)
$\displaystyle-\overline{P}^{\rm
H}\leq\textbf{q}^{\rm{DA}}\textbf{X}^{\top}_{t}\leq\overline{P}^{\rm W}$
$\displaystyle\hskip 7.11317pt\forall t\in\mathcal{T}^{\rm hist}$ (4f)
$\displaystyle\sum_{t=24(d-1)+1}^{24d}\rho^{\rm
H}\textbf{q}^{\rm{H}}\textbf{X}^{\top}_{t}\geq\underline{H}$
$\displaystyle\hskip 7.11317pt\forall d\in D^{\rm hist},$ (4g)

where the set of variables $\Omega\\!=\\!\\{\textbf{q}^{\rm DA}$,
$\textbf{q}^{\rm H}$, $o_{t}$, $u_{t}$, $b_{t}\\}\
\forall{t}\in\mathcal{T}^{\rm hist}$ includes the q-policies $\textbf{q}^{\rm
DA}$ and $\textbf{q}^{\rm H}$, as well as the real-time decisions, including
the over-production $o_{t}$ and under-production $u_{t}$ settled in real time,
and the auxiliary binary variable $b_{t}\\!\in\\!\\{0,1\\}$ indicating the
state of over- or under-production. Note that the q-policies in (4) can take
index $h_{t}$ and/or index $i$ as discussed in Section III-A

The objective function (4a) maximizes the total profit of the hybrid power
plant over the historical dataset, including four terms. The first term
$\lambda^{\rm DA}_{t}\textbf{q}^{\rm{DA}}\textbf{X}^{\top}_{t}$ corresponds to
the revenue/cost from electricity trading in the day-ahead market, where
$\lambda_{t}^{\rm DA}\\!\in\\!\mathbb{R}$ is the historical day-ahead price.
Note that $\textbf{q}^{\rm{DA}}\textbf{X}^{\top}_{t}$, reflecting the power
quantity, could be positive or negative, indicating whether the plant sells or
buys power. The second term $\lambda^{\rm H}\rho^{\rm
H}\textbf{q}^{\rm{H}}\textbf{X}^{\top}_{t}$ is the revenue from hydrogen
sales, where $\lambda^{\rm H}\\!\in\\!\mathbb{R}_{+}$, in €/Kg, is the fixed
hydrogen price. In addition, $\rho^{\rm H}\\!\in\\!\mathbb{R}_{+}$, in Kg/MWh,
is the constant power-to-hydrogen efficiency of the electrolyzer, whereas
$\textbf{q}^{\rm{H}}\textbf{X}^{\top}_{t}$ reflects the power consumed by the
electrolyzer. Finally, the third and fourth terms in (4a) refer to the
settlement of over- and under-production, respectively, in the balancing
market. Note that $\lambda_{t}^{\rm UP}\\!\in\\!\mathbb{R}$ is the upward
regulation price, which is lower than or equal to the day-ahead price
$\lambda_{t}^{\rm DA}$, reflecting a lost opportunity cost for over-
production. In addition, $\lambda_{t}^{\rm DW}\\!\in\\!\mathbb{R}$ is the
downward regulation price, which is higher than or equal to the day-ahead
price $\lambda_{t}^{\rm DA}$, reflecting a penalty cost for under-production.

Constraint (4b) defines the power imbalance $o_{t}\\!-\\!u_{t}$ to be settled
in real time as the difference between the realized wind power generation
$P^{\rm W}_{t}$ and the power scheduled in the day-ahead stage. The set of
disjunctive constraints (4c)-(4d), with $M$ a large enough positive constant,
enforces over- and under-production to not happen simultaneously at each hour
$t$. If $b_{t}=1$, then (4c) enforces the over-production $o_{t}$ to be zero.
On the other hand, if $b_{t}=0$, then (4d) sets the under-production $u_{t}$
to zero. Constraint (4e) enforces the power consumption of the electrolyzer to
lie within zero and its capacity $\overline{P}^{\rm H}$. Note that the lower
bound being set to zero means that the electrolyzer cannot operate as a fuel
cell, converting the hydrogen back to electricity. In order to avoid
settlement costs, the power traded in the day-ahead market is restricted by
(4f) to lie within the minus consumption capacity of the electrolyzer and the
nominal capacity of the wind turbine $\overline{P}^{\rm W}$. Finally, the
minimum daily hydrogen production requirement $\underline{H}$ is enforced by
(4g) for each day $d\in D^{\rm hist}$ in the historical dataset. Note that, in
this training problem, the realized electricity traded in the day-ahead market
and the electricity consumption of the electrolyzer are evaluated directly by
applying the linear policies in (2) to the values of the realized day-ahead
prices.

###  III-C Decision-Making Stage and Retraining

For each day of the testing period, the trained q-policies are applied to a
new feature vector $\tilde{\textbf{X}}_{t}$ for each hour $t$ of the following
day, to compute the linear functions representing the electricity traded in
the day-ahead market and consumed by the electrolyzer as functions of the
future day-ahead prices. These functions are then discretized, and stepwise
price-quantity bids are placed in the day-ahead market. The realized day-ahead
price will then determine the electricity traded in the day-ahead market and
consumed by the electrolyzer.

Once the uncertain parameters, i.e., day-ahead prices, balancing prices, and
wind power production, are realized, the new feature vector and the associated
realizations are added to the historical dataset. Retraining the model
considering more recent historical data points is thus performed at regular
intervals. One can use a sliding window approach in order to keep the length
of the training dataset constant, as illustrated in Fig. 2. Note that, at each
retraining interval, the blue part of the window represents the previous
testing data points recently added to the training dataset. The length of this
window is a hyperparameter of the model that should be selected appropriately,
as further discussed in our numerical analysis.

Figure 2: Illustration of sliding window approach to determine training data
in each retraining interval.

##  IV Real-Time Adjustments

We assume the electrolyzer is subject to negligible ramping constraints.
Therefore, the hybrid power plant is able to adjust the hydrogen production
schedule in real time based on the realized wind power production and
balancing prices. This section introduces a rule-based adjustment algorithm
for the real-time operation of the electrolyzer that accounts for the minimum
daily hydrogen production requirement.

###  IV-A Decision Rule for a Single Hour

In each hour, the decision rule is dependent on whether the balancing prices
are higher or lower than the hydrogen price. Hereafter, to make electricity
and hydrogen prices comparable in terms of €/MWh, we refer to $\rho^{\rm
H}\lambda^{\rm H}$ as the hydrogen price. The balancing price is not known
until after the balancing settlements, however it is assumed that it can be
approximated to a sufficient degree for the current hour by predicting the
system status [11] and observing the intraday market.

We assume that the balancing market follows a dual-pricing mechanism, implying
that $\lambda^{\rm UP}_{t}\leq\lambda^{\rm DA}_{t}\leq\lambda^{\rm DW}_{t}$
for each hour $t\in\mathcal{T}$. The following three situations can thus occur
regarding the relation between the hydrogen price and balancing prices: (i)
$\rho^{\rm H}\lambda^{\rm H}\leq\lambda^{\rm UP}_{t}\leq\lambda^{\rm DW}_{t}$;
(ii) $\lambda^{\rm UP}_{t}\leq\lambda^{\rm DW}_{t}\leq\rho^{\rm H}\lambda^{\rm
H}$; and (iii) $\lambda^{\rm UP}_{t}\leq\rho^{\rm H}\lambda^{\rm
H}\leq\lambda^{\rm DW}_{t}$. In the first situation where both up and down
balancing prices are higher than the hydrogen price, producing hydrogen would
result in less revenue than what is compensated for over-production in the
balancing market. This means that the producer would benefit from adjusting
the electrolyzer’s consumption down and exporting as much electricity to the
grid as possible. In the second situation where both balancing prices are
lower than the hydrogen price, producing hydrogen results in higher revenue
than the cost incurred from under-production in the balancing market. This
means that the hybrid power plant would benefit from adjusting the
electrolyzer’s consumption up and importing as much electricity from the grid
as possible. In the final situation, over-production results in lower revenues
than hydrogen production, and under-production results in higher costs than
revenues from hydrogen production. In this situation, the electrolyzer should
be adjusted in order to minimize any deviation from the day-ahead market bid.
This decision rule that maximizes the profit for a single hour can be
formulated as a piece-wise linear function $\Pi(.)$ that returns the adjusted
electricity consumption level of the electrolyzer, such that

$\displaystyle\Pi\big{(}\delta_{t},\lambda^{\rm H},\lambda^{\rm
UP}_{t},\lambda^{\rm DW}_{t}\big{)}=\begin{cases}0&\text{ if }\lambda^{\rm
UP}_{t}>\rho^{\rm H}\lambda^{\rm H}\\\ \overline{P}^{\rm H}&\text{ if
}\lambda^{\rm DW}_{t}<\rho^{\rm H}\lambda^{\rm H}\\\ \alpha^{\rm
H}[\delta_{t}]&\text{ otherwise,}\end{cases}$ (5)

where $\delta_{t}\\!=\\!P^{\rm W}_{t}\\!-\\!p^{\rm DA}_{t}$ is the
surplus/deficit of wind power production compared to the day-ahead market bid,
and $\alpha^{\rm H}[\cdot]$ ensures that the electrolyzer production is
feasible:

$\alpha^{\rm H}\big{[}\delta_{t}\big{]}=\begin{cases}0&\text{ if
}\delta_{t}<0\\\ \overline{P}^{\rm H}&\text{ if }\delta_{t}>\overline{P}^{\rm
H}\\\ \delta_{t}&\text{ otherwise.}\end{cases}$ (6)

Adjusting the electricity consumption of the electrolyzer according to the
decision rule (5) will maximize the generated revenues for a single hour, when
the estimated balancing price is the only source of uncertainty.

###  IV-B Real-time Adjustment Algorithm

Implementing the hourly decision rule (5) independently for each single hour
of the optimization period would not guarantee that the minimum daily hydrogen
production requirement $\underline{H}$ is satisfied. Instead, we introduce an
algorithm which only adjusts the electrolyzer’s schedule according to the
hourly decision rule in a given hour $t$ if this requirement can still be met
during the day. Therefore, the electrolyzer’s consumption can always be
adjusted upward from the day-ahead schedule at any given hour. However, in
order to perform a downward adjustment in a given hour $t$ of the day $d$, the
adjusted hydrogen production in this hour $\rho^{\rm H}p^{\rm adj}_{t}$, plus
the cumulative realized production in previous hours $\rho^{\rm H}p_{t}^{\rm
real}=\sum_{i=24(d-1)+1}^{t-1}\rho^{\rm H}p^{\rm adj}_{i}$, plus the
cumulative production schedule for the remaining hours of the day
$\sum_{i=t+1}^{24d}\rho^{\rm H}p^{\rm H}_{i}$ must be higher than the minimum
daily hydrogen production requirement $\underline{H}$. For example, let us
consider a hybrid power plant with a certain minimum daily hydrogen production
requirement, equivalent to the consumption of $15$ MWh. If the realized
cumulative hydrogen production at hour $15$ is equal to $10$ MWh and the
cumulative planned hydrogen production from hour $15$ to $23$ is equal to $7$
MWh, then the electrolyzer has a scheduled hydrogen surplus of $2$ MWh, which
can be adjusted down at hour $15$. If the hourly decision rule (5) outputs a
lower set-point for the electrolyzer than its schedule for this hour, the
electrolyzer can then be turned down as much as the surplus allows. On the
contrary, if the realized cumulative hydrogen production is only equal to $8$
MWh, then the electrolyzer has no scheduled hydrogen surplus and cannot be
adjusted down in this hour, regardless of the outputs of the hourly decision
rule (5). The complete adjustment algorithm is provided in Algorithm 1.

Algorithm 1 Real-time upward and downward adjustment

1:for each day $d$ do

2: Initialize $p^{\rm real}_{24(d-1)+1}=0$

3: for each hour $t\in[24(d-1)+1,24d]$ do

4: Receive model output: $p^{\rm DA}_{t}$, $\textbf{p}^{\rm H}$

5: Receive balancing price forecasts: $\lambda^{\rm UP}_{t}$, $\lambda^{\rm
DW}_{t}$

6: Realize production: $P^{\rm W}_{t}$

7: Compute real-time deviation $\delta_{t}=P^{\rm W}_{t}-p^{\rm DA}_{t}$

8: Compute $p^{\rm H*}_{t}=\Pi\big{(}\delta_{t},\lambda^{\rm
UP}_{t},\lambda^{\rm DW}_{t}\big{)}$

9: if $p^{\rm H*}_{t}>p^{\rm H}_{t}$ then

10: $p^{\rm adj}_{t}=p^{\rm H*}_{t}$

11: else

12: $p^{\rm adj}_{t}=\text{max}\left(p^{\rm
H*}_{t},\dfrac{\underline{H}}{\rho^{\rm H}}-\left(p^{\rm
real}_{t}+\sum\limits_{i=t+1}^{24d}p^{\rm H}_{i}\right)\right)$

13: end if

14: Receive revenue from allocations $\big{(}p^{\rm DA}_{t},p^{\rm
adj}_{t}\big{)}$

15: $p^{\rm real}_{t+1}=p^{\rm real}_{t}+p^{\rm adj}_{t}$

16: end for

17:end for

##  V Numerical Analysis

This section introduces a numerical analysis of the proposed feature-driven
day-ahead trading strategy and rule-based real-time adjustment. All source
codes are available in [12].

###  V-A Case Study Data

We use historical data for the year $2019$ for training, and the year $2020$
for testing, ensuring that the models are evaluated through all seasonal
variations. All price data is publicly available on ENTSO-e [13], along with
production data for specific wind farms, and aggregated forecasts of
offshore/onshore wind production in the Danish bidding zones DK1 and DK2. The
production from the wind farm in Roedsand, Denmark is used to model the
realized wind production of the hybrid power plant.

Realistic forecasts of day-ahead price and wind power production have been
provided by Siemens Gamesa Renewable Energy for five consecutive months. Two
years of synthetic forecasts are created for both price and wind production,
by fitting the statistical characteristics of the forecast error of Siemens
Gamesa forecasts to a theoretical distribution, and then sampling from this
distribution to generate new forecast errors with the same characteristics.
Fig. 3 provides a histogram of both original and generated forecast errors for
both day-ahead market price and wind production forecasts.

Figure 3: Distribution of day-ahead market price (right) and wind power
generation (left) forecast errors.

Forecasts are produced by sampling forecast error values from the fitted
distributions, and then adding these errors to the realized production data to
create a forecast. The entire training and testing datasets thus consist of
realized day-ahead prices, upward and downward balancing prices, and
production for the wind farm in Roedsand, and forecasts for day-ahead prices
and wind production, for $2019$ and $2020$.

###  V-B Models to be Compared

This numerical analysis compares several trained models with various
combinations of (i) linear policies architecture as introduced in Section
III-A and (ii) feature vectors. These trained models are compared to a
deterministic (Det.) optimization approach as a base-case, and a benchmark
with perfect information (Hindsight). In addition, we explore the impact of
the length of the training period, ranging between $1$ and $12$ months, on the
outcomes of different models.

We first compare models with General Architecture (GA) and Hourly Architecture
(HA) for q-policies. Recall that q-policies take index $t$ in the HA model,
which is not the case in the GA model. Next, we compare the GA and HA in the
cases where a single set of policies is defined over all values of prices, and
a case where the policies are split into multiple Price Domains (PD). When
considering multiple price domains, we refer to models as GA+PD and HA+PD.
Three price domains are chosen: one below the hydrogen price $\rho^{\rm
H}\lambda^{\rm H}$, one above the $90$% percentile of realized day-ahead
prices in the training data, and one in between. The hydrogen price is a
natural threshold to separate the trading decisions because producing hydrogen
is necessarily more profitable than selling power for day-ahead prices below
the hydrogen price. The $90$% percentile is chosen to reduce the influence of
extreme outliers on the q-policies.

Additionally, we investigate three different types of feature vectors
$\textbf{X}_{t}$. Firstly, the simplest Reduced Feature (RF) vector contains
only the deterministic wind production forecast $\hat{P}^{\rm{W}}_{t}$, such
that $\textbf{X}^{\rm RF}_{t}=\big{[}\hat{P}^{\rm{W}}_{t},\lambda,1\big{]}$.
Secondly, the Augmented Feature (AF) vector includes additional features,
namely the aggregated onshore/offshore wind production forecasts in the two
bidding zones DK1 and DK2, released by the Danish transmission system
operator, Energinet, before the time of bidding, such that $\textbf{X}^{\rm
AF}_{t}=\big{[}\tilde{\textbf{X}}_{t}^{\rm AF},\lambda,1\big{]}$ with
$\tilde{\textbf{X}}_{t}^{\rm AF}=\big{[}\hat{P}^{\rm W}_{t},\hat{P}^{\rm
on,DK1}_{t},\hat{P}^{\rm on,DK2}_{t},\hat{P}^{\rm off,DK1}_{t},\hat{P}^{\rm
off,DK2}_{t}\big{]}$. This augmented feature vector may capture additional
information related to the uncertainty sources at the cost of training
additional q-policies and requiring a larger amount of training data.
Increasing the length of the historical dataset raises issues of stationarity
of the environment, in particular of electricity prices. Therefore, a so-
called Forecast Model (FM) feature vector is introduced, that accounts for the
same additional features $\tilde{\textbf{X}}_{t}^{\rm AF}$, while minimizing
the added complexity of the model. This is achieved by first training a
separate feature-driven forecast model that provides a single improved wind
power generation forecast feature $\tilde{X}^{\rm
FM}_{t}=\tilde{\textbf{q}}^{\rm FM}\big{[}\tilde{\textbf{X}}_{t}^{\rm
AF},1\big{]}^{\top}\in\mathbb{R}$, where $\tilde{\textbf{q}}^{\rm FM}$
represents a vector of policies that is trained using a historical dataset. As
the environment related to wind power generation is expected to be stationary,
to a large extent, this feature-driven forecast model can be trained on a
longer historical dataset. Then, the FM feature vector is defined as
$\textbf{X}^{\rm FM}_{t}=\big{[}\tilde{X}^{\rm FM}_{t},\lambda,1\big{]}$.

###  V-C Results

(a)  (b)  (c)

Figure 4: Ex-post profit of the hybrid power plant with (a) four policy
architectures (GA, HA, GA+PD, HA+PD); (b) the HA+PD model for various training
dataset lengths and available feature vectors (AF, RF, FM), compared to the
Deterministic and Hindsight models; and (c) the HA+PD model before and after
the real-time adjustment, compared to the deterministic (Det.) and Hindsight
model, and the Optimal Adjustment strategy.

The results presented are the profits generated by each model from electricity
trades in the day-ahead market, hydrogen production, and settlements in real
time, evaluated ex-post for the entire year $2020$.

Fig. 4a illustrates the comparison between the different policy architectures,
showing the best performing feature vector and training period for each
architecture. This plot shows that introducing multiple price domains
increases the performance radically for both types of architectures, resulting
in the HA+PD model outperforming the GA+PD model with price domains included.
Additionally, we note that the training period yielding the best results for
the GA model is $5$ months, and the model performed within $99$% of this
performance after only $3$ months. With a training period of $3$ months, the
GA model generates around $5$% higher revenues than the HA model. This
indicates that for time periods with a more non-stationary environment than
the one used in the study, or with limited available historical data, the GA
model might be a more appealing choice. Since Fig. 4a shows that HA+PD is the
model that outperforms others, we further analyze this model in the rest of
this section.

Fig. 4b depicts the performances of HA+PD for different feature vectors and
varying lengths of the training dataset, from one to $12$ months. First, we
observe that the improvement of the model by having access to a training
dataset longer than $7$ months is limited, irrespective of the feature vectors
chosen. For example, the profit when models trained on a $12$-month dataset is
only $1$-$2$% higher than when trained on a $7$-month dataset. The second
observation is that the model with the FM feature vector setting usually
exhibits a better performance than the ones with the AF and RF feature vector
settings, especially when the length of the training dataset is lower than
$12$ months. However, these three models show a similar performance when the
plant uses a dataset of $12$ months. The third observation is the performance
of our models in comparison to the deterministic model, where the hybrid power
plant makes day-ahead bidding decisions by using deterministic forecasts only.
We notice that, by using a training dataset of at least $4$ months, our model
outperforms the deterministic model. For example, when using the $12$-month
dataset, the plant makes around $5.9\%$ more profit by using the HA+PD model
with either of three feature vector settings. The final observation
corresponds to the comparison of the HA+PD model with respect to the hindsight
model, in which the plant has perfect information on the prices and wind
generation. We observe that the profit earned by our proposed HA+PD model is
only $3.7\%$ lower than the profit in hindsight, whereas it is $9.8\%$ for the
deterministic model. For the rest of this section, we further analyze the
best-performing model, i.e., the HA+PD model with a $12$-month training
dataset and (AF) feature vector setting.

Fig. 4c depicts the profit across various models before and after real-time
adjustments. Obviously, the hindsight model does not need any real-time
adjustment. The final profit, i.e., after in the day-ahead stage plus real
time, earned by the deterministic (Det.) and the proposed HA+PD model is
computed using the rule-based adjustment strategy proposed in Section IV-B.
This profit is compared to the final profit obtained by the HA+PD model with
an optimal adjustment, implemented as an optimization problem over $24$ hours
with perfect foresight, which provides an upper bound on the benefits of any
adjustment policy. We observe that the the proposed real-time adjustment
strategy achieves a higher increase in the profit of the deterministic model
compared to that of the HA+PD model. Indeed, due to a less efficient day-ahead
scheduling, the deterministic model has more potential for improvement in the
real-time stage than the HA+PD model. However, the final profit of the
deterministic model is still slightly lower than that of the proposed HA+PD
model. Yet, it is important to note that its result relies on having access to
accurate upward and downward balancing price forecasts for the the real-time
adjustment strategy, which is not a straightforward task. As the final profits
of the deterministic model are highly dependent on the performance of the
real-time adjustment policy, in the absence of accurate price forecasts, the
deterministic model risks achieving significantly lower final profits than the
HA+PD model. Additionally, we observe that the proposed rule-base adjustment
strategy achieves almost as much profit as the optimal adjustment one, under
the assumption of accurate price forecasts. This shows that, owed to the
proposed real-time adjustment strategy, the final profit of the HA+PD model
gets even closer to the profit in hindsight, making it an even more attractive
model.

Finally, Fig. (5) provides two examples of feature-driven bidding strategies
in the day-ahead market, obtained by the HA+PD model. The left plot shows the
bidding strategy in a representative hour during which the hybrid power plant
sells power to the grid. In this hour, the plant sells the first $10$ MW at
price $\rho^{\rm H}\lambda^{\rm H}$ and the rest at the $90$% percentile of
the realized day-ahead prices in the training data ($\lambda^{\rm 90\%}$). The
right plot shows a representative hour during which the hybrid power plant
buys power from the grid. The first $10$ MW is bought at price $\lambda^{\rm
90\%}$ and the rest at price $\rho^{\rm H}\lambda^{\rm H}$.

Figure 5: Example of resulting price-quantity bidding curves in the day-ahead
market, when the hybrid power plant buys (right) and sells (left) electricity.
Recall $\rho^{\rm H}\lambda^{\rm H}$ is the hydrogen price, and $\lambda^{\rm
90\%}$ is the $90$% percentile of realized day-ahead prices in the training
data.

##  VI Conclusion

This paper explains how hybrid power plants with co-located wind turbines and
an electrolyzer can implement efficient feature-driven models to learn from
historical data and make informed day-ahead trading decisions. The proposed
feature-driven model derive trading (selling or buying) decisions in the day-
ahead electricity market, as well as a hydrogen production schedule for the
next day, fulfilling the minimum daily hydrogen quota. This is a pragmatic
solution, which properly accounts for wind power and price uncertainty without
the need to generate probabilistic forecasts or solve complex stochastic
optimization problems. Our numerical analysis shows that the proposed feature-
driven models outperform the deterministic model, and require less adjustment
in real time. In addition, they result in a final profit which is close to
that in hindsight.

For future work, it is of interest to explore the performance of the model in
a non-stationary environment. This could be tackled by developing online
decision-making methods, similar to the one proposed in [14] for wind power
trading only. It is also interesting to include more complex physical
characteristics of the electrolyzer, such as non-linear efficiency and
degradation curves, and add more relevant assets to the hybrid power plant,
such as battery and hydrogen storage.

## Acknowledgement

We would like to thank Siemens Gamesa Renewable Energy for providing us with
historical forecast data. We also thank the Danish Energy Technology
Development and Demonstration Programme (EUDP) for supporting this research
through HOMEY project (Grant number: 64021-7010).

## References

  * [1] Danish Ministry of Climate, Energy and Utilities, “The goverment’s strategy for power-to-x,” p. 5, 2021, https://ens.dk/sites/ens.dk/files/ptx/strategy_ptx.pdf.
  * [2] P. Pinson, C. Chevallier, and G. N. Kariniotakis, “Trading wind generation from short-term probabilistic forecasts of wind power,” _IEEE Transactions on Power Systems_ , vol. 22, no. 3, pp. 1148–1156, 2007.
  * [3] J. Morales, A. Conejo, and J. Pérez-Ruiz, “Short-term trading for a wind power producer,” _IEEE Transactions on Power Systems_ , vol. 25, no. 1, pp. 554–564, 2010.
  * [4] A. Sun and A. J. Conejo, _Robust Optimization in Short-Term Power System Operations_. Springer, 2021.
  * [5] P. Pinson, “Distributionally robust trading strategies for renewable energy producers,” _IEEE Transactions on Energy Markets, Policy and Regulation_ , vol. 1, no. 1, pp. 37–47, 2023.
  * [6] D. Bertsimas and N. Kallus, “From predictive to prescriptive analytics,” _Management Science_ , vol. 66, no. 3, pp. 1025–1044, 2019.
  * [7] M. Muñoz, J. M. Morales, and S. Pineda, “Feature-driven improvement of renewable energy forecasting and trading,” _IEEE Transactions on Power Systems_ , vol. 35, no. 5, pp. 3753–3763, 2020.
  * [8] A. Stratigakos, S. Camal, A. Michiorri, and G. Kariniotakis, “Prescriptive trees for integrated forecasting and optimization applied in trading of renewable energy,” _IEEE Transactions on Power Systems,_ , vol. 37, no. 6, pp. 4696–4708, 2022.
  * [9] K. Parginos, R. Bessa, S. Camal, and G. Kariniotakis, “Interpretable data-driven solar power plant trading strategies,” in _2022 IEEE PES Innovative Smart Grid Technologies Conference Europe (ISGT-Europe)_ , 2022, pp. 1–5.
  * [10] A. Georghiou, D. Kuhn, and W. Wiesemann, “The decision rule approach to optimization under uncertainty: Methodology and applications,” _Computational Management Science_ , vol. 16, no. 4, pp. 545–576, 2019.
  * [11] A. Skajaa, K. Edlund, and J. M. Morales, “Intraday trading of wind energy,” _IEEE Transactions on Power Systems_ , vol. 30, no. 6, pp. 3181–3189, 2015.
  * [12] “Feature-driven-trading-of-wind-energy-and-hydrogen,” 2023. [Online]. Available: https://github.com/emilhelgren/feature-driven-trading-of-wind-power-and-hydrogen
  * [13] “ENTSO-e transparency platform,” 2023. [Online]. Available: https://transparency.entsoe.eu/?site_preference=normal
  * [14] M. A. Muñoz, P. Pinson, and J. Kazempour, “Online decision making for trading wind energy,” _Computational Management Science_ , vol. 20, pp. 1–31, 2023.