Sustainable Energy Efficient Communities: Guidelines for Pilot Demand Response Cooperation (The Springer Series in Sustainable Energy Policy) [1st ed. 2024] 3031499913, 9783031499913

This book analyses issues surrounding the efficient integration of demand response programmes in residential communities

131 70 23MB

English Pages 133 [131] Year 2024

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Sustainable Energy Efficient Communities: Guidelines for Pilot Demand Response Cooperation (The Springer Series in Sustainable Energy Policy) [1st ed. 2024]
 3031499913, 9783031499913

Table of contents :
Foreword
Preface
Author Presentation
Contents
Acronyms
1 Introduction
2 Energy Demand Management
2.1 Cooperation System Challenges
2.2 Demand Management
2.2.1 Software and Hardware Platforms
2.2.2 Communication Infrastructures and Protocols
2.2.3 Pilots and Demand Aggregation Examples
2.3 Summary
References
3 Demand Aggregation: System Architecture and Design
3.1 Cooperative Demand Scheduler
3.1.1 Demand Scheduler Architecture
3.1.2 Consumer: Household Unit
3.1.3 Utility
3.1.4 Demand Aggregator: Community Unit
3.2 Optimization Techniques
3.3 Demand Aggregation Algorithms
3.4 Summary
References
4 Evaluation of Scheduling Algorithms
4.1 Performance Evaluation
4.1.1 Evaluation Using Heuristic Techniques
4.1.2 Evaluation Strategies
4.1.3 Identifying Consumer Behaviors
4.1.4 Microgeneration Evaluation
4.2 Summary
References
5 Behavioral Analysis and Pattern Validation
5.1 ML Techniques
5.2 Demand Segmentation and Forecasting Tools
5.3 Behavioral Pattern Analysis
5.3.1 Behavior Pattern Analysis
5.3.2 Unsupervised ML Analysis
5.3.3 Supervised ML Analysis
5.3.4 Added Value of Demand Forecasting
5.3.5 Forecasting Characterization and Evaluation
5.4 Summary
References
6 Experimental Demand Scheduler Validation
6.1 Scheduler Implementation
6.1.1 Computation Costs
6.1.2 Communication Cost
6.1.3 Security Analysis
6.2 Summary
References
7 Conclusions
Appendix Questionnaire for Deploying DR Systems
Reference

Citation preview

The Springer Series in Sustainable Energy Policy

Carlos Cruz

Sustainable Energy Efficient Communities Guidelines for Pilot Demand Response Cooperation

The Springer Series in Sustainable Energy Policy Series Editors Gale Boyd, Department of Economics, Social Science Research Institute, Duke University, Durham, NC, USA David Feldman, Department of Urban Planning and Public Policy, University of California, Irvine, CA, USA Radhika Khosla, Oxford India Centre for Sustainable Development, Somerville College, Oxford University, Oxford, UK Ying Shirley Meng, Department of NanoEngineering, University of California San Diego, San Diego, CA, USA Clemens Rohde, Franhofer Institute for Systems and Innovation Research ISI, Karlsruhe, Baden-Württemberg, Germany

Publishes works that integrate perspectives from applied, physical, social, and policy sciences to provide a broader and deeper understanding of sustainable energy policy issues, challenges, methodologies, and potential solutions at all levels of governance. Volumes published in the series present the science, technology, and data analysis necessary to inform and evaluate sustainable energy policy and cover all aspects of energy policy including energy efficiency, planning, management, security, production, consumption, and development; the energy/water nexus and the water/energy/food and fiber nexus; and linkages between energy cost and sustainability, and between energy and development, climate change, and migration. The series is international in its authorship, content, audience and editorial board. The Springer Series in Sustainable Energy Policy Potential authors who wish to submit a book proposal should contact Ute Heuser, Associate Editor: [email protected]

Carlos Cruz

Sustainable Energy Efficient Communities Guidelines for Pilot Demand Response Cooperation

Foreword by Ignacio Bravo

Carlos Cruz Department of Electronics University of Alcalá Madrid, Spain

ISSN 2524-5589 ISSN 2524-5597 (electronic) The Springer Series in Sustainable Energy Policy ISBN 978-3-031-49991-3 ISBN 978-3-031-49992-0 (eBook) https://doi.org/10.1007/978-3-031-49992-0 © The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Switzerland AG 2024 This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors, and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland Paper in this product is recyclable.

To my father.

Foreword

The effects of climate change are encouraging people around the world to seek to reduce our carbon footprint and increase green energy production. In this context, smart energy management is attracting much attention, with new consumer participation options and services emerging in relation to renewable energy self-consumption, storage, demand response, and energy efficiency. The new frontiers opened up to a decentralized energy market are revolutionizing the roles to be played by individuals, communities, and societal stakeholders in the new energy landscape, with widespread social implications because of newforms of people-centered energy production and distribution. This innovative paradigm, based on cooperation, is being driven by the successful combination of new technologies and their penetration in society, which enable much more efficient energy scenarios than in the past. It is also being made possible by a parallel change in people’s behaviors toward greater sustainability, one example of which is the transformation in how energy is produced and consumed. Central to this new energy scenario is the consumer community, as key to more flexible energy production, storage, and supply. Further information and communication technological progress in energy efficiency therefore needs to focus on integration in relation to energy consumption. The Internet of Things (IoT) and the smart grid can provide energy consumers with individualized and personalized information and guidance in terms of targets for energy savings and cost reductions, improve billing transparency, and enhance grid reliability. Technology can also play an important role in shaping human consumption behaviors. Recent initiatives seek to increase residential efficiency by estimating aggregate demand within smart communities with a view to rationalizing consumption. However, the widespread adoption of such sustainable practices and community-based models is not yet realized. This book, by Carlos Cruz, an electronic engineer with ample experience in electronic design, data analysis, optimization of smart energy systems as well as methodologies applied to energy communities, identifies and discusses key challenges in the adoption of sustainable practices and community-based energy models in residential communities. A wide range of topics are covered related to smart and sustainable communities, strategic energy management, behavioral modeling, energy demand scheduling, demand profiling, smart system management, energy optimization, green vii

viii

Foreword

energy, and the social aspects of smart energy integration. New data mining and machine learning tools are described that enhance smart community functioning through, e.g., energy demand reduction, energy use prediction, and the identification of consumption patterns and their flexibilities. Also described are IoT-based methods and solutions to energy demand response and demand-supply balancing services, and practical applications of consumer/community-centric networked digital energy systems, based on demand response dynamics; occupant behavioral modeling; and secure consumer cooperation, convenience, and flexibility. Ultimately, energy consumption patterns are identified that potentially reduce energy use by making overall consumption more sustainable and efficient. The following are the objectives of the book: • To describe the main challenges posed by demand cooperation systems and demand-side smart systems for energy management. • To identify components and applications for residential energy management, as well as the key smart energy hardware, software, and communication protocols. • To design a system architecture for an energy demand scheduler composed of key energy management actors at the residential level. • To describe the main heuristic demand optimization techniques and the aggregation concept in energy management. • To describe aggregated energy management and residential microgeneration, and to analyze consumer behavior impact on energy management. • To describe the different machine learning techniques applicable to energy demand management and the main tools available for demand aggregation and forecasting. • To explain how to implement and deploy a pilot cooperative demand response framework. The sustainability foregrounded in this book upholds some of 17 Sustainable Development Goals in relation to sustainable cities and communities (objective number 11), climate actions (13), and affordable clean energy initiatives (7). Furthermore, its theme usefully engages with the crucial intersection between industrial innovation and university research. This publication merits prominent attention as a valuable resource for academic and non-academic stakeholders with an interest is promoting and developing the sustainable and energy-efficient communities of the future. October 2023

Prof. Ignacio Bravo Full Professor Director for Internationalisation University of Alcalá Alcalá de Henares, Madrid, Spain [email protected] https://www.uah.es https://www.geintra-uah.org

Preface

The smart energy system and smart community concepts promise to solve several urgent issues, including a lack of energy resources, inefficient energy use, rising energy costs, and the need to develop sustainable energies. With a view to transitioning to a more sustainable and efficient energy future, government, research institutions, and industry are planning actions aimed at encouraging consumers to make more sustainable lifestyle choices, based on, for instance, the use of hybrid/ electric vehicles and smart energy-efficient appliances. Additionally, with the goal of significantly mitigating greenhouse emissions and fostering energy communities, public financial and funding instruments are beginning to provide programmed support, e.g., for equipment retrofitting, insulation, and renewable energy generation for self-consumption. Furthermore, the potential offered by the information and communication technologies (ICTs)—in relation to smart appliances and other connected devices and sensors—is raising expectations regarding the deployment of demand-side management (DSM) and demand response (DR) programs that reduce demand peaks and induce behavioral change in consumers. Various important questions regarding the development of smart communities remain unanswered. What are the core elements of DR, a smart community, an aggregator, or a home controller? What steps should be followed in designing DR systems? How could consumers be motivated to participate in pilot DR systems? Would consumers be allowed to install home controllers in their households and aggregators in residential buildings? What methods and tools would be necessary? How can diverse stakeholders be effectively integrated? This book answers such questions by describing solution pathways and describing design concepts and success factors. It covers the following main topics: • • • •

The smart communities of the future. Smart energy systems. Pilot DR guidelines. Smart home development tools.

This book, in exploring what is actually meant by smart communities, provides a deep understanding of how, given certain conditions, we can make communities ix

x

Preface

smart for everyone. Following a brief introduction (Chap. 1), the book explores the following concepts: • The main challenges posed by demand cooperation systems (Chap. 2). • System architecture design for a residential-level energy demand scheduler (Chap. 3). • Consumer behaviors and consumption patterns, microgeneration, aggregation, and demand optimization algorithms (Chap. 4). • Machine learning techniques applied to energy demand management (Chap. 5). • Implementation and deployment of a pilot cooperative DR framework (Chap. 6). The tools, tips, and experiments that have arisen from my research, own experiences, and practice-related work, as described in this book, will, it is hoped, facilitate understanding and development of the above key concepts by decision-makers, not to mention their diffusion in society. I wish all individuals responsible for developing pilot DR architectures much success in the deployment of environmentally sustainable and efficient energy solutions in their communities. October 2023

Carlos Cruz Ph.D. in Electronics Assistant Professor Department of Electronics University of Alcalá Alcalá de Henares, Madrid, Spain [email protected] https://www.uah.es https://www.carloscruztorre.com

Acknowledgments This book has been made possible thanks to the ENEFF – Pilot 2017/T1/TIC – 5184 project (financed by the Community of Madrid through the 2017 Talent Attraction program). I wish to thank to the Spanish Ministry of Science and Innovation, under the research Project “Putdr2test” (TED2021-132700BI00). I would also like to thank the University of Alcala, and especially the GEINTRA group (Grupo de Ingenieria Electronica Aplicada a Espacios Inteligentes y Transporte) of the Department of Electronics, for giving me the opportunity to participate in this project.

Author Presentation

Carlos Cruz holds an M.Sc. in Electronic Engineering from the University of Granada and a Ph.D. in Electronics from the University of Alcala (Spain). Since 2022, he has been a Lecturer in the Electronics Department of the University of Alcala. His areas of research are digital embedded systems, electronic design, and data analysis, and he has acquired extensive experience in detector evaluation, software simulation, and hardware design. Fellowships include CSIRC UGR (2007), JAE-TEC 2009, International research organizations and infrastructures (2011), and PTA 2018. Carlos has collaborated with several research centers, including CSIC, CIEMAT, ESSBilbao, ESRF, and ALBA Synchrotrons. At CSIC (2009–2011, 2020–2022), his work involved the evaluation of detectors and sensors and the development of data acquisition systems; at CIEMAT (2016–2019), he worked on the development of a digital readout prototype for a calorimeter and a digital processing system for CCD readout; at ESSBilbao (2014–2015), he oversaw the design of diagnostic beamline instrumentation; and as a member of the detectors and electronics team at European Synchrotron Radiation Facility (ESRF) in France and ALBA Synchrotrons in Spain, he worked on X-ray detection instrumentation (2012–2015). He has participated in 13 research projects and 3 research contracts with publicprivate funding. He is co-author of some 20 high-impact factor papers and has contributed to 10 national and international conferences. He is currently a reviewer in scientific journals such as Applied Energy, Energy and Buildings, Cleaner Production, Sensors and Actuators B, Sustainable Cities and Society, IoT (Elsevier), Foods, Mathematics, Sustainability, Electronics, Applied Sciences, Sensors and Energies (MDPI). He is guest editor of the Special Issue: Smart Energy Management and Sustainable Urban Communities, Energies (ISSN: 1996-1073) and Sensor Application for Smart and Sustainable Energy Management, Sensors (ISSN: 14248220); topical advisory panel member for Computation, Technologies, Sustainability, Sensors, Applied Sciences, and Electronics (MDPI); and a member of international and national committees (Erasmus+). He is also a member of the Editorial Board of Sustainable Cities and Society (Elsevier) (IF 10.696; ISSN: 2210-6707) and an

xi

xii

Author Presentation

IEEE Senior Member (2022–). Finally, he is licensed (No. 176210) as a Supervisor of radioactive facilities for the Spanish Nuclear Safety Council (CSN 2022): unsealed sources and industrial radiography.

Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

2 Energy Demand Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Cooperation System Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Demand Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Software and Hardware Platforms . . . . . . . . . . . . . . . . . . . . . . 2.2.2 Communication Infrastructures and Protocols . . . . . . . . . . . . 2.2.3 Pilots and Demand Aggregation Examples . . . . . . . . . . . . . . . 2.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5 6 8 9 11 13 14 15

3 Demand Aggregation: System Architecture and Design . . . . . . . . . . . . 3.1 Cooperative Demand Scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 Demand Scheduler Architecture . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2 Consumer: Household Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.3 Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.4 Demand Aggregator: Community Unit . . . . . . . . . . . . . . . . . . 3.2 Optimization Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Demand Aggregation Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17 18 19 20 23 23 24 25 36 37

4 Evaluation of Scheduling Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 Performance Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 Evaluation Using Heuristic Techniques . . . . . . . . . . . . . . . . . . 4.1.2 Evaluation Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.3 Identifying Consumer Behaviors . . . . . . . . . . . . . . . . . . . . . . . 4.1.4 Microgeneration Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

39 39 40 43 45 48 51 52 58

xiii

xiv

Contents

5 Behavioral Analysis and Pattern Validation . . . . . . . . . . . . . . . . . . . . . . . 5.1 ML Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Demand Segmentation and Forecasting Tools . . . . . . . . . . . . . . . . . . . 5.3 Behavioral Pattern Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1 Behavior Pattern Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2 Unsupervised ML Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.3 Supervised ML Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.4 Added Value of Demand Forecasting . . . . . . . . . . . . . . . . . . . 5.3.5 Forecasting Characterization and Evaluation . . . . . . . . . . . . . 5.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

61 61 62 63 65 67 76 83 85 89 90 92

6 Experimental Demand Scheduler Validation . . . . . . . . . . . . . . . . . . . . . . 93 6.1 Scheduler Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 6.1.1 Computation Costs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 6.1.2 Communication Cost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 6.1.3 Security Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 6.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Appendix: Questionnaire for Deploying DR Systems . . . . . . . . . . . . . . . . . . 113

Acronyms

6LoWPAN AES AI ANN ATD CoAP CPU DCF DoS DR DSM DTLS ECC ECDH ECDSA EU FIFO GA GCM GSM HAN HC ICT IoT IP IPv6 K-NN LDA LPWAN LR LTE

IPv6 over LPWAN Advanced Encryption Standard Artificial Intelligence Artificial Neural Network Attention Command Constrained Application Protocol Central Processing Unit Demand Calculation Function Denial of Service Demand Response Demand-Side Management Datagram Transport Layer Security Celliptic Curve Cryptography Helliptic Curve Diffie-Hellman Elliptic Curve Digital Signature Algorithm European Union First-In First-Out Genetic Algorithm Galois Counter Mode Global System for Mobile Communications Home Area Network Hierarchical Clustering Information and Communication Technologies Internet of Things Internet Protocol Internet Protocol Version 6 K-Nearest Neighbor Linear Discriminant Analysis Low-Power Wide Area Network Linear Regression Long-Term Evolution xv

xvi

MAE MAPE ML MQTT MSE NAN NAT NILM NIST NREL OpenADR OS PCA PLC PPP PS PSO PV QoS RAM RBF REDD REE RF RMSE RR RTT SA SAREF SD SHA256 SIM SSH SSL SVM TCP TLS TOU UDP UKDALE WAN WiMax

Acronyms

Mean Absolute Error Mean Absolute Percentage Error Machine Learning Message Queuing Telemetry Transport Mean Squared Error Neighborhood Area Network Network Address Translator Non-intrusive Load Monitoring National Institute of Standards and Technology National Renewable Energy Laboratory Open Automated Demand Response Operating System Principal Component Analysis Powerline Communications Point-to-Point Protocol Pattern Search Particle Swarm Optimization Photovoltaic Quality of Service Random Access Memory Radial Basis Function Reference Energy Disaggregation Dataset Red Eléctrica Española Random Forest Root Mean Squared Error Round Robin Round Trip Time Simulated Annealing Smart Applications REFerence ontology Standard Deviation 256-Bit Secure Hash Algorithm Subscriber identity module Secure Shell Protocol Secure Socket Layer Support Vector Machine Transmission Control Protocol Transport Layer Security Time-of-Use User Datagram Protocol UK Domestic Appliance Level Electricity Wide Area Network Worldwide Interoperability for Microwave Access

Acronyms

WLAN WWAN0 XML

xvii

Wireless Local Area Network Wireless Wide Area Network Zero Extensible Markup Language

Chapter 1

Introduction

Energy efficiency is emerging as a key aspect of both climate change and the goal of reducing our carbon footprint. A more sustainable energy system is being configured by consumer lifestyle choices, e.g., hybrid/electric vehicles, food from sustainable agriculture, and energy efficient households. Public institutions are also providing program support, e.g., by funding equipment retrofitting and subsidizing energy efficiency in public and private facilities, with the aim at encouraging citizens to play a more active role within the electricity supply system. Utility companies are committed to the same goal, with a more intelligent network that better manages flexibility in demand, enables consumer participation in balancing services, and integrates energy storage services and self-consumption. The electricity market has recently begun to address issues of power supply reliability by exploring demand-side management (DSM) policies. Current strategies to encourage consumers to shift or reduce their electricity use are pricing and financial incentives. Time-of-use (TOU) electricity tariffs are evolving towards more sustainable behaviors by encouraging electricity use when there is an abundance of supply from solar photovoltaic (PV) cells. However, many consumers simply do not know which hours of the day are the most .CO2 intensive, when renewables are generating the most power, or when prices are low (or even negative) in electricity wholesale markets. Innovative services are being developed that leverage consumers to obtain more control over their electricity consumption and so contribute to rationalizing energy use and reducing costs. Utility companies, public authorities, and policy-makers, not to mention the internet-of-things (IoT) sector, are increasingly consolidating their service and product offerings to focus on integrating and exploiting consumer flexibility and consumption awareness. Demand-side flexibility can be scheduled as an energy resource and can greatly impact on electricity system balancing and reliability. Appliances such as heaters, air conditioners, dishwashers, washing machines, and electric vehicles can be connected so that their aggregated power consumption can be controlled remotely with the goal of shifting demand over time, e.g., to take advantage of lower prices and periods when renewables generate energy. Consumers © The Author(s), under exclusive license to Springer Nature Switzerland AG 2024 C. Cruz, Sustainable Energy Efficient Communities, The Springer Series in Sustainable Energy Policy, https://doi.org/10.1007/978-3-031-49992-0_1

1

2

1 Introduction

that offer flexibility in rescheduling their processes are rewarded, e.g., with lower prices or points that can be cashed in. Moreover, consumers who produce energy (e.g., using rooftop solar panels) and who store energy in household or electric vehicle batteries, whether for their own use or for sale to others (called prosumers), are playing an increasingly important role in the success of local stakeholder interactions and local energy supply. This book describes guidelines for piloting demand-response (DR) cooperation by implementing and evaluating scheduling algorithms that aggregate and optimize community demand while maximizing renewable energy use. Imagine, as an application scenario, a smart community of electricity consumers, with interconnected appliances, empowered by better control over consumption, and provided with sufficient incentives to coordinate and adjust their energy demands. Consumption control is coordinated by a home controller that facilitates domestic energy management in such a way that consumers, sharing nearly real-time electricity demand information, can view energy-related data, control their electrical appliances to make optimum use of energy, and autonomously adapt their energy consumption. An aggregator that optimizes consumer resource use ensures that overall consumption pursues common goals, such as sustainability and lower cost. Utilities that perform real-time billing, profiling, and fault detection offer incentives to consumers, e.g., guaranteeing a lower price if demand does not exceed a certain threshold. Such production, storage, and distribution companies now supply consumers who additionally benefit from information about supply availability. The system architecture also welcomes prosumers that generate, store, and share their supply surplus. Overall, the aggregator is a core element in terms of offsetting consumer demand against total supply from available renewables at the district level. Performance, feasibility, service quality, and security measures are studied and validated in a laboratory testbed setting using lightweight cost-effective hardware platforms and living-lab datasets, in an ecosystem of consumer behavioral change towards greater energy efficiency, greener habits, and more efficient consumption through optimal management of flexibility. The development and living-lab validation of technologies for citizen empowerment towards reduction of .CO2 emissions and integrated home automation solutions represent main use cases. Emulated scenarios yield realistic and efficient results that identify the main behavioral patterns in aggregated communities, with consumer demand volume, flow, and flexibility highlighted as key factors. Identifying behavior patterns enables better strategies to be deployed in DSM programs serving real-life smart communities pursuing sustainable and efficient energy use and behavioral change. Furthermore, analysis of consumption patterns of consumers participating in living-lab settings reveals how DR program acceptance within a community might be impacted by consumer profiles and consumption drivers (e.g., flexible kW volumes, number of enrolled consumers, and percentage reduction in fossil-fuel energy consumption). Such analyses serve 5 purposes: to estimate consumer level of engagement in a DR program; to identify and target potential candidates for automated DR; to target loads; to help a community predict its microgeneration needs; and to customize reward schemes according to recognized community patterns.

1 Introduction

3

Machine learning (ML) analytics of living-lab demonstration databases (suitably anonymized) automates the extraction of patterns and relevant correlations. The implementation of both unsupervised ML methods—k-means, hierarchical clustering (HC), and principal component analysis (PCA)—and supervised ML methods— linear discriminant analysis (LDA), k-nearest neighbor (KNN), and fuzzy logic— helps estimate the DR capacity of a community participating in a demand aggregation and scheduling system.

Chapter 2

Energy Demand Management

Abstract After reading this chapter you should be able to: • • • •

Understand the main challenges posed by demand cooperation systems Understand demand-side smart systems for energy management Identify components and applications for residential energy management Understand the key smart energy hardware, software, and communication protocols.

With a view to transitioning to a more sustainable energy efficient reality, government, research institutions, and industry are planning actions to inspire consumer lifestyle choices and changes, including the use of hybrid/electric vehicles and smart appliances. Also aiming at significantly mitigating greenhouse emissions and fostering energy communities are public financial and funding instruments that provide programmed support, e.g., for equipment retrofitting, insulation, and renewable energy generation for self-consumption. Moreover, the potential of the information and communication technologies (ICTs)—in the form of smart appliances and other connected devices and sensors—is raising expectations regarding the deployment of DSM and DR programs that reduce demand peaks and induce behavioral change in consumers. This chapter provides an overview of the current technical landscape in the home automation environment that enables consumers to engage in DR programs. Described are the main challenges posed by cooperation systems, communication infrastructures, and protocols, and also the software and hardware platforms deployed in different smart grid and IoT applications. Reviewed are cost effectiveness, compatibility, scalability, security, configuration, and lightweight design properties for key demonstrable pilots and marketable solutions that deploy aggregation and DR programs. Also analyzed are the benefits of energy saving and clean energy initiatives from both individual and aggregated perspectives. Keywords Smart community · Demand response · Scheduling algorithm · IoT communication protocols · Behavioral patterns · Machine learning

© The Author(s), under exclusive license to Springer Nature Switzerland AG 2024 C. Cruz, Sustainable Energy Efficient Communities, The Springer Series in Sustainable Energy Policy, https://doi.org/10.1007/978-3-031-49992-0_2

5

6

2 Energy Demand Management

2.1 Cooperation System Challenges DR system aggregation and ICT innovations that foster energy efficiency and sustainability are key elements underpinning sustainable smart energy communities (Fig. 2.1). A cooperation system aims to tackle 3 core issues, namely, that 40% of .CO2 emissions come from the residential sector, that up to 30% of energy used by buildings is wasted, and that approximately 90% of our time is spent indoors. Other more specific challenges are described in what follows. Obsolete electricity grid regulation. The energy distribution system has traditionally been mainly linear, with power generated in large facilities transmitted one-way from the power plant to the final consumer. The sector is currently facing new constraints such as the need for infrastructure renewal and the increase in decentralized energy production. Additional challenges are consumer participation in the energy market, the integration of novel technologies, and the need for a high level of reliability. Individual energy management. Techniques deployed to improve energy efficiency are mainly based on home automation and smart metering. Most DR developments refer to energy efficiency and optimization solutions from a consumer point of view, but their performance has evolved without participatory and consensual decision-making by energy consumers. Growing energy demand. Energy demand has grown by around 20% in the last 20 years, and is expected to further increase at an annual rate of 1.8% over the period 2020-2030. In the residential sector, electricity use is increasing due to population

Fig. 2.1 Energy management instruments (aggregator and smart appliances) and resources (collaboration and renewable) aimed at achieving efficiency and sustainability goals in a smart community. Source Adapted from [1]

Quadrillion British thermal units

2.1 Cooperation System Challenges

7

60 Industrial

50 40

Residential

30 Comercial

20 10

Transport 2010

2020

2030 Year

2040

(a)

2050

(b)

Fig. 2.2 World electricity consumption by sector. Source: US Energy Information Administration, International Energy Outlook (a). Evolution of energy demand in Spain 2020–2021, corrected (green) and gross demand (orange) (b) Fig. 2.3 Evolution of energy consumption in the Spanish residential sector (GWh) 2020–2050 in fossil fuels, electricity, renewables and objective efficiency. Source Ministerio de Transportes, Movilidad y Agenda Urbana (Spain) [2]

growth and higher living standards (Fig. 2.2a). In 2021 alone, energy demand grew by up to 5.5% compared with the previous year (Fig. 2.2b). While resource use in the residential sector is expected to fall, the availability of renewables is expected to increase slightly until 2030 (Fig. 2.3). Rising energy prices. Energy prices increased by 200% in 2022 compared to the average for previous years, in part due to the huge impact on economic activity of the COVID-19 public health crisis, and also due to a 70% increase in the international price of gas and in .CO2 rights emissions. The European Union (EU) has adopted the Fit For 55 plan for green transition aimed at reducing greenhouse gas emissions by at least 55% by 2030, thereby increasing pressure on emissions despite the repercussions for electricity prices. Energy prices will only become stable with an increase in renewable energy generation and reduced dependence on fossil fuels. Low sustainable energy production. Limiting the increase in global average temperatures, in different scenarios, including below 2.◦ C, is illustrated in Fig. 2.4a. The energy system will continue to be dominated by fossil fuels, however, which will account for almost 90% of total energy supply in 2030 and will lead to increased .CO2 emissions. In the residential sector, only around 19% of energy consumption comes from renewable resources (Fig. 2.4b).

8

2 Energy Demand Management

(a)

(b)

Fig. 2.4 Global greenhouse gas emission scenarios (a). Electricity generation in the Spanish energy sector. Source Red Elèctrica de España (REE) (b)

Underdeveloped security and data protection systems in DSM. DR involves the processing of personal data and ICT integration. Data protection, privacy, and security concerns are a matter not only for industry and investors, but also for individual consumers, since metering data processed by smart grid operators are classified as personal data, and consumers are increasingly concerned about data security and privacy. Smart meters can easily be hacked if the management system is poorly configured or if there is a failure to put adequate security and/or privacy measures in place. Low energy management program uptake and inadequate DR energy management. Consumers do not necessarily feel morally obliged to support sustainable energy use and often only commit if energy savings do not involve high economic and behavioral costs. A lack of interest and/or motivation can be a determining factor in the development of DR systems, and the potential contribution of aggregating consumers has been systematically overlooked due to disparate consumer behaviors. Currently, under 2% of the global potential for demand flexibility is utilized. Although the DR market is moderately consolidated at the global level (Fig. 2.5), the Asia-Pacific region is experiencing significant growth, while China, which has experienced energy shortfalls due to rapid economic growth, is a potentially large market for management systems. Japan, meanwhile, is considered another example of the kind of open market that is crucial to essential change in the sustainable energy sector.

2.2 Demand Management Smart home research-and-development has spurred a variety of opportunities to increase energy efficiency. Household appliances and connected devices can be accessed, managed, and controlled by autonomous hardware platforms according to a daily schedule or in response to commands from anywhere, with web-based technologies gaining importance as enablers of user-friendly applications [3]. While

2.2 Demand Management

9

Fig. 2.5 Automated DR management systems market 2021. Source Mordor Intelligence

smart appliances and connected devices offer increasing benefits in terms of energy and bill savings, the problem is ensuring a single application that helps the consumer to configure, manage, and monitor applications and devices and the corresponding information. A major challenge is the wide variety of communication standards and protocols used for devices and sensors. Described below are advances needed in software, hardware, and communication networks.

2.2.1 Software and Hardware Platforms A smart home system needs to be highly interactive to reach its full potential. Smart appliances, devices, and sensors increasingly offer energy saving benefits, and a smart energy grid and smart meters are essential to further evolution. A main challenge is the wide range of different standards for devices, with successful deployment and use of smart appliances and devices requiring smart meters, smart grids, constraints, DR accessibility, internet access, protocols, etc. The emergence of low-cost platforms has greatly enabled the implementation of home controllers, whose main functions are smart appliance control, consumption data compilation, and demand profiling. Automation can be developed through open source and locally hosted platforms such as OpenHAB [4], Mozilla WebThings, and Home Assistant [5]. OpenHAB offers easy integration of a wide variety of devices and also includes other home automation systems and technologies in a single solution; Mozilla WebThings is an open platform for monitoring and control devices; and Home Assistant offers a fast, reliable, secure, and flexible system for device control. Crowdfunded proposals have also emerged, such as Home Assistant Amber (2021), which can locally integrate more than 1000 different kinds of smart devices [6].

10 Table 2.1 Hardware platforms Hardware Raspberry Pi 3 Arduino BeagleBone RADXA Libelium waspmote PYNQ Control4Home automation LG smart appliances

2 Energy Demand Management

Communication 4 USB ports, WiFi, Bluetooth, optional ZigBee and Z-Wave WiFi, Bluetooth, ZigBee, GSM 1 USB port, PLC, Bluetooth, Ethernet WiFi, Bluetooth 5.0, 1 USB port, GbE LAN 1USB, 802.15.4/ZigBee LoRaWAN, WiFi GSM/GPRS, 4G Bluetooth, Ethernet, 1 USB port Bluetooth, WiFi Z-Wave and ZigBee WiFi

Open Automated Demand Response (OpenADR) is an energy management system that shuts down power consuming devices during periods of high demand. DR signals transmitted from the system operator facilitate timely and predictable responses while allowing choices by the end consumer. It is based on various DR schedules and operates dynamic pricing through a communicator client. Other proposals are more focused on technical specifications, e.g., the Smart Appliance REFerence (SAREF) ontology, which achieves semantic interoperability between smart devices, and Non-Intrusive Load Monitoring (NILM), a demand disaggregation tool that breaks down household consumption data by appliances and monitors energy consumption in buildings without the need to install hardware on individual appliances [7]. Table 2.1 lists the most promising hardware platforms, in terms of low cost, compatibility, and versatility, for implementing a smart home management system. Raspberry Pi [8] is an electronic board with integrated Bluetooth and WiFi connectivity. Arduino [9] produce inexpensive microcontrollers that implement low-cost clients that generate energy demand profiles [10], e.g., a remotely controlled client by Zigbee for the Arduino Mega board [11]. BeagleBone is another open source hardware platform that can be used for device control, while a remote monitoring system has been developed using Libelium Waspmote, a modular device allowing the integration of different sensors [12]. Such smart home architectures rely on a central unit as a primary piece of hardware that is the focus for all communications and data transmission between energy management devices, the consumer, and household appliances and devices.

2.2 Demand Management

11

2.2.2 Communication Infrastructures and Protocols The overview below describes existing smart home technologies with their security properties and most feasible communication protocols, as well as efficient use of available infrastructures in the following network types: the home area network (HAN), which consists of devices in the home environment; the neighborhood area network (NAN), which collects data from multiple HAN locations and sends it to a data concentrator; and the wide area network (WAN), which connects to the service provider. HANs. These infrastructures implement home controllers with integrated smart appliances using communication technologies (wired, wireless, short-range, and long-range) that provide sustainable energy services for smart grids [13]. A broad range of network infrastructures for data transmission [14], including wired and wireless technologies, are widely used for data transmission. Fiber optic approaches for high-speed data exchange and transmission are justified when a high data transmission rate is required [15]. Powerline communication (PLC) is commonly implemented in computer networks and wired smart meters for remote monitoring purposes and to ensure a flexible communications network. However, internet protocol (IP)-related challenges to integration and real-time communication issues need to be addressed [16]. A low-cost solution has been proposed Artale et al. [17] based on coupling the PLC signal and avoiding wireless technologies through aggregated data. The current regulatory framework is sufficiently flexible to allow the incorporation of new PLC technologies,1 and provides for the deployment of systems and solutions based on renewable resources in a wide variety of heterogeneous networks. Data transmission is mainly established through a variety of non-wired techniques, such as ZigBee, Z-Wave, Bluetooth, WiFi, and IPv6 over a Low-Power Wireless Area Network (LPWAN) [19], corresponding to short-range wireless communication protocols: (1) ZigBee [20] offers a communication range of up to 100 m and both a low data rate (up to 250 kbps, lower than the 300 Mbps for WiFi) and low power consumption; (2) Z-Wave [21], due to low communication latency in small data packets, is used for short-range communications; (3) Bluetooth is widely used for data exchanges over short distances [22]; (4) WiFi offers a high data transmission rate and long-range data transmission [23]; and (5) LPWAN is a generic term for various wireless communication protocols optimized for long-range and lowpower IoT applications, e.g., IPv6 over Low-Power Wireless Personal Area Network (6LoWPAN). NANs. Intended to be secure in a NAN environment is the Thread network protocol, a low-power IPv6-based mesh networking technology for IoT. It uses, under the IEEE 802.15.4 wireless protocol, 6LoWPAN, which, applied in automation designs [24], helps reduce cost and architecture complexity [25]. The 4G Long-Term Evolution (LTE) wireless service, in contrast, offers better performance and faster speeds, as 1

Regulations allow the use of PLC technologies in outdoor deployments, as discussed in [18].

12

2 Energy Demand Management

Table 2.2 Wireless networks: technologies for different application areas Technology Strengths Application Areas Encryption/ Authentication Bluetooth

WiFi Z-Wave Zigbee

Small networks Security, speed Easy access Flexibility Popular in HAN Speed, flexibility No interferences

HAN

Challenge response scheme/CRC32

HAN

4-way handshake/ CRC32 AES128/ 32-bit home ID ENC-MIC-128 Encrypted key/ CRC16 Symmetric key cryptography/AES 128b Symmetric key cryptography/AES 128b 64-bit A5/1 encryption/ session key generation WEP, WPA, WPA2/ open, shared EAP Symmetric key encryption/ mobility management entity DMA2000 /Authentication and key agreement

HAN, NAN

LPWAN

Low cost Low consumption Flexible topology Low power Low cost

HAN, NAN

NAN, WAN

6LoWPAN

Low energy use

HAN, NAN

GSM/ General Packet Low cost Quality Radio Service (GPRS) signal

HAN, NAN WAN

WLAN

Robustness

HAN, WAN

5G

High speed Low latency

HAN, WAN

3G

Fast data transfer

HAN, WAN

well as lower latency over 3G, WiFi, and Worldwide Interoperability for Microwave Access (WiMax) [26]. WANs. Suitable for this type of network are cellular standards based on WiMax and the Global System for Mobile Communication (GSM, which cover a radius of 1000 meters and comprise 2 interconnected networks [27]. GSM is a low-cost communication system with excellent signal quality that can be implemented between several home controllers. LPWAN and 5G protocols, which have high speeds, bandwidths, and responsiveness, operate in various licensed and unlicensed frequency bands. However, since 5G introduction to IoT remains slow, other technologies currently offer more promise, e.g., the Long-Range Wide Area Network (LoraWAN) communication protocol that uses the LoRa radio signal is capable of tackling most IoT challenges and applications. Table 2.2 highlights the main characteristics of these technologies and suggests suitable areas of application.

2.2 Demand Management Fig. 2.6 IoT system protocols. Source Adapted from [28]

13

Application Transport Network Link

HTTP/S

CUSTOM PROTOCOL

MQTT TCP

CoAP UDP

IP WiFi Bluetooth Zigbee Z-wave

Figure 2.6 shows the main protocols used for IoT systems, with current communication architectures for smart homes that could potentially incorporate device interaction in various ways. User Datagram Protocol (UDP) sockets, with no connection between client and server, can be implemented by the Constrained Application Protocol (CoAP) over the Datagram Transport Layer Security (DTLS), which guarantees the confidentiality and integrity of exchanged message content. The Transmission Control Protocol (TCP) is implemented by Message Queuing Telemetry Transport (MQTT), which connects devices that allow data encryption.

2.2.3 Pilots and Demand Aggregation Examples DR and demand flexibility technologies are still in development. Some key elements for DR program development are the definition of independent aggregators, participation, and implementation. Pilot implementations such as in Belgium [29], Shanghai [30], and the Netherlands [31] have analyzed smart meters flexibility, household electricity consumption feedback, pattern recognition, and the effectiveness of price incentives. Studies in Germany have focused on monitoring consumption in different households where customers are exposed to different prices modifications over 2 years [32]. In another study, consumption was reduced in 77 households by controlling the operation of appliances, like washing machines, that could reduce peak-time consumption, resulting in around 48% reduction compared to a control group with non-smart appliances [33] The possibility of residential aggregation to access markets varies across the EU. In Germany, aggregators currently require an agreement with the supplier before accessing consumer flexibility, with Energy & Meteo Systems GmbH supporting energy aggregators for efficient market integration. The Netherlands provides grid services through a network of household meters. In France, default agreements allow aggregators to access all markets without negotiation. In the UK, active management with mechanisms aimed at increasing consumer participation has been widely implemented, with suppliers aggregating the consumption of all their customers and operating the network as a single entity; consumers therefore instantaneously participate in markets while managing their consumption. In Spain, aggregation is not currently implemented. The IREMEL and CoordiNet projects, which generate

14

2 Energy Demand Management

renewable energy on a small scale, offer a flexible market solution with demand management and storage services, identifying and aggregating flexible demand for several consumers through an aggregator. Other solutions offered by HolaLuz and Solify maintain and control the energy produced in photovoltaic (PV) panels. Finally, Bambooenergy [34] emerged in 2022 as a promising example of platform development for retailers and aggregators to efficiently manage flexibly distributed resources. Those proposals are examples that confirm the importance of implementing management and/or aggregation systems in realistic environments.

2.3 Summary DR systems are considered to be a benchmark for encouraging reduced energy consumption and resource optimization, with power system operators adopting DR strategies and developing smart grid technologies, including intelligent energy management systems, advanced metering infrastructures, and compatible ICTs. Technology deployment has a significant role to play in configuring an effective market framework, especially from the perspective of consumer engagement in DR programs, efficient participation in DR programs, and the easy forecasting of prices. In this chapter, hardware and software requirements have been reviewed to identify the most promising free and low-cost platforms (e.g., Raspberry Pi). The main communication protocol needs have also been identified (e.g., MQTT and DTLS, and also key studies on smart device data transmission. The smart communication infrastructure is commonly seen as a hierarchical network with 3-tier architecture comprising a (HAN), NAN, and WAN. The network infrastructure considers the key components of a DR system, which are the consumer, the server, and the utility service, respectively. At the HAN level, data transmission between appliances is mainly performed through a variety of non-wired techniques, including ZigBee (with low data transmission and power consumption levels), Z-Wave (suitable for short-range communications due to the low latency of small data packet communication in a scalable environment), and WiFi (with high-rate and long-range data transmission). At the NAN level, connection is via a bidirectional WiFi communication infrastructure that transmits energy demand and time preferences to the server. As for the WAN level, communications are established between the server and the service substations via 3G, 5G or LPWAN.

References

15

References 1. C.C. de la Torre, Sistema cooperativo de planificacion de demanda de electricidad agregada: comunidades sostenibles que optimizan el consumo de renovables. Ph.D. thesis, Universidad de Alcala (2022) 2. MITMA (2022) Ministerio de transportes, movilidad y agenda urbana. https://www.mitma. gob.es. Accessed 30 June 2021 3. E. Palomar, I. Bravo, C. Cruz, Household energy demand management (2023), pp. 65–92. https://doi.org/10.1002/9781119899457.ch3 4. R.C. Parocha, E.Q.B. Macabebe, Implementation of home automation system using openhab framework for heterogeneous iot devices, in 2019 IEEE International Conference on Internet of Things and Intelligence System (IoTaIS) (2019), pp 67–73. https://doi.org/10.1109/ IoTaIS47347.2019.8980370 5. N. Ali, F. Radzi, Ja’afar A, Abdul Hamid N, Saleh T, Home automation monitoring system based on internet-of-things application. J. Phys.: Conf. Ser. 1502, 012041 (2020) 6. N. Casa, Home-assistant-amber (2021). https://www.crowdsupply.com/nabu-casa/homeassistant-amber. Accessed 01 Nov 2021 7. N. Batra, J. Kelly, O. Parson, H. Dutta, W. Knottenbelt, A. Rogers, A. Singh, M. Srivastava, Nilmtk: an open source toolkit for non-intrusive load monitoring, in Proceedings of the 5th International Conference on Future Energy Systems, Association for Computing Machinery, New York, NY, USA, e-Energy ’14 (2014), pp. 265–276. https://doi.org/10.1145/2602044. 2602051 8. M.U. Qureshi, A. Girault, M. Mauger, S. Grijalva, Implementation of home energy management system with optimal load scheduling based on real-time electricity pricing models, in 2017 IEEE 7th International Conference on Consumer Electronics - Berlin (ICCE-Berlin) (2017), pp. 134–139. https://doi.org/10.1109/ICCE-Berlin.2017.8210612 9. Arduino (2021) Arduino. https://www.arduino.cc. Accessed 28 March 2021 10. M. Amer, A. El-Zonkoly, N. Aziz, N. M’Sirdi, Smart home energy management system for peak average ratio reduction (Ann. Univer, Craiova, 2015) 11. K. Baraka, M. Ghobril, S. Malek, R. Kanj, A. Kayssi, Low cost arduino/android-based energyefficient home automation system with smart task scheduling, in Proceedings of the 2013 Fifth International Conference on Computational Intelligence, Communication Systems and Networks, IEEE Computer Society, Washington, DC, USA, CICSYN ’13 (2013), pp. 296–301. https://doi.org/10.1109/CICSYN.2013.47 12. M.A. Quintana-Suárez, D. Sánchez-Rodríguez, I. Alonso-González, J.B. Alonso-Hernández, A low cost wireless acoustic sensor for ambient assisted living systems. Appl. Sci. 7(9) (2017). https://doi.org/10.3390/app7090877. https://www.mdpi.com/2076-3417/7/9/877 13. R. Zafar, A. Mahmood, S. Razzaq, W. Ali, U. Naeem, K. Shehzad, Prosumer based energy management and sharing in smart grid. Renew. Sustain. Energy Rev. 82, 1675–1684 (2018). www.sciencedirect.com/science/article/pii/S1364032117310894 14. N. Andreadou, M.O. Guardiola, G. Fulli, Telecommunication technologies for smart grid projects with focus on smart metering applications. Energies 9(5) (2016). https://doi.org/10. 3390/en9050375. https://www.mdpi.com/1996-1073/9/5/375 15. B. Shakerighadi, A. Anvari-Moghaddam, J.C. Vasquez, J.M. Guerrero, Internet of things for modern energy systems: state-of-the-art, challenges, and open issues. Energies 11(5) (2018). https://doi.org/10.3390/en11051252. https://www.mdpi.com/1996-1073/11/5/1252 16. M. Yigit, V.C. Gungor, G. Tuna, M. Rangoussi, E. Fadel, Power line communication technologies for smart grid applications: a review of advances and challenges. Comput. Netw. 70, 366–383 (2014) 17. G. Artale, A. Cataliotti, V. Cosentino, D.D. Cara, R. Fiorelli, S. Guaiana, N. Panzavecchia, G. Tinè, A new plc-based smart metering architecture for medium/low voltage grids: Feasibility and experimental characterization. Measurement 129, 479–488 (2018) 18. X. Fang, N. Wang, T.A. Gulliver, A plc channel model for home area networks. Energies 11, 3344 (2018). https://doi.org/10.3390/en11123344

16

2 Energy Demand Management

19. J. Leithon, S. Werner, V. Koivunen, Cost-aware renewable energy management: centralized vs. distributed generation. Renew. Energy 147, 1164–1179 (2020) 20. B. Bilgin, V. Gungor, Performance evaluations of zigbee in different smart grid environments. Comput. Netw. 56(8), 2196–2205 (2012). www.sciencedirect.com/science/article/pii/ S1389128612000941 21. A. Mahmood, N. Javaid, S. Razzaq, A review of wireless communications for smart grid. Renew. Sustain. Energy Rev. 41, 248–260 (2015). www.sciencedirect.com/science/article/pii/ S1364032114007126 22. M. Collotta, G. Pau, A solution based on bluetooth low energy for smart home energy management. Energies 8(10), 11916–11938 (2015) 23. J. Fletcher, W. Malalasekera, Development of a user-friendly, low-cost home energy monitoring and recording system. Energy 111, 32–46 (2016) 24. S.N. Han, Q.H. Cao, B. Alinia, N. Crespi, Design, implementation, and evaluation of 6lowpan for home and building automation in the internet of things, in 2015 IEEE/ACS 12th International Conference of Computer Systems and Applications (AICCSA) (2015), pp. 1–8. https://doi.org/ 10.1109/AICCSA.2015.7507264 25. J. Aradindh, V.B. Srevarshan, R. Kishore, R. Amirthavalli, Home automation in iot using 6lowpan. Int. J. Adv. Comput. Eng. Netw. 3(5), 2320–2106 (2017) 26. J. Huang, F. Qian, A. Gerber, Z.M. Mao, S. Sen, O. Spatscheck, A close examination of performance and power characteristics of 4g lte networks, in Proceedings of the 10th International Conference on Mobile Systems, Applications, and Services, Association for Computing Machinery, New York, NY, USA, MobiSys ’12 (2012), pp. 225–238. https://doi.org/10.1145/ 2307636.2307658 27. Y. Saleem, N. Crespi, M.H. Rehmani, R. Copeland, Internet of things-aided smart grid: technologies, architectures, applications, prototypes, and future research directions. IEEE Access (2019) 28. C. Cruz, E. Palomar, I. Bravo, A. Gardel, Cooperative demand response framework for a smart community targeting renewables: testbed implementation and performance evaluation. Energies 13(11) (2020). https://doi.org/10.3390/en13112910. https://www.mdpi.com/19961073/13/11/2910 29. R. D’hulst, W. Labeeuw, B. Beusen, S. Claessens, G. Deconinck, K. Vanthournout, Demand response flexibility and flexibility potential of residential smart appliances. Appl. Energy 155, 79–90 (2015) 30. X. Zhang, J. Shen, T. Yang, L. Tang, L. Wang, Y. Liu, P. Xu, Smart meter and in-home display for energy savings in residential buildings: a pilot investigation in shanghai, china. Intell. Build. Int. (2016), pp. 1–25. https://doi.org/10.1080/17508975.2016.1213694 31. C. Gercek, W. Schram, I. Lampropoulos, W. van Sark, A. Reinders, A comparison of households’ energy balance in residential smart grid pilots in the Netherlands. Appl. Sci. 9, 2993 (2019). https://doi.org/10.3390/app9152993 32. R. Stamminger, V. Anstett, The effect of variable electricity tariffs in the household on usage of household appliances (2013) 33. C.B. Kobus, E.A. Klaassen, R. Mugge, J.P. Schoormans, A real-life assessment on the effect of smart appliances for shifting households’electricity demand. Appl. Energy 147, 335–343 (2015) 34. Bambooenergy (2022) Agregadores y minoristas independientes que administran de manera eficiente los recursos de flexibilidad distribuidos. https://bambooenergy.tech/es. Accessed 30 June 2021

Chapter 3

Demand Aggregation: System Architecture and Design

Abstract After reading this chapter you should be able to: • • • •

Design a system architecture for an energy demand scheduler Identify key energy management actors at the residential level Understand the main heuristic demand optimization techniques Understand the aggregation concept in energy management.

Individual consumers in the residential sector have not been considered targets for DR programs due to their low energy consumption. However, customers typically respond to increasing prices by modifying behavior and usage practices. Demand aggregation models are based on consumer groups subscribing to distributed power plants, with aggregators developing strategies for consumers to modify their energy demand in response to system operator requirements and energy availability. New entities are emerging that act as mediators or intermediaries between consumer groups and distributors, assuming responsibility for the installation of communication and appliance control systems in end-user premises. While the traditional grid offers programs for large-scale consumers such as industrial plants and buildings, similar programs are not available to the residential sector for 3 main reasons: communication difficulties in managing many residential units; a lack of efficient and open automation tools; and the difficulty faced in integrating heterogeneous architectures in a demand management system. This chapter describes a novel energy management system by design with the consumer at its core. The proposal consists of a group of consumers coordinating their demand behavior, as, aware of their energy consumption, they pre-schedule their demand for the upcoming 24 h. Keywords Cooperative smart community · Scheduling algorithm · Consumer preference · Renewable energy

© The Author(s), under exclusive license to Springer Nature Switzerland AG 2024 C. Cruz, Sustainable Energy Efficient Communities, The Springer Series in Sustainable Energy Policy, https://doi.org/10.1007/978-3-031-49992-0_3

17

18

3 Demand Aggregation: System Architecture and Design

3.1 Cooperative Demand Scheduler The demand cooperation system is designed on the basis of: (1) a set of consumers Ci ; (2) a set of actions available to each consumer, called strategies or preferences (e.g., energy sharing); and (3) an associated energy demand quantity that is of benefit for all consumers. Each consumer selects the action that best benefits them and/or the community, i.e., the action providing the greatest reward (the best response), which is generally dependent on the actions of the other consumers. Decision-making by multiple consumers determine a particular action, so the outcome for an individual consumer depends on the decisions of the group, whose approach can be classified as noncooperative or as cooperative. The non-cooperative approach. Non-cooperation does not mean that consumers do not cooperate with each other, but that decisions must be self-fulfilling without communication between the consumers., i.e., their actions are not coordinated with those of other consumers. Individual consumer actions are thus predicted without considering the outcome of decisions by the other consumers. In a non-cooperative scenario, individual consumers will only deviate from a proposed solution if it is not in their interest. An example is a prosumer household in a microgeneration energy sharing framework that does not share its renewable energy to avoid reducing its own resources. The cooperative approach. Cooperation consists of a bargaining process resulting in a Nash equilibrium, whereby an outcome cannot be improved by a consumer changing their strategy. Consumers agreeing on certain terms of cooperation communicate with each other, receive aggregated demand services, and decide how benefits are shared. The participating consumers do not always have the same interest and do not always provide the same value, but expect to receive benefits according to the provided value. The bargaining problem can be stated as 2 consumers with possible contractual agreements and an interest in cooperating. Assuming that both parties behave rationally, what will be the agreed contract? Several axiomatic and strategic negotiation solutions are possible, focused on the outcome and its properties. Proposed is choosing an outcome based on axioms that the parties agree must be satisfied:

.

• Pareto-optimal solution. No solution is available that makes one player better off without making another player worse off. • Symmetric solution. The solution depends only on the community’s preference function, not on the individual consumer.

3.1 Cooperative Demand Scheduler

19

3.1.1 Demand Scheduler Architecture The demand scheduler approach is based on the consumer, the aggregator, and the utility using renewable resources. Figure 3.1 illustrates roles and processes within the adopted cooperation framework, according to network, namely, HAN, NAN, and WAN. The HAN comprises communication technologies for energy management and appliance integration at the home level. Requiring a relatively small coverage area, it enables management and planning within the consumer’s home. The consumer provides their energy usage data for automatic management and control by the home controller, which extracts the scheduling data, transmits the processed data to the aggregator, and collects information on and controls a set of smart appliances. The NAN consists of several HANs connected within a two-way communication infrastructure that transmits time preferences to a centralized community controller, comprising a set of consumers using the same energy provider. The consumers adapt

WAN LEVEL Data Flow Communication UTILITY: energy suppliers shared by customers (RW) CENTRALIZED AGGREGATOR Capabilities: Optimization

NAN LEVEL

Community consumers (N)

HAN LEVEL

HEM CONTROLLER Consumer Capabilities: - Scheduling - Monitoring - Control

HOME ENERGY MANAGER(HEM)

HOME SMART APPLIANCES (Ai)

Fig. 3.1 Cooperative demand scheduler architecture at the HAN, NAN, and WAN levels. Source Adapted from [1]

20

3 Demand Aggregation: System Architecture and Design

their consumption cooperatively by sharing their demand schedule with a data collector that integrates consumption information in a common display. This management system is connected to the utility company in the WAN, consisting of the set of energy providers shared by the customers, which establishes communications between the aggregator and the utility. This system of distributed generation allows energy (mainly renewable) to be collected and shared, with the resulting lower environmental impact. Finally, integration occurs in the aggregator, located in the NAN, which locally distributes the energy supplied via a resource allocation algorithm implemented in response to existing renewable energy supply conditions, ensuring efficient demand reallocation that reflects the consumption preference data for each appliance.

3.1.2 Consumer: Household Unit Each consumer has a set of N appliances labeled A. The fixed energy demand is determined by consumer habits, behaviors, and appliance uses, as well as by variable demand resulting from the use of these appliances. Appliances potentially consume energy 24 h a day, as they are not completely switched off unless fully disconnected (standby power). Considering a discrete time slot system, time granularity is assumed to be 1h. Each consumer pre-allocates a certain fixed demand quantity and expected variable consumption for the upcoming 24 h. For each appliance .aij A, we assume daily fixed and variable consumption scheduling vectors in each time slot t 0-23 that control variable and fixed consumption. Thus, consumer i.∈ .N = 1, 2, …, .N has non-shifting energy demand for appliances in a particular time slot, representing the aggregate load of local non-shifting consumption by their appliances relative to frequent behaviors. In addition, for consumer i we have .Ai = .ai , m, m .∈ 1, 2, …, .M , where .M is the number of appliances belonging to consumer i that allow for shiftable consumption. Energy fixed and variable demand for 1h are denoted as fd and vd, respectively. Variable energy demand, characterized by its flexibility, considers the consumer’s preference for an appliance to start in a given time period, with each appliance having a run window, i.e., an interval closed at each end by a minimum start time and a maximum end time, labeled .tbeg and .tend , respectively. The operation time of appliance i is .tsched , coinciding with the run time interval of the operation [.tbeg , .tend ]. L is the duration of the planned operation on the next day. Demand must be activated at a time in the predefined interval: .∀ij ∈ A, tsched ≥ tbeg . And demand must also be disconnected: .∀ij .∈ A, .tsched .≤ .tend . Consumer j sets the following data for the appliance .aij .∈ A (Table 3.1). • Fixed consumption (kWh), when .aij is on standby • Consumption (kWh), when .aij is activated • Foreseen duration (hours/minutes) of .aij operation on the following day

3.1 Cooperative Demand Scheduler

21

Table 3.1 Smart appliance configuration Appliance configuration Demand (kWh) .vd

Fixed demand (kWh) .fd

Duration (h)

Time ON

Time OFF

.L

.tbeg

.tend

• .aij start time (e.g., 8:00 h) • .aij end time (e.g., 12:00 h) Prosumers are categorized according to the generated renewable energy, storage possibilities, and demand. Thus, some prosumers (.C1 ) generate renewable energy but have no storage capacity, while other prosumers (.C2 ) both generate and store renewable energy. Initially, prosumers .C1 check their available renewable energy. If enough is available and net energy demand over the entire time slot is greater than zero, these consumers have sufficient energy to self-supply. Hence, renewable energy is available to satisfy energy demand at time t and the consumer decides whether to cooperate in the provision of energy for the next 24 h. If the microgenerated renewable energy is only enough to satisfy demand over the time slot, the consumer participates by aggregating their preferences with those of the community for the next day’s energy supply, sending the generated renewable energy on-site to the aggregator. If .PWgit is renewable energy generation per slot, the energy consumed by .C1 is expressed according to Eq. 3.1. . . 23 RW tc1 = .t=0 PW tg1 − C1t

.

(3.1)

The consumer schedules energy to the aggregator for the upcoming 24 h when total energy demand at time n exceeds .C t .> .PW g t . The other consumers (.C2t ), with a backup energy storage system, can send surplus energy to the aggregator during conditions of no demand. Daily energy consumption in this case is calculated according to Eq. 3.2. .

. . 23 PW tg2 + PW ts2 − C2t RW tc2 = .t=0

(3.2)

The consumer uses a configuration and parameter setting application to monitor, visualize, control, and program appliance operations. Figure 3.2 shows the application sequence that explains how the application functions. The first and second tabs serve to check the resources used in the previous 24 h, i.e., consumption by selected appliances. The third and fourth tabs show selected areas in the home and operation times, with the appliances shown below. Finally, the fifth tab summarizes the demand information entered for each area of the home, and allows a data array to be sent to the aggregator with all the appliance configurations.

22

3 Demand Aggregation: System Architecture and Design

Fig. 3.2 Consumer programming application. Source Adapted from [1]

The home controller executes priority preferences and time intervals for demand scheduling, ensuring efficient energy management in the home environment. Reallocation is performed by the home controller by activating appliances according to a 24 h vector per appliance. The consumer can thus adjust their real-life dynamics at the home level. The home controller systematically activates/deactivates appliances on receiving and applying reassigned 24 h vectors from the aggregator.

3.1 Cooperative Demand Scheduler

23

3.1.3 Utility The utility sets the rules for the marketplace and for energy offers from different electricity suppliers, and ultimately are responsible for the operation and maintenance of the distribution network, for ensuring secure transmission, and for efficient management and balancing of production and demand. The utility does not offer aggregated flexibility to other market players, rather it provides services and data to consumers. Its roles and tasks cover operation, maintenance, and development of distribution networks. The utility also acts as an arbitrator, provides DR incentives to customers to increase energy efficiency, and also provides valuable information on renewable and fossil-fuel energy scheduling for the upcoming 24 h. The energy supply is generated from a set of renewable sources in a time period denoted by RW—i.e., a renewable energy vector with 24 time slots—with the utility company centralizing energy distribution, aggregator reporting, and billing.

3.1.4 Demand Aggregator: Community Unit The aggregator is defined as an intermediary between energy end users that collects and reallocates demand with the objective of maximizing use of renewables by the community of consumers. Playing an important role on behalf of the consumers, it contains the scheduling data for all consumption appliances that can potentially be reallocated within the desired activation intervals. This scheduling problem is considered in terms of a coalition system, consisting of a set of consumers (either the consumers in N or all their appliances) and a set of appliances, that must result in a fair division of RW, i.e., a set of rules that, when used correctly by the consumers, guarantee each a fair share of resources by the end of the process. Table 3.2 depicts scheduling communication flows. The algorithm is executed every 24 h by means of local search optimization, whereby the summed consumption by appliances minimizes depletion of the available renewable supply. Different solutions are possible once the requested L, i.e., appliance operation duration, is within the desired activation interval [.tbeg , .tend ]. The aggregator determines the optimal setting in .rx, minimizing total overconsumption (in hours) of the RW supply in a given time interval. The algorithm searches through the joint demand matrix for the optimal time .tsched to start operation of each appliance, according to operation time L and operation time tolerance. Finally, for each appliance a 24 h reassigned demand vector resulting from execution of the algorithm is privately forwarded by the aggregator to the home controller that controls and monitors the operations of each appliance.

24

3 Demand Aggregation: System Architecture and Design

Table 3.2 Roles and structure of exchanged messages .Application .→ .Controller: m1: .{fD, .vD, .L, .tbeg , .tend , ID . ∀ Appliance to be programmed .∈ Ac .Controller .→ .Aggregator: m1 .×Ac appliances . ∀ Consumer .c ∈ C .U tility .→ .Aggregator: .rw = [rw0 , · · · , rw23 ] (kW) .Aggregator: Run the programming of the data .A .Aggregator .→ .Controller: .[d0 , · · · , d23 ] (kW) .×Ac appliances. .Controller .→ .Appliances: .(ON /OFF) ∀ [0, · · · , 23] . ∀ Appliance to be programmed where: consumer.c introduces, for each appliance.∈ Ac identified by.ID, fixed and programmed demand.fD, vD, duration of variable consumption .L, time slot for appliance operation .(tbeg , tend ) .rwt (kW) expected for time interval .t, while .dt (kW) programmed .t of the day.

3.2 Optimization Techniques Optimization tries to locate the best values (optimal points) for certain predetermined variables subject to constraints. Successful optimization automatically generates and examines all alternative combinations operating within a range, known as the operating interval, that yield feasible results for the objectives being pursued. The optimization problem is formulated as in Eq. 3.3. minf ((x)) , for x ∈ X

.

(3.3)

where X is a non-empty set in .Rn and f is a continuous function. The objective is to find the minimum value .f ∗ (.(x∗ )) .∈ X that satisfies Eq. 3.4. f ∗ = f ∗ ((x)) ≤ f ((x)) , ∀x ∈ X

.

(3.4)

The no-free-lunch theorem (i.e., the computational cost of finding a solution, averaged over all problems in the class, is the same for any solution method) highlights the impossibility of implementing a universal general purpose optimization strategy, as general purpose methods require careful finetuning. Optimization techniques, classified according to whether or not they guarantee an optimal solution, can be deterministic or heuristic. Deterministic methods are usually ineffective when applied to high-dimensional problems, due to limited requirements and knowledge, and an exceptionally large search space. They do not include random factors and, because they try to find the optimal result by exploring the entire search space, they are computationally costly.

3.3 Demand Aggregation Algorithms

25

Heuristic and meta-heuristic methods, in contrast, do not always guarantee an optimal result, but rapidly obtain a good-enough solution by randomly searching for feasible solutions. They start with an initial solution, and iteratively (according to predefined rules) search for alternative solutions that are evaluated for optimality. The search ends with a particular stop condition or a predefined number of iterations. The main advantages of heuristic algorithms are their simplicity and lower computational cost. The main heuristic/meta-heuristic techniques are classified as follows: • Evolutionary algorithms, e.g., the genetic algorithm (GA), are inspired by natural selection and biological evolution. They iteratively evolve a population of potential solutions using mutation, crossover, and selection operations. • Physical algorithms, e.g., simulated annealing (SA) inspired by metallurgy, model physical systems and processes and frequently use physics-related concepts to guide optimization. • Swarm algorithms, e.g., particle swarm optimization (PSO), are inspired by the collective behavior of groups (swarms) that cooperate to solve problems or achieve goals. Swarm intelligence is self-organized, decentralized, and distributed. • Derivative-free optimization algorithms, e.g., pattern search (PS), are direct search methods that rely on function evaluations to seek optimal solutions. Evolutionary algorithms search in a population of potential solutions that interact with each other, physical and swarm algorithms typically start with a single solution or a limited set of solutions, and direct search methods explore the search space in a systematic but non-exhaustive manner with the aim of finding the local minima or maxima of an objective function.

3.3 Demand Aggregation Algorithms Data aggregation is defined as a centralized system of aggregation tasks that communicates with both the utility and consumers. A scheduling algorithm optimizes the allocation of expected renewable energy supply to a community of consumers according to selected preferences. Figure 3.3 depicts the scheduling structure for the consumer, aggregator, and utility. The daily fixed consumption demand for consumer .i.N is the non-reallocated local consumption demand (i.e., for appliances) and frequent behaviors aggregated according to Eq. 3.5, while the daily fixed demand for the community of consumers at time t is calculated by the aggregator according to Eq. 3.6. 23 t fDi = .t=0 .aij ∈Ai fDi,a ij

(3.5)

fDt = .iN fDit

(3.6)

.

.

26

3 Demand Aggregation: System Architecture and Design

Fig. 3.3 Sequence of main processes and message exchanges. Source Adapted from [1]

The total energy consumed by all appliances is verified by the aggregator, and the data collector reallocates the total demand of the community, according to Eq. 3.7, i.e., according to both what is fair for all consumers and the renewable supply available for each time slot. 23 23 .iN .t=0 fDit . .t=0 RW

.

(3.7)

The variable hourly demand schedule for the appliance,.vDit , should satisfy Eq. 3.8. ∀t ∈ {0, . . . , 23}, .iN (fDit + vDit ) ≤ RW

.

(3.8)

Equation 3.8 reflects a global centralized optimization problem, while the unique solution (Nash equilibrium) is achieved by Eq. 3.9:

3.3 Demand Aggregation Algorithms

∀i ∈ {1 . . . N }, μti = fDit + min{(DCF)((vDit ))} ≤ RW

.

27

(3.9)

.DCF handles displacement of variable demand according to the time interval for which the appliance is scheduled. Therefore, the solution to the optimization problem must satisfy .tsched and avoid overconsumption L in specific time slots. The formulation, explained in Algorithm 1, is created as its minimum, i.e., (.min. DCF(·)). The optimal time interval for the activation of each appliance is determined on the basis of the activation time, preferred interval, and available renewable energy supply. Thus, considering the following variables, A, .tsched , .tbeg , and .tend , optimization, according to Eq. 3.10, will determine whether a setting is appropriate by minimizing total overconsumption (in hours) by the community’s appliances versus the renewable supply available in a given time interval. The aggregator notifies the community → μ i , ∀i ∈ N as reallocated to of agreement and privately releases the demand vector .− each consumer.

vDiRequired ≤ RW iRenewables

.

(3.10)

Figure 3.4 describes demand aggregator roles for 2 scenarios: Centralized scenario (Fig. 3.4a). Consumers are assumed to be willing to share data and to participate in the reallocation process. As in sequential turn-based systems, the order of players starts within a turn and one of the scheduling strategies described below ([A], [B], [C], or [D]) is implemented. Semi-decentralized scenario (Fig. 3.4b). Consumers operate in a more privacyaware scenario, so the aggregation logic is executed individually for each consumer on a first-in-first-out (FIFO) basis. Consumers, as they arrive at the RW vector, access it, lock it, and allocate their demand to the shared supply. The aggregator in this scenario operates as a common repository that maintains consistency in the shared copy of the supply vector. Scheduling strategies are as follows: [A]. Round robin (RR). Selection is fairly and rationally ordered, starting from the first to the last consumer, and then starting again from the first consumer. Applying a recursive RR strategy, renewable resources are fairly allocated among consumers and/or appliances, because the number of consumers is known and fixed, and because the reallocation process is centralized by the aggregator that, starting with itself, satisfies consumer demand in a periodically repeated order, with the preferences of neighbors taken into consideration. [B]. Random RR. This scheduling approach operates in a similar way to [A], differing only in the random choice of the first consumer. [C]. First player always the same. Sorting, based always on the same first player, aims to identify the fairest sequence, i.e., sorting is according to a fair division protocol. The allocation is based on a sequence that maximizes the expected value of some social welfare function, as a natural way to allocate objects to agents in a decentralized way.

28

3 Demand Aggregation: System Architecture and Design

Algorithm 1 Function Green scheduler 1.0 (DCF). 1: RW t (Renewable vector) = {σ1 , . . . , σ24 }; RWx = RWi + PW 2: N = size(Ai ) i , t i , minimum consumption, consumption 3: Define limit to the variables tbeg end i 4: Optimizable search starting point tsched 5: for ihour time to total number of hours do i , t i ] then 6: if ihour does not belong to the interval [tbeg end 7: Calculation of fDit 8: end if 9: end for 10: for iappliance 1 to the size of the appliance configuration (Ai ) do 11: RW t = RW t − Ai (fDit ) 12: end for 13: Ai (vDit ) = Ai (vDit ) − Ai (fDit ) 14: Ai (Dit (Dit < 0)) = 0 15: Ai (fDit ) = Ai (fDit ) − Ai (fDit ) i i 16: Objective function@(tsched ) maximum consumption (Ai , RW t , tsched ) 17: [tsched ] = Heuristic technique(Objective Function, tsched , tbeg , tend ) i 18: (Result, HCoo, RWdemanded ) = maximum consumption (tsched ,Ai ,RW) 19: RX = RW - RW demanded i , ti Require: Ai configuration: vDit , fDit , Li , tbeg end i i Ensure: tbeg < tend 20: Starting “hourly consumption” HCoo (energy consumption per hour) 21: for iappliance 1 to the size of the configuration of the appliances do i 22: Set tbeg i i 23: Set tend based on Li y tbeg 24: for ihour time to total number of hours do i , t i ] then 25: if ihour belongs to the interval [tbeg end 26: HCo(ihour) ← HC (ihour) + Ai (vDit ) 27: else 28: HCo(ihour) ← HCo(ihour) + Ai (fDit ) 29: end if 30: end for 31: end for 32: RW t Demanded ← min(RW t , HCot ) 33: R1 = maximumslot(RW t s); that only renewable energy is used 34: R2 = maximumslot(HCot ); that peak consumption is minimal 35: overconsumptiont = RW t − HCot maximum peak and to take advantage of overconsumption for every hour 36: overconsumptiont (overconsumptiont < 0) = 0 37: result = Rx i ) 38: return result, RW t Demanded , HCot (tsched

3.3 Demand Aggregation Algorithms

29

Algorithm 2 Round-robin strategy (RR). 1: Generate parameters for consumer allocation 2: Define the global variable RW 3: while (user) and (min(RW ) >= 0) do 4: if Optimization needs then 5: Load consumer preferences. Ai preference matrix size 6: Call optimization function on variable preferences: RW , Ai , N 7: Number of users ++ 8: if (RW equal to 0) then 9: Break 10: end if 11: end if(No consumer to optimize) 12: end while

Fig. 3.4 Scheduler structure, communications, and flows. Variables used: .vDi , .fDi , and .RWi . Source Adapted from [2]

[D]. Random first player/sequencing. The order is randomly selected. This may— or may not—introduce efficiency above Pareto efficiency, which is when resources are allocated to the maximum level of efficiency, and any change will make someone worse off. We implemented optimization methods based on the SA algorithm, GA, PS algorithm, and PSO algorithm to guide the search for a feasible demand reallocation solution, i.e., the closest local minimum strategy for Algorithm 1. 1. SA. This meta-heuristic algorithm determines an optimal solution by randomly searching the solution space to find a good approximation to the optimal

30

3 Demand Aggregation: System Architecture and Design

Table 3.3 Equivalences between SA and energy demand reallocation SA Combinational problem Solution .tsched Cost (objective function .DCF) Search Parameter control Optimal solution

Stage Energy Stage Temperature Minimal energy stage

Fig. 3.5 General SA algorithm structure. Source Adapted from [3]

value of a function in a high-dimensional search space, with the probability function modified during the process1 (Eq. 3.11). p(δE) = e

.

( K−δET ) B

(3.11)

SA implementation. Demand reallocation can be applied as a combinational problem taking into account the existing relationships between combinational logic and thermodynamic simulation (Table 3.3). Figure 3.5 depicts SA operation, which relies on a random search strategy to find a local minimum solution for the demand calculation function (.DCF), 1

The search of solutions is inspired by thermodynamic statistics. The laws of thermodynamics determine the probability of an increase in energy by a quantity ..E given by Eq. 3.11, where .kB is the Boltzmann constant.

3.3 Demand Aggregation Algorithms

31

Algorithm 3 Demand optimization based on the SA algorithm. 1: T > 0 initial parameter 2: N (T ) as maximum number of iterations 3: while stop criterion has not been fulfilled do 4: Randomly generate a quick solution. tsched i i 5: Evaluation tsched , D = f(tsched ) 6: n = 1 7: while n = 0 y u< exp((f(tsched . ) - f(tsched ))/T ) then i i 14: tsched = tsched . 15: end if 16: end if 17: n = n+1 18: end while i 19: T reduction and tsched updated 20: end while

which starts at an initial time .tsched per appliance (Algorithm 1). SA starts by generating a test point based on the current estimation and finds a new solution that considers the time constraint [.tbeg , .tend ]. The .tsched value is randomly generated and filtered by L. Regarding the best value of D, (.D = i . f(.tsched )), the original value .D. , .tsched . is accepted as the best solution if .D is less optimal than D. Once the internal counter threshold is reached, .T is modified, and the best solution is selected before the counter N is restarted. The complexity of Algorithm 3 increases exponentially with the number of possible per-appliance reassignments and operation times. Sometimes an optimal solution is not possible in a feasible time period, because, since SA is not based on solution sets, the solution may become trapped in local optima. 2. GA. The GA is mainly deployed to solve optimization problems according to natural selection, exploiting the ability of evolutionary operators to improve the quality of a solution. The GA can solve an optimization problem due to its stochastic nature and its effectiveness in performing a global search. While implementation does not involve many mathematical assumptions, perfor-

32

3 Demand Aggregation: System Architecture and Design

Fig. 3.6 General GA structure. Source Adapted from [3]

mance does not always guarantee an optimal solution. Figure 3.6 describes the general GA structure in terms of the following features: • It works with a solution that encodes and performs a search of possible solutions. • It uses an objective function called the fitness function instead of gradients or other supplementary data. • It deploys probabilistic transitions instead of deterministic rules, with operators acting during execution applied with a certain probability. GA implementation. The objective is to find an optimal operating time and solve the reallocation problem of minf(x) subject to the constraint [.tbeg , .tend ]. Each appliance comprises a set of features called chromosomes that can be mutated to reallocate better features than the initial features. GA finds a solution by starting with a random initial .tsched 2 population (Algorithm 4). The number of evaluations is increased when the method finishes by calculating a .P generation with feasible solutions for appliance scheduling (.tsched per appliance). The best .tsched is inserted into the best solution and the other solutions are discarded. Mutation or crossover operators can be used to generate the next evaluation of the current generation. A mutation operator, for instance, can randomly modify the scheduled start times (.tsched ) of some appliances to generate new solutions with better outcomes. 2

The algorithm creates a set of possible optimal solutions and a starting value is not required.

3.3 Demand Aggregation Algorithms

33

Algorithm 4 Demand optimization based on GA. 1: Generate solutions. Construct a set of P solutions. 2: while Number of evaluations < MaxEval do 3: Evaluation of solutions 4: Selection based on the quality of the solution (selection) 5: P is partially modified by applying mutation and crossover operation 6: Evaluation number ++ i 7: The valid constraint P for each tsched . Discard solutions that are disqualified. 8: end while Fig. 3.7 General PS algorithm structure. Source Adapted from [3]

3. PS. Also known as direct search, PS attempts to locate an optimal solution above the current point, and if located, this better solution becomes the new current point. PS implementation. Solutions are investigated around the current operation time (.tsched ), with the direction that will minimize Algorithm 1 determined from an initial .tsched value. As described in Algorithm 5, PS investigates, for each appliance, the nearest neighborhood of a possible solution in [.tbeg , .tend ]. The search for a better reallocation pos-

34

3 Demand Aggregation: System Architecture and Design

Algorithm 5 Demand optimization based on the PS algorithm. i 1: Initialize - predefined default search step .0 ; tsched y . = .0 2: while do i 3: D = (tsched + L*.) solution 4: Evaluation of nearest neighbors in D 5: if better in D then 6: Upgrade the current solution to the best neighbor in D; . = .0 7: else 8: reduction of the search step . = .0 /2 9: end if 10: end while

sibility, where L and D would reduce the .. search step, ends when the step is sufficiently shortened, which occurs with convergence to the local minimum consumption. The search continues activated until the iteration limit is reached (Fig. 3.7). 4. PSO. This stochastic evolutionary search method is based on the collective intelligence paradigm. Solutions, called particles in PSO, are reallocated guided by the particle that finds the best solution. PSO shares similarities with other evolutionary techniques, but the finetuned number of parameters is larger. Figure 3.8 depicts a flowchart of PSO, starting with a swarm size, i.e., a number of particles, randomly generated in the search space of the objective function. Particles exchange information on 3 attributes: position (a current position that represents a potential solution), velocity (a current velocity that controls speed and flight direction), and the value of the objective function (which determines their merit). After the information exchange, the probability of migration to regions with low values of the objective function is evaluated. Figure 3.9 illustrates PSO. Particles fly through the search space according to velocities obtained based on previous best positions. The characteristics of the particle with the best position in the swarm are determined, i.e., the particle that provides the minimum value of the objective function. Velocity calculation increases the probability of particle migration to the region with the lowest objective function. After each flight, particle positions are modified and their objective functions are evaluated for the updated positions. PSO implementation. Demand reallocation and the best position determine a minimum value for scheduled times by evaluating .DCF through various iterations. Algorithm 6 illustrates the search procedure, starting with particle generation and the assignment of velocities and positions. The system requires initialization with a candidate population of solutions that will → → x = .(xi1 , . . . , xij ) and .− v = .(vi1 , . . . , vij ) repswarm to the optimal result. .−

3.3 Demand Aggregation Algorithms

35

Fig. 3.8 General PSO structure. Source Adapted from [3]

Fig. 3.9 Illustration of particle optimization. Source Adapted from [3]

resent current position and current velocity. The application time is defined −→ −→ −→ as a set of lower and upper bounds for the operation .[tbeg , tend ], where .tbeg − → ij ij i1 i1 = .(tbeg , . . . , tbeg ), and .tend = .(tend , . . . , tend ).

36

3 Demand Aggregation: System Architecture and Design

Algorithm 6 Illustration of flight in PSO. 1: Starting from the particle population with random value positions in the search −→ −→ → space given consumption preferences − x ∼U[tbeg , tend ] − → − → 2: Place each particle in the position best known to its initial position p ← x − → − → − → 3: Initialize the velocity of each particle to random values v ∼U[−d , d ] where − → −→ −→ d = beg − end − → − → − → 4: Initialize the best known position g a x where f ( x ) is the lowest. For each particle evaluate the desired optimization of the fitness function. 5: while Termination condition not achieved do 6: for Each particle i do 7: if i > 1 then 8: Select two random numbers φp ,φg → → → → → → 9: Adapt speed − v ←ω− v + cp φp (− p -− x ) + cg φg (− g -− x) − → − → − → − → 10: Limits v for all dimensions i ( v , − d , d ) → → → 11: Update the particle position − x ←− x +− v −→ −→ − → 12: Population limits xi for all dimensions i ( x , tbeg , tend ) 13: end if → → 14: if f (− x ) < f (− p ) then → → 15: Update the best known position of the particle − p ←− x 16: end if → → 17: if f (− x ) < f (− g ) then → → 18: Update the best known position of the particle − g ←− x 19: end if 20: end for − → g has the best position found in the search space 21: 22: end while

3.4 Summary Smart communities are expected to become more efficient as consumers gain autonomy and improve self-organization in terms of reducing and reallocating energy consumption. Energy demand assessment helps the energy scheduler develop a sustainable energy-efficient plan for end users who are expected to play an active role in supply and demand management, and so move from being passive consumers to becoming active suppliers (prosumers). Programming their energy consumption means that consumers can reduce their energy costs and improve the ratio between peak and average consumption. Such communities can evolve further through incre-

References

37

mental demand automation and the integration of innovative digital and physical smart sensors and appliances. This chapter describes a novel energy demand scheduler for the residential sector that optimizes energy supply while benefiting the environment. The novelty lies mainly in its scalability, as it permits great flexibility in system configuration, while important aspects of aggregation capabilities and demand management are also explored that have the common goal of green consumption. The scheduler integrates the energy supply available from renewable resources in a process centralized through a community aggregator that processes, schedules, and optimizes community demand so as to maximize renewable energy consumption. Different heuristic techniques demonstrate demand scheduler capabilities, applicability, and flexibility benefits. A centralized scenario and a semi-decentralized scenario, each with their corresponding aggregation settings, are defined for resource reallocation, with the local component (i.e., the household) playing a key role. Consumers visualize their consumption and make optimal use of energy through automatically controlled smart appliances. The integration of local microgeneration technologies also plays an important role when the renewable supply is insufficient to meet demand.

References 1. C. Cruz, E. Palomar, I. Bravo, A. Gardel, Towards sustainable energy-efficient communities based on a scheduling algorithm. Sensors 19(18) (2019). https://doi.org/10.3390/ s19183973.https://www.mdpi.com/1424-8220/19/18/3973 2. C. Cruz, E. Palomar, I. Bravo, M. Aleixandre, Behavioural patterns in aggregated demand response developments for communities targeting renewables. Sustain. Cities Soc. 72, 103001 (2021). https://doi.org/10.1016/j.scs.2021.103001 3. C.C. de la Torre, Sistema cooperativo de planificacion de demanda de electricidad agregada: comunidades sostenibles que optimizan el consumo de renovables. Ph.D. thesis, Universidad de Alcala (2022)

Chapter 4

Evaluation of Scheduling Algorithms

Abstract After reading this chapter you should be able to: • • • •

Understand how to evaluate heuristic algorithms for demand optimization Understand the aggregation concept for energy management development Understand residential microgeneration and its impact on energy management Understand consumer behavior and its validation.

Recent directives encourage consumers to play an active role in the electricity system, including renewable energies, through aggregation programs, self-consumption, and storage. A wide variety of DR proposals promote energy use based on ICTs deployed by consumers. Although such proposals are beneficial for communities, consumer participation is still in the early demonstration and evaluation stages. In this context, implementing and validating an energy demand scheduler in a controlled scenario is crucial to understanding acceptance of cooperation-based systems. This chapter describes a methodology, based on 4 heuristic techniques, to evaluate a demand scheduler according to different consumption preferences and renewable energy availability factors and configurations, with the necessary resources estimated according to the required computation times for demand reallocation. The best consumer coalition for aggregation is explored, with the structure of the scheduling algorithm analyzed for a centralized scenario and a semi-decentralized scenario. Finally, factors are extracted to identify possible consumer behaviors and demand in terms of appliances is analyzed. Keywords Cooperative smart community · Scheduling algorithm · Consumer preferences · Renewable energy · Microgeneration · Performance evaluation · Consumption time

4.1 Performance Evaluation The computational cost of Algorithm 3 is evaluated by representing several possible scenarios configured by the factors described in Table 4.1, including community size, appliances and their distribution, preference elasticity, and demand and supply issues. The suitability of 4 heuristic techniques, namely, SA, PSO, GA, and PS, are © The Author(s), under exclusive license to Springer Nature Switzerland AG 2024 C. Cruz, Sustainable Energy Efficient Communities, The Springer Series in Sustainable Energy Policy, https://doi.org/10.1007/978-3-031-49992-0_4

39

40

4 Evaluation of Scheduling Algorithms

Table 4.1 Heuristic algorithm validation and pattern recognition for different scenarios Factors Value Description Experiments for scenarios with .< 5 consumers and scenarios .> 30 consumers. The number of consumers is not a determining factor in algorithm performance No. of appliances .< 40/Small, The number of appliances directly affects algorithm performance, which is faster for .> 1200/Large communities of .< 40 appliances Appliance S, D Same or different numbers of appliances per distribution household Variable demand .< 9 kWh/Low, .> 18 Reallocated demand volume potentially influences kWh/High performance, depending on renewable supply availability, volume, and flow Demand flow .σ .< 20 .% Flat, .σ .> Peak demand reflects 20% variability throughout the day 20 .% Peak Consumer flexibility .6 Consumer demand elasticity directly influences h/Mixed, .>6 demand reallocation efficiency. The 3 scenarios reflect consumer time preferences and operating h/Flexible flexibility Supply flow RW SD .< 20 .% Flat, SD The availability of renewable and variable resources may affect demand reallocation .> 20 .% Peak

Community size

.< .>

5/Small, 30/Large

evaluated for the 8 consumer cases reflected in Table 4.2. More flexible or altruistic communities are represented by cases 1, 3, 5, and 7, reflecting consumers with a wide range of time preferences (e.g., from 0 h to 23 h), whereas less altruistic or less flexible communities are represented by cases 2, 4, 6, and 8. Appliance run times are similar for both community types. The heuristic techniques and their behaviors are simulated on a local computer, and the experiments are based on identical input parameters. The experiments involve identifying the most influential factors in the demand reallocation process. Demand reallocation applies 4 different centralized scheduling strategies ([A], RR; [B], random RR; [C], first player always the same; or [D], random first player/sequencing) to determine optimal search efficiency (see Sect. 3.3).

4.1.1 Evaluation Using Heuristic Techniques Figures 4.1, 4.2, 4.3 and 4.4 depict the required computation times for the 8 cases and the 4 heuristic optimization techniques illustrated, by way of example. For illustrative purposes, strategy [C], i.e., the first consumer is always the same, is applied, but the example is also applicable to the other strategies. The [C] strategy is implemented over 24 h in all cases. The 8 cases reflect a large number of appliances and/or different

4.1 Performance Evaluation

41

Table 4.2 Simulation scenarios for the 4 heuristic techniques Community Appliance size N number A

Appliances Fixed distribution demand fd

Variable Consumer demand vd flexibility (CF)

RW Vector per hour

Case 1

.>

5 .< 30

.>

40 .< 1200

S

.


9

24 h

10

Case 2

.>

5 .< 30

.>

40 .< 1200

S

.


9

.L

10

Case 3

.>

5 .< 30

.>

40 .< 1200

D

.


9

24 h

10

Case 4

.>

5 .< 30

.>

40 .< 1200

D

.


9

.L

10

Case 5

.>

5 .< 30

.>

40 .< 1200

S

.


18

24 h

10

Case 6

.>

5 .< 30

.>

40 .< 1200

S

.


18

.L

10

Case 7

.>

5 .< 30

.>

40 .< 1200

D

.


18

24 h

10

Case 8

.>

5 .< 30

.>

D

.


18

.L

10

40 .< 1200

(a)

(b)

Fig. 4.1 Comparison of SA, PSO, GA, and PS for the same number of appliances for low power consumption over 24 h (a) and . L (b). Source Adapted from [17]

appliance distributions, and highly flexible consumer preferences regarding time. Broadly speaking, the less flexible communities (i.e., cases 2, 4, 6, and 8) obtain better results in terms of reallocation than the more altruistic communities (i.e., cases 1, 3, 5, and 7). Reallocation time is slightly higher when consumer variable demand is high (Figs. 4.1 and 4.2), and when consumers schedule a different number of appliances (Figs. 4.3 and 4.4). More flexible communities with high variable demand also result efficient when applying the SA technique.

42

4 Evaluation of Scheduling Algorithms

(a)

(b)

Fig. 4.2 Comparison of SA, PSO, GA, and PSfor different numbers of appliances and low variable consumption over 24 h (a) and . L (b). Source Adapted from [17]

(a)

(b)

Fig. 4.3 Comparison of SA, PSO, GA, and PS for the same number of appliances and high variable consumption over 24 h (a) and . L (b). Source Adapted from [17]

(a)

(b)

Fig. 4.4 Comparison of SA, PSO, GA, and PS for different numbers of appliances (a) and . L (b). Source Adapted from [17]

4.1 Performance Evaluation

(a)

43

(b)

Fig. 4.5 Evaluation using different optimization techniques (a) and results for different numbers of appliances using SA (b). Source Adapted from [17]

As shown in Fig. 4.4 (red), with the [C] strategy, 30 min is required for demand reallocation. The PSO and GA techniques work with solution sets that achieve reallocation in less time, withPSO achieving the greatest efficiency (28 s). Figure 4.5a compares the 4 heuristic techniques with different consumer numbers, with PSO, PS. and GA achieving fast global optimal solutions. Figure 4.5b shows that computation time increases reallocation time in line with the number of appliances.

4.1.2 Evaluation Strategies This section evaluates the centralized sequential structure using the different scheduling strategies, i.e., [A], RR; [B], random RR; [C], first player always the same; or [D], random first player/sequencing. The computation cost is higher when consumers set very flexible demand requirements, when the number of consumers is high, and when the number of appliances is high. Compared to the other strategies, [C] obtains less efficient results while taking more time, [D] yields a similar cost to [C], and [A] and [B] reflect similar behaviors, with [B] an optimal strategy when a small number of less flexible consumers require low variable demand. More time is required for large communities with different numbers of appliances per consumer. In terms of reallocation, the highest times (exceeding 30m) are obtained for [C], combined with high flexibility and different household distributions. [A] appears to be the most appropriate for demand reallocation.

44

4 Evaluation of Scheduling Algorithms

Fig. 4.6 RW compared for different cases applying the SA strategy. Source Adapted from [17] RW compared for cases 1-8

Figure 4.6 compares scheduled times, for the 8 scenarios (Table 4.2), using 2 simulated RW vector structures: a uniform RW vector and a heterogeneous RW vector (peaks) (the standard deviation (SD) for each time slot is set to 50%). The experiment, which applies the[B] scheduling strategy (random RR) and the SA technique, shows that the 2 RW vector structures require a similar time for communities of 5 to 30 consumers. Also analyzed for the 2 RW vector structures are the centralized and semidecentralized approaches for a wide range of demand factors. The outcome, depicted in Fig. 4.7 shows that the semi-decentralized approach requires greater reallocation time, while the flexible demand factors negatively influence the centralized model. The centralized configuration is usually more efficient, with some few exceptions

Fig. 4.7 Reallocation times compared for centralized and semi-decentralized scenarios considering key factors. Source Adapted from [19]

4.1 Performance Evaluation

45

Fig. 4.8 Used/surplus RW supply in a semi-decentralized environment for flexible, mixed, and rigid scenarios. Source Adapted from [19]

z z

(e.g., demanding communities with fixed preferences, or low demand reallocation capacity during peak demand hours), because the algorithm is configured every 24 h irrespective of the number of consumer preferences. The semi-decentralized approach is less efficient because the algorithm must be executed individually for each consumer; therefore, for several users requiring the service at the same time, the first consumer to access the RW vector locks it. Figure 4.8 shows that the semidecentralized approach generates 46% waste in the available supply in more flexible communities, i.e., with a large margin of flexibility in their preferences, and also illustrates a poor use of renewable resources in rigid communities, as compared to centralized adjustment.

4.1.3 Identifying Consumer Behaviors The aggregator is processed for scenarios and use cases to identify possible community behaviors and influential factors according to: • Demand volume: . A for high demand and . B for low demand • Demand flow, with algorithm robustness evaluated for.C, representing flat demand flow throughout the day, and. D, representing demand in specific periods generating demand peaks • Consumer flexibility, with elasticity preferences depending on the duration and preferred time period, and where . E, . F, and .G represent rigid, mixed, and flexible behaviors, respectively. • Supply flow, where . X represents uniform supply, and .Y represents consumption peaks. Behavioral patterns arise from consumer interactions and participation in the aggregation service. Aggregation efficiency depends on certain factors, as illustrated in Table 4.3, affecting reallocation in given time slots. Algorithm complexity varies

.E

.B

D

.Y

.E

.C

.X

Scenario High/Low demand Homog/fluct demand Homog/fluct RW

2

.B

1

Combinations/ Cases

.X

.C

.B

.E

3

.Y

D

.B

.E

4

.X

.C

A

.E

5

Y

D

A

.E

6

.X

.C

A

.E

7

.Y

.C

A

.E

8

Table 4.3 Combinations of cases used for behavioral analyses

.X

D

.B

.F

9

.Y

.C

.B

.F

10

.X

.D

.B

.F

11

Y

.C

.B

.F

12

.X

.D

.A

.F

13

.Y

.C

.A

.F

14

.X

.D

.A

.F

15

Y

.C

.A

.F

16

.X

.D

.B

.F

17

.Y

.C

.B

.G

18

.X

.D

.B

.G

19

.Y

.C

.B

.G

20

.X

.D

.B

.G

21

.Y

.C

.A

.G

22

.X

.D

.A

.G

23

.Y

.C

.A

.G

24

46 4 Evaluation of Scheduling Algorithms

4.1 Performance Evaluation

(a)

47

(b)

Fig. 4.9 Ratio of required reallocation times between the number of consumers and SA in a centralized environment (a). Impact of demand volume over time for different consumer flexibility and demand flow scenarios (b). Source Adapted from [19]

according to the different scenarios, the number of appliances, and the number of consumers, with computation cost increasing proportionally with the number of appliances (Fig. 4.9a). The impact of demand volume and flow is shown in experiments with different consumer flexibility levels and demand scenarios. High demand, peak demand, and high flexibility (.G AD−) represent the upper bounds of the aggregation algorithm (Fig. 4.9b). Consumer flexibility parameters like the duration of appliance operation (. L) can add complexity to the optimal search for shared resources. Figure 4.10 depicts optimal reallocation in a flexible scenario (32.5% of scheduled demand). A lower bound of 0.8% defines when consumers do not express their flexibility (i.e., . E AC). The reallocated time is also influenced by demand peaks, most especially in flexible scenarios. Figure 4.11 shows that shared renewable resources are quickly reallocated in rigid communities. Optimal reallocation is more timeconsuming with high flexibility, as the reallocation search space is larger. The flexibility ratio therefore has a significant impact on computational cost: the average delay for a low flexibility ratio is 15 s, an hour is required to achieve optimal reallocation, and more than 40% of resources are required for a high flexibility ratio. Flexible communities are thus more computationally costly than rigid communities. The experiments show that a high number of consumers, high demand volume, and flexible settings (especially short-term values) have a negative impact on reallocation performance. High flexibility is correlated with shorter operation time intervals, as demand reallocation increases the complexity of a new reallocation process, and so extends the time needed to locate the optimal solution. Figure 4.12 illustrates reallocation cost for renewable resource availability considering 3 RW vector struc-

48

4 Evaluation of Scheduling Algorithms Degree of demand reallocation ( %)

32,5

Flexible

15,34

Mixed

0,83

Rigid

0

10

20

30

40

Fig. 4.10 Required times for 3 consumer behaviors. Source Adapted from [49]

Fig. 4.11 Impact of consumer flexibility on all combinations of factors, including RW supply. Source Adapted from [19]

tures, demand volumes and flows (including a case of insufficient supply). Peak hour requirements and high demand (.−AD−) require longer reallocation times, while uniform demand allows adjustment to any potential disruption or imbalance in renewable supply.

4.1.4 Microgeneration Evaluation Analyzed below is aggregation that includes prosumers in the reallocation process, specifying how aggregate demand is affected in controlled scenarios. The microgeneration level is based on the daily demand profile for household solar PV production

4.1 Performance Evaluation

49

Fig. 4.12 Impact of renewable supply flow for RW scenarios by volume and flow. Source Adapted from [49]

[28]. The prosumer sends their PV production to the aggregator for its administration with the RW vector obtained from the utility ([20]). The analysis reflects consumers sending their preferences when renewable supply is sufficient, when renewable supply is insufficient, and for different demand preferences and RW renewable resources. Table 4.4 summarizes the results for the reallocated demand and indicates the necessary fossil-fuel resources for 3 possible scenarios: 1. Sufficient RW renewable supply (green) throughout the entire time period to supply the community (blue). Demand is reallocated according to consumer preferences by reducing peak consumption (red). Figures 4.13a and b show reallocated demand achieved without recourse to fossil fuels for communities with flexible and mixed preferences, respectively.

Table 4.4 Demand reallocation in flexible and mixed scenarios for sufficient/insufficient RW and PV provision Reallocation Flexible scenario Mixed scenario Fossil (%) resources No. of prosumers with PV resources Sufficient RW Sufficient RW and PV provision Insufficient RW Insufficient RW and PV provision

2

3

2

3

Flex/Mix

45% 57%

61%

61%

12%

12%

0% 0%

70% 73%

72%

71%

67%

68%

2%/13% 1%/11%

50

4 Evaluation of Scheduling Algorithms

(a)

(b)

Fig. 4.13 Demand reallocation (W) in a flexible scenario (a) and in a mixed scenario (b) with a sufficient supply of renewable RW. Source Adapted from [49]

Energy demand (kW)

60 50 40 30 20 10 0 0

5

10

15

20

25

Hour

(a)

(b)

Fig. 4.14 Demand reallocation (W) in a flexible scenario (a) and in a mixed scenario (b) with an insufficient supply of renewable RW. Source Adapted from [49]

2. Insufficient RW supply in some time slots that leads reallocation to reduce peak demand in the flexible scenario (Fig. 4.14a) by up to 70%, maximizing the RW vector. Demand reallocation is increased up to 13% for enough RW, and fossil-fuel energy is required to meet community demand (up to 2%). In the mixed scenario, up to 13% fossil-fuel energy is required (Fig. 4.14b). However, the 2 main consumption peaks are reduced due to a 48% increase in reallocation capabilities. 3. Inclusion of household PV production. Figures 4.15a and b depict demand reallocation when prosumers send PV production to the aggregator but with little impact on the reallocation process, e.g., for the flexible scenario, barely 3% of reallocated demand is exceeded if 2 or 3 consumers send PV production to the aggregator.

4.2 Summary

51

(a)

(b)

Fig. 4.15 Demand reallocation in a flexible scenario (a) and in a mixed scenario (b) with insufficient renewable RW and consumer PV supplies. Source Adapted from [49]

An increase in prosumers sending their PV production does not optimize aggregated resources, as provision is always available in the same time slot. This represents a limitation of the PV system itself, i.e., non-reallocation to other time slots. This problem could be overcome by including a storage and stage redistribution system. However, residential PV generation negatively affects the aggregator’s profits ([14]), as investment in storage is not profitable considering battery useful life and degradation patterns. Furthermore, consumers without on-site energy technologies benefit more than owners of PV storage systems ([53]). Pilot experiments focused on local prosumer participation facilitate the dissemination and viability of self-production systems. One way to modify this trend is to promote strict self-supply since the exported kWh price is lower than its generation cost ([35]).

4.2 Summary The chapter describes algorithm validation using 4 techniques (SA, PSO, GA, and PS), starting from aggregation of total consumer demand 24 h in advance. The required time for demand reallocation varies depending on the number of appliances and consumer flexibility. In terms of computation times, PSO yields optimal results if compared to SA. As for the different scheduling strategies ([A],RR; [B], random RR; [C] first player always the same; and [D], random first player/sequencing), [A] appears to function best in the demand scheduler. Consumer behavior is also analyzed in depth, by evaluating aggregation performance by demand reallocation in different scenarios considering factors such as demand volume and consumer flexibility. Real data is used for expert analysis of all possible factors as well as their impact on performance in different scenarios in order to extract patterns. Consumer flexibility in defining time intervals greatly influences algorithm performance. Highly flexible communities are computationally

52

4 Evaluation of Scheduling Algorithms

more costly (35 s for 5 consumers with 48 appliances each), although the renewable supply is efficiently reallocated. In classifying energy behavior, the aggregator improves the reallocation of renewable resources, most especially for consumers with flexible demand preferences. Therefore, and related to the consumer need for leverage, DR strategies shaped around behaviors can help manage energy consumption and expenditure in a community. Flexible consumer behavior, for instance, improves sustainability, efficiency, and responsiveness in the community. The demand scheduler classifies unknown consumption patterns by their energy. In the best-case scenario, renewable resource management is improved by more than 40%. The scheduler manages resources better in centralized communities, most especially when consumers are highly flexible in their preferences. Finally, microgeneration by the prosumer optimizes demand reallocation when insufficient renewable resources are provided by the service provider. Enough RW provision always achieves a positive effect in reallocation (an increase of 12% and 5% in the flexible and mixed scenarios, respectively), while PV provision benefits reallocation of insufficient renewable resources. A flexible scenario that integrates PV increases the reallocation demand by up to 28% to mitigate RW scarcity, while fossil-fuel energy is hardly used in certain time slots (only 2%). The worst-case situation is a mixed scenario with insufficient RW. While PV provision benefits reallocation in cases of insufficient RW, an increase in consumer PV energy does not optimize the resources of the aggregator. Homes equipped with microgeneration systems should be given priority in reallocating energy, as this would encourage the rest of the coalition to install microgeneration systems and so participate in the aggregation scheme.

Appendix Datasets with appliances and their usage times are available that enable validation of the aggregation algorithms and of behavior patterns.. The main data used are described below: The Reference Energy Disaggregation Data Set (REDD) is an energy disaggregation benchmark dataset, originally published by the Massachusetts Institute of Technology, based on readings and data for 6 households in Massachusetts (USA). At the household level, the main circuits contain 15 kHz current and voltage, and at the residential level, each individual circuit measures low-frequency (3–4s) power readings. Readings are collected from 5 household types. Figure 4.16 presents appliance activity data and consumption patterns for a REDD household.

Appendix

53

800

Appliances' activity

700

Demand (W)

600 500 400 300 200 100

00:00

6:00

12:00 (b)

18:00

00:00

00:00

6:00

12:00

18:00

00:00

Demand (W)

(a)

00:00

6:00

12:00 (c)

18:00

00:00

(d)

Fig. 4.16 Energy demand in a REDD household (a), appliance activity (b), consumption per day (c), and appliance consumption (d). Source Adapted from [49]

• Household 1. Monday to Thursday, activity from 7:00–9:00 h. Monday, activity from 18:00 h. Friday, low activity. Saturday and Sunday, high activity from 10:00 h. • Household 2. Medium to high and very distributed activity during the night. Possible sleep disturbance. Activity distributed during the day, with possible workfrom-home activity. • Household 3. Friday and Saturday afternoons, low activity. Monday to Friday, medium activity at the same time of day. • Household 4. Evenings, medium to high activity, except Fridays, Saturdays, and Sundays. Activity distributed throughout the day. • Household 5. High activity from 18:00 h onward, except on Saturdays when activity moves to the evening. Tuesdays and Thursdays, especially high evening activity (a possible evening work routine). The National Renewable Energy Laboratory (NREL) dataset [38] includes electricity demand profiles for 200 households randomly selected from those available in the USA Midwest region. The profiles (using modeling proposed by [37]) reflect realistic patterns of residential energy consumption, validated using metered data, with a time resolution of 10m. Households vary in size and number of occupants, and the profiles represent total electricity use (in W) (see Fig. 4.17).

54

4 Evaluation of Scheduling Algorithms

Fig. 4.17 Average consumption demand aggregated for 200 NREL households

Fig. 4.18 Renewable generation for NREL data

NREL Solar Resource Data [38] is a synthetic solar PV plant dataset for the US (Fig. 4.18). Data is intended for transmission and utility schedulers conducting solar integration studies and needing to estimate the energy production of hypothetical solar plants. The dataset consists of annual 5m solar power data and hourly forecasts for the next day for approximately 6,000 simulated PV plants. NREL generates dayahead solar forecast data for eastern US locations using the Weather Research and Forecasting model. Finally, the UKDALE dataset [30] contains energy demand data for 5 households, with household energy demand and individual appliance demands recorded every 6 s. Figure 4.19 depicts the typical consumption patterns for 2 smart appliances in a UKDALE household. Figure 4.20 shows a distribution of appliance demand and disaggregation. Demand preferences are profiled by the consumption patterns in

Appendix

Fig. 4.19 Example consumption patterns for 2 UKDALE appliances

Fig. 4.20 Example distribution of energy demand values for a UKDALE household

55

56

4 Evaluation of Scheduling Algorithms

Fig. 4.21 Example energy demand patterns for appliances in a UKDALE household

various datasets. Figure 4.21 shows demand histograms for household 1 corresponding to the daily demand patterns of 9 appliances. Finally, Table 4.5 shows the average estimated and standby energy per appliance and the estimated operating times.

Appendix Table 4.5 Energy usage by common household appliances

Source Adapted from [49]

57

58

4 Evaluation of Scheduling Algorithms

References 1. N. Ali, F. Radzi, A. Ja’afar, N. Abdul Hamid, T. Saleh, Home automation monitoring system based on internet-of-things application. J. Phys. Conf. Ser. 1502, 012041 (2020) 2. M. Amer, M.A. El-Zonkoly, N. Aziz, N. M’Sirdi, Smart home energy management system for peak average ratio reduction. Ann. Univ. Craiova (2015) 3. N. Andreadou, M.O. Guardiola, G. Fulli, Telecommunication technologies for smart grid projects with focus on smart metering applications. Energies 9(5), (2016). https://doi.org/10. 3390/en9050375, https://www.mdpi.com/1996-1073/9/5/375 4. J. Aradindh, V.B. Srevarshan, R. Kishore, R. Amirthavalli, Home automation in IOT using 6lowpan. Int. J. Adv. Comput. Eng. Netw. 5, p 3, 2320–2106 (2017) 5. Arduino, Arduino (2021), https://www.arduino.cc. Accessed 28 Mar 2021 6. G. Artale, A. Cataliotti, V. Cosentino, D.D. Cara, R. Fiorelli, S. Guaiana, N. Panzavecchia, G. Tinè, A new plc-based smart metering architecture for medium/low voltage grids: feasibility and experimental characterization. Measurement 129, 479–488 (2018) 7. Bambooenergy, Agregadores y minoristas independientes que administran de manera eficiente los recursos de flexibilidad distribuidos (2022), https://bambooenergy.tech/es. Accessed 30 Jun 2021 8. K. Baraka, M. Ghobril, S. Malek, R. Kanj, A. Kayssi, Low cost arduino/android-based energyefficient home automation system with smart task scheduling, in Proceedings of the 2013 Fifth International Conference on Computational Intelligence, Communication Systems and Networks, IEEE Computer Society, Washington, DC, USA, CICSYN ’13, pp. 296–301 (2013). https://doi.org/10.1109/CICSYN.2013.47, https://doi.org//CICSYN.2013.47 9. N. Batra, J. Kelly, O. Parson, H. Dutta, W. Knottenbelt, A. Rogers, A. Singh, M. Srivastava, Nilmtk: an open source toolkit for non-intrusive load monitoring, in Proceedings of the 5th International Conference on Future Energy Systems, Association for Computing Machinery, New York, NY, USA, e-Energy ’14, pp. 265–276 (2014). https://doi.org/10.1145/2602044. 2602051 10. J. Bergstra, B. Komer, C. Eliasmith, D. Yamins, D.D. Cox, Hyperopt: a python library for model selection and hyperparameter optimization. Comput. Sci. & Discov. 8(1), 014008 (2015) 11. B. Bilgin, V. Gungor, Performance evaluations of ZigBee in different smart grid environments. Comput. Netw. 56(8), 2196–2205 (2012). https://doi.org/10.1016/j.comnet.2012.03.002 12. L. Breiman, Random forests. Mach. Learn. 45(1), 5–32 (2001) 13. N. Casa, Home-assistant-amber (2021), https://www.crowdsupply.com/nabu-casa/homeassistant-amber. Accessed 01 Nov 2021 14. B. Celik, S. Suryanarayanan, R. Roche, T.M. Hansen, Quantifying the impact of solar photovoltaic and energy storage assets on the performance of a residential energy aggregator. IEEE Trans. Sustain. Energy 11(1), 405–414 (2020). https://doi.org/10.1109/TSTE.2019.2892603 15. M. Claesen, B.D. Moor, Hyperparameter search in machine learning (2015), arXiv:abs/1502.02127 16. M. Collotta, G. Pau, A solution based on bluetooth low energy for smart home energy management. Energies 8(10), 11916–11938 (2015). https://doi.org/10.3390/en81011916 17. C. Cruz, E. Palomar, I. Bravo, A. Gardel, Towards sustainable energy-efficient communities based on a scheduling algorithm. Sensors 19(18), (2019). https://doi.org/10.3390/s19183973, https://www.mdpi.com/1424-8220/19/18/3973 18. C. Cruz, E. Palomar, I. Bravo, A. Gardel, Cooperative demand response framework for a smart community targeting renewables: testbed implementation and performance evaluation. Energies 13(11), (2020). https://doi.org/10.3390/en13112910, https://www.mdpi.com/19961073/13/11/2910 19. C. Cruz, E. Palomar, I. Bravo, M. Aleixandre, Behavioural patterns in aggregated demand response developments for communities targeting renewables. Sustain. Cities Soc. 72, 103001 (2021). https://doi.org/10.1016/j.scs.2021.103001 20. C. Cruz, T. Alskaif, E. Palomar, I. Bravo, Prosumers integration in aggregated demand response systems. Energy Policy 182, 113745 (2023). https://doi.org/10.1016/j.enpol.2023.113745

References

59

21. D. Dinculeana, X. Cheng, Vulnerabilities and limitations of MQTT protocol used between IoT devices. Appl. Sci. 9(5), (2019). https://doi.org/10.3390/app9050848, https://www.mdpi.com/ 2076-3417/9/5/848 22. R. D’hulst, W. Labeeuw, B. Beusen, S. Claessens, G. Deconinck, K. Vanthournout, Demand response flexibility and flexibility potential of residential smart appliances: experiences from large pilot test in Belgium. Appl. Energy 155, 79–90 (2015) 23. X. Fang, N. Wang, T.A. Gulliver, A PLC channel model for home area networks. Energies 11, 3344 (2018). https://doi.org/10.3390/en11123344 24. J. Fletcher, W. Malalasekera, Development of a user-friendly, low-cost home energy monitoring and recording system. Energy 111, 32–46 (2016) 25. C. Gercek, W. Schram, I. Lampropoulos, W. van Sark, A. Reinders, A comparison of households’ energy balance in residential smart grid pilots in the Netherlands. Appl. Sci. 9, 2993 (2019). https://doi.org/10.3390/app9152993 26. S.N. Han, Q.H. Cao, B. Alinia, N. Crespi, Design, implementation, and evaluation of 6lowpan for home and building automation in the internet of things, in 2015 IEEE/ACS 12th International Conference of Computer Systems and Applications (AICCSA), pp. 1–8 (2015). https://doi.org/ 10.1109/AICCSA.2015.7507264 27. J. Huang, F. Qian, A. Gerber, Z.M. Mao, S. Sen, O. Spatscheck, A close examination of performance and power characteristics of 4G LTE networks, in Proceedings of the 10th International Conference on Mobile Systems, Applications, and Services, Association for Computing Machinery, New York, NY, USA, MobiSys ’12, pp. 225–238 (2012). https://doi.org/10.1145/2307636. 2307658 28. IEA, Example of daily load profile for solar PV production relative to electricity demand in 2050, IEA, Paris (2021), https://www.iea.org/. Accessed 26 Jul 2021 29. M. Iglesias-Urkia, A. Orive, A. Urbieta, Analysis of CoAP implementations for industrial internet of things: a survey. Procedia Comput. Sci. 109, 188–195 (2017). https://doi.org/10.1016/j. procs.2017.05.323, http://www.sciencedirect.com/science/article/pii/S1877050917309870. in 8th International Conference on Ambient Systems, Networks and Technologies, ANT-2017 and the 7th International Conference on Sustainable Energy Information Technology, SEIT 2017, 16–19 May 2017, Madeira, Portugal 30. J. Kelly, W. Knottenbelt, The UK-DALE dataset, domestic appliance-level electricity demand and whole-house demand from five UK homes. Sci. Data 2(150007), (2015). https://doi.org/ 10.5286/UKERC.EDC.000004 31. C.B. Kobus, E.A. Klaassen, R. Mugge, J.P. Schoormans, A real-life assessment on the effect of smart appliances for shifting households’ electricity demand. Appl. Energy 147, 335–343 (2015) 32. A. Larmo, A. Ratilainen, J. Saarinen, Impact of CoAP and MQTT on NB-IoT system performance. Sensors 19(1), (2018). https://doi.org/10.3390/s19010007, https://www.mdpi.com/ 1424-8220/19/1/7 33. J. Leithon, S. Werner, V. Koivunen, Cost-aware renewable energy management: centralized vs. distributed generation. Renew. Energy 147, 1164–1179 (2020) 34. A. Mahmood, N. Javaid, S. Razzaq, A review of wireless communications for smart grid. Renew. Sustain. Energy Rev. 41, 248–260 (2015). https://doi.org/10.1016/j.rser.2014.08.036 35. P. Mir-Artigues, P. del Río, Prosumers’ behavior under a regulation that encourages strict selfsufficiency. The case of Spanish photovoltaic micro-generation. Energies 14(4), (2021). https:// doi.org/10.3390/en14041114, https://www.mdpi.com/1996-1073/14/4/1114 36. MITMA, Ministerio de transportes, movilidad y agenda urbana (2022), https://www.mitma. gob.es. Accessed 30 Jun 2021 37. M. Muratori, M. Roberts, R. Sioshansi, V. Marano, G. Rizzoni, A highly resolved modeling technique to simulate residential power demand. Appl. Energy 107, 465–473 (2013). https:// doi.org/10.1016/j.apenergy.2013.02.057 38. NREL, [Residential profiles Dataset] (2020), https://data.nrel.gov/system/files/69/ResidentialProfiles.xlsx. Accessed 01 May 2021

60

4 Evaluation of Scheduling Algorithms

39. A. Palmieri, P. Prem, S. Ranise, U. Morelli, T. Ahmad, MQTTSA: a tool for automatically assisting the secure deployments of MQTT brokers, in 2019 IEEE World Congress on Services (SERVICES), vol. 2642 (IEEE, 2019), pp. 47–53 40. E. Palomar, I. Bravo, C. Cruz, Household energy demand management, pp. 65–92 (2023). https://doi.org/10.1002/9781119899457.ch3 41. R.C. Parocha, E.Q.B. Macabebe, Implementation of home automation system using OpenHAB framework for heterogeneous IoT devices, in 2019 IEEE International Conference on Internet of Things and Intelligence System (IoTaIS), pp. 67–73 (2019). https://doi.org/10.1109/ IoTaIS47347.2019.8980370 42. M.S. Piscitelli, S. Brandi, A. Capozzoli, Recognition and classification of typical load profiles in buildings with non-intrusive learning approach. Appl. Energy 255, 113727 (2019). https:// doi.org/10.1016/j.apenergy.2019.113727 43. M.A. Quintana-Suárez, D. Sánchez-Rodríguez, I. Alonso-González, J.B. Alonso-Hernández, A low cost wireless acoustic sensor for ambient assisted living systems. Appl. Sci. 7(9), (2017). https://doi.org/10.3390/app7090877, https://www.mdpi.com/2076-3417/7/9/877 44. M.U. Qureshi, A. Girault, M. Mauger, S. Grijalva, Implementation of home energy management system with optimal load scheduling based on real-time electricity pricing models, in 2017 IEEE 7th International Conference on Consumer Electronics—Berlin (ICCE-Berlin), pp. 134–139 (2017). https://doi.org/10.1109/ICCE-Berlin.2017.8210612 45. Y. Saleem, N. Crespi, M.H. Rehmani, R. Copeland, Internet of things-aided smart grid: technologies, architectures, applications, prototypes, and future research directions. IEEE Access (2019) 46. B. Shakerighadi, A. Anvari-Moghaddam, J.C. Vasquez, J.M. Guerrero, Internet of things for modern energy systems: state-of-the-art, challenges, and open issues. Energies 11(5) (2018). https://doi.org/10.3390/en11051252, https://www.mdpi.com/1996-1073/11/5/1252 47. R. Stamminger, V. Anstett, The effect of variable electricity tariffs in the household on usage of household appliances (2013) 48. Y. Syafarinda, F. Akhadin, Z.E. Fitri, B. Widiawan, Yogiswara, E. Rosdiana, The precision agriculture based on wireless sensor network with MQTT protocol. IOP Conf. Ser. Earth Environ. Sci. 207, 012059 (2018) 49. C.C. de la Torre, Sistema cooperativo de planificacion de demanda de electricidad agregada: comunidades sostenibles que optimizan el consumo de renovables. Ph.D. thesis, Universidad de Alcala, 2022 50. M. Yigit, V.C. Gungor, G. Tuna, M. Rangoussi, E. Fadel, Power line communication technologies for smart grid applications: a review of advances and challenges. Comput. Netw. 70, 366–383 (2014). https://doi.org/10.1016/j.comnet.2014.06.005 51. L.A. Zadeh, G.J. Klir, B. Yuan, Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems: Selected Papers, vol. 6 (World Scientific, 1996) 52. R. Zafar, A. Mahmood, S. Razzaq, W. Ali, U. Naeem, K. Shehzad, Prosumer based energy management and sharing in smart grid. Renew. Sustain. Energy Rev. 82, 1675–1684 (2018). https://doi.org/10.1016/j.rser.2017.07.018 53. B. Zakeri, G.C. Gissey, P.E. Dodds, D. Subkhankulova, Centralized vs. distributed energy storage—benefits for residential users. Energy 236, 121443 (2021). https://doi.org/10.1016/j. energy.2021.121443, https://www.sciencedirect.com/science/article/pii/S0360544221016911 54. X. Zhang, J. Shen, T. Yang, L. Tang, L. Wang, Y. Liu, P. Xu, Smart meter and in-home display for energy savings in residential buildings: a pilot investigation in shanghai, china. Intell. Build. Int. 1–25 (2016). https://doi.org/10.1080/17508975.2016.1213694

Chapter 5

Behavioral Analysis and Pattern Validation

Abstract After reading this chapter you should be able to: • • • •

Understand the different ML techniques applied to energy demand management Understand the main tools available for demand aggregation and forecasting Apply different behavioral analyses to energy pattern classification Understand demand forecasting at the individual and aggregated demand levels.

Encouraging consumers in responsible consumption is essential to sustainable energy use. Effective demand-side planning is based on categorizing consumers and their demand behaviors and in-depth analysis of reallocation responses. Consequently, major streams in residential energy consumption research are ecological trends and consumer behaviors. This chapter analyzes consumption linkages, estimates energy footprints according to consumer preferences, describes the analysis and definition of the behavioral patterns of consumers participating in aggregated DR services, and demonstrates how consumer profiles can influence validation of these services. Categorizing consumers according to their demand preferences and understanding consumption in different scenarios improves planning and decision-making by both the consumer and the energy manager. Also described is optimal demand forecasting based on clustering models. Keywords Demand response · Aggregated demand scheduling · Load patterns · Flexibility impact · Cluster analysis · Automatic demand profiling

5.1 ML Techniques The recognition of social and behavioral factors is fundamental to understanding and optimizing a DR system, and is key to the satisfactory performance of aggregation services. Consumer behavior in terms of consumption patterns is a major uncertainty in DR systems that complicates accurate estimation of responses and energy demand. Pattern identification can help determine the platforms, market rules, and incentives that are most effective for each community, and can also provide valuable information on how a community might respond to future demand challenges. © The Author(s), under exclusive license to Springer Nature Switzerland AG 2024 C. Cruz, Sustainable Energy Efficient Communities, The Springer Series in Sustainable Energy Policy, https://doi.org/10.1007/978-3-031-49992-0_5

61

62 Fig. 5.1 Main ML techniques applied in the smart community context

5 Behavioral Analysis and Pattern Validation

Supervised learning

> Labeled data > Direct feedback > Predict outcome/future

> No tags Non supervised > No comments > Find the hidden structure in learning the data

Reinforced learning

> Decision process > Reward system > Action learning

ML, one of the pillars of ICTs applied across the whole DR spectrum, helps identify consumer behaviors and validate established patterns in datasets. The main ML techniques are based on algorithms that can automatically learn from data and observations to provide tools for prediction, regression, classification, and efficient control in distributed systems. The fact that these algorithms improve performance in line with the number of features in the dataset allows for great flexibility in optimally finetuning models to make them more robust and compatible with any dataset. ML techniques are used for computation tasks when the design and programming of explicit rule-based algorithms is not feasible. Figure 5.1 shows 3 approaches to analysis: (1) unsupervised, with no labeled data, aimed at deducing the natural structure in a set of training samples; (2) supervised, with labeled data and carried out with prior knowledge (i.e., knowledge of the correct answer), aimed at computing classification accuracy; and (3) reinforced learning, aimed at exploring and acquiring data by interacting in its environment.

5.2 Demand Segmentation and Forecasting Tools Demand forecasting allows for real-time long-term planning, ensuring better aggregation. Clustering and segmentation techniques can be deployed to identify households for DR programs, based on their demand or consumption data. Categorization by similarity is viewed as an area of application with great potential, as a system based on predictive models and scenarios can minimize energy demand and cost through flexible classification of a set of consumers. Grouping consumers according to similarity, i.e., based on demand data sorted by days or averaged over several weeks, is useful for TOU tariffs and consumption elasticity rankings, can be based on unsupervised or supervised algorithms.

5.3 Behavioral Pattern Analysis

63

Unsupervised learning techniques process unlabeled or raw data to identify similar clusters. Consumers are clustered using self-organizing maps, and similar shapes are located that reflect consumption patterns. Hybrid clustering techniques can be used to establish clusters of consumers. The main goal is usually to reduce peak consumption. Methods include k-means, which partitions a dataset into clusters and calculates a mean for each, KNN, which uses available data to classify new data by a majority vote of neighbors, and PCA, which reduces data dimensionality while preserving essential information. As for supervised learning techniques, these are mainly regression and classification methods. They require labeled data in order to identify features in demand profiles, such as locally distributed energy resources (e.g., generation sources, electric vehicles). Consumption habits vary significantly due to variables such as the weather, activity patterns, occupancy patterns, household size, heterogeneous consumer behavior, etc, so it is important to deploy techniques according to individual demand levels or certain degrees of aggregation. Support vector machines (SVM) are widely used for daily consumption forecasting, and also often used to ensure security of electricity supply. Other methods used to predict aggregated consumption in DR systems are artificial neural networks (ANN), loosely inspired by the human brain, linear regression (LR), which accurately estimates peak demand when activity-related factors strongly influence consumption pattern (e.g., the number of consumers), and random forest (RF), which predicts individual consumption as influenced by certain factors (e.g., humidity, time, temperature, and social parameters) and has been successfully used in aggregation systems. Unsupervised and supervised ML techniques are discussed in greater detail below.

5.3 Behavioral Pattern Analysis A preliminary analysis of real consumption data for a community has been implemented for the NREL dataset, a centralized and publicly available resource consisting of electricity demand profiles for 200 randomly selected US households (validated with metered data at a resolution of 10 m) [2]. The households vary in size and number of occupants and the profiles represent total electricity use in watts (W). Figure 5.2 shows an example of a partial time series for NREL dataset consumption and renewable resource provision. The NREL Solar Power Data for Integration Studies are synthetic solar PV power plant data points for the US representing the year 2006 [3]. The estimated classification and regression capabilities of the scheduler are summarized as follows: 1. Classification of 3 behavioral patterns by expert analysis of the aggregation algorithm. 2. Classification of 3 behavioral patterns in different consumer community environments reflecting user-consumer interactions and flexibility. Unsupervised techniques automate analysis in these scenarios, as well as in datasets containing

64

5 Behavioral Analysis and Pattern Validation

Fig. 5.2 Time series of consumption (blue) and RW vector of supplied PV energy (red). Source Adapted from [1] Normalised consumption

Anual consumption 1.0 0.9

Normalised consumption

Consumption per hour (W)

25000

20000

15000

10000

0.8 0.7 0.6 0.5 0.4

5000

0.3 00:00

02:00

04:00

06:00

08:00

10:00

12:00

Time slot

( a)

14:00

16:00

18:00

20:00

22:00

00:00

02:00

04:00

06:00

08:00

10:00

12:00

Time slot

14:00

16:00

18:00

20:00

22:00

( b)

Fig. 5.3 NREL dataset. Annual consumption (a) and normalized annual consumption (b)

consumption records, with hourly consumption for a community of consumers over a year. 3. Evaluation of scenarios in supervised analyses overseen by an expert, with accuracy of up to 90% for classification into 3 similarity groups. 4. Identification of time variations in demand to predict community consumption. For the same dataset, regression models based on RF, SVM, and LR are evaluated and compared in the aggregator in terms of accuracy and computation times for various community demand clusters, achieving up to 95% prediction accuracy. Data preparation requires checking for missing values, assessing data quality, and checking for outliers. The final framework is a CSV file with 3 types of data: a timestamp reflecting time and date (i.e., YYYY–MM–DD hh:mm:ss); energy consumed in 10 m intervals; and forecast values of the RW vector. For the 200 households in the NREL dataset, Fig. 5.3 shows annual consumption and normalized annual consumption according to Eq. 5.1, which reduces redundancy and associates similar shapes. However, scaling consumption values does not

5.3 Behavioral Pattern Analysis

65

guarantee an optimal ranking, as while it might improve the performance of some algorithms, it worsens the performance of other algorithms. .

i X nor mali zed =

i x i − xmin i i xmax − xmin

(5.1)

where max(x) and min(x) are the maximum and minimum values.

5.3.1 Behavior Pattern Analysis A community of consumers yields different behavioral patterns, whose recognition and analysis can result in a better estimation of the community’s DR. Analysis serves to estimate the level of consumer engagement in DR, identify possible candidates for DR, determine demand level, predict consumption needs, and customize reward schemes according to recognized demand patterns. Behavior patterns analyzed using the PSO heuristic technique for a given number of consumers and preferences distinguish different scenarios in terms of reallocation times and the balance between demand and supply. The results show 3 different consumer behaviors and their influence on the community aggregation algorithm, as depicted in Figs. 5.4, 5.5, 5.6 and 5.7. Aggregated demand is depicted before (blue) and after (red) optimization in response to RW, and the available RW supply

Demand (W)

Reallocation of community demand

100

500 0

0

RW

1500

Energy (W)

200

No optimised demand Optimised

1000

1000 500 0

200

RW provided by supplier RW available by allocating standby power RW available after reallocation

100 0

0

5

10

15

20

25

0

5

10

15

(a)

20

25

(b)

Fig. 5.4 Demand for mixed and flexible communities (a) with high demand mainly in one time slot (.G AD X ) and (b) with low demand spread over the whole day (. F BCY ) 400 100 200

50 0

0 400

50

200 0

0 0

5

10

15

(a)

20

25

0

5

10

20

25

(b)

Fig. 5.5 Concerned behavior in a community comprising flexible consumers, with medium-low demand at a time of peak demand (.G B D X ), (a) with a homogeneous supply of RW and flexible and low demand (.G BCY ) (b)

Energy (W)

Demand (W)

66

5 Behavioral Analysis and Pattern Validation Reallocation of community demand

2000

10000 5000 0

0

RWvector status

4000

10000

2000 0

5000 0

5

10

15

20

25

0

0

5

10

(a)

15

20

25

(b)

Fig. 5.6 Busy behavior in a community with high demand in a rigid scenario, on a peak-hour basis (. E AD X ) with a flat supply of renewables (a), and with flat demand and a sufficient supply of renewables (. E ACY ) (b) 200

500

100 0

0

500

200 100

0

0

5

15

10

(a)

20

25

0

0

5

10

15

20

25

(b)

Fig. 5.7 Demanding behavior, in a mixed community with mostly peak time demand (. F AD X ) (a), and with less demand spread throughout the day (. F B D X ) (b)

is shown before (green) and after (yellow) fixed and variable demand allocation. The 3 consumer behavior patterns are as follows: Concerned behavior. This reflects low demand and high flexibility in consumption preferences, which are reallocated across the entire time slot. For instance, Fig. 5.5 exemplifies how the aggregator reduces peak demand and adjusts to periods when intermittent renewable energy is available. Busy behavior. This reflects high and flat demand that is inflexible throughout the day, meaning that reallocation adjustment is difficult. The aggregator has a small margin regarding the flattening of demand throughout the day and, with difficulty, allocates the available supply (Fig. 5.6). Demanding behavior. This reflects heterogeneous consumer flexibility, as illustrated in Fig. 5.7 for different renewable supply scenarios. The aggregator manages to efficiently reallocate consumption in peak periods, even with insufficient supply in some time slots. Figure 5.4a exemplifies high demand in specific time slots (e.g., during the night), whereas Fig. 5.4b illustrates low demand throughout the day and insufficient RW provision. The aggregator succeeds in reallocating demand over a broad time period, but the aggregator is unable to reallocate demand solely with renewables, and so needs to resort to fossil-fuel resources. Figure 5.5 illustrates flexible consumers with low demand, focused on a time slot, and with no extreme peaks of consumption. The aggregator reallocates demand by reducing peak consumption up to 50%. Specifically, Fig. 5.5a indicates a 40% peak

5.3 Behavioral Pattern Analysis

67

reduction for high demand preferences from 7:00h–16:00h. Despite high reallocation flexibility, peak demand is not completely reduced. In a context of high demand from 8:00h, the aggregator has a very small margin to homogeneously adjust demand over the entire time period (Fig. 5.6). Figure 5.7 illustrates reallocation behavior for a community with consumption peaks and a low balancing margin, and the aggregator is unable to avoid consumption peaks. Certain RW tranches are therefore likely to be exhausted due to the impossibility of reallocating demand. Renewable resources are efficiently managed by consumers with concerned behaviors, as exemplified by a reallocation margin of 30% compared to 1% for the busy behaviors. The results highlight the importance of defining temporal flexibility according to the time of day, as this provides opportunities for maintaining energy balance, reducing peak demand, and integrating renewable resources.

5.3.2 Unsupervised ML Analysis ML focuses on cluster classification or dimensional reduction, and is often used for unsupervised clustering when there is no prior knowledge of categories. An unknown data structure is explored with a view to extracting meaningful information without the guidance of a known outcome variable. The following unsupervised analyses are implemented: (1) k-means clustering, well suited to analyzing large-scale data set and their indices, determines an appropriate number for a household cluster; (2) k-prototypes, an extension of the k-means algorithm to categorical domains that clusters objects described by mixed attributes; (3) HC, often used to identify typical energy use profiles and to understand consumption characteristics, but having the drawback that it is computationally time consuming; and (4) PCA, which reduces the dimensionality of the data and so is useful when there is a lack of labeled data or when dealing with large-scale smart meter data. 1. K-means clustering is a data mining technique for pattern recognition studies that allows data to be organized into clusters without any prior knowledge. The clusters that emerge define groups that share a certain degree of similarity. Figure 5.8 shows the results obtained for the NREL dataset, consisting of hourly averaged demand profiles and segmented energy profiles determining strategies by type of consumer. The different colors reflect clusters of consumption patterns. Determining the number of clusters is more complex when data variability is great, with the optimal number of clusters subjectively dependent on the statistical method used. Clusters are obtained using the elbow method (which reflects the sum of the squared distances from each point to its assigned center), the average silhouette method (which measures the quality of a cluster), or the gap method (which deploys a Gaussian process for classification tasks). Households show a general increase in consumption throughout the day, but focused especially on the first hours (Fig. 5.8a). A common dynamic in consumption

68

5 Behavioral Analysis and Pattern Validation Cluster 1 Cluster 2 Cluster 3

20000 17500

Cluster 1 Cluster 2 Cluster 3

3500 3000

15000

Demand

Demand

2500

12500

2000

10000 1500 7500 1000

5000

500

2500 00:00

02:00

04:00

06:00

08:00

10:00

12:00

14:00

16:00

18:00

20:00

00:00

22:00

(a)

02:00

04:00

06:00

08:00

10:00

12:00

14:00

16:00

18:00

20:00

22:00

(b)

Fig. 5.8 k-means analysis describing 3 annual consumption patterns (a), and SD obtained for the 3 annual consumption patterns (b). Cluster 1, a pattern similar to concerned behavior (red), cluster 2, concerned-demanding behavior (blue), and cluster 3, a more heterogeneous demanding behavior (green). Source Adapted from [9] Household distribution

Household in cluster

Household in cluster

Household distribution

cluster

(a)

cluster

(b)

Fig. 5.9 Household distribution of NREL: k = 2 (a) and k = 3 (b). Source Adapted from [9]

reflects consumers with higher demand at peak hours, while other groups present a low and uniform consumption profile. The SD for each cluster shows whether the behavior is homogeneous or reflects consumption peaks (Fig. 5.8b). The hourly behavior reflects homogeneous consumption especially during the night for cluster 2 (maximum SD 1371 W at 17:00h), fairly homogeneous 24h consumption for cluster 3 (maximum SD 1813 W at 17:00h), and heterogeneous consumption for cluster 1, especially from 9:00h onward (increasing SD that peaks at 3807 W at 20:00h). Figures 5.9 and 5.10 show coalitions by number of households obtained for 2, 3, 4, and 5 clusters, with 3 clusters reflecting the most homogeneous distribution. Cluster 1 shows similarities with busy behavior (. E AD−), extracted from the expert analysis in terms of volume and demand flow. Cluster 2 corresponds to concerned behavior (. F B − −), while cluster 3 illustrates demanding behavior, i.e., with heterogeneous volume and demand flow (.G − D−). Studying specific time slots plays a key role in determining consumption patterns. For instance, early in the day, a community with many consumers may have preferences for a significant amount of demand for a particular working hour compared to a community with more flexible demand preferences. NREL data on consumption

5.3 Behavioral Pattern Analysis

69

Household distribution

Household in cluster

Household in cluster

Household distribution

cluster

cluster

(a)

(b)

Fig. 5.10 Household distribution of NREL: k = 4 (a) and k = 5 (b). Source Adapted from [9] 1.0 1.0

0.8

0.8

0.6

0.6

0.4

0.4

0.2

0.2

0.0

Cluster 1 Cluster 2

06:00

0.0 07:00

08:00

09:00

10:00

11:00

12:00

06:00

07:00

08:00

09:00

(a)

10:00

11:00

12:00

(b)

4

800 700 600 500

2

Elbow

Método Gap

3

400 300

1

200 100

0

0

2

4

6

k

8

(c)

10

12

14

2

4

6

k

8

10

12

14

(d)

Fig. 5.11 Consumption patterns obtained with k-means (a), average consumption trend in the period 6:00h–12:00h (b), and values of k obtained with the gap method (c) and with the elbow method (d). Source Adapted from [9]

behavior have been studied for various time slots, with each time slot 6:00h–12:00h (morning), 12:00h–17:00h (afternoon), 17:00h–20:00h (evening), and 1:00h–6:00h (night) processed in the same way, using the elbow and gap methods, so as to obtain the number of groups. Figure 5.11 illustrates behavior in the morning period, with the energy behavior of households classified into 2 clusters. An initial upward consumption trend stabilizes from 9:00h onward, and the 2 clusters show very similar consumption levels, although cluster 1 consumption, slightly lower, fluctuates more. The clustering here shows little heterogeneity in the behavior of the community.

70

5 Behavioral Analysis and Pattern Validation

1.0

1.0

0.9

0.9

0.8

0.8

0.7

0.7

0.6

0.6

0.5

0.5

0.4

0.4

0.3

0.3

Cluster 1 Cluster 2

12:00

13:00

14:00

15:00

16:00

17:00

12:00

13:00

14:00

(a)

15:00

16:00

17:00

(b)

Fig. 5.12 Consumption patterns obtained with k-means (a), and average consumption trend in the time period 17:00h–24:00h (b). Source Adapted from [9]

1.0

1.0

0.9

0.9

0.8

0.8

0.7

0.7

0.6

0.6

0.5

0.5

0.4

0.4

0.3 17:00

0.3

Cluster 1 Cluster 2 18:00

19:00

(a)

20:00

17:00

18:00

19:00

20:00

(b)

Fig. 5.13 Consumption patterns obtained with k-means (a), and average consumption trend in the time period 17:00h–24:00h (b). Source Adapted from [9]

Figure 5.12 shows behavior in the afternoon period, with energy consumption increasing gradually from 14:00h onward. While the main difference between the 2 clusters is the upward consumption in the latter part of the period, the trend is very similar and homogeneous. Figure 5.13 illustrates the evening period, which also shows 2 clusters, with cluster 1 showing higher consumption earlier in the day and cluster 2 showing lower and more fluctuating consumption. Clustering makes it possible to structure consumption data and derive significant relationships for specific time slots. However, analysis of time slots does not allow us to clearly establish differentiated behavioral patterns for the community, with the result that only 2 consumer clusters are established. Figure 5.14 shows that the biggest difference occurs in the latter part of the day, indicating that analysis carried out over the full 24h period clearly differentiates 3 clusters, i.e., it allows for better segmentation of household data. 2. K-prototypes clustering reflects an algorithm with mixed data (numerical and categorical variables) and a custom dissimilarity metric: the distance between a point and the cluster centroid (prototype) to be minimized. While k-means calculates the Euclidean distance between 2 points and k-modes efficiently handles only categorical data, K-prototypes obtains cluster centroids, which, for energy consumption, is expressed in terms of numerical and categorical data. It does this by calculating the

5.3 Behavioral Pattern Analysis

71

1.0

1.0

0.9

0.9

0.8

0.8

0.7

0.7

0.6

0.6

0.5

0.5

0.4

0.4

0.3

0.3

Cluster 1 Cluster 2

01:00

02:00

03:00

04:00

05:00

06:00

01:00

02:00

03:00

04:00

(a)

05:00

06:00

(b)

Fig. 5.14 Consumption patterns obtained with k-means (a), and average consumption trend in the community in the time period 12:00h–6:00h (b). Source Adapted from [9] Cluster 1 Cluster 2 Cluster 3

18000

4500

Demand standard deviation

14000

Demand

12000 10000 8000 6000 4000

Cluster 1 Cluster 2 Cluster 3

4000

16000

3500 3000 2500 2000 1500 1000 500

00:00

02:00

04:00

06:00

08:00

10:00

(a)

12:00

14:00

16:00

18:00

20:00

22:00

00:00

02:00

04:00

06:00

08:00

10:00

12:00

14:00

16:00

18:00

20:00

22:00

(b)

Fig. 5.15 analysis of 3 annual consumption patterns (a), and SD for the 3 annual consumption patterns (b). Cluster 1 is similar to busy behavior (red), cluster 2 reflects concerned somewhat undemanding behavior (blue), and cluster 3 shows more heterogeneous demanding behavior (green). Source Adapted from [9]

mode, not the mean, of the categorical attributes. The categorical variables for energy consumption are defined as high volume and demand flow, heterogeneous volume and demand flow, and a low consumption profile. k-prototypes and k-means results clearly differentiate between consumer groups with higher peak demand. Comparing the red line in Fig. 5.15 with that in Fig. 5.8 show a similar correlation of the demand profile in cluster 2 (concerned behavior) for both methods (blue lines). However, the average demand volume for cluster 1 is lower when k-prototypes is used, mainly due to a different ranking of 24 households. For instance, k-prototypes from cluster 3 (20 demanding consumers) are classified in cluster 2, and cluster 1 (4 busy consumers) is classified in cluster 3. 3. HC, probably the most intuitive and flexible algorithm, is optimal at finding outliers and outlier groups. It detects the clustering structure of a hierarchical dataset without creating clusters. Starting with each data point as its own cluster, the algorithm locates similar points and clusters them together using a dissimilarity function ( complete, single, average linkage, minimum variance, etc). The algorithm becomes more demanding in terms of time and resources as it iteratively processes data points as it searches through the entire dataset.

72

5 Behavioral Analysis and Pattern Validation

Fig. 5.16 HC classification. The x-axis represents objects and clusters and the y-axis represents the inertia when clustering at each level. Source Adapted from [1]

The dendrogram in Fig. 5.16 shows the HC relationship between similar consumer datasets, with the number of classes a compromise between similarity and dissimilarity. The results are presented in nested groups and organized as a classifying tree. The different nodes in the tree contain similar data, and nodes at one level are successively joined with nodes at the next higher level based on their similarity. Ultimately, the nodes in the tree provide a visual snapshot of the data contained in the dataset. The final 3 clusters are obtained based on the cut-off point location (between 0.3 and 1.25 in this case). Three subsets of similar data for households (represented by data points) are interpreted as follows: cluster 1 (red) with 52 points, cluster 2 (blue) with 58 points, and cluster 3 (green) with 90 points. The horizontal position of each branch is related to the distance (dissimilarity) between groups. Clusters 1 and 3 belong to the same branch as they present more similarities in both the demand volume and flow dimensions. These clusters fall within the FADX scenario. Cluster 2 shares common dynamics with cluster 3, the most populated and most heterogeneous cluster. It can be inferred from the data and correlations that the extracted patterns fit well with HC clustering. Figure 5.17 shows mean consumption and SD results for 3 clusters obtained by HC. 4. PCA is an unsupervised technique used for dimensional reduction of a dataset consisting of many correlated variables. The idea is to remove redundant data, while preserving as far as possible all critical information. PCA applied to the NREL dataset aims to minimize redundant data and optimize cluster centers. Data are processed in 24 dimensions, where each dimension represents 1h of the day. The main objective is to reduce the 24 dimensions as much as possible. The first number gives the variance contained in the first principal component, while the second number provides the variance in the second principal component. For the NREL dataset, reserving 24 principal components (representing a 24h day), the principal components reveal the typical consumption behaviors, with the data grouped into 3 clusters according to experiments and experience. Clusters 1 and 2 show greater dispersion in relation to their centroid, possibly due to different consumption trends among the households in

5.3 Behavioral Pattern Analysis

73 Cluster 1 Cluster 2 Cluster 3

16000

4000

Cluster 1 Cluster 2 Cluster 3

3500

14000 3000 12000 2500 10000 2000 8000

1500

6000

1000

4000

500 00:00

02:00

04:00

06:00

08:00

10:00

12:00

(a)

14:00

16:00

18:00

20:00

22:00

00:00

02:00

04:00

06:00

08:00

10:00

12:00

14:00

16:00

18:00

20:00

22:00

(b)

Fig. 5.17 HC classification of 3 annual consumption patterns (a), and SD for the 3 annual consumption patterns (b). Cluster 1 shows busy consumer behavior (red), cluster 2 shows low flat demand i.e., concerned consumer behavior (blue), and cluster 3 shows more heterogeneous demand, i.e., demanding consumer behavior (green). Source Adapted from [9] Fig. 5.18 PCA for the NREL dataset: busy, demanding, and concerned consumer behaviors. Source Adapted from Cruz et al. [1]

the cluster. Figure 5.18 illustrates 3 different clusters in the 2 principal components that cause the cumulative contribution rate to reach 87%, with some loss of the variance ratio (information) during the transformation. The first and second components explain the greatest possible variance (62% and 25%, respectively). Table 5.1 shows the variance and cumulative variance for each principal component. The sum of the variances indicates the percentage of information retained during the transformation. PCA results are considered reliable only if this sum is greater than 0.85, i.e., a loss of 15% or more of the information leads to inaccurate results. Generally there is no meaning assigned to each principal component after dimensional reduction. Table 5.2 summarizes mean consumption and SD for the 3 clusters, calculated using k-means, k-prototypes, and HC, and showing annual consumption volumes and homogeneity for each cluster. For k-means, cluster 1 (. E A − −) represents the

2

0.250

0.873

1

0.623

0.623

Variance

Cumulative variance

Number of principal components

0.938

0.642

3

0.957

0.197

4

0.965

0.717

5

0.970

0.558

6

0.975

0.469

7

0.979

0.375

8

0.982

0.338

9

0.244

11

0.9853 0.987

0.305

10

Table 5.1 Analysis of variance and accumulated variance for different principal components

0.989

0.212

12

0.992

2.05

13

0.993

0.174

14

0.994

0.138

15

0.996

0.123

16

0.997

0.109

17

19

20

0.998

0.998

0.999

0.0858 0.0703 0.048

18

74 5 Behavioral Analysis and Pattern Validation

5.3 Behavioral Pattern Analysis

75

Table 5.2 Mean consumption and SD for each cluster k–means HC

Cluster 1 Cluster 2 Cluster 3

Mean

SD

Mean

SD

16265 5640 8481

3237 1799 2445

12506 5054 7368

2733 1532 2328

(a)

k– prototypes Mean 14180 5402 7916

SD 2810 1677 2433

(b)

Fig. 5.19 Gained flexibility (in kW) for the clusters extracted by k-means, for a rigid scenario (a) and for a flexible scenario (b). Source Adapted from [1]

upper limit for both high and fluctuating demand and also shows greater heterogeneity (3237 W) and higher average consumption (16265 W), for HC, cluster 2 shows the most uniform (1532 W) and lowest (5054 W) consumption, while PCA reveals the low variability of the dataset. The resulting clusters are considered as scenarios for further experiments with aggregation. NREL consumption data are the input parameters for different flexibility and renewable supply preference scenarios. The NREL samples, clustered by ML, are manually configured to generate a flexibility scenario reflected in a consumer’s minimum annual consumption setting the fixed demand, and the difference between minimum and maximum consumption setting the reallocated demand. Extracted manually are data on the peak consumption period and its duration. A rigid flexibility scenario lengthens the start of the period by one third of the peak duration, while a flexible scenario adds half of the operating duration to the same period. In addition, different renewable supply scenarios are tested on a uniform basis. Figure 5.19a shows the flexibility gained in a rigid scenario, in which the aggregator has little scope to shift demand. This scenario is efficiently configured by a coalition of clusters 2 and 3 (concerned and demanding behaviors, respectively). Cluster 2 manages to reallocate 41% of its demand to the least occupied slots, while cluster 3 shows the best performance in terms of volume flexibility. The demand scheduler

76

5 Behavioral Analysis and Pattern Validation

operates satisfactorily at peak hours in the rigid scenario. Figure 5.19b shows similar results for a flexible scenario. The volume of variable demand is higher for coalitions composed of clusters 1 and 3, clusters 2 (the most flexible community, with 42% of demand) and 3, and cluster 3 alone, with 36%, 26%, and 34% of their respective demands reallocated. Experiments conducted with the resulting clusters in the semi-decentralized configuration, where the algorithm allocates available renewable supply, show that supply is allocated by NREL household enumeration order; the algorithm does not optimize preferences in this scenario, but does shift the starting point of allocation within each cluster considering the best- and worst-case scenarios. Clusters 2 and 3 obtain 32%–11% and 33%–16% of the flexible demand, respectively. The coalitions, however, do not perform as efficiently as in the centralized environment. While cluster 1 improves flexible demand volume by joining with cluster 2, but causes the coalition with cluster 3 to saturate the renewable supply during peak demand.

5.3.3 Supervised ML Analysis Supervised ML techniques, used for forecasting and classification, assign sets of attributes to predefined class labels by making predictions based on past observations. They are computationally intensive, so accurate results are highly dependent on both parameter finetuning and data selection. The techniques are supervised because the desired output signals are already known for a set of samples (Fig. 5.20). Supervised techniques, by profiling demand and assigning unknown consumers to existing classes, reduce demand in accordance with consumer patterns, and also provide valuable information to the utility on the needed resources. Supervised ML techniques are implemented to validate a clustering analysis and determine the most efficient classification methods. Demand profiles are assigned to a group of consumers in the NREL dataset and customized synthetic computation costs are obtained through algorithm validation. The following supervised analyses are implemented: (1) linear discriminant analysis (LDA), which accurately classifies consumption behavior and demand forecasting; (2) fuzzy logic, which uses similarity and fuzzy relationships to enhance efficiency of classifications of consumers into community patterns; and (3) KNN, recently and very accurately applied to classification-based daily energy consumption prediction.

Input data

Training data tags

ML algorithm

Model forecasting/classification

New data

Fig. 5.20 Design for the supervised analysis

Forecasting/ classification

5.3 Behavioral Pattern Analysis

77

Fig. 5.21 LDA applied to the NREL dataset. Source Adapted from [1]

1. LDA maximizes the separation between groups and the variance within each class. It is similar to PCA in terms of dimensionality reduction, but unlike PCA, rather than find the axes of maximum variance in the data, it looks for the points, features, or subspaces that are most discriminatory in separating data. It is used as a feature extraction technique to increase computational efficiency and, in nonregularized models, to reduce the degree of overfitting due to dimensionality. LDA has the drawback (compared to PCA, which is more frequently used for dimensionality reduction) of needing model training and testing on a percentage of the dataset. Regarding energy consumption data, LDA tries find the 24h demand that optimizes class separability and the most discriminatory type of demand from consumption data. Figure 5.21 shows the results for an LDAclassifier generated for the NREL dataset using the Bayesian rule. The LDA model, trained and tested using a percentage of the demand dataset (20% of 200 households), reduces the number of dimensions to .c − 1 features, where .c is the number of classes, and also reduces the separation to only 3 features. The accuracy value obtained for LDA is 0.90. With PCA, cluster 2 shows high inter-household variability within the group, while clusters 1 and 3 appear clearly differentiated in PCA compared to LDA. 2. Fuzzy logic is based on imprecise and uncertain knowledge where the physical reality is graded. It is based on the standard logic (Fig. 5.22) whereby a value can be defined by a degree of truth between 0 (true) and and (0) false. This technique, based on fuzzy set theory, uses a set of intuitive rules [4]. A fuzzy subset A of .U is defined by the function .σ A(u), the membership function of set A. The membership function .σ A(u) is equal to the degree of membership

78

5 Behavioral Analysis and Pattern Validation

(a)

(b)

Fig. 5.22 Examples of Boolean logic (a) and multi-valued logic (b) Fig. 5.23 Flexible, mixed, and rigid functions for variable preferences in fuzzy logic. Source Adapted from [9]

Flexible

Fixed

Mixed

1

0 0

0.3

0.6

1

w

between 0 and 1 for any element . F of .U . A collection of elements u of .U is defined as part of a given set. Fuzzy logic elements belong to some degree to a particular fuzzy set. A fuzzy set . F of .U provides a given value [0, 1], corresponding to the u element, while w represents the degree of membership whose elements belong to . F. Each reassigned time-based feature in the dataset becomes a fuzzy variable or a combination of possible factors. Figure 5.23 shows the degree of membership w, .σ F(u) = w. We denote u as an element belonging to . F and .σ F(u) as the membership function of . F. If .σ F(u) = 0, the element u does not belong to . F, if .σ F(u) = 1, u is part of . F, while if 0 .< .σ F(u) .< 1, u is a fuzzy member of . F. . A, . B and .C are fuzzy sets with the corresponding membership functions .σ A(u), .σ B(u), and .σ C(u) in set .U . The union between 2 fuzzy sets is described by the membership function .σ A∪B (u), and is defined for all u .∈ U by Eq. 5.2 σ A∪B∩C (u) = max (σ A (u) σ B (u) σC (u))

.

(5.2)

The intersection between fuzzy sets is described by the membership function σ A∩B∩C (u) and is defined for all u .∈ U by Eq. 5.3.

.

σ A∩B∩C (u) = min (σ A (u) σ B (u) σC (u))

.

(5.3)

Linguistic variables are used for decisions based on fuzzy rules, rather than concrete values, as they allow ambiguous concepts to be defined in a manner understandable to an ML system. The components of the fuzzy system are as follows: 1. Fuzzification interface. Using linguistic variables, this allows the input data to be read and scaled to fit the fuzzy set, where each input item belongs to some degree to each of the sets.

5.3 Behavioral Pattern Analysis

79

Table 5.3 Fuzzy rules used for classification Rule Specification R0 R1 R2

x2 = x3 = long and X4 = x5 = long and x6 = x7 = middle and x8 = x9 = short, then concerned behavior x1 = x2 = long and X5 = x6 = long and x9 = x10 = middle and x17 = x18 = short, then demanding behavior x7 = long and x8 = long and x15 = middle and x16 = middle and x23 = middle and x24 = short, then busy behavior

Fig. 5.24 Required normalized demand reallocation times for different consumption preferences. Source Adapted from [1]

2. Knowledge base. This contains linguistic control rules, summarized in Table 5.3, with specialized knowledge for the construction of the fuzzy system. The function or logic can be interpreted as a union or intersection between sets. 3. Decision logic. This indicates how the output of the fuzzy rules is to be interpreted. 4. Fuzzy classification. This is converted into a real classification through the fuzzification interface. Fuzzy logic is applied to the synthetic dataset generated by the demand scheduler. This data is structured into a set of 24 fuzzy variables comprising all combinations of factors and normalized times (Fig. 5.24). Visualizing the combination of all factors in terms of normalized cost presents an interesting result of the impact of factors on consumer coalitions and their behaviors. For example, rigid communities (. E – – – –) run fast when scheduling demand. The input data are classified into fuzzy classes as follows: rigid, with peak-based demand, flexible, with low-volume demand, and mixed, with uniform demand. Figure 5.25 shows the classification as a matrix, with accuracy of 0.79. Fuzzy class 1, matching busy behavior, classifies 8 combinations correctly, and fuzzy class 3, representing demanding behavior (mixed scenario), classifies 10 combinations cor-

Fuzzy class 3 Fuzzy class 2 Fuzzy class 1

Fig. 5.25 Confusion matrix classification of the reassigned time dataset, with 3 classes established as fuzzy rules, resulting in 8 and 10 classified combinations corresponding to the busy and demanding behaviors, respectively. Source Adapted from [1]

5 Behavioral Analysis and Pattern Validation

Truth class

80

Fuzzy class1

Fuzzy class2 Fuzzy class3 Predicted class

rectly. Fuzzy class 2, correlated with concerned behavior, reflects greater difficulty in correctly classifying certain combinations. To optimize the fuzzy classification rules, performance is compared for the PSO and GA algorithms. The function minimized is the classification error, i.e., the percentage of unclassified samples, and the resulting accuracy is 0.9 for PSO and 0.92 for GA, achieved after 30 iterations. 3. KNN is inspired by the biological neural networks of the human brain. It starts with an untrained network and establishes a training pattern in the input layer, taking a large number of labeled points to learn how to label other points. Signals are fed through the network and the output is determined in the last layer. The algorithm finds the K samples (value that affects the output) in the training data set closest to the classified point. A high K value reduces noise but also reduces resolution, giving preference to the majority class. The classifier immediately adapts when new training data is input, although computational complexity grows linearly with the number of additional samples, unless a dataset with very few dimensions (features) and with efficient data structures is implemented by the algorithm. Figure 5.26 depicts results expressed as a confusion matrix for KNN applied to the NREL dataset with a value of K=5. Each group is represented by a similar number of samples, providing a good estimate of the quality of the observed patterns. Despite some false positives, the samples in the dataset are correctly classified, achieving an accuracy of 94%. Table 5.4 summarizes the evaluation metrics obtained for the classification, showing averages of 0.94 and 0.93 for both the F1-score and the recall parameter. TheKNN classifier is 100% accurate in identifying cluster 2 (concerned behavior). The value is lower, at 88%, for cluster 3 (mixed and heterogeneous behaviors). The rule for cluster 1, however, unclassified 4 samples from cluster 2, raising doubts about the appropriateness of the dataset used for this analysis. New scenarios configured in the aggregation algorithm for the NREL consumption data, taking into account the classification obtained by KNN. The 2 scenarios are rigid and flexible, and renewable supply is RW. Figure 5.27a depicts the flexibility gained

81

Cluster2 Cluster1

Truth class

Cluster3

5.3 Behavioral Pattern Analysis

Cluster3

Cluster2 Predicted class

Cluster1

Fig. 5.26 Classification for 60 households from the NREL dataset. Source Adapted from [1] Table 5.4 Precision parameters for classification by KNN for 60/140 households from the NREL dataset Precision Recall F1—score Support Cluster 1 Cluster 2 Cluster 3 Precision macro avg weighted avg

0.91/0.89 1/1 0.88/0.91

1/0.93 0.91/0.97 0.91/0.87

0.95/0.91 0.91/0.99 0.94/0.89

21/60 20/35 15/45

0.93/0.93 0.94/0.92

0.94/0.92 0.93/0.92

0.93/0.93 0.93/0.92

60/140 60/140

(a)

(a)

Fig. 5.27 Gained flexibility (in kW) for the clusters extracted by KNN in a rigid scenario (a), and in a flexible scenario (b). Source Adapted from [1]

82

5 Behavioral Analysis and Pattern Validation

Table 5.5 Accuracies and required simulation times for the different classification techniques Technique Score Time (ms) Dataset

NREL Synthetic

NREL

Supervised algorithms KNN LDA Fuzzy Logic Fuzzy Logic with PSO Unsupervised algorithms PCA k–means

k-prototypes HC

0.93 0.9 0.79 0.9

4.25 5.10 134.2 26300

0.87 Elbow: K = 3 / Uncertainty = 0.29 Silhouette: K = 3 / Mean = 0.22 Elbow: K = 3 / Cost = 20.5 Threshold: 1

6.0 750 1070

493 2.09

in a rigid scenario, showing gained flexibility that is similar to the experiments with the unsupervised techniques; in fact, cluster coalitions between clusters 2 and 3 gain a higher volume of flexible demand (34%). Cluster behavior flattens out noticeably with the KNN classification, with the flexibility share of cluster 1 remaining low (23%). Figure 5.27b, reflecting a flexible scenario, shows more balanced cluster dynamics, with flexibility of up to 30% of total demand, and in cluster 2, of up to 38% of flexible demand. KNN applied to the semi-decentralized setting for the aggregator also improves the flexibility results under different scenarios.1 The KNN rankings obtained for the NREL data present a similar ratio for both the flexible demand volume gained after cluster scheduling and its ratio over the total demand volume. The highest flexibility is obtained by cluster 3 (32% and 26% best and worst scheduling scenarios, respectively) and by the coalition between clusters 2 and 3 (31% on average). Cluster 1 also improves on the flexible demand ratio as obtained in the semi-decentralized KNN scenario (22%). Table 5.5 summarizes the results obtained for the supervised and unsupervised techniques, showing that the best performer isKNN and the poorest performer is fuzzy logic. The unsupervised algorithms are faster for similar accuracy scores, which makes them very suitable for real-time classification of demand profiles. Some difficulties appear with the accuracy measurements for k-means, k-prototypes, and HC, and with the computation needs of the fuzzy logic classifier. PCAcombined

1

New flexibility scenarios are set for the NREL data as described in Sect. 5.3.2.

5.3 Behavioral Pattern Analysis

83

with k-means or HC improves clustering consistency, obtaining a more accurate consumption forecast. k-means is efficient if compared to HC, although HC doubles the computational cost of k-means. The experiments described in [5], requiring large resources (1367s) to classify 40 buildings, compare HC with an evolutionary learning algorithm using 17 consumption categories, obtaining an 80% accuracy rate to adequately represent 9 clusters. With management of shared sources within a flexible community improving by 46%, the experiments demonstrate how flexible consumers could be motivated by the benefits of implementing the DR technology in their homes, i.e., how a scheduler could empower an entire consumer community to coordinate the targeting of renewable energy sources. Note that all the techniques used for this analysis were implemented on the aggregator hardware itself, running on the Raspberry Pi hardware platform.

5.3.4 Added Value of Demand Forecasting Demand forecasting increases the visibility of consumption behavior and so enables a better understanding of predicted demand factors. Figure 5.28 illustrates the model deployed to forecast consumption based on renewable energy availability. Train-test validation is a common practice of splitting the whole NREL dataset into training and test sets, with the split for testing model predictions usually set to 70/30. The training set contains a known outcome that the model learns from. The training and test periods are defined on NREL data rather than on random sporadic data. Any given pair X vector/Y target in the training data (1151h) yields electricity consumption in the current hour (Y value). The NREL dataset with 2470h of observations is tested with 1151/456h of observations per household. A phase in which the aggregator cleans up data irregularities and averages available data is followed by a normalization phase that ensures that a convergence problem does not produce large variance. Explored are 3 ways of modeling predictions for the consumer community:

Test

Data input

Training

Data preprocessing training and validation

Fig. 5.28 Demand forecasting methodology

Training

Forecasting

Stop

Demand forecasting Evaluation metric

84

5 Behavioral Analysis and Pattern Validation

1. The aggregator models households individually for each of the 200 households in the NREL dataset, an approach that allows better understanding of the accuracy of individual demand predictions. 2. The aggregator collects energy demand for the 3 clusters of households identified by the ML techniques. 3. The aggregator incorporates household consumption before developing a single aggregated model to forecast the behavior of the community, i.e., the forecasts for each household are summed to obtain aggregated average consumption. The main techniques uses to find an optimal trajectory that characterizes the trend or dynamics of consumption in a household and in a community are as follows: (1) RF, which has gained enormous popularity for predictive modeling and behavioral analysis, is a highly scalable and easy to use technique whose best solution takes the form of a set of decision trees selected by a voting procedure; (2) SVM, which performs well for non-linear regression estimation problems for small sample sizes; and (3) linear regression (LR), which estimates the value of a dependent variable (y) based on a given independent variable (x). 1. RF is a type of classifier that divides training data into smaller subsets until a predefined criterion is met. The construction of an RF model is based on the selection of 2 hyperparameters: the number of trees, and the number of estimates to be considered. The algorithm consists of a collection of tree-structured classifiers [h(x,. Pk ), k = 1, ...], where. Pk are identically distributed independent random vectors. RFis a combination of tree predictors, each depending on an independently sampled random vector. The algorithm for inducing RF (developed by [6]) improves the accuracy of decision trees by employing replicates of the training set. 2. SVM, derived from the theory of perceptrons and backpropagation,2 is a universal tool, applicable to both classification and regression problems, for solving multidimensional function estimation problems. When supervised, it is based on pre-processing the data in a higher dimension from the original feature space, in a hyperplane–a line that separates/classifies data points in the ensemble–for regression or classification. The data points or vectors that lie on the hyperplanes are the support vectors that constitute the weights of the boundary lines. The ultimate goal is to select the hyperplane regression that bests fits the training set. Figure 5.29 shows that, for a set of data points, there are several hyperplanes separating 2 subsets. Some hyperplanes are very close to the points, so if points close to those existing points were added, the hyperplane would no longer be valid. Kernel functions, which increase computational capacity, used in SVM include the linear, polynomial, sigmoid, and radial basis function (RBF) kernels (Table 5.6). The SVM tries to maximize the boundary margin between hyperplanes.

2

The perceptron model is a simple model that can only be applied in linearly separable problems. It is understood as a hyperplane that separates a space and whose position depends on the weights (W). The value of the function is obtained with the scalar product of the point vector and the vector representing the hyperplane. The weights are updated using the Cartesian product of the unclassified points and the current value of the weights. .Wk+1 = .Wk + . yn xn .

5.3 Behavioral Pattern Analysis

85

X2

X2 Margen

+ +

+ o o o oo o

Vector support

+

+ +

+

+

o o o oo o

¿Hyperplane?

X1

+

+ +

positive hyperplane Result

+ negative hyperplane

SVM:

X1

Fig. 5.29 Illustration of the SVM technique Table 5.6 Kernel functions Kernel Linear Polynomial Sigmoid RBF

K(x, x’) ⟩ ⟨ x, x ' .γ > 0 ⟨ ⟩ ' 2 .( x, x + c) ⟨ ⟩ ' .tanh(γ x, x + r ) 2 −γ ||x−x ' || .e

Parameter

.



. p∈ N , C

≥0 > 0, r < 0



>0

3. LR is one of the most basic forms of supervised learning, whereby the model is trained to predict the behavior of data as a function of certain independent variables. It is mostly used to determine the relationship between variables and to make forecasts. In this case, the variables on the x-axis and y-axis must be linearly correlated.

5.3.5 Forecasting Characterization and Evaluation ML algorithm parameters are finetuned before training, with optimization aimed at finding the value giving the best performance for the validation set. In implementation, a balance is struck between bias and variance, avoiding model over- or underfitting. This process can be implemented by a cross-search in the hyperparameter space [7] or can be automated [8]. The quality of SVM and RF results is determined by the values set for several hyperparameters, namely, C, .γ , .n tr ees , and .n estimator . The C parameter regulates the tolerance of classification points in the dataset, while.γ works with non-linear kernels (such as sigmoid) and oversees algorithm overfitting. Described below is how the optimal values according to the individual or aggregated cases are obtained, using the R.∧ 2 coefficient, a statistical measure of data accuracy. Individual level. Figure 5.30 depicts different . R ∧ 2 values obtained for SVM. The optimal value of. R ∧ 2 is 0.31 with [C,.γ ] = [1e5, 1e-2]. The required computation time

86

5 Behavioral Analysis and Pattern Validation

(a)

(b)

Fig. 5.30 Hyperparameter combinations for SVM [.C, .γ ]: validation by . R ∧ 2 (a) and computation time (s) (b). Source Adapted from [9]

(a)

(b)

Fig. 5.31 Hyperparameter combinations for RF [.n tr ees , .n estimate ]: validation by . R ∧ 2 (a) and computation time (s) (b). Source Adapted from [9]

increases for values of C .≥ 1e6 and .γ .≥ 1e-2., and the computation time required with the optimal parameters is 10.9s. Figure 5.31 shows that RF values of .n tr ees = 3 and .n estimation = 1e4 achieve accuracy of 0.46, and also that the computation time is considerably increased (148s).

5.3 Behavioral Pattern Analysis

(a)

87

(b)

Fig. 5.32 Hyperparameter combinations for SVR [.C, .γ ]: validation by . R ∧ 2 (a) and computation time (s) (b). Source Adapted from [9]

(a)

(b)

Fig. 5.33 Hyperparameter combinations for RF [.n tr ees , .n estimate ]: validation by . R ∧ 2 (a) and computation time (s) (b). Source Adapted from [9]

Aggregate level. Figure 5.32, which depicts . R ∧ 2 values obtained with SVM and different hyperparameters settings, shows that the best performance (0.89) is obtained with [C,.γ ] = [1e4, 1e-3] for a computation time of 8.9s. Figure 5.33 shows that, for RF, the computation time increases to 26s considering .n tr ees = 3e1 and .n estimate = 1e2, while the . R ∧ 2 optimal value is obtained for [.n tr ees , .n estimate ] = [1e2, 3] for a computation time of 26s. Selected as optimal values for the individual and aggregated cases are [C,.estimate] = [1e6, 0.001] for SVR and .n estimate = 1e3 for RF. C .< 1e-3 reduces accuracy by 50s, while higher .γ and C values considerably increase computation time.

88

5 Behavioral Analysis and Pattern Validation 1 0,9

120

SVR LR RF

100

0,8

MAPE (%)

80

R2

0,7

60

0,6

40

0,5 0,4

20

0,3 0

Individual Cluster1 Cluster2 Cluster3 Aggregation household

(b)

(a)

3,5

30

3

25

MSE (xe-6)

35

MAE (xe-3)

4

2,5

20

2

15

1,5

10

1 5 0,5 0 0

(c)

(d)

Fig. 5.34 Results for R.∧ 2 (a), MAPE (b), MAE (c), and MSE (d) for the individual, clustered (clusters 1, 2, and 3) and aggregate cases. Source Adapted from [1]

To determine their suitability in terms of performance and accuracy, the techniques are evaluated using different scoring statistics: mean absolute percentage error (MAPE), which reflects the accuracy of a forecasting method; mean absolute error (MAE), which measures significantly large errors; and mean squared error (MSE), which, used as the loss function during the training phase, calculates the average difference between real and predicted demands. Figure 5.34 shows that computation time is greatest for the individual case, due to the resources needed for one-to-one extrapolation of the data, while prediction accuracy is greatest for the aggregate case (e.g., R.∧ 2 scores of 0.41 and 0.92 for LR at the individual and aggregate levels, respectively). SVM, RF, and LR yield successful forecasts in all clustering environments. RF shows impressive results and stable performance for all the approaches, and most especially for the aggregate case (R.∧ 2 = 0.93; MAE = 0.2e-3; MSE = 0.8e-6; MAPE = 3.6). SVM accuracy is surprisingly low for the individual case (R.∧ 2 = 0.3), but, for the aggregate environment, improves on LR and RF. MAPE accuracy is low: from 16% up to 105% for the individual case and from 2% up to 41% for the aggregate case. MAPE indicates poor accuracy for the SVM technique, and the MSE likewise, with a poorer performance for the individual case. At the cluster level, there is

5.4 Summary

89

Demand (Wh)

Forecast energy demand (Wh)

Current Prediction

Current energy demand (Wh)

( a)

( b)

Fig. 5.35 Measured (black) and predicted (red) energy consumption for the individual case using SVM: time series (a); test set scatter plot (b). Source Adapted from [1]

Demand (Wh)

Forecast energy demand (Wh)

Current Prediction

Current energy demand (Wh)

(a)

(b)

Fig. 5.36 Measured (black) and predicted (red) energy consumption for the aggregate case using SVM: time series (a); test set scatter plot (b). Source Adapted from [1]

a 57% increase in prediction accuracy. Individual-level clustering shows greater consumption variability, which makes the achievement of higher levels of accuracy difficult. Figures 5.35a and 5.36a show time series for measured consumption (black) and predicted consumption (red) over a 24h period test period, implemented by SVM for the individual and aggregate cases, respectively, and showing that forecast accuracy is greater for the aggregate case. Figures 5.35a and 5.36b depict the corresponding scatter plots. If the predictions were 100% accurate, all points would be on the 45degree line (. y = x). The high dispersion observed for the individual case shows less prediction accuracy than for the aggregate case.

5.4 Summary The development of efficient mechanisms to classify and predict energy demand in a smart community is of great interest given their important role in DR programs. The measurement of energy consumption and the integration of energy efficiency behav-

90

5 Behavioral Analysis and Pattern Validation

iors in consumers are as necessary as advances in production and management mechanisms. Electricity suppliers, market regulators, and consumers themselves need to understand how consumer communities can respond to the aggregated version of DR developments. In this chapter, consumer behavior analyzed for demand aggregation identifies 3 patterns, namely demanding, busy, and concerned, as driven by specific factors and validated using real living-lab data. The results represent useful information for the supply of sufficient renewable energy, improve understanding of the main factors in optimal demand reallocation and efficient aggregation, provide information on consumption prediction based on individual and aggregated demands, and point to how a possible reward scheme could be customized according to a recognized energy demand pattern. Various supervised and unsupervised ML techniques (e.g., k-means, HC, KNN, LDA, fuzzy logic) are used to validate the analyzed energy demand patterns. Unsupervised methods, such as k-means, extract demand profiles (and the appropriate number of profile) and determine the variability and flexibility dynamics within a community of consumers. Analyzing mean and SD values for hourly consumption identifies, from the NREL dataset, demand volume and flow patterns that enables consumers with a similar pattern to be grouped in 3 clusters. In our experiments, cluster 1 (busy behavior) is the least responsive of the clusters, with high fluctuating demand that complicates renewable resource management by the aggregator. As for supervised analysis, KNN differentiates 3 behaviors for 140 NREL households with 93% accuracy, identifying busy, concerned, and demanding consumer behaviors in 49%, 25%, and 32% of cases, while fuzzy logic identifies the same patterns with an accuracy of 79%. Scenarios with busy behavior account for 33% of reallocated demand, while the other two patterns in flexible coalition account for 45% of the reallocation demand with only 47% participation (42% demanding behavior and 5% concerned behavior). Experiments show that the aggregator classifies different behavior patterns with an accuracy of up to 90%, using supervised and unsupervised techniques. Regression techniques, such as RF, SVM, and LR, used to predict aggregator consumption obtain high accuracy (.> 0.94) and result in fast behavior profiling for the clusters. The results indicate that prediction is much better for aggregate demand than for individual demand.

Appendix Table 5.7 shows details for the described scenarios, with parameters defined according to demand volume and flow, consumer flexibility, and renewable demand and supply flow. The database is based on energy use data for the most common appliances (Table 4.5, with data on average energy use, standby energy, and estimated operating time for various appliances).

5.4 Summary

91

Table 5.7 Simulation assumptions used to validate the scheduling algorithms: combination scenarios for different factor values Demand volume

Consumer flexibility

Rigid (. L =

High (.> 5 h)

Demand flow

Description

Supply flow

Scenario

Figure

Consumers with high activity and occupancy. Demand is randomly distributed throughout the day

Peak Plane

. E BC X . E BCY

Figure 5.6a

Peak 8:00–11:00

Demand is spread throughout the day, with a special focus on early morning

Plane Peak

.E B D X

Plane

Consumers with low activity and occupation. Distributed demand during leisure time

Plane Peak

. E AC X . E ACY

Peaks 8:00–11:00 10:00, 12:00, 22:00

Distributed demand in first hour and free time

Plane Peak

. E AD X . E ADY

Plane

Consumers with high activity and occupancy. Demand distributed throughout the day

Plane Peak

. F BC X

PEak 10:00–22:00

Distributed demand along the day

Plane Peak

.F B D X . F B DY

Plane

Consumers with low activity and occupation. Focused activities in the morning and midday

Plane Peak

. F AC X

.N )

Low (.< 5 h)

Mixed (. L =

High

. N /2)

Low

Flexible (. L = 24)

High

Low

. E B DY

Figure 5.6b

. F BCY

Figure 5.5a

. F ACY

Peak 10:00–11:00 15:00, 18:00

Focused activities at Plane Pico midday. Distributed demand through free time

. F AD X . F ADY

Plane

Consumers with high demand and occupancy

Plane Peak

.G BC X .G BCY

Peak 6:00–10:00

Consumers with medium consumption throughout midday

Plane Peak

.G B D X .G B DY

Plane

Consumers with low activity and occupation. Distributed demand in the morning

Plane Peak

.G AC X .G ACY

Peak 5:00–11:00

Demand distributed throughout the day with peaks in consumption

Plane peak

.G AD X .G ADY

Figure 5.5b

Figure 5.7a

Figure 5.7b

92

5 Behavioral Analysis and Pattern Validation

References 1. C. Cruz, E. Palomar, I. Bravo, M. Aleixandre, Behavioural patterns in aggregated demand response developments for communities targeting renewables. Sustain. Cities Soc. 72, 103001 (2021) 2. M. Muratori, M. Roberts, R. Sioshansi, V. Marano, G. Rizzoni, A highly resolved modeling technique to simulate residential power demand. Appl. Energy 107, 465–473 (2013). https:// doi.org/10.1016/j.apenergy.2013.02.057 3. NREL (2020) [Residential Profiles Dataset], https://data.nrel.gov/system/files/69/ResidentialProfiles.xlsx. Accessed 01 May 2021 4. L.A. Zadeh, G.J. Klir, B. Yuan, Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems: Selected Papers, vol. 6 (World Scientific, 1996) 5. M.S. Piscitelli, S. Brandi, A. Capozzoli, Recognition and classification of typical load profiles in buildings with non-intrusive learning approach. Appl. Energy 255, 113727 (2019) 6. L. Breiman, Random forests. Mach. Learn. 45(1), 5–32 (2001) 7. M. Claesen, B. De Moor, Hyperparameter search in machine learning (2015), arXiv:abs/1502.02127 8. J. Bergstra, B. Komer, C. Eliasmith, D. Yamins, D.D. Cox, Hyperopt: a python library for model selection and hyperparameter optimization. Comput. Sci. & Discov. 8(1), 014008 (2015) 9. C.C. de la Torre, Sistema cooperativo de planificacion de demanda de electricidad agregada: comunidades sostenibles que optimizan el consumo de renovables. Ph.D. thesis, Universidad de Alcala (2022)

Chapter 6

Experimental Demand Scheduler Validation

Abstract After reading this chapter you should be able to: • • • •

Understand how to implement and deploy a pilot cooperative DR framework Analyze the computation cost of centralized demand reallocation Analyze the communication overheads of different network protocols Understand pilot demand testbeds in terms of confidentiality, integrity, and authentication issues and solve availability problems.

Home energy management and DR systems are becoming an important part of the electrical power infrastructure. The two-way communication capabilities of a smart grid enables command-response exchanges between 3 domains, namely, DR servers, aggregators, and home controllers, while some cloud-based deployments leverage energy big data to improve DR performance. However, the 3-domain architecture for energy management raises concerns regarding data and communication protection. Furthermore, demand reallocation implementation with renewable sources has hardly been explored or validated. This chapter evaluates a demand scheduler using real prototypes to verify network protocol feasibility and analyze different community scenarios and consumer behaviors for different hardware platforms, communication resources, and security requirements. The aggregation algorithm is implemented on 4 hardware platforms with different characteristics, namely, Raspberry Pi 4, 3B+, and 3B, and Arduino Mega, while the network architecture is validated by analyzing the communication and security requirements of the UDP, MQTT, CoAP, WiFi, and 3G network protocols. Keywords Cooperative demand response · Consumption scheduling · Renewable supply · Raspberry Pi · Arduino Mega · Performance evaluation · CoAP · MQTT · DTLS For a community of consumers with a common utility and aggregator, scheduler interactions are exemplified in Fig. 6.1. Each consumer has a home controller implemented on the Raspberry Pi 3B platform, connects with appliances via WiFi, and © The Author(s), under exclusive license to Springer Nature Switzerland AG 2024 C. Cruz, Sustainable Energy Efficient Communities, The Springer Series in Sustainable Energy Policy, https://doi.org/10.1007/978-3-031-49992-0_6

93

94

6 Experimental Demand Scheduler Validation

Fig. 6.1 Experimental demand scheduler framework: household layout, 3 consumers, the aggregator, and the utility

communicates with the aggregator via WiFi or 3G. The consumer enters time preferences for each appliance, and this information is transmitted to an aggregator implemented on a Raspberry Pi 4 platform that communicates via WiFi or 3G. The home controller connects smart appliances to the controller, using the following communication protocols: (1) ZigBee (code BILGIN20122196), a low data transmission rate and low power consumption protocol; (2) Z-Wave (code MAHMOOD2015248), used for short-range communication due to its low latency; and (3) WiFi, long range, with a high data transmission rate, and also both visible and secure. The aggregator is implemented coded in C++ language and is compiled with Linaro GCC version 7.4.0 on a MicroSD card and using the Linux operating system, enabled to communicate over IEEE 802.11 and the 3G wireless network.

6.1 Scheduler Implementation Figure 6.2 illustrates messaging between the aggregator, controller, and appliances. The home controller collects appliance preferences for the following input data: fixed demand fD (kWh in standby mode), variable demand vD (kWh when run-

6.1 Scheduler Implementation

95

Fig. 6.2 Controller-aggregator and controller-appliance messaging. Source Adapted from [1] Event

State machine

Light state modification

Switch

Listen/trigger Events

Bus of events

Switch call service

listen Call

(a)

light Yeelight

call service event

Service register

Switch

Timer

Hour

call listen

Others

gateway

Switch Event

light Yeelight

Zigbee Z - Wave WiFi

(b)

Fig. 6.3 Home Assistant architecture and device configuration (a), and WiFi, Zigbee, and Z-Wave configuration (b)

ning), durationL (activation time), and start-end interval [.tbeg , .tend ], which reflects the flexibility time frame and has to be at least L for each appliance . I Di . The aggregator collects the consumers’ data, and, considering their preferences, generates and privately transmits a 24 h reassigned demand vector for each appliance. The home controller manages and controls appliance operation according to the reallocated vector, using, for instance, Home Assistant, free and open-source home automation software. Home Assistant, which integrates different smart appliances without relying on the cloud or remote servers, consists of a web server installed on a Raspberry Pi platform. Figure 6.3a shows an overview of the Home Assistant architecture, consisting of: (1) an event bus, a central component that facilitates actions (e.g., event listening); (2) a state machine, which monitors and triggers a state change or updated event to the event bus; and (3) a service registry, which listens to the event bus and simplifies duration-based automation. Figure 6.3b shows timer configuration through a gateway that uses Z-Wave, ZigBee, or WiFi for appliance-to-controller communications, e.g., transmitting a time change event according to a certain frequency to the event bus.

96

6 Experimental Demand Scheduler Validation

TV switch Zigbee Home controller Aggregator Switch Z-Wave

(a)

Switch Hi-Fi Fan switch Z-Wave

(b)

Fig. 6.4 Smart appliances and platforms: Z-Wave (white connector) and ZigBee (black connector) connection modules (a), and appliance and home controller with the aggregator integrated in a home smart hub (b). Source Adapted from [2]

Figure 6.4a illustrates the smart devices used in the demand scheduler and Fig. 6.4b illustrates a home smart hub, with the controller and aggregator. Appliances directly based on Zigbee can be integrated via the Zigbee Home Automation global standard, while the Z-Wave JS controller is used to configure Z-Wave integration. Activation data for each appliance are sent in a vector of 24 time slots until a full day is completed. Each slot is identified by 0/1, corresponding to appliance deactivation/activation. The basic structure of the script syntax is a list of key and/or value maps containing actions. MQTT, for instance, reduces complexity by allowing a single connection to a message topic. An appliance is configured as follows: binary sensor: - platform: MQTT name: “appliance name ” state topic: “task/appliance” json attributes topic: “task/appliance” payload off: 0 payload on: 1 value template: “.valuejson.data[now().hour]” The device name value corresponds to a configured home appliance, and the subject/appliance parameter is the route of the message sent by MQTT. Vectors are configured as follows: example A -.> “data”: “000000000000000011100000” example B -.> “data”: “000000000000011110000010”. Each appliance is turned ON or OFF according to its status updated at a time change. Figure 6.5 shows, in red, when the switch is OFF, and in green, when the switch is ON, i.e., the time periods 16:00 h–19:00 h, 14:00 h–17:00 h, and 22:00 h– 23:00 h.

6.1 Scheduler Implementation

97

Fig. 6.5 Example of Z-Wave switch execution. Source Adapted from [2]

The aggregator algorithm is implemented coded in C++ language and is compiled with Linaro GCC version 7.4.0 on a MicroSD card and using the Linux operating system, enabled to communicate over IEEE 802.11 and the 3G wireless network.

6.1.1 Computation Costs Table 6.1 summarizes aggregator reallocation times for different platforms and operating systems, with preliminary results in line with previous simulation results. Figure 6.6 compares aggregator computation times for various scenarios. Aggregator logic, accounting for an additional delay of about 1000 s, is implemented on

Table 6.1 Computation costs for different platforms Model

CPU

RAM

Frec. Clock (GHz)

Time (s) CASE2 2 consumers 32 appliances

Time (s) CASE3 3 consumers 52 appliances

Processor computer

Dual core Intel i5

8 GB 2.3 LPDDR3

MacOS 10.15

1.02 .± 0.17

2.56 .± 0.20

4.10 .± 0.31

Raspberry Pi 4

Quad Core Cortex A72

2GB 1,5 LPDDR4

Linux Ubuntu

1.45 .± 0.01

11.85 .± 0.03

19.39 .± 0.02

Raspberry Pi 3B+

Quad Core Cortex A53

1 GB 1.4 LPDDR2

Linux Ubuntu

2.70 .± 0.31

22.27 .± 0.04

36.66 .± 0.36

Raspberry Pi 3B

Quad Core Cortex A53

1 GB 1.2 LPDDR2

Linux 3.13 .± 0.09 Raspbian

26.12 .± 0.05

42.59 .± 0.10

Arduino mega

ATmega2560 Flash Microcon256 KB troller





0.016

Operative Time (s) system CASE1 1 consumer 3 appliances



1030 .± 6

98

6 Experimental Demand Scheduler Validation

Fig. 6.6 Computation cost for consumers in flexible and rigid communities according to the number of appliances. Source Adapted from [1]

0

150 150

5

10

15

20

(a) Hours Optimized demand. Uniform supply of rw No optimised demand

100 100 50 50 0 00 0

150

5 5

10 10

15 15

20 20

(d) Hours (d) Optimized demand. Non-uniform supply of rw

0

25 25

100 50 0 0

5

10

Hours (g)

15

20

Flexible scenario

0

25

Demand (Watt)

Demand (Watt)

Demand Demand(Watt) (Watt)

0

20

25

40 40

5

10

15

20

(b) Hours Optimized demand. Uniform supply of rw No optimised demand

20 20 0 00 0

5 5

10 10

(e) Hours

15 15

20 20

25 25

20

0 0

5

10

Hours (h)

15

20

Rigid scenario

40 20 0 0

Optimized demand. Non-uniform supply of rw

40

25

No optimized demand

60

25

Demand (Watt)

50

No optimized demand

40

Demand (Watt)

Demand (Watt)

100

Demand Demand(Watt) (Watt)

No optimized demand

150

Demand Demand(Watt) (Watt)

Demand (Watt)

the Raspberry Pi and/or Arduino Mega platforms. Note that Arduino Mega limits the scheduling of large appliances due to its variable 8KB static random access memory (RAM). The effect of variables such as the number of consumers, the volumes of fixed and reallocated demand, the total community demand, and the flexibility of the operating time intervals are also evaluated to determine which factors influence algorithm results in terms of reallocation time. Figure 6.7 shows the aggregated and reallocated demand vector for 2 consumers before scheduling (a, b, c) and for optimized

60 60

5

10

5 5

10 10

15

20

25

15

20 20

25 25

(c) Hours Optimized demand. Uniform supply of rw No optimised demand

40 40 20 20 0 00 0

(f )) 15 Hours (f

Optimized demand. Non-uniform supply of rw

60 40 20 0 0

5

10

Hours (i)

15

20

25

Mixed scenario

Fig. 6.7 Aggregated vector for 2 consumers (demands in 2 colors) before scheduling (a, b, c), reallocation with a uniform RW supply (d, e, f), and reallocation with a non-uniform RW supply (g, h, i) Source Adapted from [1]

6.1 Scheduler Implementation

99

scheduling with uniform supply (d, e, f) and nonuniform supply (g, h, i). For the implementation, 3 community scenarios are established, as follows: 1. Flexible scenario (consumer time preferences are relaxed, so demand is widely satisfied in reallocation). Figure 6.7a and d, g depict the aggregate demand vector in the aggregator before and after reallocation, respectively, illustrating high reallocation capacity when the community is flexible. 2. Rigid scenario (consumers are more demanding, so demand reallocation possibilities are limited). Figure 6.7e, h shows how the aggregator has little scope to adjust demand homogeneously throughout the day. 3. Mixed scenario (demand is more heterogeneous). Figure 6.7f, i shows that the activation preferences of the appliances vary and the aggregator can balance the load evenly throughout the day.

6.1.2 Communication Cost Table 6.2 shows message structure and interaction size information for exchanges between the different components as well as the communication times for different protocols. Figure 6.8a illustrates the experimental setup for different network protocols and quality of service (QoS) and security requirements. These are based on WiFi and 3G connections due to integration of the Sixfab 3G-4G/LTE Base HAT module on all platforms, with mini PCIe 3G/4G modules implemented in the Raspberry board acing as a bridge. The Sixfab 3G-4G/LTE Base HAT module, which provides simplified data connection for remote IoT projects anywhere, is a low-power highspeed (LTE, LTE) connection in an easy-to-integrate USB 2.0 module requiring 1.8 V power. The platform design is ultracompact as a consequence of the Telit LE910C1 Mini PCIe module. Figure 6.8b shows the Sixfab Core 3G software installed in the home controller and aggregator platforms to check real-time connection status. Sixfab Core automatically chooses the interface based on a priority list. For example, ppp0 is a point-to-point protocol (PPP) interface created by pppd when the modem is connected using the ATD (attention) call on the serial port, while wwan0 is also available even when the Global System for Mobile CommunicationsGSM modem is operational but not connected. Communication is evaluated through UDP sockets (when there is no connection between client and server), MQTT (which connects appliances that allow data encryption and require authentication), and CoAP DTLS (which guarantees the confidentiality and integrity message content). These are described in further detail below. 1. UDP. UDP communication over the IEEE 802.11 standard is deployed using sockets and client-server applications, with each client-server application operating in a communication channel. The channel descriptor (socket) indicates the communication protocol deployed, the socket network address, the local and remote

Size

Protocol (under WiFi in ms)

. Application

UDP CoAP/DTLS MQTT/TLS → Contr oller : m1: .{ f D , v D , L , tbeg , tend , I D} 48B = 8B/data (.×6 data field) . ∀ device to be programmed .Contr oller → Aggr egator : m1 .×4 appliances 192B = 48B/appliance (.×4 appls.) 21 .± 2 95 .± 13 162 .± 15 .U tilit y → Aggr egator : .[0, · · · , 23] (kWh) 192B= 8B/slot (.×24 slots) . Aggr egator → Contr oller : .[0, · · · , 23] (kWh) .×4 appls. 768B= 192B/appliance (.×4 appliances) 25 .± 3 109 .± 21 175 .± 20 .Contr oller → Apppliance : .[0, · · · , 23] (ON/OFF) 192B = 8B/slot (.×24 slots) over ZigBee/Z-Wave: .≈20 . ∀ device to be programmed

Message structure

Table 6.2 Message structure and size (message headers and payload from Fig. 6.2

100 6 Experimental Demand Scheduler Validation

6.1 Scheduler Implementation

101

(a)

(a)

Fig. 6.8 Electronic boards used for 3G communication between consumer and aggregator (a), and aggregator software application transmitting 3G communication status, TOU, and kB transmitted/received in real time (b). Source Adapted from [2] Fig. 6.9 UDP client-server communication. Source Adapted from [3]

Aggregator

Consumer

socket ( ) Socket creation and association bind ( )

DATA APPLIANCES PREFERENCES vector vD, fD, L, tbeg ,tend, ID

socket ( )

sendto ( )

recvfrom ( ) UDP (802.11)

Data transmission

blocked until data is received

blocked until data is received processing of received data socket ( )

Socket creation

Socket socket ( ) creation and association DATA vector CONFIRMATION

sendto ( )

recvfrom ( )

UDP (802.11) exit succes

IP network address, and the port number, thereby uniquely identifying each clientserver application. Figure 6.9 depicts a client-server communication. Establishing or releasing the connection under the UDP communication protocol is not necessary, as the data is simply sent with the destination address (within the data structure). 2. MQTT. Widely used for IoT devices due to its high portability and reduced consumption in terms of memory and power, this protocol is implemented through the Transmission Control Protocol (TCP) port 1883 for non-secure communication and port 8883 to add Transport Layer Security (TLS). MQTT establishes a message that defines a delivery guarantee called QoS, with 3 different levels (Fig. 6.10a): QoS level 0, the message is sent at most once with no acknowledgment; QoS level, the message is sent at least once with 1 acknowledgment, but potentially causes inconsistencies for the aggregator; and QoS level 2, the message is sent exactly once

102

6 Experimental Demand Scheduler Validation Consumer

Aggregator SYN [SYN,ACK]

TCP connection establishment

ACK CONNECT COMMAND

MQTT connect

ACK CONNECT ACK

Data transmission QoS2

PUBLISH('vD, fD, L, tbeg end, ID' QoS0) PUBLISH('vD, fD, L, tbeg end, ID' QoS1) TCP connection & DATA publish

PUBACK PUBLISH('vD, fD, L, tbeg end, ID' QoS2) PUBREC PUBREL PUBCOMP DISCONNECT REQUEST ACK

TCP connection establishment

[FIN,ACK]

(a)

(b)

Fig. 6.10 MQTT handshake (a) and communication capture with QoS level 2 (b), insecure and without TLS between consumer and aggregator via WiFi. The application data fit into a single MQTT datagram, sent over TCP/IP. Source Adapted from [1] Aggregator DTLS handshake messages

ClientHello HelloVerifyRequest ClientHello ServerHello Certificate Cipher suite:

DTLS handshake messages

Certificate request Server Key Exchange ServerHelloDone

Data transmission via secure connection

Certificate Certificate Validated Client Key Exchange ChangeCipherSpec Finished ChangeCipherSpec Finished Application Data

(a)

(b)

Fig. 6.11 CoAP/DTLS handshake (a) and communication capture (b) between consumer and aggregator via WiFi. The application data are sent authenticated and encrypted with a unique session key in a single DTLS datagram over UDP/IP. Source Adapted from [1]

with 4-stage verification. Figure 6.10b shows Wireshark CoAP/DTLSpacket capture at QoS level 2 between the consumer and the aggregator. 3. CoAP/DTLS. The most common way to secure a TCP connection is using the TLS protocol, which ensures privacy and data integrity between 2 communicating applications. CoAP over UDP is a protocol based on TLS that ensures confidentiality, integrity, and authentication of messages, and DTLS, also a protocol based on TLS, is commonly used to secure DTLS traffic. The implementation is based on DTLS v1.2 under FreeCoAP, a C library developed for GNU/Linux devices using GnuTLS, a free software implementation of Secure Socket Layer SSL and TLS protocols. Figure 6.11 illustrates a DTLS session, with both the consumer and aggregator equipped with certificates and private keys. A handshake is used to agree on security settings and a communication session key. The initial consumer DTLS handshake

6.1 Scheduler Implementation

103

Fig. 6.12 Communication latency between the consumer and aggregator for different WiFi communication protocols. Source: Adapted from [1]

100 Latency (ms)

Fig. 6.13 Communication latency between the consumer and aggregator for different 3G communication protocols Protocol

MQTT TLS

MQTT QoS2

MQTT QoS1

MQTT QoS0

1000

1500

2000

2500

3000

3500

Latency (ms)

establishes a secure channel containing a TLS cipher suite. The session starts with the DTLS message “Hello”, and keys and certificates are exchanged. While TLS (data stream) and DTLS (application data) both make their deliveries with authentication and end-to-end encryption, DTLS delivers with lower latency. When there is no more data to send, the consumer sends an encrypted alert, which is a notify close message to initiate DTLS logout. Figure 6.12 illustrates the round trip time (RTT) between 2 Raspberry Pi platforms connected via WiFi for different network protocols. The IP address does not need to be public, and a consumer query locates the aggregator’s address before leaving the router. The consumer and the aggregator connect over WiFi in network traffic environments, with the latency standard deviation exceeding 5% in all scenarios. CoAP/DTLS is faster (90 ms) than MQTT/TLS (160 ms), while DTLS is slower due to its public key cryptography methods. In a congested networks, MQTT achieves a RTT of 30–100 ms at any QoS level, which is an acceptable delay for a non-secure context.

104

6 Experimental Demand Scheduler Validation

Table 6.3 Required resources per protocol for the consumer/aggregator in the WiFi network a o Protocol CPU (%) RAM (%) ROM (bytes) . T ( C) UDP MQTT QoS0 MQTT QoS1 MQTT QoS2 MQTT TLS CoAP DTLS

4.1/0.3 4.3/0.3 5/0.3 4.1/0.5 2.1/5.4 2.2/7.6

0.3/0.3 0.3/0.3 0.3/0.4 0.4/0.4 0.4/0.3 0.4/0.3

@13K/@13K @150K/@150K @150K/@150K @150K/@150K @200K/@200K @74K/@58K

58.5/55.8 58.7/55.8 58.4/55.8 58.5/55.3 58.5/55.3 58.4/55.8

Figure 6.13 shows the RTT between the same 2 Raspberry Pi platforms connected via the 3G network. A public MQTT server is implemented and connects by 3G through the host (gateway.thebroker.com) on port 1883. Communication latency is greater (3535 ms) in comparison with the WiFi scenario where the IPs belong to the same network. The Sixfab subscriber identity module (SIM) card does not support static IPs, so the board must communicate via a third point (server). Note that the Sixfab 3G/4G LTE Base HAT module in the Raspberry Pi board significantly increases battery consumption in data transmission mode (430 mA, vs. 2 mA in standby mode). Table 6.3 summarizes the communication resources required in terms of processor and memory usage and chip temperature, for protocols validated for a real consumer and aggregator communication scenario (impact assessment in terms of latency, memory, and central processing unit (CPU) requirements carried out on 2 Raspberry Pi platforms, and communication costs over the network protocols calculated using the GNU/Linux timing tool). Table 6.4 shows the accuracy and execution time results obtained by applying different ML techniques on the aggregator Raspberry Pi platform, with similar accuracy results for the different working environments. However, execution time is much longer in the hardware implementation mainly due to processing limitations. The libraries and packages necessary for execution operate perfectly on the Raspberry Pi, confirming its satisfactory operation in the aggregator, with acceptable execution times for both automatic classification (9.11ms for PCA) and aggregated regression (93.32ms for SVM). These results have been compared with simulations from other studies deploying MQTT and CoAP libraries on highly constrained platforms [4–6]. Those studies conclude that certain implementations are more interoperable and faster, and also ensure message confidentiality and integrity, authentication, and the resolution of availability issues. For 3G technology, MQTT is the recommended communication protocol for implementation of wireless sensor networks, which transmit data in approximately 1s [7], a time that depends, however, on the download and upload capacity of each network provider (AXIS 3G networks download = 0.65kbps and upload .= 0.2 kbps).

6.1 Scheduler Implementation

105

Table 6.4 Algorithm accuracy and execution times compared for simulations and implementations on the Raspberry Pi 4 platform ML techniques in Accuracy (R.∧ 2) Execution time (ms) aggregator Raspberry Pi 4 Simulation Raspberry Pi 4 Simulation Supervised automatic classification algorithms KNN 0.96 0.93 LDA 0.90 0.92 Fuzzy Logic 0.79 0.80 Fuzzy Logic PSO 0.90 0.89 Supervised automatic classification algorithms PCA 0.87 0.88 k-means dist: 0.29 dist: 0.29 k-prototypes cost:20.50 cost:20.5 HC 1 1 Regression algorithms in the aggregated demand model LR 0.93 0.93 RF 0.94 0.92 SVR 0.64 0.71

19.20 11.90 250 39340

8.20 5.20 134.2 26300

9.11 7281 4980 11.29

3.90 3518 3549 2.32

129.21 170.50 93.32

21.45 36.0 9.10

6.1.3 Security Analysis DR clients and home controllers interact with physical electrical equipment to shed loads or to programmatically alter their loads. HAN devices that are legitimate1 are equipped with adequate energy service functions and are fully tested for interoperability with controllers and service providers. Utilities provide customers with metering data, pricing information, and DR signals as commercial energy services through smart meters or dedicated APIs. The corresponding communication channels should therefore comply with cybersecurity frameworks for critical infrastructures such as National Institute of Standards and Technology (NIST) and OpenADR 2.0. Most security specifications and standards for DR communications require TLS with client authentication, which is an effective solution for communications security even when deployment migrates to the cloud. Use of Extensible Markup Language (XML) signatures are also proposed as an optional and effective solution for nonrepudiation. In non-cloud deployment, cyber vulnerability assessment would require evaluation of the deployment infrastructure of the DR provider. Note that migration to the cloud changes the attack surface of the DR system, and so requires reconsideration of requirements for intrusion detection systems, network monitors, etc. The

1

A HAN device is considered legitimate if its digital certificate is signed by a trusted certification authority. This certificate needs to be stored in tamper-resistant hardware to ensure its integrity.

106

6 Experimental Demand Scheduler Validation

Fig. 6.14 Possible attacks on the client-server setup. Source Adapted from [2]

ATTACK IPv4 172.29.29.40

AGGREGATOR IPv4 172.29.29.52

HC MQTT QSo0 IPv4 172.29.30.30

Cases A/B password No/yes

HC MQTT QSo1 IPv4 172.29.30.31

HC MQTT TLS Case I IPv4 172.29.30.34

certification

CasesE/F password No/yes

CasesC/D

Cases E/F

password No/yes

password No/yes

HC MQTT TLS IPv4 172.29.30.33

HC MQTT QSo2 IPv4 172.29.30.32

protection of electronic access points and security perimeters is the responsibility of the cloud provider. At the application level, a protocol provides for consumer authentication with a username and password. The aggregator can be configured to disallow anonymous connections and to maintain a list of passwords that it forwards when a consumer attempts to connect. MQTTconnection packets have incorporated usernames and passwords to authorize and send data to the consumer. The username is a string encoded in UTF-8 and ISO 10646 character encoding format using variable length symbols, while the password is binary encoded data of a maximum of 65535 bytes. It is only possible to submit a username once without a password. Basic security capabilities are considered by design, i.e., data privacy, data integrity, and authentication between communicating parties, to establish an optimal security configuration within the MQTT protocol and for WiFi communications. Figure 6.14 identifies 9 possible attack and malicious behaviors that can occur during interactions, depending on 3 configurations: password or authentication certificate; TCP connection; and TCP/TLS. Attacks are deployed over eavesdropping time slots of 60 s using tools such as MQTT Security Assistant [8]. Experiments in the transmission of consumer demand flexibility data are structured as follows: • Considering MQTT communication with QoS configurations. The server listens on port 1883 and supports authentication mechanisms, which can be disabled (cases A, C, and E) or enabled (cases B, D, and F). • Considering MQTT over TLS with elliptic curve cryptography ECC key exchanges (cases G and H) or certification (case I). Table 6.5 shows results for different kinds of attacks for different settings/cases, with associated risk levels. All attacks can succeed in the absence of authentication. Unencrypted TCP protocols (cases A, B, C, D, E, F) display higher vulnerabilities,

Setup Protocol

TCP TCP TCP TCP TCP TCP TCP/TLS TCP/TLS TCP/TLS

Cases

A B C D E F G H I

1216 3232 1354 1400 1424 1441 3950 4050 4542

Message size (kbytes)

Table 6.5 Security configurations

916 980 1044 1110 1154 1168 3170 3220 4353

Message modification attack (kbytes) No Password No Password No Password No Password Certificates

Server authentication

– ./ – ./ – ./ – x x

Phishing attack

x ./ x ./ x ./ x ./ x

Results Manipulation data

– ./ – ./ – ./ – ./ x

x

./

./

./

./

./

./

./

./

Brute- force DoS attacks

2111 83 681 13 657 0 0 71 0

Overhead (%)

HIGH HIGH HIGH HIGH HIGH HIGH LOW LOW LOW

General risk

6.1 Scheduler Implementation 107

108

6 Experimental Demand Scheduler Validation

while the TCP/TLS protocols present the lowest overall risk, especially when authentication is by means of certificates. Those results would suggest the most favorable configuration to be authentication via TLS with certification (e.g., X.509, a standard for public key infrastructures). Relevant security properties in relation to network attacks are availability, confidentiality, and integrity, with attacks often mounted to assess risk levels regarding data, system, and communication security and privacy. Different attack types are described as follows [3]: 1. Sniffing attacks. The attacker tries to intercept packets to find credentials (client IDs, usernames, and passwords) to connect to the server. Authentication mechanisms will block all anonymous connections in the server. When DTLS/TLS is implemented, an attacker cannot listen in on transmitted messages. Message reply attacks are also prevented, as the attacker cannot replay the session with previously exchanged information. 2. Message modification attacks. The attacker tries to generate packets to cause server errors that affect hardware platform performance. If sufficient control over the network infrastructure is achieved, the attacker can exploit the attack by sending manipulated preferences to the server, deleting exchanged messages, etc. A secure channel prevents message modification. 3. Phishing attacks. The attacker masquerades as a trusted entity, but fails if they cannot complete successful authentication. Messages exchanged between trusted peers are safe if encrypted using authenticated public keys. 4. Public key authentication attacks. Attacks against public key authentication processes are via TLS including asymmetric the elliptic curve Diffie-Hellman ECDH key exchange, which is used to decrypt the symmetric key (in this case, the Advanced Encryption Standard (AES) 128-bit key). The DTLS/TLS suites, negotiated between server and client, involve an exchange of information agreeing on the same secret key. For example, with the RSA public key cryptosystem, the client uses the server’s public key, obtained from the public key certificate, to encrypt the secret key information, which it then sends to the server, uniquely able to decrypt this message. Data transmission is then encrypted in GCM, and the elliptic curve digital signature algorithm (ECDSA) is used to authenticate the key exchange and the negotiated 256-bit secure hash function SHA256. The message authentication code (MAC)-then-encrypt design is applied to authenticate ECDSA key exchange to prevent attacks. 5. Spoofing attacks: A spoof IP address is used to send TCP/IP or UDP/IP data packets. As protection against spoofing,TLS/DTLS includes a cookie sent by the server, which forces the attacker/client to be able to receive the cookie. 6. Brute-force attacks. The attacker uses trial and error to crack passwords, login credentials, and encryption keys. To prevent cracking, default passwords and user accounts are disabled and the Secure ShellSSH protocol is protected by allowing access only to machines with authorized SSH keys. 7. Denial-of-service (DoS) attacks. Stateless TLS cookies are a protection against possible DoS attacks, as the server verifies the cookie and proceeds with the

6.2 Summary

109

handshake only if it is valid. This mechanism, however, does not provide any defense against DoS attacks from valid IP addresses. In the case of an internally hosted private server, the attack entry point is limited to open network ports. In the cloud, however, physical isolation of hardware is not always guaranteed, and some functionalities and resources might be shared with other cloud tenants. Smart home energy management systems provide informationrich data in the form of socioeconomic profiles, usage habits, appliances used, energy sources, and automation routines, etc, and consequently, a larger surface is available for privacy invasions than in other systems, most especially in the cloud. Data must therefore be protected from other tenants, external entities, and the cloud utility. While data encryption and access control can resolve the first 2 issues, protecting data from cloud service providers would require going a step further and ideally encrypting data even when processed in memory. It is therefore important to help and facilitate consumer understanding of what data smart home energy management systems collect and how the data can be shared without risk of unwanted disclosure and/or processing.

6.2 Summary This chapter has outlined the technologies that can be feasibly used to support the adoption of DSM tools and DR programs at the domestic level. To validate the feasibility of the aggregator, several hardware platforms (Raspberry Pi 4, 3B+, and 3B and Arduino Mega) are tested, returning feasible results considering the number of consumers. The Raspberry Pi 4 platform is especially efficient and lightweight, with the aggregator requiring less than 2 s to program consumers with 4 appliances. Data transmission between appliances uses current solutions, such as ZigBee, Z-Wave, and WiFi. Demand aggregation management is located in the NAN that connects the DR controllers in a two-way communication infrastructure responsible for ensuring flexibility. Protocols such as 3G/5G and LPWAN represent the best options for configuring connections between the most promising DR utility models and local energy services. The CoAP DTLS protocol is designed for devices and networks with certain limitations (e.g., low power, low data transmission rate, and networks using IEEE802.11 or IEEE802.15.4). The experiments demonstrate the feasibility of the DTLS-based communication framework, a viable solution for WiFibased consumer-aggregator communications, although its handshake is challenging due to the involvement of public key cryptography and the higher latency. MQTT is capable of meeting time specifications, so its maturity and configuration in this environment also merit consideration. In congested WiFi networks, MQTT achieves a RTT of 30–100 ms at the QoS 0, QoS 1, and QoS 2 levels, which is an acceptable delay when security encryption is not required. The MQTT protocol is especially suitable when contiguous location of the aggregator in the home means that the transmission distance is short.

110

6 Experimental Demand Scheduler Validation

WiFi connection may be less expensive than 3G since there is no payment per transmitted kB. 3G also requires an additional maintenance cost for each activated IoT SIM card. However, the advantage of 3G is that it is possible to access all devices via command lines and to check connection status from any location regardless of distance. This feature makes 3G the most appropriate choice in cases where the aggregator is located at a considerable distance from the residential building. 3G Sixfab provides private IP addresses for the home controller and the aggregator via a network address translation (NAT router. This IP configuration establishes communication between the aggregator, consumer, and an external MQTT server, with an approximate latency of 3000 ms depending on the quality of the message, making 3G MQTT an acceptable configuration for a more distant aggregator. Communication and data security complies with the key network security properties of availability, confidentiality, and integrity. Experimental security tests simulating attacks on different aggregator-consumer configurations show how messages can be intercepted and intercepted data can be classified with inadequate security settings. DoS attack tests may be affected by the impossibility of disconnecting the home controller, and a malformed data test may allow use of unrestricted values on published messages. This would confirm the need to modify default security settings, as any attacker could subscribe and post a topic. This, combined with the ability to post malformed data, enables attackers to cause errors and crashes in the IoT service.

References 1. C. Cruz, E. Palomar, I. Bravo, A. Gardel, Cooperative demand response framework for a smart community targeting renewables: testbed implementation and performance evaluation. Energies 13(11) (2020). https://doi.org/10.3390/en13112910. https://www.mdpi.com/1996-1073/13/11/ 2910 2. C.C. de la Torre, Sistema cooperativo de planificacion de demanda de electricidad agregada: comunidades sostenibles que optimizan el consumo de renovables. Ph.D. thesis, Universidad de Alcala (2022) 3. E. Palomar, I. Bravo, C. Cruz, Household Energy Demand Management (2023), pp. 65–92. https://doi.org/10.1002/9781119899457.ch3 4. A. Larmo, A. Ratilainen, J. Saarinen, Impact of coap and mqtt on nb-iot system performance. Sensors 19(1) (2018). https://doi.org/10.3390/s19010007. https://www.mdpi.com/1424-8220/ 19/1/7 5. D. Dinculeana, X. Cheng, Vulnerabilities and limitations of mqtt protocol used between iot devices. Appl. Sci. 9(5) (2019). https://doi.org/10.3390/app9050848. https://www.mdpi.com/ 2076-3417/9/5/848 6. M. Iglesias-Urkia, A. Orive, A. Urbieta, Analysis of coap implementations for industrial internet of things: a survey. Procedia Comput. Sci. 109, 188–195 (2017). https://doi.org/10.1016/j.procs. 2017.05.323. http://www.sciencedirect.com/science/article/pii/S1877050917309870. 8th International Conference on Ambient Systems, Networks and Technologies, ANT-2017 and the 7th International Conference on Sustainable Energy Information Technology, SEIT 2017, 16–19 May 2017, Madeira, Portugal 7. Y. Syafarinda, F. Akhadin, Z.E. Fitri, W.B. Yogiswara, E. Rosdiana, The precision agriculture based on wireless sensor network with MQTT protocol. IOP Conf. Ser.: Earth Envir. Sci. 207, 012059 (2018) 8. A. Palmieri, P. Prem, S. Ranise, U. Morelli, T. Ahmad, Mqttsa: a tool for automatically assisting the secure deployments of mqtt brokers, in 2019 IEEE World Congress on Services (SERVICES), vol. 2642 (IEEE, 2019), pp. 47–53

Chapter 7

Conclusions

Encouraging consumers to embrace renewable energies and energy efficiency solutions is crucial to sustainability, with utilities and policy-makers consequently opening up new value propositions for residential communities. A variety of business models are emerging that include DR systems, demand aggregators, and distributed load optimizers, focused on maximizing the inherent flexibility and diversity of behind-the-meter devices. Some aggregators can even signal consumers to modify their demand in response to utility requirements or market prices, when real-time pricing is interfaced with the distribution system. Both active demand and controlled DR push the whole chain of energy market actors to a positive environmental impact. Barriers to large-scale implementation of demand aggregation schedulers include the lack of a regulatory framework and conflicts of interest between consumers and service providers. Beyond the technical, geographical, and economic requirements for the implementation of a scheduler, the ultimate key is to involve the end user, as demand management systems will not be efficient without the acceptance and involvement of consumers. However, even though the added value of current developments is well understood and of growing interest, measurement of the desired levels of consumer engagement and technological readiness is still in the demonstration stage. Testbed scenarios have measured different indicators (such as the time flexibility of smart appliances, electricity consumption of in-home displays, performance indicators that reflect consumption patterns, etc.) that can be used to determine the impact and economic viability of residential DR programs. However, although communities could benefit from any of these advances, consumers tend to view the issue at the household scale and are mainly motivated by cost savings. Recent surveys analyzing the factors that discourage residential consumers regarding DSM and energy resource distribution indicate, as fear factors, the potential implementation costs and inappropriate utility information and support. This book describes guidelines for a pilot DR cooperation project based on a novel algorithmic approach to scheduling that aggregates and optimizes community energy demand and time flexibility, while maximizing use of the available renewable energy © The Author(s), under exclusive license to Springer Nature Switzerland AG 2024 C. Cruz, Sustainable Energy Efficient Communities, The Springer Series in Sustainable Energy Policy, https://doi.org/10.1007/978-3-031-49992-0_7

111

112

7 Conclusions

supply. Performance, feasibly, quality of service, and security are validated in a laboratory testbed, using lightweight and cost-effective hardware platforms (e.g., Raspberry Pi) and existing living-lab datasets. Piloted trials on the monitored consumers result in promising measures of a potential consumer response to DR programs. A preliminary analysis of consumer behaviors and consumption data in emulated scenarios using living-lab datasets identifies 3 main behavioral patterns regarding aggregation, with demand volume, demand evolution, and flexibility as key factors. The novelty resides in triggering cooperative DR action whereby consumers engage in a common (aggregated) view that reflects their demand and flexibility. The architecture supports an aggregated multiple-household electricity load scheduling system that allocates the available renewable energy supply, and doing so fairly according to the algorithmic response to consumer flexibility. This study should help establish better strategies for the deployment of DR programs in real-world residential communities of consumers, based on understanding and recognizing social and behavioral factors and their impact on consumer engagement and on aggregation performance.

Appendix

Questionnaire for Deploying DR Systems

This appendix contains questions and responses for an anonymous survey [1] that aimed to assess the impact and acceptance of a DR platform integrated into the lives of consumers and communities. • Are you familiar with or interested in energy efficiency tools in your home/region? 1. 2. 3. 4. 5. 6. 7. 8.

User applications. Smart home controllers. Smart appliances. Smart sensors. Government programs. Utility software. No interest. No familiarity.

• Are you familiar with/interested in renewable energy source generation? 1. 2. 3. 4. 5. 6.

Home-based microgeneration. Microgeneration in residential building. Government programs. Utility programs. No interest. No familiarity.

• How do you see your relationship with your electricity supplier? 1. I understand the consumption peaks and prices to reduce my consumption. 2. I understand consumption peaks and prices to reduce my consumption in the future. 3. I understand my bill. 4. I have a special plan (energy saving or energy efficient) with my supplier. 5. None of the above. 6. Other. © The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Switzerland AG 2024 C. Cruz, Sustainable Energy Efficient Communities, The Springer Series in Sustainable Energy Policy, https://doi.org/10.1007/978-3-031-49992-0

113

114

Appendix: Questionnaire for Deploying DR Systems

• Would you be interested in? 1. 2. 3. 4. 5. 6.

Automating the activation of your appliances. Automating lighting, heating and cooling systems. Automating the operation of your television. Generating energy with solar panels. None of the above. Other.

• Would you be willing to plan/estimate your energy demand for? 1. 2. 3. 4. 5.

The next day. The next 3 days. The next week. The next month. There is no time to do this.

• This research paper develops an aggregator that collects consumers’ demand, aggregates it, and then regroups it to create a community view of demand. Would you be concerned about...? 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.

The privacy of your data. Security of communication with the aggregator. Statistical data. Profile of the load. Use of data by third parties. The real benefits of aggregation. Fossil fuel vs renewable energy supply. Whether this means an increase in the bill. The impact of rescheduling on your time preferences. None of the above. Other.

• The consumer data collected comprises the activation time preference of each device. How would you consider the definition of this time? 1. Flexible; I would not mind a change. 2 Partially flexible; I would not mind a change on certain devices or days of the week. 3. Rigid; my time preferences are fixed. • These preferences would be entered through an application; would you have any problems using the application? 1. No. 2 Yes ... Which one? 3. I prefer other means such as ......

Appendix: Questionnaire for Deploying DR Systems

115

• A home controller is the device that communicates data between you and your aggregator and controls the activation of your appliances. It is small, efficient, and low cost. Would you have any problems installing this controller in your home? 1. No. 2. Yes... Which one? 3. I prefer other means ..... • The aggregation task results in a community demand vector, which is rescheduled according to the available supply of renewables, so each consumer will get a rescheduled demand vector. Which of the following options are you familiar with? 1 I trust the aggregator and would let my home controller activate/deactivate my appliances according to the rescheduled vector. 2. I trust the aggregator, but I prefer to verify the reprogrammed vector before giving control over the home appliance. 3. I trust the aggregator but prefer to control activation of my appliances myself. 4. I would not trust the aggregator... Why? 5. Other • I would trust more 1. The aggregator device in residential installations. 2 The aggregator device located in a utility installation. 3. The aggregator device located in consumer installations (the role is rotated every week or so). 4. Other. • The utility also has access to the community demand vector anonymously (billing is controlled through the smart metering infrastructure). From this data, novel planning for renewable generation and storage could emerge for the benefit of the community/district. What do you think? 1. 2. 3. 4.

Very good. Maybe good. I don’t mind. Other

• Would you be motivated to participate in this pilot to install the home controller in your home and the aggregator in your residential building? 1. Yes 2. No 3. Not sure... Why?

116

Appendix: Questionnaire for Deploying DR Systems

Reference 1. C.C. de la Torre, Sistema cooperativo de planificacion de demanda de electricidad agregada: comunidades sostenibles que optimizan el consumo de renovables. Ph.D. thesis, Universidad de Alcala (2022)