A Novel Design and Optimization Software for Autonomous PV / Wind / Battery Hybrid Power Systems

This paper introduces a design and optimization computer simulation program for autonomous hybrid PV/wind/battery energy system. The main function of the new proposed computer program is to determine the optimum size of each component of the hybrid energy system for the lowest price of kWh generated and the best loss of load probability at highest reliability.This computer program uses the hourly wind speed, hourly radiation, and hourly load power with several numbers of wind turbine (WT) and PV module types. The proposed computer program changes the penetration ratio of wind/PV with certain increments and calculates the required size of all components and the optimum battery size to get the predefined lowest acceptable probability.This computer program has been designed in flexible fashion that is not available in market available software like HOMER and RETScreen. Actual data for Saudi sites have been used with this computer program. The data obtained have been compared with these market available software. The comparison shows the superiority of this computer program in the optimal design of the autonomous PV/wind/battery hybrid system.The proposed computer program performed the optimal design steps in very short time and with accurate results. Many valuable results can be extracted from this computer program that can help researchers and decisionmakers.


Introduction
Energy is considered as the most important factor in the modern life.In remote areas, especially in the desert of vast land of Saudi Arabia, the energy is valuable because the electric utility is not available and the transportation of fossil fuels required for small convention electric generation plants is very hard and expensive.There are wide areas in Saudi Arabia, especially in remote areas, that have no access to the electric utility.It is not economical to extend the national electric grid to all these wide remote areas.Most of these areas rely on conventional electric energy sources like diesel generators for their electric power supply.However, this conventional generation depends on the availability of fossil fuel that usually is quite expensive.Besides that, the engines usually operate at low efficiency due to the typical loads in remote areas that vary considerably during the day and night [1].So, localizing the generation of electricity and independent of the fuels that should come from remote areas can help people live in these areas economically and environmentally.Renewable energy (RE) system can play an important role in generating the electricity without a need to fuel or reduction of the environment hazard.Using many RE sources can increase the system reliability and reduce the price of generated kWh considerably.The power generated from wind and PV energy systems is dependent on the wind speed and solar radiation, respectively.The nature of these weather factors is different where the radiation is in the day time but the wind speed increases at night than at the day time.For this reason, a combination between wind and PV energy systems can increase the system reliability and reduce the size of the storage system required which can be translated into considerable reduction in the cost of the generated energy.These two important RE sources can be used with battery storage to feed the load with the deficit power in case the generated power is not enough for the load and it can save the surplus power when the generated power is greater than the load requirements.This system has been analyzed in many researches such as in [2][3][4], and it is the one used in this paper.Diesel engine can be used as a secondary backup with the battery storage but this will increase the system cost considerably.Sometimes fuel cell with hydrogen storage tanks is used as secondary storage with the battery as shown in [5][6][7].Hybrid system components can be connected together in DC-bus, AC-bus, or hybrid DC and AC-buses.
In a DC-coupled configuration, the different energy sources are connected to a DC-bus through appropriate power electronic converters interfacing circuits.The DC sources may be connected to the DC-bus directly if appropriate or may be a DC/DC converter is required to regulate the DC voltage.If there are any DC loads, they can also be connected to the DC-bus directly or through DC/DC converters to achieve appropriate DC voltage for the DC loads.The DC coupling scheme is characterized by simple construction and control and it has low efficiency and reliability: low efficiency because all power to the load should go through the inverter and low reliability because if the inverter does not work, the whole system will shut down.To avoid this situation, it is possible to connect several inverters with lower power rating in parallel, in which case synchronization of the output voltage of the different inverters, or synchronization with the grid, if the system is grid-connected, is needed which increase the system reliability but it will increase the cost.A proper power sharing control scheme is also required to achieve a desired load distribution among the different inverters [8][9][10].Many researchers used the series hybrid system as an example in [2,11].In the other way, all RE sources and batteries can be connected to DC-bus and the DC-bus will be connected to AC-bus through bidirection converter.The design principles of this system is relatively complicated but it has better efficiency and reliability compared to the series configuration [1].Many researchers used the parallel hybrid DC-coupling system as an example in [2,4].In an AC coupling system, the different energy sources are integrated through their own power electronic interfacing circuits to a power frequency AC-bus [10].
Instead of connecting the entire hybrid energy sources to just a single DC or AC-bus, as discussed previously, the different sources can be connected to the DC or ACbus of the hybrid system depending on the output of each of them.As a result, the system can have higher energy efficiency and reduced cost.On the other hand, control and energy management might be more complicated than for the DC-and AC-coupled schemes [10].Interconnection of wind energy system with the AC-bus directly is shown in many researches such as [1,12,13].
Choosing of the appropriate configuration depends on the type of output power of the most of the generation and loads.If most of the generation and some loads are DC, it is better to use DC-bus coupling or to use AC-bus coupling if the other case is valid.If the major power sources of a hybrid system generate a mixture of AC and DC power, then a hybrid-coupled integration scheme may be considered [10] which is the case in this paper as shown in Figure 1.

Modeling of PV/Wind/Battery Hybrid Energy System
In this paper, a hybrid RE system (HRE) in AC-bus connection is designed by using wind/PV/battery storage as shown in Figure 1.The dispatch of the system is very easy to be understood where the load is supplied primarily from WTs and PV through the bidirectional converter, respectively.In case the generated power is greater than the load requirements, the surplus power will feed the battery storage from wind and PV in case the battery storage is not full.In case the generated power from the wind and PV is not sufficient for the load, the deficit power will be compensated from the batteries unless the batteries are lower than the minimum state of charge.Interconnecting the WT directly to the AC-bus will increase the system efficiency than the interconnecting WTs to DC-bus through AC/DC converting and then converting the DC power to synchronized AC power again.The sizing of each component of the proposed system is designed by using a new proposed computer program (NPCP) and its results are compared with HOMER Program which is one of the most famous computer programs in designing the hybrid systems.

Modeling of Wind Energy Generator.
Wind energy is a form of solar energy produced by uneven heating of the earth's surface.Unlike any conventional power source, wind power is less predictable.Although wind power source is less predictable than the solar power, it is typically available for more hours in a given day.Wind resources are influenced by the type of the land surface and the elevation of the land surface.Generally, if the land is in high elevation then it is good for wind energy conversion and vice versa.Also the generation of energy from WTs increasing considerably with the increasing the height of the tower but it increases the cost of the system.Also, the open area places are suitable for installation of wind energy systems.Since the wind speed is extremely important for the amount of energy a WT can convert to electricity (the power content of the wind varies with the cube of the wind speed), the choosing of wind energy site based on the wind speed data is very important.Many literatures have been done to choose the best possible site from many available sites [14][15][16][17][18].In the following sections of this paper, a detailed analysis of the power available from WT for different wind speeds is given.The output power from wind energy system is given by where  0 is the overall efficiency of WT and can be obtained from the following equation: where   is the coefficient of performance of the WT,   is the efficiency of the mechanical system of WT,   is the generator efficiency of the WT, and NWT is the optimum number of WTs.
The vertical wind speed gradient can be obtained from the following equation: where, ℎ is the height above the ground level, , ℎ is the height of where the wind speed is measured, , and  is the power law exponent, which depends on the roughness of the ground surface; its average value is (1/7) [19].Many researchers used the anemometers in different height to get accurate value of  but this value differs from site to site and from time to time in the same site.Due to the effect of wind speed on the generated power from WT, the availability of wind has a great influence on capital investment and on profitability of the entire systems, where, the characteristics of wind at the plant site play a significant role in the price of kWh generated from the whole system.So, the selection of suitable WT for certain site needs a lot of calculations and details to be studied and optimized.
The actual WT output power with the wind speed is shown as where   is the rated power;   is the cut-in wind speed;   is the rated wind speed; and   is the cut-off wind speed.Using this equation, the power output of a turbine can be modeled if the cut-in, cut-out, and rated wind speed and the rated power are known.The speed of the wind is continuously changing, making it desirable to describe it by statistical methods.One statistical quantity which we have mentioned earlier is the average or arithmetic mean [19].For a set of measured wind speeds,   , the mean of the set  is defined as The sample size or the number of measured values is .
Wind speeds are normally measured in integer values, so that each integer value is observed many times during a year of observations.The numbers of observations of a specific wind speed   will be defined as   .The probability (  ) of the discrete wind speed   is observed as With this definition, the sum of all probabilities will be unity.
The cumulative distribution function (  ) can be defined as the probability that a measured wind speed will be less than or equal to   as shown in the following equation: There are several density functions which can be used to describe the wind speed frequency curve.The two most common are the Weibull and the Rayleigh functions.The Weibull is a two-parameter distribution.The Weibull distribution shall be presented here.The wind speed  is distributed as the Weibull distribution if its probability density function is shown in the following equation: ) , ( > 0,  > 0,  > 1) .
This is a two parameter distribution where  and  are the scale parameter and the shape parameter, respectively.A method depending on the accurate statistical analysis for obtaining Weibull parameters has been used in this computer program [20].The value of Weibull parameters can be obtained from the following equations as shown in the following: where where  and  are the mean values of   and   , respectively.
The capacity factor of the WT in certain site can be obtained from the following equation: W,av =   *   .
The average number of WTs, ANWT required is given by the following equation: where,  LW,av is from WT and  W,av is the average electric power generated from each WT.

Modeling of PV Energy System
Generator.The orientation of the PV array against the movement of the sun determines the intensity of the sunlight failing on the modules surface and, therefore, it will affect the system power output.The tilt angle and the azimuth angle are the two parameters that need to be considered.The tilt angle is the angle between the plane of the PV array and the horizontal whereas the azimuth angle is the angle between the plane of the PV array and due south (or sometimes due north when in southern hemisphere).The orientation will be facing south for the case of Saudi Arabia due to its location in the north of the equator.The PV array surface should be positioned in a way that it is aimed directly perpendicular to the sun's rays.This will capture the maximum amount of sunlight to be converted into electricity.This tilt angle and orientation can be easily achieved using a tracking system that follows the sun's trajectory at a particular time and day.However, a tracking system is costly and requires high maintenance.Therefore, various studies have been conducted on the optimum tilt and orientation angle for fixed surfaces.In this research, PV array is assumed to have optimum monthly tilt angle.However, the optimum monthly tilt angle chosen should provide maximum power output from the system during the month.The tilt angle can be fixed at a certain angle all year round, seasonally or monthly changed.The monthly optimum tilt angle will be used in this study because of its simplicity and its economic benefits.There has been some earlier literature that suggested positioning PV arrays to face south at certain tilt angle for sites in the north of the equator [21][22][23].Theoretical calculations were performed to determine optimum tilt angle,  opt , and orientation of PV arrays.The position of PV array is defined by its tilt angle and orientation, expressed as the azimuth angle; . Figure 2 [24] shows a fixed PV module facing due South and tilted at an angle .Where  is the angle between the tilted surface and the horizontal whereas  is the angle between the normal of the tilted surface projected on a horizontal surface from the local meridian.A South facing surface has  = 0 ∘ and North facing surface has  = 180 ∘ .The angle of declination  is the angular displacement of the sun to the center of the earth and is given by the following equation: where  represents a day in a year.All estimated with the day number of a year given for each month [25]: But it is recommended that  should be calculated from the following equation: The sunset hour angle   is the solar angle corresponding to the time when the sun sets calculated by where,  is the latitude angle of the selected site, degrees and  is the solar declination angle, degrees.During solar noon, the radiation is at its highest point.At this time, the path length the sun rays travel through the atmosphere is the shortest.Thus, it is desirable to tilt the PV arrays at an angle where its plane is perpendicular to the sun at solar noon.This optimum tilt angle  opt for the PV modules is found to be ( − ) which is equal to , at solar noon [26].
Monthly collectable radiation on a tilted surface for a given month (  ) can be estimated as follows: where (  ) is the direct or beam radiation, (  ) is the diffuse radiation, and (  ) is the ground reflected radiation.Equation ( 18) can be simplified as follows:

Modifying Solar Radiation on Monthly Optimum Tilted
Surface.Monthly average daily extraterrestrial radiation on a horizontal surface (  ) can be calculated from the following equation: The eccentricity correction factor () can be computed from the following equation: The monthly average clearness index (  ) is where  is the monthly average daily global radiation incident on a horizontal surface.
where   is a function of the transmittance of the atmosphere and can be estimated as the ratio of extraterrestrial radiation on the tilted surface to that on a horizontal surface for a given month.For surfaces directly facing the equator, The ratio of the daily average radiation at tilted surface to that on a horizontal one for each month,  can be obtained from the following equation: The optimum monthly tilt angle can be obtained from the following equation:

Calculation of Average Solar Cells' Area.
The cell temperature can be obtained from the following equation: where   is the ambient temperature, ∘ C,   is the solar cells temperature, ∘ C. The generating efficiency of the PV modules in terms of the cell temperature is shown in the following equation: The solar cell average area (PVA) required to feed load with average load,  LPV,av can be calculated from the following equation: where   is the factor of safety which includes an allowance for the possible inaccuracy of the insulation data, its covering by dust in the order of 1.1.  is the variability factor that takes into account the influence variation in the radiation from year to year, about 0.95.  is the theoretical solar cell efficiency,   () is the solar cell efficiency at time ,   is the theoretical solar cells temperature, and  PC is the power conditioning system efficiency.
The calculation of optimum PV area, PVA can be obtained from energy balancing between the load and the generation from PV system.PVA may be different than the average value due to the approximation and due to the discarded surplus power output from the PV system in case of full battery and the output greater than the load requirements.

Modeling of Battery
Storage.Battery storage system has been used to store the extra generated energy than the load requirements and supply the load with the energy when the generated power is not sufficient for the load.The maximum limit that the battery can store is  ,max and the minimum state of discharge is  ,min .The state of charge of the battery should be between these two limits.The control system should stop charging in case the state of charge of the battery reached  ,max and stop discharging in case this state reaches  ,min .The control system ensures the battery to work between these two limits to prevent batteries against shortening their life or even their destructions.The state of the battery after certain period of time Δ in charging and discharging process (  ( + Δ)) can be defined from (30) and (31), respectively.These two equations are valid only when the state of charge of the battery is within the allowable limits shown in (32); otherwise, the state of the battery can be obtained from (33).Consider Mathematical Problems in Engineering At any time, the charge of the battery should obey the following rule: where   () is generated power from wind,  PV () is the generated power from PV,   () is the load requirements, and  inv is the inverter efficiency.The value of  inv is about 95% in both directions from AC to DC or from DC to AC [2,5].
is the self-discharge rate which depends on the state of charge and the state of the health of the battery; the proposed value of 0.2% per day is recommended for most batteries [27].
and   are the charging and discharging efficiency of the battery.The value of charging efficiency   ranging from 85% to 65% depends on the charging current [28]; some other researches claim that the charging efficiency is about 90% [4].
The value of   is assumed to be 90% in this study.The battery discharging efficiency is assumed;   depends also on the discharging current and its value is assumed to be 85% in [4].Some other researches assume that the discharging efficiency is very high and it can be considered to be 100% [29].The minimum allowable storage capacity of the battery  ,min can be obtained from the following equation: where   is the rated or nominal capacity of the battery and sometimes it can be used to be the same as the maximum allowable storage capacity of the battery,  ,max .DOD is the depth of discharge of the battery.The value of DOD determines the battery life cycle where the higher value of DOD means shorter life cycles of the battery.

Modeling of Power Modifier.
Power electronics converter has been used in hybrid system to convert DC power to AC and from AC to DC to be suitable for the bidirectional power flow.Modern PWM converters have improved efficiency with typical value ranging from 90% to 95% with investment cost of $800/kW and $750 for replacement, $8 for annual cost and maintenance, and 15 years life time [2,4,5].
The inverter power ( inv ()) is in charging battery mode and when   >   can be calculated from the following equation, where part of the PV will flow through the inverter to help WTs to feed the load and the other part from PV will go to the battery to charge it. Consider The inverter power in charging battery mode and   () <   () of the battery can be calculated from the following equation, where the load gets all required energy from the wind and the other part from the wind will pass the converter to charge the battery.Also, the whole generation from PV will go to charge the battery in case the battery is not fully charged: The inverter power in discharging battery mode can be calculated from the following equation, where the whole power from the PV and the defect power will come from the battery in case the battery SOC is greater than the minimum possible value ( ,min ): The simulation results can determine the required rated value of the PWM converter depending on the above equations.

Economic Model
Many researches introduce economical techniques to determine the cost of the generated kWh depending on many assumptions.Some detailed techniques [30] used net present value to determine the price of kWh generated from hybrid energy systems.The economic analysis depends on calculating of the levelized cost of energy (LCE).The LCE can be determined by dividing the annual cost of the hybrid system by the yearly energy produced as [31] LEC where TPV is the total present value and is defined as the total cost of the whole hybrid system at the present time, AE is the annual total energy of the load and CRF is the capital recovery factor and it can be determined from where  is the net interest rate and  is the life times in years.The total present value TPV can be obtained from the following equation: where IC is the initial capital cost of the whole system, RC is the replacement cost, OMC is the operation and maintenance cost, and PSV is the present value of scrap [32].

The Initial Capital Cost.
The initial capital cost of the hybrid system includes the whole components of the system including the civil work, installation cost, and electrical connections and testing.The price of each component of the hybrid system and its life time and efficiency are shown in the Table 1.In this research, the civil work and installation costs are taken as 40% of PV generator price for PV part and 20% of wind generator price for wind part [11].The initial cost can be determined from the following equation: where PV  is the price of PV per meter square, WT  is the price of WT per kW, NWT is the total WT required for the hybrid system,   is the battery capacity (kWh),   is the price of battery system ($/kWh), and INV  is the price of inverter per kW. ) . ( RC is the capacity of the replacement unit (kW for WTs, and inverters, kWh for battery, etc.),   is the unit price cost ($/kW for WT and inverters, $/kWh for battery), and  rep is the number of components replacements over the system life period.

Operation and Maintenance
Cost.The present value of the operating and maintenance cost, OMC, is representing the maintenance cost all over the life time of the project for all components in the time of installation.This is the sum of all yearly scheduled operation and maintenance costs.OMCs include such items as an operator's salary, inspections, insurance, and all scheduled maintenance.Some researchers used a fixed percentage of the total cost of the system for maintenance such as in [34]; the annual maintenance cost has been set at 5% of capital cost for the WT, 1% of capital cost for the PV generator, and 0% for the batteries storage.OMC has been assumed to be 1% of the initial hardware system cost [31].Also, OMC has been used as a fixed cost per capacity of each component of the hybrid system such as in [6]; the used annual maintenance cost of WT is $100/kW which is about 3% of the WT price and 0% of the PV system.Also, [27] used annual maintenance cost of WT is $20/kW and $10/kW for the PV system and $25/kWh of the battery capacity.
Reference [4] used annual maintenance cost to be $20/kW for PV, $75/kW for WTs, and $20/kWh of the capacity of the batteries.Some authors have calculated the maintenance cost as a fixed cost per kWh about 1%.This will link the operation and maintenance to the operating time [29,35].In this paper, after a detailed survey of a lot of researches, the predicted value of the OMC cost is summarized in Table 1.OMC of the hybrid system can be expressed from the following equations [2]: 3.4.The Present Scrap Value.The present scrap value, PSV, can be obtained from (44) [32].This is the system's net worth in the final year of its life-cycle period.This value has been taken to be 10% of WT and civil work and ignored its value for other components in [32].And it is assumed to be 20% of the power conditioning equipment and battery bank and 10% for the solar array [31].In our analysis, the scrap or salvage value of each component has been taken as 20% for WTs, batteries, power conditioners, and civil work and 10% for the solar array.Future costs must be discounted because of the time value of money.A certain amount of money received today is worth more that the promise of the same amount in the next year, because it can be invested today and earn interest.To calculate the single present scrap value (PSV) of a future expense (FE) occurring in a specific year at a given net interest rate (), the following formula can be used: where SV is the value of scrap,  is the inflation rate, and  rep is the number of different components replacements over the system life period .

New Computer Program Description
The new proposed computer program (NPCP) has been designed to perform sizing and optimizing the whole component of the hybrid system.The NPCP used the model of each component explained in the previous sections.(i) The data of the market available WTs such as the cut-in wind speed,   , the rated wind speed,   , the cut-off wind speed,   , rated power,   , coefficient of performance,   , hub height, the efficiency of the mechanical and electrical system, swept area of the blades, and lifetime.
(ii) The data of the market available PV modules such as module efficiency, module area, output voltage and current, nominal operating temperature, and lifetime.
(iii) The data of market available batteries such as the rated capacity, depth of discharge, lifetime, charging and discharging efficiency, and operating voltage.
(iv) Hourly wind speed for available sites and hourly solar radiation for available sites.
(v) Site locations and elevations.
(vi) Economic data such as the price of each component, its replacement price, operation and maintenance price, scrap (salvage) price, interest rate, inflation rate, and life time proposed in this paper.

Weibull Parameters Calculations.
The purpose of this subroutine is to determine the Weibull, scale and shape parameters, , and .The logic used to determine an accurate value of the Weibull parameters is shown in Figure 4.

Capacity Factor and Average Power Generated from
Wind Energy System.The purpose of this subroutine is to determine the capacity factor,   , and the average number of WT, ANWT.The load for wind energy system and PV system can be obtained from the following equations, respectively: where Pen  is the penetration ratio from the WT and   is the average load power.

Modifying Solar
Radiation on a Tilted Surface.In this computer simulation program, it is assumed that the tilt angle of the PV modules should be changed monthly to the best tilt angle.The monthly best tilt angle should be calculated from (26).The hourly radiation on horizontal surface should be changed to become as the radiation on the monthly best tilt angle.The ratio of daily average radiation on a tilted surface to that on a horizontal surface for each month is shown in (25).The flowchart of the modifying solar radiation on a tilted surface is shown in Figure 5.

Energy Balance.
Energy balance part of the proposed computer program is the main part.To compute the optimum number of WTs and optimum solar module area required, an energy balance between the loads and the output from wind energy and PV systems must be made.Many salient factors will be calculated from this part such as (1) optimum number of WTs, (2) optimum area for PV modules, (3) optimum capacity of the battery, (4) optimum size of the inverter, (5) the yearly energy, (6) the energy contribution from PV and wind separately, (7) many other valuable data can be extracted from this part of the computer program.
This part of the computer program uses the average number of WTs, ANWT, and the average area of PV modules to calculate the energy produced from each supply and check if these values are just enough for the load requirements or if the program should increase it.The total energy generated should be combined and compared with the load power.In case the generated power is greater than the load requirements, the surplus power will charge the battery.In the other case, where the generated power is less than the load requirements, the defect power will be obtained from the battery system.The highest value of the accumulation of the power in the batteries determines its capacity as will be explained in the following logic.The total energy generated should satisfy the load requirements; otherwise, the size of the wind energy or the size of PV system should change by certain value.In the other case, if the total energy generated is greater than the load requirements by considerable limit, the size of the wind energy or the size of PV system should be reduced by certain value.The cycle starts again until the generated energy just satisfies the load requirements through the year.The logic

Start Weibull parameter program
For I = 1 to 8760 Read u(I)

Yes
No Is J + 0.5 > u(I) > J − 0.5?behind the energy balance part is shown in Figure 6.The following algorithm explains the operating logic of the energy balance program: The total energy generated from the WT is the summation of power generated from the wind through the year and can be obtained from the following equation: The output power from PV energy system is given by The total energy generated from the PV modules can be obtained from the following equation: If   () >   () and SOC <  ,max , then or if   () >   () and SOC >  ,max , then In case the generated power from the wind alone is lower than the load requirements but the generated power from both wind and PV is greater than the load requirements then the surplus power from the wind and PV will go to charge the batteries.The difference between the generated power (wind and PV) and the load should be multiplied by the charging   The energy balance for each WT and each PV module at different penetration ratio has been evaluated using an energy balance subroutine.The penetration ratio in the program is changed by 5% and the price of kWh generated from the system will be calculated and the minimum price of kWh generated from the system will be selected to determine the optimum penetration from wind and PV systems in the HRES.The flowchart of the energy balance part of the computer program is shown in Figure 6.

Economic Calculation Subroutine. A detailed economic technique has been explained in economic analysis section.
This technique is discussed in details and it takes into consideration all economic factors to get an accurate price for the generated kWh to easily compare between different options.The output results from energy balance program should be transferred to this subroutine such as the optimum number of WT, NWT, the optimum PV array area, PVA, and the required capacity for the batteries,   , and converters,  inv .Also, many economic data should be delivered to this subroutine as the price and the replacement cost, maintenance and operation cost, life time, salvage value, and rated power of each component.Also, the interest rate, , and inflation rate, , should be available as an input data for this subroutine.Figure 7 shows the flowchart for determining the price of kWh generated from the HRES and the minimum price that comes out from the total combinations of WT types and PV module types at certain penetration ration.

HOMER Software Simulation Program
Hybrid optimization model for electric renewable (HOMER software) software is one of the most famous softwares developed by National Renewable Energy Laboratory (NREL).This system can be used in HRES with backup like batteries or gas turbine autonomous or interconnected with electric utility.The HOMER software also can optimize the system with fuel cells and hydrogen tanks and electrolysis.This software can handle systems with MPPT tracking for PV system and it can compensate the solar radiation of the horizontal surface to be as the radiation on sun trackers with one or two axes or it can modify the solar radiation to become on the daily or monthly or yearly best tilt angle.Also the input wind speed can be modified to the hub height of WT.This software has a detailed economic calculation which takes account of all economic factors.But the detailed calculation is not shown and it is just a black box with a limited flexibility in changing the input data without an ability to check and change the economic calculation technique.Also, there is one more shortage with this software which is that the system cannot provide the user with the optimum sizing for each component but it can only use the available options that the user introduces to the computer to choose one of these options.So, this program can be used to compare with the results obtained from the proposed computer program in its optimum results.The simulation by using HOMER software is the same as the one used in NPCP.Many computer simulation programs may be used to do the same job as HOMER software but with less flexibility and they are not famous and effective like HOMER software.These market available computer softwares are HGYBRID2, HYDROGEMS, HOGA, TRANSYS, SOLSIM, SOMES, RAP-SIM, ARES, INSEL, and HYBRIDS.A detailed comparison between these software packages is shown in [36].

Simulation Results
Simulation has been carried out by using the NPCP and HOMER software to check and validate the results obtained from the new proposed computer program.In our new proposed computer program, the program can design the optimum size of each component depending on the minimum cost of energy.But the main limitation of HOMER software is that this feature is not included in the software however HOMER software needs the user to introduce many possibilities for each component to select the best option from these possibilities.So, the lowest price obtained from HOMER software is not the optimum solution but it will be the best possibility from the available possibilities entered to each component as a data.The optimum solution from the NPCP will be entered to HOMER software to compare the results.
The simulation has been done in the beginning with one of the best sites in wind energy which is Dhahran site where its average wind speed is 4.7 m/s at 10 m height from ground level.This site is located in the eastern part of Saudi Arabia at the coast of Arabian Gulf in 26 ∘ 18  N and 50 ∘ 8  E. One hundred WT data are introduced to the program to choose the best WT suitable for this site and the optimum contribution from wind and PV.Three PV modules have been introduced to choose the best one for this site.The load  profile for small village known as (ADDFA) in the north of Saudi Arabia were collected over several years and used as a load profile in our analysis.The load data for this village is multiplied by 10 to compensate the future extension and to design a system that may supply several remote villages.
The penetration ratio of wind and PV in feeding the load is changing in step of 1% and the optimum value will be selected according to the minimum price for kWh.The life time has been chosen to be 30 years, interest rate for Saudi Arabia is 2% [37], and inflation rate is 5% [38].Comparison between the results from NPCP and HOMER for Dhahran site is shown in Table 2.
6.1.The Detailed Results for Dhahran Site.The detailed results for Dhahran site in HOMER software are shown in Figure 8, and Table 3 shows the cash flow summary for Dhahran site by component type.It is clear from Figure 8 that the total capital cost is $46,780,000, $21,000,000 (44.9%) for PV, $16,280,000 (34.8%) for wind energy, $6,000,000 (12.8%) for batteries, and $3,500,000 (7.5%) for converter.The energy contributions from wind and PV are 63% and 37%, respectively.The price of kWh generated in Dhahran with HOMER software is 10.7 Cents/kWh when using AWE-1 WT.
The same results obtained from NPCP which are shown in Table 3 and Figure 9.The energy contributions from wind and PV are 60% and 40%, respectively.The minimum price for kWh generated is 10.5 Cents/kWh which is 2% lower than the one obtained by HOMER software.The best WT that can be used with Dhahran is a AWE-1.The total initial cost of the project is $49,126,780.The total initial cost for wind is 14,400,000 (29.3%), and, for PV, it is 22,006,190 (44.8%), for batteries is 7,929,092 (16.14%), and for converter is 4,791,500 (9.8%).
It is clear from the results of HOMER software and NPCP that the price of kWh generated does not change too much, only 2% deviation in these two values.NPCP predicts that the best contribution is 60% from wind and 40% from PV but HOMER software predicts that the contribution is 63% from wind and 37% from PV.
Table 4 shows the cash flow summary by cost type in HOMER software for Dhahran with AWE-1 WT.It is clear from this table that the initial cost is $46,780,000 (59.5%), $20,161,322 (25.63%) for replacement costs, $18,644,206 (23.7%) for operating and maintenance cost, and $−6,920,542 (−8.8%) for salvage price.The main concern here in the salvage value is saved in HOMER software as a default value and it cannot be change and there is no even explanation for this value in HOMER software.Also, HOMER software assumes zero salvage value for PV and converter which are different than the proposed values in many researches such in [31,32].

Conclusions
Hybrid RE system can economically feed loads in remote areas in Saudi Arabia and any other places in the world.

Figure 1 :
Figure 1: The proposed hybrid energy system.

Figure 3 :
Figure 3: Summarized block diagram of the proposed computer program.

Figure 4 :
Figure 4: The flowchart of the first subroutine for determining the Weibull parameters.

Figure 6 :
Figure 6: The flowchart of energy balance subroutine in the new proposed program.

Figure 7 :
Figure 7: The flowchart of the economic analysis model.

Figure 8 :
Figure 8: The cash flow summary by component for Dhahran from HOMER software.

Figure 9 :
Figure 9: The cash flow summary by component for Dhahran from NPCP.

Table 1 :
The detailed economic factors of each component of the hybrid system[33].

Table 2 :
Comparison between the results from NPCP and HOMER for Dhahran site.

Table 3 :
The energy and cost contributions for each component for Dhahran site in HOMER software and NPCP.

Table 4 :
The cost contributions for each cost type for Dhahran site in HOMER software and NPCP.