FOTODIM — Software for Sizing of Photovoltaic Systems

This study addresses the development of a computational tool for the sizing of photovoltaic systems interconnected to the grid (grid-tied) and isolated (off-grid) systems. The calculations for the sizing were obtained from the CRESESB Engineering Manual for Photovoltaic Systems, the GREENPO Photovoltaic Systems Technology, Design and Installation Manual, and the BLUESOL Solar System Introduction Digital Book. With knowledge of the latitude, longitude and altitude data of the site, the tool calculates the angle of the modules for better absorption of the photovoltaic radiation. For systems connected to the grid, it is also necessary to provide information on the consumption of the building to be serviced by the photovoltaic system. For isolated systems, in addition to information on the site, it is necessary to know the demand and consumption of the building. Decision-making criteria are based on economic analysis, according to indexes such as Net Present Value (NPV), Internal Rate of Return (IRR), and Discounted Payback. The screens developed for the sizing tool and examples of sizing of both photovoltaic systems are presented as results, through tables and graphs. The developed software is reliable, and all calculations have theoretical basis.


Introduction
The world's population may increase by roughly 1.5 billion people, reaching a milestone of nearly 8.8 billion by 2035.During this period, the gross domestic product (GDP) is expected to grow more than double, with one fifth of this growth coming from the increase of the population and four fifths, from improvements in productivity (BP Energy, 2016).
By 2030, energy consumption in developing countries is estimated to be 69% higher compared 2010, with an average growth of 2.7% per annum, accounting for 65% of the world's consumption, compared with 54% in 2010 (Kaygusuz, 2012).
The progressive growth of the world's population tends to raise levels of per capita consumption of resources, leading to a downward trend in the availability of natural resources.With the increasing urbanization and industrialization of the countries, the search for energy increases, pressing the administration of the governments to direct the plans of expansion of energy with exercises towards the sustainability (Heller, Espinasa, & Paredes, 2016;Singh, Vats, & Khanduja, 2016).
By 2035, renewable energy sources are expected to account for one quarter of the global primary energy growth and more than one third of the global energy generation growth, and may increase to 16% in energy generation, if technological and policy actions such as agreements enacted at COP 21, in Paris, are carried out (BP Energy, 2016).
The largest domestic electricity supply source currently in Brazil is hydropower, accounting for 70.6% (BEN, 2014).
The construction of dams for electricity generation has been facing strong environmental restrictions and energy security policies, mainly in the Amazon Rainforest, which poses risks to the construction of a solid energy matrix, a situation that forces the use of non-renewable sources to supply the demand (Freitas & Soito, 2011;Pereira et al., 2012;Prado Jr., 2016;Ribeiro et al., 2016).
Decentralized power generation can become a viable alternative to meet consumer demand and reduce transmission and distribution grid costs (Mohajeri et al., 2016).This generation can be achieved by means of the installation of photovoltaic panels, which is already a reality in Brazil, albeit with little relevance.The IEA (2014) describes that solar energy is one of the renewable energy resources with the highest potential and may be the largest world source of electricity by 2050.
Market forecasts for photovoltaic modules are currently very optimistic, with some going well beyond what was estimated for the current technology situation in both developed and developing countries.Due to the growth of grid-tied installations in homes, the need arises to optimize the sizing of photovoltaic generation systems, as well as selection of efficient devices, with knowledge of all the costs involved and subsequent return on invested capital.
To provide users with a versatile and intuitive calculation tool, "FOTODIM" software was developed.Its objective is to design Grid-tie and Off-Grid photovoltaic systems, considering technical and economic criteria.The development of the computational tool was performed using MATLAB software (Matrix Laboratory, Mathworks, Inc., version R2013a).The software has a database of equipment, which will be used by the user for the design of the photovoltaic system, and a database of solar radiation from some cities of the State of Paraná.It is possible to add new equipment and register new locations.

Photovoltaic Solar Energy
The direct generation of electricity using solar energy is performed by photovoltaic modules.Photovoltaic cells are responsible for converting energy.
Through the photovoltaic effect, the cells absorb the available photons from the solar radiation and convert the energy from the sun into direct current.Photovoltaic technology in recent years has stood out among energy sources within the renewable matrix (REN21, 2012).
Photovoltaic generation systems can be formed in two ways: generators connected to the local transmission grid (grid-tied) and isolated grid generators (off-grid), the latter being often used in places where the transmission grid is inaccessible or for reasons of technical and/or financial feasibility.Figure 6.

Source: On
The main radiation)

Inverte
The invert voltage.Th specific in The funct application energy into In general that they d Batteries with more modern technologies such as nickel cadmium (NiCd), nickel metal hydride (NiMH), and lithium ion (Li-ion), among others, despite presenting advantages (greater efficiency, longer service life, and greater discharge depth), are not yet economically feasible in most photovoltaic systems (Vera, 2004).
Among the specifications of a battery, the most frequently used for designing a photovoltaic system are charge rate, open circuit voltage, cut-off voltage, nominal voltage, discharge depth, and working temperature.

Charge controllers
The charge controller (or regulator) increases the efficiency of the photovoltaic system and the service life (number of cycles) of the batteries.A charge controller monitors the voltage of the batteries and protects them from undue overcharging.
The key functions of a charge controller are (BLUESOL, 2016): • Control of the perfect recharge of the battery bank; • Protection against unexpected overcharge; • Protection against excessive discharge; and • Provision of information on the battery bank level.

Protection Diodes
Under certain operating conditions, some or only one of the constituent modules of a photovoltaic panel may undergo shading.As a consequence of the shading, so-called hot spots appear (BLUESOL, 2016).If not diagnosed at the start of the project, these hot spots may permanently damage the entire module.This happens because, when a cell runs out of solar radiation, it may compromise the entire line (because the cells are connected in series) and, instead of generating electricity, the line begins to behave as a charge.
When operating normally, the electrical energy generated by the photovoltaic cells is consumed by the charge that is connected to the module.When shading occurs-for example, due to a dry sheet covering the entire cell-it will be inversely polarized, behaving as a charge.All the energy received is converted into heat.
If the current passing through the cell is high enough, the hot spot will begin forming.The largest current that a cell can receive under these conditions is the short-circuit current (GREENPO, 2004).
To prevent hot spot formation, the current should be diverted from the cells through a bypass diode, which is connected to a set of cells with inverse polarization.Generally, the diodes are connected to groups of 18 or 20 cells, so that a 36-cell module has two diodes and a 72-cell module has 4 diodes (CEPEL-CRESESB, 2014).

HOMER
Homer is the most widely used software for sizing and simulating renewable sources, available for download and free for trial purposes.It is suitable for quick pre-feasibility, optimization and sensitivity analysis in various possible configurations of renewable sources (Sinha & Chandel, 2014).
Homer allows data such as component costs, resource availability, manufactured data, etc., and simulates different configuration systems, generating results ordered by Net Present Value.
The major disadvantage of HOMER is that input variables should be inserted by the user or set as the limits of sensitivity analysis (Zahboune et al., 2016).

HYBRID 2
Hybrid 2 was developed by Renewable Energy Research Laboratories (RERL), from the University of Massachusetts, in the United States, with the support of the National Renewable Energy Laboratory (CEERE, 2016).
It allows for the simulation of systems consisting of up to three different generators, comprising wind turbines, photovoltaic modules, and diesel turbines.
Hybrid 2 uses a probabilistic model to explain the variations of energy generation in renewable systems, performing economic analysis and forecasting the performance of several hybrid systems (Sinha & Chandel, 2014).
A negative point of this software is the limited access to available parameters and the lack of flexibility.On the other hand, it presents a library with several resource data (Sinha & Chandel, 2014).

RETScreen
RETScreen is a feasibility study tool, comprising a free software program for download, developed by the Ministry of Natural Resources of Canada (RETScreen, 2013).The software simultaneously performs financial analysis and the analysis of environmental benefits of different renewable energy sources to anywhere in the world.Este software utiliza linguagem Visual Basic e C como plataforma de trabalho.
The software has a database of more than 6000 ground stations, which includes solar radiation indexes, power resource maps, etc.
The main limitations of RETScreen are to disconsider the effects of temperature for performance analysis of photovoltaic systems, to have no data import function, and to support no advanced calculations (Sinha & Chandel, 2014).

INSEL
The INSEL (Integrated Simulation Environment Language) general-purpose modeling language was developed by the University of Oldenburg, Germany, allowing users to build a structure with the aid of its library and user-specified execution time (INSEL, 2013).This software has its own database of meteorological parameters from almost 2000 locations worldwide.For photovoltaic systems and thermal systems, data on solar radiation, temperature, humidity and wind speed can be generated using this software, based on the average values for a month, for any location and orientation.
This simulation software has the flexibility to generate configurations for the planning and monitoring of electrical and thermal energy systems.

TRNSYS
In 1975, the University of Wisconsin and the University of Colorado (United States) jointly developed a software program for energy system simulation called the Transient Energy Simulation Program (Trnsys) (Wisc, 2013).
Since its inception, Trnsys has undergone changes, currently including photovoltaic systems, solar concentration systems, and other forms of exploitation of thermal generation, which makes it a hybrid simulator.
Trnsys was initially developed for simulation of thermal systems, but it has now included photovoltaic systems, solar concentration systems, as well as other forms of utilization of thermal generation, making it a hybrid simulator.
Trnsys does not provide optimization options, but performs high-precision simulations with graphics and other details (Shandel, 2014).

Development of the FOTODIM Software
The purpose of the calculation tool developed is to size grid-tied and off-grid photovoltaic systems.The development of the computational tool was performed using the MATLAB software (Matrix Laboratory, Mathworks, Inc., version R2013a).
The sizing of photovoltaic systems depends, among other factors, on the climatological characteristics of the place or region where the project is to be carried out.
Grid-tied systems can be designed to meet the total demand of the building or a fraction thereof, as on days with low solar radiation, the chain of the local concessionaire supplies the consumption demanded by the building.
Off-grid systems can also be designed to meet the total demand of the building or a fraction thereof but require storage systems to supply power in periods with low solar radiation rates.Energy storage is usually performed using lead-acid batteries.
The software developed presents a database of equipment that can be used by users for the sizing of the photovoltaic system.The database also includes the average radiation of some municipalities of the State of Paraná, coming from the Brazilian Solarimetric Atlas (Tiba, 2000).The database allows the addition of new equipment and the registration of new locations.
The mathematical model used for photovoltaic design came from the Engineering Manual for Photovoltaic Systems (CEPEL-CRESESB, 2014), Photovoltaic Systems Technology, Design and Installation Manual (GREENPO, 2004), and the Solar System Introduction Digital Book (BLUESOL, 2016).

Survey of Available Solar Resources
The ideal tilt angle of the photovoltaic modules can be determined according to the latitude of the project site, the configuration of the photovoltaic system (grid-tied or off-grid) being a factor that affects the tilt angle calculation method.Thus, it is possible to calculate the tilt angle using only latitude data, using Equation 1 for off-grid systems and Equation 2 for grid-tied systems.
For off-grid systems, a higher tilt angle is recommended, as it ensures greater absorption of solar radiation in the periods close to the winter solstice, according to Equation 2 (BLUESOL, 2016).
Where, β: Panel tilt angle in relation to the horizontal plane (degrees); Φ: Latitude of the site or area (degrees).
For Grid-tie systems, smaller tilt angles provide greater absorption in the periods near the summer solstice, which increases the generation of energy in these periods.In this configuration, due to a potential financial benefit that occurs in tariff offsetting systems, as is the case in Brazil, the use of Equation 2is suggested (BLUESOL, 2016).
In any of the photovoltaic systems (grid-tie or off-grid), it is recommended that tilt angles smaller than 10° are not affected, as the natural cleaning of the modules by atmospheric precipitation can be impaired (BLUESOL, 2016).
In the calculation tool developed, users have the possibility of changing the tilt angle of the modules and the azimuthal deviation of the modules.To correct the position of the modules, it is used Klein's methodology (Klein, 1977).
As energy production is directly related to solar radiation, the accumulated value of solar energy, over a one-day period, can be expressed using the number of Full Sun Hours (FSH), according to Equation 3 (CEPEL -CRESBES, 2014).
This magnitude reflects the number of hours in which the solar radiation, throughout the day, is equivalent to a constant radiation and equal to 1 kW m -2 .

Grid-tied System Design
For the design of the grid-tied photovoltaic generator, the daily average consumption per year of the building (Wh day -1 ) should be raised.This data can be calculated based on the history of monthly electricity bills issued by the local concessionaire.

Photovoltaic Panel
The power of the photovoltaic panel connected to the grid can be calculated by Equation 4(CEPEL-CRESESB, 2014).
Where, P VP : Peak power of the photovoltaic panel (Wp); E: Average annual daily consumption of the building (Wh day -1 ); E tf : Average annual daily consumption referring to the minimum consumption tariff charged by the concessionaire (cost of availability).For 3Ø systems, a monthly minimum value equivalent to 100 kWh month -1 is charged, irrespective of the use.For two-phase systems with three (3) conductors, 50 kWh month -1 is charged, and for single-phase or two-phase systems with two (2) conductors, 30 kWh month -1 is charged; TD: performance rate (dimensionless); FSH AV : annual average of the Full Sun Hours (FSH) incident on the photovoltaic panel plane (h day -1 ).

Voltage Inverter
The inverter sizing factor represents the relation between the nominal power of the inverter and the peak power of the photovoltaic generator, as shown in Equation 5(CEPEL-CRESESB, 2014).
The power of both the photovoltaic panel and the inverter must be adjusted so that the inverter's ISF has the best cost/benefit ratio.The ISF depends on the selected inverter, photovoltaic module technology, orientation and tilt angle of the panel, and environmental conditions such as temperature and local radiation.
(1) Inverter Input Voltage The input voltage of the inverter is the sum of the voltages of the photovoltaic modules associated in series.
Because the voltage is strongly dependent on temperature, the extreme conditions of winter and summer should be used in the design.
The maximum system voltage occurs when the photovoltaic panel is still in open circuit (V OC ) at low temperatures.This can happen during the winter period, even at sunrise, when the system voltage rises based on the low temperature of the photovoltaic panel, and the inverter has not yet connected to the grid due to the low radiation.
During the summer, the temperature of the photovoltaic modules in Brazil can reach values higher than 70°C, resulting in a reduction of the system voltage, due to the negative temperature coefficient.It is thus necessary to assess whether the PV panel has a sufficient number of modules connected in series so that the panel voltage is higher than the minimum voltage of the MPPT (Maximum Power Point Tracker) system of the inverter.If the panel voltage drops below the minimum MPPT voltage of the inverter, its efficiency will be compromised and may cause its disconnection.
Based on these considerations, the number of modules connected in series can be calculated through Equation 6(CEPEL-CRESESB, 2014).
Where, Vi MPPTmin : Minimum operating voltage of the input MPPT of the inverter (V); Vi MPPTmax : Maximum operating voltage of the input MPPT of the inverter (V); V mpTmin : maximum power voltage (V mp ) of a photovoltaic module at the lowest expected operating temperature (V); V mpTmax : maximum power voltage (V mp ) of a photovoltaic module at the highest intended operating temperature (V).
(2) Inverter Input Current The inverter has a maximum continuous input current.To ensure that this value is not exceeded, it is possible to calculate the maximum number of photovoltaic modules connected in parallel using Equation 7(CEPEL-CRESESB, 2014).
No. of modules in parallel = Ii max /I sc (7) Where, Ii max : Maximum input current input to the inverter; I sc : Short-circuit current of the photovoltaic module at the expected temperature.

Sizing of Off-Grid Systems
Off-grid systems were designed according to the critical month method, considering that, based on an energy balance carried out during the year, the critical month is the one with the least favorable average conditions for the system (lower solar radiation with greater use of charges).It is assumed that, if the system works properly during said month, the same will happen for the other months of the year.Therefore, the system will produce more energy than necessary in other months, during which average conditions will be more favorable.

Electricity Demand and Consumption
To start the sizing of an off-grid system, it is necessary to know the demand and the consumption that the PV system will need to meet.The power, quantity and time of use of the equipment must be defined.
The most traditional way to determine the energy consumption of a consumer unit is to add the energy consumed of each device throughout the day (Wh day -1 ).To do this, the user is offered a list of devices with their respective powers, coming from PROCEL (National Electricity Conservation Program).The user can add other equipment to the list or change the existing ones.If the user already has the power demand of the building (kW), based on any other calculation methodologies, this value can be fed directly into the software.

Voltage Inverter
After defining the list of devices that will be part of the building, as well as their maximum power demand (kW), it is possible to size the inverter to be used.
For charges requiring peak power, such as induction motors during startup, it is necessary to be aware of this power, along with its duration, in order to define the surge capacity that the inverter is able to withstand.
The user should set the operating voltage of the system (12, 24, 36 or 48 V DC ), and the rated inverter should have the same input voltage as the system voltage and the output voltage (V AC ), according to the requirements of the charges to be reached, usually 127 V AC or 220 V AC , 60 Hz.

Battery Bank
The total daily energy consumed by the building is initially calculated, using equation 8 (CEPEL-CRESESB, 2014).
Where, L: Total daily energy consumed by the building in a given month (Wh day -1 ); L DC : Energy consumed daily in DC in a given month (Wh day -1 ); L AC : Energy consumed daily in AC in a given month (Wh day -1 ); ɳ bat : Overall battery efficiency (decimal); ɳ inv : Inverter efficiency (decimal).
The capacity of the battery bank is calculated by Equation 9(CEPEL-CRESESB, 2014).
Where, CB C20 : The capacity of the battery bank in Wh for the discharge regime in 20 hours (Wh); N: Number of days of autonomy, typically between 2 and 4 (days); dd: Battery discharge depth (decimal); The number of days of autonomy is the period that the battery bank will meet the independent building of photovoltaic generation.This happens on days of high cloudiness and low rates of solar radiation.
The capacity of the battery, in Ah, is given by Equation 10(CEPEL-CRESESB, 2014).
The number of batteries in parallel is calculated by Equation 11(CEPEL-CRESESB, 2014).
The number of batteries connected in series depends on the nominal voltage of the system and is obtained by Equation 12(CEPEL-CRESESB, 2014).

No. batteries in series =
Where, V bat : Nominal voltage of the battery (V).

Photovoltaic Panel
The power required for the photovoltaic panel is obtained by Equation 13 (CEPEL-CRESESB, 2014).
Where, Red 1 : Reduction factor of the power of the photovoltaic modules, in relation to their nominal value, encompassing the effects of: i) a possible accumulation of dirt on the surface over the time of use; ii) permanent physical degradation; iii) manufacturing tolerance for less than the nominal value; iv) losses due to temperature.Red 1 is assigned a default value of 0.75 (decimal) for c-Si photovoltaic modules; Red 2 : Power reduction factor due to system losses, including wiring, controller, diodes etc.At this value, the value of 0.9 (decimal) is recommended as default.
The determination of the number of modules in series (Equation 14) should consider the system voltage and the maximum power of the modules when operating at the highest temperature for the project site (V mpTmax ).

No. modules PV in series
Where, V mpTmax : Maximum power voltage for the highest expected temperature for the site where the modules are to be installed (V).
The maximum power voltage at the highest (or lowest) predicted temperature is calculated by Equation 15(CEPEL-CRESESB, 2014).m, the rs the jas.ccsenet.

Grid-ti
In this step (Figure 0).

With regar area and t equipment
The last st system, co

Examp
The follow sizing data

Figure
Figure shows a Grid-tie photovoltaic system.

Figure
Figure 2. Off-g Figure 3 sh Figure 7. FO photovoltaic s nted Payback ( system are co Figure 1 Figure 1 photovoltaic sy

Table pre characteris
Table 1.C