A Two-Stage Stochastic Model to Optimize the Number of Photovoltaic Panels in Smart Homes Considering the Impact of Air Pollution and Uncertainty in Daily Power Generation
Abstract
The growing demand for energy and environmental challenges have made optimizing energy consumption in the residential sector—a sector that accounts for 33.2% of energy use in Iran—essential for addressing the energy crisis, frequent power outages, and environmental pollution. This study develops a two-stage stochastic integer mathematical model to determine the optimal number of solar panels while providing an energy consumption scheduling plan for smart home appliances. The model incorporates technical, environmental, and economic factors, including installation space, air pollution levels, solar panel costs, and energy prices. A major source of uncertainty is the daily electricity generation capacity of solar panels, which varies throughout the year. To address this, the model treats each day as a scenario and is solved using GAMS software by converting the stochastic model into a scenario-based one. Given that solving the model with 365 daily scenarios is computationally intensive, a scenario reduction method using averaging was applied, reducing the number of scenarios to 12—one for each month. Results show that in countries with high energy prices, such as Germany, installing between 15 and 76 solar panels is economically viable. In contrast, in Iran, where energy prices are subsidized, installing up to 11 panels is cost-effective. Additionally, higher air pollution levels increase the optimal number of panels, and smart management of household appliances can reduce costs by up to 25%.
Keywords:
Photovoltaic systems, Smart homes, Energy optimization, Stochastic programming, Home energy managementReferences
- [1] Momayezi, F., Sabri-Laghaie, K., & Ghaffarinasab, N. (2023). Energy management of smart homes by optimizing energy consumption scheduling. In Handbook of smart energy systems (pp. 713–734). Cham: Springer International Publishing. https://doi.org/10.1007/978-3-030-97940-9_67
- [2] Farrokhifar, M., Momayyezi, F., Sadoogi, N., & Safari, A. (2018). Real-time based approach for intelligent building energy management using dynamic price policies. Sustainable cities and society, 37, 85–92. https://doi.org/10.1016/j.scs.2017.11.011
- [3] Sabri-Laghaie, K., Momayezi, F., Ghaleshakhani, N., & Maroufi, L. (2025). Association rule mining based approach to consider users’ preferences in the energy management of smart homes. Journal of building engineering, 104, 112361. https://doi.org/10.1016/j.jobe.2025.112361
- [4] Jafari-Nikpay, M., Arabzade-Nosratabad, Z., & Momayezi, F. (2026). Optimizing smart home energy management with branch and bound method: A novel model for daily and weekly scheduling of smart appliances. Spectrum of operational research, 3(1), 252–274. https://doi.org/10.31181/sor31202643
- [5] Sasanmoghadam, S., & Sabri-Laghaie, K. (2026). Adaptive scheduling and storage system preservation in smart home energy management systems: Considering cost efficiency, user satisfaction and storage systems durability. Journal of energy storage, 142, 119521. https://doi.org/10.1016/j.est.2025.119521
- [6] Doostkhah-Ahmadi, H., Momayezi, F., & Sabri-Laghaie, K. (2026). A two-stage stochastic programming approach for green smart homes: Optimal panel sizing and cost-efficient scheduling of photovoltaic systems, battery storage, and EV charging under carbon emission pricing. Energy and buildings, 350, 116529. https://doi.org/10.1016/j.enbuild.2025.116529
- [7] Zafar, B., & Slama, S. A. Ben. (2022). PV-EV integrated home energy management using vehicle-to-home (V2H) technology and household occupant behaviors. Energy strategy reviews, 44, 101001. https://doi.org/10.1016/j.esr.2022.101001
- [8] Song, Z., Guan, X., & Cheng, M. (2022). Multi-objective optimization strategy for home energy management system including PV and battery energy storage. Energy reports, 8, 5396–5411. https://doi.org/10.1016/j.egyr.2022.04.023
- [9] Tostado-Véliz, M., Rezaee Jordehi, A., Hasanien, H. M., Turky, R. A., & Jurado, F. (2023). A novel stochastic home energy management system considering negawatt trading. Sustainable cities and society, 97, 104757. https://doi.org/10.1016/j.scs.2023.104757
- [10] Gomes, I. L. R., Ruano, M. G., & Ruano, A. E. (2023). MILP-based model predictive control for home energy management systems: A real case study in Algarve, Portugal. Energy and buildings, 281, 112774. https://doi.org/10.1016/j.enbuild.2023.112774
- [11] Chen, X., & Ning, D. (2023). FastInformer-HEMS: A lightweight optimization algorithm for home energy management systems. Energies, 16(9), 1–17. https://doi.org/10.3390/en16093897
- [12] Ouedraogo, K. E., Ekim, P. O., & Demirok, E. (2023). Feasibility of low-cost energy management system using embedded optimization for PV and battery storage assisted residential buildings. Energy, 271, 126922. https://doi.org/10.1016/j.energy.2023.126922
- [13] Ameur, A., Berrada, A., & Emrani, A. (2023). Intelligent energy management system for smart home with grid-connected hybrid photovoltaic/ gravity energy storage system. Journal of energy storage, 72, 108525. https://doi.org/10.1016/j.est.2023.108525
- [14] Erdinç, F. G. (2023). Rolling horizon optimization based real-time energy management of a residential neighborhood considering PV and ESS usage fairness. Applied energy, 344, 121275. https://doi.org/10.1016/j.apenergy.2023.121275
- [15] Autuori, J., Arbaoui, T., Ouazene, Y., & Yalaoui, F. (2024). Optimizing energy consumption considering residential solar panels generation and battery storage in smart homes. Journal of energy storage, 94, 112122. https://doi.org/10.1016/j.est.2024.112122
- [16] Selcen Ayaz, M., Malekpour, M., Azizipanah-Abarghooee, R., Karimi, M., & Terzija, V. (2024). Probabilistic photovoltaic generation and load demand uncertainties modelling for active distribution networks hosting capacity calculations. International journal of electrical power & energy systems, 159, 110016. https://doi.org/10.1016/j.ijepes.2024.110016
- [17] Mansour, S. H., Azzam, S. M., Hasanien, H. M., Tostado-Veliz, M., Alkuhayli, A., & Jurado, F. (2024). Wasserstein generative adversarial networks-based photovoltaic uncertainty in a smart home energy management system including battery storage devices. Energy, 306, 132412. https://doi.org/10.1016/j.energy.2024.132412
- [18] Hooshmand, F. (2024). Stochastic optimization models for the solar system design and energy management problem in an off-grid residential house. Journal of energy storage, 100, 113615. https://doi.org/10.1016/j.est.2024.113615

