ABSTRACT Title of Dissertation: Three Essays on Optimization, Machine Learning, and Game Theory in Energy Pattanun Chanpiwat Doctor of Philosophy, 2023 Dissertation Directed by: Professor Steven A. Gabriel Department of Mechanical Engineering This dissertation comprises three main essays that share a common theme: developing methods to promote sustainable and renewable energy from both the supply and demand sides, from an application perspective. The first essay (Chapter 2) addresses demand response (DR) scheduling using dynamic programming (DP) and customer classification. The goal is to analyze and cluster residential households into homogeneous groups based on their electricity load. This allows retail electric providers (REPs) to reduce energy use and financial risks during peak demand periods. Compared to a business-as-usual heuristic, the proposed approach has an average 2.3% improvement in profitability and runs approximately 70 times faster by avoiding the need to run the DR dynamic programming separately for each household. The second essay in Chapter 3 analyzes the integration of renewable energy sources and battery storage in energy systems. It develops a stochastic mixed complementarity problem (MCP) for analyzing oligopolistic generation with battery storage, taking into account both con- ventional and variable renewable energy supplies. This contribution is novel because it considers multi-stage stochastic MCPs with recourse decisions. The sensitivity analysis shows that increas- ing battery capacity can reduce price volatility and variance of power generation. However, it has a small impact on carbon emissions reduction. Using a stochastic MCP approach can increase power producers’ profits by almost 20 percent, as proposed by the value of stochastic equilib- rium solutions. Higher battery storage capacity reduces the uncertainty of the system in all cases related to average delivered prices. Nevertheless, investing in enlarging battery storage has di- minishing returns to producers’ profits at a certain point restricted by market limitations such as demand and supply or pricing structure. The third essay (Chapter 4) proposes a new practical application of the stochastic dual dynamic programming (SDDP) algorithm that considers uncertainties in the electricity market, such as electricity prices, residential photovoltaic (PV) generation, and loads. The SDDP model optimizes the scheduling of battery storage usage for sequential decision-making over a planning horizon by considering predicted uncertainty scenarios and their associated probabilities. After examining the benefits of shared battery storage in housing companies, the results show that the SDDP model improves the average objective function values (i.e., costs) by approximately 32% compared to a model without it. The results also indicate that the mean objective function values at the end of the first stage of the proposed SDDP model with battery storage and the deterministic LP model equivalent (with perfect foresight) with battery storage differ by less than 30%. The models and insights developed in this dissertation are valuable for facilitating energy policy-making in a rapidly evolving industry. Furthermore, these contributions can advance com- putational techniques, encourage the use and development of renewable energy sources, and in- crease public education on energy efficiency and environmental awareness. THREE ESSAYS ON OPTIMIZATION, MACHINE LEARNING, AND GAME THEORY IN ENERGY by Pattanun Chanpiwat Dissertation submitted to the Faculty of the Graduate School of the University of Maryland, College Park in partial fulfillment of the requirements for the degree of Doctor of Philosophy 2023 Advisory Committee: Professor Steven A. Gabriel, Chair/Advisor, Department of Mechanical Engineering Professor Qingbin Cui, Dean’s Representative, Department of Civil and Environmental Engineering Professor Hosam K. Fathy, Department of Mechanical Engineering Associate Professor Mark D. Fuge, Department of Mechanical Engineering Associate Professor Fabricio Oliveira, Department of Mathematics and Systems Analysis, Aalto University, Finland Dr. Maxwell Brown, U.S. National Renewable Energy Laboratory © Copyright by Pattanun Chanpiwat 2023 Dedication I dedicate my dissertation work to my family and the scientific community. ii Acknowledgments I would like to express my gratitude to my advisor, Professor Steven A. Gabriel, whose support and commitment have been crucial in bringing me to this point. Looking back to day one, I have improved tremendously under your supervision in many areas, including but not limited to background and theory, large-scale mathematical modeling, analysis and articulation of research outcomes, and most importantly, becoming a good scientific researcher. Your patience and guidance have helped me become who I am today. Your feedback resonated with me, “It’s okay to struggle. It may take time to understand new material, but as long as you learn from it, that’s what’s most important.” I will keep this in my heart and use this teaching philosophy with my future students, trainees, and colleagues. I am deeply grateful for the opportunity to work with you and to learn from your expertise. Additionally, your humble and personable demeanor has taught me invaluable soft skills that I will carry with me throughout my career. Dear Mrs. Pakamon Chanpiwat, I just wanted to let you know how much I love and ap- preciate you. You mean the world to me! I am grateful for the love and support you show me every day. Your sacrifices for our family have not gone unnoticed. I understand that supporting me meant putting your career path on hold, and for that, I cannot thank you enough. Your ded- ication to our children is unparalleled, and I appreciate how you have taken care of our family, allowing me to focus on my Ph.D. studies. As Michelle Obama once said, marriage isn’t always a 50-50 split, and I know that during this time, it may have felt more like a “70% you and 30% iii me” situation. However, I promise to make it up to you in every way possible, just as you have supported me. You are the real MVP (most valuable player) of our family, and your contributions are essential to our success. I feel so lucky to have found someone as kind, loving, and beautiful as you. I promise to cherish and love you for the rest of my life. Thank you for being my wife and my partner in life. Dear my two beloved children, I cannot express in words how much joy and happiness you have brought into my life. Being your father is a privilege and an honor that I cherish every day. You are the sunshine that brightens my mornings and the stars that light up my nights. As you grow and develop, I want you to know that my love and support for both of you are unwavering. I will always be there for you, no matter what challenges life throws your way. I want you to have a wonderful and memorable childhood, full of laughter, love, and good memories that you can look back on with fondness. My hope is that you will grow up to be responsible adults who contribute positively to society. I will do my best to prepare you for the challenges that lie ahead, to instill in you good values and morals, and to encourage you to reach for your dreams and aspirations. Thank you for being my children and for bringing so much joy to my life. I love you both more than words can express, and I will always be your biggest supporter and advocate. With love and admiration, Daddy. I would like to take this opportunity to express my deepest gratitude to my wonderful parents who gave birth to me and have always been there for me, providing me with unwavering moral support even when we are more than 10,000 miles apart. Their love and guidance have been an integral part of my life, and I cherish every moment spent with them. I am particularly grateful for the three visits they made to the U.S. while I was here, during which we had the chance to create unforgettable memories together. Furthermore, I would also like to extend my appreciation iv to my dear older brother, who has always been a great source of support and guidance for our family. He has been taking good care of our parents back home, and I cannot thank him enough for his selfless dedication. I am truly blessed to have such wonderful parents and brother, and I am forever grateful for their love and support throughout my life’s journey. Professor Fabricio Oliveira, I would like to express my sincere gratitude for your sup- port and mentorship during my time at Aalto University in Finland. Working as a part of your Gamma-opt research group was an incredibly challenging and rewarding experience for me. Your guidance and expertise have been instrumental in helping me gain a good understanding of Julia and its powerful applications in optimization. Your supervision of my dissertation and involve- ment in the EasyDR project have been invaluable to me. Your feedback and insights have helped me grow as a researcher and have given me the tools to tackle complex problems. I appreciate the time and effort you put into serving on my dissertation committee and for your dedication to helping me succeed. To Maxwell Brown, Ph.D., I am grateful to you, for the opportunity to work with you and the team at U.S. National Renewable Energy Laboratory (NREL). Your mentorship and support have been invaluable in shaping my academic and professional journey in large-scale modeling, specifically the Regional Energy Deployment System (ReEDS) model. Working with a talented and diverse group of researchers has improved my coding skills and broadened my knowledge in renewable energy. Your contributions to our paper and dissertation have greatly improved their quality and impact. I also thank you for serving on my committee and being a significant source of motivation throughout my academic journey. Your feedback and guidance have been instrumental in shaping my research. I look forward to future collaborations in renewable energy. I want to thank Clayton Barrows, Dheepak Krishnamurthy, and Daniel Steinberg for my time at v NREL. It was an incredible opportunity to work with you and the team. Professor Mark Fuge: Thank you for your class. It was packed with materials for a semester, but I learned a lot from it. Also, thank you for serving on my committee. Profes- sor Hosam Fathy: Thank you for your lectures and for serving on my dissertation committee. Professor Qingbin Cui: Thank you for serving as the Dean’s Representative. Mr. Thomas Howard Beigel: I have worked with you for many years, and you have re- freshed my core engineering background. I feel proud to be an engineer again. Kevin M. Calabro and Dr. Robert J. Bonenberger, thank you for having me on your Keystone staff. Professor David Bigio: It was my pleasure to work with you for multiple semesters. Your kindness will always be remembered. Professor Michel Cukier and Professor Fuge, it was fun to work with both of you for many years. I always smiled when I thought about how much we achieved for PrairieLearn in a single semester. Professor Shapour Azarm: Thank you for your classes and for giving me the chance to work with you as a teaching assistant. Thank you Professor Bruce L. Golden, Profes- sor Johan Larsson, Professor Chopra Nikhil, and Professor Courtney Paulson for your valuable lectures. I would like to express my gratitude to the faculty and staff of the University of Maryland Mechanical Engineering Department, including Kerri Poppler James, Professor Peter Sandborn, Nikki Morris, Sripen Penny Komsat, Gina Speaks, Isabelita S. Brown, Segen Sara A. Habte, and Megan Elizabeth Petry, for their help and support. Additionally, I would like to thank the faculty and staff of Aalto University, including Ahti Salo, Afzal Siddiqui, and Johanna Glader, as well as Maisa Rein and Minna Westerlund. Your support was greatly appreciated. Thank you all. Thank you very much, Mr. Tritana Supamusdisukul and Ms. Warangkana Rusitanonta, for your hospitality in hosting my family for multiple years. We cannot imagine how our lives would vi have been without your support. A special thanks to Prima Supamasukul, who brought daily joy to our family. It is my pleasure to see you grow up. And last but not least, I would like to thank Kanoon for being a great companion. I just wanted to take a moment to express my sincere gratitude to Lieutenant Colonel Sek- sun Moryadee, Ph.D. I am so grateful to have had you as a senior colleague who introduced me to the fascinating world of large-scale mathematical modeling, specifically the World Gas Model. Your works and applications have truly inspired me and further sparked my interest in operations research (OR) and the field of optimization. I also appreciate the introduction to your former advisor, Professor Steven A. Gabriel, at the University of Maryland, College Park, who is a renowned expert in this area. Thank you for your support. I feel incredibly lucky to have had the chance to work alongside such talented and ded- icated colleagues throughout my academic and professional journey. Rachel Moglen, Michael Siemann, Chad Huemme, Nathan Boyd, Kevin Quigley, Tony Shu, Andrew Blohm, Julia Fil- iberti Allen, Stephanie Allen, Olli Herrala, Nikita Belyak, Topias Terho, Paula Weller, Helmi Hankimaa, Joaquin de la Barra, Jussi Leppinen, Olander Leevi, and Juho Roponen have all made significant contributions to my development as a researcher. vii Table of Contents Preface ii Foreword ii Dedication ii Acknowledgements iii Table of Contents viii List of Tables xi List of Figures xii List of Abbreviations xiv Chapter 1: Introduction 1 1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.2.1 Optimality and Complementarity . . . . . . . . . . . . . . . . . . . . . . 6 1.2.2 Stochastic Dual Dynamic Programming (SDDP) . . . . . . . . . . . . . 8 1.3 Organization of the Dissertation . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.4 Summary of the Dissertation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.4.1 Essay 1 (Chapter 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.4.2 Essay 2 (Chapter 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.4.3 Essay 3 (Chapter 4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.5 Papers and Presentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.5.1 Presentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Chapter 2: Using Cluster Analysis and Dynamic Programming for Demand Response Applied to Electricity Load in Residential Homes 28 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.2 Clustering Algorithm and Evaluation . . . . . . . . . . . . . . . . . . . . . . . 36 2.2.1 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.2.2 Dynamic Program Formulation . . . . . . . . . . . . . . . . . . . . . . . 37 2.2.3 Estimating Demand Response Profits With the Dynamic Programming Using Historical Locational Marginal Prices . . . . . . . . . . . . . . . . 38 viii 2.2.4 Clustering Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.2.5 Clustering Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.3 Experimental Case Study and Results . . . . . . . . . . . . . . . . . . . . . . . 51 2.3.1 Demand Response and Volatility of Locational Marginal Prices . . . . . . 51 2.3.2 Opportunities to Improve Demand Response Profitability . . . . . . . . . 52 2.3.3 Improvement of Clustered Load-Profile Method over Greedy Method . . 54 2.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 2.5 Chapter Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Chapter 3: Multi-Stage Modeling with Recourse Decisions for Solving Stochastic Com- plementarity Problems with An Application In Energy 60 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 3.1.1 Research Objectives and Contributions . . . . . . . . . . . . . . . . . . . 68 3.1.2 Structure of the Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 3.2 Complementarity Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 3.2.1 Decision Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 3.2.2 Model Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 3.2.3 Multi-Stage, Stochastic Mixed Complementarity Problems . . . . . . . . 78 3.2.4 Quality Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 3.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 3.3.1 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 3.3.2 Case Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 3.3.3 A 3-Bus Network Example . . . . . . . . . . . . . . . . . . . . . . . . 91 3.3.4 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 3.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 3.5 Chapter Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Chapter 4: Optimizing Operations Planning of Stand-Alone Battery Storage Using Stochas- tic Dual Dynamic Programming: A Case Study of Southern German Resi- dential Households 100 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 4.1.1 Research Objectives and Contributions . . . . . . . . . . . . . . . . . . . 105 4.2 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 4.2.1 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 4.3 Model I: Stochastic Dual Dynamic Programming . . . . . . . . . . . . . . . . . 109 4.3.1 Decision Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 4.3.2 Prediction of Uncertainty in the Electricity Market . . . . . . . . . . . . 117 4.3.3 Linear Policy Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 4.4 Model II: Multi-Stage, Linear Programming Problem Model . . . . . . . . . . . 134 4.5 A Numerical Example: Southern German Household . . . . . . . . . . . . . . . 137 4.5.1 Comparing Stochastic Solutions of SDDP Model with Conventional Stochas- tic LP Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 4.6 Life Cycle Cost Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 4.7 Computational Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 4.8 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 ix 4.9 Chapter Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 Chapter 5: Conclusions and Future Work 164 5.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 5.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Bibliography 169 x List of Tables 1.1 Selected Literature Review of Essays 1, 2, and 3 . . . . . . . . . . . . . . . . . . 3 1.2 Key Areas of Research Questions and Goals . . . . . . . . . . . . . . . . . . . . 13 1.3 List of Journal Articles and Conference Proceeding . . . . . . . . . . . . . . . . 24 1.4 List of Presentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.1 Household Electricity Load [126] and LMPs Data [36] . . . . . . . . . . . . . . 37 2.2 Percentages of Shiftable HVAC Load for DP (with illustrative values) [91, 92, 127] 40 3.1 Sets of Time Periods for T ‡ 1 , T ‡ 2 ⊂ T of gslowfiuts and T ‡‡ 1 , ..., T ‡‡ 4 ⊂ T of gimd fiuts . . . 73 3.2 Power Plants’ Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 3.3 Generating Capacity (MW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 3.4 Power Transfer Distribution Factors (PTDF) [88] . . . . . . . . . . . . . . . . . 83 4.1 Data Description and Accuracy Measure of Electricity Demand Prediction in kWh 118 4.2 Data Description and Accuracy Measure of Electricity Price Prediction in C/kWh 118 4.3 Data Description and Accuracy Measure of PV Generation Prediction in kWh . . 119 4.4 Parameters for A Numerical Example [111, 149] . . . . . . . . . . . . . . . . . . 137 4.5 Variables’ Bounds for A Numerical Example . . . . . . . . . . . . . . . . . . . . 137 4.6 Information of Objective Function Values at the First Stage Across All Planning Horizons r ∈ R for the SDDP Model With and Without Battery Storage . . . . . 142 4.7 Information of Objective Function Values at the First Stage Across All Planning Horizons r ∈ R for the LP Model With and Without Battery Storage . . . . . . . 146 4.8 Information of Objective Function Values at the First Stage Across All Planning Horizons r ∈ R for the SDDP Model and LP Model With Battery Storage . . . . 149 4.9 Information of Objective Function Values at the First Stage Across All Planning Horizons r ∈ R for the SDDP and LP Models Without Battery Storage . . . . . . 152 4.10 Initial Installed Capital Costs of Energy Storage Subsystems [109] . . . . . . . . 156 4.11 Operating and Decommissioning Costs and Saving of Energy Storage Subsys- tems [109] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 4.12 Life Cycle Cost of A Lithium-ion Battery (LFP, 2 kW, 4 hr) . . . . . . . . . . . . 157 4.13 Computational Results of SDDP and LP Models . . . . . . . . . . . . . . . . . . 159 xi List of Figures 1.1 Locational Marginal Price Spikes on May 30, 2015, for Houston, Texas [36] . . . 14 2.1 Hourly LMPs of Texas between May 1 - September 30, 2017, from the Electric Reliability Council of Texas [36] . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.2 Three Randomly Selected Households with DP Event Duration, DR Profit, and Electricity Load Profile Between May 1 to September 30, 2017 . . . . . . . . . . 43 2.3 24 Hourly LMPs Of Texas Between May 1 - September 30, 2017 . . . . . . . . . 48 2.4 Estimated DR Profits Using DP by the Brute-Force Method Between May 1 to September 30, 2017 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 2.5 Sensitivity Analysis on Percent Household Selection of the Brute-Force Method and The Greedy Method Between May 1 to September 30, 2017 . . . . . . . . . 54 2.6 Four Load Cases of Randomly Selected 3,000 Households With Two km and Two kp by CLPM with Left) Cumulative Cases, Right) Individual Cases . . . . . . . . 55 2.7 Opportunity for Profitability Improvement (%) with The CLPM Over the Greedy Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 2.8 Ratio of Profitability Improvement (%) Over Calculation Time (Min.) of The CLPM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 3.1 Interrelated Optimization Problems and Equilibrium Problem (KKT) . . . . . . . 71 3.2 Scenario Tree for a Twelve-Hour Period in a Three-Stage Problem (the Last Stage Being the Recourse Decisions). . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 3.3 Scenarios of Demand (MW) by Locations [108] . . . . . . . . . . . . . . . . . . 90 3.4 Scenarios of Wind Generation (MW) by Locations [108] . . . . . . . . . . . . . 91 3.5 Scenarios of PV Generation (MW) by Locations [108] . . . . . . . . . . . . . . 92 3.6 A 3-Bus System of the Transmission System . . . . . . . . . . . . . . . . . . . . 93 3.7 Percent Improvement of EVPI and VSES Values by Case Study . . . . . . . . . . 94 3.8 Box-Plots of Power Market’s Delivered Electricity Prices . . . . . . . . . . . . . 95 3.9 Battery Storage’s Sensitivity Analysis On Total Emission, Generation, and Profit by Firm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 4.1 Two approaches: Multi-stage, Deterministic, Linear Programming Model and SDDP model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 4.2 Historical Values of Electricity Consumption, PV Generation, and Electricity Prices Between April 8, 2016, to June 30, 2016 . . . . . . . . . . . . . . . . . . 111 4.3 Planning Time Horizon for Price and Demand Prediction . . . . . . . . . . . . . 112 4.4 Box-Plot of Historical PV Generation between April 1, 2016, to June 30, 2016 . . 113 xii 4.5 Planning Time Horizon for Residential Electricity Price and Residential Electric- ity Demand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 4.6 Prediction of Electricity Demand by All Models over Planning Horizon Stage . . 124 4.7 Histogram of Residential Electricity Demand Prediction for All Hours . . . . . . 125 4.8 Prediction of Electricity Price by All Models over Planning Horizon Stage . . . . 126 4.9 Histogram of Residential Electricity Price Prediction for All Hours . . . . . . . . 127 4.10 Prediction of Electricity PV Generation by All Models over Planning Horizon Stage128 4.11 Histogram of PV Generation Prediction for All Hours . . . . . . . . . . . . . . . 129 4.12 Linear Policy Graph in an SDDP Model for Each Planning Horizon r ∈ R . . . . 130 4.13 Histogram of Objective Function Values for All Four Models (First-Stage for Each Planning Horizon r ∈ R) between April 8, 2016, to June 30, 2016 . . . . . 139 4.14 Box-Plots of Objective Function Values for All Four Models (First-Stage for Each Planning Horizon r ∈ R) between April 8, 2016, to June 30, 2016 . . . . . . . . 140 4.15 Objective Function Values at the First-Stage Across All Planning Horizons r ∈ R for the SDDP Model With and Without Battery Storage . . . . . . . . . . . . . . 141 4.16 Objective Function Values at the First-Stage Across All Planning Horizons r ∈ R for the LP Model With and Without Battery Storage . . . . . . . . . . . . . . . . 145 4.17 Battery Storage Usage of SDDP and LP Models With Battery Storage at the End of the First Stage Across All Planning Horizons r ∈ R . . . . . . . . . . . . . . 147 4.18 Objective Function Values at the End of the First Stage Across All Planning Hori- zons r ∈ R for the SDDP and LP Models With Battery Storage . . . . . . . . . . 148 4.19 Objective Function Values at the End of the First Stage Across All Planning Hori- zons r ∈ R for the SDDP and LP Models Without Battery Storage . . . . . . . . 153 xiii List of Abbreviations AC Air Conditioning AEP American Electric Power, a Power Utility ARIMA Autoregressive Integrated Moving Average C1 BASE Base Case Study C2 CEN Centralized-Controlled Case C3 HFC High Fossil Fuel Price Case Study C4 LFC Low Fossil Fuel Price Case Study C5 HVA High VRE Availabilities Case Study CC Combined Cycle CLPM Clustered Load-Profile Method COMED Commonwealth Edison, a Power Utility CTF Combustion Turbine Fossil DOM Dominion, a Power Utility DP Dynamic Programming DR Demand Response EIA U.S. Energy Information Agency EVPI Expected Value of Perfect Information ERCOT Electric Reliability Council of Texas FEMP Federal Energy Management Program FERC U.S. Federal Energy Regulatory Commission Fingrid Finnish National Electricity Transmission Grid Operator FMI Finnish Meteorological Institute GW Gigawatt HE Hydroelectric HVAC Heating, ventilation, and air conditioning kg Kilogram xiv ICT Information and Communication Technologies IEA International Energy Agency IoT Internet of Things ISO Independent System Operator KKT Karush–Kuhn–Tucker (conditions) kWh Kilowatt-Hour LCC Life Cycle Cost LCCA Life Cycle Cost Analysis LFP Lithium-ion Battery LLC Local-Level Cycle LMPs Locational Marginal Prices MAE Mean Absolute Error MCP Mixed Complementarity Problem MDA Multivariate Discriminant Analysis MSE Mean Squared Error MW Megawatt MWh Megawatt-Hour NIST National Institute of Standards and Technology NTNU Norwegian University of Science and Technology NU Nuclear PAM Partitioning Around Medoids PJM Pennsylvania, Jersey, Maryland Interconnection PTDF Power Transfer Distribution Factors PV Photovoltanics PV Present Value Q Quadrant REPs Retail Electric Providers RES Renewable Energy Systems RMSE Root Mean Squared Error RTO Regional Transmission Organization SARIMA Seasonal Autoregressive Integrated Moving Average xv SDDP Stochastic Dual Dynamic Programming SF Steam Fossil SPV Single Present Value TSO Transmission System Operator UN United Nations UPV Uniform Present Value VRE Variable Renewable Energy VSES Value of the Stochastic Equilibrium Solution WL Whisker Labs WN Onshore-Wind xvi Chapter 1: Introduction 1.1 Motivation According to the United Nations (UN), renewable energy is a way to ensure a safer future [139]. Energy derived from fossil fuels poses a significant challenge to the climate. At the same time, renewable energy sources are a key component of the solution. To mitigate the impacts of climate change, it is necessary to decrease global carbon dioxide emissions by approximately 50% by 2030 and achieve the Net Zero Emissions (NZE) Scenario by 2050, a normative International Energy Agency (IEA) scenario [61, 139]. To achieve this goal, we must reduce our dependence on fossil fuels and focus on developing clean, accessible, reliable, economical, and sustainable sources of energy. In recent years, there has been significant progress in the development of renewable technologies. According to the IEA, in 2022, we have achieved a record-breaking year for renewable capacity, having added approximately 340 GW in various forms such as solar, wind, hydro, geothermal, and ocean energy [62]. At the same time, there is still room for improvement as we aim to increase the proportion of energy from these technologies from 5% in 2022 to 17% by 2030 in order to meet the NZE goals by 2050. The move towards a more sustainable world requires a greater reliance on renewable energy sources. 1 In this dissertation, we explore the significance of energy efficiency and renewable energy in reducing carbon emissions in the global energy system, as identified by the IEA in 2022 [62]. The three essays in this dissertation are unified by a common theme: developing ways to promote sustainable and renewable energy both supply and demand sides from an application perspective. 2 Ta bl e 1. 1: Se le ct ed L ite ra tu re R ev ie w of E ss ay s 1, 2, an d 3 A re a [8 7] [1 23 ] [8 3] [6 5] [1 37 ] [4 0] [4 7] [8 0] [9 4] [1 45 ] [1 17 ] [1 13 ] [3 0] [4 4] [1 9] [5 4] [1 18 ] [5 1] [1 44 ] [1 6] [4 ] [1 7] [6 7] [7 ] [1 00 ] [1 04 ] [2 5] [2 4] E ss ay 1 E ss ay 2 E ss ay 3 O pt im iz at io n an d B i-L ev el O pt im iz at io n Pr ob le m : B i- L ev el O pt im iz at io n Pr ob le m ✓ ✓ ✓ ✓ ✓ ✓ ✓ C lu st er A na ly si s ✓ ✓ ✓ ✓ ✓ ✓ E le ct ri ci ty L oa d Pr ofi le ✓ ✓ ✓ ✓ C om pl em en ta ri ty Pr ob le m ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ D yn am ic Pr og ra m m in g ✓ ✓ ✓ ✓ ✓ M ul ti- St ag e Pr ob le m ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Ti m e Se ri es D at a ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ R is k M an ag em en ta nd H ed gi ng St ra te gy : C ha nc e C on st ra in ts ✓ ✓ D em an d R es po ns e, H ed gi ng , an d L oa d Sh if tin g ✓ ✓ ✓ ✓ ✓ ✓ ✓ R ec ou rs e Pr ob le m s ✓ ✓ ✓ ✓ R ob us tO pt im iz at io n ✓ ✓ ✓ ✓ ✓ St oc ha st ic Pr og ra m m in g ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ A dv an ce d C om pu ta tio na l Te ch ni qu es : D ec om po si tio n Te ch ni qu e ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Pa ra lle lC om pu tin g ✓ R ol lin g H or iz on ✓ ✓ ✓ ✓ Pr ed ic tio n Te ch ni qu e ✓ ✓ G re en E ne rg y: E ne rg y St or ag e ✓ ✓ ✓ ✓ ✓ ✓ ✓ Po w er M ar ke tM od el in g ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ R en ew ab le E ne rg y ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ 3 In Essay 1 (Chapter 2), we apply a cluster analysis, an unsupervised machine learning technique, and dynamic programming (DP) to enhance the DR1 scheduling program within the residential electricity market for REPs [11]. To make informed decisions about demand response among similar groups of customers, it is necessary to classify residential customers based on their electricity load profiles. We used the Partitioning Around Medoids technique (also known as K-Medoids) to group households with similar electricity-use patterns [73]. The contribution of Essay 1 is novel because it combines multistage dynamic programming and cluster analysis on time-series electricity load profiles, tested with real-world load data of residents in Texas. This combination has not been observed in the literature, as shown in Table 1.1. Essay 2 (Chapter 3) analyzes how integrating renewable energy and battery storage into the electricity market affects the market equilibrium [10]. The essay presents a multi-stage model with recourse decisions that solve stochastic complementarity problems in a competitive electric- ity market with variable renewable energy considerations. We employ a Nash-Cournot formula- tion to represent imperfect competition between power producers and a grid owner [43, 54, 144]. The study investigates the potential impact of renewable energy and battery storage on all partic- ipants in the electricity market, including electricity prices, battery storage usage, and emissions. This research is novel because it approaches the problem from a market equilibrium perspective, using the Nash-Cournot formulation of imperfect competition among power producers, instead of just a single optimization problem. It takes into account a multi-stage optimization problem, a recourse decision in a rolling-horizon manner, the stochasticity of variable renewable energy, and battery storage scheduling. What makes this essay unique is the combination of these aspects, as 1DR is an electricity program that permits consumers and retail electricity providers (REPs), or power providers, to shift load over time especially when power is scarce. 4 shown in Table 1.1. The third essay (Chapter 4) in this series develops an optimization model for determining the operational strategies of stand-alone battery storage in a residential community [12]. The model presents a new practical application of the stochastic dual dynamic programming (SDDP) algorithm [25, 105] and takes into account uncertainties in the electricity market, including elec- tricity prices, residential photovoltaic (PV) generation, and loads. To demonstrate the effective- ness of our approach, we use actual 2016 electricity market data from Southern Germany in a case study [18]. Our first approach is the proposed SDDP model, which breaks down the problem into smaller sub-problems and incorporates probabilistic models to account for uncertainty. We use time-series forecasting techniques such as exponential smoothing, seasonal auto-regressive inte- grated moving averages, and local-level models to predict future uncertainties (electricity prices, residential photovoltaic (PV) generation, and loads) for predicting three types of uncertainties previously mentioned above [121]. The SDDP model considers predicted uncertainty scenar- ios and their associated probabilities to optimize battery storage usage scheduling for sequential decision-making over a planning horizon. To evaluate the performance of our SDDP model, we formulated a second approach using a multistage convex stochastic optimization model, as- suming perfect foresight of the uncertainties [16, 67]. Essay 3 introduces a novel contribution: a multi-stage stochastic dual dynamic programming (SDDP) model created to optimize battery storage scheduling. The model can utilize past time series data to predict future electricity prices, residential photovoltaic (PV) generation, and loads with high chronological accuracy, down to an hourly resolution. The model was tested using real-world residential data from Southern Ger- many in 2016, making this combination novel. 5 1.2 Background 1.2.1 Optimality and Complementarity This section introduces the mathematical formulation of complementarity models that are useful in simultaneously solving optimization problems that involve one or more decision-makers who interact with each other [118]. They have proven to be particularly effective in resolving bottom-up energy market models [43]. Chapter 3 of this dissertation uses complementarity mod- els for an application in the energy market, which we introduce here [43, 54, 118]. The set of indices i ∈ I represents |I| players in the problem. Each player i has their own optimization problem with an objective, such as maximizing profit or minimizing cost. The general formulation [118] can be expressed as Eq. 1.1, as shown below. min xi fi(x) (1.1a) s.t. gij(xi) ≤ 0 (αij) ∀ i = 1, ..., I, j = 1, ..., J (1.1b) hik(xi) = 0 (βik) ∀ i = 1, ..., I, k = 1, ..., K (1.1c) −xi ≤ 0 (νi) (1.1d) The vector xi ∈ Rni is a set of decision variables controlled by player i. The objective function, defined as fi(x) : Rn −→ R in Eq. 1.1a, is subject to the inequality constraints in Eq. 1.1b, represented by gij(xi) : Rn −→ R, and equality constraints in Eq. 1.1c, represented by hik(xi) : Rn −→ R, respectively. The associated dual variables for the constraints in Eq. 1.1b and 6 in Eq. 1.1c are denoted by αij ∈ R and βik ∈ R, respectively. Additionally, Eq. 1.1d imposes nonnegativity of xi, and its associated dual variables are denoted by νi ∈ Rni . We can assume that the objective function (Eq. 1.1a) depends on variable x ∈ Rn, which contains decision the vectors of all players’ decisions xi ∈ Rni |x = {xT 1 , ..., x T i , ..., x T I }T , where ∑I i ni = n. The Karush-Kuhn-Tucker (KKT) conditions related to the problem in Eq. 1.1, as depicted in Eq. 1.2, can be derived only if functions fi(x) (Eq. 1.1a), gij(xi) (Eq. 1.1b), and hik(xi) (Eq. 1.1c) are continuously differentiable [43]. We can conclude that solving the complementarity system in Eq. 1.2 is equivalent to solving the optimization problem in Eq. 1.1 [43, 118] if and only if these conditions are met: 1) fi(x) and gij(xi) are both convex and 2) Equations 1.1b and 1.1c satisfy standard constraint qualification conditions (e.g., one of the linear independence, Slater, Kuhn-Tucker, or weak reverse convex constraint qualifications) [41] so that the KKT conditions in Eq. 1.2 are both necessary and sufficient for optimality. 0 = ∇xi fi(x) + J∑ j=1 ∇xi gij(xi)αij + K∑ k=1 ∇xi hik(xi)βik (1.2a) 0 ≤ −gik(xi) ⊥ αij ≥ 0, ∀ i = 1, ..., I, j = 1, ..., J (1.2b) 0 = hik(xi), βik free, ∀ i = 1, ..., I, k = 1, ..., K (1.2c) The problem in Eq. 1.2 is an example of a mixed complementarity problem (MCP) which is defined more generally as an equation with corresponding free variables and inequalities with associated nonnegative variables [43]. 7 1.2.2 Stochastic Dual Dynamic Programming (SDDP) In this section, we provide a detailed summary of the stochastic dual dynamic programming algorithm [104, 105]. This algorithm forms the foundation of our heuristic application for Essay 3 (Chapter 4), which has been developed with the aim of optimizing battery storage schedul- ing [12]. The SDDP algorithm is commonly used for solving multistage stochastic optimization problems due to its ability to avoid state discretization (of the state space), which can lead to an extremely large number of states (referred to as the curse of dimensionality in dynamic program- ming). For instance, in a problem with a two-stage dynamic algorithm, we have to discretize a first-stage variable x1 into a set of trial values {x̂1i, i = 1, ..., n}, which then necessitates solving the second-stage problem for each of the trial values. The SDDP algorithm approximates the ex- pected cost-to-go functions2 (or alternatively called a future cost function) of stochastic dynamic programming by using piecewise linear functions. The piecewise functions obtained from the dual solutions of the optimization problem at each stage of the subproblem in Eq. 1.3 can be understood as Benders cuts [17] in a stochastic, multistage decomposition algorithm [105]. The algorithm is ideal for implementation in parallel processing and is therefore suitable for large- scale applications. The SDDP algorithm, proposed by [105], can be summarized as follows. The two-stage stochastic dual dynamic programming problem is described in Eq. 1.3. 2These functions are used to approximate the expected value of each subproblem [26]. 8 min c1x1 + p1c2x21 + · · ·+ pmc2x2m (1.3a) s.t. A1x1 ≥ b1 (1.3b) E1x1 + A2x21 ≥ b21 (1.3c) E1x1 + A2x22 ≥ b22 (1.3d) . . . (1.3e) E1x1 + A2x2m ≥ b2m, (1.3f) In the first stage of Eq. 1.3, a decision of x1 is made. As a result, there are m second-stage subproblems for each trial decision x1. α1j(x1) = min c2x2j ∀j = 1, ...,m (1.4a) s.t. A2x2j ≤ b2j − E1x1 ∀j = 1, ...,m (1.4b) for all j = 1, ...,m. The objective function, as formulated in Eq. 1.3a, is to minimize the sum of the first-stage immediate costs, c1x1, and the expected values of the second-stage costs,∑m j=1 pjc2x2j . The sum of all probabilities for each subproblem, pj , equals one, ∑m j=1 pj = 1. We can use a stochastic dynamic recursion, as discussed in [105], to solve Eq. 1.3. Ad- ditionally, we can estimate the expected future cost function ᾱ1(x1) using Eq. 1.5, where the function α1j(x1) has been previously defined in Eq. 1.4. 9 ᾱ1(x1) = m∑ j=1 pja1j(x1) (1.5) Therefore, we can express the first-stage problem of the dynamic recursion as Eq. 1.6, where c1x1 denotes the immediate cost of x1, and ᾱ1(x1) represents the expected future conse- quence of x1. It is worth noting that the dual dynamic programming algorithms bear a resem- blance to the deterministic case when the future cost function is piecewise linear. min c1x1 + ᾱ1(x1) (1.6a) s.t. A1x1 ≥ b1 (1.6b) Without loss of generality, we assume that the right-hand side vectors bt for t = 1, . . . , T are independent random variables. Each bt is then discretized into m scenarios {btj, j = 1, . . . ,m}, each with its associated probability {ptj, j = 1, . . . ,m}. min ctxt + ᾱt(xt) (1.7a) s.t. Atxt ≥ btj − Et−1x̂t−1i (πt−1ij) (1.7b) The Eq. 1.7 represents the subproblem in the SDDP algorithm. πt−1ij are the dual variables of the constraints in Eq. 1.7b. x̂ti are trial decisions for all i = 1, ..., n, t = 1, ..., T . Below is a detailed description of how the SDDP algorithm is implemented. One major drawback with Algorithm 1 is that it is practically impossible to try every pos- 10 Algorithm 1 Stochastic Dual Dynamic Programming 1: x̂ti ← Define a set of trial decision x̂ti ∀i = 1, ..., n, t = 1, ..., T 2: for t ∈ {T, T − 1, ..., 2} do ▷ backward recursion 3: for x̂ti ∈ {i = 1, ..., n} do 4: for btj ∈ {j = 1, ...,m} do 5: Solve the optimization problem in Eq. 1.7 for t, x̂t−1i and btj 6: Determine the expected vertex value π̄t−1i = ∑m j=1 ptjπt−1ij 7: Create a supporting hyperplane of the approximate expected future cost function for stage t− 1, ᾱt−1(xt−1) 8: end for 9: end for 10: end for 11: Go to Step 1 sible combination of scenarios btj in order to determine the values of trial decisions x̂ti. This is due to the fact that the number of combinations grows exponentially with the number of stages. Rather than performing a forward simulation of the multistage deterministic dual dynamic pro- gramming algorithms discussed in [105], Pereira and Pinto (1991) suggested utilizing a Monte Carlo forward simulation for a sample of the scenarios btj , as outlined in Algorithm 2. The ob- jective of the simulation is to identify “good” trial decisions at each stage t ∈ T . These decisions are then used to approximate the future cost function. Algorithm 2 Monte Carlo Forward Simulation for A Sample of the Scenarios 1: Solve the first-stage problem Eq. 1.6 2: Assign x̂1 as an optimal solution 3: Set x1i = x̂1 for i = 1, ..., n 4: for t ∈ {2, ..., T} do 5: for i ∈ {1, ..., n} do 6: Sample a vector bti from the set {btj = 1, ...,m} 7: Solve the optimization problem for stage t and sample i : min ctxt + ᾱt(xt) (1.8a) s.t. Atxt ≥ bti − Et−1x̂t−1 (1.8b) 8: Store the optimal solution in Step 7 as x̂ti 9: end for 10: end for 11 The lower bound z is calculated from the first-stage problem solution in Eq. 1.6. As the optimal policy is stochastic, we cannot compute the upper bound z̄ directly. Instead, a measure to quantify the quality of the policy is to determine a confidence interval for the expected cost [26]. This involves estimating z̄ from the results of Monte Carlo simulations performed for all stages t ∈ T and scenarios j ∈M , as defined in Eq. 1.9. z̄ = c1x1 + 1 n n∑ i=1 zi (1.9) where zi represents the total cost for a Monte Carlo simulation. zi = T∑ t=1 ctxti (1.10) Eq. 1.11 is the standard deviation of the estimator that measures the uncertainty around the estimation of z̄ in Eq. 1.9. σz = √√√√ 1 n2 n∑ i=1 (z̄ − zi)2 (1.11) The 95% confidence interval for the true population value of z̄ (assuming that z̄ is approx- imately normal) can be described by the equation shown in Eq. 1.12 [95, 104]. [z̄ − 2σz , z̄ + 2σz] (1.12) The confidence interval of the upper bound estimate in Eq. 1.12 can be utilized to establish a stopping criterion [105]. For instance, if the lower bound z falls within the confidence interval, the SDDP algorithm is stopped. This criterion establishes a relationship between the acceptable 12 accuracy of the simulation (determined by the sample size n) and the accuracy of the optimal policy calculated by the SDDP algorithm. 1.3 Organization of the Dissertation This dissertation consists of three essays that involve optimization, machine learning, and game theory in energy. The theme of the three essays in this dissertation is to develop ways, from an application perspective, to promote sustainable and renewable energy on both the supply and demand sides. The key areas of research questions and goals of Essays 1-3 are summarized in Table 1.2. Table 1.2: Key Areas of Research Questions and Goals Topics Essay I Essay II Essay III Demand Response X X X Customer Classification X Battery Storage X X Equilibrium Programming X Dynamic Programming X X Stochastic Programming X X Multi-Stage Decision X X X Variable Renewable Energy Integration X X Market Power X Energy Systems X X X Computational Improvement X X X Business / Policy Insight X X X Case Study X X X This dissertation is organized as follows. Chapter 1 (this chapter) introduces readers to the motivation and background for the research. The three main essays can be found in Chapters 2, 3, and 4. Chapter 5 concludes the dissertation, synthesizes key findings, and proposes future research in the field. 13 1.4 Summary of the Dissertation 1.4.1 Essay 1 (Chapter 2) In electric power markets, there is a chance to reduce costs by shifting residential electric load from high-priced to lower-priced periods. High price spikes can be financially damaging to retail electricity providers (REPs), who may have to provide contractually end-users with fixed prices. For instance, on May 30, 2015, the Houston, Texas, power market had a significant swing in power prices, which is displayed in Fig. 1.1. The price range that day was from $-0.01/MWh to $6,732.26/MWh, with an average price of $217.94/MWh. These price changes can cause retail electricity providers (REPs) to go out of business if they pursue it for a long period. Although most residential power customers do not directly face these wholesale electricity market price swings, a subset of a REP’s residential load can be moved to meet customer demand at a lower overall cost using demand response (DR). Figure 1.1: Locational Marginal Price Spikes on May 30, 2015, for Houston, Texas [36] 14 In DR, residential (and other sectors) consumers are no longer passive agents, but active ones who allow the grid operator to manipulate their energy consumption during the day [23]. To encourage this behavior, system operators often use demand response, which involves adjusting the electricity consumption of residential users during times of high demand [101]. By enabling more efficient and intelligent operation of electrical loads, this practice can result in an overall reduction in energy usage. The literature provides many reasons why demand response is an important component of energy management. It offers an opportunity to reduce or shift energy consumption out of the electric grid during peak periods in response to real-time, high electricity prices [22] or when a high load jeopardizes grid reliability [21, 143]. DR schemes can be categorized into several types, such as direct control or voluntary control schemes. These can include peak clipping, val- ley filling, load shifting, strategic conservation, strategic load growth, flexible load shape, and load shifting (being one of the most widely applied methods) [83]. As described in [143], DR schemes can be centralized or distributed. In the former, consumers communicate directly with the power utility provider (or REP) with no interaction between themselves. In the latter, con- sumers interact to provide aggregate total consumption information to the utility. DR has several benefits, including improvements in economic efficiency, power system flexibility, reduction in generation capacity requirements, and lower greenhouse gas emissions [68, 81, 98]. In addition to the economic benefits of shifting energy usage from peak to off-peak times, demand response (DR) also has a positive impact on sustainability. By reducing demand during peak hours, DR can help lessen the need for fossil fuel power plants, such as coal and natural gas, to handle the load [83, 123]. For example, DR has significantly reduced the need for new gas-fired power plants in the United Kingdom, which act as peaking marginal generation technology. As a 15 result, the amount of imported natural gas needed has decreased [112]. Researchers such as [65, 116, 124] have explored the potential of using demand response for variable renewable energy (VRE) resources like wind and solar in demand-side management for peak reduction. Successful DR implementations not only improve system operation and expansion but also market efficiency [11, 68], ultimately leading to reduced power generation and related CO2 emissions [125]. While DR has the potential for many benefits, several challenges must be addressed before it can become a practical contributor to the power system [98]. Although existing power supply systems are subject to consumption fluctuations and compromises [132], many studies have used simplistic models with limited outcomes [63, 98, 103]. It is not reasonable to evaluate DR in isolation using simplistic models, especially within the context of an existing market framework that is highly diverse and subject to fixed linear price-demand relationships and constraints [98]. Despite the potential benefits of DR, its implementation to balance generation and demand in the power network remains low, especially in the residential, commercial, and small business sectors [130]. This is due to a lack of interoperability, algorithm stability, metering, information security infrastructure, and inappropriate market structure [81]. Accurately classifying households based on their energy usage patterns and their likely response to Demand Response (DR) events is essential in modeling residential consumer load. Several methods have been employed to group consumers for load management [106], including clustering analysis, fuzzy clustering techniques, K-nearest neighbors, decision trees, multivariate discriminant analysis (MDA), and Naive-Bayes classifier [76]. [92] has developed a dynamic program for scheduling DR that estimates the potential profits of DR programs using histori- cal pricing data [92]. Customer classification is a crucial practice for REPs to group users with similar characteristics into specific groups [70, 84]. For instance, in Italy, electricity distribution 16 regulation enabled electricity providers to establish dedicated tariffs, within the allowable price and revenue caps, to be applied to customers based on their corresponding energy use patterns [14]. The demand response and clustering analysis described in [11] allows for the customization of DR events to each distinct customer group, helping REPs enhance the accuracy and depend- ability of their DR programs. This essay presents an improved process for residential classification based on household energy consumption characteristics. This process enhances decision support for demand response efforts. The essay develops a method to group 10,000 residential households into similar groups based on energy use, using statistical and machine-learning techniques. This allows REPs to plan and conduct demand responses more effectively. To evaluate the value of DR scheduling over a desired time horizon, a case study was analyzed by comparing business-as-usual and the proposed DR scheduling using clustered analysis. We used DP, as outlined in [92], to calculate the profits produced by customer grouping. This essay has made several valuable contributions to the field, as summarized below [11]. • We propose using a clustered load-profile method (CLPM) and sensitivity analysis to clas- sify customer electricity loads based on the magnitude and pattern of residential electricity loads. • An analysis was conducted on actual electricity load data from 10,000 fully anonymized residential customers in Texas between May 1, 2017 and September 30, 2017. • The study proposes a novel use of clustering approaches for customer classification. Dy- namic programming is used to assess the profitability of REPs. • This chapter presents a case study comparing the effectiveness of different methods for 17 selecting households for demand response. Specifically, we compare the greedy method, the brute-force method, and the clustered load-profile method (CLPM). Our proposed CLPM utilizes intelligent grouping of customers based on their thermostat electricity load data to improve profitability and reduce the computational burden. Our research demonstrates that only a small amount of information is needed to implement a reliable demand response program. This method of classifying customers based on their electricity load pro- files is crucial for making informed decisions about DR on segmented, homogeneous groups of customers. Retail electric providers can improve their DR programs by approximately 2.3% in profitability and between 35 to 350 times faster computational performance (based on 3000 households). Our optimized residential electricity load scheduling tool shows potential in reduc- ing peak demand and minimizing locational marginal price volatility risks, ultimately improving the power grid’s overall resilience. 1.4.2 Essay 2 (Chapter 3) Increasing the use of battery (and other types) storage can help us meet renewable energy targets for an entire energy system. Energy storage systems can help mitigate the intermittency of variable renewable energy in power generation (e.g., wind and solar). However, the impacts of energy storage can vary depending on the storage owners and market settings [145]. Furthermore, there is still considerable work needed to optimize the use of battery storage for renewable energy technologies in the power grid. In Essay 2, we analyze the value of variable renewable energy (VRE) and battery storage [10]. By using stochastic programming, we can account for the intermittent nature of VRE [19, 18 30, 45]. We utilize recourse problems [16, 67] to determine the value of battery storage in the power market. Due to the inclusion of different scenarios and an increasing time dimension, the associated model can become large. To improve the computational speed, we explore the use of a rolling-horizon technique [19, 113] in the associated complementarity problem. Our approach involves solving a series of stochastic mixed complementarity (MCP) problems using only partial foresight, also known as a rolling horizon. With each roll of the stochastic MCP, additional stochastic information is revealed for a fixed number of time periods. Additionally, the model in this approach is more realistic than assuming perfect foresight formulations. Lastly, using the rolling-horizon approach can improve computational performance. The problem is approached from a market-equilibrium perspective rather than just a single optimization problem. We develop the model based on a Nash-Cournot formulation of imperfect competition among power producers. We formulate the problem as a stochastic complementarity problem (Nash-Cournot equilibria in power markets) based on [45, 54, 144], with the addition of multi-stage recourse decisions [16] and stochasticities in variable renewable availabilities and electricity demand. The study focuses on three main types of players, each of whom seeks to optimize their own problems. These players include the power producers, the grid owner, and market-clearing conditions (MCC). The resulting mixed complementarity problem contains market-clearing conditions with the Karush-Kuhn-Tucker (KKT) optimality conditions for all players. The study examines practical scenarios to comprehensively investigate market equilibrium in a specific context. The analysis considers factors such as the availability of renewable energy sources, market demand fluctuations, and battery storage size. This essay is novel because it combines these unique aspects to provide a deeper understanding of the value of using battery 19 storage and variable renewable energy technologies, as well as the interaction of players in the power market. The research has provided several contributions to the literature, which can be summarized as follows [10]. • We propose deriving the value of battery storage and variable renewable energy (VRE) technologies by using multi-stage stochastic equilibrium modeling with recourse decisions. • To simulate real-world operations, we propose implementing practical physical restrictions, such as a variation in the time required to transition from being shut down to a fully oper- ating state. This can be achieved through the use of our proposed temporally unchanging constraints. • As an addition to their optimization-based counterparts [16, 67], we propose using the value of the stochastic equilibrium solution (VSES) and expected value of perfect information (EVPI) as measures of quality to assess the advantages of utilizing the stochastic MCP in comparison to a deterministic equivalent. By increasing the storage capacity of batteries, they have the potential to reduce price fluctuations and variations in power generation, as our sensitivity analysis for battery storage capacity has shown. However, our analysis of various case studies has revealed that an increase in battery capacity has an insignificant impact on reducing carbon emissions. Expanding battery storage has its benefits but producers will experience diminishing returns after a certain point due to market conditions such as demand and supply, pricing structure, generation capacities of low-cost generation technology, and the availability of variable renewable resources. 20 1.4.3 Essay 3 (Chapter 4) In recent years, residential end-users have become increasingly important in providing de- mand flexibility to the power system [2]. This can be achieved by utilizing battery storage as an energy resource for the grid. One way to achieve demand flexibility is through an optimal grid control system and battery storage which compensates for a portion of the residential load. The third essay explores the feasibility of using a stochastic dual dynamic programming (SDDP) model [25, 105] to account for uncertainties in the market environment and optimize the use of residential battery storage. To accomplish this, we develop a new practical applica- tion of the stochastic dual dynamic programming algorithm [105] for solving multistage, convex stochastic programming problems. We use two different approaches to achieve this goal [12]. The first approach is a multistage convex stochastic optimization model [67] that assumes per- fect foresight of uncertainties in electricity prices, photovoltaic (PV) generation, and load. Its results serve as the best possible lower bound (in a minimization problem). A second approach is more practical and is trained on past information and uses an SDDP model. This latter approach predicts uncertainties in electricity prices, photovoltaic (PV) generation, and load using three time-series forecasting techniques (exponential smoothing, seasonal auto-regressive integrated moving averages, and local-level models) and evaluates the outcomes of future events without knowing such uncertainties. Both approaches iteratively update decision-making strategies for each planning horizon stage according to the uncertainties exposed up to the current decision stage of the environment. Case studies are generated to evaluate and provide insights into im- plementing different mathematical modeling approaches. This prototype model enables an edge computing device, such as a Raspberry Pi, to host an optimization model. Using this model, the 21 device can schedule battery storage usage optimally and delegate learning and predicting tasks related to the environment to more capable cloud-based computational resources if necessary. The research presented herein contributes to the literature by: • Developing an SDDP model that is based on approximating the convex expected-cost-to- go functions [105] using a policy graph [25], and is designed to be useful in the context of electricity markets. • Employing time-series forecasting techniques, including exponential smoothing, seasonal auto-regressive integrated moving averages, and local-level models, to predict future un- certainties using past data [121]. The SDDP model incorporates anticipated uncertainty scenarios and their corresponding probabilities to optimize battery storage usage schedul- ing for sequential decision-making over a planning horizon. • Offering an economic evaluation and insights into strategies for deploying battery stor- age, while also showcasing the model’s capabilities through case studies on a test network model based on historical data from Southern Germany in 2016 [18]. After analyzing the effect of battery storage on SDDP models, we have found that, at a 90% confidence level, the hourly average of the first-stage objective function value (i.e., costs in the minimization problem) for the SDDP model with battery storage is statistically different to that of a model without battery storage. When considering the means, the SDDP model with battery storage improved by approximately 32% compared to the model without it. According to our results, the difference between the mean objective function values at the end of the first stage of the proposed SDDP model with battery storage and the deterministic LP model with battery 22 storage is less than 30% within the deterministic LP counterpart. We recognize the magnitude of this difference and explore the possibility of enhancing our prediction abilities to reduce the disparity between stochastic (SDDP) and deterministic (LP) models. Similar comparisons have been made for LP models, and we have found that the mean objective function values between LP models with and without battery storage are statistically different at a 95% confidence level. When battery storage is incorporated into an LP model, the average objective function value (i.e., costs) improved by approximately 43% compared to models without it. 1.5 Papers and Presentations Throughout the extensive research and analysis conducted for this dissertation, it is im- portant to highlight the significance of each paper and presentation produced as a result. The contributions of the author and associated contributors to both journal publications and confer- ence proceedings played a vital role in the success of this research. Tables 1.3 and 1.4 enumerate the various publications and presentations made by the author. To provide additional detailed contributions of each author for each paper listed in Table 1.3, we have included summaries below: 1. In this paper, Chanpiwat is the lead author, while Gabriel and Siemann proposed the topic and research questions. Chanpiwat, Gabriel, and Moglen worked together to formulate the mathematical model, while Siemann provided the data for this research. Chanpiwat then took charge of implementing the model and carrying out the computational case study, with assistance from Gabriel and Moglen. Finally, Chanpiwat primarily wrote the manuscript 23 Table 1.3: List of Journal Articles and Conference Proceeding # Name Chapter Lead-Author Status Journal Articles: 1 P. Chanpiwat, S. A. Gabriel, R. L. Moglen, and M. J. Siemann, “Using cluster analysis and dynamic programming for demand response applied to electricity load in residential homes,” ASME Journal of Engineering for Sustainable Buildings and Cities, vol. 1, p. 011006, Feb 2020. 1 Yes Published 2 R. L. Moglen, P. Chanpiwat, S. A. Gabriel, and A. Blohm, “Optimal thermostatically-controlled residential demand response for retail electric providers,” Energy Systems, Aug 2020. 1 No Published 3 J. C. Huemme, S. A. Gabriel, P. Chanpiwat, and T. Shu, “An analysis of the U.S. - China Trade War’s Impact on Global Natural Gas Markets and the U.S. Coast Guard’s LNG inspection workforce,” Journal of Natural Gas Science and Engineering, vol. 97, p. 104198, Jan. 2022. - No Published 4 P. Chanpiwat, S. A. Gabriel, and M. Brown, “Multi-Stage Modeling with Recourse Decisions for Solving Stochastic Complementarity Problems with An Application In Energy,” Jan 2023. 2 Yes Revised and Resubmitted 5 P. Chanpiwat, F. Oliveira, and S. A. Gabriel, “Optimizing Operations Planning of Stand-Alone Battery Storage Using Stochastic Dual Dynamic Programming: A Case Study of German Households,” 2023. 3 Yes Manuscript in Preparation Conference Proceeding: 6 L. Wang, T. Hensel, P. Chanpiwat, S. Zhu, and J. Srebric, “Occupant-centric Control of Building Systems based on Real-time Optimization by Extremum Seeking,” in 2022 IEEE International Conference on Environment and Electrical Engineering and 2022 IEEE Industrial and Commercial Power Systems Europe (EEEIC / I&CPS Europe), Prague, Czech Republic: IEEE, Jun. 2022, pp. 1–6. - No Published with the help of Moglen and with comments and suggestions from Gabriel and Siemann. Siemann and Gabriel collaborated to secure funding for the project that resulted in this publication. 2. In this paper, Chanpiwat is a co-author. Gabriel and Blohm conceptualized the research goal, while Moglen, Chanpiwat, and Gabriel designed the methodology, with data supplied by Blohm. Moglen, Chanpiwat, and Gabriel formulated the mathematical investigation process and supporting algorithms, with comments from Blohm. Moglen validated the results and prepared the case studies, while Moglen, Chanpiwat, and Blohm were respon- 24 sible for implementing the statistical model. Moglen principally wrote the manuscript with assistance from Chanpiwat, and Gabriel and Blohm offered comments and suggestions. Moglen worked on the visualization of the results, with help from Chanpiwat. Gabriel had oversight and management responsibilities for the research activity, while the acquisition of financial support for the project was fulfilled by Gabriel and Blohm. 3. Chanpiwat is one of the co-authors of this research project. Huemme and Gabriel proposed the research goals and contributions, while Huemme, Chanpiwat, and Gabriel worked together to develop the methodology. During the implementation phase, Huemme was mainly responsible for writing and testing the computer code, with technical support from Chanpiwat. The model was validated by Huemme using a programming script written by Chanpiwat. Shu and Huemme performed data curation. Huemme was the primary inves- tigator and writer of the original draft, with assistance from Gabriel, Chanpiwat, and Shu during the review and editing process. Chanpiwat provided assistance with data and results visualization, while Gabriel oversaw project administration. 4. Chanpiwat is the lead author of this manuscript. The research questions were composed by Chanpiwat and Gabriel, while the mathematical model was developed by Chanpiwat with feedback from Gabriel and Brown. Chanpiwat primarily implemented the model, analyzed the research questions, and validated the results with assistance from Gabriel and Brown. The paper was mainly written by Chanpiwat, including visualization, with assistance from Gabriel and suggestions from Brown and Gabriel. Gabriel supervised the project. 5. Chanpiwat led the research efforts as the main contributor. Oliveira developed the overarch- ing research goals and methodology with support from Chanpiwat and Gabriel. Chanpiwat 25 primarily performed statistical analysis and synthesized study data, while also implement- ing and validating the computer code for proposed algorithms. Chanpiwat primarily wrote the manuscript, developed result visualization, and presented a case study. Oliveira se- cured the financial support for the project, while Gabriel and Oliveira shared supervision and project administration responsibilities. 6. Chanpiwat was a co-author of this project, with a focus on the optimization model. This included the development of both two-objective and three-objective optimization models, as well as the analysis of results. Chanpiwat also assisted with the writing of the manuscript and provided feedback during the review and editing process. 1.5.1 Presentations The author has provided a list of conference presentations that have been developed as a result of their research. Table 1.4 lists the presentations, which are a testament to the impact of the research and its relevance to the scientific community. 26 Table 1.4: List of Presentations Name Chapter Conference Presented On Clustering of Households to Better Understand Their Potential for Demand Response: Numerical Results for Texas 1 Norwegian University of Science and Technology (NTNU) Demand Response Workshop 2018, Trondheim, Norway. May 28, 2018 Clustering Residential Customers by Their Load Profiles for Demand Response Events 1 Trans-Atlantic Infraday (TAI) Conference 2018, Washington, D.C., United States. Nov 2, 2018 Using Cluster Analysis and Dynamic Programming for Demand Response Applied to Electricity Load in Residential Homes 1 Trans-Atlantic Infraday (TAI) Conference 2019, Washington, D.C., United States. Oct 18, 2019 Utilization of Battery Storage and Demand Response for the Implementation of Variable Renewable Energy Resources 2 Institute for Operations Research and the Management Sciences (INFORMS) Virtual Annual Meeting 2020. [Online]. Nov 10, 2020 Multi-Stage Modeling with Recourse Decision for Solving Stochastic Complementarity Problems with an Application in Energy 2 Federal Energy Regulatory Commission (FERC) Technical Conference on Increasing Market and Planning Efficiency through Improved Software 2021, Washington, D.C., United States. [Online]. Jun 23, 2021 Multi-Stage Modeling with Recourse Decisions for Solving Stochastic Complementarity Problems with an Application in Energy 2 Institute for Operations Research and the Management Sciences (INFORMS) Annual Meeting 2021, California, United States. [Online]. Oct 25, 2021 Energy-Related Stochastic Complementarity Problems Solved by Multi-Stage Modeling with Recourse Decisions 2 Trans-Atlantic Infraday (TAI) Conference 2022, Stockholm, Sweden. Nov 4, 2022 Optimizing Operations Planning of Stand-Alone Battery Storage Using Stochastic Dual Dynamic Programming: A Case Study of German Households 3 International Conference on the Integration of Constraint Programming, Artificial Intelligence, and Operations Research (CPAIOR) 2023, Nice, France. Jun 1, 2023 Optimizing Stand-Alone Battery Storage Operations Scheduling under Uncertainties in German Residential Electricity Market using Stochastic Dual Dynamic Programming 3 Federal Energy Regulatory Commission (FERC) Technical Conference: Increasing Real-Time and Day-Ahead Market Efficiency through Improved Software, 2023, Washington, D.C., United States. [Online] Jun 29, 2023 Optimizing the Operational Planning of Residential Stand-Alone Battery Storage using Stochastic Dual Dynamic Programming 3 Optimization 2023 Conference, Aveiro, Portugal. Jul 26, 2023 27 Chapter 2: Using Cluster Analysis and Dynamic Programming for Demand Re- sponse Applied to Electricity Load in Residential Homes Note: This chapter appeared as the first paper, Chanpiwat et al. (2020). Journal Papers • P. Chanpiwat, S. A. Gabriel, R. L. Moglen, and M. J. Siemann, “Using cluster analysis and dynamic programming for demand response applied to electricity load in residential homes,” ASME Journal of Engineering for Sustainable Buildings and Cities, vol. 1, p. 011006, Feb 2020. • R. L. Moglen, P. Chanpiwat, S. A. Gabriel, and A. Blohm, “Optimal thermostatically- controlled residential demand response for retail electric providers,” Energy Systems, Aug 2020. Abstract This essay develops means to analyze and cluster residential households into homogeneous groups based on the electricity load. Classifying customers by electricity load profiles is a top priority for retail electric providers (REPs), so they can plan and conduct demand response (DR) 28 effectively. We present a practical method to identify the most DR-profitable customer groups as opposed to tailoring DR programs for each separate household, which may be computationally prohibitive. Electricity load data of 10,000 residential households from 2017 located in Texas was used. The study proposed the clustered load-profile method (CLPM) to classify residential customers based on their electricity load profiles in combination with a dynamic program for DR scheduling to optimize DR profits. The main conclusions are that the proposed approach has an average 2.3% profitability improvement over a business-as-usual heuristic. In addition, the proposed method is approximately 70 times faster on average than running the DR dynamic pro- gramming separately for each household. Thus, our method not only is an important application to provide computational business insights for REPs and other power market participants but also enhances resilience for the power grid with an advanced DR scheduling tool. Nomenclature Indices and Sets i, I Index and set of cluster cases k Index and set of clusters n,N Index and set of the number of households or objects t Index of the time horizon of interest or stage Functions and Variables αt Percentages of shiftable load removed 29 At Duration of the DR event selected (hours) βt Percentages of shiftable load recovered Cm Clustered category for magnitudes of household electricity consumption for 1, ..., km Cp Clustered category for household electricity consumption patterns for 1, ..., kp C.casei Cluster case from combining Cm and Cp Counti Number of households in C.casei D Data set of n objects δt Energy Price ($/kWh) DP (Loadi) Dynamic programming function using representative load profile ($) Ft(St) Saving function at time t ($) γt Base load at time t (kWh) House.ID Household Identity km Maximum number of clusters allowed for Cm kp Maximum number of clusters allowed for Cp Loadi Representative load profile of C.casei (kWh) LS1,t Load removed (kWh) LS2,t Load recovered (kWh) p1,t Electricity price during each stage t during the DR event ($/kWh) p2,t Electricity price during the recovery period ($/kWh) 30 pc Cost to the retail electric providers (REPs) of providing electricity to their customers ($/kWh) Pcl. Percent of household portion selected by clustered load-profile method (%) Pgr. Percent of household portion selected by greedy method (%) Profitcl. Total demand response profit from households selected by clustered load-profile method ($) Profithou. Demand response profit per individual household ($) Profiti. Demand response profit per clustered load profile ($) St Number of stages (e.g., hours) t remaining in the current DR event Vt(St) Optimal amount of savings generated by shifting a customer group’s load ($) 2.1 Introduction Advancements have been achieved in residential energy management systems, such as ther- mostat set point control, to enhance the energy efficiency of buildings by utilizing smart grid and innovative technologies. These systems combine control systems with information and com- munication technologies (ICT) [55, 107, 128]. According to the U.S. Energy Information Ad- ministration [140], demand response (DR) saved 12,248 MW of actual peak power demand in 2017, and the residential sector alone accounted for 3960 MW of actual peak demand savings. Almost 87% of US residents possess air conditioning equipment that contributed up to 12% of total home energy expenditures in 2015 [34]. Heating, ventilation, and air conditioning (HVAC) power load was used in this study due to data availability, the fact that it has the largest load of household appliances and typically coincides temporally with high-energy prices [33, 86]. Other 31 smart appliances, in theory, could also be used. Improvement in building energy management relies heavily on ICT [125]. One of the most promising tools to save energy and energy costs during peak power demand in the residential sec- tor is the thermostat1. Remotely controlling thermostats (e.g., by changing set points or limiting the equipment duty cycle) brings many advantages to power utilities and retail electric providers (REPs) [1]. Connected thermostats provide household data to power utilities and REPs, such as indoor temperature and HVAC set point, and they help reduce stress on the electricity grid during peak electricity demand through DR programs [125]. For example, thermostats allow utilities and REPs to adjust residential HVAC (e.g., air conditioning) scheduling during times of peak power demand [20]. They also provide a means to improve electricity management for the distribution system, energy efficiency, and customer-specific services [101, 120]. The extension of Internet connectivity into the network infrastructure and cloud computing has begun to appear in the lit- erature related to DR [102, 122, 128, 135]. However, the current work in this area especially in the residential sector is deficient but essential in the development and implementation of the residential DR programs. Demand response is the managing of demand-side resources to alter the electricity con- sumption of end-users in response to high wholesale electricity prices or when the system relia- bility is threatened [143]. DR in this essay is defined as an electricity program between consumers and REPs, i.e., power providers, which permits load shifting over time. The main goals for REPs to use DR are to reduce demands at peak prices and serve as hedging against price volatility [125]. In turn, REPs utilizing DR in this way will enhance grid resilience for parties such as the inde- 1Residential customer hardware used to manage their HVAC system. Utilities (and in our case retail electric providers) have no authority over customer thermostats unless they sign up for a specific program with a qualified product. 32 pendent system operator [133]. In Fig. 2.1, average hourly locational marginal prices (LMPs) in summer 2017 for Texas were $31.07/MWh with the highest and lowest at $1742.30/MWh and $0.62/MWh, respectively. This represents a wide range of prices which makes planning for REPs difficult. REPs seek to hedge against the risk associated with volatile real-time pricing of elec- tricity, which can be financially very challenging [6]. Currently, they purchase a large portion of their power portfolio in advance but leave some parts for the spot market with real-time prices to balance power supply and demand and minimize costs. In the residential sector, REPs primarily charge their customers for electricity via fixed-price contracts, so they are always looking for methods to reduce the costs of providing energy during expensive periods [36]. DR can be one of the most effective tools for minimizing their risk of high prices by serving as a physical hedge to that vulnerability [122]. In this study, we focus on how to help REPs mitigate financial risk with the use of customer classification for residential DR programs. Figure 2.1: Hourly LMPs of Texas between May 1 - September 30, 2017, from the Electric Reliability Council of Texas [36] Classification of residential customers can improve DR programs considerably [77]. It is 33 useful for the REPs to group users with similar characteristics into specific groups [84]. Having accurate assignment of customers into appropriate classes helps utilities in many areas including improving management efficiency, setting distribution load profiles, and charging service fees differently according to customer classes [14, 87]. Having different customer profiles helps REPs better mitigate the risk of unsuccessful DR, reduce customers’ opt-out, and increase savings on both physical energy demand and electricity bills for customers. This essay extends the current practices by developing a process for the classification of residential customers using electricity load data. While the study in this essay was conducted for the Texas power market using HVAC load, the methodology easily extends to other regions and different types of loads. For a different region or season, the LMP profile may vary, but the clustering techniques are expected to be equally effective. Also given the scale of load under control by a single REP, there is the assumption that the load being shifted is not large enough to influence the LMPs. If this were not the case, then this altering of LMPs would need to be taken into account in the decision process. Finally, it may be advantageous for retail power providers to periodically update these customer clusters for increased profitability in the face of changing market conditions. There are many studies in the area of residential customer classification [5, 47, 86]. How- ever, few works have focused on grouping customers, based on their electricity loads, specifically for the purpose of load shifting for DR programs [37, 102]. Furthermore, the distinct effect be- tween the magnitude of household electricity load and the pattern of residential electricity load behaviors deserves more attention. A number of previous works estimated the potential amount of residential electricity load that could be shifted over time using DR [35, 101, 122]. However, none have assessed the financial impacts of optimal DR scheduling with respect to different clus- 34 tered load profiles and variable electricity prices as incorporated in this essay. The use of dynamic programming (DP2) as a sensitivity analysis tool to determine the number of clusters is also new and introduced in this essay. Theoretically, REPs can sort individual customers by potential profit calculated using opti- mal scheduling and selectively conduct DR only on the top-ranked portion to have high returns. This is a brute-force method. However, it is computationally expensive since REPs have to deter- mine the optimal DR schedule (i.e., using DP) for each individual customer. Implementing such an approach or other methods with a large number of customers in real-time is not practical. By applying our proposed clustered load-profile method (CLPM), REPs can group customers and then prioritize them by potential profits of each group using DP. They benefit from having only k tailored DR programs (i.e., running a DP k times) for k groups of customers, where k << N , where N is the total number of customers. Thus, the number of DP model runs can be signifi- cantly decreased for near real-time processing, while still accurately and effectively representing the original residential set of customers. Consequently, contributions of this essay include the following: 1. A clustered load-profile method (CLPM) and sensitivity analysis to classify customer elec- tricity loads by magnitude and pattern of residential electricity load. 2. Analysis based on real electricity load data of 10,000 fully anonymized residential cus- tomers from Texas between May 1, 2017, and September 30, 2017. 3. Novel use of clustering approaches for customer classification using a DP to assess REPs’ DR profitability [91, 92]. 2A single- and multi-objective DP formulation used as a tool to assess the value of load shifting with DR over a desired time horizon [91, 92]. 35 4. A case study to compare the effectiveness of selecting households for DR between using the greedy method, the brute-force method, and the CLPM. The remainder of this essay is organized as follows. Section 2.2 describes the method- ologies of data, DP, clustering algorithm, and clustering evaluation. Section 2.3 presents an experimental case study and results. Finally, Sec. 2.4 provides conclusions. 2.2 Clustering Algorithm and Evaluation 2.2.1 Data This study obtained fully anonymized electricity load data from Whisker Labs (WL) [126], our industrial partner specializing in residential DR, and online real-time hourly LMP data, from the Electric Reliability Council of Texas (ERCOT) [36] as presented in Table 2.1. In all, there were 10,000 residential customers (households) in Texas from May 1, 2017, to September 30, 2017. The data set has 3,552 sequential hourly periods (3,552 = 24 hours/day times 148 days) that contain LMP and household electricity load data. We transformed the data set in Table 2.1 into three data sets: 1. Data1: Hourly electricity load between May 1, 2017, to September 30, 2017 (dimension: 10,000 × 3,552). 2. Data2: Average hourly electricity load (dimension: 10,000 × 24). 3. Data3: Hourly LMPs (dimension: 1 × 3,552). 36 Table 2.1: Household Electricity Load [126] and LMPs Data [36] # Date & Time LMP ($/MWh) Electricity Load (kWh) #1 #2 ... #10000 1 05/01/17 00:00 20.87 0.35 0.62 ... 1.15 2 05/01/17 01:00 18.73 0.34 0.51 ... 0.62 3 05/01/17 02:00 17.85 0.35 0.36 ... 0.41 ... ... ... ... ... ... ... 3552 09/30/17 23:00 1.72 1.19 1.15 ... 0.83 2.2.2 Dynamic Program Formulation The problem of scheduling DR events for a customer or customer cluster can be solved as an optimization problem. This problem is explored in depth in [91, 92] and is summarized in this section. To formulate the problem into a single-objective optimization problem, the problem is divided into stages t that discretize the time horizon. They are assumed to be hours in our implementation. The state of the system at any time t is given by St, representing the number of stages remaining in the current DR event. At each stage, an action At is selected from the set of feasible actions, describing a DR event of 1, 2, 3, or 4 hours duration, or the base case of doing nothing. The savings (i.e., profits) generated by selecting action At is computed using Eq. 2.1. The savings at time t, given by Ft(St), can be interpreted as the difference in profit between calling a DR event and the do-nothing case. Thus, when At = 0, Ft(St) = 0. Ft(St) = ∑ t LS1,t(p1,t − pc)− ∑ t LS2,t(p2,t − pc) (2.1) where p1,t is the electricity price during each stage t during the DR event, and p2,t is the price during the recovery period. pc is the cost to the REP of providing electricity to their customer. 37 LS1,t and LS2,t are the amount of load that can be removed at time t and the amount of energy required to return the house to its original set point as a result of the load-shifting at time t, respectively. The DP objective function is defined by the recursive relationship between the profit gen- erated at time t and the decision’s value to future time periods as shown in Eq. (2.2). Vt+1(St+1) recursively calculates the future value of calling a DR event At given the starting state St. Vt(St) = max At∈At(St) Vt+1(St+1) + Ft(At) (2.2) Vt(St), therefore, defines the optimal amount of savings generated by shifting a customer group’s load. 2.2.3 Estimating Demand Response Profits With the Dynamic Programming Using Historical Locational Marginal Prices Grouping customers into homogeneous clusters achieves two goals. First, it allows REPs more profitable control of existing customers. Second, it permits a more informed selection of which customers to enroll in DR programs. With respect to the first goal, different customer load profiles can generate different profits (i.e., savings) in DR events. We aim to enter each customer into as few DR events as possible to reduce their discomfort. With respect to the second goal, enrolling a customer in thermostat-driven DR requires purchasing a smart thermostat for that customer. Therefore, it is not financially advantageous to enroll customers who do not perform well in DR events, which is generally true for poorly insulated houses that even during DR require significant HVAC load. For both goals, after the important step of clustering customers into 38 homogeneous groups, we require a metric to determine the financial benefits of these groups. To compute the profits generated by grouping customers, we use DP as formulated in [91, 92]. The DP schedules DR events for a customer cluster throughout the day. The customer’s schedule is determined by the times of the day in which a customer’s HVAC load can be shifted to maximize profits for the REP. For example, a customer with a peak load at 12:00 p.m. is likely to generate more profits in a mid-day DR event if there is a price spike than a customer with a peak load at 6:00 p.m. Demand response can take many different forms such as peak shaving and load shifting. In this essay, DR is used to describe a program initiated between REPs and their customers. Variations of this program have already been implemented in the industry. Customers are enrolled in the DR program and are issued a smart thermostat. In return, they give REPs permission to remotely control their thermostat within a predetermined contract such as a number of events per season, maximum temperature setback, or other restrictions to maintain customer comfort. When REPs wish to initiate a DR event, they send a command to their customer’s thermostat to increase the set point during summer events or decrease the set point during winter events. When the event is over, usually 1–4 hours later, REPs send a second command to return the thermostat set point to its original value. If at any time, customers are uncomfortable during a DR event, all they need to do is go to their thermostat and adjust their set point, and they will have opted out of the DR event. To optimally schedule DR events using DP, we divide the time horizon of interest into stages t (e.g., hours). Then, we compute the amount of load that is shiftable in each stage for a given customer group. The data used in this study were the hourly household total electricity load. We determine a customer’s shiftable load as a percentage of their total load in each hour. 39 Table 2.2: Percentages of Shiftable HVAC Load for DP (with illustrative values) [91, 92, 127] Hour ID % Removed % Recovered Base Load (kWh) Energy Price ($/kWh) 1 α1 (0.77) β1 (0.69) γ1 (1.75) δ1 (0.105) 2 α2 (0.66) β2 (0.55) γ2 (1.77) δ2 (0.078) 3 α3 (0.56) β3 (0.43) γ3 (1.70) δ3 (0.190) 4 α4 (0.46) β4 (0.32) γ4 (1.60) δ4 (0.052) The percent load shifted values presented in Table 2.2 were fitted to the pseudo data output from a gray box thermodynamic model [127]. The percentages in Table 2.2 determine the amount of shiftable HVAC load from the total electricity load of a household (i.e., Data1). Illustrative per- centages of load removed αt and load recovered βt are given in Table 2.2, which are calibrated for our region of interest (i.e., Texas). These empirically derived factors were used to approximate the complex thermodynamics of heating and cooling. The scope of this study is only HVAC load, as previously mentioned. The percentages presented in Table 2.2 were calibrated for determining the shiftable HVAC load, and hence, direct application of these specific factors to other shiftable loads would not be appropriate. However, they could be recalibrated for potential broader ap- plications using a similar methodology. A DR event with an HVAC system set to cooling mode (i.e., air conditioning) involves temporarily increasing a customer’s thermostat set point, shifting load that would otherwise be used for cooling until after the DR event. More importantly, the net effect of the set point manipulation is not only a shift of the load to a lower price interval but also a reduction in total load use [127].∑ t LS1,t and ∑ t LS2,t are, respectively, the total load removed during the DR event and the total load used to return a house to its pre-DR temperature, called the recovery load or load recovered. For example, a 3-h DR event (i.e., starting at any hour of the day), followed by a 1-h recovery scenario, can be computed using the values presented in Table 2.2. It is assumed 40 that regardless of the event duration, the hour after the event end is used for recovery. Based on this assumption, this is a conservative estimate and therefore guarantees that DR events do not overlap. The duration of the actual time it takes to recover a house to its original set point depends on the house and if the house has reached the elevated set point for the duration of the event. These two factors are difficult to quantify, and therefore, the simplifying assumption of one hour is assumed, as described in [91, 92]. The total load removed and the load recovered for this example would be calculated as shown in Eq. (2.3). and (2.4) with base load γt in kilowatt- hour associated with those hours only for an illustrative purpose of this particular household. The removed and recovered percentages apply to an electricity load profile or a representative electricity load profile that can be one household or one cluster, respectively. ∑ t LS1,t = (α1) · (γ1) + (α2) · (γ2) + (α3) · (γ3) = (0.77) · (1.75) + (0.66) · (1.77) + (0.56) · (1.70) = 3.47 kWh (2.3)∑ t LS2,t = (β1) · (γ1) + (β2) · (γ2) + (β3) · (γ3) = (0.69) · (1.75) + (0.55) · (1.77) + (0.43) · (1.70) = 2.91 kWh (2.4) Given the amount of shiftable load calculated using Equations (2.3). and (2.4), we define the objective function of the DP as the difference in profit between doing a DR event and the baseline of not doing one. For example, in Table 2, the reward for the 3-h DR event would be 41 calculated as shown in Eq. (2.5), in which the first three hours are for load removal and the fourth hour is for load recovery. Ft(St) is the savings (i.e., profits) at time t. δt is an energy price in dollars per kilowatt-hour. It is assumed that the customer pays a flat electricity price for this time period pc at 0.048 $/kWh. For the implementation of the DP used in this essay, it is assumed that prices are deterministic and perfectly known. Stochastic versions of the DP are examined in [92]. Ft(St) = [(α1)(γ1)(δ1 − pc) + (α2)(γ2)(δ2 − pc) + (α3)(γ3)(δ3 − pc)] −[( ∑ t LS2,t)(δ4 − pc)] = [(0.77)(1.75)(0.105− 0.048) + (0.66)(1.77)(0.078− 0.048) +(0.56)(1.70)(0.190− 0.048)]− [(2.91)(0.052− 0.048)] = $0.235 (2.5) Thus, for the example presented in Eq. (2.5), a 3-h DR event would save an average of $0.235 per customer. Then, by using the DP formulation, an optimal DR schedule would be found for this example scenario, along with the profits generated by that DR schedule using the DP method presented. A similar process would be repeated for all other customers or customer clusters, generating optimal DR schedules for each. Since the DP is applied to individual clus- tered electricity load profiles, it has no effect on the classification approach. To illustrate the scheduling outcomes of DP, Fig. 2.2 shows three randomly selected house- holds from the same region, graphed by DP event duration, potential DR profit, and electricity load profile from May 1 to September 30, 2017. All three households experienced the same 42 Figure 2.2: Three Randomly Selected Households with DP Event Duration, DR Profit, and Elec- tricity Load Profile Between May 1 to September 30, 2017 LMPs during this period. Since they differ in electricity loads, the resulting optimal strategies and profits are different. The shifting load may be more profitable or less profitable in small mar- gins because customers (or groups of customers) consume electricity differently. For example, a customer may have a valley (i.e., low load) during the price spike in the afternoon. This customer does not use much energy during the price spike, so moving his load may be disadvantageous. Furthermore, it would perhaps preclude him from having another DR event during his evening peak load, because the evening DR event would coincide with the afternoon DR event. It is ad- vised not to schedule a DR event (i.e., do nothing as the zero-hour event duration) if the price spike is not temporally correlated with a customer’s electricity load profile. 43 The proposed DP can alleviate stress on the power grid in cases of excessive power demand or shortage in power supply that causes price spikes. Price spikes are not purely demand based. They can be caused by renewable energy intermittence (shortfalls in supply forecasts) or by generator outages, among other causes. It can be difficult to determine the cause of a price spike, but a significant portion of them can be caused by supply shortfalls, not demand surpluses. In either case, DR can help reduce grid stress. The elevated DR set point is more energy efficient, reducing the total amount of energy used across the DR event and recovery period, relative to the do-nothing case. Thus, if a second peak is created, it is of a smaller magnitude than the original peak. The profits generated by individual clustered load profiles (i.e., by separating customers into clusters) can be compared by treating all customers with the same DR schedule. The differ- ence between clustered and unclustered DR profits gives the value of grouping the heterogeneous array of DR-enrolled customers into individually controlled homogeneous clusters. In addition, the characteristics of clusters that generate more profits indicated ideal candidates to enroll in future DR programs. 2.2.4 Clustering Algorithm In the classification literature, the majority of clustering methods are either hierarchical clustering [40] o