Techno-economic assessment of green ammonia production with different wind and solar potentials

This paper focuses on developing a fast-solving open-source model for dynamic power-to-X plant techno-economic analysis and analysing the method bias that occurs when using other state-of-the-art power-to-X cost calculation methods. The model is a least-cost optimisation of investments and operation-costs, taking as input techno-economic data, varying power profiles and hourly grid prices. The fuel analysed is ammonia synthesised from electrolytic hydrogen produced with electricity from photovoltaics, wind turbines or the grid. Various weather profiles and electrolyser technologies are compared. The calculated costs are compared with those derived using methods and assumptions prevailing in most literature. Optimisation results show that a semi-islanded set-up is the cheapest option and can reduce the costs up to 23% compared to off-grid systems but leads to e-fuels GHG emissions similar to fossil fuels with today’s electricity blend. For off-grid systems, estimating costs using solar or wind levelized cost of electricity and capacity factors to derive operating hours leads to costs overestimation up to 30%. The cheapest off-grid configuration reaches production costs of 842 e /t 𝑁𝐻 3 . For comparison, the "grey" ammonia price was 250 e /t 𝑁𝐻 3 in January 2021 and 1500 e /t 𝑁𝐻 3 in April 2022 (Western Europe). The optimal power mix is found to always include photovoltaic with 1-axis tracking and sometimes different types of onshore wind turbines at the same site. For systems fully grid connected, approximating a highly fluctuating electricity price by a yearly average and assuming a constant operation leads to a small cost ( < 4%) overestimation compared to the more advanced optimisation method applied here .


Introduction
The latest IPCC reports on climate consequences of increased emissions shows that urgent action is needed to reduce the anthropogenic greenhouse gas emissions to mitigate severe adverse climate effects [1]. Focusing on the transport sector, direct electrification powered by renewable energy is identified as the most efficient and cheapest alternative to replace fossil fuels [2,3]. However, electrification of long-range transport like aviation or shipping is severely challenged by the weight of batteries and limited autonomy [4]. On the other hand, the largescale development of biofuels raises concerns regarding the available sustainable biomass resources [5]. Thus, electro-fuels synthesised from renewable hydrogen produced through water electrolysis requiring less or no biomass (like e-ammonia) are also envisaged as substitutes. One barrier to electro-fuel development is the economic viability of its production. Therefore, in the last decade, many studies have been these studies do not model the electricity supply extensively and often assume a fixed electricity price and a steady plant operation [9][10][11][12]. This is a simplification of the conditions of real future green e-fuel plant, which will have to face either fluctuating electricity prices (''grid connected'') or fluctuating electricity availability (''off-grid'' operation, also called ''islanded'').

Sets and subsets
Some studies here called ''individual plant models with local energy system integration'' (ESI) have a greater focus on the electricity supply that is assumed variable and the dynamics of the system. Identified cost reduction potentials are generally related to increased plant flexibility, reduced electricity tariffs, and combining various renewable sources for the electricity [13][14][15][16][17][18]. Other fuel-plant modelling approaches using mixed integer linear programming or mixed integer non-linear programming optimisation have also been used [19][20][21][22][23]. However, whereas the increased complexity may improve the model realism, this usually comes with increased computational expenses, reducing the practicality and accessibility of the modelling tool.
In recent literature reviews focusing on e-fuels [24,25], the studies are explicitly compared in terms of their techno-economic assumptions. This is useful but the comparison does not include an analysis of the implications of the type of modelling method used. In this study, we have classified the different studies via the method applied and later elucidate the effects of the method for the cost prediction. Specifically, the focus is on comparing two generic types of methods identified above: ''individual plant models with local energy system integration'' and ''process modelling and economic analysis''. The question addressed in this paper is then: which system design and cost estimate can be expected with an advanced individual plant model with local energy system integration, and how does it compare with the results obtained from typical ''process modelling and economic analysis'' using fixed electricity prices, in calculating the fuel costs?
Taking e-ammonia as an example, the production process is modelled following the typical process modelling, including heat integration and comparing the process when using alkaline (AEC) or solid oxide (SOEC) electrolysers for hydrogen production. This process model is used directly to calculate the cost of the e-ammonia for a given electricity price and a given number of operating hours. The results will later be compared with the costs obtained with an ''ESI'' type of model that uses the same input data.
The ''ESI'' model developed in this analysis, combines the latest state-of-the-art modelling features of individual electrofuel plant models, including: • Extensive modelling of the renewable power supply, taking into account different wind turbines and photovoltaic (PV) technologies, hourly profiles, and weather profile types. In addition, the following features currently not, or only partially addressed in the literature, are here added to the ''ESI'' fuel plant model: • Multiple wind turbines and PV technologies are assumed available for every site, and each technology is associated with a specific cost and power profile (weather-dependent). The model invests in the turbines or mix of technologies leading to the lowest fuel production cost for each site. • The possibility to combine a renewable power supply (solar or wind) with grid power and optimise the use of each given the hourly electricity spot price. In the literature, most studies focus on off-grid renewable solutions [15,17,18,[26][27][28] or on-grid solutions [11,15,[29][30][31]. Fewer use semi-islanded solutions, but with a marginal grid usage (only the ammonia plant is grid powered) [16], no dynamic operation (constant inflexible ammonia production) [32] or using more complex models with a relatively high solving time [23].
These features are combined to determine the least-cost power-to-X (PtX) system design and assess the consequent fuel production cost for different power-supply configurations (effectively different plant locations) and with different assumptions on plant flexibility. Until now, all studies performing a PtX cost assessment use or develop only one single method to calculate the fuel production cost (or the levelised cost of fuel). In this study, two methods of cost calculations are tested with the same techno-economic assumptions and power profile. By doing so, it is possible to identify and quantify usual ''method bias'', which, to the best knowledge of the authors, has not been done before. To summarise, the novelty of this work is to gather in one study an extensive modelling of the power supply (including various wind turbines types, solar PV technologies with off-grid, on-grid and semiislanded set-ups in different locations), different electrolysis technologies (SOEC and AEC) integrated with the fuel plant, cost optimisation of investments, and dynamic operation. In addition, this work identifies and quantifies the methodological bias of some specific studies when calculating e-fuel costs.
By doing so, this study identifies cost-effective solutions to develop alternative fuels which are crucial to phase out fossil fuels and reduce global GHG emissions. Given the various types of technologies and weather type configurations used in this study, the conclusions can be used as a reference for other areas in the world with similar characteristics. Finally, in the literature, while comparing the result of different studies, the main differences are usually explained based on differences in the assumed input data and the method bias is disregarded. This study shows how the cost calculation method used can influence the results and where modellers should focus to avoid important method bias.
Section 2 discusses the relevant literature focusing on single plant power-to-X models. Section 3 describes the methods developed in this work, and Section 4 presents the input data used in the model. Results are presented in Section 5, which is divided in two parts, one presenting the results obtained with the model developed in this work (Section 5.1), the other one comparing it with the results obtained using other methods and assumptions (Sections 5.4, 5.2, 5.3). Section 6 summarises the main conclusions.

Literature review
This section presents a literature review on relevant studies focusing on single plant power-to-X models.

Review of state-of-the-art electro-fuel technologies
Given their potential to decarbonise the hard-to-abate sectors such as shipping or aviation, electrofuels are gaining more and more attention. A recent literature review [25] on electrofuels shows that a large variety of fuels have been studied with a large focus on e-methanol, e-methane and Fischer-Tropsch liquid fuels. In the latest years eammonia has been studied more extensively, notably because ammonia synthesis does not require carbon. This is a significant advantage given the limited availability of biogenic carbon sources [5] and the technical challenges of extracting carbon from the air at a reasonable cost [33]. For this reason, the authors of this study decided to focus on ammonia as a study case. The exact same method could however be applied to any of the other e-fuels and the methodological conclusions of this analysis remain valid for the other type of e-fuels.
The main component of a PtX plant is the electrolyser. In general three types of electrolysis are studied: solid oxide electrolysis (SOEC), alkaline electrolysis (AEC) and proton exchange membrane electrolysis (PEM). PEM-based electrolysis units have relatively good performance but are subject to high material supply risks, due to the use of very scarce elements like iridium and platinum, which may hinder its large-scale deployment [34]. For this reason, PEM electrolysis is not considered in this study. On the other hand, alkaline electrolysers (AEC) are characterised by long operational lives and use materials that are abundant, but are hampered by modest efficiencies. Solid oxide electrolysis units are the most efficient, but some materials currently used (yttrium) may pose challenges if deployed on a large scale [34]. However, this technology is still at a lower technology readiness level, so further developments and material changes can be expected. Therefore, both AEC and SOEC electrolysis types are included in this study. The dynamics of the PtX plants and flexibility assumptions of the different plant components are very different from one study to another. Some do not address the question of a flexible system and directly assume that the PtX operates steadily all year long [31]. This represents a ''best-case'' extreme and thus gives a lower bound cost estimate. Others consider the possibility to operate the electrolyser and the fuel plant flexibly with a given operating load range [16][17][18]. When the flexibility of the system is addressed, studies usually also include the modelling of an additional intermediate storage of hydrogen (typically in the form of hydrogen tanks or caverns [16]) or electricity (with batteries) [18]. In this study, an underground pressurised hydrogen pipe storage is considered as we believe this to be a more cost effective solution than hydrogen tanks for medium scale applications [35].
A summary of the system characteristics of recent PtX cost assessment studies can be found in Table 1. j Low FLH when using the PtX facility to store overproduced electricity. k Focus of this study is mostly on hydrogen but the possibility to produce hydrogen-based fuels is discussed. l Simulation-based model but electricity prices are calculated using Capex and Opex of the wind farm plus monthly grid electricity price. m FLH of the electrolyser with constant grid supply/electricity price-driven. n FLH of the electrolyser with wind-driven production and flexible/non-flexible fuel plant. o Without using formal optimisation methods. p But HB plant is powered with grid electricity.
q Different type of turbines are compared and the optimal ones are chosen for each site. r To avoid catalyst damaging. s But the FLH of solar PV supply is 2705 h/y.

Review of methods for modelling electro-fuel cost for single plants
The two primary types of approach to estimating the production costs of electrofuels for individual plants could be classified as ''process modelling and economic analysis'' (PM) [9][10][11][12]30,31,[36][37][38] and ''individual plant models with local energy system integration'' (ESI) [15][16][17][18]32,39]. The PM approach consists in modelling the plant process at a high level of detail and using it as a basis for economic analysis. Usually, these studies do not model the electricity supply extensively and often assume a fixed electricity price and a steady plant operation [9][10][11][12]. The electricity price used is usually the grid electricity price average for a specific year [11], a hypothetical power purchase agreement [30] or the levelised cost of electricity (LCOE) of the generating technology [37]. This would result again in a lower bound on the fuel cost as it does not factor in the effects of not having power full time, having to oversize the plant for a given production. It also neglects that in an energy system with significant amounts of PtX and a large share of renewable production, the cost of electricity will vary over time.
The ESI approach models the electricity supply with further details, considering a weather-dependent electricity profile and sometimes a variable cost for grid electricity. In this case, the fuel plant can usually operate flexibly by use of some intermediate storage (hydrogen buffer, batteries) or backup power [13][14][15][16][17]. From one study to another, the plant power supply is described at different levels of detail, going from a single source available to an optimised mix of different power supplies with variable availability and prices. In the latest studies of ESI type, the size of the plant, the power supply system and hourly operation are usually optimised together [18].
For both ESI and PM methods, the system sizing and operation can be either pre-determined or optimised, taking into account the economic and technical aspects. The optimisation can include the plant operation, the plant capacities (investments), or both. The type of optimisation used in the different studies is summarised in Table 1.
The electricity price is an important e-fuel cost driver [25] and the way it is calculated differs between studies. Three different calculation methods have been identified: • Fixed electricity price methods (FixEl_P) • Use of LCOE and fuel plant simulation with variable power supply (Sim_LCOE) • Using the Capex and Opex of the power supply system after optimising this (Syst_Opt) The principle of FixEl_P methods is, first, to estimate the electricity consumption of every plant component (usually obtained from process modelling) and later use this to calculate the annual electricity consumption of the fuel plant for a given number of operating hours at full load. Then, the annual electricity cost is calculated by multiplying the yearly electricity consumption by the average annual electricity cost (or sometimes LCOE) in e/MWh. The electricity cost is a part of the Opex of the fuel plant. The fuel cost is obtained by adding investment expenditure and other operation and maintenance costs. This method is mostly used in the process modelling type of analysis such as [10][11][12]30,31,36,37]. For systems that are fully grid-connected, this method has the problem that it disregards any effects of potential grid price variation on the plant's operation that could benefit from operating more flexibly and using intermediate storages.
To ensure that the fuel produced is renewable, this method also requires the ambitious assumption that ''green'' electricity can be bought through a power purchase agreement ensuring a fixed electricity price at all times like in [30]. For off-grid systems, using the LCOE of a single renewable technology as price input associated with a given capacity factor [37] also has some limitations. Indeed, the method cannot identify an optimal mix of different renewable power sources or how to benefit from intermediate storage systems. This method is also completely inadequate for the study of ''semi-islanded'' systems. The Sim_LCOE methods used by [15,17] put more focus on the variability of the power supply and the flexibility of the fuel plant. At first, the power supply and plant capacities are fixed. Then, given renewable power capacity, production profile, and fuel plant technical specifications (electrical consumption, minimal load), a simulation tool estimates the fuel plant's annual electricity consumption and the amount of fuel produced. The cost of electricity is obtained by multiplying its consumption by the levelised cost of electricity (LCOE) of the renewable power supply. The fuel cost is obtained by adding fuelplant investment expenditures and other operating and maintenance costs and dividing the sum by the total amount of fuel produced. [17] iterates the process with different sizing configurations to optimise the levelised cost of fuel production as a ''brute-force'' optimisation approach. The method is further improved in [26] using a genetic algorithm optimisation. However, finding an optimal design for semiislanded solutions that includes both local renewable power and some purchase from the grid spot market remains challenging with Sim_LCOE methods.
The Syst_Opt methods for example used by [16,18,21] do not use the LCOE or any averaged electricity price directly to calculate the electricity cost. Instead, the cost of electricity is obtained using the Capex and Opex of the renewable plant and the installed renewable capacities. The sizing of the renewable plant is usually done by minimising the fuel production cost for given fuel demand. This is a very sound approach for ''island'' operation where any back up by grid purchase is neglected. However, the possibility of using both local renewable power and some electricity from the grid with dynamic pricing is usually not addressed in the fast-solving models of this type. Studies that use more advanced modelling techniques, sometime consider this set-up as an option [23]. However, the high solving time of these techniques limits the number of possible system configurations and sensitivities that can be analysed in practice.
The model developed in this study aims, on one hand, to compensate for some of the shortcomings in the existing methods and, on the other hand, to be used as a reference to quantify the method bias that occurs when using fixed electricity prices for e-fuel costs calculation. To do so, the model is designed to be able to use the same input data set as for the fixed electricity price methods. The analysis method is also designed to be flexible and fast-solving in order to be usable with many different technologies, scenarios and sensitivity-analyses. This also facilitates the use of the tool by others to validate the results (see data and code availability). The model has similar features compared to models using fast-solving Syst_Opt methods (such as Osman et al. [18] or Armijo et al. [16]), but some notable improvements have been included such as the possibility to study optimal semi-islanded configurations with dynamic grid pricing while maintaining a reasonable solving time. The possibility to use an optimal mix of different wind turbine types in the same site is also included.
Using formal optimisation methods to design the model allows also to take into account dynamic grid pricing or variable electricity input associated with potential flexible plant operation, which cannot be done with methods that use a fixed electricity price. In addition, the method presented in this study facilitates the assessment of an optimal renewable power mix with multiple renewable sources and gives a precise assessment of the hours of operation that can be reached using 100% renewable sources and an optimised use of the storage systems. This method can be extended to the study of semi-islanded systems that include both local renewable power and a connection the grid with a dynamic electricity pricing. This gives an advantage over the Sim_LCOE methods currently challenged with designing optimal semi-islanded systems [26].
Finally, by restraining the ''freedom'' of the optimisation model in a specific way, it is possible to replicate the ''process modelling with fixed electricity price'' approach. By doing so, it is possible to compare the results obtained with a fixed price method and the results from the optimisation model using exactly the same data set. This gives the possibility to identify the systematic differences (''method bias'') between the two. Table 1 summarises the state-of-the-art review of the systems used in PtX analysis and classify the selected studies depending on the method used. The methods selected are characterised by their relatively low computational demand and their focus on individual PtX plant.

Methods
This section explores the model framework of the method developed in this study described as ''dynamic power supply and system optimisation'' DPS_Syst_Opt. This method will be used as a reference for the comparison with the other state-of-the-art methods.

Overview of the ''dynamic power supply and system optimisation'' model
The model is a linear programming model which minimises the costs of investments and operation of storage, power-supply and fuel production units. The system under study is a large-scale ammonia plant and its surrounding energy system, including power supply and byproduct markets. Three specific types of weather profiles are analysed. The fuel producer owns the fuel production system, including a desalination plant, storage systems (hydrogen storage and battery park), an electrolyser and an ammonia plant (Air Separation Unit and Haber-Bosch loop). The method presented could be used to analyse any fuel plant if the techno-economic data are available. Process side-products such as heat and oxygen can be sold at market price. The fuel producer pays the investment and operating costs of each owned facility. The system is constrained to produce 430 000 tonnes of ammonia per year, comparable to existing conventional large-scale ammonia plants [40], which is still much larger than all current renewable ammonia projects.
Two different ways to power the plant are considered: ''off-grid'' (also known as behind-the-meter) or ''semi-islanded'': a mix of local renewable production and grid supply. In the off-grid set-up, the fuel producer owns renewable power facilities and cannot purchase or sell electricity to the public grid. Excess electricity can be curtailed without extra costs. In the islanded set-up, the fuel producer owns renewable power facilities that are not connected to the grid and another connection allowing the purchase of electricity from the grid at the market spot price plus grid fees. The fuel plant is assumed to be a marginal player and does not influence the market prices. An overview of the studied cases is presented in Fig. 1, illustrating (i) weather profiles (plant location), (ii) how the plant is powered, and finally (iii) the process chosen for producing the hydrogen.
The method used to determine the optimal ammonia plant design and integration within the local energy system consists of three steps presented in Fig. 2.

Power supply model
The renewable power supply side is modelled with a high level of detail using a separate model to generate power time series and estimate technology costs based on data from the literature. Three types of representative weather profiles relevant to electro-fuel production are selected: • Profile 1, (solar+): very high solar capacity but low wind (northern Chile) • Profile 2, (wind+): very high wind capacity but low solar (Denmark) • Profile 3, (wind/solar): high wind and solar capacity (South Australia) One objective of this paper is to understand the dynamics of typical weather profiles, rather than identify optimal placements. Thus other locations with higher potentials, such as western Sahara (see [41]), may give better financial results but are not studied. Instead, the focus is on three areas with ''representative'' renewable potential and where data on electricity spot prices are publicly available. The precise plant location, assumed to be on the coastline, facilitate water accessibility and fuel bunkering. Some sites corresponding to these criteria and presented in Fig. 3 are Esbjerg in Denmark, Arica in Chile and Ceduna in Australia. As the study aims to compare different types of profile rather than performing an actual case study, possible practical limitations such as available space, regulations or existing infrastructure are not considered.
The renewable power devices considered are eight different onshore wind turbines, four different offshore wind turbines, fixed-axis PV, and single-axis tracking PV. Each power generating technology is characterised by its cost and the associated hourly power-generating profile specific to each selected location. DTU Wind's CorRES model [44] was used to determine the annual energy production of each wind turbine   from wind-farm power curves (found through computational fluid dynamics modelling using PyWake tool) and hourly MERRA-2 weather satellite data with reanalysis. The annual energy production of fixed and 1-axis tracking solar generating technologies is found using the open-source reanalysis model based on satellite data developed by [45] (renewable.ninja). However, as the authors of the model mentioned, the re-analysis data used (MERRA-2) tends to overestimate the solar potential. Especially outside Europe, there is also a lack of validation with specific site measured data. Therefore, the results obtained in this study are likely to underestimate the capacities of solar PV actually needed and under-size the plant infrastructures compared to a real life PtX project. The costs obtained in the result section must then be interpreted as a low cost boundary. Ideally, the optimisation model would use on-site (or near-site) measured PV production profile but this type of data is usually hard to obtain.

Fuel plant model
Ammonia synthesis plants are mainly based on the Haber-Bosch (HB) process, which utilises hydrogen and nitrogen produced by cryogenic air separation (ASU). Hydrogen is produced via an electrolysis reaction in a ''green'' ammonia synthesis plant. This study considers the alkaline (AEC) and solid oxide (SOEC) types of electrolyser. AEC is a mature technology with a long history of green hydrogen production with a lower Capex compared with SOEC. However, due to a high operating temperature, the SOEC has higher efficiency, and the reduced electricity consumption may be worth the investment. In addition, the high-temperature SOEC and Haber-Bosch process can be heat integrated. The process modelling of the two set-ups and the related costs are presented in Section 4.2. The cost and technical assumptions are valid for a large-scale ammonia plant (430 kt of ammonia produced per

Mathematical description of the optimisation model
The optimisation model is formulated as a linear problem to allow fast solving and the possibility to run multiple scenarios (around 500 for this study). Solving one scenario takes between 1 and 5 min using Gurobi solver with Julia/JuMP language on a desktop computer (Intel Core(TM) i5-8265U CPU 1.80 GHz and 8 GB RAM).
The decisions variables are the hourly output flows of mass or energy from the unit ''u'' , and the capacities of unit u invested (both positive variables) (see Table 2).
The objective function minimises the annualised fuel production cost.
Where , is the hourly price of the output from unit u at time t. and are the fixed and variable operation and maintenance costs of unit u.
* is the total investment expenditure of unit u multiplied by the annuity factor = (1+ ) (1+ ) −1 . d is the discount rate (always 8%) and n the technical lifetime of unit u. Some of the production units need to fulfil an annual demand . The units constrained to produce a given yearly amount of output (here only the ammonia plant) belong to the subset (constraint (2)): The different energy system units are constrained by their technical limitations for the minimal and maximal load (constraint (3)). To avoid a mixed integer linear or non-linear problem formulation and to keep reasonable calculation time, start and stop costs are not implemented. In this regard, it is assumed that all load-constrained units operate above their minimal load all year round. * The fuel production units can also have ramping constraints (constraint (4)), with a maximal ramping rate up and down .
The electricity produced by unit u equals the installed capacity multiplied to the normalised power profile , of the units ∈ at time t, being the subset of the renewable intermittent power units (constraint (5)): Then, power/heat balance must be respected (constraint (6)): power/ heat generation equal power/heat consumption / being the electric/heat consumption (if negative) or production (if positive) of unit u in kWh per output produced. To avoid non-linear or piece-wise problem formulation that usually imply the use of integer variables, the electrolyser efficiency is assumed non-load dependent thus omitting the better efficiencies at lower load and underestimating the performance of the system. This is however balanced by other approximations that overestimate the performance of the system such as no start and stop costs or no components lifetime reduction due to dynamic operation.
Similarly, the hydrogen production and consumption balance must be in balance (equilibrium constraint (7)). Hydrogen consumption or production (depending on the sign) H 2 is expressed in kg H 2 per output produced. Other chemicals used to produce hydrogen or synthesised using hydrogen respect the mass balance presented in constraint (8), where is the subset of units synthesising a product utilising a reactant from unit . The production rate is the quantity of product synthesised at unit u per kilogram of reactant.
Finally, the storage systems balance constraint (constraint (9)) is expressed as: where is the subset of units behaving like a tank (e.g., H 2 tank or batteries), is the subset of units used to charge a tank (e.g., compressor or charger) and is the subset of units used to discharge a tank (e.g., valve). and are respectively the charging and discharging efficiencies. At t = 0, the tanks are empty.

Wind power
In this study, multiple turbines designed for different wind speeds are available for each site. The eight onshore wind turbines comprise four rotors (with rotor diameters of 117 m, 126 m, 136 m, and 142 m) at two hub heights (100 m and 150 m). All onshore turbines have power capacities between 3.15 MW and 3.45 MW. Larger rotors and higher hub heights lead to higher capacity factors, albeit at a cost. The four offshore turbines have the same rotor, with a diameter of 164 m. What differentiates them is their power ratings (8 MW and 9.5 MW) and their hub heights (100 m and 150 m). The offshore turbine with the lowest power rating of 8 MW has a higher capacity factor, optimised for lower wind speeds. Windfarm Capex values were found using the national renewable energy laboratory wind-plant integrated system design & engineering model built on NASA's OpenMDAO software [47,48]. The results were then scaled to match the costs for onshore and offshore wind in the danish energy agency energy catalog [46]. Opex values for onshore and offshore turbines were taken from [46]. The levelised cost of electricity of each turbine is also indicated and calculated according to Eq. (10) using a discount rate d of 8%, and a technical lifetime of n. Techno-economic values used to model the different wind turbines, capacity factors and LCOE are summarised in Table A.11 in the supplementary material.
is the total of the energy produced by the powergenerating technology in one year in MWh

Solar PV
Both fixed-axis and single-axis PV were included as generation options. Renewables.ninja [45] was used to find the annual energy production of both fixed-axis and single-axis solar generating technologies. The optimal tilt angles for each location are taken from global solar atlas [43], and 90% inverter efficiency was assumed. Capex and Opex were taken from [46]. Costs, capacity factors, and LCOE for the included PV technologies can be seen in Table 3. LCOE is calculated using Eq. (10).

Grid electricity
When grid electricity is used, the electricity prices are taken from the same place and year (2019) as the weather profile to retain any potential correlation between electricity price and weather profile. Prices originate from coordinador eléctrico national (Arica, northern Chile, Solar site) [49], Nordpool (DK1, Denmark, Wind) [50], and the Australian energy market operator (Ceduna, South Australia, Solar/Wind) [51]. A description of the spot market electricity feature for each location can be seen in Fig. 5.
In South Australia, there are a few hours per year where the electricity price is either extremely high (9070 e/MWh) or low (−555 e/MWh). Most of the time, prices are also higher in South Australia than in northern Chile or Denmark, which themselves have relatively similar electricity price profiles.
Grid tariffs are added to the electricity spot price. The same grid tariffs are applied everywhere to limit the comparison to the electricity market price and weather profile. The tariffs are 16.65 e/MWh consisting of 10.74 for transmission, 5.37 for distribution, and 0.54 for taxes based on an analysis from the Danish transmission system operator Energinet adapted to electrolysis systems [52]. Like [15], the grid connection cost is set at 66 e/kW (see Table 4). Other types of grid pricing, such as dynamic tariffs and tariffs adapted to the local network features that may include the costs of potential grid reinforcement could also be investigated in further research.

Green ammonia synthesis plant description and layouts
Figs. 6 and 7 present the ammonia production process based on AEC and SOEC, respectively. Many other layouts leading to slightly higher or lower efficiencies but reduced investment could also be investigated. One of them increases the efficiency by 3% with a relatively limited Capex increase and is presented in Appendix C. The results obtained with this improved layout are still very similar to those obtained with the original layout of Fig. 7 and could be explored in further studies.    i It is assumed (optimistically) that the plant operator is able to put the electrolyser park on stand-by regularly. j Both electrolysers are assumed to operate very dynamically and follow the power variations in real-time [54]. k Based on [55] using reverse osmosis. More recent desalination techniques such as membrane distillation [56] or MED-TVC [57] could also be investigated in further research. l In the form of hydrogen compressed at 100 bars in buried steel pipes [35]. m 9% of cushion gas is needed in the underground pipes storage [35]. n 0.94 kWh/kg of compressed hydrogen from 20 to 100 bars. o 0.04 kWh of losses per kWh charged and 0.05 kWh losses per kWh discharged with a total round-trip efficiency of 91%, based on [58].

Table 6
Economic assumptions used in the optimisation model. The chemical engineering plant cost index was adopted to account for the inflation effect except for batteries where inflation is from [59].

Fuel plant techno-economic metrics
Techno-economical features of the ammonia synthesis plant and electrolysers obtained from the literature and the process simulation are summarised in Tables 5 and 6. Economic assumptions are relevant for a large-scale ammonia plant (430 kt/y). The supplementary material provides a detailed description of the process models, technology choices and economic assumptions in Appendix B. All assumptions are valid for present and near term future (2020-2025).

Results and discussion
This section is divided into two parts, one presenting and discussing the results obtained with our method ''DPS_Syst_Opt method'' for dynamic power supply and system optimisation (described in Section 5.1), the other comparing these results with those obtained using methods and assumptions commonly used in the literature in Sections 5.4, 5.2, and 5.3.

Least-cost ammonia production system using the DPS_Syst_Opt method
The results presented are based on wind, solar, and electricity price time series from 2019 and may differ using time series from other years. The plant operation and sizing are also made assuming perfect foresight meaning that the plant operates ''knowing'' the future power production and grid prices. 2 stage stochastic programming, myopic foresight or robust optimisation methods could be used to decide on investment decisions that consider weather and grid price uncertainties. Taking more robust investment decisions adapted to a large variety of possible events would likely oversize the infrastructures thus increasing the total costs compared to the method used in this study.
The sizing of the system is driven by an annual demand for ammonia of 430 kt.

Examples of optimal sizing and operation
As an example, Fig. 8 shows the yearly masses and energy balances and the optimal system sizing obtained for off-grid (also known as behind-the-meter) ammonia production in South Australia (wind/solar) using an alkaline electrolyser.  To produce 430 kt NH 3 per year (representing the yearly energy consumption of 2 of the world's largest containerships −18 000 TEUcruising at 23 kts [61]), the least-cost off-grid solution in South Australia (wind/solar), that has both good wind and solar resources, suggests that about 500 MW of onshore wind and 1.66 GW of PV power with a tracking system should be installed. This would require around 30 km 2 (2700 ha) of land (using space requirements from [46]) while the largest solar PV plant in the world (Bhadla solar park in India of 2.5 GW) occupies 5665 ha. In addition, a bit more than 1 GW of electrolysers would be required. Only 600 MW are installed globally in 2021 but several 1 GW alkaline electrolysers are planned in the coming years [62]. Then, 100 MWh of batteries are used. In comparison, the world's largest battery park in 2017 has a 129 MWh capacity (Tesla/Neoen hornsdale power reserve [63]). Finally, 140 tonnes of pressurised hydrogen underground pipes need to be installed requiring to excavate 0.1 km 2 so 10 ha of land [35]. These comparisons give an idea of the (challenging) sizes required to reach the same yearly production as standard fossil ammonia plants.
Two examples of optimal plant operation on an hourly basis are presented in Fig. 9. With a semi-islanded power supply in northern Chile presented on the left of Fig. 9, the plant's operation depends on the electricity price assumptions and the renewable power availability. The storage systems needed are reduced to a small hydrogen buffer (8 tonnes) without batteries. During the day, the fuel plant and electrolyser operate at full load using solar power to maximise the amount of ammonia delivered at a low cost and fill up the hydrogen storage. Some electricity has to be curtailed around midday when the power production is at its maximum. During the night, the fuel plant and electrolyser operate at a lower load to limit the grid-related expenses and use some of the hydrogen stored. If the electricity price goes low enough during the night, the plant operates again at a higher load taking advantage of low electricity prices. In the off-grid power supply set up in South Australia (wind/solar), presented on the right of Fig. 9, renewable power production is much higher during the day than in the semi-islanded case. This is done (a) to produce enough ammonia during the day to compensate for the lower production at night and respect the yearly ammonia demand; and (b) to fill up the hydrogen storage system during the day to use it at night. The complementarity between wind and solar power can be observed, the solar tracking system providing most of the electricity during the day and the onshore turbines during the night. Similar optimal off-grid operational behaviour has been observed by [16], which also stresses the beneficial effects of combining wind and solar power (with a tracking system) to increase the total capacity factor. Fig. 10 and Table 7 present the optimal sizing of the plant in the other sites for different system configurations.

Optimal sizing and operation in other configurations
As seen in Fig. 10, offshore wind turbines are not invested in any of the cases because their ratio cost/capacity factor is less favourable than the solar and onshore wind power supply. Due to limited land availability and local resistance, offshore turbines may however still be deployed in some locations. Solar PV with 1-axis tracking is always preferred to fixed support solar PV. Even if the tracking system is more expensive, the total system cost decreases thanks to the higher capacity factor, limiting the need for intermediate storage systems and infrastructure oversizing. Other studies like [26] consider fixed-axis solar PV technology, which would tend to either reduce the share of solar PV in optimal solutions or overestimate the fuel-production costs compared to a solution using 1-axis tracking systems. Due to the relatively high storage cost, running the fuel plant at full load is not economically viable in the off-grid configuration. Operating the plant flexibly and oversizing the infrastructure is preferable to deliver the yearly ammonia demand. This effect has also been identified by [16,18,26], which confirms the validity of the results obtained. Fig. 10 shows that, in the off-grid case, at sites where both wind and solar resources are available (wind/solar in South Australia), investments in both solar and wind power capacities are the least-cost option. Thanks to the complementarity between wind and solar profiles, smaller plant capacities and less intermediate storage are needed. Batteries are still used to power the ammonia plant at a minimal load when no renewable electricity is produced. The site with limited solar potential (wind+ in Denmark) still uses solar PV with a tracking system due to its low cost and complementarity with the wind power profile. Similar investment behaviour is also observed in [16] except that firm-up electricity from the grid is used instead of batteries. When the wind potential is high enough (in Denmark (wind+) and South Australia (wind/solar)), the onshore turbine SP198-HH100 is always implemented, as it provides the best balance between cost and capacity factor among the proposed turbines. Studies focusing on wind-based Fig. 9. Example of optimised hourly system operation. Normalised H 2 storage level (or electricity price) trend is obtained dividing the hourly quantity of hydrogen in the storage (or hourly electricity price) by the highest capacity stored over the year (or highest electricity price) and then multiplying by a factor large enough to see the trend appearing on the figure.  e-fuel production usually consider one specific type of turbine per site like [16]. Here, in Denmark (wind+), investing in two turbines with different hub-heights adapted for different wind speeds (Onshore SP198-HH100 and SP198-HH150) leads to the lowest fuel production cost, which shows that using a mix of different types of wind turbine instead of one for a specific site should be considered in further studies. Results also show that the power supply technology providing the lowest fuel production cost is not always the one with the lowest LCOE. In some cases (i.e., in Denmark (wind+), off-grid), a turbine with higher LCOE but a high capacity factor (reported in Table A.11 in the supplementary materials) lowers the total system cost by limiting intermediate storage size and electrolyser oversizing. This example stresses that choosing a power technology with the lowest LCOE to estimate fuel costs has its limitations and can omit the potential gains of using technologies with a higher LCOE and a higher capacity factor. When a semi-islanded set-up is possible, the size of the storage system can be drastically reduced as seen in Table 7. Batteries and hydrogen storage are however still used in South Australia (wind/solar) to cope with peak electricity prices. Furthermore, a small hydrogen storage is used in northern Chile to avoid running the electrolyser at night when the electricity prices are too high. When the solar resource is sufficient as in Chile and Australia, the least-cost solution uses both Table 8 Full load hours and average load of the Haber-Bosch and electrolysis unit in the optimal set-up.  grid supply and local solar power production with 1 axis tracking as seen in Fig. 10. In Denmark, where electricity prices are relatively low, investing in wind turbines seems more expensive than using the grid alone. However, these results do not consider the possible extra costs due to grid reinforcement, and it is assumed that the infrastructure and power production capacity is already there (and paid), which may not be the case in reality. These results show that the most economical solution for a grid-connected power-to-X plant required to produce a given amount of fuel per year is overall to maximise its number of full load hours and reduce the capital invested. Therefore, assumptions made by some studies of PtX plant using mainly grid-surplus electricity as a power source such as [39] should be taken carefully. Table 8 shows that the ammonia plant has higher full load hours (FLH) compared to the electrolyser due to the limited flexibility assumed, which leads to the requirement for hydrogen storage. With a stable power supply, the least-cost solution tends to reduce the plant's capacities and operate at a high or full load most of the time as seen in Table 8. The plant is operated more flexibly in South Australia (wind/solar), where electricity prices vary with amplitude. Fig. 11 presents the shares of electricity production and consumption per type of units in the different configurations. The overall system efficiency is also indicated.

System efficiency
It can be seen on Fig. 11, that, in the off-grid set-up, some of the renewable electricity produced is curtailed, especially for SOECbased systems. The very high Capex of SOEC (2020 numbers) push the optimisation model to use batteries and high-capacity factor power supply such as wind power to a higher extent in order to increase the plant full load hours instead of oversizing the electrolyser. Typically, in the off-grid case, in Denmark (wind+) and South Australia (wind/solar) sites, more wind turbines are invested to increase the electrolyser load at night but the model also invest into large PV plants to cover the electricity demand during the day. In repeated occasions, when wind and solar produce simultaneously, some of the excess electricity is used to fill the batteries, but a significant share remains curtailed when the battery capacities is exceeded. Investing into larger battery capacities would be less profitable compared to curtailment. For this reason, even with the higher SOEC efficiency, the overall PtX efficiency is only improved by a few percent (up to 7%). Therefore, considering only the electrolyser and processes efficiencies without analysing economic rational system investments decisions and dynamic operation behaviours (similarly to [64]) may be misleading when comparing different electrolysis technologies, especially in an off-grid set-up. Similar dynamics explain the curtailment for AEC-based systems. If a grid connection is possible, storage and electrolyser oversizing are no longer an issue, and the system can fully benefit from the higher SOEC efficiency. Therefore, in the semi-islanded case, the overall system efficiency is higher, and the cost difference with AEC systems is reduced. For offgrid solutions, the overall efficiencies obtained and presented in Fig. 11 are in general slightly lower than those encountered in the literature, which lay between 50 and 55 for alkaline-based systems [17,27,33] and between 70%-75% for SOEC-based systems [11,33]. This is mostly because the method used here considers the least-cost plant design, which sometimes prefers a reduced overall efficiency (due to curtailment) to limit excessive oversizing and storage costs. When the electricity supply is constant, the overall efficiency or specific consumption is very close to that obtained in other studies (for alkaline system, 50% LHV efficiency in [32] or 10.43 kWh/kg NH 3 in [18], among other examples).
As the electrolyser is the primary electricity consumer, the effect of its efficiency on the overall ammonia production cost was studied in a sensitivity analysis available in the supplementary material (Appendix D.2). It was found that an increase of 1 kWh/kg H 2 in electricity consumption increases the production cost between 1.1 and 2.6 e/MWh, so around 1-1.5%.

Carbon emissions
As shown in Fig. 11, when the grid connection is used, more than 50% of the electricity consumed originates from the grid in the leastcost solution. Using the 2019 world average of the electricity carbon intensity of 472 gCO2e/kWh [65] and the grid electricity consumption levels indicated in Fig. 11, the emissions related to the grid electricity usage would be around 440 gCO2e/kWh NH 3 in the case with the lowest grid electricity share (northern Chile using SOEC). With cleaner electricity at 239 gCO2e/kWh (European Union levels in 2019 [65]), emissions related to the grid would be around 220 gCO2e/kWh NH 3 . As a comparison, the very low sulphur oil used in the maritime industry and the ammonia produced from natural gas emit around 325 and 510 gCO2e/kWh (Well-to-Wake) respectively [66]. This puts a question over the sustainability of fuels relying partially on grid electricity with today's mix. Indeed, according to Ref. [3], the electricity must be at least 90% from renewable origin to have a better climate footprint than the fossil counterpart (for e-petrol, e-diesel and e-kerosene). The quantification of GHG emissions could be further refined including the emissions from the grid in real time but also the life cycle emissions of the plant infrastructure. By excluding these aspects, the calculated e-fuels carbon footprint is likely to be underestimated. Fig. 12 presents the annualised fuel production cost depending on the location and electrolyser type and the system cost breakdown. In all cases, producing the fuel off-grid is more expensive than using a grid connection (semi-islanded) because the cost of the electrolyser and power supply is doubled due to oversizing. The additional storage systems slightly increase the costs. The cost of the desalination plant is negligible compared to the rest as observed by [16,67].

Production costs
The site with the highest solar potential has the lowest fuel production cost. In the off-grid case, the production cost reaches 163 e/MWh NH 3 (842 e/t NH 3 ) using an AEC electrolyser. Adding a connection to the grid reduces the production cost down to 147 e/MWh NH 3 (759 e/t NH 3 ). This result differs from that in [26], which found the cheapest locations were usually those with a high wind capacity factor. However, [26] did not consider the 1-axis tracking PV technology, which could explain the difference.
These values are relatively high compared to some of the values reported in the literature: 463 e/t NH 3 in [16], 416-664 e/t NH 3 in [18] or 431-528 e/t NH 3 in [6], mostly due to different costs assumptions for the infrastructure and different power profiles. However, the values of this study are more in line with those reported by Nayak et al. [17] and Pawar et al. [8], who reported around 670 and 723 e/t NH 3 , respectively.
At 2020 price levels, even if SOEC systems have a higher efficiency, the fuel plant relying on SOEC leads to ammonia production costs that are significantly higher, especially when the power supply fluctuates. A sensitivity analysis of SOEC Capex and Opex values can be found in the supplementary material in Figure D.20. This sensitivity is used to assess which cost reduction is needed to reach the cost level of AEC systems. In the off-grid configuration, the SOEC-based system can be cost-par with the current AEC system with a Capex reduction (including stack replacement cost), of around 50% (down to 1300-1600 e/kW) compared to today's level. For systems relying fully on grid electricity, only a 42% Capex reduction is needed (down to 2000 e/kW). This is considering an AEC consumption of 51.5 kWh/kg H 2 and a Capex of 1100 e/kW, including stack replacement. The efficiency considered for the SOEC heat integrated with the ammonia plant is 37.9 kWh/kg H 2 . A 50% SOEC cost reduction is in line with 2030 expectations.

Effect of plant flexibility assumptions
Among the Sim_LCOE and Syst_Opt types of method, the assumptions about plant and electrolyser flexibility can differ significantly from one study to another. As mentioned in [16], these assumptions can review, the most common minimal load used for AEC is 20% to avoid hydrogen cross-over [54]. b Motivated by [18], who stated that the Haber-Bosch loop should operate at a constant load to avoid catalyst damage and efficiency loss. c Assuming the possibility to put the electrolyser on stand-by regularly with negligible extra costs. d Some industries claim that reducing the minimal load to 10% is feasible [68]. significantly impact the results. To study that influence, one reference case is compared to various scenarios addressing the assumptions that are usually encountered in the literature regarding minimal loads and ramping rates. The different cases studied are presented in Table 9. To simplify the comparison, the focus was on the AEC-based system. The differences in terms of fuel production costs are presented in Fig. 13. In Fig. 13, it can be observed that, when the plant has access to the grid, the flexibility of the electrolyser and ammonia plant have a limited impact on the production cost. It does however have a noticeable, but small, influence when the electricity market price has a high variation amplitude with price peaks as in South Australia (wind/solar).
In the off-grid set-up, when production relies primarily on solar power, an electrolyser with a minimal load of 20% (AEC[20-100%]) increases the production cost up to 36.6% compared to the reference. This is mainly because very large and expensive battery capacities are needed to operate at minimal load, and the power supply needs to be oversized accordingly to fill the batteries. A non-flexible electrolyser in locations where the power supply is more regular (South Australia, wind/solar) limits the additional costs to ''only'' an 19.5% increase.
A non-flexible Haber-Bosch plant (HB[100%]) with a fully flexible electrolyser increases the cost by around 20% compared to the base case and by 25% with the wind/solar profile (in South Australia). The costs increase because running the ammonia plant at full load requires larger hydrogen storage and hence larger electrolyser and power supply capacities. On the other hand, additional HB plant flexibility (down to 10% instead of 40%) (HB[10-100%]) does not reduce the cost significantly.
Combining an electrolyser that is not fully flexible with a nonflexible ammonia plant as a ''worst-case scenario'' (AEC[20-100%] _HB[100%]) increases the production price by nearly 50% in sites where the power supply depends mostly on one source and 40% in the Australia (wind/solar) case.
Removing the ramping constraint of the HB plant (HB_NoRamping) gives results very similar to the base case. When considering time steps of one hour, the constraint is usually non-binding and could be removed to improve the computational time. The possibility that the constraint may have a stronger effect with a smaller time resolution could be investigated in further research.
To better understand the minimal load effect on the costs, multiple optimisation runs are made with different HB minimal load values and the costs obtained are displayed in Fig. 14. It can be observed that at 40% minimal load, the costs even out for all cases and for solar even earlier at 60%. Fig. 14 shows that in the off-grid case, the ammonia plant's flexibility has a key influence on production costs, especially for ammonia plant that have a minimal load above 60%. Armijo et al. [16] observed cost-flexibility curves with similar trends and stated that ''H 2 storage is the key cost driver related to the lack of flexibility''. To validate this observation, the cost breakdown of the optimal energy system was calculated for every ammonia plant's minimal load and can be found in Figure   hydrogen for both the fuel plant and the storage facility. Another interpretation of these results, not mentioned by [16], is that the HB plant's flexibility has a strong influence on the costs, but only down to a specific minimum load that depends on the type of power profile. For example, in northern Chile (solar+), which relies on relatively regular solar power, operating the plant below a 60% load does not significantly reduce the costs. With the production sites relying more on wind power (Denmark (wind) and South Australia (wind/solar)), which has a less regular profile pattern, operating at a lower load is more beneficial. However, below a 40% minimal load the cost reductions are also less significant. Indeed, when the system is sized to produce a given amount of fuel per year, the optimal operation is to run the ammonia plant with a high number of full load hours to make the best use of the available capacities and thus avoid excessive oversizing. Therefore, with an optimal operation and a fully flexible ammonia plant, the actual number of hours at which the ammonia plant would operate at low loads is very limited (167, 394, and 225 h below a 10% HB load in northern Chile, Denmark and South Australia (wind/solar) respectively), so a very flexible ammonia plant does not significantly improve the plant's economic performance. In addition, this study did not consider the extra plant costs of a chemical process designed to be more flexible. With the limited benefits of additional flexibility, these extra costs may actually make systems using a very flexible plant more expensive than ones with ''standard'' flexibility. This result is a rather positive outcome for the industry. Indeed, if the industrial research should still focus on designing flexible fuel plants for off-grid systems, the challenge is limited to the design of ''flexible enough'' plants that probably require a lower amount of technical innovations than fully flexible plants.
Summing up, the assumed flexibilities of plants are highly important for the fuel production costs of off-grid solutions and it is therefore key to consider these features when modelling e-fuel production off-grid or, in a lower extent, in systems with highly fluctuating electricity prices. However, a very flexible fuel plant able to operate below 40% load has a limited impact on economic performances thus further research on very flexible fuel plant processes may not so heavily be needed.

Effect of assumptions regarding by-product sales
Some studies, like [69], consider the sale of by-products such as heat and/or oxygen in their analysis. Using the model developed in this study, we study the influence of by-product selling price on ammonia cost estimates. Oxygen produced through electrolysis has a very high purity, making it suitable for any application, including medical use. It is assumed that 7.8 kg O 2 is recovered and sold per kg H 2 produced. The oxygen prices reported in the literature vary between 27 and 150 e/t O 2 [69,70]. Quantities of recoverable heat from AEC have been estimated at 7.07 MWh ℎ /t H 2 [71]. The heat has a relatively low temperature, still suitable for a local district-heating network. Lowtemperature district heating prices are reported between 23 and 52 e 2019 /MWh [69,72,73].
Cost estimate reductions that can be expected from the sale of heat and oxygen are presented in Fig. 15.
It is observed in Fig. 15 that selling oxygen and/or heat strongly influences the cost, which can be reduced down to 30%-40% if heat and oxygen sales are cumulated and selling prices are in the highest range. Oxygen sale represents the highest costs reduction potential which is between 5 and 29% if all the oxygen can be sold at the prices stated in the literature. Costs reduction related to heat sale are between 4 and 10%.
The possibility of selling excess renewable electricity was also studied. Here it is assumed that the renewable plant can be connected to the grid without extra cost and the surplus electricity sold at the market price instead of curtailing it. Results showed that it does not make a significant difference, as excess electricity is usually generated when the price of grid electricity is low. Hence, in the studied sites, the benefits from the electricity sale reduce the fuel costs by less than 1%.
In conclusion, selling by-products entails are large cost-decrease potential, which should be taken into account when modelling the e-fuel production plants and when deciding on locations.

Estimate of ammonia production costs using FixEl_P methods
The objective of this section is to identify and quantify the method bias that occurs when calculating the costs using the system optimisation method presented in this work (DPS_Syst_Opt) or a fixed electricity price method (FixedEl_P). Unfortunately, the simulation and LCOE methods (Sim_LCOE) cannot be directly compared with the DPS_Syst_Opt method (presented in Section 3), as the Sim_LCOE methods results are driven by the installed renewable capacity and not by the fuel demand.
The FixEl_P methods estimate the plant's annual electricity consumption for a given number of operating hours and calculate the electricity cost by multiplying it by a fixed electricity price. The fuel N. Campion et al. cost is obtained by adding fuel plant investment expenditure and other operational and maintenance costs. Two cases are differentiated: one where the PtX plant is powered exclusively by the grid (like [11,31] or [29]), the other where it is powered exclusively by variable renewable sources (like [30,36] or [37]). To make a methodological comparison possible, the FixedEl_P method is reproduced using exactly the same data-set as is used with the DPS_Syst_Opt presented in the previous sections. The electricity cost is calculated in the three locations presented in Section 4.1 with two different methods depending on whether the PtX plant is powered by the grid or by wind and solar PV.
If the PtX plant is powered exclusively by the grid, the electricity costs are calculated in terms of the yearly average of the hourly electricity prices presented in Section 4 (similarly to [11] or [31] 16. In the case where the PtX plant is powered by wind or solar power alone, the electricity price is determined using the lowest LCOE among the power supply technologies for each site using the data presented in Section 4.1. The size of the electrolyser and ammonia plant required to produce 430 kt NH 3 /y is determined by the number of operating hours at full load derived from the wind or solar capacity factor (as done by [36]). No storage system is considered.
The calculated LCOEs and full load hours are presented in Table 10. The investment and operating costs are derived from the plant sizing and added on top of the electricity cost to obtain the ammonia cost labelled ''MinLCOE_LowFLH'' in Fig. 16.
Other studies arbitrarily set the plant operating hours (for example, to 85% of yearly operation as a base case in [30] or 50% in [37]). In the method labelled ''MinLCOE_HighFLH'', the ammonia cost is calculated using a high FLH (7884 FLH) and the lowest LCOE of renewables for the electricity price. Fig. 16, shows the comparison between the results obtained with the DPS_Syst_Opt method and the other methods.
The ''off-grid'' case in Fig. 16 illustrates the method bias between the fixed electricity price and the DPS_Syst_Opt methods in an offgrid set-up. Results show that using the minimal LCOE available while assuming a high number of full load hours underestimates the fuel production cost by more than 50% compared to the DPS_Syst_Opt method. This method is not used as such in the literature, but studies assuming that renewable electricity can be available with high full load hours (for example, through the grid) at a cost close to PV or wind power LCOE like in [30] are likely to generate a similar methodological bias. This can be corrected by assuming a lower fuel plant full load hour calculated from the renewable power capacity factor (like in [36]). However, with this method, the estimated costs can be up to 30% over-estimated compared with the DPS_Syst_Opt method. Indeed, the MinLCOE_LowFLH method do not consider the possibility of optimally combining different power sources that complement each other, nor the use of intermediate storage systems which finally underestimate the plant full load hours that would remain economically feasible. The type of electrolyser used seems to have a limited influence on the percentage costs difference between the two methods.
The ''only-grid connected'' case in Fig. 16 illustrates the limited methodological bias between the averaged grid electricity price method (''FixedAvGrid'' for example used by [11]) and optimisation methods that consider optimal flexible plant operation (DPS_Syst_Opt method). Results show that, when the amplitude of electricity price variation is low, as in Denmark (wind+) or northern Chile (solar+), the calculated costs are very similar between the two methods with around 1% difference. Indeed, with the fixed electricity price method, the PtX plant runs at a constant load and is sized at the minimum to respect the annual demand. Given the relatively stable electricity prices, stable ammonia production is also favoured by the optimisation method, and the plant is run flexibly for only a few hours per year (which explains the remaining cost difference between the two methods). With a higher electricity price spread like in South Australia (wind/solar) (see Fig. 5), the average electricity price method calculates production costs up to 5% higher compared to the DPS_Syst_Opt method. This is because using a fixed average price and full load production omits the savings that could be made when operating the plant at a lower load or using an intermediate storage system when the electricity price is high. An electricity market price with high variation is specific to Australia, but it is also likely to occur in future energy systems with a high variable renewable energy penetration [41]. Thus, studies focusing on late future and using a grid supply should consider the grid-price variation for more accuracy.
Summing up, the method used has a high impact on the calculated fuel production costs, in particular when analysing off-grid solutions. It also has some impact, albeit less, when looking at grid connected solutions with high fluctuations in electricity prices.

Conclusion
This paper has focused on the modelling and quantification of the costs related to e-ammonia production using and comparing different methods of estimating e-fuel costs. E-ammonia is synthesised from electrolytic hydrogen produced using renewable power and/or electricity from the grid. Different electrolyser types, power connection set-ups and production sites are compared. Building upon typical models features from the previous literature, an optimisation model was developed and used to determine least-cost e-fuel plant designs and estimate the consequent fuel costs. Using the same input data, the e-ammonia cost was calculated using other methods often used in the literature (referred to as ''fixed electricity price methods'' in this analysis) and compared with the results obtained using the developed optimisation method. The key questions addressed in this study were: (1) which system design and cost estimate can be expected with an advanced individual plant model with local energy system integration, and (2) how does it compare with the results obtained from typical ''process modelling and economic analysis'' using fixed electricity prices, in calculating the fuel costs? Thus, this paper provides powerto-X plant design recommendations based on a fast solving optimisation model, and points to the bias that may occur while using other simpler methods to estimate e-fuel costs.
Results concerning the power-to-X plant design and costs show that, for off-grid e-fuel production systems, the optimal power mix always includes solar PV with one axis tracking even if the solar potential is limited (15% capacity factor). In some places, using different types of onshore turbines in the same site provides the cheapest option.
Notably, the technologies with the lowest LCOE were not always those minimising the overall system costs, as high capacity factors may be more important. The electrolyser park should be as flexible as possible to avoid prohibitive battery costs. A flexible ammonia plant gives significant fuel cost reduction down to a minimal load of ca. 40%. Below this, there is no further cost gain. Thus, designing fully flexible processes may not be a research objective so relevant for the industry. The overall power to ammonia efficiency lies between 47%-48% for AEC-based systems and 52%-54% for SOEC-based systems depending on the production site. The lowest off-grid ammonia production cost obtained was 163 e/MWh NH 3 (842 e/t NH 3 ) in northern Chile using an alkaline electrolyser powered with 1-axis tracking solar PV.
A mix of local renewable power production and a connection to the grid (semi-islanded set up) is the cheapest option to produce e-fuels when potential grid-reinforcement costs are not considered. Overall system efficiency is also increased compared to an off-grid system thanks to reduced curtailment and ranges between 50%-51% for AECbased systems and 63%-65% for SOEC-based systems. The production costs are reduced to 147 e/MWh NH 3 (760 e/t NH 3 ) in northern Chile using an alkaline electrolyser and an optimal mix of grid electricity and on-site solar power with one axis tracking. In comparison, in Western Europe, ''grey'' ammonia had a selling price of around 40 e/MWh (200 e/t NH 3 ) in 2019 and 290 e/MWh (1500 e/t NH 3 ) in 2022 [74]. Thus, if the fossil fuel prices remain globally at high levels, the e-fuels may become competitive even with limited governments support. The fuel cost would still remain four times higher compared to previous price levels which may be economically unsustainable in the long run. However, the electrolysis technology which today represents between 30 (Chile, AEC) and 66% (Chile, SOEC) of the total costs is still an ''immature'' technology and suggests a large cost reduction potential which could be achieved via mass production gains and technology improvements. Typically, the cost of e-ammonia could drop to 110 e/MWh (570 e/t NH 3 ) if SOEC becomes available at a cost of 460 e/kW as predicted in some studies [37]. In addition, in the semiislanded case, the size of the infrastructures and intermediate storage is significantly reduced, making that solution potentially more appealing from an industrial and technical point of view. However, in the leastcost solution, the grid provides more than 50% of the electricity. With the 2019 global grid carbon intensity levels (472 kgCO2/kWh), the e-ammonia carbon footprint would be similar to ''grey'' ammonia produced from natural gas.
Results on method bias identification and quantification show that, for systems that are fully grid-connected, with electricity prices fluctuating hourly, approximating the electricity cost by an average grid electricity price with a full load plant operation (FixEl_P methods) gives results very close (max 1% cost difference) to the optimisation method if the hourly grid price variation amplitude is limited. With larger variations in price amplitude, using an average electricity price disregards the potential savings due to flexible plant operation and slightly overestimates the production costs (but only up to 4% in the cases studied). Using power purchase agreements ensuring, for example, that the electricity is ''green'' should be addressed carefully. Assuming that ''green electricity'' is available at all times at a price similar to solar or wind LCOE will underestimate the cost of e-fuels significantly. For offgrid e-fuel production systems, estimating the production costs using the renewable technology LCOE and deriving the fuel-plant operating hours from the power capacity factors overestimates the costs by up to 30% compared to the optimisation method because potential costs savings due to the use of complementary power sources or intermediate storages are disregarded.
In the off-grid set up, assumptions made on the ammonia plant flexibility have a significant impact on the results. An ammonia plant with a minimal load of 40%-60% (depending on the weather profile) provides significant cost reductions. Nevertheless, ammonia plants that are more flexible, with minimal loads below these levels, reduce the system costs only marginally. If a grid connection is available, the flexibilities of the ammonia plant and electrolyser have a limited effect on the system costs (with 2019 electricity prices). The consideration of ammonia plant ramping constraints did not have a significant influence on the results. Assumptions on by-products sale, such as heat and oxygen, entails large cost-decrease potential (up to 40%), thus the possibility to sell these products should be looked at carefully by industrials before choosing a site for PtX production. Considering the sale of surplus electricity at the market price does not significantly reduce the cost estimates as the price will be low when there is a surplus.
Since this study has mostly focused on comparing fast-solving methods, further development could include the comparison with more complex methods that use integer or non-linear programming. The methods that handle weather profile uncertainty such as stochastic or robust optimisation could also be compared.
Finally, the results show that using both stable power supply like grid and local renewable power is the cheapest option, but runs the risk of having counterproductive effects on greenhouse gas emissions reduction as long as the electricity blend on the grid includes large fractions of fossil power. This leads to the conclusion that the grid usage for e-fuel production should be carefully controlled. In further studies, the pertinence of control mechanisms such as green certificates, power purchase agreements, forced off-grid solutions or carbon taxes could then be assessed in terms of costs, technical feasibility and life cycle assessment performances.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Data availability
The input data files and the code used for this study are freely available at Input data (Original data) (GitHub)