Next Article in Journal
Robust Power Sharing and Voltage Stabilization Control Structure via Sliding-Mode Technique in Islanded Micro-Grid
Next Article in Special Issue
Automated Residential Energy Audits Using a Smart WiFi Thermostat-Enabled Data Mining Approach
Previous Article in Journal
Design and Analysis of Two Permanent-Magnet-Assisted Bearingless Synchronous Reluctance Motors with Different Rotor Structure
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimal Fuzzy Energy Trading System in a Fog-Enabled Smart Grid

1
School of Electrical Engineering and Computer Science (SEECS), National University of Sciences and Technology (NUST), Islamabad 44000, Pakistan
2
Department of Computer Science, College of CIT, Taif University, Taif 21944, Saudi Arabia
*
Author to whom correspondence should be addressed.
Energies 2021, 14(4), 881; https://doi.org/10.3390/en14040881
Submission received: 10 January 2021 / Revised: 2 February 2021 / Accepted: 4 February 2021 / Published: 8 February 2021
(This article belongs to the Special Issue Advances in Energy-Efficient Buildings)

Abstract

:
With the recent technological advancements, it has become possible to conceive numerous valuable applications for efficient utilization of energy resources in a smart grid. As distributed energy generation and distributed storage systems become cost-effective, trading energy becomes a lucrative alternative for both prosumers and manufacturers. In this paper, we make use of fuzzy logic to propose a system for optimal energy trading in a fog-enabled smart grid set-up. The existing systems in this realm have inherited issues of network latency, computational expensiveness, information availability, scalability, and performance. Some systems require a specialized transmission line for energy trading and plenty of them based on the dedicated producer-consumer model, putting limits to their practical effectiveness. Our framework makes use of fog-computing infrastructure to address scalability, information availability, and network latency issues. We exploit the fuzzy logic paradigm to handle the issues with crisp values and to improve the computational efficiency of the system. Our model of energy-trading system incorporates various input parameters to decide on the excess energy, including real-time price, time of day, outdoor temperature, buyers’ interest, and storage capacity. Simulation results show that our proposed system possesses promising potential to maximize the profit of energy trading and to minimize electricity usage from the main grid.

1. Introduction

The generation, transmission, and distribution of electricity are three primary functions of the traditional power grids [1]. In these grids, electricity flows from operational units to the consumption units and the usage information flows in the opposite direction. From their introduction in the late 1870s to the 1970s, these grids worked very well. Due to advancements in electronics technology, a drastic increase in the number of electronic devices has been observed since the 1970s, resulting in the failure of traditional power grids in coping with energy requirements. Many factors contribute to the erosion of these grids, including electromechanical working, centralized production, manual monitoring & restoration, blackouts, lack of security, reliability, and limited control, to name a few. These factors led to the emergence of smart grids (SGs), which build upon the limitations posed by traditional power grids and offer numerous features, including dynamic pricing, bidirectional electricity, information flow, system stability, self-healing, theft detection, supervisory control, data acquisition and analytics, and fault tolerance.
A smart grid also offers integration options with renewable energy sources (RESs). The exponential rise in electricity demand in the recent few decades has led to the world-wide energy crisis. As such, many organizations are researching new energy resources to tackle the ongoing (and anticipated) energy crisis. The traditional ways of extracting energy from fossil fuels affect not only the atmosphere but also the finite resources of the earth [2]. The energy obtained from fossil fuels is, therefore, becoming costly for consumers. During research for new energy resources, RESs have been discovered, which produce low-cost renewable energy (RE). The RESs, like wind, sunlight, biomass, tidal waves, etc., naturally replenish and never run out on a human time scale. They are the biggest ecosphere element of the Earth, and the energy extracted from these components offers significant benefits to the customers, economy, and the environment. Furthermore, based on a recent study, RE accounted for around 19.2% of worldwide power usage by humans and 23.7% of electricity generation by humans in 2014 and 2015, respectively [3]. This implies that the share of RE is increasing in the generation, as well as in the consumption of total electricity. Therefore, it is highly essential to use the RESs effectively, to obtain maximum advantages from the RE, which is possible under smart grid infrastructure. Along these lines, various research activities in recent years have focused on the optimal scheduling of resources for a cost-effective and reliable supply of electricity [4,5,6,7].
Furthermore, a smart grid uses numerous devices to monitor, analyze, and control the flow of electricity and other grid features. These devices are installed at different stages of the system and can even reach up to billions [1]. The explosive increase in the number of devices linked with SGs raised many problems, such as data sharing, connectivity, monitoring, and the processing of a huge amount of information [8]. These problems of SGs are addressed by the introduction of the Internet of Things (IoT), which sets up a dynamic and global network platform and enables devices to communicate information in real-time. The initial propositions of IoT-based SG infrastructure exploit cloud computing for storing, sharing, and processing huge amounts of data generated by the system and its devices. The dependency on the cloud can lead to issues, like network latency, cloud dependability, and information availability, to name a few. This leads us to make use of “fog computing”, also known as “Edge Computing”, for tackling these issues.
The fog computing infrastructure provides data storage, computing, and sharing capabilities at a local level [9]. In this setup, all the neighboring devices communicate with their fog server and fog is responsible for communicating the devices’ data with the cloud server, i.e., no direct communication happens between devices and the cloud server. It acts as an intermediary layer of a distributed network that connects IoT and cloud computing environments. This has been demonstrated with the help of Figure 1. We can see that the smart devices communicate with the fog layer in this infrastructure and the fog layer then communicates with the cloud layer for further processing, storage, or sharing of data. With this model, if a fog server goes down, the other fog instances won’t stop functioning. Hence, making the system more reliable and robust. The fog layer brings the data generation and the data processing endpoints closer to each other, which helps in creating low-latency networks and enables support for real-time applications. It also helps in reducing the amount of bandwidth required for data processing compared to whether all that data were to be sent to the cloud for processing. The fog layer also helps in ensuring the privacy of confidential data because, at a fog server present on the local network, we can configure which part and what form of data needs to be sent on a public network for further processing on the cloud. The fog layer of fog computing infrastructure can have various components and features, including gateways, storage units, processing capabilities, routers, switching equipment, and a customer’s on-premise equipment to access the edge devices, to name a few. In the context of this article, the fog paradigm helps in overcoming various limitations inherent with the cloud-dependent infrastructure used in existing approaches for energy trading.
One of the primary characteristics of an SG is that consumers of electricity can also be prosumers, i.e., they can both produce and consume electricity. Because of the intermittent nature of electricity generation, prosumers can either store their excessive electricity in batteries, export it to the primary power grid, curtail it, or sell it to different energy customers. The direct trading of energy between consumer and prosumer is termed peer-to-peer (P2P) energy trading [10]. For efficient utilization of resources, it is very important to find a balance between different options to deal with excess energy generated by a prosumer.
In this research work, we propose a system to optimally trade excessive electricity generated by a prosumer in a fog-enabled smart grid environment. The objectives are to maximize the profit of trading energy, minimize electricity usage from the grid, reduce the overall electricity cost, and promote better utilization of excessive energy. The system makes use of fuzzy logic paradigm to improve the performance of decision-making. It covers a wide range of operating conditions than crisp boundaries for decision-making. To achieve the desired optimality of decisions made by our proposed system, we introduce numerous input parameters, such as real-time price, time of the day, outdoor temperature, buyers’ interest, and storage capacity. To the best of the authors’ knowledge, fuzzy logic has not been studied yet for energy trading in a fog-enabled smart grid setup. Different research groups have recently proposed fuzzy logic-based models to deal with the issue of stock trading [11,12]; these applications have inspired us to study fuzzy logic for energy trading in a smart grid.
Organization: The remaining paper is structured as follows: We present a short overview of the related work in Section 2. In Section 3, we elaborate on the problem statement. Section 4 presents the fuzzy logic-based system model, and Section 5 provides the implementation methodology of the proposed system. Simulation results are discussed in Section 6, followed by the conclusion and future directions in Section 7.

2. Related Work

In 2015, Liu et al. utilized optimization theory (non-convex) and second-order cone programming to propose a methodology for peer-to-peer energy trading between micro-grids [13]. The objectives of the research were to minimize the overall energy cost and energy sharing losses. Although the methodology reduces the total electricity bill of all connected micro-grids, it assumes dedicated transmission lines between the micro-grids, which might not be possible for large scale energy trading. Furthermore, the proposed system lacks scalability, trading mechanism, and automation of the electricity trading process. Energy trading factors are also overlooked in this research work. Later, in 2016, Rubio et al. exploited the concepts of adaptive fuzzy logic modeling to propose a system for agents-based energy trading [14]. The objectives of the research were to assign dynamic tariffs to the consumers based upon their portfolio and to improve the computational efficiency of the system. Although the system manages the imbalances in electricity tariff computation, it assumes balanced participation of the agents in the bidding process, which is not a realistic assumption. Furthermore, the system is not applicable for sophisticated markets. It also lacks scalability and does not incorporate energy trading factors, such as real-time price, times of the day, and outdoor temperature.
In 2017, Alam et al. used mixed-integer non-linear programming and Pareto optimality to propose a P2P model for trading electricity between smart homes [15]. The objectives of the research were to minimize the electricity consumption cost among smart homes and maintain a local balance between demand and supply. Although the proposed system achieves fair cost distribution between energy trading smart homes, the system relies heavily on the cloud, which can lead to network latency and data availability issues. Moreover, the model is classified as a non-deterministic polynomial-time (NP) hard problem, which can lead to an exponential increase in solution time for small problem cases. Besides, it does not utilize energy trading factors, such as real-time price, times of the day, outdoor temperature, buyers’ interest (BI), and storage capacity. In the same year, Khorasany et al. exploited knapsack approximation along with a greedy algorithm to propose a P2P market-clearing framework for distributed energy resources (DERs) [16]. The objective of the research was to maximize the economic surplus of the energy auction. Although the proposed framework maximizes the economic surplus for the DERs owners, it bases on the assumption that a dedicated forum/portal exists for the bidding, which might not be desirable for an automated solution. The framework also lacks scalability and does not entertain energy trading factors for an optimal solution.
Later, in 2018, Zhang et al. utilized game theory to propose a P2P energy trading framework for microgrids [17]. The objectives of the research were to maintain a local balance of electricity demand-supply and to reduce the overall cost of the electricity consumed by the microgrids. Although the proposed framework provides a local balance of electricity generation and consumption, it lacks scalability. Furthermore, the framework requires a dedicated forum for the bidding of excess energy generated by the microgrids, which might not be desirable for an automated energy trading solution. Besides, the energy trading factors are ignored in this research effort, as well.
In 2019, Gai et al. exploited the consortium block-chain algorithm to propose a methodology for privacy-preserving energy trading in a smart grid [18]. The major objective of the research was to preserve the privacy of energy trading users. The proposed system balances local generation and demand, reduces energy utilization from the main grid, and also preserves the privacy of the users. However, it inherits network latency and data availability issues due to the usage of cloud infrastructure. Moreover, the proposed system is computationally expensive and does not make use of the energy trading factors, e.g., real-time price, times of the day, outdoor temperature, and buyers’ interest. Lastly, in 2020, Son et al. proposed a P2P energy trading system for smart grids [19]. The main objective of their work was to encrypt bids and preserve the privacy of users. The proposed system guarantees the protection of information; however, it also inherits issues, like computational expensiveness, network latency, and data availability, to name a few.

3. Problem Formulation

In this section, the problem statement is formally defined based on the findings from the related work. The existing systems for energy trading possess numerous limitations, most of them inherit scalability issue, i.e., expanding the system at a larger level is limited. Moreover, due to reliance on non-linear complex mathematical models, they are computationally very expensive. The accessibility of data was missing in all the suggested frameworks. Furthermore, none of the suggested systems dealt with the network latency problem. Most of the frameworks solely rely on cloud infrastructure, which is vulnerable to the following limitations:
  • Network latency: On a public network, SG devices often interact wirelessly with servers. The strength of the wireless network often differs depending on its use, wireless router positioning and/or building’s infrastructure, etc. This can lead to potential network variance and disrupted communication with the server, which can lead to system failure.
  • Privacy: The devices of the SG are publicly deployed. These devices indirectly share the private data of customers across the cloud infrastructure, which may be misused to obtain understanding about users and/or any other malicious intent.
  • Dependability: The cloud-based SG system architecture is strongly dependent on the cloud infrastructure to be alive. If for any reason, the cloud infrastructure/services go down, the system will no longer work.
  • Availability: It can be described as ensuring access to and use of data in a timely and reliable manner. It is considered the most significant measure of SG, as a compromise in this measure may result in disruptions in its functioning.
Besides, the performance of the existing systems is also limited because they do not make use of the energy trading factors to exploit the optimal potential of decision-making. These factors lead us to the design and development of a new energy trading system in an SG, which builds on the limitations of existing systems proposed in this realm. The system should be able to optimally decide about the usage of excessive energy, i.e., whether the excess electricity generated by a prosumer should be stored in batteries, exported to the main power grid, sold to different energy customers, or a combination of all.

4. System Model

In this section, we propose the model of our system and its implementation. We use the fog computing paradigm to design an energy trading system to address the issues inherited from cloud infrastructures, such as network latency, scalability, information availability, and cloud dependability. In literature, numerous SG system architectures have been proposed exploiting the fog computing paradigm to address ad hoc problems [20,21,22,23,24,25,26]. However, to the best of our knowledge, the fog computing paradigm has not been studied yet for the energy trading problem. In this direction, the higher-level system architecture of the fog-enabled smart grid environment can be visualized in Figure 2. The information and energy flow are depicted with solid and dashed arrows, respectively. From the figure, we can see that all the home energy management system (HEMS) devices communicate with their fog server and the fog communicates the devices’ information with the cloud. We can examine that there are generally 2 types of energy flows, represented with dashed arrows, at the consumption tier, as follows:
  • Flow between the smart meter and smart grid: A bidirectional flow of energy happens via this channel. If energy flows from a smart grid to a smart home then the smart meter records the consumed units and runs in forward or consumption direction. On the other hand, if a smart home is generating excessive energy then it can export that to the energy network. In this case, the smart meter records the energy units exported on the network. This happens through the concept of net metering, also known as reverse metering or net smart metering [27].
  • Flow between smart devices and HEMS: In the proposed architecture, energy flow is controlled through HEMS deployed in a smart home. HEMS collaborates with smart devices, such as smart meter, building appliances, distributed storage (DS) units (e.g., batteries), and distributed generation (DG) units (e.g., wind turbines and photovoltaics) for autonomous and cost-effective energy consumption. In case of excessive energy, HEMS is responsible for exporting it to the energy system, i.e., either by exporting to the main grid or by trading with local consumers.
The information flow, represented with solid arrows, happen between all 3 tiers of our proposed architecture. There are typically 5 types of information flows that happen between these tiers, as follows:
  • Communication between HEMS and smart devices: It allows smart devices, such as smart meter, home appliances, DS units, and DG units, to communicate with HEMS. This connection also helps to optimally schedule the power consumption of different devices for a cost-effective solution.
  • Communication between a smart meter and smart grid: A smart meter records all the consumed and produced energy units by a smart home and sends that information to the smart grid. Real-time energy pricing information is available through information flow from the smart grid to a smart meter, while energy consumption and production information are available to the smart grid through information flow from the smart meter.
  • Communication between HEMS and fog server: The fog server is established on a local network of the HEMS, addressing the network latency and privacy issues inherent with a cloud-dependent infrastructure. In our proposed setup, the neighboring HEMSs communicate with their fog computing server and a fog server is then responsible for transmitting that information to the cloud server.
  • Communication between fog server and cloud server: Both cloud server and fog server complement each other to provide optimal access to computing resources. The cloud infrastructure offers convenient, ubiquitous, and on-demand access to a shared pool of computing resources, such as remote processing, storage, servers, networks, and applications [28]. However, the reliance of the cloud on Internet infrastructure introduces issues, like varying network latency and downgrade in quality of service, causing serious limitations for real-time applications. The fog server processes the data received from HEMSs, aggregates it, and store it on the cloud server. The information about energy production, consumption, peak factor, and trading is forwarded to the cloud server, to assist the smart grid to later utilize that information.
  • Communication between smart grid and cloud server: This medium can be used to cross-check the information exchanged between smart meters and smart grid, as well as to assist the smart grid in case its communication with smart meters is compromised. The power of cloud computing can be used directly by the smart gird for heavy computing and for performing various analytical activities on the enormous volumes of data produced in its infrastructure by different devices.
Furthermore, speaking of the use of fuzzy logic for the aforementioned problem, fuzziness occurs when it comes to the uncertainty that inherits from linguistic ideas without clear boundaries. Most of the factors linked with energy trading can be optimally expressed using fuzzy logic theory. For example, factors, such as real-time price, times of the day, outdoor temperature, and buyers’ interest, can be more naturally expressed in fuzzy logic than using the Boolean theory. The output of the system can also be better expressed in fuzzy logic than crisp decision-making. For instance, if someone classifies electricity storage to batteries as high, it leaves us uncertain how high it should be. The introduction of fuzzy logic will make the interaction more clear and natural. Moreover, fuzzy logic is beneficial because there is no necessity for mathematical modeling compared to existing systems [29]. The conceptual diagram of our fuzzy inference system (FIS) has been shown in Figure 3. We can visualize that the proposed FIS is a multi-input and multi-output (MIMO) system. It takes crisp inputs, fuzzifies them, and pass on the fuzzified values to the inference engine. The inference engine then applies fuzzy operators on the inputs, performs implications, aggregates the consequent of fuzzy rules, and then de-fuzzifies the outputs for generating crisp values.
The model suggested in this paper is assessed on Mamdani FIS [30], and rules are produced using the antecedent and consequent linguistic variables. For example:
Rule: If Outdoor-Temperature is “HOT”, and Price is “HIGH”, and Time-of-Day is “NOON”, and BI is “HIGH”, and Capacity is “LOW”, then P2P-Trading is “HIGH”, and Main-Grid is “LOW”, and Batteries is “LOW”.
The above rule is very self-explanatory, which indicates for trading the excess energy generated by the system with the peers. Now, let us define the membership functions for our input and output variables.

4.1. Real-Time Price

This input variable has the most impact on the decision to be made about the excessive energy. Bill reduction is a goal that housing consumers want to accomplish at all times. Total energy bills and consumption are highly reliant on present price tariffs. A time of use (ToU) price tariff is considered under this suggested methodology. Rates are taken from the Hydro One, Ontario, Canada [31]. The value of price per unit varies from $0.07 to $0.13 depending upon the ToU. The membership functions for the low, medium, and high price values of this input variable can be visualized in Figure 4a. We can analyze that trapezoidal membership functions have been exploited for this variable because the membership values stay at 1 for a range rather than at a specific point.

4.2. Outdoor Temperature

This input variable mainly affects the electricity load and consumption. If the outdoor temperature is very high or very cold, then we can experience more usage of electricity to keep the indoor temperature at a moderate level, satisfying the users’ comfort. The value of outdoor temperature varies from −40 °C to 50 °C. The membership functions for the very cold, cold, normal, hot, and very hot outdoor temperature values of this input variable can be visualized in Figure 4b. The readings are mapped as per the American Society of Heating, Refrigerating, and Air-Conditioning Engineers (ASHRAE) standards [32]. We can analyze that trapezoidal membership functions have been exploited for this variable because the membership values stay at 1 for a range rather than at a specific point. Here, we assume that the indoor temperature is being controlled by electricity to maintain the users’ comfort.

4.3. Time of the Day

This is another important factor that can impact electricity consumption. We can analyze from our daily experience that electricity consumption is very high at noon than at midnight. The value of time of day covers all the 24 h in a day. The membership functions for the midnight, morning, noon, and evening times of the day input variable can be visualized in Figure 4c. We can analyze that triangular membership functions have been exploited for this variable because the membership values are at 1 for specific points only rather than for a range.

4.4. Buyers’ Interest (BI)

This is another important input parameter to help in deciding the P2P energy trading. If the buyers’ interest is high then there are more chances for selling the excess electricity generated by the system at a comparatively higher price than with lower values of buyers’ interest. The buyer interest can be computed based on the profiles of the consumers in the system and the requests for excessive energy, as follows:
Buyers Interest = Number of consumers requested for energy Total number of consumers in the system .
For example, if there are 100 total consumers in an SG system, and 50 consumers have requested excessive energy in the system, then the value of buyers’ interest input would be 50 100 = 0.5 . A value of 0.0 would mean that no consumer is interested in buying the electricity, while a value of 1.0 means that all the consumers are interested in buying the electricity. The membership functions for the low, medium, and high values of the buyers’ interest input variable can be visualized in Figure 4d. We can analyze that triangular membership functions have been exploited for this variable.

4.5. Capacity

This parameter tells us about the remaining storage capacity for excessive electricity. It is a ratio between the capacity consumed and the total capacity of the electricity storage medium. This parameter affects the decision about excessive energy, as if the storage capacity is full, then we are left with only two options for the excessive energy, which are exporting to the main grid, and P2P trading. A value of 0.0 means batteries are fully charged and no capacity is available for storing the electricity, while a value of 1.0 means that batteries are empty, and full capacity is available for storing the electricity. The membership functions for the low, medium, and high values of the storage capacity input variable can be visualized in Figure 4e. We can analyze that trapezoidal membership functions have been exploited for this variable.

4.6. Store to Batteries

This output variable helps in determining whether to store the excessive electricity generated by the system in the batteries or not. The membership functions for the low, medium, and high values of the store to batteries output variable can be visualized in Figure 5a. We can analyze that trapezoidal membership functions have been exploited for this variable.

4.7. Export to Main Grid

This output variable helps in determining whether to export the excess electricity generated by the system to the main grid or not. The membership functions for the low, medium, and high values of the export to the main grid output variable can be visualized in Figure 5b. We can analyze that triangular membership functions have been exploited for this variable.

4.8. P2P Energy Trading

This output variable helps in determining whether to trade excessive electricity generated by the system with the peers or not. The membership functions for the low, medium, and high values of the P2P energy trading output variable can be visualized in Figure 5c. We can analyze that Gaussian membership functions have been exploited for this variable because the membership values are approaching 1 by following a continuous normal distribution.

5. Implementation Methodology

In this section, we provide the details both for implementing the proposed system (modeled in Section 4) in a simulated environment and for integrating it into real-world operations. We have used the Fuzzy Logic Toolbox [33] of MATLAB 9.4 R2018a on a 2.90 GHz PC processor to implement the proposed FIS and for generating the simulation results presented in the following section. The fuzzy logic toolbox provides us a graphic interface to model any complex FIS. We can use its graphical interface to configure input/output variables with desired membership functions, to configure rules, and to evaluate the system by plotting various surfaces. At a higher level, the model of our proposed FIS in the fuzzy logic toolbox can be visualized as shown in Figure 6. We can see that 5 inputs are fed into the FIS, and 3 outputs are generated by the system, one for each option of dealing with excess energy generated at a HEMS. Mamdani FIS has been applied at the heart of the system and the centroid method is exploited for the defuzzification of output values [29,30]. The implemented system requires very minute space in memory (approximately 2 KB) for evaluating the rule-base. The system can be integrated at a HEMS level for practical applications using the free and open-source Real-time Internet of Things (RIOT) operating system [34].

6. Results and Discussion

In this section, we compare the results of our proposed system with the existing approaches for energy trading in a smart grid and evaluate the novelties proposed in our study. Our system exploits the capabilities of the fog-cloud paradigms. The cloud environment addresses the problem of scalability intrinsic in most of the ad hoc energy trading approaches suggested earlier. To tackle the variable network latency, privacy, and data availability issues, the fog infrastructure complements the cloud. To the best of our understanding, fog computing has not earlier been widely utilized to tackle the issue of electricity trading in an SG. The system model follows three-tiered architecture, named, respectively, as consumer tier, fog tier, and cloud tier, as shown in Figure 2. The electricity flow happens only at the first tier of the system, while the information flow happens between all-tiers of the system.
For increasing the computational efficiency of the system and to improve the performance, we made use of the fuzzy logic paradigm. It has been utilized to develop a decision-making system for the HEMS that regulates the excessive energy generated by a prosumer. The implementation details of the system have been specified in Section 6 above. The surface plot of P2P energy trading has been shown in Figure 7, with real-time price per unit of electricity and outdoor temperature on the X and Y-axis, respectively. In the plot, we can examine that P2P energy trading is at 0.5 to start the neutral stream of excessive electricity; however, as the outdoor temperature increases or decreases towards extreme values, along with increasing utility price of electricity, the P2P energy trading proportion also increases towards the higher band. This is because P2P energy trading is the most profitable option for excessive energy utilization.
Furthermore, the surface plot of exporting excessive electricity to the main power grid has been shown in Figure 8. The real-time price per unit of electricity and buyers’ interest variables are depicted on the X and Y-axis, respectively. Other parameters impacting the decision are kept constant for analyzing this scenario. In this plot, we can examine that the export of electricity to the main grid is at 0.5 to start the neutral stream of excessive electricity; however, as the buyers’ interest increases towards higher values along with the utility price of electricity, the exporting of electricity to the main grid decreases from 0.5 to lower band. We can observe that at buyers’ interest’s value of 1.0 (maximum) and price’s value of $0.13 per unit (maximum) the excessive electricity’s percentage for exporting to the main grid is 0; this is because exporting excessive electricity to the main grid is the least profitable option in this scenario. Thus, the system provides an optimal balance between exporting excessive electricity to the main grid and P2P energy trading, leading to profit maximization.
In comparison with existing approaches, the novelties of our framework have been demonstrated in Table 1. We can examine that our proposed framework offers scalability and also addresses the issues caused by network latency. The introduction of the fog computing layer in our proposed model, presented in Figure 2, helps to reduce the network latency inherited by other approaches. Our proposed system provides options to export excess electricity to the main grid, as well as the option for P2P trading, along with storage to batteries. It also provides flexibility to utilize all three available options in parallel, depicted through the multi-medium option in the table. For example, if the price is low, the outdoor temperature is normal, capacity is low, and buyers’ interest is also low for some time instance, then these input factors would lead to exporting the excess electricity to the main grid. To the best of the authors’ knowledge, the proposed approach is the only solution in the literature that studies the parallel utilization of all three output options; and it does so by exploiting the power offered by fuzzy logic.
Furthermore, because of the utilization of fuzzy logic, the proposed system is also computationally efficient than most of the existing systems basing on conventional mathematical models. The proposed approach approximates the system behavior rather than finding out the numerical/analytical relationship between the system variables; hence, it saves computational cost. Our system is also more robust by nature than the existing approaches in this realm. Let us try to understand that with the help of an analogy from traditional robotics. In robotics and automation, the Yoshikawa index, denoted by Y * , characterizes the kinematic sensitivity of a robotic system, i.e., how a small change in the joint variables affects the corresponding change in operational variables [35]. The robot is in an isotropic configuration when the value of Y * is maximal. There are various benefits of isotropic configurations, including good accuracy of actuators, noise rejection, and avoidance of singularity, to name a few. The main advantage of using fuzzy logic in our proposed system is that it inherently takes care of the errors that may occur due to small fluctuations in the inputs of the system, which ultimately results in a more robust system. Additionally, due to its reliance on the fog-infrastructure, our system also offers privacy and availability of data. Nevertheless, our proposed system does not maintain a local balance between the generation of electricity and its demand, which is offered by most of the existing systems for this problem. However, the usage of numerous energy trading factors increases the performance of the system, hence, offers local optimality.

7. Conclusions and Future Directions

In this paper, we proposed a system for optimal energy trading for prosumers in smart grid infrastructure. The existing systems in this domain inherit network latency, computational expensiveness, information availability, scalability, and performance issues. Moreover, some systems require a specialized transmission line for energy trading, and most of them are based on a dedicated producer-consumer model, putting limits on their practical effectiveness. Our proposed system utilizes fog-cloud infrastructure to address various limitations faced by existing methodologies, including scalability, information availability, cloud-dependability, privacy, and network latency issues. To improve the computational time of the system along with the issues inherited from the Boolean theory, we utilized the fuzzy logic paradigm. The proposed fuzzy inference system covers all major input variables, such as real-time price per unit of electricity, outdoor temperature, time of day, buyers’ interest, and batteries’ charging capacity for deciding on the excess electricity generated by a prosumer. It also covers the possible output options for deciding on the excessive electricity in the system, i.e., how much percentage of excessive electricity should be stored in batteries, should be exported to the main grid, and should be given to buyers through P2P trading. Based on simulation results, we have concluded that the proposed system provides an optimal balance for utilizing all three output options in parallel to deal with the excess electricity in the system. To the best of the authors’ knowledge, the proposed system is the only system in the literature that provides flexibility to utilize all three output options in parallel. It helps in maximizing the profit from energy trading and minimizes electricity usage from the main grid. The proposed inference system requires very minimal computing resources for processing the rules in a production environment. It can be integrated at the HEMS level as a working mechanism using the RIOT operating system.
We also believe that fuzzy logic has not been studied yet on a fog-enabled smart grid for addressing the energy trading problem; as such, we are also planning to extend this work further for various research possibilities. In these directions, we are looking forward to expanding the rule-base of the inference system for refining the optimality of our results for specific scenarios. We are also working on integrating learning mechanisms for improving the decision-making of the inference engine.

Author Contributions

Conceptualization, K.S. and S.I.; methodology, K.S.; software, K.S.; validation, S.I. and H.M.; formal analysis, K.S.; investigation, S.I.; resources, S.I.; data curation, S.I.; writing–original draft preparation, K.S.; writing–review and editing, S.I. and H.M.; visualization, S.I.; supervision, S.I.; project administration, S.I. and H.M.; funding acquisition, S.I. All authors have read and agreed to the published version of the manuscript.

Funding

National University of Sciences and Technology (NUST), Islamabad 44000, Pakistan pays the article processing charges of ISI-index journal papers.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
SGSmart grid
RESRenewable energy sources
RERenewable energy
IoTInternet of Things
P2PPeer-to-peer
DERDistributed energy resources
BIBuyers’ Interest
FISFuzzy inference System
MIMOMulti-input and multi-output
HEMSHome energy management system
ToUTime of use
ASHRAEAmerican Society of Heating, Refrigerating and Air-Conditioning Engineers
KBKiloByte
RIOTReal-time Internet of Things
DSDistributed storage
DGDistributed generation
NPNon-deterministic Polynomial-time

References

  1. Collier, S. The Emerging Enernet: Convergence of the Smart Grid with the Internet of Things. IEEE Ind. Appl. Mag. 2017, 23, 12–16. [Google Scholar] [CrossRef]
  2. Kosmadakis, G.; Karellas, S.; Kakaras, E. Renewable and Conventional Electricity Generation Systems: Technologies and Diversity of Energy Systems. In Lecture Notes in Energy Renewable Energy Governance: Complexities and Challenges; Springer: London, UK, 2013; pp. 9–30. [Google Scholar]
  3. Renewable Energy Policy Network for the 21st Century (REN21). Available online: https://www.ren21.net/wp-content/uploads/2019/05/REN21_GSR2016_FullReport_en_11.pdf (accessed on 6 December 2020).
  4. Hussain, H.M.; Javaid, N.; Iqbal, S.; Hasan, Q.U.; Aurangzeb, K.; Alhussein, M. An Efficient Demand Side Management System with a New Optimized Home Energy Management Controller in Smart Grid. Energies 2018, 11, 190. [Google Scholar] [CrossRef] [Green Version]
  5. Hafeez, G.; Javaid, N.; Iqbal, S.; Khan, F.A. Optimal Residential Load Scheduling Under Utility and Rooftop Photovoltaic Units. Energies 2018, 11, 611. [Google Scholar] [CrossRef] [Green Version]
  6. Javaid, N.; Ahmed, A.; Iqbal, S.; Ashraf, M. Day Ahead Real Time Pricing and Critical Peak Pricing Based Power Scheduling for Smart Homes with Different Duty Cycles. Energies 2018, 11, 1464. [Google Scholar] [CrossRef] [Green Version]
  7. Nadeem, Z.; Javaid, N.; Malik, A.W.; Iqbal, S. Scheduling Appliances with GA, TLBO, FA, OSR and Their Hybrids Using Chance Constrained Optimization for Smart Homes. Energies 2018, 11, 888. [Google Scholar] [CrossRef] [Green Version]
  8. Tu, C.; He, X.; Shuai, Z.; Jiang, F. Big data issues in smart grid—A review. Renew. Sustain. Energy Rev. 2017, 79, 1099–1107. [Google Scholar] [CrossRef]
  9. Lee, J.; Chung, S.; Kim, W. Fog server deployment technique: An approach based on computing resource usage. Int. J. Distrib. Sens. Networks 2019, 15, 1–19. [Google Scholar] [CrossRef] [Green Version]
  10. Hamari, J.; Sjöklint, M.; Ukkonen, A. The Sharing Economy: Why People Participate in Collaborative Consumption. J. Assoc. Inf. Sci. Technol. 2016, 67, 2047–2059. [Google Scholar] [CrossRef]
  11. Naranjo, R.; Arroyo, J.; Santos, M. Fuzzy modeling of stock trading with fuzzy candlesticks. Expert Syst. Appl. 2018, 93, 15–27. [Google Scholar] [CrossRef]
  12. Lauguico, S.; Concepcion, R., II; Alejandrino, J.; Macasaet, D.; Tobias, R.R.; Bandala, A.; Dadios, E. A Fuzzy Logic-Based Stock Market Trading Algorithm Using Bollinger Bands. In Proceedings of the 2019 International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM), Laoag, Philippines, 29 November–1 December 2019; pp. 1–6. [Google Scholar]
  13. Liu, T.; Tan, X.; Sun, B.; Wu, Y.; Guan, X.; Tsang, D.H.K. Energy management of cooperative microgrids with P2P energy sharing in distribution networks. In Proceedings of the 2015 IEEE International Conference on Smart Grid Communications (SmartGridComm), Miami, FL, USA, 2–5 November 2015; pp. 410–415. [Google Scholar]
  14. Rúbio, T.R.P.M.; Queiroz, J.; Cardoso, H.L.; Rocha, A.P.; Oliveira, E. TugaTAC Broker: A Fuzzy Logic Adaptive Reasoning Agent for Energy Trading. In Proceedings of the 2015 European Conference on Multi-Agent Systems (EUMAS), Athens, Greece, 15–16 December 2015; Springer: Cham, Switzerland; pp. 188–202. [Google Scholar]
  15. Alam, M.R.; St-Hilaire, M.; Kunz, T. An optimal P2P energy trading model for smart homes in the smart grid. Energy Effic. 2017, 10, 1475–1493. [Google Scholar] [CrossRef]
  16. Khorasany, M.; Mishra, Y.; Ledwich, G. Peer-to-peer market clearing framework for DERs using knapsack approximation algorithm. In Proceedings of the 2017 IEEE PES Innovative Smart Grid Technologies Conference Europe (ISGT-Europe), Torino, Italy, 26–29 September 2017; pp. 1–6. [Google Scholar]
  17. Zhang, C.; Wu, J.; Zhou, Y.; Cheng, M.; Long, C. Peer-to-Peer energy trading in a Microgrid. Appl. Energy 2018, 220, 1–12. [Google Scholar] [CrossRef]
  18. Gai, K.; Wu, Y.; Zhu, L.; Qiu, M.; Shen, M. Privacy-Preserving Energy Trading Using Consortium Blockchain in Smart Grid. IEEE Trans. Ind. Inform. 2019, 15, 3548–3558. [Google Scholar] [CrossRef]
  19. Son, Y.B.; Im, J.H.; Kwon, H.Y.; Jeon, S.Y.; Lee, M.K. Privacy-Preserving Peer-to-Peer Energy Trading in Blockchain-Enabled Smart Grids Using Functional Encryption. IEEE Trans. Ind. Inform. 2020, 13, 1321. [Google Scholar] [CrossRef] [Green Version]
  20. Zahoor, S.; Javaid, S.; Javaid, N.; Ashraf, M.; Ishmanov, F.; Afzal, M. Cloud–Fog–Based Smart Grid Model for Efficient Resource Management. Sustainability 2018, 10, 2079. [Google Scholar] [CrossRef] [Green Version]
  21. Zhu, L.; Li, M.; Zhang, Z.; Xu, C.; Zhang, R.; Du, X.; Guizani, N. Privacy-Preserving Authentication and Data Aggregation for Fog-Based Smart Grid. IEEE Commun. Mag. 2019, 57, 80–85. [Google Scholar] [CrossRef]
  22. Liu, J.; Weng, J.; Yang, A.; Chen, Y.; Lin, X. Enabling Efficient and Privacy-Preserving Aggregation Communication and Function Query for Fog Computing based Smart Grid. IEEE Trans. Smart Grid 2019, 1–8. [Google Scholar] [CrossRef]
  23. Fatima, I.; Javaid, N.; Nadeem Iqbal, M.; Shafi, I.; Anjum, A.; Ullah Memon, U. Integration of Cloud and Fog based Environment for Effective Resource Distribution in Smart Buildings. In Proceedings of the 2018 14th International Wireless Communications & Mobile Computing Conference (IWCMC), Limassol, Cyprus, 25–29 June 2018; pp. 60–64. [Google Scholar]
  24. Chekired, D.A.; Khoukhi, L.; Mouftah, H.T. Fog-Based Distributed Intrusion Detection System Against False Metering Attacks in Smart Grid. In Proceedings of the 2019 IEEE International Conference on Communications (ICC), Shanghai, China, 20–24 May 2019; pp. 1–6. [Google Scholar]
  25. Okay, F.Y.; Ozdemir, S. A secure data aggregation protocol for fog computing based smart grids. In Proceedings of the 2018 IEEE 12th International Conference on Compatibility, Power Electronics and Power Engineering (CPE-POWERENG 2018), Doha, Qatar, 10–12 April 2018; pp. 1–6. [Google Scholar]
  26. Kumari, A.; Tanwar, S.; Tyagi, S.; Kumar, N.; Obaidat, M.S.; Rodrigues, J.J.P.C. Fog Computing for Smart Grid Systems in the 5G Environment: Challenges and Solutions. IEEE Wirel. Commun. 2019, 26, 47–53. [Google Scholar] [CrossRef]
  27. Seme, S.; Sredensek, K.; Praunseis, Z. Smart grids and net metering for photovoltaic systems. In Proceedings of the 2017 IEEE International Conference on Modern Electrical and Energy Systems (MEES), Kremenchuk, Ukraine, 15–17 November 2017; pp. 188–191. [Google Scholar]
  28. National Institute of Standards and Technology. Available online: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-145.pdf (accessed on 27 January 2021).
  29. Iqbal, S.; Boumella, N.; Garcia, J. Fuzzy Controllers- Recent Advances in Theory and Applications, 1st ed.; InTech: London, UK, 2012; pp. 554–586. [Google Scholar]
  30. Ross, T.J. Fuzzy Logic with Engineering Applications, 4th ed.; Wiley: Hoboken, NJ, USA, 2016; pp. 84–98. [Google Scholar]
  31. Hydro One. Available online: https://www.hydroone.com/rates-and-billing/rates-and-charges/electricity-pricing-and-costs (accessed on 6 December 2020).
  32. ASHRAE Standard. Available online: https://www.ashrae.org/technical-resources/bookstore/standard-55-thermal-environmental-conditions-for-human-occupancy (accessed on 2 December 2020).
  33. MathWorks. Available online: https://www.mathworks.com/products/fuzzy-logic.html (accessed on 23 January 2021).
  34. Real-time IoT OS. Available online: https://www.riot-os.org (accessed on 27 January 2021).
  35. Yoshikawa, T. Manipulability of Robotic Mechanisms. Int. J. Robot. Res. 1985, 4, 3–9. [Google Scholar] [CrossRef]
Figure 1. Fog computing.
Figure 1. Fog computing.
Energies 14 00881 g001
Figure 2. Fog-enabled system architecture of a smart grid.
Figure 2. Fog-enabled system architecture of a smart grid.
Energies 14 00881 g002
Figure 3. Multi-Input and Multi-Output (MIMO) fuzzy inference system.
Figure 3. Multi-Input and Multi-Output (MIMO) fuzzy inference system.
Energies 14 00881 g003
Figure 4. Input membership functions.
Figure 4. Input membership functions.
Energies 14 00881 g004
Figure 5. Output membership functions.
Figure 5. Output membership functions.
Energies 14 00881 g005
Figure 6. Higher-level representation of our proposed fuzzy inference system (FIS) in the fuzzy logic toolbox of MATLAB.
Figure 6. Higher-level representation of our proposed fuzzy inference system (FIS) in the fuzzy logic toolbox of MATLAB.
Energies 14 00881 g006
Figure 7. Surface plot of peer-to-peer (P2P) energy trading, with real-time price per unit of electricity on the X-axis and outdoor temperature on the Y-axis. Other parameters are kept constant for simulation purposes to observe the interrelation of real-time price and outdoor temperature input variables with the P2P energy trading.
Figure 7. Surface plot of peer-to-peer (P2P) energy trading, with real-time price per unit of electricity on the X-axis and outdoor temperature on the Y-axis. Other parameters are kept constant for simulation purposes to observe the interrelation of real-time price and outdoor temperature input variables with the P2P energy trading.
Energies 14 00881 g007
Figure 8. Surface plot of exporting electricity to the main grid, with real-time price per unit of electricity on the X-axis and buyers’ interest on the Y-axis. Other parameters are kept constant for simulation purposes to observe the interrelation of real-time price and buyers’ interest input variables with the exporting of electricity to the main grid.
Figure 8. Surface plot of exporting electricity to the main grid, with real-time price per unit of electricity on the X-axis and buyers’ interest on the Y-axis. Other parameters are kept constant for simulation purposes to observe the interrelation of real-time price and buyers’ interest input variables with the exporting of electricity to the main grid.
Energies 14 00881 g008
Table 1. Comparison of our proposed system with existing approaches.
Table 1. Comparison of our proposed system with existing approaches.
AuthorsScalabilityNetwork LatencyExport to Main GridP2P TradingComputational EfficiencyMulti-MediumPrivacyLocal Balance
Liu et al. [13]××××××
Rubio et al. [14]××××××
Alam et al. [15]×××××
Khorasany et al. [16]×××××
Zhang et al. [17]×××××
Gai et al. [18]×××××
Son et al. [19]×××××
Proposed System×
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Shahzad, K.; Iqbal, S.; Mukhtar, H. Optimal Fuzzy Energy Trading System in a Fog-Enabled Smart Grid. Energies 2021, 14, 881. https://doi.org/10.3390/en14040881

AMA Style

Shahzad K, Iqbal S, Mukhtar H. Optimal Fuzzy Energy Trading System in a Fog-Enabled Smart Grid. Energies. 2021; 14(4):881. https://doi.org/10.3390/en14040881

Chicago/Turabian Style

Shahzad, Khuram, Sohail Iqbal, and Hamid Mukhtar. 2021. "Optimal Fuzzy Energy Trading System in a Fog-Enabled Smart Grid" Energies 14, no. 4: 881. https://doi.org/10.3390/en14040881

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop