Marginal Uncertainty Cost Functions for Solar Photovoltaic, Wind Energy, Hydro Generators, and Plug-In Electric Vehicles

: The high penetration of renewable sources of energy in electrical power systems implies an increase in the uncertainty variables of the economic dispatch (ED). Uncertainty costs are a metric to quantify the variability introduced from renewable energy generation, that is to say: wind energy generation (WEG), run-of-the-river hydro generators (RHG), and solar photovoltaic generation (PVG). On other side, there are associated uncertainties to the charge/uncharge of plug-in electric vehicles (PEV). Thus, in this paper, the uncertainty cost functions (UCF) and their marginal expressions as a way of modeling and assessment of stochasticity in power systems with high penetration of smart grids elements is presented. In this work, a mathematical analysis is presented using the ﬁrst and second derivatives of the UCF, where the marginal uncertainty cost functions (MUCF) and the UCF’s minimums for PVG, WEG, PEV, and RHG are derived. Further, a model validation is presented, considering comparative test results from the state of the art of the UCF minimum, developed in a previous study, to the minimum reached with the presented (MUCF) solution.


Introduction
In recent years, solar photovoltaic and wind energy sources of energy have been acquiring more relevance in the electric power systems. These sources are penetrating in systems where only conventional energy generation as thermal and hydraulic have been present. In the same way, in countries, like Colombia, where the hydraulic potential of generation is high, several run-of-the-river Hydro Generators have been constructed.
The aforementioned sources are renewable energy sources and their power dispatch should deal with uncertainties related to their primary energy source, in this way, in Reference [1], long-time performance of an electric vehicle charging station with photovoltaic generation (PVG), batteries, and a hydrogen system were evaluated through a proposed energy management system. In Reference [2], uncertainties were treated through a general analytic technique to evaluate the technical impact in radial distribution systems. In Reference [3], a decentralized energy management system was proposed to achieve an efficient charging of electric vehicles in a medium voltage direct current charge station.
Although solar, wind energy, or run-of-the-river energy sources apparently do not have any cost referring to their primary energy source, it is possible to model overestimation or underestimation costs, through Uncertainty Cost functions (UCF). This modeling is based on the dispatched power, estimated through probability functions [4][5][6], considering the primary source's stochasticity.
Based on the mentioned approach, in Reference [7], PVG, wind energy generation (WEG), and plug-in electric vehicles (PEV) underestimation and overestimation UCF were modeled. In Reference [8], run-of-the-river hydro generators uncertainty costs were derived, as well. Regarding loads and its uncertainty cost modeling, it is observed In Reference [9], that uncertainty costs of controllable loads can be derived considering the same mathematical approach as electric vehicles.
Given that, in the mentioned previous work, uncertainty costs associated with normal, lognormal, Gumbell, and Rayleigh Probability Density Functions (PDF) were assumed, in Reference [10], a simplified calculation of UCF through an uniform PDF is proposed. Another simplification of the uncertainty cost models is shown in Reference [11], where UCF are approximated by quadratic functions, and this quadratic approximation is used to perform an economic dispatch.
From the UCF calculations, Optimal Power Flow (OPF) was calculated using heuristic techniques for the IEEE 118 nodes system, considering PVG, PEV, and WEG [12]. In addition to the previous OPF, controllable loads were also evaluated with PVG, PEV, and WEG, in an OPF that was solved by DEEPSO algorithm [13,14].
In Reference [15], an OPF in multiple time periods, considering PVG, WEG, and PEV, was calculated through DEEPSO algorithm. Finally, in Reference [6], UCF were used in order to handle, in discrete intervals, the variable cost of generation (e.g., one minute), in which a forecast for renewable, non-conventional sources could be available.
Excluding Reference [6], where the uncertainty costs were modeled as integrals and the OPF was evaluated, in the previously mentioned studies, uncertainty costs were analytically derived and applied to OPF calculation through heuristic optimization techniques. However, power values that minimize UCF for renewable non-conventional dispatched power were not estimated, that is to say, there was no evaluation of the global optimal operation point.
The goals of this paper are (i) to determine and validate the costs that minimize the UCF (presented in Sections 2 and 3 from previous studies) for solar, wind, plug-in electric vehicles, and run-of-the-river hydro generators and (ii) to present an analytical formulation of Marginal uncertainty costs functions. In order to achieve these goals, the first derivatives of costs functions were calculated with the aim of determining critical points (Section 4). Simultaneously, second derivatives were calculated so as to establish if the found values were effectively local minimum values. Next, analytic minimum values were derived, and, finally, a comparison of the results obtained with previous works results was performed (Section 5).

Concept of Uncertainty Cost Functions from Previous Studies
In order to calculate Uncertainty Costs Functions (UCF), it is necessary to define underestimation and overestimation costs developed in previous studies [5,7].

Uncertainty Cost Due to Underestimate
Costs due to underestimation refer to the power that a renewable generation unit cannot deliver to the grid when the scheduled power value of the plant is smaller than the available generation power: where P Sch and P Av are the scheduled power and the available power, respectively. In this case, penalty cost due to underestimate is given by: where c u is the penalty cost coefficient due to underestimate, and P max is the generator maximum output power. Now, because of the variability of the renewable power sources, the power generated by these sources has a Probability Density Function (PDF) f n (P) associated. The uncertainty cost due to underestimation is defined as the expected value of C sub (developed from Expression (2)):

Uncertainty Cost Due to Overestimate
Costs due to overestimate are referred to the power that cannot be supplied by a renewable generator because available power is smaller than previously scheduled power: In this case, penalty cost due to overestimation is given by: where c o is the penalty cost coefficient due to overestimate, and P min is the generator minimum output power.
In the same way as the underestimation condition and based on the stochastic nature of renewable sources, the uncertainty cost due to overestimate is given by the expected value of C so (developed from Expression (5)): Finally, Uncertainty Cost Function (UCF) for a given renewable source is equal to the sum of underestimation and overestimation costs (developed from Expressions (3) and (6), respectively):

Presentation of Uncertainty Cost Functions of PVG, WEG, PEV, and Run-of-the-River Hydro Generators (RHG)
In this section, uncertainty costs functions due to overestimate and underestimate for PVG, WEG, PEV, and RHG are presented from previous studies (it is presented just the formulation, as an input for Sections 4 and 5). These uncertainty costs functions were calculated considering integrals (3) and (6). Further details about the UCF calculations can be found in References [5,7,8].

Photovoltaic Generation UCF
Considering PVG case, there are two conditions related to the solar irradiation and the photovoltaic power generation [6,7,16]. In Reference [7], a variable W Rc is defined so that for generated power smaller than W Rc , the generated power has a quadratic relationship with the solar irradiation, and for generated power higher than W Rc , the relationship between generated power and solar irradiation is linear. W Rc is defined as follows: where W PVr is the rated power of the PVG source, G r is the rated irradiance of the geographical environment, and R c is a reference value according to the specific geographical location [6,7]. Then, two conditions are defined related to W Rc and W PV,i , the available power for a generator i, as follows: In the following, variables that appears in Expressions (9)- (14) are defined: c PV ,u,i is the penalty cost coefficient due to underestimate in the PVG for generator i, W PV ,∞,i is the maximum power output of the PVG i, c PV ,o,i is the penalty cost coefficient due to overestimate in the PVG for generator i, W PV ,s,i is the scheduled PV power set by Economic Dispatch (ED) model in generator i, λ is the location parameter of the log-normal distribution, β is the scale parameter of the log-normal distribution, and er f is the error function.
Uncertainty underestimation and overestimation costs in Expressions (9)- (14), considering both A and B conditions, are calculated as an expected value from Expressions (3) and (6)  The Uncertainty cost due to underestimate when W PV ,s,i ≤ W Rc is given by the sum of the functions f 1 (W PV,s,i ) (Expression (9)) and f 2 (W PV,s,i ) (Expression (10)): The uncertainty cost due to overestimate is given by the function f 11 (W PV,s,i ) presented in the following: The uncertainty cost due to overestimate is given by the function f 10 (W PV,s,i ), presented in the following: The uncertainty cost due to overestimate when W PV ,s,i > W Rc is the sum of the functions f 3 (W PV,s,i ) and f 4 (W PV,s,i ), presented in Expressions (13) and (14): Finally, it is possible to obtain the UCF for PVG case in both conditions: W PV ,s,i ≤ W Rc and W PV ,s,i > W Rc . When W PV ,s,i ≤ W Rc , UCF is given by the sum of functions (9)- (11). On the other hand, when W PV ,s,i > W Rc , UCF is given by the sum of functions (12)- (14).

Wind Energy Generation UCF
In this subsection, uncertainty underestimation and overestimation costs for Wind Energy Generators (WEG) are presented. This costs are calculated through the expected value defined in Expressions (3) and (6), modeling wind speed behavior as a Rayleigh distribution [4][5][6]17], and using statistical variable change theorem in order to express the probability density function of wind speed in terms of the active power generated by the WEG [7].
The variables that are used in subsequent definitions and expressions for wind energy uncertainty costs functions are defined in the following: is the penalty cost coefficient due to underestimate in the WEG for generator i, c w,o,i is the penalty cost coefficient due to overestimate in the WEG for generator i, W r is the maximum power of the WEG generator i, W w,s,i is the scheduled WEG power set by ED model in generator i, v r is the rated wind speed, v i is the WEG cut-in wind speed, v 0 is the WEG cut-out wind speed, and σ is a Rayleigh PDF scale parameter.
ρ and κ are defined as follows:

Uncertainty Cost Due to Underestimate in WEG Case
The uncertainty cost due to underestimate for WEG is given by the function f 5 (W w,s,i ) (Expression (17)) [7]:

Uncertainty Cost Due to Overestimate in WEG Case
The uncertainty cost due to overestimate for WEG is presented in the following [7]: Finally, the UCF for WEG is obtained by the sum of Expressions (17) and (18).

Plug-in Electric Vehicles UCF
In this subsection, uncertainty underestimation and overestimation costs for plug-in electric vehicles (PEV) are presented taking as reference [7]. The variables that are used in subsequent definitions and expressions for plug-in electric vehicles costs functions are defined in the following: c e,u,i is the penalty cost coefficient due to underestimate in the PEV in node i, c e,o,i is the penalty cost coefficient due to overestimate in the PEV in node i, P e,s,i is the scheduled PEVs power set by ED model in node i, µ is the mean of the PEVs power, and φ is the standard deviation of the PEVs power.

Uncertainty Cost Due to Underestimate in PEV Case
Uncertainty cost due to underestimate is estimated through the expected value (3), giving the Expression (19):

Uncertainty Cost Due to Overestimate in PEV Case
Uncertainty cost due to underestimate is estimated through the expected value (6) giving the Expression (20): Then, the UCF for PEV is given by the sum of Expressions (19) and (20).

Run-of-the-River Hydro Generators UCF
In this subsection, uncertainty underestimation and overestimation costs for run-of-the-river hydro generators (RHG) are presented. These costs are calculated through the expected value defined in Expressions (3) and (6), modeling discharge behavior as a Gumbel distribution [21][22][23], and using statistical variable change theorem in order to express the probability density function of wind speed in terms of the active power generated by the RHG [8].
The variables used in subsequent definitions and expressions for REG uncertainty cost functions are defined in the following: c HYD,u,i is the penalty cost coefficient due to underestimate in the RHG in node i, c HYD,o,i is the penalty cost coefficient due to overestimate in the RHG in node i, W HYD,s,i is the scheduled RHG power set by ED model in node i, W HYD,∞,i is the maximum RHG power generation capacity generator in node i, µ is the mean value of discharge σ is the standard deviation of discharge, ρ is water density in kg/m 3 , η t is hydro turbine efficiency, η g is electric generator efficiency, η m is generator-turbine coupling efficiency, h is the height difference in the power station in meters, Ei is the exponential integral function, and k is defined as follows: 3.4.1. Uncertainty Cost Due to Underestimate in Run-of-the-River Hydro Generators Case Uncertainty cost due to underestimate in RHG is calculated from Expression (3), giving the uncertainty cost due to underestimate for RHG (Expression (22)) [8]:

Uncertainty Cost Due to Overestimate in RHG Case
Uncertainty cost due to overestimate in RHG is calculated from Expression (6), giving the uncertainty cost due to underestimate for RHG (Expression (23)) [8]: Thus, the UCF for RHG is equal to the sum of Expressions (22) and (23).

Formulation and Application of Marginal Cost Functions of PVG, WEG, PEV, and RHG
Marginal cost is defined as the increment of the total cost due to an increment of a unit of production [24]. Mathematically, marginal cost is the derivative of a cost function with respect to produced quantity. Here, UCF derivatives with respect to scheduled power are shown for PVG, WEG, PEV, and RHG.

Marginal Uncertainty Cost Function for PVG
The UCF for PVG when W PV ,s,i ≤ W Rc is given by the sum of Expressions (9)- (11). The derivatives of these expressions are calculated independently and must be added to get the total UCF derivative.
In order to calculate the derivative of the Expression (9), the next constants are defined: Now, f 1 (W PV,s,i ) can be rewritten in terms of the previously defined constants: Then, the derivative of f 1 (W PV,s,i ) with respect to W PV,s,i is: From the derivative shown in Expression (25), the second derivative is calculated: In order to calculate the derivative of Expression (10), the next constants are defined: With the previously mentioned constants, Expression (10) is rewritten: Then, the derivative of f 2 (W PV,s,i ) with respect to W PV,s,i is: The second derivative of Expression (28) is easily found: Finally, the derivative of Expression (11) is calculated. In order to do so, the following constants are defined: Expression (11) is rewritten in terms of the previously defined constants: Now, the derivative of Expression (30) is calculated: (32) In this way, the marginal cost of PVG when W PV ,s,i ≤ W Rc is equal to the sum of Expressions (25), (28), and (31).

When W PV ,s,i > W Rc
The UCF for PVG when W PV ,s,i > W Rc is given by the sum of Expressions (12)- (14). The derivatives of these expressions are calculated independently and must be added to get the total UCF derivative.
In order to calculate the derivative of the Expression (12) the next constants are defined: Expression (12) is rewritten in terms of the previously defined constants: f 10 (W PV,s,i ) = k 10,1 · W PV ,s,i er f ln(k 10,7 · W PV,s,i ) − λ k 10,6 − k 10,2 + k 10,5 k 10,3 − er f ln(k 10,7 · W PV,s,i ) − λ k 10,6 − k 10,4 . (33) Now, the derivative of Expression (33) is calculated: In order to calculate the derivative of Expression (13) the next constants are defined: Now, f 3 (W PV,s,i ) can be rewritten in terms of the previously defined constants: Then, the derivative of f 3 (W PV,s,i ) with respect to W PV,s,i is: The second derivative of f 3 (W PV,s,i ) is easily calculated from (37): Finally, the derivative of Expression (14) is calculated. In order to do so, the following constants are defined: With the previously mentioned constants, Expression (14) is rewritten: Then, the derivative of f 4 (W PV,s,i ) with respect to W PV,s,i is: From Expression (40), second derivative of f 4 (W PV,s,i ) with respect to W PV,s,i is calculated: In this way, the marginal cost of PVG when W PV ,s,i > W Rc is the sum of Expressions (34), (37), and (40).

Marginal Uncertainty Cost Function for WEG
In order to derive the marginal UCF of wind energy generators, the derivatives of Expressions (17) and (18) are calculated following a similar procedure as in the PEV case. In the case of the Uncertainty cost due to underestimate (Expression (17)), the following constants are defined: Expression (17) can be rewritten in terms of the previous constants: The first derivative of Expression (42) with respect to W w,s,i is shown in the following: The second derivative of f 5 (W w,s,i ) with respect to W w,s,i is calculated from Expression (43) Now, for the Uncertainty cost due to overestimate (Expression (18)), the next constants are defined: 2ρ 2 σ 2 ), Then, Expression (18) is rewritten in terms of the previous constants: The derivative of Expression (45) is presented in the following: The second derivative of f 6 (W w,s,i ) with respect to W w,s,i is calculated from Expression (46): In this way, the marginal cost can be calculated through the sum of Expressions (43) and (46).

Marginal Uncertainty Cost Function for PEV
In order to estimate marginal UCF for PEV, UCF (19) and (20) derivatives should be calculated. In order to calculate the derivative of Uncertainty cost due to underestimate (Expression (19)), the next constants are defined: Then, Equation (19) can be rewritten as: The second derivative of f 7 (P e,s,i ) with respect to P e,s,i is calculated from Expression (49): Now, in order to calculate the derivative of the Uncertainty cost due to overestimate function (Expression (20)), the next constants are defined: (20) is rewritten in terms of the previously defined constants:

Now, Expression
Finally, the first derivative of Expression (51) is calculated: Expression (52) is used to calculate the second derivative of f 8 with respect to P e,s,i as follows: In this way, it is possible to calculate the marginal cost UCF for PEV through the sum of Expressions (49) and (52).

Marginal Uncertainty Cost Function for RHG
The marginal UCF for RHG is obtained through the derivative of Expressions (22) and (23) referred to Uncertainty cost due to underestimate and overestimate, respectively. In order to calculate the derivative of the Uncertainty cost due to underestimate, the next constants are defined: Expression (22) is rewritten using the defined constants: f 9 (W HYD,s,i ) = k 9,1 (W HYD,s,i − W HYD,∞,i ) · k 9,2 + k 9,3 · k 9,4 − Ei − e W HYD,s,i −k 9,5 k 9,3 . (54) Now, the derivative of Expression (54) is calculated: The second derivative of f 9 with respect to W HYD,s,i is calculated from Expression (55): HYD,s,i = k 9,1 k 9,3 · e W HYD,s,i −k 9,5 k 9,3 · e −e W HYD,s,i −k 9,5 k 9,3 . (56) In order to calculate the derivative of the Uncertainty cost due to overestimate for RHG (Expression (23)), the next constants are defined: With the previously defined constants, Expression (23) is rewritten as follows: From Expression (58), it is possible to calculate the second derivative of f 12 with respect to W HYD,s,i : (59)

Application: Minimum Costs for PVG, WEG, PEV, and RHG Generation Units
In the previous section, the first and second derivatives of costs functions (marginal uncertianty cost functions) were calculated starting from the formulation in Reference [7,8]. Here, these derivatives are used to calculate minimum uncertainty costs for PVG, WEG, PEV, and RHG generators. In order to calculate these minimum values, the injected powers, which makes the uncertainty marginal costs functions equal to zero, are estimated through the false position method [25]. Next, second derivative signs are verified in order to evaluate the concavity of the function.
The results presented in Table 1 are consistent with previous research findings, presented in Figures 1-4, where the UCF area calculated with the formulation developed in Reference [7]. In Figures 1-4, it can be seen that minimum values of cost functions are reached at power values shown in the second column of Table 1, minimizing their respective cost functions. The aforementioned figures correspond to the state-of-the-art results [7,8].
In the following, in Table 2, the parameters used in minimum uncertainty costs calculations are presented for each technology. These parameters are the same used in previous research [7,8].

Conclusions
In previous research, uncertainty costs functions were calculated for PVG, WEG, PEV, and RHG units. One can note from the results that uncertainty costs functions have minimum cost values that were calculated analitically. In order to determine the values of dispatched power that minimizes uncertainty costs functions, marginal cost functions were calculated for PVG, WEG, PEV, and RHG units. The values that minimize uncertainty cost functions were determined by making marginal costs functions equal to zero and solving this equation through the false position method [25].
The obtained results were compared to previous research findings. The power values that minimizes the uncertainty costs are in accordance with previous research results [7,8]. This marginal costs functions and their derivatives can be used as an input for economic dispatch [26] and Optimal Power Flow (OPF) calculations. In the former case, many solvers, such as those used by Matpower [27] to perform extended OPF calculations, require analytical first and second derivatives of cost functions and constraints.
As future work, it is expected to include the analytic developments presented in this paper in operation planning of power systems, including renewable energy sources.
On the other hand, as mentioned, analytic formulations of the gradient (Marginal costs) and Hessian (Marginal cost derivatives) presented in this paper could be used to extend the traditional studies of OPF, e.g., OPF, contingency constrained OPF, unit commitment, etc.