INTELLIGENT RESIDENTIAL ENERGY MANAGEMENT SYSTEM IN SMART BUILDING CONSIDERING FUEL CELL AND PHEV ’ S

The increased greenhouse gas emissions and the global warming from fossil fuels to produce electrical power generation and transportation, they become the most critical concern of governments to find an alternative source to fossil fuels such as renewable energies like wind and solar; Additionally, transportation is one of the main sources of environmental pollution, to this end, PHEV grid is presented, but the widespread use of PHEV will be creating a significant load on the grid. For this reasons in this paper, a model for the optimal application of green house, was studied in 24 hours. Energy management issue is considered in zero energy buildings with solar hybrid power sources, fuel cell, electrolyzer, hydrogen tank, compressor, reformer, anaerobic reactors and converters as well as plug-in hybrid electric vehicle (PHEV) must be provided, designed and implemented. The green house serves bilateral energy exchange with the upstream distribution network and if the surplus energy provided, can be sold to the network. Daily house trashes use to decline the bioenvironmental contaminations and also heat of house and hot water is supplied using fuel cell heat and if necessary we should purchase gas from network. In order to optimize this house, an objective function is extracted and aggregation Swarm algorithm to minimizing costs was carried out using MATLAB program. Finally, optimal operation is presented for the green house and results have been analyzed.


I. Introduction
Environmental concerns in using fossil fuel and their limited resources with energy supply concerns is caused relatively rapid fond on electricity energy production from renewable sources.Solar energy is among the best energies that possess a significant frequency.In recent years' interests is formed toward the fuel cell, because the fuel Cells are resources of the clean and efficient electricity production.Fuel cells are electrochemical devices that convert directly the chemical energy of a gas fuel into electrical energy and by supplying fuel (hydrogen) in all day long safe energy can produced.Today, because of the desire to reduce the consumption of benzene, plug-in hybrid electric vehicles attracted a myriad of attention.These vehicles use electric energy system power.Electric transportation vehicles have potential to unravel environmental and economic challenges in today and the future [1].
Green houses or very houses with zero energy is a term considered to the new generation of buildings and the reason is that all energy requirement for these buildings is provided by these buildings through its improvised systems which produce green energy.The determination of green energy in these buildings is the energy derived from renewable energy sources that do not have any environmental contaminations.Among these energy sources can demonstrate like the energy from the sun, wind, geothermal, biomass and so on.Smart buildings with zero energy are used as an appropriate choice to combine a great number of distributed energy resources to power networks in the future and building modern designs.
For this purpose, in this paper energy management issue in zero energy buildings have been considered with attendance of solar hybrid power production resources, fuel cell and electrolyzer, hydrogen tank, compressor, reformer, anaerobic reactor and converter and also charging a plug-in hybrid electric vehicle (PHEV) is provided, designed and implemented.The main purpose of this paper is to minimize costs using swarm algorithm operation function in an optimum state for 24 hours is presented.

II. Related works
In ref [1] the most dominant issue which exist in increasing electric vehicles requirement is their charging in peak consumption of electricity.In order to decrease this effect, charging station has been proposed which designed somehow that it is not seem to be necessary in network to charge among peak period.Energy demand for charging PHEV is covered by produced solar energy or connects to network or using both ways.
According to [2], the impact of the electric vehicles on residential distribution grid is evaluated and they suggested the coordination charging mechanism which was based on innovative rules as a tool for shaping load.So investigated, the effect of this mechanism on the consumer prosperity and the advantages use of the renewable system.The results showed the coordination mechanism has able to avoid of the overload of distribution transformers.Also, they are indicated the renewable (the sector renewable and cost renewable) performance, which depends on several factors such as weather, location, equipment features and the priority for the consumers.
paper [3], optimize the behavior of Plug-in Electric Vehicle (PEV) parking lots considering the interaction with renewable energy resources.In this paper a model was proposed to reflect the impacts of different RERs on the profits and behavior of a PEV parking lot.The participation of the parking lot in multiple markets was modeled while considering PV and wind power resources, as well as the uncertainties of PEVs' behavior.The numerical results indicated that the behavior of the parking lot in participating in the electricity markets changed by applying different RERs.It was observed that the parking lot's profit was higher for the case when wind power generation was considered; it was followed by PV and lastly the base case where no RER was employed in the distribution system.It was also noticed that the participation in the reserve market was mainly influenced by the price, while the participation in the energy and regulation markets was mainly influenced by the power availability [4].
In ref [5] the overall comparative analysis of hybrid systems on-site consumption was conducted for two buildings with different weather conditions.Comparative analysis results shown that the method used in this study can be useful in the design of hybrid energy systems with production on-site consumption.
The research [6] proposed that a home energy management system with the aim of reduce electric energy consumption, peak to average ratio (PAR) and increase the consumers' welfare.The researchers used of an optimization hybrid bacterial harmony algorithm (HBH) that consists of two algorithms: Bacteria foraging algorithm (BFA) and harmony search algorithm (HAS).Their findings showed that it is possible to reduce the price of electric energy for consumers and increase the consumers' welfare by provide a coordinated program and in line with the generated electrical energy information of grid in order to use of appliances.
The researchers in article [7] proposed an intelligent residential energy management system (IREMS) for smart residential buildings that its benefits showed in a case study.The main object of IREMS was decrease in electricity, costs while less than the maximum power demand is limited to the various parameters such as the operation of residential loads and renewable energy resources.moreover, the researchers used the battery as a suitable solution to reduce the loss of the power generation of renewable resources.
The research [8] provided an optimal overall framework for efficient energy management and its components, include a smart home with home batteries, plug-in electric vehicle and photovoltaic.The aim of the researchers was to increase home profits provided that demand response and supply the energy required for PEV. in addition to that, the battery energy storage system (BESS) is used in this model.In this project, according to different optimization times analyzed the cost of the home battery energy storage system, the types and various modes of PEVs control, the parameters of the BESS and the electricity costs of in a systematic way.their results showed that with the implementation of the CP (Convex programming) control program in V2H and H2V modes, the houses with a battery energy storage system will not purchase electricity at peak load hours.
In research [9], a home energy management system including photovoltaic panels and battery energy storage system was investigated.The researchers have examined the following items: i) the effect of the electricity price mechanism using the time-of-use pricing (TOU), the real-time pricing (RTP), and the stepwise power tariff (SPT); ii) the impact of solar panels; and iii) the variability of solar panels in different seasons.The management plan presented in this study was also programmable in the GAMS.
research [10] examined the use of the Fuel Cell as an energy carrier to use in off grid mode.In this research, an energy management algorithm (EMA) is used for alternative energy sources (AES) in smart home systems.The fuzzy control logic is used to this purpose and is simulated in MATLAB.

III. The proposed model
In this paper, a green residential house is studied that solar systems, electrolyzer, hydrogen tank, the fuel cell is used to supply power and specify for each of the four units, number, initial investment costs, replacement costs, maintenance costs, interest rates and the life of the unit.

A. Renewable Resources
In this work, used of solar energy sources and wind energy resources to provide domestic load.The data of wind speed and solar radiation were extracted from Renewable Energy Organization of Iran (SANA) and Ganjeh website in Ardabil province of Iran.The data collected during one year to determine the amount of generation at in the different seasons in the year [11].
The output power of solar modules is obtained by (1): Where   is the output power (kwm-2),   is the max power that equal 270 (wm-2), Gt is the solar radiation intensity (wm-2) and N is the number of solar modules [2].
The output power of a wind turbine P is a randomly variable which depends on the wind speed V, so it can be as a mathematical model.
In (2) where Vcut−in is cut -in wind speed in meters per second, Vcut−off is of cutoff wind speed in meters per second, Vrated is rating speed in meters per second, V is wind speed in meters per second, N is the number of wind turbine, and Prated is the power rated in kilo Watt [12].

B. PHEV specifications
The private cars are often used to commuting between houses, workplaces, leisure time and entertainment.In tab. 1 presented car features which used in this work, such as charging specifications and AER [13].Therefore, in this article the assumption is that the consumers recharging their car at home.

Model
Ford C-Max Capacity 8 Kwh

Electric Range
The PHEV energy for process car charging is depend on the features of the car's battery and driving habits of every user.

a. State of Charge (SOC)
It determines the capacity of the battery which related to the pattern consumers' consumption.In fact, it determines how the energy of the car's battery consumed by measuring the amount of mileage distance during one day.This value of energy should be provided for recharging the battery by the grid.Therefore, the driving pattern has major role in the effectiveness PHEV on the distribution grid.The average distance mileage by owner's car is estimated 6 miles in one day [14].According to [15] this value is achieved 30 miles.SOC is the state of charge which can be obtained of (3): In this equation, d is the total distance mileage by the car and λ is the maximum distance mileage in electric mode hence when  ≥  the usable capacity of the battery is completely consumed and the SOC is zero [11].

C. Characteristics determination of sample house units
Other units also require to specify the nominal power, initial investment costs, replacement costs, maintenance costs, unit life and efficiency which are given in the tab. 2 [16].
Tab. 2. Characteristics determination of units

IV. MATHEMATICAL MODEL
A. Constraints

a. The balance of power constraint
The most important constraint of system that must always be respected is a balance between power productions, consumption and provided to the upstream network (production in the form of calls) for all periods of time.The relation which is related to electric energy balance is as follows [17,19]: b.The sale of energy to the upstream network constraint Because of the problems and technical limitations such as constrained production units and… for power which is sent from the house to the upstream, it is necessary to a maximum amount considered: ≤ (5) Where    is maximum power applicable to network and   exchange power with upstream network.

c. The production power capacity of solar unit constraint
() ≤   () ≤    () (6) Where    () is the minimum solar unit power and    () maximum solar unit power.

d. The fuel cell capacity constraint:
Each output capacity should not exceed their design capacity: 0 ≤   () ≤    (7) Where    is the maximum power of the fuel cell.
f.The hydrogen tank capacity constraint: 0 ≤  tan () ≤    (9)    is maximum capacity of the hydrogen tank.

B. The objective function
The objective function is the sum of all net present cost. =   +   +   +   (10) In order to obtain optimum operation, we need an objective function.In fact, this objective function specifies the strategy operation.The main objective of this function is minimizing the costs subjected to all operational constraints (T: time interval, 24 hours).

V. Simulation analysis
Cost is an objective function that reaches its optimal level after a period of time.Birds Swarm algorithm, we consider the generation 300 and randomly program is repeated 300 times, when it reaches to a fixed amount the optimal solution is obtained in this case.
Fig. 1 shows the Ppv amount of produced solar energy of a day in winter.The sun shines around 7 a.m. and in 13 p.m. reaches into maximum amount of itself that is about 5.8 kilowatts and around 19 p.m., the production of solar energy become zero.Conv-Ppv is a power which enters to converter from the Sun and it provides charge that is approximately 5.4 kW.Ppv-el, which is the difference between Ppv and conv-Ppv surplus power that will be entered into electrolyzer.

Fig. 1. The amount of solar energy
Fig. 2 is the load curve for a house based on IEEE standard shows, that is the maximum amount, 4 kW [21].

Fig. 2. load curve for a house based on IEEE standard [21]
The following figure shows the purchasing power from the network.Between 10 a.m. to about 16p.m. hours that we do not need to buy energy.From 17p.m. to 20p.m. hour that sun radiation of is reached to zero, we must buy electricity distribution network which is about 5.2 kW.

Fig. 3. Purchasing electricity from the grid
As you can see in Fig. 4. from 10a.m. to 14p.m. that solar-generated power is more than our requirement, we do not need to buy electricity from the network anymore.If the amount of power that enters from electrolyzer to hydrogen tank is larger than tank capacity, the difference between solar generated power to the electrolyzer and the total capacity of the electrolyzer, sells to network.

Fig. 4. Sale of electricity to the network
Fig. 5 (a) shows the power that enters into the tank from electrolyzer.The sun between 9 a.m. to 15p.m. that we have sun radiation which provides charge.Excess solar produced energy enters into the electrolyzer, then into hydrogen tank, and if the amount of power that entered from electrolyzer to hydrogen tanks is larger than capacity will be sold; and at other hours no power enters from the electrolyzer into the tank.Fig. 5 (b) shows the fuel cell generated power.From 10 a.m. to 15p.m. that we have solar radiation and the sun is applicable.There is no need to fuel cell, so that in these hours it does not enter into orbit and the sun supplies the required charge; and in remnant hours, solar power cannot supply the charge.Total charge enters toward converter, which means that the power that enters into the electrolyzer is equal to zero.Now, the difference between the charge and PV should be supplied by fuel cell.If it could not buy electricity from the network, so we do not sell electricity to the network.In this case, the fuel cell is coming into the orbit and produce power, then we have heat and the amount of gas purchased from the network will be gone down.Fig. 6 shows the generated power from the fuel cell to the converter.From 10 a.m. to 15 p.m. that we have solar radiation and the sun is applicable.There is no need to fuel cell, so that in these hours it does not enter into orbit and the sun supplies the required charge.But in other hours produce 2kW.
Fig. 6.The generated fuel cell power toward the converter Fig. 7 shows the amount of heating that fuel cell produces.From 10 a.m. to 15 p.m. that we have solar radiation and the sun is applicable.The fuel cell does not produce any power, so we do not have heat; so that we must purchase gas from network, so that in these hours it does not enter into orbit and in other hours' fuel cell is became into the orbit and produce power, so we have heat.Fig. 8 shows the amount of hydrogen in the tank.The sun between 9 a.m. to 15 p.m. that we have sun radiation and there is some extra power that enters into electrolyzer from PV.As a result, the capacity of hydrogen tank increases.But in night that there is no sun radiation, existing capacity of tank goes down and hydrogen is consumed.

Fig. 8. The amount of hydrogen in the tank
Chart 9 shows the gas purchase for network in order to supply hot water and heating of house.As we see in the below graph, during the hours that we have solar energy production we need mostly to buy gas from our network, because production of fuel cell is zero.So there is no heat so we purchase required gas.Charge consumption normalized curve based on reference IEEE [20] is shown.We multiply at the peak consumption that gives us actual consumption of house.We consider the peak amount of a residential unit approximately 4kW.As shown here, in this part of the normalized consumption curve to multiple four times and our new charge curve is shown in Fig. 10.

Fig. 10. Normalized charge consumption curve
Our vehicle charging scenario is that the best time to recharge the vehicle is when charges has lowest amount actually and be lower than average.As you can see in figure the difference between charge and average are calculated.When it had the lowest amount, we choose the time period for vehicle charging that best time is 3 a.m., 4 a.m., 5 a.m.hours.

A. Comparisons between vehicle charging management and vehicle charging non-management:
As you can see in the figure below when we have the vehicle charging management to wit the maximum peak at about 5.4 kilowatt at 3a.m., 4a.m., and 5a.m. hours.The amount of purchasing power from the network has been postponed to the morning.Major purchased power is created in one peak.In morning cost and consumption is lower and it is great for us and charge management helps to network.But at a time when we do not manage vehicle charging to wit in 7a.m., 8a.m. and 9a.m. the maximum peak hours are about 6 kW; which it has to purchase more power from network to supply house consumption electricity.The major purchase is at the peak hours.Costs is high and too much power should be purchased and the network may be in trouble.

Fig. 12. purchasing power from the network with vehicle charging management nonmanagement
As you can see in the figure below when we have the charging management to wit the maximum peak at about 5.5 kilowatt at 3 a.m., 4 a.m., and 5 a.m. hours and vehicle will be charged at 3 a.m. for 3 hours.But at a time when we do not manage vehicle charging to wit in 7 a.m., 8 a.m. and 9 a.m. the maximum peak hours are about 7.5 kW.It is assumed that when the vehicle arrives home, it will be charged.

VII. Conclusion
Using correct and principled and producing more energy and economizing in consuming energy is one of the practical ways to reduce fuel consumption in the world, according to diversity and variety of activities in the construction industry, nowadays more than 40% energy has accounted for the 50 to 60 percent of that is spent on heating of residential spaces is of particular importance, therefore, the method developed in this paper in the design and implementation of building is an effective step in reducing fuel consumption and saving energy in the building.When we use fuel cell heat, the amount of gas network will be reduced from network.
Today, in many parts of the world, using photovoltaic systems to minimize their need to general electricity and produce required general electricity even without his powers independently.Given that renewable energies have no any pollution for the environment and can be named clean energy.The initial cost of renewable power plants is high but its equipment has long life and very low maintenance costs.By using renewable energies achieve lower energy cost and improving system reliability.When we use renewable energies, our dependence to distribution network decreases and the amount of purchasing energy from the network will be reduced.We use maximum of solar energy, amount of required charge of the green house enters into convertor and the rest is surplus power generated from the sun that enter into electrolyzer that we can sell to the network; that hydrogen is a clean energy.And the response of the software was pretty good and can be used for hourly and daily planners, well.

Fig. 5 .
Fig. 5. Generated power from electrolyzer and fuel cell

Fig. 7 .
Fig. 7.The heat generated by the fuel cell.

Fig. 9 .
Fig. 9. Purchase of gas from network in order to provide hot water and house heating