METHODS FOR IMPROVING THE OPTIMAL OPERATION CONTROL OF COMBUSTION ENGINE-BASED MICRO-CHP SYSTEMS IN SMALL RESIDENCES by Brandon Robertson B.A.Sc., The University of British Columbia, 2017 A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE in THE COLLEGE OF GRADUATE STUDIES (Mechanical Engineering) THE UNIVERSITY OF BRITISH COLUMBIA (Okanagan) November 2019 © Brandon Robertson, 2019 ii The following individuals certify that they have read, and recommend to the Faculty of Graduate and Postdoctoral Studies for acceptance, a thesis/dissertation entitled: METHODS FOR IMPROVING THE OPTIMAL OPERATION CONTROL OF COMBUSTION ENGINE-BASED MICRO-CHP SYSTEMS IN SMALL RESIDENCES submitted by Brandon Robertson in partial fulfillment of the requirements for the degree of Master of Applied Science in Mechanical Engineering Examining Committee: Dr. Homayoun Najjaran Supervisor Dr. Rudolf Seethaler Supervisory Committee Member Dr. Kasun Hewage Supervisory Committee Member Dr. Shahria Alam Additional Examiner iii Abstract The research presented in this thesis contributes to the body of literature surrounding the optimal operation of micro-CHP (combined heat and power) systems particularly within small residences. A method is discussed that allows for the use of more complicated constraints and increased resolution compared to standard model predictive control (MPC) strategies. This method uses two progressively more detailed optimizations where the first optimization applying boundary constraints to the second optimizations. Such a technique results in more freedom in the choice of constraints and resolution for the MPC optimization. This method is tested with micro-CHP formulations containing solar power, an auxiliary heater, thermal energy storage (TES), and electrical energy storage (EES). Many variants of the proposed method and formulations are tested using a novel HLM for comparison. Computational complexity resulting from the proposed method and the formulation are discussed. The effects of forecasting inaccuracies and the selling price of electricity are investigated for the proposed formulations. The time-step size and horizon length of the optimization are changed, and the effects of these changes are explored. The behavior of the controller is also discussed in relation to a heat-led method (HLM). The proposed methods can be generalized to problems with different constraints resulting in a transferable solution to similar problems. The methods are also tested using low-performance hardware and open-source software to be generalizable and competitive in cost to conventional methods. The proposed formulations and MPC strategies were able to outperform an HLM in the majority of test scenario, particularly when the selling price of electricity is lower than the purchasing price. However, when the selling and purchasing price of electricity are the same, the iv performance of the proposed MPC strategy is much closer to that of the HLM with no guarantee of better performance with the current formulation. The formulation was also able to deal with relatively complex constraints while achieving sufficiently low computation times. v Lay Summary The use of combined heat and power (CHP) systems has become a popular alternative to conventional power generation due to their high efficiencies resulting from extracting both heat and power from the fossil fuel combustion. CHPs are ideal for use in residential homes because the heat and power can be used on-site at the source of the demand. Current methods for controlling these CHP systems aims to optimize how the CHP works alongside subsystems such as renewable energy systems, thermal storage, and battery storage. However, these optimizations are difficult and require the problem to be over-simplified often resulting in a low-resolution view of the situation. The proposed research aims to increase the detail and resolution at which these optimizations are performed to keep the computational cost low while obtaining accurate situations. It is demonstrated that two progressively more detailed optimizations can utilize each other to achieve good performance. vi Preface The work performed in this thesis was conducted under the supervision of Dr. Homayoun Najjaran in the Advanced Control & Intelligence Systems (ACIS) Laboratory at the University of British Columbia, Okanagan Campus. Much of the work was also conducted during a 1-year internship at ElectroMotion Energy under Mr. Jai Zachary as part of a Mitacs Accelerate Grant. The research was in part inspired by the Synergistic Energy Ecosystem, patent number US9429018B2. vii Table of Contents Abstract ......................................................................................................................................... iii Lay Summary .................................................................................................................................v Preface ........................................................................................................................................... vi Table of Contents ........................................................................................................................ vii List of Tables ................................................................................................................................ xi List of Figures .............................................................................................................................. xii List of Symbols ........................................................................................................................... xiv List of Abbreviations ................................................................................................................ xvii Glossary ...................................................................................................................................... xix Acknowledgements .................................................................................................................... xxi Dedication .................................................................................................................................. xxii Chapter 1: Introduction ................................................................................................................1 1.1 Motivation ....................................................................................................................... 1 1.2 Context and Background................................................................................................. 3 1.2.1 Combined-heat and power .......................................................................................... 3 1.2.2 Control of CHP-based systems ................................................................................... 4 1.3 Objectives ....................................................................................................................... 5 1.4 Contributions................................................................................................................... 7 Chapter 2: Literature Review .......................................................................................................8 2.1 Background ..................................................................................................................... 8 2.1.1 Conventional operation strategies ............................................................................... 8 2.1.2 Heat-led method .......................................................................................................... 8 viii 2.1.3 Electricity-led method ................................................................................................. 8 2.2 Other operation strategies ............................................................................................... 9 2.2.1 Large-scale CHPs and CCHPs .................................................................................... 9 2.2.2 Microgrids ................................................................................................................... 9 2.3 Optimal operation in small residential systems ............................................................ 10 2.3.1 Equipment considerations ......................................................................................... 12 2.3.2 Optimal operation objectives .................................................................................... 12 2.3.3 Problem formulations................................................................................................ 13 2.3.4 Optimization constraints and system modelling ....................................................... 17 2.3.5 Stochastic nature of domestic loads .......................................................................... 19 2.3.6 Flexibility .................................................................................................................. 21 2.4 Summary ....................................................................................................................... 22 Chapter 3: Methodology..............................................................................................................24 3.1 Materials ....................................................................................................................... 24 3.1.1 Hardware and software ............................................................................................. 24 3.1.2 Load data ................................................................................................................... 25 3.2 System overview ........................................................................................................... 26 3.3 Heat-led method ............................................................................................................ 27 3.4 Model Predictive Control .............................................................................................. 28 3.4.1 Forecasting ................................................................................................................ 31 3.4.2 Multi-optimization strategy ...................................................................................... 32 3.4.2.1 System functions ............................................................................................... 34 3.4.2.2 Low-resolution optimization ............................................................................. 35 ix 3.4.2.2.1 Objective function and constraints .............................................................. 35 3.4.2.2.2 Constraints ................................................................................................... 36 3.4.2.3 High-resolution optimization ............................................................................ 39 3.4.2.3.1 Objective function ....................................................................................... 39 3.4.2.3.2 MPC-pre and MPC-post Constraints .......................................................... 40 3.4.2.3.3 MPC-post constraints .................................................................................. 42 3.4.2.4 Penalty formulation ........................................................................................... 43 Chapter 4: Results and Discussion .............................................................................................44 4.1 Computational complexity and time comparison ......................................................... 47 4.1.1 Multi-optimization method ....................................................................................... 47 4.1.2 Proposed formulation ................................................................................................ 48 4.1.3 Resolution and horizon changes ............................................................................... 49 4.1.4 MPC-pre versus MPC-post ....................................................................................... 51 4.1.5 Penalty constraints .................................................................................................... 51 4.1.6 Forecasting ................................................................................................................ 51 4.1.7 Low-performance hardware ...................................................................................... 52 4.2 Net cost comparison ...................................................................................................... 52 4.2.1 Proposed MPC strategies .......................................................................................... 52 4.2.2 Resolution changes ................................................................................................... 53 4.2.3 MPC-pre versus MPC-post ....................................................................................... 56 4.2.4 Penalty constraints .................................................................................................... 57 4.2.5 Forecasting ................................................................................................................ 58 4.2.6 Selling tariff ratio ...................................................................................................... 59 x 4.3 Analysis of behavior ..................................................................................................... 59 4.3.1 EES and relative improvement ................................................................................. 59 4.3.2 Micro-CHP and EES charging .................................................................................. 64 Chapter 5: Conclusions ...............................................................................................................67 5.1 Summary ....................................................................................................................... 67 5.2 Key contributions .......................................................................................................... 70 5.3 Limitations .................................................................................................................... 71 5.4 Future work ................................................................................................................... 72 Bibliography .................................................................................................................................74 xi List of Tables Table 2.1. System overview of reviewed articles. ........................................................................ 11 Table 3.1. System characteristics of energy sources and sinks and energy storage systems. ....... 26 Table 4.1. Cost, improvement, computation time, and runtime results of HLM and MPC testing over varying scenarios for 0.6:1 selling tariff ratio..................................................... 45 Table 4.2. Cost, improvement, computation time, and runtime results of HLM and MPC testing over varying scenarios for 1:1 selling tariff ratio........................................................ 46 xii List of Figures Figure 1. Visualization of the system setup. ................................................................................. 27 Figure 2. Example of timeline and actions for MPC-pre and MPC-post with a HR optimization time-step of 10-minutes................................................................................................ 29 Figure 3. Graph showing the relationship between average computation time per time-step and # of time-steps. The % improvement in displayed in respective fashion next to the datapoints to show the performance of each test. It should be noted that the % improvement should only be compared between tests with the same selling cost ratio, either 0.6:1 or 1:1. The resolution, in minutes, and optimization horizon, in hours, is designated at the bottom of the graph for each set of test scenarios. The presented scenarios include the those using real loads performed on the laptop. ........................ 50 Figure 4. State-of-charge of the EES and % improvement of the MPC-pre strategy over the HLM over 7-days with a 0.6:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. ................................................................. 62 Figure 5. State-of-charge of the EES and % improvement of the MPC-post strategy over the HLM over 7-days with a 0.6:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. ................................................................. 62 Figure 6. State-of-charge of the EES and % improvement of the MPC-post strategy over the HLM over 7-days with a 1:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. ................................................................. 63 Figure 7. State-of-charge of the EES and % improvement of the MPC-post strategy over the HLM over 7-days with a 1:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. ................................................................. 63 xiii Figure 8. A 12-hour sample of PCHP and PEES behavior from the MPC-pre test with a 0.6:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. .......................................................................................................................... 65 Figure 9. A 12-hour sample of PCHP and PEES behavior from the MPC-post test with a 0.6:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. .......................................................................................................................... 65 Figure 10. A 12-hour sample of PCHP and PEES behavior from the HLM test with a 0.6:1 selling tariff ratio and real loads................................................................................... 65 Figure 11. A 12-hour sample of PCHP and PEES behavior from the MPC-pre test with a 1:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. .......................................................................................................................... 66 Figure 12. A 12-hour sample of PCHP and PEES behavior from the MPC-post test with a 1:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. .......................................................................................................................... 66 Figure 13. A 12-hour sample of PCHP and PEES behavior from the HLM test with a 1:1 selling tariff ratio and real loads. ............................................................................................. 66 xiv List of Symbols 𝛼 Modification factor for /kW to /kWh 𝐵𝑆𝐹𝐶𝑎𝑐𝑡𝑢𝑎𝑙𝐶𝐻𝑃 Actual function of BSFC for the CHP (g/kWh) 𝐶𝑒𝑙𝑒𝑐(𝑡) Cost of electricity at time-step 𝑡 ($CAD/time-step) 𝐶𝑒𝑥𝑡𝑟𝑎 Extra cost 𝐶𝑓𝑢𝑒𝑙(𝑡) Cost of fuel at time-step 𝑡 ($CAD/time-step) 𝐶𝑚𝑎𝑖𝑛𝑡(𝑡) Cost of maintenance at time-step 𝑡 ($CAD/time-step) 𝐶𝐴𝐻(𝑡) Cost of maintenance at time-step 𝑡 ($CAD/time-step) 𝐶𝑜𝑠𝑡𝐿𝑅 Cost of LR objective function 𝐶𝑜𝑠𝑡𝐻𝑅 Cost of HR objective function 𝑐𝑃𝐴𝐻 Penalty constant for 𝑃𝐴𝐻 𝐸𝑒𝑥𝑡𝑟𝑎𝑒𝑙𝑒𝑐 Extra electricity energy (kWh) 𝐸𝑒𝑥𝑡𝑟𝑎ℎ𝑒𝑎𝑡 Extra heat energy (kWh) 𝐸𝐸𝐸𝑆(𝑡) Energy of the EES at time-step 𝑡 (kWh) 𝐸𝑐𝑢𝑟𝑟𝑒𝑛𝑡𝐸𝐸𝑆 Current energy value of the EES (kWh) 𝐸𝑇𝐸𝑆(𝑡) Energy of the TES at time-step 𝑡 (kWh) 𝐸𝑐𝑢𝑟𝑟𝑒𝑛𝑡𝑇𝐸𝑆 Current energy value of the TES (kWh) 𝐹𝐶𝐻𝑃(𝑡) Fuel usage at time-step t (g) 𝐹𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 Average historical value of 𝐹𝐶𝐻𝑃(𝑡) at the control time-step (g) 𝐹𝑙𝑖𝑛𝑒𝑎𝑟𝐶𝐻𝑃 Linear function of the fuel used by the CHP (g) 𝐹𝐶𝐻𝑃(𝑡) Fuel usage of the CHP at time-step 𝑡 (g) 𝑓𝜆𝑒𝑙𝑒𝑐 Selling tariff ratio for 𝜆𝑒𝑙𝑒𝑐 xv 𝑓𝑎𝑣𝑔𝜆𝑒𝑙𝑒𝑐 Average historical value of 𝑓𝜆𝑒𝑙𝑒𝑐 at the control time-step 𝐻𝐶𝐻𝑃(𝑡) Thermal power of the CHP at time-step 𝑡 (kW) 𝐻𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 Average historical value of 𝐻𝐶𝐻𝑃(𝑡) (kWe) 𝐻𝑙𝑖𝑛𝑒𝑎𝑟𝐶𝐻𝑃 Linear function of the thermal power produced by the CHP (kW) 𝐻𝑃𝑅𝑎𝑐𝑡𝑢𝑎𝑙𝐶𝐻𝑃 Actual function of the HPR for the CHP (kW/kWe) 𝐻𝐷𝐻𝑊(𝑡) Thermal power required by the DHW load at time-step 𝑡 (kW) 𝐻𝑙𝑜𝑎𝑑(𝑡) Thermal power required by the load at time-step 𝑡 (kW) 𝐻𝑇𝐸𝑆(𝑡) Thermal power out of (+) and into (-) the TES at time-step 𝑡 (kW) 𝜆𝑏𝑢𝑦𝑓𝑢𝑒𝑙 Cost of fuel ($CAD/g) 𝜆𝑏𝑢𝑦𝑒𝑙𝑒𝑐 Cost of electricity ($CAD/kWh) 𝜆𝑚𝑎𝑖𝑛𝑡 Cost of maintenance ($CAD/hr) 𝑀 A large constant 𝜂𝑇𝐸𝑆 Half the round-trip efficiency of the TES 𝜂𝐸𝐸𝑆 Half the round-trip efficiency of the EES 𝑃 Power (kWe) 𝑃𝐴𝐻(𝑡) Power required by the AH at time-step 𝑡 (kWe) 𝑃𝐶𝐻𝑃(𝑡) Power provided by the CHP at time-step 𝑡 (kWe) 𝑃𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 Average historical value of 𝑃𝐶𝐻𝑃(𝑡) at the control time-step (kWe) 𝑃𝐸𝐸𝑆(𝑡) Power from (+) or to (-) the EES at time-step 𝑡 (kWe) 𝑃𝑔𝑟𝑖𝑑(𝑡) Power from (+) or to (-) the grid at time-step 𝑡 (kWe) 𝑃𝑙𝑜𝑎𝑑(𝑡) Power required by the load at time-step 𝑡 (kWe) 𝑃𝑃𝑉(𝑡) Power provided by the PV at time-step 𝑡 (kWe) xvi 𝑃𝑈𝐶𝐻𝑃(𝑡) Power and on/off state of the CHP at time-step 𝑡 (kWe) 𝑟𝐿𝑅 Resolution of LR time-step (min.) 𝑟𝑀𝑅 Resolution of MR time-step (min.) 𝑟𝐻𝑅 Resolution of HR time-step (min.) 𝑆𝑔𝑟𝑖𝑑(𝑡) Piecewise cost of purchasing/selling electricity at time-step t ($CAD) 𝜎𝐶𝐻𝑃(𝑡) Piecewise penalty constraint at time-step t 𝜏𝐿𝑅 Number of time-steps for the LR optimization horizon 𝜏𝑀𝑅 Number of time-steps for the MR optimization horizon 𝜏𝐻𝑅 Number of time-steps for the HR optimization horizon 𝑡 Time-step 𝑡𝐿𝑅𝑀𝑅 Index of 𝜏𝑀𝑅 within the LR optimization 𝑡𝑀𝑅𝐻𝑅 Index of 𝜏𝐻𝑅 within the MR optimization 𝑢 Binary state variable (0 or 1) 𝑢𝐶𝐻𝑃(𝑡) Binary state of the CHP at time-step 𝑡 (0 or 1) 𝑥 Part-load ratio (kWe/kWerated) xvii List of Abbreviations AB Auxiliary boiler AC Absorption chiller AH Auxiliary heater ANN Artificial neural networks BSFC Brake-specific fuel consumption CHP Combined heat and power CNN Convolutional neural networks DP Dynamic programming DHW Domestic hot water EC Electric chiller EES Electrical energy storage ELM Electricity-led method EV Electric vehicle HLM Heat-led method HPR Heat-to-power ratio HR High-resolution LP Linear programming LR Low-resolution MES Multi-energy systems MILP Mixed-integer linear programming MINLP Mixed-integer non-linear programming MPC Model-predictive control xviii MR Medium-resolution NLP Non-linear programming PV Photovoltaic solar panels SA Smart appliances TES Thermal energy storage xix Glossary Absorption chiller A refrigeration system that removes heat from one location and releases it in another. CCHP/Micro-CCHP A CHP system that also produces CHP A system or device that generates electricity usually by combusting fossil fuels while capturing much of the waist heat. Often is based on a combustion engine, micro-turbine, or Stirling-engine attached to a generator or fuel-cells. Cogeneration An alternate name for a CHP system. Dynamic programming A optimization technique where predefined solution paths are created then solved using a technique such as a shortest path method. Fuel-cell A electro-chemical device that converts fuel, often natural gas, into electricity and heat. Fuzzy logic An artificial intelligence technique that used membership functions and a rule base to make soft decisions. Linear programming A type of optimization formulation where there is an objective function that is to be minimized or maximize and a set of linear constraints that relate constrain terms from the objective function. Non-linear programming is the linear programming with some non-linear constraints. Mixed-integer programming notes the inclusion of integer variables. Micro-CHP A CHP with a rated power of < 50 kWe that is small and often a single device rather than a system. Micro-turbine A small gas-turbine based machine. xx Polygeneration A system often based on a CHP or CCHP system that generates more than 3-types of energy or outputs. Stirling engine A type of engine that uses difference in temperature to create work. Ramp rate The rate at which a generator is ramped up or down in power production. Virtual power plant A collection of distributed generation power producers that work together as one virtualized power plant. xxi Acknowledgements My sincerest thanks to my supervisor Dr. Homayoun Najjaran for his advice and guidance through my graduate degree. He was always willing to take a minute to talk about my last-minute problems and always provided guidance that would point me in the right direction. I would like to thank Jai Zachary and ElectroMotion Energy for welcoming me into their company with open arm and guiding me through the word of micro-CHP technology. I learned so much in such a short time and for this I am grateful. To my colleagues at the Advanced Control & Intelligent Systems (ACIS) Laboratory, I thank you for listening to my wild ideas and for making this degree that much more enjoyable. A special thank you to my family Don, Lori, Matt, and Sheneice and to Cole and all my good friends for supporting me through this journey, listening to my problems, and giving me great advice that helped me get through this degree. xxii Dedication This work is dedicated to my late father Don Robertson who always inspired me to follow the path that I chose and to push myself to meet my full potential. 1 Chapter 1: Introduction This thesis is devoted to improving the control of multi-energy system (MES) based around a micro-CHP (combined heat and power) system. In this introduction, the motivations behind this research are first presented followed by some background information to provide context around micro-CHP systems and the context of how optimal operation in a small residence fits into the context of the micro-CHP control strategies and environments. Finally, the remainder of the thesis will be outlined, and the major contributions will be asserted. 1.1 Motivation The use of micro-CHP systems as alternative energy systems for on-site power production has increased in popularity over the past four decades resulting in over 50 cogeneration appliances under 50 kWe that can be used for small to medium sized residential systems [1]. Micro-CHP systems are typically quite economical since the price of fossil fuels is often much lower than the price of electricity and since micro-CHPs often boast high overall efficiencies. Moreover, the use of a micro-CHP in residential systems reduces a household’s greenhouse gas emissions when compared to a conventional systems [2]. This makes micro-CHP technologies an economical and environmentally friendly alternative to conventional heat and power generation. Conventional power production can result in a substantial loss between burning the fossil fuels at the power plants and to get the electricity to the residential consumer. The loss is mostly due to the inefficient production of energy. The average efficiency of these plants in the USA varied from an average of 38 and 38.2 to 43.1 and 42.4 between 1993 to 2003 for oil and gas-fired power plants [3], respectively. Implementation of CHP-based systems is a simple way to improve these efficiency figures since the efficiency of CHP systems can range from around 50%-95% [1]. 2 More loss also occurs due to transmission and distribution line losses simply getting the electricity to the consumer. As an example, the average transmission and distribution losses in the state of California, USA between 2002 and 2008 was about 7% [4]. To improve grid efficiency and reduce the environmental impact of power production, these line losses must be addressed. Additionally, due to the growing demand of electric vehicles (EV), the transmission and distribution losses will be further increased and the use of smart charging of EVs will be important for maintaining viability with the grids [5] [6]. The use of EVs integrated into optimal operation formulations is not done in this work; however, it has been performed by other works and is discussed as a part of potential future work. One strategy commonly used by many utilities is demand side management. If consumer demands can be reduced onsite particularly at critical times, then there is both less stress on the grids and often less power usage overall. A second strategy is to implement power production onsite to meet consumer demands and potentially export excess electricity to the grid. This can be done with many different types of systems such as micro-CHPs and solar panels. A third strategy is to put both these ideas together and to manage onsite power resources in optimal ways either for the consumer, the grids, or both. Despite being such a beneficial technology, adoption of micro-CHPs has been slow [1] [2]. This means that the most incentivized strategies are key for improving adoption; optimizing the operation of these micro-CHP systems alongside all other local power systems to minimize cost to the consumer. Implementation of on-site systems such as solar power, battery storage, and micro-CHP technologies can also help to reduce the pressure of peak power production on the grids. However, each technology alone has its limitations. Solar power production does not peak at the same time as residential power usage; this can be addressed using battery storage. The power production of PV is also subject to weather conditions and geographical location. Micro-CHPs also produce 3 more emissions as compared to many renewable energies. A micro-CHP-based system alongside subsystems such as thermal energy storage (TES), electrical energy storage (EES), photovoltaic solar (PV), and many others can work together to maximize the benefits from all subsystems and result in high efficiencies and increased economic benefits. Advanced algorithms have been developed to control these subsystems in near-optimal ways to achieve high cost savings and/or lower emissions. There is much research into the control of MES [7] and the control of CHP systems [1] [8] and combined cooling heat and power (CCHP) systems [9]; however, the newest research is often not using and/or not contrasting the most beneficial techniques established in the previous literature. Also, there are still some gaps left in the literature that can be addressed. This is discussed further in Chapter 2: Literature Review. 1.2 Context and Background 1.2.1 Combined-heat and power Also known as cogeneration systems, CHP systems utilize fossil fuels to produce electricity while scavenging the waste heat. Both the electricity and heat are to be used by parallel systems which results in a high overall efficiency since the fossil fuel is economically used. The complexity associated with CHPs is due to the coupled relationship of heat and power. This increases the complexity related to both sizing of the system and components and controlling of the system. There are 5 major CHP types which use different prime movers: combustion engine, turbine/micro-turbine, fuel cell, and Stirling engine [1]. The combustion engine and turbine/micro-turbines produce electricity using the work produced by burring the fossil fuels whereas the Stirling engine uses a temperature difference to create work and are known for their high heat-to-power ratios [10]. Fuel cells use an electrochemical process to produce electricity with heat as a 4 byproduct. One of the primary differences between the operation of many of these systems is in how they are used. For the case of small systems. Fuel cells with a small power production are often used because they are mostly operated in a continuous fashion with no shutdowns. Micro-turbines and Stirling engines are operated either continually, more so with micro-turbines, or with shutdowns, more with Stirling engines. Combustion engines often have the lowest heat-to-power ratio and are almost always operated with shutdowns. This means that despite all the CHP systems being similar in that they take in fossil fuels and produce both heat and power, they cannot all be lumped into one model. They require different sizing requirements, and some require different control algorithms. Even if the same control algorithms are to be used, the resulting behavior is likely to vary. With the addition of an absorption chiller (AC) or electric chiller (AE) as a subsystem, a CHP system is dubbed a combined cooling, heat, and power (CCHP) system [9]. These systems add further complexity since there are now three dependent resources, cooling energy, heat energy, and electricity. 1.2.2 Control of CHP-based systems CHP systems are traditionally used by large-scale power producers. These large plants collect the waste heat from power production of large generators and use it as a source of local heating and district heating. Such plants deal with the wholesale electricity market and therefore require different control algorithms than small-scale systems. These plants must find the optimal power production to commit to the utilities. This is called the economic dispatch problem. It is a widely researched topic and deals with how to economically run a CHP plant. The unit commitment problem is also dealt with in these plants whereby individual generators must commit 5 to produce the desired power output. Often economic dispatch and unit commitment are solved simultaneously by one algorithm for these plants. The energy management problem is associated with managing energy resources in a system containing multiple energy producers. Advanced energy management algorithms are usually formulated as an optimization of the states of all energy producers. Such a problem is solved using techniques such as linear programming (LP). However, some of these energy management formulations consider these states over a time-horizon and are better described by the optimal operation problem. A CHP-based system that utilizes constraints that link the states temporally should be solved as an optimal operation problem or optimal scheduling problem. This means that if an energy storage device is present then the states of the system at every time-step are dependent. Often these problems are solved using LP or dynamic programming (DP) or approximated using fuzzy logic and may use short-term load forecasting. Since the solution of these problems results in the optimal state of all system variables over a time horizon, the solution is either used as a schedule for operation or used with an MPC strategy. 1.3 Objectives The aim of this research is to develop an MPC strategy that is computationally feasible when a standard MPC strategy would not when solving the optimal operation of a micro-CHP-based residence with energy storage while maintaining constraint complexity. Such a strategy should be feasible on standard or low-performance hardware and should provide good performance in comparison to alternative methods. 6 The proposed research will identify and utilize the practical and efficient optimization methods to formulate a generic template for how such models’ optimizations should be formulated. Chapter 2: Literature Review reinforces the ideas for such formulations and discusses and provides criticism to previous works. The use of MPC strategies based on LP techniques is the superior strategy for controlling a micro-CHP-based system in a residence, discussed in Chapter 2: Literature Review. One major issue with using an MPC strategy is that the optimization needs to be solved before the next time-step. This means that either the MPC strategy must use a relatively large time-step with a moderately complex optimization or a small time-step must be used with a relatively simple optimization in order to maintain a reasonable computation time. The issue with large time-steps is that it can influence the outcome by making the problem more discrete and that load/prediction changes are not considered until the next time-step. The issue with a simple optimization is that the constraints may be too simple to obtain an accurate optimal solution. The proposed research aims to create a model where more complicated constraints can be used with a small time-step. The proposed technique does this using progressively more complicated optimizations that use the previous optimization results to constrain the horizon. This method is tested with varying time-step sizes and horizon lengths to determine how these variations effect performance. This will be discussed further in Chapter 3: Methodology. There are many major factors that can affect the performance of an optimization for the optimal operation of a micro-CHP-based system. The selling price of electricity and presence of forecasting inaccuracies (predicted loads) are both tested and discussed to provide a better understanding of such factors and to assess the robustness of the proposed algorithm and problem formulations. The resolution of the proposed algorithm is also adjusted to help provide insight into 7 the potential benefits of high-resolution solutions. This is discussed in Chapter 4: Results and Discussion. 1.4 Contributions The major contributions of the work performed in this thesis are as follows: • Proposed a technique for giving flexibility to the resolution and constraints used for the optimal operation of a micro-CHP-based system. This technique allows for more complicated constraints to be used with a resolution finer than what would traditionally be possible. The proposed method is demonstrated using a high-resolution with relatively complex constraints. • Proposed and tested two types of MPC formulations for the optimal operation of a system containing a combustion engine-based micro-CHP, PV, an auxiliary heater (AH), TES, and EES. • Performed a set of multi-variate tests on the proposed MPC formulations to better understand the effects of selling price of electricity on the performance of an optimal operation algorithm. • Investigated the effects of forecasting inaccuracies and model resolution on the performance of the proposed MPC strategy. • Proposed and investigated the use of a novel heat-led method (HLM) for the control of a micro-CHP-based system. • Ensured that all of the proposed work is viable using low-performance hardware and open source software. 8 Chapter 2: Literature Review 2.1 Background 2.1.1 Conventional operation strategies For the operation of CHP and CCHP units, there are two conventional operation strategies that are used. Either a heat-led method (HLM/HL) or electricity-led method (ELM/EL) are required due to the independent nature of the electricity and thermal energy production as well as demand [11]. 2.1.2 Heat-led method The HLM also referred to as heat demand management (HDM) is where the thermal output of the CHP is matched to the thermal load [12]. It is the preferred mode of operation for small CHP systems. Following the heat demand results in a high efficiency since the CHP only operates to satisfy the thermal demand. However, this method is only relatively economical since it does not consider the economic effects of electricity tariffs [11]. CHP systems can buy and often sell electricity to the grid or store the electricity for later use [12]. Alternatively, excess thermal energy may also be stored or heat dumping can be performed to release excess heat into the atmosphere [10] [13]. 2.1.3 Electricity-led method The ELM also referred to as Electricity demand management (EDM) is another conventional operational strategy where the electrical output of the CHP is matched to the electricity load. Auxiliary heating systems may be incorporated to deal with excess heat demand. This operation mode is especially important if the CHP system is disconnected from the grid e.g., 9 in the case of a microgrid. This is because a grid disconnect would require the electricity load to balance with the electricity production. Other variations include the minimization of exported electricity such as in [10]. Excess thermal energy is often either dumped or stored in a TES system as it is in an HLM. 2.2 Other operation strategies 2.2.1 Large-scale CHPs and CCHPs With large-scale CHP plants the optimization of operation is often about the economic dispatch and unit commitment of the plants where the optimization is targeted towards optimizing the states of the system [8]. The optimal scheduling of CHP subsystems over a time horizon is a common control strategy where the internal states of the individual generators are optimized over time to create an optimal schedule of operation [14]. Most often this problem is not as complicated as an optimal operation problem because there is a lack of temporal constraints to increase the complexity of the optimization. The problems that include energy storage, such as in [15] [16] [17], and ramp rate constraints, such as in [18] [19], are most practical for planning problems [14]. The inclusion of temporal dependency constraints in an economic dispatch problem is sometimes called dynamic economic dispatch. 2.2.2 Microgrids CHP-based microgrid operation often is controlled using horizon-based methods [20] and is formulated as an optimal operation problem. Microgrids with heat and power resources act as a large micro-CHP-based system just on a macro scale. While much of these systems are large in scale, many are also medium scale such as buildings or hospitals. These cases are quite similar to 10 those discussed in this work and share the same concerns such as load uncertainty, model complexity, and model resolution [20]; however, due to the scale and location of these microgrids, much of these are neglected from this literature review. 2.3 Optimal operation in small residential systems This section discusses the control strategies for micro-CHP systems in small residences that are formulated as an optimal operation problem. The prime mover power rating and building type of all relevant references are detailed below in Table 2.1. 11 Table 2.1. System overview of reviewed articles. Reference Description Prime mover rating (kWe) Building type [11] 8.0 Single residence [10] 2.0 Residential [13] 20 50 apartment housing [21] 16 Unspecified [22] 15 Building, MSU [23] 10 Small office building [24] 1.2 Residential home [25] 1.2 Residential [26] 1 & 2 Residential [27] 1 & 2 Residential [28] ~0.7 Residential [30] 3 Residential [31] ~2.5 Residential home [32] 65 - 100 Small & large hotel, restaurant, & residential neighborhood [33] 9.0 Small microgrid [34] 2.25 Single-family home [35] 5.5 Smart home [36] 3.0 Residential home [37] 0.3 Smart home [38] ~8.8 - ~14.7 Unspecified Note: Values extrapolated from figure or text that are not explicitly mentioned are denoted by “~”. 12 2.3.1 Equipment considerations CHP and CCHP systems typically rely on one of the following types of prime movers: combustion engine [21] [22] [10] [13] [23], fuel cell [10] [24] [25] [26] [27] [28] [29] [30] [31], micro-turbine [32], or Stirling engine [10]. The most prevalent addition to a micro-CHP-based system is thermal energy storage (TES) and is used in [33] [11] [34] [35] [10] [36] [24] [26] [32] [27] [13] [28] [29] [30] [23]. Caliano et al. [13] tests how 6 different sizes of TES effect the optimal operation problem. Electrical energy storage (EES) is also common as seen in [24] [25] [32] [28] [23] and in [35] [37] where electric vehicles are used as the EES device. [25] goes further by investigating the effects of battery capacity and efficiency on the optimal operation of the system. Boilers either used in primary operation [22] [10] or for auxiliary heat if the prime mover is insufficient [33] [11] [34] [13] [29]. [24] [26] [27] [30] all use a backup heater if the prime mover is insufficient and [21] uses a heat pump. CCHP systems use either an absorption chiller [21] [22] or electric chiller [21] to provide cooling. Use of a smart appliance (SA) is considered in [35] and [37] and flexible loads in [11]. Some works consider alternative energy producers such as PV [33] [37] [28] and wind [33]. Systems such as in [32] only consider a micro-CHP system with no other subsystems or components. 2.3.2 Optimal operation objectives The most common objective of the optimal operation for CHP systems is to optimize for cost, normally by manipulating electricity generation. All optimization-based methods of operation mentioned in this review excluding [11] deal with cost optimization as the objective as similar to that of most CHP plants. Emission is another popular objective for CHP plants and is often used alongside the cost objective such as in [33]. The model presented in [11] uses cost as 13 the objective; however, it is mentioned that other objectives such as emissions can be easily implemented with the model. [21] presents a formulation with two successive objectives. The first is an optimization of the energy savings ratio (i.e. maximize energy usage from local generation) and the second is an optimization of the cost as mentioned previously. The energy saving ratio optimization is used as a constraint in the cost saving optimization to solve the multi-criteria optimization problem. The effects of demand response programs is investigated in [28] and was found to reduce costs, flatten out the demand profile, reduce grid power usage, and improve equipment life. 2.3.3 Problem formulations The most common technique for optimal operation is optimization and is used by [22] [34] [35] [10] [36] [24] [25] [33] [37] [38] [26] [21] [28] [30] [23] [31]. The optimal operation problem in [38] is formulated into a convex optimization problem based on Lyapunov optimization. The problem is solved analytically without the need of a solution search-based algorithm. This method was able to give a near-optimal solution for the optimal operation in real-time, and the formulation is proved mathematically to be a near-optimal solution. However, the mathematical complexity of the formulation is high which would make to model difficult to adapt to a system with different components. Some works such as [26] use a linear programming (LP) technique that must use a solver. The model developed in [26] is a simple LP model that is meant for a generic micro-CHP-based system. Although, the formulation does not allow for discontinuous operation. This means that it not applicable to micro-CHP systems that require start/stop operation such as those with combustion engines; this is also the case with the model in [31]. The model in [26] accounted for different economic situation such as a feed-in tariff or a not-yet imposed carbon tax. The annual 14 savings of the LP method were as high as 165 euros compared to an HLM and ELM. A LP model was developed in [23] that looks at 4 or 10 time-steps of operation of the micro-CHP-based system and uses a building simulation to determine the building loads. The algorithm stops erratic behavior by forcing the micro-CHP to stay on for at least 4 time-steps. It was able to achieve a 12.95% to 17.9% improvement over a conventional system. Such a model only accounts for a short time period into the future which is not ideal for the EES system since it is likely to cycle over 1-day not a 16-40 minutes. Also, the minimum on-time constraint is quite long compared to the number of time-steps in the MPC strategy, so it is possible that constraint can cause the simulated behavior differ from the actual behavior. Some models use more advanced version of LP such as mixed-integer linear programming (MILP) [34] [36] [24] [30] and mixed-integer non-linear programming (MINLP) [21] [28] to allow for more comprehensive constraints. MILP allows for integer variables and MINLP allows for integer variables and non-linear constraints. A benefit of LP techniques is that the computational load of a complex problem is often low due to the use of advanced solvers. The MILP model in [34] was able to achieve a computation time of 0.5 to 91.27 seconds while using a 15-minute resolution and 0.04 to 0.54 seconds for resolution of 1-hour. [36] used an MILP model solved with the CPLEX solver in MATLAB and was able to achieve a computation time as long as 1-minute for a 15-minute resolution resulting in 1-14% improvement over an HLM. The fast computation time is particularly important for the model in [36] because it is a model predictive control strategy using a rolling horizon and must update the solution often. The MILP formulation in [30] also utilized a resolution of 15-minutes. [24] uses an MILP model with a 1-minute resolution and a horizon of a few days which resulted in a computation time of about 66 minutes. The computation time is mostly independent of the scenario and is primarily dependent on the problem size [24]. Similar to [36], [24] uses a receding horizon, so the 15 optimization needs to have a reasonably low computation time. Also [24] aims for a method that requires non-sophisticated software. To accomplish this, a greedy algorithm with 2 parts was developed. The first part of the algorithm is used to optimize the micro-CHP and the second part is used to optimize the charging and discharging of EV. This algorithm was able to reduce the computation time by 93% while resulting in a solution with less than 3% error compared to the MILP [24]. However, unlike the MILP, the greedy algorithm is not as adaptable to a system with different components. A technique for updating day-ahead solutions is introduce in [31]. The technique uses an artificial neural network (ANN) to provide a compensation factor to update a day-ahead schedule to account for day-ahead forecasting inaccuracies. The ANN was trained offline to relate forecasting error to the optimal compensation factor to optimize the day-ahead schedule. This technique takes 10.7 seconds for each hour that it is implemented on. This computation time is substantially lower than the time intervals of the schedule which means that a more robust algorithm that is more computationally expensive could be incorporated. However, the accuracy of this technique is exceptionally high for the specific formulation, so a more robust algorithm may be unnecessary. It is worth noting that the work in [31] only uses a FC and EES and does not contain any TES. It is also used with a FC working with continuous operation with a time-step of 1-hour. Therefore, this technique may not translate easily to a system that require high resolution due to frequent cycling. [32] uses DP which is another formulation for the optimal operation problem for a micro-CCHP-based system. A shortest path algorithm in MATLAB is used for solving the model. It is also mentioned how the dynamic programming graph grows at an exponential rate and the authors limit some constraints to keep the problem at a reasonable computation level [32]. This infers that the model would not be useful for problem of greater complexity. Since the model in [32] does not 16 contain many of the components of other formulations mentioned, such as electric vehicles or electrical energy storage, the model may not be a good fit for problems more complicated than a simple case. Opposed to an optimization such as all previously mentioned works, [27] uses a fuzzy logic controller with instantaneous inputs and outputs. A HLM, ELM, and a LP model from [26] are used for comparison. Unlike the other works mention in this review, the model is meant to approximate an optimization by using rational that tends towards an optimal solution. Energy usage is maximized while producing no excess heat. The fuzzy logic controller was able to outperform the HLM, ELM, and LP model except for one scenario where the LP model was marginally more profitable. The superiority of the fuzzy logic controller is positively correlated to the selling price of electricity since the maximization of energy usage will result is less profitability when the selling price is reduces [27]. Despite finding of the authors, the conclusion that the fuzzy controller is superior to all LP models should not be generalized since, by definition, LP aims at providing an optimal solution. The authors mention that the superiority of the fuzzy logic controller in [27] over the LP model in [26] is likely due to inaccuracies of forecasting or simplicity of the LP model. Also, the model in [26] is a generalized model that is quite simple, so it would be useful for future work to test a similar fuzzy logic controller against more advanced LP-based models. Like in [26], the fuzzy logic controller does not consider on/off operation and cannot be generalized to many micro-CHP systems. Some works focus on the use of a solver for solving the optimal operation problem. A common solution is to use a commercial solver such as the IBM ILOG CPLEX solver as in [36], also in [28], where the authors were able to achieve fast computation times with a good solutions. Another popular alternative is to use a custom search heuristic algorithm as in [13] [25] [33] or a 17 simple iterative algorithm. A colonial competitive algorithm was developed in [25] and compared against a harmony search algorithm for day-ahead optimization with hourly resolution. The proposed algorithm in [25] was more powerful and accurate than the harmony search algorithm. [33] proposed a modified bacterial forging algorithm for a multi-criteria optimal operation problem. The multiple criteria were combined using a fuzzy satisfactory method to minimize the difference between the chosen membership values and the calculated membership values. The proposed algorithm was able to achieve better results compared to a particle swarm optimization algorithm and a genetic algorithm; however, the computation time was the highest among the three. Due to the fuzzy satisfactory method, [33] provides the only method that results in a subjective answer to an optimization problem. This is because cost and emissions are conflicting objectives, so a Pareto optimal solution does not exist without added context, in this case by the fuzzy satisfactory method. 2.3.4 Optimization constraints and system modelling Maintenance cost is considered by [33] [10] [25] [26] [32] where [25] even considers the battery maintenance cost. Maintenance cost was the main driver of operation alongside heat demand in [32], this is especially the case for the small hotel and restaurant case studies at times of low tariff. Start-up and shutdown costs serves a similar purpose to maintenance costs by reducing the incentive to operate in an way that could be harmful to the system. [11] considers a start-up cost, [25] considers a shutdown cost, and [33] [32] considers both a start-up and shutdown cost. Caliano et al. [13] apply a constraint to limit the number of run cycles of the micro-CHP to 2 per day which serves a similar function to the start-up and shutdown cost constraints by penalizing major start 18 and stop behavior. A minimum up-time and a minimum downtime constraint are used by [24]. Cold- and hot-start constraints are utilized in [30] due to the heat-up requirement of the PEMFC micro-CHP. [24] [26] [32] [30] all consider ramp rate constraints. This is likely the most important for [32] since the prime mover is fairly large and would have a reasonably slow ramp rate. Most works do not consider ramp rate likely because the smaller prime movers have the ability for high ramp rates such that the time-step size is longer than the maximum ramp rate. Accuracy of many models is reduced by linear approximation when using LP techniques. [34] uses a piecewise approximation for the electricity and heat production of the micro-CHP. [22] uses a quadratic efficiency curve for the micro-CHP and uses fixed point iteration to linearize the constraint and solve the problem. Apposed to using linearized constraints related to efficiency, [24] constrains the operation of the prime mover to points of fixed efficiency; either full-, half-, or no-load operation. Both the thermal and electrical efficiencies are assumed to be fixed in [30]. Another issue with optimization techniques is that the horizon is limited and so the final values of transient variables are optimized; however, this is not considering how this would affect points past the end of the horizon. To address this, [34] uses a constraint that assumes the end state of the TES should be the same as it was a day previously. This assumption assumes that all days are similar, and while it may not be a based on a perfect assumption, the constraint resulted in an improvement of 2% for the solution. The individual components of the micro-CHP are considered in [22]. This results in an accurate and detailed set of constraints; however, this also requires many constraints and 24 variables which is computationally expensive. Since the scope of [34] and [11] both consider a building, they apply soft constraints to penalize lack of comfort for the consumer. 19 2.3.5 Stochastic nature of domestic loads Because of the stochastic nature of electrical and thermal loads, methods that consider loads as deterministic are unlikely to be robust. Many methods such as those in [22] [34] [35] [32] use accurate building models for forecasting the thermal loads of a building. [13] uses the software TRNSYS to simulate the heating and cooling loads of the desired building to be used for the optimization forecast. [22] deals with a building that has mostly scheduled loads, so the electrical loads are assumed as deterministic and the stochastic nature of the unscheduled loads is ignored. The stochastic nature of the loads in [13] should be less variable than most other works mentioned since the building considered contains 50 apartments compared to a single residence considered in most other works mentioned. [32] assumes that the loads are known for the optimal operation; however, due to the size and types of the building in the case studies, this assumption would not be valid for single residence or smaller building. Some sources address the stochastic nature of the thermal and electrical loads directly. [34], [25], and [28] consider the loads as stochastic variables with [25] using a Monte Carlo simulation for the forecast which resulted in saving of $0.3 per day over treating the loads as deterministic variables. [34] uses the aid of weather data to aid with the stochastic forecast. Stochastic variables may be representative of the loads; however, they are not accurate to the actual loads. As such, an alternative to treating the loads as stochastic variables is to forecast by treating the loads as deterministic variables predicted through models that use external information to learn correlations. An example of an advance model of this kind would be in the works of [24] where an ANFIS model is used for short-term forecasting that could achieve error 3.3% and lower. The use of forecasting techniques in optimal operation can be extremely important. Some works such as [25] use day-ahead scheduling to control the micro-CHP-based system. This is 20 common for large-scale plants that participate in the day-ahead wholesale electricity market; however, large plants are supplying a large number of loads and not a single residence, so the variance of the net load should be smaller due to the large sample size. [25] partly addresses this by treating the loads as stochastic variables. Also, the resolution used by [25] is hourly resolution as is used in [28]. [31] also uses day-ahead forecasting; however, the loads are reforested before the day-ahead schedule is used and this new forecast is used in conjunction with an ANN to update the schedule. [39] tests the effect of sampling time on the optimal operation of a residential micro-CHP-based system using MILP that could did not allow for the trade of electricity. It was found that the difference between a 1-hour and 5-minute time interval could give about 4% difference in cost. However, low resolution runs inflate the savings estimated by the model and even 5-minute and 10-minute resolution produced different costs [39]. The model in [24] uses a 1-minute sample time for a high resolution solution. This model is also based on a rolling horizon, meaning that the solution is continually updated [36]. A rolling horizon approach can address a change in the forecasts since the solution is continually update. [36] presents a model predictive control method that is also based around a rolling horizon and a sampling time of 15-minutes is used; however, as with [24], the model is not tested with loads inaccurate to the forecasts. This is a major benefit of a rolling horizon approach and should be investigated. An MPC strategy using a 15-minute resolution was also used by [30], but the electrical loads are assumed to be the average profile of a residential home by assuming that a cluster of buildings is acting as a virtual power plant. This is an odd assumption and the short-comings of a smart algorithm are likely to be more prevalent when using real loads from a single residence. A real-time optimal operation strategy is implemented in [32] and the dynamic programming model is set up with a 15-seconds resolution. 21 The fuzzy logic controller used in [27] allows for near-real-time decision making, unlike all other solutions. 2.3.6 Flexibility A common system component in much of the articles in this review is a TES. [33] [11] [34] [35] [10] [36] [24] [26] [32] [27] [13] [30] all have a TES as a component that is able to aid in the flexibility of the system by allowing a degree of decoupling between the thermal and electrical production of the micro-CHP. EES serve a similar function [35]. [24] [25] [32] all utilize EES; however, the flexibility that is added would be less than the TES since all methods considers the thermal energy as a hard constraint that must be satisfied while the electrical energy is a variable subject to the optimization. This is except for [27] which does not use an optimization, [34] that considers comfort as a soft constraint, and [21] which consider EES as a hard constraint due to the inability to trade electricity. [35] and [37] discuss the use of EV as EES. The combination of both EV and TES can be used as an effective way of uncoupling the thermal and electrical energy production [35]. It is noted by [25] that battery contribution is subject to the costs at play in the optimization and the battery efficiency. If the battery contribution is reduced, then the flexibility would also be reduced. Heat dumping is a control option that can be implemented in some systems. [10] and [13] both use heat dumping to improve flexibility. The micro-CHP system in [13] does not allow for part-load operation and therefore heat dumping is quite beneficial. Additional flexibility was accomplished while the resulting amount of thermal energy dumped was low. This strategy helped lead to greater saving compared to an HLM. It is also noted that the savings were highest when 22 the TES was small and the savings approached zero as the TES grew larger [13]. This is likely due to the virtually unlimited flexibility that would come with a large enough TES. SAs are considered by [35] and [37] to provide flexibility to the electricity production of the system by providing a flexible electricity load. [37] found that the operation of SAs tended to be at times of low electricity tariffs. This means that they operate at times of lowest incentive which means that more power could be traded at times of higher tariffs. Flexible loads are often synonymous with SA. [11] uses flexible loads to increase local electricity usage and reduce peak demand. This was able to increase the optimal solution in [11] by 6%. The fuzzy logic controller presented by [27] should be more rigorously tested since the system does not account for future changes. This means that the system cannot be flexible in preparation for changing loads and may not be able to effectively handle these changes. Future study should investigate this further. 2.4 Summary It can be noted that there is a large variety of components included in the scope of the works discussed. This means that it is important for a model to be adaptable to systems with different components in order to fully address the optimal operation problem for a general case. Many existing methods make it difficult to alter the formulations or in altering the formulations, computation time may become an issue. One commonality between much of the optimization-based strategies is the use of simplistic or relaxed constraints likely chosen to maintain a reasonable computation time. The use of models for forecasting can produce good results; although, this presents an issue of adaptability. The use of state-of-the-art prediction techniques or an easily accessible and generalizable model for buildings would be best for use in non-case specific 23 application of a micro-CHP-based system. To fully address the stochastic nature of thermal and electrical loads, a receding horizon with MPC approach is useful for continually updating solutions. This should reduce the effects of inaccurate predictions and help rectify erroneous behavior caused by inaccurate constraints; however, the actual investigation of the impact of an updated solution has not yet been investigated. Regardless of the case, small systems such as in the work mentioned should either treat the loads as stochastic variables or implement methods to mitigate the inaccuracies that accompany stochastic variables. 24 Chapter 3: Methodology 3.1 Materials 3.1.1 Hardware and software One of the main focuses of this research is for the developed control system to be used with a low-performance, low-cost computer so that the cost of implementation is reasonable for small systems. The tests are performed on a Laptop running a 2.6-GHz Intel Core I7 processor to get the majority of the results and a Raspberry Pi 3 B+ [40] is used to test the computational feasibility since it is one of the most widely used and inexpensive single-board computers. The optimization software is only running on 1 core while the model-predictive control program is running in a separate process. This means that despite the continual use of the optimization software, the wear on the computer is limited. However, the control scheme could easily be used on a more powerful computer. The optimization software used for solving the MINLP problems in the model-predictive control strategy is the SCIP Optimization Suite [41] which is the fastest open-source optimization software. Further improvement to the speed of the optimizations allowing for more complex constraints could be obtained by using a faster optimization software such as the IBM CPLEX solver [42], by using previous solutions for solution initialization, or using better hardware. By using open source software and inexpensive, low-performance hardware, advanced control systems can be competitive with lower intelligence control systems since the cost of implementation remains low. 25 3.1.2 Load data Due to the requirements of the methods being used, the data was obtained from various sources with varying timescales and resolutions. Data was required for the electricity load, PV output, domestic hot water (DHW) load, and thermal load for a residential home. The resolution required is 1-minute. Moreover, the data needs to be from a residential home during cold weather which limits the available datasets due to timescale and environment. Realistic volatility is required so the electricity, PV, and DHW datasets are all taken from datasets using real measurements. It is noted that there is error associated with combining multiple energy-based datasets into one simulated scenario; however, testing with such data should show insight into the basic ability and benefits of the methods being used. The electricity load data was obtained from the Smart* Dataset for Sustainability [43]. The data contains mixed resolutions varying from 1-minute to 1-hour, so all data was combined into 1-minute resolution data using linear interpolation for data with a resolution higher than 1-minute. The dataset is based on a 1700 sq. ft., 2-story home in western Massachusetts. The solar power output data is from the SunSpot dataset [44]. The location of the solar data is unknown. However, it can be observed that winter months are associated with drastically reduced solar consumption as would be expected from a location that experiences cold weather during winter. The DHW usage dataset is that of Edwards, Beausoleil-Morrison, and Laperrière [45]. The specific home is one with average DHW consumption. The data consists of measurements of liters of hot water used every 5-minutes. Based on the assumption that the ground water entering the hot water tank is 10°C and that the hot water leaving the tank is at a temperature of 60°C, the flow rate 26 of hot water can be represented as power. Also, linear interpolation was used to obtain a 1-minute resolution representation of the 5-minute resolution data. The thermal load data is the simulated data from [46]. The dataset contains the thermal energy supply with a resolution of 1-hour. The data resolution was increased to 1-minute by using linear interpolation. The data is from a simulated 2696 sq. ft., 1-story urban home based on the Building America B10 Benchmark. The simulation area used is Otis, MA because it is in western Massachusetts similar to the electricity data. 3.2 System overview The proposed test system is a residential system with a 6 kWe combustion engine micro-CHP, ~5.5 kWe PV array, 4.5 kWe AH, 13.2 kWe Tesla Powerwall 2 AC battery, and a 50 gal TES; all specifications are noted in Table 2.1 and a visual representation of the system and all its connections can be seen in Figure 1. Table 3.1 System characteristics of energy sources and sinks and energy storage systems. Energy sources/sinks Energy storages Micro-CHP Auxiliary heater PV solar Grid TES EES Type Combustion engine DHW element PV Utility Type DHW tank Type Rated power 6 kWe 4.5 kWe ~5.5 kWe 24 kWe Temp. range 55-75°C Max power 5 kWe Size 55 gal Max charging 5 kWe Energy capacity 4 kWh Energy capacity 13.2 kWh Efficiency 90% Efficiency 89% Ref. [47] [44] Ref. [48] The thermal load, electricity load, DHW load, and solar power production are all simulated by using real data as described in Section 3.1.2. The TES and EES are modelled using basic power 27 flow and round-trip efficiencies similar to the AH, TES, and EES constraints described in Section 3.4.2.2.2. The micro-CHP is modelled using a mathematical model from [47]. Due to its great potential for cost savings, a TOU tariff is taken as the electricity tariff structure for all tests. The TOU tariff used is from Ontario, Canada [49]. The system is simulated using 1-minute resolution to match that of the modified data sets. Figure 1. Visualization of the system setup. 3.3 Heat-led method A heat-led control strategy was developed to act as a baseline comparison for the proposed MPC strategies. The basic idea of most HLMs is that the micro-CHP is turned on when the TES temperatures falls below a lower threshold and turns off when the TES temperatures exceeds a higher threshold. As a result, this limits the flexibility that is inherent to micro-CHP-based systems that utilize a TES system. The backup heater is only set to operate when the TES temperature falls 28 out of the desired range with an added buffer temperature of a few degrees. In these ways the HLM is similar to that of traditional HLM strategies [11]; however, since some of the proposed MPC strategies will be using a EES system, a simple control scheme must be developed for the EES control. The idea is that a system such as the Tesla Powerwall 2 AC [48] and gateway are capable of understanding what power is being fed to the EES by the supply systems. Because of this, the EES is set up to charge at a maximum rate during off-peak hour, 11:00-17:00 and 19:00-7:00, so that only power from the micro-CHP and PV are being utilized. During on-peak hours, 7:00-11:00 and 17:00-19:00, the EES is set to discharge power at a maximum rate to the grid and the dwelling. During the weekends, the optimal behavior is not obvious. The EES is set to discharge at a constant rate to completely deplete the EES by the end of the weekend. It should be noted that at this time the Tesla Powerwall 2 AC does not officially support supply via an AC generator. 3.4 Model Predictive Control The optimization of the micro-CHP-based systems is done using two novel MPC strategies. The strategies use a repeating set of optimizations to achieve the control states for the system. One MPC strategy optimizes the current states of the system and the other MPC strategy is used to optimize the future states of the system, these are referred to as MPC-pre and MPC-post, respectively. 29 A) B) Figure 2. Example of timeline and actions for MPC-pre and MPC-post with a HR optimization time-step of 10-minutes. 30 Examples of the actions taken by the two MPC strategies on a timeline can be seen in Figure 2. The basic MPC strategy work as follows: updated measurements are received from the system; a set of forecasts for future states of the solar supply power, electricity load, thermal load, and DHW load are determined using ANNs or given directly; a multi-optimization strategy is performed and determines the optimal schedule for operation of the system; the specific states from the schedule are used as control states for the micro-CHP, EES, and AH; and the process is repeated with a delay matching the resolution of the HR optimization. The idea is to essentially create an optimal schedule of operation for all controllable devices based on predicted information and update this schedule every time-step. The MPC-pre uses the 0th time-step from the optimal schedule to control the system. The states are implemented as soon as the forecasting and optimizations are complete. There is a delay that started at the beginning of the current iteration and is equal to the time-step of the HR optimization. Following this delay, the next iteration begins. These actions can all be observed on the timeline in Figure 2A. However, this is not completely accurate since the forecasting and optimization takes time and the 0th time-step refers to the time when the iteration was started. This MPC strategy is therefore only viable when the iteration time is low so that the time when the controllable states are implemented is close enough to the time when the forecasting and optimization was started. The MPC-post uses the 1st time-step from the optimization schedule to control the system. Since the 1th time-step refers to a future state, the optimal states are not implemented for control immediately. As with the MPC-pre strategy, there is a delay after the optimization is complete. Following this delay, the control states are implemented, and the next iteration begins. This is shown graphically on the timeline in Figure 2B. MPC-post has an information delay equal to the 31 time-step size of the LR optimization but is accurate in the sense that the states are being used as they would be in the optimizations. Unlike the MPC-pre strategy, the computation time of one iteration is irrelevant as long as it does not exceed the LR optimization’s time-step size. Both MPC-pre and MPC-post are tested with a penalty constraint to control the cycling of the micro-CHP. In the standard MPC-pre and MPC-post strategies the cycling frequency is arbitrary as it is subject to the optimization and the time-step size of the HR optimization. However, since the proposed formulation is intended to be a general formulation, the cycling rate of a micro-CHP should be able to be controlled when operating with start/stop behavior. This is particularly important for combustion engine-based micro-CHPs since there is a cost associated with start-up both in fuel and in wear that is not considered in the cost metrics used for the proceeding tests. The following subsections detail different steps of the model-predictive control strategies. In particular, the forecasting strategy is explored as well as the optimization strategy and its different stages. 3.4.1 Forecasting ANNs are a current state-of-the-art technique for timeseries regression problems and while the most common architectures to use are based on the LSTM or GRU models, recent research suggests that temporal CNN models work better for most timeseries problems [50]. Also, CNN-based models are good at generalizing patterns in data and all loads are highly correlated to the time of day making for potential simplistic demand patterns, particularly in the case of the solar power and thermal demand. For these reasons a deep CNN model was created for all load types and all resolutions totaling 8 CNN models. Note that for the purposes of this study the accuracy of the CNNs of little concern as the primary purpose of the CNNs is to add unbiased variability to 32 the forecasting data. This is so that the MPC algorithm can be tested for robustness to prediction error. Using ANNs, a probabilistic model able to discover specific patterns, relationships, and nuances learned through training can be used to represent the high variance data. There is also the added benefit of the continuous improvement of the ANNs over time as more data is collected from the household, the better the predictions should get. 3.4.2 Multi-optimization strategy The standard formulation of a MINLP problem for CHP scheduling is similar to any other timeseries linear programming problem. An objective function which is a summation over a timeseries, one-time constraints, and constraints repeated over a timeseries are used to solve for sets of decision variables representing different parameters at each time-step. For the traditional approach to a system such as the one proposed in this work, the main temporal constraints are the charging/discharging constraints of the TES and EES. These constraints represent how the current time-step affects the energy level of the TES and EES at the following time-step. These are the primary constraints that link variables through time and add most of the complexity to the MINLP. However, since these temporal constraints only rely on the previous and next time-steps, if the optimal solution of any time-step is already known, then the optimization horizon can be shortened to that time-step and all the following time-step can be ignored. This is important since the MPC only needs the 0th or 1st time-step from the optimal solution for controlling the system. If the optimization horizon could be shortened, then the optimization could be made more detailed since there are less decision variables to solve for. Couple this with a short time-step size and the 33 resolution and accuracy of the optimization could be further improved from a standard optimization with a long time-horizon and large time-step size. The proposed technique works by using a low-accuracy optimization with simplified constraints, a long horizon, and a large time-step size to obtain an initial guess for the optimal operation schedule. A second optimization is then performed with more accurate constraints, a shorter horizon, and a shorter time-step size where the states of the temporal variables at the end of the horizon are constrained to boundary constraints (i.e. the expected values obtained from the solution of the previous optimization). In particular, the LR optimization used for this formulation represents the average operation of the system and the expected values of the energy systems. This is because it is computationally unreasonable to make a realistic optimization with such a long horizon without making extreme simplifications. The HR optimization is representative of the actual system operation and uses accurate constraints. Because of its complexity, the horizon of the HR optimization can only be a few hours. Without boundary constraints on the end of the optimization horizon, the error associated with this unknown final state would be distributed amongst the short time horizon and have a large effect on the solution. Since the LR optimization horizon is so long, even if the states at the end of the optimization horizon are incorrect, the error is more dispersed over the days’ worth of many time-steps rather than a couple hours. The use of a higher-level optimization results to determine boundary constraints can be repeated as many times as needed until the appropriate complexity or resolution is achieved. However, it was observed by the authors that it is critical for all optimizations to be representative of each other or the final solution can be inaccurate due to conflicting solutions. 34 3.4.2.1 System functions The brake specific fuel consumption (BSFC) modified from [47], is used for determining the 𝐵𝑆𝐹𝐶𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 which is further used in calculating the fuel cost in the LR optimization. It is terms of the part-load ratio, 𝑥 , and the binary operation variable, 𝑢, of the micro-CHP. This modified BSFC is given by, 𝐵𝑆𝐹𝐶𝑎𝑐𝑡𝑢𝑎𝑙𝐶𝐻𝑃 (𝑥, 𝑢) = 966𝑥2 + 1767𝑥 + 1167𝑢 [𝑔/𝑘𝑊ℎ] (1) The fuel usage was determined by making Equation (1) in terms of power and fitting a linear inequality in the operating range of 1.5 to 6 kWe. It was fit to a linear inequality to make for simple a constraint and because 𝐹𝑙𝑖𝑛𝑒𝑎𝑟𝐶𝐻𝑃 is reasonably accurate in this operating range; moreover, the efficiency of the micro-CHP drops substantially below a load of 1.5 kWe. The 𝐹𝑙𝑖𝑛𝑒𝑎𝑟𝐶𝐻𝑃 is used as a constraint for finding the fuel cost in the HR optimizations. It is in terms of the electrical power produced by the micro-CHP, 𝑃, and binary operation of the micro-CHP, 𝑢, as follows, 𝐹𝑙𝑖𝑛𝑒𝑎𝑟𝐶𝐻𝑃 (𝑃, 𝑢) = 5174.1𝑃 − 8191.9𝑢 [𝑔/𝑘𝑊ℎ] (2) The heat-to-power ratio (HPR) is modified from [47], and is in terms of 𝑥 and 𝑢 of the micro-CHP. It is used to determine the 𝐻𝑃𝑅𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 which is used in the LR optimization and is given by, 𝐻𝑃𝑅𝑎𝑐𝑡𝑢𝑎𝑙𝐶𝐻𝑃 (𝑥, 𝑢) = −18.347𝑥3 + 45.76𝑥2 − 39.933𝑥 + 15.7𝑢 [𝑘𝑊/𝑘𝑊𝑒] (3) Equation (3) was put in terms of power and fitted to a linear inequality in the operating range of 1.5 to 6 kWe. The fact that it is a linear inequality constraint simplifies the optimization problem and the fitted Equation is reasonably accurate in the specified operating range. It is in terms of the electrical power produced by the micro-CHP, 𝑃, and binary operation of the micro-CHP, 𝑢, as follows, 35 𝐻𝑙𝑖𝑛𝑒𝑎𝑟𝐶𝐻𝑃 (𝑃, 𝑢) = 1.4421𝑃 + 9.8479𝑢 [𝑘𝑊] (4) The electricity purchasing tariff is based on the time-of-use (TOU) tariff in Ontario, Canada [49]. The TOU tariff results in increased tariffs during peak power usage times such as 7am to 11am and 5pm to 7pm while reducing tariffs during off-peak times. In the case of Ontario, there are two different off-peak tariffs: during mid-day and during the nighttime. The resulting equation is given by, 𝜆𝑏𝑢𝑦𝑒𝑙𝑒𝑐(𝑡) = {{0.065, 1 ≤ ℎ𝑟 < 7 & 19 ≤ ℎ𝑟 < 24 0.095, 11 ≤ 𝐻𝑅 < 17 , 1 ≤ 𝑑𝑎𝑦 ≤ 50.132, 7 ≤ ℎ𝑟 < 11 & 17 ≤ ℎ𝑟 < 19 0.065 , 6 ≤ 𝑑𝑎𝑦 ≤ 7 (5) 3.4.2.2 Low-resolution optimization 3.4.2.2.1 Objective function and constraints The LR objective function is a cost minimization of the fuel cost, electricity cost, maintenance cost, and a penalizing term for using the AH all summed over time. The penalizing term for the AH is defined as 𝑐𝑃𝐴𝐻𝑃𝐴𝐻(𝑡) where 𝑐𝑃𝐴𝐻 is a weighting variable and 𝑃𝐴𝐻(𝑡) is the power usage of the AH at time-step 𝑡. Note that 𝑟𝐿𝑅 is the resolution of the LR optimization in minutes, 𝜏𝐿𝑅 is the number of time-steps in the LR optimization horizon, and 𝛼 is used for converting from per hour to per time-step. The fuel cost at every time-step is defined as 𝛼 multiplied by the fuel usage, 𝐹𝐶𝐻𝑃(𝑡), multiplied by the cost of fuel, 𝜆𝑏𝑢𝑦𝑓𝑢𝑒𝑙 , which is assumed to be static. The electricity cost is 𝛼 multiplied by 𝑆𝑔𝑟𝑖𝑑(𝑡) which is the piecewise cost of electricity. The maintenance cost is 𝛼 multiplied by the maintenance cost, 𝜆𝑚𝑎𝑖𝑛𝑡, multiplied by the power production of the micro-CHP divided by 𝑃𝐻𝑅,𝑎𝑣𝑔𝐶𝐻𝑃 . This ratio of power to average power is taken as the percentage of time that the micro-CHP will be active since 𝑃𝐻𝑅,𝑎𝑣𝑔𝐶𝐻𝑃 is calculated by averaging 36 the historical power production of the micro-CHP. After every HR optimization 𝑃𝐻𝑅,𝑎𝑣𝑔𝐶𝐻𝑃 is recalculated. The LR objective function is as follows: 𝑚𝑖𝑛 𝐶𝑜𝑠𝑡𝐿𝑅 = ∑(𝐶𝑓𝑢𝑒𝑙(𝑡) + 𝐶𝑒𝑙𝑒𝑐(𝑡) + 𝐶𝑚𝑎𝑖𝑛𝑡(𝑡) + 𝐶𝐴𝐻(𝑡))𝜏𝐿𝑅𝑡=0 (6) where 𝐶𝑓𝑢𝑒𝑙(𝑡) = 𝛼𝜆𝑏𝑢𝑦𝑓𝑢𝑒𝑙𝐹𝐶𝐻𝑃(𝑡) (7) 𝐶𝑒𝑙𝑒𝑐(𝑡) = 𝛼𝑆𝑔𝑟𝑖𝑑(𝑡) (8) 𝐶𝑚𝑎𝑖𝑛𝑡(𝑡) = 𝛼𝜆𝑚𝑎𝑖𝑛𝑡𝑃𝐶𝐻𝑃(𝑡)/𝑃𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 (9) 𝐶𝐴𝐻(𝑡) = 𝑐𝑃𝐴𝐻𝑃𝐴𝐻(𝑡) (10) 𝛼 =𝑟𝐿𝑅60, 𝑟𝐿𝑅 ∈ ℤ> (11) 3.4.2.2.2 Constraints A thermal energy balance constraint is used to balance the thermal energy flow from the sources, the micro-CHP and AH, and the thermal energy sinks, the thermal load and the DHW load, with the flow of thermal energy into and out of the TES. This is given by, 𝐻𝑇𝐸𝑆(𝑡) = 𝐻𝑙𝑜𝑎𝑑(𝑡) + 𝐻𝐷𝐻𝑊(𝑡) − 𝐻𝐶𝐻𝑃(𝑡) − 𝑃𝐴𝐻(𝑡), 0 ≤ 𝑡 ≤ 𝜏𝐿𝑅 (12) An electrical energy balance constraint is used to balance the electrical energy from the sources, micro-CHP, EES, and PV, and to the energy sinks, electrical load, EES, and AH, with the energy flow to and from the utility grid in as follows, 𝑃𝑔𝑟𝑖𝑑(𝑡) = 𝑃𝑙𝑜𝑎𝑑(𝑡) + 𝑃𝐴𝐻(𝑡) − 𝑃𝑈𝐶𝐻𝑃(𝑡) − 𝑃𝐸𝐸𝑆(𝑡) − 𝑃𝑃𝑉(𝑡), 0 ≤ 𝑡 ≤ 𝜏𝐿𝑅 (13) The power produced by the micro-CHP, 𝑃𝑈𝐶𝐻𝑃(𝑡), is taken as the average power production in a single time-step and can be chosen from the continuous range of 0 to 6 kW. This 37 will result in some minor inaccuracy since the HR optimization cannot achieve extremely low values in this operating range due to the HR operating range. The relation is shown by, 𝑃𝑈𝐶𝐻𝑃(𝑡) = 𝑃𝐶𝐻𝑃(𝑡), 0 ≤ 𝑡 ≤ 𝜏𝐿𝑅 (14) In order to determine the heat production of the micro-CHP, first the average heat produced during the past 4-hours is determined 𝐻𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 and 𝑃𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 , respectively. When the simulation time is less than 2-hours, 𝐻𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 and 𝑃𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 are taken to be the averages from previously ran tests. The state 𝑃𝑈𝐶𝐻𝑃(𝑡) is then multiplied by the ratio of 𝐻𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 to 𝑃𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 to determine the likely power produced during a given time-step. This works because a LR is assumed to represent the average of the HR optimization. The use of 𝑃𝑈𝐶𝐻𝑃(𝑡) for relating the relations is because 𝐻𝐶𝐻𝑃(𝑡) is dependent on 𝑃𝑈𝐶𝐻𝑃(𝑡). 𝐻𝐶𝐻𝑃(𝑡) is given by, 𝐻𝐶𝐻𝑃(𝑡) =𝐻𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃𝑃𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 𝑃𝑈𝐶𝐻𝑃(𝑡), 0 ≤ 𝑡 ≤ 𝜏𝐿𝑅 (15) Similar to Equation (15), the fuel usage is calculated using the average fuel usage, 𝐹𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 , is used for calculating the likely state of 𝐹𝐶𝐻𝑃(𝑡) as follows, 𝐹𝐶𝐻𝑃(𝑡) =𝐹𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃𝑃𝑎𝑐𝑡𝑢𝑎𝑙,𝑎𝑣𝑔𝐶𝐻𝑃 𝑃𝑈𝐶𝐻𝑃 , 0 ≤ 𝑡 ≤ 𝜏𝐿𝑅 (16) Differing from Equations (15) and (16), the monetary exchange due to trade of electricity to the grid, 𝑆𝑔𝑟𝑖𝑑(𝑡), is calculated using the average selling tariff ratio experienced in the past 4-hours. Where the selling tariff ratio is 𝑓𝜆𝑒𝑙𝑒𝑐≠ 1 when selling electricity. 𝑆𝑔𝑟𝑖𝑑(𝑡) is given by, 𝑆𝑔𝑟𝑖𝑑(𝑡) = 𝑓𝑎𝑣𝑔𝜆𝑒𝑙𝑒𝑐𝜆𝑏𝑢𝑦𝑒𝑙𝑒𝑐(𝑡)𝑃𝑔𝑟𝑖𝑑(𝑡), 0 ≤ 𝑡 ≤ 𝜏𝐿𝑅 (17) A TES constraint is used to model the charging and discharging of thermal energy from the TES given by, 38 𝐸𝑇𝐸𝑆(𝑡 + 1) = 𝐸𝑇𝐸𝑆(𝑡) − √𝜂𝑇𝐸𝑆𝛼𝐻𝑇𝐸𝑆(𝑡), 0 ≤ 𝑡 ≤ 𝜏𝐿𝑅 (18) The square root of the round-trip efficiency is applied to 𝐻𝑇𝐸𝑆(𝑡), so that the full efficiency is applied after the energy is added and removed from storage. This also assumes that applying efficiency loss to the TES is the same as applying the efficiency directly to the energy flow. It is worth noting that the efficiency of energy transportation is neglected. This is because the transportation loss could be combined with the micro-CHP efficiency Equation and the thermal load and the formulation of the optimization would remain the same, thus instead of an arbitrary assumption, it is simply neglected in this study. Similar to Equation (18), an EES constraint is used to model the charging and discharging of electrical energy from the EES given by, 𝐸𝐸𝐸𝑆(𝑡 + 1) = 𝐸𝐸𝐸𝑆(𝑡) − √𝜂𝐸𝐸𝑆𝛼𝑃𝐸𝐸𝑆(𝑡), 0 ≤ 𝑡 ≤ 𝜏𝐿𝑅 (19) The square root of the round-trip efficiency of the EES is applied to the 𝑃𝐸𝐸𝑆(𝑡) so that the full efficiency is applied after the power used for charging and discharging. The starting value of the TES and EES are constrained to the values the TES and EES before the optimization started. At the 0th time-step the TES and EES are constrained as follows, 𝐸𝑇𝐸𝑆(0) = 𝐸𝑐𝑢𝑟𝑟𝑒𝑛𝑡𝑇𝐸𝑆 (20) 𝐸𝐸𝐸𝑆(0) = 𝐸𝑐𝑢𝑟𝑟𝑒𝑛𝑡𝐸𝐸𝑆 (21) The states of the TES and EES at the end of the optimization horizon must also be constrained; however, the states must be realistic despite them representing future events. This is because the optimization does not consider the future past the last time-step in the horizon. A good approach is to constrain the end of a 24-hour horizon to have the same values as at the beginning [34], thereby assuming that all days are similar. However, constraining a value that is only 24-hours in 39 the future is likely to heavily influence the state of the EES since 24-hours is analogous to one behavioral cycle of the EES. Thus, the horizon for the LR optimization is set to 48-hours. This still makes use of the assumption that all days are similar; however, it gives the optimization more freedom since the 24-hour mark can be freely changed. This is particularly important for the weekend since the operation on the weekend will be different due to the static electricity price. Also, it is likely that this approach will result is quicker deviation from bad assumptions, such as when the optimization is initialized. As such, the state of the TES and EES are constrained to the starting states of the TES and EES, respectively, as given by, 𝐸𝑇𝐸𝑆(𝜏𝐿𝑅) = 𝐸𝑇𝐸𝑆(0) (22) 𝐸𝐸𝐸𝑆(𝜏𝐿𝑅) = 𝐸𝐸𝐸𝑆(0) (23) 3.4.2.3 High-resolution optimization 3.4.2.3.1 Objective function The HR objective function is identical to that of the LR optimization with two exception. For the maintenance cost, the binary state of the micro-CHP is explicitly used, 𝑢𝐶𝐻𝑃(𝑡), instead of a usage fraction as in the LR optimization. There is an extra cost term 𝐶𝑒𝑥𝑡𝑟𝑎 which is multiplied by a large number 𝑀 that is meant to penalize the usage of the variables 𝑃𝑒𝑥𝑡𝑟𝑎 and 𝐻𝑒𝑥𝑡𝑟𝑎; these variables are used in Equations (45) and (46) and are discussed in Section 3.4.2.3.2. The HR objective function is as follows: 𝑚𝑖𝑛 𝐶𝑜𝑠𝑡𝐻𝑅 = ∑ (𝐶𝑓𝑢𝑒𝑙(𝑡) + 𝐶𝑒𝑙𝑒𝑐(𝑡) + 𝐶𝑚𝑎𝑖𝑛𝑡(𝑡) + 𝐶𝐴𝐻(𝑡)) + 𝑀𝐶𝑒𝑥𝑡𝑟𝑎𝜏𝐻𝑅𝑡=0 (24) where 𝐶𝑒𝑥𝑡𝑟𝑎 = |𝑃𝑒𝑥𝑡𝑟𝑎| + |𝐻𝑒𝑥𝑡𝑟𝑎| (25) 40 𝐶𝑓𝑢𝑒𝑙(𝑡) = 𝛼𝜆𝑏𝑢𝑦𝑓𝑢𝑒𝑙𝐹𝐶𝐻𝑃(𝑡) (26) 𝐶𝑒𝑙𝑒𝑐(𝑡) = 𝛼𝑆𝑔𝑟𝑖𝑑(𝑡) (27) 𝐶𝑚𝑎𝑖𝑛𝑡(𝑡) = 𝛼𝜆𝑚𝑎𝑖𝑛𝑡𝑢𝐶𝐻𝑃(𝑡) (28) 𝐶𝐴𝐻(𝑡) = 𝑐𝑃𝐴𝐻𝑃𝐴𝐻(𝑡) (29) where 𝛼 =𝑟𝐻𝑅60, 𝑟𝐻𝑅 ∈ ℤ> (30) 3.4.2.3.2 MPC-pre and MPC-post Constraints Since the operation state of the micro-CHP is assumed to be discontinuous, the power produced by the micro-CHP must be represented with two variables in order to operate in a discontinuous set shown by, 𝑃𝑈𝐶𝐻𝑃(𝑡) = 𝑢𝐶𝐻𝑃(𝑡)𝑃𝐶𝐻𝑃(𝑡), 0 ≤ 𝑡 ≤ 𝜏𝐻𝑅 (31) 𝑃𝐶𝐻𝑃(𝑡) ∈ {0} ∪ [1.5,6] (32) The binary variable 𝑢𝐶𝐻𝑃(𝑡) allows the micro-CHP to go between an off state where 𝑃𝑈𝐶𝐻𝑃(𝑡) =0 and an on state where 𝑃𝑈𝐶𝐻𝑃(𝑡) can operate within an operating range of 1.5 to 6 kW. The micro-CHP is constrained to this range for a couple of reasons. The heat produced by the micro-CHP is relatively linear relative to the power production of the micro-CHP in this range, making for accurate modeling with simple constraints. This is also the case of the fuel usage with respect to power production. The constraints of the micro-CHP are not accurate in the low-performance range since they are linear inequalities and not high-order polynomials, and the micro-CHP Equations from [47] show that the fuel usage and heat production around the zero point is non-zero, which would result in low efficiency performance of the micro-CHP. 41 The heat produced by the micro-CHP is calculated based on the power produced by and the binary state of the micro-CHP constrained by the following linear inequality, 𝐻𝐶𝐻𝑃(𝑡) = 𝐻𝑙𝑖𝑛𝑒𝑎𝑟𝐶𝐻𝑃 (𝑃𝑈𝐶𝐻𝑃(𝑡), 𝑢𝐶𝐻𝑃(𝑡)) , 0 ≤ 𝑡 ≤ 𝜏𝑀𝑅 (33) The fuel usage of the micro-CHP is represented by the following linear inequality, 𝐹𝐶𝐻𝑃(𝑡) = 𝛼𝐹𝑙𝑖𝑛𝑒𝑎𝑟𝐶𝐻𝑃 (𝑃𝑈𝐶𝐻𝑃(𝑡), 𝑢𝐶𝐻𝑃(𝑡)), 0 ≤ 𝑡 ≤ 𝜏𝐻𝑅 (34) The units of 𝐹𝑙𝑖𝑛𝑒𝑎𝑟𝐶𝐻𝑃 are in g/kWh so 𝛼 is used to get the Equation in terms of g/kW produced per one time-step. The monetary exchange due to the trade of electricity is considered as a piecewise relation with respect to 𝑃𝑔𝑟𝑖𝑑(𝑡). The cost of buying electricity from the grid is formulated as the price of electricity at that time multiplied by the amount of electricity being exchanged. The profit from selling electricity is calculated the same way except that a selling tariff ratio factor, 𝑓𝜆𝑒𝑙𝑒𝑐, is applied to linearly reduce the profits from selling electricity. This constraint was formulated as a set of big-M constraints to achieve a piecewise relationship and is given by, 𝑆𝑔𝑟𝑖𝑑(𝑡) = {𝜆𝑏𝑢𝑦𝑒𝑙𝑒𝑐(𝑡)𝑃𝑔𝑟𝑖𝑑(𝑡), 𝑃𝑔𝑟𝑖𝑑(𝑡) ≥ 0𝑓𝜆𝑒𝑙𝑒𝑐𝜆𝑏𝑢𝑦𝑒𝑙𝑒𝑐(𝑡)𝑃𝑔𝑟𝑖𝑑(𝑡), 𝑃𝑔𝑟𝑖𝑑(𝑡) < 0 (35) As in Equations (18) and (19) in the LR optimization, temporal charging behavior is given to the 𝐸𝑇𝐸𝑆 and 𝐸𝐸𝐸𝑆, respectively, as follows, 𝐸𝑇𝐸𝑆(𝑡 + 1) = 𝐸𝑇𝐸𝑆(𝑡) − √𝜂𝑇𝐸𝑆𝛼𝐻𝑇𝐸𝑆(𝑡), 0 ≤ 𝑡 ≤ 𝜏𝐻𝑅 (36) 𝐸𝐸𝐸𝑆(𝑡 + 1) = 𝐸𝐸𝐸𝑆(𝑡) − √𝜂𝐸𝐸𝑆𝛼𝑃𝐸𝐸𝑆(𝑡), 0 ≤ 𝑡 ≤ 𝜏𝐻𝑅 (37) As with Equations (22) and (23), the states of the TES and EES at the 0th time-step are constrained to the real states at the start of the optimization as given by, 𝐸𝑇𝐸𝑆(0) = 𝐸𝑐𝑢𝑟𝑟𝑒𝑛𝑡𝑇𝐸𝑆 (38) 42 𝐸𝐸𝐸𝑆(0) = 𝐸𝑐𝑢𝑟𝑟𝑒𝑛𝑡𝐸𝐸𝑆 (39) The states of the TES and EES at the end of the HR horizon are constrained to the value that was found at the corresponding time in the LR optimization as given by, 𝐸𝑇𝐸𝑆(𝜏𝐻𝑅) = 𝐸𝑇𝐸𝑆(𝑡𝐿𝑅𝐻𝑅) (40) 𝐸𝐸𝐸𝑆(𝜏𝐻𝑅) = 𝐸𝐸𝐸𝑆(𝑡𝐿𝑅𝐻𝑅) (41) The purpose of the LR optimization is only to determine realistic boundary constraints for the end of the HR optimization’s horizon. This is particularly important for the EES since the state of the EES changes slowly. Without this constraint, the HR optimization would only be able to make decisions based on the length of the HR horizon, a couple hours, when the EES is likely to cycle every 24-hour. Therefore, this point would have to either be arbitrarily constrained or unconstrained where the optimization will optimize the state only for the optimization horizon and not consider any future ramifications. For example, the most optimal solution for an optimization running at 2am might be to store electricity at nighttime and then use it at 7am. However, if the optimization is only looking a couple hours into the future, it will not be capable of seeing the benefit of keeping the electricity stored since its horizon ends at 6am. Therefore, the state of the EES at 6am found in the LR optimization would be used, so that the HR optimization only has to worry about deciding what happens between 2am and 6am. 3.4.2.3.3 MPC-post constraints Since in MPC-post the control states used by the optimization are offset by 1 time-step, the 0th time-step of the controllable states must be constrained to how the system is currently operating as follows, 43 𝑃𝐴𝐻(0) = 𝑃𝑐𝑢𝑟𝑟𝑒𝑛𝑡𝐴𝐻 (42) 𝑃𝐸𝐸𝑆(0) = 𝑃𝑐𝑢𝑟𝑟𝑒𝑛𝑡𝐸𝐸𝑆 (43) 𝑃𝑈𝐶𝐻𝑃(0) = 𝑃𝑈𝑐𝑢𝑟𝑟𝑒𝑛𝑡𝐶𝐻𝑃 (44) The presence of Equations (42) - (44) have the capability of causing an infeasible solution. Therefore, Equations (36) and (37) are modified for the 1st time-step and the variables 𝐻𝑒𝑥𝑡𝑟𝑎 and 𝑃𝑒𝑥𝑡𝑟𝑎 are added as given by, 𝐸𝑇𝐸𝑆(1) = 𝐸𝑇𝐸𝑆(0) − √𝜂𝑇𝐸𝑆𝛼𝐻𝑇𝐸𝑆(0) + 𝐻𝑒𝑥𝑡𝑟𝑎 (45) 𝐸𝐸𝐸𝑆(1) = 𝐸𝐸𝐸𝑆(0) − √𝜂𝐸𝐸𝑆𝛼𝑃𝐸𝐸𝑆(0) + 𝑃𝑒𝑥𝑡𝑟𝑎 (46) Since the use of these variables are penalized in the objective function, they will only be used when there are no feasible solutions. The rest of the horizon is constrained as in Equations (18) and (19) from the LR optimization. 3.4.2.4 Penalty formulation Both MPC strategies are tested with the addition of a penalty constraint to allow for control of the amount of cycling performed by the micro-CHP. The penalty constraint is applied to the objective function of the HR optimization by adding a term 𝑐∆𝑢𝐶𝐻𝑃𝜎𝐶𝐻𝑃 to the summation over time. The constant 𝑐∆𝑢𝐶𝐻𝑃 is the penalizing factor and as positively correlated with increased micro-CHP runtime. The value of 𝑐∆𝑢𝐶𝐻𝑃 can be tuned to suit the needs of the system operator. The term 𝑢𝐶𝐻𝑃 changes from a previously on state to an off state, 𝜎𝐶𝐻𝑃 = 1 or else 𝜎𝐶𝐻𝑃 = 0 as stated by the following, 𝜎𝐶𝐻𝑃(𝑡) = {1, 𝑢𝐶𝐻𝑃(𝑡 − 1) − 𝑢𝐶𝐻𝑃(𝑡) > 00, 𝑢𝐶𝐻𝑃(𝑡 − 1) − 𝑢𝐶𝐻𝑃(𝑡) ≤ 0 (47) 44 Chapter 4: Results and Discussion The MPC and HLM were both tested over a simulated 7-day period in mid-December. The simulation comprised of the data mentioned in Section 3.1.2 and a mathematical model of the micro-CHP from [47]. Both the HLM and MPC methods were tested with modifications to the model’s selling price of electricity by altering the electricity selling cost to purchasing cost ratio from 0.6:1 to 1:1. The MPC model is also tested both with short-term load forecasting and using the real values from the simulation. To investigate the effects of higher-resolution optimizations, the MPC model is tested with varying resolutions and time horizons. The computational load of the proposed methods is discussed. This is primarily to determine the ability for these methods to result in low-computation times while maintaining good solutions. This is investigated further by contrasting results from scenarios using different resolutions and horizon lengths and determining the effects on the proposed method. Other factors such as use of the MPC-pre versus MPC-post method, penalty constraints, forecasting, and low-performance hardware are also investigated. A cost comparison of the MPC-pre, MPC-post, and HLM is performed where the MPC-pre and MPC-post strategies are analyzed to determine how well and how consistently they outperform the simplistic HLM. This brings to question the proposed MPC algorithms, the effects of changing the resolution, the differences between the MPC-pre and MPC-post methods, the effects of forecasted loads, and the inclusion of a penalty constraints. Finally, the behavior of the proposed methods is analyzed. The relation between use of the EES and the relative improvement over the HLM is discussed to infer the mechanisms by which the MPC methods outperform the HLM and how the MPC methods and HLM both behave in a similar fashion. The link between running of the micro-CHP and charging of the EES is also discussed. The results of the test scenarios are summarized in Table 4.1 and Table 4.2 below.45 Table 4.1. Cost, improvement, computation time, and runtime results of HLM and MPC testing over varying scenarios for 0.6:1 selling tariff ratio. Computer Resolution/horizon Loads Performance Method Pi Laptop Penalty 5min/ 10min/ 15min/ Real Forecast Cost ($/7 days) Improvement (%) [a] Comp. Time (s/s) [b] Avg. Comp. Time (s) Avg. Max. Time (s) [c] # of Cycles Avg. Runtime (s) HLM x 20.71 N/A << 1 < 1 < 1 137 31.9 MPC-pre x 1.5hrs x - N/A > 1 - - - - MPC-pre x 1.5hrs x - N/A > 1 - - - - MPC-pre x 3.5hrs x 17.83 13.9 0.0904 46.3 526 248 17.3 MPC-pre x 3.5hrs x 17.96 13.3 0.0451 17.3 548 264 16.2 MPC-pre x 3.5hrs x 19.17 7.4 0.0314 17.9 371 222 19.4 MPC-pre x x 3.5hrs x 17.99 13.1 0.0180 9.4 268 192 22.4 MPC-pre x 4hrs x 17.48 15.6 0.0723 39.4 500 258 16.4 MPC-pre x 3.5hrs x 17.97 13.2 0.0008 0.8 6 220 20.2 MPC-pre x 4hrs x 17.77 14.2 0.0008 0.7 4 216 20.4 MPC-pre x 8hrs x 17.63 14.8 0.0320 16.3 490 211 20.7 MPC-pre x 8hrs x 17.06 17.6 0.0160 4.6 154 211 20.5 MPC-pre x 8hrs x 18.55 10.4 0.0048 3.1 43 207 20.9 MPC-pre x 14hrs x 16.73 19.2 0.0502 33.4 682 204 21.0 MPC-post x 1.5hrs x - N/A > 1 - - - - MPC-post x 1.5hrs x - N/A > 1 - - - - MPC-post x 3.5hrs x 17.49 15.6 0.1117 48.0 533 332 12.6 MPC-post x 3.5hrs x 17.24 16.7 0.0583 19.9 521 335 12.5 MPC-post x 3.5hrs x 18.99 8.3 0.0356 18.1 497 285 14.6 MPC-post x x 3.5hrs x 17.92 13.4 0.0304 13.6 380 257 16.6 MPC-post x 4hrs x 17.30 16.4 0.1093 44.1 715 329 12.7 MPC-post x 3.5hrs x 18.21 12.0 0.0014 1.2 17 261 16.8 MPC-post x 4hrs x 17.25 16.7 0.0017 1.5 19 261 16.4 MPC-post x 8hrs x 16.76 19.1 0.0395 25.1 479 259 16.2 MPC-post x 8hrs x 16.43 20.6 0.0203 7.9 152 259 16.2 MPC-post x 8hrs x 18.63 10.0 0.0073 6.0 54 221 19.0 MPC-post x 14hrs x 16.93 18.2 0.0695 46.4 769 257 16.2 [a] The % improvement relative to the corresponding HLM. [b] The (s/s) refers to computation time per second of iteration time. [c] The average of the 5 highest computation time iterations. 46 Table 4.2. Cost, improvement, computation time, and runtime results of HLM and MPC testing over varying scenarios for 1:1 selling tariff ratio. Computer Resolution/horizon Loads Performance Method Pi Laptop Penalty 5min/ 10min/ 15min/ Real Forecast Cost ($/7 days) Improvement (%) [a] Comp. Time (s/s) [b] Avg. Comp. Time (s) Avg. Max. Time (s) [c] # of Cycles Avg. Runtime (s) HLM x 5.93 N/A << 1 < 1 < 1 137 31.9 MPC-pre x 1.5hrs x 8.48 -43.0 0.0619 23.0 152 410 10.6 MPC-pre x 1.5hrs x 8.65 -45.8 0.0526 20.8 130 390 11.0 MPC-pre x 3.5hrs x 5.26 11.3 0.0478 31.9 196 280 15.2 MPC-pre x 3.5hrs x 4.83 18.5 0.0129 8.4 48 290 14.5 MPC-pre x 3.5hrs x 5.59 5.7 0.0121 10.0 81 230 18.5 MPC-pre x x 3.5hrs x 5.70 3.9 0.0090 5.9 28 197 22.0 MPC-pre x 4hrs x 4.82 18.7 0.0396 26.5 178 282 14.9 MPC-pre x 3.5hrs x 6.89 -16.1 0.0005 0.5 1 225 19.6 MPC-pre x 4hrs x 6.08 -2.5 0.0005 0.5 1 223 19.4 MPC-pre x 8hrs x 5.58 5.8 0.0088 8.3 58 231 18.5 MPC-pre x 8hrs x 6.05 -2.0 0.0034 3.2 27 231 18.7 MPC-pre x 8hrs x 6.42 -8.2 0.0019 2.0 16 200 21.6 MPC-pre x 14hrs x 5.63 5.1 0.0365 32.3 612 218 19.7 MPC-post x 1.5hrs x 7.40 -24.8 0.0461 13.8 72 547 7.7 MPC-post x 1.5hrs x 6.92 -16.6 0.0395 12.3 68 538 7.8 MPC-post x 3.5hrs x 5.64 4.9 0.0461 27.6 160 350 12.0 MPC-post x 3.5hrs x 5.64 4.9 0.0130 7.8 45 350 12.0 MPC-post x 3.5hrs x 7.29 -22.9 0.0104 8.0 45 287 14.7 MPC-post x x 3.5hrs x 6.35 -7.1 0.0105 6.3 33 269 15.8 MPC-post x 4hrs x 5.79 2.4 0.0377 22.6 157 345 12.1 MPC-post x 3.5hrs x 7.54 -27.1 0.0006 0.5 1 262 16.7 MPC-post x 4hrs x 6.77 -14.1 0.0007 0.6 1 263 16.4 MPC-post x 8hrs x 5.56 6.2 0.0120 10.6 62 265 15.9 MPC-post x 8hrs x 5.59 5.8 0.0032 2.9 17 265 15.9 MPC-post x 8hrs x 7.75 -30.7 0.0021 2.3 14 226 18.6 MPC-post x 14hrs x 6.23 -5.1 0.0353 28.5 410 260 16.2 [a] The % improvement relative to the corresponding HLM. [b] The (s/s) refers to computation time per second of iteration time. [c] The average of the 5 highest computation time iterations. 47 4.1 Computational complexity and time comparison 4.1.1 Multi-optimization method The computation time of the MPC strategy with varied time-step and horizon times can be seen in Table 4.1 and Table 4.2. The proposed method is successful at giving more freedom for constraint complexity and number of solution variables since the increase in complexity by a complicated constraint can be countered with a decrease is solution variables. A higher-resolution solution than what would be possible through a conventional optimization is easily achieved using the LR optimization’s solution as a boundary condition for the end of the HR optimization’s horizon. Without the multi-optimization strategy, either the resolution would have to be low, about 25-minutes to 1-hour for the proposed formulation, or the constraint complexity would have to be reduced. It is worth noting that the accuracy of such a formulation is only as accurate as the sum of its parts. If the LR optimization is inaccurate, then this will greatly influence the successive optimizations. In the proposed formulation the LR optimization uses averages so that this effect can be limited and so that it can better resemble the resulting MPC solution. It was observed that an inaccurate LR optimization tends to underestimate the cost compared an accurate LR optimization. The multi-optimization strategy used in the MPC-pre and MPC-post strategies can increase the variety of constraints and resolutions which an MPC strategy can use to control a micro-CHP-based system compared to a conventional optimization. This requires more thought and tuning as the control system designer, since there must be more than one optimization which must all work together. However, as a generic approach to the optimal operation of micro-CHP-based systems, the proposed multi-optimization strategy is quite useful. It allows for the simplification of formulations using temporal constraints dealing with systems, e.g. TES, EES, EV, and SA Such 48 systems have comparatively high computational complexity and could all likely benefit from using a multi-optimization formulation. 4.1.2 Proposed formulation The multi-optimization strategy and the proposed formulation incorporates detailed constraints including the binary operation of the micro-CHP with a discontinuous operating range in Equations (31) and (32), the use of linear inequalities for heat production in Equation (33), fuel usage in Equation (34), and the piecewise selling/purchasing price of electricity in Equation (5). These constraints make the MINLP problem more difficult to solve. The complexity associated with the binary micro-CHP operation and the linear inequalities is demonstrated by comparing the LR optimization commutation time to the HR computation time. The LR optimization takes place over a 2-day period with a time-step size of 30 minutes totaling 96 time-steps. The HR optimization with the most time-steps is the 15min/14hrs scenario containing a total of 56 time-steps. The average computation time for the LR optimization on a laptop running a 2.6-GHz Intel Core I7 processor is 0.74 seconds and 0.315 seconds on the Raspberry Pi 3 B+. When compared to the average iteration times seen in Table 4.1 and Table 4.2, the LR is comparatively quite small. It should be noted that the background processes and forecasting take little time relative to the HR optimization which makes up the bulk of the iteration times and is responsible for the large maximum computation times. The computational effects of the piecewise electricity price can be easily seen by comparing the computation times of Table 4.1 and Table 4.2. The average computation time for every test is slower by 0.1 to 17.9 seconds for the 0.6:1 selling tariff ratio scenarios compared to the corresponding 1:1 selling tariff ratio scenarios. This can also be seen by comparing the average 49 maximum computation times which are on average 413 seconds longer for the 1:1 selling tariff ratio scenarios and vary from as little as 41.3 seconds to as high as 692.5 seconds longer, ignoring the extremely small computation time scenarios. For the MPC-pre strategy to work most effectively, the computation time should remain low so that the solution is implemented as soon as possible. While the only constraint on computation time for the MPC-post strategy is that it must be lower than the time-step size of the HR optimization. Although the average computation times of all scenarios may be reasonably low and should work well for both strategies, the maximum computation times can be extremely high. This means that in practice either the resolution and horizon must be set to conservative values to ensure adequate computation time or the computation time must be capped off at a specified threshold. If a solution were to be stopped, depending on the solution’s gap size, the resulting solution may not be adequate to use. In such a case using a simple algorithm such as a HLM could be used. This was the technique adopted by the authors which only had to be implemented in 16 iterations over all tests and proved to result in reasonable solutions. 4.1.3 Resolution and horizon changes Each of the three resolutions tested, 5min, 10min, and 15min, experienced drastic computation time increases as the computation time rose above a second, shown in Figure 3. The 5min/2hrs scenario had an average computation time that was higher than all tests and was not recorded since the controller repeatedly would fail due to the computation time being too high. This means that there is a trend where the lower the time-step size, the faster the computation time will rise with increased solution variables. This makes sense for two reasons. As the resolution is decreased, the time-step intervals increase, and the temporal solution variables are less dependent 50 on one another since the momentum of the system is lower at higher resolutions. Also, as seen with the penalty constraints, as the solution is restricted to longer runtimes, the computation time decreases. An inherent side-effect of a lower-resolution MPC strategy is longer runtimes. For example, the 5min/1.5hrs scenarios with a 0.6:1 selling tariff ratio had computation time that exceeded practical values. This increased spread of the computation times both between the MPC-pre and MPC-post methods and the 0.6:1 and 1:1 selling tariff ratio appears to increase as the number of solution variables increases but also as the time-step size is decreased. Figure 3. Graph showing the relationship between average computation time per time-step and # of time-steps. The % improvement in displayed in respective fashion next to the datapoints to show the performance of each test. It should be noted that the % improvement should only be compared between tests with the same selling cost ratio, either 0.6:1 or 1:1. The resolution, in minutes, and optimization horizon, in hours, is designated at the bottom of the graph for each set of test scenarios. The presented scenarios include the those using real loads performed on the laptop. 51 4.1.4 MPC-pre versus MPC-post For a 0.6:1 selling tariff ratio, the average computation times are slightly lower for the MPC-pre scenarios compared to the corresponding MPC-post scenarios. However, for a selling tariff ratio of 1:1, the opposite correlation is seen where almost all the average computation times are higher for the MPC-pre scenarios compared to the corresponding MPC-post scenarios. The average difference for all average computation times is 7.9 seconds and ranges from 0.2 to 21.4 seconds. This could be caused by the additional constraints that must be used for the MPC-post that constrains all of the solution variables on the first time-step. 4.1.5 Penalty constraints The average computation time is notably lower for all of the penalty constraint scenarios relative to the corresponding non-penalty scenarios. This reduction in computation time is even more drastic when looking at the average maximum computation times. The average computation times dropped by 46%, 31%, 30%, and 19% while the average maximum computation times dropped by 51%, 27%, 41%, and 27%. This is because many of the solution scenarios become impractical when a penalty constrain is used since all scenarios with excessive cycling are easily discarded due to their high costs. 4.1.6 Forecasting The 15min/8hrs scenarios showed a decrease in computation time ranging from 19% to 38%. A smaller decrease of 10% and 11% were seen in the 5min/1.5hrs scenarios and seemingly arbitrary effects were seen with the 10min/3.5hrs scenarios with tests showing increases of 3%, 19%, and 3% and a decrease of 19%. The cause of the decreased computation times for the 52 15min/8hrs and 5min/1.5hrs scenarios is possibly related to the inaccuracy of the forecasting models; however, further testing would be needed to relate these effects to a reliable cause. 4.1.7 Low-performance hardware The average computation time on a laptop running a 2.6-GHz Intel Core I7 processor was 1.7 to 2.8 times faster compared with a Raspberry Pi 3 B+. However, the average maximum computation time ranged from 25 times slower to 3.1 times faster. In general, the average maximum computation time has a much higher variance compared with the average computation time. This suggests that rigorous testing should be performed on the proposed formulations before real-word implementation to determine if the computation times are adequate. Despite this great increase, often if the computation time is unrealistic for the Raspberry Pi 3 B+ then it is also unrealistic for more powerful hardware (i.e. a laptop running a 2.6-GHz Intel Core I7 processor). This is primarily because of the non-linear scaling of the computation time in such problems. Since constraint complexity and number of solution variables are the two factors that can be altered, the control system creator is limited to either lower the resolution of the optimization or to simplify the optimization constraints of the computation time despite the hardware that is being used. The use of different software is not investigated in the proposed work. 4.2 Net cost comparison 4.2.1 Proposed MPC strategies The proposed MPC-pre and MPC-post strategies were superior to the proposed HLM for most test scenarios. With a selling tariff ratio of 0.6:1, the MPC strategies were able to always outperform the HLM by 7.4% to 20.6% with an average improvement of 14.5%. Although, the 53 performance of the tests with a 1:1 selling tariff ratio proved less ideal with 54% of the test scenarios underperforming the HLM. The 5min/1.5hrs scenarios proved completely unacceptable with the MPC strategies with a detriment of 16.6% to 45.8% compared to the HLM. The MPC-pre 10min/4hrs scenario underperformed the HLM by 2% and when short-term load forecasting was used, this dropped to a detriment of 8.2%. The MPC-post 10min/3.5hrs scenario was able to improve upon the HLM by 4.9%; however, this dropped to a detriment of 22.9% when forecasted loads were used. The 15min/3.5hrs and 15min/4hrs with MPC-pre and MPC-post scenarios underperformed the HLM by 16.1%, 2.5%, 27.1%, and 14.1%, respectively. These cases use an unrealistically short horizon length compared to the resolution and computation time and are not a good representation of the model’s performance. The MPC-post 15min/8hrs scenario has an improvement of 5.8% which drops to a detriment of 30.7% when considering forecasted loads. The MPC-post 15min/12hrs scenario underperformed the HLM by 5.1%. Since the cost of selling electricity is so high for the 1:1 selling tariff ratio scenarios, the benefits related to optimal behavior are high. This means that many of the scenarios will result in non-ideal solutions for the proposed formulation due to load inaccuracies and the inaccuracies introduced by the two optimizations. 4.2.2 Resolution changes Most of the varying resolution and horizon tests were capable of outperforming the comparable HLM with main exception being the 5min/1.5hr tests. These tests were only valid for the 1:1 selling tariff ratio scenario and proved to have significantly underperform compared to the HLM. The MPC-pre having an improvement of -43.02% and -45.8% and the MPC-post having an improvement of -24.77% and -16.6% for use of real loads and forecasting, respectively. The reasoning for this is likely that the HR horizon is too small and there is insufficient time for the 54 bad assumption made using the solution from the LR optimization to be corrected. The state 𝐸𝑇𝐸𝑆(𝜏𝐻𝑅) is constraint at the 1.5-hour mark of the HR optimization meaning that the state of the TES will be heavily constrained since the relative momentum of this state is high at such low-resolutions. The state of 𝐸𝐸𝐸𝑆(𝜏𝐻𝑅) is likely to be inaccurate and this inaccuracy is only dispersed amongst 1.5-hours. For performance of the 10min and 15min resolution tests, excluding the 15min/3.5hrs and 15min/4hrs scenarios, using real loads and no penalty constraint are generally similar in cost and the tests using real loads outperform the HLM tests with only 1 exception. The 15min resolution tests using real loads outperforms the 10min resolution tests in all tests except for the MPC-pre with 1:1 selling tariff ratio scenario. With the 0.6:1 selling tariff ratio scenarios, increasing the resolution of the 10min test from 3.5 hour to 4 hours increased the relative improvement by 1.72% and 0.9% for MPC-pre and MPC-post, respectively. For increasing the 15min test from 8 hours to 14 hours an increase of 4.33% and -0.84%. Similarly, for the 1:1 selling tariff ratio scenarios, a relative increase of 7.34%, -2.47%, 0.73%, and -11.28% was seen, with the 15min/14hr test underperforming the HLM by 5.07%. This suggests that an increase in horizon length may not always result in a better solution. The erroneous 𝐸𝑇𝐸𝑆(𝜏𝐻𝑅) constraint influence on the micro-CHP’s performance may be a cause for some of this effect; however, the error caused by 𝐸𝑇𝐸𝑆(𝜏𝐻𝑅) would be greatly distributed when considering horizon lengths of 8 hours and 14 hours. Therefore, a more likely cause of this arbitrary relation between performance and horizon length is 𝐸𝐸𝐸𝑆(𝜏𝐻𝑅). Both the LR and HR optimizations are not completely accurate and much of the performance of the HR optimization is placed on the EES states of the LR optimization. Also, changing the HR optimization horizon will change the behavior of the HR optimization since this 55 will change 𝐸𝐸𝐸𝑆(𝜏𝐻𝑅), and since the HR optimization may also be inaccurate, a better overall performance may be seen. The 15min/3.5hrs and 15min/4hrs scenarios were able to achieve similar costs with a selling tariff ratio of 0.6:1 compared to the 10min/3.5hrs and 10mim/4hrs, respectively. Where use of the 15min resolution over the 10min resolution was able to achieve a relative improvement of 0.1%, -1.4%, -1.4%, and 0.3% for the 3.5hrs and 4hrs time horizon and the MPC-pre and MPC-post scenarios, respectively. However, for the 1:1 selling tariff ratio scenarios, the 15min resolution drastically underperformed the 10min resolution for the 3.5hrs and 4hrs time horizon scenarios. Average runtime can be ruled out as a major factor since for the MPC-pre scenarios, the 15min resolution case has a longer average runtime than the 10min resolution case for a horizon of 4hrs, but a shorter average runtime for a horizon of 3.5hrs. The detriment to the improvement of using a 15min resolution over a 10min resolution is 20% and 21.2% for the MPC-pre tests and 20.1% and 16.5% for the MPC-post tests with a horizon of 3.5hrs and 4hrs, respectively. It can be inferred that when optimal behavior is better rewarded, with a 1:1 selling tariff ratio, then the added flexibility given by the 10min resolution can provide for better solutions. In a practical sense, this is not a fair comparison since the computation times are vastly different; however, it aids in the argument that both the optimization horizon and resolution both play a significant role in the performance of an MPC strategy. The resolution and horizon lengths used for an optimization can have a big impact on the performance of the model. Too short of a horizon length can potentially lead to poor solutions by over-constraining the optimization. However, the benefits of long horizon times may not always lead to a better solution since the optimization and resulting boundary constraints are only approximations of the optimal solution and may provide different levels of inaccuracy at different 56 times. Use of the longest practical horizon for a given resolution is most recommended as it will reduce the dependence of the beginning time-steps of the optimization on the boundary constraints by gives more time to disperse the effects of erroneous constraints. Depending on the accuracy of the LR optimization, the model horizon and resolution can be chosen to decide between a tradeoff of better flexibility with a lower resolution and less influence on boundary constraints with a slightly higher resolution. 4.2.3 MPC-pre versus MPC-post The cost differences between the MPC-pre and MPC-post strategies are all within 5% of each other for the 0.6:1 selling tariff ratio scenarios. The tests with forecasting and the penalty constraint proved to have the lowest differences between the two strategies. This is all unlike the 1:1 selling tariff ratio, where the differences are as high as 30% and the largest 3 differences are all from scenarios with forecasting. This again demonstrates how the effects of load forecasting are amplified when the selling price of electricity is high. With one exception, the MPC-post method outperformed or matched the performance of the MPC-pre strategy for the 0.6:1 selling tariff ratio scenarios. However, in the cases with a 1:1 selling tariff ratio, the MPC-pre strategy mostly outperformed the MPC-post strategy with 4 exceptions. Two of these exceptions are the 5min/1.5hrs scenarios and the other two are among the top 3 smaller differences, $0.02 and $0.46. The average performance increase of the MPC-pre is exceptionally large for most of the 1:1 selling tariff ratio scenarios whereas the average performance increase of the MPC-post strategy is small for the 0.6:1 selling tariff ratio scenarios. The MPC-pre strategy has very little control lag, so for the 1:1 selling tariff ratio scenarios, a more up-to-date solution is given. Since a 1:1 selling tariff ratio means that optimal behavior is better 57 rewarded, the MPC-pre can obtain better costs. For a 0.6:1 selling tariff ratio, this up-to-date solution does not give the same level of benefits. No definitive statements regarding optimality can be made when comparing the MPC-pre and MPC-post strategies because of the difference in average runtimes. The MPC-post strategy reduced the runtime by an average of 27% relative to the MPC-pre strategy. The only conclusion that can be made between the two strategies is that the MPC-pre strategy always produces longer runtimes compared to the MPC-post strategy for this specific formulation. This can be beneficial or detrimental depending on the formulations. Further tests should be conducted to better understand the behavior difference to different problem formulations and true optimality difference of the two strategies. 4.2.4 Penalty constraints In all cases with the penalty constraint, the number of on/off cycles over the 7 days decreased and the average runtime increased. It is noted that these tests represent a modest penalty to only mildly penalize the cycling of the micro-CHP. In the case of the 0.6:1 selling tariff ratio scenarios, the reduction in cost from the penalty constraint is not high, $0.03 and $0.68 for MPC-pre and MPC-post, respectively. Alternatively, for the 1:1 selling tariff ratio scenarios, the cost difference is much more substantial with a relative improvement reduction of 14.9% and 12%. The penalty constraint brought the 1:1 selling tariff ratio MPC-post scenario from outperforming the HLM to underperforming the HLM by 7.1%. It is noted that the 1:1 selling tariff ratio penalizes suboptimal behavior more than the 0.6:1 selling tariff ratio since suboptimal handling of electricity export can dramatically affect the overall cost. 58 4.2.5 Forecasting The tests using forecasted load generally underperformed relative to the corresponding test using the real loads. This is to be expected since the forecasted loads are not completely accurate, and the control scheme heavily relies on future information as can be seen in the tests where the horizon length was varied. In both the scenarios with the 0.6:1 and 1:1 selling tariff ratio, the MPC-pre strategy was better able to deal with the load inaccuracies caused by the forecasted loads. This can be seen by the higher difference in improvement in the MPC-post scenarios. The relative improvements of the MPC-pre versus MPC-post models was 5.86% vs. 8.44% and 7.16% vs. 10.62% for the 0.6:1 selling tariff ratio scenario using 10min/3.5hr and 15min/8hr, respectively. For the 1:1 selling tariff ratio scenarios the relative improvements were 12.82% vs. 27.73% and 6.23% vs. 36.31%. It appears that the 1:1 tariff ratio scenarios generally have a larger difference between the real loads and forecasted loads. Again, the benefits of optimal behavior are better rewarded in the 1:1 tariff ratio scenarios as seen by the overall low costs. This means that the suboptimal behavior caused by the load uncertainties is likely more sensitive as selling prices of electricity is increased relative to the purchasing price. However, this cannot be completely generalized since with the 15min/8hrs MPC-pre scenario with 1:1 selling tariff ratio only had a relative improvement difference of 6.26% which is well below the other 1:1 selling tariff ratio scenarios and near the low end of the 0.6:1 selling tariff ratio scenarios. With the 0.6:1 selling tariff ratio scenarios, all of the forecasted load scenarios obtained costs lower than the proposed HLM. This is unlike the 1:1 selling tariff ratio scenarios where there are three scenarios where the forecasted loads underperformed relative to the HLM. In the MPC-post scenarios with 1:1 selling tariff ratio the relative cost increased from $5.62 to $7.29 and $5.59 59 to $7.75 for the forecasted loads case with 10min/3.5hrs and 15min/8hrs, respectively. This is an extremely large increase and is the combination of the delayed control from the MPC-post strategy and the inaccurate forecasts. For the most robust performance against forecasting inaccuracies, use of an MPC-pre strategy is superior to an MPC-post strategy. Also, when selling price of electricity is equal to the purchasing price, the sensitivity to these forecasting inaccuracies increase compared to when the selling price is lower than the purchasing price. However, since the forecasted loads are from different models, a direct comparison cannot be reliably made between the performance of models with differing resolutions and horizon lengths. 4.2.6 Selling tariff ratio The selling tariff ratio has a large impact on the performance of the optimal operation of a micro-CHP-based system. In the proposed formulation, the 0.6:1 selling tariff ratio caused a cost increase of roughly 3 times compared to the 1:1 selling tariff ratio case. This is substantial and demonstrates how sensitive the performance is to the cost of electricity. If the selling price is lower than the purchasing price, then such systems will be most economical when the electricity being produced is offsetting the conventionally purchased grid electricity. This means that it is recommended to not oversize the micro-CHP for a system if maximum profitability is the goal. 4.3 Analysis of behavior 4.3.1 EES and relative improvement This section describes observations made from analyzing the state of charge of the EES and the relative improvement over a week-long period shown in Figure 3 - Figure 6. 60 The optimal behavior of the EES is extremely similar to that of the HLM throughout all of the weekdays. However, during the weekends, the behavior of the EES becomes more erratic. The weekday behavior of the MPC strategy has progressive charging rather than the maximum rate charging of the HLM. This would distribute the power used for charging the EES more evenly over times of low electricity prices. Also, the charging behavior of the 1:1 selling tariff ratio scenarios is much more erratic compared to that of the 0.6:1 selling tariff ratio scenarios. This is again demonstrating the increased cost benefits of the 1:1 selling tariff ratio scenarios where many minor actions are taken to obtain these cost benefits. Since the price of electricity on the weekend is fixed, it appears that the EES switches over to a behavior that increases flexibility and supports the other systems. With the 0.6:1 selling tariff ratio scenarios, the weekend behavior of the EES appears to also charge back up progressively to be ready for the following day, whereas with the 1:1 selling tariff ratio scenarios, this state of the EES remains low at the end of the week. This is odd since the value of electricity is higher in the 1:1 selling tariff ratio scenario and the TOU tariff structure is back in effect the following day. This could be due to the benefits of increased flexibility provided by the EES. Further investigation is required to understand this behavior. The relative improvement over the week-long period appears to be quite stable for the 0.6:1 selling tariff ratio scenarios. The relative improvement of the MPC strategies in these tests decreases when the electricity tariffs are high in the mornings and the HLM is set to discharges more electricity. When the electricity tariff is high in the evenings, the relative improvement of the MPC strategy is maintained since the EES was not completely charged by the MPC strategy. When the relative improvement drops, the MPC regains much of this by more careful use of the EES rather that quickly bringing the EES to full charge like in the HLM. It can also be noted that the stability of the relative improvement increased over time. It appears that the algorithm gets into a 61 performance rhythm and diminishes the influence of the initial conditions as time progresses, aiding to the improvement over time. The relative improvement of the 1:1 selling tariff ratio scenarios has a high variance, yet it is not completely volatile since the pattern is still predictable. It is difficult to discern much from the behavior other than that higher selling price of electricity means that the effects of the same behaviors on cost are amplified. The HLM and MPC strategies flip back and forth between outperforming and underperforming each other and it would be difficult to see the benefits until either the end of a week or to fit the data to a trend curve over a multi-week period. However, it is of note that the relative improvement ended up stabilizing at the end of the week. 62 Figure 4. State-of-charge of the EES and % improvement of the MPC-pre strategy over the HLM over 7-days with a 0.6:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. Figure 5. State-of-charge of the EES and % improvement of the MPC-post strategy over the HLM over 7-days with a 0.6:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. 63 Figure 6. State-of-charge of the EES and % improvement of the MPC-post strategy over the HLM over 7-days with a 1:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. Figure 7. State-of-charge of the EES and % improvement of the MPC-post strategy over the HLM over 7-days with a 1:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. 64 4.3.2 Micro-CHP and EES charging This section describes observations made from analyzing the charging behavior of the EES and the operation of the micro-CHP at a time of varying electricity tariff arbitrarily sampled from the data shown in Figure 7 - Figure 13. The micro-CHP operated as much as possible while the electricity tariff is high in Figure 8, Figure 9, Figure 11, and Figure 12. During off-peak hours, the EES is charged largely using the micro-CHP. This is less pronounced for the 1:1 selling tariff ratio scenarios where the EES is often charged and discharged when the micro-CHP is switched off rather than mostly following the operation of the micro-CHP as in the 0.6:1 selling tariff ratio scenarios. This is be because the 1:1 selling tariff ratio scenario benefits most from excessive charging during off-peak hours then major discharging during peak times and then a mixture of charging and discharging for mid-peak times. On the other hand, with the 0.6:1 selling tariff ratio the charging of the EES mostly uses the micro-CHP to charge during off-peak and mid-peak times while still using the EES for minor discharging and mostly discharges during peak times. This is similar to the performance of the HLM shown in Figure 10 and Figure 13 where the EES is set to discharge heavily during on-peak hours and to charge primarily using the micro-CHP during off-peak hours. 65 Figure 8. A 12-hour sample of 𝑷𝑪𝑯𝑷 and 𝑷𝑬𝑬𝑺 behavior from the MPC-pre test with a 0.6:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. Figure 9. A 12-hour sample of 𝑷𝑪𝑯𝑷 and 𝑷𝑬𝑬𝑺 behavior from the MPC-post test with a 0.6:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. Figure 10. A 12-hour sample of 𝑷𝑪𝑯𝑷 and 𝑷𝑬𝑬𝑺 behavior from the HLM test with a 0.6:1 selling tariff ratio and real loads. 66 Figure 11. A 12-hour sample of 𝑷𝑪𝑯𝑷 and 𝑷𝑬𝑬𝑺 behavior from the MPC-pre test with a 1:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. Figure 12. A 12-hour sample of 𝑷𝑪𝑯𝑷 and 𝑷𝑬𝑬𝑺 behavior from the MPC-post test with a 1:1 selling tariff ratio, real loads, no penalties, and a resolution of 10min and horizon of 3.5 hrs. Figure 13. A 12-hour sample of 𝑷𝑪𝑯𝑷 and 𝑷𝑬𝑬𝑺 behavior from the HLM test with a 1:1 selling tariff ratio and real loads. 67 Chapter 5: Conclusions This thesis investigates the use of a novel optimization formulation within an MPC strategy for the optimal operation of a micro-CHP-based system. The aim was to improve upon the established MPC techniques described in previous works by creating a more generic model that allows for flexibility in the choices of optimization constraints, resolution, and solution horizon. A multi-optimization strategy was used in conjunction with a set of optimization formulations to create a novel optimization strategy for use in an MPC strategy. Two variations of the MPC strategy were applied to the control of a micro-CHP-based simulated residence. This chapter first summarizes the methodology used and major findings in Section 5.1 followed by a list of the key contributions from the research described in this thesis in Section 5.2. The future work is discussed in Section 5.3 as well as potential work that could stem directly from the proposed research. 5.1 Summary The previous literature related to the optimal operation of a micro-CHP-based system particularly in small residences or small-scale systems was conducted. There is much effort in these works to obtain low-computation times either from the proposed algorithms using simplified constraints or by alternative algorithms. There is a lack of consistency among these methods where newer methods are not building off the good methodology and constraints proposed by previous works that could be beneficial or potentially provide superior results. Resolutions of various scales are found in these works. Much of the techniques use lower-resolutions which have been previously shown to provide for potentially worse solutions and could potentially pose a problem 68 when dealing with stochastic loads of small buildings. Moreover, when dealing with a micro-CHP with on/off behavior, these high resolutions can heavily bias the performance. Two MPC strategies were developed that used a novel optimization strategy for the optimal operation of a system containing a combustion engine-based micro-CHP, solar panels, thermal storage, battery storage, and a backup heater all within a small residence with hot water, heating, and electricity loads. The MPC formulations obtained future information from either a set of CNN models for load forecasting or used the real values of the future loads directly. The MPCs also both used a novel optimization formulation where a low-resolution optimization based on averages was used for obtaining the optimal states of the thermal storage and battery storage. A secondary optimization with a higher resolution then used some of the optimal states from the low-resolution optimization as boundary constraints for a new optimization with a shorter time-horizon. Either the states from the 0th time-step of this optimization are used for controlling the current states of the system or the states from the 1st time-step are used for controlling the next states of the system. The proposed MPC strategies were then tested with varied horizon lengths and time-step sizes, different selling prices of electricity, low-performance hardware, and with the addition of a penalty constraint. Tests were then compared with each other as well as to a proposed HLM to act as a baseline. In general, the multi-optimization strategy shows promise as it was able to result in generally good behavior from the system and outperform the proposed HLM in many of the cases. The multi-optimization strategy allowed for good computation times that would not be achievable with the proposed resolutions without arbitrary boundary conditions. It was found that the resolution/time-step size of the models increased the computational complexity for a given number of time-steps and that the computation time likely grows exponentially relative to the total number of time-steps. Therefore, it is suggested that the smallest time-step size is used that allows 69 for a reasonably long time-horizon and that individual testing for different scenarios should be performed. The computation time on low-performance hardware, Raspberry Pi 3 B+, is about 1.7-2.8 times slower compared to a Laptop running an I7-6700HQ; however, the maximum computation times ranged from similar between the laptop and Raspberry Pi to the Raspberry Pi taking much longer. Together with the exponential scaling of the computation time with horizon length, it can be concluded that a model that is viable for such a laptop is also likely viable or close to viable for the Raspberry Pi. So, the benefits of implementation on anything other than low-cost/low-performance hardware is unnecessary using the proposed open-source software and optimization formulation. The MPC strategy always obtained a better final cost compared to the HLM for all tests with a selling tariff ratio of 0.6:1. This is unlike the tests with a selling tariff ratio of 1:1 where much of the tests underperformed the HLM. Among these, the tests without forecasted loads, penalty constraints, and with sensible resolutions and horizons outperformed the HLM with the exception of one scenario that underperformed by 2.0%. However, when these tests used forecasted loads, all scenarios except for one underperformed the HLM. This means that accurately forecasted loads are essential for the proposed formulation when the selling price of electricity is high relative to the purchasing price. One of the two scenarios that used the penalty constraint with a 1:1 selling tariff ratio also underperformed the HLM while the other outperformed it by 3.9%. It is again recommended that a reasonably high-resolution with a reasonably long time-horizon is used since the resulting costs of the different cases were all the same for the proposed formulation. This should be individually tested for specific formulation to find the most optimal combination as the results are highly reliant on the accuracy of the lowest-resolution optimization. The MPC-pre and MPC-post strategies both achieved similar results as well as similar computation times. If 70 possible, it is recommended to use the MPC-pre strategy as it would allow for quicker reactions to forecasting uncertainty and more flexibility due to near-real-time control. Although, depending on if the computation time of the proposed formulation is too high, the MPC-pre may not be sensible and the MPC-post strategy should be used. 5.2 Key contributions The major contributions of this thesis are detailed as follows: • A novel multi-optimization strategy is introduced and thoroughly tested to validate its ability to give flexibility to an optimization’s constraints, horizon length, and time-step size while still obtaining near-optimal solutions for use in an MPC strategy. • A generic optimization formulation is created using the proposed multi-optimization strategy where one optimization is based on averages of all the states and is used to find the boundary constraints for a second, more detailed optimization. Such a formulation demonstrates the benefit of using a multi-optimization strategy in a practical sense. It also establishes a new template for optimization formulations solving such optimal operation problems where there is more freedom for use of detailed constraints and for choosing the number of solution variables. • The proposed formulation uses common constraints and is intended to be a generic starting point for the creation of new formulations based on different micro-CHP-based systems particularly with a combustion engine-type micro-CHP. A penalty constraint is also introduced to allow for user defined control of the micro-CHP cycling. 71 • The proposed formulation is tested using both an MPC-pre and MPC-post strategy. The choice of technique is reliant on user choice or the computation time of an MPC iteration. Both methods are validated as workable techniques alongside the proposed formulation. • The proposed methods were evaluated using low-performance hardware and open-source software since optimal operation controllers in small residential systems need to be low-cost in order to be competitive with standard methods. 5.3 Limitations The proposed MPC strategy using the multi-optimization method is useful for increasing the flexibility of constraints and resolutions used in a MPC problem formulation; however, it cannot always be implemented practically. If a formulation is extremely computationally complicated, then the multi-optimization method may not be computationally feasibility while maintaining good performance. This is because the resolution and optimization horizon of the high-resolution optimization may have to be set to unreasonably high and low values, respectively. Some constraints may be difficult to implement into the low-resolution optimization since the constraint must be expressed in terms of averages. Moreover, not all constraints may maintain accuracy as they are expressed in terms of averages. The proposed work was tested using data from varying sources. This difference in sources includes a difference in location and environment. This difference in location means that the weather will be different for all sources at any given time. The environment is also different, and the user behavior will vary amongst the sources. The result is a set of usage profiles that do not align and a poor representation of how energy resources are used relative to each other in a real dwelling. However, this is likely to primarily effect the level of performance and the primary 72 objective of this research deals with computational feasibility while maintaining performance that is better than the baseline strategy. It is likely that a better representation of a dwelling would result in different performance; however, the proposed strategy should still outperform the HLM in the standards tests. 5.4 Future work Further investigation should be performed on the effects of high-resolution on solution optimality. The formulation proposed in this study showed some of the effects of varied resolution on solution cost; however, due to the nature of the formulation, the time-step size effected the runtime behavior and the horizon length greatly influenced the behavior of the final solution. Testing with a micro-CHP that does not operate in start/stop behavior is one way to give potentially better insight into these effects. Also, testing with better software or a light-weight formulation would also allow for greater variation in time-step size while maintaining the same horizon length. The forecasting models were separately trained for the different resolution/horizon length combinations. While this is appropriate for practical use, it makes it more difficult to make comparisons on how different resolutions effect the forecasting accuracy of a model. If this were to be investigated further, the different resolution models should be tested with highly varying horizon lengths to help mitigate the biases that would come from the individual combinations. This would need to be done with models that can be directly compared where the constraints are not affected by a change in resolution and only the increase in solution freedom and response to load inaccuracies is affected. Also, a more detailed investigation of load inaccuracies should be done for formulations with varying resolution where the forecasted loads are intentionally altered to compare the performance reduction seen by the lagging control of MPC strategies. Moreover, a 73 multi-variate sensitivity analysis could be performed on the effects of varying short-term load forecasting accuracy while varying MPC resolution. This would provide the best information on the importance of load accuracy for different MPC resolutions. Use of detailed MPC strategies such as the proposed formulation should be used to better understand the behavior of the strategy. This can be used to improve the performance of simplistic algorithms, such as the proposed HLM, to eliminate the need for costly hardware, complicated software, and short-term forecasting. The presented problem formulation demonstrated its potential in this thesis; however, the system simulation was simplistic, and the loads were from varying sources with varying resolutions. This formulation should be tested with a real micro-CHP-based system in a real residence or at least real high-resolution load data from one source and detailed models of all subsystems. From this, reliable results could be gained to give more robust insight on the proposed formulation. The proposed multi-optimization strategy can be tested with different CHP-types such as fuel cell where the micro-CHP can operate in a continuous fashion and not need to deal with binary operation constraints. This can greatly reduce computational complexity and make room for other complex constraints such as quadratic heat production and fuel usage that could greatly increase the accuracy of the optimization. The multi-optimization strategy also shows promise for use in other optimal operation formulation. The strategy is a good candidate for optimal operation problems containing other temporal constraints such as electric vehicle charging and SAs. Such future work could prove extremely valuable based on how computationally expensive temporal constraints can be on the optimal operation optimization. 74 Bibliography [1] S. Murugan and B. Horák, “A review of micro combined heat and power systems for residential applications,” Renew. Sustain. Energy Rev., vol. 64, pp. 144–162, 2016. [2] M. Mohammadi et al., “Micro combined heat and power (MCHP) technologies and applications,” Renew. Sustain. Energy Rev., vol. 28, pp. 510–524, 2013. [3] W. H. J. Graus, M. Voogt, and E. Worrell, “International comparison of energy efficiency of fossil power generation,” Energy Policy, vol. 35, no. 7, pp. 3936–3951, 2007. [4] L. Wong, “A Review of Transmission Losses in Planning Studies,” 2011. [5] D. B. Richardson, “Electric vehicles and the electric grid: A review of modeling approaches, Impacts, and renewable energy integration,” Renew. Sustain. Energy Rev., vol. 19, pp. 247–254, 2013. [6] A. Dubey and S. Santoso, “Electric Vehicle Charging on Residential Distribution Systems: Impacts and Mitigations,” IEEE Access, vol. 3, pp. 1871–1893, 2015. [7] P. Mancarella, “MES (multi-energy systems): An overview of concepts and evaluation models,” Energy, vol. 65, pp. 1–17, 2014. [8] F. Salgado and P. Pedrero, “Short-term operation planning on cogeneration systems: A survey,” Electr. Power Syst. Res., vol. 78, pp. 835–848, 2008. [9] H. Cho, A. D. Smith, and P. Mago, “Combined cooling, heating and power: A review of performance improvement and optimization,” Appl. Energy, vol. 136, pp. 168–185, 2014. [10] A. D. Hawkes and M. A. Leach, “Cost-effective operating strategy for residential micro-combined heat and power,” Energy, vol. 32, no. 5, pp. 711–723, 2007. [11] J. Matics and G. Krost, “Micro combined heat and power home supply: Prospective and adaptive management achieved by computational intelligence techniques,” Appl. Therm. 75 Eng., vol. 28, no. 16, pp. 2055–2061, 2008. [12] J. J. Wang, Y. Y. Jing, C. F. Zhang, and Z. J. Zhai, “Performance comparison of combined cooling heating and power system in different operation modes,” Appl. Energy, vol. 88, no. 12, pp. 4621–4631, 2011. [13] M. Caliano, N. Bianco, G. Graditi, and L. Mongibello, “Economic optimization of a residential micro-CHP system considering different operation strategies,” Appl. Therm. Eng., vol. 101, pp. 592–600, 2016. [14] M. Nazari-Heris, B. Mohammadi-Ivatloo, and G. B. Gharehpetian, “A comprehensive review of heuristic optimization algorithms for optimal combined heat and power dispatch from economic and environmental perspectives,” Renew. Sustain. Energy Rev., vol. 81, pp. 2128–2143, 2017. [15] D. Mclarty, N. Panossian, F. Jabbari, and A. Traverso, “Dynamic economic dispatch using complementary quadratic programming,” Energy, vol. 166, no. 1, pp. 755–764, 2019. [16] A. A. Eladl and A. A. Eldesouky, “Optimal economic dispatch for multi heat-electric energy source power system,” Electr. Power Energy Syst., vol. 110, pp. 21–35, 2019. [17] P. Vögelin, B. Koch, G. Georges, and K. Boulouchos, “Heuristic approach for the economic optimisation of combined heat and power (CHP) plants: Operating strategy, heat storage and power,” Energy, vol. 121, pp. 66–77, 2017. [18] T. Niknam, R. Azizipanah-Abarghooee, A. Roosta, and B. Amiri, “A new multi-objective reserve constrained combined heat and power dynamic economic emission dispatch,” Energy, vol. 42, pp. 530–545, 2012. [19] A. Rong and R. Lahdelma, “An effective heuristic for combined heat-and-power production planning with power ramp constraints,” Appl. Energy, vol. 84, no. 3, pp. 307–325, 2007. 76 [20] W. Gu et al., “Modeling, planning and optimal energy management of combined cooling, heating and power microgrid: A review,” Int. J. Electr. Power Energy Syst., vol. 54, pp. 26–37, 2014. [21] J. Y. Wu, J. L. Wang, and S. Li, “Multi-objective optimal operation strategy study of micro-CCHP system,” Energy, vol. 48, no. 1, pp. 472–483, 2012. [22] H. Cho, R. Luck, S. D. Eksioglu, and L. M. Chamra, “Cost-optimized real-time operation of CHP systems,” Energy Build., vol. 41, no. 4, pp. 445–451, 2009. [23] K. Yun, H. Cho, R. Luck, and P. J. Mago, “Real-time combined heat and power operational strategy using a hierarchical optimization algorithm,” Proc. Inst. Mech. Eng. Part A J. Power Energy, vol. 225, no. 4, pp. 403–412, 2011. [24] P. Jochem, M. Schönfelder, and W. Fichtner, “An efficient two-stage algorithm for decentralized scheduling of micro-CHP units,” Eur. J. Oper. Res., vol. 245, no. 3, pp. 862–874, 2015. [25] H. Karami, M. J. Sanjari, H. B. Gooi, G. B. Gharehpetian, and J. M. Guerrero, “Stochastic analysis of residential micro combined heat and power system,” Energy Convers. Manag., vol. 138, pp. 190–198, 2017. [26] O. A. Shaneb, P. C. Taylor, and G. Coates, “Optimal online operation of residential μcHP systems using linear programming,” Energy Build., vol. 44, no. 1, pp. 17–25, 2012. [27] O. A. Shaneb, P. C. Taylor, and G. Coates, “Real time operation of μcHP systems using fuzzy logic,” Energy Build., vol. 55, pp. 141–150, 2012. [28] M. Majidi, S. Nojavan, and K. Zare, “Optimal stochastic short-term thermal and electrical operation of fuel cell / photovoltaic / battery / grid hybrid energy system in the presence of demand response program,” Energy Convers. Manag., vol. 144, pp. 132–142, 2017. 77 [29] S. D. Oh, K. Y. Kim, S. B. Oh, and H. Y. Kwak, “Optimal operation of a 1-kW PEMFC-based CHP system for residential applications,” Appl. Energy, vol. 95, pp. 93–101, 2012. [30] M. Houwing, R. R. Negenborn, M. D. Ilić, B. De Schutter, M. D. Ilic, and B. De Schutter, “Model predictive control of fuel cell micro cogeneration systems,” in 2009 International Conference on Networking, Sensing and Control, 2009, pp. 708–713. [31] M. J. Sanjari, H. Karami, and H. B. Gooi, “Micro-generation dispatch in a smart residential multi-carrier energy system considering demand forecast error,” Energy Convers. Manag., vol. 120, pp. 90–99, 2016. [32] J. F. Rist, M. F. Dias, M. Palman, D. Zelazo, and B. Cukurel, “Economic dispatch of a single micro-gas turbine under CHP operation,” Appl. Energy, vol. 200, pp. 1–18, 2017. [33] M. Motevasel, A. R. Seifi, and T. Niknam, “Multi-objective energy management of CHP (combined heat and power)-based micro-grid,” Energy, vol. 51, pp. 123–136, 2013. [34] A. Collazos, F. O. Maréchal, and C. Gähler, “Predictive optimal management method for the control of polygeneration systems,” Comput. Chem. Eng., vol. 33, pp. 1584–1592, 2009. [35] S. Gräßle, B. Becker, T. Knapp, F. Allerding, H. Schmeck, and A. Wagner, “Intelligent control system for chp-equipment in smart-homes,” in Proceedings of the 2nd International Conference on Microgeneration and Related Technologies, 2011, no. January 2011. [36] M. Houwing, R. R. Negenborn, and B. De Schutter, “Demand response with micro-CHP systems,” Proc. IEEE, vol. 99, no. 1, pp. 200–213, 2011. [37] M. Rastegar and M. Fotuhi-Firuzabad, “Load management in a residential energy hub with renewable distributed energy resources,” Energy Build., vol. 107, pp. 234–242, 2015. [38] G. Zhang, Y. Cao, Y. Cao, D. Li, and L. Wang, “Optimal energy management for microgrids with combined heat and power (CHP) generation, energy storages, and 78 renewable energy sources,” Energies, vol. 10, no. 9, pp. 1–18, 2017. [39] T. Wakui and R. Yokoyama, “Impact analysis of sampling time interval and battery installation on optimal operational planning of residential cogeneration systems without electric power export,” Energy, vol. 81, pp. 120–136, 2015. [40] Raspberry Pi Foundation, “Raspberry Pi,” 2019. [Online]. Available: https://www.raspberrypi.org/. [41] A. Gleixner et al., “The SCIP Optimization Suite 6.0,” Jul. 2018. [42] IBM ILOG CPLEX, “CPLEX Optimizer,” 2019. [Online]. Available: https://www.ibm.com/analytics/cplex-optimizer. [43] S. Barker, A. Mishra, D. Irwin, E. Cecchet, P. Shenoy, and J. Albrecht, “Smart*: An Open Data Set and Tools for Enabling Research in Sustainable Homes,” in Proceedings of the 2012 Workshop on Data Mining Applications in Sustainability (SustKDD 2012), 2012, no. August, p. 6. [44] D. Chen, S. Iyengar, D. Irwin, and P. Shenoy, “SunSpot: Exposing the Location of Anonymous Solar-powered Homes,” in Proceedings of the 3rd ACM International Conference on Systems for Energy-Efficient Built Environments, 2016, pp. 85–94. [45] S. Edwards, I. Beausoleil-Morrison, A. Laperrière, and A. Laperriè, “Representative hot water draw profiles at high temporal resolution for simulating the performance of solar thermal systems,” Sol. Energy, vol. 111, pp. 43–52, 2015. [46] National Renewable Energy Laboratory, “Commercial and Residential Hourly Load Profiles for all TMY3 Locations in the United States.” 2013. [47] H. I. Onovwiona, V. Ismet Ugursal, and A. S. Fung, “Modeling of internal combustion engine based cogeneration systems for residential applications,” Appl. Therm. Eng., vol. 27, 79 no. 5–6, pp. 848–861, Apr. 2007. [48] Tesla, “Powerwall 2 AC.” 2016. [49] Ontario Energy Board, “Electricity rates,” 2018. [Online]. Available: https://www.oeb.ca/rates-and-your-bill/electricity-rates. [50] S. Bai, J. Z. Kolter, and V. Koltun, “An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling,” CoRR, vol. abs/1803.0, 2018.
- Library Home /
- Search Collections /
- Open Collections /
- Browse Collections /
- UBC Theses and Dissertations /
- Methods for improving the optimal operation control...
Open Collections
UBC Theses and Dissertations
Featured Collection
UBC Theses and Dissertations
Methods for improving the optimal operation control of combustion engine-based micro-CHP systems in small… Robertson, Brandon 2020
pdf
Page Metadata
Item Metadata
Title | Methods for improving the optimal operation control of combustion engine-based micro-CHP systems in small residences |
Creator |
Robertson, Brandon |
Publisher | University of British Columbia |
Date Issued | 2020 |
Description | The research presented in this thesis contributes to the body of literature surrounding the optimal operation of micro-CHP (combined heat and power) systems particularly within small residences. A method is discussed that allows for the use of more complicated constraints and increased resolution compared to standard model predictive control (MPC) strategies. This method uses two progressively more detailed optimizations where the first optimization applying boundary constraints to the second optimizations. Such a technique results in more freedom in the choice of constraints and resolution for the MPC optimization. This method is tested with micro-CHP formulations containing solar power, an auxiliary heater, thermal energy storage (TES), and electrical energy storage (EES). Many variants of the proposed method and formulations are tested using a novel HLM for comparison. Computational complexity resulting from the proposed method and the formulation are discussed. The effects of forecasting inaccuracies and the selling price of electricity are investigated for the proposed formulations. The time-step size and horizon length of the optimization are changed, and the effects of these changes are explored. The behavior of the controller is also discussed in relation to a heat-led method (HLM). The proposed methods can be generalized to problems with different constraints resulting in a transferable solution to similar problems. The methods are also tested using low-performance hardware and open-source software to be generalizable and competitive in cost to conventional methods. The proposed formulations and MPC strategies were able to outperform an HLM in the majority of test scenario, particularly when the selling price of electricity is lower than the purchasing price. However, when the selling and purchasing price of electricity are the same, the performance of the proposed MPC strategy is much closer to that of the HLM with no guarantee of better performance with the current formulation. The formulation was also able to deal with relatively complex constraints while achieving sufficiently low computation times. |
Genre |
Thesis/Dissertation |
Type |
Text |
Language | eng |
Date Available | 2019-11-26 |
Provider | Vancouver : University of British Columbia Library |
Rights | Attribution-NonCommercial-NoDerivatives 4.0 International |
DOI | 10.14288/1.0385978 |
URI | http://hdl.handle.net/2429/72420 |
Degree |
Master of Applied Science - MASc |
Program |
Mechanical Engineering |
Affiliation |
Applied Science, Faculty of Engineering, School of (Okanagan) |
Degree Grantor | University of British Columbia |
GraduationDate | 2020-02 |
Campus |
UBCO |
Scholarly Level | Graduate |
Rights URI | http://creativecommons.org/licenses/by-nc-nd/4.0/ |
AggregatedSourceRepository | DSpace |
Download
- Media
- 24-ubc_2020_february_robertson_brandon.pdf [ 1.59MB ]
- Metadata
- JSON: 24-1.0385978.json
- JSON-LD: 24-1.0385978-ld.json
- RDF/XML (Pretty): 24-1.0385978-rdf.xml
- RDF/JSON: 24-1.0385978-rdf.json
- Turtle: 24-1.0385978-turtle.txt
- N-Triples: 24-1.0385978-rdf-ntriples.txt
- Original Record: 24-1.0385978-source.json
- Full Text
- 24-1.0385978-fulltext.txt
- Citation
- 24-1.0385978.ris
Full Text
Cite
Citation Scheme:
Usage Statistics
Share
Embed
Customize your widget with the following options, then copy and paste the code below into the HTML
of your page to embed this item in your website.
<div id="ubcOpenCollectionsWidgetDisplay">
<script id="ubcOpenCollectionsWidget"
src="{[{embed.src}]}"
data-item="{[{embed.item}]}"
data-collection="{[{embed.collection}]}"
data-metadata="{[{embed.showMetadata}]}"
data-width="{[{embed.width}]}"
async >
</script>
</div>
Our image viewer uses the IIIF 2.0 standard.
To load this item in other compatible viewers, use this url:
https://iiif.library.ubc.ca/presentation/dsp.24.1-0385978/manifest