Demand Response Optimization Model to Energy and Power Expenses Analysis and Contract Revision

: This paper proposes a mathematical model based on mixed integer linear programming (MILP). This model aids the decision-making process in local generation use and demand response application to power demand contract adequacy by Brazilian consumers / prosumers. Electric energy billing in Brazil has some speciﬁcities which make it di ﬃ cult to consider the choice of the tari ﬀ modality, the determination of the optimal contracted demand value, and demand response actions. In order to bridge this gap, the model considers local generation connected to the grid (distributed generation) and establishes an optimized solution indicating power energy contract aspects and the potential reduction in expenses for the next billing period (12 months). Di ﬀ erent alternative sources already available or of interest to the consumer can be considered. The proposed mathematical model conﬁgures an optimization tool for the feasibility analysis of local generation use and, concomitantly, (i) checking the tari ﬀ modality, (ii) revising the demand contract, and (iii) suggesting demand response actions. The presented result shows a signiﬁcant reduction in the energy and power expenses, which conﬁrms the usefulness of this proposal. In the end, the optimized answers promote beneﬁts for both, the consumer / prosumer and the electric utility.


Introduction
Electricity is a fundamental input for the development of society and a recurrent governmental concern in several countries is to ensure an adequate energy supply.The projections for generation and consumption presented by research agencies indicate that the energy supply may not be enough to meet demand without generation system expansion [1,2].Thus, adding alternative sources (distributed generation) to the energy grid and performing a rational energy use management are worldwide strategic objectives [3].
At the end of the 1970s, the concept of demand side management (DSM) was introduced in the USA as a way of trying to guarantee an adequate supply of electricity [4].The electricity utility acted directly on consumers, switching loads on/off, according to the need.This switching occurred either during peak consumption hours (e.g., from 6:00 p.m. to 9:00 p.m.) or at peak demand times.
In a complementary way to DSM, the prosumer (a consumer who also produce its own energy) can also aid to attenuate peak demand in the electrical system through the technique known as demand response (DR) [5,6].In DR, a (bio)diesel generator set, for example, can be used to supply the consumption during on-peak hours [7].If the cost of diesel generation (fuel plus maintenance) is less

Introduction to the Cluster of Articles and Contributions of this Paper
The energy contract determination and the viable use of demand response (DR) policies are important aspects tied to the overall energy costs of consumers.Each cited aspect is a problem to be investigated and solved as discussed hereafter.
According to Chen and Liao [11], the electricity contract determination is a frequent problem faced by industrial customers.The authors propose a solution procedure based on a linear programming model, which seeks a globally optimal solution for contract determination.The proposed model uses less computation time when compared to a meta-heuristic approach.
The authors Ding et al. [12] propose a demand response (DR) model for industrial installations management using mixed integer linear programming (MILP).Tasks are divided into schedulable and non-schedulable ones, and distributed generation resources are used to implement DR actions.Based on the energy price, the model determines the scheduling of tasks to change the demand from peak periods (high cost from utility's electricity) to off-peak periods (with lower cost).The proposed scheduling not only reduces energy costs for consumer units, but also improves the utility grid reliability.
According to Gholian et al. [13], while most household appliances operate independently, industrial units are highly interdependent and must follow certain operational sequences, which can take several days, involving several batch cycles.The authors developed a mixed integer linear programming model which, in addition to controlling a group of loads, also considers the use of local renewable energy generation and energy storage.
In a complementary view to Gholian et al. [13], the work presented by Lindberg et al. [14] analyzed the potential and limitations for using demand side management in 15 industries in Sweden, in different areas such as cellulose and paper, cement, steel, refrigeration, and refineries.A common limitation presented is that most processes work better if they are executed at constant speed (in a sequential system) and without stops.As a conclusion, the authors presented that DSM could be scarcely used.The application potential was less than they expected, and its effective application could be not easy.The authors pointed out that alternative policies that allow the studied industrial systems to work without constraints in electrical supply can be of great value.
An alternative to decrease the energy consumption from utility during peak hours is the use of local power generation (distributed generation).According to Martins et al. [15], diesel generator sets traditionally used for power generation in stand-by mode, can be used in parallel with the grid to meet the consumer's demand during peak hours.This operation, known as peak shaving, reduces expenses for the consumer (if diesel generation has a lower cost than the utility energy cost) and helps to reduce the system overload in times of greater demand.

Paper Novelty
In Brazil, as will be detailed in Section 2, the determination of the contract details has some singular aspects: different tariff modalities can be chosen, tariff flags are charged according to the hydroelectric reservoirs' levels, and some other concerns must be taken into account when negotiating the demand contract with the electricity utility [10,16].Thus, electric energy billing in Brazil has some specificities, which makes it complex to consider, at the same time, the following factors: (a) choice of the tariff modality, (b) determination of the optimal contracted demand value, and (c) the implementation of demand response actions, that is, the use of power generation from alternative sources to reduce both electricity consumption and power demand during specific hours.
The cluster of the above-mentioned articles corroborates that the contract determination and the choice of adequate demand response (DR) policies are issues to be considered within the consumer energy costs.In a complementary manner, as mentioned, the Brazilian electrical system has some billing singularities, another complicating issue for the decision-making process involving local generation use and demand response application to power demand contract adequacy by consumers/prosumers.To the best knowledge of the authors, no paper considers all these issues in a single integrated solution approach.In order to bridge that gap, this paper presents a solution approach based on a mathematical optimization model in mixed integer linear programming (MILP) to aid the decision-making process.The referred model, presented in Section 3, establishes an optimized answer that determines, at the same time: (i) the best tariff modality, (ii) the optimal value for the demand contract, and (iii) the best hours during the day to use each alternative source (scheduling of sources usage).

Paper Organization
The content of this paper is organized as follows.Section 2 presents the problem definition and the Brazilian tariff system characteristics.Section 3 presents modeling assumptions and the mathematical model, which is developed in mixed integer linear programming (MILP).Section 4 describes the evaluated scenarios and presents numerical results.Section 5 discusses and compares the results of the nine evaluated scenarios.Section 6 presents the concluding remarks and highlights topics for future developments.

Brazilian Tariff System
According to the Brazilian Electricity Regulatory Agency [10], consumers are classified into two groups, A and B. In B group, consumer units are powered at low voltage (less than 2.3 kV), and for these units it is only necessary to pay for the electricity consumption in kilowatt-hours (kWh).For A group, consumer units are powered at high voltage (equal to or greater than 2.3 kV) and there are different tariffs applied to both: for the electricity consumption (kWh) and the power demand (kW).
The tariffs applied to A group differ in value according to on-peak and off-peak hours.The on-peak represents the period consisting of 3 consecutive daily hours, usually between 6 p.m. and 9 p.m., defined by the local utility, which takes into account its electrical system load curve.The off-peak represents all other day hours [10].
For A group consumers, 2 tariff types are available: green or blue.For the green tariff, different electricity consumption tariffs are applied for on-peak and off-peak hours, and a single tariff for power demand (for all daily records).For the blue tariff, differentiated tariffs for on-peak and off-peak hours are applied to both, the electricity consumption and the power demand.
The current tariff values [17], in monetary units per kilowatt-hour ($/kWh), for the green and blue modalities (powered from 2.3 kV to 25 kV) are shown in Table 1.
In Brazil, 66.6% of electricity is generated by hydroelectric plants [18].Thermoelectric plants are used to guarantee supply in drought periods, even at relative higher generation costs, with respect to hydroelectric.For this reason, the Brazilian Electricity Regulatory Agency applies the tariff flag system [16].Its purpose is to promote a temporary (monthly) correction in tariff values if higher cost power plants are used for power generation.
In the tariff flags system, three flags are considered: (i) green flag, when the conditions for energy generation are favorable, and there is no additional value charged, (ii) yellow flag, in less favorable conditions, the value of $0.015 is added for each kWh consumed, and (iii) red flag, for unfavorable generation conditions, where level 1 condition increases the tariff value by $0.040 per kWh, and level 2 increases $0.060 for each kWh.In 2018, the red flag (level 2) occurred from June to October, the yellow flag application occurred in May and November, and the green flag was considered in the other months.
Therefore, in addition to the tariff values shown in Table 1, the application of tariff flags can increase the value of the electricity bill.Thus, in the context of forecasting energy consumption and related expenses, it is relevant to consider both the annual tariff readjustment and the tariff flags application.

Demand Contract
The contracted demand (CD) is the active power demand (in kilowatts, kW) to be mandatorily and continuously made available by the electricity utility.The consumer must pay the full amount contracted, even if it is not used.The consumer can suffer a payment penalty in case of exceeding the tolerance value over the contracted demand [10].
The demand is registered on the consumer energy meter every 15 min, and it represents the active electrical power average supplied from the electrical power system to the installed load in operation [10].Thus, during a month period, there will be approximately 2880 demand records, and the highest value will be considered as the measured demand (MD).
In accordance with Brazilian Electricity Regulatory Agency [10], when the amount of measured demand (MD) exceeds the contracted demand (CD) by more than 5% (five percent), an overtaken tax must be added to the consumer invoice.The exceeded demand (ED) tariff is twice the demand tariff value [10].
From the measured demand value, three criteria are used to obtain the invoiced demand (for each month), which must be paid under the application of the respective tariffs [10].
According to the first criterion, when the measured demand (MD) is less than the contracted demand (CD), the CD in full must be paid.There is no exceeded demand.

2.
According to the second criterion, when the measured demand (MD) value is between the contracted demand (CD) and the 5% tolerance limit (LD), the MD oneself must be paid.There is no exceeded demand.

3.
According to the third criterion, if the measured demand (MD) is greater than the demand limit (LD), the MD must be paid plus the exceeded demand (ED).The ED value, in this condition, is obtained by subtracting CD from MD.It should be noted that these three criteria presented in Table 2 must be applied to determine the invoiced demand and exceeded demand (if it happens) from the measured demand values of every month during the year.

Demand Side Management/Demand Response
From the utility need to ensure an adequate power supply, it is observed that demand side management (DSM) actions are relevant [19,20].The peak shaving strategy, illustrated in the load curve in Figure 1a, is generally used to reduce power demand during on-peak hours.The electric utility may apply this strategy to directly control (disconnect) consumer's loads.However, for many consumers the peak shaving technique is unfeasible or highly undesirable [14].In the demand response (DR) context, alternative power sources (local generation) are used in both cases: when the utility's tariff is relatively more expensive, and to decrease demand values during specific hours, providing an alternative to peak shaving.
In Figure 1b a load curve with a DSM concept called strategic conservation is illustrated [19,20].In this case, there is an overall reduction in power consumption during all day, which may happen by both using the energy efficiency concepts [21], or the uninterrupted use of alternative sources (local generation), such as a small hydroelectric or a biogas power plant [22].
There is a potential reduction in expenses by using intermittent sources (such as photovoltaic or wind), whose generation costs (also considering maintenance) tend to be less than utility tariffs.In the case of agro-industries, biogas from biomass could be used.Thus, the use of either DSM or DR actions can be recommended, but its usage must be carefully analyzed in conjunction with other operational characteristics, e.g., the availability of alternative sources for the critical consumption periods.From the utility need to ensure an adequate power supply, it is observed that demand side management (DSM) actions are relevant [19,20].The peak shaving strategy, illustrated in the load curve in Figure 1a, is generally used to reduce power demand during on-peak hours.The electric utility may apply this strategy to directly control (disconnect) consumer's loads.However, for many consumers the peak shaving technique is unfeasible or highly undesirable [14].In the demand response (DR) context, alternative power sources (local generation) are used in both cases: when the utility's tariff is relatively more expensive, and to decrease demand values during specific hours, providing an alternative to peak shaving.
In Figure 1b a load curve with a DSM concept called strategic conservation is illustrated [19,20].In this case, there is an overall reduction in power consumption during all day, which may happen by both using the energy efficiency concepts [21], or the uninterrupted use of alternative sources (local generation), such as a small hydroelectric or a biogas power plant [22].
There is a potential reduction in expenses by using intermittent sources (such as photovoltaic or wind), whose generation costs (also considering maintenance) tend to be less than utility tariffs.In the case of agro-industries, biogas from biomass could be used.Thus, the use of either DSM or DR actions can be recommended, but its usage must be carefully analyzed in conjunction with other operational characteristics, e.g., the availability of alternative sources for the critical consumption periods.

Mathematical Model
The proposed mathematical optimization model is developed in mixed integer linear programming (MILP).Section 3.1 presents the main modeling considerations.In Section 3.2, the model objective function is explained, and in Section 3.3 the involved constraints are described.The used nomenclature is presented at the end of this article.This nomenclature details the indexes, sets, parameters, and variables used in the MILP formulation.

Modeling Considerations
One of the objectives of the developed mathematical model is to verify the possibility of reducing the highest registered value by the utility for each month (measured demand values).For this to be possible, it is necessary to analyze all the demand registers during each month.For instance, with access to the Virtual Agency, through the website of the local electricity utility [23], consumers located in the state of Paraná (Brazil) have access to all the demand values recorded every 15 min in the last 2 years.The example in Figure 2a presents the graph with the 2688 demand records for February 2018.

Mathematical Model
The proposed mathematical optimization model is developed in mixed integer linear programming (MILP).Section 3.1 presents the main modeling considerations.In Section 3.2, the model objective function is explained, and in Section 3.3 the involved constraints are described.The used nomenclature is presented at the end of this article.This nomenclature details the indexes, sets, parameters, and variables used in the MILP formulation.

Modeling Considerations
One of the objectives of the developed mathematical model is to verify the possibility of reducing the highest registered value by the utility for each month (measured demand values).For this to be possible, it is necessary to analyze all the demand registers during each month.For instance, with access to the Virtual Agency, through the website of the local electricity utility [23], consumers located in the state of Paraná (Brazil) have access to all the demand values recorded every 15 min in the last 2 years.The example in Figure 2a presents the graph with the 2688 demand records for February 2018.As shown in Section 2.2, the measured demand value (which is considered for billing purposes) is the highest among these 2688 recorded values.For the monthly records example presented in Figure 2a, it occurred on 6th February.Figure 2b highlights the graph for 6th February, with a demand record every 15 min.
The developed model does not consider the disconnection of electrical loads, but the use of local energy generation when the demand peaks occur, a strategy related to the demand response.Therefore, with the use of parameters from daily charts, the model aims to indicate when it is feasible to use its local generation (alternative sources such as diesel or biodiesel generator set) to reduce demand peaks, according to the need.The result of this peak shaving strategy is that the measured demand will be reduced and, consequently, the optimal value for the demand contract can be recalculated.
In Figure 2b, the graph represents the registered demand values for the exact day on which the higher registers occur.To obtain the hourly values, the four records of each hour were grouped and the highest value was considered.Figure 3a shows an example of hourly demand records (from 0:00 a.m. to 3:00 p.m.) of January 2018.The Measured Demand is 224 kW and occurred on the 29th at 14:00 pm.The largest hourly demand records are represented with a red background in Figure 3.These records do not necessarily occur at the same day.From the identification of the highest values for each hour (from 0 h to 23 h), for each month (from January to December), the hourly demand registered (HDR) values used by the mathematical model are identified, as illustrated in Figure 3b.

Objective Function
The objective function, presented in Equation (1) aims to minimize the total amount of expenses with electricity consumption (Factor 1) at peak (cPK) and off-peak (cOP) hours, as well as the amount spent on invoiced demand (Factor 2) and on exceeded demand (Factor 3) for the considered period, in months (m).It should be noted that, when using blue tariff, two demand values are considered, one for peak period (dPK) and another for off-peak (dOP), as well as exceeded values for both periods (ePK and eOP).For the green tariff, just one invoiced demand value (dDay) and one exceeded demand value (eDay) are considered during the day.As shown in Section 2.2, the measured demand value (which is considered for billing purposes) is the highest among these 2688 recorded values.For the monthly records example presented in Figure 2a, it occurred on 6th February.Figure 2b highlights the graph for 6th February, with a demand record every 15 min.
The developed model does not consider the disconnection of electrical loads, but the use of local energy generation when the demand peaks occur, a strategy related to the demand response.Therefore, with the use of parameters from daily charts, the model aims to indicate when it is feasible to use its local generation (alternative sources such as diesel or biodiesel generator set) to reduce demand peaks, according to the need.The result of this peak shaving strategy is that the measured demand will be reduced and, consequently, the optimal value for the demand contract can be recalculated.
In Figure 2b, the graph represents the registered demand values for the exact day on which the higher registers occur.To obtain the hourly values, the four records of each hour were grouped and the highest value was considered.Figure 3a shows an example of hourly demand records (from 0:00 a.m. to 3:00 p.m.) of January 2018.The Measured Demand is 224 kW and occurred on the 29th at 14:00 pm.The largest hourly demand records are represented with a red background in Figure 3.These records do not necessarily occur at the same day.From the identification of the highest values for each hour (from 0 h to 23 h), for each month (from January to December), the hourly demand registered (HDR) values used by the mathematical model are identified, as illustrated in Figure 3b.As shown in Section 2.2, the measured demand value (which is considered for billing purposes) is the highest among these 2688 recorded values.For the monthly records example presented in Figure 2a, it occurred on 6th February.Figure 2b highlights the graph for 6th February, with a demand record every 15 min.
The developed model does not consider the disconnection of electrical loads, but the use of local energy generation when the demand peaks occur, a strategy related to the demand response.Therefore, with the use of parameters from daily charts, the model aims to indicate when it is feasible to use its local generation (alternative sources such as diesel or biodiesel generator set) to reduce demand peaks, according to the need.The result of this peak shaving strategy is that the measured demand will be reduced and, consequently, the optimal value for the demand contract can be recalculated.
In Figure 2b, the graph represents the registered demand values for the exact day on which the higher registers occur.To obtain the hourly values, the four records of each hour were grouped and the highest value was considered.Figure 3a shows an example of hourly demand records (from 0:00 a.m. to 3:00 p.m.) of January 2018.The Measured Demand is 224 kW and occurred on the 29th at 14:00 pm.The largest hourly demand records are represented with a red background in Figure 3.These records do not necessarily occur at the same day.From the identification of the highest values for each hour (from 0 h to 23 h), for each month (from January to December), the hourly demand registered (HDR) values used by the mathematical model are identified, as illustrated in Figure 3b.

Objective Function
The objective function, presented in Equation (1) aims to minimize the total amount of expenses with electricity consumption (Factor 1) at peak (cPK) and off-peak (cOP) hours, as well as the amount spent on invoiced demand (Factor 2) and on exceeded demand (Factor 3) for the considered period, in months (m).It should be noted that, when using blue tariff, two demand values are considered, one for peak period (dPK) and another for off-peak (dOP), as well as exceeded values for both periods (ePK and eOP).For the green tariff, just one invoiced demand value (dDay) and one exceeded demand value (eDay) are considered during the day.

Objective Function
The objective function, presented in Equation (1) aims to minimize the total amount of expenses with electricity consumption (Factor 1) at peak (cPK) and off-peak (cOP) hours, as well as the amount spent on invoiced demand (Factor 2) and on exceeded demand (Factor 3) for the considered period, in months (m).It should be noted that, when using blue tariff, two demand values are considered, one for peak period (dPK) and another for off-peak (dOP), as well as exceeded values for both periods (ePK and eOP).For the green tariff, just one invoiced demand value (dDay) and one exceeded demand value (eDay) are considered during the day.(1)

Constraints
As indicated in the objective function, there are variables referring to the electricity consumption (cPKm and cOPm) and variables related to invoiced demand (ex.dPKm) and exceeded demand (ex.ePKm).The constraints are organized in two subsections: the first groups consumption constraints and the second demand ones.

Consumption Constraints
For each hour (h) in each month (m) that the binary variable representing the alternative source (a) use (uAS) is zero, the hourly generation variable of the alternative source (hgAS, continuous variable) will also be zero, observed in Implication (2).For each hour (h) in which the binary variable for the use of the alternative source (uAS) is equal to 1 (one), the value of the demand met by the alternative source (dAS) is attributed to the variable representing the hourly generation (hgAS) for each alternative source (a), for each month (m), as shown by Implication (3).
It is emphasized that the referred implications (⇒) involving binary variables (in the implication antecedent) and continuous variables (in the implication consequent) can be transformed into algebraic inequalities, as detailed by Magatão [24].
Taking into account the development of a model that meets the characteristics of different sources available to the consumer, it was considered that an alternative source could have a maximum limit of daily power generation.For example, a diesel (or biodiesel) generator set could be limited by the fuel tank storage capacity.Thus, Inequality (4) is responsible for ensuring that the sum of hourly generation (hgAS) of each alternative source (a) is less than the maximum daily generation capacity (maxAS) parameter.
Equation ( 5) is used to determine the amount of monthly power generated (enAS) from the hourly generation (hgAS) of each alternative source (a), multiplied by the number of Days in each month (m).For on-peak hours (hc = 1), the hourly generation (hgAS) is added for each hour (h) that is between the start (sPK) and (∧) the end (ePK) of peak time.Equation ( 6) is used for the amount of electric energy generated by each alternative source (enAS) during off-peak hours (hc = 2).6) Implications ( 7) and (8) determine the use or not of intermittent sources for the entire period of analysis.When the binary variable that represents the intermittent source use (uIS) is 0, the energy of the intermittent source (enIS) will be zero.When the binary variable is 1, the value for the energy variable generated by the intermittent source will be the same as the monthly generation (mgIS) of each source (i) for peak and off-peak hours (hc).
Equation ( 9) is used to group the amount of electricity generated by each alternative source (enAS) into a variable that considers the energy of all generation from alternative sources (enAG) for each month (m) at each consumption hour (hc).In Equation (10), the sum of the energy supplied by each intermittent source (enIS) is added in a variable that represents the total energy of the intermittent generation (enIG) for each month (m) at each consumption time (hc).Equation ( 11) is used to sum the energy supplied by alternative generation (enAG) and by intermittent sources generation (enIG).In this way, the total energy generated in the month (enTMG) for each month (m) at peak (hc = 1) and off-peak (hc = 2) times will be determined.
Implication (12) indicates that, when the energy consumption is greater than the total energy generated in the month (enTMG) by the consumer, it will be necessary to use energy from the electric utility (enEU), which is the difference between the energy consumption and total energy generated in the month (enTMG).In this case, there will be no surplus energy (enS) that could be injected into the grid.If the consumption (Cons) is less than the enTMG, there will be energy injected into the grid, as indicated by Restriction (13).
Energies 2020, 13, 2803 9 of 23 Restriction (14) refers to the choice of using the Blue (tm = 1) or Green (tm = 2) tariff modality.The Tariff binary variable (Tariff ) can take the value 1 only for one of the tariff modality options.Thus, the model has to choose the best tariff modality for the system.
Implication (15) indicates that, according to the defined tariff modality (tm), the cost related to the use of energy by the electricity utility (cEU) is equal to the energy consumed (enEU) multiplied by the utility's electricity tariff (taEU).This cost is considered to each month (m) for each consumption hour (hc).
Equations ( 16) and ( 17) are used, respectively, to obtain the value of the alternative power generation cost (cAG) and the cost of intermittent generation (cIG).The energy produced by each source (enAS or enIS) is multiplied by the effective generation cost (cAS or cIS) for peak and off-peak hours (hc).The total monthly power generation cost (cTMG) is the sum of the costs of cAG and cIG, for each month (m) and consumption time (hc), as shown in Equation (18).
Equation ( 19) determines the energy credit (EC) value, when the surplus energy (enS) generated by the consumer is injected into the grid.For billing purposes, each kWh will be multiplied by the parameter referring to the sale value of the surplus energy (vS).
The amount of monthly expenses ($) on electricity consumption will be the amount paid for the energy consumed from the utility (cEU), plus the total monthly generation cost (cTMG) for local generation sources, minus the Energy Credit (EC) obtained with the surplus energy.Expenses on consumption during peak hours (cPK) are obtained when hc = 1, and for off-peak hours (cOP) when hc = 2, as shown in Equations ( 20) and (21).

Demand Constraints
For each time (h), in each month (m) that the binary variable representing the use of the alternative source (uAS) is zero, the demand variable of the alternative source (dAS) will be zero, as seen in Implication (22).For each hour (h) in which the binary variable uAS is equal to 1, the variable dAS will be less than or equal to the generation power of the alternative source (pgAS), according to each alternative source (a), for each month (m), as indicated by Implication (23).
Energies 2020, 13, 2803 10 of 23 Equation (24) indicates that the total power demand that can be met with local generation (dGen) at each hour of the day (h), for each month (m) is bounded by the sum of fulfilled demands (dAS) by each alternative source (a).
From the definition of which alternative source (a) will be used in each hour of each month, the demand supplied by the alternative generation (dGen) is subtracted from the hourly demand registered (HDR).Thus, the value of the decreased hourly demand (DHD) is obtained for each hour (h) in each month (m), according to Equation (25).
According to Table 2, for peak hours (hd = 1) the measured demand (MD) will be the highest value of the new decreased hourly demand (DHD) between the start (sPK) and end (ePK) of peak hours, as it can be seen in Restriction (26).The MD for off-peak hours (hd = 2) is the highest value of the DHD recorded between off-peak hours, according to Restriction (27).When the green tariff is used, there is only one measured demand value (MD), equivalent to the highest value of the DHD recorded during all hours (h) of the day (hd = 3), as indicated in Restriction (28).
The limit demand (LD), calculated by Equation (29), is the contracted demand (CD) value multiplied by the 5% tolerance value (Tol), and must be calculated for the three considered periods (hd): on-peak, off-peak, and all-day hours.
The mathematical model will indicate the best value for the contracted demand (CD).However, the CD value should not be greater than the highest value recorded for the measured demand.Therefore, the Restriction (30) is used to bound that the CD for each hd period is less than or equal to the maximum measure demand (MDmax) for each hd.
According to Table 2, from the measured demand (MD) values, for all months (m) and demand period (hd), there are 3 criteria for determining the value of each Invoiced Demand (ID).When the MD is less than or equal to the contracted demand (CD), the ID is equal to the Contracted Demand and there is no charge for the exceeded demand (ED), as shown in Restriction (31).When the measured demand (MD) is between the contracted (CD) and the limit demand (LD), the invoiced demand (ID) is the measured demand itself, as indicated by Restriction (32).
By criteria 1 and 2 of Table 2, formulated in Restrictions (31) and (32), there is no charge for exceeded demand (ED = 0).However, in criterion 3, formulated in Restriction (33), the exceeded demand is equivalent to the measured demand (MD) minus the contracted demand (CD).
When the tariff variable (Tariff ) indicates the use of the blue tariff modality (tm = 1), peak and off-peak demand values are considered.With the use of Restriction (34) and the application of tariffs (taD and taE), the demand (dPK) and the exceeded (ePK) values for peak hours (hd = 1) are obtained, for each month (m).By the Restriction (35), the demand (dOP) and exceeded (eOP) values for off-peak (hd = 2) are obtained.
When the tariff variable indicates the green tariff modality use (tm = 2), a single period is considered (hd = 3), and the invoiced demand (dDay) and exceeded demand (eDay) are determined according to Restriction (36).
Therefore, Expressions ( 1)-( 36) present the developed mathematical model.Numerical results obtained with the developed model for different scenarios are presented in Section 4.

Results
The aim of this section is to present the mathematical model functionalities.The model was implemented in the IBM ILOG CPLEX Optimization Studio 12.8 modeling and optimization environment.The simulations were executed by using an Intel Xeon E3-1240 CPU @ 3.40 GHz.
The model determines the amounts to be paid for the electricity consumption and power demand for the next 12-month period, taking into account the possibility of using local generation and jointly performing the adjustment of the tariff type and the demand contract.The studies carried out are based on a comparison with a reference condition (Scenario 0), which is currently present in the consumer, namely: contracted demand of 450 kW and without using local generation.Nine different conditions (Scenarios 1-9) are analyzed.

Input Parameters
The electricity consumption and power demand records of a university located in the south of Brazil (western region of Paraná state) were used.Currently, the consumer is under the green tariff, powered with a 13.2 kV system, with 450 kW of contracted demand.
For the analyses of scenarios, three sources for local electricity generation were considered, grouped into two alternative sources (AS) that can be used to perform demand response, and one intermittent source (IS).Actual data from these sources were used, from the collection of other consumers in the same city and, thus, under similar environmental conditions.Information about the considered power sources is hereafter provided:

1.
A diesel generator set with a maximum power of 78 kW.Taking into account fuel, oil changes, and periodic maintenance, the generation cost is $1.48 for each 1 kWh;

2.
Generation by a biogas system with a maximum power of 52 kW, with the capacity to generate energy without interruption 24 h a day.Taking into account the preventive maintenance monthly performed, the effective generation cost is $0.08 for each 1 kWh.3.
A photovoltaic system (with no energy storage component) composed of 100 panels, totaling 33.5 kWp.The monthly generation data obtained in 2018 for these panels were used to estimate capacity parameters.The generation cost was considered $0.10 per kWh, taking into account the periodic reviews.

Evaluated Scenarios
The mathematical model was executed to evaluate nine scenarios (Scenarios 1-9) compared to a reference scenario (Scenario 0).Initially, for the reference scenario, the values were obtained only by multiplying the recorded consumption and demand data (for the previous 12-month period) by the considered tariffs for the next 12-month period, as detailed in Section 4.2.1.Subsequently, the model was executed for the following scenarios: Scenario 1: The default optimization analyses are executed, which involve the choice of the best tariff modality (green or blue) and to determine the optimal value for the contracted demand.These optimization analyses of scenario 1 (Sc1) are common to all scenarios hereafter tested.Scenario 2: Sc1 analyses plus the use of diesel generator set only during on-peak hours.Scenario 3: Sc1 analyses plus the use of diesel generator set to cut demand peaks during the day.Scenario 4: Sc1 analyses and the use of photovoltaic system generation in off-peak hours.Scenario 5: Sc1 analyses plus the combination of diesel and photovoltaic generation.Scenario 6: Common functions and the use of biogas system generation, with the capacity to operate 24 h a day, without interruption.Scenario 7: Common functions plus combined use of diesel generator set and biogas system generation.Scenario 8: Common functions plus the use of photovoltaic and biogas generation.Scenario 9: Common functions with the use of all the available sources, that is, diesel generator set, biogas system generation, and photovoltaic system.
In this way, each of the evaluated scenarios provided input parameters for the mathematical optimization model developed in Section 3. In Table 3, the evaluated scenarios can be observed, with the indication of the execution time, number of variables (binary and continuous/integers), and the number of constraints generated in each analyzed scenario.This is highlight that the MILP model was executed until optimality for all evaluated scenarios.In Sections 4.2.1-4.2.10, the results for each evaluated scenario are detailed.In a complementary manner, some discussions are addressed about potential expenses and savings in Section 5.

Reference Values Determination
Initially, the mathematical model was used to obtain the reference values based on the current contracted demand of 450 kW and without the use of local generation.The current tariffs were considered in accordance with Table 1, and the tariff flags that occurred in 2019.
Consumer tariffs for off-peak hours are the same for green and blue tariffs (0.52360 $/kWh), while peak hour tariffs are higher for green tariffs (1.98613 $/kWh vs. 0.79049 $/kWh), the annual amount paid can be seen in Table 4. Due to the high value of the demand tariff during peak hours (49.12 $/kW vs. 21.22 $/kW), a fact that makes the blue tariff expensive in the annual sum, the green hour tariff is the best option for the tariff framework.However, it is noteworthy that the optimal value for contracted demand (CD) is not provided at this moment.In this reference period, CD = 450 kW (indicated in the bottom of Table 4), an ad-hoc value according to the contract previously established between the University and the utility.
As it can be seen in Figure 4, the values with light yellow background (left graph) represent the demand measured at off-peak hours for each month, and the values with dark yellow background (right graph) represent the values measured at on-peak hours.The values with a red background represent the extra demand that must be paid, even without actually being used.The solid blue line represents the contracted demand value (450 kW) and the dashed line represents the limit demand (475 kW).

Scenario 1: Default Optimization Analyses
In scenario 1, the model was executed to indicate the best option for the tariff (Green or Blue) and to determine the optimal value for contracted demand, according to Equations (31)-(33) presented in Section 3.3.2.
As shown in Table 5, the optimal value obtained for the demand contract for both the green and blue tariffs for off-peak hours is equal to 494 kW.The optimal value for on-peak period contracted demand is 355 kW, as indicated in the bottom of Table 5.In Figure 5a,b, the change in the annual graph of measured demand (in comparison to Figure 4) can be seen.The optimum values for the contracted demand are indicated by the solid blue lines.The comparisons between obtained savings are presented in Section 5.  Figure 4a shows the demand values for off-peak hours, which are also the highest values recorded throughout the day for the studied consumer.Therefore, this graph represents the demand values for the green tariff.For blue tariff, Figure 4a is considered for off-peak hours and Figure 4b for peak hours.For both figures, the contracted demand value (blue line) is equal to 450 kW.

Scenario 1: Default Optimization Analyses
In scenario 1, the model was executed to indicate the best option for the tariff (Green or Blue) and to determine the optimal value for contracted demand, according to Equations (31)-(33) presented in Section 3.3.2.
As shown in Table 5, the optimal value obtained for the demand contract for both the green and blue tariffs for off-peak hours is equal to 494 kW.The optimal value for on-peak period contracted demand is 355 kW, as indicated in the bottom of Table 5.In Figure 5a,b, the change in the annual graph of measured demand (in comparison to Figure 4) can be seen.The optimum values for the contracted demand are indicated by the solid blue lines.The comparisons between obtained savings are presented in Section 5.In Figure 5a,b, the change in the annual graph of measured demand (in comparison to Figure 4) can be seen.The optimum values for the contracted demand are indicated by the solid blue lines.The comparisons between obtained savings are presented in Section 5.
The mathematical model uses the values of the monthly generation cost for each source, as well as the probable scenario of tariff flags and adjustment of tariffs.Afterwards, the model solution provides the values for consumption and demand expenses for the next 12-month period.It should be emphasized that the optimal tariff determination and the optimal contracted demand value, features obtained in scenario 1, will be also determined in all the next scenarios, with the addition of singular conditions to each analyzed scenario.

Scenario 2: Use of Diesel Generator Set during On-Peak Hours
In scenario 2, the use of diesel generation set was considered only during on-peak hours.In the Green modality, the on-peak tariff is $1.98613 per kWh and the diesel generation cost is $1.48, therefore the alternative source was used to reduce consumption from k$235 (on Table 5) to about k$190 (Table 6).For Blue modality, the cost of kWh during on-peak hours is $0.79079, i.e., smaller than the diesel generation cost.It is observed in Table 6 that even with a relative higher cost, diesel generation was used during on-peak hours in order to reduce the maximum demand values.Thus, the optimal value for the contracted demand was recalculated: it decreased from 355 kW to 281 kW.The mathematical model uses the values of the monthly generation cost for each source, as well as the probable scenario of tariff flags and adjustment of tariffs.Afterwards, the model solution provides the values for consumption and demand expenses for the next 12-month period.It should be emphasized that the optimal tariff determination and the optimal contracted demand value, features obtained in scenario 1, will be also determined in all the next scenarios, with the addition of singular conditions to each analyzed scenario.

Scenario 2: Use of Diesel Generator Set during On-Peak Hours
In scenario 2, the use of diesel generation set was considered only during on-peak hours.In the Green modality, the on-peak tariff is $1.98613 per kWh and the diesel generation cost is $1.48, therefore the alternative source was used to reduce consumption from k$235 (on Table 5) to about k$190 (Table 6).For Blue modality, the cost of kWh during on-peak hours is $0.79079, i.e., smaller than the diesel generation cost.It is observed in Table 6 that even with a relative higher cost, diesel generation was used during on-peak hours in order to reduce the maximum demand values.Thus, the optimal value for the contracted demand was recalculated: it decreased from 355 kW to 281 kW.The reduction in demand values can be compared by also observing Figure 6a,b.The total annual expenses decreased from k$939 (on Table 5) to about k$905.
Energies 2020, 13, x FOR PEER REVIEW 14 of 22 The reduction in demand values can be compared by also observing Figure 6 a,b.The total annual expenses decreased from k$939 (on Table 5) to about k$905.

Scenario 3: Use of Diesel Generator Set during All Day
In this scenario, the possibility of using a diesel generator set during all day hours was considered.As indicated in Table 7, even with the increase in consumption during off-peak hours (from k$473, Table 6, to k$480), the peak-shaving caused the reduction in contracted demand (from 494 kW to 467 kW), which bring on a small reduction in the total annual expenses as can be seen in Table 7.In this scenario, the possibility of using a diesel generator set during all day hours was considered.As indicated in Table 7, even with the increase in consumption during off-peak hours (from k$473, Table 6, to k$480), the peak-shaving caused the reduction in contracted demand (from 494 kW to 467 kW), which bring on a small reduction in the total annual expenses as can be seen in Table 7.In Figure 6a can be seen the green tariff demand values, while the values for the blue tariff are represented by Figure 6a,b, with the contracted demand optimum values of 467 kW and 281 kW.In Figure 5a it was presented that, in March and November, the highest demand values were recorded (600 kW and 572 kW).One of the goals of the proposed model is to verify the feasibility of reducing these measured demand values using alternative sources.However, for this strategy to be possible, it is necessary to use the values of daily demand, analyzed throughout each month.
Figure 7 shows the graphs with the highest daily values for (a) March and (b) November.It can be seen that during on-peak hours (identified by the columns with dark red color in the graph), the diesel generator set was used (represented in blue), since the cost (per kWh) of diesel generation is $1.48, while the energy utility tariff during on-peak hours is $1.98613 (for green tariff).In addition, the entire energy amount produced by the alternative generation was used by the consumer, so no power was injected into the utility grid.

Scenario 4: Photovoltaic System
A photovoltaic (PV) system with no batteries for energy storage is tested in scenario 4. Therefore, the PV system is an intermittent energy source and it is not considered for reducing demand peaks; it is only considered for reducing electricity consumption expenses.Without the photovoltaic generation data exclusive for peak hours, all PV generation was considered for off-peak hours.As it can be seen in Table 8, the consumption reduced from k$473 to around k$453 in off-peak period.With the use of a diesel generator set, peak-shaving was carried out, i.e., energy was supplied from local generation to reduce demand peak.It should be noted that the tariff during off-peak hours is $0.5236 and the cost of diesel generation is $1.48, almost three times higher.However, even with the higher generation cost, with the decrease in some demand peaks (between 1 p.m. and 3 p.m.) the highest demand values were reduced to 537 kW and the optimum value for contracted demand can be recalculated to 467 kW.A photovoltaic (PV) system with no batteries for energy storage is tested in scenario 4. Therefore, the PV system is an intermittent energy source and it is not considered for reducing demand peaks; it is only considered for reducing electricity consumption expenses.Without the photovoltaic generation data exclusive for peak hours, all PV generation was considered for off-peak hours.As it can be seen in Table 8, the consumption reduced from k$473 to around k$453 in off-peak period.In this scenario, the use of diesel generation and the photovoltaic system is tested.By Table 9, the demand and consumption data for peak hours are the same as for scenario 3.However, the off-peak consumption that increased in scenario 3 (in relation to the reference) due to the use of diesel generation, has now been reduced by the PV generation.

Scenario 6: Utilization of Biogas System
This scenario considers the possible use of a biogas system, with 52 kW of permanent power generation, that is, this generation occurs 24 h a day.Therefore, the use of this source can be considered as a strategic conservation procedure, shown in Figure 1b: besides a reduction in the utility electricity consumption, there is also a decrease in all registered demand values.
Table 10 shows the reduction in the amounts paid for consumption at both, on-peak and off-peak hours.With the registered demand maximum values reduction, the contracted demand was recalculated as follows: 444 kW for the green Tariff; 444 kW (on-peak hours) and 290 kW (off-peak hours) for the blue tariff.If there is a biogas production limitation, the value of the maximum daily capacity for electricity generation must be informed to the model.Restriction (4), presented in Section 3.3.1, is related to the production limit.In the example represented by Figure 8b, the model was executed with the restriction of 260 kWh for the maximum daily limit of generation (considering a tank with capacity for five hours of generation).Thus, the use of biogas would be related to the peak shaving strategy.It could be seen in Figure 8b that 100% of power generation was used during peak hours.During off-peak hours, the generator was used from 1:00 p.m. to 4:00 p.m. to reduce the four biggest demand peaks to 524 kW.
demand peaks to 524 kW.

Scenario 7: Diesel Generator Set Plus Biogas System
As it can be seen in Figure 9, the model aims to determine the time and the amount of alternative generation (local source) to be used.The biogas generation (indicated by the green color) can occur during the 24 h.The use of the diesel generator set (with the values shown in blue) occurred in two moments: first to reduce the utility electricity consumption during peak hours (from 6 p.m. to 9 p.m.) and second for the peak shaving at 1 p.m. and 2 p.m., shown in in Figure 9a, and at 1 p.m. and 3 p.m. in Figure 9b.As it can be seen in Figure 9, the model aims to determine the time and the amount of alternative generation (local source) to be used.The biogas generation (indicated by the green color) can occur during the 24 h.The use of the diesel generator set (with the values shown in blue) occurred in two moments: first to reduce the utility electricity consumption during peak hours (from 6 p.m. to 9 p.m.) and second for the peak shaving at 1 p.m. and 2 p.m., shown in in Figure 9a, and at 1 p.m. and 3 p.m. in Figure 9b.As it can be seen in Figure 9, the model aims to determine the time and the amount of alternative generation (local source) to be used.The biogas generation (indicated by the green color) can occur during the 24 h.The use of the diesel generator set (with the values shown in blue) occurred in two moments: first to reduce the utility electricity consumption during peak hours (from 6 p.m. to 9 p.m.) and second for the peak shaving at 1 p.m. and 2 p.m., shown in in Figure 9a, and at 1 p.m. and 3 p.m. in Figure 9b.Only off-peak graphs were presented in Figure 10. Figure 10a shows the demand values by using the biogas system, where the contracted demand (continuous blue line) is 444 kW.In Figure 10b, in addition to biogas, the diesel generator set was used for peak shaving, and the reduction can be seen in measured demand values for March, April, September, and November.Thus, the optimal value of 417 kW was obtained for the contracted demand.Even with a higher consumption during peak hours, the green tariff results represent the lowest annual total, as can be verified in Table 11.
restriction of 260 kWh for the maximum daily limit of generation (considering a tank with capacity for five hours of generation).Thus, the use of biogas would be related to the peak shaving strategy.It could be seen in Figure 8b that 100% of power generation was used during peak hours.During off-peak hours, the generator was used from 1:00 p.m. to 4:00 p.m. to reduce the four biggest demand peaks to 524 kW.As it can be seen in Figure 9, the model aims to determine the time and the amount of alternative generation (local source) to be used.The biogas generation (indicated by the green color) can occur during the 24 h.The use of the diesel generator set (with the values shown in blue) occurred in two moments: first to reduce the utility electricity consumption during peak hours (from 6 p.m. to 9 p.m.) and second for the peak shaving at 1 p.m. and 2 p.m., shown in in Figure 9a, and at 1 p.m. and 3 p.m. in Figure 9b.In this scenario, permanent biogas generation was combined with the intermittent PV system power generation.The reduction in consumption during off-peak hours occurs due to the use of both sources.All demand values are reduced due to the biogas usage, as indicated in Table 12, and contracted demand is recalculated for the peak and off-peak period.In this scenario, the analysis was made considering that the consumer can use the 3 sources.There is no difference in the demand graph shown in Figure 10b, which already considers biogas and diesel to reduce power demand.The PV system reduces consumption during off-peak hours, the biogas system reduces not only the consumption, but also all demand records, while diesel generator set is used to peak-shaving.Table 13 summarizes the obtained results.Section 5 analyses the achieved economy obtained for Scenarios 1 to 9 with respect to the reference, Scenario 0.

Discussion
Table 14 shows the obtained results for each scenario, with consumption values at peak and off-peak times, the optimal value for contracted demand (CD), the total amounts paid by demand, the annual expenses on energy consumption and demand, and the possible savings obtained in relation to the reference scenario.Only the data for the green tariff were considered, as the tariff modality presented the best results in relation to the blue tariff.In scenario 1, only with the tariff choice (green or blue) and the adequacy of the demand contract to the optimal value (494 kW), the total annual expenses would be reduced by 0.26%.It should be noted that, for the contract adjustment, the consumer requires no investments.
In scenario 2, the diesel generator set was used only during on-peak hours, which would result in annual savings of 5.60%.In scenario 3, diesel generation was used also to peak shaving.In this context, there was an increase in consumption expenditure during off-peak hours, due to the higher diesel cost.The optimum value for contracted demand was recalculated to 467 kW, which decreased the total demand expenses, and provided a saving of 5.99%.It should be noted that a diesel source has been considered, but this fuel can be replaced by biodiesel, natural gas, or another type of source that could be used to perform the peak shaving.
We further emphasize that the renewable sources use is feasible within the analysis carried out by the model, with the entry of parameters in an appropriate manner.Thus, sources such as biodiesel, ethanol, biogas, photovoltaic, or small hydroelectric generation can naturally and easily be incorporated into the performed analyses.That confers flexibility to the proposed model turning it adaptable to scenarios outside of Brazil.
For scenario 4, the isolated PV system (without storage system) generated savings of only 2.59% for the consumer.However, the combination between the PV system and diesel generation, presented in scenario 5, would bring an annual saving of 8.32%.
For scenario 6, the biogas system (from biomass) was considered.The low cost of generation and the capacity of 24-h energy supply significantly increased the savings to 37.60%.Indeed, this specific source is less available to consumers in comparison to the photovoltaic, wind, diesel (biodiesel), or natural gas generation systems.Scenarios 7, 8, and 9 show the combination between the three sources, which caused a relative reduction on annual expenses.In this way, the developed model is able to determine, by an exact method (solution of a MILP model), the savings for each new system configuration.As a future work, it is suggested that these results be used in an analysis of investment time return for each scenario configuration.

Conclusions
This paper proposes a mathematical model in mixed integer linear programming (MILP) to aid the decision-making process in energy contract by Brazilian consumers/prosumers.The model considers alternative (local) generation connected to the grid and establishes an optimized solution to the following decisions: (i) choice of the best tariff modality according to the Brazilian regulatory patterns, (ii) determination of the optimal value for the demand contract, and (iii) choice of the best hours during the day to use each alternative source (scheduling of sources usage).Historical values for consumption and demand records (for 12 months previous period) are parameters to the mathematical model.The consumer can, however, adjust these inputs in case of system changes, such as, equipment replacement or electrical installation expansions.
Energies 2020, 13, 2803 20 of 23 A frequent concern is the environmental problems caused by polluting and non-renewable fuels use.In this work, data from a diesel generator set was considered as an alternative source; however, to reduce the pollutants emission it is prudent to consider the use of renewable fuels such as biodiesel and ethanol.Another tested alternative source was the biogas system.Some industries or agro-industries generate waste that needs to be properly treated to do not cause environmental problems.One way to properly dispose of waste is to use it for the production of biogas, and subsequently, the generation of electric energy.Thus, something that would be discarded becomes fuel for the electricity generation, and the effective cost of generation refers to, basically, the periodic maintenance of the system.As an intermittent source, we considered the data from a photovoltaic system (a clean and renewable energy) whose use has been increasingly widespread worldwide.Wind energy is another intermittent source that could be considered concurrently with PV.
This mathematical model was developed taking into account some specific characteristics to initially meet the Brazilian billing context, due to the complexity of working with all the considered issues in this context.However, the model encompasses a series of general aspects.For instance, different alternative sources (AS) are considered in the mathematical model.The user has to provide some AS parameters, such as: maximum power (in kW), the maximum daily generation capacity (kWh), and the generation cost ($/kWh).To intermitted sources (IS), the user has to provide: the monthly generation (kWh), and the generation cost ($/kWh).Thus, the proposed model could be a good starting point for the analysis of scenarios outside Brazil.For this, the characteristics required for the demand contract (e.g., Equations ( 31)-( 33)) and utility tariff considerations must be adjusted.
The developed approach allows to correctly evaluate the use of alternative generation already installed in the consumer unit, or to consider the purchase (or rent) of equipment taking into account the annual savings that would be obtained (e.g., Table 14).In this way, the paper analyzed nine scenarios (Section 4) and the obtained gains of each one with respect to the already installed structure (the as-is configuration), as detailed in Section 5 (Discussion).
The proposed mathematical model configures an optimization tool for the feasibility analysis the use of alternative sources and concomitantly checking the tariff modality, revising the demand contract, and suggesting demand response actions.In the end, the optimized answers promote benefits for both the consumer/prosumer and the electric utility.

Figure 2 .
Figure 2. Demand records for: (a) one month and (b) one day.

Figure 3 .
Figure 3. Demand records: (a) finding the highest daily values for January and (b) the highest hourly demand registered for each month.

Figure 2 .
Figure 2. Demand records for: (a) one month and (b) one day.

Figure 2 .
Figure 2. Demand records for: (a) one month and (b) one day.

Figure 3 .
Figure 3. Demand records: (a) finding the highest daily values for January and (b) the highest hourly demand registered for each month.

Figure 3 .
Figure 3. Demand records: (a) finding the highest daily values for January and (b) the highest hourly demand registered for each month.

Figure 4 .
Figure 4. Reference scenario demand values for (a) off-peak (b) on-peak.

Figure 4 .
Figure 4. Reference scenario demand values for (a) off-peak (b) on-peak.

Figure 7 .
Figure 7. Scenario 3 daily maximum demand chart for (a) March and (b) November.

Figure 7 .
Figure 7. Scenario 3 daily maximum demand chart for (a) March and (b) November.

Figure 8 .
Figure 8. Scenario 6: (a) biogas permanent use for strategic conservation and (b) Demand graph with limit for alternative generation and peak-shaving application.

Figure 9 .Figure 10 .
Figure 9. Graph using biogas and diesel generator set for: (a) March and (b) November.

Figure 8 .
Figure 8. Scenario 6: (a) biogas permanent use for strategic conservation and (b) Demand graph with limit for alternative generation and peak-shaving application.

Figure 9 .Figure 10 .
Figure 9. Graph using biogas and diesel generator set for: (a) March and (b) November.

Figure 9 .
Figure 9. Graph using biogas and diesel generator set for: (a) March and (b) November.

Figure 8 .
Figure 8. Scenario 6: (a) biogas permanent use for strategic conservation and (b) Demand graph with limit for alternative generation and peak-shaving application.

Figure 9 .Figure 10 .
Figure 9. Graph using biogas and diesel generator set for: (a) March and (b) November.

Table 3 .
Time, variables and constraints for each executed scenario.

Table 4 .
Main results for the Reference Scenario.

Table 5 .
Main results for Scenario 1.

Table 5 .
Main results for Scenario 1.

Table 5 .
Main results for Scenario 1.

Table 6 .
Main results for Scenario 2.

Table 7 .
Main results for Scenario 3.

Table 6 .
Main results for Scenario 2.

Table 7 .
Main results for Scenario 3.

Table 8 .
Main results for Scenario 4.

Table 8 .
Main results for Scenario 4.

Table 9 .
Main results for Scenario 5.

Table 10 .
Main results for Scenario 6.

Table 10 .
Main results for Scenario 6.

Table 10 .
Main results for Scenario 6.

Table 11 .
Main results for Scenario 7.

Table 12 .
Main results for Scenario 8.

Table 13 .
Main results for Scenario 9.

Table 14 .
Annual Energy Consumption and Power Demand expenses for each scenario.
ln AS AS = {1, . . ., nAS} Alternative Sources i ln IS IS = {1, . . ., nIS} Intermittent Sources Parameter Description nMonths Number of months for analysis (e.g., 12 months).nHours Number of hours (in the day) considered for analysis (e.g., 24 h).nHC Number of hours for consumption calculations (e.g., nHC = 2: on-peak and off-peak).nHD Number of hours for demand calculations (e.g., nHD = 3: on-peak, off-peak and Day).nTM Number of Tariff Modality (e.g., nTM = 2: Blue and Green).nAS Number of Alternative Sources (e.g., 4: hydraulic, biogas, diesel and biodiesel).nIS Number of Intermittent Sources (e.g., 2: wind and photovoltaic).Days m Number of days in each month m (e.g., 28, 30 or 31).sPK Start of on-peak hours according to the local electricity utility.ePK End of on-peak hours according to the local electricity utility.Cons m, hc Electricity consumption in each month (m), on consumption times (hc) representing on-peak and off-peak hours [kWh].HDR m, h Hourly demand registered (h) for each month (m) [kW].MDmax dh Maximum value for measured demand for each hour of demand (hd) [kW].pgAS a, m Power of each alternative source (a) in each month (m) [kW].maxAS a, m Maximum daily generation capacity for each alternative source (a) for each month (m) [kWh].mgIS i, m, hc Monthly generation of each intermittent source (i) in consumption times (hc) [kWh].cAS a,m, hc Generation cost for each alternative source (a) for each month (m) at each consumption time (hc) [$].cIS i, m, hc Generation cost for each intermittent source (i) for each month (m) at each consumption time (hc) [$].taEU tm, m, hc Electricity consumption tariff for each tariff modality (tm), for each month (m), at each consumption time (hc) [$/kWh] taD tm, hd Invoiced Demand tariff for each tariff modality (tm), at demand times (hd) [$/kWh].taE tm, hd Exceeded Demand tariff for each tariff modality (tm), at demand times (hd) [$/kWh].Tol Tolerance for the contracted demand [%].vS hc Sales value (considered for billing purposes) of each kWh of surplus energy injected into the grid, for each consumption time (hc) [$].indicates the use of each intermittent source (i), for example: photovoltaic (uIS 1 = 1) and wind (uIS 2 = 1).Hourly electricity generation from each alternative source (a) for each month (m) for each hour of the day (h) [kWh].dAS a, m, h R + Demand provided by each alternative source (a) for each month (m) for each hour of the day (m) [kW].dGen m, h R + Total demand generated by all alternative sources (a) for each hour (h) [kW].DHD m, h R + Decreased hourly demand for each month (m) for each hour (h) [kW].Intermittent generation cost for each month (m) at peak and off-peak consumption hours (hc) [$].cTMG m, hc R + Total generation cost for each month (m) at peak and off-peak consumption hours (hc) [$].cEU m, hc R + Amount paid for the utility energy used, for each month (m) in consumption hours (hc), peak and off-peak [$].EC m, hc R + Energy credit obtained from the surplus energy injected into the grid, for each month (m) in each consumption time (hc) [$].MD m, hd R + Measured Demand (referring to the highest nDH value) in each month (m) in each demand hour (hd) [kW].ID m, hd R + Invoiced Demand, for each month (m) at each demand time (hd) [kW].ED m, hd R + Exceeded Demand, for each month (m) at each demand time (hd) [kW].cPK m R Electricity consumption cost during on-peak hours for each month (m) [$].cOP m R Electricity consumption cost during off-peak hours for each month (m) [$].dPK m, R + Invoiced Demand cost during on-peak hours for each month (m) [$].dOP m, R + Invoiced Demand cost during off-peak hours for each month (m) [$].dDay m R + Invoiced Demand cost for all times of the day for each month (m) [$].ePK m, R + Exceeded Demand cost during on-peak hours for each month (m) [$].eOP m R + Exceeded Demand cost during off-peak hours for each month (m) [$].eDay m R + Exceeded Demand cost for all times of the day for each month (m) [$].
+ Surplus electricity injected into the grid per month (m) at peak and off-peak consumption times (hc) [kWh].cAG m, hc R + Alternative generation cost for each month (m) at peak and off-peak consumption hours (hc) [$].