Contracted Capacity Optimization Problem of Industrial Customers with Risk Assessment

: This study developed a risk assessment tool for contract capacity optimization problems using the ant colony optimization and auto-regression model. Based on the historical data of demand consumption, the Least Square algorithm, the Recursive Levinson–Durbin algorithm, and the Burg algorithm were used to derive the auto-regression model. Then, ant colony optimization was used to search for the auto-regression model’s best p - order parameters. To avoid the risk of setting the contract capacity, this paper designed the risk tolerance parameter β to correct the predicted value of the auto-regression model. Ant colony optimization was also used to search for the optimal contract capacity with risk assessment under the two-stage time-of-use and three-stage time-of-use. This study employed an industrial consumer with high voltage power in Taiwan as the research object, used the AR model to estimate the contract capacity under the risk assessment, and cut back electricity usage to reduce the operation cost. The results can be used as a basis to develop an efﬁcient tool for industrial customers to select contract capacities with risks to obtain the best economic beneﬁts.


Introduction
In Taiwan, the rapid economic growth and development of various industries have resulted in high utility load demands [1,2].A significant amount of investment is required in utility power apparatus to consistently meet peak load demands.However, peak demand periods often cause power outages in summer, especially when the demand and supply are insufficient, thus resulting in serious economic losses.Investments in utility power apparatus must be carefully planned to arrive at an acceptable solution.For industrial customers, stable power supply and low electricity prices are important factors for evaluating construction and expansion.Signing a contract capacity helps industrial customers effectively control power consumption and reduce the electricity costs of their enterprises [3,4].
The current electricity tariff structure of the Taiwan Power Company (TaiPower, Taiwan) in Taiwan is composed of a basic electricity charge, energy charge, over-contract surcharge, and power factor adjustment plus or minus charge [5].The contract capacity is used as the basis for calculating the basic electricity charge.TPC prepares the supply power according to the contract capacity and requires users to use power according to the contract capacity in order to ensure the power supply security of the power system.Power companies often propose a variety of different power consumption plans [6], allowing users to maintain lower electricity costs.Signing contracts on capacity, where users pay for electricity according to the contracted capacity, can help avoid penalty charges.It must be noted, however, that customers need to obtain an economic tariff to reduce their electricity charge and that they must carefully plan the contract capacity appropriated to avoid penalty charges or overestimated contracts.Therefore, forecasting contract capacities plays a significant role in saving electricity costs [7].
Previous studies on optimal contract capacity have mostly focused on the historically high demand to obtain the optimal setting value of future contract capacity.In [8], Evolutionary Programming (EP) was used to solve the optimal contract capacity of industrial users during peak, semi-peak, and off-peak periods.Previous studies used particle swarm optimization (PSO) to find the optimal contract capacity for time-of-use (TOU) rate customers [9] and the stochastic search algorithm to optimize the contract capacities of the TOU rate for industrial customers [10].An optimized structure was also proposed to predict contract capacities by combining an artificial bee colony and an artificial neural network [11].Moreover, statistical and optimization tools were used to obtain the cost optimization of contract capacities for high-energy rate customers [12].Linear programming was proposed to determine electricity contract capacities while using lesser computation time [13].Planning power consumption schedules were utilized to ensure users' optimal contract capacity setting value [14].Additionally, several loss functions were derived from the asymmetric electricity pricing structure to determine the optimal capacity for industrial users [15].This paper presents an iteration particle swarm optimization to solve the optimal contract capacities of a time-of-use (TOU) rate industrial customer [16].Ref. [17] proposed an improved Taguchi method that combined the existing Taguchi method and particle swarm optimization (PSO) algorithm to solve the contract capacity setting for industrial consumers.Ref. [18] provided several solutions for entrepreneurs based on the implementation of two-stage and deep learning approaches to predict maximal load values and the moments of exceeding the contracted capacity in the short term.Most of the research data in the above studies were obtained from the evaluation of the optimal contract capacity based on the highest demand.Since the power demand of industrial users varies greatly, the prediction of future power demand information is often inaccurate.The common disadvantage of the methods described includes profit changes due to power demand uncertainties.Risk is introduced to the fixed commitment contract and the forecast contract in the electricity supply chain [19,20].With risks expected in setting relative contract capacities, addressing uncertainties is a key issue in investigating this topic [21] that merits a deeper discussion of both utilities and customers.
This paper intends to propose a risk assessment tool for the contract capacity optimization problem using ant colony optimization (ACO) [22,23] and the auto-regression (AR) model.Based on the historical data of demand consumption, the Least Square algorithm (LS) [24], the Recursive Levinson-Durbin (RLD) [25] algorithm, and the Burg algorithm (BA) [26] were used to derive the AR model.Then, ACO was used to search for the AR model's best p-order parameters.To avoid the risk of setting the contract capacity value, this study designed the risk tolerance parameter β to regulate the predicted value of the AR model.ACO was also used to search the optimal contract capacity with risk assessment by considering the risk tolerance parameter β [27,28].This study used an industrial consumer as the research case, employed the AR model to estimate the contract capacity, and considered the risk assessment when calculating the optimal contract capacity under the two-stage TOU and three-stage TOU models.The proposed algorithm was tested by a practical high-voltage consumer to prove its efficiency.The findings of this study can serve as a basis for developing an efficient tool for industrial customers in selecting contract capacities with risks in order to maximize economic benefits.

Problem Formulation
The electricity price announced by TaiPower [5] for industrial users applied the TOU rate, which is divided into two-stage and three-stage types, as shown in Table 1.The total electricity bill is the summation of the energy charge, contract capacity charge, and penalty charge.In the case of over-contract capacity, the power company's handling method is composed of three levels [5].

1.
If the monthly electricity demand is equal to or less than the contracted capacity, the charge will be based on the contracted capacity, which is called the demand charge.

2.
If the monthly electricity demand is greater than the contracted capacity, and the excess part is less than 10% of the contracted capacity, the excess part is penalized by two times the demand charge.

3.
If the monthly electricity demand is greater than the contracted capacity, and the over-contract reaches more than 10% of the contracted capacity, the excess part is penalized by three times the demand charge.Semi-peak contract 166.9 166.9 Off-peak contract 44.7 44.7 2.1.The Contract Capacity Optimization in the Three-Stage TOU Contract capacity optimization in the three-stage TOU minimizes the sum of the annual contract capacity charge and penalty charge under the load demand.The objective function is described as follows. (1) The over-contract part must be calculated according to the over-contract amount of each time period.Over-contracting for each time period is expressed as follows.
The formula when exceeding the contract during peak periods and exceeding the contract penalty is described in Equation (4).
The formula when exceeding the contract during semi-peak periods and exceeding the contract penalty is described in Equation (5).
The formula when exceeding the contract during off-peak periods and exceeding the contract penalty is described in Equation (6).
BAS i (CP, CM, CO) is the demand charge for the contracted capacity during the i − th month (NT).OVER i (DP i , DM i , DO i ) is the penalty charge for over-contract usage during the i − th month (NT).CP, CM, CO are the contracted capacities for peak, half-peak, and offpeak demands (kW).DP i , DM i , DO i are the peak, semi-peak, and off-peak peak demands during the i − th month (kW).PB i , MB i , OB i are the peak, semi-peak, and off-peak contract fees during the i − th month (kW).OCP i , OCM i , OCO i are the peak, semi-peak, and off-peak capacities exceeding the contract during the i − th month (kW).ODP i , ODM i , ODO i are the over-contracting penalties for peak, semi-peak, and off-peak demands during the i − th month (NT).

Contract Capacity Optimization in the Two-Stage TOU
The contract capacity optimization in the two-stage TOU is described as follows: The calculation of the over-contract amount and over-contract penalty for each time period is described as follows: The formula when exceeding the contract during peak periods and exceeding the contract penalty is described in Equation (10).
The formula when exceeding the contract during off-peak periods and exceeding the contract penalty is described in Equation (10).
where BAS i (CP, CK, CO) is the demand charge for the contracted capacity during the i − th month (NT).OVER i (DP i , DK i , DO i ) is the penalty charge for over-contract usage during the i − th month (NT).CP, CK, CO are the contracted capacities for peak, half-peak, and off-peak demands (kW).DP i , DK i , DO i are the peak, semi-peak and off-peak peak demands during the i − th month (kW).PB i , OB i are the peak and off-peak contract fees during the i − th month (kW).OCP i , OCO i are the peak and off-peak capacities exceeding the contract during the i − th month (kW).ODP i , ODO i are the over-contract penalties for peak, semi-peak, and off-peak demands during the i − th (NT).

Solution Algorithm
This paper used the ant colony algorithm to find the best p-order parameter of the AR model and designed the risk tolerance parameters to correct the predicted value of the contract capacity.The uncertain value generated by the specified method ensures the reliability of the optimal contract capacity.

AR Model
The AR model is one of the most employed time series models.When the series value is composed of the time series value and noise, it is expressed as shown in Equation (12).13).
AR error is the training error value of the AR model.M is the sequence data of the electricity consumption type.N is the length of the electricity consumption sequence data.X represents the original sequence data.x represents the regression data of the AR model, and X i,max j is the maximum training value in the i-sequence data.x i,min j is the minimum value in the i-sequence training data.The test error value of the AR model is expressed as shown in Equation (14).
Test error is the test error value of the AR model.m represents the sequence data of the power consumption type.n is the length of power consumption sequence data.X real represents the actual data, and x ar represents the sequence data of the AR model prediction data.X i,max real,j is the maximum value in the tested i-sequence data, and X i,min real,j is the minimum value in the tested i-sequence data.

ACO Algorithm
ACO applies the activity characteristics of biotic populations to optimization problems [17,18].When ants forage, they refer to their own information and learn from the best individual in the group.The information they learned is utilized to search for the shortest route between their colony and food sources, and the information is also exchanged within the colony until the entire population reaches a better condition.The advantages of the ACO algorithm lie in the fact that individual solutions within a range of possible solutions can converge to create a better solution through evolution iterations.ACO is optimal for global search and has been applied to solve optimization problems.This paper uses ACO to search for the best p-order parameter, allowing the AR model to predict more accurately.The procedure of the ACO application is described as follows.

1.
Input historical data, including the highest demand, peak load, semi-peak load, offpeak load, and power factor.2.
Set the parameters of ACO.
The parameters of ACO include the population of ants (k), the number of generations (G), the initial pheromone (τ 0 = 0.1), the relative influence of the pheromone trail (α = 1), the relative influence of the heuristic information (β = 2), and the pheromone evaporation rate (ρ = 0.5).
Let i t = X i t be an individual, where i = 1, 2, . .., k. k is the number of ants and is set to 30 in this paper.s is the number of parameters.All individuals are set between the lower and upper limits with a uniform distribution, as shown in Equation (15).
Rand: the uniform random number in (0,1).The fitness score of each i t is obtained by calculating the fitness function.The fitness function is calculated using Equation (16).
Apply the state transition rule.
The ants' generated state is based on the level of the pheromone and constrained conditions.Based on the concept of this multi-stage process, the search space of the operational dispatch problem can be established.The transition probability for k − th from one state s to the next j is at the t − th interval given in Equation (17).
η i,sj (g) and η i,sl (g) are the inverse of the edge distance at the g − th generation, which are expressed as Equations ( 18) and (19).
Error( t,s ) and Error( t,l ) are the scores of the s − th individual and l − th individual at the t − th interval, while Error( t,joptimal ) is the optimal fitness score at the t − th interval.N k t (s) is the number of feasible individuals at the t − th interval.τ t,sj (g) and τ t,sl (g) are the pheromone intensities on edge (s, j) and edge (s, l) at the g − th generation.Ant k positioned at state s chooses the next state to move, taking τ t,sl and η t,sl into account.When the value of τ t,sl increases, a lot of traffic occurs on this path; thus, it is more desirable to reach the optimal solution.When the value of η t,sl increases, it implies that the current state should have a higher probability.Each stage contains several states, while the order of state selected at each stage can be combined as an achievable path that is deemed a feasible solution to the problem.
Update the pheromone.
While building a solution to the problem, the pheromone of the visited path can be dynamically adjusted by employing Equation (20).This process is called the "local pheromone-updating rule".
ρ is the constant of pheromone intensity (0 ≤ ρ ≤ 1) and ∆τ k t,sj is the deviation of pheromone intensity on the edge (s, j) at the t − th interval, as shown in Equation ( 21): Q/e k t,sj , the path(s, j) for k − th ant 0 , other Q is the released rate of the pheromone (0 ≤ Q ≤ 1) and e k t,sj is the path error (s, j) for the k − th ant.

6.
If a pre-specified stopping condition is satisfied, stop the run and output the results; otherwise, return to Step 4. In this study, the stopping rule is set to 100 generations.Figure 1 shows the flow chart for searching the optimal p-order by ACO.
(  increases, it implies that the current state should have a higher probability.Each stage contains several states, while the order of state selected at each stage can be combined as an achievable path that is deemed a feasible solution to the problem.

Update the pheromone.
While building a solution to the problem, the pheromone of the visited path can be dynamically adjusted by employing Equation (20).This process is called the "local pheromone-updating rule".
 is the path error (s, j) for the k th − ant.
6.If a pre-specified stopping condition is satisfied, stop the run and output the results; otherwise, return to Step 4. In this study, the stopping rule is set to 100 generations.Figure 1 shows the flow chart for searching the optimal p-order by ACO.This paper proposes the use of ACO to solve the best p-order of the AR model.ACO is used to generate offspring in order to escape from the local optimum and to improve searchability.

Optimal Contracts with Risk
According to the power consumption habits of general contract users, the electricity bill in the three-stage TOU accounts for about 46.153% of the total electricity bill, and that in the two-stage TOU accounts for more than 66.865% of the total electricity bill.Therefore, it is an important decision-making factor to search for the optimal contract capacity in the context of managing the risks of "monthly peak demand" and "peak power consumption".In this case, a strategy evaluation using risk assessment is expected to effectively reduce the degree of risk.
In this paper, the AR model prediction error of "monthly peak demand" and "peak power consumption" was used as follows: V error,p = X i real,p − x i ar,p V error,max is the error risk value of monthly peak demand, V error,p is the error risk of peak power consumption.x i real,max represents the real data of monthly peak demand.x i ar,max represents the forecasting data of monthly peak demand.x i real,p represents the real data of peak power consumption and x i ar,p represents the forecasting data of peak power consumption.By considering the risk assessment, the AR model of monthly peak demand and peak power consumption is corrected, as shown in Equations ( 24) and ( 25): Vest_x i AR,max and Vest_x i AR,p are the monthly peak demand data and the peak power consumption data predicted by the AR model, respectively.According to this model, the risk tolerance parameter β is added to simulate and analyze the absolute error risk assessment of the optimal contract capacity due to the forecast fluctuation of monthly peak demand and peak power consumption, as shown in Equations ( 26) and (27).
As far as optimizing the contract capacity is concerned, users have to face the risk of punishment if the contract capacity is too small or wasting basic electricity charges if the contract capacity is too large.size of the risk tolerance parameter β can be determined according to the preferences of the electricity users.If they choose a smaller risk, the value of the risk tolerance parameter β must be increased.On the other hand, if the electricity consumers could accept high risks and seek the minimum total annual electricity fee, the value of the risk tolerance parameter β could be reduced to a value close to zero.Therefore, different β values were compared to different transaction expectations.
This study probed into whether the risk tolerance parameter β could allow electricity companies to maximize the minimum annual contract capacity when the risk tolerance parameter β is set in the range of [0 0.5 1 2].The total electricity cost and risk value have a specific assessment and create the best allocation between electricity consumption and risk.

Case Study
The proposed algorithm was tested for an industrial consumer with high voltage power in Taiwan as the research object.Subsequently, historical data, including the monthly peak demand and peak power consumption, were collected from 2013 to 2021.Several tests in two-stage TOU and three-stage TOU were conducted.The simulation was implemented with MATLAB on an Intel(R) Core(TM) i5-7300HQ CPU computer (Taipei, Taiwan) with 16 GB RAM.

The Best p-Order of the AR Model
Table 2 shows the results of different AR models.Based on the table, BA is used to construct the AR model with the best 17th-order in the two-stage TOU.Its best fitness function value is 0.1556 via ACO.In the three-stage TOU, the Burg algorithm is used to construct the best 16th-order of the AR model, and its best fitness function value is Inventions 2024, 9, 81 9 of 13 0.124 via ACO.Regardless of whether it is the two-stage TOU or three-stage TOU, the fitness value of the BA is the lowest.Table 3 shows the prediction errors of peak demand with the best p-order AR model.As seen, BA has fewer errors when predicting peak demand; hence, it performs better than other algorithms in different TOU stages.Figure 2 shows the curves of the predicting error with the BA.Based on this figure, the predicted peak demand of BA is close to the real values.It can be observed that BA has the capability to follow the spikes, as shown in Figure 2.  Table 3 shows the prediction errors of peak demand with the best p As seen, BA has fewer errors when predicting peak demand; hence, it perf other algorithms in different TOU stages.Figure 2 shows the curves of the with the BA.Based on this figure, the predicted peak demand of BA is values.It can be observed that BA has the capability to follow the spik Figure 2.  The test errors of the peak demand and peak power consumption TOU and peak power consumption in the three-stage TOU are shown i The test errors of the peak demand and peak power consumption in the two-stage TOU and peak power consumption in the three-stage TOU are shown in Figure 3.Most of the prediction errors are within ±15%.Some examples of peak power consumption are higher than 30%, implying that the risk is relatively high.
of the prediction errors are within ±15%.Some examples of peak power c higher than 30%, implying that the risk is relatively high.

Optimal Contract Capacity with Risk Assessment
In this paper, the risk tolerance parameters β = 0, 0.5, 1, and 2 were u the risk correction on the predicted values of peak demand and peak pow using the ACO.According to the actual data of the industrial customer, mand was 2640 kW, the peak power consumption of the two-stage TOU w kWh, and the peak power consumption of the three-stage TOU was abo As indicated in Figure 3, there are several prediction errors, and the peak p tion is higher than 30%.Therefore, the predicted value can be correcte tolerance parameter β to avoid the distortion of the evaluation of the o capacity, as shown in Tables 4 and 5. Based on these tables, the peak dem June corresponding to 0, 0.5, 1, and 2 were 2479 kW, 2586 kW, 2693 kW respectively.This finding shows that a higher risk leads to a higher peak

Optimal Contract Capacity with Risk Assessment
In this paper, the risk tolerance parameters β = 0, 0.5, 1, and 2 were used to carry out the risk correction on the predicted values of peak demand and peak power consumption using the ACO.According to the actual data of the industrial customer, the highest demand was 2640 kW, the peak power consumption of the two-stage TOU was about 532,400 kWh, and the peak power consumption of the three-stage TOU was about 256,800 kWh.As indicated in Figure 3, there are several prediction errors, and the peak power consumption is higher than 30%.Therefore, the predicted value can be corrected using the risk tolerance parameter β to avoid the distortion of the evaluation of the optimal contract capacity, as shown in Tables 4 and 5. Based on these tables, the peak demands of risk β in June corresponding to 0, 0.5, 1, and 2 were 2479 kW, 2586 kW, 2693 kW, and 2907 kW, respectively.This finding shows that a higher risk leads to a higher peak demand.Table 6 shows the optimal contract capacity, the annual electricity fee, and the risk fee among the various risk tolerance parameters.When the risk tolerance parameter is β = 0, the optimal contract capacity in the two-stage TOU is 2490 kW, and the annual electricity fee is NT 30,628,554.In the three-stage TOU, the optimal contract capacity is also 2490 kW, and the annual electricity fee is reduced to NT 26,921,278.Therefore, if the industrial customer chooses to sign the three-stage TOU, the annual electricity bill would be cheaper, and the electricity bill expenditure of NT 3,707,276 could be reduced.When the risk tolerance parameter β is larger, the optimal contract capacity, the annual electricity fee, and the risk fee also relatively increase.Table 6 provides the planners with a wider range of alternatives, the effects of various risk tolerance parameters.Instead of using maximal allowable limits for risk as constraints, an appropriate strategy can be chosen to meet the desired level of risk and electricity fee.

Comparison of the Optimal Contract Capacity with/without Risk Tolerance
Table 7 shows the comparisons of the optimal contract capacity with/without risk tolerance.Based on the table, the optimal contract capacity with the risk tolerance parameter β = 1 is 2543 kW both in two-stage and three-stage time TOUs, which is closest to the optimal contract capacity (2552 kW).Building from the above methods and problem case tests, this paper recommends the application of ACO to determine the BA with the best p-order parameters to predict the optimal contract capacity and correct it with the risk tolerance parameter β = 1.The predicted value of the AR model is applied to the calculation of the contract capacity by applying ACO, and the optimal contract capacity and the total electricity fee are obtained.

Conclusions
This paper integrated the ACO and the AR model to determine the contract capacity optimization problem with risk assessment.Based on the historical data, three algorithms, including LS, RLD, and BA, were used to derive the AR model.ACO was also used to search for the best p-order parameters and optimal contract capacity.To avoid risks due to the fluctuation in the contract capacity, this study designed the risk tolerance parameter β, which was used to regulate the predicted value of the AR model.Subsequently, it employed ACO to determine the optimal contract capacity in the two-stage TOU and three-stage TOU.Furthermore, based on the electricity consumption data of industrial users, this study conducted relevant case tests and simulations and predicted the annual best contract capacity.The method proposed in this paper can assist factory managers of industrial customers in planning, both early and accurately, the highest power demand and peak power consumption for more efficient power usage.
This paper is developed to help regulate present contract capacities or plan their contract capacities in the future by considering risk tolerance.Power companies can use this study to supply services to their TOU customers, check their load management policies, and finally make their power systems more efficient.Although this study was based on the TPC rate structure, it can easily be modified to satisfy other TOU rate structures.If it can integrate various types of electricity users, coordinate users' electricity consumption patterns, and implement demand response strategies, it is also one of the important future research directions of demand side management (DSM) [29,30].

Figure 1 .
Figure 1.Flow chart for searching the best p-order by ACO.

Figure 1 .
Figure 1.Flow chart for searching the best p-order by ACO.

Figure 2 .
Figure 2. The curves of the predicted errors using the Burg algorithm.

Figure 2 .
Figure 2. The curves of the predicted errors using the Burg algorithm.

Figure 3 .
Figure 3.The test error of the various loads.

Figure 3 .
Figure 3.The test error of the various loads.

Table 1 .
The TOU rate structure of industrial users.
is the constant of pheromone intensity ( 01 

Table 2 .
The results of different AR models.

Table 3 .
The predicting errors of peak demand.Regardless of whether it is the two-stage TOU or three-stage value of the BA is the lowest.

Table 2 .
The results of different AR models.

Table 3 .
The predicting errors of peak demand.

Table 4 .
The correct value for risk tolerance parameters β = 0 and 0.5.

Table 4 .
The correct value for risk tolerance parameters β = 0 and 0.5.

Table 5 .
The correct value for risk tolerance parameters β = 1 and 2.

Table 6 .
The optimal contract capacity, the annual electricity fee, and the risk fee are among the various risk tolerance parameters.

Table 7 .
Risk tolerance parameter β and optimal contract capacity.