Next Article in Journal
Optimal Pricing Strategies and Inventory Management for Fresh Food Products in Sustainable Cold Chain: Analytical Modeling with Korean Market Validation
Previous Article in Journal
Mental Health Impacts of Agri-Environmental Schemes: Insights from Agricultural Advisors in France and Ireland
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Efficient Energy Management for Smart Homes with Electric Vehicles Using Scenario-Based Model Predictive Control

1
China Automotive Engineering Research Institute Co., Ltd., Chongqing 401122, China
2
College of Mechanical and Vehicle Engineering, Chongqing University, Chongqing 400044, China
3
China Post Group Co., Ltd., Chongqing 400001, China
*
Author to whom correspondence should be addressed.
Sustainability 2025, 17(17), 7678; https://doi.org/10.3390/su17177678
Submission received: 18 February 2025 / Revised: 16 April 2025 / Accepted: 22 April 2025 / Published: 26 August 2025

Abstract

Model predictive control (MPC) is a commonly used online strategy for maximizing economic benefits in smart homes that integrate photovoltaic (PV) panels, electric vehicles (EVs), and battery energy storage systems (BESSs). However, prediction errors associated with PV power and load demand can lead to economic losses. Scenario-based MPC can mitigate the impact of prediction errors by computing the expected objective value of multiple stochastic scenarios. However, reducing the number of scenarios is often necessary to lower the computation burden, which in turn causes some economic loss. To achieve online operation and maximize economic benefits, this paper proposes utilizing the consensus alternating direction method of multipliers (C-ADMM) algorithm to quickly calculate the scenario-based MPC problem without reducing stochastic scenarios. First, the system layout and relevant component models of smart homes are established. Then, the stochastic scenarios of net load prediction error are generated through Monte Carlo simulation. A consensus constraint is designed about the first control action in different scenarios to decompose the scenario-based MPC problem into multiple sub-problems. This allows the original large-scale problem to be quickly solved by C-ADMM via parallel computing. The relevant results verify that increasing the number of stochastic scenarios leads to more economic benefits. Furthermore, compared with traditional MPC with or without prediction error, the results demonstrate that scenario-based MPC can effectively address the economic impact of prediction error.

1. Introduction

The integration of renewable energy sources and electric vehicles (EVs) into smart homes has become a cornerstone of modern energy systems, driven by the urgent need to reduce carbon emissions and enhance energy resilience. However, this integration poses significant challenges for grid stability and household energy management. For instance, global EV adoption has surged at an annual growth rate of over 40% since 2020, with projections indicating that EVs will account for 30% of all vehicle sales by 2030 [1]. Concurrently, residential photovoltaic (PV) installations are expected to reach 350 GW globally by 2025, a 200% increase from 2020 levels [2]. While these trends align with sustainability goals, they introduce critical operational complexities. For example, in Germany, grid operators curtailed approximately 6% of total renewable energy generation in 2021 due to PV output volatility, resulting in EUR 120 million in economic losses. Similarly, A research team from Stanford University found that unmanaged EV charging during peak hours in the Western United States has increased household electricity costs by up to 25% in regions with high EV penetration [3].
The real-world urgency of controlling energy flows in smart homes lies in mitigating two interconnected risks. One is the grid instability. Rapid EV adoption and PV variability create mismatches between supply and demand, straining distribution networks. For instance, the high demand from EV charging can strain the grid, leading to potential instability and capacity issues [4]. The other is the economic losses. Without dynamic energy management, households face higher costs from wasted PV generation (e.g., curtailment) and suboptimal EV charging schedules. In Australia, poorly managed home energy systems have led to 15–20% excess energy costs for EV owners.
To address these challenges, an effective energy management strategy (EMS) is essential to control the economic operation of energy components, including PV panels, EVs, and household appliances. Battery energy storage systems (BESSs) are common and effective components used to improve the self-consumption of PV power due to their excellent flexibility and energy efficiency. EMSs can generally be categorized as either rule-based or model predictive control (MPC) [5]. Rule-based strategies rely on a set of rules to coordinate the operation of diverse components to achieve end-users’ goals. These strategies are easy to implement in real time and have low computational costs, but lack optimality and may result in some economic loss [6]. The MPC framework is a powerful tool for optimizing economic benefits in smart homes by determining optimal control sequences in a specific future horizon. By predicting input information and implementing only the first control action at the current time, MPC achieves a degree of optimality through online receding operation and measurement output feedback [7]. Recent commercial implementations of MPC in smart home energy management systems (HEMS) demonstrate its growing practical relevance. For instance, Tesla’s Powerwall 3 integrates MPC algorithms to optimize PV–storage–EV coordination, reducing daily energy costs by 32% for households in California [8].
MPC offers significant advantages over rule-based strategies by enabling dynamic optimization through real-time prediction and constraint handling. Unlike rule-based approaches, which rely on predefined heuristics and lack adaptability to changing conditions, MPC explicitly incorporates system models and future predictions to minimize costs or maximize performance over a receding horizon. However, there are many types of MPC, and the following literature review will highlight the characteristics of different MPC.

1.1. Literature Review

The evolution of MPC strategies in smart home energy management can be categorized into two dominant paradigms—deterministic MPC and stochastic MPC—with the latter further divided into chance-constrained and scenario-based methods.
Deterministic MPC relies on a single predicted scenario of disturbances (e.g., PV generation, load demand) to optimize control actions. While computationally efficient, its performance is highly sensitive to prediction accuracy. For example, Wu et al. [9] demonstrated that a 15% error in PV prediction increases daily energy costs by 25% compared to perfect foresight. Similarly, Conte et al. [10] found that deterministic MPC fails to mitigate risks of battery overcharging during prolonged cloudy periods, leading to accelerated degradation. These studies underscore deterministic MPC’s inability to handle real-world uncertainties, necessitating robust alternatives. However, uncertainties such as the intermittent variation of PV power and users’ stochastic electricity consumption and car habits lead to prediction errors, which may cause economic losses and even malfunctioning of smart homes [11].
To address these uncertainties, stochastic MPC combines the advantages of stochastic programming and MPC, providing a probabilistic framework to account for the probabilistic occurrence of uncertainties [12]. Two categories of stochastic MPC are chance-constrained approaches [9,10] and scenario-based approaches [13,14]. Chance-constrained MPC relies on probability distributions to control the probability of violating certain constraints, while scenario-based approaches generate multiple stochastic scenarios to estimate the probability distribution of the uncertain parameters. Both approaches have their own principles and research, which will be discussed below.
Chance-constrained MPC ensures the satisfaction of state/output limitations with a predefined probability level. These constraints are designed to minimize the worst-case scenario while maintaining a certain level of confidence. However, the probability constraints need to be converted into deterministic ones to improve computational efficiency. In their work, Huang et al. [15] introduced a chance-constrained optimization framework for home energy management systems to account for uncertainty in electricity prices and household load. To reduce computational costs, they proposed an enhanced particle swarm optimization (PSO) algorithm, and a two-point estimate method. Aghdam et al. [16] developed a hierarchical three-stage energy management framework that uses a chance-constrained programming approach to schedule power in multi-microgrid systems, taking into account the unpredictability of wind power, PV power, and demand levels. They also analyzed the impact of various confidence levels on the system’s stability. Shi et al. [17] proposed a chance-constrained energy management model for an islanded microgrid, where the power demand may not always be satisfied due to uncertain renewable power generation or high costs of strict power balance. Chance constraints were used to permit control actions to violate the constraint within a small specific probability. Daneshvar et al. [18] utilized chance-constrained programming to manage energy transactions in microgrid clusters while balancing individual and collective interests. The simulation results demonstrated the effectiveness of the approach. However, chance-constrained MPC can be too conservative if fixed deterministic confidence intervals are used, leading to economic loss and potentially infeasible control actions in small probability scenarios.
To achieve optimal economic performance and reduce the impact of uncertainties, scenario-based MPC calculates the expected objective value of multiple stochastic scenarios, each accounting for different sources of uncertainty, and generates multiple optimal control strategies. As shown in Figure 1, the current inputs in different scenarios are the same due to the online measurement. Then, the expected first control action from these strategies is implemented as the actual control action. The uncertainties about disturbance or prediction error in the prediction horizon are commonly assumed to follow Gaussian distributions, and the stochastic scenarios in scenario-based MPC are typically sampled using Monte Carlo simulation [19]. Hans et al. [20] presented a scenario-based MPC approach for the optimal operation of islanded microgrids that takes into account the prediction errors of wind power and load demand. Zhou et al. [21] proposed an improved differential evolution algorithm to solve the large-scale problems. While this algorithm excels in discrete, network-level optimization, scenario-based MPC is tailored for continuous, real-time energy management under uncertainty. By comparing with chance-constrained approaches, scenario-based MPC was shown to lead to a higher self-consumption rate of wind power generation. However, a large number of scenarios may limit the tractability of the scenario-based MPC problem due to a large demand for computing power. The computational burden will increase exponentially with the increase in scenarios, though increasing the number of scenarios can improve the objective function.
To balance the accuracy of the solution with the computational burden, scenario-reduction techniques such as forward selection and backward reduction are often used [22]. This allows scenario-based MPC to be applied online. However, as shown in Figure 1, reducing the number of stochastic scenarios may degrade the optimality of the control actions calculated by scenario-based MPC, which could lead to decreased economic benefits of energy systems. Ideally, according to the law of large numbers, a larger number of stochastic scenarios will yield a more accurate characterization of the probability distribution of uncertainties, resulting in greater economic benefits.
Based on the previous discussion, it is evident that chance-constrained MPC can result in conservative control actions and economic loss, even though it is more computationally efficient than scenario-based MPC. On the other hand, scenario-based MPC can achieve better objective values, but the optimality of control actions may deteriorate due to scenario reduction methods that enable online applications. Therefore, the key issue is to ensure the maximization of economic efficiency in the use of electricity in smart homes, while also ensuring the computational efficiency for real-time application of control strategies.

1.2. Contributions

To maximize the economic performance and ensure online application capability, this study proposes the use of the consensus alternating direction method of multipliers (C-ADMM) algorithm to efficiently solve the computational burden of scenario-based MPC, which avoids reducing stochastic scenarios because of the distributed and parallel computing mode, as shown in Figure 2. Firstly, the system layout of a smart home and relevant mathematical models of the components are established. Then, the Monte Carlo simulation generates the stochastic scenarios of net load prediction errors based on the given probability distribution. The scenario-based MPC problem is designed and subsequently decomposed into multiple sub-problems by establishing the consensus constraint of the first control action in different scenarios. Finally, C-ADMM is used to solve these sub-problems in parallel without reducing the stochastic scenarios. The contributions of this paper can be summarized as follows:
  • To address the economic impact of PV power generation and load demand prediction error in smart homes, the uncertainties about the prediction error are simulated by generating multiple stochastic scenarios. Then C-ADMM, benefiting from its decomposition, coordination, and parallel computing capability, is used to accelerate the solution of scenario-based MPC. This avoids the economic loss caused by the scenario reduction and realizes the online operation of scenario-based MPC.
  • This paper analyzes the economic impact of stochastic scenario number on scenario-based MPC and verifies that too few scenarios will lead to more economic loss. Meanwhile, the effect of increasing scenarios on the single iteration time and the iteration number of C-ADMM algorithm is also discussed. The existing literature has not discussed the above characteristics of scenario-based MPC.
The remaining sections of this paper are structured as follows. In Section 2, we present the system layout of a smart home and relevant component mathematical models. In Section 3, we introduce the computing method of scenario-based MPC based on C-ADMM. Section 4 presents the relevant results and discussion. Lastly, in Section 5, we summarize the conclusions drawn from this study.

2. System Modeling

2.1. System Layout

Figure 3 illustrates the smart home, which comprises PV panels, a BESS, an EV, and other household appliances. The red lines with arrows indicate the power flow between these components, and the direction of the arrow represents the flow direction. The smart home is connected to the power grid for two-way energy trading. The PV panels, BESS, and power grid can supply power to the appliances and charge the EV. The power grid can charge the BESS at a low electricity price due to the time-of-use (TOU) rate, in addition to the free PV power. The BESS can then discharge to supply the appliances and EV or sell power to the power grid at a high electricity price. The PV power can also be exported to the power grid for energy benefits. It should be noted that the EV cannot discharge to supply power to the smart home. This is due to the conclusion from [23] that the vehicle-to-home (V2H) interaction contributes to a higher cost of aging for EV batteries.
The power flow between these components in a smart home must satisfy a power balance as shown below
P n e t ( t ) + P e v ( t ) = P g r i d _ l o a d ( t ) P p v _ g r i d ( t ) + P d i s ( t ) P c h ( t ) P c u r t a i l ( t ) ,
where the net load P net t =   P load t P pv t represents the difference between the load demand of house owners and PV power generation at time step t.   P ev t represents the charging power of the EV.   P grid _ load t and   P pv _ grid t are the purchased power from the power grid and the PV power sold to the power grid, respectively.   P dis t and   P ch t are the discharging power and charging power of the BESS.   P curtail t represents the curtailed PV power after   P pv _ grid t reaches the export limit.
Note that   P ev t ,   P grid _ load t ,   P pv _ grid t ,   P dis t ,   P ch t , and   P curtail t are all non-negative. In addition,   P grid _ load t and   P pv _ grid t must keep the same symbolic relationship with P net t , as shown in Equation (2). In other words, the smart home must get electricity from the power grid when P net t is positive and export PV power to the power grid when P net t is negative.
P n e t ( t ) P g r i d _ l o a d ( t ) 0 P n e t ( t ) P p v _ g r i d ( t ) 0 .

2.2. Component Modeling

The BESS serves as an energy buffer that can store energy generated by the PV panels and the power grid. It can then release the stored energy as required to power household appliances, EV, and even supply power back to the power grid. The energy state   E b t of the BESS can be derived by
E b ( t + 1 ) = E b ( t ) P d i s ( t ) Δ T / η b + P c h ( t ) Δ T η b
where η b is the energy efficiency of the BESS and T is the time step. In addition, to guarantee stable operation, the BESS energy state, charging and discharging power need to vary in the specific intervals as
E b , min E b ( t ) E b , max 0 P d i s ( t ) P d i s , max 0 P c h ( t ) P c h , max
where   E b , min and   E b , max are the BESS’s minimal energy and maximal energy, respectively.   P dis , max and   P ch , max are the maximal discharging and charging power, respectively.
The EV is assumed to be charged once a day due to commuting demand. The energy state   E ev t of the EV can be derived by
E e v ( t + 1 ) = E e v ( t ) + P e v ( t ) Δ T η e v
where η ev is the charging efficiency of the EV. Note that since V2H is not considered,   P ev t must be non-negative. The energy state and charging power of the EV also need to vary in specific intervals as
E e v , min E e v ( t ) E e v , max 0 P e v ( t ) P e v , max .
Since this paper only focuses on the ability to quickly solve scenario-based MPC by using C-ADMM, rather than the in-depth research of uncertainties, the stochastic variation of EV plug-in time   t a , plug-out time   t d , and charging demand for mobility are ignored. In other words, the plug-in time   t a , plug-out time   t d , plug-in energy state, and plug-out energy state of the EV are given in advance. The plug-in energy state and plug-out energy state of the EV are set as
E ( t a ) = 0.6 E e v r a t e E ( t d ) = 0.8 E e v r a t e
where E ev rate is the rated energy of the EV battery pack.

3. Methods

In order to address the economic losses caused by prediction errors in traditional MPC, scenario-based MPC is employed. This method generates multiple error scenarios to capture prediction errors as accurately as possible. The first step involves utilizing Monte Carlo simulation to randomly generate multiple error scenarios based on a given Gaussian probability distribution. Next, the MPC optimization problem is formulated with the aim of minimizing the expectation of multiple stochastic scenarios. Finally, to accelerate the computation of this optimization problem in parallel, C-ADMM is employed.

3.1. Scenario Generation

Field measurements from real-world PV systems and smart meters often show that prediction errors tend to follow a bell-shaped distribution centered around zero, with symmetric deviations. This aligns with Gaussian properties. The Central Limit Theorem suggests that aggregate errors from multiple independent uncertainty sources (e.g., weather variability, instrument noise) converge toward Gaussian behavior. Therefore, to account for the uncertainties in the prediction horizon of MPC, the prediction errors of PV power and load demand are assumed to follow a Gaussian probability distribution. Then the prediction errors of the net load P net t also follow Gaussian probability distribution. It is important to note that the efficiency of the proposed scenario-based MPC is only verified by considering the uncertainties of PV power and load demand.
To reduce the impact of prediction error and make the predicted values in the prediction horizon closer to the real value, the predicted net load P net t need to be corrected as
P ˜ n e t s ( t ) = P n e t ( t ) + w s ( t )
where w s ( t ) is the predicted error of scenario s at time step t sampled from the given Gaussian probability distribution. P ~ net s ( t ) is the corrected net load at time step t.
Note that there will be S error scenarios sampled from the Gaussian probability distribution by Monte Carlo simulation as shown in Figure 4. Each row data, including T time steps, represents a scenario. Each error scenario needs to be sampled from the given error probability distribution using a random sampling method. Assume that prediction errors are not related to the time index in the prediction horizon. This sampling process will repeat S times if S scenarios are required. The generated error scenarios will then be imported into the MPC framework to control the operation of the smart home.

3.2. Problem Formulation

In this study, scenario-based MPC considers S scenarios to mitigate the impact of prediction errors on the economy of the smart home. The objective function is to minimize the energy cost of the smart home at the current time. Based on generated probability scenarios, the objective function is formulated as the expectation of different scenarios, which is shown below
P g r i d _ l o a d s ( t ) , P p v _ g r i d s ( t ) , P d i s s ( t ) , P c h s ( t ) , P e v s ( t ) = arg min E 0 T 1 c g r i d _ l o a d P g r i d _ l o a d ( t ) c p v _ g r i d P p v _ g r i d ( t ) = arg min s = 1 S P p r o b s 0 T 1 c g r i d _ l o a d P g r i d _ l o a d s ( t ) c p v _ g r i d P p v _ g r i d s ( t )
where t   T ,   s   S , c grid _ load and c pv _ grid are the price of purchased energy and sold energy in (cents/kWh), respectively. P prob s is the specific probability of the sth scenario. Note that each scenario has the same probability due to the Monte Carlo-based sampling method. Thus, P prob s is set to 1/S. In addition, relevant state variables and control variables must be within the feasible range. The constraints are formulated by Equations (2)–(7). The power balance in Equation (1) is relaxed by inequality to eliminate the variable   P curtail t , which is converted as
P n e t ( t ) + P e v ( t ) P g r i d _ l o a d ( t ) P p v _ g r i d ( t ) + P d i s ( t ) P c h ( t ) .

3.3. Solution Procedure

Generally, in stochastic programming, a greater number of stochastic scenarios used to represent uncertainties generally leads to more stable optimization results. However, this also leads to an exponential increase in computing time. To address this issue, scenario reduction methods such as simultaneous backward reduction method [24] and forward selection method [25] are used to strike a balance between optimality and computing time. Additionally, traditional scenario-based MPC generates S control sequences, and the expectation of the first control action in each sequence is calculated to obtain real-time control action. However, this control action may not be the optimal solution obtained through optimization and may even be infeasible [19].
Standard ADMM solves optimization problems by iteratively updating primal variables (e.g., control actions) and dual variables (Lagrange multipliers) to enforce constraints. It requires centralized coordination, limiting scalability for large problems. C-ADMM is an enhanced variant designed for distributed optimization. Each scenario’s subproblem is solved independently in parallel (e.g., on separate CPU threads), then coordinated via a lightweight “consensus step” to align the first control action. Intuitively, C-ADMM acts like a team of specialists (parallel subproblems) agreeing on a shared plan (consensus constraint), whereas standard ADMM relies on a single coordinator. This enables our framework to handle 100+ scenarios without sacrificing speed.
To maximize the economic benefits, C-ADMM is used to solve the proposed scenario-based MPC problem, which does not need to reduce the scenarios and calculate the expectation of control actions. C-ADMM can decompose the original large problem into multiple small sub-problems. Then, these small sub-problems will be calculated quickly in parallel. Through continuous coordination and iteration, the global optimal control outputs will be obtained [23].
First, a complicated constraint must be used to decompose the original scenario-based MPC problem. Since S scenarios have the same probability and only one control action is implemented, the first control action of each scenario, as shown in Figure 4, must be equal as
u 1 ( 0 ) = u 2 ( 0 ) = u 3 ( 0 ) = = u S ( 0 ) = Z u
where Z u is a slack variable and u s 0 = P grid _ load s 0 , P pv _ grid s 0 , P dis s 0 , P ch s 0 , P ev s 0 . Based on the defined slack variable, the original problem in Equation (9) can be decomposed into S sub-problems. The scaled augmented Lagrangian function of the sth sub-problem in the (k + 1)th iteration is formulated as
P g r i d _ l o a d s , k + 1 ( t ) , P p v _ g r i d s , k + 1 ( t ) , P d i s s , k + 1 ( t ) , P c h s , k + 1 ( t ) , P e v s , k + 1 ( t ) = arg min 0 T 1 c g r i d _ l o a d P g r i d _ l o a d s ( t ) c p v _ g r i d P p v _ g r i d s ( t ) + ρ 2 P g r i d _ l o a d s ( 0 ) Z g r i d _ l o a d k + α g r i d _ l o a d s , k 2 2 + ρ 2 P p v _ g r i d s ( 0 ) Z p v _ g r i d k + α p v _ g r i d s , k 2 2 + ρ 2 P d i s s ( 0 ) Z d i s k + α d i s s , k 2 2 + ρ 2 P c h s ( 0 ) Z c h k + α c h s , k 2 2 + ρ 2 P e v s ( 0 ) Z e v k + α e v s , k 2 2
where k is the iteration index. Z grid _ load k , Z pv _ grid k , Z dis k , Z ch k , and Z ev k are the specific slack variables to help decompose the original problem. α grid _ load s , k = λ grid _ load s , k / ρ , α pv _ grid s , k = λ pv _ grid s , k / ρ , α dis s , k = λ dis s , k / ρ , α ch s , k = λ ch s , k / ρ , and α ev s , k = λ ev s , k / ρ are the scaled dual variables. λ grid _ load s , k , λ pv _ grid s , k , λ dis s , k , λ ch s , k , and λ ev s , k are Lagrangian multipliers corresponding to the consensus constraint Equation (11). ρ is the predefined penalty parameter. · 2 2 represents the l 2 -norm. Each sub-problem also needs to satisfy the constraints in the original problem.
Z g r i d _ l o a d k + 1 = s = 1 S P g r i d _ l o a d s , k + 1 ( 0 ) S Z p v _ g r i d k + 1 = s = 1 S P p v _ g r i d s , k + 1 ( 0 ) S Z d i s k + 1 = s = 1 S P d i s s , k + 1 ( 0 ) S Z c h k + 1 = s = 1 S P c h s , k + 1 ( 0 ) S Z e v k + 1 = s = 1 S P e v s , k + 1 ( 0 ) S
The above sub-problems are solved in parallel to speed up the calculation. Each sub-problem is assigned to an independent CPU thread. For instance, an Intel i5-10500 CPU with 16 GB RAM has 6 cores and 12 threads, which is manufactured by Intel Corporation in Chongqing, China. Thus, CPU can simultaneously calculate 12 sub-problems each time. Ideally, the computation time of each iteration is equal to the one of each sub-problem if there are enough threads (e.g., GPU has thousands of threads). After obtaining the updated control actions, the slack variables in (k + 1)th iteration will be updated according to Equation (13). Then, the scaled dual variables are updated by Equation (14). Through continuous iteration, the whole problem will converge until the stop criteria defined in Equation (15) is reached. r 2 2 and s 2 2 are the primal residual and the dual residual. ε is the predefined threshold. The vector of scaled dual variables α k = [ α grid _ load s , k ; α pv _ grid s , k ; α dis s , k ; α ch s , k ; α ev s , k ] and slack variables Z k = [ Z grid _ load k ; Z pv _ grid k ; Z dis k ; Z ch k ; Z ev k ] gradually converge to the threshold.
α g r i d _ l o a d s , k + 1 = α g r i d _ l o a d s , k + P g r i d _ l o a d s , k + 1 ( 0 ) Z g r i d _ l o a d k + 1 α p v _ g r i d s , k + 1 = α p v _ g r i d s , k + P p v _ g r i d s , k + 1 ( 0 ) Z p v _ g r i d k + 1 α d i s s , k + 1 = α d i s s , k + P d i s s , k + 1 ( 0 ) Z d i s k + 1 α c h s , k + 1 = α c h s , k + P c h s , k + 1 ( 0 ) Z c h k + 1 α e v s , k + 1 = α e v s , k + P e v s , k + 1 ( 0 ) Z e v k + 1
r 2 2 = α k + 1 α k 2 2 ε s 2 2 = Z k + 1 Z k 2 2 ε .

4. Results and Discussion

The whole simulation process is completed on a computer equipped with an Intel i5-10500 6-core processor and 16 GB RAM. The CPU with 12 threads is used for parallel computing. The whole computing is conducted in Python 3.6. The open-source convex optimization toolbox CVXPY is used for the calculation of each sub-problem [26], and the SCS solver is selected.
The PV power generation and load demand data are obtained from the open software SimSES 2016 [27]. The EV plug-in time is obtained by random sampling. The price of electricity purchased from the upstream grid is time-of-use tariff from [28]. The price of selling electricity to the upstream grid is set to half of the purchase price to promote the self-consumption of PV power. The key parameters of the smart home and relevant components are listed in Table 1. The nominal capacity of BESSs and EVs determines how long the system can supply power (e.g., a 6 kWh BESS can deliver 3 kW for 2 h before depletion). The maximum power limits how quickly energy can be stored or released (e.g., a 10 kW max power allows fast grid support during peak demand). Efficiency affects economic returns—higher efficiency reduces energy losses. Note that the prediction time horizon is 24 h, and the control action at the current time step will be implemented. In addition, this paper does not consider the prediction method of PV power and load demand, but the ability of proposed scenario-based MPC to handle the uncertainties. Thus, the predicted net load data are obtained by adding the actual net load data and prediction errors that are sampled from the given probability distribution. Figure 5 shows the PV power generation and load demand data in one year and the probability distribution of net prediction error.

4.1. Analysis of Scenario-Based MPC

Traditional scenario-based MPC usually chooses a smaller scenario size (i.e., 10 scenarios) to seek the tradeoff between the economic benefits and computation time, while this will cause more economic costs for smart homes. This paper uses the C-ADMM algorithm to solve scenario-based MPC in parallel, which is not affected by the size of stochastic scenarios due to the scalability and parallel computing capability.
The impact of different scenario sizes and operation time on the economic cost by utilizing C-ADMM is shown in Figure 6. Note that the selected penalty parameter ρ is 0.1, and the terminal criterion is 10−5. As can be seen, the one-day operation cost of the proposed smart home is gradually reduced when the number of stochastic scenarios does not exceed 30. Then it converges after exceeding 30. As the operation time increases, the operation cost of the smart home almost linearly decreases with the increase in scenario size. It indicates that the more scenarios, the lower economic cost of the smart home through scenario-based MPC. In addition, as the operation time increases, the linear decreasing relationship between the total economic cost and scenario size becomes more obvious. In other words, this decreasing trend will be more stable due to the increase of samples in stochastic scenarios, which can be explained by the law of large numbers.
C-ADMM algorithm is used to solve the scenario-based MPC problem. In each iteration, this problem will be decomposed into S sub-problems. There will be S sub-problems that need to be solved in each iteration, if the stochastic scenario size increases. Thus, the computation time of each iteration and the iteration number of C-ADMM will change. Figure 7 shows the impact of scenario size on the computation time of each iteration and average iteration number of each time step in a day. As can be seen, the computation time of each iteration by using C-ADMM increases linearly with the increase in scenario size. This is due to the limited parallel computing power of the CPU processor. The CPU processor used in this paper only has 6 cores and 12 threads, which means it can only calculate 12 sub-problems in parallel at a time. Thus, the computation time increases with the increase in scenario size. In other words, the GPU processor with thousands of cores can fully utilize the parallel computing power of C-ADMM [23,29,30]. Then the computation time will not be affected by the scenario size. Theoretically, the computation time of each iteration is equal to the one of each sub-problem if there are enough threads.
In addition, since the scenario size increases, C-ADMM algorithm must coordinate more sub-problems in each iteration. Then, as shown in Figure 7, the average iteration number almost increases linearly with the increase in scenario size when the stochastic scenario number does not exceed 60. However, since C-ADMM only coordinates the first control action of each scenario, the iteration number hardly increases. This limited coordination work leads to an average number of iterations not exceeding five at each time step, which makes scenario-based MPC run faster.

4.2. Comparison of Different MPC

To further highlight the economic performance of the scenario-based MPC approach, it is compared against two other MPC-based methods. One is the precise MPC (PMPC), which only consider perfect prediction data in the prediction horizon and has no prediction error. PMPC is taken as the benchmark for prediction accuracy with no uncertainties. The other is the deterministic MPC (DMPC), which has a prediction error but does not correct it.
Figure 8 shows the comparison of the above three MPC-based methods of power flow purchased from the grid and sold to the grid in one day. As can be seen, sold PV power flow   P pv _ grid t calculated by scenario-based MPC, which considers 100 scenarios, is closer to the benchmark than that calculated by DMPC. Power flow   P grid _ load t calculated by these three methods is almost the same. Thus, there will be less economic cost for the smart home controlled by scenario-based MPC in contrast to DMPC. It indicates that the scenario-based method can effectively correct the prediction error.
Figure 9 compares the power flow and energy state of BESS and EV batteries controlled by scenario-based MPC, PMPC, and DMPC. As can be seen, the power flow and energy state of BESS calculated by scenario-based MPC is also closer to the benchmark than that calculated by DMPC. Meanwhile, there is larger energy throughput of BESS controlled by scenario-based MPC. That means there is more free or cheap energy to supply the appliances. In addition, the sub-figures of Figure 9 on the right side show the power flow and energy state of EV batteries when plug-in. The green line and the orange line represent the EV plug-out time and plug-in time, respectively. The power flow and energy state of EV batteries controlled by these three methods are almost the same.
Table 2 shows the economic cost of a smart home controlled by scenario-based MPC, PMPC, and DMPC for different operation days. As can be seen, PMPC leads to the least energy cost, and DMPC leads to the maximum energy cost. Scenario-based MPC approach can save a lot of energy costs in contrast to DMPC. Scenario-based MPC can save at least 48% of the additional energy cost caused by prediction errors in the operation of smart homes within 1 day, 5 days, and 10 days.
Therefore, it can be concluded that the scenario-based MPC approach can correct the prediction error to a certain degree. It will lead to less energy cost for the smart home compared with traditional MPC, which inevitably suffers from prediction errors. And the quality of correction depends on the scenario size. The more scenarios, the lower the economic cost of the smart home through scenario-based MPC.
To deploy the proposed framework in real-world smart homes or microgrids, the first step are the hardware requirements. The C-ADMM-based controller can be implemented on low-cost edge devices or integrated into existing home energy management systems like Tesla Powerwall or SolarEdge. Parallel computing demands may necessitate multi-core processors for more than 50 scenarios. Then, grid interconnection requires adherence to local standards, particularly for PV export limits and voltage/frequency regulation. In addition, dynamic control strategies may conflict with user preferences (e.g., forced EV charging delays). A companion mobile app could allow manual overrides while maintaining optimality bounds.

5. Conclusions

To ensure the efficient online operation and maximum economic benefits, traditional scenario-based MPC typically requires reducing the stochastic scenarios of prediction error, which results in certain economic losses for homeowners. To address this issue, the C-ADMM-based scenario MPC framework is proposed to solve large-scale stochastic optimization problems without scenario reduction, achieving computational scalability via parallelization. This paper analyzes the impact of scenario numbers on the economic benefits of smart homes, as well as the computation time and convergence speed of C-ADMM. The findings reveal that an increased number of stochastic scenarios can achieve greater economic benefits for smart homes. Furthermore, the parallel computing capability of C-ADMM can speed up the computation of the original scenario-based MPC problem. Ideally, the computation time is not affected by scenario number if sufficient hardware, such as GPU with thousands of cores, is available for parallel computing. Additionally, by comparing traditional MPC with or without prediction errors, scenario-based MPC can save at least 48% of the additional energy cost caused by prediction errors. It verifies that the scenario-based MPC strategy can effectively correct prediction errors in the prediction horizon. In the future, more sensitivity analysis will be conducted to highlight the effectiveness of the algorithm. The scenario-based MPC and C-ADMM will be deployed on GPUs to analyze the performance of algorithms under more threads. In addition, offline experiments will be conducted to verify the feasibility of the algorithm’s application.

Author Contributions

Conceptualization, X.D., J.L. and H.B.; investigation, X.D., H.B. and Y.H.; methodology, X.D., H.B. and X.S.; visualization, X.D. and Z.Z.; writing—original draft preparation, X.D.; writing—review and editing, H.B.; funding acquisition, X.D. All authors have read and agreed to the published version of the manuscript.

Funding

This work is supported by the Natural Science Foundation Special Project of Chongqing (No. CSTB2024NSCQ−BSX0010).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

Authors Xinchen Deng, Huanhuan Bao, Zhiwei Zhao and Xiaojia Su were employed by China Automotive Engineering Research Institute Co., Ltd. Author Yao Huang was employed by China Post Group Co., Ltd. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
MPCModel predictive control
PVPhotovoltaic
EVElectric vehicle
BESSBattery energy storage system
C-ADMMConsensus alternating direction method of multipliers
PSOParticle swarm optimization
TOUTime-of-use
V2HVehicle to home
PMPCPrecise MPC
DMPCDeterministic MPC

References

  1. International Energy Agency (IEA). Global EV Outlook 2023; IEA: Paris, France, 2023; Available online: https://www.iea.org/reports/global-ev-outlook-2023 (accessed on 10 April 2025).
  2. International Renewable Energy Agency (IRENA). Renewable Power Generation Costs in 2022; IRENA: Abu Dhabi, United Arab Emirates, 2023; Available online: https://www.irena.org/publications/2023/Aug/Renewable-Power-Generation-Costs-in-2022 (accessed on 10 April 2025).
  3. The Stanford Precourt Institute for Energy. Charging Cars at Home at Night is Not the Way to Go, Stanford Study Finds; The Stanford Precourt Institute for Energy: Stanford, CA, USA, 2022; Available online: https://news.stanford.edu/stories/2022/09/charging-cars-home-night-not-way-go (accessed on 10 April 2025).
  4. Sarda, J.; Patel, N.; Patel, H.; Vaghela, R.; Brahma, B.; Bhoi, A.K.; Barsocchi, P. A review of the electric vehicle charging technology, impact on grid integration, policy consequences, challenges and future trends. Energy Rep. 2024, 12, 5671–5692. [Google Scholar] [CrossRef]
  5. Hu, X.; Deng, X.; Wang, F.; Deng, Z.; Lin, X.; Teodorescu, R.; Pecht, M.G. A review of second-life lithium-ion batteries for stationary energy storage applications. Proc. IEEE 2022, 110, 735–753. [Google Scholar] [CrossRef]
  6. Kootstra, M.A.; Tong, S.; Park, J.W. Photovoltaic grid stabilization system using second life lithium battery. Int. J. Energy Res. 2015, 39, 825–841. [Google Scholar] [CrossRef]
  7. Heirung, T.A.N.; Paulson, J.A.; O’Leary, J.; Mesbah, A. Stochastic model predictive control—How does it work? Comput. Chem. Eng. 2018, 114, 158–170. [Google Scholar] [CrossRef]
  8. Tesla, Inc. Powerwall Technical Specifications; Tesla, Inc.: Austin, TX, USA, 2023; Available online: https://www.tesla.com/support/energy/powerwall/learn (accessed on 10 April 2025).
  9. Wu, X.; Hu, X.; Moura, S.; Yin, X.; Pickert, V. Stochastic control of smart home energy management with plug-in electric vehicle battery energy storage and photovoltaic array. J. Power Sources 2016, 333, 203–212. [Google Scholar] [CrossRef]
  10. Conte, F.; Massucco, S.; Saviozzi, M.; Silvestro, F. A stochastic optimization method for planning and real-time control of integrated pv-storage systems: Design and experimental validation. IEEE Trans. Sustain. Energy 2017, 9, 1188–1197. [Google Scholar] [CrossRef]
  11. Huang, G.; Chow, T.-T. Uncertainty shift in robust predictive control design for application in CAV air-conditioning systems. Build. Serv. Eng. Res. Technol. 2011, 32, 329–343. [Google Scholar] [CrossRef]
  12. Mesbah, A. Stochastic model predictive control: An overview and perspectives for future research. IEEE Control Syst. Mag. 2016, 36, 30–44. [Google Scholar]
  13. Ramandi, M.Y.; Bigdeli, N.; Afshar, K. Stochastic economic model predictive control for real-time scheduling of balance responsible parties. Int. J. Electr. Power Energy Syst. 2020, 118, 105800. [Google Scholar] [CrossRef]
  14. Guo, X.; Bao, Z.; Yan, W. Stochastic model predictive control based scheduling optimization of multi-energy system considering hybrid CHPs and EVs. Appl. Sci. 2019, 9, 356. [Google Scholar] [CrossRef]
  15. Huang, Y.; Wang, L.; Guo, W.; Kang, Q.; Wu, Q. Chance constrained optimization in a home energy management system. IEEE Trans. Smart Grid 2016, 9, 252–260. [Google Scholar] [CrossRef]
  16. Aghdam, F.H.; Kalantari, N.T.; Mohammadi-Ivatloo, B. A chance-constrained energy management in multi-microgrid systems considering degradation cost of energy storage elements. J. Energy Storage 2020, 29, 101416. [Google Scholar] [CrossRef]
  17. Shi, Z.; Liang, H.; Huang, S.; Dinavahi, V. Distributionally robust chance-constrained energy management for islanded microgrids. IEEE Trans. Smart Grid 2018, 10, 2234–2244. [Google Scholar] [CrossRef]
  18. Daneshvar, M.; Mohammadi-Ivatloo, B.; Asadi, S.; Anvari-Moghaddam, A.; Rasouli, M.; Abapour, M.; Gharehpetian, G.B. Chance-constrained models for transactive energy management of interconnected microgrid clusters. J. Clean. Prod. 2020, 271, 122177. [Google Scholar] [CrossRef]
  19. Van der Meer, D.; Wang, G.C.; Munkhammar, J. An alternative optimal strategy for stochastic model predictive control of a residential battery energy management system with solar photovoltaic. Appl. Energy 2021, 283, 116289. [Google Scholar] [CrossRef]
  20. Hans, C.A.; Sopasakis, P.; Bemporad, A.; Raisch, J.; Reincke-Collon, C. Scenario-based model predictive operation control of islanded microgrids. In Proceedings of the 2015 54th IEEE Conference on Decision and Control (CDC), Osaka, Japan, 15–18 December 2015; pp. 3272–3277. [Google Scholar]
  21. Zhou, Z.; Shojafar, M.; Abawajy, J.; Bashir, A.K. IADE: An Improved Differential Evolution Algorithm to Preserve Sustainability in a 6G Network. IEEE Trans. Green Commun. Netw. 2021, 5, 1747–1760. [Google Scholar] [CrossRef]
  22. Dupacová, J.; Gröwe-Kuska, N.; Römisch, W. Scenario Reduction in Stochastic Programming: An Approach Using Probability Metrics; Humboldt-Universität zu Berlin, Mathematisch-Naturwissenschaftliche Fakultät II, Institut für Mathematik: Berlin, Germany, 2000. [Google Scholar]
  23. Deng, X.; Wang, F.; Lin, X.; Hu, B.; Arash, K.; Hu, X. Distributed energy management of home-vehicle Nexus with Stationary battery energy storage. Renew. Sustain. Energy Rev. 2022, 168, 112837. [Google Scholar] [CrossRef]
  24. Wang, Z.; Wang, J.; Chen, B.; Begovic, M.M.; He, Y. MPC-based voltage/var optimization for distribution circuits with distributed generators and exponential load models. IEEE Trans. Smart Grid 2014, 5, 2412–2420. [Google Scholar] [CrossRef]
  25. Feng, Y.; Ryan, S.M. Scenario construction and reduction applied to stochastic power generation expansion planning. Comput. Oper. Res. 2013, 40, 9–23. [Google Scholar] [CrossRef]
  26. Diamond, S.; Boyd, S. CVXPY: A Python-embedded modeling language for convex optimization. J. Mach. Learn. Res. 2016, 17, 2909–2913. [Google Scholar]
  27. Truong, C.N.; Naumann, M.; Karl, R.C.; Müller, M.; Jossen, A.; Hesse, H.C. Economics of residential photovoltaic battery systems in Germany: The case of Tesla’s Powerwall. Batteries 2016, 2, 14. [Google Scholar] [CrossRef]
  28. Pecan Street Inc. Pecan Street Dataport; Pecan Street Inc.: Austin, TX, USA, 2015. [Google Scholar]
  29. Deng, X.; Wang, F.; Hu, B.; Lin, X.; Hu, X. Optimal sizing of residential battery energy storage systems for long-term operational planning. J. Power Sources 2022, 551, 232218. [Google Scholar] [CrossRef]
  30. Kim, Y.; Kim, K. Accelerated Computation and Tracking of AC Optimal Power Flow Solutions Using GPUs. In Proceedings of the Workshop Proceedings of the 51st International Conference on Parallel Processing, Bordeaux, France, 29 August–1 September 2022; pp. 1–8. [Google Scholar]
Figure 1. Scenario reduction for scenario-based MPC.
Figure 1. Scenario reduction for scenario-based MPC.
Sustainability 17 07678 g001
Figure 2. Scenario-based MPC based on C-ADMM.
Figure 2. Scenario-based MPC based on C-ADMM.
Sustainability 17 07678 g002
Figure 3. Layout of a smart home.
Figure 3. Layout of a smart home.
Sustainability 17 07678 g003
Figure 4. Scheme of scenario-based MPC.
Figure 4. Scheme of scenario-based MPC.
Sustainability 17 07678 g004
Figure 5. The PV power generation and load demand data and the net prediction error.
Figure 5. The PV power generation and load demand data and the net prediction error.
Sustainability 17 07678 g005
Figure 6. Comparison of different scenario sizes and operation time.
Figure 6. Comparison of different scenario sizes and operation time.
Sustainability 17 07678 g006
Figure 7. Analysis of the computation time and iteration number.
Figure 7. Analysis of the computation time and iteration number.
Sustainability 17 07678 g007
Figure 8. Comparison of interactive power from/to the grid.
Figure 8. Comparison of interactive power from/to the grid.
Sustainability 17 07678 g008
Figure 9. Comparison of power flow and energy state of BESS and EV batteries.
Figure 9. Comparison of power flow and energy state of BESS and EV batteries.
Sustainability 17 07678 g009
Table 1. Key parameters of the smart home and relevant components [23].
Table 1. Key parameters of the smart home and relevant components [23].
ParametersSymbolValue
Nominal BESS capacity   E BESS 6 kWh
BESS energy efficiency η b 0.95
Minimum BESS energy   E b , min 1.2 kWh
Maximum BESS energy   E b , max 4.8 kWh
Maximum BESS discharging power   P dis , max 10 kW
Maximum BESS charging power   P ch , max 10 kW
Nominal EV capacity E ev rate 60 kWh
EV energy efficiency η ev 0.95
Minimum EV energy   E ev , min 12 kWh
Maximum EV energy   E ev , max 48 kWh
Maximum EV charging power   P ev , max 10 kW
Maximum sold PV power-5 kW
Table 2. Economic cost of three different MPC-based methods [cents].
Table 2. Economic cost of three different MPC-based methods [cents].
DaysPrecise MPCDMPCSMPC (Scenario = 100)
1213272222
10152017261605
15397844124204
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Deng, X.; Li, J.; Bao, H.; Zhao, Z.; Su, X.; Huang, Y. Efficient Energy Management for Smart Homes with Electric Vehicles Using Scenario-Based Model Predictive Control. Sustainability 2025, 17, 7678. https://doi.org/10.3390/su17177678

AMA Style

Deng X, Li J, Bao H, Zhao Z, Su X, Huang Y. Efficient Energy Management for Smart Homes with Electric Vehicles Using Scenario-Based Model Predictive Control. Sustainability. 2025; 17(17):7678. https://doi.org/10.3390/su17177678

Chicago/Turabian Style

Deng, Xinchen, Jiacheng Li, Huanhuan Bao, Zhiwei Zhao, Xiaojia Su, and Yao Huang. 2025. "Efficient Energy Management for Smart Homes with Electric Vehicles Using Scenario-Based Model Predictive Control" Sustainability 17, no. 17: 7678. https://doi.org/10.3390/su17177678

APA Style

Deng, X., Li, J., Bao, H., Zhao, Z., Su, X., & Huang, Y. (2025). Efficient Energy Management for Smart Homes with Electric Vehicles Using Scenario-Based Model Predictive Control. Sustainability, 17(17), 7678. https://doi.org/10.3390/su17177678

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