This is a self-archived – parallel published version of this article in the publication archive of the University of Vaasa. It might differ from the original. Optimal sizing of renewable energy systems in a Microgrid considering electricity market interaction and reliability analysis Author(s): Hakimi, Seyed Mehdi; Hasankhani, Arezoo; Shafie-khah, Miadreza; Lotfi, Mohamed; Catalao, Joao P.S. Title: Optimal sizing of renewable energy systems in a Microgrid considering electricity market interaction and reliability analysis Year: 2022 Version: Accepted manuscript Copyright ©2022 Elsevier. This manuscript version is made available under the Creative Commons Attribution–NonCommercial–NoDerivatives 4.0 International (CC BY–NC–ND 4.0) license, https://creativecommons.org/licenses/by-nc-nd/4.0/ Please cite the original version: Hakimi, S. M., Hasankhani, A., Shafie-khah, M., Lotfi, M. & Catalao, Joao P.S. (2022). Optimal sizing of renewable energy systems in a Microgrid considering electricity market interaction and reliability analysis. Electric Power Systems Research 203, 107678. https://doi.org/10.1016/j.epsr.2021.107678 1 Optimal Sizing of Renewable Energy Systems in a Microgrid considering Electricity Market Interaction and Reliability Analysis Seyed Mehdi Hakimi a, Arezoo Hasankhani b, Miadreza Shafie-khah c, Mohamed Lotfi d, and João P. S. Catalão d,* a Electrical Engineering Department and Renewable Energy Research Center, Damavand Branch, Islamic Azad University, Damavand, Iran. b Florida Atlantic University, Florida, USA c University of Vaasa, Vaasa, Finland d Faculty of Engineering of the University of Porto and INESC TEC, Porto, Portugal *catalao@fe.up.pt Abstract This paper addresses the optimal sizing of renewable energy systems (RESs) in a microgrid (MG), where the MG participates in the electricity market. A novel method for reliability analysis is proposed in this study to deal with the high penetration of RESs. In this framework, the MG is considered as a price maker, having a two-direction relation with the electricity market. RESs, including photovoltaic (PV) panels, wind turbines (WTs), and fuel cells, are optimally sized based on the reliability index, and the results are evaluated before and after the MG involvement in the electricity market. The results show a 3.6% decrease in the total cost of the microgrid as a result of the transactions with the electricity market. Furthermore, the efficiency of the proposed approximate reliability method is verified, where the reliability of the MG is evaluated with less computational complexity and acceptable accuracy. Keywords: Electricity market; Microgrid; Optimal sizing; Reliability; Renewable energy system. Nomenclature Α Demand coefficient ($/kW2) ௜ܲ ௝ Aggregated production (kW) MCP Market clearing price ($/kW) G Vertically incident solar irradiance (W/m2) ௉ܲ௏,୰ୟ୲ୣୢ Photovoltaic panel's rated power (kW) ௉௏,௖௢௡௩ Photovoltaic energy conversion efficiencyߟ Horizontal irradiances at t (W/m2) (ݐ)ுܩ Vertical irradiances at t (W/m2) (ݐ)௏ܩ ௖௨௧ ௜௡ Cut-in speed of wind turbine (m/s)ݒ ௖௨௧ ௢௨௧ Cut-out speed of wind turbine (m/s)ݒ mailto:*catalao@fe.up.pt 2 ௥௔௧௘ௗ Rated speed of wind turbine (m/s)ݒ ௐ்ܲ,୫ୟ୶ Maximum power of the wind turbine (kW) ௙ܲ௨௥௟ Output power at cut-out speed (kW) ௐ௛ݒ Wind speed at height h (m/s) ௐݒ ௥௘௙ Wind speed at height ℎ௥௘௙ (m/s) Stored energy at hydrogen tank at t (kWh) (ݐ)௧௔௡௞ܧ ௘ܲ௟ି௧௔௡௞(ݐ) Transferred power from electrolyzer to hydrogen tank (kW) ௧ܲ௔௡௞ିி஼(ݐ) Transferred power from hydrogen tank to fuel cell (kW) ௦௧௢௥௔௚௘ߟ Hydrogen tank efficiency ܪܪ ுܸమ Higher heating value of Hydrogen ௧௔௡௞,௠௜௡ܧ Minimum stored energy at hydrogen tank (kWh) ௧௔௡௞,௠௔௫ Maximum stored energy at hydrogen tank (kWh)ܧ ிܲ஼ି௜௡௩ Fuel cell's output power (kW) ி஼ߟ Fuel Cell efficiency ܰௐ் Number of installed wind turbines ܰ௉௏ Number of installed photovoltaic panels ݊ௐ் ௙௔௜௟ Number of disconnected wind turbines ݊௉௏ ௙௔௜௟ Number of disconnected photovoltaic panels ௟ܲ௢௔ௗି஽ோ(ݐ) Load profile of the smart microgrid after applying demand response program at t (kW) loss of energy expectation (kWh) ܧܮܱܮ ௦ܲ Probability of state ݏ ௦ܶ Time of load loss in state ݏ (hour) ܳ௦ Demand loss is state ݏ (kWh) (kWh) ݐ Demand loss at (ݐ)ܳ D(t) Demand at ݐ (kWh) ௐ்ܣ Availability of WTs ௉௏ Availability of PVsܣ ௖௢௡ Availability of DC/AC converterܣ ($) Net present cost ܥܲܰ ($) ௖ Cost of load curtailmentܥ ($) ௕ Cost of buying powerܥ ($) ௦ Cost of selling powerܥ H Planning year Capacity of each component (kW) ݌ܽܥ ஼஼ Capital cost ($/kW)ܥ 3 ோ஼ Replacement cost ($/kW)ܥ ைெ Operation and maintenance cost over one year ($/kW)ܥ (%) Interest rate ݎ݅ (%) ௥ Rated interest rateݎ݅ ݅௙ Inflation rate (%) Annual payment present worth ܲܣ ܵܲ Single payment present worth Useful life of component ݕ ௥ܰ Number of component's replacement ௔௩௘ܮ Average loss due to the load curtailment ($) ௕ܲ(ݐ) Power bought from the grid at ݐ (kW) ௦ܲ(ݐ) Power sold to the grid at ݐ (kW) 1. Introduction The application of renewable energy systems (RESs) has dramatically increased due to the introduction of smart microgrids (MGs), considering that the high penetration of RES has a lot of advantages associated with environmental concerns and fossil fuel depletion. On the other hand, this increasingly growing trend should be managed cautiously due to two different issues. First, the RES intermittent behavior should be compensated to maintain system reliability. Second, the total cost of the system should be minimized, which can be realized through the optimal sizing of installed units [1]. In this study, the optimal sizing of RES units is done considering the interaction between the MG and the electricity market, as well as meeting the reliability considerations. Different studies have been done on the management of RESs in smart MGs. The production of the photovoltaic panel (PV) and combined heat and power units has been determined to consider uncertainties resulting from weather conditions and RES units [2]. In [3], an energy management tool has been proposed considering RES presence and the users' behavior due to a change in the operation of appliances. In [4], PV production and energy storage have been optimized in both grid-connected and islanded modes, considering the time of use (TOU) pricing. In another study [5], the electricity cost has been minimized in residential sections considering RESs, electric vehicles, ESSs, in addition to both electrical and thermal loads. A management algorithm has been proposed to address the optimal operation of RESs and energy storage systems (ESSs), where the demand response programs have also been considered [6]. To satisfy the uncertainties in the weather, another study [7] has proposed a management algorithm to plan the RESs considering weather forecasting and ESS depreciation. In [8], the management algorithm has been developed for RESs, ESS, electric vehicle, and residential loads, where the demand side participates in the management program. The RESs have been optimally sized considering different conditions in a smart MG. In [9], A second-order conic problem has been defined for the optimal sizing and siting of RESs, and ESSs. Short-term planning has been done in order to determine the optimal size and place of RESs, considering both economic and environmental issues using mixed-integer linear programming [10]. In another study [11], the optimal sizing and placement of RESs and ESSs have been done considering the participation of users in 4 demand response programs and the modeling of residential appliances. The optimal sizing of a wind turbine (WT), PV panel, and ESS has been done considering the relation between electric vehicles and a smart MG [12]. In [13], the size of hybrid MG, including WT, PV, hydrogen tank, and ESS, has been optimized by the ε-constraint method. In [14], the optimal size of RESs and distributed generators have been determined considering the reliability constraints and financial considerations. It should be noted that the reliability consideration is crucial with the application of RESs. In [15], system reliability has been studied to avoid congestion and overloading, considering the high penetration of RESs. The reliability of islanded MG has been analyzed considering the cyber-physical elements [16]. The uncertainties in RESs have been addressed through a risk-constrained stochastic problem in order to maximize profit and keep reliability constraints. The relation between MGs and the electricity market should also thoroughly be investigated. In [17], a relation between MG and the electricity market has been studied to specify the MG role in the day-ahead market. In [18], the MG's participation in the electricity market has been planned considering its uncertainties, including load growth and outages. In [19], an optimal management strategy of MGs has been determined, considering their presence in the electricity market to schedule a day-ahead energy exchange. A risk constrained optimal energy management has been proposed to plan the renewable energy resources considering the reliability indices [20] and [21]. In [22], an integrated planning model has been developed to investigate the techno-economic performances of a high renewable energy-based standalone MG. In [23], a stochastic energy management algorithm has been proposed to address the participation of smart MGs in the electricity market, which minimizes the total cost and optimally sizes of different components. An interval-based planning algorithm has been proposed in [24] for multi-energy MGs that finds the optimal component size, the optimal component site, and the associated optimal operation multi-energy MG's components considering uncertainties. In [25], optimal sizing of an MG has been investigated to determine the optimal capacity of an islanded MG equipped with a WT, solar panel, and energy storage. An off-grid operation of an islanded MG has been addressed in [26] to find the optimal size and operation of WT, PV, and energy storage. Another study on the multi-energy MG [27] has presented an optimal structure and operation of a sample MG, including WT, PV panel, electrical energy storage, thermal energy storage, fuel cells, and boilers, where the designed structure supply the electrical, heating, and cooling loads. A stochastic energy management planning has been proposed to address the integration of renewable energy resources into multi-MG due to its presence in a real-time electricity market [28]. Furthermore, in [29], mathematical modeling of an on-grid MG has been proposed considering the high penetration of uncertain renewable energy resources, as well as diesel generators, supplying the electrical and thermal loads. Another study [30] aims to determine an optimal sizing algorithm for the RESs, where different scenarios have been investigated for the operation of energy storage in an MG through techno-economic feasibility analysis. In a specific case study in India [31], optimal planning of MG has been addressed to find the placement of a hybrid system, including PV panel/WT/Bio-generator as renewable resources, as well as diesel generation and energy storage. A short term planning algorithm has been developed to plan the MG’s equipment considering its integration into electricity market [32]. Moreover, the sizing problem of a hybrid MG has been addressed in [33], which consists of various resources, and a method has been proposed to compare the multi-objective algorithm using the six sigma approach. To find the optimal operation of a residential MG, the uncertainties in the renewable resources and the electric vehicle has been modeled using two-point estimation method [34]. 5 A two-stage stochastic mixed-integer programming method has been proposed in [35] to determine the optimal size of different resources to meet the economic benefits and consumer welfare. A two-layer algorithm has been investigated in [36] to optimally size the energy storage considering dispatch of the virtual energy storage system in a smart MG with high PV penetration. In [37], an optimal algorithm has been proposed to justify the operation of various hybrid MG configurations for a specific case study of the Long San Village in Sarawak. A management algorithm has been presented to find the optimal sizing of the components to meet the maximum demand, the uncertainties arisen by weather conditions, and financial considerations. Moreover, the optimal sizing problem has been addressed in [38] to determine the optimal sizes of energy storage, PV panel, diesel generator, which are integrated into an MG. A management algorithm has been investigated in [39] to determine an optimal configuration for the MG, where a reliability study has been done to ensure the optimal operation of WT, PV panel, and tidal turbines. In [40], a novel algorithm has been proposed for multi-energy MGs, where different energy carriers have been deployed to justify the reliable configuration of the MG, exchanging energy with other MGs and the main electrical network, as well as gas network. A taxonomy table on the optimal sizing of renewable energy systems in a MG considering electricity market interaction and reliability analysis is presented in Table 1. Table 1: Taxonomy of the optimal sizing of renewable energy systems in a microgrid considering electricity market interaction and reliability analysis. Ref. Objective and Methodology Technology Reliability Uncertainty Electricity market Planning Optimal sizing Renewable Non-renewable Storage [1] Medium term - ■ - ■ - - - [2] Short term - ■ ■ ■ - ■ - [5] Short term - ■ - ■ - ■ - [9] Long term ■ ■ - ■ - - - [10] Short term ■ ■ ■ ■ - - - [11] Short term ■ ■ ■ ■ - ■ - [12] Short term ■ ■ - ■ - ■ - [13] Medium term ■ ■ - ■ ■ ■ - [14] Short term - ■ ■ ■ ■ - - [16] Long term - ■ ■ ■ ■ ■ ■ [17] Short term - ■ ■ ■ - - ■ [18] Short term - ■ - ■ - ■ ■ [19] Short term - ■ ■ ■ - - ■ [23] Medium term ■ ■ ■ ■ - ■ ■ [24] Short term ■ ■ - ■ - ■ - [25] Short term ■ ■ - ■ - ■ - [26] Short term ■ ■ - ■ - ■ - [27] Short term - ■ - ■ - ■ - [28] Medium term ■ ■ ■ ■ - ■ ■ [30] Medium term ■ ■ ■ ■ - ■ - [31] Short term - ■ ■ ■ - ■ ■ [35] Medium term ■ ■ ■ ■ - ■ - [36] Medium term ■ ■ - ■ - ■ - [37] Short term ■ ■ ■ ■ - ■ - [38] Short term ■ ■ ■ ■ - ■ - Our Paper Long term ■ ■ - ■ ■ ■ ■ 6 The main goal of this study is to address the optimal sizing of RESs in an MG, simultaneously considering both its interaction with the electricity market and the reliability issues, which have not been addressed in the majority of previous studies. As such, the main contributions of this study are:  Assessing the impact of the interaction between a smart MG, electricity market, and the distribution network on the optimal sizing of RESs.  Developing a new method to analyze the MG's reliability (i.e., loss of load expectation, loss of energy expectation, loss of power supply probability, and equivalent loss factor), which reduces the computation complexity without sacrificing the solution accuracy. The rest of the paper is planned according to: Section 2 presents the preliminaries on a smart MG involvement in the electricity market and its implementation. Section 3 shows the modeling of various MG components, including the fuel cell, PV, WT, and hydrogen tank. Section 4 demonstrates the proposed reliability assessment method for MGs with high RES penetration. Section 5 presents the RES optimal sizing method considering the interaction between the MG and the electricity market. Section 6 provides the simulation of the proposed method and shows the results for validation. Finally, Section 7 lists the conclusions and prospects for future work 2. Involvement of Smart Microgrid in Electricity Market The market, which is considered in this study, is along with the distribution network, in which the distribution network operator (DNO) has a managerial role in administering the interaction among the utilities [41]. This connection is demonstrated in Fig. 1. Utilities offer to sell different quantities of power at various prices according to their capabilities and constraints on producing power. These offers are provided to the DNO, which sorts them from the lowest to the highest price, a process through which the market clearing price (MCP) is obtained. This price, which is offered by each utility, is the most critical factor in determining their profit or loss. Various strategies can be used to obtain the optimal offered price, with the best one allowing a utility to achieve the least overall cost. At first, the electricity market participants compute their marginal cost and disclose it to DNO, who decides an initial MCP based on this information received from different players, clearing the market accordingly. Typically, each supplier makes an offering price built upon their most expensive unit. A. Cournot Modeling After the initial offers of the players to the market and the determination of an initial MCP by the DNO, this initial MCP is multiplied by a small coefficient, and then it is sent to participants. Equation 1 is used to compute the optimal price in an iterative framework [42]: ௝ܲܥܯ = ௝ିଵܲܥܯ − ෍ߙ ௜ܲ ௝ ௡ ௜ୀଵ (1) Note that the equation is recalculated in an iterative manner until the MCP converges to an optimal value. 7 Fig. 1. Interface between market players. 3. Modeling of Microgrid Components WT units, PV arrays, fuel cells, Electrolyzers, hydrogen tanks, and DC/AC converters are components used for supplying the MG. The model of each component is presented subsequently. A. Photovoltaic Panel The output power of PV panels can be calculated as: ௉ܲ௏ = ܩ 1000 × ௉ܲ௏,௥௔௧௘ௗ × ௉௏,௖௢௡௩ߟ (2) Considering incident solar irradiance at an angle, the vertical component can be calculated for the surface of a PV installed at an angle ߠ௉௏ according to the following (3) [43]: ,ݐ)ܩ (௉௏ߠ = (ݐ)௏ܩ × (௉௏ߠ)ݏ݋ܿ + (ݐ)ுܩ × (௉௏ߠ)݊݅ݏ (3) It should be noted that the other PV's specifications are obtained from [44]. B. Wind Turbine A power curve of a WT can be obtained according to the piecewise model available in [45]. The rated power of the WT considered in this study is 50 kW, and therefore the output power can be calculated as: ௐ்ܲ = ⎩ ⎪ ⎨ ⎪ ⎧ ௪ݒ ;0 ≤ ,௖௨௧௜௡ݒ ௪ݒ ≥ ௖௨௧௢௨௧ݒ ௐ்ܲ,௠௔௫ × ( ௪ݒ − ௖௨௧௜௡ݒ ௥ݒ − ௖௨௧௜௡ݒ )௠; ݒ௖௨௧௜௡ ≤ ௪ݒ ≤ ௥ݒ ௐ்ܲ,௠௔௫ + ௙ܲ௨௥௟ − ௐ்ܲ,௠௔௫ ௖௨௧௢௨௧ݒ − ௥ݒ × ௪ݒ) − ௥ݒ ;(௥ݒ ≤ ௪ݒ ≤ ௙ݒ (4) It should be noted that the ݉ is equal to 3 in this study. Wind speed data is measured at the height of 40 m while the WT hub height is equal to 15 m so that the hub-height to determine the wind speed can be adjusted based on (5). 8 ௐℎݒ = ௐݒ ௥௘௙ × ቆ ℎ ℎ௥௘௙ ቇ ఈೢ (5) Note that ߙ௪ is equal to 0.14, and other characteristics of the WT are determined based on [45]. C. Hydrogen Tank The stored energy at time ݐ in the hydrogen tank can be calculated using (6). (ݐ)௧௔௡௞ܧ = ݐ)௧௔௡௞ܧ − 1) + ௘ܲ௟ି௧௔௡௞(ݐ) × ݐ߂ − ௧ܲ௔௡௞ିி஼(ݐ) × ݐ߂ × ௦௧௢௥௔௚௘ߟ (6) It should be noted that ݐ߂ is assumed 1 hour in this study. To calculate the Hydrogen mass in the tank, (7) is applied. ݉௦௧௢௥௔௚௘(ݐ) = (ݐ)௧௔௡௞ܧ ܪܪ ுܸమ (7) It is assumed that due to some operational issues such as pressure drop in the tank, not all the stored hydrogen can be extracted. As a result, the accessible hydrogen in the tank is determined within a minimum and maximum range. ௧௔௡௞,௠௜௡ܧ ≤ (ݐ)௧௔௡௞ܧ ≤ ௧௔௡௞,௠௔௫ܧ (8) D. Fuel Cell Polymer electrolyte membrane (PEM) fuel cells have a reliable performance under different operating conditions and are manufactured on a large scale, where this type of fuel cell is commercially available. The output power of this fuel cell can be calculated as a function of its input Hydrogen power, as well as its efficiency (ߟி஼), which can be assumed to be constant: ிܲ஼ି௜௡௩ = ௧ܲ௔௡௞ିி஼ × ி஼ߟ (9) The output power of RESs can be calculated by summing the output powers of WTs and PVs. The total number of installed WTs and PVs is equal to ܰௐ் and ܰ௉௏, respectively. The output power of the RES is calculated by (10). ௥ܲ௘௡ = ܰௐ் × ௐ்ܲ +ܰ௉௏ × ௉ܲ௏ (10) An essential point in reliability calculation is to consider the probability of the generators' shut-down. Disconnecting these generators may be planned or occurred due to an emergency. Assuming problems like protection, WTs, and PVs being disconnected result in ݊ௐ் ௙௔௜௟ and ݊௉௏ ௙௔௜௟ , respectively. The output power of all RESs can thus is calculated by (11). ௥ܲ௘௡൫݊ௐ் ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ = ൫ܰௐ் − ݊ௐ் ௙௔௜௟൯ × ௐ்ܲ + ൫ܰ௉௏ − ݊௉௏ ௙௔௜௟൯ × ௉ܲ௏ (11) E. Operation Scenarios of Renewable Energy Resources In this section, the smart MG operation strategy is reviewed. The system operation is determined by the operating conditions. Basically, at any time step, one of the following conditions may be met:  ௥ܲ௘௡(ݐ) = ௉೗೚ೌ೏షವೃ(௧) ఎ೔೙ೡ : In this scenario, all the power generated by the renewable resources is injected into the load through a DC/AC converter. 9  ௥ܲ௘௡(ݐ) > ௉೗೚ೌ೏షವೃ(௧) ఎ೔೙ೡ : In this scenario, the excess power generated by wind and solar units is directed to the electrolyzer to be converted to hydrogen. If the power injected into the electrolyzer exceeds its nominal capacity, or the hydrogen storage tank is full, the excess power is sold to the distribution grid considering the maximum capacity of the distribution transformer.  ௥ܲ௘௡(ݐ) < ௉೗೚ೌ೏షವೃ(௧) ఎ೔೙ೡ : Under this scenario, demand's deficit is supplied by the fuel cell. If this deficit is more than the nominal capacity of the battery, or if the hydrogen in the tank is not enough, the required power is purchased from the distribution grid. If the purchased power exceeds the capacity of the distribution transformer, part of the load must be shed, resulting in the load loss. 4. Reliability Assessment Various studies have introduced several indices for determining the reliability of MG, encompassing: loss of load expectation (LOLE), loss of energy expectation (LOEE) or expected energy not supplied (EENS), loss of power supply probability (LPSP), and equivalent loss factor (ELF). The above indices are defined by the following equations. ܧܮܱܮ = ෍[(ݐ)ܮܱܮ]ܧ ே ௧ୀଵ (12) In Equation (12), ܧ[. ] Denotes the expectation of variable in the time interval ݐ, which can be defined by the following equation: [ܮܱܮ]ܧ = ෍ ௦ܶ × ௦ܲ ௦∈ௌ (13) The LOEE or EENS is defined as follows: ܧܧܱܮ = ܵܰܧܧ = ෍[(ݐ)ܧܱܮ]ܧ ே ௧ୀଵ (14) where, [ܧܱܮ]ܧ = ෍ܳ௦ × ௦ܲ ௦∈ௌ (15) Furthermore, the LPSP is denoted as follows: ܲܵܲܮ = ܧܧܱܮ ∑ ே(ݐ)ܦ ௧ୀଵ (16) As ELF provides more information about the number of losses and their amounts [46], this index is chosen for reliability analysis in this study, where the nominal index is justified by ELF=0.01. The ELF is defined by Equation (17).    1 1 N t Q t ELF N D t   (17) 10 A. Microgrid Reliability Modelling The reliability calculations are done assuming the probability of failure for WTs, PVs, and the outage of the DC/AC converter. Forced outage rate (FOR) for WTs and PVs is considered 4% [47], so each WT and PV is available by a probability of 96%. The probability of outage for each unit can be calculated based on a binomial distribution function [48]. The probability of outage of ݊ௐ் ௙௔௜௟ from installed NWT and outage of ݊௉௏ ௙௔௜௟ from installed NPV is calculated by (18). ௥݂௘௡൫݊ௐீ ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ = ቈቆ ܰௐீ ݊ௐீ ௙௔௜௟ቇ × ௐீܣ ேೈಸି௡ೈಸ ೑ೌ೔೗ × (1 − ௐீ)௡ೈಸܣ ೑ೌ೔೗ ቉ × ቈቆ ܰ௉௏ ݊௉௏ ௙௔௜௟ቇ × ௉௏ܣ ேುೇି௡ುೇ ೑ೌ೔೗ × (1 − ௉௏)௡ುೇܣ ೑ೌ೔೗ ቉ (18) The outage probability of other components is negligible in comparison with WTs and PVs. However, considering the importance of the DC/AC converter, the outage probability of this component should be assumed in reliability analysis. Due to the lack of sufficient references evaluating the reliability of electronic power converters, finding the outage rate of the converter is difficult. The approximate output rate of a DC/AC converter is calculated by combining the information [49], [50]. It is assumed in [51] that the mean time to failure (MTTF) of each component is equal to the inverse of the failure rate. Accordingly, if the failure rate of a converter is 2.5*10-5 [52], then the MTTF is equal to 37037 hours. It is also mentioned in [49] that the mean time to repair (MTTR) of a DC/AC converter is almost 40 hours. If m is the mean time to failure, and r the mean time to repair a component, then the reliability or availability can be calculated by (19). ܣ = ݉ ݉ + ݎ (19) So, the availability of a DC/AC converter is equal to 99.89% in this study, which exhibits higher reliability in comparison with WTs and PVs. Finally, assuming ௜ܰ௡௩ DC/AC converter, the outage probability of ݊ௐ் ௙௔௜௟ WT, ݊௉௏ ௙௔௜௟ PV, and ݊௖௢௡௩ ௙௔௜௟ DC/AC converter is calculated by (20). ெ݂ீ൫݊ௐீ ௙௔௜௟ , ݊௉௏ ௙௔௜௟ , ݊௖௢௡௩ ௙௔௜௟ ൯ = ௥݂௘௡൫݊ௐீ ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ × ቆ ௖ܰ௢௡௩ ݊௖௢௡௩ ௙௔௜௟ ቇ × ௖௢௡௩ܣ ே೎೚೙ೡି௡೎೚೙ೡ ೑ೌ೔೗ × (1 − ௖௢௡௩)௡೎೚೙ೡܣ ೑ೌ೔೗ (20) Fig. 2 shows the availability probability of fuel cell over a 10-year period [53]. As shown in Fig. 2, fuel cell availability is more than 99% in the first 5-year period. As a result, the outage of the fuel cell is considered negligible in this study. B. Proposed Reliability Assessment Method To assess the reliability of the MG, all possible states of the MG's operation should be considered. The reliability indices should be determined, considering the probability of the MG being in each state and the amount of lost load in that state. As mentioned in the previous section, the outage probabilities of WTs, PVs, and the DC/AC converter are considered in this study. To analyze the reliability of a system, including 14 WTs and 199 PVs, the system should be studied in 2*15*200=6000 different states. Therefore, if the annual behavior of the MG is going to be explored, 8760*6000=52560000 different cases should be assessed. If a PSO algorithm optimizes these calculations with 30 particles over 200 iterations, it will take an exorbitantly long time. Therefore, it is necessary to have a computationally-efficient method within an acceptable range of accuracy. Therefore, this section presents a method for reliability assessment, which guarantees both an acceptable level of accuracy and computational burden. 11 Fig. 2. Fuel cell reliability vs. time (solid line: first 5-year period; dashed-line: second 5-year period) [54]. In this method, the outage of WTs and PVs is replaced by the average output of WTs and PVs, and a mathematical expectation of reliability indices is calculated based on this average as shown below: ]ܧ ௥ܲ௘௡] = ෍ ௥ܲ௘௡(ݏ) × ௣݂(ݏ) ௦∈ௌ (21) ]ܧ ௥ܲ௘௡] = ෍ ෍ ൛ ௥ܲ௘௡൫݊ௐ் ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ × ௣݂൫݊ௐ் ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ൟ ேುೇ ௡ುೇ ೑ೌ೔೗ୀ଴ ேೈ೅ ௡ೈ೅ ೑ೌ೔೗ୀ଴ (22) ]ܧ ௥ܲ௘௡] = ෍ ෍ ൛൫ܰௐ் − ݊ௐ் ௙௔௜௟൯ × ௐ்ܲ × ௣݂൫݊ௐ் ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ൟ ேುೇ ௡ುೇ ೑ೌ೔೗ୀଵ ேೈ೅ ௡ೈ೅ ೑ೌ೔೗ୀଵ ᇩᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇪᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇫ ஺ + ෍ ෍ ൛൫ܰ௉௏ − ݊௉௏ ௙௔௜௟൯ × ௉ܲ௏ × ௣݂൫݊ௐ் ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ൟ ேುೇ ௡ುೇ ೑ೌ೔೗ୀଵ ேೈ೅ ௡ೈ೅ ೑ೌ೔೗ୀଵ ᇩᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇪᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇫ ஻ (23) ܣ = ௐ்ܲ × ෍ ൞൫ܰௐ் − ݊ௐ் ௙௔௜௟൯ × ෍ ௣݂൫݊ௐ் ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ ேುೇ ௡ುೇ ೑ೌ೔೗ୀଵ ൢ ேೈ೅ ௡ೈ೅ ೑ೌ೔೗ୀଵ (24) ܣ = ௐ்ܲ × ෍ ൞ܰௐ் × ෍ ௣݂൫݊ௐ் ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ ேುೇ ௡ುೇ ೑ೌ೔೗ୀଵ − ݊ௐ் ௙௔௜௟ × ෍ ௣݂൫݊ௐ் ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ ேುೇ ௡ುೇ ೑ೌ೔೗ୀଵ ൢ ேೈ೅ ௡ೈ೅ ೑ೌ೔೗ୀଵ (25) ܣ = ௐ்ܲ × ܰௐ் × ෍ ෍ ௣݂൫݊ௐ் ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ ேುೇ ௡ುೇ ೑ೌ೔೗ୀଵ ேೈ೅ ௡ೈ೅ ೑ೌ೔೗ୀଵ ᇩᇭᇭᇭᇭᇭᇭᇭᇭᇪᇭᇭᇭᇭᇭᇭᇭᇭᇫ ଵ − ௐ்ܲ × ෍ ⎩ ⎪ ⎨ ⎪ ⎧ ݊ௐ் ௙௔௜௟ × ෍ ௣݂൫݊ௐ் ௙௔௜௟ , ݊௉௏ ௙௔௜௟൯ ேುೇ ௡ುೇ ೑ೌ೔೗ୀଵ ᇩᇭᇭᇭᇭᇭᇭᇪᇭᇭᇭᇭᇭᇭᇫ ஼ ⎭ ⎪ ⎬ ⎪ ⎫ேೈ೅ ௡ೈ೅ ೑ೌ೔೗ୀଵ (26) 12 ܥ = ቆ ܰௐ் ݊ௐ் ௙௔௜௟ቇ × ௐ்ܣ ேೈ೅ି௡ೈ೅ ೑ೌ೔೗ × (1 − ௐ்)௡ೈ೅ܣ ೑ೌ೔೗ × ෍ ቊቆ ܰ௉௏ ݊௉௏ ௙௔௜௟ቇ × ௉௏ேುೇି௡ುೇܣ ೑ೌ೔೗ × (1 − ௉௏)௡ುೇܣ ೑ೌ೔೗ ቋ ேುೇ ௡ುೇ ೑ೌ೔೗ ᇩᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇪᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇫ ஽ (27) Considering binomial expansion (D=1), so: ܣ = ௐ்ܲ × ܰௐ் − ௐ்ܲ × ෍ ቊ݊ௐ் ௙௔௜௟ × ቆ ܰௐ் ݊ௐ் ௙௔௜௟ቇ × ௐ்ܣ ேೈ೅ି௡ೈ೅ ೑ೌ೔೗ × (1 − ௐ்)௡ೈ೅ܣ ೑ೌ೔೗ ቋ ேೈ೅ ௡ೈ೅ ೑ೌ೔೗ୀଵ ᇩᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇪᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇭᇫ ா (28) .]ܧ ] is the mathematical expectation of binomial expansion, which can be calculated by (28). Equation (28) is extracted from Equation (26) according to [55] and binominal distribution, which is determined as follows: ෍ݔ × ቀ݊ݔቁ × ௫݌ × ௡ି௫ݍ = ݊ × ݌ ௡ ௫ୀ଴ (29) ܣ = ௐܲீ × ܰௐீ × ௐீ (30)ܣ ܤ = ௉ܲ௏ × ܰ௉௏ × ௉௏ (31)ܣ Finally, ܧ[ ௥ܲ௘௡] can be calculated as follows: ]ܧ ௥ܲ௘௡] = ܰௐீ × ௐܲீ × ௐீܣ +ܰ௉௏ × ௉ܲ௏ × ௉௏ (32)ܣ C. Uncertainty Modelling Given the high penetration of WTs and PVs in MGs, modeling the time series of wind speed and solar irradiation is an important consideration in the long-term planning of power systems. Since this paper's main objective is to determine the capacity of an MG's components, information on wind speed and solar irradiation are necessary. It is also essential to consider their associated uncertainties in the calculations. In this study, the Copula method is applied to model the uncertainties, which has higher accuracy in the long-term, unlike other methods like autoregressive, Markov, and so on [56], [57]. In different studies, stochastic variables may be considered entirely dependent, linearly dependent, or completely independent. System specifications and required accuracy are among the factors that determine this initial modeling assumption. Wind speed, solar radiation, and load behavior in their time series have high levels of dependence. For example, present solar irradiation values are highly correlated with the values of solar irradiation in previous days, so the method presented in this section can be useful. This procedure involves the following three steps:  Sequential correlation matrix modeling;  Modeling of marginal distributions;  Presenting the final model by linking the results of steps 1 and 2 by the Copula method. To do the simulation, the appropriate Copula family and its parameters, the correlation between variables, and marginal distributions of each variable should be determined. Selecting and fitting the appropriate Copula method based on a real dataset is an important part of this modeling approach. According to the maximum similarity method (applying risk modeling software), the best type of Copula function is selected. 13 The steps of modeling uncertainty (wind speed, solar irradiance, and load) using the Copula method are as follows: 1) Arranging the sampled data into a matrix whose columns are the number of samples per day (nv = 24), and its rows are days for one year (ns = 365). 2) Assigning an appropriate distribution function to each of the columns of this matrix. One of the advantages of Copula is the ability to set different distribution functions to each of the columns in this matrix. 3) Calculating the correlation matrix (nv × nv) between all the assigned distribution functions (rank correlation). 4) Copula allocation (converting existing distribution functions into a multivariable distribution function). 5) Obtaining the information needed for the corresponding period. 5. Optimal Sizing of Smart Microgrid Components The optimal size of RESs, including WT, PV, fuel cell, Hydrogen tank, and electrolyzer, are determined. This optimal sizing is done considering the interaction between the electricity market and the smart MG. ELF as a reliability index is considered in the constraints of the objective function, which is defined as follows. It is worthwhile to mention that an optimization problem has been solved using the hourly data recorded over one year, including wind speed, solar irradiance, wind direction, and temperature. ௦௜௭௜௡௚ܨܱ = ݊݅ܯ ൝෍ܰܲܥௐ்.୘ ୌ ୘ୀଵ +෍ܰܲܥ௉௏.୘ ୌ ୘ୀଵ + ෍ܰܲܥி஼.୘ ୌ ୘ୀଵ +෍ܰܲܥு்.୘ ୌ ୘ୀଵ + ෍ܰܲܥா௅.୘ ୌ ்ୀଵ ௥்ܥܲܰ+ +෍ܥ௖.୘ ୌ ୘ୀଵ + ෍ܥ௕.୘ ୌ ୘ୀଵ −෍ܥ௦.୘ ୌ ୘ୀଵ ൡ (33) The ܰܲܥ of each component can be calculated by Equation (34): NPC = ݌ܽܥ × ஼஼ܥ) + ோ஼ܥ × SP + ைெܥ × AP) (34) To calculate NPC, the interest rate should be determined, which can be calculated based on the nominal interest and annual inflation rates, formulated in Equation (35): ݎ݅ = ൫݅ݎ௥ − ݅௙൯ ൫1 + ݅௙൯ (35) AP and SP in (34) are determined as follows: ܲܣ = (1 + ு(ݎ݅ − 1 1)ݎ݅ + ு(ݎ݅ (36) ܵܲ = ෍ 1 (1 + ௡×௬(ݎ݅ ேೝ ௡ୀଵ (37) Furthermore, the penalty cost load curtailment is calculated as follows: ௖ܥ = ܧܧܱܮ × ௔௩௘ܮ (38) 14 Assuming the integration of the smart MG in the competitive electricity market, we obtain: ௕ܥ = ∑ ௕ܲ(ݐ) × (ݐ)ܲܥܯ × ே೟ܲܣ ௧ୀଵ (39) ௦ܥ = ෍ ௦ܲ(ݐ) × (ݐ)ܲܥܯ × ܲܣ ே೟ ௧ୀଵ (40) Finally, the objective function is optimized by considering the constraints of each component, as well as the following reliability constraints: [ܨܮܧ]ܧ ≤ ௠௔௫ܨܮܧ (41) ݐ)௧௔௡௞ܧ = 0) ≤ ݐ)௧௔௡௞ܧ = 8760) (42) 6. Case Study A residential complex named Ekbatan residential town is taken into account as the validation case study. Therefore, the Iranian electricity tariff scheme is considered: (i) off-peak electricity price of 0.1 $/kWh, and (ii) on-peak electricity price of 0.15 $/kWh [58]. The smart MG contains WT, PV, fuel cell, Electrolyzer, Hydrogen tank, controllable and uncontrollable loads. Line data for the MG is presented in Table 2. The schematic representation of the MG and its components is shown in Fig. 3. This smart MG is connected to a 20 kV substation, where the layout of this smart MG is radial, considering that the 20 kV network of this MG consists of an underground cable. The single line diagram of this MG is shown in Fig. 4. The specifications (i.e., unit size, capital cost, replacement cost, and operation & maintenance cost) of the components, including WT, PV panel, fuel cell, and electrolyzer are presented in Table 3 [11], [23] and [59]. It should be noted that the commercial size of components is considered according to the commercial model. Since the solar irradiance is sufficiently acceptable in Ekbatan town, and there is enough space to install PV panels on the roof of the buildings, the PV panels are selected as one of the power resources in Ekbatan town. Furthermore, due to the measured wind speed in Ekbatan town, it is justified that this residential town has a good potential for installing WTs. In this study, wind speed and solar irradiance information of the studied area (i.e., Ekbatan town) is collected hourly for a period of one year. This information is stored in a data logger and transmitted to the computer through this data logger. The schematic of the data collection system is shown in Fig. 5, which includes local monitoring, data logger, irradiance sensor, wind speed sensor, wind direction sensor, and temperature sensor. Table 2: Line data of a case study network. Node Number Node Number Resistance (p.u) Reactance (p.u) A1 A2 0.0058 0.0029 A2 A3 0.0308 0.0157 A2 A4 0.0102 0.0098 A4 A5 0.0939 0.0846 A5 B1 0.0255 0.0298 B1 B2 0.0442 0.0585 A3 B3 0.0282 0.0192 B3 B4 0.0560 0.0442 B4 C2 0.0559 0.0437 15 H2 Tank AC/DC DC/AC Fig. 3. Schematic representation of the microgrid and its components. 63/20 KV Substation A2 A3 A4 A5 B1 B2 B3 B4 A1 C2 Fig. 4. Single line diagram of the simulated microgrid. Table 3: Optimal Number of the components of smart microgrid before and after participation in electricity market considering reliability indices. Unit Size (kW) Model Capital Cost ($/kW) Replacement Cost ($/kW) Operation & Maintenance Cost ($/kW) Wind turbine 500 Norwin 47-ASR-500 1500 1000 15 Photovoltaic panel 0.4 LG400N2T-J5 2000 - 20 Fuel cell 100 Ballard 3000 2500 175 Electrolyzer 1000 MCPHY 2000 - 25 Fig. 5. Block diagram of the ambience data collection system. 16 The required data to enable the simulation of the studied MG includes annual solar irradiance and wind information along with the Ekbatan town, which is collected with an accuracy of one sample per hour (Fig. 6 and Fig. 7). The load profile of Ekbatan town is determined according to the IEEE standard curve for the residential loads, where the peak demand of different nodes is defined by the data received from the distribution grid. Fig. 8 (a) shows the load profile of the nodes A1-A5 and C2, and the load profile of the nodes B1-B4 is presented in Fig. 8 (b). A. Simulation Results of Electricity Market To replicate the electricity market, the initial MCP is provided to the MG to be applied in the optimization model, as provided in Table 4. Hence, the primary MCP is defined as an input to the optimization model to find the optimal MCP, realizing the optimal interaction between MG and electricity market, as well as minimizing the total cost of MG. The final MCP is presented in Table 5, which is determined through the optimization algorithm defined in Equation (33). As can be seen from Table 5, the final MCP decreases compared to the primary MCP to decrease the cost of interactions between MGs and electricity market. Furthermore, the MCP is lower during the first hours due to the residential load attributes. Fig. 6. Solar irradiance (W/m2) measured in Ekbatan town over one year. Fig.7. wind speed (m/s) measured in Ekbatan town over one year. 17 Fig.8. Load profile of Ekbatan town. (a) load profile of nodes A1-A5 and C2; (b) load profile of nodes B1-B4. Table 4: Primary market clearing price. Time (hour) 1 2 3 4 5 6 7 8 9 10 11 12 Primary market clearing price ($/kW) 13.89 13.89 13.08 13.08 13.89 13.11 13.99 13.89 13.90 13.90 13.91 13.90 Time (hour) 13 14 15 16 17 18 19 20 21 22 23 24 Primary market clearing price ($/kW) 13.90 13.90 13.90 13.90 13.89 13.90 13.90 13.90 13.90 13.90 13.90 13.90 Table 5: Final market clearing price. Time (hour) 1 2 3 4 5 6 7 8 9 10 11 12 Primary market clearing price ($/kW) 13.60 13.21 13.03 12.89 13.18 13.10 13.22 13.29 13.76 13.67 13.65 13.56 Time (hour) 13 14 15 16 17 18 19 20 21 22 23 24 Primary market clearing price ($/kW) 13.50 13.57 13.59 13.64 13.46 13.72 13.65 13.72 13.38 13.29 13.87 13.44 B. Sizing of Smart Microgrid’s Components The optimal size of RESs, including WT, PV, fuel cell, as well as, electrolyzer, hydrogen tank, in a smart MG is obtained and compared to a base case where the smart MG is considered as a price taker. The optimal sizes of different components are provided in Table 6. As shown in Table 6, the optimal size of all components reduces after participation in the electricity market since the MG can participate as the price maker in the electricity market, impacting the MCP. 18 On the other hand, participation of the MG in the competitive electricity market improves the benefits that MG can gain from the power transactions, i.e., the MG can purchase its power by the reduced costs from the electricity market. Hence, the optimal size of MG’s components decreases compared to the base case, where MG does not participate in the market. It should be noted that the total cost of the smart MG decreases by 3.6% after size reduction of the components due to participation in the electricity market. Table 6: Optimal Number of the components of smart microgrid before and after participation in electricity market considering reliability indices. WT PV Fuel cell Electrolyzer Hydrogen Tank Optimal size of MG’s components before participation in the market 30 27352 23 28 35 Optimal size of MG’s components after participation in the market 27 24715 22 24 30 C. Proposed Reliability Method Assessment As discussed in Section 4, an approximate model is presented in this paper to evaluate the reliability of the MG with an acceptable accuracy. In order to compare the accuracy of the approximate model with the exact model, these methods are both tested on the studied MG. An approximate model's run time is about 0.2 of the time required to execute the precise model. Therefore, this can be expected to reduce the run time from 20 hours to about 4 hours by using an approximate model to optimize the system for the given conditions, which is a significant reduction. The results of the approximate and exact models are shown in Table 7, justifying the high accuracy of the approximate model. It should be noted that the net present cost of the MG and its initial investment cost depend on the MG model. As a result, there is no difference between the exact model's values and the approximate model, i.e., the difference between the approximate model application on the MG and the exact model is only in the reliability calculations of the MG. An interesting note in Table 7 is the value of ELF obtained at the optimal point. As noted earlier in defining the objective function, ௦ indicates customer dissatisfaction or loss due to the interruption. In addition to the objective function, constraint define by Equationܥ (41) also affects and limits the load loss. Hence, maintaining system reliability is considered in this study. According to the results, as shown in Table 7, the MG reliability is not affected by application of the approximate model, where the computation complexity decreases. It should be noted that the high cost of load loss (i.e., high penalty should be paid in case of load loss) verifies the importance of reliability. Table 7: comparison between reliability indices using exact model along with approximate model. ELF LOEE (MWh/year) LPSP LOLE (hr/year) Exact Model 0.00825 56.1176 0.008654 2.23 Approximate Model 0.00833 57.4231 0.008801 2.87 1) Reliability Index Sensitivity Analysis As mentioned in Section 4, ELF is chosen as the reliability index in this study. In this section, the sensitivity analysis of smart MG is determined according to this index. If the maximum bound for ELF is considered 0.0001, the following results are obtained (Table 8). Accordingly, the calculated ELF is equal to 0.0011, which does not satisfy the constraint and fails in meeting the acceptable for a reliable MG. This issue is predictable due to the MG’s specifications and is explained in this section, where a solution is suggested for tackling this problem. 19 It can be seen from Section 4 that the availability probability of a DC/AC converter is 0.9989. On the other hand, the DC/AC converter is installed in series to load. According to reliability theory, the reliability of a system consisting of series components is equal to the product of the reliability of each component. As a result, the reliability of the system can never exceed the reliability of the DC/AC converter. The minimum possible ELF of this system will be equal to the output rate of the converter, 0.0011. The reliability indices of the system during the year are shown in Fig. 9 (ELF=0.0001). Two different solutions can be considered to improve the reliability of a system by either using more reliable components or changing the structure of the system. In this study, a simple way is assumed to increase the system's reliability, which is to use two DC/AC converters in parallel, so the ELF is reduced to 0.00000121. In order to see the efficiency of the first method, the optimization solution is obtained, considering the availability of all components, and the obtained results are shown in Table 8, where the reliability of the MG improves due to considering the availability of all components. Table 8: Calculated reliability indices for elf=0.0001 under two different cases. Case ELF LOEE (MWh/year) LPSP LOLE (hr/year) Exact model 0.0011 6.1028 0.0012 1.12 Exact model and availability of all components 0.0001 0.0743 0.000157 0.2 Fig. 9. Reliability indices, including LOEE and ELF obtained over one year (ELF=0.0001). 2) Optimization without Reliability Indices The loss from power outage per kWh ranges from about 2 $ to 12 $ for residential consumers and can change from 5 $ to 40 $ for industrial ones. The average amount of this loss is equal to 5.6 $. This section solves the optimization problem without considering the constraint (41) to compare the costs of supplying loads with load loss, intending to find a break-even point in production costs and not supplied load costs. At this point, the final energy production cost is expected to be equal to the average cost of load loss. To better understand the costs of load supply, the optimal operation of the MG is calculated without any reliability constraint. This calculation is done for both loss costs of 2 $/kWh and 12 $/kWh (equal to the minimum and maximum energy loss costs for residential consumers). 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 0 5 10 15 20 LO EE [k W h] 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 0 0.2 0.4 0.6 0.8 1 EL F time [hour] 20 The obtained results are presented in Table 9. As can be seen, if the loss cost is equal to 2 $/kWh, it means that about 99.85% of the MG loads are supplied. However, with the cost of loss load increasing to 12 $/kWh, this value is more than 99.98%. Table 10 shows the results of the comparison between the average MG costs. In this table, the average cost of energy production equals the ratio of the production costs to the total supplied load. Therefore, the following notes can be concluded according to the obtained results as follows:  By increasing MG reliability or increasing loss load cost, the average cost of the MG increases, which is reasonable based on the assumptions of this study.  At the break-even point, the average cost of the MG is higher than the average cost of energy production. Also, if the reliability constraint is considered, the difference between the average cost of power generation and the average cost of the MG is reduced.  If all loads are supplied (100% reliable), these two values are equal, which is also logical, i.e., if increasing the reliability of the MG is not economically feasible, the cost to improve the MG reliability is more than the supplied load value. As a result, the production cost of the MG increases. Table 9: Comparison between reliability indices for two loss costs of 2 $/kWh and 12 $/kWh. ELF LOEE (MWh/year) LPSP LOLE (hr/year) Loss cost = 2 $/kWh 0.0.02216 161.7753 0.02517 12.42 Loss cost = 12 $/kWh 0.001572 6.371 0.001816 1.07 Table 10: Average cost, including average production cost, average system cost, and loss load cost, as well as ELF, over a 20-year period. ELF The average production cost ($/kWh) The average system cost ($/kWh) The loss load cost ($/kWh) ELFmax 0.02216 0.4409 0.4574 2 1 0.008836 0.4600 0.4838 5.6 1 0.001574 0.4837 0.4952 12 1 0.0011 0.5003 0.5032 5.6 0.0001 7. Conclusions In this study, an optimization model to determine the optimal size of components, including WT, fuel cell, PV, hydrogen tank, and electrolyzer in a smart MG, was presented. This optimal sizing was addressed based on MG's participation as a price-maker in the electricity market. To assess the effects of the MG's participation in the market as a price maker, the total cost of the MG was calculated and compared to the base case where MG was considered as the price-taker. Moreover, a novel reliability assessment method was proposed for the computationally-efficient calculation of a reliability index used as a constraint in the optimization problem. The results were shown that MG participation in the electricity market was decreased the total cost of the MG by 3.6%. The MCP was used as criteria in order to specify the amount of electricity transaction between the MG and the electricity market. The obtained results verified that if the MCP is high, more electricity will be sold to the market, where the purchased electricity will increase when MCP is low. As a result, the MCP can be applied as the criteria for determining the electricity transaction with the market. Defining the suitable energy transaction between the electricity market and MG can decrease the total cost and optimize the size of RESs. Finally, a sensitivity analysis showed a significant effect of different components' reliability on the optimization model. 21 References [1] K. Rahbar, C. C. Chai and R. Zhang, “Energy Cooperation Optimization in Microgrids With Renewable Energy Integration,” IEEE Transactions on Smart Grid, vol. 9, no. 2, pp. 1482-1493, 2018. [2] P. Zhuang, H. Liang and M. Pomphrey, “Stochastic Multi-Timescale Energy Management of Greenhouses With Renewable Energy Sources,” IEEE transactions on sustainable energy, vol. 10, no. 2, pp. 905-917, 2019. [3] V. Pilloni, A. Floris, A. Meloni and L. Atzori, “Smart Home Energy Management Including Renewable Sources: A QoE-Driven Approach,” IEEE transaction on smart grid, vol. 9, no. 3, pp. 2006-2018, 2018. [4] V. T. Tran, K. Muttaqi and D. Sutanto, “A Robust Power Management Strategy With Multi-Mode Control Features for an Integrated PV and Energy Storage System to Take the Advantage of ToU Electricity Pricing,” IEEE Transactions on Industry Applications, vol. 55, no. 2, pp. 2110 - 2120, 2019. [5] F. Y. Melhem, O. Grunder, Z. Hammoudan and N. Moubayed, “Energy Management in Electrical Smart Grid Environment Using Robust Optimization Algorithm,” IEEE Transactions on Industry Applications, vol. 54, no. 3, pp. 2714 - 2726, 2018. [6] L. Bagherzadeh, H. Shahinzadeh, H. Shayeghi and G. B. Gharehpetian, “A Short-Term Energy Management of Microgrids Considering Renewable Energy Resources, Micro-Compressed Air Energy Storage and DRPs,” International Journal of Renewable Energy Research (IJRER), vol. 9, no. 4, pp. 1712-1723, 2019. [7] J. Faraji, A. Abazari, M. Babaei, S. M. Muyeen and M. Benbouzid, “Day-ahead optimization of prosumer considering battery depreciation and weather prediction for renewable energy sources,” Applied Sciences, vol. 10, no. 8, p. 2774, 2020. [8] M. Babaei, E. Azizi, M. T. Beheshti and M. Hadian, “Data-Driven load management of stand-alone residential buildings including renewable resources, energy storage system, and electric vehicle,” Journal of Energy Storage, vol. 28, p. 101221, 2020. [9] O. Erd, “Comprehensive Optimization Model for Sizing and Siting of DG Units, EV Charging Stations, and Energy Storage Systems,” IEEE transaction on smart grid, vol. 9, no. 4, pp. 3871- 3882, 2018. [10] O. D. Melgar-Dominguez, M. Pourakbari-Kasmaei and J. R. S. Mantovani, “Adaptive Robust Short-Term Planning of Electrical Distribution Systems Considering Siting and Sizing of Renewable Energy Based DG Units,” IEEE Transactions on Sustainable Energy, vol. 10, no. 1, pp. 158-169, 2019. [11] S. M. Hakimi, A. Hasankhani, M. Shafie-khah and J. P. Catalao, “Optimal sizing and siting of smart microgrid components under high renewables penetration considering demand response,” IET Renewable power generation, vol. 13, no. 10, pp. 1809 - 1822, 2019. [12] B. Naghabi, M. A. S. Masoum and S. Deilami, “Effects of V2H Integration on Optimal Sizing of Renewable Resources in Smart Home Based on Monte Carlo Simulations,” IEEE Power and Energy Technology Systems Journal, vol. 5, no. 3, pp. 73-84, 2018. [13] H. Bakhtiari and R. A. Naghizadeh, “Multi-criteria optimal sizing of hybrid renewable energy systems including wind, photovoltaic, battery, and hydrogen storage with ɛ-constraint method,” IET Renewable Power Generation, vol. 12, no. 6, pp. 883-892, 2018. [14] S. J. A. D. Hosseini, M. Moradian, H. Shahinzadeh and S. Ahmadi, “Optimal Placement of Distributed Generators with Regard to Reliability Assessment using Virus Colony Search Algorithm,” International Journal of Renewable Energy Research (IJRER),, vol. 8, no. 2, pp. 714-723, 2018. [15] M. Fan, K. Sun, D. Lane, W. Gu, Z. Li and F. Zhang, “A Novel Generation Rescheduling Algorithm to Improve Power System Reliability With High Renewable Energy Penetration,” IEEE Transactions on Power Systems, vol. 33, no. 3, pp. 3349 - 3357, 2018. [16] J. Guoo, W. Liu, F. R. Syed and J. Zhang, “Reliability assessment of a cyber physical microgrid system in island mode,” CSEE Journal of Power and Energy Systems, vol. 5, no. 1, pp. 46-55, 2019. [17] H. Khajej, A. A. Foroud and H. Firoozi, “Robust bidding strategies and scheduling of a price-maker microgrid aggregator participating in a pool- based electricity market,” IET Generation, transmission & distribution, vol. 13, no. 4, pp. 468-477, 2019. [18] A. Khayatian, M. Barati and G. J. Lim, “Integrated Microgrid Expansion Planning in Electricity Market With Uncertainty,” IEEE Transactions on Power Systems, vol. 33, no. 4, pp. 3634-3643, 2018. [19] R. Lahon, C. P. Gupta and E. Fernandez, “Optimal Power scheduling of Cooperative Microgrids in Electricity Market Environment,” IEEE Transactions on Industrial Informatics, vol. 15, no. 7, pp. 4152-4163, 2019. [20] H. Khaloie, A. Anvari-Moghaddam, J. Contreras and P. Siano, “Risk-Involved Optimal Operating Strategy of a Hybrid Power Generation Company: A Mixed Interval-CVaR Model,” Energy, p. 120975, 2021. [21] H. Khaloie, A. Anvari-Moghaddam, N. Hatziargyriou and J. Contreras, “Risk-constrained self-scheduling of a hybrid power plant considering interval-based intraday demand response exchange market prices,” Journal of Cleaner Production, vol. 282, p. 125344, 2021. [22] M. K. Kiptooa, M. E. Lotfyab, O. Adewuyia, A. Conteha, A. M. Howladerc and T. Senjyu, “Integrated approach for optimal techno-economic planning for high renewable energy-based isolated microgrid considering cost of energy storage and demand response strategies,” Energy Conversion and Management, vol. 215, p. 112917, 2020. [23] A. Hasankhani and S. M. Hakimi, “Stochastic energy management of smart microgrid with intermittent renewable energy resources in electricity market,” Energy, vol. 219, p. 119668, 2021. [24] D. Yang, C. Jiang, G. Cai, D. Yang and X. Liu, “Interval method based optimal planning of multi-energy microgrid with uncertain renewable generation and demand,” Applied Energy , vol. 277, p. 115491, 2020. [25] S. Geng, M. Vrakopoulou and I. A. Hiskens, “Chance-constrained optimal capacity design for a renewable-only islanded microgrid,” Electric Power Systems Research, vol. 189, p. 106564, 2020. [26] T. Jin, V. K. Subramanyam, K. K. Castillo-Villar and F. Sun, “Optimal Sizing of Renewable Microgrid for Flow Shop Systems under Island Operations,” Procedia Manufacturing, vol. 51, pp. 1779-1784, 2020. [27] F. Tooryan, H. HassanzadehFard, E. R. Collins, S. Jin and B. Ramezani, “Smart integration of renewable energy resources, electrical, and thermal energy storage in microgrid applications,” Energy, vol. 212, p. 118716, 2020. [28] S. M. Hakimi, A. Hasankhani, M. Shafie-khah and J. P. Catalão, “Stochastic planning of a multi-microgrid considering integration of renewable energy resources and real-time electricity market,” Applied Energy, vol. 298, p. 117215, 2021. 22 [29] D. Kumar, Y. P. Verma, R. Khanna and P. Gupta, “Impact of market prices on energy scheduling of microgrid operating with renewable energy sources and storage,” Materials Today: Proceedings, vol. 28, pp. 1649-1655, 2020. [30] L. Al-Ghussain, R. Samu, O. Taylan and M. Fahrioglu, “Sizing renewable energy systems with energy storage systems in microgrids for maximum cost-efficient utilization of renewable energy resources,” Sustainable Cities and Society, vol. 55, p. 102059, 2020. [31] G. K. Suman, J. M. Guerrero and O. P. Roy, “Optimisation of Solar/Wind/Bio-generator/Diesel/Battery Based Microgrids for Rural Areas: A PSO- GWO Approach,” Sustainable Cities and Society, p. 102723, 2021. [32] H. Khaloie, M. Mollahassani-Pour and A. Anvari-Moghaddam, “Optimal behavior of a hybrid power producer in day-ahead and intraday markets: a bi-objective CVaR-based approach,” IEEE Transactions on Sustainable Energy, vol. 12, no. 2, pp. 931-943, 2020. [33] M. Kharrich, O. H. Mohammed, N. Alshammari and M. Akherraz, “Multi-objective optimization and the effect of the economic factors on the design of the microgrid hybrid system,” Sustainable Cities and Society, vol. 65, p. 102646, 2021. [34] P. Emrani-Rahaghi, H. Hashemi-Dezaki and A. Hasankhani, “Optimal Stochastic Operation of Residential Energy Hubs Based on Plug-in Hybrid Electric Vehicle Uncertainties Using Two-point Estimation Method,” Sustainable Cities and Society, p. 103059, 2021. [35] D. Wu, X. Ma, S. Huang, T. Fu and P. Balducci, “Stochastic optimal sizing of distributed energy resources for a cost-effective and resilient Microgrid,” Energy, vol. 198, p. 117284, 2020. [36] C. Xie, D. Wang, C. S. Lai, R. Wu, X. Wu and L. L. Lai, “Optimal sizing of battery energy storage system in smart microgrid considering virtual energy storage system and high photovoltaic penetration,” Journal of Cleaner Production, vol. 281, p. 125308, 2021. [37] A. M. Haidar, A. Fakhar and A. Helwig, “Sustainable energy planning for cost minimization of autonomous hybrid microgrid using combined multi- objective optimization algorithm,” Sustainable Cities and Society, vol. 62, p. 102391, 2020. [38] A. Kumar, A. Verma and R. Talwar, “Optimal techno-economic sizing of a multi-generation microgrid system with reduced dependency on grid for critical health-care, educational and industrial facilities,” Energy, vol. 208, p. 118248, 2020. [39] A. A. Recalde and M. S. Alvarez-Alvarado, “Design optimization for reliability improvement in microgrids with wind–tidal–photovoltaic generation,” Electric Power Systems Research, vol. 188, p. 106540, 2020. [40] A. Ghanbari, H. Karimi and S. Jadid, “Optimal planning and operation of multi-carrier networked microgrids considering multi-energy hubs in distribution networks,” Energy, vol. 204, p. 117936, 2020. [41] A. S. Chuang, F. Wu and P. Varaiya, "A game theoretic model for generation expansion planning: problem formulation and numerical compensations," IEEE transaction on power system, vol. 16, pp. 885-891, 2001. [42] C. Grigg, P. Wong, P. Albrecht, R. Allan, M. Bhavaraju, R. Billinton, Q. Chen, C. Fong, S. Haddad, S. Kuruganty, W. Li, R. Mukerji, D. Patton, N. Rau, D. Reppen, A. Schneider, M. Shahidehpour and C. Singh, "Reliability test system task force of the IEEE subcommittee on the application of probability methods," IEEE reliability test system, vol. 14, pp. 2047-2054, 1979. [43] A. K. Kaviani, H. Baghaee and G. Riahy, “Design and Optimal Sizing of a Photovoltaic/Wind-generator System Using Particle Swarm Optimization,” Proceedings of the 22nd Power System Conference (PSC), 2007. [44] “http://www.yinglisolar.com,” [Online]. [Accessed 05 09 2019]. [45] A. Hasankhani, S. M. Hakimi and A. Vafaeizadeh, “Developing energy management system considering renewable energy systems in residential community,” 2020. [46] R. Garcia and D. Weisser, “A Wind–diesel System with Hydrogen Storage: Joint Optimization of Design and Dispatch,” Renewable Energy, vol. 31, pp. 2296-2320, 2006. [47] R. B. R. Karki, “Reliability/cost Implications of PV and Wind Energy Utilization in Small Isolated Power Systems,” IEEE Transaction on Energy Conversion, vol. 16, pp. 368-373, 2001. [48] R. Billinton and R. Allan, “Reliability Evaluation of Engineering Systems: Concepts and Techniques, 2nd edition,” Plenum Press, New York, 1992. [49] M. Marchesoni and S. Savio, “Reliability Analysis of a Fuel Cell Electric City Car,” European Conference on Power Electronics and Applications, 2005. [50] M. Khairil and S. Javanovic, “Reliability Modeling of Uninterruptible Power Supply Systems using Fault Tree Analysis Method,” European Transaction on Electrical Power, vol. 19, pp. 258-273, 2007. [51] K. Strunz and E. Brock, “Stochastic Energy Source Access Management: Infrastructure-integrative Modular Plant for Sustainable Hydrogen-electric Co-generation,” International Journal of Hydrogen Energy, vol. 31, pp. 1129-1141, 2006. [52] D. Menniti and A. Pinnarelli, “A Method To Improve Micro grid Reliability By Optimal Sizing PV/WIND Plants And Storage Systems,” 20th International Conference on Electricity Distribution, 2009. [53] M. Tanrioven and M. Alam, “Reliability Modeling and Analysis of Stand-alone PEM Fuel Cell Power Plants,” Renewable Energy, vol. 31, pp. 915- 933, 2006. [54] E. Koutroulis, D. Kolokotsa, A. Potirakis and K. Kalaitzakis, “Methodology for Optimal Sizing of Stand-alone Photovoltaic/Wind-generator Systems using Genetic Algorithms,” Solar Energy, vol. 80, pp. 1072-1088, 2006. [55] R. Billinton and R. N. Allan, Reliability evaluation of engineering systems, New York: Plenum press, 1992. [56] H. V. Haghi, M. T. Bina and M. A. Golkar, “Nonlinear Modeling of Temporal Wind Power Variations,” IEEE Transactions on Sustainable Energy, vol. 4, pp. 838-848, 2013. [57] C. Naksrisuk and K. Audomvongseree, “Dependable Capacity Evaluation of Wind Power and Solar Power Generation Systems,” ECTI Transactions on Electrical ENG., Electronics, and Communication, vol. 11, pp. 58-66, 2013. [58] A. Hasankhani and G. B. Gharehpetian, “Virtual power plant management in presence of renewable energy resources,” 2016 24th Iranian Conference on Electrical Engineering (ICEE) , pp. 665-669, 2016. [59] E. Shahrabi, S. M. Hakimi, A. Hasankhani, G. Derakhshan and B. Abdi, “Developing optimal energy management of energy hub in the presence of stochastic renewable energy resources,” Sustainable Energy, Grids and Networks, vol. 26, p. 100428, 2021. http://www.yinglisolar.com,