Optimizing Qatar’s energy system for a post-carbon future

Global decarbonization efforts, along with domestic pressures to diversify the economy, have created challenges and opportunities for the Qatari energy system. The government is focused on diversifying the national economy away from hydrocarbons, encouraging sustainable use of resources, and ensuring the security of food, energy, and water systems. Our optimization framework allows policymakers to apply a systems approach to the overall energy infrastructure in Qatar, covering a range of sectors such as industry, residential infrastructure, transportation, and agriculture. Our aims are two-fold: first, to develop an open-source tool that can be used for national-level planning and policymaking, and second to use this tool to generate key technology and policy insights that can aid the transition of Qatari energy infrastructure in the long term. Our results provide a blueprint for a cross-sectoral energy transformation: from greater use of low-carbon transport such as electric cars and public transit, to grid-scale adoption of solar energy and reverse osmosis for desalination. Liquefied natural gas is not expected to remain the most economical export, instead being replaced by hydrogen obtained from the steam reforming of natural gas. We have modeled a long-term domestic divestment from hydrocarbon exports and have shown that the country can still retain significant economic wealth in a post-carbon world, thus maintaining existing political, economic, and social structures.


Introduction
When the Japanese perfected the technique of producing cultured pearls in the late 1920s, the Qatari pearl diving industry faced a crisis that it has never recovered from. The production of oil from the 1940s onwards became the economic lifesaver for the country, and the commercial exploitation of natural gas beginning in the 1990s (with Japan as the first customer) cemented the financial prosperity of the country [1]. Although global demand for natural gas is growing as it plays an important role as a transition fuel in decarbonization strategies, Qatar cannot rely on its hydrocarbon industry indefinitely. As climate change mitigation efforts grow, the world will have to reduce its dependence on all hydrocarbon fuels. For example, Japan is on the path to replace natural gas with hydrogen for its electricity production [2]. Qatar's leadership recognizes that economic diversification is the key to continued prosperity, and long-term planning tools can provide the blueprint for a new economy that is less reliant on fossil fuel exports.
The reliance of Gulf States on fossil fuels has led to domestic challenges as well. Unsustainable energy and water use in the region, driven in part by energy subsidies, has contributed to environmental degradation: from increasing groundwater salinity [3] to urban air pollution [4]. Moreover, anthropogenic climate change will lead to severe environmental and social consequences in the Middle East [5]. It is in the interest of all countries in the region to mitigate the effects of these changes through long-term planning by deploying technologies and policies that can lead to sustainable resource use.
Optimization tools were first applied to economic planning and later extended to energy systems modeling [6]. Until now, there has been limited use of such tools in the Gulf States. Almansoori and Betancourt-Torcat modeled the electricity system in the UAE, using a stochastic approach to determine the effects of uncertain natural gas prices [7]. Established energy system models have also been used to study energy policies for Kuwait (using TIMES-VEDA) [8] and the UAE (using MARKAL) [9]. The Saudi case was modeled using a mixed-complementarity model that integrated the energy system into the wider economy [10].
Qatar's energy economy is unique in that it is tailored towards the export of processed hydrocarbons. The country's domestic resource consumption uses only a small fraction of the energy infrastructure. Our work is the first optimization approach applied to the Qatari energy system as a whole: across the largest sectors of the economy, and covering major energy products, from natural gas and hydrocarbon fuels to electricity and desalinated water. Our aims are two-fold: first, to develop an open-source tool that can be used for national-level planning and policymaking, and second to use this tool to generate key technology and policy insights that can aid the transition of Qatari energy infrastructure in the long term.

Materials and methods
Qatar has a unique energy system. The country's infrastructure is geared towards producing and exporting large volumes of natural gas, either directly (in a gaseous or liquefied state), or conversion to liquid fuels (gas-to-liquids) and petrochemicals. Domestic demand for electricity, water (mostly produced by thermal desalination), and liquid fuels, plays only a small part in the national energy economy, and these resources are subsidized by the state. Large investments in infrastructure, across all sectors, are funded wholly or partially by the government. All large-scale industries are either state-owned or closely regulated by the government. Hence, we assumed that there is only one actor, the state, whose economic objective is to be maximized.
We developed a tailor-made optimization model, called the Qatar Energy System Modelling and Analysis Tool (QESMAT), to accurately capture the peculiarities of the Qatari energy system. The Arabic word 'kismet', also used in English, means 'fate' or 'destiny'. Our optimization model can be used to plan for Qatar's kismet. The following subsections describe various parts of our research methodology.

Data collection
All data used in this project are publicly available, except for data on the performance of solar panels in the Qatari environment, which was obtained from the Qatar Environment and Energy Research Institute. We relied on international sources such as the IEA's national energy statistics [11], World Bank's population and economic indicators [12], public reports from the utility [13], hydrocarbon [14], and petrochemicals companies to build a picture of the current energy infrastructure, and forecast domestic energy demands over the next 30 years. All other information, such as trends in global commodity prices, energy demands of existing and future technologies, policy options for decarbonization, and the material and energy balances for industrial processes, were obtained from a variety of sources, including peerreviewed literature, government reports, news articles, and company websites.

Reference energy system
The Qatari energy system is designed around the production, transformation, and use of hydrocarbons, both oil and gas.
The electricity and water sectors are tied to this system due to the presence of large gas-fired power stations that also produce desalinated water. These are generally called 'integrated water and power plants' (IWPPs). The model also includes solar PV (with some intra-day electricity storage) and reverse-osmosis desalination (run by electricity rather than thermal energy). The hydrocarbons industry consists of oil and gas refineries, gas liquefaction, gas-to-liquids, petrochemicals (plastics, ammonia, urea, fuel additives) and metals processing (aluminium and steel). Domestic transportation demand consists of passenger and freight demand, both of which can be met by either conventional (gasoline or diesel), gas-powered (compressed natural gas), hydrogen or electric vehicles, along with a public transit system (for passenger transport only). Domestic cooling demand can be met by individual air conditioning units or district cooling systems. The current technology set is listed in Table 1. If there is more than one pathway available to meet a given demand, the model chooses the optimal solution based on the constraints. For example, domestic cooling demand can be met by air conditioners or district cooling, using electricity generated from solar PV, gas-fired power, or intraday battery storage, and the model determines the optimal solution for each time slice in each 5-year period. Export limits are manually set on all products and intermediates based on market demand, regional politics, or technological challenges.

Forecasting
Domestic demands for energy resources are dependent on the changes in a country's population and their wealth. We developed our own population forecast for this work. The Ministry of Development Planning and Statistics provides monthly total population numbers (as shown in Fig. 1), while the 2010 and 2015 census [15,16] reports indicate the number of people living in big (villas/houses) and small (apartments) households. These two data points were used to perform a linear regression to forecast the household population (as shown in Fig. 1) to 2050. For historical data (up to 2019), the difference between total population and household population is assumed to be the labor population (single workers living in company accommodation that is not included in the census). For 2020 and 2021, we assume that the labor population peaks at 1.7 million as World Cup infrastructure construction is at its maximum, then reduces by 100,000 every year until it stabilizes at 800,000 (covering workers in the retail/hospitality/construction sectors). This reduction in labor population, along with a steady increase in household population, is projected based on Qatar's Population Policy 2017-2022 [17], which aims to reduce the population of unskilled labor, incentivize skilled migration through naturalization, and increase the birth rate of citizens. Figure 1 also shows the World Bank's population forecast for Qatar [12]. We developed an energy service demand forecast to 2050, which generated demands for residential and commercial energy consumption (for cooling, water, and electricity), along with service demands for passenger and freight transportation.
For sectors that were based on demographics, such as residential and commercial infrastructure, per-capita service demands were used to project energy needs based on currently available technologies and changing population. We used two values of per-capita service demands (a higher and lower value) to determine 'high' and 'low' domestic demand scenarios for the uncertainty analysis. In the residential sector, we divided the population into small and large households (aligned with the census data), and determined the energy service needs of populations living in each type.

Residential
Residential electricity and water consumption is linked to the populations that reside in 'households'-the state utility considers the demand from labor accommodation within the 'commercial' sector, and we use the same approach to maintain consistency.
Electricity requirements for household populations were calculated using per-capita cooling, lighting, and appliance needs, adjusted by annual factors for efficiency improvements, increased energy needs, and increased cooling need due to climate change. These parameters, for high-and lowdemand scenarios, are listed in Table 2. All of these parameters are estimated by us, so that the resulting forecast, when extrapolated to the past, provides upper and lower bounds for the historical data (from IEA, Kahramaa, and ministry reports) (see Fig. 2 for an example of this approach).
The annual residential electricity demand is then calculated using Eq. ( Seasonal/diurnal variation in these demands is captured in a separate parameter array called 'demfrac', which splits this annual demand into six slices, i.e., for two seasons (summer and winter) and three times of day (morning, evening and night), as seen in Table 7.
The Qatari national utility company estimated a percapita water consumption (at supply) of 224 m 3 per year in 2017 [18]. We selected a lower and upper bound of 200 and 300 m 3 per person per year, multiplied by the total household population, to forecast future demand. Historical data   were plotted against an extrapolation of this future demand to validate our approach, as shown in Fig. 2.

Commercial
The IEA database aggregates the energy use of labor accommodation, private businesses, and public buildings into a single category called "commercial use". We have retained this definition for the current study. The commercial sector's energy use is dependent on total population. Thus, electricity and water consumption was calculated using the same approach as in the residential sector (1), but with different per-capita parameters, estimated by us, as shown in Table 3.

Transportation
Passenger and freight demands were estimated by us as service demands, and the total annual service demand is obtained by multiplying the parameters in Table 4 with the total population in any given year. As Qatar has transformed into an international aviation hub, with most passengers only transiting through Doha's Hamad International Airport, the total population of Qatar cannot be used to infer aviation fuel requirements. Thus, we had to follow another approach.
Historical aviation fuel use data were available from the IEA [11]. We also obtained publicly available data on historical and projected total passenger (50 million) and freight (4.4 million tons) capacities at Hamad International Airport [19]. We then correlated historical fuel use with historical passenger and freight data to obtain fuel use of 75 ktoe per million passengers and 100 ktoe per million tons of cargo. Considering the passenger-to-freight-aircraft ratio of Qatar Airways, we assumed that only 10% of all cargo is transported on dedicated freight aircraft while the rest is shipped on passenger aircraft (thus being included in the fuel used per million passengers) [20]. This method enables the forecasting of aviation fuel consumption for the maximum capacity of Hamad International Airport (just under 3800 ktoe annually).

Agriculture
In his doctoral thesis on the Qatari food-energy-water nexus, Al-Ansari studied the feasibility of domestic agriculture, and concluded that Qatar can meet its food security target of producing 40% of its food demand by using 160 million m 3 of water and 1300 GWh of electricity annually [21]. We used these estimates for agricultural water and electricity demands.
The total fixed demands are enumerated in the tables below, for both high- (Table 5) and low-( Table 6) demand scenarios. The electricity, water, and cooling demands for residential and commercial sectors are aggregated. The  agricultural electricity demand is added to the residential and commercial demands, but agricultural water demand is kept separate as this can also be met by treated sewage effluent (TSE) production. Our projections for electricity and road fuels demand, when extrapolated to the past, provide upper and lower bounds for the IEA data on electricity and fuel consumption. This validates our forecasting approach.

Optimization
QESMAT is a linear programming framework that builds on the Resource-Technology Network model developed by our research group [22]. The energy system is represented as a set of 'technologies' that can produce, transform, or consume a set of 'resources', constrained by production and demand balances at each time slice. Since Qatar is a small country, there is currently no geographical dimension to the optimal placement of technologies in QESMAT. The model is temporally divided into 5-year periods from 2020 to 2050, with six intra-year slices to capture diurnal and seasonal trends ('morning_summer','morning_winter','evening_ summer','evening_winter','night_summer','night_winter'). Annual demands listed in the table above are divided into these intra-year slices using a parameter array called 'demfrac'. These time slices are not consecutive but add up to form the entire year (see Fig. 3). Thus, while QESMAT cannot provide a detailed production plan, it outputs a generalized production schedule based on the time of day and year.
Linear programming models are commonly used in energy system optimization. The most popular energy systems modeling tool, TIMES, also uses a linear programming approach. This is because linear programs are generally guaranteed to reach global optimality within a reasonable solution time when using the simplex algorithm (implemented as CPLEX) [23]. When looking at energy systems on a country scale, we can model each technology as a black box-with any non-linearities in the operation of individual technologies approximated linearly-this assumption is valid at large scales.
For the same reason, our model assumes a linear trend between technology capacity and its capital cost, i.e., it does not capture economies of scale. Since all of our technology costs are derived from large-scale estimates, and the optimal solution deploys key technologies in significant capacities, the effect of this approximation is limited. This is, again, similar to the approach used in the TIMES model [23]. Capturing economies of scale would require us to adopt a mixed integer approach instead of a linear program-this would allow the model to deploy technologies only in fixed increments. However, the resulting model would be intractable, due to its size, when implementing stochastic uncertainty. We believe that our approach balances practicality with bigpicture accuracy.
The objective function is the sum of all future expenses and revenues, with an annualized discount rate of 1%. Stern argues against using a high discount rate for long-term planning, especially climate change mitigation [24]. A low discount rate means that long-term decisions, which will affect the lives of future citizens of the country, are not discounted by policymakers who are otherwise more concerned about the immediate future. We observe this in our own modelincreasing the discount rate reduces the decarbonization of the energy system, as the model penalizes the high upfront capital costs of deploying clean technologies. A small discount rate, such as 1%, represents a balance between capturing the time value of money and still valuing future generations.
Note that due to the low discount rate, the objective function must not be used as an absolute indicator of economic performance, but rather as a comparative metric between various scenarios, to provide quantitative backing for specific energy policies. The model is deterministic and assumes perfect foresight, but uncertainties are captured using four scenarios after 2030, as explained below. QES-MAT has been successfully benchmarked against an opensource energy systems model called OSeMOSYS [25].
The general form of a linear optimization problem is: here, x is the vector of decision variables, c is the cost vector, while a and b are vectors containing information on the constraints to be satisfied [26].

Key equations
The key equations in QESMAT are described below. Symbols, letters, and parameter/variable names are described in the Notations section at the start of the paper.

Technology balance
The total number of units of technology j in time period tm is equal to the number of units of that technology in the previous time period tm − 1, plus any new investments made in that time period (of technologies that have been invented by that time period), minus any technologies that have been retired (calculated based on the remaining lifetime of the technology in that time period), for all technologies j, all time periods tm and all scenarios s.

Retired technologies
The number of technology units retired is equal to the number of 'new' technology units that are past their lifetime ('life') plus the number of initial technology units that are past their lifetime ('life 0 '), for all technologies j, all time periods tm and all scenarios s.

Production balance
The production from technology j in time slice t of time period tm in scenario s is less than or equal to the product of the total units of technology j, the capacity factor of technology j in time slice t and the capacity of one unit of technology j, divided by the number of time slices (six equal slices in this case), for each technology j in each time slice t of time period tm in scenario s. The ≤ sign means that a technology need not always produce a resource at its full capacity.

Demand balance
The annual demand for resource r in time period tm in scenario s, multiplied by a parameter that splits annual demand into each time slice, altered by an exogenous elasticity of demand multiplied with the governmentset subsidy for the resource r in time period tm, is equal to the amount of resource imported, minus the amount exported, plus the amount retrieved from storage, minus the amount sent to storage, plus the amount produced (sum of the product of the input-output resource table and the production from each technology j), for every resource r, time slice t, time period tm, and scenario s.
The input-output resource table (µ) quantifies the manipulation of various resources by each technology. For example, a gas-fired power plant consumes natural gas (µ ng_elec,nat_gas = − 0.215 ktoe) to produce electricity (µ ng_elec,elec = 1 GWh). This table incorporates the efficiency of each technology.
The demand fraction (DemFrac) parameter can be used to split the annual fixed demands into each time slice. For example, domestic electricity consumption is higher in the evenings than mornings, while air conditioning is mostly needed in the summer. This effect was quantified using seasonal/diurnal electricity demand data from Kahramaa [18]. Resources such as aviation fuel, freight transport, potable water, and LPG are assumed to be used equally in all time (6) DemFrac t,r × D r,tm,s × 1 − Subs r,tm × Elas r,tm = ∑ j j,r × P j,t,tm,s + IMP r,t,tm,s − EXP r,t,tm,s +S take r,t,tm,s − S put r,t,tm,s ∀ r, t, tm, s  Table 7 below. The seasonality in agricultural water demand for Qatar has been estimated previously [21]. Domestic subsidies are calculated using the opportunity cost metric, i.e., the difference between the domestic price and international market price, when such a price is available, or the cost of production when there is no international market (for electricity, for example). This is the approach used by the IEA to calculate national energy subsidies [11]. Recent reductions in the price of crude oil, along with the change in domestic transport fuel pricing policy [27], mean that Qatar no longer subsidizes domestic transport fuels according to the opportunity cost metric. The only major subsidy is on electricity, with a current subsidy of 66%, meaning that domestic consumers pay a third of the production cost for electricity. We assume that all subsidies will be phased out completely by 2040, supported by the fact that the government has already implemented subsidy reductions for transport fuels [28].
Domestic demand has been modeled as elastic to price, as captured by the Elas r,tm parameter. This is defined as the ratio of percentage change in demand to the percentage change in price. Changes to the subsidy on a certain resource will affect the demand for that resource if the elasticity is non-zero. Since Elas r,tm is negative, increasing the subsidy increases demand.

Storage Equations
Since the time slices are non-consecutive, all storage equations must balance out over the year (major time period tm). The sum over time slices t of the amount of resource r sent to storage should equal the sum of the amount of resource retrieved from storage, for all resources r, over all time periods tm and scenarios s. The "Max Stor" parameter can be used to set the maximum allowable storage for each resource. Electricity storage is additionally constrained so (7) ∑ t S take r,t,tm,s = ∑ t S put r,t,tm,s ∀r, tm, s ∑ t S take r,t,tm,s = Max Stor r ∀r, tm, s ∑ t S put }elec}t,tm,s = ∑ t S take }elec},t,tm,s ∀tm, s, t = summer or winter time slices that only intra-day storage is allowed, i.e., there are separate storage balance equations for summer and winter time slices.

Constraints
We have constrained the annual production of oil to its natural production limit in Qatar (about 40,000 ktoe/year for the last few years). A moratorium on additional natural gas production has been recently lifted [29] to allow a total production of approximately 160,000 ktoe/year within the next 5 years. We have imposed a long-term decline in hydrocarbon production so that we can assess the economic effect of divestment from oil and gas (Table 8).
We implemented additional constraints on our model to provide one set of technology investment decisions until 2030, irrespective of the scenario. As seen below, the investment in new technology j in each time period tm for each scenario s is set to be equal to the technology investments in scenario '1' for all technologies, and applicable in time periods 1-3 (2015-2030) These constraints are called non-anticipativity constraints and provide a unified set of investment decisions for policymakers in the absence of knowledge about which scenario will play out. We assume that by 2030, policymakers will know which scenario best represents reality, and can make investment decisions according to that specific scenario after 2030.
Other technologies had specific constraints. Public transportation was set to be used at its full existing capacity, sewage treatment was limited to 300 Mm 3 annually, and solar PV capacity was constrained below 90,000 MW, which represents 30% of Qatar's land area (at around 3.2 ha per MW). This is an arbitrary constraint-it is not enforced by the model because the optimal solar deployment is actually constrained by domestic demand and a constraint on electricity exports. We constrain all energy imports to zero, as Qatar looks to be independent of other countries, and is affected by the regional blockade. Electricity exports are limited to 10,000 GWh/year (increasing to 40,000 GWh/year by 2050), since regional cooperation on cross-border grid extension is currently lacking.
Existing export capacity for natural gas, along with longterm sales agreements, allows us to estimate the minimum production of liquefied natural gas (LNG) and pipeline gas that must be diverted to international exports (see Table 9). This constraint is weakened in the future to allow the optimizer to choose the best export quantities based on international commodity prices and domestic needs.

Objective function
The sum of the export and domestic revenues, minus the sum of the capital, operating, fixed, storage, emission (determined by the carbon tax) and import costs, all discounted according to the time period tm, aggregated across all scenarios s, is the objective function, which is maximized. This is essentially the expected net present value (NPV) over a 30-year time horizon. Since there is uncertainty of the likelihood of any given scenario, all of them were weighted equally in the objective function.
where C tm,s is the sum of the following revenues and costs. The multiplier five indicates that the annual revenues and costs are added up for all 5 years of each time period. The capital cost does not include this multiplier as technology investments are assumed to be made only at the beginning of each 5-year period.

Uncertainty analysis
Long-term planning decisions cannot be made using a deterministic model. Using different values for key parameters such as commodity prices or domestic demands over the long-term can generate alternative infrastructure futures, but this approach does not provide a single answer regarding short-term infrastructure investments. Thus, we decided to adopt a stochastic uncertainty approach [30], where we varied two key sets of parameters reflecting the most significant uncertainties: domestic demands and commodity prices. Both parameters can be independently set as 'high' or 'low', which leads to four equally likely scenarios: 1. High commodity prices, high domestic demand 2. High commodity prices, low domestic demand 3. Low commodity prices, high domestic demand 4. Low commodity prices, low domestic demand The optimizer is constrained to provide one set of technology investment decision variables ( INV j,tm,s ) across all four scenarios until 2030, after which it is allowed to make optimal decisions for each scenario until 2050, in order to provide a single set of investment decisions until 2030 (see Fig. 4). This approach does not provide the most optimal solution for each individual scenario until 2030, but rather the 'best' compromise solution that can accommodate all four future scenarios, thus providing a practical blueprint for short-term infrastructure investment. For investment decisions to be made from 2035, we assume that policymakers will know which scenario reflects their reality and make suitable investment decisions at that time by either picking the results for one of our four scenarios, or running an updated version of QESMAT. The uncertainty analysis also performs the role of a sensitivity analysis-we can use the results of the four scenarios to understand how the model reacts to changes in domestic demands and global commodity prices. Tables 5 and 6 show the values of domestic demand for high and low scenarios, respectively. Commodity prices are estimated by us using publicly available data. We assume that the price of products derived from the processing of crude oil and natural gas are pegged to the crude and gas prices, respectively. We also assume a linear 5-yearly trend in prices for some commodities, with the price in 2015 as listed in Table 10.

Results
QESMAT was developed and executed using AIMMS Developer [31], an optimization suite with data management and visualization tools, on a Windows computer with 16 GB RAM and an Intel Core i7-5600U CPU, with a solution time of under 30 s to solve all four scenarios simultaneously. QESMAT is an open-source tool that can be shared with non-commercial users upon request.
The following sections describe the optimal solution generated by QESMAT. Table 11 provides an overview of the optimal domestic energy system and export strategy for Qatar, under the four scenarios described previously. The objective value indicates the approximate present value of profit generated by the energy sector until 2050. Note that the profits in scenarios 1 and 2 (high income) are roughly eight times larger  than the profits in scenarios 3 and 4 (low income). Despite the order of magnitude difference in revenues, the country's optimal industrial strategy remains roughly the same across scenarios, as seen in the major industrial exports section of Table 11. Integrated water and power plants (IWPP), powered by natural gas, continue to play a dominant role in the domestic electricity and water mix, but utility-scale solar photovoltaic, intra-day battery storage, and reverse osmosis desalination can be cost-effectively introduced in significant amounts under all scenarios. Treatment of sewage effluent can satisfy agricultural water demand. Transportation can be decarbonized by using hydrogen and electric cars for personal mobility, and air conditioning can be made more efficient by adopting district cooling systems in commercial and residential buildings. One can also observe the significant infrastructure savings between the high and low domestic demand scenarios (as seen in the outputs of the power and desalination plants), thus justifying the implementation of energy and water efficiency measures. Note that the model does not constrain carbon emissions beyond setting a small non-zero price on emissions that encourages the optimizer to choose the less emitting option between two otherwise equal technologies. The last part of this section illustrates the optimal results when setting the carbon price higher ($57/ton). The electricity and water infrastructure in Qatar currently depends exclusively on integrated water and power plants (IWPPs), which burn natural gas to generate electricity and produce freshwater by thermal desalination of seawater. QESMAT suggests that IWPPs will continue to provide power and water in non-daylight hours (see Fig. 5). However, utility-scale solar PV can be deployed to produce more than half of the domestic electricity demand in some scenarios, and can be complemented by intra-day battery storage, which can be used to meet air-conditioning demand (using district cooling). The battery capacity was constrained to 54 GWh (capable of storing 10,000 GWh over the summer as intra-day storage) and is only deployed in 2035. Excess output from solar generation in winter can be exported to the regional grid. Note that the deployment of solar energy can be increased by relaxing the export constraint on electricity and the capacity constraint on battery storage. Energy efficiency measures (as seen between scenarios 1, 3, and 2, 4) can lead to a significant reduction in generation capacity, as the demand for electricity reduces. Figure 6 shows how the water system varies across scenarios. Significant reductions in generation capacity can be made if the water demand is reduced. Thermal desalination (linked to the same production schedule as gas-fired electricity in Fig. 5) and electricity-powered reverse osmosis desalination plants are both required to meet domestic water needs, in the absence of sustainable natural freshwater. Water storage facilities can balance seasonal fluctuations in  and negative values represent consumption (or dispatch to storage). The dashed line represents water demand (inclusive of agricultural demand, which peaks in the summer) agricultural water demand. In scenarios with high hydrocarbon prices (1 and 2), reverse osmosis desalination plants are run during the day to coincide with electricity production from solar energy. Figure 7c shows that infrastructure costs remain fairly constant across scenarios, thus explaining why lower export revenues (in scenarios 3 and 4) can lead to significant losses. The total costs in 2030 are lower than average since it was chosen as the year at which QESMAT scenarios can diverge, thus making the optimizer delay certain infrastructure decisions until the scenario is known (2035 onwards). Figure 7a, b illustrate the order of magnitude difference in international and domestic revenues. Figure 7b shows how domestic revenues can reduce when domestic demand is lower (between scenarios 1 and 2, for example). Figure 7d shows how the long-term effect of a gradual reduction in hydrocarbon extraction on export revenue and net profit, while highlighting the significance of international commodity prices on Qatar's economy (seen as the difference in profits between scenarios 1, 2 and 3, 4).

Exports
Qatar's optimal export strategy is dependent on the domestic availability of natural resources and the expected global demand for them. Hydrocarbons from oil and gas, and downstream petrochemicals and industrial products, will continue to form the bulk of Qatar's exports over the next few decades. However, the optimal strategy for the country will see a long-term decline in the export of crude oil, oil products, and natural gas, due to both supply and demand concerns. Hydrogen, produced by the steam reforming of natural gas, may play a greater role in the country's export portfolio if global demand picks up and supports high prices. Qatar's steel and urea/ammonia industries will also drive exports (Fig. 8). Notice how the export strategy remains similar across high and low commodity price scenarios-this highlights Qatar's vulnerability in depending on hydrocarbon revenues during market downturns.

Emissions
Qatar has a high per-capita carbon footprint-even when considering only the domestic use of energy-electricity, road fuels, and air conditioning. Most of the country's carbon emissions come from the export-oriented energy industry. Figure 9 indicates that total carbon dioxide emissions are somewhat constant across scenarios. A long-term decline can be achieved through the reduction of hydrocarbon exports. Note that emissions do not change significantly when the carbon tax is increased, until the carbon tax is higher than the cost of carbon capture and storage (CCS) technologies. Since the carbon tax in the current model is set very low (0.00001 $/ton), CCS is not deployed under any scenario.
QESMAT was also run by setting a higher carbon tax ($57/ton), as shown in Fig. 10. This was set at the same carbon tax as Norway, a fossil-fuel exporter, according to the Carbon Pricing Dashboard of the World Bank [12]. In this case, CCS is deployed after 2030 as the main decarbonization technology, but the system continues to produce and export large quantities of hydrocarbons. Thus, fossil-fuelrich countries may still find it economical to pay the cost of CCS and continue to use energy-dense fuels. There is, however, a significant reduction in hydrogen exports, because of the high carbon footprint of the steam reforming process used to produce it. In both high and low carbon tax cases, system-wide decarbonization only occurs when hydrocarbon production is reduced towards 2050, as modeled in QESMAT.

Discussion
Our work illustrates the benefits of using a systems approach to guide long-term policymaking. Although the model is based on several assumptions because of the lack of finegrained data, we believe that we can still make a good case for several policies, which may be refined upon further analysis using this systems approach. These policies are divided into technological, social, and economic policy prescriptions, as seen below.

Electricity and water
• Solar PV should be deployed at grid-scale, both as stand-alone and rooftop generation. Electricity generated from solar can be directly used to meet air conditioning demands, with excess generation being exported or stored in intra-day storage. The capital cost of solar energy is already competitive with gas-fired power, and the country should encourage the implementation of solar energy projects as a priority. The national target for solar energy in Qatar, set at 20% of electricity production by 2030, can be easily achieved, and even surpassedour model shows that half of Qatari electricity production can come from solar energy by 2030. We have not considered rooftop PV as a separate technology, but the optimal split between residential and utility-scale solar PV needs further research. • Grid-scale battery systems can help store excess power generated by solar energy, while also reducing the need for excess gas-fired capacity to meet peak demands. These may also be installed by residential and commercial users, if guided by variable electricity pricing. Detailed models of battery storage integrated into the local energy mix may show greater benefits, as our model was limited to just a few, non-consecutive, time slices. For the same reason, we were also currently limited to considering intra-day electricity storage, but nevertheless found that in most scenarios, the model chooses to deploy the maximum allowable battery capacity (54 GWh) after 2035, as this is the most economically feasible way to even out supply and demand. Energy storage can help the country reduce the high costs associated with gasfired capacity that sits idle for most of the year and is only needed during summer days to meet peak demands. Note how battery storage is predominantly used to meet air conditioning demand-this opens up the possibility of using smart cooling systems that run when excess electricity is being generated from solar PV. • Reverse osmosis desalination is also indicated as a costeffective technology, with its lower energy consumption than thermal desalination. We recognize that there are greater pre-treatment costs and technical challenges for seawater RO, but nevertheless believe that this should be a priority technology for Qatar to implement. • Water storage facilities are already being constructed as a matter of national security [32], as almost all domestic freshwater needs are met by desalination. We have shown that there is also an economic benefit in using intra-day water storage. Our model does not currently support integer variables, which limits our ability to model flexibility in IWPPs, i.e., whether they operate in electricity production or water desalination modes. This flexibility may reduce the need for water storage. • District cooling provides a more efficient, centralized, air conditioning service in residential and commercial buildings, and is already used in some parts of the city

Industrial
• Our model shows that liquefied natural gas will no longer be the most profitable export for Qatar over the next few decades. This is mainly the result of lower global gas prices, which we assume will persist as new suppliers enter the market over the short-term and global demand weakens over the long-term as countries ramp up decarbonization efforts. We recommend that retired LNG capacity should not be replaced. • As global energy systems decarbonize, hydrogen promises to be the next big fuel-for industrial, residential, and transportation applications. Global hydrogen demand is expected to rise, and Qatar should translate its low production costs, large supplies of raw material and investment ability into a first-mover advantage, similar to its approach in the LNG market in the 1990s. The biggest advocate for a hydrogen economy is Japan, which, like with LNG, could be Qatar's first big customer for hydrogen. Increasing hydrogen exports, produced through the steam reforming of natural gas, can be the last driver of Qatar's hydrocarbon economy. Qatar can use the savings from its hydrocarbon revenues to thrive in a post-carbon world. • Carbon capture and storage (CCS) will have to be deployed with hydrogen production if importing countries are looking for a truly low-carbon fuel. This is still not economically feasible but will be a necessary technology if global carbon mitigation efforts are not enough to limit climate change. The implementation of CCS can be supported by a higher price for low-carbon hydrogen (such as $5000/ton). • Industries should be supported to use renewables for their internal energy needs, while also being encouraged to implement energy and water efficiency measures, alongside stringent pollution limits. • Electricity exports can be increased by investment in a regional grid with higher capacity for transmission. Excess production from solar energy can match air conditioning demand in other countries in the region, thus creating supply-demand synergy. However, regional political differences must be overcome to enable the building of this shared infrastructure.

Transport
Our model indicates that road transportation can be decarbonized by shifting towards hydrogen and electric vehicles. However, due to the easy availability of hydrocarbon fuels, the optimal solution still includes significant amounts of gasoline cars and diesel freight trucks. Decarbonization of the transport system will require a government-sponsored infrastructure roll-out, which may start with charging points for electric taxis or hydrogen refueling stations for public buses, later extended to the public.

Social Policy
• Subsidies on all energy commodities and water must be phased out, as they have been shown to lead to resource mismanagement and benefit rich households more than poor ones [35]. • Energy and water efficiency measures must be mandatory instead of voluntary. This may include mandatory installations of solar water heaters or, where possible, rooftop solar panels, while also enforcing stricter building regulations on insulation and lighting among others. • Decentralized generation and storage of electricity, at the residential and commercial level, should be encouraged through the lifting of subsidies on electricity, and instead subsidizing installations of rooftop solar and home batteries. This policy can be complemented by variable electricity pricing based on supply and demand imbalances. • Public transport, particularly the under-construction metro system, must be incentivized through low ticket prices and last-mile transport solutions such as covered walkways and electric shuttle buses around each station, which will make it easier for passengers to use during the hot summers. Our model has not quantified the added benefits of public transport reducing urban air pollution, but these can be significant. • New electric cars such as the Tesla Model S can appeal to drivers who do not want to compromise on luxury and performance if they switch to a lower-emissions vehicle. However, a government-supported infrastructure rollout, such as free charging points at shopping malls, may encourage the adoption of electric vehicles. Similarly, hydrogen-powered cars will require their own refueling infrastructure. Both types of cars can reduce urban air pollution compared to existing fossil-fuelled vehicles. • A higher carbon tax does not necessarily lead to a decarbonized energy system in Qatar, and our model simply chooses to deploy CCS when its cost is lower than the carbon tax, rather than reduce the total emissions of the system. Hydrogen exports are also less profitable due to the cost of CCS, but are still an optimal export when hydrocarbon prices are under $60/bbl oil and $5/MMBTU gas. • Currently, air pollution in Qatar is estimated by the World Health Organization to adversely affect the lives of hundreds of Qataris every year [4,36]. All of the above measures: energy efficiency, cleaner transport and renewable power, can reduce urban air pollution and its associated health impact. Further research is needed to quantify these benefits.

Economic policy
Without the constraints on natural gas production, our model chooses to extract the maximum possible amount of gas every year until 2050. The most optimal way to export the gas is by conversion to hydrogen. However, in a world increasingly threatened by climate change, rapid decarbonization of global energy systems is a priority, and it is imperative that Qatari policymakers delink the national economy from energy exports over the long term. Therefore, we chose to implement a voluntary reduction in hydrocarbon production over the next few decades in our model and analyzed the economic effect of this policy. We conclude that with the right investment strategy, Qatar should be able to generate and retain significant amounts of wealth from its hydrocarbon exports, which can be used to maintain the political and economic structures of the nation in a post-carbon world.
The hydrocarbon wealth may be invested through a sovereign wealth fund, along with a corresponding decline in 'showcase' domestic spending that generates uncertain economic benefits. Profit sharing arrangements with international oil and gas companies may also be renegotiated to retain more hydrocarbon wealth domestically. At a target investment portfolio of $1 trillion by 2050, well within the range of scenarios generated by our model, and a yearly return of just 5%, 500,000 Qatari citizens could each be provided with a universal basic income of $100,000 every year starting in 2050, funded only by the yearly returns generated by the investment portfolio. Along with a corresponding decrease in employment in the public sector, citizens can pursue their own ambitions with little economic risk, either by joining the private sector, starting their own business or volunteering around the world [35]. It is vital that citizens are consulted through this process and have an economic stake in the future of their country. The investments made by the sovereign wealth fund can catalyze a global clean energy transition.

Conclusions
Global decarbonization efforts, along with domestic pressures to diversify the economy, have created challenges and opportunities for the Qatari energy system. Our optimization framework allows policymakers to apply a systems approach to the overall energy infrastructure in Qatar, covering a range of sectors such as industrial, residential, transportation and agriculture. Our results provide a blueprint for a cross-sectoral energy transformation: from a greater use of low-carbon transport such as electric cars and public transit, to gridscale adoption of solar energy and reverse osmosis for desalination. Liquefied natural gas is not expected to remain the most profitable export, instead being replaced by hydrogen obtained from the steam reforming of natural gas. We have modeled a long-term domestic divestment from hydrocarbon exports and shown that the country can still retain significant economic wealth in a post-carbon world, thus maintaining existing political, economic, and social structures.