The maintenance of an adequate energy supply of a region relies on how its energy grid is composed, taking into account the existence and availability of a set of energy sources. The output of each individual source over a period of time varies, due to the seasonality of the natural sources (hydraulic, wind and solar) or by activating or deactivating thermal generators (from fossil fuels or biofuels) that make the system.
For a given energy demand, verifying how the natural sources available complement each other is a point of interest, because from this complementarity it is possible to assess the need of thermal complementation of the system, an option that is always more expensive and generates more pollution   .
Large interconnected systems must have the energy dispatch established based on regional differences in demand and instantaneous availability of energy. At certain times, the differences between demands and availabilities can be attenuated considering the possible complementarity between the energy resources  .
When considering the design of the energy grid of a region, measuring the complementarity between sources is also useful, even if the sources are not yet installed. This measure can help the decision making for new investments, choosing the more appropriate sources for each region, taking into account the robustness of the energy grid and the operational costs involved, in order to fulfill the expected demand.
The work of Beluco et al.  proposed a way to evaluate the complementarity in time in the same place with the determination of a dimensionless index. Later, this index was crossed with performance information  and allowed to know how the performance of hybrid systems can be directly influenced by the complementarity.
The work of Beluco et al.    established the concept of complementarity in time in the same place as being composed of three components: a partial time-complementarity, anenergy-complementarity and anamplitude-complemen- tarity. The calculation is performed based on average values and minimum and maximum values.
The index proposed by Beluco was applied by Pianezzola  in the preparation of complementary maps1 of wind and solar energy throughout the state of Rio Grande do Sul. Bagatini  also developed complementary maps2 for hydro, wind and solar energy, considering these features two by two, For the State of Rio Grande do Sul. Eifler  applied the Beluco index to evaluate the complementarity of wind and solar energy throughout the Northeast region of Brazil.
Cantão et al.  evaluated the energetic complementarity between water and wind resources along the Brazilian territory, presenting the results through maps of corelation. This work evaluated both the energetic complementarity at the same locationand the emnergetic complementarity considering distinct locations.
This paper proposes an alternative method for calculating time complementarity. This method allows the determination of the complementarity between two or more energy resources. This method also allows the calculation to be performed based on hourly or daily series and not only based on maximum and minimum values.
As an application of the proposed method, a map with the energetic complementarity in time between hydropower, wind energy and solar energy for the Brazilian State of Rio Grande do Sul is presented.
2. Complementarity Index Proposed by Beluco et al. (2008)
Beluco et al.    defined complementarity between renewable energy resources (in particular, solar and hydraulic) as the ability of the sources to work in a complimentary way. They defined a complementary index as shown in Equation (1), where, , are partial indexes measuring complementarity with respect to time, energy and amplitude, respectively.
The time-complementary index is defined as shown in Equation (2), where maximum and minimum availability of hydraulic energy occur, respectively, on Julian day number and (likewise and refer to the same days regarding solar energy). Note that if the differences equal 180, then, so that if the maxima are 180 days apart, and if the maxima coincide.
The energy-complementary index is defined as shown in Equation (3), where the total yearly hydraulic and solar energies are given and, both positive, so that if, and vanishes if tends to zero or infinity (that is, both sources are greatly disproportional).
Finally, the amplitude-complementarity index is given by previously defining the following difference score relating energy values of a given source, as shown in Equation (4), where, and are, respectively, the maximum, minimum and average value for the energy availability for the given source.
The index is defined as shown in Equation (5), where and are the difference scores for hydraulic and solar power, respectively. As it can be readily verified, the two piecewise expressions for are reciprocals of one another.
Note that all three partial indexes are defined for two sources only and are based in a few parameters, like maxima and minima and the points in time where they occur. On this work, we give a new definition of the complementarity index that takes into account the whole behavior of each source, as well as allowing for any number of sources.
3. A Complementarity Index for More than Two Energy Resources
Suppose that are nonnegative functions defined in that describe the rate of availability of energy (that is, power) in a region along a certain time interval; so is the total generated power. So the average power is defined by Equation (6).
Note that the integral is the total energy provided in the period, and it is equal to. The contribution of each individual source may vary over time, but if the total energy provided by the combination of the sources is constant, then those sources are said to have perfect complementarity.
The area between and the function with constant value value represents a energy gap, so the area below the minimum of the two curves may be seen as a measure of how far below average is this power. Thus, we define the complementarity index as shown in Equation (7). This formula can be interpreted as the ratio between the generated energy, discarding excess (above average) power, and the overall generate energy.
As all values involved are nonnegative, and because the integral is limited by, we have. The bounds are tight; the upper bound is attained by any combination of functions with constant sum; for the lower bound, for any, let for and 0; a simple calculation show that.
This formulation of the index as a definite integral allows for the use of discrete series of data, without the need of regression. For example, if we consider
4. Two Examples of Application of the Proposed Index
In this section, we illustrate the calculation of under this new definition on two special cases involving two sources. In the first example, we have two sinusoidal curves of period equal to 1. In the second, we have two step functions, also with period 1. Note that, under the previous definition  , it is not clear how to proceed in the second case, as the Julian day numbers where the maxima or minima occur are not unique.
Let and, that is, two sinusoidal curves with period 1 with a phase difference equal to
Otherwise, there will be a gap between and the average power, as seen for instance in Figure 1. As goes down towards 0 or up towards 1, this gap increases. Figure 1 illustrates the case where. The value of the index () corresponds to the area below the thick line. The gap is the area between the thick line and the dashed line.
Now we deduce an expression for this special case as a function of the phase constant. Using the classical relation to, we get Equation (9).
For, we have if. So the gap is given
Figure 1. Graph of f (in red line), g (in blue line), p (in thinner black line) and k (in thicker black line) for d = 0.25.
by Equation (10). The calculation for is analogous by symmetry.
Therefore, Equation (11), which minimum value is
. Figure 2 illustrates the calculation of.
This example shows how easy it is to extend this new concept of complementarity to a case with three energy resources. It would suffice to include in this reasoning a third sine function. Obviously a case more complex and with more breaks in analysis, but still simple to be understood.
Let and, both with period 1 with a phase difference d. Note that if (almost everywhere) and 0 otherwise. Again, the complementarity is perfect if, and get worse as goes to 0 or 1.
Figure 3 illustrates the case where. For, we can write as shown in Equation (12), so that the gap height is equal to 1 if and equal to 0 otherwise.
Figure 2. Graph of f (in red line), g (in blue line), p (in thinner black line) and k (in thicker black line) for d = 0.00.
Figure 3. Graph of f, g (step functions) and p for d = 0.25.
Therefore, the gap is calculated with Equation (13).
The calculation for is analogous, by symmetry. Therefore, Equation (14), which minimum value is.
5. A Complementarity Map Drawn up with the Proposed Index
This section describes the method for determination of cmoplementarity and presents a map containing values of the complementarity index for three energy resources throughout the State of Rio Grande do Sul, the southernmost state of Brazil. The three resources considered were hydropower, wind and solar energy. Figure 4 shows this map.
Hydrological flow data were obtained from the HydroWeb website  , maintained by the Brazilian National Water Agency. Daily flow data of 14 fluviometric stations throughout the State, in Bagé, Bento Gonçalves, Bom Jesus,Caxias do Sul, Cruz Alta, Encruzilhada do Sul, Iraí, Lagoa Vermelha, Pelotas, Porto Alegre, Rio Grande, Santa Maria, São Luiz Gonzaga and Uruguaiana, were obtained.
Figure 4. Energetic complementarity in time for hydro, wind and solar energy resources along the State of Rio Grande do Sul, the southernmost state of Brazil.
Wind speed data were obtained from the BDMER  site, maintained by INMET. The solar radiation data were obtained using the software Homer    , in a database of NASA. Time series of wind velocity and solar radiation were obtained for the same locations of the flow series.
The data were manipulated as suggested by Beluco et al.  and the values of the time-complementarity index given by Equation (8), were calculated for the fourteen municipalities for which the data series were obtained. A map was elaborated to know the distribution of this index throughout the State of Rio Grande do Sul.
The map shows better complementarity in time results among the three energy resources cited in the Northeastern region, and also a reasonable complementarity in the South. The central region of the State, as well as the region to the west, presents intermediate values of energetic complementarity in time.
This paper presented a new method for calculating energy complementarity over time which has advantages over previous methods. The proposed method allows determining the complementarity between two energy resources and also allows determinig complementarity between more than two energy resources. In addition, the proposed method still allows the use of hourly or daily series and not only average values and maximum or minimum values.
As an application of the proposed method, a map indicating the energetic complementarity in time between hydro, wind and solar energy throughout the State of Rio Grande do Sul, the southernmost state of Brazil, was built. This map shows that the northeast part of the State presents better complementarity and that the central and western regions present intermediate values of complementarities.
The authors would like to thank the support of the Institute of Mathematics of UFRGS for projects and research activities related to renewable energy resources. The authors also thank the environmental engineer Marcos Bagatini and Professor Alfonso Risso for the support to elaborate the map presented in Figure 4.
*Results were partially presented inCongresso de Matemática Aplicada e Computacional do Sudeste, 2015.
1This work of Pianezzola resulted in a paper published in this Special Issue on Energetic Complementarity.
2This work of Bagatini also resulted in a paper published in this Special Issue on Energetic Complementarity.
 Denault, M., Dupuis, D. and Couture-Cardinal, S. (2009) Complementarity of Wind and Hydro Power: Improving the Risk Profile of Energy Inflows. Energy Policy, 37, 5376-5384.
 Delucchi, M.A. and Jacobson, M.Z. (2011) Providing All Global Energy with Wind, Water, and Solar Power, Part II: Reliability, System and Transmission Costs, and Policies. Energy Policy, 39, 1170-1190.
 Yang, J., Zhang, N., Kang, C., Xia, Q., Miao, M. and Tian, X. (2016) Assessing the Dis-patch Flexibility of Coordinated Solar and Hydro Generation. Power and Energy Society General meeting (PESGM’2016).
 Beluco, A., Kroeff, P.K. and Krenzinger, A. (2008) A Dimensionless Index Evaluating the Time Complementarity between Solar and Hydraulic Energies. Renewable Energy, 33, 2157-2165.
 Beluco, A., Kroeff, P.K. and Krenzinger, A. (2012) A Method to Evaluate the Effect of Complementarity in Time between Hydro and Solar Energy on the Performance of Hybrid Hydro PV Generating Plants. Renewable Energy, 45, 24-30.
 Beluco, A., Souza, P.K., Livi, F.P. and Caux, J. (2015) Energetic Complementarity with Hydropower and the Possibility of Storage in Batteries and Water Reservoirs. In: Sørensen, B., Ed., Solar Energy Storage, Academic Press, London, 155-188.
 Pianezzola, G. (2006) Complementarity Maps of Solar and Wind Energy Resources in the State of Rio Grande do Sul. Master Dissertation, Mechanical Engineering, Universidade Federal do Rio Grande do Sul, 96 p. [In Portuguese]
 Bagatini, M. (2006) Study on the Complementarity in Time between Hydropower, Wind and Solar Photovoltaic Energy Maps in the State of Rio Grande do Sul. Graduationwork, Environmental Engineering, Universidade Federal do Rio Grande do Sul, 112 p. [In Portuguese]
 Eifler Neto, E., Risso, A. and Beluco, A. (2014) Complementarity in Time between Wind and Water Resources in Northeastern Brazil. International Journal of Environmental Engineering and natural Resources, 1, 13-18.
 Cantao, M.P., Bessa, M.R., Bettega, R., Detzel, D.H.M. and Lima, J.M. (2017) Evaluation of Hydro Wind Complementarity in the Brazilian Territory by Means of Correlation Maps. Renewable Energy, 101, 1215-1225.
 HidroWeb, Hydrological Information System, Maintained by National Water Agenty (Agência Nacioanl de águas, ANA), Brazil.
 BDMEP (Banco de Dados meteorológicos para Ensino e Pesquisa), Meteorological Data-base for Teaching and Research.
 Software HOMER, Legacy Version, The Micropower Optimization Model, Homer Energy.
 Lambert, G.T.W., Gilman, P. and Lilienthal, P.D. (2005) Micropower System Modeling with Homer. In: Farret, F.A. and Simoes, M.G., Eds., Integration of Alternative Sources of Energy, John Wiley & Sons, 379-418.
 Lilienthal, P.D., Lambert, T.W. and Gilman, P. (2004) Computer Modeling of Renewable Power Systems. In: Cleveland, C.J., Ed., Encyclopedia of Energy, Vol. 1, Elsevier, NREL Report CH-710-36771, Amsterdam, 633-647.