Sizing and operation optimization of a hybrid photovoltaic-battery backup system assisting an intermittent primary energy source for a residential application Jawad Khoury

To cite this version:

Jawad Khoury. Sizing and operation optimization of a hybrid photovoltaic-battery backup system assisting an intermittent primary energy source for a residential application. Electric power. Université de Cergy Pontoise, 2016. English. ￿NNT : 2016CERG0763￿. ￿tel-01328712￿

HAL Id: tel-01328712 https://tel.archives-ouvertes.fr/tel-01328712 Submitted on 8 Jun 2016

HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Année 2016

UNIVERSITE DE CERGY PONTOISE THESE

Présentée pour obtenir le grade de

DOCTEUR DE L’UNIVERSITE DE CERGY PONTOISE

Ecole doctorale : Sciences et Ingénierie Spécialité : Génie Electrique

Soutenance publique prévue le 01 Juin 2016

Par Jawad KHOURY

Sizing and operation optimization of a hybrid photovoltaic-battery backup system assisting an intermittent primary energy source for a residential application

JURY

Rapporteurs : Prof. Giovanni Spagnuolo Université de Salerno Prof. Manuela Sechilariu Université de technologie de Compiègne

Président du jury : Prof. Benoit Robyns École des Hautes Études d’Ingénieur

Directeur de thèse : Prof. Eric Monmasson Université de Cergy Pontoise

Co-directeur de thèse : Prof. Georges Salloum Université Libanaise

Laboratoire SATIE - UCP/UMR 8029, 1 rue d’Eragny, 95031 Neuville sur Oise France

This work is dedicated to my parents who have believed in me, encouraged me, and sacrificed a lot in order for me to reach my goals.

I also dedicate this work to my beloved country, which has been the main focus of this research, may I always try to benefit you the best way I can

iii

Acknowledgments

The work presented in this thesis was carried out within the research laboratory of Systems and Applications of Information and Energy Technologies (SATIE), the team of Systèmes d’énergie pour les transports et l’environnement (SETE). The thesis was achieved under the supervision of Professor Eric Monmasson, head of SATIE pole at the University of Cergy Pontoise and Professor Georges Salloum, head of CERGE research team at the Lebanese University.

First and foremost, I wish to thank my advisor Prof. Eric Monmasson, for it has been an honor to have worked under his guidance since my Master’s project. I appreciate all his contributions in terms of time, ideas, and funding to make my research more productive and bring the best out of me. For me, becoming as much of a reputable and knowledgable researcher as him was my greatest motivation during my Ph.D.

Second, I would like to express my sincere gratitude to my co-advisor Prof. Georges Salloum who has always been there for me, helping and advising me during the most difficult times. He went to great lengths so I can achieve my goals and become the researcher that I am today. This Ph.D. study would not have been possible without him. For that I am forever grateful.

My deep appreciation goes out to Dr. Rita Mbayed who has been like a sister to me, providing me with unlimited academic and moral support. There are no words to describe my gratitude and appreciation.

I am also very grateful to Don Abasse Boukari, Aude Brebant, Lahoucine Idkhajine, and all the personnel of SATIE laboratory who have surrounded me with the best working conditions during my stays in France. I would also like to thank my colleagues with whom I spent the best time in Paris and who have given me the beautiful experience of having friends from all over the world.

I would like to thank the members of the assessment committee, prof. Manuela Sechilariu, prof. Giovanni Spagnuolo, and prof. Benoit Robyns for reading and evaluating the manuscript. I appreciate their willingness to assume responsibility for the assessment of the quality of this thesis.

v vi

A special thanks goes to my family, especially my sister, and friends whose endless support helped me get through this tiring experience. A particular thank you goes to my fellow Ph.D. student Maria Achkar, for we have endured challenges and found support in each other since our undergraduate studies. vii

Résumé

Le travail effectué dans cette thèse propose et évalue une solution au problème de coupure fréquente du courant électrique fourni par le réseau publique défaillant dans plusieurs pays en voie de développement. La solution consiste à installer un système de panneaux Photovoltaïques (PV) avec des batteries de stockage opérant conjointement avec le réseau. L’étude traite particu- lièrement le cas Libanais et considère une application résidentielle à consommation d’énergie élevée. La topologie du système proposé introduit des contraintes supplémentaires au fonction- nement de l’ensemble par rapport aux deux configurations classiques traitées dans la littérature, à savoir accrochage au réseau ou système autonome. L’étude vise principalement à maintenir une alimentation permanente en électricité du foyer ainsi qu’à réduire les frais du système installé tout en respectant les niveaux de confort exigés par les résidents. L’étude traite l’optimisation du système PV-Batteries, en partant du dimensionnement jusqu’au fonctionnement. Tout d’abord, sa configuration est optimisée en se basant sur une étude économique détaillée pour l’estimation des frais considérant une durée de vie de 20 ans. Le dimensionnement est formulé comme un problème d’optimisation visant la réduction du coût global du système. L’optimisation du fonctionnement du système PV-batterie vient en second lieu. Un algorithme de contrôle de charges est élaboré. Cet algorithme sert à éviter la coupure du courant électrique tout en mainte- nant des niveaux élevés de confort des habitants d’une part et en respectant les contraintes de fonctionnement du système d’autre part. La gestion des charges s’effectue à plusieurs niveaux, afin de gérer les charges prévisibles et imprévisibles. La commande développée assure la coordi- nation complète entre tous les composants de l’installation : réseau, panneaux PV, batteries de stockage et charges électriques. L’étude prouve que le contrôle des charges conçu ne se limite pas à l’optimisation du fonctionnement du système, mais contribue de même à la réduction de son coût global. Le logiciel établi est optimisé de sorte à assurer une faible consommation de mémoire et une prise de décision rapide afin de réaliser l’implémentation des codes sur des processeurs de type ARM Cortex-A9. Les résultats de simulation et d’implémentation montrent que le programme développé est générique, flexible, précis, rapide et fiable. Les résultats présentés dans cette thèse attestent que le système PV-batterie proposé est bien approprié pour remplacer le réseau public pendant les périodes de coupure du courant électrique dans une application résidentielle. De plus, ce système présente une bonne fiabilité surtout lorsqu’il est couplé avec le programme de contrôle des charges développé.

Mots-Clés — Photovoltaïques, réseaux électriques non fiables, pays en voie de dévelop- pement, algorithmes génétiques, optimisation, gestion de charges, implémentation numérique

ix

Abstract

This thesis addresses the issue of intermittent primary energy source in several developing countries and considers, in particular, the case study of Lebanon. A PV-battery backup system is proposed and assessed as a replacement of the grid energy during daily power outage periods for a high energy consuming residential house. The proposed system topology introduces more critical conditions and additional constraints on the operation of the system compared to standard on-grid or standalone PV systems. The main concern is to provide permanent electricity supply to the house, reduce the resulting fees, and ensure high performance and reliability of the backup system while respecting the residents’ comfort levels. This thesis aims at thoroughly assessing the suitability of the proposed backup system by focusing on various aspects of the system. First, its configuration is optimized through the development of a detailed economic study estimating the resulting fees over its 20-year lifetime. The sizing process is formulated as an optimization problem having the sole objective of minimizing the overall cost of the system. Furthermore, a detailed comparative study of various water heating techniques is conducted to the end of determining the most suitable configuration to be coupled with the proposed backup solution. Second, the thesis targets the operation optimization of the PV-battery system by implementing a Demand Side Management (DSM) program aiming at preventing the occurrence of loss of power supply to the house while maintaining high comfort levels to the inhabitants and respecting the operation constraints of the system. The control is divided into several layers in order to manage predictable and unpredictable home appliances. The strength of the developed control lies in ensuring the complete coordination between all the components of the installation: the grid, PV panels, battery storage, and the load demand. The benefits of the DSM are proven to go beyond the operation optimization of the system since they highly affect the sizing of the backup, and by extension, the overall resulting cost. The established program is optimized for the hardware implementation process by ensuring a low memory consumption and fast decision making. The developed C codes of the full DSM program are implemented on ARM Cortex-A9 processors. The simulation and implementation results show that the developed management program is highly generic, flexible, accurate, fast, and reliable. The results presented in this thesis validate that the proposed PV-Battery backup system is highly suitable to assist unreliable grids. It outperforms currently installed Diesel Generators and demonstrates a remarkable reliability especially when coupled with the developed DSM program.

Keywords — PV, unreliable grid, developing countries, GA, optimization, DSM, Hardware implementation

Contents

List of Figures xv

List of Tables xix

Nomenclature xxi

Introduction 1 Main objectives of the thesis ...... 2 Overview of the PV-Battery backup system ...... 3 Case study ...... 5

1 State of the Art 9 1.1 Energy crisis in some developing countries ...... 9 1.2 The Lebanese energy status ...... 12 1.2.1 Overview of the Lebanese energy crisis ...... 13 1.2.2 Renewable energy systems in Lebanon ...... 16 1.2.3 Lebanon’s energy status compared to other developing countries . . . . 17 1.3 Literature review of the backup system configurations and sizing optimization . 18 1.4 Demand Side Management and hardware implementation Literature review . . 20

2 Modeling of the PV-Battery system components and Energy Flow 23 2.1 PV energy production modeling ...... 24 2.2 Grid energy modeling ...... 25 2.3 Battery bank State Of Charge (SOC) modeling ...... 26 2.4 Energy Flow modeling ...... 27 2.5 Residential Loads modeling ...... 28 2.5.1 (WM) model ...... 29 2.5.2 Water Heater Models ...... 30 2.5.2.1 Electric Water Heater (EWH) ...... 32 2.5.2.2 Solar Electric Water Heater (SEWH) ...... 34 2.5.2.3 Boiler Water Heater (BWH) ...... 35

xi xii CONTENTS

2.5.3 Heating, Ventilation and (HVAC) model ...... 36

3 PV-Battery backup sizing optimization 41 3.1 Sizing problem formulation and economic evaluation ...... 42 3.2 Sizing optimization procedure ...... 44 3.3 Study on the optimal water heating technique to be coupled with the PV-battery backup system ...... 46 3.4 Sizing optimization results ...... 50 3.4.1 Simulation results under the worst case scenario ...... 52 3.4.2 Simulation results under moderate conditions ...... 54 3.5 PV-Battery backup systems vs. Diesel generators ...... 57

4 Demand Side Management procedure 61 4.1 Overview of the DSM program ...... 62 4.2 Predictive Scheduling layer ...... 64 4.2.1 Problem formulation ...... 65 4.2.2 Number of decision variables ...... 66 4.2.3 Objective functions ...... 67 4.2.3.1 Objective 1: WM discomfort ...... 67 4.2.3.2 Objective 2: SEWH discomfort ...... 68 4.2.3.3 Objective 3: HVAC discomfort ...... 69 4.2.3.4 Objective 4: Autonomy ...... 69 4.2.4 Fuzzy logic decision maker ...... 70 4.2.5 DSM Simulation results ...... 73 4.2.5.1 WM DSM ...... 75 4.2.5.2 SEWH DSM ...... 75 4.2.5.3 HVAC DSM ...... 76 4.2.6 Advantages of the DSM for the case study ...... 77 4.3 Real Time layer ...... 79 4.3.1 Control Algorithm ...... 80 4.3.2 RT controller simulation results ...... 81

5 Demand Side Management hardware implementation 85 5.1 Predictive layer implementation on the ARM cortex-A9 ...... 86 5.1.1 Weighted sum GA optimization problem formulation ...... 87 5.1.2 C code of the DSM predictive layer ...... 91 5.1.3 DSM predictive layer implementation results ...... 92 5.1.4 Comparison of the DSM predictive layer optimization algorithms . . . 95 CONTENTS xiii

5.2 Real time layer implementation on the ARM Cortex-A9 processor ...... 97 5.2.1 C code of the RT layer ...... 97 5.2.2 DSM RT layer implementation results ...... 98

Conclusions & Perspectives 105

Bibliography 109

Appendix A PV panels modeling 127

Appendix B Fuzzy Logic 131

Appendix C GA Pseudo-Codes for the DSM program 135

List of publications 139

List of Figures

1 Overview of the operation of the system (a) during energy blackout periods, (b) during grid availability ...... 4 2 Drawing of the considered apartment showing the main electrical loads installed6

1.1 Lebanese energy production and electricity imports ...... 14 1.2 A private generator providing electricity for a neighborhood at a residential area in Lebanon ...... 15

2.1 EF in the PV-battery backup system ...... 24 2.2 Clothes washing cycle ...... 29 2.3 Example of a full clothes washing cycle ...... 29 2.4 Residential water heating systems ...... 31

2.5 Assessment of the impact of θa on the final value of θH for the EWH model . . 33 2.6 HVAC 4-node lumped RC model ...... 37

3.1 Sizing optimization flow chart executed at each generation of the EA ...... 46 3.2 Comparison procedure of the impact of the installed water heating techniques on the sizing of the PV-Battery backup system ...... 47 3.3 Applied simulation conditions for the assessment of the optimal water heating technique to be coupled with the PV-Battery backup system ...... 48 3.4 Average hourly hot water consumption during the 4 seasons of the year - Lebanese profiles.Data source: Lebanese center of energy conservation (L.C.E.C) ...... 48 3.5 Solar radiation & ambient air temperature during 7 harsh winter & summer days - Lebanese case ...... 49 3.6 Energy consumption profile during winter & summer seasons of the considered house (a) high consumption (b) moderate consumption ...... 51 3.7 PSO convergence towards the optimal sizing results ...... 52 3.8 Detailed cost resulting from the PV-Battery backup sizing under the worst case scenario ...... 53 3.9 EF during 3 days (a) harsh winter conditions (b) harsh summer conditions . . . 54

xv xvi LIST OF FIGURES

3.10 EF during 3 days (a) moderate winter conditions (b) moderate summer condi- tions ...... 56 3.11 Variation of the monthly resulting fees of a 10A DG subscription as a function of (a) Diesel prices and (b) Average monthly grid blackout hours. Data Source: Lebanese ministry of energy and water & Lebanese ministry of interior and municipalities May 2014 - May 2015 ...... 57 3.12 Comparison of the resulting costs over 20 years of the PV-battery backup and DG (20A subscription). (a) Yearly comparison; (b) Aggregated comparison . . 58

4.1 Services categorization and classification for the DSM ...... 63 4.2 Overview of the Proposed DSM program ...... 64 4.3 Determination of the number of Decision variables ...... 67 4.4 Autonomy Computation during a single grid blackout cycle ...... 70 4.5 Fuzzy logic Decision maker ...... 71 4.6 Fuzzy Rules implementation ...... 73 4.7 Base load energy and power consumption during summer season ...... 74 4.8 Pareto set of optimal solutions - Summer conditions and 14 hours of grid blackout 74 4.9 Washing process management ...... 75 4.10 Hot water temperature variation after DSM ...... 76 4.11 HVAC system operation before and after the application of the scheduling layer control ...... 77 4.12 Comparison of the two scenarios: with and without DSM ...... 78 4.13 RT layer overview ...... 80 4.14 RT layer simulation results ...... 82

5.1 GA Optimization flowchart ...... 88

5.2 Two point crossover process assuming NVar = 12 ...... 90 5.3 Function calls of the developed DSM C code ...... 91 5.4 Predictive DSM layer GA optimization convergence ...... 93 5.5 Predictive DSM layer implementation results on the ARM cortex-A9 . . . . . 94 5.6 Performance comparison of the four applied optimization methods ...... 96 5.7 Real time layer implementation approach on the ARM Cortex-A9 ...... 97 5.8 Block Diagram layout on the Xilinx Vivado Design Suite ...... 98 5.9 RT layer implementation on the ZedBoard ...... 100 5.10 Real time layer implementation on ARM Cortex-A9 & MATLAB simulation results ...... 101 LIST OF FIGURES xvii

A.1 PV panel performance as a function of the ambient air temperature and the solar insolation ...... 129

B.1 Simplified representation of the fuzzy logic decision making steps ...... 131 B.2 Fuzzy logic decision making example ...... 132

List of Tables

2.1 PV panel parameters provided by the manufacturer ...... 25 2.2 Backup system components parameters ...... 26 2.3 Boiler water heater parameters ...... 36 2.4 Thermal-Electrical analogy for the lumped RC model development ...... 37

3.1 Economic and financial parameters for the PV-Battery backup sizing ...... 42 3.2 Applied parameters for the EA optimization methods : GA & PSO ...... 47 3.3 Simulation conditions for water heating load computation ...... 49 3.4 Imapct of the water heating technique on the PV-Battery backup sizing results . 50 3.5 Components specifications & Capital cost ...... 51 3.6 GA intermediate optimal solutions ...... 52 3.7 Comparison of the backup system’s sizing results over 1 week ...... 55

4.1 Unpredictable devices power consumption (W) in priority of execution order . . 81

5.1 GA parameter settings for the predictive DSM layer ...... 92 5.2 Main C code variables format ...... 100

xix

Nomenclature

Acronyms AC Alternating Current ACU Air Conditioning Units DC Direct Current DG Diesel Generators DOD Depth Of Discharge DSM Demand Side Management EA Evolutionary Algorithms EF Energy Flow FDM Fuzzy logic Decision Maker FPGA Field Programmable Gate Array GA Genetic Algorithm HEMS Home Energy Management System KB Kilobytes LPS Loss of Power Supply LPSP Loss of Power Supply Probability MOO Multi-Objective optimization NSGA Non-Dominated Sorting GA PSO Particle Swarm Optimization PV Photovoltaic RES Renewable Energy Systems RET Renewable Energy Technologies SOC State Of Charge SoC System on Chip SOGA Single Objective GA STC Standard Test Conditions Indexes avg Mean value over a step period co Component of the PV-Battery backup system

xxi xxii NOMENCLATURE

k Step period max Maximum value min Minimum value opt Optimal value Symbols

ηinv Efficiency of the power converter σ Self discharging rate of the batteries

θHGA Hot water reference temperature determined by the GA (°C)

θindoor Indoor ambient air temperature (°C)

θinGA Indoor reference ambient air temperature determined by the GA (°C)

θoutdoor Outdoor ambient air temperature (°C)

An Normalized Autonomy level

An Normalized Autonomy level D(X) Normalized discomfort level of task X

EAC−L Energy extracted by the load from the AC bus (Wh)

EBatt−AC Energy injected by the battery bank to feed the load (Wh)

Eb Energy stored in the battery bank (Wh)

EG−AC Energy injected by the grid to the AC bus of the house (Wh)

EG−Batt Energy used from the grid to charge the battery bank (Wh)

EGc The constrained amount of energy allowed to be injected from the grid to the battery bank (Wh)

EL−BL Energy extracted by the base load (Wh)

EL−HVAC Energy extracted by the HVAC system (Wh)

EL−WH Energy extracted by the water heating process (Wh)

EL−WM Energy extracted by the WM (Wh)

EL Total energy extracted by the load (Wh)

EPV−AC Energy used from the PV panels to feed the load (Wh)

EPV−Batt Energy used from the PV panels to charge the battery bank (Wh)

EPV−Inv DC energy supplied by the PV panels to the inverter (Wh)

EPV Energy generated by the PV panels (Wh)

ichrmax Maximum charging current allowed to be injected in the batteries (A)

Ko Number of objective functions for the optimization problem nX Number of decision variables to control the device X nbat Number of installed batteries ncyc Number of grid ON/OFF cycles nPV Number of installed PV panels NOMENCLATURE xxiii

nbAC Number of operating Air Conditioning Units

PACU Electrical power consumption of a single ACU (W)

PL Power consumption of the load (W)

Pmax Contracted power limitation from the grid (W)

Rb Number of battery replacements during the lifetime of the project t Time of the day (min) th t(Xi) Starting time of the i operation state of the device X (min)

Ts Sampling period (s) vbat Voltage of the battery bank (V) Operators s Laplace operator ++ Integer incrementation operator & Logical AND operator Water Heater parameters m˙ f Flow rate of the heating fluid in the pipes (Kg/h) ρ Water density (Kg/L)

θa Ambient air temperature (°C)

θ f Temperature of the heating fluid (°C)

θH Hot water temperature inside the water tank (°C)

θin Temperature of the inlet water to the water tank (°C) C Thermal capacity of water (J/°C)

Cf Thermal capacity of the heating fluid (J/°C)

Cp f Specific heat of the heating fluid (J/Kg.°C)

Cp Specific heat of water (J/Kg.°C)

PBP Rated power consumption of the boiler water circulation pump (W)

PFP Rated power consumption of the fluid circulation pump (W)

PR Rated power consumption of the electrical resistance (W) Q Heat input of the electrical resistance (W)

Qs Heat provided by the solar radiation to the heating fluid (W) S Surface of the water tank exchanging heat with the ambiance (m2) U Stand-by heat loss coefficient (W/°C.m2)

Wd Average hot water draw per hour (L/h) GA parameters

children Children array of dimension (NInd × NVar)

Fit_Ind Array of the fitness values of each individual of the generation of dimension (NInd) xxiv NOMENCLATURE

NGen,max Maximum number of generations allowed to be produced by the GA

NGen Number of generations produced by the GA

NInd Number of individuals in the generation i.e. Population size

Nstall Number of stall generations for stopping criteria i.e. The number of generations computed with a best fitness value variation 6 tol before exiting the program NVar−T Number of decision variables for temporary services

NVar Total number of decision variables

PCross Crossover Probability

PMut Mutation Probability

Pop Population array of dimension (NInd × NVar)

Sel_Ind Array of indexes of the selected individuals for the mating pool of dimension (NInd) tol Tolerated amount of fitness variation set to 10−6 w Weighting coefficient x Vector of Decision Variables

xin f Vector of lower bounds of the decision variables

xsup Vector of lower bounds of the decision variables Real time DSM parameters DS Devices status vector (size: 1×5)

ndev Device number

Psch Power consumption vector determined by scheduling layer (size: 1×1440)

Req Requested devices for activation (size: 1×5) trem Remaining time of the 5 minute period (min) TMR 32-bit Timer value Introduction

Contents Main objectives of the thesis ...... 2 Overview of the PV-Battery backup system ...... 3 Case study ...... 5

For decades, several developing countries have been struggling with an energy crisis that has led their nations to search for alternative means of electricity production to cope with the deficit caused by periodic and frequent grid power cut-offs. Scheduled and unscheduled regular grid energy blackouts are a common issue among these countries causing the electricity supply to be intermittent and unreliable due to numerous economic, technical and even political barriers. The search for alternative sources of energy becomes a must in order to fulfill the power demand of the populations especially with the continuous worldwide increase of electricity consumption [1]. The installation of scattered Diesel Generators (DG) is the most popular substitution for the primary energy source during blackout periods. However, this solution causes massive air pollution, requires regular maintenance and is highly influenced by diesel prices and the num- ber of blackout hours. Despite their various disadvantages, DG are still being integrated in hybridized systems involving Renewable Energy Technologies (RET) [2, 3]. In the wake of growing environmental concerns, the energy production sector is urged to remove diesel based techniques and rely instead on renewable energy resources for the electricity production process. Researchers and international organizations have been investigating and promoting different sources of energy that are non pollutant and based on inexhaustible material ([4–7]). Replace- ments of conventional thermal power stations are being studied due to the massive increase in the level of worldwide pollution and the fast depletion of the fossil fuel along with the surge in the power consumption considering the evolving standard of living in almost everywhere around the world [1]. Consequently, renewable energy resources such as solar thermal and Photovoltaic (PV), wind, biomass, heat, and water are gaining popularity by the day. Unfortunately, these systems are often considered expensive, and thus, investing in such installations is a matter of resource availability and financial capabilities. Additionally, the worldwide social acceptance of these systems is highly variant among the nations and it depends, to a great extent, on the

1 2 INTRODUCTION willingness to pay of the nation, its education level, and the residence location of the community (e.g. rural and urban communities)[8].

Main objectives of the thesis

Since a high share of developing countries benefits from a high number of sunny days, naturally, a solar based system is a solution worthy of analyzing. The main drive behind the presented work is the lack of detailed research targeting the suitability of PV technology in developing countries that suffer from regular load shedding due to energy production failures. The aim is to develop a thorough analysis of the benefits that the PV technology might bring to the energy crisis in these countries. This research investigates the various advantages this technology presents compared to currently installed backup techniques. The presented work proposes the sizing and operation optimization of a residential hybrid PV-Battery backup system assisting an intermittent primary energy source. The backup system operates in conjunction with the grid and is not restricted to the classic on grid or standalone configurations. Therefore, a new system topology is adopted along with objectives that differ from those popular in the literature. A bidirectional power converter is installed to charge the batteries from the grid during its availability along with the PV panels i.e. the battery bank can be charged either by the PV panels or by the primary energy source or both. The main concern is the provision of a permanent electricity supply while taking into account the comfort levels and financial capabilities of the users as much as possible. The presented work is mainly divided into two major parts: The sizing optimization and the operation management of the PV-battery backup system. In the first part of the study, a system sizing process is conducted. Its core objective is the determination of the optimal configuration of the proposed backup system aiming at replacing the national grid during power outages. The process determines the optimal number of components to be installed in order to reduce the resulting fees over a 20-year lifetime period of the system through a detailed economic study. Realistic technical limitations are added, for they will highly influence the charging algorithm of the battery bank and consequently the overall sizing results and performance prediction of the system. A high electricity demand profile is applied for the case study. The sizing process is followed by a detailed comparison between the proposed backup system and the conventional electricity generation methods used to fulfill the grid energy deficits i.e. DG. Moreover, the study searches for means of reduction of the resulting fees without compromising the comfort levels to the users or the performance of the PV-Battery backup. Naturally, the energy consumption profile of the house has a high impact on the sizing results, and by extension, the overall cost of the system. Using the load demand for the cost reduction process can be applied mainly in two ways. First, through the reduction of the total power INTRODUCTION 3

demand by installing energy efficient devices and choosing the most beneficial configurations of the highest energy consuming loads such as the water heating load. This latter is analyzed by applying various water heating configurations to the sizing problem in order to find the optimal water heating technique to be coupled with the PV-Battery backup system. Second, by modifying the load profile of the house (i.e. applying a Demand Side Management (DSM) program) in a way that ensures the need of a lower number of components for the proper operation of the backup system. The second part of the study focuses on the development and hardware implementation of a highly flexible, generic, and well performing DSM procedure to the end of optimizing the operation of the PV-battery backup by ensuring its high reliability and robustness. Given the long blackout periods and the unreliable nature of the solar energy, applying a DSM is of great interest when coupled with the PV-Battery backup system. It helps ensure that no Loss of Power Supply (LPS) will occur during any day of the year regardless of the applied conditions. The load management program modifies the load profile of the house by controlling predictable and unpredictable loads according to the Energy Flow (EF) in the system. The most popular management objectives tackle the issue of energy price reduction and peak load procedures while maintaining high comfort levels to the users. In this study, however, a novel system topology is adopted along with objectives that differ from those popular in the literature. The concern of maintaining permanent electricity supply to the house trumps the trimming of green gas emissions and the energy price reduction. More components are involved in the energy mix: the grid, PV panels, battery storage and the required load. Therefore, a higher complexity is encountered when establishing a well-performing and reliable DSM program.

Overview of the PV-Battery backup system

The residential PV-Battery backup system comprises a PV array for the conversion of the solar irradiance to electrical power, deep-cycle flooded lead acid batteries for the storage of the electrical energy, Pulse Width Modulation (PWM) charge controllers in order to regulate the charging process of the battery bank, and a power converter able to operate under two modes: DC/AC and AC/DC conversion. The PV array is a set of PV modules mounted in serial or in parallel depending on the current and voltage required at the output of the array. The considered PV modules are constituted of mono-crystalline Silicon solar cells mounted in serial. These cells are P-N junctions formed by doping the Silicon with small atom impurities which results in two Silicon layers: the N layer prevailed by free electrons and the P layer having free openings and carrying positive charge. The cell is sandwiched in metallic contacts in order to capture the electrons and consequently allowing a current flow. The photons of the solar radiation hit the N layer of the cell; some are 4 INTRODUCTION

reflected, others having a small energy pass through the cell without having any affect on it, and the photons having an amount of energy higher than the energy gap of the cell’s material will knock loose negative electrons from their atoms. The electrons migrate to the P layer which creates a voltage differential which generates an electrical current in the cell whenever a load is connected. The charge controller regulates the current and/or voltage output of the PV array down to what the battery bank needs at the time to prevent damaging it. The regulation depends on the type of the battery, its State of Charge (SOC) and temperature, and the operation mode of the controller. The PWM charge controller is named after its PWM absorption operation mode. It consists in sending out a series of short charging pulses to the battery instead of a steady output from the controller. This latter constantly checks the state of the battery to determine how fast to send pulses, and how wide the pulses will be. The controller holds the voltage constant to prevent overheating the batteries and the charging current is reduced as the battery becomes more fully charged. The proposed system works in conjunction with the national grid in order to replace it during power outage periods. Consequently, it is not restricted to classic on grid or standalone configura- tions, which introduces new untraditional challenges, limitations, and operation constraints. The operation of the various components of the considered PV-Battery backup system is described in Fig. 1.

G G AC Loads AC Loads

EL PL

Pmax

Charger PV Inverter PV ichrmax E E If PV x ηinv < L If Eb + EPV < Eb,max

Battery Battery If E x η > E PV inv L Bank Bank

(a) Blacked out grid power (b) Available grid power

Figure 1: Overview of the operation of the system (a) during energy blackout periods, (b) during grid availability

The figure plots the EF in the system under all the operation conditions during grid (G) avail- ability and blackout periods. The continuous lines show the functional elements of the backup system. Three operation scenarios are defined: INTRODUCTION 5

• Scenario I: The power grid is blacked out (Fig. 1a)and the produced solar energy exceeds the load energy consumption The produced energy by the PV panels is responsible for satisfying the total load demand of the house. Any excess in the solar energy production is used to charge the installed battery bank through the charge controller, whenever the batteries are not fully charged. • Scenario II: The power grid is blacked out (Fig. 1a)and the produced solar energy falls behind the load energy consumption The totality of the energy produced by the PV panels is supplied to the load. The installed power converter operates as a DC/AC inverter and the battery bank intervenes to help the PV panels supply the power demands of the residents. In case both the PV panels and the battery bank fail to supply the required amount of energy to the load, a LPS occurs. • Scenario III: The power grid is available (Fig. 1b) The PV panels and the batteries do not intervene in feeding the load. The solar power is solely used to charge the battery bank. If it is insufficient, the power converter switches to the charging mode, and the grid supplies the rest of the needed energy to the battery bank in order to reach its maximum SOC. Two major operation limitations arise; the maximum charging current allowed to be injected

in the batteries (ichrmax) and the maximum allowable power to be extracted from the grid Pmax, determined according to the main breaker size of the property. These technical and realistic constraints shall not be violated, the batteries can not be charged from the grid whenever needed and with whatever amount of energy required to fill the battery bank. Furthermore, they highly affect the charging algorithm of the battery bank and set some severe conditions on the charging current that can be used to fill the batteries from the utility energy.

Case study

A Lebanese case study is considered in order to asses various aspects of the proposed PV-Battery backup system like its feasibility, its advantages and disadvantages compared to other backup systems, the amount of price reduction that can be achieved by installing PV based systems, and how can the performance of the proposed system be enhanced along with obtaining overall price reductions. The study considers a rural house of an approximate 110 m2 surface, occupied by four inhabitants and comprises: One dining room, one living room, two bedrooms and a kitchen, a reception area, two bathrooms and a balcony. The considered loads are the following: lighting, , multipurpose sockets, the common kitchen appliances, , hood, dryer etc., a water heater, and the Heating, Ventilation, and Air Conditioning (HVAC) system consisting of 4 air conditioning split units (9000 BTU/h) used only during summer days. The indoor air 6 INTRODUCTION

heating during cold winter days is based on an oil-boiler system with indoor radiator units. The considered house and the main electrical equipments installed in it are shown in Fig. 2.

4

2

Figure 2: Drawing of the considered apartment showing the main electrical loads installed

A high standard of living case study is applied. Therefore, more electrical home appliances are installed, which results in a high total energy consumption of the house. The resulting daily peak power demand is of nearly 6 kW. A Lebanese rural area located at 600 meters above sea level is considered. Solar radiation levels and ambient air temperature values are acquired from an installed weather station at the location. The remainder of the thesis is divided as follows: Chapter 1 - State of the Art: The chapter presents a thorough overview of the energy crisis in some developing countries while paying special attention to the Lebanese context. A literature review is conducted presenting previous works on various sizing methods of backup systems involving the PV technology as well as the conception and implementation of DSM programs. Chapter 2 - Modeling of the PV-Battery system components and Energy Flow: This chapter develops mathematical models of every component involved in the proposed PV- Battery backup system including the highest energy consuming residential loads. These models are mandatory for the prediction of the EF in the system and they are key to a reliable sizing procedure, as well as a highly robust and well performing DSM program. Chapter 3 - PV-Battery backup sizing optimization: In this chapter, a detailed economic study is conducted in order to determine the optimal PV-Battery configuration to be installed for a permanent electricity supply to the case study. The study determines the optimal water heating technique to be coupled with the proposed PV-Battery backup system. The obtained INTRODUCTION 7

results are analyzed and compared to the most popular backup technique currently installed i.e. DG. Chapter 4 - Demand Side Management procedure: A complete DSM is proposed. The code is divided into several control layers aiming at managing predictable and unpredictable home appliances. The developed algorithm is optimized for low memory consumption and fast decision making process. The study highlights the great benefits of the application of the DSM program to the PV-Battery backup system. Chapter 5 - Demand Side Management hardware implementation: A hardware imple- mentation of the developed DSM program in Chapter 4 is done. The proposed algorithm is coded in C language to the end of implementing the various control layers on ARM cortex-A9 processors. The study validates the high flexibility and the great performance of the proposed load management program. Conclusions & Perspectives: The final chapter gives a brief conclusion of the main contri- butions of the thesis and presents the main perspectives of the study.

Chapter 1

State of the Art

Contents 1.1 Energy crisis in some developing countries ...... 9 1.2 The Lebanese energy status ...... 12 1.2.1 Overview of the Lebanese energy crisis ...... 13 1.2.2 Renewable energy systems in Lebanon ...... 16 1.2.3 Lebanon’s energy status compared to other developing countries . . . 17 1.3 Literature review of the backup system configurations and sizing opti- mization ...... 18 1.4 Demand Side Management and hardware implementation Literature re- view...... 20 Renewable Energy Technologies (RET) are highly penetrating the worldwide energy pro- duction sector. The PV technology is one of the most popular RET especially in developing countries where abundant solar energy is available. In this chapter, the energy crisis in various developing countries is reviewed, special attention is given to the Lebanese energy status since this country is considered for the case study. PV based sizing optimization systems and tech- niques are presented, as well as DSM programs in order to highlight the main contributions of the presented study compared to the available research in the literature.

1.1 Energy crisis in some developing countries

Some developing countries have already made plans to produce electrical power from natural renewable resources, but they are confronting many political and financial obstacles. Moreover, technical problems often intervene in the expansion process of RET in these countries [9]. These problems include infrastructure challenges such as the lack of operation facilities and maintenance expertise. However, as stated by Andy Schroeter, CEO of Sunlabob company, the greatest complication confronting the implementation of RET in developing countries is

9 10 CHAPTER 1. STATE OF THE ART

the institutional framework rather than technical difficulties [10]. The high risks preventing developers from further expanding RET in developing countries as cited by the energy finance report are: Geo-Political, legal, financial, and physical [11]. For instance, Asian developing countries embody mainly 2 categories; medium and low socio- economical standards. These latter may also co-exist in a single country like in India and Nepal. India is one of the most populated countries in Asia, struggling with poverty in some areas, suffering from major power shortages, and facing constant blackouts. In such a situation, the country is increasing the use of diesel-based electricity, which is both expensive and polluting. The country also has a very high energy demand and is expected to be the second largest contributor to the increase in global energy demand by 2035, accounting for 18% of the rise in global energy consumption [12]. India has limited fossil fuel reserves and is highly dependent on fuel imports which represent 80% of the used fuel for electricity generation [13]. This requires the embrace of new energy production systems based on available resources, and since the nuclear energy option is losing its ground due to its potential dangers, the focus is on the development of Renewable Energy Systems (RES), mainly solar based technologies. India is a tropical country, capable of producing 243 GW through the use of RE resources as stated in the Green summit held in Bangalore in 2014. It is blessed with around 300 sunny days per year, and solar insolation of 4-7 kWh/m2/day. If this energy is harnessed efficiently, it can easily reduce the energy deficit scenario with no carbon emission. The Jawaharlal Nehru National Solar Mission was launched on the 11th January, 2010. The main objective of the Solar Mission is to install 20 GW of grid connected solar power and 2 GW of off-grid solar power by 2022 particularly for meeting rural energy needs. By July 2014, it was announced at the Green summit, that India has installed an equivalent amount of 32,269.6 MW based on RES excluding large hydro systems; accounting to 12.95% of the total electricity generation capacity of the country. Despite all the good results, the country is still facing a great lack of electrical energy due to the continuously increasing consumption. The continuous interruption of the electricity supply has been stated as the largest problem for industries [14], affecting the production and requiring the installation of backup DG which have a high operation cost in addition to their bad impact on the environment. The high initial cost of PV systems renders their integration hard to achieve although these latter are fit to solve the issue of power supply in remote villages. As a result, more conventional, low-cost, highly pollutant systems are being used. Extremely poor and financially unstable countries struggle with the integration of expensive RET. The Nepali rural electrification accounting for only 29%, cannot afford investing in RES, especially since the government is not able to provide the totality of the population with electric power from conventional resources. This situation generates a more serious issue than the protection of the environment. By 2009, Nepal’s renewable resources contribution was restricted CHAPTER 1. STATE OF THE ART 11

to 0.7% of the total energy consumption, while a majority of 87.1% is provided by traditional sources. The cost of petroleum fuel import was nearly 53% of total merchandise imports in the year 2005–2006, accounting a total cost of $35 million according to the ministry of finance. The country’s fragile economy, is being sabotaged by this great dependency on fuel imports [15], which makes it necessary to find less cumbersome resources to provide electric power. Nepal has a large amount of RE resources that are not harnessed due to geographical, technical, political and economical reasons. Sunshine hours average 6.8 h/day with the intensity of solar insolation averaging about 4.7 kWh/m2/day [16]. Ref. [17] categorizes solar PV systems in Nepal into three types, the applications range from extremely small systems to bigger installations however still considered small. Small solar home systems are an example of a typical system to be installed in rural areas of Nepal. They consist of PV module sizes between 2.5 Wp and 10 Wp and battery storage systems with charge controllers, all in order to supply only two white Light Emitting Diodes (LEDs) of 0.4 Wp. By the end of 2010, about 6,000 small solar home systems were installed in Nepal [17]. Institutional solar systems, on the other hand, are systems which have a capacity between 34 Wp and 6.5 kWp. They are installed in facilities such as schools, clinics, monasteries etc. By December 2006, the total number of these installations reached about 210 with a total installed capacity of about 42 kWp. This proves that efforts are being made in order to reach the golden goal of supplying clean electricity to the entire nation, but so far the number of installed systems is extremely low due to the poverty especially in rural areas. Pakistan is another country that suffers from load shedding, costing its economy an estimate of $2.5 billion/year [18] and unemployment of around 400,000 people annually [19]. According to a survey done by the World Bank [20], 66.7% of the businesses in Pakistan, which consume a high share of the total energy, identify shortage of electricity as the major business obstacle ahead of corruption and crime/terrorism which are 11.7% and 5.5% respectively. Although Pakistan’s overall wind potential is around 346 GW [21], this amount of wind is concentrated in coastal areas of the country, which will cost this financially struggling nation, expensive transmission networks in order to supply rural areas. Adding to that, a large amount of losses on the transmission lines, reaching as high as 25% loss ratio. Consequently, the focus is shifted to the solar based energy production especially that the daily average solar energy is above 5 kW/m2/day which is sufficiently available in all the Pakistani regions. Pakistan has taken steps towards the integration of RET in power generation systems. In National Renewable Energy Policy (NREP) 2002, short term targets were announced for the renewable energy integration in the energy production mix [22]. Sadly, these goals are far from being achieved due to the lack of social acceptance, and the absence of technical know-how and of trained personnel in the industry which has led the already installed systems to stop operating after a short while. The growth of the RE sector is severely affected due to the favoring of fuels 12 CHAPTER 1. STATE OF THE ART

and rental power. Numerous organizations in the private sector are offering stand-alone PV systems for low output power levels [18]. Two kinds of PV installations exist; grid-tied and stand alone systems. The former is not considered beneficial since no feed-in tariff exists in Pakistan. Consequently, grid-tied systems are rejected and the focus is on studies regarding standalone PV systems. Power outages are spreading in various Arab cities and countries as well, sometimes lasting for days especially during the summer season as it is the case in Egypt and Iraq. These energy failures occur due to the high increase in the electricity demand owing to the great air conditioning load during hot days. Egypt faces a chronic power shortage causing rolling blackouts, particularly in summer, that affect tens of millions of people. The Egyptian government opted to reduce the load on the national grid by cutting off the power regularly during the summer of 2014. The power deficit accounted to 2,500 MW approximately [23]. Iraq faces a sharply rising demand for power as well, resulting in common daily energy blackouts for several hours. Moreover, high distribution losses and frequent disconnections of the Iraqi’s distribution system are recorded as a result of the lack of maintenance, and the electricity theft [24]. The country has to import electricity from Iran and Turkey to fully satisfy domestic loads due to an estimated energy consumption increase of at least 50% during the summer season [25]. Consequently, power outages lasting 16 to 22 hours per day were common during the 2003 to 2011 period. The energy crisis is weighting on various economic sectors as the agriculture, commerce, and tourism, thus costing the country tremendous amount of money [26]. Iraqi households and businesses must rely on expensive off-grid, private DG to replace the grid during the energy blackout periods.

1.2 The Lebanese energy status

In Lebanon, the energy crisis dates from the 1980s. Since then, Lebanon has not been able to produce the totality of its energy demand which leads to regular and daily power blackouts. In 2009, the government was compelled to buy 589 GWh from Syria and 527 GWh from Egypt [27]. Despite that fact, alternative sources of energy should be installed in order to provide the citizens with electric power. What distinguishes the Lebanese case from other developing countries is the intermittent grid power during the whole year in addition to a high load profile especially during hot summer days. Currently, DG are being installed and used to fill the power deficit, nevertheless, time has proven that this solution, despite being simple and practical, has major disadvantages. RET, especially PV systems, could be an appropriate solution in the Lebanese case, given that Lebanon benefits from a very high amount of sunny days throughout the year. However, the high initial cost of such technologies and the absence of laws and serious plans, along with the extensive economical and political barriers have slowed down the integration of these systems in Lebanon. CHAPTER 1. STATE OF THE ART 13

1.2.1 Overview of the Lebanese energy crisis

Since the Lebanese civil war (1975-1990) to this day, the power generation of the national grid is no longer sufficient to the growing demand of the Lebanese market, which leads to daily, regular, and frequent electricity blackouts. There are no known fossil fuel resources currently available and the energy production relies on Fuel oil, Diesel oil and other imports, which along other reasons, result in electricity blackout periods ranging from 3 to 14 hours and sometimes more, on all the Lebanese territories. The energy deficit production notched a high 3,478 GWh by 2009, thus reducing the energy supply to the users to an average of 18 hours per day [27]. These power outages depend on the availability of fuel for the operation of conventional thermal power stations and other maintenance and damage repair issues. "Electricité Du Liban" (EDL), the only public institution that generates, transmits and distributes electricity primarily through fossil fuels, has been confronting a financial deficit averaging $1.5 billion between the year 2007 and 2010 and suffering from a total deficit of nearly $8 billion without interest [27]. This institution experiences an annual production shortage of nearly 45% due to technical faults, but mostly due to illegal practices as illegal connections to the power lines and meter tampering [28, 29], costing the government massive - continuously increasing - amounts of money ($2.2 Billion in 2012 compared to $1.7 Billion in 2011) [30]. Husam Beides, a Beirut-based World Bank official who runs the regional infrastructure and development program, states that the estimated average amount of blackout hours across the country will increase in the upcoming years from 6-8 hours to 12 hours per day. The energy production in Lebanon is dominated by thermal power plants (88% of the total energy produced) as shown in Fig. 1.1. The hydro energy has a share of only 4.5%, and the rest is supplied by the imports from Syria and Egypt, averaging 1,500 MW in 2009 [27] and reached 2,790 GWh by 2013 [31]. Petroleum imports have reached 400 million dollars in 2008 [32], and this amount is continuously increasing which results in additional problems to a country that is already suffering from a massive public dept. The installation of dual-fuelled engines that can run on fuel oil or natural gas in Zouk and Jieh stations was announced by former Energy Minister Gebran Bassil as part of a long term plan aiming at eliminating the energy blackouts by 2015. The plants are set to produce nearly 2,500 MW additional electrical power. An amount that might be sufficient to fill the energy deficit for the 4 million Lebanese people according to the CEO of the Energy & Environment Holding in Qatar, Roudi Baroudi. However, in the wake of the ongoing Syrian conflict, and the continuously increasing number of refugees, 1,500 MW additional energy should be produced in order to maintain a 24 hour power supply which would be impossible without the dependency on fuel imports [33]. As stated by Nassib Ghobril, chief analyst at Byblos Bank, the power outages are costing the Lebanese GDP 1% yearly, which according to his beliefs, is increasing the skepticism of foreign investors about investing in the country due to high operating costs. 14 CHAPTER 1. STATE OF THE ART

Thermal Power Plants Hydro Power Plants 4.5% Electricity Purchases 7.5% from Syria & Egypt

88%

Figure 1.1: Lebanese energy production and electricity imports [27]

Currently, private DG distributed all over the country are being used to fulfill the power con- sumption needs of the inhabitants. During blackout periods; the centralized DG in each area take over and provide the users with electrical energy. The subscriptions vary according to each consumer’s needs. While the majority of the residential apartments might settle for the cheapest offer: the DG provide 1.1 kVA, other citizens residing in bigger houses and having a higher standard of living tend to subscribe to more expensive offers providing 2.2 kVA to 4.4 kVA. The resulting fees rise proportionally to the subscription. In 2013, an average estimate of $1,300 was spent on electricity by a single household, 65% of which spent on generators as stated by Ferid Belhaj, Director of the Mashreq Department at the World Bank [28]. It should be noted that most of the time, the DG are managed by unprofessional individuals. Usually, no qualified engineers and technicians are being consulted in the installation and opera- tion processes which mostly results in faults, damages to household equipments and permanent maintenance requirements along with bad electrical current quality and lower energy benefits than the promised ones. On the other hand, industries, hospitals, offices and centers tend to install their own generators each according to its power consumption. This solution provides complete control over the electricity production during outages and helps reduce the resulting fees, or at least be able to manage them. The installation of DG in densely populated residential areas is an alternate solution that, not only causes massive air pollution, but also highly endangers the public health of the Lebanese citizens [34]. Moreover, this backup solution is very inconvenient due to mediocre organization of this sector. It does not offer flexibility to the user i.e. residents are charged a fixed sum of money independently from the real amount of consumed energy. The CHAPTER 1. STATE OF THE ART 15

Figure 1.2: A private generator providing electricity for a neighborhood at a residential area in Lebanon [28]

resulting fees are highly influenced by the fuel prices and the number of blackout hours. The Lebanese municipalities have recently started publishing monthly fixed tariffs relative to each subscription in order to try to contain the chaos and the varying prices between different regions of the country. The power outages problem is strongly influenced by the severe economic and political con- straints in the country. A search for new clean and affordable energy sources is required due to the growing demand of energy, the lack of fossil fuels in power plants and the enormous amount

of CO2 generated on one hand, and the major disadvantages involved in the use of DG to ensure the share of energy deficit on the other. Currently, high hopes are being associated with the possibility of supplying the oil and gas needs from natural reserves in the Lebanese territories. These assumptions are based on some reports that have shown the existence of oil in the northern offshore area [35]. Roudi Baroudi, a leading energy expert states that Lebanon disposes of a natural gas reserve of 122 trillion cubic feet which is almost three times bigger than Libya’s gas reserve [36]. Despite all the confirming theories about the existence of natural gas and oil reserves, the accomplishment of large scale projects faces great barriers as political feuds and the extreme financial requirements for the extraction process. On the other hand, assuming these reserves are commercial, most estimates suggest that it would still take 8 to 10 years to realize gas supply to Lebanon’s power sector [30]. Additionally, today’s energy supply does not consist of only providing electrical power, but also 16 CHAPTER 1. STATE OF THE ART

taking into consideration the serious damage caused to the environment by conventional power stations around the world.

1.2.2 Renewable energy systems in Lebanon

Following what was stated, the concern of providing the users with electrical energy through- out the day under all circumstances takes over the need for reducing greenhouse gases emissions. Fortunately, the use of RES allows the society to meet both goals due to their ability to provide a good amount of clean energy given the suitable Lebanese climate conditions. Consequently, the focus is on finding alternative energy production sources to be used during grid blackouts mainly in the residential sector which consumes nearly 30% of the generated and purchased energy in Lebanon [29]. While this sector is not a major greenhouse gas producer compared to the industries and transportation sectors [37], the reduction of the amount of pollution resulting from alternative energy sources to fill the deficit is still an important matter. Lebanon is a Mediterranean country having a total surface of 10,452 km2. Around 4 million people are perma- nent residents most of whom are settled in urban cities. Lebanon is subject to a Mediterranean climate, offering wet but moderate winters with some exceptions, hot summers and moderate spring and autumn weather. Resulting in nearly 300 sunny days, which makes it interesting to explore this abundantly available resource. Three official reform plans have been developed by the Ministry of Energy and Water since 2006 to the end of integrating the renewable energy resources in the power production process, but due to political reasons, none were properly implemented. The most interesting resources to explore in Lebanon are the solar thermal and PV, wind and hydro power. Nowadays, only hydro power is used to assist conventional thermal power stations, although solar radiation and wind are also abundantly available. The wind Atlas of Lebanon estimated a wind potential of at least 1,500 MW [38]. Lebanon is a country fortunate enough to have a very high amount of sunny hours, even during winter days, with a daily average solar insolation of 4.8 kWh/m2 [39]. Solar power can also be used for water heating purposes, but despite the successful installations of solar water heaters in Lebanon, their installation rate remains very low, reaching only 3% of the overall water heaters in the country by the year 2009 [40]. A PV grid backup system appears to be an acceptable solution worthy of studying. This latter is not popular among Lebanese people due to the high initial cost of such systems compared to the methods installed nowadays. Furthermore, no formal commitment has yet been made to promote the integration of RES in the energy production systems, and the absence of serious policies and academic research to show the benefits of such modern technologies play a vital role in eliminating the consideration of this solution. Some attempts to promote such systems were made mainly by The Lebanese Central Bank that has permitted commercial banks to use a CHAPTER 1. STATE OF THE ART 17

part of their deposited reserve funds at a zero percent interest rate for certain specified purposes as green energy projects [41]. Several efforts are being put by governmental institutions in order to promote PV systems in Lebanon i.e. a governmental program to provide discounted loans for the construction of decentralized PV systems at an interest rate of 0.6% and a repayment period of up to 14 years was established [42]. However, to this day, the amount of installed PV systems is still very low.

1.2.3 Lebanon’s energy status compared to other developing countries

It has become obvious that the Lebanese energy crisis goes beyond the protection of the environment. New power alternatives should be provided in order to fill the deficit of power generation. Despite the fact that Lebanon is rich in RE resources, policy makers are not harnessing this great potential appropriately. While countries rich in oil and gas are resorting to new clean energy production systems, ambitious projects like those proposed by the UAE [43, 44], Saudi Arabia [45, 46] and Algeria [47] are out of Lebanon’s reach due to several factors: • First, Lebanon is already suffering from a huge public dept and limited financial capabil- ities, and thus does not possess matching financial means to those of the UAE and the KSA. • Second, no serious coordination and partnership plans with wealthier nations have yet taken place in order to boost the RE sector in Lebanon as is the case in Algeria [48] and Morocco [49]. • Third, Lebanon lacks wide areas present in the African and Saudi Arabian Saharas, therefore installing space consuming RE production plants is complicated regarding space availability. • Fourth, territories in Lebanon fall under political considerations, so installing renewable energy plants might cause feuds and conflicts and fail to serve their initial purpose. Consequently, the focus in this study is shifted to individual standalone PV-Battery backup system that operates in conjunction with the grid. Lebanon differs from several developing countries regarding the standard of living. Unlike Nepal, India, Indonesia and others, extremely small PV applications as proposed in Ref. [17, 50, 51] are completely irrelevant to the Lebanese case. The solutions applied in other countries and considered successful, as in Bangladesh [52], cannot be generalized and are not fit to solve the Lebanese energy crisis. In other words, the efficiency of such systems and their reasonable price in extremely low consumption profiles is inarguable because a very small amount of components is needed and therefore less replacements, which will surely result in low prices despite the consideration of PV installations as an expensive technology. However, challenges arise with increasing standard of living levels along with the high increase in the electrical energy demand. 18 CHAPTER 1. STATE OF THE ART

A thorough analysis of PV-based systems needs to be established in order to accurately evaluate the feasibility and affordability of the solution as well as its fitness to the case study.

1.3 Literature review of the backup system configurations and sizing optimization

In the wake of the growing environmental concerns, the energy production sector is urged to remove diesel based techniques and to rely instead on renewable energy resources for the electricity production process. Despite the various economical and environmental disadvantages of the DG, they are still being integrated in hybridized systems involving renewable energy technologies [2, 3, 53]. For instance, Ref. [54] proposes to install grid connected PV systems instead of diesel power plants in order to supplement the shortcomings of the hydro energy production in Uganda. The study vouches for this solution and claims that it will help achieve lower energy costs in the future. The authors extended their research in order to incorporate the grid energy blackouts that occur frequently in Uganda [55]. A diesel based backup system was found to be the cheapest solution, although with the continuous decrease of the prices of the PV panels, a hybrid diesel solar solution is suggested to be considered. A hybrid PV-Battery-DG system is considered in Ref. [56] as well in order to supply electricity to 91 households in a village having a total population of 538 people out of which 90% live without electrical power and depend on kerosene oil for lighting. The considered load consists of three Compact Fluorescent Lamps (CFL) of 15 W each, and two electric fans of 40 Watts for each household. Twenty CFL bulbs of 20 W are used for street lighting. The total load reaches nearly 11.5 kW during summer months, which is the highest load profile of the year. Average daily demand peaks during summer to a 206 kWh/day consumption. An optimization problem is formulated in order to determine the sizes of each component and aiming at reducing the

life cycle cost and CO2 emissions from the system. In case of low solar radiation and SOC of the batteries, the diesel generator supplies the load. The optimal configuration, found by the

optimization process, reduces the life cycle cost of the system by 40% and CO2 emissions by 78% when compared to standalone DG. Other configurations rely on feeding the considered loads solely through RET coupled with batteries for the energy storage process. Thus dropping the DG as the alternative power source to the grid power when no connection to it is available. Standalone PV systems in developing countries are mainly proposed in order to feed very low load demands. The common off grid residential PV sizing problems usually consider low consumption profiles by excluding high energy consuming devices or by assessing low standard of living case studies [57–59]. For instance, a 170 W maximum load consumption profile is applied in Ref. [60] in order to conduct a sizing procedure of a standalone PV and battery storage system according to the Indian weather CHAPTER 1. STATE OF THE ART 19

conditions. While this study might be helpful in providing electricity at relatively low prices to poor regions in India, it is irrelevant in the case of a reasonable residential load in regions having a higher standard of living. The same thing applies to Malaysia where small systems are being proposed with extremely low load profiles for remote areas [61]. A typical residential load in a rural west southern town in Algeria is considered to be fed using solar PV technology and battery backup system as a substitution of DG [62]. A technical and economic analysis was done given an 8,000 kWh annual average electricity demand, including air conditioning during hot summer days between June and September, and having a 5.1 kW daily peak load. HOMER software [63] was used in order to find the optimal number of components to be installed that would reduce the overall cost of the system and limits carbon emissions. Sunshine hours range between 10 and 13.3 h/day, averaging 10.9 h/day. Results show that 6 kW of equivalent PV power is needed along with 2 inverters of 4 kW and 14 batteries with an estimated total cost of 74,572 $ in 25 years, as well as approximately 11 tons/year of the carbon emissions can be avoided for the individual house. The optimal solution provides 37.5 h of autonomy to the house. While numerous hybrid PV-Battery systems exist, they are mainly operated in the classic stan- dalone or on-grid mode. However, to the best of our knowledge, the literature lacks detailed assessment of hybrid PV-Battery systems that operate in conjunction with the grid. Such studies will have to ensure a high degree of coordination between all the components of the PV-based system. Ref. [64] presents a hybrid battery charging algorithm coupling both the PV panels and the utility grid. The study manages to implement the charging algorithm, achieving the coordination between the PV panels and the grid for a reliable charging algorithm. Nevertheless, the effect of the load to be fed from the system was not assessed. Furthermore, no technical limitations for the charging process were introduced e.g. the avoidance of triggering the main breaker and the maximum power allowable to be extracted from the grid in coordination with the load demand. Several sizing algorithms were applied in the literature as numerical, analytical and optimization methods or by the help of commercial softwares that integrate heuristic methods [65]. Evolution- ary Algorithms (EA) such as Single Objective Genetic Algorithm (SOGA) and multi-objective GAs have been showing great performance [66–68]. Ref. [69] compares the performance of the GA with the linear programming and proves that the former technique has a better performance than the latter. Additionally, Ref. [70] states that using GAs and Particle Swarm Optimization (PSO) are the most suitable optimization techniques to be applied while designing hybrid re- newable energy systems. Non evolutionary optimization methods were also applied in such problems; Ref. [71] compares the Lagrangian Optimization and the GA and concludes that GAs are better in finding the optimal solution. EA are used for solving problems with both discrete and continuous variables have proven to be very efficient. EA, as GAs and PSO, offer a number 20 CHAPTER 1. STATE OF THE ART

of exclusive advantages: robust and reliable performance, global search capability, little or no information requirement and good computation time. Compared to conventional optimization methods, EA showed higher robustness and less computational effort when solving non linear optimization problems.

1.4 Demand Side Management and hardware implementa- tion Literature review

With the ongoing development of smart grid concepts and sustainable energy technologies, DSM studies for residential applications have been emerging rapidly. This is due to the contin- uously increasing energy consumption and prices, along with the growing concerns about the environmental impact of the energy demand and its sway on the population’s comfort levels [72]. Furthermore, DSM programs are increasingly embraced due to the high integration rate of renewable energy technologies for they have been proven to contribute to an overall sizing reduction of standalone PV systems [73, 74] and consequently to great price reductions and lower payback periods of such systems. The concept of load management consists in modifying the load profile of a residence in a way that serves best the objectives of the study. The DSM problem was treated differently in the literature according to the installed system, available resources, and main objectives. The most popular management objectives tackle the issue of energy price reduction and peak load shaving procedures while maintaining high comfort levels to the users [75, 76]. The main difference between the various studies lies in the system structure and the techniques used to solve the problem. The control complexity increases with the number of involved components in the application. Topologies vary from relying solely on the grid, to more complicated installations involving renewable energy resources and energy storage devices. Load management programs have been applied to residential applications where the grid is the only energy supply source [77–80]. In Ref. [77] the load management is formulated as a Multi-Objective Optimization (MOO) problem aiming at reducing the energy purchase cost and the discomfort levels. A customised Non-Dominated Sorting GA (NSGA-II) was applied to find the optimal solution. A Mixed Integer Non linear Programming (MINLP) optimization under time of use electricity prices and considering offered incentives to the user is applied in [78]. The main inconvenience of the algorithm is that it does not offer great flexibility to the user who has a restrictive choice to only favor his own convenience over the price reduction or vice versa. Other studies consider the same system topology, but focus on a single load: for instance the HVAC [80, 81] or water heaters [82]. More complicated installations consider the addition of energy storage techniques but have the same goal of reducing the energy bill [83]. Adding PV panels to the mix introduces other challenges to the management process. Researches CHAPTER 1. STATE OF THE ART 21

as in [84, 85] achieve a good coordination between the grid energy, PV power production, and the battery storage system, but exclude the energy demand. Other system configurations consist of applying DSM to standalone PV-battery systems. In [86] the initial economy of the homeowner in a developing country is taken into account. The study applies a load management program to reduce peak loads and therefore reduce the sizing of the inverter to match the capabilities of a medium income customer. The standalone PV system is extended in [87] in order to integrate the buying/selling electricity process from the grid. The developed scheduling aims at minimizing the energy costs and reducing the inconvenience of electrical and thermal loads to the users. Ref. [88] proposes a home energy management system to reduce peak energy demands and increase the efficiency of the system including energy storage units. Predetermined load al- location strategies are defined and the most suitable is chosen according to real time energy prices and priority levels. Indeed, the load priority criterion has received notable attention due to its direct impact on the users’ comfort levels as was the focus in Ref. [89, 90]. For instance, Ref. [89] emphasizes on the priority assignment of the controllable residential loads in order to find a good load operation schedule to be applied during the next day. However unpredictable loads, such as the microwave, iron, vacuum cleaner etc., were not taken into consideration in the previously mentioned studies and were assumed to be uncontrollable. Most Home Energy Management System (HEMS) have been implemented by linking smart appliances to a central PC [91–93] or by installing complete solutions developed by specific cor- porations and manufacturers [94, 95] which will render every addition to the system restrictive to their products. Ref. [96] implements a control of a portable air conditioning unit on a laptop by commanding the thermostat over the internet. The developed HEMS controls only high energy consuming loads and does not control plug loads. A test bench is developed in Ref. [97] in order to implement a DSM program considering three implementation layers. The first consists of the installed loads, which are connected to a home gateway through z-wave smart plugs. These latter are able to implement the control as well as send operation data for analysis and storage. The home gateway is implemented using a Raspberry pi (Model B Rev1). The acquired data is stored on a cloud server grouping all the data base for the energy management system. This latter is operated on the personal PC of the user, and the optimization is done under MATLAB software in order to send the control commands.

Conclusion

This chapter has presented a state of the art of various topics related to the energy crisis in several developing countries and the proposed means to cope with this problem. The integration status of the PV technology in these countries is highlighted and the impact of various socio- economical and political aspects on the implementation of RES is assessed. First, The literature 22 CHAPTER 1. STATE OF THE ART

review emphasizes on countries suffering from rolling grid energy blackouts and which struggle to ensure the total electrical load demand of their nations. The main issues preventing the development and implementation of renewable energy projects are identified as the lack of clear policies and legal frameworks set by governments to organize this new sector, extremely complicated political issues and conflicts, limited information on resource base and, usually, limited financial means. Second, a detailed review of the Lebanese energy status is presented and the main reasons causing the frequent and regular power shortages in Lebanon are explained. Furthermore, the integration of RET in the energy production mix is featured and a comparison of the Lebanese case to other developing countries is established. A detailed review on the integration of photovoltaic renewable energy in developing countries is done in Ref. [98]. The paper browses through the small, medium and large scale applied and targeted projects in various developing countries. Third, backup system configurations are reviewed. The benefit of including the PV technology is highlighted, and sizing optimization methods of hybrid PV-based systems are browsed. Finally, various load management programs are reviewed according to the applied system configuration and the complexity of each of the case studies. Additionally, the most popular implementation techniques of the DSM programs are presented. Chapter 2

Modeling of the PV-Battery system compo- nents and Energy Flow

Contents 2.1 PV energy production modeling ...... 24 2.2 Grid energy modeling ...... 25 2.3 Battery bank State Of Charge (SOC) modeling ...... 26 2.4 Energy Flow modeling ...... 27 2.5 Residential Loads modeling ...... 28 2.5.1 Washing Machine (WM) model ...... 29 2.5.2 Water Heater Models ...... 30 2.5.3 Heating, Ventilation and Air Conditioning (HVAC) model ...... 36

Accurate and reliable mathematical models of the various components installed in the PV- Battery backup system are developed in order to establish a robust energy forecasting process. This latter is key to: • The analysis of several aspects of the proposed system as the determination of the optimal system configuration to be applied. • The accurate cost estimation process of the PV-Battery system. • The choice of the optimal water heating technique to be installed with the proposed backup. • The validation of the proper operation of the system as well as its suitability for the case study. • The development of a well performing DSM program for the operation optimization of the backup system. The developed models of the system components should be accurate and reliable. However, they should not result in a high computational effort especially for the DSM process due

23 CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND 24 ENERGY FLOW to memory and computational time limitations coupled with the hardware implementation procedure. Therefore, a compromise has to be made between the reliability and accuracy of the model on one hand, and the computation time and needed memory resources on the other, since the more complicated the model is, the more challenging and time consuming the implementation will be. An Energy Flow (EF) approach is considered for the modeling process of the components of the system with a step period (k) of 1 hour. Each device is characterized by its energy production/consumption pattern. The developed mathematical models include: the PV panels, the SOC of the battery bank, the amount of energy extracted from the grid, various water heating techniques, the HVAC and other home appliances. The EF between the various elements of the PV-Battery backup system is then established. Fig. 2.1 plots the three main operation scenarios and the EF in the PV-battery backup system.

Scenario I Grid off & E > E Grid Scenario II EPV-AC < EL Grid off & PV-AC L OFF ON OFF ON OFF ON Scenario III Grid on

E P AC bus - House G-AC max

E E E PV-AC Batt-AC AC-L E PV-Inv Inverter/ Charger

E PV G-Batt E PV-Batt Battery Charge Bank E Controller House Load ( L) Figure 2.1: EF in the PV-battery backup system

2.1 PV energy production modeling

The amount of energy produced by the PV panels is determined by developing a mathematical model of the PV array allowing the determination of the extracted electrical energy as a function of the solar radiation and the ambient air temperature. Monocrystalline silicon solar panels are considered, a single diode PV cell model is used, and a serial resistance is added to take into account the losses inside the cell. The set of mathematical equations and considered assumptions are explained in Appendix A. The parameters of the considered PV panels as provided by the manufacturer are shown in Table 2.1. After determining the parameters to complete the PV cell model, the energy provided by the PV module is computed. The maximum power provided by CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND ENERGY FLOW 25

Table 2.1: PV panel parameters provided by the manufacturer

Param Pmpp(W) Imp,re f (A) vmp,re f (V) Isc,re f (A) voc,re f (V) KI(%/°C) Kv(%/°C) Value 185 5.09 36.4 5.43 45 0.037 -0.34

the PV array (Pmp) can be expressed as shown in Eq. (2.1) [69].

Pmp = vmp.Imp = FF.voc.Isc.nPV (2.1)

FF represents the Fill Factor, which is directly proportional to the power conversion efficiency of a solar cell. The index 0 represents an ideal solar cell for which the empirical approximation of the fill factor and the open circuit voltage can be computed as follows [99, 100]:

voc0 − ln(voc,0 + 0.72) FF0 = (2.2) voc,0 + 1 q.voc voc,0 = (2.3) Nsm.n.K.θc

voc and Isc are computed as in the following equations:

voc = voc,re f − Kvθc (2.4) G I = [I + K (θ − 25)] × s (2.5) sc sc,re f I c 1000

With voc,re f the open circuit voltage at Standard Test Conditions (STC) and Kv the cell’s open circuit voltage temperature coefficient. The fill factor can be expressed as in Eq. (2.6) [99, 101].

FF = FF0(1 − rs) (2.6) rs=(RsmIsc)/voc : The normalized serial resistance. Pmp is computed at each step period k, during which it remains constant. Therefore the energy produced by the PV panels at each step period k = 1h is:

EPV,k = ηpc × Pmp,k (2.7)

With ηpc the power conditioning factor which is equal to 1 when operating at the maximum power point.

2.2 Grid energy modeling

When the grid power is available, it supplies the total load demand of the house. The remaining allowable energy to be extracted can be used to charge the batteries to their maximum

capacity Eb,max depending on the PV power generation. When the total amount of energy to fill CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND 26 ENERGY FLOW

the battery bank can be supplied by the grid, EG−AC,k is computed as in Eq. (2.8).

EG−AC,k = EL,k + [Eb,max − (Eb,k−1 × (1 − σ) + EPV−Batt,k × ηbat)] (2.8)

σ and ηbat are the self discharging rate and the charging efficiency of the batteries respectively. When the battery bank cannot be filled from the grid due to the maximum current constraint,

EG−AC,k is computed as in Eq. (2.9).

EG−AC,k = EL,k + EGc,k − EPV,k × ηbat (2.9)

EGc,k represents the maximum amount of energy allowed to be extracted from the grid for the battery charging process during the step period k.

2.3 Battery bank State Of Charge (SOC) modeling

Lead acid batteries are installed with the proposed PV-Battery backup system. Ideally, the Depth Of Discharge (DOD) of the battery bank should be set to a value between 30% - 50% for

a maximum battery lifetime. The amount of energy stored in the batteries varies between Eb,min and Eb,max, where: Eb,min = (1 − DOD) × Eb,max

The parameter values of the installed battery bank are shown in Table 2.2.

Table 2.2: Backup system components parameters

Parameter ηpc (%) σ (%/month) ηbat (%) ηinv (%) DOD (%) value 75 15 70 95 50

Assuming a discharge efficiency of 1, the amount of energy stored in the battery bank at each sampling period k during blackout and non blackout hours is given by Eqs. (2.10) and (2.11) respectively. Eb,k = Eb,k−1(1 − σ) + EPV−Batt,k × e   EAC−L,k (2.10) = Eb,k−1(1 − σ) + EPV,k − × e ηinv

Eb,k = Eb,k−1(1 − σ) + [EPV−Batt,k + EG−Batt,k]ηbat (2.11)  ηbat if the batteries are charging  e = 1 if the batteries are discharging  0 if neither CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND ENERGY FLOW 27

Eb,k−1 being the amount of energy stored in the batteries at step period (k − 1) and EPV,k the amount of energy produced by the PV panels at step period k. The SOC at each step period k can then be expressed in (%) as in Eq. (2.12).

Eb,k SOCk = × 100 (2.12) Eb,max

2.4 Energy Flow modeling

There are two main operation modes of the considered PV-Battery backup system: when the grid power is available, and when it is not. During a blackout period, the system operates as a standalone PV-battery system and all the grid related EF terms are set to zero:

EG−AC = EG−Batt = 0

When the energy produced by the PV panels (EPV ) exceeds the load demand (Scenario I), the EF at each step period k is described by Eqs. (2.13–2.16).

EL,k EPV−Inv,k = (2.13) ηinv

EPV−Batt,k = EPV,k − EPV−Inv,k (2.14)

EAC−L,k = EPV−AC,k = EPV−Inv,k.ηinv (2.15)

EBatt−AC,k = 0 (2.16)

When the load demand exceeds EPV (Scenario II), the EF at each step period k is computed as in Eqs. (2.17–2.20).

EPV−Inv,k = EPV,k (2.17)

EBatt−AC,k = EL,k − EPV−Inv,k.ηinv (2.18)

EAC−L,k = EPV−AC,k + EBatt−AC,k = EPV−Inv,k.ηinv + EBatt−AC,k (2.19)

EPV−Batt,k = 0 (2.20)

When the primary energy source is available (Scenario III), the PV panels and battery bank do not intervene in feeding the load, which results in:

EPV−AC = EBatt−AC = 0

The grid will help charge the battery bank if needed. This process is done by respecting the realistic constraints: the maximum charging current provided by the charger, the maximum CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND 28 ENERGY FLOW

allowable current to be injected in the battery bank ichrmax, and Pmax. The EF in the system is then computed at each step period k as in Eqs. (2.21–2.24).

EPV−Batt,k = EPV,k (2.21)

EG−Batt,k = EGc,k (2.22)

EAC−L,k = EL,k (2.23)

EG−AC,k = EAC−L,k + EG−Batt,k.ηinv (2.24)

The limitation of the DC battery charging current (ichset) is usually set to 12% of the 20 h Amp-hour capacity of the lead acid batteries. Therefore, the DC provided to the battery bank

during the charging process from the grid can not surpass the ichset threshold. EGc is then computed at each step period k as shown in Eqs. (2.25–2.27).

(Pmax − PL,k)ηinv ichr,k = (2.25) nbatvbat  ichr,k if ichr,k < ichset  ichrmax,k = (2.26)  ichset if ichr,k ≥ ichset    EGc,k = min Eb,max − Eb,k−1.(1 − σ) − EPV−Batt,k ichrmax,kvbatnbat/ηinv (2.27)

th With ichr,k(A) the electrical current extracted from the charger at the k step period. At each step period, ichr,k is determined and compared to ichset as shown in Eqs. (2.25) and (2.26) to the end of computing ichrmax,k.

2.5 Residential Loads modeling

The electricity demand of the house is key to the computation of the EF in the PV-Battery backup system. Consequently, it has a great impact on the sizing optimization of the installation and the resulting cost of the overall system. The energy consumption profile of each device is determined according to the various applied conditions in order to compute the total load demand of the house. Furthermore, mathematical models of some of the controllable high energy consuming devices are mandatory in order to implement a well performing and reliable DSM program for a residential application. First, a base load is defined grouping all the crucial devices that should be always supplied with electricity. End-user services as the lighting, multipurpose sockets, and others, represent essential devices that need to be operated whenever required. The detailed energy CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND ENERGY FLOW 29

consumption is determined following an energy audit procedure to a typical house matching the considered case study. The total amount of electrical energy consumed by the residential loads at each step period k

(EL,k) can then be computed as in Eq. (2.28):

EL,k = EL−BL,k + EL−WM,k + EL−WH,k + EL−HVAC,k (2.28)

With EL−BL, EL−WM, EL−WH, and EL−HVAC the amounts of energy extracted by the base load, the Washing Machine (WM), the water heater and the Heating, Ventilation, and Air Conditioning (HVAC) system respectively.

2.5.1 Washing Machine (WM) model

The considered WM process is divided into 3 uninterruptible states [102], each having its own power consumption and operation duration as shown in Fig. 2.2.

ON 45 minWashing 60 min Spin-drying Water Heating Standby State State State State 500 W 1000 W 2400 W

15 min Figure 2.2: Clothes washing cycle

The washing cycles should operate continuously until the task is completed. The first water heating state is the most power consuming and lasts for 45 min, followed by 60 min of washing then 15 min of spin-drying. A full clothes washing process is represented in Fig. 2.3, where t(WM1), t(WM2), and t(WM3) represent the activation time of the first, second, and third operation states of the washing process respectively.

45 min 60 min 15 min

State 1 State 2 State 3

k k+1 k+2 t(WM ) t WM t(WM ) 1 ( 2) 3 Figure 2.3: Example of a full clothes washing cycle

The energy consumption profile of the WM (EL−WM) corresponding to the example presented in CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND 30 ENERGY FLOW

Fig. 2.3 is then determined as in Eqs. (2.29–2.31).

t(WM ) −t(WM ) (k + 1) × 60 −t(WM ) E = 2 1 × 2400 + 2 × 500 (2.29) L−WM,k 60 60 t(WM ) − (k + 1) × 60 (k + 2) × 60 −t(WM ) E = 3 × 500 + 3 × 1000 (2.30) L−WM,k+1 60 60 t(WM ) + 15 − (k + 2) × 60 E = 3 × 1000 (2.31) L−WM,k+2 60

2.5.2 Water Heater Models

Mathematical models of the water heaters serve as good trackers of the variation of the water temperature inside the water tank throughout the day under various testing conditions. The amount of energy consumption for the water heating process can be determined according to the

applied water heating method and its control technique by tracking the variation of θH. Water heaters are usually controlled by the variation of their reference temperature around which the temperature inside the water tank should be kept. Globally, they can be treated as an energy storage device. This is due to the fact that the energy consumption resulting from the water heating process is highly dependent on the preset reference temperature [103] which renders the water heating process a very good candidate for the DSM and operation optimization of the PV-Battery backup system. Developing an accurate estimation of the energy consumption of the water heater is a must for a reliable EF modeling and a robust load control process. Water heater mathematical models range from simple heat exchange equations based on simplifying assump- tions, to very complex thermal models including non linear equations with a high amount of variables. They have been widely applied especially for load management programs [104, 105]. The developed models should be accurate yet simple i.e. requiring a low computation time and reduced memory consumption. Complicated models that consume memory space and time should be avoided for the prediction process as for the DSM. Several water heating configurations involving traditional as well as renewable energy tech- nologies are considered. Combinations of the main water heating techniques are applied in the study: the classic electric water heater, the hybrid solar electric water heater, the boiler water heater, and the hybrid solar boiler water heater. Although boilers do not fall into the category of renewable and clean energy, such systems have to be considered in the study due to their popularity. The consideration of environmental consequences of the used techniques becomes secondary in countries where electrical energy is not provided permanently to the users. As a result, Boiler Water Heaters (BWH) cannot be ignored despite their use of fuel oil. The installed boiler serves two main purposes; the space heating during the winter season as well as the water heating. The various water heating configurations are jointly represented in Fig. 2.4. CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND ENERGY FLOW 31

Water Tank Expansion W d Solar collectors Tank Q EWH

Circulation pump Qf SWH for heating fluid Hot water for Q domestic use boiler BWH

Water supply for domestic use

Radiator Radiator Boiler

Oil Circulation Tank Pump for boiler

Figure 2.4: Residential water heating systems

Q, Q f , and Qboiler represent the amount of heat provided to the water inside the tank by the EWH, SWH, and BWH respectively. The EWH is the most straightforward water heating technique. It is widely popular and easily installed with a very low capital and installation cost. However, it results in a very high electrical energy consumption. On the other hand, SWHs require a greater budget for the material purchase as well as the installation fees. Despite that fact, they are gaining popularity by the day due to their good efficiency, good payback period and high suitability in countries were abundant sunshine is available [106–108]. Their greatest drawback is the high uncertainty level coupled with the solar insolation levels. The SWH cannot be installed without a water heating backup technique in order to provide hot water for domestic usage during cloudy days. Two backup techniques are considered for the study. First, an electric resistance can be installed along with the SWH resulting in a hybrid SEWH configuration. Second, the existing boiler operated for the space heating can be linked to the water tank through a heat exchanger which will allow it to heat the water for domestic use. It should be noted that the SWH and BWH require the installation of circulation pumps for circulating the heating fluid and the boiler water respectively inside the pipes. Consequently, additional electrical energy consumption for the operation of the installed circulation pumps should be added to the load profile of the house whenever these configurations are applied. CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND 32 ENERGY FLOW

2.5.2.1 Electric Water Heater (EWH)

A predictive water heater model can be developed by modeling the major thermal events that occur during the water heating process. By using predefined data as the hot water draw

profile (Wd) and the heat provided by the electric resistance (Q), one can predict the operation of the EWH and consequently track the variation of the water temperature inside the tank (θH) during any time of the day. Eq. (2.32) shows the dynamic variation of the temperature inside the water tank [105, 109, 110]. It assumes a constant ambient temperature (θa) and a uniform water temperature inside the tank. The full parameter definitions can be found in the water heater parameters section of the Nomenclature (Go to page xxiii).

dθH(t)   C = U(t).S. θa − θH(t) +Wd(t).ρ.Cp. θin − θH(t) + Q(t) (2.32) dt | {z } | {z } |{z} Losses to the ambient Inlet water heat gain Heat provided by the EWH

The left side of the Eq. (2.32) represents the variation of the water temperature inside the tank, whereas the components of the right side represent respectively the losses to the ambient, the inlet water heat gain, and the input heat provided by the electric resistance. Eq. (2.32) can be reformulated as follows:

dθH(t) 1 0 0 0 = [R .θa.L(t) + R .B(t).θin − θH(t) + R .Q(t)] (2.33) dt τ 1 L(t) = U(t).S; B(t) = ρ.C .W (t); R0 = ; τ = R0.C (2.34) p d L + B

Eq. (2.33) is very useful in order to show the time constant τ of the temperature variation. τ determines the dynamic behavior of the system which clearly depends on the hot water consumption profile. The ambient air temperature has always been considered as a constant in the literature with no proper justification of its real impact on the hot water temperature. In order to assess the impact

of θa on θH, Q is set to zero and the Laplace transform is applied to Eq. (2.33) which leads to Eq. (2.35): L.θa(s) +Cp.Wd.θin θH(s) = (2.35) (Cp.Wd + L)(1 + τ.s) By applying the final value theorem to Eq. (2.35), Eq. (2.36) is obtained:

L.K lim sθH(s) = fv = (2.36) s→0 Wd.Cp + L

Eq. (2.36) represents the final value of θH (fv) when Q = 0 , with K the final value of the step input θa. CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND ENERGY FLOW 33

25

20

15 fv 10

5

0 0 20 40 60 80 100 120 140 160 180 200 Wd(L/h)

(a) Final value of θH in terms of Wd and θa (b) Variation of fv in terms of Wd for a fixed θa=24°C

1

0.8

0.6 fv 0.4

0.2

0 0 5 10 15 20 25 30 35 40 θ (°C) a

(c) Variation of the hot water final value for a fixed Wd=65 L/h; τ= 30h

Figure 2.5: Assessment of the impact of θa on the final value of θH for the EWH model

Fig. 2.5a shows how fv varies with Wd and θa. It is clear that for very low values of Wd, θa has a great impact on θH but this influence takes hours to occur due to the high resulting response times. Fig. 2.5b shows the variation of the hot water temperature as a function of the amount of hot water draw considering a 24°C ambient temperature and a turned off heating resistance. Results show that an increasing hot water draw will lower the fv to be reached. Furthermore,

the highest influence of Wd occurs in the range of 0-60 L/h which is the most realistic hourly hot water consumption range for residential applications [111, 112]. Fig. 2.5b proves that

Wd plays a vital role in determining the fv to be reached in addition to its high impact on τ, unlike θa. This contrast is shown in Fig. 2.5c. A variation of 10°C of θa will only induce a maximum addition of 0.3°C to θH, keeping in mind that this amount will be reached after nearly 30 hours. Therefore, the assumption of a constant θa is justified and will not alter the simulation results. Furthermore, it allows the reduction of the memory space needed to input the ambient temperature data, in addition to the avoidance of a non linear thermal equation that would complicate the discretization process required for the DSM program. In order to integrate the SEWH in the EF model, a fixed step discretized model is needed. To that purpose, the Tustin transform shown in Eq. (2.37) is applied in order to switch from a Laplace

representation to a discrete one (Eq. (2.38)). A sampling period (Ts) of 1 min is considered. CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND 34 ENERGY FLOW

2 1 − z−1 s −→ −1 (2.37) Ts 1 + z 1 0 0 0 θH,k = [(2τ − Ts)θH,k−1 + 2TsR θaG + 2R TsθinB + 2TsR Q] (2.38) 2τ + Ts

The rated power consumption of the installed electrical resistance (PR) is set to 2 kW and is controlled using a hysteresis control technique which aims at keeping the hot water temperature around the set reference point. Accordingly, the amount of electric power and energy consumed by the electric water heating process during its operation is added to the load profile of the house at each step period k as shown in Eq. (2.39):

k+1 Ts EL−WH,k = ∑ PR × (2.39) k 60

2.5.2.2 Solar Electric Water Heater (SEWH)

Installing a Solar Water Heater with a backup electric resistance is a popular water heating technique among countries that benefit from a high amount of solar insolation. There are various types of solar collectors and solar water heating systems that operate differently. In this study, an active-indirect solar domestic water heater is considered, in which the water inside the tank is heated indirectly through a fluid that is pumped and not circulating naturally as shown in Fig. 2.4. The received solar radiation by the collectors heats the circulating fluid inside them. The hot fluid then passes through a heat exchanger in the bottom of the water tank and heats the water, loosing its stored heat in the process. The cooled down fluid is pumped again through the pipes in the solar panels in order to collect the heat provided by the solar rays. An EWH placed

at the top of the water tank is used to raise θH to its required level whenever the sun was not able to provide the needed amount of heat. Including the efficiency of every component in the SWH model as done in Ref. [113] serves well for development and operation optimization purposes of the water heater. However, simpler and less cumbersome models are sought when considering a load forecasting process. Consequently, the efficiency factors of the components of the hybrid water heating system are combined in a single coefficient representing the efficiency of the solar collectors (α), including the heat and conduction losses. The EWH model is extended in order to incorporate the amount of heat collected by the solar panels and exchanged with the water inside the tank through the heating fluid. The operation of CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND ENERGY FLOW 35

the SEWH is described in Eqs. (2.40) and (2.41).

dθ (t) C H = U(t).S.θ − θ (t) +W (t).ρ.C .θ − θ (t) + Q(t) + Q (t) (2.40) dt a H d p in H f dθ f (t) Cf = Qs − Q f = α.Qts.A−m˙ f Cp f [θ f (t) − θH(t)] (2.41) dt | {z } | {z } Qs Q f

The electric backup resistance installed (PR = 2 kW) is controlled using a hysteresis control technique. The aggregated amount of electric power and energy used by the EWH as well as the

circulation pump for the heating fluid (PFP = 500 W) are added to the load profile of the house. To that end, the discretized representation of θH is computed by applying the tustin transform to Eqs. (2.40) and (2.41) as follows:

1 θ f ,k = [(2Cf − m˙ f Cp f Ts)θ f ,k−1 + 2TsQs,k+1 + 2m ˙ f Cp f TsθH,k−1] (2.42) 2Cf + m˙ f Cp f Ts

Q f ,k = m˙ f Cp f [θ f ,k − θH,k−1] (2.43)

1 0 0 0 0 θH,k = [(2τ − Ts)θH,k−1 + 2TsR θaG + 2R TsθinB + 2TsR Q + 2R TsQ f ,k] (2.44) 2τ + Ts

Eq. (2.42) represents the variation of the temperature of the heating fluid at each step period k. The amount of heat provided by the fluid at each step period k to the water inside the tank is

described in Eq. (2.43). The variation of the temperature of θH can then be found as shown in Eq. (2.44). The hysteresis control is applied and accordingly the amount of energy consumed by

the SEWH at each step period is computed as in Eq. (2.45), with Ts = 1 min.

k+1 k+1 Ts Ts EL−WH,k = ∑ PR × + ∑ PFP × (2.45) k 60 k 60 | {z } | {z } EWH SWH pump

2.5.2.3 Boiler Water Heater (BWH)

The BWH system operates as follows: Once the fuel oil is injected in the boiler, the heat resulting from the combustion process is transferred to the closed water loop circulating via a pump in the pipes and the indoor space heating units (the radiators). The hot water cycle used for the heating process is passed through the water tank and consequently the water for domestic use is heated by convection. The system is described in Fig. 2.4. N°2 fuel oil is used for the combustion process. The main purpose is to find the hourly equivalent amount of heat provided

by the boiler (Qboiler) to the water inside the tank in order to replace Q(t) in Eq. (2.32). Qboiler CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND 36 ENERGY FLOW

can be expressed as in Eq. (2.46).

Qboiler = HV × FC × ηboiler (2.46)

HV being the heat value of the fuel oil, FC the amount of fuel consumption of the boiler per

hour and ηboiler the equivalent overall efficiency of the system including the efficiency of the boiler, the pipes, and the convection process. The applied parameters for the BWH are shown in Table 2.3, which will lead to an equivalent heat input of the boiler of 10 kW.

Table 2.3: Boiler water heater parameters

Parameter HV (kJ/L) FC (L/h) ηboiler PBP (W) value 38,000 0.67 0.6 500

The power consumption of the circulation pump (PBP) for the operation of the boiler is added to the power consumption of the house. Accordingly, the amount of electric energy consumed by

the boiler water heating process at each step period k is computed in Eq. (2.47), with Ts = 1 min.

k+1 Ts EL−WH,k = ∑ PBP × (2.47) k 60

The hybrid Solar Boiler Water Heater (SBWH) will operate as the SEWH but the boiler will be

used as the backup heating technique. Q(t) is replaced with Qboiler in Eq. (2.40), and the energy consumption at each step period k is determined as in Eq. (2.48).

k+1 k+1 Ts Ts EL−WH,k = ∑ PBP × + ∑ PFP × (2.48) k 60 k 60 | {z } | {z } BWH pump SWH pump

2.5.3 Heating, Ventilation and Air Conditioning (HVAC) model

Numerous building thermal models are developed in the literature in order to reliably represent the indoor air temperature variation of houses and buildings since they are highly useful for the implementation of robust HVAC control systems. Mathematical models applying modern and evolved techniques as the neural networks, the Space Vector Machine (SVM), Kalman filters and identification methods have been applied in order to describe the heat transfer between the various considered elements of the house [114–117]. A simplified predictive model is needed in this study in order to perform a reliable HVAC DSM process. Thus, a lumped RC model is applied due to its simple structure and computational efficiency [118]. Most simplified building thermal models consist of lumped RC models describing the heat transfer that occur between multiple nodes of the considered house [119]. CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND ENERGY FLOW 37

This method consists in establishing an electrical analogy of the house elements, involving resistances (R) and capacitances (C) representing respectively the thermal resistances and the heat capacities of the considered house zones. Thus, a linear electrical circuit is developed. It involves several simplifying assumptions for a reduced computational effort as the consideration of time invariant parameters and a uniform indoor temperature [120]. A lumped RC model developed in [121] is used in order to simulate the variation of the indoor air temperature of the house. The equivalent electrical circuit of the analogy is shown in Fig. 2.6.

Sensor Interior ACUs Solar Envelope Ambient

θi Rie θe Rea

R R is ih A Ф θ w s Ce AeФs a + Ci - θs θh Фh

Ch Cs

Figure 2.6: HVAC 4-node lumped RC model [121]

The parameters of the thermal-electrical analogy are presented in Table 2.4. A state space model grouping the various first order thermal equations linking the considered nodes is developed. The parameters of the model are modified in order to better suit the considered case study, the optimization study of the equations and parameters of the model is beyond the scope of the presented work. The 4 node lumped RC model considers mainly 6 elements: the outdoor zone ("a" index), the envelope of the house ("e" index), the solar insolation ("s" index), the air conditioning elements ("h" index), the indoor zone ("i" index), and the temperature sensor ("s" index). The 4 considered

nodes correspond to θs, θi, θh, and θe. Four AC units are installed in the house, each having

9000 BTU/h thermal capacity (Cpth) and 800W electrical power consumption (PACU ). The state

Table 2.4: Thermal-Electrical analogy for the lumped RC model development Thermal parameters Electrical parameters Symbol Unit Temperature Voltage source θ °C Heat flux Current source φ kW ; kW/m2 Heat transmission resistance Electrical resistance R °C/kW Thermal capacity Electrical capacity C kWh/°C CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND 38 ENERGY FLOW

space representation of the system is described in Eq. (2.49):

( q˙ = Aq + Bu with [q˙] = [q] = (4 × 1); [A] = (4 × 4); [B] = (4 × 3); [u] = (3 × 1) (2.49) y = Cq with [y] = (1 × 1); [C] = (1 × 4)

  θ      s   φs φs       θi      q =   ; u =   =     φh nbAC × Cpth       θh         θa θa θe

  −1 1   0 0 R C R C  0 0 0  is s is s !     1 −1 1 1 1 1 1      Aw   + +   0 0   RisCi Ci Ris Rih Rie CiRih RieCi   C  A =  ; B =  i   1 −1   1   0 0   0 0   C R C R   C   h ih h ih !  h   1 −1 1 1   Ae 1   0 0 +  0 RieCe Ce Rie Rea Ce CeRea

h i C = 0 1 0 0

Aw and Ae represent respectively the effective area of the windows and the envelope of the considered house. The proposed time-continuous model in Eq. (2.49) is converted to a discretized state space model in order to integrate the HVAC system in the DSM program. The zero order hold discretization

method is applied along with a 5-min sampling period (Ts = 5 min) in order to compromise between the accuracy of the model and the resulting computational effort. The model outputs

the indoor air temperature θi to the end of keeping it around its reference temperature set by the DSM. To that end, a hysteresis control technique is applied. Accordingly, the Air Conditioning Units (ACU) are operated or put on stand-by mode during each sampling period. Consequently, the energy and power consumption of the HVAC system are added to the load profile of the

house depending on the number of operational ACU (nbAC) as done in Eq. (2.50).

T E = nb × P × s (2.50) L−HVAC,k AC ACU 60 CHAPTER 2. MODELING OF THE PV-BATTERY SYSTEM COMPONENTS AND ENERGY FLOW 39

Conclusion

In this chapter, mathematical models of every component of the proposed PV-Battery backup system are presented. An EF approach is considered, thus characterizing every element by its electrical energy production or consumption. The developed models ensure a high level of reliability regarding the EF prediction of the system. Moreover, a good compromise is achieved between the reliability of the estimations on one hand, and the required memory resources and computational effort on the other. The EF in the backup system is modeled according to the various occurring scenarios, depending on the grid status and weather conditions. The developed mathematical representation of the components include the PV panels, the SOC of the batteries, the grid energy, and the load models representing the electricity consumption of the house. The basic energy consumption of the residence is determined following a detailed energy audit of a typical house matching the conditions of the case study. The clothes washing process is modeled considering a three uninterruptible states WM. Moreover, high energy consuming loads as the water heating and HVAC systems are modeled by means of thermal equations and simplifying assumptions for a reduced model complexity. Various water heating configurations are developed for a comparative study regarding the optimal technique to be coupled with the proposed PV-Battery backup system. The hot water temperature is dynamically described as a function of the hot water draw, the ambient air temperature, and various other parameters depending on the considered configuration. Additionally, a 4-node lumped RC model is applied in order to describe the variation of the indoor air temperature, which will lead to the computation of the energy and power consumption profiles of the task. The developed mathematical models are highly beneficial in order to establish a good and genuine system sizing algorithm. They allow the accurate assessment of the operation of the backup system by providing a reliable and generalized EF prediction process. Moreover, these models are generic and can emulate the behavior of the loads under all testing conditions. They are mandatory for the development of a robust and well performing home energy management system aiming at optimizing the operation of the studied PV-Battery system.

Chapter 3

PV-Battery backup sizing optimization

Contents 3.1 Sizing problem formulation and economic evaluation ...... 42 3.2 Sizing optimization procedure ...... 44 3.3 Study on the optimal water heating technique to be coupled with the PV- battery backup system ...... 46 3.4 Sizing optimization results ...... 50 3.4.1 Simulation results under the worst case scenario ...... 52 3.4.2 Simulation results under moderate conditions ...... 54 3.5 PV-Battery backup systems vs. Diesel generators ...... 57

The sizing procedure determines the optimal number of components needed to obtain a low cost yet well performing PV-Battery backup system. The proposed system aims at replacing the utility energy during daily power outage periods. It should be able to provide the inhabitants with the needed power to satisfy the loads during grid blackout periods averaging 8 hours and that can reach 14 hours per day. The number of involved components is computed in order to prevent the occurrence of a Loss of Power Supply (LPS) for a high energy consuming residential application, while respecting the operational constraints of the system. A detailed economic study is conducted in order to find the overall price over the 20-year lifetime of the proposed backup system. When considering such a wide period of time, multiple factors should be included in the study to the end of providing an accurate estimate of the total resulting fees. The mandatory additions include: • The yearly maintenance cost of the various installed components. • The replacement costs of the elements which do not have a 20-year lifetime such as the battery bank. • The inflation and interest rates along with other economical factors which will allow the determination of the present value of the amount of money to be spent during the complete 20-year period.

41 42 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION

• The resulting cost for the battery charging process from the grid. This latter cannot be neglected, otherwise the system will consider that charging the batteries from the primary energy source is free of charge, thus ignoring the PV panels and relying solely on the grid energy. A thorough economic study will establish a detailed assessment of the advantages brought by the proposed PV-battery system compared to other conventional grid backup methods. The proposed backup is compared to the most popular replacement of the national grid during energy cut-off periods i.e. the DG, from an economical, social, environmental and technical perspective. The main concern is ensuring a high autonomy level of the backup system, thus providing permanent electricity supply to the house at a reasonable overall price. The study integrates technical and realistic constraints as the contracted power limitation from the grid, the rated charging current of the charger, the maximum allowable current to be injected in the batteries, and the DC bus voltage. It is imperative to take into account that the PV panels and batteries should be mounted in serial and parallel in a way that ensures a DC bus voltage that is a multiple of 6 V, which introduces additional constraints to the sizing optimization. The Energy Flow (EF) is carefully predicted since an accurate sizing of the backup system requires the establishment of a high coordination level between the several components of the installation as the PV panels, the battery bank, the grid, and the load demand. The proposed PV-Battery sizing procedure applies modern optimization methods. The system is optimized using EA which proved to be very efficient and have been showing great performance for the sizing optimization of renewable energy based systems [66–68].

3.1 Sizing problem formulation and economic evaluation

The economic assessment of the installation is key to the determination of the amount of components to be installed. A 20-year lifetime of the project is considered. Consequently, several resulting fees are included: the capital cost, the replacement cost of the batteries as

many times as needed during the lifetime of the project (Rb), and the maintenance cost of the components. The economic study takes into account the inflation rate (ir) over the project’s

lifetime (N), the interest rate offered by a bank for a savings account (isa) and the loan interest rate (iL) given over a certain period of time (M). These parameters are defined in Table 3.1. The

Table 3.1: Economic and financial parameters for the PV-Battery backup sizing

Parameter ir (%) isa (%) iL (%) Rb ck (C/kWh) N (years) M (years) Value 3.5 5 0.99 7 0.1 20 5 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION 43

total price can then be expressed as in Eqs. (3.1) and (3.2).

f (x) = COST = Capital + Maintenance + Replacement +Cchbat (3.1)

Cchbat = EG−Batt × ck (3.2)

Cchbat represents the amount of money to be spent in order to charge the batteries from the main energy source during its availability. With EG−Batt the amount of energy extracted from the grid

for the charging process and ck the cost of the kWh imposed by the utility power provider. The capital, replacement, and maintenance resulting fees are computed as follows:

• Capital cost: The capital cost consists of the sum of the costs of each component of the PV-Battery backup system: PV panels, batteries, charge controllers, power converters, etc. The payment is considered to be done over a period of M years through a loan given by a bank

at an interest rate iL. The total capital cost is then calculated as in Eq. (3.3) using the defined parameters in Table 3.1.

    M iL(iL + 1) Capital = ∑Capco ×CRF × M = ∑Capco × M × M (3.3) co co (iL + 1) − 1

CRF is the Capital Recovery Factor, allowing the determination of the value of an annuity according to the interest rate and the period of the payment. co represents the components

of the installation and Capco is the capital cost of a specific component which depends on the number of components to be installed.

• Replacement cost: A worst case replacement scenario is considered. It is assumed that the battery bank is to be replaced 7 times during the 20 years. The replacement cost is computed as in Eq. (3.4) using the defined parameters in Table 3.1.

isa Replacement = (nbat.Rb.Capbat) × SFF × N = (nbat.Rb.Capbat) × N × N (1 + isa) − 1 (3.4)

Where nbat represents the number of installed batteries, Rb the number of battery replace- ments during the lifetime of the project, and SFF the Sinking Fund Factor; it is used when a future payment is forecast. It allows the calculation of the real amount of money that can be spent considering the interest rate of a savings account. 44 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION

• Maintenance cost: The maintenance cost of each component of the system is set to a value of 1% of its capital cost. The maintenance cost depends solely on the inflation rate and can be calculated as represented in Eq. (3.5) using the defined parameters in Table 3.1.

(1 + ir)N − 1 Maintenance = ∑Mainco × FVA = ∑Mainco × (3.5) co co ir

Mainco is the maintenance cost of a component. FVA represents the final value of a payment after adding the inflation rate. It should be noted that the maintenance cost of the batteries is not included in Eq. (3.5) during the years when they are replaced.

The optimization problem is constrained by technical constraints and by the maintenance of a permanent power supply to the house, thus maintaining a nil Loss of Power Supply Probability (LPSP). This latter is computed as shown in Eqs. (3.6) and (3.7).

LPSk = EL,k − [EPV,k + Eb,k−1 − Eb,min] × ηinv (3.6)

∑ LPS LPSP = k k (3.7) ∑k EL,k Eq. (3.6) represents the loss of power supply when the energy produced by the panels and the energy stored in the batteries are not sufficient to supply the load. The PV-Battery backup system optimization problem is then formulated as follows:  minimize f (x) = COST = Capital + Maintenance + Replacement +C  chbat  x subject to LPSP = 0 (3.8)    PL,k 6 Pmax; ∀ k

With PL,k the amount of power consumed by the load at step period k and Pmax the contracted power limit from the grid.

3.2 Sizing optimization procedure

Population based EA are used in order to solve the optimization problem of sizing the PV-Battery backup system described in Eq. (3.8). Two optimization techniques are applied and compared: the GA and PSO. • Genetic Algorithm (GA)[122]: GAs are useful when a compromise between finding a good solution and a reduced com- CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION 45

putation time is acceptable. They are used due to their high performance in finding global optimums. A GA is a stochastic and population based algorithm. The initial population is randomly chosen, then the algorithm imitates the biological genetic process by applying genetic operations like selection, crossover and mutation. Therefore, the final population preserves the fittest individuals. The crossover operator ensures extending the search area of the algorithm by always creating new species and integrating them in the search space. As for the mutation operator, it prevents the algorithm from premature convergence towards a local minimum. The GA is applied using the optimization toolbox of MATLAB.

• Particle Swarm Optimization (PSO)[123] : The PSO is a stochastic population based method that generates its initial population randomly. Being a subclass of EA, PSO uses a population (swarm) of individuals (parti- cles) that are updated from iteration to the other. Each particle is a solution that can be

represented in a NVar-dimensional space with NVar representing the number of decision variables. The particle is represented by its position and velocity that at each iteration are adjusted based on the best experience or position of the one particle (local best) and the best experience or position ever found by all particles (global best). The velocity vector determines the direction to which the particle will be aiming in the next iteration. The search continues until the optimal solution is found. The developed toolbox for MATLAB described in [124] is applied in order to simulate the PSO.

Fig. 3.1 describes the flow chart of the optimization procedure. First, all input data are initialized and the simulation conditions are defined. Second, the optimization program will produce the first generation and begin the evaluation process of the individuals. The predictive EF models are then applied in order to predict the energy status of the system during the complete simulation period for the proposed PV-Battery configuration. The LPS is then computed for each step period of the simulation. Then the optimization program computes the LPSP by the end of the preset simulation period. Moreover, it checks whether any of the imposed constraints are violated in order to penalize the unfit individuals. A fitness value is assigned for each computed solution by the EA reflecting its degree of optimality. It corresponds to the estimated system price over its 20-year lifetime. The steps are repeated until the stopping criteria are reached, thus the optimal sizing configuration is determined. The optimization program will terminate whenever one of these two events occur: the maximum number of generations NGen,max is

produced, or the number of stall generations is reached Nstall. This latter represents the number of produced generations during which the best fitness value varied of an amount less or equal to a preset tolerance level tol. The main applied optimization parameters for both the GA and PSO are shown in Table 3.2. 46 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION

Input & initialization: Components & economical parameters, Power & energy consumption, weather data, blackout schedule

Number of system components determined by the optimization algorithm

Compute ichrmax (Eqs. (2.25) and (2.26))

Grid model PV array model (Eqs. (2.8) and (2.9)) (Eqs. (2.1–2.7))

Battery Bank model (Eqs. (2.10–2.12))

Compute LPSk (Eq. (3.6))

k=k+1

End of No Yes simulation period? Compute LPSP (Eq. (3.7))

Cost & constraints evaluation (Eq. (3.8))

Fitness value of the solution

Termination in case optimal solution reached Figure 3.1: Sizing optimization flow chart executed at each generation of the EA

3.3 Study on the optimal water heating technique to be cou- pled with the PV-battery backup system

The water heating process is one of the most energy consuming loads in the residential sector [125], hence there is great interest in assessing the effect of the applied water heating technique on the sizing of the PV-Battery backup system. The high reduction of energy consumption achieved by the introduction of solar energy for the water heating is unquestionable due to the adequate climate for the case study e.g. as studied in [108] and [126] for the Lebanese market. However, the benefits that such additions might bring to a PV-battery backup system have not been assessed yet nor proven. The consideration of environmental consequences of the used CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION 47

Table 3.2: Applied parameters for the EA optimization methods : GA & PSO

Parameter NInd NGen,max Nstall tol Value 20 200 50 10−6

techniques becomes secondary in countries where electrical energy is not provided permanently to the users. As a result, BWHs cannot be ignored despite their use of fuel oil. In this study the most commonly installed water heaters are compared, i.e. the EWH, the hybrid SEWH, the BWH and the hybrid SBWH.

Simulation Conditions Define WH Find WH Apply Sizing Find best PV-Battery technique load Algorithm configuration

Compute additional fees

Figure 3.2: Comparison procedure of the impact of the installed water heating techniques on the sizing of the PV-Battery backup system

The comparison procedure of the impact of the installed water heating techniques on the sizing of the PV-Battery backup system is shown in Fig. 3.2. First, the resulting energy consumption for each considered water heating technique is computed. According to the considered technique, the electrical energy consumption can be the result of the operation of the electric backup resistance, the pump of the SWH for the circulation of the heating fluid, and the pump of the boiler. The computed water heating load is then added to the load profile of the house in order to predict the EF in the system. Additional fees should be added to the cost of the PV-Battery backup system described in Eq. (3.1) such as: the capital cost of the solar panels along with their annual maintenance cost whenever a SWH is considered, and the resulting fuel cost due to the boiler operation whenever a BWH is installed. Finally, the PV-Battery system sizing optimization program is executed in order to determine the optimal configuration of the backup. An accelerated time simulation is done covering a period of one week during which various weather conditions and hot water draw profiles are applied in order to represent as closely as possible a full typical year for the case study. Fig. 3.3 represents the applied simulation conditions regarding the ambient air temperature, the solar insolation level, and the hot water consumption of the case study. For instance, one of the considered conditions is a harsh winter scenario where high hot water consumption occurs along with low solar radiation and low ambient air temperatures. This is done in order to find the average yearly energy consumption of the applied water heating technique and consequently find its impact on the sizing of the PV-Battery backup system. The applied sizing conditions consider a high amount of grid blackout hours that occur during 48 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION

Summer

Fall Fall

Harsh Moderate Winter

High Summer Winter Spring

Moderate Winter High

Medium Spring

Solar Radiation Solar Medium Harsh Ambient Air Temperature Low Winter Low

Low Medium High Hot water consumption Figure 3.3: Applied simulation conditions for the assessment of the optimal water heating technique to be coupled with the PV-Battery backup system various periods of the considered simulation time. They average 8 hours of electricity cut-off per day and can reach 14 hours per day. A 45% grid blackout ratio of the complete simulation period is employed. A Lebanese setting is considered for the simulation process. Corresponding weather data, hot water consumption, technical parameters and economic parameters are applied. Typical Lebanese hot water consumption profiles during the 4 seasons of the year are used (Fig. 3.4).

(a) Hot water consumption - Fall & Spring seasons (b) Hot water consumption - Winter & Summer seasons

Figure 3.4: Average hourly hot water consumption during the 4 seasons of the year - Lebanese pro- files.Data source: Lebanese center of energy conservation (L.C.E.C)

The weather conditions including the amount of solar radiation and the variation of the ambient air temperature are shown in Fig. 3.5. The main simulation parameters for the computation of the water heating load are described in Table 3.3. Measurements were acquired from a weather station installed at a Lebanese rural CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION 49

1 30

Summer C) o

) 25 ( a 2 0.8 θ Summer 20 0.6 Winter 15 Winter 0.4 10

Solar radiation (kW/m radiation Solar 0.2 5 Ambient air temperature temperature air Ambient 0 0 0 12 24 36 48 60 72 84 96 108 120 132 144 156 168 0 12 24 36 48 60 72 84 96 108 120 132 144 156 168 Time (h) Time (h) (a) Solar radiation during Winter & Summer seasons (b) Ambient air temperature during Winter & Summer

Figure 3.5: Solar radiation & ambient air temperature during 7 harsh winter & summer days - Lebanese case

Table 3.3: Simulation conditions for water heating load computation Parameter Value Inlet water temperature θin (°C) 12 - 28 Hot water consumption over a day (L) 162 - 221 Simulation step (s) 1 Tank volume (L) 150 Solar energy produced over a day (kWh) 1.6 - 6.6 Equivalent surface of the solar panels (m2) 1.8

region located at an elevation of 600 m above sea level. The weather data corresponds to the months of January and August of the year 2013 which represent respectively the harshest months during winter and summer seasons. The sizing optimization program is executed for every considered water heating technique. The the detailed cost of each water heating system and its effect on the sizing process are presented in Table 3.4. The EWH is considered as the reference model for the comparison. It is clear that boiler based systems have a lower number of initial components and consequently a lower initial cost. However their overall cost exceeds that of a SEWH due to the high resulting fuel costs. The BWH reduces the overall installation price by a shy 1.7%, making it the least favorable water heating technique after the EWH. Due to lower load consumption in boiler based systems, the amount of electrical energy to be extracted from the grid to charge the batteries dropped nearly 20% compared to techniques. Despite that fact, this energy drop is not enough to compensate the high costs resulting from the fuel combustion. The SBWH is the second best configuration topping the BWH due to the high reduction in fuel consumption (54%) but falling far below the SEWH which offers a high price reduction of 9.2% compared to the EWH. Consequently, a SEWH is the optimal water heating technique to be installed along with the PV-battery backup system, allowing the reduction of the price by approximately 4950 e. This result validates that solar solutions are extremely fit to developing countries having an adequate climate as Lebanon, whether they are applied for water heating or electricity generation 50 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION

purposes.

Table 3.4: Imapct of the water heating technique on the PV-Battery backup sizing results EWH SEWH BWH SBWH Optimal 10 PV 10 PV 10 PV 10 PV configuration 24 Batteries 20 Batteries 20 Batteries 20 Batteries Components cost (e/20 yrs) 41,842 37,499 37,283 38,286 Fuel cost (e/20 yrs) - - 6,025 2,766 Battery charging cost (e/20 yrs) 11,892 11,288 9,508 10,086 COST (e) 53,734 48,787 52,816 51,120 Reduction (%) Reference -9.2% -1.7% -4.87%

3.4 Sizing optimization results

The proposed PV-Battery backup system sizing process is based on the worst case scenario testing. This latter will overpower any other operation conditions of the system and will have the greatest sway on the sizing optimization results. Consequently, the compilation of various weather conditions as done in Section 3.3 cannot be applied in order to determine the optimal configuration for a highly reliable grid backup system. In the case of an intermittent primary energy source, many factors play major roles in the determination of the number of components of the backup system as the weather conditions, the frequency of blackout periods, and the phases during which these cut-offs take place. Two simulation conditions are tested; the first considers the worst case scenario during which hard blackout schedules are applied (52% of the total simulation period) along with harsh weather conditions and a high energy consumption profile (up to 31kWh per day). The sizing results under the worst case scenario will make sure to provide electrical current to the house even under extreme conditions. On the other hand, moderate simulation conditions are applied in order to asses the impact of a load management program on the sizing results of the system and consequently the price reductions that can be reached. Lower energy consumption profiles are used and a normal blackout schedule is applied, consisting of 8 energy cut-off hours per day (34% of the total simulation period). The modeled system is operated over a duration of 6 days under different combinations of grid blackouts. The consideration of the production dynamics in this study by applying a very small simulation period led to identical sizing results to those when average hourly data are applied contrary to what was stated in Ref. [127]. Consequently, a simulation step k = 1hr is applied in order to reduce the computational effort of the algorithm. The solar radiation data and ambient air temperature are shown in Fig. 3.5. The water heating load is determined based on the hybrid CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION 51

SEWH since it has been proven to be the optimal water heating technique to be coupled with the PV-Battery backup system. The house load profiles are shown in Fig. 3.6. Fig. 3.6b plots the energy consumption of the house during days when some main appliances are not activated as the washing machine, the iron etc. Additionally, this profile considers a lower hot water consumption, which results in smaller periods of operation of the electric backup resistance.

4.5 4.5 4 Summer 4 Summer Winter 3.5 3.5 Winter 3 3 2.5 2.5 2 2 1.5 1.5 1 1

Energy consumption (kWh) consumption Energy 0.5 (kWh) consumption Energy 0.5 0 0 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (a) High energy consumption profile (b) Reduced energy consumption profile

Figure 3.6: Energy consumption profile during winter & summer seasons of the considered house (a) high consumption (b) moderate consumption

The optimization algorithm will apply the imposed conditions to find the optimal number of PV panels and batteries to be installed. The parameters of the components of the system along with their prices are shown in Table 3.5. The considered PV modules have a 185 W peak power; a single battery can produce 1,350 Wh; the power converter can supply a maximum of 35A DC for the charging process, and can be connected to a maximum load of 3 kW. The SEWH consists of 1.8 m2 equivalent surface of solar panels along with a 2 kW rated electric backup resistance in order to heat the water for domestic use inside a 150 L water tank.

Two power converters are needed. The number of charge controllers Ncc depends on the DC bus voltage of the system vsys. It is computed as shown in Eq. (3.9).

Pmpp.nPV Ncc = (3.9) icc.vsys

With icc, the rated current of the charge controller.

Table 3.5: Components specifications & Capital cost PV panels Battery Converter Charge controller SEWH 2 Specs 185W; 24v 225Ah; 6v 3000W; 35A icc = 45A 150L; 1.8m ; 2kW Cost (C) 330 190 1500 200 750 52 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION

3.4.1 Simulation results under the worst case scenario

Under harsh conditions, a very hard blackout schedule is applied, accounting to a high 52% energy cut-off time. The load profiles shown in Fig. 3.6a are applied. Both the PSO & GA converged to an optimal combination of 14 PV panels and 20 batteries; corresponding to a 24 V system voltage (7 parallel sets of 2 serial mounted PV modules & 5 parallel sets of 4 serial

mounted batteries). Ncc is calculated by replacing vsys in Eq. (3.9); three charge controllers need to be installed.

x103 58.5 Best Mean 56.5

54.5 Fitness value (€) value Fitness 52.5

50.5 0 10 20 30 40 50 60 70 80 90 100 Generation Figure 3.7: PSO convergence towards the optimal sizing results

Fig. 3.7 plots the convergence of the PSO technique at each generation towards the optimal solution. 97 generations and 4 minutes were needed to determine the global optimum. Some of the best individuals found at each generation of the GA are shown in Table 3.6. The algorithm converged to a solution where no loss of power supply occurs during the complete simulation period. The overall cost of the system over the 20-year period is 50,936C. A capital cost of 13,600C is required to install the backup system including the interest rate. Fig. 3.8 describes in detail how the computed price over the considered lifetime of the project is divided. Fig. 3.8a shows the share of each term of Eq. (3.1) in determining the final price estimation of the proposed backup system. It is obvious that the highest share belongs to the replacement cost of the batteries, followed by the cost resulting from the battery charging process from the grid. Fig. 3.8b further confirms that the batteries are the weakest component

Table 3.6: GA intermediate optimal solutions

nPV nbat LPSP (%) COST (C) 0 8 26.23% 25,309 8 12 9.5% 36,337 10 14 5.57% 40,404 12 18 1.5% 47,863 14 20 0% 50,936 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION 53

1.93% Capital PV Panels Replacement 11.9% Batteries 26.15% 26.7% Maintenance 26.15% Converter C chbat Charge Controller E 6.75% G-Batt 48.6% SEWH 9.9%

40.4% 1.5%

(a) Cost decomposition as in Eq. (3.1) (b) Cost decomposition per component

Figure 3.8: Detailed cost resulting from the PV-Battery backup sizing under the worst case scenario

of the system economically wise. Their capital, maintenance, and replacement costs constitute nearly half of the resulting PV-Battery backup system fees over the lifetime of the project. The combination of the battery cost share and the resulting price from the battery bank charging process from the grid leads to a whopping 75% battery related share of the total system price. These results validate that any major price reduction process should eventually be battery-centric. For instance, a DSM program able to implement a high coordination level between the various components of the system will have a high impact on the performance of the battery bank. First, lower amount of energy will be used from the grid for the battery charging process especially

during high solar insolation periods which will reduce Cchbat. Second, a softer battery charging algorithm can be obtained after the implementation of the load management program, leading to an increase of the lifetime of the battery bank. As a result, a high decrease of the estimated battery replacement cost can be achieved. The EF corresponding to the optimal system configuration is plotted in Fig. 3.9, two simulation conditions are shown: during the winter season (Fig. 3.9a) and the summer season (Fig. 3.9b). These latter plot the variation of the SOC of the battery bank, the amount of energy produced

by the installed PV panels, the electrical energy consumption of the house (EL), the maximum

DC allowed to charge the batteries from the main energy source (ichrmax) and the amount of energy extracted from the grid (EG−AC). The black lines delimit the periods of power outage whereas the orange lines delimit the periods of grid availability. By examining Fig. 3.9b, several validations of the proper operation of the system can be concluded. The SOC does not fall below the 50% preset threshold therefore no LPSP occurs during the complete simulation period. The high amount of solar radiation allows the production of the needed electrical energy to maintain the autonomy of the system even during the blackout hours. Additionally, the SOC of the battery bank remains at a high level for nearly the totality of the simulation period. Rare limitations on the charging current of the batteries are encountered. During harsh and stormy winter days 54 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION

100 SOC 75 (%) 50 E 1 PV-Inv 0.5 (kWh) 0 E 7 L 3.5 (kWh) 0 26 ichrmax 13 (A) 0 E 7 G-AC Grid Status (kWh) 3.5 0 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 Time (h) (a) Harsh winter conditions

100 SOC 75 (%) 50 E 2 PV-Inv 1 (kWh) 0 E 7 L 3.5 (kWh) 0 i 26 chrmax13 (A) 0 E 7 G-AC Grid Status (kWh) 3.5 0 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 Time (h) (b) harsh summer conditions

Figure 3.9: EF during 3 days (a) harsh winter conditions (b) harsh summer conditions

(Fig. 3.9a), the PV panels produce a very small amount of electricity. Therefore, more energy is extracted from the grid for the charging process. It can be seen that sometimes despite the grid power availability (e.g between the hours 46 & 48; 71 & 72) and the urgent need to fill the battery bank, this latter is not charged from the grid. Indeed, the maximum allowable charging current is nearly set to zero due to the high electricity demand which prevents the charging process and consequently the SOC remains low during this period. This validates the proper

implementation of the Pmax and ichrmax constraints; severe restrictions are therefore imposed on the battery charging algorithm. The SOC slightly adjusts up during some of these periods due to the solar energy production which intervenes in the battery charging task.

3.4.2 Simulation results under moderate conditions

The optimal PV-Battery backup system configuration is found by applying a worst case scenario study. However, it is interesting to perform the sizing process under moderate conditions CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION 55

for several reasons. First, moderate conditions represent a great majority of the days for the case study. Therefore their is great interest in assessing the performance of the proposed backup system under the normal and most frequent conditions. Second, this simulation will help analyze the impact of the grid blackout hours as well as the load consumption of the house on the sizing results. Moreover, the benefits of a well performing DSM program can be highlighted through the great price reduction that can be achieved when modifying the load profile of the house. A sizing procedure based on normal and moderate events which neglect extreme conditions is conducted. An average blackout schedule is applied amounting to a 34% energy cut-off time. A combination of both load profiles shown in Fig. 3.6 is applied during the optimization in order to well reflect a realistic simulation period during which high and moderate energy consuming days occur. An optimal combination of 6 PV panels and 20 batteries is reached by the PSO & GA (3 parallel sets of 2 serial mounted PV modules & 5 parallel sets of 4 serial mounted batteries). Two charge controllers need to be installed in order to obtain a system voltage of 24 V. A similar combination will result in an overall cost over the 20-year lifetime of the installation of 42,787C divided as follows: A capital cost of 19,613C including the loan interest rate, 20,585C as replacement costs of the batteries and 2,589C for the yearly maintenance procedure. The current simulation conditions led to a high decrease of nearly 16% of the cost. The EF results of the optimal sizing results are shown in Fig. 3.10. The comparison analysis shows that a high number of batteries is still needed even under moderate conditions since the energy cut-offs might occur during peak power consumption hours of the day (e.g between the hours 44 and 48 in Fig. 3.10a). Since this high energy demand occurs during night hours, the number of PV panels was reduced. In addition, due to less periods of blackout, the grid is able to charge the battery bank quickly and continuously when needed. Therefore lower solar energy is required for the battery charging process which led to the reduction of the number of PV panels nearly by half. Additionally, the considered moderate weather conditions provide higher solar radiation values which in turn means that a lower number of PV panels will produce a higher amount of electrical energy. Table 3.7 summarizes and compares the sizing results of the moderate conditions relatively to

Table 3.7: Comparison of the backup system’s sizing results over 1 week Harsh Moderate Comparison EL (kWh) 220.2 195.2 -11.35% EPV (kWh/module) 3.92 5 +27.55% EG−AC (kWh) 229.3 208.7 -8.98% EG−Batt (kWh) 126.25 85 -32.67% EG−Batt/EG−AC (%) 55.05 40.73 -26% SOC (%) 86.3 94.34 +8.52% COST (C) 50,936 42,787 -16% 56 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION

100 SOC 75 (%) 50 E 0.4 PV-Inv 0.2 (kWh) 0 E 7 L 3.5 (kWh) 0 26 ichrmax 13 (A) 0 E 7 Grid Status G-AC 3.5 (kWh) 0 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 Time (h) (a) moderate winter conditions

100 SOC 75 (%) 50 E 0.4 PV-Inv 0.2 (kWh) 0 E 7 L 3.5 (kWh) 0 i 26 chrmax13 (A) 0 E 7 Grid Status G-AC 3.5 (kWh) 0 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 Time (h) (b) moderate summer conditions

Figure 3.10: EF during 3 days (a) moderate winter conditions (b) moderate summer conditions

the harsh ones. The table shows the amount of energy consumption during the 7 day period (EL), the amount of energy generated by a single PV module (EPV /module), the total amount of energy

extracted from the grid (EG−AC), the amount of energy extracted from the grid to charge the battery bank (EG−Batt), the share of the grid energy used to charge the batteries (EG−Batt/EG−AC), the average SOC of the battery bank over the simulation period, and the overall cost of the system. Under moderate simulation conditions, the load demand is reduced and common weather conditions are applied. Consequently, the PV energy production is increased by 27.55% compared to the harsh situation, and the amount of energy extracted from the grid is reduced by 9%. A severe drop of 33% of the amount of energy used to charge the battery bank from the

grid is achieved. Moreover, its share relatively to EG−AC dropped remarkably while considering

moderate simulation conditions. A 26% drop is recorded, which amounts to a high Cchbat reduction. These results prove the high impact that a DSM process will have on the sizing of the PV-Battery backup system due to the lower energy consumption from the grid for the battery charging process, thus the high reduction of the overall system price it leads to. CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION 57

It shall be noted that under both simulation conditions the average SOC of the battery bank is kept at a high level which validates that the number of batteries was increased in order to satisfy certain peak loads that take place during grid outage periods. This fact suggests that the backup system is being oversized in order to satisfy high load demands occurring during small periods of time. The high number of installed batteries is not needed during most of the simulation time, however a LPS will occur if they were not installed. This furthermore validates the necessity of the consideration of the effect of a complete load management study on the sizing results. By allowing the shifting of certain high energy consuming tasks, the peak electricity consumption periods during blackouts can be avoided, consequently, a lower number of batteries will be needed to satisfy the energy demands of the inhabitants which will be detailed in chapter 4.

3.5 PV-Battery backup systems vs. Diesel generators

A Lebanese case study is applied where regular electricity cut-offs occur during the day for long periods of time. A comparison process is developed between the proposed PV-battery backup and the currently installed DG. Local data and prices were considered, as the subscription fees, diesel prices, and blackout hours. The monthly DG subscriptions vary from an electrical current extraction limit of 5A to 30A. Fig. 3.11 shows how the monthly resulting fees of a DG subscription of 10A over a year period are highly variant. Moreover, it is clear that they extremely depend on diesel prices and the average amount of grid blackout hours.

16 180 180 16

14 160 160 14

12 140 140 12

10 120 120 10

8 100 €/month Bill Generator €/month Bill Generator 100 8 Local diesel price €/20 L €/20 price diesel Local Average grid blackout hours/month blackout grid Average 6 80 80 6 May June July Aug. Sept. Oct. Nov. Dec. Jan. Feb. Mar. Apr. May May June July Aug. Sept. Oct. Nov. Dec. Jan. Feb. Mar. Apr. May Month Month (a) DG fees V/S Diesel price (b) DG fees V/S Average grid blackout hours

Figure 3.11: Variation of the monthly resulting fees of a 10A DG subscription as a function of (a) Diesel prices and (b) Average monthly grid blackout hours. Data Source: Lebanese ministry of energy and water & Lebanese ministry of interior and municipalities May 2014 - May 2015

The data corresponds to the period between May 2014 & May 2015, during which both high and low fuel prices occurred. Additionally, a wide range of blackout periods (between 6.4 hours and 14.6 hours per day) was recorded. Consequently, it is of great benefit to consider this year period as a reference for the assessment of the resulting payments corresponding to a DG subscription. 58 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION

By adding the inflation rate ir defined in Table 3.1, the total yearly and cumulative amount resulting from the DG backup system can be determined. This latter is compared to the detailed fees resulting from installing the proposed PV-battery backup system under similar conditions. The comparison results are shown in Fig. 3.12.

7

PV 6 DG 80 PV DG 5 )

k€ Cost 60 4 )/year k€ 3 40

Price ( Price 2 20 1 ( price Cumulative

0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Year Year (a) Comparison of yearly fees over 20 years (b) Comparison of the aggregated fees over 20 years

Figure 3.12: Comparison of the resulting costs over 20 years of the PV-battery backup and DG (20A subscription). (a) Yearly comparison; (b) Aggregated comparison

The presented results validate the long term advantages of installing a PV based backup system rather than relying on DG. Fig. 3.12b plots the cumulated spent money over 20 years for both PV and DG backup systems. The hatched zones represent the cost variation between the two systems. These latter are used for the calculation of a payback period of the PV-battery backup system. As shown in Fig. 3.12b, a payback period of the system of nearly 10 years and 6 months is obtained. The net present value of the installation of a PV-battery backup system is computed in order to assess if the investment is profitable over the lifetime of the project. A 5% discount rate is considered resulting in a positive net present value of 7,830C which validates that the studied backup is a good investment. The advantages of the proposed backup system are not restricted to the economical evaluation. In addition to the pollution reduction, the PV-battery backup system offers a high flexibility to the user by allowing him to control the resulting fees unlike the case of DG. The DG monthly payments are continuously fluctuating and are highly dependent on fuel prices and grid blackout hours. It is one of the biggest disadvantages of such systems, in addition to the current extraction limitation. This latter sets severe constraints on the allowable loads to be operated during blackout periods, hence sacrificing the users comfort levels. This is not an issue when a PV-battery backup system is installed. In fact, a proper load management will make sure to satisfy both current extraction limits and the user’s comfort. Resulting in a high price reduction and a lower payback period to an already advantageous backup configuration. CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION 59

Conclusion

In this chapter, a complete sizing procedure of a PV-battery backup system to assist an intermittent grid was introduced. A high load profile reaching 6kW and 31kWh per day was considered. Several realistic and critical constraints were taken into account as the limitation on the amount of extracted energy from the grid to feed the loads, the charger rated current, the maximum charging current that can be injected in the battery bank and the DC bus voltage. The sizing process is formulated as an optimization problem. The fitness function to be minimized is the overall cost of the system over the 20-year lifetime of the project. Two robust and well performing EA were applied as optimization techniques. A comparative study of the effect of the installed water heating technique on the sizing of the PV-battery backup system is done as an attempt to reduce the overall cost of the backup system, taking into account that the water heating load is one of the most energy consuming loads in the residential sector. The comparative study accurately quantifies the amount of price reductions that can be reached by assessing several configurations under various simulation conditions for the considered case study. The hybrid SEWH coupled with the PV-battery backup system is proven to be the most economical solution; compared to a PV-Battery system using an EWH as the water heating technique, the optimal system achieves a 9.2% reduction of the total price of the installation, outperforming every other configuration. For a reliable backup system sizing process, a worst case scenario study should be applied in order to make sure that no LPS will occur to the house. A harsh grid blackout schedule is applied along with a high energy demand. The simulations were conducted under winter and summer scenarios. Real weather data, load consumption and blackout schedules were applied. Both the GA and the PSO led to the same optimal number of components to be installed, which validates the accuracy and reliability of the obtained results. An optimal configuration of 14 PV panels and 20 batteries is determined. The PV-Battery backup system is sized under moderate conditions as well. They lead to a notable reduction of the overall price, thus proving that a load management process will highly influence the sizing results of the PV backup system. The battery charging process is one of the highest contributors to the total cost of the backup system as shown in Fig. 3.8. The high number of installed batteries is not needed during most of the simulation time, however a LPS will occur if they were not installed. By allowing the shifting of certain high energy consuming tasks, the peak electricity consumption periods during blackouts can be avoided. Consequently, a lower number of batteries can be installed following the load profile modification, which will also result in less frequent charging and discharging cycles. That is, drastic price reductions are achieved due to the need for a lower number of battery replacements during the 20-year period. The comparison of the sizing simulation results under harsh and moderate conditions presented 60 CHAPTER 3. PV-BATTERY BACKUP SIZING OPTIMIZATION in Table 3.7 validates the high influence of the DSM program on the battery charging process and by extension on the overall price of the backup system. Finally, a detailed comparison with DG subscriptions was conducted. The technical and economical assessment of the studied backup techniques proved that the proposed PV-Battery backup system has multiple advantages over the DG. Its better performance, lower cost, and higher level of flexibility encourage its installation in countries that suffer from an intermittent energy supply. Chapter 4

Demand Side Management procedure

Contents 4.1 Overview of the DSM program ...... 62 4.2 Predictive Scheduling layer ...... 64 4.2.1 Problem formulation ...... 65 4.2.2 Number of decision variables ...... 66 4.2.3 Objective functions ...... 67 4.2.4 Fuzzy logic decision maker ...... 70 4.2.5 DSM Simulation results ...... 73 4.2.6 Advantages of the DSM for the case study ...... 77 4.3 Real Time layer ...... 79 4.3.1 Control Algorithm ...... 80 4.3.2 RT controller simulation results ...... 81 The concept of load management consists in modifying the load profile of a residence in a way that serves best the objectives of the study. The most popular DSM objectives tackle the issue of energy price reduction and peak load shaving procedures while maintaining high comfort levels to the users [75, 76]. However, more pressing concerns arise when considering frequent and daily energy blackouts in the case of an intermittent primary energy source. The greatest concern is the insurance of a permanent power supply to users while respecting their comfort level and maintaining the good operation of the backup system. Therefore the focus is directed towards the management of residential loads in order to ensure a reliable and efficient PV-battery backup system, and not towards the energy consumption reduction according to real time electricity pricing and peak load shaving. Every component of the system should be included in the control due to highly critical conditions where the application of an ineffective load management program will lead to an unacceptable LPS. Given the long periods of power shortage and the unreliable nature of the solar energy, applying a DSM is of great interest when coupled with the PV-Battery backup system due to several reasons. First, it allows the

61 62 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

optimization of the performance of the proposed backup system. The Energy Flow (EF) in the system is controlled following a thorough predictive study which is highly adaptable to the applied conditions. Additionally, the DSM program dynamically supervises the energy consumption of the house. Second, the home energy management system will help maintain a high comfort level to the users regardless of the applied conditions. Third, the implementation of a reliable load management program plays a major role in the overall cost reduction of the PV-Battery backup system. As shown in Table 3.2, a configuration of 8 PV panels and 12 batteries will produce a 9.5% LPSP. Under such conditions, a well performing load management task should be able to maintain permanent power supply to the house without highly sacrificing the comfort level of the residents. Thus achieving a very high price reduction of the installation over the 20 year lifetime of the system. Therefore, this PV-Battery configuration will be applied for the validation of the performance of the developed DSM.

4.1 Overview of the DSM program

The concept of services is firstly introduced; they are of 3 types [102]. The end-user, inter- mediate and support services. The first is the set of loads and electrical tasks enabled by the consumer that directly produce comfort to the inhabitants e.g. clothes washing, lighting, HVAC. The intermediate services manage the energy storage process as the battery bank whereas the support services are in charge of the energy production process e.g. the power grid and the installed PV panels. Services can be defined as permanent or temporary; a service is considered as permanent if its energy consumption/production/storage covers the complete studied period of time, in contrast with temporary services which are operated for a specific duration e.g. the washing machine. A service is described as observable when the impact of an end-user service on the comfort level is known, or when the power profile of the intermediate/support services can be determined. When the behavior of a service can be modified, it is deemed as modifiable. If the operation cycle of a service is predefined, it is said to be predictable. The load classification process is explained in Fig. 4.1; Fig. 4.1a explains the categorization of the services, whereas Fig. 4.1b divides the house devices to three separate classes. After assigning the required energy to feed the base load, the control mechanism is divided into two main layers; the scheduling, and the real-time layer. The first layer will manage the predictable, observable and controllable loads. The second manages the controllable, observable and unpredictable loads.

• Predictive Scheduling Layer: The scheduling layer includes a set of data predictions as the user behavior, the weather conditions, the grid blackout schedule and the comfort level standards. This layer will manage the predictable, observable and controllable loads by means of predictive mathematical models of the predictable loads and of every component CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 63

Base Load Lighting, TVs, Laptops OBSERVABLE PREDICTABLE SERVICES SERVICES Refrigerator

Scheduled Services Temporary services: Washing Machine Permanent Services: HVAC, SEWH Uncontrollable Services Scheduled Services RT controlled Services RT controlled services MODIFIABLE Monitoring Services Microwave, Iron, etc. SERVICES

(a) Services categorization (b) End-user services classification

Figure 4.1: Services categorization and classification for the DSM

of the backup system. The permanent loads as the SEWH and the HVAC systems are controlled by the variation of their reference set points and the number of operational elements. The temporary predictable services are controlled by shifting their operation time according to the energy availability and users comfort level. The predictive layer produces a load operation schedule of the predictable end-user services in order to be applied during the next 24 hours. • Real Time Layer: A DSM program cannot determine the operation time of a microwave or a hair dryer one day ahead, these tasks are not predictable, thus such services cannot be controlled by the scheduling process. The real-time layer manages the controllable, ob- servable and unpredictable loads. Following the determination of the energy consumption schedule computed by the higher-level scheduling layer, the EF of the system is updated. Accordingly, the unpredictable loads will have to be enabled or disabled during the day in order to avoid the occurrence of a LPS for the remainder period. The decision making depends on a priority level order of the considered loads preset by the users.

The proposed control system goes beyond the peak load shaving process and focuses on the insurance of a permanent electricity supply to a residential application along with the maintenance of high comfort levels to the residents. Additionally, the developed controller should carefully take into account the operation constraints of the proposed backup system, and will therefore have to ensure that no complications will result from the load management process. The integration of realistic and technical constraints is crucial in a DSM program since disregarding them might result in a great malfunction of the system. For instance, the management program should not be allowed to operate high power consuming loads simultaneously in order to avoid triggering the main breaker of the property. A higher complexity is encountered for establishing a well-performing and reliable DSM program. One great challenge to the control algorithm 64 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

is achieving an optimal coordination between the multiple components of the system, thus between the end-user, intermediate, and support services. The proposed control is built to be highly generic and flexible. It swiftly adapts itself with any applied conditions such as winter or summer seasons, weekdays or weekends and so on. An overview of the proposed complete DSM program is depicted in Fig. 4.2.

Load Classification Predictive Scheduling Layer Sampling period = 1 hour Base Load Predicted Data Energy Flow Computation module Scenario I Grid off & E > E Lighting, TVs, Laptops Grid Scenario II PV-AC L WM Grid off & EPV-AC < E L Solar insolation User OFF ON OFF ON OFF ON Scenario III Grid on Refrigerator GA E P Ambient temperature preferences AC bus - House G-AC max E E Scheduled Loads PV-AC Batt-AC E optimiza- AC-L SEWH Blackout Schedule + E Temproray services: WM PV-Inv Inverter/ tion Permanenet Services: HVAC, SEWH Occupancy hours Bounds Charger

PV EG-Batt ... E HVAC RT controlled Loads PV-Batt Battery Charge Bank House Load (E ) Microwave, Iron, Hair Dryer etc. Controller L Optimal Energy Flow By priority order

Sampling period= 5 minutes & RT OBSERVABLE Real Time Control Updated Energy Flow SERVICES Microwave PREDICTABLE SERVICES Energy Flow Computation module Hair Dryer Scenario I Grid off & E > E Grid Scenario II PV-AC L Grid off & EPV-AC < E L Unpredictable OFF ON OFF ON OFF ON Scenario III Grid on E P Loads Power AC bus - House G-AC max Hair Iron E E Real Time PV-AC Batt-AC EAC-L MODIFIABLE Decision to Consumption E SERVICES PV-Inv Layer Enable/Disable Inverter/ + Charger Iron E Uncontrollable Services Loads PV G-Batt Priority levels E Scheduled Services PV-Batt Battery Vacuum Charge Bank RT controlled Services House Load (E ) Controller L Monitoring Services Cleaner

Figure 4.2: Overview of the Proposed DSM program

The predictable loads are handled by the predictive scheduling layer which is in charge of changing the load profile of the house in accordance with the predicted available energy resources and operation constraints. Moreover, the scheduling layer maximizes the autonomy level of the system (i.e. the stored energy in the battery bank), in order to take into account that unpredictable devices are going to be activated during the day and consequently ensure that no LPS will take place. An optimal operation schedule of the predicted loads to be applied during the next 24 hour period is determined, thus a daily updated EF prediction regarding every component of the backup system is obtained. The optimal EF determined by the highest layer of the control algorithm is then transferred to the RT control layer, along with the power ratings and specifications of the installed unpredictable devices. Accordingly, the RT layer will decide whether to allow the operation of these devices when requested or not. In addition, this control layer will keep the EF of the system updated following the decision making process. The considered unpredictable devices and their priority levels are shown in Fig. 4.2.

4.2 Predictive Scheduling layer

The aim of the predictive scheduling layer is to minimize the resulting discomfort levels to the users, ensure that no constraint violations occur, and maintain a high autonomy of the system for the operation of unpredictable devices. The control is based on a set of data predictions as the weather conditions, the grid blackout schedule, and the comfort level standards. The highest CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 65

layer of the DSM program consists in determining an optimal schedule of operation of the predictable devices. At the beginning of each day, the program should be able to forecast the EF in the system and accordingly, modify the electrical consumption of the house in order to ensure the availability of the power supply during the complete day. The schedule should be able to satisfy multiple objective functions as maintaining a high level of autonomy, a proper operation of the system and low user discomfort level. The EF in the backup system is determined over a 24 hour period with a step period k = 1h. The schedule should keep a high amount of energy inside the battery bank as a provision for the additional unpredictable loads that will be activated during the day. The scheduling process is based on predicted input data, and mathematical models of the backup system’s components and EF. A detailed energy audit of a typical residence is conducted. The base load energy consumption data is sampled at a 5 min sampling period whereas the power consumption of the load is sampled at a 1 min period for a highly accurate and dynamic modeling of the load demand. The considered predictable loads are the Washing Machine (WM), Solar Electric Water Heater (SEWH) and the Heating, Ventilation, and Air Conditioning (HVAC) system. The WM is controlled by shifting the activation time of its 3 state operation cycle whereas the SEWH and

HVAC systems are controlled using a hysteresis control technique, in order to maintain θH and

θindoor around their references set by the DSM.

4.2.1 Problem formulation

The proposed predictive DSM program considers 4 objective functions (Ko=4). The objective functions to be minimized are the discomfort levels produced by the management of the WM, HVAC, and the SEWH. The fourth objective function to be maximized is the autonomy level

of the system. Maximizing An is equivalent to minimizing (1 − An), given that An is always positive. The predictive layer can be formulated as a MOO problem as described in Eq. (4.1).

 minimize f1(x)=D(WM); f2(x)=D(SEWH); f3(x)=D(HVAC); f4(x)=(1-An)  x   subject to t(WM3) = t(WM2) + 60 min = t(WM1) + 105 min;    LPSP = 0   P P ; ∀ k L,k 6 max (4.1)  9 AM 6 t(WM1) 6 4 PM    15°C 6 θHGA 6 49°C    18°C 6 θinGA 6 24°C   0 6 nbAC 6 4 66 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

with x = {x1,x2,...,xNVar }, NVar being the number of decision variables to be determined by the optimization process. The solution space of the optimization algorithm is reduced due to

several impositions. First, user defined upper and lower bounds (xin f and xsup) over the decision variables are set. Second, The severe constraints set on the battery charging process as explained in Paragraph "Overview of the PV-Battery backup system" of the thesis are applied, otherwise faulty SOC predictions might take place. Third, limitations concerning the amount of power extraction from the grid are implemented by making sure that the power consumption during

the next 24 hours does not exceed a fixed preset threshold (Pmax). The power consumption vector (PL,k) of the house is computed at a frequency of 1 minute. The corresponding solution is discarded whenever the power threshold is surpassed. Fourth, no LPSP should occur during the day. The LPSP is computed as shown in Eqs. (3.6) and (3.7). MOO techniques aim to minimize a number of objective functions that most often are in conflict. Among several proposed Multi-Objective Genetic Algorithms [128], the NSGA-II [129] is selected to the test and simulation of the scheduling program due to its simple structure, the existence of experience in practical applications in various research fields [130–134], and its excellent performance on the majority of test problems. This technique presents many advantages: • Firstly, It can produce a good and diverse Pareto optimal set of solutions for a trade-off process. • Secondly, it is capable of searching simultaneously different regions of a solution space and ensures a very good solution diversity. • Thirdly, as shown in [135], this technique has a faster computation time compared to other MOGAs. As stated in Ref. [136], constraint handling methods should be added to the algorithm. In this study, a death penalty technique is applied in order to set the constraints on the optimization program.

4.2.2 Number of decision variables

The number of decision variables (NVar) varies depending on the applied conditions and the number of considered devices. It is computed as shown in Eq. (4.2).

NVar = nWM + nSEWH + nHVAC = 3 + 1× ncyc + 2× ncyc = 3(1 + ncyc) (4.2) |{z} |{z} θHGA θinGA;nbAC

With θHGA the hot water reference temperature determined by the GA, θinGA the indoor reference ambient air temperature determined by the GA, and nbAC the number of operating Air CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 67

Conditioning Units. It can be seen that NVar is proportional to ncyc. Ideally, ncyc is set to 24, corresponding to each hour of the day. This will lead to a very high amount of decision variables and consequently to a high computation time and effort of the DSM. Therefore, to reduce the

number of decision variables, the ncyc should be reduced but not at the expense of the reliability of the control. The considered approach to set ncyc is shown in Fig. 4.3.

1 2 3 4 5 6 ncyc = 6 Grid Status OFF ON OFF ON OFF ON

12 A.M 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1617 18 19 20 21 22 23 24 Time (h) Figure 4.3: Determination of the number of Decision variables

The DSM should first detect the changes in the predicted blackout schedule. Accordingly, ncyc is

determined. For each grid blackout or availability period, θHGA, θinGA, and nbAC are computed by the optimization algorithm. For instance, as shown in Fig. 4.3, ncyc is equal to 6, resulting in 21 decision variables as opposed to 75 in case setting ncyc equal to the step period of the algorithm. The power consumption should be reduced during grid energy cutoffs, and since the temperature set points have a high influence on the power consumption of the SEWH and HVAC systems, the modification of their reference points is most beneficial during blackout periods. Which makes this used strategy excellent for the case study. It reduces the computation time and memory resources occupied by the optimization algorithm due to the reduction of the number of decision variables while maintaining a high reliability level of the results.

4.2.3 Objective functions

The objective functions to be minimized are the discomfort values produced by the control algorithm. Additionally, the optimization process should maximize the autonomy of the system. Mathematical models for the predictable devices are applied. They are mandatory to predict the EF in the system for each control schedule, and therefore determine the resulting discomfort levels.

4.2.3.1 Objective 1: WM discomfort

The used WM process is divided into 3 uninterruptible states [102], each having its own power consumption and operation duration as shown in Fig. 2.2. In the DSM program, an uninterruptible washing process is considered. The first state is the most power consuming and lasts for 45 min. Three decision variables are reserved for the washing process, one for each state. Consequently, additional constraints should be added in order to make sure that these stages are executed continuously. The user will set the lower and upper acceptable time shifting 68 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

limits for the operation of the WM along with the desired optimal starting time of the process. These boundaries will reduce the search space of the optimization algorithm and will restrict it to values within the specified time range. Accordingly, the normalized discomfort level D resulting from the DSM can be computed as in Eq. (4.3).

 t(i) −topt(i)  if t(i) > topt(i)  max[tmax(i) −topt(i);topt(i) −tmin(i)] D(i) = (4.3)  topt(i) −t(i)  if t(i) 6 topt(i) max[tmax(i) −topt(i);topt(i) −tmin(i)]

A discomfort value of 1 corresponds to a maximum shifting process. In such case, the determined starting time value of the service is at the farthest point from the optimal setting.

4.2.3.2 Objective 2: SEWH discomfort

The SEWH has been proven to be the optimal water heating technique to be installed with the PV-battery backup system for an intermittent primary energy source. A hysteresis control is applied to the backup electrical resistance in order to keep the water temperature inside the

tank around its optimal value θopt. The DSM program will determine the reference temperatures

(θHGA) around which θH should be kept since the power consumption of the device is highly affected by controlling its reference points [137]. It should be noted that safety measures are taken into consideration in the SEWH model. When the temperature of the water inside the water tank surpasses 65°C, the pump circulating the fluid in the solar collectors will be turned off and therefore no more heat provided by the sun rays will be communicated to the water inside

the water tank to avoid overheating issues. A one minute sampling period (Ts) is considered as a compromise between the accuracy of the model and the computation time of the algorithm. In order to compute the amount of discomfort resulting from the variation of the temperature’s set point by the scheduling layer, an average value of the temperature during a step time is

considered. It is then normalized, and reaches its maximum when θH is equal to θin. The average value method is used in order to simplify the algorithm and serves as a good indicator of the status of the water temperature in the tank. The SEWH discomfort can then be expressed as follows.

a + b Dwdk(SEWH) =  (4.4) 2 (θopt − ∆) − θin  th a = (θopt − ∆) − θa,k θa the water temperature at the beginning of the k step period  th b = (θopt − ∆) − θb,k θb the water temperature at the end of the k step period  wdk The index of the step periods in which there is a hot water draw (4.5) CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 69

θopt should not be confused with the reference temperature to be determined by the DSM (θHGA). θopt and ∆ are set to 49°C and 2.5°C respectively. The total discomfort produced can then be computed as shown in Eq. (4.6).

∑ Dwdk(SEWH) D(SEWH) = wdk (4.6) Ndis

Ndis represents the number of intervals during which a discomfort occurs.

4.2.3.3 Objective 3: HVAC discomfort

The predictive layer has to define the reference air temperature to be held in the house θinGA. A decision variable indicating the number of operating ACU bound between 0 and 4 is added. A hysteresis control is applied to the ACU in order to maintain the room temperature around the reference set by the DSM program. If the house is occupied, the discomfort levels will be calculated and integrated in the optimization process, otherwise, they are set to zero. This procedure allows the program to produce reliable control results under several conditions (e.g. weekdays, week-ends, holidays). The discomfort level is calculated as in Eq. (4.7).

 θindoor,opt − θindoor,avg  if θindoor,avg < θindoor,opt  θindoor,opt − θindoor,min Dk(HVAC) = (4.7)  θindoor,avg − θindoor,opt  if θindoor,avg ≥ θindoor,opt θindoor,max − θindoor,opt

Minimum and maximum indoor air temperature values are defined, beyond which discomfort values will be recorded. θindoor,min, θindoor,max, θindoor,opt are set to 20°C, 28°C, and 22°C respectively. θindoor,avg is computed by finding the mean value of the temperatures at the beginning of the step time and at its end. The total discomfort resulting from the HVAC reference changing process is then computed as shown in Eq. (4.8). poc represents the total number of hours during which the house is occupied.

poc ∑ Dk(HVAC) D(HVAC) = k=1 (4.8) poc

4.2.3.4 Objective 4: Autonomy

The normalized autonomy level of the proposed backup system is computed by aggregating the amount of unused available energy in the battery bank over the number of blackout cycles that occurs during a day (bot). The computation of the autonomy level during a single grid blackout cycle is shown in Fig. 4.4. The orange zones delimit periods of grid availability whereas 70 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

E b,min Eb,max

Ebsum OFF A ~ELsum E ON b,min Eb,max

Figure 4.4: Autonomy Computation during a single grid blackout cycle

black zones indicate a power shortage period. At the beginning of each energy cut-off period,

the available amount of energy in the batteries to be used during the energy shortage cycle Ebsum is predicted. Then the load demand over the considered blackout time is aggregated in order to

determine ELsum. This procedure is repeated over each grid blackout period (bot = 3 for the case study as shown in Fig. 4.3). The autonomy can then be computed as in Eqs. (4.9) and (4.10).

bot     A = ∑ [Ebsum − ELsum] = Eb,k−1(1 − σ) − Ebmin − ∑EL(k) (4.9) j=1 k A An = (4.10) bot × (Ebmax − Ebmin)

4.2.4 Fuzzy logic decision maker

The NSGA-II scheduling program produces a Pareto set of optimal schedules. The retained schedule to be applied in the next 24 hours is the result of a trade off process. In this study, a complete automated system is developed, the DSM program chooses the most fit solution according to the user preferences. In order to do so, a Fuzzy logic Decision Maker (FDM) is developed. A Mamdani inference system is implemented on MATLAB for the testing procedure. The Mamdani inference system is based on the fact that both the inputs and outputs are catego- rized into fuzzy sets conditioned by membership functions during the decision making process. The crisp inputs are fuzzified and associated to the fuzzy sets according to the proposed input membership functions. Afterwards, a number of fuzzy rules are applied in order to produce the output fuzzy set. The results of all the applied rules are then aggregated to produce the final fuzzy output set. This latter is defuzzified in order to obtain the crisp optimal solution. A brief overview of the fuzzy logic control technique as well as the Mamdani inference system are presented in Appendix B. The optimal solution from the Pareto set is found after the evaluation of the normalized discom- CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 71

Membership Functions

Low Average High Low Average High 1 1

0.8 0.8 D(WM) 0.6 0.6 0.4 0.4 Bad Average Good 1 0.2 0.2 Degree of membership Degree of membership Degree 0.8 D(SEWH) 0 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.6 D(WM) D(HVAC) 0.4 Low Average High Low Average High 1 1 0.2 D(HVAC) of membership Degree 0.8 0.8 0 0.6 0.6 0 10 20 30 40 50 60 70 80 90 100 Grade Autonomy 0.4 0.4

Level 0.2 0.2 Degree of membership Degree of membership Degree Output

0 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 −1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 D(SEWH) Autonomy

Figure 4.5: Fuzzy logic Decision maker

fort and autonomy levels to the end of determining a grade reflecting their degree of optimality towards the user preferences. Thus the crisp input set u to the FDM is constituted of 4 inputs whereas the crisp output is a single solution (i.e. the grade of the optimal individual). The sets of linguistic input values (u˜) and linguistic output values (y˜) group 3 linguistic categories. The sets can be represented as follows:

 u = { D(WM), D(SEWH), D(HVAC), An}  u˜ = { Low, Average, High }  y˜ = { Bad, Average, Good }

˜ j ˜ j Consequently fuzzy input and output sets Ai and Bl can be defined corresponding to each input ˜Low ˜Good i, output l, and linguistic value j (e.g. AD(WM), Bgrade). In order to determine the fuzzy input sets, membership functions µ ˜ j mapping the crisp inputs to their corresponding linguistic values Ai should be developed. The proposed triangular membership functions are shown in Fig. 4.5. The Mamdani inference system will then apply a set of linguistic If-Then rules in order to determine the output fuzzy set. Since 4 inputs and 3 linguistic values are involved, the total number of rules is 34 thus 81 rules. The resulting number of rules is high and is subject to be increased in case additional appliances will be added, consequently manually establishing these rules can be complicated and time consuming. A scoring procedure is applied in order to establish the fuzzy rules as shown in Algorithm 4.1. The fuzzy input set u˜ is represented by the values {1,2,3} e.g. a high WM discomfort rate will lead to ID(WM) = 3. For each individual, scores are assigned relatively to the linguistic input values, penalizing unfavored ones by lowering their score. The presented example in Algorithm 4.1 represents the scores implemented under summer weather conditions. The scoring method is crucial regarding the implementation of the users’ preferences. The attributed scores should be carefully chosen in order to well reflect the priority order of the tasks. It can be seen by the attributed scores that the most important criterion of the decision making is the produced autonomy level of the individual. A bad autonomy level will penalize its corresponding 72 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

Algorithm 4.1 Fuzzy Rules determination 1: procedure RULES DETERMINATION 2: c2 = c3 = ct = 0 . Initialize counters 3: for ID(SEWH)= 1 → 3 do 4: c1 = 0 5: switch doID(SEWH) 6: case 1: c1 = c1 + 3 7: case 2: c1 = c1 + 0 8: case 3: c1 = c1 − 2 9: for ID(WM)= 1 → 3 do 10: switch doID(WM) 11: case 1: c2 = c1 + 3 12: case 2: c2 = c1 + 0 13: case 3: c2 = c1 − 1 14: for IAn = 1 → 3 do 15: switch doIAn 16: case 1: c3 = c2 − 3 17: case 2: c3 = c2 + 3 18: case 3: c3 = c2 + 6 19: for ID(HVAC)= 1 → 3 do 20: switch doID(HVAC) 21: case 1: ct = c3 + 4 22: case 2: ct = c3 + 1 23: case 3: ct = c3 − 2 24: ct = round(ct × 3/16) . Compute the final score of each individual = {1,2,3} 25: if ct 6 0 then ct = 1 . Bad grade 26: end if 27: end for 28: end for 29: end for 30: end for 31: end procedure

individual’s score by -3 points, however a high autonomy level will lead to a notable increase of

6 points. The final score ct is then computed by summing the collected points over the inputs and scaling it to values of 1 (bad grade), 2 (average grade), or 3 (good grade). All combinations are included and therefore a complete set of fuzzy rules reflecting the user preferences is obtained.

For example: if D(WM) is low (ID(WM)) = 1, D(SEWH) is average (ID(SEWH) = 2), An is low (IAn = 1), and D(HVAC) is low (ID(HVAC) = 1); the total score is computed as follows: round(0 + 3 - 3 + 4) × 3/16  = 1 therefore the fuzzy rule can be stated as:

If D(WM)is Low AND D(SEWH)is Average AND D(HAVC)is Low AND An is Low Then grade is Low. The graphical interpretation of the implemented fuzzy rules according to the multiple inputs are shown in Fig. 4.6. Each figure plots the effect of 2 inputs on the grade output by considering the other not represented inputs as ideal. A bad autonomy level results in a lower grade than a bad WM discomfort level. Moreover, a good autonomy level is favored over a good WM or SEWH CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 73

comfort level. It can be seen in Figs. 4.6a and 4.6c that the scheduling layer will disregard any solution that has a low autonomy level. A high discomfort produced from a shifting process of the WM is not a serious matter as the one resulting from a low autonomy. It should be kept in mind that the boundaries of the shifting and the reference temperatures are set in the DSM program, consequently, even high discomfort levels fall in the acceptable user defined shifting range.

80 80 60 60

Grade 40 Grade 40

20 20 0 0.2 1 0 0 0.4 0.5 0.2 0.2 0.6 0 0.4 0.4 0.8 −0.5 Autonomy 0.6 0.6 Discomfort WM 1 −1 HVAC 0.8 0.8 SEWH 1 1 (a) Grade VS WM discomfort & Autonomy level (b) Grade VS SEWH & HVAC discomfort levels

80 80 70 60 60

50 Grade 40 Grade 40 20 30 0 0.2 0 20 1 0.4 0.2 0.4 0 0.6 0 0.2 HVAC 0.6 0.4 0.6 Autonomy 0.8 0.8 HVAC 0.8 1 −1 1 1 Discomfort Washing machine (c) Grade VS HVAC discomfort & Autonomy level (d) Grade VS WM & HVAC discomfort levels

Figure 4.6: Fuzzy Rules implementation

After applying the set of rules by the Mamdani inference system, the fuzzy output set is determined for the defuzzification process. Finally, all the scores of the final population are compared and the individual with the best score is chosen as the optimal load schedule to be applied to the house.

4.2.5 DSM Simulation results

Simulations are conducted considering a high energy consuming house occupied by a family of 4 persons. The aggregated daily energy consumption can reach 31.5kWh during the summer season with a base load of 12.7kWh, which represent a high energy consumption

profile especially compared to the electricity consumption data in developing countries. Pmax is set to 6.5 kW. Optimal enabling periods of each task were determined by an observation of a typical residence. Different simulation conditions are applied in order to test the reliability of the program. Its performance will be assessed by analyzing the test results considering harsh 74 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

summer conditions along with a very high amount of blackout hours. The considered base load profile during a summer day is shown in Fig. 4.7.

2.5 Lighting 400 Lighting Sockets 2 Sockets Refrigerator Refrigerator 300 TVs 1.5 TVs

200 1

100

Power consumption (kW) 0.5 Energy consumption (Wh)

0 0 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (a) Base load electrical energy consumption (b) Base load electrical power consumption

Figure 4.7: Base load energy and power consumption during summer season

The battery bank is considered as initially fully charged and the simulation time is set from 12 AM to 12 AM covering a period of 1 day with a 1 hour step period. 8 PV panels and 12 batteries are the considered backup configuration and harsh weather and grid blackout conditions are applied. An energy cutoff schedule of 14 hours per day is considered, the blackouts occur during peak energy demand periods. The specifications of the components are shown in Table 3.5. The simulations are conducted on a 2.6 GHz Intel core i7 processor, 4 cores, 8 GB 1600 MHz DDR3 memory. A death penalty constraint handling method has been added to the implemented NSGA-II algorithm using the MATLAB software in order to handle the applied constraints in the study. A population size of 60 was considered and a Pareto fraction of 35% is set. 102 generations were created accounting to a simulation time of 1 min and 20 s. The produced Pareto optimal set of solutions for the trade off process under the above mentioned conditions is represented in Fig. 4.8.

0.4

0.3

0.2 Optimal Solution 0.1 HVAC discomfort 0.8 2.5 0.6 2 0.4 1.5 1 0.2 0.5 −3 0 x 10 Autonomy SEWH discomfort Figure 4.8: Pareto set of optimal solutions - Summer conditions and 14 hours of grid blackout

The most influencing variables on the operation of the system which are the autonomy, the CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 75

SEWH and the HVAC discomfort are plotted. All solutions delimited by the dashed plane are discarded due to their low autonomy levels. The optimal solution according to the considered user preferences is represented by the red point. The DSM results are assessed according to each predictable device in order to validate the good operation of the control and its high flexibility towards several testing conditions. A color coding is applied for the grid status: a black line indicates a blackout period whereas orange lines delimit grid availability periods.

4.2.5.1 WM DSM

The washing process is a temporary service controlled by shifting its operation time. The maximal activation bounds of the WM set by the user are shown in Fig. 4.9a.

Grid 2 Scheduled operation time Grid Status topt(WM1) Required operation time Status ON 1.5 Activation shifting boundaries tmin (WM1) tmax (WM1) Shifted 1 1 hour

WM status WM 0.5 User required Activation period WM Energy consumption (kWh) consumption WM Energy OFF 0 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (a) Shifting of the WM’s operation time (b) WM’s energy consumption after scheduling

Figure 4.9: Washing process management

The scheduling layer clearly respected the needed constraints. The first state of the washing process, which lasts for 45 mins, is the highest energy consuming state. As shown in Fig. 4.9a, the optimal operation time of the washing process was set between 10 AM and 12 PM, a period during which the grid power is not available. The predictive program shifted the high energy consuming states of the washing process to periods where the primary energy source is available. As shown in Fig. 4.9b the high energy consumption period of the process is operated between 9 AM and 10 AM, whereas after the occurrence of the energy blackout, a small amount of energy is extracted from the batteries for the washing process.This shifting process will result in a low discomfort level due to the wide acceptable range of shifting proposed by the user. Moreover, it allows the battery bank to maintain a high level of SOC to be used by other devices during the rest of the day.

4.2.5.2 SEWH DSM

The water temperature variation inside the water tank is plotted in Fig. 4.10a, along with the average hourly hot water consumption during the day. Due to the high solar radiation during summer days, the scheduling layer did not need to modify 76 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

70 60 C) C) o 65 Grid Status Grid Status o θ 55 H 60 50 55 θ H 45 50 45 40 θ θ HGA Temperature ( Temperature 40 HGA 35 Temperature ( Temperature 30 25 W d 20 20 W 15 15 d (L/h)

d 10 (L/h)

d 10 W

W 5 5 0 0 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (a) Hot water reference temperature variation - Summer (b) Hot water reference temperature variation - Winter

Figure 4.10: Hot water temperature variation after DSM

the reference temperature around which θH should be. A nearly nil discomfort level is obtained from the SEWH. This is hardly the case during harsh winter days. For the sake of validation, the scheduling layer’s action on the SEWH system during a harsh winter day is shown in Fig. 4.10b. When no solar insolation occurs, the solar water heater will not be able to provide the inhabitants with hot water. Consequently the electrical backup resistance will operate in order to heat the water for domestic use. Since the reference temperature has a high impact on the energy consumption of the device, the scheduler lowered it during grid blackouts in order to preserve the high autonomy of the system. The compromise between the two objectives of the control was achieved i.e. the comfort of the users was not sacrificed as seen in the 6PM-10PM period. Despite the already high energy consumption of the house during this peak period, the reference hot water temperature was maintained at a relatively high level in order to fulfill the highest hot water demand that occurs during the day. Whereas, when small amounts of hot water are consumed and during energy cut-off periods, the reference temperature is severely dropped. It can be seen in the 2PM-6PM period that despite the very low hot water demand, the reference temperature was kept at a high level of 45°C in order to anticipate the high demand that will occur during the next energy cut-off period. This procedure ensures the availability of hot water during times of need when the grid is blacked out and no energy in the batteries can be assigned for the water heating process. Thus, the developed DSM takes great advantage of the high capacity of the water heating task to serve as an energy storage system.

4.2.5.3 HVAC DSM

The HVAC system is one of the most energy consuming loads in a residential application, which makes it the ideal target for the DSM process. Controlling the operation time of the ACU is crucial regarding the amount of energy that will be drained from the battery bank during

grid cut-off periods. Fig. 4.11 plots the variation of θindoor – based on the predictive model – along with θoutdoor, the occupancy periods, θinGA, and nbAC. Fig. 4.11a shows an indoor air temperature kept around the optimal comfort temperature of 22°C regardless of the blackout CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 77

30 35 C)

o Grid Status θ C) 32.5 outdoor o Occupancy Grid Status 25 30 27.5 θ outdoor 22 25 20 22.5 Temperature ( Temperature θ

θ ( Temperature inGA indoor 20 θ indoor nb AC 4 nb 4 AC 3 3 2 2 1 1 0 0 Nb.ACs Nb. ACs 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (a) HVAC system behavior without the implementation of(b) HVAC system behavior after the implementation of the DSM the DSM

Figure 4.11: HVAC system operation before and after the application of the scheduling layer control

periods. The operation of the HVAC system after applying the scheduling layer is represented in Fig. 4.11b. In general, the house is not occupied between 8 AM and 5 PM, consequently, the indoor temperature was allowed to rise because no discomfort level will be produced and a higher autonomy will be maintained. As shown in Fig. 4.11b, as soon as the utility power is provided, ACU are enabled in order to reduce the temperature near the required reference set by the NSGA-II. The indoor temperature is reduced as much as possible during grid availability in order to take into account the next power outage period during which no ACU can be operated. Consequently, a high autonomy level is maintained for the unpredictable devices.

4.2.6 Advantages of the DSM for the case study

The proper operation of the DSM scheduling layer according to each of the considered predictable loads has been validated. The main benefits and the good results of the DSM program can be highlighted by comparing the energy status of the system before and after the application of the DSM. The first scenario assumes an ideal schedule reflecting the residents’ preferences, completely respecting their comfort level, and disregarding the autonomy of the system. Thus, this scenario will be able to maintain the indoor air temperature, the hot water temperature and the operation of the WM to the desired settings. The simulation results are presented in Fig. 4.12. Figs. 4.12a and 4.12b plot the SOC of the

battery bank, EPV , EL, and EG−AC. As shown in Fig. 4.12a, during the 10 AM to 2 PM period, the SOC of the battery bank falls rapidly to low levels below the 50% DOD, mainly due to the HVAC operation. Consequently, a loss of power supply is recorded during the day. The control system will not allow the occurrence of such an event and will cut the power off the loads in order to avoid further usage of the stored energy in the batteries. Moreover, it is clear that two full charging cycles of the battery bank are needed when no load management is applied in contrast with only one after the application of the DSM. Consequently, the implemented control leads to the extension of the lifetime of the batteries in addition to the maintenance of a 78 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

100 100 SOC 80 SOC 90 (%) 60 (%) 80 40 70 E 1.5 E 1.5 PV 1 PV 1 (kWh)0.5 (kWh)0.5 0 0 5 E 5 E L 2.5 L 2.5 (kWh) (kWh) 0 0 5 5 E Grid Status E Grid Status G-AC 2.5 G-AC 2.5 (kWh) (kWh) 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (a) EF without scheduling (b) EF after scheduling

6 5 Grid Status Baseload Grid Status 5 WM 4 Base Load SEWH WM 4 HVAC SEWH 3 HVAC 3 2 2

1

Energy consumption (kWh) consumption Energy 1 Energy Consumption (kWh) Consumption Energy

0 0 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (c) Detailed load energy consumption without scheduling (d) Detailed load energy consumption after scheduling

7 6 Grid Status Grid Status 6 5 5 4 4 3 3 2 2 Power consumption (kW) Power consumption Power consumption (kW) Power consumption 1 1

0 0 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (e) Power consumption without scheduling (f) Power consumption after scheduling

Figure 4.12: Comparison of the two scenarios: with and without DSM

permanent power supply to the house. Thus, less battery replacements are needed during the 20-year lifetime of the project. It can be seen in Fig. 4.12b that between the 10 AM to 2 PM blackout period, the PV panels were in charge of feeding the load and were able to maintain a high SOC level in the battery bank at the same time due to the high solar insolation. By comparing the aggregated load demand of the house plotted in Figs. 4.12c and 4.12d, it can be noticed that in the former, the consumption profile is wide spread over the day, whereas in the latter, the DSM managed to concentrate the high energy demand during periods when the grid power is available. Furthermore a lower peak energy and power demand are reached after applying the DSM. Fig. 4.12e shows that without the load management process, the peak power demand occurs during a power outage period which

is unacceptable. Furthermore, the high power demand approaches the 6.5 kW Pmax threshold risking triggering the main breaker of the house. This is not the case when the DSM is applied as shown in Fig. 4.12f. The power consumption reaches its high levels during grid availability. The CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 79

peak power demand of the house remains below 6 kW. Shifting the high power consumption to the 6AM-10AM period allowed the preservation of a high amount of energy in the battery bank to be used later on during the day and to take into account the non predictable loads activation. The DSM program was able to avoid draining the battery bank, reaching a minimum SOC value of 71% after the scheduling layer. Without the application of a scheduling layer, a 9.5% LPSP is recorded, accounting to nearly 4 kWh of energy deficit during the simulation period. The simulation results show that the developed DSM program has a great influence on the PV-Battery backup system sizing results. Consequently, it can contribute to a remarkable reduction of the overall cost of the system due to several reasons. First, a lower initial number of components can be installed. A 9.5% LPSP resulting from the reduced 8 PV-12 batteries backup system configuration is perfectly handled by the DSM. No LPS occurs, therefore a great drop of the cost of the system (29%) is achieved compared to the 14 PV-20 batteries configuration. Second, a softer charging/discharging cycle of the batteries is achieved compared to when no DSM is applied which will increase the lifetime of the batteries. Consequently, less replacements will be needed during the 20-year lifetime of the system, and less energy is used from the grid for the battery charging process which in turn will highly decrease the total price of the backup system. Therefore, validating that coupling the PV-Battery backup system with the proposed well performing DSM program is of great importance.

4.3 Real Time layer

The RT load controller is developed in order to manage unpredictable loads in the residential application. These devices do not have specific activation times and the duration of their operation is very hard to be predicted. The main concern is ensuring a zero LPSP during the day while taking into account the residents’ preferences. Therefore, load operation priority levels are set by the user in order to favor the operation of a device against the other whenever they are requested to be activated during the same period of time. The RT layer will also have to ensure that the operation constraints of the PV-Battery backup system will not be violated (e.g. respect the subscribed power extraction limitation from the grid). Thus, the decision making relies highly on several factors as the prevention of the occurrence of a loss of power supply, the preset priority levels applied by the user, the operational constraints of the installed system, and the scheduling results determined by the higher predictive control layer. This layer updates the EF in the system and passes it to the RT control which will decide to enable or disable the unpredictable devices. 80 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

4.3.1 Control Algorithm

The considered day is divided into periods of 5 minutes, after which the control will check which devices are operational or not. Consequently, the RT layer is triggered by the occurrence of two events: the request of activation of an unpredictable load (case 1), and each 5 minutes (case 2). A simplified representation of the testing procedure of the RT layer is shown in Fig. 4.13a. Both considered RT layer activation cases are depicted in Fig. 4.13b.

Inputs: House Load profile determined by scheduling layer ; Energy flow of the system predicted over 24 hours;

Power consumption (PL) and activation times of unpredictable devices

Case 1: Device activation request Case 2: Five minute sampling period

Find requested device Find activated devices by priority order

Update house load profile (EL) until the end of the 5 minute period for each device

Compute EF & LPSP over the remaining period of the day

Check if LPSP & Pmax constraints are violated => Enable / Disable Devices

(a) RT layer simplified flow chart

Case 1 t Device 1 rem Device 2 Device 3 Case 2

Device 4 Device 5 t =5 rem Device Activation Requests Activation Device

0 5 10 15 20 25 30 35 40 45 Time (min) (b) RT layer triggering events

Figure 4.13: RT layer overview

Whenever a load activation is requested (case 1), the RT layer will compute the amount of

energy consumed by the activation of the considered device based on the remaining time (trem) of the considered 5-min period. The load demand is then updated over the rest of the day and the EF in the system is re-calculated, followed by the LPSP computation. The RT layer then checks whether any of the operation constraints are violated or if the SOC of the batteries will CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 81

fall below the 50% DOD. Accordingly, the decision to enable or disable the device for the rest of the 5-min period is determined. The RT layer checks the states of the devices each 5 minutes (case 2). For instance, by examining Fig. 4.13b, at minute 20 of the day, devices 2 to 5 are operating. The RT control will iterate over these devices in priority order. Starting with the device with the highest priority, it is assumed to

operate for 5 additional minutes (trem=5). Its corresponding power and energy consumption are added and re-calculations are conducted as in case 1 in order to update the EF and determine a decision. This process is repeated for the rest of the operational devices until control signals are generated for each of them.

4.3.2 RT controller simulation results

Matlab simulations of the proposed RT controller are conducted in order to check its good performance and reliability. The same simulation conditions employed for the testing of the predictive scheduling layer are applied. The RT control is assessed by analyzing the test results considering harsh summer conditions along with a very high amount of blackout hours. The predictive scheduling layer is operated at the beginning of the day and the optimal schedule to be applied for the next 24 hours is determined. This latter is given as an input to the RT layer in order to determine the control decisions of the unpredictable devices operated during the day.

The activated unpredictable devices along with their power consumption (Pcons) are shown in Table 4.1. Fig. 4.14 shows the control results determined after the activation of the RT layer, where the black and orange lines delimit the periods when the grid energy is blacked out and available respectively. The required activation time and duration of each device are shown in Fig. 4.14a. The devices are initially enabled. Almost all of them were enabled for their complete activation time due to the high amount of energy reserved in the battery bank. This furthermore proves the optimal operation of the developed predictive scheduling layer. A high amount of energy is reserved for the inevitable operation of unpredictable devices by the scheduling layer due to the autonomy maximization process. Two high power consuming devices were disabled for only 5 minutes. At 6 PM, the iron was not allowed to operate during the first 5 minutes of the hour. This decision can be justified by examining the power consumption of the house after the execution of the RT layer shown in Fig. 4.14b. It is clear that during the 6PM-7PM period, the peak power consumption reaches a high 5.8 kW during the first five minutes. This is due to the activation of the microwave for 2 minutes at 6 PM. The iron consumes an additional 2.5 kW

Table 4.1: Unpredictable devices power consumption (W) in priority of execution order Device Microwave Hair dryer Hair iron Iron Vacuum cleaner Pcons (W) 1500 1550 200 2500 700 82 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

6 Grid Status ON Grid Status Microwave 2 mns 2 mns 5 Hair dryer Microwave activation times 30 mns 4 Hair Iron Hair Dryer activation time 15 mns Iron 15 mns Hair iron activation time 3 Vacuum 1 hr Iron activation time 2 1 hr Device Enable Status Enable Device Vacuum activation time 5 mns 5 mns (kW) Power consumption 1

OFF 0 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (a) RT devices status (b) Power consumption after RT layer execution

2.5 Grid Status 100 SOC (%) 75 2 50 1.5 E 1 1.5 PV 0.5 (kWh) 0 4 1 E L 2 (kWh) 0

Power consumption (kW) Power consumption 0.5 5 Grid Status G 2.5 (kWh) 0 0 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (c) Power consumption added by the activation of RT (d) EF after RT layer execution devices

2.5 Grid Status Grid Status 20 2

15 1.5

10 1 ΔSOC (%)

0.5 5 Energy consumption (kWh) consumption Energy

0 0 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (e) Energy consumption added by the activation of RT(f) Additional ratio of energy used from the battery bank devices by the RT layer

Figure 4.14: RT layer simulation results which will lead to surpassing the maximum amount of power allowed to be extracted from the grid (6.5kW) and consequently triggering the main breaker of the house. Since the microwave is set to have a higher priority compared to the iron’s, the latter service was disabled, until the microwave finishes its operation. The iron was prevented to operate for the first step time due to the constraints violation despite the availability of energy in the battery bank. The added power consumption to the house load profile by the RT layer decisions is shown in Fig. 4.14c, during the first 5 minutes of the 6PM-7PM period an additional 1.5 kW was extracted, then the addition of 2.5 kW corresponding to the iron took place. The EF in the backup system after the RT layer execution is plotted in Fig. 4.14d, the load profile of the house is modified and the additional amount of energy is shown in Fig. 4.14e. Despite higher energy demands during blackout periods before 6 PM, the system is able to maintain a high amount of energy in the battery bank. CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE 83

During the 8PM-9PM period, two devices are requested to be activated, the hair dryer and the hair iron, having a power consumption of 1550W and 200W respectively. At the end of the previous step the SOC was nearly 75%, which led to allowing the hair dryer’s activation for 25 minutes rather than 30. The 15 minute activation of the hair iron will consume less energy than that of the hair dryer’s operation for 5 minutes. Therefore the former was enabled and the latter was turned off in order to prevent the SOC from falling below the 50% threshold. ∆SOC is represented in Fig. 4.14f, it plots the difference between the SOC of the battery bank before and after the execution of the RT layer. A maximal additional extraction of 20.5% of the SOC is achieved, which results in a SOC ratio higher than 50% when extracted from the minimal SOC attained in the scheduling layer (71%). The presented simulation results show a high degree of reliability of the developed RT controller. No LPS is recorded during the day despite the high energy consumption, the high amount of grid blackouts, and the highly reduced PV-Battery configuration. Moreover, the RT layer testing results proved the robust performance of the control regarding the satisfaction of the required objectives, the operation constraints of the PV-Battery backup system, and the user’s preferences and comfort level.

Conclusion

This Chapter develops a robust DSM of a high energy consuming residential application under intermittent grid energy. A load classification process is done in order to associate each of the installed home appliances to one of two control layers: the predictive scheduling layer and the RT control layer. The former layer aims at determining the operation cycles of the predictable devices in order to determine a load operation schedule to be applied during the day. The latter RT control layer targets the unpredictable residential electrical appliances. It dynamically determines a decision regarding enabling or disabling the unpredictable devices according to the energy status of the system and its operation restrictions, as well as the preset priority levels by the users. The scheduling problem is formulated as a MOO program, the NSGA-II is the technique of choice. The number of decision variables, objective functions, and constraints were optimized relatively to the case study, which resulted in a fast and reliable management program. A FDM implementing the preferences of the users was created for an automatic trade off process. Simulation results under multiple conditions are presented for the validation of the high flexibility of the control. High energy consuming states of temporary services as the WM were shifted to periods when the grid power was available in order to avoid draining the batteries. Permanent services as the SEWH and the HVAC systems were efficiently controlled to reduce the energy consumption as well as maintaining a high level of comfort of the users. Moreover, the DSM 84 CHAPTER 4. DEMAND SIDE MANAGEMENT PROCEDURE

harnessed the great potential of thermal loads to act as storage devices. No loss of power supply occurred during the day, no operation constraints were violated, and a great compromise was achieved between maintaining low discomfort levels to the users, respecting their load preferences, and ensuring a high autonomy level of the system despite the high amount of grid blackout hours. The resulting predicted EF is passed from the scheduling layer to the RT layer for the decision making process concerning enabling or disabling unpredictable loads. Five appliances are considered for the testing of the dynamic load control. The simulation results show that the control was able to maintain a permanent energy supply to the house while respecting the user predefined priority levels and the system operation constraints. The control algorithm achieves a high level of coordination between the several components of the system as the grid, the PV panels, the battery bank, and the load demand. Realistic and technical constraints concerning the operation of each component of the installation are integrated in the model. Furthermore, the proposed DSM is robust, generic, and highly adaptable to the applied conditions as the occupancy hours, hot water demand, solar and blackout data. The simulation results show that the benefits of applying a DSM program coupled with a PV-battery backup installation are not restricted to the operation optimization of the system. Very high price reductions of the overall backup system can be achieved due to the need of lower number of components for a good operation of the system, a lower number of battery replacements during the lifetime of the project, and a lower amount of energy extracted from the grid for the battery bank charging process. Chapter 5

Demand Side Management hardware im- plementation

Contents 5.1 Predictive layer implementation on the ARM cortex-A9 ...... 86 5.1.1 Weighted sum GA optimization problem formulation ...... 87 5.1.2 C code of the DSM predictive layer ...... 91 5.1.3 DSM predictive layer implementation results ...... 92 5.1.4 Comparison of the DSM predictive layer optimization algorithms . . 95 5.2 Real time layer implementation on the ARM Cortex-A9 processor . . . . 97 5.2.1 C code of the RT layer ...... 97 5.2.2 DSM RT layer implementation results ...... 98

The hardware implementation is a mandatory procedure when considering a residential load controller. A thorough analysis of the various aspects of the implementation such as the choice of the hardware, the programming technique, the computation time, the required hardware resources, and the hardware and development cost has to be conducted. That is, the full load management codes are implemented on ARM Cortex-A9 processors, which will allow the assessment of the performance and required computational effort of the developed DSM program. The control layers are coded in C and optimized for a low memory consumption and a highly generic and flexible control. The existing dual-core ARM cortex-A9 processors on the ZedBoard are used for the implementa- tion process. The board features a Xilinx ZYNQ XC7Z020 combining dual-core ARM cortex-A9 processors and FPGA fabric logic [138]. This platform can be of great use to extended works on the DSM including data acquisition, data processing, and data prediction modules. More- over, timing benefits can be achieved by using System-On-Chip (SoC) solutions by off-loading parallelized modules from the processors to the logic fabric and thus achieving a faster control process. The structure of the developed code allows the isolation of various modules which

85 86 CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION

can be migrated later on from the processor to FPGAs. These latter have been widely used for hardware in the loop processes and were reported to be very efficient compared to processor based implementations [139, 140]. Therefore, they represent a suitable platform for the future implementation of the predictive load models as the SEWH, HVAC system, the WM, and other home appliances. On the other hand, the RT layer is highly sequential and is based on a series of tests and loop calculations. Thus, a processor based implementation approach of the RT control is more suitable. The hardware implementation of the predictive DSM layer should determine the optimal load control schedule to be applied to the house in a fast manner. Additionally, the implemented code should consume the lowest possible amount of memory resources of the hardware platform due to several reasons. Firstly, due to the future addition of modules in charge of computing the predicted input data to the control algorithm. They are based on learning and model identification algorithms which will require additional memory space. Secondly, due to the incorporation of processes dealing with prediction uncertainties that will need to correct, in a fast way, the decision making procedure following urgent and unpredictable events (e.g. modification of the grid blackout schedule). Thirdly, the memory space reservation and the fast computation time of the predictive layer have to be ensured in order to take into account the possible integration of additional home appliances which will require further memory resources, constraint imposition, and computational effort of the algorithm. The scheduling layer ensures a high degree of coordination and interconnection between the var- ious components of the PV-battery backup system on a 24 hour basis. It involves small sampling periods for some predictive load models such as the SEWH and the HVAC system. This high level of reliability requires a high number of modules, function calls, and iterations, resulting in a notable computational effort. Consequently, ensuring that such a developed management system can be implemented on a low cost device along with its peripheral modules is crucial. The cost of the target device is directly correlated with its computational capacity, and since the cost reduction is always a golden target for any developed control system, there is great interest in keeping the implementation of the proposed DSM along with its future extensions within the capabilities of a ZYNQ.

5.1 Predictive layer implementation on the ARM cortex-A9

In Chapter 4, a predictive scheduling layer has been developed aiming at determining the operation cycles of the predictable loads. The problem is formulated as a MOO problem and the NSGA-II optimization technique was used in order to produce a Pareto set of optimal solutions (i.e. Predictable load activation schedules to be applied during the next day). A single optimal schedule reflecting the user preset preferences has to be applied, therefore, a FDM was created CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION 87

for an automatic trade off process in order to obtain a single optimal load operation schedule to be applied during the next day. The simulation results proved the algorithm to be very efficient and accurate. However, the use of an a priori MOO method as the weighted sum method is more advantageous than the NSGA-II for the hardware implementation process of the predictive DSM layer owing to several reasons. First, the proposed DSM program does not seek a trade-off process to be done by the user. In fact, this latter should be completely transparent towards the control program. Therefore, it is of great interest to produce a single optimal solution rather than a Pareto set of optimal solutions. Second, the implementation process of an a priori optimization method is straightforward and consumes less memory resources of the target hardware which is a crucial concern for the full DSM implementation. More modules are involved when choosing the NSGA-II method, as the FDM, therefore avoiding the implementation of unnecessary additional tasks is of great importance. Moreover, the NSGA-II requires additional memory storage space due to the fast non-dominated sorting process depending on the used population size [129]. Another drawback of the NSGA-II is its computational complexity which increases with the number of considered objective functions. A higher computational burden will lead to a higher usage of memory resources and a potential increase in the computation time of the decision. These implementation weak points can be avoided by joining all the objective functions into a single one, and solving the problem using a SOGA.

5.1.1 Weighted sum GA optimization problem formulation

When opting for a weighted sum method, the biggest concern is the choice of the weighting coefficients to be applied for each objective function [141, 142]. This method is avoided whenever there is no clear way to compute reliable values of the weights given their high influence on the optimization results. However, in the context of the proposed load management program, the user preferences are clearly known, the weighting coefficients are constant and only change according to the considered season i.e. the load priorities differ between the summer and winter seasons. Nevertheless, special care must be taken whilst choosing the proper weighting factors, in order to obtain the high level of accuracy provided by the FDM regarding the implementation of the user preferences.

Solving an optimization problem with Ko objective functions by applying the weighted sum method is done through assigning a weight wo to each normalized objective function fo(x) and summing these latter into a single objective function f (x) to be minimized. The optimization 88 CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION

problem can be formulated as shown in Eq. (5.1).

 Ko Ko minimize f (x) = wo fo(x); wo = 1  x ∑ ∑  o=1 o=1 (5.1) subject to g (x) ≤ b , j = 1,...,m.  j j   xin f ≤ x ≤ xsup

Initial population creation Ngen = 1

Ngen = Ngen + 1

Selection (App. C - Algorithm C.1)

Crossover (App. C - Algorithm C.2)

Mutation (App. C - Algorithm C.3)

New population generation (App. C - Algorithm C.4)

Stopping No Yes criteria reached?

Exit GA Optimal solution found Figure 5.1: GA Optimization flowchart

The proposed predictive DSM program considers 4 objective functions (Ko = 4). The objective functions to be minimized are the discomfort levels produced by the management of the WM, HVAC, and the SEWH. The fourth objective function to be maximized is the autonomy level

of the system. Maximizing An is equivalent to minimizing (1 − An), given that An is always positive. The computation of the objective functions and the imposed constraints on the control algorithm are explained in Chapter 4. Thus, the optimization problem can be formulated as CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION 89 shown in Eq. (5.2)  minimize f (x) = wWMD(WM) + wSEWH D(SEWH) + wHVACD(HVAC) + wA(1 − An)  x  subject to t(WM ) = t(WM ) + 60 min = t(WM ) + 105 min;  3 2 1   LPSP = 0    P P ; ∀ k L,k 6 max (5.2)  9 AM 6 t(WM1) 6 4 PM    15°C 6 θHGA 6 49°C    18°C 6 θinGA 6 24°C    0 6 nbAC 6 4 The GA optimization method is applied in order to solve Eq. (5.2) to the end of finding the optimal load operation schedule to be applied during the next day. Fig. 5.1 describes the steps of the proposed GA, the developed pseudo-codes are detailed in Appendix C. The main implemented modifications in order to suit the load management program can be described as follows: • The initial population creation represents the first step of the GA optimization. It consists in the generation of a random population within the preset boundaries and respecting the constraints of the predictive DSM layer shown in Eq. (5.2). • The selection process chooses individuals from the population to be part of the mating pool for the generation of the offsprings. A fitness sharing method is applied in order to reduce the chances of selection of identical solutions. Such a procedure will allow to maintain the diversity of the generated populations as well as to avoid the premature convergence of the algorithm. Identical individuals are penalized by lowering their selection probability relatively to their number of duplicates in the population. • The crossover process: A two point crossover method is applied as shown in Fig. 5.2. In order to ensure the correct implementation of the WM continuity constraints, the first crossover point is prevented from falling between one of the WM related decision variables. Otherwise, the continuity of the WM states will not be guaranteed. • The mutation process is applied in order to maintain the diversity of the generated

population. According to the preset mutation probability (PMut), the number of individuals to be mutated in the generation is determined. The concerned decision variables will be altered within their defined boundaries. • The new population generation process consists in combining the initial population and the produced children into a single solution set. The fitness value of all the individuals is evaluated by applying the developed Energy Flow (EF) models as well as computing the discomfort and autonomy levels. Accordingly, the solution set is sorted in order to 90 CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION

determine the best individuals that will be passed to the next generation. A death penalty method is used in order to implement the imposed constraints. A high fitness value is

assigned to whichever individual that violates the LPSP and Pmax constraints. • The Stopping criteria will force the GA to exit and stop the search for the optimal solution. The optimization will stop in case one of the two following events occurs: First, when

a maximal amount of computed generations is reached NGen,max. Second, if the best fitness value variation is less than the preset tolerance level tol over a preset number of

stall generations Nstall. Restricting the stopping criteria to NGen,max will require previous knowledge on the estimated required number of generations to be produced in order to

reach the optimal solution. Consequently, an inflated NGen,max will result in a higher

computation time and effort of the algorithm. The addition of the Nstall stopping criteria will prevent the GA from producing unnecessary generations. However, a small number

of stalling generations might cause premature convergence of the GA, therefore Nstall should be carefully chosen.

First Crossover Point First Crossover Point Limit Second Crossover Point Parent 1

t t t θ θ θ θ θ θ nb nb nb WM, 1 WM, 2 WM, 3 HGA HGA HGA HVAC HVAC HVAC AC AC AC

t t t θ θ θ θ θ θ nb nb nb WM, 1 WM, 2 WM, 3 HGA HGA HGA HVAC HVAC HVAC AC AC AC Parent 2

Offspring t t t θ θ θ θ θ θ nb nb nb WM, 1 WM, 2 WM, 3 HGA HGA HGA HVAC HVAC HVAC AC AC AC

Figure 5.2: Two point crossover process assuming NVar = 12

The fitness evaluation of the produced individuals is highly influenced by the weighting ratios assigned to the various objective functions. The weighting factors should reflect as accurately as possible the user preferences in order to favor the operation of certain tasks over others by directly modifying the optimality of the solution. It has been proven in Chapter 4 that the developed FDM accurately represented the load preferences of the users. Therefore, the choice of the weighting coefficients for the predictive DSM layer is based to a great extent on the fuzzy rules determination process of the FDM shown in Algorithm 4.1. The assigned scores are a direct image of the human experience and knowledge of the proposed load management procedure. Thus, the weighting coefficients can be found by summing the attributed scores for each linguistic value of each input resulting in the following set of coefficients for the considered

summer case {wWM = 2/12, wSEWH = 1/12, wHVAC = 3/12, wA = 6/12}. CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION 91

5.1.2 C code of the DSM predictive layer

A detailed predictive DSM layer is coded in C in order to implement it on one of the ARM cortex-A9 processors of the ZYNQ. The developed C codes implement a customized GA incorporating the suitable constraints and parameters to the load management problem. The scheduling algorithm is developed, including the GA optimization process, the fitness evaluation, the EF computation, and the predictive load models. The hierarchy of the developed program and function calls is shown in Fig. 5.3.

Inputs Main Function

1 Data processing GA functions: 2 Sel/Cross/Mut GA function: 4 3 New_Pop DSM Objective Function 6 5 lmprocessing Energy Flow Computation 7 WM disc. SEWH Model

8 SEWH disc. Ts = 1 mn

9 HVAC disc. HVAC Model T = 5 mns 10 Autonomy s Ts = 1h Figure 5.3: Function calls of the developed DSM C code

All input data are assigned in the main function of the program. They include the characteristics and coefficients of the load models; the number of PV panels and batteries installed for the backup system; the predicted weather conditions, house occupancy hours, and grid blackout schedules; along with the required settings and optimal reference points for the operation of the loads representing the user’s preferences. The management program will first analyse the input data set, extracting all necessary information for the decision making process. The data processing function will determine the number and periods of the blackout hours, the

number of grid intermittency cycles ncyc, and consequently the number of decision variables NVar. Additionally, the function will compute the hourly amount of produced energy by the PV panels for the 24h EF prediction process. Once the input data is analyzed and all the required information is extracted, the main function will initialize the problem optimization by calling 92 CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION

the GA. During every new population generation process, the fitness value of all the involved individuals as well as the produced children should be analyzed (as shown in Algorithm. C.4, line 4). The DSM objective function is then called for each individual in order to determine its fitness value. Consequently, the reduction of the assigned number of individuals will lead to a lower amount of function calls and therefore a high reduction of the computational effort of the implemented control. Each individual represents a set of load operation schedules to be applied during the next day. Therefore a thorough analysis of the EF of the system is done in order to determine the resulting discomfort levels and the autonomy of the system. Following the implementation of the load models of the SEWH, HVAC, and the WM, the hourly energy consumption of these latter can be computed. The total load demand is determined by adding the energy consumption of the predictable loads to the base load of the house. The number of decision variables will highly affect the amount of memory resources needed

for the DSM implementation. The developed strategy for the determination of NVar explained in Paragraph 4.2.2 is extremely efficient for the hardware implementation process. It reduces drastically the array dimensions of the generated populations by the GA. On the other hand, the bit sizes and formats of the involved variables in the DSM are carefully chosen for memory space reservation.

5.1.3 DSM predictive layer implementation results

The employed implementation conditions are identical to those applied in Chapter 4; a summer case is considered with a very high amount of grid blackout hours occurring during peak load demands. The applied grid blackout schedule leads to 21 decision variables to be determined by the GA. Three of which are assigned for the 3-state WM operation, whereas 6 decision variables are assigned for each of the reference temperature of the SEWH and HVAC, as well as the number of operating ACU. The applied GA parameters are shown in Table 5.1. A

set of NInd was tested in order to find a compromise between the accuracy of the solution and the complexity of the implementation. There is great interest in maintaining a low number of individuals per population due to its direct effect on the number of function calls and therefore

the computational effort of the overall optimization. An optimal NInd value of 40 individuals was selected as the best population size. The optimal solution is reached by applying an 80%

Table 5.1: GA parameter settings for the predictive DSM layer Parameter Value Parameter Value NInd 40 PCross 80% NGen,max 200 PMut 10% −6 Nstall 20 tol 10 Stack size 200 KB CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION 93

and 10% crossover and mutation rates respectively. The stopping criteria of the algorithm is

determined by setting the maximum number of generations allowed to be produced NGen,max as well as the number of stalling generations Nstall.

0.8 0.45 Best Fitness Value D(WM) A n D(HVAC) 0.6 0.4

0.4 0.35 Value Fitness Value Fitness N 0.2 stall 0.3 0 0 12 24 36 48 60 72 82 0.29 0.291 0.292 0.292 0.293 0.3 0.31 0.322 0.325 0.37 0.38 0.4 0.41 0.42 Generation Fitness Value (a) Convergence of the GA towards the optimal solution (b) Objective function values during GA convergence

Figure 5.4: Predictive DSM layer GA optimization convergence

The convergence of the GA towards the optimal load schedule to be applied during the next day is plotted in Fig. 5.4a. 82 generations were produced in order to reach the optimal solution, requiring a computation time of 18.35 s. The stack size is increased to 200 KB for the proper operation of the code due to the high amount of executed iterations and involved data. Fig. 5.4a shows that a lower number of stall generations would have led to a suboptimal solution of

the optimization problem. Therefore, setting Nstall to a value of 20 allowed reaching the best solution while reducing as much as possible the computational effort of the GA. The values of the objective functions during the convergence of the GA as a function of the equivalent fitness value are shown in Fig. 5.4b. D(SEWH)is neglected due to the high solar insolation levels and low hot water demand under summer conditions which result in a zero discomfort level for the water heating process. It is clear that the improvement of the autonomy level is the dominant target for the GA at the cost of increasing D(WM)and D(HVAC). Throughout the course of the generation production process, solutions with high levels of autonomy are retained and chosen as the best individuals. This is due to the fact that the highest weighting coefficient has been

attributed to An. The GA successfully converged to an optimal solution that achieves a good compromise between the discomfort levels and the autonomy of the system. The load control results following the application of the optimal schedule determined by the GA are shown in Fig. 5.5. The implementation results were retrieved from the ZedBoard via a serial UART connection. The stored data were then exported to MATLAB for plotting. The developed GA was able to determine a better activation time of the WM compared to the NSGA-II. The implemented solution shifted the first state of the WM by a period of 45 min (Fig. 5.5a) rather than one hour. The time shift corresponds to the required operation duration of the first WM state which consumes the highest amount of energy. The activation time of the washing process 94 CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION

Grid 35 Scheduled operation time

Status C) 32.5 t (WM ) Required operation time o opt 1 30 Occupancy Grid Status ON 27.5 θ Activation shifting outdoor 25 boundaries tmin (WM1) tmax (WM1) 22.5 Shifted ( Temperature 20 θ θ inGA 45 mns indoor

WM status WM nb 4 AC 3 2 1 0 OFF Nb.ACs 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (a) WM control (b) HVAC control

6 Grid Status 100 SOC 90 5 (%) 80 70 E 1.5 4 PV 1 (kWh)0.5 0 3 5 E L 2.5 2 (kWh) 0

Power consumption (kW) Power consumption 5 1 E Grid Status G-AC 2.5 (kWh) 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Time (h) Time (h) (c) Power consumption profile (d) EF implementation results

Figure 5.5: Predictive DSM layer implementation results on the ARM cortex-A9 was brought closer to the preset optimal operation time of the task by reducing the shift from 1 h to 45 min. The second state of the washing process is fully operated during the 10 AM - 2 PM blackout period which does not decrease the autonomy level of the system due to the low power consumption of the WM during its second operation state. The continuity constraints of the three washing states are respected and implemented successfully. The permanent loads were appropriately managed by the proposed predictive layer as well. The hot water temperature inside the water tank remained at a high level for the complete day. The high solar insolation

and low hot water consumption profile allowed the maintenance of an acceptable θH resulting in a nil discomfort rate. Furthermore, the developed SOGA was able to harness the energy storage potential of the thermal loads as shown in Fig. 5.5b. The indoor air temperature was maintained near the preset comfort levels during the house occupancy periods. The ACU are operated during grid availability periods in order to avoid draining the battery bank due to their high electrical energy consumption. The proposed predictive layer successfully manages to coordinate between the imposed comfort levels, the blackout hours, the occupancy periods, and the EF in the system in order to find the best trade off for the control of the HVAC. Fig. 5.5c plots the power consumption profile of the house after the predictive DSM layer implementation. It is clear that the implemented control shifted the peak load demands to periods of grid availability,

thus ensuring a high autonomy level of the system. Moreover, the Pmax constraint added to the GA is well respected i.e. the power consumption of the house is maintained lower than the 6.5 kW threshold. Fig. 5.5d plots the detailed predicted EF in the system for a complete day. The CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION 95

SOC of the battery bank is kept at a high level during the complete period. The implemented load management program ensures a zero LPSP by preventing the SOC of the batteries from falling below the the 50% DOD threshold. The high energy demand is concentrated during grid availability periods therefore sparing the energy stored in the battery bank for the unpredictable loads activation.

5.1.4 Comparison of the DSM predictive layer optimization algorithms

Several methods were applied in order to test the performance of the developed DSM predictive layer as cited below: • First, a multi-objective optimization approach was applied to the end of finding the best load operation schedule of the house. The NSGA-II optimization algorithm is the method of choice. This technique produces a Pareto set of optimal solutions, thus a FDM is developed in order to find the best solution among the Pareto set according to the user’s preferences. • Second, the multiple objective functions were combined in a single one by adding weight- ing coefficients reflecting the priorities of the residents. A SOGA is used in order to solve the optimization problem. The multi-objective NSGA-II and the SOGA were tested on MATLAB software. • Third, the weighted sum SOGA was coded in C. The developed GA is optimized relatively to the needs of the proposed management program as well as the available resources and imposed constraints of the hardware implementation. The simulations of the Matlab codes and the developed C code were conducted on a 2.6 GHz Intel core i7 processor, 4 cores, 8 GB 1600 MHz DDR3 memory. • Fourth, the developed C code is implemented on ARM cortex-A9 processors in order to test its good and reliable performance. Fig. 5.6 represents a detailed comparison of the produced results by applying the 4 methods. It compares the final fitness value of the optimal solution in addition to its corresponding D(WM),

D(HVAC)and autonomy level An. The C code simulation results as well as the implementation of the control on the ARM Cortex- A9 showed that the developed code outperformed the MATLAB simulations applying the NSGA-II and the single objective optimization. A lower aggregated fitness value is reached when applying a SOGA compared to the NSGA-II for the predictive DSM layer. This is due to the fact that the performance of Pareto dominance-based algorithms as the NSGA-II is worsened by the increase in the number of objectives [143] unless these latter are highly correlated [144], which is not the case in the developed load management program. The good results obtained when implementing the developed C code validate the suitable choice of the 96 CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION

Fitness Value WM discomfort

GA−ARM 0.2909 0.125 GA−C 0.2909 0.125 GA−Mat 0.2937 0.1613 0.326 NSGA−II 0.1667

0.23 0.25 0.27 0.29 0.31 0.33 0 0.05 0.1 0.15 0.2 Fitness value WM discomfort GA−ARM 0.293 0.6357 GA−C 0.293 0.6357 GA−Mat 0.2897 0.6407 NSGA−II 0.2904 0.5777

0 0.1 0.2 0.3 0.4 0 0.2 0.4 0.6 0.8 HVAC discomfort Autonomy

(a) Objective function values for the 4 optimization methods

120 Number of generations 102 Computation time (s) 100 82 80 80 66 60

40 34 29 18.35 20 2.3 0 NSGA-II GA - Matlab GA - C ARM Cortex-A9 (b) Produced number of generations and computation time of the 4 optimization methods

Figure 5.6: Performance comparison of the four applied optimization methods weighting coefficients. The generated results managed to reach higher levels of autonomy and to implement the imposed user’s preferences with a remarkable accuracy, resulting in a lower D(WM) and a nearly identical D(HVAC) compared to the simulated NSGA-II and SOGA on MATLAB. The number of produced generations and the computation time of the algorithm for each applied method are represented in Fig. 5.6b. The developed C code offers higher calculation speed of the DSM predictive layer. Moreover, it requires the production of a higher number of generations prior to the convergence to the optimal solution. A hardware implementation of the load management program on the ARM cortex-A9 will require 18.35 s in order to produce the optimal schedule to be applied for the next 24h. Naturally, a faster computation time of the algorithm is obtained when simulated on the Intel core i7 processor. CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION 97

5.2 Real time layer implementation on the ARM Cortex-A9 processor

The developed Real Time load controller is implemented on the ARM processor in order to manage the unpredictable loads that will be activated during the day. These devices do not have specific activation times and the duration of their operation is hard to predict. The greatest concern is the insurance of a permanent power supply to the house residents while respecting their comfort levels and maintaining the good operation of the PV-Battery backup system. Every component of the system should be included in the control due to highly critical conditions where the application of an ineffective DSM program will lead to an unacceptable LPS. The predictive scheduling layer updates the EF in the system and passes it to the RT control which will decide to enable or disable the unpredictable devices according to the energy status of the system and its operation restrictions, as well as the preset priority levels by the users.

5.2.1 C code of the RT layer

The RT layer is implemented on one of the ARM cortex-A9 processor of the ZYNQ, thus a C code of the controller is developed. The RT control layer is highly sequential; a high number of tests and loops are executed and a high dependency among the output control signals exists. The Xilinx Tools (Vivado, Xilinx SDK) are used in order to implement the RT layer on the existing ARM Cortex-A9 processor on the ZedBoard. The input devices are emulated by the General Purpose Input Output (GPIO) switches connected to the Programmable Logic (PL) part of the ZYNQ, whereas the control outputs are fed to the on-board LEDs for a concrete visualization of the decision making process. The main program architecture is shown in Fig. 5.7a. The 5 minute sampling is done using a 32-bit timer implemented on the PL, it operates at the same frequency of the FPGA. The timer frequency TMR_freq is therefore set to 100 MHz. An

ZedBoard PC 1 2 3 Connections & Linking Functions Hierarchy Inputs Configuration & Initialization the ZYNQ components UART Main Devices Devices GIC ARM Configure & ARM Program Data Initialize GIC Cortex Storage Timer Devices GIC BSP functions Interrupts Connect & A9 GIC link Timer Timer Interrupt Outputs Interrupt Handlers Devices IH Outputs RT Layer UART Timer IH

(a) Implementation of the RT layer on the ARM Cortex- (b) ARM processor programming procedure A9

Figure 5.7: Real time layer implementation approach on the ARM Cortex-A9 98 CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION

interrupt based approach is applied; at each activation request of a device and/or 5 minute period, interrupts are generated in order to call the RT controller and execute it on the processor. The Generic Interrupt controller (GIC) is in charge of managing the generated interrupts and linking them to the processor. A UART connection is established between the board and the PC in order to retrieve the data from the ZYNQ. Fig. 5.7b describes the ARM processor programming procedure. First, all the used components are initialized then, they are connected to each other and to the processor. Finally, the functions hierarchy is represented. Each Interrupt Source (IS) is connected to its corresponding Interrupt Handler (IH) function which calls the developed RT layer for the decision making process. Fig. 5.8 represents the developed block diagram in the Vivado design suite used to generate the bitstream in order to program the ZYNQ. The generated

axi_timer_0 Timer

S_AXI capturetrig0 generateout0 capturetrig1 generateout1

freeze pwm0

processing_system0_7_axi_periph s_axi_aclk interrupt s_axi_aresetn S00_AXI AXI Timer ACLK rst_processing_system100_0_7M axi_gpio_1 LEDS ARESETN[0:0] slowest_sync_clk mb_reset S00_ACLK S_AXI ext_reset_in bus_struct_reset[0:0] S00_ARESETN[0:0] M00_AXI s_axi_aclk GPIO gpio_rtl_0 aux_reset_in peripheral_reset[0:0] M00_ACLK M01_AXI s_axi_aresetn mb_debug_sys_rst interconnect_aresetn[0:0] M00_ARESETN[0:0] M02_AXI AXI GPIO dcm_locked peripheral_aresetn[0:0] M01_ACLK axi_gpio_0 Switches M01_ARESETN[0:0] Switches Processor System Reset Interrupt M02_ACLK S_AXI GPIO gpio_rtl M02_ARESETN[0:0] s_axi_aclk ip2intc_irpt s_axi_aresetn xlconcat_0 processing_system0_7 AXI Interconnect AXI GPIO In0:0]0] dout[1:0] PTP_ETHERNET_0 In0:0]1] DDR DDR Concat FIXED_IO FIXED_IO USBIND_0 Timer M_AXI_GP0_ACLK M_AXI_GP0 Interrupt IRQ_F2P[1:0] TTC0_WAVE0_OUT TTC0_WAVE1_OUT TTC0_WAVE2_OUT FCLK_CLK0 FCLK_RESET0_N

ZYNQ7 Processing System Figure 5.8: Block Diagram layout on the Xilinx Vivado Design Suite

bitsream in Vivado is then exported to the Xilinx SDK tool where a Board Support Package (BSP) is created and the processor is programmed. The pseudo codes describing the C code implementation of the RT layer and the interrupt handling functions are shown in Algorithms 5.1, 5.2, 5.3. The detailed formats of the main variables of the C code are shown in Table 5.2. Their range of values relative to the case study imposes the bit size to be used. This latter is highly important due to high memory consumption of the code, therefore it is of great interest to reduce the variable sizes where possible without sacrificing the accuracy of the results. Pcons represents the power consumption of the considered devices.

5.2.2 DSM RT layer implementation results

The implemented interrupt based RT layer is tested over a period of 4 hours. An extremely harsh scenario of load activations is applied in order to verify the proper operation of the code CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION 99

Algorithm 5.1 Real Time Layer (RT Layer)

1: procedure RT LAYER(ndev,EF,Psch,DS,t,trem) 2: Pmax[t : 1 : t +trem]=Psch[t : 1 : t +trem]+Pcons(ndev) 3: if Pmax[t : 1 : t +trem] > limit then 4: DS(ndev) = 0 . Disable device during [t,floor(t)+5] 5: else 6: Compute EF over [t;24h] period 7: Compute LPSP 8: if LPSP = 0 then 9: DS(ndev) = 1 . Enable during [t,floor(t)+5] 10: else 11: DS(ndev) = 0 . Disable during [t,floor(t)+5] 12: end if 13: end if 14: end procedure

Algorithm 5.2 Devices Interrupt Handler (DIH) 1: procedure DIH(Req,EF,DS,TMR) 2: Disable additional device Interrupts 3: Get Timer Value; Read(TMR) 4: Find t & trem 5: Read Req 6: Determine which device changed its state (ndev) 7: Determine if Rising Edge (RE)or Falling Edge (FE) 8: if RE then 9: Decision = RT Layer . Call RT layer function 10: if Decision=0 then . Disable requested device 11: Turn off corresponding output 12: Update vector DS 13: else . Decision=1 14: Turn on corresponding output 15: Update vector DS 16: Update EF 17: end if 18: else . FE occurred 19: Turn off corresponding output 20: Update vector DS 21: end if 22: Clear Interrupt status 23: Enable Device Interrupts 24: end procedure under extreme conditions. The hardware implementation is depicted in Fig. 5.9. Fig. 5.10 plots the implementation results on the ZYNQ device compared to the MATLAB simulations. The implementation results were retrieved from the ZYNQ device via a serial UART connection. The stored data are then imported to MATLAB for plotting. The same priority order of the 100 CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION

Algorithm 5.3 Timer Interrupt Handler (TIH) 1: procedure TIH(Req,EF,DS,TMR) 2: Check if Timer is expired 3: Get Timer Value; Read(TMR) 4: Find remaining time of day (hour, minutes, seconds); Reset Timer to predefined reset value; 5: for ndev=1 → 5 . Iterate over ndev following the priority order 6: if DS[ndev]=1 then . If Device ndev is activated 7: Decision = RT Layer . Call RT layer function 8: if Decision=0 then . Turn off the device 9: Turn off corresponding output 10: Update vector DS 11: else . Decision=1 12: Turn on corresponding output 13: Update vector DS 14: Update EF 15: end if 16: end if 17: end for 18: end procedure

Table 5.2: Main C code variables format Variable Qualifier Format Bit Size (bits) Range Pcons[5] Constant Array of Unsigned integers 16 0 - 4000 EPV [24] Constant Array of Unsigned integers 16 0 - 1500 Eb[24] Volatile Array of Doubles 64 8000 - 17000 EL[24] Volatile Array of Unsigned integers 16 0 - 5000 Pmax[1440] Volatile Array of Unsigned integers 16 0 - 6500

Output LED representing UART connection the decision of the to PC RT control layer

Loaded bitstream on the ZYNQ

Input Switches representing the activation of unpredictable loads Figure 5.9: RT layer implementation on the ZedBoard

devices used in section 4.3 was applied, their power consumption is shown in Table 4.1. The devices were requested to be activated in turn and remained waiting for activation for the complete testing period. The grid is blacked out for 2 hours, long enough to drain the remaining CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION 101

45 3 6 Grid Status Matlab

ON 2 1 ZYNQ 5 Priority Levels Microwave 4 Hair dryer 3 Hair Iron Pmax (kW) Pmax Device State Device Iron 2 Vaccum 1 OFF

0 0 0.5 1 1.5 2 2.5 3 3.5 4 0 0.5 1 1.5 2 2.5 3 3.5 4 Time (h) Time (h) (a) RT devices status (b) Updated power consumption after RT DSM implementation

Grid Status Grid Status 4 Matlab 13 Matlab ZYNQ ZYNQ 12 3

11 (kWh) L (kWh) 2 b E E 10 1 9

8 0 0 1 2 3 4 0 1 2 3 4 Time (h) Time (h) (c) Energy stored in the battery bank after RT DSM(d) Updated Load Demand after RT DSM implementation implementation

50 45 40 35 30 25 20 15

Computation time (ms) time Computation 10 5 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Number of activated Devices (e) RT layer decision computation time

Figure 5.10: Real time layer implementation on ARM Cortex-A9 & MATLAB simulation results

energy from the battery bank. This is done in order to check how the RT control reacts when such events occur. The computed decision by the RT DSM is shown in Fig. 5.10a. Where the ON and OFF states represent an enabled and disabled device respectively. During the first hour period, the grid power is available for the load as for the charging of the battery bank. The Microwave is activated first (minute 15), followed by the vacuum cleaner (minute 20), then by the Iron (minute 25). By this time, the power consumption nearly reached 6kW as shown in Fig. 5.10b. At the 30th minute, the hair dryer was requested to be activated, which would add 1550 W to the power consumption of the house resulting in surpassing the 6.5 kW power threshold. Therefore the hair dryer was disabled for the next 5 min. However, since it has a higher priority than the Iron, at minute 35, the hair dryer was enabled and the Iron was prevented from operation due to the integrated power limitation constraint in the RT DSM. Thus, the device is kept disabled for the rest of the simulation period. At minute 40, the hair iron device was requested and enabled 102 CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION

due to high energy availability and the low power consumption of the device thus no risk of triggering the main breaker of the house. At the end of the first period, a grid blackout takes place. The battery bank is initially nearly fully charged as shown in Fig. 5.10c. It is able to maintain the operation of the requested devices for approximately an hour. Afterwards, the SOC of the battery bank witnesses a severe drop near its minimum allowable value. Consequently, high energy consuming devices were disabled first (Hair dryer, Vacuum & Microwave), and eventually all the devices were shut down due to the lack of stored energy inside the battery bank between the hours 2 & 3. During this period, the load demand (Fig. 5.10d) dropped to very low levels. At the beginning of the fourth hour, the grid is rendered available again. Since it is in charge of feeding the loads, all the unpredictable devices were enabled except for the one that violates the maximum power constraints according to its priority level: the iron. One of the main concerns when implementing a highly sequential code on a processor is the computation time of the algorithm. In this case, it represents the needed computation time in order to determine the control outputs of the unpredictable devices. Fig. 5.10e plots the maximal computation time required by the developed RT controller. When a device is enabled, the decision making process requires 2.3 ms. This duration grows proportionally with the number of considered devices. The 5 minute timer loop will iterate over all the activated devices and update the EF of the system. Therefore, if 5 devices are considered and were operating at a certain time, the RT layer will require nearly 16 ms to produce the required output. Consequently, the developed code is highly suitable to be implemented on the ARM cortex-A9 processor. Limited amount of memory was consumed without sacrificing the reliability nor the accuracy of the code. The MATLAB simulations are identical to those obtained from the hardware implementation results with an extremely low error as shown in Fig. 5.10. Additionally, a very fast decision making process is developed, which is mandatory for a real-time controller development.

Conclusion

In this chapter, a detailed hardware implementation of the full DSM of a residential house under intermittent primary energy source is presented. An optimized weighted sum GA code is developed in order to ensure a high operation reliability of the installed PV-battery backup system. Both the predictive and RT layers of the DSM were coded in C to the end of implementing them on an ARM cortex-A9 processor. The optimization problem formulation is presented in detail. The algorithms compromised between the computational effort requirement of the proposed code, its memory resources consumption, and its high level of reliability and accuracy. The implemented predictive DSM layer accurately respected all the imposed constraints on the GA: the decision variables are kept within their bounds, the continuity of the WM process is ensured,

the Pmax limit is not surpassed and no LPSP occurs during the complete 24h period. The RT CHAPTER 5. DEMAND SIDE MANAGEMENT HARDWARE IMPLEMENTATION 103 layer implementation performed excellently as well. Unpredictable devices were immediately handled in a way that respects the residents’ preferences and ensures the permanent energy supply to the house. Thus providing on hardware a complete, generic, and very well-performing DSM program.

Conclusions & Perspectives

This thesis presents an exhaustive analysis of a hybrid PV-Battery backup system that operates in conjunction with the national grid in order to ensure permanent electricity supply to a high energy consuming residential application. The research was motivated by several factors as: the occurrence of regular grid power outages in various developing countries which leaves their nations without electricity supply for long periods of time during the day, the need to replace currently installed DG due to their numerous disadvantages, and the urge to integrate RET in the energy production mix especially in developing countries. The main objectives of the study are to: • Establish a good understanding of the operation of the proposed system and optimize its configuration. • Estimate its resulting fees and compare them to the currently installed backup solutions. • Optimize the operation of the PV-Battery backup system through the development and implementation of a reliable DSM program. • Evaluate the impact of the proposed DSM program on the overall backup system price. First, a general introduction of the study is done. It introduces the main objectives of the thesis and explains in detail the structure of the proposed PV-Battery backup system, the involved electrical equipments, and the multiple operation modes that can occur. The introduction outlines the considered Lebanese case study by describing the installed residential electrical loads. A state of the art of the energy crisis in various developing countries including Lebanon is conducted in chapter 1 which helps position the Lebanese energy status compared to other countries that share similar conditions. The chapter addresses the main barriers confronting the further integration of RET in Lebanon, such as their alleged high resulting prices, low social acceptance level, and lack of clear policies and regulations to encourage further investment in such systems. These obstacles helped shape the major directives of this thesis which attempt to change the popular beliefs related to PV based systems. Additionally, the chapter presents a literature review of various PV based system sizing procedures and DSM programs applied to residential applications. A great part of the study depends on predictive data such as: the load demand computation, the energy production and EF predictions, the sizing process, and the predictive DSM layer. That is, mathematical models of all the components of the PV-Battery backup system should

105 106 CONCLUSIONS & PERSPECTIVES

be developed as a mandatory step for a reliable system analysis as done in chapter 2. They are key to a thorough assessment of the topology and performance of the proposed backup system. Simplifying assumptions are made - where necessary - for a complexity reduction of the algorithms. The developed models include the PV panels, the energy extracted from the grid, the SOC of the battery bank, the EF in the system, the base load consumption of the house, the WM, various water heating configurations, and the HVAC system. Chapter 3 conducts a detailed economic study of the proposed PV-Battery backup system over its 20-year lifetime and optimizes its configuration. The SEWH is found to be the best water heating technique to be coupled with the backup system, outperforming every other water heating configuration considering the Lebanese context. An optimal configuration of 14 PV panels and 20 batteries is found in order to ensure permanent electricity supply to a high energy consuming residential application under the harshest of conditions. This chapter establishes a detailed comparison between PV based system and DG, proving that the former is more costly effective and provides more electrical energy to the residents while offering them greater control over the resulting tariffs. Battery related fees as the replacement costs and the battery charging from the grid are identified to be the highest contributors to the overall price of the PV backup system, which renders them the prime target for any price reduction process. Moreover, the system sizing results under moderate conditions prove that a robust load management program will contribute to great price reductions of the system while ensuring permanent power supply to the house. Consequently, a complete DSM program for the operation optimization of the backup system is proposed in chapter 4. The control is divided into multiple layers for an accurate management of the considered residential loads. The program is formulated as a MOO problem aiming at reducing the discomfort level to the residents and increasing the autonomy level of the system. The developed control layers are optimized for low memory consumption and fast computation time in order to take into account the hardware implementation process. The DSM testing results show significant flexibility of the program along with a high reliability level and remarkable performance, thus preventing the occurrence of a LPS. The benefits of the proposed management program extend to include the achievement of great price reductions. Whenever the proposed DSM is applied, a PV-Battery configuration of 8 PV panels and 12 batteries is sufficient to provide permanent electricity supply to the case study, amounting to a remarkable system price reduction of 29% over the 20-year period. The full proposed DSM program is implemented on ARM Cortex-A9 processors. To that end, C codes of the control layers are developed in chapter 5 for the hardware implementation procedure. A SOGA is customized in order to fit the required constraints and objectives for the predictive control layer. The implemented proposed DSM program operates with a high degree of reliability, converges to an optimal solution and thus outperforming the other optimization CONCLUSIONS & PERSPECTIVES 107

techniques, consumes low memory resources of the hardware platform, and provides a fast decision making process regarding the control of home appliances, especially unpredictable loads. In conclusion, this thesis validates the high suitability of the PV-Battery backup system to replace DG during grid blackout periods. The proposed system is more advantageous practically and financially. Additionally, very high price reductions and performance reliability can be obtained when the backup system is coupled with the developed DSM program, thus achieving high cost reductions of the system, ensuring permanent power supply to the users, respecting their comfort levels, and giving them great control over their energy consumption and consequently the resulting fees. The proposed study can be extended for higher reliability and broader enhancement of the PV-Battery backup system. The main perspectives and future works can be summarized as follows: • Development of optimized predictive algorithms for the prediction of the solar insolation, ambient air temperature, grid blackout hours, house occupancy periods, hot water demand and the load demand using modern learning and predictive techniques. • The proposed DSM program can be extended in order to take into account prediction uncertainties. The DSM should dynamically interact with the changes and rapidly react to unpredictable uncertainties. These latter are mainly of three kinds: 1. Error in the weather forecast (solar radiation and ambient air temperature predic- tions). 2. Error in the prediction of the grid blackout schedule: It has been proven that the energy cut-offs are one of the most influencing factors on the operation of the backup system. The scheduling layer is based on a proposed grid blackout schedule. A re-scheduling process should be conducted in case the utility power changed its state. Any re-scheduling will produce a new predicted EF in the system which in turn will be given to the RT layer for the control of unpredictable devices. 3. The uncertainty concerning the user’s behavior (e.g. house occupancy periods) and consequently the major load demand profile modifications. • Migration of computationally heavy modules which are able to benefit from the paralleli- sation process to the PL of the ZYNQ. Thus coding in VHDL the concerned modules and ensuring the good coordination between the processors and the FPGA of the ZYNQ. • The development of a reliable energy supervisor: The proposed work managed to achieve a high level of coordination between the various components of the system by reliably controlling the output/demand side of the system. On the other hand, an energy supervisor dealing with the energy production side of the system is highly beneficial. This latter 108 CONCLUSIONS & PERSPECTIVES

will modify the operation of the system and will choose the optimal electricity source to be used in order to satisfy the load demand taking into account the implemented control on the output of the system. Thus allowing to feed the load from the PV-Battery system even during grid availability. Consequently, a highly complicated degree of coordination should be achieved for an optimal performance of the PV-battery backup system. • Finally, the development of a reduced house prototype, representing the various considered loads for an experimental validation of the performance of the PV-Battery backup system as well as the complete implemented DSM program. Bibliography

[1] United Nations Development Programme (UNDP). Human development Report 2014. Sustaining human progress: Reducing Vulnerabilities and Building Resilience.

[2] S. Berclin Jeyaprabha and A. Immanuel Selvakumar. Optimal sizing of pho- tovoltaic/battery/diesel based hybrid system and optimal tilting of solar array us- ing the artificial intelligence for remote houses in India. Energy and Buildings, 96:40 – 52, 2015. URL: http://www.sciencedirect.com/science/article/pii/ S0378778815002042, doi:http://dx.doi.org/10.1016/j.enbuild.2015.03.012.

[3] M.S. Ismail, M. Moghavvemi, and T.M.I. Mahlia. Genetic algorithm based optimiza- tion on modeling and design of hybrid renewable energy systems. Energy Conversion and Management, 85(0):120 – 130, 2014. URL: http://www.sciencedirect.com/ science/article/pii/S0196890414004750, doi:http://dx.doi.org/10.1016/j. enconman.2014.05.064.

[4] A. Terakawa. Review of thin-film silicon deposition techniques for high-efficiency solar cells developed at panasonic/sanyo. Solar Energy Materials and Solar Cells, 119(0):204 – 208, 2013. Thin-film Photovoltaic Solar Cells. URL: http://www.sciencedirect.com/ science/article/pii/S0927024813003395, doi:http://dx.doi.org/10.1016/j. solmat.2013.06.044.

[5] T.M. Razykov, C.S. Ferekides, D. Morel, E. Stefanakos, H.S. Ullal, and H.M. Upadhyaya. Solar photovoltaic electricity: Current status and future prospects. Solar Energy, 85(8):1580 – 1608, 2011. Progress in Solar Energy 1. URL: http://www.sciencedirect.com/ science/article/pii/S0038092X1000366X, doi:http://dx.doi.org/10.1016/j. solener.2010.12.002.

[6] Anurag Chauhan and R.P. Saini. A review on integrated renewable energy system based power generation for stand-alone applications: Configurations, storage options, siz- ing methodologies and control. Renewable and Sustainable Energy Reviews, 38(0):99 – 120, 2014. URL: http://www.sciencedirect.com/science/article/pii/ S1364032114004043, doi:http://dx.doi.org/10.1016/j.rser.2014.05.079.

109 110 BIBLIOGRAPHY

[7] United Nations Development Programme (UNDP). Sustainable energy. http://www.undp.org/content/undp/en/home/ourwork/environmentandenergy/ focus_areas/sustainable-energy.html.

[8] Eleni K. Stigka, John A. Paravantis, and Giouli K. Mihalakakou. Social acceptance of renew- able energy sources: A review of contingent valuation applications. Renewable and Sustain- able Energy Reviews, 32:100 – 106, 2014. URL: http://www.sciencedirect.com/ science/article/pii/S136403211300840X, doi:http://dx.doi.org/10.1016/j. rser.2013.12.026.

[9] International Renewable Energy Agency (IRENA). Financial mechanisms and investment frameworks for renewables in developing countries. pages 1–112, 2012.

[10] Corruption and access to finance impeding solar’s growth in developing countries: Sun- labob [online]. 2015. http://www.pv-tech.org/news/corruption_and_financing_ impeding_solars_growth_in_developing_countries_sun.

[11] J. Karp, J. Wrathall, and M. Gerard. Managing the risks of renewable energy projects in developing countries. 2015. URL: http://www.energyfinancereport.com/2015/ 05/managing-the-risks-of-renewable-energy-projects-in-developing- countries/.

[12] H. Kaja and D. T. Barki. Solar PV technology value chain in respect of new silicon feedstock materials: A context of India and its ambitious national solar mission. In India Conference (INDICON), 2011 Annual IEEE, pages 1–4, 2011. doi:10.1109/INDCON. 2011.6139596.

[13] Indian Ministry of new and renewable energy. Strategic plan for new and renewable energy sector for the period 2011–17, February 2011. http://mnre.gov.in/file-manager/ UserFiles/strategic_plan_mnre_2011_17.pdf.

[14] Mevin Chandel, G.D. Agrawal, Sanjay Mathur, and Anuj Mathur. Techno-economic analysis of solar photovoltaic power plant for garment zone of jaipur city. Case Studies in Thermal Engineering, 2(0):1 – 7, 2014. URL: http://www.sciencedirect.com/ science/article/pii/S2214157X13000117, doi:http://dx.doi.org/10.1016/j. csite.2013.10.002.

[15] Surendra K.C., Samir Kumar Khanal, Prachand Shrestha, and Buddhi Lamsal. Current status of renewable energy in nepal: Opportunities and challenges. Renewable and Sustain- able Energy Reviews, 15(8):4107 – 4117, 2011. URL: http://www.sciencedirect.com/ science/article/pii/S1364032111002619, doi:10.1016/j.rser.2011.07.022. BIBLIOGRAPHY 111

[16] Shrestha J.N. et al. Solar radiation in Nepal: its implications in telecommunication services. In Proceedings of first national conference in renewable energy technology for rural development, Center for Energy Studies, Institute of Engineering, 12-14 October, 2006.

[17] Alternative Energy Promotion Center (AEPC) and Energy Sector Assistance Programe (ESAP). Status of solar photovoltaic sector in Nepal: 2010. URL: http://www.aepc.gov. np/old/images/pdf/statusofsolarphotovoltivsector2010.pdf.

[18] Hassan A. Khan and Saad Pervaiz. Technological review on solar PV in Pakistan: Scope, practices and recommendations for optimized system design. Renewable and Sustain- able Energy Reviews, 23(0):147 – 154, 2013. URL: http://www.sciencedirect.com/ science/article/pii/S1364032113001330, doi:10.1016/j.rser.2013.02.031.

[19] Institute of Public Policy. State of the Economy: Emerging from the Crises. Annual Report Beaconhouse National University, Lahore, 2008.

[20] World Bank. 2007. Enterprise surveys : Pakistan country profile 2007. Enterprise surveys country profile. Washington, DC, World Bank Group. http://documents.worldbank.org/curated/en/2007/01/20451170/enterprise- surveys-pakistan-country-profile-2007.

[21] Alternative Energy Development Board (AEDB). Wind energy in Pakistan. http://www. aedb.org/wind.htm.

[22] Mohammad Azam Khan and Noman Latif. Environmental friendly solar energy in pakistan’s scenario. Renewable and Sustainable Energy Reviews, 14(8):2179–2181, 2010. URL: http://EconPapers.repec.org/RePEc:eee:rensus:v:14:y:2010:i:8: p:2179-2181.

[23] Ashley Theron. Egypt: Manufacturers’ gas shortage to come to an end. http://www.esi- africa.com/egypt-manufacturers-gas-shortage-to-come-to-an-end/, Nov. 2015.

[24] International Energy Agency. World Energy Outlook Special Report: Iraq Energy Outlook. pages 1–147, October, 2012.

[25] U.S Energy Information Administration. Country analysis brief: Iraq. https://www.eia. gov/beta/international/analysis.cfm?iso=IRQ#note, January 2015.

[26] Rafiq Latta. Iraq wakes up from power shortage nightmare. Middle East Economic Survey, 55(44), October 2012. 112 BIBLIOGRAPHY

[27] Lebanese Republic Ministry of Energy and Water. Policy paper for the electricity sector, June 2010.

[28] S. Westall. No light at end of tunnel for Lebanon’s power crisis, 2015. URL: http://www. reuters.com/article/us-lebanon-electricity-idUSKCN0SK1LH20151026.

[29] R. Chedid and F. Chaaban. Renewable-energy developments in arab countries: a regional perspective. Applied Energy, 74(1-2):211–220, 2003. URL: http://EconPapers.repec. org/RePEc:eee:appene:v:74:y:2003:i:1-2:p:211-220.

[30] World Bank. Lebanon: Economic and social impact assessment of the syrian conflict. Executive summary. September 2013. URL: http://www.undp.org/content/dam/ rbas/doc/SyriaResponse/Lebanon%20Economic%20and%20Social%20Impact% 20Assessment%20of%20the%20Syrian%20Conflict.pdf.

[31] Arab Union of Electricity (AUE). Statistical bulletin, 22nd issue, 2013.

[32] Oussama Ibrahim, Farouk Fardoun, Rafic Younes, and Hasna Louahlia-Gualous. En- ergy status in lebanon and electricity generation reform plan based on cost and pollution optimization. Renewable and Sustainable Energy Reviews, 20(0):255 – 278, 2013. URL: http://www.sciencedirect.com/science/article/pii/ S1364032112006259, doi:10.1016/j.rser.2012.11.014.

[33] J. Nielsen, The Daily Star. Power plants to be completed within months, february 26, 2014. http://www.dailystar.com.lb/Business/Lebanon/2014/Feb-26/248485- power-plants-to-be-completed-within-months.ashx#axzz3H4ByZDwW.

[34] Stephen Dockery. Beirut generators as deadly as smoking: study, 2012. URL: http://www.dailystar.com.lb/News/Local-News/2012/Dec-18/198904-beirut- generators-as-deadly-as-smoking-study.ashx.

[35] C. Abi Said , Global Network on Energy for Sustainable Development (GNESD). Electric Energy and Energy Policy in Lebanon, 2005.

[36] O. Habib. Lebanon may tap gas wealth in 2012, The daily star, January 6, 2012. URL: http://www.dailystar.com.lb/Business/Lebanon/2012/Jan-06/ 158999-lebanon-may-tap-gas-wealth-in-2012.ashx.

[37] E. Kinab and M. Elkhoury. Renewable energy use in lebanon: Barriers and solutions. Renewable and Sustainable Energy Reviews, 16(7):4422 – 4431, 2012. URL: http://www. sciencedirect.com/science/article/pii/S136403211200305X, doi:10.1016/j. rser.2012.04.030. BIBLIOGRAPHY 113

[38] United Nations Development Programme UNDP. The national wind Atlas of Lebanon. Technical report, A report prepared by Garrad Hassan for the (UNDP)–CEDRO Project, 2011.

[39] Adel Mourtada. Mediterranean solar (hot) spot– preparation phase – Lebanon fact sheet, 2011.

[40] World Bank. Lebanon social impact analysis – electricity and water sectors, Report no.48993–lb, 2009.

[41] Banque Du Liban (BDL). Circular number 236, 2010.

[42] Solar Novus Today. Lebanon: Government wants to promote renewable energy, Febru- ary 2013. http://www.solarnovus.com/lebanon-government-wants-to-promote- renewable-energy_N6291.html#sthash.ycXGDZek.dpuf.

[43] Masdar Institute/IRENA (2015), Renewable Energy Prospects: United Arab Emirates, REmap 2030 analysis. IRENA, Abu Dhabi. www.irena.org/remap.

[44] Binsal Abdul Kader. Dubai triples renewable energy target to 15% by 2030 [on- line]. January 2015. http://gulfnews.com/business/sectors/investment/dubai- triples-renewable-energy-target-to-15-by-2030-1.1444765.

[45] Abdulrahman Al-Ghabban. Saudi Arabia’s Renewable Energy Strategy and Solar Energy Deployment Roadmap, King Abdullah City for Atomic and Renewable Energy. page 60, 2013.

[46] Anthony DiPaola. Saudi arabia delays $109 billion solar program eight years [on- line]. January 2015. http://www.renewableenergyworld.com/news/2015/01/saudi- arabia-delays-109-billion-solar-program-eight-years.html.

[47] Le Programme des Energies Renouvelables et de l’Efficacité Énergétique [online]. 2015. http://www.mem-algeria.org/francais/index.php?page=le-programme- des-energies-renouvelables-et-de-l-efficacite-energetique.

[48] World Bank Group, Energy Sector Management Assistance Program ESMAP. Tapping a hidden resource – energy efficiency in the middle east and north africa, February 2009.

[49] Mediterranean Solar Plan Strategy Paper. http://ec.europa.eu/energy/ international/international_cooperation/doc/2010_02_10_mediterranean_ solar_plan_strategy_paper.pdf. 114 BIBLIOGRAPHY

[50] P. Loka, S. Moola, S. Reddy, A. Skumanich, S. Fulton, S.C. Siah, and P. Mints. A case study for micro-grid pv: Rural electrification in India. In Photovoltaic Specialists Conference (PVSC), 2013 IEEE 39th, pages 3379–3382, June 2013. doi:10.1109/PVSC. 2013.6745174.

[51] M.H. Hasan, T.M.I. Mahlia, and Hadi Nur. A review on energy scenario and sus- tainable energy in indonesia. Renewable and Sustainable Energy Reviews, 16(4):2316 – 2328, 2012. URL: http://www.sciencedirect.com/science/article/pii/ S1364032111005995, doi:10.1016/j.rser.2011.12.007.

[52] Islam Sharif and Marufa Mithila. Rural electrification using PV: the success story of Bangladesh. Energy Procedia, 33(0):343 – 354, 2013. {PV} Asia Pacific Conference 2012. URL: http://www.sciencedirect.com/science/article/pii/ S1876610213000854, doi:http://dx.doi.org/10.1016/j.egypro.2013.05.075.

[53] Eustace Mbaka Nfah. Evaluation of optimal photovoltaic hybrid systems for remote vil- lages in far north cameroon. Renewable Energy, 51:482 – 488, 2013. URL: http://www. sciencedirect.com/science/article/pii/S0960148112006064, doi:http://dx. doi.org/10.1016/j.renene.2012.09.035.

[54] Ssennoga Twaha, Mohd Hafizi Idris, Makbul Anwari, and Azhar Khairuddin. Applying grid-connected photovoltaic system as alternative source of electricity to supplement hydro power instead of using diesel in uganda. Energy, 37(1):185 – 194, 2012. 7th Biennial Interna- tional Workshop Advances in Energy Studies. URL: http://www.sciencedirect.com/ science/article/pii/S0360544211007821, doi:http://dx.doi.org/10.1016/j. energy.2011.11.051.

[55] Patrick Mark Murphy, Ssennoga Twaha, and Inês S. Murphy. Analysis of the cost of reliable electricity: A new method for analyzing grid connected solar, diesel and hybrid distributed electricity systems considering an unreliable electric grid, with examples in uganda. Energy, 66(0):523 – 534, 2014. URL: http://www.sciencedirect.com/ science/article/pii/S0360544214000279, doi:http://dx.doi.org/10.1016/j. energy.2014.01.020.

[56] Nitin Agarwal, Anoop Kumar, and Varun. Optimization of grid independent hybrid PV–diesel–battery system for power generation in remote villages of Uttar Pradesh, In- dia. Energy for Sustainable Development, 17(3):210 – 219, 2013. URL: http://www. sciencedirect.com/science/article/pii/S0973082613000082, doi:10.1016/j. esd.2013.02.002. BIBLIOGRAPHY 115

[57] Abdul Ghafoor and Anjum Munir. Design and economics analysis of an off- grid PV system for household electrification. Renewable and Sustainable En- ergy Reviews, 42(0):496 – 502, 2015. URL: http://www.sciencedirect.com/ science/article/pii/S1364032114008296, doi:http://dx.doi.org/10.1016/j. rser.2014.10.012.

[58] Mitchell Lee, Daniel Soto, and Vijay Modi. Cost versus reliability sizing strategy for isolated photovoltaic micro-grids in the developing world. Renewable Energy, 69(0):16 – 24, 2014. URL: http://www.sciencedirect.com/science/article/pii/ S0960148114001633, doi:http://dx.doi.org/10.1016/j.renene.2014.03.019.

[59] Hussein A. Kazem, Tamer Khatib, and K. Sopian. Sizing of a standalone photo- voltaic/battery system at minimum cost for remote housing electrification in sohar, oman. Energy and Buildings, 61(0):108 – 115, 2013. URL: http://www.sciencedirect.com/ science/article/pii/S037877881300087X, doi:http://dx.doi.org/10.1016/j. enbuild.2013.02.011.

[60] Mahendra Lalwani, D.P. Kothari, and Mool Singh. Size optimization of stand-alone photovoltaic system under local weather conditions in India. International journal of applied engineering research, Dindigul, 1(4), 2011.

[61] W.X. Shen. Optimally sizing of solar array and battery in a standalone photovoltaic system in Malaysia. Renewable Energy, 34(1):348 – 352, 2009. URL: http://www. sciencedirect.com/science/article/pii/S0960148108001158, doi:10.1016/j. renene.2008.03.015.

[62] B. Said, B.M. Seghir, B. Mahmoud, C. Alberto, D. Belkacem, and H. Messaoud. Envi- ronmental evaluation of typical house situated in the south of algeria by using photovoltaic system. In Environment Friendly Energies and Applications (EFEA), 2012 2nd International Symposium on, pages 641–645, 2012. doi:10.1109/EFEA.2012.6294030.

[63] Software and documentation available at. www.homerenergy.com.

[64] S.R.R. Dhiwaakar Purusothaman, R. Rajesh, K.K. Bajaj, V. Vijayaraghavan, and M. Venkatesan. Hybrid battery charging system using solar pv and utility grid. In Power and Energy Systems Conference: Towards Sustainable Energy, 2014, pages 1–5, March 2014. doi:10.1109/PESTSE.2014.6805275.

[65] Banu Y. Ekren and Orhan Ekren. Simulation based size optimization of a PV/wind hybrid energy conversion system with battery storage under various load and auxiliary energy conditions. Applied Energy, 86(9):1387 – 1394, 2009. URL: http://www. 116 BIBLIOGRAPHY

sciencedirect.com/science/article/pii/S0306261908003401, doi:http://dx. doi.org/10.1016/j.apenergy.2008.12.015.

[66] A.T.D. Perera, R.A. Attalage, K.K.C.K. Perera, and V.P.C. Dassanayake. A hybrid tool to combine multi-objective optimization and multi-criterion decision making in designing stan- dalone hybrid energy systems. Applied Energy, 107(0):412 – 425, 2013. URL: http://www. sciencedirect.com/science/article/pii/S0306261913001578, doi:http://dx. doi.org/10.1016/j.apenergy.2013.02.049.

[67] B. Ould. Bilal, V. Sambou, C.M.F Kébé, P.A. Ndiaye, and M. Ndongo. Methodology to size an optimal stand-alone PV/wind/diesel/battery system minimizing the levelized cost of energy and the CO2 emissions. Energy Procedia, 14(0):1636 – 1647, 2012. 2011 2nd International Conference on Advances in Energy Engineering (ICAEE). URL: http://www. sciencedirect.com/science/article/pii/S1876610211045656, doi:http://dx. doi.org/10.1016/j.egypro.2011.12.1145.

[68] Rodolfo Dufo-López, José L. Bernal-Agustin, José M. Yusta-Loyo, José A. Dominguez- Navarro, Ignacio J. Ramirez-Rosado, Juan Lujano, and Ismael Aso. Multi-objective opti- mization minimizing cost and life cycle emissions of stand-alone PV-wind-diesel systems with batteries storage. Applied Energy, 88(11):4033 – 4041, 2011. URL: http://www. sciencedirect.com/science/article/pii/S0306261911002418, doi:http://dx. doi.org/10.1016/j.apenergy.2011.04.019.

[69] Eftichios Koutroulis, Dionissia Kolokotsa, Antonis Potirakis, and Kostas Kalaitzakis. Methodology for optimal sizing of stand-alone photovoltaic/wind-generator systems using genetic algorithms. Solar Energy, 80(9):1072 – 1088, 2006. doi:http://dx.doi.org/ 10.1016/j.solener.2005.11.002.

[70] M. Fadaee and M.A.M. Radzi. Multi-objective optimization of a stand-alone hybrid renew- able energy system by using evolutionary algorithms: A review. Renewable and Sustainable Energy Reviews, 16(5):3364 – 3369, 2012. URL: http://www.sciencedirect.com/ science/article/pii/S1364032112001669, doi:http://dx.doi.org/10.1016/j. rser.2012.02.071.

[71] Jeeng-Min Ling and Anh Son Khuong. Analytical comparisons of lagrangian/genetic algorithm for the optimal capacity planning for stand- alone photovoltaic generation. The International Conference on Green Technologies, 2014.

[72] Marc Beaudin and Hamidreza Zareipour. Home energy management systems: A review of modelling and complexity. Renewable and Sustainable Energy Reviews, BIBLIOGRAPHY 117

45:318 – 335, 2015. URL: http://www.sciencedirect.com/science/article/pii/ S1364032115000568, doi:http://dx.doi.org/10.1016/j.rser.2015.01.046.

[73] P.P. Groumpos and G. Papegeorgiou. An optimum load management strategy for stand-alone photovoltaic power systems. Solar Energy, 46(2):121 – 128, 1991. URL: http://www.sciencedirect.com/science/article/pii/0038092X9190024Q, doi: http://dx.doi.org/10.1016/0038-092X(91)90024-Q.

[74] Yi Zong, L. Mihet-Popa, D. Kullmann, A. Thavlov, O. Gehrke, and H.W. Bindner. Model predictive controller for active demand side management with pv self-consumption in an intelligent building. In Innovative Smart Grid Technologies (ISGT Europe), 2012 3rd IEEE PES International Conference and Exhibition on, pages 1–8, Oct 2012. doi: 10.1109/ISGTEurope.2012.6465618.

[75] Yong Wang and Lin Li. Time-of-use based electricity demand response for sustain- able manufacturing systems. Energy, 63(0):233 – 244, 2013. URL: http://www. sciencedirect.com/science/article/pii/S036054421300844X, doi:http://dx. doi.org/10.1016/j.energy.2013.10.011.

[76] Xiao Hui Li and Seung Ho Hong. User-expected price-based demand response algo- rithm for a home-to-grid system. Energy, 64(0):437 – 449, 2014. URL: http://www. sciencedirect.com/science/article/pii/S0360544213010190, doi:http://dx. doi.org/10.1016/j.energy.2013.11.049.

[77] Ana Soares, Carlos Henggeler Antunes, Carlos Oliveira, and Álvaro Gomes. A multi-objective genetic approach to domestic load scheduling in an energy management system. Energy, 77(0):144 – 152, 2014. URL: http://www.sciencedirect.com/ science/article/pii/S0360544214006689, doi:http://dx.doi.org/10.1016/j. energy.2014.05.101.

[78] Ditiro Setlhaolo, Xiaohua Xia, and Jiangfeng Zhang. Optimal scheduling of household appliances for demand response. Electric Power Systems Research, 116(0):24 – 28, 2014. URL: http://www.sciencedirect.com/science/article/pii/ S0378779614001527, doi:http://dx.doi.org/10.1016/j.epsr.2014.04.012.

[79] G.T. Costanzo, Guchuan Zhu, M.F. Anjos, and G. Savard. A system architecture for au- tonomous demand side load management in smart buildings. Smart Grid, IEEE Transactions on, 3(4):2157–2165, Dec 2012. doi:10.1109/TSG.2012.2217358.

[80] Cara R. Touretzky and Michael Baldea. Integrating scheduling and control for economic MPC of buildings with energy storage. Journal of Process Control, 24(8):1292 – 1300, 2014. 118 BIBLIOGRAPHY

Economic nonlinear model predictive control. URL: http://www.sciencedirect.com/ science/article/pii/S0959152414001164, doi:http://dx.doi.org/10.1016/j. jprocont.2014.04.015.

[81] Mesut Avci, Murat Erkoc, Amir Rahmani, and Shihab Asfour. Model predictive HVAC load control in buildings using real-time electricity pricing. Energy and Buildings, 60(0):199 – 209, 2013. URL: http://www.sciencedirect.com/science/article/ pii/S037877881300025X, doi:http://dx.doi.org/10.1016/j.enbuild.2013.01. 008.

[82] Ugur˘ Atikol. A simple peak shifting DSM (demand-side management) strategy for residential water heaters. Energy, 62(0):435 – 440, 2013. URL: http://www. sciencedirect.com/science/article/pii/S0360544213008189, doi:http://dx. doi.org/10.1016/j.energy.2013.09.052.

[83] Ditiro Setlhaolo and Xiaohua Xia. Optimal scheduling of household appli- ances with a battery storage system and coordination. Energy and Buildings, 94(0):61 – 70, 2015. URL: http://www.sciencedirect.com/science/article/pii/ S0378778815001565, doi:http://dx.doi.org/10.1016/j.enbuild.2015.02.051.

[84] Yumiko Iwafune, Takashi Ikegami, Joao Gari da Silva Fonseca Jr., Takashi Oozeki, and Kazuhiko Ogimoto. Cooperative home energy management using batteries for a photovoltaic system considering the diversity of households. Energy Conversion and Management, 96(0):322 – 329, 2015. URL: http://www.sciencedirect.com/ science/article/pii/S0196890415002046, doi:http://dx.doi.org/10.1016/j. enconman.2015.02.083.

[85] Elizabeth L. Ratnam, Steven R. Weller, and Christopher M. Kellett. An optimization-based approach to scheduling residential battery storage with solar PV: Assessing customer benefit. Renewable Energy, 75(0):123 – 134, 2015. URL: http://www.sciencedirect.com/ science/article/pii/S0960148114005588, doi:http://dx.doi.org/10.1016/j. renene.2014.09.008.

[86] A.S.O. Ogunjuyigbe, T.R. Ayodele, and C.G. Monyei. An intelligent load man- ager for PV powered off-grid residential houses. Energy for Sustainable Development, 26(0):34 – 42, 2015. URL: http://www.sciencedirect.com/science/article/pii/ S0973082615000113, doi:http://dx.doi.org/10.1016/j.esd.2015.02.003.

[87] Elham Shirazi and Shahram Jadid. Optimal residential appliance scheduling un- der dynamic pricing scheme via HEMDAS. Energy and Buildings, 93(0):40 BIBLIOGRAPHY 119

– 49, 2015. URL: http://www.sciencedirect.com/science/article/pii/ S0378778815000870, doi:http://dx.doi.org/10.1016/j.enbuild.2015.01.061.

[88] Seung Ho Hong, Mengmeng Yu, and Xuefei Huang. A real-time demand re- sponse algorithm for heterogeneous devices in buildings and homes. Energy, 80:123 – 132, 2015. URL: http://www.sciencedirect.com/science/article/pii/ S0360544214013085, doi:http://dx.doi.org/10.1016/j.energy.2014.11.053.

[89] Mohammad Rastegar, Mahmud Fotuhi-Firuzabad, and Hamidreza Zareipour. Home energy management incorporating operational priority of appliances. International Jour- nal of Electrical Power & Energy Systems, 74:286 – 292, 2016. URL: http://www. sciencedirect.com/science/article/pii/S014206151500321X, doi:http://dx. doi.org/10.1016/j.ijepes.2015.07.035.

[90] J. Faxas-Guzmán, R. García-Valverde, L. Serrano-Luján, and A. Urbina. Priority load control algorithm for optimal energy management in stand-alone photovoltaic systems. Renewable Energy, 68:156 – 162, 2014. URL: http://www.sciencedirect.com/ science/article/pii/S096014811400069X, doi:http://dx.doi.org/10.1016/j. renene.2014.01.040.

[91] Qinran Hu and Fangxing Li. Hardware design of smart home energy management system with dynamic price response. Smart Grid, IEEE Transactions on, 4(4):1878–1887, Dec 2013. doi:10.1109/TSG.2013.2258181.

[92] M. Kuzlu, M. Pipattanasomporn, and S. Rahman. Hardware demonstration of a home en- ergy management system for demand response applications. Smart Grid, IEEE Transactions on, 3(4):1704–1711, Dec 2012. doi:10.1109/TSG.2012.2216295.

[93] A. Saha, M. Kuzlu, W. Khamphanchai, M. Pipattanasomporn, S. Rahman, O. Elma, U.S. Selamogullari, M. Uzunoglu, and B. Yagcitekin. A home energy management algorithm in a smart house integrated with renewable energy. In Innovative Smart Grid Technologies Conference Europe (ISGT-Europe), 2014 IEEE PES, pages 1–6, Oct 2014. doi:10.1109/ ISGTEurope.2014.7028970.

[94] Schneider Electric. Wiser Home Management, 2013. URL: https://www.wiserenergy. com.

[95] Panasonic Corporation. Energy solutions for homes. URL: http://panasonic.net/es/ solution-works/HouseEnergy/. 120 BIBLIOGRAPHY

[96] A. Saha, M. Kuzlu, and M. Pipattanasomporn. Demonstration of a home energy manage- ment system with smart thermostat control. In Innovative Smart Grid Technologies (ISGT), 2013 IEEE PES, pages 1–8, Feb 2013. doi:10.1109/ISGT.2013.6497866.

[97] W. Li, C. Yuen, N.U. Hassan, W. Tushar, C. Wen, K.L. Wood, K. Hu, and X. Liu. Demand response management for residential smart grid: From theory to practice. Access, IEEE, 3:2431–2440, 2015. doi:10.1109/ACCESS.2015.2503379.

[98] J. Khoury, R. Mbayed, G. Salloum, E. Monmasson, and J. Guerrero. Review on the integration of photovoltaic renewable energy in developing countries—special attention to the lebanese case. Renewable and Sustainable Energy Reviews, 57:562 – 575, 2016. URL: http://www.sciencedirect.com/science/article/pii/ S1364032115014458, doi:http://dx.doi.org/10.1016/j.rser.2015.12.062.

[99] M. A. Green. Solar cells : operating principles, technology, and system applications / Martin A. Green. Prentice-Hall Englewood Cliffs, N.J, 1982.

[100] S. Bowden and A. Rohatgi. Rapid and accurate determination of series resistance and fill factor losses in industrial silicon solar cells. In the 17th European Photovoltaic Solar Energy Conference and Exhibition;Munich, Germany. October 22-26, 2001.

[101] Wilfried G J H M van Sark. Teaching the relation between solar cell efficiency and annual energy yield. European Journal of Physics, 28(3):415.

[102] Duy Long Ha, Stephane Ploix, Mireille Jacomino, and Minh Hoang Le. chapter Home Energy Management Problem: towards an Optimal and Robust Solution, pages 77–106. Number 978-953-307-065-0. InTech, 2010.

[103] K. Elamari and L. A C Lopes. Frequency based control of electric water heaters in small pv-diesel hybrid mini-grids. In Electrical Computer Engineering (CCECE), 2012 25th IEEE Canadian Conference on, pages 1–4, 2012. doi:10.1109/CCECE.2012.6335022.

[104] K. Uchida, T. Senjyu, N. Urasaki, and A. Yona. Installation effect by solar heater system using solar radiation forecasting. In Transmission Distribution Conference Exposition: Asia and Pacific, 2009, pages 1–4, 2009. doi:10.1109/TD-ASIA.2009.5356904.

[105] Liam Paull, Howard Li, and Liuchen Chang. A novel domestic electric water heater model for a multi-objective demand side management program. Electric Power Sys- tems Research, 80(12):1446 – 1451, 2010. URL: http://www.sciencedirect.com/ science/article/pii/S0378779610001434, doi:http://dx.doi.org/10.1016/j. epsr.2010.06.013. BIBLIOGRAPHY 121

[106] John Bryden, Lily Riahi, and Romain Zissler. MENA Renewables Status Report. Techni- cal report, United Arab Emirates MOFA, IRENA, and REN21, 2013.

[107] Isabella Ruble and Pierre El Khoury. Lebanon’s market for domestic solar water heaters: Achievements and barriers. Energy for Sustainable Development, 17(1):54 – 61, 2013. URL: http://www.sciencedirect.com/science/article/pii/ S0973082612000920, doi:http://dx.doi.org/10.1016/j.esd.2012.11.004.

[108] Lebanese Center for Energy Conservation (L.C.E.C). In The residential solar water heaters market in Lebanon in 2011, September 2012.

[109] M.H. Nehrir, Runmin Jia, D.A. Pierre, and D.J. Hammerstrom. Power management of aggregate electric water heater loads by voltage control. In Power Engineering Society General Meeting, 2007. IEEE, pages 1–6, 2007. doi:10.1109/PES.2007.386024.

[110] L. Paull, D. MacKay, H. Li, and Liuchen Chang. A water heater model for increased power system efficiency. In Electrical and Computer Engineering, 2009. CCECE ’09. Canadian Conference on, pages 731–734, 2009. doi:10.1109/CCECE.2009.5090225.

[111] American Society of Heating, Refrigerating and Air-Conditioning Engineers, Inc. (ASHRAE) Handbook-Heating, Ventilating, and Air-Conditioning (HVAC) Applications. In Typical Residential Family’s Hourly Hot Water Use, page Fig. 12. Page 49.12, 2007.

[112] J. Kondoh, Ning Lu, and D.J. Hammerstrom. An evaluation of the water heater load potential for providing regulation service. Power Systems, IEEE Transactions on, 26(3):1309– 1316, 2011. doi:10.1109/TPWRS.2010.2090909.

[113] H. Taherian, A. Rezania, S. Sadeghi, and D.D. Ganji. Experimental validation of dynamic simulation of the flat plate collector in a closed thermosyphon solar water heater. Energy Conversion and Management, 52(1):301 – 307, 2011. URL: http://www. sciencedirect.com/science/article/pii/S0196890410002840, doi:http://dx. doi.org/10.1016/j.enconman.2010.06.063.

[114] Tang, Andrew Kusiak, and Xiupeng Wei. Modeling and short-term pre- diction of HVAC system with a clustering algorithm. Energy and Buildings, 82:310 – 321, 2014. URL: http://www.sciencedirect.com/science/article/pii/ S0378778814005751, doi:http://dx.doi.org/10.1016/j.enbuild.2014.07.037.

[115] Abdul Afram and Farrokh Janabi-Sharifi. Theory and applications of HVAC control systems – a review of model predictive control (MPC). Building and Environment, 72:343 – 355, 2014. URL: http://www.sciencedirect.com/ 122 BIBLIOGRAPHY

science/article/pii/S0360132313003363, doi:http://dx.doi.org/10.1016/j. buildenv.2013.11.016.

[116] Xiupeng Wei, Andrew Kusiak, Mingyang Li, Fan Tang, and Yaohui Zeng. Multi- objective optimization of the HVAC (heating, ventilation, and air conditioning) system performance. Energy, 83:294 – 306, 2015. URL: http://www.sciencedirect.com/ science/article/pii/S0360544215001796, doi:http://dx.doi.org/10.1016/j. energy.2015.02.024.

[117] Andrew Kusiak and Guanglin Xu. Modeling and optimization of HVAC systems using a dynamic neural network. Energy, 42(1):241 – 250, 2012. 8th World Energy System Confer- ence, WESC 2010. URL: http://www.sciencedirect.com/science/article/pii/ S0360544212002666, doi:http://dx.doi.org/10.1016/j.energy.2012.03.063.

[118] Bruno Bueno, Leslie Norford, Grégoire Pigeon, and Rex Britter. A resistance- capacitance network model for the analysis of the interactions between the en- ergy performance of buildings and the urban climate. Building and En- vironment, 54:116 – 125, 2012. URL: http://www.sciencedirect.com/ science/article/pii/S0360132312000388, doi:http://dx.doi.org/10.1016/j. buildenv.2012.01.023.

[119] Rick Kramer, Jos van Schijndel, and Henk Schellen. Simplified thermal and hygric building models: A literature review. Frontiers of Architectural Research, 1(4):318 – 325, 2012. URL: http://www.sciencedirect.com/science/article/pii/ S2095263512000647, doi:http://dx.doi.org/10.1016/j.foar.2012.09.001.

[120] Ion Hazyuk, Christian Ghiaus, and David Penhouet. Optimal temperature control of intermittently heated buildings using Model Predictive Control: Part I – building modeling. Building and Environment, 51:379 – 387, 2012. URL: http://www.sciencedirect.com/ science/article/pii/S0360132311003933, doi:http://dx.doi.org/10.1016/j. buildenv.2011.11.009.

[121] Peder Bacher and Henrik Madsen. Identifying suitable models for the heat dynam- ics of buildings. Energy and Buildings, 43(7):1511 – 1522, 2011. URL: http://www. sciencedirect.com/science/article/pii/S0378778811000491, doi:http://dx. doi.org/10.1016/j.enbuild.2011.02.005.

[122] Melanie Mitchell. An Introduction to Genetic Algorithms. MIT Press, Cambridge, MA, USA, 1998. BIBLIOGRAPHY 123

[123] J. Kennedy and R. Eberhart. Particle swarm optimization. In Neural Networks, 1995. Proceedings., IEEE International Conference on, volume 4, pages 1942–1948 vol.4, Nov 1995. doi:10.1109/ICNN.1995.488968.

[124] S. Ebbesen, P. Kiwitz, and L. Guzzella. A generic particle swarm optimization matlab function. In American Control Conference (ACC), 2012, pages 1519–1524, June 2012. doi:10.1109/ACC.2012.6314697.

[125] L. Arena, R. Walters, and D. Dwiantoro. Assessing the energy savings of tankless water heater retrofits in public housing. 2013. URL: http://books.google.fr/books?id= XMLDrQEACAAJ.

[126] Ahmad Houri, Hussein Salloum, Anwar Ali, Abdel Karim Abdel Razik, and Leila Houri. Assessment of energy and financial performance of a solar hot water system in a single family dwelling: case study from Marjeyoun - South Lebanon. In Lebanese Center for Energy Conservation (L.C.E.C), 2009.

[127] Onur Elma and Ugur Savas Selamogullari. A comparative sizing analysis of a renew- able energy supplied stand-alone house considering both demand side and source side dynamics. Applied Energy, 96(0):400 – 408, 2012. Smart Grids. URL: http://www. sciencedirect.com/science/article/pii/S0306261912001821, doi:http://dx. doi.org/10.1016/j.apenergy.2012.02.080.

[128] Abdullah Konak, David W. Coit, and Alice E. Smith. Multi-objective optimization using genetic algorithms: A tutorial. Reliability Engineering & System Safety, 91(9):992–1007, September 2006. URL: http://www.sciencedirect.com/science/article/B6V4T- 4J0NY2F-2/2/97db869c46fc43f457f3d509adaa15b5.

[129] K. Deb, A. Pratap, S. Agarwal, and T. Meyarivan. A fast and elitist multiobjective genetic algorithm: NSGA-II. Evolutionary Computation, IEEE Transactions on, 6(2):182 –197, apr 2002. doi:10.1109/4235.996017.

[130] Salvatore Carlucci, Giulio Cattarin, Francesco Causone, and Lorenzo Pagliano. Multi- objective optimization of a nearly zero-energy building based on thermal and visual discom- fort minimization using a non-dominated sorting genetic algorithm (NSGA-II). Energy and Buildings, 104:378 – 394, 2015. URL: http://www.sciencedirect.com/science/ article/pii/S0378778815301080, doi:http://dx.doi.org/10.1016/j.enbuild. 2015.06.064.

[131] Zahra Moravej, Farhad Adelnia, and Fazel Abbasi. Optimal coordination of directional overcurrent relays using NSGA-II. Electric Power Systems Research, 124 BIBLIOGRAPHY

119:228 – 236, 2015. URL: http://www.sciencedirect.com/science/article/pii/ S0378779614003319, doi:http://dx.doi.org/10.1016/j.epsr.2014.09.010.

[132] Seyed Hamid Reza Pasandideh, Seyed Taghi Akhavan Niaki, and Sharareh Sharafzadeh. Optimizing a bi-objective multi-product EPQ model with defective items, rework and limited orders: NSGA-II and MOPSO algorithms. Journal of Manufactur- ing Systems, 32(4):764 – 770, 2013. URL: http://www.sciencedirect.com/ science/article/pii/S0278612513000927, doi:http://dx.doi.org/10.1016/j. jmsy.2013.08.001.

[133] Prakash Kumar Rout and Debiprasad Priyabrata Acharya. Fast physical design of CMOS ROs for optimal performance using constrained NSGA-II. AEU - International Jour- nal of Electronics and Communications, 69(9):1233 – 1242, 2015. URL: http://www. sciencedirect.com/science/article/pii/S1434841115001399, doi:http://dx. doi.org/10.1016/j.aeue.2015.05.004.

[134] M. Bayat, Z. Dehghani, and M.R. Rahimpour. Dynamic multi-objective opti- mization of industrial radial-flow fixed-bed reactor of heavy paraffin dehydrogenation in LAB plant using NSGA-II method. Journal of the Taiwan Institute of Chemi- cal Engineers, 45(4):1474 – 1484, 2014. URL: http://www.sciencedirect.com/ science/article/pii/S1876107013002721, doi:http://dx.doi.org/10.1016/j. jtice.2013.10.011.

[135] V. Khare, X. Yao, and K. Deb. Performance scaling of multi-objective evolutionary algo- rithms. In CarlosM. Fonseca, PeterJ. Fleming, Eckart Zitzler, Lothar Thiele, and Kalyanmoy Deb, editors, Evolutionary Multi-Criterion Optimization, volume 2632 of Lecture Notes in Computer Science, pages 376–390. Springer Berlin Heidelberg, 2003. URL: http: //dx.doi.org/10.1007/3-540-36970-8_27, doi:10.1007/3-540-36970-8_27.

[136] Ken Harada, Jun Sakuma, Isao Ono, and Shigenobu Kobayashi. Constraint-handling method for multi-objective function optimization: Pareto descent repair operator. In Shigeru Obayashi, Kalyanmoy Deb, Carlo Poloni, Tomoyuki Hiroyasu, and Tadahiko Murata, editors, Evolutionary Multi-Criterion Optimization, volume 4403 of Lecture Notes in Computer Science, pages 156–170. Springer Berlin Heidelberg, 2007. URL: http://dx.doi.org/ 10.1007/978-3-540-70928-2_15, doi:10.1007/978-3-540-70928-2_15.

[137] Khalid Ibrahim Elamari. Using electric water heaters (ewhs) for power balancing and frequency control in pv-diesel hybrid mini-grids. August 2011. URL: http://spectrum. library.concordia.ca/35817/. BIBLIOGRAPHY 125

[138] L.H. Crockett, R.A. Elliot, and M.A. Enderwitz. The Zynq Book: Embedded Processing with the ARM Cortex-A9 on the Xilinx Zynq-7000 All Programmable SoC. Strathclyde Academic Media, 2014.

[139] J. Khoury, N. Patin, E. Monmasson, G. Salloum, and L. Idkhajine. FPGA-based emulation system dedicated to the test of specific PWM strategies for automotive VSI inverter. In Power Electronics and Applications (EPE), 2013 15th European Conference on, pages 1–7, Sept 2013. doi:10.1109/EPE.2013.6631975.

[140] Madhu Monga, Manoj Karkee, Song Sun, Lakshmi KiranTondehal, Brian Steward, AtulKelkar, and Joseph Zambreno. Real-time simulation of dynamic vehicle mod- els using a high-performance reconfigurable platform. Procedia Computer Science, 9:338 – 347, 2012. Proceedings of the International Conference on Computational Sci- ence, ICCS 2012. URL: http://www.sciencedirect.com/science/article/pii/ S1877050912001573, doi:http://dx.doi.org/10.1016/j.procs.2012.04.036.

[141] R. Timothy Marler and Jasbir S. Arora. The weighted sum method for multi-objective optimization: New insights. Structural and Multidisciplinary Optimization, 41(6):853–862, 2010. doi:10.1007/s00158-009-0460-7.

[142] Abdullah Konak, David W. Coit, and Alice E. Smith. Multi-objective optimization using genetic algorithms: A tutorial. Reliability Engineering & System Safety, 91(9):992 – 1007, 2006. Special Issue - Genetic Algorithms and ReliabilitySpecial Issue - Genetic Algorithms and Reliability. URL: http://www.sciencedirect.com/science/article/pii/ S0951832005002012, doi:http://dx.doi.org/10.1016/j.ress.2005.11.018.

[143] Mario Köppen and Kaori Yoshida. Substitute distance assignments in nsga-ii for handling many-objective optimization problems. In Shigeru Obayashi, Kalyanmoy Deb, Carlo Poloni, Tomoyuki Hiroyasu, and Tadahiko Murata, editors, Evolutionary Multi-Criterion Optimization, volume 4403 of Lecture Notes in Computer Science, pages 727–741. Springer Berlin Heidelberg, 2007. URL: http://dx.doi.org/10.1007/978-3-540-70928-2_ 55, doi:10.1007/978-3-540-70928-2_55.

[144] H. Ishibuchi, N. Akedo, and Y. Nojima. Behavior of multiobjective evolutionary algo- rithms on many-objective knapsack problems. Evolutionary Computation, IEEE Transac- tions on, 19(2):264–283, April 2015. doi:10.1109/TEVC.2014.2315442.

[145] W.S. Levine. The Control Systems Handbook, Second Edition: Control System Advanced Methods, Second Edition. Electrical Engineering Handbook. CRC Press, 2010. URL: https://books.google.com.lb/books?id=GVjvBQAAQBAJ.

Appendix A

PV panels modeling

The non linear relationship between the voltage (v) and the current (I) at the terminals of the PV array is shown in Eq. (A.1).

q(v + RsaI) I = NpIph − NpIs[exp( ) − 1] (A.1) NsKθcn

Ns and Np being the number of modules mounted in serial and parallel consecutively to form

the PV array; Iph(A) the photo-generated current; Is(A) the diode current; q(Coulomb) and K(Joules/Coulomb) the electron charge and Boltzman’s gas constant respectively, and n the

diode’s ideality factor. The PV cell’s temperature (θc) and the equivalent serial resistance of the  PV array Rsa(Ω) can be expressed as in Eqs. (A.2) and (A.3) respectively.

NOCT − 20 θ = θ + .G (A.2) c a 800 s

Ns.Rsm Ns.Rs.Ns1 Rsa = = (A.3) Np Np 2 Where θa is the ambient air temperature; Gs the solar irradiance (W/m ); NOCT the Nominal Operating Cell Temperature (NOCT=45°C ± 2°C) which represents the temperature of an open 2 circuited cell at Gs=800 W/m and θa=20°C ambient temperature.

Rsm is the equivalent serial resistance of the PV module and Ns1 the number of cells in serial in a PV module. The relation between the current and voltage at the terminals of a PV module (Im and vm) can be expressed as in Eq. (A.4).

q(vm + RsmIm) Im = Iph − Is[exp( ) − 1] (A.4) Ns1Kθcn

The photocurrent can be found as in Eq. (A.5):

Isc,re f .Gs Iph = + KI(θc − Tcre f ) (A.5) Gs,re f

127 128 APPENDIX A. PV PANELS MODELING

Isc is the cell’s short circuit current. The ref index indicates that the values are at STC. KI is the short circuit current temperature coefficient provided by the manufacturer.

Let the thermal voltage vt be as in Eq. (A.6)

N Kθ n v = s1 c (A.6) t q

Assuming that Iph is equal to Isc and Is is equal to Irs the cell’s reverse saturation current at STC, the unknown parameters of the cell model can be determined. Irs, vt, Rsm can be found using the PV panel manufacturer’s values of the power, voltage and current at Maximum Power Point (MPP) (mp index) and short circuit operation (sc index).

At open circuit Im=0 and under STC Eq. (A.4) becomes: ! voc,re f 0 = Isc,re f − Irs.exp (A.7) vt

voc,re f is the open circuit voltage at STC. By assuming silicon PV cells and considering the operation at the MPP, Eqs. (A.8) and (A.9) are obtained.   vmp,re f + Imp,re f Rsm Imp,re f = Isc,re f − Irs.exp (A.8) vt

dP d(v.I) dI dI Imp |MPP = |MPP = Imp +Vmp |MPP = 0 ⇒ |MPP = − (A.9) dv dv dv dv vmp I can be written as a function of I and v, I = f (I,v). Consequently, dI is derived as in Eq. (A.10).

∂ f (I,v) ∂ f (I,v) ∂ f (I,v) dI dI = dI. + dv. ⇒ = ∂v (A.10) ∂I ∂v dv ∂ f (I,v) 1 − ∂I with

−I .exp( vmp+Rsm.Imp ) ∂ f (I,v) rs vt |MPP = (A.11) ∂v vt −I .R .exp( vmp+RsmImp ) ∂ f (I,v) rs sm vt |MPP = (A.12) ∂I vt

Eqs. (A.9–A.12) at the MPP point lead to the relation between Imp and vmp described in Eq. (A.13). I .exp( vmp+RsmImp ) Imp rs vt = v +R I (A.13) vmp v + R I .exp( mp sm mp ) t sm rs vt APPENDIX A. PV PANELS MODELING 129

By solving the set of equations (Eqs. (A.7), (A.8) and (A.13)), vt, Irs and Rsm can be determined as shown in Eqs. (A.14–A.16):

(2vmp − voc)(Isc − Imp) vt =   (A.14) I + (I − I ).ln Isc−Imp mp sc mp Imp −voc  Irs = Isc.exp (A.15) vt ! Isc − Imp  Rsm = vt ln + voc − vmp /Imp (A.16) Imp

From Eq. (A.14) the cell’s ideality factor can be determined as shown in Eq. (A.17).

7 o 7 θ =25 C c 2 Gs=1000 W/m 6 θ =50oC 6 2 c Gs=800 W/m o 2 5 θ =75 C Gs=600 W/m c 5 G =400 W/m2 θ =100oC s 4 c 4 3 3 2 2 1 1 Output current of PV (A) array current Output Output current of PV (A) array current Output 0 0 0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50 Voltage of PV array (V) Voltage of PV array (V)

(a) I-V curve for different Temperature values and Gs=Gre f (b) I-V curve for different solar irradiance values and T=Tre f

200 200 θ =25oC c 2 Gs=1000 W/m θ =50oC 2 c Gs=800 W/m 150 o 150 2 θ =75 C Gs=600 W/m c G =400 W/m2 θ =100oC s c 100 100

50 50 Output Power Output of PV (W) array Output Power Output of PV (W) array 0 0 0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50 Voltage of PV array (V) Voltage of PV array (V)

(c) P-V curve for different Temperature values and Gs=Gre f (d) P-V curve for different solar irradiance values and T=Tre f Figure A.1: PV panel performance as a function of the ambient air temperature and the solar insolation

q.v n = t (A.17) Ns1.K.Tc,re f

The above described set of equations are implemented on MATLAB-Simulink in order to plot the voltage-current (I-V) and the power-voltage (P-V) curves as shown in Fig. A.1.

Appendix B

Fuzzy Logic

The Fuzzy logic control is a rule based decision making technique that employs the human expertise on how to control a system or determine a proper decision to a problem, by implement- ing a set of rules. It can be classified into four main components [145]: First, a fuzzification process is applied to the inputs in order to transform them from their crisp to linguistic state. Second, a rule base is defined containing a fuzzy logic quantification of the expert’s linguistic description of how to find the best solution. Third, an inference mechanism is developed in order to apply the expert’s knowledge to the end of producing a good decision. Fourth, a defuzzification process is needed in order to convert the output of the inference mechanism into crisp values. A simplified representation of the fuzzy logic decision making steps is shown in Fig. B.1.

A number of linguistic variables and terms (u˜ j) are defined in order to evaluate the crisp inputs (ui) and classify them into categories. In fuzzy logic there is no extreme categorization of the inputs e.g. A person can be described as 70% tall and 30% short rather than strictly attributing

it to one of the two categories. In order to fuzzify the crisp inputs, membership functions µ ˜ j Ai are developed based on the human knowledge and experience relating to the problem. These j functions will map the crisp inputs into their equivalent set of linguistic value Ai as follows:   ˜ j  Ai = ui, µ ˜ j (ui) ∀ ui ∈ Ui with i = 1 → I; j = 1 → J Ai

Linguistic Crisp Inputs Crisp Inputs Outputs Fuzzy Inference Fuzzification Defuzzification system

Linguistic Ouputs Figure B.1: Simplified representation of the fuzzy logic decision making steps

131 132 APPENDIX B. FUZZY LOGIC

˜ j I being the total number of inputs and J the total number of linguistic inputs. Ai associates the crisp input ui to a degree of membership to its equivalent linguistic value u˜ j according to the

defined membership function µ ˜ j , thus completing the fuzzification process. For example, as Ai shown in Fig. B.2a, a 35% HVAC discomfort level (crisp input) is fuzzified to an equivalent of 66% Average, 7% High, and 0% Low discomfort (linguistic set of inputs). Following the

Low Average High Bad Average Good 1 1

0.8 0.8 0.66 0.6 0.6

0.4 0.4 Centroid 0.2 0.2 Degree of membership Degree Degree of membership Degree 0.07 0 0 0 0.1 0.2 0.3 0.35 0.4 0.5 0.6 0.7 0.8 0.9 1 0 10 20 30 40 45 50 60 70 80 90 100 D(HVAC) Grade (a) Fuzzification process (b) inference and defuzzification process

Figure B.2: Fuzzy logic decision making example

fuzzification process, a set of rules should be established in order to find the resulting output. They can be associated with weighting coefficients in order to favor some rules over others. The total number of rules is equal to JI. Fuzzy rules are simple IF-Then rules involving an antecedent and a consequent. When considering 3 linguistic values and a single input, 3 fuzzy rules can be established as shown below: Rule #1 : If D(HVAC) is Average Then grade is Average | {z } | {z } Antecedent Consequent Rule #2 : If D(HVAC) is Low Then grade is Good Rule #3 : If D(HVAC) is High Then grade is Bad A Mamdani inference system is considered, it consists of two main steps for the fuzzy rule implementation. First the antecedent is evaluated. In case multiple inputs are involved the rules will include "AND" and "OR" tests reflecting the user knowledge of the interdependency between the inputs and their impact on the decision, e.g.:

If D(HVAC) is High AND Autonomy is Low Then grade is Bad

In such cases a min-max inference method is applied in order to find the reshaping of the consequent corresponding to the "AND" and "OR" operators respectively. The second step of the Mamdani inference system consists in applying the implication process: the results of the fuzzy rules are applied to the membership functions of the consequent. The results of the fuzzy rules are then combined by aggregating them into a single output fuzzy set B. An example of the determination of the fuzzy output set is shown in Fig. B.2b; B is delimited by the thick fuchsia line. A defuzzification process is required in order to extract a crisp output from APPENDIX B. FUZZY LOGIC 133

the fuzzy output set. The centroid of area method is applied, the crisp output co is computed by applying the following formula, assuming that z is the output abscissa axis:

R z µB.z dz co = R z µB dz

As shown in Fig. B.2b, a 35% HVAC discomfort rate will lead to a grade of 45/100 after applying the centroid defuzzification method.

Appendix C

GA Pseudo-Codes for the DSM program

Algorithm C.1 Roulette Wheel Proportional Selection process (SEL)

1: procedure SEL(inputs: Pop[NInd][NVar],Fit_Ind[NInd]; output: Sel_Ind[NInd]) 2: Compute the cumulative fitness of the population (cum_fit) 3: for i=1 → NInd do . Compute selection probability of each individual i (Psel,i) 4: Psel,i=Fit_Ind[i] / cum_fit 5: end for 6: for i=1 → NInd do . Compute the cumulative probability of each individual Cum_Psel,i 7: Cum_Psel,i=Psel,i+Cum_Psel,i−1 8: end for 9: for i=1 → NInd do . Selection of the individuals for the mating process 10: Generate random number 0 6 r 6 1 11: Ind_index = 0 12: while (r > Cum_Psel,Ind_index) && (Ind_index 6 NInd ) do 13: Ind_index ++ 14: end while 15: Sel_Ind[i]= Ind_index ; 16: end for 17: end procedure

135 136 APPENDIX C. GA PSEUDO-CODES FOR THE DSM PROGRAM

Algorithm C.2 Two Point Crossover process (CROSS)

1: procedure CROSS(inputs: Sel_Ind[NInd], Pop[NInd][NVar],NVar; outputs: chil- dren[NInd][NVar], Children_Size) 2: Children_Size = 0 . Initialize Children_Size, the number of individuals chosen for the crossover 3: Randomly generate the first crossover points Cp1 > 3 . To ensure the continuity of the WM load 4: Randomly generate the second crossover points Cp2 with Cp1 < Cp2 < NVar 5: for i=1 → NInd do . Find the number of individuals involved in the crossover 6: Generate random number 0 6 r 6 1 7: if r < PCross then 8: Parent[Children_Size]= Sel_Ind[i] . Select the parent individuals 9: Children_Size ++ 10: end if 11: for i=1; i < Children_Size; i=i+2 do . Recombination Process 12: for c1=0 → Cp1 do 13: children[i][c1]=Pop[Parent[i]][c1] 14: children[i+1][c1]=Pop[Parent[i+1]][c1] 15: end for 16: for c2=c1 → Cp2 do 17: children[i][c2]=Pop[Parent[i+1]][c2] 18: children[i+1][c2]=Pop[Parent[i]][c2] 19: end for 20: for c3=c2 → NVar do 21: children[i][c3]=Pop[Parent[i]][c3] 22: children[i+1][c3]=Pop[Parent[i+1]][c3] 23: end for 24: end for 25: end for 26: end procedure APPENDIX C. GA PSEUDO-CODES FOR THE DSM PROGRAM 137

Algorithm C.3 Mutation process (MUT)

1: procedure MUT(inputs: Children_Size, ncyc, NVar−T , NVar; output: children[NInd][NVar]) 2: for i=1 → NVar do . Browse through each decision variable 3: for j=1 → Children_Size do . Browse through each individual of the children array 4: Generate random number 0 6 r 6 1 5: if r < PMut then 6: if i 6 3 then . The decision variable index corresponds to the WM 7: Randomly generate the 1st WM state children[ j][1] within the boundaries 8: Compute the 2nd & 3rd WM states with respect to the continuity con- straints 9: children[ j][2]=children[ j][1]+60 . The second washing state lasts for 60 min 10: children[ j][3]=children[ j][2]+15 . The third washing state lasts for min 11: end if 12: if (i > 3) && (i < ncyc + NVar−T ) then . Reference θSEWH 13: Generate the decision variable children[ j][i] within the preset boundaries 14: end if 15: if (i > ncyc + NVar−T ) && (i < NVar−T +2 × ncyc) then . Reference θHVAC 16: Randomly generate the decision variable children[ j][i] within the bound- aries 17: end if 18: if (i > NVar−T + 2 × ncyc) && (i < NVar) then . Number of operating ACU 19: Randomly generate the decision variable children[ j][i] within the bound- aries 20: end if 21: end if 22: end for 23: end for 24: end procedure 138 APPENDIX C. GA PSEUDO-CODES FOR THE DSM PROGRAM

Algorithm C.4 New Population Creation process (New_Pop)

1: procedure NEW_POP(inputs: Pop[NInd][NVar], Children_Size, Children[NInd], NInd, NVar; output: Best_Fit_Ind) 2: Fit_Tot_Pop[2 ×NInd ] . Define the array of the fitness values of the total population 3: Tot_Pop[2 ×NInd ][NVar ] . Combined population with generated children 4: Compute the fitness value of each individual in Tot_Pop and store values in Fit_Tot_Pop 5: Sort Fit_Tot_Pop in descending order and save the indexes of the individuals in Fit_index [NInd ] 6: for i=1 → NInd do . Update the Population 7: for j=1 → NVar do 8: Pop[i][j]= Tot_Pop[Fit_index[i]][j] 9: end for 10: end for 11: Best_Fit_Ind = Fit_Tot_Pop[1] . Assign the best fitness value of the new produced Population 12: end procedure List of publications

Journal articles

[1] J. Khoury, R. Mbayed, G. Salloum, and E. Monmasson. Optimal sizing of a residential PV-battery backup for an intermittent primary energy source under realistic constraints. Energy and Buildings, 105:206 – 216, 2015.

[2] J. Khoury, R. Mbayed, G. Salloum, and E. Monmasson. Predictive demand side manage- ment of a residential house under intermittent primary energy source conditions. Energy and Buildings, 112:110 – 120, 2016.

[3] J. Khoury, R. Mbayed, G. Salloum, E. Monmasson, and J. Guerrero. Review on the integration of photovoltaic renewable energy in developing countries—special attention to the Lebanese case. Renewable and Sustainable Energy Reviews, 57:562 – 575, 2016.

International Conference proceedings

[1] J. Khoury, R. Mbayed, G. Salloum, and E. Monmasson. Modeling of a hybrid domestic solar/electric water heater for hardware implementation. In Mediterranean Electrotechnical Conference (MELECON), 2014 17th IEEE, pages 560–565, April 2014.

[2] J. Khoury, R. Mbayed, G. Salloum, and E. Monmasson. Sizing of a PV-battery backup for an intermittent primary energy source. In 11th International Conference on Modeling and Simulation of Electric machines, converters and systems (ElectrIMACS), May 2014.

[3] Jawad Khoury, Rita Mbayed, Georges Salloum, and Eric Monmasson. Comparison of the water heating technique’s impact on the sizing of a standalone PV-battery backup system assisting an intermittent primary energy source. In Industrial Electronics Society, IECON 2015 - 41st Annual Conference of the IEEE, pages 000857–000862, Nov 2015.

139