Energy Mix Optimization from Energy Security Perspective Based on Stochastic Models

As a problem, generally, energy security components do not interfere with the calculation of the optimal energy supply situation. Energy security indices so-called ‘passive indices’ cannot illustrate comprehensive optimal situation. In this paper, we are looking to find a solution to make a framework of the impact of energy security on energy supply in order to obtain comprehensive analysis of the economic optimal point. Method is based on the competition of energy costs to meet demand during the study period. Threats that have been addressed in the energy security are seen as risky and stochastic parameters in the model. The nature of these parameters is of uncertainty type, therefore, based on the probable scenarios of the stochastic model, the perspective of the energy supply system is drawn up based optimizing the supply of different carrier energy. We apply this method on Iran’s import of gasoline as a national threat of energy supply. According to the results, in the period when there are threats of energy imports, energy storage is a low-cost and safe way to compensate for the damage caused by threats. Assuming an annual growth of 5%, capacity can be increased to 8 million barrels during the threat period. The optimal index varies in this period between 0.04 and 0.06.


INTRODUCTION
Energy security is a multifaceted term that is usually defined in relation to the location, purpose and duration of the study. (Lu et al., 2016) argued that a holistic view of energy security is needed to better understand and assess vulnerabilities and threats (Shi et al. 2019).
Energy security can be called "sustainable and reliable energy supply at reasonable prices and social costs (World Economic Forum, 2015)".
The definition includes three aspects of the environment, economic and geopolitical aspects (van Moerkerk and Crijns-Graus, 2016) Therefore, some researches focuses on environmental aspects of energy supply, Lin and Raza (2020) examine energy security indicators and CO2 emissions for long-run energy supply by applying the MARKAL framework.
Energy security has a variety of dimensions, and each indicator of energy security, examine one aspect of energy security. Availability, accessibility, affordability and acceptability are four areas used to evaluate energy security so-called "four As." These indicators have wide applications for example Madani explores the relationship between China's energy policies and the BRI, especially in energy security, by highlighting the energy status in China and its top energy priorities with the analytical framework based on the model of "four As (Madani, 2021)." Energy security indicators are an imperfect tool for evaluating the energy supply system optimization. For complete evaluation, we need to calculate the competition between energy security costs and other costs such as economic and environmental issues.
In the studies, energy security indicators are used passively, after implementing the model and determining the decision variables. This Journal is licensed under a Creative Commons Attribution 4.0 International License In these situations, energy security indicators are not effective in determining the optimum supply system's point of view, and are used only to illustrate the situation in the possible future (Kruyt et al., 2011), (Cherp, 2011;Jansen et al., 2004).
This situation shows a minimal application of energy security indicators in decision making, for example, Bert et al., in their paper titled "Indicators for energy security," presented their findings as a table. Table 1 shows some of the energy security indicators and their role in policymaking.
As can be seen in Table 1, energy security indices generally do not have mathematical calculations in determining the optimum energy point. So the key question is how can energy security considerations be introduced into energy policy making? How can the optimal supply system be obtained by considering the impact of energy security indicators on the assessment of the energy supply system and the calculation of related threats?
In fact, we are looking for an active approach to energy security. In an active approach, the achievements of energy security literature also interfere with calculations of energy supply models, and as a result, energy security indicators reach their optimal level. The point of optimal point of view of energy security indicators is a point that is considered by considering the impact of energy security on the model of competition between different energy carriers or energy technologies.
Of course, we realize that in the energy security literature there is no optimal point for energy security indicators. And as these indicators improve, the system's status increases against supply threats. On the other hand, the improvement of energy security indicators is associated with higher costs in the energy supply system, and ultimately the optimal point is determined by the competition between the supply system costs.

BACKGROUND
Several studies have just been conducted to introduce energy security indicators in light of existing concerns (Eshita and Tayyeb, 2011. p. 3), (Barton et al., 2004. p. 4), (Cherp, 2011;Böhringer, 2004). Bert et al. Highlighted the long-term energy security indicators and, while categorizing energy security indicators in the form of globalization, economic efficiency, environmental acceptability and regional flow, points out that although the use of energy security indicators in analytical tools But these indicators are not applicable to energy policy and are used only to calculate indicators (quantitative) from the output of models (Kruyt et al. 2011).
Augutis et al., Discusses the impact of energy security on energy supply models. According to their opinion, in order to fully calculate the impact of energy security, we need a hybrid approach that takes into account definite and stochastic parameters.
They have tried to develop the energy security coefficient and use this coefficient to evaluate energy security. But, the problem with the development of energy security indicator is part of the same problem that exists in other energy security indicators. The fiscal indicator is characterized by two criteria: 1. No significant price changes due to supply fluctuations. 2. Stable energy supply and noninterruptions. Energy supply is calculated (Augutis et al., 2015).
Initially, energy supply models were solved in deterministic models, but they were not fully responsive to the needs of the energy sector, uncertainties in the supply of energy could not simply be ignore. Therefore, stochastic models have more influence on energy supply models.
In the context of the gas price, Mirkhani refers to the importance of entering stochastic parameters in deterministic energy supply models, using the Monte Carlo method to enter the uncertainty of gas prices in the energy model. These uncertainties exist in cases where historical data exists. He compares the results of a stochastic model with deterministic model results and calculates the benefits of problem solving by stochastic reducing costs. (Mirkhani, 2012) Some stochastic models evaluate the interaction between policies and the uncertainty of energy prices to measure new investments (Seljom and Tomasgard, 2017).
In general, the following approaches have been developed to achieve an active energy security approach: The first method is to use experts' opinion polls to determine energy security indices and add constraints to the energy supply model until it arrives at the desired outcome; The second method is to enter stochastic price parameters for items with historical information; The third method is to calculate new energy security indicators based on energy supply models that reflect the resilience of the energy supply system. Table 2 shows the comparison between the methods for calculating the impact of energy security on energy supply models in terms of advantages and disadvantages.
Given the nature of the problem, we need a method that takes into consideration energy security considerations and has the minimum weak points. When a deterministic energy supply model is applied under the uncertainty, it is rather difficult to obtain a robust result. Therefore, scenario analysis is usually applied for consideration of the impact of uncertain parameters on the results of the deterministic model (Mirkhani, 2012).

METHODOLOGY
To overcome the problems and disadvantages of existing methods, a new method is introduced: 1. Threats to the target of energy security indicators in the energy supply model 2. These threats can be seen as stochastic variables 3. Scenario planned via CIA method 4. Competition of energy security parameters with other system costs so that the supply of energy security is one of the elements of decision making.
The process of the process is shown in Figure 1.

Problem Modeling
The energy supply model is developed based on the energy reference model and microeconomic basis. Due to simplification in problem solving, oil, gas, and renewable energy sources are among the main carriers. In the conversion layer, oil and gas refineries and power plants have entered the model, and finally the economic sectors of Residential-Commercial, Industry, Transportation and Agriculture have been identified as energy consumers. Due to the need for the problem, the model is made centrally and without regard to spatial dimensions. Figure 2 shows the energy flow diagram.

Conceptual Model
The energy supply model, taking into account energy security considerations, is composed of three parts of the objective function, the constraints and indicators of energy security. The following sections explain the sections of the model.

Objective Function
The objective function is to minimize the total cost of the energy supply system with the supply of energy demand during the study period. The objective function includes:

Crude oil production
The amount of crude oil produced from oil reservoirs can be exported or converted to petroleum products, so the total amount of crude delivered to refineries and petroleum exported are smaller than those produced in the same year.

Minimum oil delivery to refineries
At the base year, the capacity of the country has a certain amount. The capacity to keep useless is not permitted by law, and therefore, the amount of oil delivered to the refineries is larger than the current capacity of the refineries.

Crude delivery to refineries
The development of capacity building requires investment and spending time and money. Therefore, the whole capacity should not be left if capacity is created. Therefore, the amount of oil delivered to the refineries cannot be less than the previous year (the capacity created should not be left useless).

Crude conversion to oil products
For one unit of petroleum that enter the refinery, petroleum products are produced that account for the efficiency of the refinery's product. Therefore, the amount of crude oil delivered to the oil refineries of the country is converted into a certain amount of petroleum products due to the efficiency of oil refineries.

Oil products consumption
According to the balance of mass, the total domestic petroleum products produced in the country plus imports from the remaining reserves since last year are equal to the oil products allocated to exports, storage and various consumption sectors, including households, Industry, transportation, agriculture and power plants. Accurate calculations based on historical information The need for historical information is only applicable to variables whose exact historical information is available Sophisticated scenario planning 3 rd method Calculation of the index of the supply model, taking into account fluctuations and threats, considering the indicators based on the discontinuation of supply and price changes.
Providing a new index that requires a new interpretation of energy security Failure to review existing energy security indicators and their aggregation 3.4.6. Gasoline consumption According to the balance of mass, the total amount of gas produced in the country plus imports and withdrawals from the remaining reserves since last year is equal to the gasoline allocated to exports, storage and various consumption sectors, including households, businesses, industry, transportation, agriculture and power plants.

Gasoline equilibrium
In the transportation sector, the following restrictions apply for gasoline: Regarding the rate of gasoline production in the oil refineries of the country and the amount of gasoline used in the transportation sector each year, if necessary, imports of gasoline are carried out. Thus, the amount of gasoline consumed in the transport sector, which is a percentage of the total energy consumed in this sector, is equal to the amount of gasoline produced in the oil refineries of the country, which represents a certain percentage of the total oil products produced in the oil refineries, Gasoline is imported, and in the event of excess production on demand, gas is exported.

Gas production
The gas produced from the gas reservoirs after being sent to the gas refineries will become a certain amount of light gas due to the efficiency of the gas refineries.

Gas equilibrium
According to the mass balance equations, the total amount of natural gas produced in the interior and imports is equal to the natural gas allocated to exports and the various sectors of consumption, including domestic, commercial, industrial, transportation and power plants.

Electricity production
The total electricity generated in renewable energy plants and thermal power plants is equal to the total electricity available for allocating to different sectors.

Renewable production
According to the plans for the use of renewable energy at power plants, a certain part of electricity is supplied through renewable energy.

Electricity equilibrium
The total amount of electricity produced in the country (after deductions for transportation and distribution) and imports is equal to the amount of electricity allocated to exports and various sectors of consumption, including domestic, commercial, industrial, transportation and agricultural sectors.

Energy demand
The total amount of petroleum products, natural gas, electricity and traditional fuels allocated to the household-commercial sector is greater than or equal to the total energy demand of this sector. The demand for petroleum products, gas and electricity for this sector has also been considered separately. For the industrial sector, we have the same constraints as the residential-commercial sector. The total amount of oil products, natural gas and electricity allocated to the larger transport sector equals the total energy demand of this sector. The total amount of oil and electricity allocated to the larger agricultural sector is equal to the total energy demand of this sector. The total amount of oil and natural gas allocated to larger thermal power plants is equal to the total energy demand of this sector. Also, given that thermal power plants use natural gas to produce electricity on petroleum products, and these two are interchangeable energy carriers, the demand for gas in this sector has been considered separately. The amount of gas allocated for injection into larger oil reservoirs is equal to the amount of demand specified by the specialists.

NEID index
The index of dependence on imports is one of the most common indicators of energy security. This index is applicable to different carriers and different regions. They mainly consider import dependence on energy consumption. The Asia-Pacific Energy Research Center has a composite measure for import diversification and dependence (APERC, 2007) In this way, the Shannon index is weighted to measure the degree of dependence of the country on imports: The greater the value of this indicator, the greater the dependence of the energy supply system on energy imports, and therefore the level of security of supply is lower.

SCENARIO PLANNING VIA CIA
There are two basic dimensions of uncertainty about the future of energy: One of them is the value of the parameters that describe the future (such as: Technology cost, or economic growth rate); and the relationship between parameters (such as: If economic growth is faster Will speeds up technological innovations?). Taking these two dimensions into account, the uncertainty about the future of energy is becoming more in depth. A scenario analysis is a technique that is particularly suitable for deep uncertainty situations, although quantitative tools for describing these uncertainties, which are an abstract construction about the future, may undermine the credibility of the results.
The scenario usually takes place within the framework of a single model, or as a set of assumptions about the relationships between variables. Scenario area analysts then change the specific values for key parameters and study their effect on the results. In some cases there may be tens of thousands of parameters that can change their values, which leads to an infinite number of possible outcomes. Meanwhile, even if the two models of modeling value the key parameters equally, the results may differ depending on the second type of uncertainty, usually reflected in the structure logic of the model.
Any scenario based on a common framework produced using different models may have different results, indicating uncertainty in models and relationships that models have been designed to illustrate.
A stochastic model is constructed by entering an uncertain factor into a definite model. In this case, there is a coincidence (threat) of gas imports.

Driving Forces
Driving forces are the determinants of trends and uncertainties. The propulsive forces can change the environment of economic analysis in general or cause minor changes in trends.
The propulsive forces are determined by a team of experts and experts. In the current issue, the propulsion forces are: • Sanctions If the sanctions are tightened, production trends and energy consumption are heavily affected. Sanctions also affect foreign investment and export of products such as crude oil, which provides government revenue.

• Regional unifications
It means the regional unification of the neighboring countries of Iran such as Russia, Syria, Iraq, and … against sanctions, which, if any, could limit the effects of sanctions and create opportunities for Iran.

• New technologies
The emergence of new technologies can always increase efficiency and reduce costs, so new technologies are one of the parameters that affect the trends.
The general trends in energy issues are limited to energy production and consumption areas. Problem trends include: • Demand increment • Supply increment • Import decrease

Assumptions and Scenarios
Scenarios begin with reasonable assumptions about the future of Iran, and trends are the result of assumptions about the future. In Table 3, the assumptions collected from experts are shown: Recent assumptions are the basis for producing trends that are counted in Table 4. These trends are calculated on key factors.

Cross Impact Analysis
One of the features of the scenario is internal cohesion that raises the justification of the scenario. Trend processes that lead to reinforcement lead to the intrinsic cohesion of the scenario.
The method of analyzing the interaction of the effect of the processes on each other shows that in a conditional process, if the process of one occurs, what other probability is likely to occur.
Thus, the higher probability trends indicate greater solidarity and greater internal consistency.
According to Table 5 and trend review, the three main processes that support each other are obtained through the interaction analysis method.
In these scenarios, the price of gasoline imports varies from $ 63.7 to $ 132 per barrel. Based on the Delphi method, the value of the price in each scenario and the probability of the scenario were obtained by means of the arithmetic mean. Table 6 shows the calculated scenarios.

CONCLUSION AND POLICY RECOMMENDATION
In this paper, we are looking to find a solution to the use of energy security indicators in energy supply models in order to obtain a more comprehensive analysis of the energy efficiency point. Our method of analysis is based on the competition of energy costs to meet specific demand over the course of the 20-year period. The lack of rising gasoline prices and other imported oil imports 3 Reduce crude oil exports and increase product imports 4 The sharp rise in imported gasoline prices 5 Business as usual 6 Reducing crude oil exports and reducing product imports  Increasing sanctions under the pretext of human and nuclear rights, establishing regional unity against the United States with the presence of Iran and Russia, reducing foreign investment 3 Increased pressure on Iran, lack of regional unification, reduced foreign investment, reduced crude oil sales 4 Increasing consumption of petroleum products and other types of energy due to population growth and economic development 5 Reducing consumption of petroleum products by increasing natural gas consumption and replacing it with petroleum products 6 Business as usual Energy dependency index was considered as one of the indicators of the importance of energy security and the gas import variable as the main variable with uncertainty was selected in the case study of Iran as a stochastic variable.
Gasoline price scenarios are based on the interaction analysis method, which consists of three scenarios of intense boycotting and passivity, a strong and active boycott, and the continuation of the current situation. The intense and active boycott scenario means a massive boycott by Iran of the West and a solidarity in opposition to the West by Iran. Serious sanctions and passivity mean Iran's isolation and lack of support from neighboring countries with Iran in countering Western sanctions.
The scenario is the one that reflects the highest prices and the ongoing trend of the current low-cost gasoline. These scenarios are used in solving a stochastic model.
The result of the stochastic model indicates that in the years when there is a threat to gasoline, the economic model emphasizes energy storage, and because, according to the refining capacity capability in the model as well as the low refineries' efficiency, the refining capacity leads to maintaining capacity performance Created, it has refused to create new capacity.
The energy security index is the equivalent of a multivariate function that can be optimally localized in different situations.
By solving a stochastic model, the energy basket composition is in such a way that the index is placed in an optimal local position.
The change in the energy security index comes from the output of the model with a change in the energy basket, which diverts the system from the optimal point and ultimately loses its economic value. In this way, the economic aspect has been given more attention and has been paid to other aspects such as aspects related to social and political crises and environmental issues.
Therefore, it is suggested that the energy security indices in energy supply systems approach their optimal points, which, by definition, is an optimal indicator with a definite mix of the output of the model, and another combination of energy security indicators, despite the fact that the value of the equation in the index output will not be accepted.
Therefore, the following recommendations can be considered as policy recommendations: • Iran is a country that will have uncertainties in energy supply in the coming years, so self-sufficiency of the energy supply system is one of the key determinants of energy supply. Investments should be made in order to self-sustain the storage of energy carriers. • Considering the annual growth potential of 5%, capacity building up to 8 million barrels of crude oil equivalent for storage of energy carriers as a solution to short-term threats • Capacity building for refining crude oil is justified if there is long-term energy threats. • The dependence on energy imports is one of the most important and comprehensive indicators of energy security, which in large energy decisions makes the system more vulnerable to threats. • Optimizing refineries in Iran and improving their energy basket will increase the value of the product basket and ultimately significantly increase the refining capacity of the energy supply system. This, on the one hand, reduces the dependence on imports of fossil fuels, and, on the other hand, increases the benefits of fuel exports to Iran's foreign exchange earnings. • The price of electricity from renewable energy would decrease if it is lower than half the current price, and electricity imports will not reach 80 million barrels in 1414. • Due to the increase in gasoline imports to 179 million barrels in 1414, based on the output of the model, it is necessary to work on the variety of import routes as well as the routes and ports of import.