Research Article Participation of Grid-Connected Energy Hubs and Energy DistributionCompaniesintheDay-AheadEnergyWholesaleand Retail Markets Constrained to Network Operation Indices Omid Kohansal ,MahmoudZadehbagheri ,MohammadJavadKiani , andSamadNejatian Department of Electrical Engineering, Islamic Azad University, Yasuj Branch, Yasuj, Iran Correspondence should be addressed to Mahmoud Zadehbagheri; mzadehbagheri@gmail.com Received 8 February 2022; Revised 10 June 2022; Accepted 20 July 2022; Published 25 August 2022 Academic Editor: Sheng Du Copyright © 2022 Omid Kohansal et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. In this paper, the optimal scheduling of energy grids and networked energy hubs based on their participation in the day-ahead energy wholesale and retail markets is presented. e problem is formulated as a bilevel model. Its upper level minimizes the expected energy cost of electricity, gas, and heating grids, especially in the form of private distribution companies in the mentioned markets, in the first objective function, and it minimizes the expected energy loss of these networks in the second objective function. is problem is constrained by linearized optimal power flow equations. e lower-level formulation minimizes the expected energy cost of hubs (equal to the difference between sell and purchase of energy) as an objective function in the retail market. Constraints of this model are the operation formulation of sources and active loads and the flexibility limit of hubs. e unscented transformation approach models the uncertainties of load, renewable power, energy price, and energy demand of mobile storage. en, the Karush–Kuhn–Tucker approach and Pareto optimization technique based on ε-constraint are adopted to extract the single-level single-objective formulation. Finally, obtained results verify the capability of the present method in improving the economic status of hubs and the economic and operation situation of the mentioned networks si- multaneously so that the proposed scheme by managing the power of energy hubs compared with power flow studies has been able to reduce operating costs by 8%, reduce energy losses by 10%, and improve voltage profile and temperature by 36% and 30%. 1.Introduction 1.1. Motivation. Nowadays, due to the advancement in power generation technologies (such as combined heat and power (CHP) systems and renewable energy sources (RES)) and energy storage systems (ESSs) (such as electric vehicles (EVs)), energy management programs such as environ- mentally friendly demand response programs (DRP) are adopted to save energy. us, these power sources and active loads (ALs) can enhance technical status of the network and reduce its cost by participating in the power system [1]. For example, RESs in the electricity grid reduce the network operating cost and energy price, which is commensurate with the increase in social welfare [2]. In addition, the increase in the number of these elements in energy networks (ENs), such as electricity, gas, and heating networks, raises the volume of data sent to the energy network operator (ENO), which complicates decision making. To address this, smart grid theory suggests that different sources and ALs be managed in the form of different aggregators such as energy hub (EH), virtual power plant (VPP), or microgrid (MG) [3]. However, since EH can manage several types of energy si- multaneously, it will have higher energy efficiency than VPP and MG because VPP and MG generally produce only electrical energy [3]. In order to establish proper energy management in energy networks, sources and ALs will have bilateral coordination with the EH operator. EH operators also coordinate with ENOs, which is defined as a two-layer Hindawi International Transactions on Electrical Energy Systems Volume 2022, Article ID 2463003, 20 pages https://doi.org/10.1155/2022/2463003