{'fraction_non_alphanumeric': 0.03528692624013633, 'fraction_numerical': 0.012077205201348497, 'mean_word_length': 4.1377046060144655, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Network Risk Limiting Dispatch: Optimal Control and Price of Uncertainty

Increased uncertainty due to high penetration of renewables imposes significant costs to the system operators. The added costs depend on several factors including market design, performance of renewable generation forecasting and the specific dispatch procedure. Quantifying these costs has been limited to small sample Monte Carlo approaches applied specific dispatch algorithms. The computational complexity and accuracy of these approaches has limited the understanding of tradeoffs between different factors. {In this work we consider a two-stage stochastic economic dispatch problem. Our goal is to provide an analytical quantification and an intuitive understanding of the effects of uncertainties and network congestion on the dispatch procedure and the optimal cost.} We first consider an uncongested network and calculate the risk limiting dispatch. In addition, we derive the price of uncertainty, a number that characterizes the intrinsic impact of uncertainty on the integration cost of renewables. Then we extend the results to a network where one link can become congested. Under mild conditions, we calculate price of uncertainty even in this case. We show that risk limiting dispatch is given by a set of deterministic equilibrium equations. The dispatch solution yields an important insight: congested links do not create isolated nodes, even in a two-node network. In fact, the network can support backflows in congested links, that are useful to reduce the uncertainty by averaging supply across the network. We demonstrate the performance of our approach in standard IEEE benchmark networks.


I. INTRODUCTION
The existing electric grid is operated so that online generation is sufficient to meet peak period demand. But uncertainties arising from outages and unpredicted fluctuations in demand and renewable generation can cause a loss of load event, when online generation does not meet demand some load needs to be disconnected from the power system. To decrease the loss of load probability, the system operator (SO) schedules generation and transmission line capacity so it exceeds forecasted peak net demand by a small percentage (around 5%), to compensate for small amount of uncertainty due to generator contingencies and load forecast errors. This additional reserve capacity is utilized in real time as actual loads and contingencies are revealed. Typically energy and reserve capacity are scheduled following a '3-σ' rule: the total amount scheduled is the forecast plus '3-σ', where σ is the standard deviation of net demand forecasting error. Currently, the typical values of σ is around 1% to 2% of total load. Due to various incentives and state goals such as the renewable portfolio standards (RPS), renewables are expected to make up to 30% to 40% of generation mix in the USA. Increased penetration of renewable generation increases the uncertainty in the grid [1], [2]. In such scenario, the current deterministic dispatch practice would require large reserve capacity allocations. Such allocations increase energy costs significantly and accrue unwanted emissions [3]. For example, each additional 1% of reserve costs CAISO about 50 million dollars (based on 2009 costs). In light of the significant financial implications, various alternative forms of stochastic dispatch procedures have been studied [4], [5]. The goal of these procedures is to solve a dispatch program that utilizes available forecasts and the sequential decision nature of the problem. Past approaches often resulted in programs that were infeasible in practice due to computational complexity and relying on Monte-Carlo type approaches that could only be calculated with a limited number of scenario samples. The complexity of these procedures makes it even difficult to reliably evaluate the benefit of smart grid technologies or improvements in forecasting. Moreover, these approaches require significant changes in the operating procedures and software of system operators. In some cases, the forecast error distributions are not utilized appropriately or at all [6].
Recently, Risk Limiting Dispatch (RLD) [7], [8] was proposed as a new dispatch framework. By utilizing a simplified approach that is applied after unit commitment and does not consider network constraints, a very simple analytic dispatch rule can be obtained. The rule proposes an alternative deviation calculation that depends on error performance of forecasting, the costs of various generation alternatives and the timing of dispatch decisions stages. It was shown that in uncongested and lossless networks, the proposed dispatch significantly reduces the renewable integration cost. Moreover, reliable estimates of various metrics such as integration cost, emissions and costs due to forecasting performance can be easily obtained [3].
The first contribution of this paper is the derivation of risk limiting dispatch for a congested network. This dispatch is denoted the network RLD and we show that it is simple to implement computationally(without the need for Monte Carlo type of simulations), results in reliable and interpretable dispatch decisions and can be used to provide stable performance estimation. We model economic dispatch under uncertainty as a two-stage dispatch problem where the decision is made for each operating hour. Without loss of generality, we assume that the first stage occurs at the day ahead market and the second stage occurs at the real time market. In a day-ahead market (DAM), the SO purchases energy at generators connected to different buses in the network, utilizing forecasts and error distributions for loads and renewable generation at various buses. In the real-time market (RTM), dispatch decisions are made utilizing the realized values of all loads, renewable generations and physical network constraints such as transmission limits. We consider a DC power flow model for analysis and validate our results by considering full AC model in case studies.
The key observation that makes the problem tractable is that in real networks, only a very small number of transmission lines are congested. For example, the commonly used IEEE benchmark networks [9] are far from being congested under normal operations. Also, the WECC model for the California network only include a few congested lines [10]. We expect that the congestion patterns would not shift excessively under the uncertainty levels typically present in the renewable penetration levels expected in the near future. Intuitively, knowing the congestion patterns should reduce the complexity of the dispatch procedure since not all possible network constraints need to be considered. In this paper we formalize this intuition by developing an accurate picture of a network operating under expected congestion, that is where congestion is predicted in the DAM. We observe a novel fact: a network operating under expected congestion due to uncertainty behaves qualitatively different than a network under deterministic loads and generation. We introduce the concept of back flow to capture this behavior. Back flows are directed permissible flows in congested links that need to be included in a two stage dispatch. The possibility of back flow is somewhat surprising, as congestion in a two bus network in deterministic dispatch program implies the two buses are decoupled [11], [12]. We also develop a computationally simple dispatch approach that utilizes this structural understanding to compute the dispatch in a simplified form via a set of equilibrium equations. The proposed approach can be easily integrated into existing unit commitment and dispatch procedures of the system operators.
The second contribution of this paper is in developing the concept of price of uncertainty that characterize the intrinsic impact of uncertainty on the cost of dispatch. Given a network, the integration cost is defined as the difference between expected cost under the optimal dispatch procedure (i.e., RLD) and the dispatch cost if the SO has a clairvoyant view of all loads and renewable generations [13]. We observe that under the expected mild to moderate uncertainty levels, the integration cost increases linearly with the uncertainty in the forecast error and the per unit of uncertainty cost of integration is the price of uncertainty. The price of uncertainty can also be interpreted as the benefit of improving forecast procedures and can be used as a metric to evaluate the benefits of forecasting and provide a reference point to judge specific dispatch methodologies.
A brief discussion of related works follow. Monte Carlo based dispatch formulations that include security constraints and DC power flow balance have been studied recently [4], [14]- [19]. They result in difficult optimization problems that can only be evaluated with (limited) Monte Carlo runs and do not provide much insight into the dispatch methods. MPC approaches [20], [21] address recourse in decision making, but still rely on Monte Carlo, and may not be appropriate when the number of recourse opportunities is small, limiting the corrections calculated by MPC. Single market problems are more tractable [22]- [25] but do not capture the nature of recourse or congestion. Methodologies for assessing reserves in the presence of significant wind generation was presented in [26] without including two stages or congestion. Current deterministic dispatch avoids complicated procedures by considering a worst-case net load to be satisfied, namely the forecast plus three standard deviations of forecast error [27]. Other papers (e.g. [28], [29]) investigated a robust version of unit commitment utilizing a DC flow model without recourse to represent the market model, and [30] used a similar model but is fully adaptive to the realization of the uncertainties.
The remainder of the paper is organized as follows. Section II sets up the two-stage dispatch model in detail, and describes the uncertainty model. Section III reviews a single bus model and develops the price of uncertainty. In order to develop this qualitative understanding under limited congestion patterns we first study small network scenarios. Section IV first investigates a 2-bus network, defines the concept of back flow and identifies the appropriate structural results, utilizing it to develop a simple dispatch methodology. Section IV then investigates general networks with a single congested link and demonstrates an appropriate reduction mechanism. Section V provides computational experiments illustrating the performance of the procedure in real networks. Section VI concludes with future work.

II. MODEL SETUP A. Network Risk Limiting Dispatch (N-RLD)
Network Risk Limiting Dispatch (N-RLD) is formulated as a two stage optimization problem in an power network (Figure 1). The first stage represents a market where the SO can buy energy corresponding to dispatch decisions. Decisions are made at each node of the network. The second stage corresponds to delivery or real time, which represents a 5 or 15 minute interval during which energy is delivered. Stage 1 typically occurs 24 hours ahead of real-time and slow ramping generation or base load generation is dispatched at this stage [12]. In some cases, stage 1 can represent a market an hour ahead of real-time. Without loss of generality we call this stage 'day ahead'. Stage 2 is then the 'real-time'. Fig. 1. Power network example with five nodes. Demand at bus i is denoted by Di, the first stage generation by gi and second stage generation by g R i . The capacity of line between bus i and bus k is denoted C ik and the flows on each line is determined by the net injection, gi + g R i − Di at each bus.
The SO makes dispatch decisions constrained by an n-bus power network with m transmission lines. The SO has to satisfy a random load l i at each bus i, known only at real-time. He has available for free w i units of renewable energy, also revealed only at real-time. In stage 1, the SO can dispatch generation g i after observing some information 1 available about the random load and wind at the buses. In stage 2 or recourse stage, the SO chooses g R i after observing the random loads and demands to balance the network. The g R i 's can be seen as generation level of fast generators or shedded load. Energy can only be purchased in the first stage so g i ≥ 0. Renewable generation is not dispatchable and is taken as negative load, following standard practice. The net load at bus i is defined as d i = l i − w i and it can be positive or negative. Excess power at any bus i in the second stage can be disposed off for free, so g R i can be positive or negative. The cost of dispatching generation at bus i in the first stage is c i (g i ) and q i (g R i ) in the second stage. In general both costs are represented by increasing, convex functions. When not specified, we assume that both costs are linear and given by c i (g i ) = α i g i and q i (g R i ) = β i (g R i ) + , where α i and β i are prices in dollars per MW and (x) + = max(x, 0). Later we show the assumption is not restrictive since while operating under mild to moderate uncertainty, we are interested in perturbations of the dispatch around its operating point, and it can be shown that the linear cost segment at that point determine costs. Moreover, to avoid trivial solutions and arbitrage, assume day ahead prices are smaller than real time prices, i.e., α i ≤ β k for all 1 ≤ i, k ≤ n. The total SO cost for the first stage is the sum of first stage costs, and the total second stage cost is the sum of the second stage costs.
Once first stage dispatch decisions are made and renewable generation is realized, second stage dispatch decisions and power flows in the system are determined by the physical network and its properties. We consider a DC power flow model [31] for dispatch calculation purposes. We validate the performance of the dispatch by considering the full AC model in the case studies. Dispatch decisions need to respect network flow constraints, and in particular transmission line constraints. The capacity of the line connecting nodes i and j in the network is given by c ij . We also utilize an observation about congested transmission links in practice. For example, in CAISO, normally only one or two of the main transmission lines from Northern California to Southern California experience congestion. This limited congestion assumption will be utilized to simplify the dispatch calculation. In particular in this paper we focus on the scenario with at most one congested link. In future work we generalize this to problems with k congestion link following the same approach proposed here.
To establish the information structure of the two stage optimization problem, we propose the following 1 For example, the information observed in the day-ahead could be the weather information.
forecasting model. The net load is decomposed as T is the first stage forecast and e = [e 1 e 2 . . . e n ] T is a zero mean Gaussian distributed random vector with covariance matrix Σ e = σ 2 e Σ ′ e , where Σ ′ e is a known error correlation matrix (e ∼ N(0, σ 2 e Σ ′ e )). Furthermore, the forecastd and error e are independent. Moreover, average performance of the forecast, in the form of forecast error variance σ 2 e is provided for each bus or operating region.
The Gaussian error assumption is justified by recent studies (e.g. [2]) that observe forecast errors are distributed as a (truncated) Gaussian random variable. For the typical variances utilized, the errors in utilizing a Gaussian distribution is negligible and an accepted practice in dispatch mechanisms. Also note that the results for Gaussian models carry over to many other distributions with little modification [8].

B. Formulation and Decomposition of N-RLD
We formulate the mathematical optimization problem in this section. Before stating the entire problem, it is convenient to define the following DC-OPF problem where q is a positive price vector, (2b) is the power balance constraint, ∇ T ∈ R n×m is the mapping from branch flows to bus injections [32], f is the m where the expectation is taken with respect to the distribution of d conditional on the forecast d. The constraint g ≥ 0 limits the day ahead decisions to purchasing generation power only. Additionally, g is function of the forecastd and the error distribution. The optimal solution to (3) is called the risk limiting dispatch.

C. Integration Cost and Price of Uncertainty
A fundamental quantity of interest is the impact of uncertainty in the cost of dispatch. We call this quantity the integration cost [3], which is defined the difference between the expected cost of the procedure and the expected cost of a dispatch clairvoyant of the realization of d. The clairvoyant dispatch can allocate all the required power in the day ahead by solving the deterministic OPF V * C (d) = J(α, d). The integration cost for a realization of the information setd is given by An important question is regarding the sensitivity of this cost to the forecast error standard deviation σ e when the best possible dispatch is utilized. If C I is a linear function of σ e , so C I = pσ e , then p is the price of uncertainty, a fundamental limit faced by any dispatch procedure. In this paper we show how it can be calculated for various scenarios.

D. Small-σ Assumption
An important consideration is the order of magnitude of the error standard deviation σ e compared to the entries in the average net load vector µ and the transmission line capacities. Standard deviation of day ahead load forecasts σ L are 1% − −2% of the expected load µ L . Wind error forecasts are more severe, and error standard deviations σ W of 30% of rated capacity µ W have been observed. High wind penetration scenarios have about 30% of total load being generated by wind, and therefore the total error would be about 0.01 + 0.3 * 0.3 = 10% of total load.
In contrast to the financial situation, a relative forecast error of 10% would not change the overall physical operating characteristic of the network. More precisely, suppose we calculate the deterministic dispatch based on the forecast valuesd and find bus i would be generating power in the first stage. Then with high probability, bus i would still be generating power in the two stage dispatch problem. Also, the network congestion pattern under the deterministic dispatch and the two-stage dispatch should not be drastically different. Sections III and IV formalizes these observations.
We call the operating regime in the above scenarios the small-σ regime. More rigorously, we have the following definition. Definition 1. Letd be the predicted net demand and σ e be the standard deviation of the forecast error. The small-σ assumption denotes the scaling regime where 1 σed → ∞. For the simplicity of exposition, we delegate such limits to the appendix and focus on the intuitive points of analysis in the main body of the paper. The overall message is that forecast values are very useful in determining the qualitative behaviour of the network.

III. SINGLE-BUS NETWORK CASE
This section reviews the risk limiting dispatch control for a single-bus network [8], [33], and analyzes the price of uncertainty in this scenario. A network can be modeled by a single-bus if congestion never occurs in the network. Under the same-σ assumption, this is equivalent to the fact that if there is sufficient capacity under the forecast net-demand, then the forecast errors being small enough compare to the capacity in the network such that line flow limits would not be hit under almost all realizations.

A. Risk Limiting Dispatch
Since we only consider a single bus, all variables are scalar. Equivalently, the single bus network can be thought as an n-bus network without congestion since buses can freely exchange power 2 . In this case, the constraint region in (2) reduces to net supply must equal net demand, and the RT-OPF becomes The DA-SPF in (3) can then be reduced to RLD can then be derived as follows. Consider the unconstrained optimization problem Taking the subgradient with respect to g gives the optimality condition where Q(·) is the Gaussian Q function. The risk limiting dispatch (optimal dispatch) g is given by inverting (7 Note it is possible that g < 0, it can be shown that the risk limiting dispatch g * (optimal solution to the constrained problem in (5)) is given by thresholding

B. Price of Uncertainty
Since most power systems would not have 100% penetration in the near future, we assume that the net demand d, and its predictiond, are positive. Then first we would show the price of uncertainty exists (i.e. the integration cost is linear in σ e ), and then calculate its value. (4) is linear under the small-σ assumption and can be written as lim where σ e is the standard deviation of the error e and p = βφ(Q −1 ( α β )) (φ(·) is the standard Gaussian density and Q(·) is the complimentary Gaussian cumulative density function).
Theorem 1 relies on the observation that if net demand is positive (d > 0), then it is always beneficial to purchase energy in the day ahead as the energy price is higher in real-time, so the optimal schedule must be positive g * > 0. The positivity constraint in the simplified DA-SPF ( (5)) is redundant, and the cost of uncertainty ((4)) can be explicitly computed. The proof of Theorem 1 is given in Appendix A. Figure 2 plots the price of uncertainty for different values of α/β with β set to be 1. Somewhat surprisingly, p is not monotonic in α/β and it goes to 0 as α/β approaches 0 or α/β approaches 1. Intuitively, when α/β is small, the day ahead cost is very low, and the SO can purchase sufficient amounts of energy to absorb the prediction error. In contrast, when α/β is close to 1, the day ahead and real-time costs are similar, so the SO waits until real-time to balance the system once the net load realization is completely known.

C. Extremely High Penetration
In some networks renewable power may have a penetration level of more than 100%, violating the small-σ assumption. For example, in a microgrid where wind or solar energy is abundant, the net demand could become negative. In this case, the cost of uncertainty is no longer linear in the standard deviation of the prediction error and in general cannot be computed in closed form.

IV. CONGESTED NETWORKS CASE
The RT-OPF in N-RLD for n-bus networks does not admit an analytical solution as in the single bus case, significantly increasing the complexity of the full dispatch. In particular, it is difficult to obtain the day ahead dispatch g in closed form. Moreover, the cost of uncertainty can be a complicated function of the information set and the network capacities c. These quantities can be numerically computed resorting to a Monte Carlo approach, but the computational challenges are formidable due to the high dimensionality of the problem.
Instead, the small-σ assumption from Sec. II can be explored to obtain a simple and interpretable dispatch. Since the prediction error is a small percentage of the net load, the change in flows caused by that error is also a small percentage, we assume the prediction error is small compared to bothd and c. Under the small-σ assumption, the qualitative or structural behavior of the power system predicted in the day-ahead from the forecastd will not differ from its realization in real-time after observing d. If we expect to purchase power at a bus in the day-ahead, then after real-time, we do not expect power to be shed in that bus. If a transmission line is expected to be congested in a certain direction in the day-ahead, then the direction of congestion would not be reversed at real time. Since qualitative features are consistent with the forecast, a deterministic OPF based on the day-ahead price α and the net load forecastd will predict congested lines, congestion directions and buses where energy is purchased correctly. Let P denote the feasible injection region of the network (the set of all power injections that satisfy the operational constraints) [34]. This deterministic OPF is denominated Nominal Day-Ahead OPF (NDA-OPF): In stochastic control terms, NDA-OPF solves the certainty equivalent control problem for N-RLD (3) [35], [36], by replacing the random quantity d by the deterministic quantityd and solving the optimization problem. Denote the generation schedule from NDA-OPF by g.
The day ahead schedule g in the DA-SPF ( (3)) can be decomposed as the nominal dispatch added to a perturbation g = (g + ∆) + where ∆ ∈ R n is the perturbation. The optimal schedule is determined by computing ∆. Perturbations are expected to be small since the uncertainty is small, so the perturbed DA-SPF can be significantly simplified. The simplification comes from the small-σ assumption (see Definition 1), and is manifested in three key observations: 1) If g i < 0, bus i is treated as a source of unlimited energy, since it is shedding energy in the nominal problem (NDA-OPF). If g i > 0, then the perturbed dispatch ∆ i is not constrained to be positive since g i is much larger than σ e ∆ i under the small-σ assumption. 2) If the line between buses i and k are not congested, then it is not congested in perturbed DA-SPF.
3) If the line between buses i and k is congested from i to k, then it would not become congested from k to i in the perturbed DA-SPF. Going forward, we assume these observations to hold. This is called the small-σ assumption. We propose the two step algorithm in Algorithm 1.

Algorithm 1: Procedure to solve Network Risk Limiting Dispatch
Step 1 (NDA-OPF): Solve the nominal problem in (11) using forecast net load and day ahead prices to obtain the nominal schedule g and nominal line flows f .
Step 2 (Perturbed DA-SPF):Solve the DA-SPF ( (3)) for the optimal perturbation ∆ by substituting g = g + σ e ∆ * and appropriately normalizing and reducing the problem using Observations (1) − (3) as The optimal DA-SPF dispatch is then given by g = (g + σ e ∆) + . At first glance, (12) seems to be no simpler than the original problem in (3). However, note that the network capacity constraints (13d) only include the lines that are congested in the nominal problem. In essence, (12) balances a 'left-over' network from solving the nominal problem, and (13d) states that if a line is congested in the nominal problem, no more energy is allowed to flow along the direction of congestion.
The next subsection explores the normalization and reduction process to define the Perturbed DA-SPF for two bus and three bus networks. We show the perturbation ∆ is the solution to a set of deterministic equilibrium equations. Then the problem of an arbitrary network with n buses and a single congestion link is studied and we show the general reduction procedure results in an optimal dispatch control under the small-σ assumption.

A. Two Bus Network
Consider the two bus network in Fig. 3. For this network, the day ahead dispatch is a vector g = [g 1 g 2 ] T of the scheduled generation at each bus. The real-time balancing of the network requires solving an OPF where the injection region is two dimensional. The RT-OPF becomes where f is the amount of power flowing from bus 1 to bus 2 and c is the capacity on the line. To apply Algorithm 1, first solve the NDA-OPF (11) for the two bus network. Then, to apply Step 2, we partition R 2 into the five regions in Fig. 4 according to the value of the net demand forecastd. Each region is defined by whether the transmission link is congested or not, the direction of congestion, and whether each bus is scheduled to generate power in the nominal problem. The small-σ assumption enables inference of these facts with high probability from the solution of the NDA-OPF. Regions A, B, C and D reduces to the single bus case as analyzed in Section III. In regions B and D, since the line capacity is not binding, power can flow from one bus to the other without congestion. In region A, bus 1 has excess power and transfer up to capacity to bus 2, and then reserve is only needed for bus 2. Region C is symmetrical to region A.
For region E in Fig. 4,d 1 > −c andd 2 > c. Since buying at bus 1 is cheaper (α 1 < α 2 ), the SO should transfer up to line capacity c units of energy from bus 1 to bus 2. The NDA-OPF solution is then At first glance, it seems the two buses are now decoupled and can be treated as two isolated buses since the line between them is congested. However, this viewpoint is not correct due to the two-stage nature of the problem and congestion being directional. In the two stage dispatch problem, the SO decides in the first stage to purchase some energy based on the forecast and error statistics; however the actual balancing of the network occurs at the second stage. Some averaging of the errors can still occur even if the line from bus 1 to bus 2 is congested. For example, suppose that in real-time e 1 > 0 and e 2 < 0. That is, demand at bus 2 was over-predicted and demand at bus 1 was under-predicted. Due to this configuration, bus 2 needs less than c units of energy from bus 1, and the remaining energy can be utilized to satisfy the under-predicted demand in bus 1. This represents a flow from bus 2 to 1 and does not violate congestion constraints, since the line was congested from bus 1 to 2. Due to this property of opposing the congestion direction, we denominate this flow a backflow. For example, backflow does not arise in region A because bus 1 always has an excess of energy and does not require any energy from bus 2. Similarly for region C.
In region E, the small-σ assumption implies that d ∈ E with high probability and the line is not congested from bus 2 to bus 1 (Observation (3)). Assuming that errors e 1 and e 2 have covariance matrix the optimal dispatch and price of uncertainty in region E are given by: Fig. 3, with prices α 1 and α 2 respectively. Without loss of generality, we assume α 1 ≤ α 2 . Under the small-σ assumption, the risk limiting dispatch (equation (3)) is given by

Theorem 2. Consider the two-bus network in
where g = [d 1 + cd 2 − c] T and ∆ * is the unique solution to where z = [z 1 z 2 ] T = e/σ e . The cost of uncertainty is linear and the price of uncertainty is given by . Before formally proving Theorem 2, we provide an intuitive explanation of the non-linear equations in (16). After subtracting the nominal dispatch choice, the net demands (normalized by σ e ) are z 1 and z 2 respectively, and only backflow is allowed. The network reduces to a two bus network with a unidirectional link going from bus 2 to bus 1 (Fig. 5). The left hand side of (16) can be seen as the cost of purchasing an additional unit of energy at the buses in stage 1, while the right hand side can be seen as the benefit of having that unit of energy at stage 2. Therefore (16) can be interpreted as balancing the cost and benefit between buying an additional of unit at stage 1. For example, one additional unit of energy at bus 1 is useful if two event occurs: z 1 > ∆ 1 (bus 1 does not have enough energy) and (b) z 1 + z 2 > ∆ 1 + ∆ 2 (bus 2 does not have enough energy to transfer to bus 1). Since power can be transferred from bus 2 to bus 1 in the perturbed network (Fig. 5), the price of buying an unit of energy at real time is min(β 1 , β 2 ) and the right hand side of (16a) is the expected benefit of having that unit of energy available. The price of purchasing that unit of energy at stage 1 is α 1 . At optimality, equilibrium is achieved between the cost at stage 1 and the expected benefit at stage 2. Similarly, (16b) describes the equilibrium at bus 2 Figure 6 plots the ratio in the average price between a network where backflow is not taken into account and a network that allows backflow as a function of the correlation between errors e 1 and e 2 . If backflow is not allowed, then the network becomes two isolated buses. The ratio is always less than 1 since a network with backflow can do no worse than a network without backflow. The ratio is lowest when the two buses are negatively correlated since backflow averages out the uncertainties in the error. As the two buses become positively correlated, backflow becomes less useful since both errors tend to be the same sign and averaging is less useful.
Proof of Theorem 2: Note that Theorem 2 can be proven using the same limiting arguments as given in Appendix A for Theorem 1. For the sake of clarity and brevity, we present a proof without going into the limiting details, but the arguments can be easily make rigorous by following Appendix A.  Fig. 6. Ratio in prices between using and not using back flow for α1 = α2 = 0.5 and β1 = β2 = 1. Note the curve is always below one since a network with back flow can do no worse than a network without backflow.
Any dispatch can be written as g+σ e ∆. We first prove the optimal ∆ is independent of σ e . Substituting g = g + σ e ∆, the DA-SPF (Eqn. (3))becomes By the small-σ assumption, the constraint in Eqn. (18b) is always satisfied since g ≥ 0 from the definition of NDA-OPF. The RT-OPF (Eqn. (14)) becomes Since the nominal flow is c, let f = c − δ with δ representing the backflow. Substituting the value of g into Eqn. (19), By the assumption that the line does not congest from bus 2 to bus 1, the constraint δ < 2c is always satisfied and can be dropped. Normalizing Eqn. (20) by σ e gives where the optimization variables g R+1 and δ have been normalized by σ e and z i := e i /σ e . LetJ = J/σ e , and note thatJ only depdent of β and ∆. Combining (18) and (21), ∆ solves the unconstrained optimization problem min To solve this optimization problem, we need the gradient of E[J(β, ∆)] with respect to ∆. The optimization problem can be analytically solved to yield Using the linearity of expectation and taking derivatives with respect to ∆ in α T ∆ + E[J (β, ∆)] gives (16).
Next we prove the price of uncertainty is given by Eqn. (17). The value of full knowledge optimization problem is E[J(α, d)]. The error is zero mean and by the small-σ assumption, E[J(α, d)] = α T g where g is the nominal solution. The cost of uncertainty is Most networks consists of a large number of buses and lines, but under normal operating conditions, only very few lines are congested. For example, the California transmission network can be thought as divided into three zones connected by major transmission lines shown in Figure 7 and the flows within a zone are unrestricted [37]. The zonal grouping in CAISO was designed utilizing the idea of collapsing together buses connected by uncongested transmission lines in a deterministic OPF. We formalize and extend this intuitive concept for ND-RLD by showing that a general network with a single congested link reduces to a two bus problem under mild to moderate uncertainty. More concretely, assume the line from bus 1 to bus 2 is congested, then  (11)). Under the small-σ assumption, suppose that f 12 = c 12 is the only congestion in the network, then the following holds:

B. N-bus Network with a Single Congested Line
1) There are at most two nodes with positive generation. That is, g i > 0 for at most two i. Furthermore, if g 1 ≤ 0, then only one other bus has positive generation. (3)) takes the form

2) The risk limiting dispatch (equation
3) If β i = β k = β for all i, k, then optimization problem reduces to an equivalent problem over a congested two node network with congestion from bus 1 ′ to 2 ′ with correlated errors. Let k = 1 be the bus with positive generation. Then the first stage costs are α ′ 1 = α 1 and α ′ 2 = ( α k γ k − γ k α 1 ) and the errors are given by where γ i ∈ [0, 1] are determined by the topology of the network and can be calculated by (25) and (26).
Point 1) in Theorem 3 seems strange since it is highly unlikely that only two generators would be generating in a power network. This result is comes from the assumption that the prices are linear in the power generated, which is used here to simplify the presentation. In practice, cost functions are piecewise linear or quadratic. If piecewise linear cost functions are used, then Theorem 3 1) is modified to stating that there are at most two generators operating at their marginal cost [12]; if quadratic (or other convex continuous increasing) cost functions are used, Theorem 3 is modified to stating that there are at most two different marginal costs among the generators. The details of the derivation is given in the Appendix. The overall message of Theorem 3 remains unchanged in each case: in a network with one congested link, the risk limiting dispatch can be calculated by considering a two-bus network obtained from the original n-bus network.
The proof of this theorem is somewhat technical and is given in the appendix. The theorem states that the network can be collapsed into a single bus or a two bus network, utilizing an appropriate averaging of the net demands. To understand how to calculate the bus averaging weights γ i , it is convenient to simplify (3) (with cost β) by considering fundamental flows [38]. Pick one spanning tree in the network. This spanning tree has n nodes and n − 1 edges. The flows on these n − 1 edges is called a fundamental flow, denoted byf ∈ R n−1 . These flows are fundamental in the sense that any flows, f in the network can be written in the form f = Rf, where R ∈ R m×n−1 is a constant matrix only depending on the chosen spanning tree.
The constraint (2c) can be eliminated and (2) reduces to: Let a T i be the ith row of A for i = 1, . . . , n. For each node i = 3, . . . , n in the network, letf (i) be set of fundamental flows that solve the following set of equations In matrix form,f (i) solves where A 2 is the (n − 2) × (n − 1) matrix obtained by removing the first two rows of A and h i−1 is a vector with entry i − 1 being 1 and all other entries 0 . Inverting givesf (i) = −Ã −1 h i−1 and Next we apply Theorem 3 to a three bus single cycle network with equal admittance on each line. Let the predictiond be such that the line from bus 1 to bus 2 is congested. That is, f 12 = c 12 in the nominal problem. There are four possible congestion patterns 3 as listed in Figure 8. Bus i is labeled by the sign of g i . Figure 9 shows the equivalent two bus networks for each of the networks in Fig. 8  after applying Theorem 3. The networks in Fig. 9 are labeled by the first stage costs, the sign patterns and the forecasted errors at each of the nodes. Let ∆ ′ be the solution to the two bus networks in Fig.  9. Then the controls ∆ for the original problem are given in each of the networks in Fig. 9.
Note the result in this section can be extended to the case of a network with multiple congested lines. Namely, given a network with K congested lines, it can be reduced to an equivalent network with K + 1 buses [39]. The methods for multiple congested lines are the same for a single congested line, although the mathematical details are more cumbersome to handle. Fig. 9. The equivalent perturbed networks for the networks in Fig. 8 respectively. The left bus is 1 ′ and the right bus is 2 ′ . The back flow is only allowed form 2 ′ to 1 ′ .

V. SIMULATION RESULTS
This section explores various numerical examples using the IEEE 9-bus benchmark network. In particular we compare the performance of ND-RLD with utilizing the standard 3 − σ rule. We also compute the price of uncertainty numerically and compare it to the theoretical prediction.

A. Uncongested Network
Many practical networks have line capacities that are much larger than the typical power flows. For these networks, they are well approximated by a single bus network. For example, consider the IEEE 9-bus network in Figure 10. The nominal generation and demands from the data included with this benchmark network [9], [40] is shown in Table II. Note that line flows are significantly smaller than transmission line capacities. Therefore, under moderately high penetration, the network can be thought as a network operating without capacity constraints. Up to this point we have used the DC power flow model, while in reality power flow is AC. It is known that for transmission networks, due to the low R/X ratios of the transmission lines, DC and AC power flows yields similar answers. This is confirmed in our simulations where the difference in performance of using the risk limiting dispatch under DC and AC power flow models is minimal. Therefore it is sufficient to use the simpler DC flow model to obtain the dispatch.  To analyze the performance of the risk limiting dispatch derived in Section III, we compare it to two other dispatches. The first one is the currently used 3 − σ dispatch, and the second one is the oracle dispatch where the actual realization of the wind is known at stage 1. We assume that all the generating buses have a first stage cost 4 α = 1 and all buses have the same second stage cost β. For simplicity,  250  250  150  300  150  250  250  250  250   TABLE II  ALL UNITS ARE MW. BOTH DC AND AC POWER FLOWS ON EACH LINE OF THE NETWORK IS SHOWN. CAPACITIES ARE THE LONG  TERM EMERGENCY RATING OF THE LINE. THE NETWORK IS UNCONGESTED. the prediction errors are generated as i.i.d. zero mean Gaussian random variables with variance σ 2 . The predictionsd is taken to the nominal demands in Tab. I. The risk limiting dispatch is derived by viewing the network as a single bus. For actual operation, the amount of reserves to put at each buses in the network need to be determined. Here we spread the reserves equally among the three generating buses(buses 1,2 and 3). From (8) and the fact that the prediction errors are independent, the single bus risk limiting dispatch is 9 . The network risk limiting dispatch is given by The 3 − σ control purchases a reserve of 3 times the standard deviation for each bus in the network, or 3 · 9 · σ. Again we spread out the 3 − σ dispatch over the three generating nodes as We simulate the cost for both the DC and AC power flows. Figure 11 plots the total cost of the three dispatches for β = 1.5α. As we can see the risk limiting dispatch performs much better than the 3 − σ dispatch. There are two reasons why the 3 − σ dispatch or rules like it perform badly. The first is that the 3 − σ rules is too conservative since it does not take into account the actual cost of the second stage; the second reason is that the 3 − σ dispatch ignores the potential benefit of averaging between the prediction errors by treating the different buses as isolated nodes. In contrast, risk limiting dispatch takes these two points into consideration. Figure 12   is a zoomed in version of Fig. 11 by plotting the total cost only for the risk limiting dispatch and the oracle dispatch. The cost for the oracle dispatch is constant at 315 up until σ = 80. This is expected since the predicted total demand is 315 MW, and the prediction errors are zero mean, so the errors averages out. At higher σ, the capacities in the network become binding and the cost goes up since not all errors can be averaged. The cost for the risk limiting dispatch is essentially linear for all σ's.
Furthermore, the slope of the cost is (very close to) the price of uncertainty calculated in the earlier sections.
A lower bound for the minimum total cost is the total cost of applying the risk limiting dispatch to a network with infinite capacities, since an infinite capacity network has lower cost than a finite capacity one and the risk limiting dispatch is optimal for the former. From Figure 12, this lower bound is almost met. Thus the risk limiting dispatch is close to optimal and our assumption of viewing an uncongested network as a single bus network is valid. The slopes of the lines gives the price of uncertainties. As  expected, the price of uncertainty for the oracle dispatch is 0 since the actual realization is known at the first stage. The price of uncertainty of the risk limiting dispatch closely matches that of the single bus price of uncertainty, while the 3 − σ price is much higher.

B. Congested Network
To construct a congested network, the network in Fig. 10 is modified by increasing the nominal load at bus 5 to 150 MW and reducing the capacity of the line connecting bus 5 and 6 to 75 MW. Then the line from bus 6 to bus 5 is congested. There are two different first stage costs α 1 and α 2 and these are given by the marginal costs of the generators. Let α = 1 2 (α 1 + α 2 ) and we normalize all cost by α. Figure 13 plots the total cost of the three dispatches for β = 1.5α. Again, we see the risk limiting dispatch performs much better than the 3 − σ dispatch. Figure 14   the total cost only for the risk limiting dispatch and the oracle dispatch. As expected, the cost of the oracle dispatch is constant over a wide range of σ's. The cost of the risk limiting dispatch is linear and very close to its lower bound. The lower bound is obtained by applying the risk limiting dispatch to a network with only one finite capacity line, namely the line congested under the nominal flows. Figure  14 shows that modeling a network with one congested line as a two bus network is very accurate.  Figure 15 shows the difference in cost of assuming there is no congestion in the network and the correct dispatch solution taking the congestion into account. The former calculation ignores the congestion information in the network. As expected, the later dispatch performs better since it takes into account the congestion in the network. VI. CONCLUSION In this paper we addressed the solution of a two-stage stochastic dispatch for system operators. We showed that a simple control exists under mild to moderate uncertainty about future realizations of net demand. The control is composed of two parts, one which is the certainty equivalent control rule, and another that is a deviation that hedges against the uncertainty by appropriately taking into account costs and recourse opportunities. Moreover, by incorporating the fact that only a small number of transmission lines that congest at any given hour, the optimal dispatch can be calculated analytically. The price of uncertainty is a tool to measure the performance of distinct dispatch procedures. We show that under mild assumptions on forecast errors, the proposed dispatch achieves the cost bound given by the price of uncertainty. The proposed procedure also performs rather well in a full AC network.
where (a) follows from the assumption d > 0, (b) follows from setting g =d + ∆, (c) follows from changes from variables where ∆ ′ = ∆/σ e and z = e/σ e and the mean of e remains 0 in the limit and (d) is follows the calculation below. From first order conditions, the optimal solution ∆ ′ * solves Therefore,∆ ′ * = Q −1 ( α β ). The price of uncertainty p can be calculated as

B. Proof of Theorem 3
By assumption only the flow from 1 to 2 is congested, (24) can be replaced by an equivalent problem by choosing f 12 as a fundamental flow and including only the constraint on it. Without loss of generality, letf 1 = f 12 .
Writing (30) as a linear program gives The Lagrangian is where λ, µ, and ν are the Lagrangian multipliers. Differentiating with respect to y gives α −λ −ν = 0.
Since ν are the Lagrangian multipliers associated with the constraint y ≥ 0, but complementary slackness where h 1 = [1 0 · · · 0] T is the first standard basis. The dual is At first glance it seems that the dimension of (33) is n + 1. However since (32) is n − 1 equations involving n + 1 unknowns, there are only 2 independent variables. The next claim gives a precise characterization of the solution of (33).
Suppose the claim is true. The first statement of Theorem 3 is that only two nodes are generating energy. From complementary slackness, g i > 0 only if λ i = α i . Since α has only two degrees of freedom, for generic α, λ i = α i for at most two components. Therefore in general only two nodes would be generating energy.
The second statement is that only the nodes that generates power would be used to do the perturbation control. That is, ∆ i = 0 only if g i > 0. The intuition is as follows: suppose g i < 0, then under the small sigma assumption, g i can be viewed as an infinite source of free energy, so no perturbation is needed; suppose g i = 0, if a small unit of energy is purchased at node i, there is a cheaper option to purchase the unit of energy somewhere else (or g i would have been positive), therefore ∆ i = 0.
To show that the problem reduces to a two bus network if all β are equal, we need to consider the second stage optimization problem. Now let f denote the set of perturbed flows. Since the line from 1 to 2 is congested in the nominal problem,f 1 = f 12 < 0. Let x i = ∆ i + (−g i ) + /σ − z i , where ∆ i is the first stage control, (−g i ) is the left over energy, and z i is the normalized estimation error. The second stage optimization problem becomes This optimization problem has precisely the same form as (31), with C 12 = 0. By Claim 4, the dual of (34) is where γ = [1 0 γ 3 · · · γ n ] T , a i ∈ [0, 1] and depends on the network topology for i = 3, . . . , n. If β's are all the same (or β 1 , β 2 are smaller than all other β's), the dual reduces to where x ′ 1 = γ T x and x ′ 2 = (1−γ) T x. This is exactly the dual of a two bus network with prediction errors γ T z and (1 − γ) T z, leftover energy γ T (−g) + and (1 − γ) T (−g) + , and controls γ T ∆ and (1 − γ T )∆. Let It can be shown that if there are two generating nodes then one of them can be taken to be node 1. Suppose the other generating node is node k. To solve equilibrium equation (16) for ∆ ′ 1 and ∆ ′ 2 , the associated first stage costs are α 1 and ( α k γ k − γ k α 1 ) respectively.

C. Proof of Claim 4
We prove Claim 4 be guessing the solution and verifying it is correct. We show λ = [1 0 γ 3 · · · γ n ] T where γ i is given by (26) solves (32). Expanding A T λ gives where * denote a generic number and (a) follows from observing that (Ã −1 h i−1 ) T is the transpose of (Ã T ) −1 without the first row and the following simple lemma Lemma 5. Let X be a r × r − 1 matrix and suppose the matrix h 1 X is invertible with inverse Y. Let Y 1 be the matrix obtained from Y by removing the first row. Then XY 1 =       * * * · · · * 0 1 0 · · · 0 0 0 1 · · · 0 . . . 0 We still need to show that 1 ≥ 0γ i ≥ 0. This can be done through graph theory, but it is simpler to recognize that the flows given by (25) solves a DC OPF problem. For the i'th node, the optimization problem is to find the least generation need at nodes 1 and 2, satisfying a demand of 1 unit at node i, 0 demand at all other nodes, and no flow on the line between 1 and 2. Therefore γ i is the proportion of power that node 1 produced, and 1 − γ i is the proportion of power that node 2 produced.

D. Nonlinear Prices
First consider the following nominal OPF problem where c i 's are differentiable where q i (·) is increasing and convex,f are the fundamental flows and the line capacities are infinite. Rewriting (37) as minimize n i=1 q i (y) (38a) subject to y − Af −d ≥ 0 (38b) y ≥ 0. (38c) The Lagrangian of (38) is At optimal, the primal and dual variables minimizes the Lagrangian, so q ′ i (y * i ) − λ * i − ν * i = 0 and A T λ * = 0.
The null space of A T is spanned by the 1 vector, therefore λ * = λ * 1 for some λ * . By complementary slackness, node i is generating if ν i = 0. The nodes in the network can be divided into two groups, one group is all the generating node and the other is the non-generating nodes. For all the generating nodes, the marginal prices are all the same, that is, q ′ i (y * i ) = q ′ k (y * k ) = λ * if y i > 0 and y k > 0. From the perturbation control of view, the network consists of many nodes with the same first stage cost λ * , therefore the perturbation control ∆ can be divided up in arbitrary fashion between those nodes. Now suppose that the network has one congested link. The nominal problem becomes The Lagrangian is At optimal, q ′ i (y * i ) − λ * i − ν * i = 0 and A T λ * + µ * h 1 = 0. From previous results, λ can be decomposed as λ = aλ 1 + (1 − a)λ 2 , where a 1 = 1, a 2 = 0 and a i ∈ [0, 1] for i = 3, . . . , n. The decision variable in the two stage optimization problem becomes ∆ ′ 1 = a T ∆ and ∆ ′ 2 = (1 − a) T ∆, and the optimization problem is min After solving for the optimal ∆ ′ 1 and ∆ ′ 2 , we need to map it back to the original ∆ i 's. Again, if y i = 0, then we set ∆ i = 0. For the rest of the nodes, ∆ ′ 1 and ∆ ′ 2 can be split up in any fashion as long as it is consistent.

E. Piecewise Linear Cost Functions
In practice piecewise linear cost functions (convex, increasing) are often used. We start again with the uncongested network. Since the cost functions are not differentiable, the Lagrangian in (39) is not differentiable. We use subgradients instead. Given a function f (x) : R n → R, a vector s ∈ R n is a subgradient of f at x if f (y) − f (x) ≥ s T (y − x) for all y. The set of all subgradients at x is called the subdifferential and denoted ∂f (x). By the convexity, at optimality, s * i − λ * i − ν * i = 0 for some s * i ∈ ∂q i (y * i ) and A T λ * = 0. We still have all λ's are equal and the two stage problem only depends ∆ = ∆ 1 + ∆ 2 + · · · + ∆ n . In contrast to the differentiable cost case, here the control is only done at one node, that is, ∆ = ∆ i for some node i and ∆ k = 0 if k = i. The reason is that all generating node except one would be operating at a corner point on their respective cost curves and it is optimal not to change those corner points. Only one generator would be operating at a point not at the corner, and all the control should be done at that point. Similarly, for a network with one congested link, only two generators will be operating at a non-corner point, and the perturbation control is done at those two points.