{'fraction_non_alphanumeric': 0.028409907536051358, 'fraction_numerical': 0.004359699132851051, 'mean_word_length': 4.60827512090274, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Modeling and Optimal Control of a Hydrogen Storage System for Wind Farm Output Power Smoothing

This paper proposes an output power smoothing strategy for a grid-connected wind-hydrogen plant. An Energy Storage System (ESS) composed of an electrolyzer and a fuel cell is used to smooth the fluctuating output power of the wind plant. The aim of this study is to propose a multi-objective optimization model for joint wind farm and energy storage operation, to smooth the wind power output, and to track a load demand subject to a variety of constraints on the system model. Based on a modeling adopting mixed-integer constraints and dynamics, the problem of output power fluctuations and smooth tracking of load demand is solved through the implementation of an optimal controller which follows a sequential optimization technique. We illustrate the effectiveness of the proposed controller with a simulation example, employing real equipment data and wind profiles.


I. INTRODUCTION
Clean energy resources in comparison to fossil fuels have raised considerable attention in energy markets during the last decade. Among them, the most promising options are wind and solar [1]. However, such technologies are associated with major operational drawbacks such as the intermittent nature and uncertainty, together with demand and supply mismatches and high capital, operational and maintenance cost. These aspects represent the greatest challenge for the efficient and effective integration of the wind power into the electricity grid [2]- [5].
It is well known that wind power is not constant and can fluctuate significantly since it is proportional to the cube of its speed [6]. To overcome this aspect, various power smoothing methods have been proposed in the last decade.
A main approach is to leverage on energy storage systems. Specifically, ESSs are used to smooth the variations in wind power production and follow the scheduling plan so as to improve energy market operations. Batteries, ultra capacitors, super inductors, flywheels and fuel cell systems are also utilized for storage purposes [7]. However, an efficient control system is required to minimize the energy storage and prolong the devices life in order to minimize the associated cost. Muyeen et al. [8] proposed Static Synchronous Compensator (STATCOM) incorporated with Battery Energy Storage System (BESS) with simple hydrogen generator topology composed of a rectifier and an electrolyzer. The aim was to generate constant hydrogen gas by using the electrical energy from a fixed-speed wind farm and at the same time provide smooth output power, maintaining constant voltage magnitude at wind farm. A work on the feasibility of hydrogen used as energy buffer for managing the intermittent production of renewable energy along with output power fluctuations smoothing was presented in [9]. They presented the platform MYRTE and implemented Photovoltaic (PV) output power fluctuations smoothing algorithm. The objective was to send to the grid operator, the information concerning the smoothed PV profile available for the next day.
A cooperative control method was proposed by [10] to solve the problem of smoothing output power from the wind generator and supplied to the power grid. In that study, a model description method is derived in order to emulate the behaviors of each device, the electric power flow and the hydrogen gas flow among the devices. [11], [12] studied wind power smoothing via flywheel, Superconducting Magnetic Energy Storage (SMES), and battery energy storage systems to smooth the net power injected into the grid by a wind power plant.
Despite the papers revised above, according to the authors' knowledge, the problem of the output power smoothing with hydrogen based energy storage system has been very little explored in the literature. In particular, some significant issues such as achieving stable hydrogen production and simultaneously smoothing wind power taking into account all the operational constraints, limitations of the energy storage system, degradation, and operational and maintenance costs deserve further investigation and there is a great need to develop new energy storage and management methods to address the problems outlined above. These aspects are explicitly addressed in this paper while nor the modeling and the low level/local control of wind turbines are developed being them out of the scope of the study.
Specifically, the plant is modeled considering mixedinteger constraints and switching dynamics for the hydrogen tank and degradation dynamics. Also, the depreciation cost are considered when switching among on (ON), off (OFF), cold (CLD), warm up (WRM) and standby (STB) operational states of the considered equipments (electrolyzer and fuel cell). Analogously, all the time constraints related to the hot and cold start of the controlled equipment have been explicitly addressed and taken into account in their operational mode switching (discrete and continuous dynamics). In this way, the controller exploits the real capability of the plant in tracking the power demand and, at the same time, guarantees a smooth power inflow to the grid. The control objectives are pursued sequentially with priority first to the smoothing and than to the load tracking. With these features, the controller simultaneously smooths the output wind power and tracks the reference demand P ref with the available system power P avl .
Numerical results are conducted to show the effectiveness of our approach. The models and the control strategy developed in this paper are part of the EU-FCH 2 JU (European Union Fuel Cells and Hydrogen 2 Joint Undertaking) project funded HAEOLUS -Hydrogen-Aeolic Energy with Optimized eLectrolysers Upstream of Substation [13], where a hydrogen-based ESS has been designed and is currently under construction to be integrated in a wind farm situated in north Norway. The models and the control strategy here developed will be integrated in that plant. The project will demonstrate the techno-economic feasibility of the integrated system in three different use cases as per the IEA-Task 24 final report [14], and this paper addresses one of them, i.e., the energy-storage. Numerical results are conducted to show the effectiveness of our approach on data taken from the project and, for those not yet designed, complemented with data taken from the literature.

II. PROBLEM FORMULATION
The system diagram of the plant and its main components are shown in Fig. 1. The wind power flow, the hydrogen flow and the data flow are denoted by green, blue and red lines, respectively. Accordingly, P w indicates the power generated by the wind farm, P ON e indicates the input power of the electrolyzer, P ON f indicates the output power of the fuel cell, and P ref is the reference demand which has to be tracked by P avl . In the paper, formulations are derived in a discrete time k. The continuous time t can be obtained via t = kT s , with T s being the sampling time.

A. Discrete Operational States of the Devices
The electrolyzer and the fuel cell can be operated in 3 different physical modes, namely the ON, the OFF and the STB mode. The overall behaviour can be modeled by the automaton shown in Fig. 2. Together with the three mentioned modes, the two additional states CLD and WRM are included in order to account for cold and warm starts within the cost functions introduced in Sec. III-A. The automata are used in order to derive a Mixed-Logic Dynamic (MLD) model to be included in the proposed controller so that to achieve a feasible operating strategy for the electrolyzer and the fuel cell in terms of logic commands [15]: each state is linked to a logic variable 1 whenever for a given i ∈ {e, f }, the corresponding i-th automaton is switching among the states α to β at time k while σ β α,i (k) = 0 otherwise. As it will be clearer later the transitions affecting the operating costs of the electrolyzer and the fuel cell are among the states ON-OFF, CLD-STB and STB-OFF, since they cumulatively account for a complete operational cycle and, therefore, affect the cycles lifespan of each device.
1) Model and MLD Constraints of the States: The five discrete states OFF, CLD, STB, WRM and ON of each automaton are identified by the product of one logical variable and one power, which is relevant for that state, to be different from zero. For instance, whenever the electrolyzer is in the ON state, the corresponding input power P in e is limited within the range [P min e , P max e ], while it is null otherwise. Thus, by defining P in when δ ON e (k) = 1. Moreover, being mutually exclusive, all other logical variables δ α e , α = ON will be set null. Similarly, whenever the electrolyzer is in the STB state, the relevant power to be considered is the stand-by power P STB consumption are null, resulting in P e (k) = 0. In general, the meaning of P i (k) depends on the condition of the i-th device that, in turn, is identified by the corresponding δ α i (k). That is, P α i = P i δ α i (k) and, therefore, according to the operating condition of the i-th device, each δ α i (k) is determined as In order to cope with an optimal control framework, the cases in (1) By using the transformations defined in [15], the above formulas can be expressed with the following compact inequalities for each case where M > 0 is an upper bound of P i (k). The auxiliary variables codified by inequalities (3) are then adopted to model the MLD by linking the discrete logical states of each device with its operating power, according to (1). Namely, for i ∈ {e, f }, the following constraints are derived Since the devices will work in one and only one mode at any time k, the additional mutually exclusive constraint Here it is important to highlight the devices are operated independently of each other, that is we don't force any mutually exclusive operation. This extra degree of freedom will help the controller to minimize the switching costs that are suitably included in corresponding cost functions.
2) Model and MLD Constraints of the State Transitions: In principle, the operational states in Fig. 2 imply twenty possible mode transitions 2 2 ∧ stand for the AND logical operators with σ β α,i ∈ [0, 1], α, β ∈ {OFF, CLD, STB, WRM, ON}, α = β and i ∈ {e, f }. Eq. 6 can be converted into three inequalities and provided as constraints in the proposed MPC controller, thus resulting in the following formulas For some state transitions, i.e., σ OFF ON,i (k), σ CLD OFF,i (k) and σ OFF STB,i (k), a cost is paid. Indeed, each complete off/on cycle affects the cycle lifespan of the device because the corresponding stack degrades. These transitions will be so included in the devices cost functions while all the inadmissible transitions, i.e., those not shown in Fig. 2, are set to 0 and enforced with corresponding constraints to be enforced at all time k:

B. Operating Constraints
The electrolyzer and the fuel cell have inherent limitations regarding the switching time between the feasible operating modes. This fact results in time constraints for the corresponding automaton that are included into the controller by means of suitable mixed integer linear inequalities involving the relevant logical variables: with i ∈ {e, f } and where T CLD , T WRM are the start up time (cold start) and the response time (warm start) that each device has to wait before switching from OFF to STB and from STB to ON, respectively, as shown in Fig. 2.

C. Ramp Up Constraints
In order not to damage the electrolyzer and the fuel cell during their operations, the controller will force the P e and P f per time-step variation to be bounded according to where R i are the ramp limits of both the devices.

D. State Space Model of the Hydrogen Storage Dynamics
Hydrogen dynamics are given in terms of the hydrogen level H(k) in the tank and the efficiencies of the electrolyzer and of the fuel cell η e and η f , respectively, the power of the electrolyzer and the fuel cell in their ON state P e and P f , respectively, and also the corresponding logic variables of the devices δ ON e and δ ON f . The resulting formula is Notice that, according to (11) the electrolyzer and the fuel cell respectively produce and consume hydrogen only in their ON modes.

E. Operating Range Constraints
The electrolyzer, the fuel cell and the hydrogen tank have operating ranges limits that can be modeled correspondingly as

F. Power Balance Constraints
The power balance and the corresponding constraint that holds at each time k is that highlights how P avl depends on P w and on the balancing action of the hydrogen storage system.

III. PROBLEM DESCRIPTION
In this section the MPC problem for output power smoothing and load tracking is presented by exploiting a sequential execution of control subproblems. Secs. III-A, III-B and III-C defines the cost functions of the electrolyzer, fuel cell, power smoothing and load tracking, respectively. In what follows, the cost functions will be defined with respect to a generic optimization horizon T .

A. Electrolyzer and Fuel cell Cost Functions
The operating costs of the electrolyzer and the fuel cell include several terms, i.e., the component depreciation, the reduction of life cycles, the energy spent in keeping the units warm during stand-by, the energy spent for cold and warm starts [7], [16]- [19]: where i ∈ {e, f }, k is the current time instant, j = 0, 1, . . . , T − 1 accounts for future time instants, NH i is the i-th device cycles lifespan, S rep,i is the i-th device stack replacement cost, C OM i indicates the i-th device operating and maintenance costs, s(k + j) is the power spot price, that is the one-hour price of wholesale market electricity and C OFF ON,i , C STB CLD,i , and C OFF STB,i , denote the i-th device cycle costs. We emphasize that, on the one hand, the cold starts imply higher costs than the warm starts while on the other hand, OFF mode does not imply any power absorption (while this is not true in STB, CLD, and WRM modes).

B. Reference Tracking Cost Function
One goal of the system is to track the load demand P ref with the available power P avl . The load tracking cost function is given by the mismatch between P ref and P avl as The total load tracking cost function at time k is so given as where ρ l , ρ ez and ρ fc are positive weighting scalars that have been selected after numerical simulations and their values allow to have a good threshold between power consumption, goal satisfaction and equipment degradation.

C. Output Power Smoothing Cost Function
The power smoothing has been achieved by accounting previous available power values, and properly evaluating the scheduling of future power ahead in time. The output power smoothing is formulated so that the controller will minimize the receding horizon cost function where τ B is the number of previous samples considered for the smoothing action, ω k+ j,τ defines a weighting factor and y k+ j,τ is a decision variable that defines the bound on the difference of past and future available power values. Specifically, y k+ j,τ is subject to the constraints y k+ j,τ ≥ 0, (17a) whereȳ τ is a threshold below which the power span is considered acceptable by the grid operator, i.e., the power provided is considered "smooth".

D. Multi-objective MPC formulation
At each step k the controller selects a sequence of future command inputs through an optimization procedure, which aims at minimizing suitable cost functions and enforcing the fulfillment of the required constraints. Only the first sample of the control sequence is applied, and subsequently the horizon is shifted. By this receding horizon approach, a feedback policy is actually defined. In order to set up the minimization problem in an MPC setting, we recast (16) in vector form as where i = e, f . The problem in (18) is recast sequentially, where we first give priority to the power smoothing and then we consider the resulting optimal value as a further constraint for the load tracking optimization problem. The first problem finds the minimal P avl variation which is admissible given the thresholdȳ of the grid operator and given all the variations in a previous time window. The corresponding optimal bounds for P avl to comply with the smoothing requirements ( (15) and (16)) are used in the second stage for load tracking so as to constrain P avl . The two steps are detailed in what follows.

1) Output Power Smoothing:
The power smoothing problem is subject to constraints in (18).
2) Load tracking: The problem of satisfying the user reference demand is addressed by taking the optimal value J * s of the output power smoothing problem as a constraint for the load tracking one: subject to constraints in (18),

IV. CASE STUDY
The proposed control strategy taking into account for the discrete devices operational states, their corresponding MLD constraints, and the system continuous dynamics has been implemented using MATLAB/YALMIP/GUROBI. Data and constraint limits of the different components are taken from the HAEOLUS plant and, for those not defined yet, data from the literature have been adopted and reported in TABLE I. The considered devices stack replacement costs are as 2/3 of the 40% of Capex i , i.e., where the Capex i used in simulations is reported in Table I.

V. SIMULATIONS AND NUMERICAL RESULTS
In order to present the effectiveness of the proposed control algorithm, three different wind profiles with frequent fluctuations (Fig. 3) have been considered. The tuning of the load tracking cost function weights should aim at a soft tracking of the output variables towards the given references and an efficient use of the stored energy. More specifically, if there exists a big difference between the demanded energy and the energy available in the system, the controller operates the ESS in order to track the demand and minimize operating costs. The effectiveness of the approach is summarized in the Fig. 3 and Fig. 4, where it can be clearly observed that the power P avl is properly filtered when tracking the reference demand provided by the grid operator in all the three fluctuating wind profiles. Particularly, Fig. 3 shows the three wind powers P w , and a grid operator reference P ref . It can be seen that the wind powers and the reference demand are mismatched frequently over the 24 hours simulation. The system response is reported in Fig. 4. In Fig. 4(a) it is possible to see that the controller is able to track the reference smoothly in all the three scenarios. Both surplus and deficit power are considered, with a power flow towards or from the storage. The surplus power is indeed shunted to the electrolyzer for the production of hydrogen according to the current level of hydrogen and the storage physical constraints. Fig. 4(b) shows the three corresponding hydrogen levels associated with each wind profile. As expected, they always satisfy the storage constraints and keep the hydrogen  level between H min and H max . During the hours when the demand is higher than the wind power production, the fuel cell provides back up power for re-electrification, switching from OFF to ON states. The opposite, instead, happens to the electrolyzer since there is not enough power to be stored. The ON, OFF and STB switching are scheduled in the optimal way designed by the control algorithm.

VI. CONCLUSIONS
In this paper we presented a modeling and control approach for the energy management of a wind farm equipped with a hydrogen-based energy storage system. The adoption of an energy storage system allows to cope with the uncertainty of the wind generation and provides additional service to the grid, such as smooth power balance. The system components have been modeled including their inherent logic behavior. A detailed modeling of the relevant constraints has been carried out. Furthermore, the cold and warm starts of the electrolyzer and the fuel cell have been considered together with their cycle and stand-by costs. A two-objective optimization MPC has been set able to guarantee smooth power profiles delivered to the grid, reduced operating cost and components life saving. The two-objective optimization problem has been solved via a sequential optimization problem with priority first on the smoothing power production and then on the cost saving operation.
The work has been developed within the EU2020 funded project HAEOLUS, where the proposed control approach will be implemented on a real wind farm under construction in north Norway. The control algorithm has been validated via simulations whose data are based on such plant and complemented, for those not yet defined, with realistic data from the literature. Future work will integrate the proposed results into a multi timescale stack power regulation market.