First Approach to a Holistic Tool for Assessing RES Investment Feasibility

: Combining availability, viability, sustainability, technical options, and environmental impact in an energy-planning project is a difﬁcult job itself for the today’s engineers. This becomes harder if the potential investors also need to be persuaded. Moreover, the problem increases even more if various consumptions are considered, as their patterns depend to a large extent on the type of facility and the activity. It is therefore essential to develop tools to assess the balance between generation and demand in a given installation. In this paper, a valuable tool is developed for the seamless calculation of the integration possibilities of renewable energies and the assessment of derived technical, ﬁnancial and environmental impacts. Furthermore, it also considers their interaction with the power grid or other networks, raising awareness of the polluting emissions responsible for global warming. Through a series of Structured Query Language databases and a dynamic data parameterization, the software is provided with sufﬁcient information to encode, calculate, simulate and graphically display information on the generation and demand of electric, thermal and transport energy, all in a user-friendly environment, ﬁnally providing an evaluation and feasibility report.


Introduction
As renewable energy sources (RES) have become an important part of the power generation mix, the availability of appropriate management tools is an important issue to be achieved. Management involves the integration of RES into the grid and, subsequently, a complete balance of both available energy resources and consumer profiles [1,2].
Likewise, detailed technical and economic studies must be performed in parallel to ensure the feasibility of the project. All these aspects must consider the environmental impact derived from related industrial activities [3]. The importance of this facet is evident since as early as 1995, the U.S. Department of Energy published a report with the manual for the economic evaluation of energy efficiency and renewable energy technologies [4].
Technical and economic issues are widely covered by several management tools, whereas environmental audit techniques have their appropriate set of tools. Nevertheless, it is beyond the scope of this paper to delve deeper into these fields.
Therefore, how to combine energy availability with economic viability, technical options, and the resulting carbon footprint, and how to issue a holistic report to persuade potential investors is a coming challenge for technicians. The tool proposed in this paper seeks to lay the foundations of such a holistic approach, being able to provide several important aspects to support the decision to install an RES facility in a certain location.
To build the aforementioned software tool, the programming language Python 3.6 and the integrated development environment (IDE) PYQT Designer 5 are used. The system also made use of nine SQL (Structured Query Language) relational databases, developed for that purpose and which can be deployed on a local server or on a Data as a Service (DaaS) cloud system.
The structure of the paper is as follows. First, Section 2 provides a brief overview of the common tools used to estimate or calculate both energy production and consumption. Secondly, Section 3 addresses the process of modeling different energy sources and characterizing the systems, including the generation of demand profiles, feasibility evaluations, modeling of consumptions and balance among the elements. An illustrative example of the application of the proposed tool is developed in Section 4. Finally, Section 5 presents some conclusions.

State-of-the-Art of Energy Estimation Tools
It can easily be seen that designing a tool to estimate the total production of energy from a specific renewable source is not a novel idea [5]. However, it can also be verified that the vast majority of these current tools are focused on a single type of RES at a specific location [6][7][8] and only a few of them are on a pair [9]. Furthermore, financial and economic project analysis tools are widely used.
Only a few works manage both the estimation of energy production and the economic analysis, as in [10]. These implementations addressed how to deal with an immediate consumption scenario, determining which loads must be shed to fit and match the demand profile with the short-term production forecast and assessing the economic feasibility of a household installation. In addition, some approaches have made use of holistic assessment tools for a micro-turbine combined thermal RES [11], for building thermal insulation solutions [12] or for the evaluation of investments in different energy market scenarios [13].
On the contrary, the definition and construction of consumption profiles for complex and various consumer choices remain a hot topic for researchers [14,15]. There are many research groups working on establishing the best methodology to determine the most accurate consuming profile to model and predict the energy demand of a particular residential area, service or facility [16][17][18].
For instance, stochastic data analysis, temporal series measurement, aggregation or disaggregation of the electric consumption data are several commonly used modeling techniques [19]. Otherwise, local authorities such as the Spanish Government [20] might provide standard profiling methods in absence of data.

Profiling Methodology
The idea proposed by Ciabattoni et al. of sizing a particular RES installation ensuring its economic convenience in varying consumption patterns [21] has been taken as a starting point. From there, the present proposal has been completely constructed in its entirety, extending it both technically and geographically so that any of the renewable energy sources available in a given geographical demarcation and the conventional sources available in it can be considered, as well as the complex set of consumption needs.
In general, the production profiles, which conform the SQL databases, can be obtained from two main sources. On the one hand, public repositories such as the solar radiation data taken from the NASA (National Aeronautics and Space Administration) website can be used with a top-down approach [22]. On the other hand, time series monitored in different installations can be employed with a bottom-up philosophy, by aggregating the individual records or applying time series modeling techniques [10].
The same procedure is applied for demand profiles [2,[15][16][17][18][19][20]. Thus, whatever the profile processing used to obtain an operative model, in most cases, top-down methods are used to define resources availability, deterministic and behavioral ones to determine generators capacity and mainly bottom-up methods for shaping individuals and facilities consumption.
The analysis application includes several calculations and estimation methods both to determine the amount of energy available and to describe the consumption profile of the appliances.
Each energy source or load is modeled according to its behavioral equations and recorded data, publically available from various repositories. From all these data, a relational SQL database system is built which also provide a seamless maintenance, flexibility and periodic updates.
Furthermore, the developed graphical user interface (GUI) allows for an intuitive interaction with the user while hiding all the algorithmic complexity. To structure the system, the resources have been organized into a two-level tab hierarchy. On the top level, tabs for the energy resources, the energy generators, the consumer demand and the balance among all of them can be found. Following this hierarchy, every time a resource is selected, a group of various subtabs is shown where detailed definitions can be performed. This is addressed in detail in the following subsections.

Profiling Energy Resources
As stated above, a top-bottom profiling method was mainly used to obtain the availability of each energy resource under consideration. Four main types of resources were considered in this proposal, i.e., radiated energy, flow energy, potential energy and fuel energy.

Solar Radiation Estimation and Profiling
Two scenarios were considered when estimating the irradiation model of a given location. On the one hand, the global solar radiation (Ho) in a specific period (t1-t2), i.e., the total amount of energy received during a considered period, was determined by: Isc.Eo(cosθt.cosδ.cosL + senδ.senL)dt (1) where θ is the solar incidence angle, Isc·Eo·cosθ is the extraterrestrial irradiance Isc corrected with the equation of time Eo, δ is the declination angle and L is the latitude, all of them at mid-month for all the months within the period considered, according to Duffie and Beckman [23]. In this first approximation, the data taken from the repository published by NASA are combined with the geographical data of the chosen location and applied to Equation (1). This results in the estimation of the monthly mean value of the horizontal extraterrestrial radiation value on the surface.
Combining these estimated data in the form of a monthly averaged surface solar radiation database, several algorithms may be used for determining the direct radiation, the diffuse radiation and the total radiation in any inclination, orientation, altitude or orientation applied to oneor two-axis solar trackers.
On the left side of the tab shown in Figure 1 is the selector that allows including the option of parameterization regarding the types of the supportive infrastructure for the solar collectors and its orientation related geometrical data. Below these, the user can find the dials that allows incorporating the corrective factors depending on both the clarity and transparency of the atmosphere and the albedo of the ground into the profile calculation algorithm [23]. No other on-execution-time environmental or weather modifying parameters had been considered in this proposal.
On the other hand, some laboratories such as the National Renewable Energy Laboratory [9]. which has large series of measured local data, provide prediction algorithms that can be directly used to estimate the solar irradiation of a specific place over a determined time horizon by means of the learning based on these recorded data. This set of values in the form of SQL database is directly usable as a source in this tab. As most SQL code is not completely portable between different database systems without adjustments, a convenient formatting is needed.
Since this method would always be available for any kind of resources if registered data were provided, it will not be referred again in the following sections of this document. An example of the interface window from the solar radiation profiling tab is shown in Figure 1, where the annual profile of generated energy per square meter for different configurations can be seen. On the right side of the tab, dials and sliding bars were included to allow for a basic variation of location and/or atmospheric conditions. For the sake of simplicity, data profiles have been smoothed with the monthly average.

Kinetic Energy Estimation and Profiling
The calculation of this value set the first limit for establishing the power rate of a wind turbine (WT) or a hydro generator (HG). The kinetic energy (Ec) of a fluid of density δ flowing across blades of a flat area (A) at a specified speed (v) per time unit (t) was determined by: Nevertheless, not all of this energy could be converted to torque/speed in the WT because of Betz Law. In addition, mechanical (Rm) and electric (Rg) transformations reduce the total efficiency, so the usable generator's energy was It can easily be understood that being provided with the most accurate historic weather records of the wind speed or river flow rate regimes at a specific location, produces the most accurate estimation profiles to feed our SQL databases.
As mentioned in the previous section, the data were provided per surface unit. An example of the wind and water flow power availability at a specific location is shown in Figure 2.

Water Potential Energy Estimation and Profiling Tab
Water accumulated in a dam by rainfall in a river basin can be used to produce energy by means of turbines. The water flow energy was determined by: where δ is the density of water, Q is the flow rate and H is the elevation of the water column, according to Agüera [24]. Hence, the energy per square meter available in a basin due to runoff waters from expected rainfalls stored in a dam could be estimated within a specified period, as shown in Figure 3. As stated before, valid geographical and meteorological data are essential for a valid estimation. Particularly, the reservoir of potential energy that a river basin can provide is difficult to estimate so the use of averaged models is even more justifiable than for other RESs.

Fuel Energy Estimation and Modeling, Additional Data and Comparison Features Tab
As a rule, there is no particular regime regarding the supply of any fuel type. Subsequently, the energy produced in a boiler due to fuel combustion was determined by the relationship between its lower calorific value and the weight of the burnt fuel.
Note that this model also included an additional aspect not considered before, i.e., the weight of carbon dioxide released into the atmosphere during the combustion process, expressed in kg. Figure 4 displays the estimated energy production estimation using coal as the fuel. This program tab also offers the possibility to consider existing line grids, whose tariffs and emissions data can easily be entered into the program. Finally, this tab allows for the selection within several resources from the ones described above and either to perform a comparison between them or to compose a so-called "energy mix", i.e., the total availability of modeled and predicted energy at a particular area or location. Figure 5 displays the data input interface for existing grids and an example of the graphic comparing feature is shown in Figure 6, respectively.

Generation Profiling Tab
As stated at the beginning of Section 3, in the profiling tab, both the description and the characteristics of each listed generation system were incorporated based on the information provided by manufacturers and suppliers. Efficiency data, energy losses in HV and LV distribution grid and the thermal effects were also recorded in the database for each source. Thus, the final behavior and capacity of each listed generator were defined by applying the necessary correction parameters to the predefined equations. Consequently, the entire supplying system was considered from the generator itself to the point of common coupling (PCC).
The left side of Figure 7 shows the interface for entering the description and parameters of each selected generator type. These generators are shown in the spreadsheet on the right side after they were registered. Then, the generator is assigned a unique ID number, which can be chosen by the user to aggregate this unit to the project.
To ensure a complete analysis of any generation system, the model includes its evaluation and studies from different points of view, such as technical feasibility and economic and environmental viability. Therefore, the purchase price and other costs are included in this definition tab, as well as information regarding CO 2 emissions.

Technical Feasibility
To estimate the technical feasibility of a previously defined generation system, the data corresponding to the associated energy source at a defined location were applied. In this process, it is necessary to choose the right relationship between the selected generator and its primary source of energy. Failing to do this will lead to erroneous calculations and eventually to wrong decisions.
Combining the data from an ES with that of a selected generator with a recorded efficiency and associated losses provides the total amount of energy that the installation can produce in a defined period. Otherwise, a forecast estimation of a given installation for a determined time horizon, as exposed in [10], can also give its scheduled power profile to be used in this evaluating tab. Figures 8 and 9 show two examples of generation systems at different locations, one for a photovoltaic plant and the other for a hydropower system.

Economic Viability
Several parameters were considered to estimate the economic viability of a determined installation. Factors such as cash flow, net present value (NPV) or cost-profit ratio were included in this assessment. Likewise, the production day-period and the daily tariffs with variable hourly prices were considered and can be tuned as well.
The return on investment (ROI) based on the retained cash flow is displayed in a graph. The parameterization area in the tab allows for the selection among various demand characteristics (Figure 10), the prices which can be modified by some sliders in the upper area of the tab (Figure 11), or the introduction of financial evaluation settings in the right side ( Figure 12). All these parameters concern either the cost-profit relationship or the cash flow and, therefore, the economic viability.

Environmental Viability
Considering the stored data concerning the variety of energy sources and their generation characteristics, this tab provides the environmental feasibility in a graphical report in which the amount of carbon dioxide emitted or saved in a year is displayed ( Figure 13).

Demand Profile Modeling
Three different types of energy consumers were considered in this application: electric consumption, thermal demand, and transportation issues using EVs, as shown in Figure 14. Each of these consumptions has several characteristic patterns whose values were stored in various databases that can easily be uploaded and updated by means of the SQL features.
In addition to other sources of information, data from energy audits done in different types of companies can be easily adapted to the SQL format to obtain useful realistic profiles.

Energy Balance Calculation
On the one hand, the system contains the entire set of energy resources and generators database with their characteristics from primary energy transformation to the PCC. On the other hand, a set of demand profiles for different consumers is used. Therefore, combining all the information for the chosen items, a monthly energy balance report can be generated.
A setting window is used to configure the desired power from either a generating profile or a consuming one as it can be seen in Figure 15. This allows performing an energy balance monitoring profile, as depicted in Figure 16.  As a result, an energy balance report is displayed in a window whose data can also be exported into spreadsheets, as shown in Figure 17. Moreover, this balance tab provides interactive dial controls for introducing variations in the parameters to establish different analysis conditions in simulation mode.

An Illustrative Example of Application
This section is intended both to expose how to proceed with the proposed tool by an example and to provide a comparative analysis between two scenarios with different sets of devices installed in the same facility to generate a couple of contrasting reports.

Overall Description
This is a sample study on the supply of electric power to a new hypothetical 115-room hotel and golf course which would be built in Sierra Morena, Cordova, Spain (37 • 58 16.7"N 4 • 48 36.8"W). The study considers that there is a nearby electrical network able to supply the whole power demanded by the hotel [25].
The power planned for the facility at project stage is as shown in Table 1. Golf course transport n.s. 2 10 golf carts at 30 km per day each (300 km/day). Transport Staff transport n.s. 2 6 staff cars at 60 km per day (360 km/day). 1 Heating, ventilating and air conditioning (HVAC). 2 Not specified (n.s.).
For the sake of simplicity, on the one hand, it will be considered that appropriate capacitor banks are installed to ensure that the power factor is the unit. On the other hand, absolute data on secondary losses in devices, cable lengths, etc. are not detailed, but have been considered in terms of sector statistics, otherwise, the present document would be oversized and possibly undermined its true objective.

Choosing Demand Profiles
Based on previous data obtained from an energy audit in an existing golf club and resort placed in Cordova's surrounding, demand profiles are chosen for each type of energy according to what it is displayed in Table 1 and exposed in Section 2. The graphs represent the demand per kW of power per day all year round. Each (shown in Figures 18-20) is built from a respective matrix of 12 monthly averaged values corresponding to a year. The displayed data graphs result from the spline interpolation with the Python scipy library.       Thus, all receivers have already been included in the Balance Spreadsheet ( Figure 21).

Analyzing Different Scenarios
Once the demand profiles have been selected, the requested power is assigned to each group of receivers. To identify the receivers the prefix "R" is used and "G" for the generators; if the denomination is followed by "E1", it represents the first Scenario, and so on.
The experimental study will evolve through different supply Scenarios and the way in which the environment and the economy are affected will be shown.
The generators are selected from the "Energy balance" menu and the resource of each energy source is assigned as well. The prices of the resource, its maintenance, and the investment represent a part of the total cost amount to perform viability checking of the project, to what there must be added the losses for the machine and the transport efficiency, the thermal losses, etc. All these data are part of the SQL database of each generator and resource.

Scenario 1
Constraints: choosing generators and their respective profiles Scenario 1 considers that all power is provided by the existing network of ENDESA (ENDESA is the local power utility in Southern Spain) with triple pricing [26]. Standard heat pumps will be used for HVAC, a natural gas boiler for water heating, the declared induction stoves for the kitchen and standard refrigerators and freezers will be installed. In addition, golf carts will be gas vehicles and the staff cars will be diesel. Figure 22a shows the boiler graphs, in which the red line indicates the energy that the boiler can supply at full power, whereas the blue one represents the estimated demand profile. Proceeding in the same way, Figure 22b-d presents this information for the other generators in Scenario 1.  Now, the transport elements will be added. Thus, six cars for the hotel staff and 10 carts for the golf course will be considered for simultaneous use. Figure 23 depicts the capacity of generating energy for transport generators. Note that the gap between the capacity of generators and the requirements of the demand is larger than in previous analysis since the use of each vehicle is essentially discontinuous.
Once configured, the proposed consumption profile model can be simulated from a technical, economic and environmental point of view. Figure 24 displays all the elements involved in the simulation of the first Scenario of the proposed Balance Report Sheet.

Technical Analysis
As stated in the previous section, all electric power is supplied by the grid (696 MWh, dotted line in Figure 25a) in this Scenario, while the generation itself remains null (solid line). On the right side of Figure 25, the instantaneous daily values are shown.  Furthermore, thermal energy (1142 MWht) is entirely supplied by the proposed generators (demand track has been 1% intentionally diverted in Figure 25b to show that they are overlapped).
Moreover, once the transport is analyzed from the technical point of view, it can be clearly seen in Figure 25c that it is 100% satisfied (215,000 km per year).
With these results, the installation is in working order, however, it is time to analyze its economic feasibility and CO 2 emissions.

Economic Analysis
As can be seen in the graph of accumulated cash flow (Figure 26), the investment from the financial point of view is profitable, given that the investment would be recovered after 14 years, with a benefit-investment ratio (BIR) of 0.21 €. Even though it might be feasible, the environmental aspect has not been considered, thus the project might become obsolete in a short period of time.
There are also several dial and scroll controls available to allow users to modify several economic parameters, especially those related to price and taxes, to perform basic sensitivity analyses. Figure 27a-c shows three illustrative cases in which investment sensitivity due to the increase in fuel price and emission issues [26,27], respectively, result in unprofitability within the considered 20 years horizon.  The Benefit-Investment Ratio has lowered to negative and the recovery period is outside the predictable limits, which warns about the low flexibility of adaptation to likely events, and the need to make convenient decisions to prevent that. Otherwise, the project would come out of the profitability margin and would make it unviable.

Environmental Analysis
It is obvious that emissions in this Scenario are very high. In the lower left-hand side of Figure 25 are displayed the CO 2 emissions in tons due to the consumption of AC grid (129 t) and in total (244 t), as well as that of the own facility (114.91 t).
Below, on the right-hand side (in the graph, nuclear waste is multiplied by 10 for visibility purposes), energies are split up by type and their equivalent emissions in nuclear waste and toe are also described in Figure 28.
The dial in the simulation balance tab allows varying the CO 2 emission factor to check the project profitability through the evolution of the energy mix.

Scenario 2
The investment improvement action aimed to assess its feasibility will be directed in two ways. Firstly, replacing combustion systems by those provided with alternative technologies. For instance, the gas boiler and standard air-air heat pumps with the most efficient aerothermal [28] heat pumps (air-water).
With regard to transport, internal combustion vehicles are going to be replaced with electric ones; given that the demand for travel is not affected by the autonomy of these vehicles, their efficiency is 90%, compared to 30% or 35% of combustion vehicles. Diesel and high-pressure gasoline vehicles are not only transport generators, they are also large emitters of CO 2 and NO x and especially 2.5-micron particles are highly carcinogenic as they enter the cells more directly.
Despite its high price, the annual battery charge loss is close to 1%, which may consider a service-life of about 10-20 years depending on use. The average consumption is 20 kWh per 100 km and the battery is charged in 40 minutes at 80%, but for a full charge it takes 2 h, provided that the power of the charger allows for it.
Secondly, for this Scenario, a 200 kW photovoltaic system [29] will be installed on the roof, with a 35 • slope and 10 • East orientation. To do this, the user might select the section named "Solar Radiation Resources" and simulate the roof parameters, as shown in Figure 29a. Once it is done, a daily average of 5.66 KWh·per sq.m. and per day, with an increase of 8.49% over the horizontal radiation, is obtained. Furthermore, various inclination/orientation models are simulated to have real data regarding the convenience of using the roof of the building to place the panels, and the results are shown in Figure 29b. Note in Figure 29b that, even though the two-axis tracking (channel 4) gets much more radiation, the roof solution (traced in channel 1) should be kept because of its optimal slope (31 • ) and shade-free location. That is why a 200 kWe photovoltaic generator might be installed onto the roof, since there is enough roof available (962 sq.m. required), with monocrystalline panels, obtaining the results in Figure 30.
Upgrading to the new Scenario or model, the Balance to be considered is that shown in Figure 31. Both the induction cooker and refrigerators and freezers should be kept because they are optimized to the current technology. The new results from the technical point of view are shown in Figure 32.   It is not recommended to exceed 45% of the total demand since what is not consumed during sunny hours can be injected into the network (if you are a producer) at the minimum price since this case considers no accumulation.
Regarding the thermal and transport issues, they are technically the same as the previous curves, since the demands have not changed and the new receivers have been adjusted again according to the corresponding control curve.
From the economic point of view, the return on investment has been reduced to four years and BIR has been increased to 2.14 € (Figure 33a). It is mainly due to the energy provided by the photovoltaic system at zero fuel cost and the higher profitability of the electric car as opposed to the internal combustion, as well as that coming from the aerothermal pumps.  Note that, when repeating the sensitivity analysis in which consumption was increased by 10%, the graph results as shown in Figure 33b, in which the values of profitability and return have barely moved, which means that the project is economically stronger now.
Simulating the model with the new CO 2 emissions and invoicing and keeping the emission rights at 20 € as above, the return and profitability remain almost the same (Figure 33c), mainly because the emission cost is negligible compared to the increase in profit. The project is now safer and more reliable with respect to potential threats in the coming years.
From an environmental perspective, the most noteworthy is the enormous reduction in CO 2 emissions, which has dropped by around 65%, from 230.47 t to 81.34 t (Figure 34). This is because the facility has stopped burning fuel and passed to the electricity grid the thermal energy generators, which has fewer emissions, has also been offset by a photovoltaic installation that produces 45% of consumption.
Having reached this point, to continue searching for a Zero Emissions [30,31] panorama, it is necessary to install an accumulation system and continue adding renewable energy, passing it on to manageable ones or adding fuel cells, which, as it is not mature technology, should be dismissed for the moment.

Conclusions
A first approach to an analysis tool has been developed that provides a holistic software environment, capable of generating technical, economic and environmental reports to support an investment decision. To make the system useful, flexible and modular, an SQL database system has been programmed. The current profiling methodology allows for the use of any modeling information related to RES, generators or consumption profiles by adapting the source data to a monthly average database structure, regardless of how the model was built or how the measurements were taken.
These databases can automatically be, and are presented as, one of the main lines of future development of the proposed tool.
Although no real investment examples or proven validation cases have been performed to assess the validity of the tool described in this paper, the process followed in the previous section proves that obtaining feasibility reports through the proposed tool is a user-friendly process. Moreover, the obtained reports allow for comparative analysis against different design alternatives, as can easily be seen from a fully completed theoretical case and the several simulations that have been carried out yielding consistent and promising results.

Conflicts of Interest:
The authors declare no conflict of interest.