Water resources allocation considering water supply and demand uncertainties using newsvendor model-based framework

A novel newsvendor model-based framework for regional industrial water resources allocation that considers uncertainties in water supply and demand was proposed in this study. This framework generates optimal water allocation schemes while minimizing total costs. The total cost of water allocation consists of the allocated water cost, the opportunity loss for not meeting water demand, and the loss of the penalty for exceeding water demand. The uncertainties in water demand and supply are expressed by cumulative distribution functions. The optimal water allocation for each water use sector is determined by the water price, the unit loss of the penalty and opportunity loss, and the cumulative distribution functions. The model was then applied to monthly water allocation for domestic, industrial, and agricultural water use in two counties of Huizhou City, China, whose water supply mainly depends on Baipenzhu Reservoir. The water demand for each water use sector and the monthly reservoir inflow showed good fits with the uniform and P-III distributions, respectively. The water demand satisfied ratio for each water use sector was stable and increased for the optimal water allocation scheme from the newsvendor model-based framework, and the costs were lower compared with the actual water allocation scheme. The novel framework is characterized by less severe water shortages, lower costs, and greater similarity to actual water use compared with the traditional deterministic multi-objective analysis model, and demonstrates strong robustness in the advantages of lower released surplus water and higher water demand satisfied ratio. This novel framework yields the optimal water allocation for each water use sector by integrating the properties of the market (i.e., determining the opportunity loss for not meeting water demand) with the government (i.e., determining the water price and the loss of the penalty for exceeding water demand) under the strictest water resources management systems.

management, and it has been widely applied in many fields of economic management [35][36][37] , while it is barely applied in water resources management.
He et al. 38 applied the Newsvendor model to allocate regional water resources under the constraint of total water-use quota and provided optimal water allocation schemes for each sector and water governor in water resources management, however, uncertainties in water demand and supply are not considered and the total water use cost cannot be properly addressed.The impacts of changes in water price, the penalty for exceeding water demand and the opportunity loss for not meeting water demand on the optimal water allocation aren't investigated.The novelty of the current study is to propose a newsvendor model-based water resources allocation framework.This framework considers the uncertainties both in water inflows and demands, minimizes the total cost of allocated water and penalties for allocated water exceeding or failing to satisfy future water demand in the water resources allocation model.This newsvendor model improves the optimization of water resources allocation for the regional industrial water use sectors and was applied to optimize the monthly water allocation for domestic, industrial, and agricultural water use in two counties of Huizhou City, China to evaluate the efficiency of the proposed framework.Given that the original newsvendor model only considers uncertainty in demand, uncertainty in supply is also considered in the improved newsvendor model.Both the uncertainties in water inflow and demand are considered in the optimized water allocation scheme based on the improved newsvendor model (Abbreviated as WAINM, i.e., the first letter of "Water Allocation Improved Newsvendor Model"); uncertainties in both water inflows and demands are represented by probabilistic distributions.In addition to the allocated water cost, penalty losses for allocated water exceeding future water demand and opportunity losses for allocated water failing to satisfy future water demand are also quantified and incorporated into the objective function.The WAINM is developed to balance the relationship between uncertain water inflow and demand as well as allocated water for optimized water allocation schemes while minimizing total costs.A two-stage heuristic algorithm is proposed to solve the WAINM and obtain the optimal water allocation schemes.
The specific objectives of the current study are to (i) consider uncertainties in water demand and supply using cumulative distribution functions; (ii) construct the WAINM and evaluate the its efficiency, and (iii) reveal the impacts of water price, the penalty for exceeding water demand and the opportunity loss for not meeting water demand on the optimal water allocation.The results of this study will aid regional water allocation under stringent water resources management systems.

Proposed framework
In the proposed framework (Fig. 1), several possibility distribution functions are used to simulate the uncertainties in water demand and available water resources, and the cumulative distribution functions (CDFs) of water demand and available water resources are obtained.Next, the water allocation model (based on the newsvendor model) is constructed, and the solution method is chosen.The optimal water allocation scheme with the lowest total cost is determined.
Water allocation based on the newsvendor model.The classical newsvendor model.In the classical newsvendor model, the cost of each newspaper is c .Sometimes all the newspapers are sold, and sometimes there is a surplus of newspapers; if the newsvendor buys more newspapers in a day, he loses money at the return cost of h for each newspaper; if not enough newspapers are sold, he makes less money at the opportunity loss cost of v .An optimization model of the quantity of newspapers to purchase needs to be constructed to minimize the total cost.Newsvendor models are powerful tools for solving problems associated with uncertain decision making.The newsvendor problem is one of the most basic problems of random storage management, and it has been widely applied in many fields of economic management, such as goods ordering and storage and product distribution.
Newsvendor model-based framework for water allocation that considers the uncertainties in water supply and demand.
(1) Basic idea Like a newsvendor selling newspapers (i.e., water allocation), when the unit purchasing cost (i.e., c ) of news- paper (i.e., the purchase cost of a unit water resource or water price), the unit loss (i.e., h ) of the over-purchased part (i.e., the penalty for exceeding water demand), and the unit loss (i.e., v ) of the under-purchased part (i.e., the opportunity loss for not meeting water demand) are known, and the exact demand (i.e., water demand during a period) is unknown, the number of newspapers the newsvendor should purchase every day (i.e., how much water should be allocated) needs to be determined to minimize the total cost (i.e., the total cost of water allocation).One of the basic assumptions of the newsvendor model is that the demand for newspapers is uncertain, which corresponds to the uncertainty in the water demand of each water use sector in the water resources allocation model.There is no limit to the quantity of goods in the classical newsvendor model.The available water resources are limited and uncertain under changing environments; available water resources are limited by the engineering capacity.The classical newsvendor model needs to be improved to develop a water resources allocation model that considers the uncertainties in both water supply and demand.
The main advantages gained by the analogy of water allocation to the newsvendor problem are as follows: (1) the allocated water cost as well as the penalty and opportunity loss can be properly considered when allocating water resources and determining the constrained total water use, which fits well with the most stringent water management system; (2) the impacts of changes in water price, the penalty for exceeding water demand and www.nature.com/scientificreports/ the opportunity loss for not meeting water demand on the optimal water allocation can be quantified via the newsvendor model-based water resources allocation framework, which aids water governor for effective water resources management.
(2) Improved newsvendor-based framework for water allocation that considers the uncertainties in water supply and demand Water resources allocation involves reasonably allocating limited water resources among different water use sectors and ensuring the efficient utilization of water resources.If a region is divided into i ( i = 1, 2, 3, . . ., I ) calculation units, there are j ( j = 1, 2, 3, . . ., J ) water use sectors for each calculation unit.The objective function based on the newsvendor model is determined to minimize the total cost of water allocation.The cost function of the j th water use sector in the i th calculation unit is as follows: The expected cost functions are as follows: (1) www.nature.com/scientificreports/where, in time period t , D t i,j represents the water demand; x t i,j represents the allocated water resources; R t and g R t represent the runoff and its density function, respectively; and C o , C u , and C p represent the expected loss of the penalty for exceeding water demand, the expected opportunity loss for not meeting water demand, and the expected cost of allocated water, respectively.C x t i,j is a concave function that needs to be minimized to optimize the allocation of water.The upper and lower bounds of runoff and water demand need to be compared to define C x t i,j .
If R t max < D t i,jmax , where x t i,j * represents the optimal allocated water, and F i,j () represents the CDF of the water demand.If R t max > D t i,jmax , where x t i,j * represents the optimal allocated water, and the derivation procedure is provided in D1 in the supplementary information file.
In contrast to the unlimited order quantity in the classical Newsvendor model, available water resources in water allocation are constrained by the reservoir capacity.That is, the total amount of allocated water is limited by the discharge of the reservoir, and the discharge is also restricted by the design water level of the reservoir.The constraints are as follows: 1. Reservoir capacity constraint 2. Water balance constraint 3. Reservoir discharge constraint Equation ( 16) can be obtained from Eqs. ( 13) and ( 14): www.nature.com/scientificreports/ The maximum reservoir discharge where V t , r t , and Q t represent reservoir capacity, inflow, and outflow in time period t , respectively.The optimal allocated water x t i,j * can be obtained according to the above expected cost function and constraints.If V t < V min , then the total allocated water exceeds the maximum discharge of the reservoir; x t i,j * is not the optimal allocated water and requires modification.In the current study, a two-phase heuristic algorithm was introduced to obtain the optimal allocated water x t i,j * .In this method, a new Lagrange function is constructed by linking the expected cost function with the constraint of available water resources through Lagrange parameters (e.g., ), and then the newsvendor model of water resources allocation under limited available water resources is solved by solving the new Lagrange function.
The new Lagrange function is as follows: where represents the Lagrange parameter.The optimal allocated water x t i,j * can be obtained as follows: where x t i,j * represents the optimal allocated water, which can be represented by .An optimal value of is calculated to obtain the optimal allocated water x t i,j * .x t i,j * is determined by the water price ( c ), the unit loss of the penalty for exceeding water demand ( h ), and the unit loss ( v ) of opportunity loss for not meeting the water demand of the j th water use sector in the i th region.The CDFs of water use and reservoir inflow also affect the optimal allocated water.
The detailed derivation procedure is provided in D2 in the supplementary information file.

Uniform and P-III distributions.
The uniform distribution has been a useful tool for describing the distribution of some water-related elements such as irrigated water depth 39 and daily streamflow 40 .Given the rapid development of the agricultural industry and population growth, data for the first three years of the forecasted years were used for the historical data analysis.We assumed that agricultural, industrial, and urban water demand fit the uniform distribution 41,42 , and the highest value in the previous three years serves as the upper bound and the lowest value serves as the lower bound.That is, P-III is the most commonly used probability distribution for calculating the frequency of the main hydrological elements (e.g., rainfall, runoff) in China in recent decades 43 .The P-III distribution function is as follows: where γ represents the unknown shape parameter and Ŵ(γ ) is a gamma function.Equation ( 24) can be obtained by the standardized transformation of Eq. (23).P-III is used to fit the historical monthly inflow series, and the design monthly inflow can be calculated according to the design frequency.( 17)  S1.Table S1 also shows the unit loss of opportunity loss for not meeting water demand.

Results and discussion
Water demand and supply inputs.
(1) The design monthly inflow of Baipenzhu Reservoir The frequency curves of the inflow of Baipenzhu Reservoir from Jan to Dec are shown in Fig. S1, and the correlation coefficient of each month is shown in Table S2.The degree of fit of the P-III frequency curve was very high, and the minimum correlation coefficient was as high as 0.9.The P-III frequency curve could be used to fit the monthly inflow distribution of Baipenzhu Reservoir.
(2) Industrial water demand Table 1 shows the upper and lower bounds of the agricultural, industrial, and domestic water demand from 2005 to 2011 in Huidong and Huiyang.Industrial and domestic water consumptions were assumed to have an even intra-annual distribution (Table S3), and the intra-annual distribution of agricultural water consumption was deduced from the average water use from 2002 to 2011.Since the development of agriculture is stable, the average errors of the prediction of agricultural water demand are small, with a maximum of 8.01% and minimum of 2.07% (Table 1).Due to the rapid development of the industrial economy and population growth in the study area 44 , the prediction errors of industrial and domestic water demand were larger; the maximum average prediction error of the industrial and domestic water demand was 34.52% and 17.38%, respectively.The prediction error decreased gradually with time, and the minimum average prediction error of industrial and domestic water demand was -1.07%and -0.94%, respectively.The assumption that the water demand fits the uniform distribution is reasonable; the water demand can be predicted by the probability distribution function deduced from historical water use data.the reservoir (Fig. 3).Basically, higher reservoir inflow corresponds to a higher water demand satisfied ratio (Table 2) (e.g., 100% from 2005 to 2008).The water demand satisfied ratio is lower when there are fewer inflows (e.g., from 2009 to 2011).A greater release of surplus water from the reservoir in actual allocation causes the available water resources in the reservoir to be insufficient and lowers the water demand satisfied ratio during the latter period (Table 2).Although there was some variation in water inflow, both the optimal allocated water and actual water use were stable, and the optimal allocated water of each year was almost equal to the actual water use, ensuring that the water satisfied ratio remains high and stable in optimal allocation (Fig. 3).This is superior to actual allocated water, which shows consistent decrease and greater variation.This poses a major challenge for water supply security.One percent of the water demand satisfied ratio corresponds to one score; the number of scores for actual allocated water was 653, which is lower than that of optimal allocated water with 685 scores (Fig. 4), demonstrating the greater effectiveness of the WAINM.Tables 3, 4 and Table S4 show the actual water use, optimal allocated water and actual allocated water from 2005 to 2011 for each water use sector, respectively.During this period, the agricultural, industrial and domestic water use respectively shows significant decrease, significant increase and fluctuating increase (Table 3).This is mainly due to the improved water use efficiency and the adoption of water saving technologies under the strictest water resources management systems.In the optimal water allocation, the optimal allocated water for each water use sector is determined according to the water price, the unit loss of the penalty for exceeding water demand, and the unit loss of opportunity loss for not meeting the water demand, as well as the maximum monthly water demand and water inflow, and shows similar change trend to that of the actual water use (Table 4), whereas in the actual water allocation (Table S4), the actual allocated water for each water use sector shows greater variation and doesn't match the actual water use well compared to the optimal allocated water.In the actual water allocation, higher reservoir inflow permitted the allocation of water to each water use sector to meet water demand from 2005 to 2008; a higher water demand satisfied ratio was achieved during this period, and more surplus water was released from the reservoir (Table S5).This also resulted in a lower water demand satisfied ratio from 2009 to 2011 given that reservoir inflow was lower during this period, and more surplus water was released from the  www.nature.com/scientificreports/reservoir during the earlier period.The overall increasing and stable water demand satisfied ratio in the optimal water allocation scheme demonstrated the superiority of the WAINM compared with the actual water allocation.

Water allocation based on the improved newsvendor model. Water demand satisfied ratio.
Water allocation cost.The cost of the optimal allocated water was only 48 billion CHY, which is much less than 71.4 billion CHY in actual allocated water (Table S6; Fig. 5).In 2005 and 2007, the cost of optimal allocated water was higher than that of actual allocated water, and the cost of optimal allocated water decreased after 2008.From  www.nature.com/scientificreports/2009 to 2011, the cost of optimal allocated water was significantly lower than that of actual allocated water.This stems from the fact that the water demand satisfied ratios in the actual water allocation scheme were all 100% from 2005 to 2008 and were higher than those under optimal water allocation (Table 2).This suggests that water demand was not fully met in the optimal allocation scheme, and the allocated water cost and opportunity loss for not meeting water demand in the optimal allocation scheme were greater than that of the actual allocation scheme, even if there was a loss of the penalty for exceeding water demand in the actual water allocation scheme.
The unit loss of the opportunity loss is greater than the water price and the unit loss of the penalty loss for each water use sector (Table S1); the opportunity loss is much greater than both the allocated water cost and penalty loss, and it accounts for much of the total cost of water allocation, demonstrating that the total cost of the optimal water allocation scheme (i.e., with lower water demand satisfied ratio and higher opportunity loss) was greater than that of the actual water allocation scheme (i.e., with higher water demand satisfied ratio and lower opportunity loss).From 2009 to 2011, the water demand satisfied ratios in the optimal water allocation scheme were higher than those in the actual water allocation scheme, which decreases the opportunity loss and the total cost of water allocation across the three years.
From the perspective of uncertainty, the optimal allocation of water resources can be divided into deterministic allocation and uncertain allocation.In light of the uncertainty in available water and water demand, water allocation by the WAINM is classified as uncertain allocation.The water allocation results by the WAINM were compared with the water allocation results from the water resources allocation scheme in the Dongjiang River Basin of Guangdong Province, which was obtained via the deterministic allocation model using a multi-objective analysis method (i.e., MOA model) (Table S7).Compared with actual water use, water shortage occurred in both of the water allocation schemes obtained by the WAINM and MOA models (the WAINM allocated more water for agricultural water use, which resulted in abandoned water) (Table S7).The water shortage of the water allocation schemes obtained by the MOA model was much greater than that of the WAINM, especially water allocation for agricultural water use, as the MOA model applied the water supply design guarantee rate parameter when attempting to optimize allocation decisions 45 .In the MOA model, the water supply guarantee rate of agricultural water use was the lowest; the agricultural water shortage was the most severe.The water shortage of the industrial water allocation scheme obtained by the MOA model was less than that of the WAINM, which mainly stemmed from the higher guarantee rate of the industrial water supply 46 .Nevertheless, the total water shortage in the optimal water allocation scheme obtained by the MOA model was 32.6 million m 3 , which was much higher than that of the water allocation scheme obtained by the WAINM with a water shortage of 3.1 million m 3 .The price parameters in Table S1 were used to calculate the cost of the two types of water allocation schemes.The water allocation cost of the MOA model was much higher than that of the WAINM (Table S7).The water shortage was less severe and the costs were lower for the optimal water allocation scheme obtained by the WAINM under an uncertain water supply compared with the traditional deterministic MOA model; these results were also more similar to actual water use.
Sensitivity analysis of the three cost price parameters in the water allocation improved newsvendor model.Figure 6 shows the impacts of changes in c , h and v on the optimal water allocation obtained by the WAINM in terms of surplus water released from reservoir and score.When the three parameters of each industry are doubled or decreased by 50%, both the surplus water released from reservoir and score of the corresponding optimal water allocation scheme show some changes, and the surplus water released from reservoir has greater change.In particular, the scores have barely changed, showing strong robustness of the WAINM.No matter how the three parameters change, the optimal water allocation shows obvious advantages over the actual water allocation, with less surplus water released from reservoir and higher guarantee rate of water supply.
Fig. S2 shows the change rates of optimal allocated water caused by doubled or decreased by 50% changes of h and v for each water use sector from 2005 to 2011, respectively.Obviously, in all years, changes of c , h and v for agriculture lead to the largest change range of allocated water (i.e., with an average of 0.126% by c , 0.772% by h , and 0.887% by v ), followed by industrial (i.e., with an average of 0.055% by c , 0.448% by h , and 0.500% by v ), and domestic has the least change range (i.e., with an average of 0.016% by c , 0.149% by h , and 0.165% by v ).Although the three parameters of agricultural water use were the lowest, the optimal allocated water caused by their changes were the biggest, because agricultural water use accounts for the most in the basin 47 .The optimal allocated water has the highest sensitivity to the change of v , followed by h , and the lowest sensitivity to the change of c , because c is the lowest of the three parameters, and the change of c has little effect on the allocation of water.The change of h has greater impact, and the change of v has the greatest impact, indicating that among the three price parameters of the WAINM, the opportunity loss has the greatest impact on the allocated water while the water price has the least impact.
The WAINM has several advantages compared with actual water allocation and the traditional deterministic MOA model.It helps decision makers determine the optimal water allocation schemes and achieve a stable water demand satisfied ratio for each water use sector at the lowest total cost; it also uses the CDFs to represent the uncertainties in both water demand and supply, which is more similar to the actual water resources system.
The optimal water allocation amount obtained by the WAINM for each water use sector is determined by the water price, the unit loss of the penalty for exceeding water demand, the unit loss of opportunity loss for not meeting the water demand of the water use sector, and the CDFs of water use and supply.The water price and the unit loss of the penalty and opportunity loss can be determined by the market or by the government; It is difficult to predict regional water demand, because the influencing factors are complex and dynamic, and water demand prediction is full of challenges with greater uncertainty 48,49 .In the current study, considering the short and stable time series of industrial water demand in the study area, meanwhile, the number of newspapers the newsvendor purchased every day in the Newsvendor model was assumed to conform to a uniform distribution [35][36][37] , the demand for newspapers is uncertain, just like the uncertainty in the water demand of each water use sector in the water resources allocation model, therefore, the uniform distribution was chosen to express the uncertainties in water demand.The parameter of the uniform distribution was calibrated and validated with time series of observed water use in the study area, and the uniform distribution for each water use sector was taken as the input for the WAINM.
Practical applications and future research prospects.The novel proposed framework can be applied to provide optimal water allocation schemes for water governors in the fast-developing countries or regions with the strictest water resources management systems, according to the water price and the unit loss of the penalty and opportunity loss determined by the water market or by the government.The cumulative distributions applied in the WAINM can be adjusted in real time according to the water use characteristics of the region and the temporal distribution of reservoir inflows of the reservoir, and the impact of regional water demand and supply on the optimal water allocation amount should be further studied.Some constraints can be added in the WAINM to ensure the superiority of domestic water use in future studies.

Conclusions
The current study proposed a newsvendor model-based framework for water allocation.The possibility distribution functions of both water demand and supply, as well as the cost of each water use sector, the unit loss of the exceeding water demand, and the unit loss of the penalty for not meeting water demand, were incorporated into the framework to determine the optimized water allocation schemes with lowest total costs.The case study suggests that, in the optimal water allocation scheme from the WAINM, the water demand satisfied ratio increased and the costs were lower compared with actual water allocation.The total water shortage and cost in the optimal water allocation scheme by the traditional deterministic MOA model were respectively 9.52 and 2.26 times larger than that of the water allocation scheme by the WAINM.Sensitivity analysis of the three cost price parameters demonstrated the strong robustness of the WAINM. https://doi.org/10.1038/s41598-023-40692-7 https://doi.org/10.1038/s41598-023-40692-7 Baipenzhu Reservoir, Dongjiang River Basin, China Basic information.Baipenzhu Reservoir is located in the upper stream of the Xizhi River (Fig.2); it was constructed in April 1958 and has a drainage area of 856 km 2 and total reservoir capacity of 1.22 billion m 3 .Baipenzhu Reservoir is a large reservoir that functions in flood control, irrigation, power generation, and navigation.It also serves as one of the main water sources of Huidong and Huiyang, which are the two counties of Huizhou City, Guangdong Province.The two counties have exhibited stable industrial water use in recent decades; nevertheless, there is an urgent need to develop a model to optimize the allocation of the scarce water resources of Baipenzhu Reservoir among the different uses of industrial water in the two counties.Data.The uniform distribution was applied to analyze the uncertainties in the water demand of Huidong andHuiyang in terms of the design frequency, according to the time series of historical water use data collected from the Guangdong Water Resources Bulletin and Huizhou Statistical Yearbook (2002-2011).The P-III distribution was applied to simulate the monthly inflow of Baipenzhu Reservoir under different frequencies according to the observed inflow of the reservoir from 1985 to 2011, the data of which were obtained from the Guangdong Hydrology Bureau.The water price of each water use sector and the unit loss of the penalty for exceeding water demand are shown in Table
Fig-ure3shows actual water use, actual allocated water, and optimal allocated water by the WAINM and the inflow of Baipenzhu Reservoir from 2005 to 2011.The actual allocated water is greater than the optimal allocated water when the reservoir inflow is higher (such as for 2006 and 2008) and more surplus water is released from

Figure 3 .
Figure 3.Comparison of water use and actual and optimal allocated water (Unit: million m 3 ).

Figure 4 .
Figure 4. Comparison of the overall water demand satisfied ratio under actual and optimal water allocation.

Figure 5 .
Figure 5.Comparison of the cost of actual and optimal water allocation.

Figure 6 .
Figure 6.Changes in c, h and v on the optimal water allocation obtained in terms of surplus water released from reservoir and score of water demand satisfied ratio.

Table 1 .
The upper and lower bounds of predicted and historical water use (million m 3 ).

Table 2 .
Comparison of the water demand satisfied ratio and water surplus under actual and optimal water allocation.

Table 4 .
Optimal allocated water by the Water allocation based on the Improved Newsvendor Model (million m 3 ).