Hybrid Energy Network Management: Simulation and Optimisation of Large Scale PV Coupled with Hydrogen Generation

: The power production of electrical Renewable Energy Sources (RES), mainly PV and wind energy, is affected by their primary source of energy: solar radiation value or wind strength. Electrical networks with a large share of these sources must manage temporal imbalances of supply and demand. Hybrid Energy Networks (HEN) can mitigate the effects of this unbalancing by providing a connection between the electricity grid and and other energy vectors such as heat, gas or hydrogen. These couplings can activate synergies among networks that, all together, increase the share of renewable sources helping a decarbonisation of the energy sector. As the energy system becomes more and more complex, the need for simulation and optimisation tools increases. Mathematical optimisation can be used to look for a management strategy maximising a speciﬁc target, for instance economical, i.e. the minimum management cost, or environmental as the best exploitation or RES. The present work presents a Mixed Integer Linear Programming (MILP) optimisation procedure that looks for the minimum running cost of a system made up by a large-scale PV plant where hydrogen production, storage and conversion to electricity is present. In addition, a connection to a natural gas grid where hydrogen can be sold is considered. Different running strategies are studied and analysed as functions of electricity prices and other forms of electrical energy exploitation.


Introduction
A power plant is a system that converts one primary source of energy to another form: for instance, in a gas-fired power station, methane is converted to electricity. In a different way, Hybrid Energy Networks (HEN) are characterised by the possibility of creating different power conversion paths. For instance, in a cogeneration plant, natural gas can be converted into heat and electricity at the same time. This feature allows a greater exploitation of the primary fuel with respect to a separate production of heat and electricity. On one hand, this plant is more efficient, while, on the other hand, its management is more complex as its power production must meet dynamically different external parameters such as heating demand or price of electricity sold to the grid.
Another difference that makes the management of HEN more elaborate is the possibility of using energy storage components. Storage can be more economical and efficient when adopted in one energy vector than in another: for instance a thermal energy storage can be less flexible but cheaper than the storage of electrical energy in an electrochemical battery storage. computational performance of the implementation, some operational optimisations on a test case study, whose data are derived from literature, are performed. These results show the potential advantages of the approach which can be used to assess different scenarios.

Description of the Hybrid Energy System
The Hybrid Energy System (HES) analysed in this work is made up of two different energy vectors: electricity and hydrogen. The primary energy source of the plant is solar irradiation while its outputs are electricity and hydrogen: electrical power can be consumed locally or sold to the electrical network. On the other hand, hydrogen produced by renewable electrical energy can be either converted again into electricity or sold to a natural gas network. Both forms of energy can be stored: in hydrogen tanks and/or in Battery Energy Storage System (BESS) accumulating electrical energy. In Figure 1, a sketch of the system and of its power flows is presented.
In the following, a brief outline of the methodology used and of the equations describing the working of modules are given.

Modelling of the HES
The modelling of the system is made on the basis of energy flow balance in time intervals over a time horizon defining the plant scheduling and management. The proposed simulation takes in input the power production and economical data, the characteristics of the power conversion modules and their interactions and as results it computes a strategy that minimises a target function by using output power levels as degrees of freedom of the system.
Basically, the workflow of the optimisation procedure is subdivided into three main sections: 1.
Definition of a scheduling interval and its discretisation. The number of intervals of equal length ∆t is N int , for instance a one day scheduling period can be divided either into 24 intervals of 1 h or in 96 intervals of 15 min. Time profiles of the energy production such as production of the PV plant and demand of the local energy load, together with the time profiles of the energy prices, are considered to be known data. This phase is carried out by reading different files containing the time series of data, either obtained by environmental conditions (solar irradiation) or by market prices (purchasing and selling of electrical energy). As the approach proposed is more oriented toward energy flows, every power variable in the system is modelled as constant in each time interval. Transient phenomena, related for instance to power-electronics converters connecting PV output in DC and electrical grid in AC, are neglected and, furthermore, HES is considered to be in steady-state in each time interval.

2.
Definition of technical and operational characteristics of the different sources as well as connections among them. Mathematically, these constraint equations are divided into two categories: -Balance equations represent the energy balance of each energy carrier in order to ensure feasible solutions where output is covered by production. -Constitutive equations represent the relations between the input and output power of a source, as well as its operational limits.
The first set of equation is linear by definition; its structure is in fact made up of an algebraic sum of energy values over a given time interval. Each energy vector is characterised by its own balance equation and a constraint equation is defined for every single time interval. The second set of equations does not have an a priori structure, as the input-output relation of one module could be in general a nonlinear function. In most application cases, these relations are linear or can be approximated by piece-wise linear relations.

3.
Computation of the target function to be optimised and evaluation of the scheduling strategy minimising/maximising it. As an example, if an economical target function is adopted, the sum over the time intervals of earnings obtained by selling the electrical energy to the grid has to be maximised. In this last case, the objective function is expressed as a linear form made by multiplying the energy sold to the grid in each interval by the unit selling price.
After the mathematical description of the HES is obtained, the optimisation of its target function can be attempted. This process can be approached in different ways, but, if model equations are linear, the most efficient way of looking for the optimal point is by using Linear Programming (LP) techniques. Unfortunately, the problem formulation is not fully linear because of the presence of piece-wise linear equations and/or by logical variables that must be used to describe the ON/OFF status of modules. In this case, the optimal scheduling can be found by means of a Mixed Integer Linear Programming (MILP) solver by using a standard branch and bound MILP solver [14]. A more detailed description of the procedure used can be found in [10] for the case of hybrid electric and thermal hybrid network.

PV Plant
The PV plant is modelled by means of its net power output in each time interval.
The power takes into account the efficiency of DC/AC converters and transformers. The energy produced is given as PV(t k )∆t and it is expressed in (MWh). The power produced is obtained by an atlas (e.g., [15]) and considering the PV modules technology and their fixed-mounting or single/double axis tracking.

Electrical Grid and Load
The plant is connected to the electrical grid with the possibility of selling and purchasing electrical energy. The main characteristics of the grid are the unit price values that change in time both during the day and throughout the year. These variations are expressed as a time series of the electrical prices. The unit selling price is given by: c s coefficients are obtained by market data and are expressed in (e/MWh). Electrical power can also be purchased by the grid at a unit price that is expressed by: where the constant term c grid takes into account the costs of electrical system charges, the fares for meter transport and management and excises and taxes which are added to the unit cost of electricity. Fixed costs of connections are not considered in the present work as they are independent from the plant management and they should be added afterwards.
Besides price values, the electrical connection is considered to have a maximum rated power P max grid related to connecting lines and transformers capacities that cannot be exceeded. The power level exchanged with the grid is one of the degrees of freedom of the plant management as power produced by PV plant can either be sold to the grid or, as shown below, stored in batteries or converted to hydrogen. In each time interval, the power exchanged with the grid is given by two variables, P s (t k ) and P p (t k ), the sold and purchased power values expressed in (MW), respectively. The two variables are mutually exclusive as the plant cannot sell and purchase power at the same time. This constraint is taken into account by two logical variables that can take 0 or 1 values in each interval. The constraint equation is given by: which ensures that the plant in each t k can be either selling power (δ s (t k ) = 1) or purchasing it (δ p (t k ) = 1), or neither of the two. The presence of the logical variables in the problem formulation forces to use the MILP formulation for optimisation. Another characteristic of the proposed formulation is the possibility to constrain the power exchanged with the electrical grid to follow a given profile in time. This need comes from the requirements of dispatching that can ask the plant to follow a schedule different from the production level of PV. The possibility of storing PV production in either BESS or hydrogen gives the plant more flexibility [16]. The modelling of this dispatch condition is, in the present formulation, managed by setting a logical variable δ disp (t k ) at the 1 value in the time intervals when P s (t k ) or P p (t k ) must be equal to a set value P disp grid (t k ). Local electrical users can be present, and they are supposed to be known and defined for each time interval as:

Electrolyser
Water electrolysis is a viable technology to store electrical energy by converting it into hydrogen [17]. For what concerns the hydrogen production and avoiding details about the technology, the equation that describes water electrolysis is: where q el (t k ) is the hydrogen mass flow in the kth interval, expressed in kg/h; η el is the efficiency of the electrolyser which is considered constant and depending on the technology; K el is the operative constant that converts a unit electrical energy in input to the resulting hydrogen mass, for instance K el = 21.25 kg/MWh, (@273 K, 1 bar); and P el (t k ) is the electrical power in input to the electrolyser in the kth interval and it is considered as the independent variable of the component. By stoichiometry, the water mass needed to obtain a hydrogen unit mass in kg is given by: Following the approach proposed in [8], the operative cost for running the electrolyser is computed on a depreciation approach. To this cost a maintenance cost is added. the equation used is: where C el i = c el i · P el max , expressed in e, is the electrolyser investment cost and c el i , in e/kW, is its unit cost; L el , expressed in h, is the service life; and c el m , expressed in e/h, is the hourly operation and maintenance (O&M) cost.

Fuel Cell
Fuel cell is the power module that converts hydrogen in electrical power [18]. As for the electrolyser, its operating equation is given by: where P f c (t k ) is the electrical power in input to the fuel cell and it is its control variable; q f c (t k ) is the hydrogen mass flow in the kth interval, expressed in kg/h, in input to the fuel cell; η FC is the efficiency of the fuel cell that is considered constant and depending on the technology; and H i is its operating constant, for instance H i = 0.033, expressed in MWh/kg, (@273 K, 1 bar). Again, as for electrolyser, economic costs are evaluated on a depreciation basis: where C f c i = c f c i · P f c max , in e, is the investment cost and c f c i , in e/kW, is the unit power cost; L f c , h, is the service life; and c f c m , in e/h

Hydrogen Tank
The mass of hydrogen coming from water electrolysis can be stored in a tank to be used, at a later time, by fuel cell. The quantity of hydrogen mass stored in the tank is ruled by a dynamic equation as its rate of variation depends on the mass flow in input/output respectively from electrolyser/fuel cell. It is in fact given by: where q in tank (t k ), in kg/h is the hydrogen mass flow in input to the tank, while q out tank (t k ) is the outgoing flow; and M tank (t k ) is the quantity of stored hydrogen, expressed as a percentage of the maximum mass that the tank can contain M max tank in kg. As in previous cases, economic costs are computed on a depreciation basis: where C tank i = c tank i · M max tank , in e is the tank investment cost and c tank i in e/kg is the unit cost; L tank , in h is the service life; and c tank m , in e/h, is the hourly operation and maintenance (O&M) cost.

Natural Gas Grid
Hydrogen can be transported employing the same infrastructures already developed for natural gas as it can be blended up to a certain percentage, usually lower than 10 %, with natural gas [19]. In the present model, the hydrogen mass flow sold to the gas grid is expressed by q grid (t k ), in kg/h. The unit selling price of hydrogen, expressed in e/kg, is taken as a datum known from natural gas market. Once the unit price is defined, the decision variable q grid (t k ), expressed in kg/h, is used to describe hydrogen flow to the natural gas grid.

Battery Energy Storage System
Storage of electrical energy can be obtained by electrochemical batteries. This form of storage is alternative to hydrogen conversion. As in the case of hydrogen storage, the equation that models this phenomenon is dynamic as the rate of energy storage is equal to the battery power input/output. The BESS status is described by its State Of Charge (SOC) that can be expressed as a percentage of the maximum battery capacity. The equation describing the BESS is: where P bc (t k ), in MW is the electrical power flowing in (charging) the battery; P bd (t k ), in MW is the electrical power flowing out (discharging) the battery; η bc and η bd are the charging and discharging efficiency values; and E batt , in MWh, is the rated battery capacity. Again, the depreciation approach is used for the definition of the economic cost, while, in this case, maintenance costs are neglected [8]. The number of charge/discharge cycles is used to evaluate the service life of BESS.

MILP Optimisation Procedure
The mathematical model above defined can be used to describe the HES and to optimise it. The decision variables used in the problem are subdivided into real valued (Table 1) and integer (0/1) ones ( Table 2). The total number of variables for each time interval is thus nine real variables and nine integer ones.

Electrical Balance
In every time interval, the balance of electrical power must be enforced, that is: Besides balance equation, limits on power values must also be constrained: in addition, physical constraints on some variables must also be defined to avoid conflicts between power flows, as previously explained in (4): Initial and final conditions of storage units can be specified, for instance imposing that start and end status of storage would be equal:

Hydrogen Balance
In addition, the hydrogen balance must be imposed in each time interval. By considering as positive the hydrogen generated, the equation is: As in the previous case, for hydrogen constraints on maximum values of flows, contemporary in and out flows and initial and final status of storage must also be enforced, so that:

Objective Function
The aim of the procedure is to find out the better exploitation for the electrical power produced by PV considering all alternatives regarding storage. The objective function is in this case economical: all earning and costs during the scheduling period are considered, so that the problem is formulated by: The objective function must be minimised taking into account all constraints presented in the previous sections.
By considering the list of variables presented in Tables 1 and 2, the problem has a dimension that is 18 * N int ; for example, for a week period scheduling discretised on the hour basis N int = 168, the problem has to handle 1512 real valued variables and 1512 integer valued ones.

Case Studies
The proposed optimisation formulation was implemented in a Python procedure [20], using the package PuLP [21] for the solution of the MILP problem. The simulation was implemented with a modular architecture so that components can be added or removed from the system, testing different plant configurations. In this way, several arrangements were run with the aim of checking procedure functionality and accuracy. These case studies were inspired by a real test case situated in the central part of Italy where there is the possibility of building a large-scale PV plant on poor quality agricultural land in a region easily accessed by electrical, natural gas and water infrastructures. Irradiation data on this location were then used to draw a PV and hydrogen plant. The V plant was designed on state-of-the-art panels coupled with hydrogen handling components defined on the basis of literature data, mainly the ones found in [8]. The performance of the plant were evaluated on different time horizons, as described below. For the sake of simplicity and graphical clarity, one day scheduling period on the hour basis was used in all the presented cases. The day used for display was sampled in April as, from analysis of different seasonal data, it is the one where energy storage is more often used.

Computational Cost
The computational cost of the procedure was tested to verify its applicability to real world cases. The procedure was run on a computer with 2.5 GHz Dual-Core Intel Core i7 running different problems changing the dimension in terms of number of variables. CPU times were recorded and are reported in Table 3. The CPU times are also shown in semi-logarithmic scale in Figure 2. This representation highlights the exponential nature of the computational cost of the procedure [22]. Despite this exponential cost, it must be remarked that the problem has a weak coupling between time intervals as only storage devices are characterised by dynamic equations, e.g., (11) and (13). Following the experience gained with other scheduling optimisation processes, the most interesting analysis period is usually one day or one week. Thus, in absolute terms, the computational costs for operational cases, i.e., 24 or 168 h for one day or one week, respectively, at the hour base, are well matched with the use of the procedure within an operational optimisation of the system.

Case 1: Connection with Natural Gas Grid
In this case, the interactions between the HES and natural gas grid are considered and thus only the electrolyser is working in the system while hydrogen tank and fuel cell are removed. The aim of this study is to find out the selling price of hydrogen to the natural gas grid that makes the hydrogen generation competitive versus the selling of the PV production to the electrical grid. A schematic outline of the HES is shown in Figure 3.
The following data are considered for the plant: -PV plant: PV rate = 120 MW (34) -Electrical network: The unit price of electricity is defined on the basis of market data and one day series is reported in Figure 4. -Electrolyser: P el max = 20 MW (36) It is considered that hydrogen is produced at the pressure of 30 bar, which is suitable for natural gas grid output and for short term storage. -Natural gas grid: q max grid = 1000 kg/h The hydrogen selling price is set as fixed externally.  Hydrogen selling price is used as a parameter varying within 2-5 e/kg. The results obtained by the optimiser in one sample day in April, at the selling hydrogen price of 4.2 e/kg, are shown in Figures 5 and 6. It is possible to see how the competition between the electricity and natural gas prices makes more convenient to produce hydrogen in low electrical price hours. In particular, the solution found exploits 1 h during the very early morning and the interval between 11 and 19, when the electricity price is constrained to be low by a large offer of PV renewable energy available on the electrical market.
From the parametric analysis, it is possible to find the hydrogen selling price for which, during the day, it is competitive to produce hydrogen. By considering a 24-h scheduling period and by varying the hydrogen price, the quantity of hydrogen energy produced and sold to the natural gas grid is shown in Figure 7 and numerical values are reported in Table 4. It can be seen that the breakeven price, defined as the gas price at which, with the present situation of electrical market price, the production of hydrogen starts to be competitive, is found at about 3 e/kg. This is due to a low price of electrical energy during the central hours of the day, as can it be seen in Figure 4.

Case 2: Hydrogen Storage and Fuel Cell Generation
The production of electrical power by the fuel cell requires a double stage of power conversion: from electrical to hydrogen and back from hydrogen to electrical. This process is obviously largely inefficient due to the sum of the losses in both energy conversion processes. Under these hypothesis and considering the current values of energy prices, the production of electrical energy by the fuel cell is not competitive. To test the procedure, an academic test case was devised which requires the triggering of the fuel cell, thus validating the correctness of the whole simulation.
The electrolyser, tank and grid data are the same as used in Case 1. The fuel cell has the following data: In this case, the hydrogen tank has a maximum capacity of M max tank = 350 kg leading to a maximum value of stored energy equal to 11.55 MWh, which is sufficient for a short-term storage even if it cannot provide long self-sufficiency periods of the plant. This test is made by a specific arrangement: it is considered that a local electrical load, constant in time, and with a power U e = 1 MW, is connected to the plant. This load is supplied during the day by the electrical power produced by PV while during the night it can be provided either by the power purchased by the electrical grid or by the fuel cell. When the cost of purchasing electrical power during the night overcomes a certain threshold, it is more convenient for the system to accumulate hydrogen during the day and use it in the night by running the fuel cell. To simplify the analysis, a flat cost of electrical energy is used; this assumption again does not correspond to the actual situation of prices, but it is used here for testing purposes.
By changing parametrically the price of electricity, the procedure finds it more convenient to run the fuel cell for a value larger than 200 e/MWh. As displayed in Figure 8, the hydrogen tank is filled up during the day by means of the PV energy. During evening and night, the fuel cell is running until the hydrogen tank is emptied so that, in this particular case, the load is supplied for 5 h, as shown in Figure 9. As the capacity of the tank is limited, the procedure finds during the day the hours when it is less convenient selling electrical power to the grid and stores it instead in the hydrogen tank.
Besides the testing of the procedure, the breakeven price value of 200 e/MWh gives a term of comparison with the present price situation with respect to the one when the local use of hydrogen is becoming economically suited.

Case 3: Dispatching Constraint
Non-predictable renewable energy has an impact on power delivery scheduling and can overload the transmission system [23,24]. In this respect, energy storage of PV electricity in hydrogen and its subsequent conversion in electrical energy can help ancillary electrical grid systems.
This aspect is modelled in the scheduling procedure by activating a constraint that affects the value of power exchanged by the system with the electrical grid. If HES is licensed as a controllable power generation unit, it is characterised by a power band which can be increased or reduced so that the power exchanged with the electrical grid exactly match a time profile. This service is remunerated by the Transmission System Operator by means of a power band price defined in the regulation markets.
The procedure is tested in this case by simulating two days of scheduling with two dispatch requests. On the first day, an increase in power output for 1 h, at 11 a.m., is required: 75 MW is asked while the PV production is forecasted at 70 MW. On the second day, a reduction of power output is imposed: power sold to the grid is reduced from 70 MW of forecasted PV to 65 MW, again for a period of 1 h. The procedure is able to find an optimal solution by adding the fuel cell output to the PV production in the first case while storing the excess power in hydrogen in the second. The solution of the MILP formulation assures that a feasible solution fulfilling the limits imposed by storage capacity can be found. A hourly diagram of the quantities involved is shown in Figure (10).
This means that there is either sufficient energy stored, or capacity to store it, to meet the dispatch constraint, otherwise the optimisation run exits with an unfeasible status. In addition, the scheduling is optimal in the sense that, besides fulfilling the power output required, the minimum operating cost is sought as required by problem definition in Equation (33).

Discussion and Further Developments
The proposed MILP-based procedure was applied to several cases of operational optimisation of a HES with PV generation and hydrogen conversion facilities. The procedure enabled the definition of minimum operational costs which can be used both for the evaluation of several economic indicators in the planning phase of HES and/or for runtime scheduling of existing plants.
The procedure can in fact be applied, for instance, to the evaluation of key performance indices (for instance the Levelised Cost Of Energy produced by the plant) assuring the minimisation of its operational costs under the dynamic price variation and fulfilment of all technical constraints. Parametric studies can be performed by changing the parameters of the system, both technical and economical, in order to find their best arrangement in a planning phase of the HES or to find its operational scheduling on an existing system.
Further developments of the procedure are related to the addition of more criteria for optimisation, allowing the introduction of complex storage models, for instance taking into account battery ageing, and of environmental quantities such as the saving of greenhouse gas emissions. In this case, the role of hydrogen in industrial or transport applications could be assessed. These new features would allow critically evaluating different scenarios where hydrogen requests from particular applications are inserted and/or further constraints are considered, for instance limitation on water availability in input to the electrolyser or additional costs on storage of hydrogen and its liquefaction process. Funding: This research received no external funding.

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