^{1}

^{2}

^{1}

This research addresses the planning and scheduling problem in and among the smart homes in a community microgrid. We develop a bi-linear algorithm, named ECO-Trade to generate the near-optimal schedules of the households ’ loads, storage and energy sources. The algorithm also facilitates Peer-to-Peer (P2P) energy trading among the smart homes in a community microgrid. However, P2P trading potentially results in an unfair cost distribution among the participating households. To the best of our knowledge, the ECO-Trade algorithm is the first near-optimal cost optimization algorithm which considers the unfair cost distribution problem for a Demand Side Management (DSM) system coordinated with P2P energy trading. It also solves the time complexity problem of our previously proposed optimal model. Our results show that the solution time of the ECO-Trade algorithm is mostly less than a minute. It also shows that 97% of the solutions generated by the ECO-Trade algorithm are optimal solutions. Furthermore, we analyze the solutions and identify that the algorithm sometimes gets trapped at a local minimum because it alternately sets the microgrid price and quantity as constants. Finally, we describe the reasons of the cost increase by a local minimum and analyze its impact on cost optimization.

The significance of smart home research is growing rapidly because of increasing industrial demand. In North America, the forecasted annual growth rate of smart homes is 23.1%, resulting in 63 million smart homes by 2022 [

This research addresses the planning and scheduling problem in smart homes. It also considers the interactions between the smart homes in a community microgrid. In the smart homes, the prosumers generate energy from the renewables (e.g., solar panels, miniature wind turbines, etc.) and store energy into energy storage systems (e.g., electric vehicles, home energy storage, etc.). A network of interconnected smart homes in a neighborhood forms a community microgrid which enables peer-to-peer (P2P) energy trading among themselves. This research emphasizes on energy source, storage and load scheduling in smart homes to increase energy efficiency and minimize the energy costs.

This research integrates Demand Side Management (DSM) with P2P energy trading in a community microgrid. However, P2P energy trading may create a cost fairness issue. It means that a household cost when it trades energy in the microgrid is sometimes higher than the cost when it does not participate. This issue may discourage end-users from participating in energy trading. We address this unfair cost distribution problem by assuring Pareto optimality among the households in the microgrid.

In our previous study, we developed an optimal model to solve this multi-objective cost optimization problem [

Furthermore, in contrast to our previous paper [

The reminder of this article is organized as follows. Section 2 identifies the research gap and discusses the significance of the ECO-Trade optimization algorithm. Section 3 describes the ECO-Trade algorithm. Section 4 presents the results using synthetic and real datasets. Section 5 analyzes the conditions for sub-optimal solutions. Section 6 discusses the impact of a local minimum on cost optimization. Finally, Section 7 concludes the article, summarizing our contributions.

An energy cost optimization problem is typically formulated as a linear or non-linear optimization model. Linear programming is widely used to solve linear optimization models [

P2P energy trading among the households is a comparatively new concept. The P2P service providers maintain the distribution network and provide metering and billing services [

This work presents a near-optimal cost optimization algorithm which considers the unfair cost distribution problem for a DSM system coordinated with P2P energy trading.

Authors | Year | Method | Solution Type | Addressed Cost Fairness Issue? | Coordinate DSM with P2P Trading? | Evaluated with an Optimal Method? |
---|---|---|---|---|---|---|

Shamsi et al. [ | 2016 | Dynamic Programming | Approximate | Yes | No | No |

Liu et al. [ | 2017 | Bi-Level Programming | Approximate | Yes | No | No |

Tushar et al. [ | 2017 | Game Theory | Approximate | Yes | No | No |

Long et al. [ | 2018 | Constrained Non-Linear Programming | Approximate | Yes | No | No |

Samadi et al. [ | 2016 | Game Theory, Approximate Dynamic Programming | Approximate | Yes | Yes | No |

Zhou et al. [ | 2018 | Multiagent System | Approximate | Yes | Yes | No |

ECO-Trade [ | 2019 | Bi-Linear Programming | Near-Optimal | Yes | Yes | Yes |

The proposed ECO-Trade algorithm follows a bi-linear programming approach. It breaks down our previously proposed optimal model (which is a non-convex MINLP model [

Module 1 optimizes the energy cost for the individual households when they do not participate in microgrid energy trading. It computes the initial values of energy supply and demand, D S k , h (defined later in (16)). Module 2 uses the values of D S k , h as constants in the first iteration of the bi-linear algorithm.

Objective Function: If a household does not participate in microgrid energy trading, its energy cost is expressed as (1).

C k N o T r a d e = ∑ h ∈ H G P h ⋅ G E k , h + ∑ i ∈ I d k , i ( τ k , i − ( ∑ h ∈ H r k , i , h ⋅ h + t k , i − 1 ) ) (1)

The objective function is defined as (2),

min C k N o T r a d e (2)

The optimal solution should satisfy the following constraints.

Energy Balance Constraints: Constraint (3) ensures the balance of energy consumption and generation in each timeslot for all households. The total energy consumed by the loads should be the same as the total energy generated by the energy sources. In this constraint, the grid and renewables are energy sources and the home appliances are loads. The storage and the microgrid can be energy sources or loads based on their functionalities in each timeslot.

∑ i ∈ I S k , i , h ⋅ p k , i + I C k , h ⋅ S P k = G E k , h + B E k , h + R E k , h , ( k ∈ K , h ∈ H ) (3)

Stored Energy Constraints: In the first timeslot, storage energy is a function of initial storage energy, storage efficiency and self-discharging rate as expressed in (4).

S E k , 1 = I E k ⋅ S D k + I C k , 1 ⋅ S P k ⋅ E k − B E k , 1 , ( k ∈ K ) (4)

The stored energy in the other timeslots is a function of the available stored energy in the immediate previous timeslot, storage efficiency, and self-discharging rate, which has been expressed in (5).

S E k , h = I E k , h − 1 ⋅ S D k + I C k , h ⋅ S P k ⋅ E k − B E k , h , ( k ∈ K , h ∈ H : h ≠ 1 ) (5)

The proposed algorithm discourages charging and discharging a storage at the same time because it will increase the energy cost. While charging the storage, due to the efficiency ( E k ), we lose energy which we could have used directly to power an appliance/load or to sell, without loss.

There are 2 ways to represent storage charging. One is using discrete charging power (on/off charging using a Boolean variable). Another way is using continuous values as the storage charging power. We used the former method so that the proposed algorithm can also consider the storage of an EV. The charging duration of an EV depends on the charging power and this on/off charging feature with fixed charging power gives the user more control over the required time to charge a storage.

Storage Capacity Constraints: Constraints (6) and (7) ensure that a storage energy should not exceed the maximum storage capacity and should not go below the minimum energy level.

S E k , h ≤ M i n C k , ( k ∈ K , h ∈ H ) (6)

S E k , h ≥ M i n C k , ( k ∈ K , h ∈ H ) (7)

Task Duration Constraints: For each appliance, Constraint (8) maintains the total duration of an operation. It also ensures that the operation of an appliance can be interrupted as long as its duration of operation satisfies the required time to complete the task. For example, a dishwasher is an interruptible appliance. If it takes three hours to complete a task and has to be completed by 12 am, it does not matter what three hours we are operating the dishwasher.

∑ h ∈ H S k , i , h = t k , i , ( k ∈ K , i ∈ I ) (8)

Renewable Energy Availability Constraints: Constraint (9) ensures that the energy drown from the renewables should be equal or less than the available energy.

R E k , h ≤ R Q k , h , ( k ∈ K , h ∈ H ) (9)

Reservation Time Constraints: Constraint (10) specifies that an appliance operation should start after (or at) the reservation time. ∑ h ∈ H r k , i , h ⋅ h refers to the reservation timeslot. An appliance is reserved only once in the time horizon. Therefore, the multiplication of r k , i , h by the corresponding timeslot h provides the reservation timeslot.

∑ h ∈ H S k , i , h = ∑ h = ∑ h ∈ H r k , i , h ⋅ h N S k , i , h , ( k ∈ K , i ∈ I ) (10)

If an appliance is requested multiple times within the same time horizon, the algorithm schedules the appliance operation as if it had multiple similar appliances.

Relationship between the Scheduling Vector and the End Time Constraints: Constraint (11) binds t k , i with S k , i , h . The end time of an appliance should also be the last execution time.

S k , i , h ⋅ h ≤ τ k , i , ( k ∈ K , i ∈ I , h ∈ H ) (11)

Maximum Allowable Delay Constraints: Constraint (12) specifies that an appliance operation must be completed before (or at) the user defined maximum allowable time limit.

τ k , i ≤ β k , i , ( k ∈ K , i ∈ I ) (12)

Uninterruptibility Constraints: Constraints (13) and (14) define that an uninterruptible appliance keeps running without any interruption until it completes its operation.

∑ d = 0 t k , i − 1 S k , i , h + d − t k , i ≥ − t k , i ( 1 − U S k , i , h ) , ( k ∈ K , i ∈ U , h = [ 1 , N − t k , i + 1 ] ) (13)

∑ h = 1 N − t k , i + 1 U S k , i , h = 1 , ( k ∈ K , i ∈ U ) (14)

Utility Grid Max Power Limit Constraints: Constraint (15) limits the power that can be drawn from the grid.

G E k , h ≤ L k max , ( k ∈ K , h ∈ H ) (15)

Demand and Supply Constraints: Equation (16) calculates the demand or supply of energy from the external energy sources like grid and microgrid. If the value of D S k , h is positive, the household has energy demand. If the value of D S k , h is negative, the household has energy surplus.

D S k , h = ∑ i ∈ I S k , i , h ⋅ p k , i + I C k , h ⋅ S P k − R Q k , h − S E k , h − B E k , h + M i n C k , ( k ∈ K , h ∈ H ) (16)

Module 2 computes the microgrid energy price. In this module, M E k , h is a constant and M P h is a variable.

Objective Function: The proposed model in Module 2 is a multi-objective optimization problem which is expressed as (17).

min ( C t o t a l , C 1 , C 2 , ⋯ , C k ) (17)

Here, C t o t a l is the total cost of all households and C k is the total cost of the k-th household which are expressed in (18) and (19) respectively.

C t o t a l = ∑ k ∈ K ∑ h ∈ H G P h ⋅ G E k , h + ∑ k ∈ K ∑ i ∈ I d k , i ( τ k , i − ( ∑ h ∈ H r k , i , h ⋅ h + t k , i − 1 ) ) (18)

C k = ∑ h ∈ H G P h ⋅ G E k , h + ∑ h ∈ H M P h ⋅ M E k , h + ∑ i ∈ I d k , i ( τ k , i − ( ∑ h ∈ H r k , i , h ⋅ h + t k , i − 1 ) ) (19)

The total energy bought from the microgrid is the same as the total energy sold to the microgrid. Therefore, microgrid energy price does not have an impact on the total cost. Hence, Equation (18) does not require the microgrid energy cost. This multi-objective optimization problem is solved by using C t o t a l as the sole objective function and the remaining objective functions, C k , are added as inequality constraints (Constraint (24) discussed later). Therefore, the objective function of Module 2 is defined as (20).

min C t o t a l (20)

The optimization model should satisfy Constraints (4) (15) as well as the following constraints.

Energy Balance Constraints: Constraint (21) ensures that, in a specific household, total energy consumption is equal or less than the total available energy.

∑ i ∈ I S k , i , h ⋅ p k , i + I C k , h ⋅ S P k ≤ G E k , h + B E k , h + R E k , h + M E k , h , ( k ∈ K , h ∈ H ) (21)

Microgrid Energy Price Constraints: Constraints (22) and (23) define the maximum and minimum limits of microgrid energy price.

M P h ≥ 0, ( h ∈ H ) (22)

M P h ≤ G P h , ( h ∈ H ) (23)

Pareto Optimality Constraints: Constraint (24) implements Pareto optimality. It ensures that a household cost when it participates in microgrid trading must be less than or equal to the cost when it does not participate.

C k ≤ C k N o T r a d e , ( k ∈ K ) (24)

The third module computes the microgrid energy, M E k , h , using the constant microgrid prices, M P h , provided by Module 2. The optimization model of Module 3 is similar to Module 2. The main differences are: 1) it does not require Constraints (22) and (23) because microgrid prices are constants, and 2) Constraint (21) of Module 2 is modified as Constraint (25). Module 3 also requires the following constraints.

Energy Balance Constraints: Constraint (25) ensures that, for a specific household, the total energy consumption should be the same as the total available energy.

∑ i ∈ I S k , i , h ⋅ p k , i + I C k , h ⋅ S P k = G E k , h + B E k , h + R E k , h + M E k , h , ( k ∈ K , h ∈ H ) (25)

A negative value of M E k , h means the household is an energy seller at that specific timeslot. A positive value means the household is a buyer.

Energy Balance Constraints for Microgrid: Constraint (26) ensures that the total energy sold in the microgrid by all households must be equal to the total energy bought from the households.

∑ k ∈ K M E k , h = 0 , ( h ∈ H ) (26)

Energy Constraints While Trading in Microgrid: Constraint (27) calculates the amount of available energy to trade in the microgrid.

M Q k , h = ∑ i ∈ I S k , i , h ⋅ p k , i + I C k , h ⋅ S P k − G E k , h − R Q k , h − S E k , h − B E k , h + M i n C k , ( k ∈ K , h ∈ H ) (27)

If a household is a seller at a timeslot, this constraint limits the maximum amount of energy that the household can sell to the microgrid. If a household is a buyer, this constraint defines the minimum energy required by the household from the microgrid.

M E k , h ≥ M Q k , h , ( k ∈ K , h ∈ H ) (28)

In this section, we compare the proposed ECO-Trade algorithm with the optimal model to evaluate its performance. We used a 64 bit Fedora 20 machine with Intel Core i7 CPU (2.67 GHz) and 12 GB RAM to collect the results. CPLEX 12.6.1.0 [

This section shows the impact of the number of households, timeslots and appliances on the computation time.

In the previous section, we compared the ECO-Trade algorithm with the optimal model for small problem sizes. Although it is the best approach to evaluate the performance of an approximate algorithm, it is not practical for our case because we are unable to generate solutions for large scenarios. If we exclude the non-linear constraints from the optimal model, its time complexity will decrease because in this case, the optimal model will be reduced to an MILP model. However, this optimal model will no longer ensure Pareto optimality.

Parameter | Value |
---|---|

Storage Efficiency | 90% |

Storage Self-Discharging Rate | 0.01% |

Storage Initial Energy (kWh) | 5 |

Reservation Time | 1st Timeslot |

End Time | Last Timeslot |

Maximum Power Limit of a Household (kW) | Infinite (200,000) |

Parameter | Min | Max |
---|---|---|

Duration of Appliance Operations | 1 | Total Timeslots |

Appliance Power (kW) | 0.5 | 15 |

Grid Energy Price (Cent) | 0.1 | 5 |

Disutility Factor (Cent) | 0.01 | 10 |

Storage Power (Cent) | 2 | 5 |

Minimum Storage Capacity (kWh) | 0 | 2 |

Maximum Storage Capacity (kWh) | 5 | 10 |

Renewable Energy (kWh) | 0 | 10 |

The cost of the previously proposed optimal model [

Pareto optimality is always equal to or less than the minimum cost that considers Pareto optimality. In

We used household load datasets collected in Ottawa [

considered 12 households which were selected based on their annual consumption profiles. The electricity bills of the potential participants were examined; some volunteers were selected for the study because their annual electricity consumption were close to the Canadian average, whereas others were selected because they consume below or above the average.

We collected solar irradiance for Ottawa from the National Solar Radiation Database (NSRDB) [

We used Tesla Powerwall as the home energy storage. The storage characteristics are given in

We used 4 representative days of 2010 based on seasons (summer and winter) and days of the week (weekend day and weekday). We used Real-Time Price (RTP) and Time-Of-Use (TOU) prices of these days to evaluate our algorithm. Hydro Ottawa uses a TOU price which is set by the Ontario Energy Board (OEB) [

Properties | Description |
---|---|

PV Module | Suntech STP200S-18/ub-1 Module |

Array Tilt Angle | 45.41˚ (Site Latitude) |

Array Azimuth | 180˚ (South Facing Array) |

Number of Modules in Series | 2 |

Number of Parallel Strings | 2 |

Properties | Values |
---|---|

Power | 3.3 kW |

Efficiency | 92% |

Self-Discharging Rate | 1% per Day (0.042% per Hour) |

Minimum Energy Level | 2.56 kWh (40% of Max Capacity) |

Maximum Energy Level | 6.4 kWh |

We used different settings of the parameters to generate different scenarios. For household loads, we considered a summer weekday, a summer weekend day, a winter weekday and a winter weekend day load profiles. For each of these load profiles, we divided the scenarios based on user preference: economy and comfort. A user may prefer to save cost, which we labeled as economy. We used a low value of the disutility factor (0.001 per timeslot) so that the algorithm can tolerate more delay in appliance operation. On the other hand, a user may prefer more comfort. In this setting, the disutility factor is set to a higher value (200 per timeslot) so that the algorithm shows reluctance to any delay in appliance operation. If the household has a storage, the scenarios were varied based on the initial storage energy. A household can have minimum storage energy or maximum storage energy at the beginning of a planning cycle. The parameters were also different for RTP and TOU energy price schemes. A detailed description of how these parameters were used to generate different scenarios can be found in [

We generated 112 different scenarios for performance analysis. The ECO-Trade algorithm terminates if the cost does not improve more than 0.1% within 3 consecutive iterations. Results show that the ECO-Trade algorithm provides optimal solutions for 99% of the scenarios. The remaining 1% of cases had a cost at most 1.8% higher than the optimal solution. The median solution time is around 4.6 sec for all scenarios. For the ECO-Trade algorithm, the solution times of 90.2% of the scenarios are below 1 min. We observed that 7.1% of the scenarios took more than 2 min to solve. Therefore, we conclude that the proposed ECO-Trade algorithm is a better alternative to the optimal model considering the trade-off between the accuracy and the solution time.

The ECO-Trade algorithm sometimes gets trapped into a local minimum and cannot improve the resulting solution any further. In this section, we analyze the conditions under which the algorithm generates sub-optimal solutions. For simplicity, we consider only 2 households, 2 timeslots and 1 appliance. We exclude the renewables and the self-discharging feature of the storage. We do not consider the disutility cost, i.e., all disutility factors are set to 0. The appliance and storage characteristics are shown in

We use Module 1 of the ECO-Trade algorithm to generate the household cost when they are not participating in the microgrid energy trading.

Now, we introduce the microgrid and solve the same optimization problem, but this time also allowing the households to trade energy with each other.

To generate a suboptimal result with this simple scenario, we initialize the microgrid prices for the two timeslots as follows. We use the grid price (which is the maximum limit of the microgrid price) as the microgrid price at the 1st timeslot and we use 0 (which is the minimum limit of the microgrid price) as the microgrid price at the last timeslot. The ECO-Trade algorithm gets trapped into a local minimum and cannot improve the solution any further. It generates the same solution in the next few iterations and finally terminates with a solution which is given in

In

Household | Appliance | Duration (Time-slots) | Power (kW) | Disutility Factor () | Reservation Time-slot | Max Delay |
---|---|---|---|---|---|---|

Household 1 | App1 | 2 | 2 | 0 | 1 | 2 |

Household 2 | App1 | 2 | 4 | 0 | 1 | 2 |

Characteristics | Household 1 | Household 2 |
---|---|---|

Initial Energy (kWh) | 2 | 2 |

Power (kW) | 5 | 3 |

Max Capacity (kWh) | 6 | 8 |

Min Capacity (kWh) | 2 | 2 |

Charging Efficiency | 50% | 50% |

Self-Discharging Rate (per Timeslots) | 0% | 0% |

Household | Household 1 | Household 2 | ||
---|---|---|---|---|

Timeslot | 1 | 2 | 1 | 2 |

Price Grid | 3.00 | 9.00 | 3.00 | 9.00 |

Stored Energy (Availability) | 4.00 | 2.00 | 3.50 | 2.00 |

Energy Source Grid | 6.50 | 0 | 7.00 | 2.50 |

Storage | 0.50 | 2.00 | 0 | 1.50 |

Load Storage Charging | 1 | 0 | 1 | 0 |

App1 | 1 | 1 | 1 | 1 |

Total Cost: 63 | Cost: 19.5 | Cost: 43.5 |

Household | Household 1 | Household 2 | ||
---|---|---|---|---|

Timeslot | 1 | 2 | 1 | 2 |

Price Grid | 3.00 | 9.00 | 3.00 | 9.00 |

Microgrid | 1.22 | 6.09 | 1.22 | 6.09 |

Stored Energy (Availability) | 4.50 | 2.00 | 3.50 | 2.00 |

Microgrid (Demand/Availability) | −1.32 | −1.28 | −2.68 | 1.28 |

Energy Source Grid | 5.82 | 0.78 | 8.18 | 1.22 |

Storage | 0 | 2.50 | 0 | 1.50 |

Microgrid (Source/Load) | 1.18 | −1.28 | −1.18 | 1.28 |

Load Storage Charging | 1 | 0 | 1 | 0 |

App1 | 1 | 1 | 1 | 1 |

Total Cost: 60 | Cost: 18.14 | Cost: 41.86 |

minimum load is 7 kWh (2 kWh for the appliance and 5 kWh for charging the storage). Household 1 sells 7 kWh of energy to Household 2. Therefore, the total load at this timeslot is 14 kWh. This 14 kWh is drawn from the grid and the storage (13.5 kWh from the grid and 0.5 kWh from the storage). Selling energy to the microgrid does not have any impact on the household cost because buying grid energy has the same cost as selling energy to the microgrid. Therefore, the

Household | Household 1 | Household 2 | ||
---|---|---|---|---|

Timeslot | 1 | 2 | 1 | 2 |

Price Grid | 3.00 | 9.00 | 3.00 | 9.00 |

Microgrid | 3.00 | 0 | 3.00 | 0 |

Stored Energy (Availability) | 4.00 | 2.00 | 3.50 | 2.00 |

Microgrid (Demand/Availability) | −9.00 | 0 | 5.50 | 0 |

Energy Source Grid | 13.5 | 0 | 0 | 2.50 |

Storage | 0.50 | 2 | 0 | 1.50 |

Microgrid (Source/Load) | −7.00 | 0 | 7.00 | 0 |

Load Storage Charging | 1 | 0 | 1 | 0 |

App1 | 1 | 1 | 1 | 1 |

Total Cost: 63 | Cost: 19.5 | Cost: 43.5 |

energy cost for household 1 is 19.53 for 6.5 kWh energy. At timeslot 2, household 1 does not buy energy from the grid. It uses 2 kWh of energy from the storage. The microgrid price is 0 at this timeslot. Hence, buying or selling energy to the microgrid does not impact the household cost (microgrid quantity is set to 0 kWh).

In an iteration, when the microgrid prices are 3 and 0 (constants) for timeslots 1 and 2 respectively, we get a solution which trades −7 kWh and 0 kWh of energy in the microgrid. This solution provides the maximum cost for Household 1, which is 19.5. The microgrid quantity does not have any impact on the energy cost because either the microgrid price is 0 or it is the same as the grid price. Therefore, this solution cannot be improved for the given constant microgrid prices.

In the next iteration, when the microgrid quantities are constants (−7 kWh and 0 kWh for timeslots 1 and 2 respectively) the solution cannot be improved either. At timeslot 1, any microgrid price which is less than 3 will increase the Household 1 energy cost to more than 19.5, which violates the Pareto optimality constraint. For timeslot 2, the microgrid price does not have any impact on energy cost because the households do not trade energy at this timeslot.

A similar explanation is also applicable to household 2. When the microgrid prices are constants (3 and 0 for timeslots 1 and 2 respectively), the total energy cost of this household is the same for any amount of microgrid energy trading. On the other hand, when the microgrid quantities are constants (7 kWh and 0 kWh for timeslots 1 and 2 respectively), any value which is less than 3 violates the Pareto optimality constraint for Household 1. For timeslot 2, the microgrid price does not have any impact because it does not trade energy in microgrid.

In an iteration, if the energy price is greater than 0 (at timeslot 2 for both households), we will not trade energy: the only household available to sell into the microgrid is household 1, but it has no energy available (unless it bought some from the grid, but then it would have to sell at least at the grid price to come out ahead).

In addition to this simple example, we analyze all scenarios which generated sub-optimal solutions. These are relatively large scenarios and it is hard to identify the exact reasons for sub-optimal solutions. We notice different patterns in the solutions which are mostly related to the boundary values of the microgrid price. Every sub-optimal scenario we found has microgrid energy prices that are higher in adjacent timeslots and the price is either 0 or the same as (or at least very close to) the grid price. However, scenarios where the grid prices are close to these boundary values do not always result in a sub-optimal solution.

In the proposed bi-linear optimization, the algorithm sets the microgrid prices as constants and determines the microgrid quantities in one module. In the next iteration, it sets the microgrid quantities as constants and determines the microgrid prices. This property of the algorithm sometimes does not allow the solution to be improved while maintaining the Pareto optimality constraints in each iteration. Therefore, we can conclude that the ECO-Trade algorithm sometimes gets trapped at a local minimum because it alternately sets the microgrid price and microgrid quantity as constants.

In this section, we analyze how a local minimum increases the total cost in a microgrid. To explore the factors, we studied the scenario which provides the worst solution with synthetic data. The scenario consists of 30 households, 2 appliances and 3 timeslots. The parameters used for this optimization were generated randomly as described in Section 4.1. For this scenario, the optimal cost is 132.79 and the sub-optimal cost generated by the ECO-Trade algorithm is 139.68. The sub-optimal cost is 5.2% higher than the optimal cost. We use this specific scenario to analyze all the results presented in this section.

There are 2 main reasons for an increase in the cost of the proposed the ECO-Trade algorithm. First, the sub-optimal microgrid price may force the ECO-Trade algorithm to buy more energy from the grid compared to the optimal solution. Second, it may delay an appliance operation compared to the optimal solution.

If, in a microgrid area, the households buy more energy from the grid compared to the optimal solution, then the ECO-Trade algorithm cannot produce the optimal solution. There are 2 main reasons that may cause the solution derived by the ECO-Trade algorithm to buy more energy from the grid:

Household | Max. Cost () | Opt. Cost () | ECO-T. Cost () | Cost Incr. () | Energy Loss Self-Dis.(kWh) | ||
---|---|---|---|---|---|---|---|

Stor. | Disuti. | Opt. | ECO-T. | ||||

1 | 28.55 | 24.14 | 28.55 | 0.46 | 0.11 | 0.16 | |

2 | 6.67 | 5.17 | 6.67 | 0.64 | 0.10 | 0.12 | |

3 | 14.22 | 12.34 | 14.21 | 0.67 | 0.11 | 0.16 | |

4 | 0.00 | −2.81 | −3.06 | 0.06 | 0.10 | 0.06 | |

5 | 2.52 | 1.04 | 2.50 | 0.11 | 0.10 | ||

6 | 4.52 | 3.27 | 4.51 | 0.11 | 0.13 | ||

7 | 5.88 | 4.34 | 4.01 | 0.11 | 0.12 | ||

8 | 13.71 | 12.01 | 13.71 | 0.59 | 0.10 | 0.17 | |

9 | 13.78 | 10.60 | 13.78 | 0.42 | 0.10 | 0.16 | |

10 | 9.32 | 8.09 | 9.31 | 0.41 | 0.10 | 0.13 | |

11 | 0.99 | 0.02 | 0.99 | 0.11 | 0.11 | ||

12 | 0.00 | −3.44 | −12.22 | 0.11 | 0.08 | ||

13 | 12.53 | 9.53 | 12.52 | 0.10 | 0.14 | ||

14 | 0.00 | −2.62 | −5.14 | 0.09 | 0.05 | ||

15 | 5.54 | 4.05 | 4.53 | 0.11 | 0.12 | ||

16 | 13.16 | 10.66 | 13.16 | 0.31 | 0.10 | 0.15 | |

17 | 26.52 | 22.34 | 26.51 | 0.33 | 0.10 | 0.17 | |

18 | 0.00 | −2.66 | −5.19 | 0.09 | 0.05 | ||

19 | 3.28 | 1.35 | 3.15 | 0.10 | 0.06 | ||

20 | 0.31 | −1.68 | −5.97 | 0.31 | 0.11 | 0.11 | |

21 | 7.16 | 5.64 | 7.25 | 0.45 | 0.11 | 0.12 | |

22 | 4.76 | 3.32 | 4.71 | 0.10 | 0.11 | ||

23 | 4.04 | 2.11 | 1.10 | 0.57 | 0.10 | 0.11 | |

24 | 2.12 | −0.07 | −2.37 | 0.11 | 0.08 | ||

25 | 0.00 | −1.59 | −4.40 | 0.11 | 0.08 | ||

26 | 8.98 | 7.67 | 8.98 | 0.62 | 0.11 | 0.14 | |

27 | 3.77 | 1.38 | 1.02 | 0.96 | 0.10 | 0.10 | |

28 | 3.04 | 0.85 | 0.06 | 0.11 | 0.09 | ||

29 | 0.00 | −1.65 | −0.02 | 0.10 | 0.06 | ||

30 | 0.88 | −0.63 | −3.18 | 0.10 | 0.11 | ||

Total | 196.26 | 132.79 | 139.68 | 4.43 | 2.35 | 3.15 | 3.35 |

Cost Difference | Total Increased | ECO-Trade Algorithm | |||||

between the | Cost in ECO-Trade | Lost 0.2 kWh | |||||

the Algorithms: 6.89 | Algorithm: 6.78 | More Energy |

The households in the ECO-Trade solution buy this energy at the 1st timeslot from the grid at a price of 1.41. Therefore, the ECO-Trade algorithm incurs an additional cost of 3.15 kWh*1.41/kWh = 4.43 compared to the optimal solution.

In a microgrid area, households may buy more energy from the grid if the storage devices lose more energy due to self-discharging.

The ECO-Trade solution sometimes delays an appliance operation, which increases the cost due to the disutility cost.

This paper analyzes the performance of the ECO-Trade algorithm compared to the optimal model. We get 97% optimal solutions for synthetic (small) data sets and 99% optimal solutions for more realistic (large) datasets. Also, the difference in results is less than 5.2% in the first case and 1.8% in the second case. The solution time is almost always less than one minute, and much lower than the optimal model. Therefore, based on the results presented in this paper, we can conclude that the ECO-Trade algorithm is a better alternative to the previously proposed optimal model considering the accuracy and the solution time.

We analyze the solutions generated by the ECO-Trade algorithm for a wide range of problem sizes and identify that the sub-optimal cost potentially arises when the microgrid price reaches the boundary limits. Every sub-optimal scenario we found has microgrid energy prices that are higher in previous adjacent timeslots and the price is either 0 or close to the grid price. In a local minimum, the sub-optimal microgrid energy price forces the households either to buy more energy to compensate for storage energy loss or delays appliance operations. However, having microgrid prices that take on their boundary values is not sufficient for a suboptimal solution to occur. In our work, only a small percentage of cases ended up being trapped in a local minimum. Going forward, we will explore how to deal with this issue. For example, we can verify whether a given solution has microgrid prices at the boundaries, and re-run modules 2 and 3 iteratively using perturbed microgrid prices (for example the average price) as a starting point.

The authors declare no conflicts of interest regarding the publication of this paper.

Alam, M.R., St-Hilaire, M. and Kunz, T. (2019) Towards Optimal Planning and Scheduling in Smart Homes. Smart Grid and Renewable Energy, 10, 179-202. https://doi.org/10.4236/sgre.2019.107012

A) Sets

H Set of timeslots where h ∈ H I Set of appliances where i ∈ I K Set of households where k ∈ K U Set of uninterruptible appliances where U ⊂ I B) Parameters

C p r e Previous cost

C c u r Current cost

d k , i Disutility factor of an appliance

E k Storage efficiency

G P h Grid energy price

I E k Initial storage energy level

L k max Maximum grid power limit

M i n C k Maximum storage capacity

M i n C k Minimum storage capacity

N Number of timeslots in the scheduling time horizon

p k , i Power consumption of an appliance

r k , i , h Reservation time of an appliance which represents the time when the scheduler gets a request to start a specific appliance (boolean constant, r k , i , h = 1 means that operation of the appliance is requested)

R Q k , h Amount of generated renewable energy

S D k Self-discharging coefficient of the storage

S P k Required power to charge the storage

t k , i Duration of the running time of an appliance

x Final solution

β k , i Maximum allowable delay of an appliance

ϵ Threshold value

ϵ c o u n t Threshold counter

ϵ max Maximum threshold counter limit

ϵ c u r Cost improvement

C) Variables

B E k , h Energy used from the storage ( B E k , h ∈ ℝ + )

C k Total cost of the k-th household when it participates in microgrid energy trading ( C k ∈ ℝ )

C k N o T r a d e Total cost of the k-th household when it does not participate in microgrid energy trading ( C k N o T r a d e ∈ ℝ )

C t o t a l Total cost of all households ( C t o t a l ∈ ℝ 0 + )

D S k , h Energy demand or supply of a household ( D S k , h ∈ ℝ , a positive value represents energy demand and a negative value represents energy surplus)

G E k , h Energy drawn from the grid ( G E k , h ∈ ℝ + )

I C k , h Storage charging state (boolean vector, I C k , h = 1 means the storage is in charging state)

M Q k , h Demand or supply of microgrid energy ( M Q k , h ∈ ℝ , a positive value represents the minimum energy demand of the household and a negative value represents the maximum amount of energy that the household can sell to the microgrid)

R E k , h Energy used from the renewable source ( R E k , h ∈ ℝ + )

S E k , h Energy level of a storage ( S E k , h ∈ ℝ + )

S k , i , h Appliance operation time (boolean vector, S k , i , h = 1 means the appliance is in operation)

U S k , i , h Start time of an uninterruptible appliance (boolean vector, U S k , i , h = 1 represents the timeslot when an uninterruptible appliance starts its operation)

τ k , i End time of an appliance operation ( τ k , i ∈ ℕ )

D) Variables or Parameters

D S k , h Energy demand or supply of a household ( D S k , h ∈ ℝ , a positive value represents energy demand and a negative value represents energy surplus). D S k , h is a variable in Module 1 and a parameter in Module 2.

M E k , h Energy traded in microgrid ( M E k , h ∈ ℝ , a positive value represents a buyer and a negative value represents a seller). M E k , h is a parameter in Module 2 and a variable in Module 3.

M P h Price of microgrid energy ( M P h ∈ ℝ + ). M P h is a variable in Module 2 and a parameter in Module 3.