New Modeling and Control Solutions for Integrated Microgrid System with respect to Thermodynamics Properties of Generation and Demand by MASSAGH Fang-Yu Liu B.S. Mechanical Engineering National Taiwan University, 2012 4OLOGY OCT I LIBRA RIES Submitted to the Department of Mechanical Engineering in partial fulfillment of the requirements for the degree of Master of Science in Mechanical Engineering at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY September 2014 @ Massachusetts Institute of Technology 2014. All rights reserved. A uthor ................... Signature redacted Department of Mechanical Engineering Aug 8, 2014 Certified by....... Signature redacted Kamal Youcef-Toumi Professor of Mechanical Engineering Thesis Supervisor Accepted by................... 20% Signature redacted David E. Hardt Professor of Mechanical Engineering Chairman, Committee on Graduate Students 2 New Modeling and Control Solutions for Integrated Microgrid System with respect to Thermodynamics Properties of Generation and Demand by Fang-Yu Liu Submitted to the Department of Mechanical Engineering on Aug 8, 2014, in partial fulfillment of the requirements for the degree of Master of Science in Mechanical Engineering Abstract This thesis investigates microgrid control stability with respect to thermodynamics behaviors of generation and demand. First, a new integrated microgrid model is introduced. This model consists of a combined cycle power plant, a building with air-conditioning system and a renewable source. This integrated model allows researchers to study microgrid stability while considering the physical behaviors of the generation and demand. Specifically, the model takes into account the slow dynamics existing in both the generation side and demand side. Second, a model predictive controller (MPC) is implemented for this new integrated system. The MPC uses a linearized model of this system to generate control commands by predicting the system behavior and optimize the system performance. The MPC minimizes an objective function that includes the power imbalance between generation and load, as well as the temperature differences between zone temperatures and the desired temperature setpoints. Overall, the results in this work proved that excellent grid balance could be achieved by a model predictive controller for our integrated model. The modeling and control performance have been verified by simulating several different scenarios. Thesis Supervisor: Kamal Youcef-Toumi Title: Professor of Mechanical Engineering 3 4 Contents 1 2 Introduction 13 1.1 Research Motivation ....... 1.2 Research Approach and Thesis Structure . . . . . . . . . . . . . . . . ........................... System Modeling Introduction ........ 2.2 Modeling of the Integrated System ................................ 17 Subsystem Modeling . . . . . . . . . . . . . . . . . . . . . . . 19 Model Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.3.1 Steady State of the System Model . . . . . . . . . . . . . . . . 31 2.3.2 Building Air-conditioning (AC) Subsystem . . . . . . . . . . . 33 2.3.3 Generation Sub-system . . . . . . . . . . . . . . . . . . . . . . 38 Simulation Results - Showing System Behaviors . . . . . . . . . . . . 41 2.4.1 Scenario 1: Effect on Grid Frequency with Increasing Fuel Demand of Generation . . . . . . . . . . . . . . . . . . . . . . . . 2.4.2 2.4.3 43 Scenario 3: Effect on Grid Frequency with Variation in Renewables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.4 41 Scenario 2: Effect on Grid Frequency with Changing in the Building Demand . . . . . . . . . . . . . . . . . . . . . . . . . 45 Scenario 4: Basic Control of Generation and Building under Renewable Variations . . . . . . . . . . . . . . . . . . . . . . . 2.5 17 . . . . . . . . . . . . . . . . . . . 2.2.1 2.4 15 17 2.1 2.3 13 Sum m ary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 50 54 3 Model Predictive Control for Integrated Microgrid System 3.1 . . . . . . . . . . . . . . . . . . 55 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 D esign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 M PC Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Simulation Results and Discussion . . . . . . . . . . . . . . . . . . . . 65 3.2.1 3.3 .. Introduction . . . . . . . . . . .. 3.1.1 3.2 55 4 Conclusions and Recommendations 69 4.1 Sum m ary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 4.2 Recommendations . . . . . . . . . . . . . . . . . . . .... . . . . . . . 70 A Tables 71 B MATLAB Code - Steady State Value of the System 75 C MATLAB Code - Model Linearization 81 D MATLAB Code - Model Predictive Control 6 109 List of Figures .. . . ..... . . . . . . . .. . 2-1 Standard 6-buses grid network . . . . . . . . . . . . . . . . . . . . . . . 18 2-2 Brayton cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2-3 Gas turbine block diagram . . . . . . . . . .... . . . . . . . . . . . . . 22 2-4 Steam turbine block diagram . . . . . . . . . . . . . . . . . . . . . . . . 22 2-5 Fuel system block diagram . . . . . . . . . . . . . . . . . . . . . . . . . 23 2-6 Single-shaft combined cycle power plant model . . . . . . . . . . . . . . . 25 2-7 The building + air-conditioning model . . . . . . . . . . . . . . . . . . . 27 2-8 Steady state simulation for generator angles and speeds. 61 62 63 32 2-9 Steady state simulation for generation powers, valve positions and fuel flows. 32 Vp1 W 1 Pml V 2 W1 2 Pm2 .. . W1 W2 W3 . 2-10 Steady state simulation for building temperatures. Tzi Twii Tw1 2 Twi3 . . . . 33 2-11 Building AC sub-system verification results of cooling effect. . . . . . . . . 35 2-12 Building AC sub-system verification results of cooling effect. . . . . . . . . 35 Tw14 Tc1 Tf1 Tz 1 Tw 2 1 Tw 22 Tw 23 Tw 24 Tc 2 Tf 2 . . . . . .. .. 2-13 Building AC sub-system verification results with ambient temperature change. 36 2-14 Building AC sub-system verification results with ambient temperature change. 36 2-15 Building AC sub-system verification results with power input change. . . 37 2-16 Building AC sub-system verification results with power input change. . . 37 2-17 Generation sub-system verification results with fuel increase . . . . . . . . 39 2-18 Generation sub-system verification results with fuel increase. The zoom-in version for Figure 2-17. . . . . . . . . . . . . . . . . . . . . . . . . . ... . 2-19 Generation sub-system verification results with fuel decrease. 7 . . . . . . . 39 40 2-20 Generation sub-system verification results with fuel decrease. The zoom-in version for Figure 2-19. . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 2-21 Scenario 1: Time domain simulation of the mechanical power of generation for the integrated system with increasing fuel demand. . . . . . . . . . . . 42 2-22 Scenario 1: Time domain simulation of the mechanical power of generation for the integrated system with increasing fuel demand. The zoom-in version of Figure 2-21. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 2-23 Scenario 1: Time domain simulation of the generator (motor) angles and speeds for the integrated system with increasing fuel demand. . . . . . . . 43 2-24 Scenario 2: Time domain simulation of the generator (motor) angles and speeds for the integrated system with changing in the building demand. . 44 2-25 Scenario 2: Time domain simulation of temperature of the building for the integrated system with changing in the building demand. . . . . . . . . . 2-26 Scenario 3-1: Fast and small variation in the power generated by renewables. 44 46 2-27 Scenario 3-1: Time domain simulation of the generator (motor) angles and speeds for the integrated system with fast and small renewable power variation. 46 2-28 Scenario 3-2: Slow and small variation in the power generated by renewables. 47 2-29 Scenario 3-2: Time domain simulation of the generator (motor) angles and speeds for the integrated system with slow and small variation in renewables. 47 2-30 Scenario 3-3: Fast and large variation in the power generated by renewables. 48 2-31 Scenario 3-3: Time domain simulation of the generator (motor) angles and speeds for the integrated system with fast and large variation in renewables. 2-32 Scenario 3-4: Slow and large variation in the power generated by renewables. 48 49 2-33 Scenario 3-4: Time domain simulation of the generator (motor) angles and speeds for the integrated system with slow and large variation in renewables. 49 2-34 Governor steady-state power-frequency characteristics . . . . . . . . . . . 51 2-35 On-off + proportional controller algorithm . . . . . . . . . . . . . . . . . 51 2-36 Scenario 4: Control commands for the generations and building with basic control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 52 2-37 Scenario 4: Time domain simulation of the generator (motor) angles and speeds for the integrated system with basic control. . . . . . . . . . . . . 53 2-38 Scenario 4: Time domain simulation of the mechanical power of the generation for the integrated system with basic control . . . . . . . . . . ... . . 53 2-39 Scenario 4: Time domain simulation of temperature of the building for the integrated system with basic control. . . . . . . . . . . . . . . . . . . . . 54 3-1 Principle of MPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 3-2 Time domain simulation of the generators angles for both nonlinear and linear m odel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 61 Time domain simulation of the generator speeds for both nonlinear and linear m odel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3-4 Time domain simulation of the mechanical power of generation for both nonlinear and linear model. 3-5 . . . . . . . . . . . . . . . . . . . . . . . 61 Time domain simulation of the zone temperatures for both nonlinear and linear m odel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3-6 Structure of the MPC . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3-7 The control commands calculated from the MPC. . . . . . . . . . . . . . 65 3-8 Time domain simulation of the generator (motor) angles and speeds for the integrated system under MPC. . . . . . . . . . . . . . . . . . . . . . . . 3-9 66 Time domain simulation of the mechanical power of generation for the integrated system under MPC. . . . . . . . . . . . . . . . . . . . . . . . . . 66 3-10 Time domain simulation of temperature of the building for the integrated . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 3-11 The power difference over time . . . . . . . . . . . . . . . . . . . . . . . 67 system under MPC. 9 10 List of Tables 3.1 x, z and u for our integrated system . . . . . . . . . . . . . . . . . . 3.2 x, y and u for our integrated system modified for MPC . . . . . . . . 64 60 A.1 Notation for the zone model . . . . . . . . . . . . . . . . . . . . . . . 72 A.2 Steady state value of the integrated model . . . . . . . . . . . . . . . 73 11 12 Chapter 1 Introduction 1.1 Research Motivation The renewable energies are playing an important role today and more so in the future. Due to its sustainability and little environmental impact, utilizing renewables become an ideal solution to the depletion of fossil fuel sources. Therefore, government and industries are looking for ways to efficiently manage the renewables. As the rapid development of the renewable energy techniques, the penetration of variable energy resources has increased tremendously in recent years. The high penetration of renewable resources into the grid changes the conventional structure of the grid. A motivation of dividing grid network into smaller networks that allow local controller implementation has emerged. Microgrids concept is then introduced which is very different from the conventional grid structure. Microgrid presents a cluster of loads and distributed energy resources (DERs) operating as a single engineering system, which is capable of supplying its owanlocal load in both grid-connected and autonomous (island) mode {I1J. The mi- crogrid can act autonomously without being connected to the utility, or it can also connect to the utility under huge disturbances. This small semi-autonomous system offers increased reliability and efficiency for the power system network. The microgrids concept has great capabilities but also present new challenges. As a small-scale power units, the fluctuation of load and the intermittency of renewable 13 energy - particularly wind and solar - will make a huge impact on the stability of microgrid, especially during island mode. The microgrid stability has been investigated in many research papers [17]. Much effort by researchers has been spent on developing methods to address such great challenges in order to make microgrids become a reality. Different modeling and control structures have been proposed in literatures [4] [3] [12]. Generally, microgrids are modeled as a small-scale version of the conventional grid that can be connected or disconnected to the utility grid. The major control structures can be summarized into three categories, island mode control [22], hierarchical control [27] and agent based control [6]. In island mode control, the microgrid is designed to run autonomously with local controller on each micro-sources. In hierarchical control, three control levels are used for maintaining reliable operation, using a centralized controller at upper level to control all the local controllers. In agentbased control, agents can represents the physical or virtual entities to communicate and react to each other and the environment. A gap in the existing literatures is the integration of physical models that include slow dynamics from both the generation and load sides. The grid dynamics considered in the previous works are basically the coupled electromechanical dynamics among synchronous generators, which is the most relevant to grid frequency. However, the time-scale of this kind of dynamics is really fast when compared to the thermal response (ex. the ramping effect of generation and the thermal capacitance of building load). Therefore, it is important to take into account the physical characteristics of generation and load in order to realize the grid dynamics. An integrated model that considers those important characteristics of generations and loads is introduced in this thesis. Additionally, a model predictive controller is implemented based upon this model. Chapter 2 describes the detailed modeling of each component in this system using MATLAB language. Those components are connected by a standard grid model to form the integrated system. Verification testing of each component and whole system confirmed that the model behaves as expected. Several simulation results are shown in this chapter to demonstrate the system be14 havior under different actions. Chapter 3 covers the development of model predictive control for the integrated system in the MALAB environment. Simulation results demonstrate the performance of the proposed control approach. 1.2 Research Approach and Thesis Structure To address these emerging challenges mentioned above, the microgrid requires a more comprehensive model to investigate the important characteristics of generation and load, as well as a more generalized control method to achieve better grid stability. And given the small size of a microgrid and advances in computational and communication speeds, the possibility of a purely centralized real time control that could get information from both generation and load sides and communicate between each other is much greater. Therefore, we propose a new integrated modeling solution for microgrid with power plant generation and building load, as well as a model predictive control structure based upon this new model. 15 16 Chapter 2 System Modeling 2.1 Introduction The purpose of this work is to investigate the thermodynamic effects of both the generation and load on the microgrid. Here we introduce an integrated model that consists of a combined cycle power plant subsystem as the dispatchable generation, as well as a building air-conditioning subsystem as the controllable load. The main objective is to generate a physical-based model that captures both the fast and slow dynamics of these subsystems. The details of the different subsystems are first described. Then simulation results are presented to show the verification of the system response. Finally, the chapter demonstrates the overall system behaviors under three different scenarios. 2.2 Modeling of the Integrated System The modeling objective of this section is to develop & generalised iateggAted model of a microgrid. This. integrated model consists of a standud -6&b rniegwrid system used as the grid network [251. In addition, it incorporates a dispatchable generation subsystem, a variable generation subsystem and a controllable load subsystem. These are all connected to different buses in the grid network. The combination of all the subsystem forms an integrated model of the microgrid system. Figure 2-1, inspired 17 from [25], shows the whole structure of the system, which contains two dispatchable generations (Buses 1 and 2), one variable generation - renewables (Bus 3) that can represent solar or wind energy generation, one building (Bus 4), and two static loads (Buses 5 and 6). Dispatchable Generation Dispatchable Grid 0Generation Comind CdeFo I Combined Cyde I Power Plant Powe Plat 2 I Controllable Load Buding + Air-conditioning System . 5 3 Variable Generation RenewaNes Static Load 0 Static Load Figure 2-1: Standard 6-buses grid network Bus 1: Dispatchable Generation (Combined Cycle Power Plant) Bus 2: Dispatchable Generation (Combined Cycle Power Plant) Bus 3: Variable Generation (Renewables) Bus 4: Controllable Load (Building + Air-conditioning System) Bus 5: Static Load Bus 6: Static Load 18 As shown in Figure 2-1, the overall system consists of five subsystems: the dispatchable generation, the variable generation, the controllable load, the static load, and the grid subsystem. Details of each subsystem modeling are stated in what follows. 2.2.1 Subsystem Modeling Generation Subsystem 1. Dispatchable Generation - Combined Cycle Power Plant In power generation, the combined cycle power plant (CCPP) plays an important role due to its increased efficiency and low emissions. Therefore, our model uses a combined cycle power plant model to present the characteristics of the dispatchable generation. The combined cycle power plant consists of a gas turbine and a steam turbine. The steam is generated by firing hot exhaust gases from the gas turbine using the heat recovery steam generator. Gas Turbine The most commonly used model for a gas turbine in CCPP is Rowen's model [24]. Rowen's model has provided a starting point for the development of gas turbine models but it doesn't include the physical behaviors of the gas turbine. Therefore, several gas turbine models have been introduced in the literature with different degree of complexity to get deeper insight into internal processes. There are some reviews that give a brief comparison of those models [26] [9] [21]. The model used in this work to capture the physical behavior of the gas turbine of a CCPP is based on the Detailed model [10] [19]. The thermodynamic characteristics of the gas turbine are modeled by algebraic equations in the Detailed model. These equations axe corresponding to the adiabatic compression and expansion, as well as the isobaric heating within the combustor of a gas turbine. A schematic of the gas turbine is shown in Figure 2-2. It is based on a Brayton thermodynamic cycle. The actual Brayton cycle consists of four processes: 1-2 adiabatic compression, 2-3 isobaric heat addition, 3-4 adiabatic expansion, 19 2 Chwnber 34TM.t Turbkn* CaMMp M 9 W 4 Figure 2-2: Brayton cycle 4-1 isobaric heat rejection. The algebraic equations describing these thermody- Td=Ti(1+ ) xc = (PR , namic processes are presented below (Equation (2.1)): Xh = (PR Te = Tf(l - 7 (1 - ) fe bnLHV TI=Td+(%Cph Wf + W Wf Wf +W 'Yh- ) -h 1 )7t) Pg = (W + Wf)Cph(Tf - Te) 20 - WCpc(Td - T) (2.1) where Td the temperature at compressor outlet T the temperature at compressor inlet Tf gas turbine firing temperature Te exhaust gas temperature 77C compressor efficiency 77t turbine efficiency 71eoma combustion efficiency PR compression ratio 7c cold end ratio of specific heats W air flow Wn air flow at nominal operation Wf fuel flow Wfn fuel flow at nominal operating condition LHV lower heating value of natural gas hot end ratio of specific heats Cph specific heat of exhaust gas flow CCc specific heat of air flow Pg the power setpoint For this model, the input is the fuel flow labeled by W and the output is the mechanical power setpoint labeled by Pg. This model has no dynamics, we are adding a first order differienotial eque*1oaWdemonstrate the dynamic response of the gas turbine..The dynamics is-ralatingthe power setpoint and the actual mechanical power output of the gas turbine. The overall block diagram of the gas turbine is shown in Figure 2-3. And for the overall gas turbine model, the input is the fuel flow labeled by Wf and the output is the mechanical power 21 generated by the gas turbine labeled by Png. Gas turbine Gas Turbineb d I + STCD Algebraic Equations Figure 2-3: Gas turbine block diagram where Wf fuel flow Pmg the -power generated by the gas turbine TCD gas turbine time constant Steam Turbine In this thesis, a simplified steam turbine model, which only takes into account the dynamics within the heat recovery steam generator, is used. The dynamics is modeled as a second order response shown in Figure 2-4. The input is the power setpoint from the algebraic equations Pg, and the output is the mechanical power generated by the steam turbine Pm,,. Stus Turbine P PM (1 +sT,.)(1+sTb) Figure 2-4: Steam turbine block diagram 22 where PM the power generated by the steam turbine Tm steam turbine time constant Tb heat recovery boiler time constant Fuel System The fuel system in the CCPP is modeled as a second order differential equation as shown in Figure 2-5. The input is the fuel demand labeled as F and the output is the fuel flow labeled as Wf, which is also the input to the gas turbine model. Fuel qutsin i 1d Wr Figure 2-5: Fuel system block diagram where Fd fuel demand V valve position TV valve position r time conota4t TF fte1aytem time constat At steady state, the fuel flow is exactly the same as the fuel demand. 23 The Synchronous Generator Model There are various sophisticated and detailed models in the literature [20]. For our purpose, we choose the most commonly used second order simplified model that captures the electromechanical properties of synchronous generators. The second order model describes the acceleration (deceleration) of the synchronous generator due to any imbalance between the mechanical power and electrical power. For each generator i, we have Wi = 7rf (Pmi(pu)- Pe(pu) - Diwi) where rotor angle rotor speed Pm(pu), Pe(pu) per unit mechanical power, electrical power D damping coefficient H generator rotor inertia f nominal frequency The overall CCPP model consists of a gas turbine, a steam turbine, a fuel system, and a synchronous generator. The block diagram for the overall CCPP model is shown in Figure 2-6. 24 Fuel systern F IW I - AfgebraWe equations of energy traufwrm 1 + sTF 1 + STV P Gas turbine Synchronous P P6 + P, Generator 1+ s 1 ;CI1 (1 +srT)(1+s b) Heat recvery/Steam turbine Figure 2-6: Single-shaft combined cycle power plant model There are seven state variables in the CCPP model representing the valve position V, the fuel flow Wf, the mechanical power output from gas turbine P,, the mechanical power output from steam turbine Pn, the rate change of the mechanical power output from steam turbine R,&., as well as the angle and the speed of the synchronous generator 5,, w. The input to the overall CCPP model Js the fue demadinto the4uel ystem labeledas F&ndoutput isithe net electrical power output from the synchronous generator ii Ieled& the ideal cases, the net power output of our CCPP model is twice of the power output of a single gas turbine. This is not the case in practice, but this simplified model is sufficient for the purpose of this thesis. 2. Variable Generation - Renewables The variable generation is presented as a simple power injection into the grid with forecast. The forecast could be a square signal, a sinusoidal signal or the 25 real-time data obtained from solar or wind resources. Load Subsystem 1. Controllable Load - Building with Air-conditioning System For the building models, there are three main types of methods in the literature [2]: nodal (multi-zone) method, zonal method and CFD (Computational Fluid Dynamics) method. The resulting models are all based on solving the equations describing the thermal behaviors of the building. Among these three, the CFD method is the most complete approach. It is appropriate for investigating the detailed local effect inside the building. The zonal method is a first degree of simplification of the CFD method. It's a two-dimensional method and can be used to study the spatial and temporal distribution of the building temperature. However, both the CFD and zonal methods require huge computation time. And both methods requires knowledge related to flow dynamics. In this work, since we are only concerned with the temperature behaviors, the nodal (multi-zone) approach is chosen to describe the building load. The nodal method is a one-dimensional method, with a main assumption that each building zone is a homogenous volume described by uniform variables. Therefore, each zone is treated as a node with a unique temperature. The heat transfer equations are solved for each node of the system. The nodal method is good for multi-zone building modeling and it's easier to implement with reasonable computation time [5], [15], [18], [1]. Figure 2-7 shows the whole structure of the building including the air conditioning model, which consists of two zones and an airconditioning system. 26 Outside air i M M*ut * Supply air T Cooling coil Return air Zone 1 Zone 2 Tn T Ta Figure 2-7: The building + air-conditioning model The Zone Model The governing equations derived from mass and energy balance of each zone i are given by, d Tz. hMsaiCp(Tsa - Tzi) Czi dt 4 + 1hwij Awi (Twij - Tzi) j=1 + he Aes(Tej - Tzi) + hfpAfp(Ti - Tzi) (2.2) Equation (2.2) states that rate change of energy in a zone is equal to the difference between the power transferred to the zone by convection and the power removed from the zone. The time derivative of the zone temperature Tz is given by this energy equation. This temperature depends on the wall temperature Tw, the ceiling temperature Tc, the floor temperature Tf, the supply air temperature Ta, and the ambient temperatures Tamb. The ambient temperature is set by the environment. The other associated temperatures are coming from the equations stated below. 27 For the internal walls of each zone i, we have 0w13 d Tw dt =hj j(z- wj + hwij Awij (Tz-adjacent Tw ) - (2.3) Equation (2.3) shows the rate changes of the energy in internal walls are equal to the energy transferred through walls due to temperature difference between the indoor temperature and the adjacent zone temperature. For the external walls of each zone i, we have - hwl Awj(Tzi - Twi ) Cwd dt + hwij Avij(Tamb - Twi) (2.4) Equation (2.4) shows the rate changes of the energy in external walls are equal to the energy transferred through walls due to temperature difference between the indoor temperature and the ambient temperature. For the ceiling and floor of each zone i, we have Ce d T'd = hci Aci(Tzi - Te ) + hciAci(Tamb - Tdi) dt Cf + hfiAfi(Tamb -Tf) dt =hA(Tzi-T) (2.5) where the notation is given in Table A.1. Equation (2.5) shows the rate changes of the energy in ceilings and floors are equal to the energy transferred through ceilings and floors due to temperature difference between the indoor tempera, ture and the ambient temperature. 28 The Air-conditioning System The air-conditioning system contains a mixing box and a cooling coil. The energy balance of the air in the mixing box is given by, Tmix T o'Tamb + EN = mfaiTz ha=z 2.6) 26 Msa Equation (2.6) shows the air temperature comes out of the mixing box Tmi, depends on the ambient temperature Tamb and the return air temperature from each zone Ti. The energy consumption of the cooling coil is calculated as follows, Pcwling = COP (mix Tsa) (2.7) Equation (2.7) shows the power input to the cooling coil Pcooing has effect on the supply air temperature Ta. The performance of the cooling coil is quantified by the coefficient of performance (COP) in the equation. 2. Static Load The static load is presented as constant power consumption over time. Grid Subsystem The grid itself is modeled by a set of algebraic equations, which come from the power flow analysis shown in Equation (2.8). VAVjGi cos(i - 93) Pe= + ViGr 2 2 + ( + Bij sin(9 2 - 9,)] Qei = -- 1 VV[Gi 3 sin(Oi - Oj) 3 VViB + - Bij cos( 2 - 93)] 29 (2.8) where 9 bus voltage angle V bus voltage magnitude Pe, Qe active electrical power and reactive electrical power G, B real and imaginary part of the system admittance matrix Detailed formulation of this equation can be found in [8]. The renewables and static loads are modeled as static power injections, which affect the system admittance matrix. 30 2.3 Model Validation This section presents simulation results to ensure that the components and subsystems in the integrated model behaves as they axe intended to. 2.3.1 Steady State of the System Model The integrated model has a set of differential equations associated with 30 states shown in Table A.2. The steady state values can be calculated by setting all the derivatives in the differential equations to zeros. Here we calculate the steady state value from the equations in the previous section and run the simulation to verify it. The MATLAB code for finding the steady state value is in Appendix B. From calculation, the steady state value of the system states are listed in Table A.2. Simulation results show the system behavior when setting the calculated steady state values in Table A.2 as initial conditions. Figure 2-8 shows the time domain simulation of the generator angles and speeds, Figure 2-9 shows the time domain simulation of the power output and the fuel flow of the generation, and Figure 2-10 shows the time domain simulation of the building temperatures. From these three figures, the calculated steady state values are verified. Nothing changes in the 1200 seconds simulation duration. The whole system rests in equilibrium. 31 1 01 1 1 I 1 1 Phase Angle Difference of Synchronous Generators Over Time 1 I I 1 0 -0)- - - < -20 -30 I I 120 I 60 II 240 I 180 I II II I I I 540 600 660 720 Time (sec) I I I I 420 480 I I I 300 360 Gen1 angle Gen2 angle Loadi angle II 840 II 780 II 900 II II II I 960 1020 1080 1140 1200 Speed of Synchronous Generators Over Time 61 I 1 1 - Geni speed - Gen2 speed -Load1 speed 6C .5- 60 U) 55 9.5- 60 120 I I I I r 0 180 240 300 480 540 600 660 Time (sec) I I I I I 360 420 720 780 840 I I 900 960 1020 1080 1140 1200 Figure 2-8: Steady state simulation for generator angles and speeds. 61 62 63 W1 W2 W3 Mechanical Power Over Time 1.8r - GenI mechPower -Gen2 mechPowerJ -1.6L CL 1.4- ~1.21j 200 0 600 Time (sec) 800 1000 1200 Valve Position/Fuel Flow Over Time -Geni Valve Position - Gent Fuel Flow -Gen2 Valve Position - Gen2 Fuel Flow - 0.85r- 400 0.8 0.75 0.7 0 0.654 .J-I I 200 0 400 600 Time (sec) j 800 1000 1200 Figure 2-9: Steady state simulation for generation powers, valve positions and fuel flows. Vp1 Wf1 Pm1 V 2 Wf2 Pm 2 32 Temperature Over Time for bus 4 (building) 244-Z.r.I2.P0.11 - 24. 24.2 - 24.1 - 24 23, - E 800 00 00400 0 10 1000 Time (sec) Temperature Over Time for bus 4 (building) 2 7.5 -- I2, P24 1 6 r1 Z41.H I.3P1p0041 27-22_ Ztadl - state s at f. T T2T 24.5 -1222 E Time ag IO 0401. seeiigc)-MU 242 Tw14 2. Buidin 2.2 Figure 2-10: 1200 2.040406010 2 Tc1 Time (sec) f1 Ai-wnaxo T Tw2 z1T2012T222Tw23 T Tc2 f (AC)Subsste n building temperatures. foroftebidnlCsbsse a etdwt min emertr Tz Steady ~ ~~~~~" behllo ~ ~~ ~simulation The ~ ~~~ state Twig Tw 1 2 Tw 1 3 Tw 14 Tcj Tf1 Tz, TW 2 1 TW 22 Tw 23 Tw 24 Tc 2 Tf 2 eprtr Inta 2.3.2 ftewoebidn s3 Ther ambien temperauetruh Building Air-conditioning (AC) Subsystem The behavior of the building AC sub-system was tested with ambient temperature change and power input (the power input to the air-conditioning unit) change. Case 1: Figures 2-11 and 2-12 show the expected cooling event of a building. The initial temperature of the whole building is 300. The ambient temperature through- out the whole simulation period is also 300. When the air-conditioning is off, the whole building remains at 300. At 240 seconds, the air-conditioning is turned on. As expected, the zone temperatures, the wall temperatures as well as the ceiling and floor temperatures ramped down due to the cooling effect. The ramping rates of the wall, ceiling and floor temperatures are slower than the zone temperature due to their larger capacitances. We also assumed that the airflows to these two zones are the same in this case. Therefore, we can see from Figure 2-12 that the final temperature of zone 1 is lower than zone 2 due to its smaller volume. 33 Case 2: Figures 2-13 and 2-14 show the building behaviors subject to ambient temperature change. The room temperature goes down (goes up) as the ambient temperature decrease (increase) under the same power input. Case 3: Figures 2-15 and 2-16 show the building behaviors subject to input power change. The room temperature goes lower as the power input increase. And the room temperature ramped back to the ambient temperature (300) when the air-conditioner is off. The steady state temperatures of the zone temperatures as well as the wall, ceiling and floor temperatures under three cases can be calculated from the MATLAB code in Appendix B. The calculated steady state temperatures match the simulation results. 34 Ambient Temperature Over Time 31 30.8- 30.6 - 30.4 30.2- E) 29.829.4 -29.2 -- 0 20 40 1200 Time (sec) Power input to the air-condition unit 0.5 0.45 -- 0.4 0.35 -- 0.3 -0.25 0.2 -o- ..,5 -- 0.1 -- 0.05 -010 2 Boo 400 Time (sec) 1200 Iwo0 Figure 2-11: Building AC sub-system verification results of cooling effect. Temperature Over Time for bus 4 (building) C E 28 -- lr Znl mprur Time (sec) Temperature Over Time for bus 4 (building) -2o1000o.00 29- Zon.1 3004902p1ra41r . .040 . .I01mperatur0 .... -23n31 00404i 10,mporaIur. - -.. Zn31 3 - -- Z4ne2 - Zon.2 w40 w004 Oloraor Ioomperaur - 27 ' 23 - E 25 - Zooo2o: loo pro.ur 3) 0 200 400 6Tm Time (sec) 800 I 1000 1200 Figure 2-12: Building AC sub-system verification results of cooling effect. 35 Ambient Temperature Over Time 29.5 E329 2 21.5 28 E CL27.5 F- 27 26.5 0 260 Time (sec) Power input to the air-condition unit O 5I 0 CL a -0.5- I 1000 2000 3TMe 4000 S=0 5000 Time (sec) Figure 2-13: Building AC sub-system verification results with ambient temperature change. Temperature Over Time for bus 4 (building) 24 - Z-2 temperature 23,5 --23 -22.522- CL 21.5 - - E S21 20Tec1.0 1 30DO 2 400M Time (sec) 60 0 5000 Temperature Over Time for bus 4 (building) 27 26 - 25 -. - tlm erlr wa ~~~Z0.e1 al: temperalure mprlr CL 23 - E --- Zo - 22 Zonel1wal tempsrlure ZonI wa]l temperature I floor Iemperalur. -- Zons2 wall lemperature - ---- Ioe calng temperalurm Z.n 0 1000 2M00 3000 4D0 5600 Zo2 wall lempemture uper lm - 0Zon2 w11 Zo.2 I rlng Imspersture --- Zon2 , 20 - ilor temperature Figure 2-14: Building AC sub-system verification results with ambient temperature change. 36 Ambient Temperature Over Time - 31 30.630.4302302 E 29.8- E) 29 .6- 29.4 - 29.2 0 l0 2000 00 300 Time (sec) DO s00 60 5000 6000 Power input to the air-condition unit 0.9 0.8 0.7 0.6 0.5 0,4 0.3 0.2 0.1 0 100D 2000 4000 Time (sec) Figure 2-15: Building AC sub-system verification results with power input change. Temperature Over Time for bus 4 (building) - 28 26 02 22- WONm tempertur ZonI E C)20 - 18 Zn-1 wEAl --- 0 1000 4000Woo 2000 --- 3000 Time (sec) 4000~Z tempemilure Z"ne wall temporaiure Z"n2 I-pmpeiure -Zone1wl tMp9ralur. I00 f--Znt. waN-p-rtur. -2 _n11.nn tepMW - Z_2e W.oo tempmraur . 1. Temperature Over Time for bus 4 (buldng ejmemes wall tempwralure n2 -- -Z n2 wallr - 28 wall - -Z - -Zn2 -n2 tempoaum mprur Celr1emerau I-oo 22 24 E 22 Ill 0 1000 2M00 Time (sec) 4000 5" 60DO Figure 2-16: Building AC sub-system verification results with power input change. 37 2.3.3 Generation Sub-system The behavior of the generation sub-system was tested with the fuel demand input. Figures 2-17 - 2-20 show the simulation results of the verification test, which confirmed the expected system behavior. When there's an increase in the fuel demand, both fuel flow and power output of the power plant increase accordingly at different rates due to different time constants. In contrast, when there's a decrease in the fuel demand, both fuel-flow and power output of the power plant decrease accordingly at different rates due to different time constants. Figure 2-17 shows the simulation results when encountered a fuel demand increase at 50 seconds. Figure 2-18 is the zoom-in version of Figure 2-17. From the graphs, we can see that the valve position and fuel flow can quickly catch up with the fuel demand due to its small time constant (T, = 0.05s and TF = 0.4s). The mechanical output power goes up as a a combination of first order and second order response. The time constant associated with the first order response is the gas turbine constant TCD = 0.2s, and the time constants associated with the second order response are the steam turbine constants Tm = 5s and T = 20s. Figure 2-19 shows the simulation results when encountered a fuel demand decrease at 50 seconds. Figure 2-20 is the zoom-in version of Figure 2-19. From the graphs, we can see that the valve position and fuel flow can quickly catch up with the fuel demand due to its small time constant (T, = 0.05s and TF = 0.4s). The mechanical output power goes down as a a combination of first order and second order response. The time constant associated with the first order response is the gas turbine constant TCD = 0.2s, and the time constants associated with the second order response are the steam turbine constants Tm = 5s and T = 20s. 38 Valve Position/Fuel Flow - 2.5 I I I 10 20 30 -- Valve Position -Fuel Flow 2 21.5 0 CL > 0 40 50 Time (sec) 60 I 1 1 70 80 90 70 80 100 Mechanical Power Over Time 4 3.5 -0 Ca -- Gen mechPower 0 20 10 30 40 60 50 90 100 Time (sec) Figure 2-17: Generation sub-system verification results with fuel increase Valve Position/Fuel Flow --- Valve Position -Fuel Flow I 25- Ca 48 49 50 Time (sec) 51 52 . -Gen 52 53 Mechanical Power Over Time 2.8- 5 2.6a S2.4c 2.2a 247 48 I 49 I . 50 Time (sec) 51 52 mechPower 53 Figure 2-18: Generation sub-system verification results with fuel increase. The zoom-in version for Figure 2-17. 39 Valve Position/Fuel Flow 1 2 -Valve -Fuel 0 LL o.5H 0 0 Position Flow 0 CU5-0. 0 > 10 20 30 40 50 Time (sec) 60 70 80 Mechanical Power Over Time I I I I 90 100 -- Gen mechPower 1.5 0 0.5 Ca 0 -0.5 0 I 10 I 20 I 30 I 40 I 50 Time (sec) I 60 I 70 80 90 100 Figure 2-19: Generation sub-system verification results with fuel decrease. Valve Position/Fuel Flow -Valve Position - Fuel Flow 0.5- IL S00 as -0.5 47 48 49 50 Time (sec) 51 52 53 Mechanical Power Over Time -- Gen mechPower Z51.50 CL C: 0.5 47 48 49 50 Time (sec) 51 52 53 Figure 2-20: Generation sub-system verification results with fuel decrease. The zoom-in version for Figure 2-19. 40 2.4 Simulation Results - Showing System Behaviors This integrated system has three manipulated inputs: the fuel demand to both generations (Fdl, F2), and the power input to the building (Pooiing). Scenario 1 and 2 show the system behaviors subject to input change. Scenario 1 demonstrate the effect on grid frequnecy with generations' fuel demands change. Scenario 2 demonstrate the effect on grid frequnecy with building's power demand change. Scenario 3 demonstrate the effect on grid frequency with different level of renewables power penetration. 2.4.1 Scenario 1: Effect on Grid Frequency with Increasing Fuel Demand of Generation To study the impact of increasing fuel demand of generation on grid stability, the power consumption of the building remains unchanged as the fuel demand increase. In this case, each generation has increased its fuel demand by 0.2 per unit. The mechanica1imr of ea g *mon ramped up due to the increasingfuel demand as shown in Figur2-21. Figure 2-22 is the zoom-in version of Figure 2-21, which shows the fuel system dynamics as described in Section 2.2.1 and verified in Section 2.3.3. The increase of power generated by generations due to raising fuel demand causes a power imbalance within the grid, which results in the oscillations in the generator angles and speeds (frequency). Figure 2-23 shows the results of the time domain simulation in generator angles and speeds. Total of 40% raise in the fuel demands results in approximately 0.5 Hz frequency oscillation. 41 Mechanical Power Over Time 2 -- Genl mechPower --- Gen2 mechPower 1.8 1.6- 0 C. .0 1.4 ( 1.2II 0 200 400 1 1 600 Time (sec) 800 1200 1000 Valve Position/Fuel Flow Over Time -Valve -Fuel Position Flow c 0.8- > 0 200 400 600 Time (sec) 800 1000 1200 Figure 2-21: Scenario 1: Time domain simulation of the mechanical power of generation for the integrated system with increasing fuel demand. Mechanical Power Over Time 1.8 -Gent -Gen2 1.6 mechPower mechPower 'L 1.4 1.2 1 c -7 0 2 3 4 5 Time (sec) 6 7 8 9 10 Valve Position/Fuel Flow Over Time 1.1 -Valve Position, Fuel Flow 1 0 - 0.9 ILL 0.8 0 >0.7 -a > 0 1 2 3 4 5 Time (sec) 7 8 9 10 Figure 2-22: Scenario 1: Time domain simulation of the mechanical power of generation for the integrated system with increasing fuel demand. The zoom-in version of Figure 2-21. 42 Phase Angle Difference of Synchronous Generators Over Time 1 401 1 -- Gen1 angle - - Gen2 angle 20 -- Lodl angle -o0 <-20-4011 0 60 120 180 240 300 360 420 480 540 600 660 720 Time (sec) 780 840 900 960 1020 1080 1140 1200 840 900 960 1020 1080 1140 1200 Speed of Synchronous Generators Over Time 61 60.5 IZ Q Ce en --- Gen2 speed -Load1 speed 60 59.5- 0 Figure 2-23: 60 120 180 240 300 360 420 480 540 600 660 720 Time (sec) 780 Scenario 1: Time domain simulation of the generator (motor) angles and speeds for the integrated system with increasing fuel demand. 2.4.2 Scenario 2: Effect on Grid Frequency with Changing in the Building Demand To study the impact of power demand changes, Figure 2-24 and 2-25 show the results of the time domain simulation with changing in the building demand corresponding to the temperature of the zones. In this case, the building air-conditioning unit is turned on and off trying to maintain the zone temperatures around the temperature setpoint 270. When the controller is turned on, the building consumes 50 MW power. When the controller is turned off, the building consumes 0 MW power. The performance of the on and off controller can be seen from Figure 2-25. The controller presented here is just used to change the consumed power in load in order to investigate the grid response to load changes. Therefore, we are not going to talk about this control in detail. The change in building consumed power results in the oscillations in the generators angles and speeds as shown in Figure 2-24. The figure shows about 50 MW changes in building power demand can result in approximately 2 Hz frequency 43 oscillations. In this case, the power generated by the generation remains unchanged. 150 6 100- - Gen1 angle -- Gen2 angle Load1 angle 50- 1 1 Phase Angle Difference of Synchronous Generators Over Time 3 4 4 5 6 6 7 7 8 9 2 3 240 300 1 1 1 0) *0 0 0) 00 -50 -00 60 120 180 360 420 480 540 600 660 720 Time (sec) 780 840 900 960 1020 1080 1140 120 0 Speed of Synchronous Generators Over Time 64 1 1 1 1 1 1 1 1 540 600 660 Time (sec) 720 780 840 900 6260 U) 60 120 180 240 300 360 420 480 960 1020 1080 1140 1200 Figure 2-24: Scenario 2: Time domain simulation of the generator (motor) angles and speeds for the integrated system with changing in the building demand. Temperature Over Time for bus 4 (building) -2=2 -I 29.5 2.9 28 0. 27 -400 27.5 E26 25. 0 2W 600 400 Time (sec) JIM 00 1000 12 Temperature Over Time for bus 4 (building) wall I-mrture - -Zonl -Z- 1W tigpeaure 29 28.5 ~-Z"n2 28 cw al emp ure wa: tempe :a ume E W 275 27 26s1 0 200 400 Time (sec) 800 Ioo 1200 Figure 2-25: Scenario 2: Time domain simulation of temperature of the building for the integrated system with changing in the building demand. 44 2.4.3 Scenario 3: Effect on Grid Frequency with Variation in Renewables To study the impact of renewables penetration, Scenario 3-1 to 3-4, described below, show the variation in the power generated by the renewables at different levels and rates. A square wave was chosen to demonstrate the extreme case of energy variation. The time constant of the building model is approximately 2 minutes. To represent a fast variation, the power generated by the renewables changes every 1 minutes. And to present a small variation, the power generated by the renewables changes every 5 minutes. The net load of this system is approximately Pet = 600 MW. To represent a large variation, the power generated by the renewables changes between +0.2 Pet and -0.2 Pat. And to present a small variation, the power generated by the renewables changes between +0.8 Poet and -0.8 Pet. The power generated by the dispatchable generation and the power consumed by the building remain unchanged. Scenario 3-1 and 3-2 investigate the effect on grid frequency with small renewable power variation. Figure 2-26 and Figure 2-28 show the power variation profiles of the renewables over time. Figure 2-27 and Figure 2-29 show the resulting generator angles and speeds due to renewable power variation. We can see from both cases, about 0.8 Hz deviation of frequency occurs due to the 120 MW change of the renewable power. 45 * Scenario 3-1: Fast and small variation in the power generated by renewables Power Variation of Renewables Over Time I I I I 300 360 I I I i I 100 50 0 0 CL -WOF -100 0 60 120 180 240 420 480 540 600 660 time (s) 720 780 840 900 960 1020 1080 1140 1200 Figure 2-26: Scenario 3-1: Fast and small variation in the power generated by renewables. Phase Angle Difterence of Synchronous Generators Over Time 0) eI angle Gen2 angle - <40 0 60 180 120 240 300 360 420 480 540 600 660 Time (sec) 720 780 840 900 960 1020 1080 1140 1200 Speed of Synchronous Generators Over Time G1 -- 60.5 NZ a, Gen1 speed -Gen2 -Loadi speed s 60 59.5 "0 60 120 180 240 300 360 420 480 540 600 660 720 Time (sec) 780 840 Y T -F I 900 960 1020 1080 1140 1200 Figure 2-27: Scenario 3-1: Time domain simulation of the generator (motor) angles and speeds for the integrated system with fast and small renewable power variation. 46 e Scenario 3-2: Slow and small variation in the power generated by renewables 1 50[ I 1 60 120 Power Variation of Renewables Over Time 1 1 1 1 1 1 I 1 1 1 1 100 50 0 a a0 -50- -10oo- 00 180 240 300 360 420 480 540 600 time 660 720 780 960 1020 1080 1140 1200 840 900 (s) Figure 2-28: Scenario 3-2: Slow and small variation in the power generated by renewables. Phase Angle Difference of Synchronous Generators Over Time I I 60 120 I I III I I I I I I 720 780 840 I I I I 200 - -20 -G0 180 240 300 360 420 480 540 600 660 Time (sec) 900 960 1020 1080 1140 1200 Speed of Synchronous Generators Over Time 6 a 60 Co U)--Gn 59.5spe speed 60 120 180 240 300 360 420 480 540 600 660 Time (sec) 720 780 840 900 960 1020 1080 1140 1200 Figure 2-29: Scenario 3-2: Time domain simulation of the generator (motor) angles and speeds for the integrated system with slow and small variation in renewables. 47 * Scenario 3-3: Fast and large variation in the power generated by renewables Power Variation of Renewables Over Time 500400300200100- 00i ca -100-200-300- -500 F__-- __FN 60 120 180 240 0 E F- 300 360 420 __ 480 I 540 600 time (s) t--[-1 660 720 780 840 900 ~ - -400- 960 1020 1080 1140 1200 Figure 2-30: Scenario 3-3: Fast and large variation in the power generated by renewables. Phase Angle Difference of Synchronous Generators Over Time ,x 107 CD 5D 0) (D R, 0-5-GenI -Gen2 -Load1 -10- 15 1 0 120 180 240 300 angle angle angle 360 - 420 480 LIIII 540 600 660 Time (sec) 720 780 840 900 960 1020 1080 1140 1200 900 960 1020 1080 1140 12 00 Speed of Synchronous Generators Over Time 200 I 5, 5) 0~ U) 0 - -- Gen speed -200- -Gead~speed -4001 0 60 120 180 240 300 360 420 480 540 600 660 Time (sec) 720 780 840 Figure 2-31: Scenario 3-3: Time domain simulation of the generator (motor) angles and speeds for the integrated system with fast and large variation in renewables. 48 e Scenario 3-4: Slow and large variation in the power generated by renewables Power Variation of Renewables Over Time I I 360 420 I I I 400300- - 200 - 100 0 0 100k-200 -300-400 -50' 0 60 120 180 240 300 480 540 600 time (s) 660 720 780 840 900 960 1020 1080 1140 1200 Figure 2-32: Scenario 3-4: Slow and large variation in the power generated by renewables. X 107 51 1 1 1 Phase Angle Difference of Synchronous Generators Over Time 1 1 -5- CD --- < -10-1 0 5 60 120 180 240 300 Gen1 angle Gen2 angle Load1 angle 360 420 480 600 660 720 Time (sec) 540 780 840 900 960 1020 1080 1140 1200 Speed of Synchronous Generators Over Time 40 2000- a. -200 - - C/) __. -- Gen1 speed -- Gen2 speed -Loadi speed -400-600 0 60 120 180 240 300 360 420 480 600 660 Time (sec) 540 720 780 840 900 960 1020 1080 1140 1200 Figure 2-33: Scenario 3-4: Time domain simulation of the generator (motor) angles and speeds for the integrated system with slow and large variation in renewables. 49 Scenario 3-3 and 3-4 investigate the effect on grid frequency with large renewable power variation. Figure 2-30 and Figure 2-32 show the power variation profiles of the renewables over time. Figure 2-31 and Figure 2-33 show the resulting generator angles and speeds due to renewable power variation. Under large variation of renewables, the frequency deviates significantly from the nominal 60 Hz. Scenario 3-1 to 3-4 demonstrate the influence of renewables penetration on the grid stability. Small and large renewables variation results in different levels of frequency deviation. The oscillations in frequency under small renewable power variations are relatively small and basically symmetric about the nominal frequency (60 Hz), which are generally considered acceptable for reliable operation. In contrast, very different transient behavior is observed with large variations. Under large power variation, the frequency deviates significantly from nominal frequency (60 Hz) and settle at a higher or lower frequency. The microgrid system goes completely unstable due to large power imbalance within the grid. 2.4.4 Scenario 4: Basic Control of Generation and Building under Renewable Variations To address the existing control problem with this new integrated model, we choose the most common control method for both generation and building. Two decentralized controllers are presented: (1) automatic generation control for generation (2) on-off controller + proportional controller for building air-conditioning system. Automatic Generation Control - Turbine Governor The turbine governor is designed to maintain the desired system frequency as the load changes by adjusting the mechanical power output of the turbine. Figure 2-34 is the steady-state characteristic of a turbine governor. The change in speed (frequency) is sensed by the governor and it will act to adjust the turbine input controlled signal in 50 order to change the mechanical output power. AI af lA R Pv~ Figure 2-34: Governor steady-state power-frequency characteristics On-off Controller + Proportional Controller The on-off controller is a bang-bang controller while the proportinal controller is calculated control output proportional to the error signal, which is the difference between the setpoint and the process variable. In this case, a hybrid controller is implemented. The temperature setpoint is set to be 270. Therefore, the error signal for proportional controller is the temperature difference between the current zone temperature and the temperature setpoint. Figure 2-35 shows the complete algorithm for this hybrid controller. If Pm. -= T.... 0 thim > Ta..,.g+1 thu =-k - Twa P..Ih, = (T'- sog T0 .. eke I T,.,.. < T&... - 1 thu Pm"UM. = 0 elm T... -T..) P.... =~ - Mnd V Figure 2-35: On-off + proportional controller algorithm The reason for this, kind of hybrid controller is becaase the cmrrent building airconditioning systems are generally equipped with variable speed fan that allows the 51 power input be adjusted with respect to temperature measurements. In this case, the generator control and building control are completely decoupled. Figure 2-37, 2-38, 2-39 show the time domain simulation results of the basic control. Figure 2-36 shows the control actions by the AGC and the building controller. The building controller adjust the input power to the building depends on the temperature difference. However, the performance is not ideal due to the on and off behaviors. The temperature fluctuates within a temperature range of [260 29']. On the other hand, the AGC controller tends to adjust the fuel demand to reduce the frequency deviation. Overall, the intermittency of renewable energy, and the power demand needed to maintain the building within a comfort zone contribute to a large fluctuation of the net load, which makes the system frequency deviates away from its nominal value. With the basic control, the system is not completely loss it stability, where the system still recovers and tends to go back to nominal 60 Hz, but the peak deviation is too large and unacceptable. Power Demand of Building Over Time 0.5 0.40.3 00.2EL 0.1- 0 60 120 180 240 300 360 420 480 540 600 660 Time (sec) 720 780 840 900 960 1020 1080 1140 1200 780 840 -Gent Fuel Demand Gen2 Fuel Demand 900 960 1020 1080 1140 1200 Fuel Demand to Generations Over Time 1.5 a'0.5 LL0 60 120 180 240 300 360 420 480 540 600 660 Time (sec) 720 Figure 2-36: Scenario 4: Control commands for the generations and building with basic control. 52 Phase Angle Difference of Synchronous Generators Over Time 100 I I I I I I I I 720 780 840 900 I 50W 12 -50 -150 0 60 120 180 240 300 " GelangleW -Gen2 angle~ -Load angle -100 360 420 480 540 600 660 Time (sec) 960 1020 1080 1140 1200 - Speed of Synchronous Generators Over Time 63 62- r61 60 Wl 59 58 571 0 Figure 2-37: 540 600 660 Time (sec) 720 Scenario 4: Time domain simulation of the generator (motor) angles and speeds for the integrated system with basic control. -Gent -Gen2 Mechanical Power Over Time 2.5r mechPower mechPower a 1.5 - a) 0.5 0 200 400 600 Time (sec) 800 1000 Valve Position/Fuel Flow Over Time 1.5 - Gent Valve Position -Gent Fuel Flow - Gen2 Valve Position - Gen2 Fuel Flow F-- IL L---F 0.5 0 0 -J U 200 400 600 Time (sec) 800 1000 1200 Figure 2-38: Scenario 4: Time domain simulation of the mechanical power of the generation for the integrated system with basic control. 53 Temperature Over Time for bus 4 (building) 95 28.5C2 28 27 -- 26.5202 4. 100 Time (sec) - Zone1 wall --- o -Z0n- Temperature Over Time for bus 4 (building) 11,Il *eln -~~ ZOnM2 wed: - 29,5 - -- 2.5 wa Z-n2 temperature wall tmperaturm tmp-ratur. mperau floor tempqralure Summary Through the modeling and simulation of the integrated system, we could find that the fluctuation with generation, renewables and load influence the system frequency greatly. And basic uncoordinated controls of generation and building are not sufficient to maintain the system frequency within an acceptable range. In the meantime, the building temperature performance is not ideal either. Therefore, there's a need to provide a more generalized control method that can take the characteristic of generation and building into account for this new introduced system model. 54 Chapter 3 Model Predictive Control for Integrated Microgrid System 3.1 Introduction A more generalized control method is now needed to control the integrated system and taking into account the physical characteristics of the generation and building. In this Chapter, a model predictive controller is presented and evaluate the system behavior from a linearized model of the integrated system. The simulation results show that the controlled system exhibits a satisfactory performance without violating the system's physical constraints. 3.1.1 Background Model Predictive Control (MPC) is an advanced control method thakhms been used in several industries over several decades. In recent years, MPC has been used for power system models. MPC is a look-ahead method to optimize system outputs based on the knowledge of system behavior. It relies on a descriptive model of the system to predict the system's future behavior in order to compute the control commands by optimizing an objective function over a finite receding horizon. The advantage of the MPC method is that it can easily be incorporated in the control of MIMO 55 (multi-input, multi-output) systems. Additionally, MPC is capable of setting constraints on the inputs and outputs of the system in the calculation of future control actions. This is why MPC was chosen for this work. Due to the physical limitations on generation and demand, the ability to compute control actions without violating system's constraints and maintain proper system operation is very important. There are two main breakthroughs in our work: I. Generally, most of the MPC applications in power system or energy field are based upon economic dispatch. The objective of an economic MPC is to minimize the cost function comprising the total electricity cost of the system [23 [7]. In our work, the performance index involves physical variables in order to address the imbalance between generation and demand. II. Some of the literature shows model predictive control on trajectory deviation on certain variables such as voltage or frequency [13] [14]. However, these studies used mostly grid models that consider the generation and load as simple power injections. The mathematical model developed and used in this thesis to predict the microgrid system behavior under MPC is a new integrated model. As indicated in the previous chapter, namely section 2.2, this model includes the thermodynamic characteristics of generation and demand as well as the grid topology. 56 3.2 3.2.1 Design MPC Setup The basic principle of MPC is graphically depicted in Figure 3-1, inspired by [16]. past future I 4d I 1 Trajectory -Reference -- Predicted future output Past output UA n _J7 Optimal future input trajectory (time k) Past input - --- Optimal future input trajpctory (time k+1) k k+I Control horizon (p) Prediction horizon (m) k p k+Fm JI Figure 3-1: Principle of MPC At every time step t-k, the MPC solves an optimization problem over a finite prediction horizon [k, k+m] with respect to an objective function to ensure that the predicted outputs can stay as closer to the reference trajectory. The control action is computed over a control horizon [k, k+p], where p<m. However, only the first control solution is implemented for each time step. The next control solution comes from redoing the whole optimization over the next finite time window [k+1, k+m+11. The optimization problem is solved by minimizing an objective function with the general form as shown in Equation (3.1). Ny J Nu Wy(yi - ri) 2 = i=1 + Zwui AUi 2 = 57 (3.1) The first term in Equation (3.1) represents the difference between expected output and output reference. The second represents the control signal change. The parameters wyi and w,,i are weights. This representation also assumes that there are N, outputs and N. inputs. System Linearization Our nonlinear multi-input multi-output (MIMO) model developed in Section 2.2 was built in MATLAB environments. However, the Model Predictive Control Toolbox provides a control function available in MATLAB that is limited to linear system models. In order to use the MPC, a linear approximation model of our nonlinear system is generated around some operating points. The non-linear differential and algebraic equations of each individual subsystem model of our system can be put together to form an overall system-integrated model. The general algebraic-differential equations of the integrated system model are shown below: Eb f(x, z, u) 0 g(x, z, u) where x represents the system state variables, z represents the algebraic variables that typically appear in the algebraic equations associated with the model and the power flow equations The variable u designates the control inputs. The function f is the nonlinear function that represents the system differential equa- tions, and g is the function that represents the system algebraic equations. The differential equations of our integrated system models are described in Section 2.2 and the algebraic equations of the system are stated as follows 58 For each bus i: n o = -Pe + VsG + E VVj[Giy cos(Oi - 03) + Bij sin( 2 - Oj)I 7=1 o= -Qe -VsB VV[Gi 3 sin(i - 0,) - Bi3 cos( 2 - 8,)] + j=1,joi For each generator i: 0 = Eisetpojft -- Ej - V E. Xdi sin(i - bi) V2 V E- 0 =-Qei --+ cos( Xdi Xdi 2 -i6 ) 0 =-R where 0 bus voltage angle V bus voltage amplitude j generator voltage angle E generator voltage magnitude Xd generator synchronous reactance The state matrix A, of the linearized system is obtained by eliminating the algebraic variables. fA f g;' A(. -9 gz AzJ - 0 J A, =Af - fzgz 9M 59 (3.2) This is assuming that g- is nonsingular. From Equation (3.2), we can get a linearized system: b= A~x+ Bu Table 3.1 shows the state, intermediate algebraic and the input variables of our system. The linearization of the nonlinear model was calculated at every time step and fed into the MPC. The system is only linearized around one operating point for coding simplification. The system studied in this thesis is subject to small disturbances. The operating point was chosen to be the steady state conditions listed in Table A.2. And the MATLAB code for deriving the linearized model is' in Appendix C. Table 3.1: x, z and u for our integrated system x Vp 1 Wf 1 Pmg1 Pms1 Rms1 61 w 1 Vp 2 Wf 2 PMg 2 PMs 2 Rms 2 62 w 2 63 w 3 Tz1 Twn Tw 12 Tw 13 Tw1 4 Tc1 Tf1 Tz 2 Tw 2 1 Tw 2 2 Tw 23 Tw 2 4 Tc 2 Tf 2 V1 V2 V3 V4 V5 V6 E1 Pe1 Qe1 E2 Pe2 Qe2 E3 Pe3 Qe3 z 01 02 03 04 05 06 u Fd1 , Fd2 , Pcoouing Simulations were conducted to verify the validity of the linear model. The nonlinear and linear model were both simulated and the results are shown in Figure 3-2 - 3-5. From these four figures, we can see that the linearized model gets the same resutls as the nonlinear model except for a little offset in the zone temperature. But the offset is approximately 0.05', which is acceptable for the MPC design. 60 Ph2s 9 Angle Di 6n66 of Synchron6us G0n66 Sp..d aWM 6 vWr Tim -0G62 2629 (6006620) -L06269W62.6 60,8 .Synro Gou Gnraor 0- Tim -- - L6ad66.p2( n-a - 6084 606 10 ql n i w~G 1604 $9.659.4- -% 90 0 260 66 (0 0 620 Iwo0 2 40 SW T66 Tim. (-2) 100 120 Figure 3-2: Time domain simulation of theFigure 3-3: Time domain simulation of the generators angles for both nonlinear andgenerator speeds for both nonlinear and linear model. linear model. i L55 Mechacal Powe 0e Tlmpeatue Tim -h G.4 - Ome Timne 1wr bu 4(building 1:- 1.35- 12 1.15- 20 40 260 Bo0 1000 1200 T6m6 60 ) 0 Figure 3-4: Time domain simulation of theFigure 3-5: Time domain simulation of the mechanical power of generation for bothzone temperatures for both nonlinear and nonlinear and linear model. linear model. Input-Output Choices The system's control inputs are limited to three controllable attributes of the system: the fuel demand of both generators (ui = Fdl, U 2 = Fd2), and the power input of the building air-conditioning unit (U 3 = Pcooling). The outputs are chosen to be the power difference between generation and demand (yi = Pmi + Pm2 the temperature of both rooms in the building (y2 - Pcooling), and = Ti and Y2 = Tz 2 ). Because this choice of outputs can ensure the control system to maintain the power balance and building temperature within an acceptable range. 61 Therefore, the objective function in Equation (3.1) becomes, J = Wy1(Y1 - r1 ) 2 + w, 2 (y 2 - r2 ) 2 + wy 3 (y3 - r3 ) 2 + WU1AU1 2 + Wu 2 AU 2 2 + W 3 AU 3 2 where r1 is the power difference reference signal, r2 and r3 are the zone temperature reference signal. Aui represents the control signal difference with control input in steady state. MPC Structure Figure 3-6 shows the structure of the MPC setup for the integrated system. At every time t=k, MATLAB runs the nonlinear integrated system model first over the prediction horizon to get the continuous linearized system model. And then create an MPC based on the linearized model. The Model Predictive Control Toolbox discretizes a continuous-time plant with sampling time ts automatically. The MPC controller will calculate the future control actions upon a weighted objective function. The objective function has two parts: one to minimize the power imbalance between generation and demand, the other one minimizes the temperature difference of the room temperatures with the desired temperature. The weights on the power balance in the performance index are set to some higher values than those associated with the zone temperatures. This will make the power imbalance small and consequently eliminates the oscillations in the grid frequency. The lower weights on the temperatures may result in some error in temperature tracking. However, the zone temperatures can be allowed to vary from their references and still have a comfortable environment. 62 MPC Predic wd Outpu Future Control Inputs Fu Ure En SySfteM Reference Trajectory System outputs Objective Constraints Function Figure 3-6: Structure of the MPC The main purpose of this MPC control is to show if we control the imbalance first with respect to the thermodynamic effects on both the generation and demand. Even thought the frequency of the system is not predicted and controlled by the MPC controller, the frequency oscillation of the grid can still be significantly reduced. Tunning The MATLAB Model Predictive Control Toolbox has a limitation on the model. Namely, the direct feed-forward from the control inputs to any output is not permitted. In our system, the first output that represents the power imbalance is a function of the input power. Therefore, a first order behavior, with a small time constant (T), is added as shown in Equation (3.3). Tp is chosen as approximately 100 times smaller than the smallest time constant in system model. The actual power input to the building (Pcooing) becomes a state and the power demand becomes an input (Pd). .1 Pcooing = (Pd - 63 Pcooling) (3.3) Table 3.2: x, y and u for our integrated system modified for MPC x y Vp 1 Wf1 Pmg1 Pms1 Rms1 61 w1 Vp 2 Wf 2 PMg 2 PMs2 Rms 2 62 W2 63 w 3 Tz 1 Twnl Tw1 2 Tw 13 Tw1 4 Tc 1 Tf1 Tz 2 Tw 2 1 Tw 22 Tw 23 Tw 24 Tc 2 Tf 2 PCOOun (P1 + Pm2 -Pd) Tz Tz 2 u Fd1 Fd2 Pd Tamb where Pd power demand for the building T, time constant = 0.0001s In order to take into account the influence of the ambient temperature, we also add one more input as a measured disturbance Tamb. Then the system becomes a model with 31 states, 4 inputs and 3 outputs (2 manipulated inputs and 1 measured disturbance) shown in Table 3.2 The simulation sampling time is set to be 30 seconds. This was the smallest sampling possible due to computer limitations. Although this control sampling rate is a little larger than the time constant of the generation, but it is proved to be sufficient for the simulation results. Each simulation iteration has a unique linear plant for the MPC. This linear plant is calculated from the nonlinear model in real-time. And the reference value for the system is also updated. Both the inputs and outputs are constrained, and with different weights in the objective function. The fuel demand inputs (Fdl, F2) are constrained to [0 2] (per unit) and the power demand input (Pd) is constrained to [0 1] (MW). The temperatures of the building are set to be positive and not greater than Tamb. The weight structure for inputs is set to [0 0 01, since we are not concerned about the control cost in this case. The weight structure for outputs is set to [3 1 1], which emphasizes the weight for the first output term (the power imbalance of the system). For the prediction horizon and control horizon, several different values are tested with simulation. Tests indicated that the prediction horizon cannot be too long and the 64 control horizon cannot exceed a portion of the prediction horizon in order to avoid some numeric issues during calculation. Therefore, the final value of the prediction horizon is 60 sampling time and the control horizon is 5 sampling time. Details of the controller in MATLAB code can be found in Appendix D. The next section shows the simulation results for the MPC. 3.3 Simulation Results and Discussion The MPC is implemented and simulated on the 6-bus system and under the same renewables power variation as described in Section 2.4.4. The simulation results show the system behavior under MPC. The controller tends to maintain the building room temperature around the temperature-setpoint (Tdesired = 270) while ensuring the minimum power difference between generation and demand at the meantime. Control Commands Calculated from the MPC. - -- Fuel Demand for Generation 1 200 0.5 H 400 _j __j j L' 600 time (s) L_j -L L L- L 800 --L__ _ F 1000 ' H % __ _ L 1L-- 1200 Control Commands Calculated from the MPC. 0.20 -Power Input for Building AC Systeml - 0.26 - 0.24 0.22 -0.2 --.10200 400 600 (s) time 800 1000 Figure 3-7: The control commands calculated from the MPC. 65 1200 Phase Angle Difference of Synchronous Generators Over Time 40 Q - 1 1 20 - .h.. ..... 1 .... IV -20 -40 60 120 180 240 300 360 I I 420 480 540 600 660 Time (sec) 720 780 840 900 960 1020 1080 1140 1200 Speed of Synchronous Generators Over Time 61 60.5- I I I I I I I1 .. k .JL I Gent speed -- Gen2 speed 60 CL) 59 .5 - ) 59 60 120 180 240 300 360 420 480 540 600 660 Time (sec) 720 780 840 900 960 1020 1080 1140 1200 Figure 3-8: Time domain simulation of the generator (motor) angles and speeds for the integrated system under MPC. Mechanical Power Over Time 2 -Gn ec w - 1.5 0.5 0 200 400 600 Time (sec) 800 1000 1200 Fuel Flow Over Time 1.5- -Gent -Gen1 L[ L 1 -- Gen2 fuelDemand fuelFlow fuelDemand Gen2 fuelFlow 0L 0 .57-rLL 0 200 400 600 Time (sec) 800 1000 1200 Figure 3-9: Time domain simulation of the mechanical power of generation for the integrated system under MPC. 66 Temperature Over Time for bus 4 (building) 30.5 30 29.5 28.5 C. 28 E a2 27.5 27 26.5 400 Soo Time (sec) 100O Temperature Over Time for bus 4 (building) all =3 1 --- ---Zon wdB Zo - - 29 'mperature iall Z,0110 6.p0811 2 wag18 315p*12301 - a) Q. E .mp.rr wall b.mperatur. tomp.rure Z o allIigtmperatur Z" temp ratur. Zone 29,5 Z"o2 .Oog 30sp-t-o o-Z021 or30,0p53030 28.5 - - 28 0 2W 4W No Time (sec) I0m 1200 Figure 3-10: Time domain simulation of temperature of the building for the integrated system under MPC. Power Difference Over Time I, -- - -- Power Difference Output 7 - Reference Power Difference -- .- ~l .~ 3 1.5 , - I , II 2 I 1 I 0 0.5 I - COL I I I I II I 0 I 200 400 600 Time (sec) 800 1000 1200 Figure 3-11: The power difference over time The control solutions optimized by the MPC are shown in Figure 3-7. And Figure 3-9 shows the mechanical power generated by the generators due to the control inputs. 67 From 3-10, we can see that the MPC finds a perfect power input to the building that could maintain the temperature around 28 0 without fluctuation. Although the room temperatures are not exactly at the desired temperature 270, the performance is acceptable for a building climate control since generally people can withstand the temperature changes within a certain range. From Figure 3-11, we can see that the power difference (yi) is tracking the reference value r, as expected. The reference signal is computed by the grid loss with renewables forecast information. The reference power difference is fed into the MPC to minimize the power imbalance in the microgrid. Figure 3-8 shows the time simulation results of generator angles and speeds (frequency), the grid frequency is reduced to 0.5 Hz oscillation, which is considered acceptable (< 0.2% of nominal 60 Hz = 1.2 Hz). In the MPC setup, we didn't provide the MPC controller with any information about the grid frequency. However, by predicting the power imbalance from the system model, we can reduce the oscillation in the grid frequency successfully. The results proved that we could achieve better grid stability from minimizing the power imbalance based on the thermal characteristics of the generation and building. 68 Chapter 4 Conclusions and Recommendations 4.1 Summary This thesis has introduced a new physical model for microgrid systems. The model integrates detailed dynamics of each sub-system in the microgrid. The simulation results of the integrated system demonstrate the effects of the coupled thermodynamic and electromechanical behaviors. This choice of system boundary not only enhances the overall knowledge of microgrid behaviors but also provides a more realistic model for understanding control performance. The second part of this thesis presents the design and implementation of a Model Predictive Controller (MPC) along with its performance evaluation. A linearized model is generated from the original nonlinear system. This linear model is used in the desigi and testing of the MPC. The model integrates the thermodynamic model of generation and demand within the overall system model, and allows the MPC to use the information from both sides to optimize the control actions while minimizing power imbalance. The simulation results show that the model predictive controller successfully reduces the grid frequency deviation and at the same time maintains the building temperature within acceptable limits in the face of variations in renewables. 69 4.2 Recommendations There are two main ways to build upon this thesis work. First, the modeling concept can be used to study different sub-systems that are connected to a microgrid. Specifically, physical models of the combined cycle power plant and building air-conditioning sub-systems were introduced to help in understanding the behavior and effects of generation and demand. One can incorporate other physical dynamic system models into this microgrid system to study grid dynamic and control performance issues. Furthermore, this thesis focused only on the frequency stability issues concerning this microgrid model. The voltage limitations and other constraints have yet to be investigated. One approach among others to demonstrate the control formulation and performance evaluation of such an integrated microgrid system. Other control method could be attempted specifically ones that can handle constrained optimization requirements for nonlinear physical systems with large dynamic and disturbance effects. 70 Appendix A Tables 71 Table A.1: Notation for the zone model Tzi C_, Tij A* y h,, 3 Tei Aci hci Tf Apj hf the the the the the the the the the the the Tamb the ambient temperature Ta C, the temperature of supply air specific heat of air mass flow rate of supply air to each zone i maai temperature of each zone i capacitance of each zone i temperature of four walls of each zone i, j = 1-4 area of four walls of each zone i, j = 1-4 heat transfer coefficient of four walls, j = 1-4 temperature of the ceiling of each zone i area of the ceiling of each zone i heat transfer coefficient of the ceiling of each zone i temperature of the floor of each zone i area of the floor of each zone i heat transfer coefficient of the floor hoa mass flow rate of outside air mrai mass flow rate of return air from each zone i 72 Table A.2: Steady state value of the integrated model V1 Wf1 Pmgi Pms1 Rms1 0.6363 0.6363 0.5268 0.5268 0 61 0 Wi V,2 62 60 0.8493 0.8493 0.7500 0.7500 0 5.7124 w2 60 63 w3 Tz 1 Twil -26.9004 60 23.7478 26.8739 26.8739 26.8739 24.0226 26.8739 26.8739 24.2974 27.1487 27 1487 27.1487 24.0226 27.1487 27.1487 Wf 2 Pmg2 Pms 2 Rm8 2 Tw1 2 Tw13 Tw14 Tc, Tfi Tz 2 Twai Tw 22 Tw 23 Tw2 4 Tc2 Tf 2 73 74 Appendix B MATLAB Code - Steady State Value of the System 75 1 clear all 2 close all 3 clC 4 5 Pcooling = 0.5; 6 Pfan = 0.5; 7 Tamb = 30; 8 9 syms xl x2 x3 x4 x5 x6 x7 x8 x9 x10 xll x12 x13 x14 10 11 Ni = 2; 12 Nj = 4; 13 Ns 14 hw = zeros (Ni,Nj); 15 Aw = zeros(Ni,Nj); 16 Cw = zeros (Ni,Nj); 17 hc = zeros(Ni,l); 18 hf = zeros(Ni,l); 19 Ac = zeros (Ni,l); 20 Af = zeros (Ni,l); 21 Cz = zeros(Ni,l); 22 Cc'= zeros (Ni, 1); 23 Cf = zeros(Ni,l); 24 Cp = 1.005; 7; = 25 26 Msa = 0.5; 27 msa = zeros (Ni,1); 28 msa(l) = Msa*Pfan; 29 msa(2) = Msa*(l-Pfan); 30 Moa 31 Mra = Msa-Moa; 32 mra = zeros (Ni,1); 33 mra(l) = Mra*0.5; 34 mra(2) = Mra*0.5; 35 COP = = 0.1; 2.5; 76 Tsa = -COP /Msa/Cp*Pcooling + (Moa*Tamb+mra (1) *xl+mra (2) *x8) /Msa; for j=1:Nj hw (1, j) = 0. 02; Aw (1, j) = 1; Cw (1, j) = 5; 0.02; end for j=1:Nj hw (2, j) = Cw (2, j) = 5; end Aw (2, 1) = 2; Aw(2,2) = 1; Aw(2,3) = 2; Aw(2,4) = 1; Cz(1) = 2.5; Cc (1) = 5; Cf (1) = 5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w(i,4)*Aw(i,4)+hc(i)*Ac(i)+. 88 hf(i)*Af(i))*x8+hw(i,1)*Aw(i,1)*x9+hw(i,2)*Aw(i,2)*xlO+... 89 hw(i,3)*Aw(i,3)*xll+hw(i,4)*Aw(i,4)*x12+hc(i)*Ac(i)*x13+... 90 hff(i)*Aff(i)*x14); 91 f9 92 hw(i,1)*Aw(i,1)*Tamb); 93 fl0 = 0 == 1/Cw(i,2)*(hw(i,2)*Aw(i,2)*x8-2*hw(i,2)*Aw(i,2)*xlO+. 94 hw(i,2)*Aw(i,2)*Tamb); 95 fl1 96 hw(i,3)*Aw(i,3)*Tamb); 97 f12 = 0 == 1/Cw(i,4)*(hw(i,4)*Aw(i,4)*x8-2*hw(i,4)*Aw(i,4)*x12+. 98 hw(i, 4) *Aw(i, 4) *x1) 99 f13 = 0 == 1/Cw(i,1)*(hw(i,1)*Aw(i,1)*x8-2*hw(i,1)*Aw(i,1)*x9+... = = 0 == 1/Cw(i,3)*(hw(i,3)*Aw(i,3)*x8-2*hw(i,3)*Aw(i,3)*x11+. 0 == ... 1/Cc(i)*(hc(i)*Ac(i)*x8-2*hc(i)*Ac(i)*x13+hc(i)*Ac(i)*Tamb); 1o f14 = 0 == ... 1/Cf(i)*(hf(i)*Af(i)*x8-2*hf(i)*Af(i)*x14+hf(i)*Af(i)*Tamb); 101 102 103 [xl, x2, x3, x4, x5, x6, x7, solve(fl,,f2,ff3,ff4,f5,ff6,ff7, 104 x8, x9, xlO, x1l, x12, x13, x14] ... f8,f9, flO,ffll,ff12, fl3,ffl4,xl,x2,x3,... x4,x5,x6,x7,x8,x9,xlO,xli,x12,x13,x14); 78 105 X-steady = [xl, x2, x3, x4, x5, x6, x7, x8, x13, x14]; 106 save ( 'steadyValueBuilding.mat', 'X_steady'); 107 108 syms Fd 109 500; 110 Wn ill Wfn = 10; 112 W 113 Wf = Fd*Wfn; 115 Ti = 298; 116 PR = 15.4; 117 rc = 1.4; 118 rh = 1.33; 119 Ec = 0.86; 120 Et = 0.89; 121 Ecomb = 0.99; 122 Cpc = 1.005; 123 Cph = 1.157; 124 LHV = 47141; = 1*Wn; = 114 125 126 Xc = 127 Td = Ti*(1+(Xc-1) /Ec); 128 Tf = Td + (Ecomb*LHV)/Cph*Wf/(Wf+W); 129 Xh = 130 Te = Tf*(1-(1-(1/Xh))*Et); 131 Pg = (PR*W/Wn)^((rc-1)/rc); (PR* (Wf+W)/(Wfn+Wn) )^((rh-1)/rh); (W+Wf) *Cph* (Tf-Te) -W*Cpc* (Td-Ti); 132 133 disp ('Solving'); 134 [F&c.genl] - solve(Pg == 1.0536, Fd); 135 [Fdgen2] = solve(Pg == 1.5000, Fd); 136 Fdgen = 137 save (' [Fdgenl Fdgen2]; steadyValueGeneration.mat', 'Fdgen') 79 x9, x10, x1l, x12, 80 Appendix C MATLAB Code - Model Linearization 81 1 function Amatrix = myEvents, calculateAmatrix(myPowerDGrid, myPowerGrid, ... spFlag, x0) 2 f = myPowerDGrid.frequency; 3 Y = myPowerGrid.YBus; 4 5 G = real(Y); B = imag(Y); 6 E = myEvents(spFlag).eGensMag; 7 V = myEvents(spFlag).eLoadsMag; 8 Xd = (0.20 0.20 0.25); 9 theta = myEvents(spFlag).eLoadsAng; 10 theta = theta*pi/180; %degree -> %degree rad 11 12 %review where it can get the number of total nodes 13 n=6; 14 %review if dyns is the number of generators + other dynamic devices 15 dyns=length(myPowerDGrid.dynDev.dynDevNum); 16 generators 17 buildings 18 %review if this is the order of each dynamic device 19 orders=3; 20 for i=l:dyns 21 H(i) 22 D(i) 23 M(i) 24 end 25 A=theta; = 1; = = 2; myPowerDGrid.dynDev.DMData(i).h; myPowerDGrid.dynDev.DMData(i) .d; = 2*H(i); 26 27 Tv = 0.05; 28 Tf = 0.4; 29 Tcd = 0.2; 3o Tm = 5; 31 Tb 32 f = 60; 33 H = [5 4 5]; 34 D = (0.001 0.001 0.001]; = 20; 82 35 M 36 Tp 2*D; = 0.0001; = 37 38 Ni = 2; 39 Nj = 4; 40 hw = zeros(Ni,Nj); 41 Aw = zeros (Ni, Nj); 42 Cw = zeros (Ni,Nj); 43 Cp = 1.005; 44 for j=1:Nj 0.02; 45 hw(1,j) 46 Aw(1,j) = 1; 47 Cw(1,j) 48 end 49 for j=1:Nj = = 5; 0.02; 50 hw(2,j) = 51 Cw(2,j) = 5; 52 end 53 Aw(2,1) = 2; 54 Aw(2,2) = 1; 5s Aw(2,3) = 2; 56 Aw(2,4) = 1; 57 Czl = 2.5; Cz2 = 2.5; 58 Cfl = 5; 59 hcl = 0.01; hfl = 0.01; hc2 = 0.01; 60 Acl = 1; Afl = 1; Ac2 61 Msa 62 Pfan = 0.5; 63 msal = Msa*Pfan; 64 msa2 = Msa*(1-Pfan); 65 Moa = 66 Mra = Msa-Moa; 67 mral = Mra*0.5; 68 mra2 = Mra*0.5; 69 COP = 2.5; 70 Aone = 1/Czl*(msal*Cp/Msa*mral-(msal*Cp+hw(1,1)*Aw(1,1)+... Ccl = 5; Cf2 = = 5; Cc2 2; Af2 = = 5; hf2 = 0.01; 2; 0.5; = 0.1; 83 71 hw (1, 2) *Aw (1, 2) +hw (1, 3) *Aw (1, 3) +hw (1, 4) *Aw (1, 4) +. 72 hcl*Acl+hfl*Afl)); 73 Bone = 1/Czl*(msal*Cp/Msa*mra2); 74 Atwo = 1/Cz2* (msa2*Cp/Msa*mra2- (msa2*Cp+hw (2, 1) *Aw (2, 1) +... 75 hw (2, 2) *Aw (2, 2) +hw (2, 3) *Aw (2, 3) +hw (2, 4) *Aw (2, 4) +. 76 hc2*Ac2+hf2*Af2)); 77 Btwo = 1/Cz2*(msa2*Cp/Msa*mral); 78 79 80 Fx Fx = [-1/Tv 0 0 0 0 0 0 ... 0 0 0 0 ... 0 0 0 0 0 0... 0 0 ... 0 0 ... 0 0 ... 0 0 0 ... 0 0 ... 0 0; 0 81 0 0 0 0 -1/Tf 1/Tf 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0... 0 0... 0 0 0... 0 0... 0 0; 0 82 0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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 199 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 200 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 201 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 202 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 203 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 204 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 205 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 206 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 207 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 208 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 209 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 211 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; 212 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; 0; 0; 213 214 215 P, (partial 216 %Km 217 for i=l:n Partial theta) for j=1:n 218 if 219 j#i 220 Km(i,j)=V(i)*V(j)*(G(i,j)*sinf(A(i)-A(j))-. 221 B(i, end 222 end 223 224 end 225 for i=l:n 226 Km(i,i)=0; 227 for j=1:n 228 if jsi Km(i,i)=Km(i,i)-Km (i, 229 j) end 230 231 j)*cos(a(i)-A(j))); end 103 232 end 233 234 %Lm 235 for i=l:n (partial Q, 236 for j=l:n 237 if partial theta) jsi 238 Lm(i,j)=V(i)*V(j)*(-G(i,j)*cos(A(i)-a(j) )-... 239 B (i, ) ) -A (j) end 240 end 241 242 end 243 for i=1:n 244 Lm(i,i)=O; 245 for j=l:n 246 if ji 247 Lm(i,i)=Lm (i,i)-Lm(i,j); end 248 end 249 25o j) *sin (A (i) end 251 252 %Mm 253 for i=1:n (partial P, partial V) for j=l:n 254 255 if j#i j)*cos(A(i)-a(j))+... 256 Mm(i, j)=V(i)*(G(i, 257 B(i, j)*sin(a(i)-a(j) )); end 258 end 259 260 end 261 for i=l:n 262 Mm (i, 263 for j=l:n 264 if i)=2*V (i) *G (i, i); j#i 265 Mm(i,i)=Mm(i,i)+V(j)*(G(i,j)*cos(A(i)-a(j))+. 266 B(i,j)*sin(a(i)-a(j) 267 )); end 104 end end %Nm (partial Q, for partial V) i=l:n for j=l:n if jsi Nm(i, j)=V(i)*(G(i, j)*sin(a(i)-a(j))- B(i, j)*cos(a(i)-a(j))); end end end for i=l: n Nm(i, i) =-2*V(i) *B (i,i); for j=l:n if jsi Nm(i, i) =Nm(i, i) +Nmr(j, i) end end end % Gy for i=l:n for j=l :n Gyl (i, j) =Km (i, j); Gyl (n+i, j)=Lm(i, j) Gyl (i,n+j)=Mm(i, j) Gyl (n+i,n+j)=Nm(i, j) end end if orders == 2 for i=l:dyns Gyl(i,2*n+((i-i)*4+3))=-l; Gyl(i+n,2*n+((i-i)*4+4))=-1; end elseif orders == 3 for i=l:dyns 105 Gyl(i,2*n+((i-i)*3+2))=-1; Gyl(i+n,2*n+((i-i)*3+3))=-1; end end og= []; for i=1:(n/2) Ag = [Ag xO((i-1)*2+1)]; end if orders == 2 Gy2 = zeros(2*n,2*n+4*dyns); for i=1:dyns Gy2((((i-i)*4)+3),i)= -V (i) *E (i) *cos (theta (i) -Ag (i) ) /Xd (i) i) = -V (i) *E (i) *sin (theta (i)-Ag (i) ) /Xd (i) Gy2 ((((i-1) *4) +4) , Gy 2 ((((i-i)*4)+3), (n+i) =-E () *sin Gy2((((i-i)*4)+4), (n+i) =-(2*V(i) /Xd(i))+. (E (i) *cos (theta (i) -Ag(i) Gy2 ((((i-1) *4) +3), (theta (i)-Ag (i) ) /Xd (i) )/Xd(i)); (2*n) + (((i-1) *4) +1))) =-V(i) *sin (theta (i)-.. Ag(i) )/Xd(i); Gy2 ((((i-1) *4)+4), (2*n) + (((i-1) *4) +1)) )=V(i) *cos (theta (i) -. Ag(i))/Xd(i); end for i=1:4*dyns Gy2 (i, 2*n+i) =-1; end elseif orders == 3 Gy2 = zeros(2*n,2*n+3*dyns); for i=1:dyns Gy 2 ((((i-i)*3)+2),i)= -V (i) *E (i) *cos (theta Gy2((((i-i)*3)+3),i)= -V (i) *E (i) *sin (theta (i)-Ag (i)) /Xd (i); (i)-Ag (i) )/Xd (i); Gy2((((i-1)*3)+2), (n+i)) =-E(i)*sin(theta(i)-Ag(i))/Xd(i); Gy2((((i-1)*3)+3), (n+i)) =-(2*V(i) /Xd(i))+. (E (i) *cos (theta(i) -Aq(i) )/Xd(i)); 106 e)*3)+2),-((2*n)+(((i-l)*3)+)))=... Gy2((((i- -V (i) *sin (theta (i) -Ag (i) ) /Xd (i); Gy2((((i-l)*3)+3), ((2*n)+(((i-1)*3)+1)))= ... V(i)*cos(theta(i)-Ag(i))/Xd(i); end for i=l: 3*dyns Gy2 (i, 2*n+i) =-1; end end Gy=[Gyl;Gy2]; Gyp=Gy; % Gx Gx = zeros(21,31); Gx(14,6) = V(1)*E(1)*cos(theta(1)-Ag(1)) /Xd(1) Gx(15,6) = V(1)*E(1)*sin(theta(1)-Ag(l)) /Xd(1) Gx(17,13) = V(2)*E(2)*cos(theta(2)-Ag(2) /Xd(2) Gx(18,13) = V(2)*E(2)*sin(theta(2)-Ag(2) /Xd(2) Gx(20,15) = V(3)*E(3)*cos(theta(3)-Ag(3) /Xd(3) Gx(21,15) = V(3)*E(3)*sin(theta(3)-ag(3) /Xd(3) Gx-p=Gx; Amatrix = Fx - Fy*(Gy_p\eye(size(Gy-p)))*Gx_p Amatrix = Fx-p - Fy-p*(Gy_p\eye(size(Gy_p)))*Gx_p; end 107 108 Appendix D MATLAB Code - Model Predictive Control 109 1 addpath('rsgtssimv2\') 2 addpath('DataMPC\') 3 addpath('rsgtssimv2\matpower4.l\') 4 addpath('rsgtssimv2\powerGrid.mindnode\') 5 addpath('rsgtssimv2\utilities\') 6 7 8 clear all 9 close all 10 clC 11 12 load('xint.mat'); 13 load('xint-b.mat'); 14 load( 'steadyValueGeneration.mat'); 15 16 %% Initialization 17 %initial states for linearized model 18 xO = 19 xO(1) = Fd2Pg(xint(1)); 20 xO(2) 21 xO(8) = Fd2Pg(xint(8)); 22 xO(9) 23 % initial ocntrol signal for MPC control 24 uintc 25 % initial control signal for runSimulator 26 uints (MPC control) [xint;xint-b;0.5]; Fd2Pg(xint(1)); = Fd2Pg(xint(8)); = [x0(l) = xO(8) 0.5]; [xint(1) xint(8) = 0.5]; 27 [; 28 UMPC = 29 % total simulation time 30 ttotal = 1200; 31 % time period to apply every control move 32 tcontroller = 30; 33 % number of MPC simulation steps 34 Nsimulation = t total/t_controller; 35 % time to get each linearized plants 110 30; 36 tlin 37 % time for iteration 38 Nlin = t total/t_controller; = 39 40 % start time and final time to get 41 Ts = 0; 42 Tf = 0; 43 % start time and final time to 44 Tsu = 0; 45 Tfu = 0; linearized model implement new control signal 46 47 %% Iteration code: 48 for i=l:Nlin MPC 49 50 Ts = Tfu; 51 Tf = Tfu+t_lin; 52 iter = i; 53 54 [labelVec, timeVec, stateVec, b-stateVec, btimeVec, rl, r3]=runSimulatorMPC(1,Ts,Tf,xint,xintb,uints,iter); 55 56 %% get the 57 Ni = 2; 58 Nj = 59 hw = 60 Aw = zeros(Ni,Nj); 61 Cw = zeros(Ni,Nj); 62 Cp = 1.005; 63 for j=l:Nj linearized system 4; zeros(Ni,Nj); 64 hw(1,j) = 0.02; 65 Aw(1,j) = 1; 66 Cw(1,j) = 5; 67 end 68 for j=l:Nj 69 hw(2,j) = 0.02; 70 Cw(2,j) = 5; 111 r2, 71 end 72 Aw(2,1) = 2; 73 Aw(2,2) = 1; 74 Aw(2,3) = 2; 75 Aw(2,4) = 1; 76 Czl = 77 Cfl = 5; 78 hcl = 0.01; 79 Acl = 80 Msa = 0.5; 81 Pfan = 0.5; 82 msal = 83 msa2 = Msa*(1-Pfan); 84 Moa 85 Mra = Msa-Moa; 86 mral = Mra*0.5; 87 mra2 = Mra*0.5; 88 COP = 2.5; 89 Tv 90 H = [5 4 5]; 91 D = [0.001 0.001 92 M = 93 freq = 60; 94 Tp = 2.5; 1; Cz2 = 2.5; Ccl = 5; Cf2 = 5; Cc2 = 5; hfl = 0.01; hc2 = 0.01; hf2 Afl = 1; Ac2 2; = Af2 Msa*Pfan; 0.1; 0.05; = 0.001]; 2*D; = 0.0001; 95 96 load('Amatrix.mat') 97 A = As; 98 B =[1/Tv 0 0 0; 99 0 0 0 0; 100 0 0 0 0; 101 0 0 0 0; 102 0 0 0 0; 103 0 0 0 0; 104 0 0 0 0; 105 0 1/Tv 0 0; 106 0 0 0 0; 112 = 2; = 0.01; 107 0 0 0 0; 108 0 0 0 0; 109 0 0 0 0; 110 0 0 0 0; 111 0 0 0 0; 112 0 0 0 0; 113 0 0 0 0; 114 0 0 0 1/Czl* (msal*Cp*Moa/Msa); 115 0 0 0 1/Cw(1,1)*hw(1,1)*Aw(1,1); 116 0 0 0 1/Cw(1,2)*hw(1,2)*Aw(1,2); 117 0 0 0 1/Cw(1,3)*hw(1,3)*Aw(1,3); 118 0 0 0 0; 119 0 0 0 1/Cc1*hcl*Acl; 120 0 0 0 1/Cfl*hfl*Afl; 121 0 0 0 1/Cz2* (msa2*Cp*Moa/Msa); 122 0 0 0 1/Cw(2,1)*hw(2,1)*Aw(2,1); 123 0 0 0 1/Cw(2,2)*hw(2,2)*Aw(2,2); 124 0 0 0 1/Cw(2,3)*hw(2,3)*Aw(2,3); 125 0 0 0 0; 126 0 0 0 1/Cc2*hc2*Ac2; 127 0 0 0 1/Cf2*hf2*Af2; 128 0 0 1/Tp 0]; 129 C 0 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 =[ 0 0 -1; 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 130 0 0; 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0.. 131 0 0]; 132 D [0 = 0 0 0; 133 0 0 0 0; 134 0 0 0 0]; 135 136 sys = ss(A,B,C,D); 137 138 %% 139 ts = create MPC object 30; 113 140 p = 60; 141 m = 5; 142 % MPC weights structure 143 wghts = struct('ManipulatedVariables', [0.0 'OutputVariables', 0.0 0.0], [3 1 1]); 144 % MPC manipulated variable 1 (Fd genl) 145 MV(l) 146 % MPC manipulated variable 2 (Fd gen2) 147 MV(2) 148 % MPC manipulated variable 3 (Pcooling) 149 MV(3) iso % MPC output variable 1 (Pmg1+Pmsl+Pmg2+Pms2-Pcooling) 151 OV(l) 152 % MPC output variable 2 (Tzl) 153 OV(2) 154 % MPC output variable 3 (Tz2) 155 OV(3) 156 % set the forth input 157 sys.InputGroup.MD = 4; 158 % 4 inputs 159 MPCobj = mpc(sys, ts, = struct('Min',0,'Max',2); = struct('Min',0,'Max',2); = struct('Min',0,'Max',1); = struct('Min',0,'Max',10); = struct('Min',0,'Max',30); = struct('Min',0,'Max',30); (3 MV, (Tamb) as measured disturbance 1MD), 3 outputs p, m, wghts, MV, OV); 160 161 %% MPC controller 162 T 163 % reference signal 164 r = = 10; [rl r2 r3]; 165 166 set imulation options w/ initial values 167 SimOpt = mpcsimopt(MPCobj); 168 % define MPC controller state 169 xmpc = mpcstate (MPCobj,x0, [], [],uintc); 170 171 % set simulation options w/ initial values 172 set(SimOpt, 'PlantInitialState',x0,'ControllerInitialState',xmpc); 173 % specifies the measured disturbance signal v (Tamb), that ... has as many columns as the number of measured disturbances. 114 30; = 174 v 175 % do the MPC simulation [y-mpc, 176 t-mpc, u-mpc, xp-mpc, xmpcqmpc, SimOptions] = sim(MPCobj,T,r,v,Sim~pt); % y-mpc: 177 outputs, variables, t-mpc: sequence, u: manipulated ... xpmpc: % state of the model, 178 time xmpc-mpc: state of the controller 179 step of the control strategy by MPC controller 180 % save the first 181 u-new-s = u mpc(,:); 182 unews(l) = Pg2Fd(unew_s(l)); 183 unews(2) 184 u_MPC = = Pg2Fd(unews(2)); [uMPC;u-new-s]; 185 186 %% run simulation and apply the first 187 Tsu = 188 Tfu = Ts+tcontroller; Ts; [labelVec, timeVec, 189 step of u stateVec, b-stateVec, btimeVec] ... runSimulatorMPC(2,Tsu,Tfu,xint,xintb,u_new-s,iter); 190 %% 191 grab the initial last state for the state for the next 192 xint = 193 xintb = bstateVec(size(b 194 uints = unew-s; 195 % set 196 uintc 197 xO = 198 xO(1) = Fd2Pg(xint(1)); 199 xO(2) = Fd2Pg(xint (1)); 200 xO(8) = Fd2Pg(xint (8)); 201 xO(9) = Fd2Pg(xint (8)); next simulation simulation) stateVec(size(stateVec,l),:)'; stateVec,l), :)'; initial state for next MPC control = u_mpc(1,:); [xint;xintb;uintc(3)]; 202 end 203 save('uMPCtimeseries.mat', 'uMPC'); 115 (as the ... 116 Bibliography [1] Ali Parvaresh Ahmad Parvaresh, Seyed Mohammad Ali Mohammadi. A new mathematical dynamic model for hvac system components based on matlab/simulink. International Journal of Innovative Technology and Exploring Engineering (IJITEE), July 2012. [2] Frederic Suard Louis Stephan Arnaud Jay Aurelie Foucquier, Sylvain Robert. State of the art in building modelling and energy performances prediction: A review. Renewable and Sustainable Energy Reviews, 2013. [3] Prasenjit Basak. Microgrid : Control Techniques and Modeling. In Universities Power Engineering Conference (UPEC), 2009 Proceedings of the 44th International, pages 0-4, 2009. [41 Shyam Naren Bhaskara and Badrul H. Chowdhury. Microgrids - a review of modeling, control, protection, simulation and future potential. IEEE, 2012. [5] M. Al-Rousan Bourhan Tashtoush, M. Molhim. system for control analysis. Energy, 2005. Dynamic model of an hvac [6] A.L. Dimeas and N.D. Hatziargyriou. Agent based Control for Microgrids. In 2007 IEEE Power Engineering Society General Meeting, pages 1-5. IEEE, June 2007. [71 Alessandra Parisio-GAigren Anderssor; Manfred Morari ,Frauke Oldewurtel, Andreas Ulbig. Reducing peak electricity demand in building climate control using real-time pricing and model predictive control. IEEE, 2010. [81 Antonio Gomez Exposito, Antonia J Conejo, and Claudio Oanizares. Electric energy systems. analysis and operation, volume The electr. CRC, Boca Raton, Fla, 2008. [9] A. B. G. Bahgat H. E. M. A. Shalan, M. A. Moustafa Hassn. Comparative study on modelling of gas turbines in combined cycle power plants. December 19-21, 2010. [10] Kody M. Powell Jong S. Kim and Thomas F. Edgar. Nonlinear model predictive control for a heavy-duty gas turbine power plant. American Control Conference (ACC), June 17-19 2013. 117 - [11] Don Kondoleon, Laurie Ten-Hope, Terry Surles, and Robert L. Therkelsen. The CERTS MicroGrid Concept. In Integration of Distributed Energy Resources The CERTS MicroGrid Concept, number October, page 32. The Consortium for Electric Reliability Technology Solutions (CERTS), 2002. [121 R.H. Lasseter. MicroGrids. In Fellow, IEEE, volume 1, pages 305-308. IEEE, 2002. [13] Ratnesh Kumar Licheng Jin and Nicola Elia. Model predictive control based real time power system protection schemes. IEEE Transactions, 2010. [14] D. J. Hill M. Larsson and G. Olsson. Emergency voltage control using search and predictive control. International Journal of Power and Energy Systems, 2002. [15] N. Ghaddar M. Mossolly, K.Ghali. Optimal control strategy for a multi-zone air conditioning system using a genetic algorithm. Energy, 2009. [16] Magdi S. Mahmoud. Advances in discrete time systems. 2012. [17] R. Majumder. Some aspects of stability in microgrids. IEEE Transactions on Power Systems, vol. 28(No. 3):3243-3252, August 2013. [18] Feng Hong Manohar R. Kulkarni. Energyoptimal control of a residential spaceconditioning system based on sensible heat transfer modeling. Building and Environment, 2004. [19] John Mantzaris and Costas Vournas. Modelling and stability of a single-shaft combined cycle power plant. June 2007. [20] mohammad Shahidehpour Mircea Eremia. Handbook of electrical power system dynamics. 2013. [21] C. Domingo F. Fernaindez L. Rouco M. GonzAlez P. Centenol, I. Egido. Review of gas turbine models for power system stability studies. [22] P. Piagi and R.H. Lasseter. Autonomous control of microgrids. In 2006 IEEE Power Engineering Society General Meeting, page 8'pp. IEEE, 2006. [23] Henrik Madsen Rasmus Halvgaard, Niels Kjolstad Poulsen and John Bagterp Jorgensen. Economic model predictive control for building climate control in a smart grid. Innovative Smart Grid Technologies (ISGT), 2012. [24] W. I. Rowen. Simplified mathematical representations of heavy-duty gas turbines. ASME, 1983. [25] H Saadat. Power System Analysis. 2004. [26] Jovica V. MilanovicAt' Soon Kiat Yee and F. Michael Hughes. Overview and comparative analysis of gas turbine models for system stability studies. February 2008. 118 [27] A.G. Tsikalakis and N. D. Hatziargyriou. Centralized control for optimizing microgrids operation. IEEE Trans on Energy Conversion, 2008. 119