A Two-Stage Stochastic Optimisation Methodology for the Operation of a Chlor-Alkali Electrolyser under Variable DAM and FCR Market Prices

: The increased penetration of renewable energy sources in the electrical grid raises the need for more power system ﬂexibility. One of the high potential groups to provide such ﬂexibility is the industry. Incentives to do so are provided by variable pricing and remuneration of supplied ancillary services. The operational ﬂexibility of a chlor-alkali electrolysis process shows opportunities in the current energy and ancillary services markets. A co-optimisation of operating the chlor-alkali process under an hourly variable priced electricity sourcing strategy and the delivery of Frequency Containment Reserve (FCR) is the core of this work. A short term price prediction for the Day-Ahead Market (DAM) and FCR market as input for a deterministic optimisation shows good results under standard DAM price patterns, but leaves room for improvement in case of price ﬂuctuations, e.g., as caused by Renewable Energy Sources (RES). A two-stage stochastic optimisation is considered to cope with the uncertainties introduced by the exogenous parameters. An improvement of the stochastic solution over the deterministic Expected Value (EV) solution is shown.


Introduction
The European energy markets have known a drastic change in the past decades, from vertically integrated geographical based monopolies to a transparent pan-European energy-only market and from a mostly fossil based central generation park to distributed generation with renewable energy sources. Ancillary services have also known a large evolution during the past few years and likely are still prone to change in the years to come [1]. The reserves markets have opened up, alleviating technology bans and so creating a level playing field for both producers and consumers. Contracting periods and corresponding delivery times have been shortened from years to weeks to hours, creating more flexibility for the reserve providers.
Considering this evolving energy landscape, industry needs to keep up by attuning the way of operating processes and doing business. One of the electro-intensive sectors is the chlor-alkali industry. derived from the forecast distribution. They concluded that a flexible operation can create savings up to more than 20% for certain periods and that an optimal participation on the FCR market can offer significant higher profits than by exploiting the spot market price differences.
Simkoff et al. [14] investigated the real-time market participation of a chlor-alkali process in which an optimisation is carried out for bids on the DAM and real-time markets under both price and product demand uncertainty . As the work is USA based, the so-called Fifteen-Minute Market (FMM) is comparable, but not identical, to the balancing market as it is known in most European countries. A Hammerstein-Wiener modelling approach is used to decrease the computational time to come to a converged solution, this in comparison to using a full-order physics based model. The bidding in the DAM is considered to be the first stage decision, while the product demand and FMM prices are considered to be the second stage decisions in the stochastic formulation. Four FMM price scenarios are defined heuristically considering the available data. These are scenarios with a significant price spike, a moderate price spike, near-zero prices and close to DAM prices. They conclude that the stochastic optimisation approach is superior to the expected value problem definition. While showing similarities in approach with our work, some important differences exist. The DAM and FMM are substitutes for sourcing electricity, being it at different moments in time. Therefore a trade-off needs to be made between bidding in the DAM and FMM. In our work, all electricity is sourced on the DAM, being it under constraint by the volume of FCR which is contracted. No energy sourcing trade-off is made between energy markets, instead a complementary service is contracted, applying inter-temporal and no volume constraints on the DAM electricity sourcing.
In this work, a methodology is developed for the optimisation of the operation of a chlor-alkali electrolysis plant under hourly variable electricity prices and provision of FCR. A chlor-alkali model is proposed, based on a k-factor analysis. A cost function is combined with the technical and operational constraints of an industrial chlor-alkali electrolysis plant as well as the market constraints and formulated as a constrained optimisation problem. Short term market price forecasts are developed for both the Day-Ahead Market (DAM) and FCR market, which serve as input for the optimisation. A stochastic modelling approach is developed to mitigate the uncertainty of the next days DAM price under the RES and load forecasts. The contributions of this work are the following: • The chlor-alkali process is described based on a k-factor analysis, leading to a tractable mathematical model. This serves as purpose to obtain a computationally efficient optimisation while still encompassing the process specifics. • A methodology for co-optimising the power consumption and ancillary service provision schedule is developed, this under DAM price uncertainty. The Regelleistung.net platform FCR market rules are implemented, with daily FCR prices and a pay-as-cleared pricing system. A two-stage stochastic modelling approach is used, allowing for a timely optimised decision making considering the consecutive Gate Closure Times (GTCs) of the DAM and FCR market. The scenarios and their corresponding probabilities as needed for the stochastic optimisation are calculated case dependent in contrast to a fixed heuristic scenario construction approach. • The stochastic modelling with DAM price uncertainty due to uncertainty in wind and load predictions is proven to be more performant than the deterministic expected value solution, especially under high volatile prices.
This article is organised as follows. In Section 2 the considered DAM and FCR markets are described with respect to rules as applicable for the purpose of this work. A short term DAM and FCR market price forecasting model is applied, with the wind and PV power production and grid load as exogenous parameters for the DAM model. The k-analysis chlor-alkali model is presented in Section 3. Under Section 4 the constrained optimisation model is defined and solved in both a deterministic as two-stage stochastic way. Simulations and results are discussed in Section 5 and conclusions are drawn in Section 6.

Frequency Containment Reserve Market Description
Providing FCR to the electric grid has long been a privilege for classical power plants. A local market operated by the TSO was used to fix long duration contracts with the largest power plants in their control area. In the last few years a more technology neutral approach is taken towards provision of ancillary services, opening up the market to other market players as well. Moving towards a technology neutral sourcing is only one part of the shift in ancillary services, next to reducing the minimum bid size, shortening the contract times and integrating markets. In Germany, a common tendering for FCR has originated in 2007, where all four German TSOs agreed on a common FCR tendering framework agreement. A common platform, Regelleistung.net, was set up where the joint calls for tenders were launched. In 2012, the Swiss TSO Swissgrid also participated in this joint tendering, leading the way for other non German TSOs to follow. At the current moment of writing, the FCR cooperation exists of all the German TSOs 50Hertz, Amprion, TenneT and TransnetBW, Belgian TSO Elia, Dutch TSO TenneT, Austrian TSO APG and Swiss TSO Swissgrid, with the participation of the Danish TSO Energinet.dk planned [15]. In total, these countries cover 46% of the total required FCR capacity of 3000 MW in the Continental Europe Synchronous Area.
The rules as applied by the FCR cooperation are subject to change and harmonisation, and have known some major and minor changes in the past years. A rather major change was the introduction of a shorter contracting time, i.e., product period, being a single day with a D-2 tendering, which happened on the 1st of July 2019. On the 1st of July 2020 these timings were further refined leading to a product period of 4 h with daily tendering. Some other characteristics of the joint FCR tendering are the maximum export levels of 30% of a country's needed FCR and that a core portion of FCR still needs to be sourced from FCR suppliers in the own control area, i.e., local procurement [15]. The market is closed at 08h00 D-1 and results are published at latest at 08h30 D-1.
The FCR cooperation builds on a TSO-TSO model, where a Common Merit Order List (CMOL) is created containing all the offers as submitted by FCR suppliers. A central clearing system is used to calculate the optimal combination of bids to be awarded, taking into account all the rules and constraints that apply. As optimisation goal, the total procurement cost is minimised. Without reaching import or export limits, every TSO applies the Cross Border Marginal Price (CBMP) for the FCR supplier remuneration. Local Marginal Prices (LMPs) can be established when either the export or import limit is exceeded. An LMP higher or lower than the CBMP is present when the import and export limit is exceeded respectively. This CBMP or LMP is used to remunerate the FCR suppliers whose bids have been accepted according to a paid-as-cleared methodology. When a country's import limit is exceeded and thus a LMP higher than the CBMP is set, all of the locally sourced FCR (the core portion) will receive this elevated remuneration. The volume which was imported will be remunerated according to the CBMP [16].
Regelleistung makes available the FCR volume demand, tendering results including CBMP and LMPs and an anonymous list of bids of all countries, giving the possibility to gain insight in the market [17]. All bids placed on the Regelleistung platform are visualised in Figure 1, covering the period from the 1st of July 2019 up to and including the 30 September 2020. Note that the vertical axis in Figure 1 has a logarithmic scale and that thus a large portion, more than 44%, of the total bids are placed into the market as a zero-bid. This zero bidding strategy can be explained by the pay-as-cleared market clearance method which is applied. The FCR volume demand is currently larger than the volume of zero bids, assuring the zero-bidders to obtain the CBMP remuneration without having to develop a classic profit-risk trade-off bidding strategy. In this work, the zero-bidding will be applied, eliminating the need for the development of a bidding strategy. It is assumed that the volumes which are bid into the FCR market will be 100% awarded according to the CBMP, removing the uncertainty of bid acceptance. It is therefore the CBMP price which is further used in this work.

Frequency Containment Reserve Price Prediction Model
Considering that the FCR Regelleistung market is fairly new and that major changes in product period and tendering have taken place over the last few years, prediction of future market prices is considered challenging. The historical prices spanning the period from the 1 April 2020 up to the 1 October 2020 are shown in Figure 2. Prior to the 1 July 2020 daily prices were used, and a weekly pattern seemed to emerge with higher prices during weekend days. The shift to a 4 h contracting period seems to have resulted in a different bidding behaviour of market parties, abolishing the weekly price periodicity. The limited availability of data with these new market rules and the changed bidding strategy impede the use for forecasting purposes. Therefore, a market price prediction model is trained based on the available daily price dataset ranging from the 1 July 2019 until the 30 May 2020, leaving a testing dataset with daily prices ranging from the 1 June to the 30 June 2020. The integration of 4 h contracting prices is considered in future work, when a larger dataset will be available. SARIMA models are made by using the pmdarima package in Python [19], which constructs, evaluates and defines the best fitting model based on the AIC [19]. A SARIMA model is noted as SARIMA(p, d, q)(P, D, Q) m where p, d and q are the non-seasonal parameters, P, D and Q are the seasonal parameters and m is the number of periods per season. The parameter p (P) notes the order of autoregression (AR), the parameter d (D) is the degree of differencing and q (Q) the order of moving average (MA). The resulting best-fit model is a SARIMA(2,1,2)(1,0,2,7), has a RMSE of 1.29 and a MAPE of 18.32 considering the testing dataset. Figure 3 shows the actual and predicted FCR prices during a part of the testing period. It is seen that the weekly periodicity is captured by the model.

Day-Ahead Market Description
Identical to electricity retailers [20], large consumers have many options on sourcing their electricity, ranging from long-term hedging contracts, over the Day-Ahead Market (DAM) to the Continuous Intraday Market (CIM) as well as the balancing market. The DAM is considered the most liquid market, i.e., a market with a large number of buyers and sellers, for electricity trading. The principle of electricity pricing on the DAM is based on the supply and demand curves, where for every hour of the day a single clearing price is defined based on the intersection of both. As its name depicts, the DAM is closed the day before delivery, i.e., bids need to be placed before 12h00 D-1. After closing, the prices are fixed and are communicated to the market parties by 14h00 D-1. At the moment of placing bids in the market there is uncertainty on the actual hourly market price which will be set and an assumption needs to be made.
All the electricity consumed for the chlor-alkali electrolyser is considered to be bought on the DAM. In this work, we assume the electrolysis plant to be a price-taker, i.e., that the volumes of the bids of the plant are sufficiently small compared to the total market volume, so that it does not influence the outcome of the DAM prices. Next, the assumption is made that the set bid price is sufficiently high so that at any moment the plant can be assured of buying electricity on the DAM, evading the uncertainty of bid acceptance. This is a commonly used strategy within industry, where a DAM limit bid price is based on the profitability of production, which can be a multiple of the actual DAM prices.

Day-Ahead Market Price Prediction Model
Time-series prediction of the DAM price is a popular research topic, and can be done by applying various methods such as (S)ARIMA(X) models [21][22][23], artificial neural networks [24,25] or deep learning [26]. The DAM has been an established electricity trading platform for many years, hence leading to a large available dataset on the historical prices which can serve as input to a prediction algorithm. Periodicities in the DAM price are known to be daily, weekly and seasonal, and could be modelled as such. As elaborated upon in [27], also several fundamental, operational and strategic factors have an impact on the DAM price. Considering the increasing amount of Renewable Energy Sources (RES), the weather conditions are one of those factors. In [28] extreme prices on the German DAM are investigated. It is concluded that price spikes are mainly observed when a high demand and low supply is forecasted while negative prices are mainly seen when a high wind power production and low demand are expected. In general it can be stated that the effect of RES is clear in the study of extreme price behaviour. These finding could be extrapolated to the Belgian system, considering Belgium is one of the leading countries in (offshore) wind power production [29], as well as having a high production from solar PV systems [30].
Considering both the given facts of multiple periodicities and impact of external regressors, a choice of method needs to be made. A Trigonometric seasonality, Box-Cox transformation, ARMA errors, Trend and Seasonal components (TBATS) model allows for multiple periodicities to be included but has as major drawback that no external regressors can be included. Considering the importance of the latter in the DAM pricing, it is decided to create a short-term Belgian DAM price prediction model by using the SARIMA with eXogenous factors (SARIMAX) method. As the SARIMAX method only allows for a single direct periodicity, a second periodicity is included indirectly by using Fourier terms. As exogenous parameters the actual wind and PV production as well as the grid load are added. The latter are considered to be known, i.e., the uncertainty of future wind and PV production are not taken into account here. The historical data for the external regressors are obtained from Elia [31][32][33] and data on historical DAM prices are obtained from the ENTSO-E transparency platform [34]. The model is trained based on a dataset ranging from the 1 June 2019 to the 30 May 2020, with June 2020 serving as test dataset. Identical to the FCR price prediction model the pmdarima package in Python is used. The resulting best fitting model is a SARIMAX(3,1,2)(2,0,2,24). Figure 4 shows the actual and predicted DAM prices during a part of the testing period. An RMSE of 10.16 is obtained (The MAPE is not calculated because it is considered to be not representative since the dataset contains negative and zero prices). The model shows to grasp periodicities as well as encompassing the part of the variability of the exogenous parameters, nevertheless forecast errors are still present. The Auto-Correlation Function (ACF) and Partial Auto-Correlation Function (PACF) plots of the residuals show remaining lags within the significance bands, hinting that a higher-order SARIMAX model might provide a better prediction. Nevertheless, based on the AIC, no improved SARIMAX model is found. To investigate the potential heteroscedasticity of the time series, the residuals are subjected to Engle's Test for Autoregressive Conditional Heteroscedasticity (ARCH), as implemented in the Python statsmodels package [35]. The null hypothesis is confirmed, i.e., the residuals are found to be homoscedastic, and no ARCH term is considered to improve the model. The constructed SARIMAX model will be used to forecast the next-day DAM prices, so to serve as input for the optimisation algorithm, as will be further explained in Section 4.2. Considering the constraints, as defined in Section 4.1, the intraday relative price differences are of importance, rather than the absolute price levels.
Note that this model is constructed based on the actual values of the exogenous parameters, i.e., it has perfect knowledge on the future wind and PV production as well as on the grid load. In practice, only forecasts of these parameters are available which are prone to uncertainty. Coping with this uncertainty is further explained in Section 4.3.

Chlor-Alkali Electrolysis Model
The chlor-alkali electrolysis process is very electricity intensive, with an electricity consumption between 2 and 2.4 kWh/kg of Cl 2 produced by using the membrane technology [36]. With a European chlorine production of 9424 kton in 2018 [37], the corresponding electricity consumption is comparable to a country with the size of Ireland. Because of this electricity intensiveness of the process, the chlor-alkali industry has been a front runner in valorising the flexibility the process encompasses.
The constructed model focusses on the membrane technology and is considered for the operation in a discrete way, with time steps of a single hour. This time step size has been chosen in function of the smallest granularity in the used data, i.e., the DAM with hourly varying prices and the practical control of the electrolyser. No full dynamic model is envisioned, which would be too computationally intensive and deemed not necessary for the purpose of this work. In The starting point of our model is the relation between the cell voltage and the current density. The cell voltage U c is a sum of six different voltages, being the decomposition voltage, membrane potential, electrode overpotential for chlorine and hydrogen, the ohmic voltage drop in the membrane, electrolytes, electrodes and conductors [38]. The cell voltage U c has a nonlinear relation with the current density J, mainly caused by the electrode (anode and cathode) overpotential. The nonlinearity is strongly present in the lower current density area and a linear relationship can be considered from J equal to 1.5 kA/m 2 and more. As the day-to-day modulation of membrane electrolysers is limited in terms of current density, a linear relationship can be assumed for the model. Only for a brief moment, when ramping up from or down to a complete shutdown, the nonlinear zone is crossed. This simplification is referred to as a k-factor analysis. The k-factor [Vm 2 /kA] can be considered the pseudo-ohmic resistance, and is the parameter for the slope of the linear part of the voltage-current density curve. The k-factor method is widely used in the chlor-alkali industry to characterise the overall performance of an electrolyser [39] and has a value between 0.08 Vm 2 /kA and 0.5 Vm 2 /kA, depending on the bipolar membrane cell technology and the cell condition [40]. Here we consider a k-factor of 0.10, with a linear increase of 2.08 10 −3 per equivalent membrane lifetime month m l , as given in (1). More specific models are available in literature, defining the k-factor based on various process parameters [41]. k = 0.10 + 2.08 10 −3 m l A cell voltage U c0 of 2.35 V is considered at zero electric current. The cell voltage U c is then given by: We introduce the current efficiency which is considered to be linearly related to the equivalent membrane lifetime m l . The current efficiency can be obtained through an anodic balance using the sulphate key method. In (3), a starting value of 0.96 for a new cell and a degradation of 8.33 × 10 −4 per equivalent lifetime month is considered, which are both defined experimentally [38]. Besides the decrease of the current efficiency due to membrane ageing, also more dynamic effects exist, e.g., short term current efficiency changes due to interruption of operation. As the level of detail of these effects are not considered the core of this work, we refer to [42] for a more detailed description.
Wishing to obtain the electric power density of a cell P c , we combine the cell voltage U c with the current density J and current efficiency , obtaining (4).
Industrial electrolysers have multiple cells in series combined, forming a single unit. By adding the number of cells N c which are put in series and the Electrically Active Surface Area (EASA), we can obtain the power consumption of a complete electrolyser unit.
Q NaOH = N c J A easa 670.20 (8) Note the quadratic current density term in (4), which is not present in (6), (7) and (8). This results in an inverse relationship between the consumed electric power and the production of Cl 2 , H 2 and NaOH. It is thus more energy efficient to run the process at a lower current density, and not at nominal production capacity, which is different than most industrial processes. This inverse relationship should be kept in mind when assessing the power profile as result of an optimisation. Despite this inverse relationship between efficiency and utilisation level, industrial electrolysis processes are often operated close to nominal capacity, due to the high Capital Expenditures (CAPEX) in constructing electrolysers.

Constrained Optimisation Problem
The operation of an industrial process is bound to several constraints, both technically and economically. Describing these constraints combined with a cost function allows for optimisation of the operation of the chlor-alkali process. A schematic overview of the electrolyser setup as used in this work is shown in Figure 5. The cost function f is defined in (9).
The value of the produced products, E Cl 2 , E H 2 and E NaOH , is assumed to be fixed in time and is expressed in euro/ton, while the production volumes, Q , are dictated by the current density and thus variable in time. Variable electricity costs for operation of the electrolysis process are accounted for by using the hourly variable DAM price E DAM t and the electrolyser power P e t . Since the power consumption of the electrolyser is directly related to the current density, see (4), it can be considered a proxy for the current density. A last term accounts for the FCR remuneration, with P FCR t the contracted FCR power and E FCR t the CBMP expressed in euro/MW/h. A first constraint (10) considers the obligation to deliver to customers. A continuous flow of chlorine, Q Cl 2 ,c t , is sent to the customer, which is assumed to be constant during the complete simulation. Q Cl 2 ,c t is fixed at 3.2 tons per hour, corresponding to 85% of the production capacity of the chlor-alkali electrolysis plant, defined as the average Nominal Utilisation Level (NUL a ) of the electrolyser. While the NUL a can vary over time due to market demand, it is expected to be rather high during most periods. In this work a NUL a of 85% is considered in all simulations. The flexibility of the plant is inversely related to the NUL a , i.e., a high NUL a relates to a low potential for flexibility.
A minimum V Cl 2 ,− and maximum V Cl 2 ,+ chlorine storage constraint is taken into account in (11), set at 5 tons and 45 tons respectively, representing a physical storage of 50 tons with a safety margin of 5 tons. This storage capacity volume is sized according to industrial reality and can be considered rather small in size. The main reason is the safety consideration in storing chlorine, making it a limiting factor in the chlor-alkali process [2]. The chlorine storage tank is used as buffer for production fluctuations. The size of this storage tank could thus also influence the flexibility potential of the plant. A fixed volume of chlorine in storage in the beginning and end of the simulation is ensured by (12), which are both set at 25 tons.
V Cl 2 ,beg = cte The operation of an electrolyser is limited in current density. A minimum J m,− and maximum J m,+ current density boundary is implemented in (13) between which a continuous control is possible, with the only exception of a shutdown of the electrolyser, when the current density is zero. J m,− is set at 1.85 kA/m 2 , while the J m,+ is set at 6.67 kA/m 2 . These current densities can be translated to power levels using (4), leading to a minimum power level P e,− of 2.26 MW and a maximum power level P e,+ of 9.84 MW.
As discussed in Section 2.1, a minimum bid size of 1 MW, a bid step size of 1 MW and a contracting period of 4 h are implemented by the Regelleistung platform as most up-to-date rules. In Section 2.2 it is discussed that due to dataset length constraints a daily price prediction model is developed. Nevertheless, the 4 h contracting period constraint is implemented in the optimisation model, as given by (14) and (15).
Constraints as given in (16) In practice, a ramp-rate limitation ∆J r , for both the upwards and downwards modulation of the electrolyser, is used to maintain a safe process operation. A value of 0.3 kA/min, i.e., 18 kA/hour is implemented in (17). With a nominal current density of 6.67 kA/m 2 and an EASA of 2.7 m 2 as used in this work, it is thus possible to ramp up to nominal or ramp down to zero current within the time of one hour. In a discrete model with hourly time periods, this constraint will thus not impact the optimisation.
The cost function f will be maximised taking into account the aforementioned constraints, leading to an optimal power consumption profile and contracted FCR volumes.

Deterministic Optimisation
Maximisation of the cost function f as defined in (9) is only possible in case a value for each parameter is available. As explained in Section 2 future prices of energy and ancillary service markets are not known in advance and are prone to forecasts. A SARIMA(X) model for the FCR and DAM prices is constructed and used as deterministic price input for E FCR t and E DAM t respectively. For the DAM SARIMAX model, the actual data for wind, PV and load are used, as obtained from Elia [31][32][33]. The optimisation where the predicted FCR and DAM prices are used is termed the forecast scenario. The constrained optimisation problem is defined in the Pyomo language, which is a Python based, open-source optimisation modelling language [43]. For optimisation, the BONMIN solver from the open-source Coin-Or project is used [44].
To evaluate the performance of the optimisation, a Crystal Ball scenario is taken as reference where the actual DAM and FCR market prices are used. To define the benefit of electrolyser modulation, a flat load operation of the electrolyser is assumed as well, where a steady power consumption level and a maximum FCR contracting is assumed while producing an identical amount of chlorine as with the forecast and Crystal Ball scenarios. Figures 6 and 7 show optimised power consumption and FCR bid profiles for two distinct days. Table 1 summarises the results, with a detail of the electricity sourcing cost on the DAM (C DAM ), FCR remuneration (C FCR ) and a total cost (C Tot ). The difference with the Crystal Ball scenario, for both the flat load and forecast scenarios, are calculated and shown in the table as well. Since a fixed value for the chemical product costs is used during the complete simulation and an identical amount of product is produced in each scenario, these values are not discussed in the results. An overview of the parameter values as used in the simulations in this work are shown in Table 2.
The results of the simulation on the 2 June show that practically no improvement, i.e., only a cost increase of 0.01%, could be made by better forecasting the DAM and FCR prices. Nevertheless, the absolute price forecasts are not perfect. The results are influenced by the inter-temporal relative price differences, since a fixed volume of products needs to be produced during the simulation time window (see constraints in Section 4). Indeed, this is also seen in the results of the simulation on the 6 June, as the DAM prediction shows inter-temporal differences with the actual DAM prices. A higher morning peak and lower evening peak are predicted while the actual prices shown the vice versa pattern, resulting in a total cost increase of 25.88%.
To assess the flexibility opportunity of the electrolyser, the total cost increase in case of flat load operation is calculated. The results for the 2 June show an increase of 7.22% while the results for the 6 June show a value of 56.38%. The cost increase is compared to the Crystal Ball scenario. The influencing criterion is the intraday DAM price volatility as defined by (18). Considering the examples, indeed a low intraday price difference of ∆E DAM = 17.35EUR is seen during the 2 June and a larger price difference of ∆E DAM = 30.06EUR is seen during the 6 June. Operation in a non-flat-load manner is more beneficial in case of larger intraday price differences.   The optimisations and corresponding results as presented here either assume a perfect knowledge for the FCR and DAM prices, i.e., the Crystal Ball scenario, or assume forecasted prices but with perfect knowledge on the exogenous parameters influencing the DAM price, i.e., the forecast scenario. Either which are not realistic given the fact that no perfect knowledge is present. Instead, a FCR and DAM price prediction needs to be made under uncertainty of the exogenous parameters. A way of coping with this uncertainty is to apply a stochastic modelling approach as is done in Section 4.3.

2-Stage Stochastic Optimisation
In Section 4.2 the results from the optimisation by using the FCR and DAM actual prices or considering price predictions based on actual values for the exogenous parameters are discussed. Nevertheless, the applicability of this approach in real life is not possible due to the inter-temporal constraints of the exogenous parameters. Indeed, the actual production values for wind and PV and the total grid load are not known in advance. Instead, timely available predictions for these values need to be used for the DAM price prediction model. Elia makes available forecasts for these parameters and updates them on a regular basis [31][32][33]. To cope with the uncertainty of these predictions and the impact on the predicted DAM price, a two-stage stochastic optimisation approach is taken. Four different scenarios are constructed, based on a combination of wind and PV power production and grid load, and this for each single optimisation period. An example of the scenarios and their probabilities is given in Figure 8 and Table 3.  The cost function as defined in (9) can be reformulated, obtaining the optimisation function (19). The first stage decision consists out of bidding into the FCR market. A second stage decision will then define the volumes of electricity which will be bought on the DAM, under DAM price uncertainty due to wind and PV power production and grid load forecasts. Considering the GCTs of both markets, FCR volumes indeed need to be bid into the market before supplying bids into the DAM. While the FCR market is no substitute for the DAM, as no electricity is sourced, the committed FCR volumes do impose a constraint on the operation of the electrolysis process, having an effect on the flexibility valorisation. Note that the volumes and cost of the produced chemical products represent the total value generated. Considering static product unit prices as given in Table 2 the operation of the chlor-alkali process is always profitable considering the DAM prices as used in our work. The calculated value would therefore not influence the results of the optimisation. In case of more dynamic and volatile product costs, these could influence the outcome of the optimisation.
The stochastic package PySP is used [45], combined with the aforementioned Pyomo language and BONMIN solver. A total of 30 daily simulations are conducted during June 2020, covering both week and weekend days, days with high and low RES production and days with negative DAM prices. An overview of the results is given in Table 4. The Value of Stochastic Solution (VSS), as it is defined by Birge et al. [46], is used as criterion to define the added value of solving the problem in a stochastic way. It is defined according to (20), being the difference between the solution of the deterministic expected value optimisation (sol(EV)) and the solution of the two-stage stochastic problem (sol(2SSP)).

Discussion
Regarding the Crystal Ball deterministic optimisation as shown in Section 4.2, Figures 6 and 7, a rather rational result is obtained. The power consumption is optimised based on the DAM prices, by running the electrolyser at nominal production capacity when the prices are lowest and reducing the power when prices are highest throughout the day. As result, during the hours with the lowest electricity prices, no FCR is contracted as the contractual obligations of the FCR could not be fulfilled, i.e., no upward operational band is present when running at full capacity. Considering the constraints as defined, a fixed volume of product, i.e., chlorine, needs to be produced within a single optimisation time window, i.e., a single day. As result, only the relative DAM price differences are of importance for the optimisation of the operation of the electrolyser. Improvement of the DAM price prediction should thus be focussed on the price pattern rather than on the absolute values of the prices. The profit obtained by supplying FCR towards the TSO is considered rather limited with respect to current Regelleistung.net CMBP prices. The rationale of the optimisation seems to be to optimise the operation of the electrolyser based on the DAM price variability, with as second level order contracting as much FCR as possible under the constraints as defined by the optimised power consumption profile.
Operating the electrolyser flexibly is shown to be mostly interesting in case large intraday DAM price differences. Figure 7, with a ∆E DAM of 30.06 euro shows a potential profit of 56.38%. An intraday price delta ∆E DAM of 17.35 euro as present on the dataset used for the simulation as shown in Figure 6 shows to only create a potential profit of 7.22% by flexible operation.
Introducing a two-stage stochastic modelling approach to mitigate the uncertainties due to DAM price predictions with exogenous parameters is shown to have a beneficial effect, considering the test dataset of June 2020. In total a VSS of 0.51% is obtained, i.e., the stochastic solution brings a benefit, being it rather limited, in comparison to the deterministic Expected Value solution. When assessing the VSS for each simulation separately, we see that for some simulations the EV solution shows better results than the stochastic solution. This is as to be expected since the stochastic methodology approaches the problem with probabilities, which are per definition the quantification of how likely an event is expected to occur. Only on average the solution will be more performant.

Conclusions
In this work, a methodology is proposed for the economical optimisation of the operation of a chlor-alkali electrolysis process which is modelled by using the k-factor method. A set of industry-based constraints combined with a cost function forms the basis for a constrained optimisation problem. The electrolyser is assumed to be operated on electricity sourced on the Day-Ahead Market (DAM) and has the possibility to deliver Frequency Containment Reserve (FCR) to the grid. First, a deterministic optimisation considering predicted DAM and FCR market prices with SARIMA(X) models with known exogenous parameter values is considered. A comparison is made between the Crystal Ball scenario, i.e., where the DAM and FCR prices are assumed to be known upfront, and with a flat load scenario, i.e., where the power consumption is stable throughout the simulation time. A flexible operation of the electrolyser is concluded to be interesting in case of larger intraday DAM price differences. The exogenous parameters as used in the SARIMAX DAM price prediction model, i.e., the wind and PV production and grid load forecast, bring uncertainty, as these are in reality based on predictions. To mitigate these uncertainties, a two-stage stochastic modelling approach is used. The stochastic solution is shown to be slightly more beneficial compared to the deterministic Expected Value solution, with a benefit of 0.51%.
In general, it can be concluded that a flexible operation of a chlor-alkali electrolyser, under both varying electricity market prices and delivery of FCR service is deemed beneficial compared to a flat load operation. To optimise the flexible operation of the electrolyser, an as good as possible forecast for the future market prices is necessary, especially focussed on the relative price differences within the simulation period. A two-stage stochastic modelling can serve as solution to the introduced uncertainties.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: