Stochastic Planning of Distributed PV Generation

: Recent studies by electric utility companies indicate that maximum beneﬁts of distributed solar photovoltaic (PV) units can be reaped when siting and sizing of PV systems is optimized. This paper develops a two-stage stochastic program that serves as a tool for optimally determining the placing and sizing of PV units in distribution systems. The PV model incorporates the mapping from solar irradiance to AC power injection. By modeling the uncertainty of solar irradiance and loads by a ﬁnite set of scenarios, the goal is to achieve minimum installation and network operation costs while satisfying necessary operational constraints. First-stage decisions are scenario-independent and include binary variables that represent the existence of PV units, the area of the PV panel, and the apparent power capability of the inverter. Second-stage decisions are scenario-dependent and entail reactive power support from PV inverters, real and reactive power ﬂows, and nodal voltages. Optimization constraints account for inverter’s capacity, PV module area limits, the power ﬂow equations, as well as voltage regulation. A comparison between two designs, one where the DC:AC ratio is pre-speciﬁed, and the other where the maximum DC:AC ratio is speciﬁed based on historical data, is carried out. It turns out that the latter design reduces costs and allows further reduction of the panel area. The applicability and efﬁciency of the proposed formulation are numerically demonstrated on the IEEE 34-node feeder, while the output power of PV systems is modeled using the publicly available PVWatts software developed by the National Renewable Energy Laboratory. The overall framework developed in this paper can guide electric utility companies in identifying optimal locations for PV placement and sizing, assist with targeting customers with appropriate incentives, and encourage solar adoption.


Motivation and Context
Savings on fuel costs, deferred construction of future power plants, less frequent transmission and distribution upgrades, smaller peak loads, and, subsequently, reduced rate payments to the region interconnection are but a handful of promising prospects of grid-connected distributed photovoltaics (PVs) for electric utility companies [1]. Reinforced by tax incentives, government-mandated renewable portfolio standards, customer-supported initiatives, and consistently decreasing solar generation costs [2], utilities are undergoing ever-increasing deployments of distributed PVs into their electricity grid; especially at the distribution level. For example, in San Antonio, TX, USA, the local on the voltage deviation in the absense of DG, and this information is used to sequentially place DG units in [18].
Heuristic and metaheuristic methods facilitate obtaining reasonably working solutions to very complex NP-hard problems albeit with no guarantees on optimality. A sensitivity-based guided search algorithm is proposed in [5] to assist the particle swarm optimization (PSO) algorithm in solving a joint DG allocation and distribution reconfiguration problem. DG placement and sizing in radial distribution networks to minimize power losses and voltage deviation in the presence of voltage-dependent loads is attained by [19] via the Shuffled Bat algorithm. Support vector machines are used in conjunction with the PSO algorithm in [20] to tackle a chance constrained formulation of the PV placement and sizing problem with a detailed PV model and nonlinear power flows. Loss sensitivity factors are used in [21] to determine DG locations and initial capacities for wind and PV technologies. Antlion optimization is then employed to update DG capacities so as to achieve voltage stability as well as reduced costs associated with DG investment and line thermal loss. Voltage stability is also considered in [22] but optimization is carried out via an improved genetic algorithm. The hybrid artificial bee colony and cuckoo search of [23] is shown to outperform PSO and genetic algorithm variants for DG placement and sizing. Stochastic PV generation scenarios are introduced in the multi-objective PSO algorithm of [24] assuming that solar irradiance follows the beta distribution, but no reactive support is provided by the PV units. Reactive power support based on a constant power factor is introduced in [25].
Comparison between MIP methods and the genetic algorithm in [26] reveals that MIP methods yield improved solutions at the expense of a longer computation time. Mixed-integer linear programming (MILP) is pursued in [27] for robust placement and sizing of dispatchable and intermittent DGs where a set of polyhedral constraints model the uncertainty in wind, PV, and loads. By modeling uncertainty as a set of scenarios, optimal placement and sizing for conservation voltage reduction is tackled in [28]. These works do not consider PV units with reactive power capabilities and consider a simplified linear mapping from solar irradiance to the AC output of the PV units.
Optimal placement and sizing of voltage-source inverter-based PV solar farms and natural gas-based micro-turbines is presented in [29] as a mixed-integer second-order cone program (MISOCP) by leveraging the conic relaxation of power flow equations. The objective is to minimize costs of investment, operation, and CO 2 emission. Fast reactive power support from the PVs is also accounted for in the planning stage via incorporating a Jacobian-based voltage stability index weighted by the rated PV size. Multistage stochastic programming for optimal placement, sizing, as well as the dispatch of DGs and storage systems is presented in [30] where novel linearized flow-based loss models are exploited to arrive at a MILP formulation. These works consider a generic piecewise relationship between irradiance and PV output where the DC:AC ratio of the inverter has been abstracted within the mapping. A more detailed system level model that accounts for DC:AC size and the PV module area is given in [31,32], where, to obtain tractable formulations for unbalanced distribution networks, binary placement variables are assumed continuous and semidefinite relaxations or linearizations of the power flow equations are employed. A slightly more detailed model that accommodates a fixed DC:AC ratio as well as the dependencies of AC power output on the module temperature is also presented in [20]. On the other hand, the works in [20,31,32] do not account for the clipping effect of the PV unit, which pertains to the PV inverter limiting the AC power output under high solar irradiance conditions. The clipping effect is accommodated in [25], but the design is limited to optimizing only the active power rating of the PV unit as a consequence of considering only constant-power-factor reactive power support.

Contributions and Paper Organization
This paper formulates a two-stage stochastic MISOCP formulation for the placement and sizing of distributed PV units in distribution networks. The first stage attends to decisions made during a utility's planning phase for PV installation, that is, decisions regarding the location and sizing of PV units that minimize installation costs. The second stage captures a utility's operational phase in terms of costs associated with thermal loss and efforts pertaining to voltage maintenance. Since the first-stage decisions subsequently affect the performance during the second stage, both stages must be solved concurrently. The stochasticity of PV injections and loads is characterized by a finite set of scenarios; for the PV injections in particular, we used solar irradiance data from the PVWatts calculator. The objective is to minimize the installation costs of the PV system as well as the expected value of thermal loss. Two-stage stochastic programming has successfully been used in other aspects of power system planning [33], and this paper demonstrates its effectiveness for the problem at hand. In contrast to the prior art of Section 1.2 and our previous work [32,34,35], the main contributions of this work are as follows: • In line with standard practice based on the PVWatts calculator, an analytical model for PV units is presented that rigorously maps solar irradiance to the injected AC power. It is shown that the analytical model is nonconvex. Two engineering designs are then offered to bypass the non-convexity.

•
Based on realistic data, several homes are considered per node of the distribution network. Together with linearized network equations that adequately describe the relationships between powers and voltages of the distribution network, the developed framework is intended as a tool for utility-level studies.

•
Extensive numerical studies on the IEEE 34-bus distribution feeder are carried out. It is shown that the degree of freedom between DC and AC sizes can be leveraged to lower installation costs through reduction of the panel area, in comparison to a scheme where the DC and AC sizes are restricted to conform to a known DC:AC ratio.
The organization of this paper is as follows. Section 2 describes the network model and formulates the optimization problem. Section 3 lays out the required data for the numerical tests of Section 4. Section 5 concludes the paper.

Network Model and the Optimization Problem
A radial distribution network with a substation and N − 1 user nodes can be modeled by a tree graph as depicted in Figure 1. Let N := {1, ..., N} denote the set of all nodes. The root node is labeled as node 1 and represents the substation connected to the transmission network. The remaining nodes n ∈ N + = {2, ..., N} represent user nodes of the distribution network. Every user node n ∈ N + has a unique ancestor denoted by A n . The line connecting node A n to node n is referred to as line n. A line is referred to by its end node since in a tree network there are no meshes. Moreover, every node n ∈ N has a set of children nodes denoted by C n .
For example, in Figure 1, the ancestor of node n is A n = m and the set of children for node n is C n = {j, j }. For terminal nodes of the network, C n is an empty set. Each user node n ∈ N + will serve L n individual homes represented by ∈ L n := {1, . . . , L n }.

PV Module Model
A user ∈ L n on node n ∈ N + is generically allowed to have a PV generation unit. The output of the optimization problem to be described will yield the optimal decisions with respect to PV installation. For the PV module, the variable of interest is the panel area, which is denoted by A n, (m 2 ) for node n and home . The PV setup is shown in Figure 2. The nameplate DC rating of the PV module at node n ∈ N + and home ∈ L n , denoted by p dc0 n, , is given by where η module is the module efficiency and ι 0 is the solar irradiance at standard test conditions (STC) and is equal to 1 kW/m 2 [10]. For a PV-enabled user, the DC power output of the PV module is governed by solar irradiance conditions. Assume that, for user ∈ L n at node n ∈ N + , the uncertainty in solar irradiance and loads can be characterized by the finite set of T scenarios indexed by the set T := {1, 2, . . . , T}. Denote by ι n,t the plane-of-array irradiance (in kW/m 2 ) at node n and scenario t. The DC power output of the PV module denoted by p dc n,t, is given by [11] p dc n,t, = ι n,t ι 0 p dc0 n, = η module A n, ι n,t . (2)

Inverter Model
At node n ∈ N + and user ∈ L n , let S ac n, denote the nameplate apparent power capability of the inverter. Furthermore, denote respectively by p ac n,t,l and q ac n,t,l the AC real and reactive power output injected to the grid per scenario t ∈ T . Assuming that the inverter efficiency is a constant given by η inv , the real AC power injected into the grid equals p ac n,t, = min dη inv p dc n,t, , S ac n, , where d is the derating factor. Equation (3) shows that, in cases of excess available AC power generation due to exceedingly high irradiances, the output of the inverter p ac n,t, is clipped to match its apparent power capability S ac n, . This clipping effect is accounted for in the PV Watts calculator [11]. By substituting the right-hand side of Equation (2) into Equation (3), the operational constraints on p ac n,t, and q ac n,t, , expressed in terms of sizing variables A n, and S ac n, , are given as follows: Constraint (4b) is a second-order cone (SOC) while constraint (4a) is nonconvex as the right-hand side is the minimum of two expressions that depend respectively on variables A n, and S ac n, . In Sections 2.2.1 and 2.2.2, we detail two engineering designs that easily bypass this non-convexity. The designs are based on assumptions on the DC:AC ratio which for n ∈ N + and ∈ L n is denoted by κ n, and is defined as The first design, referred to as the optimal design, is explained in Section 2.2.1 and is based on the requirement that the DC:AC ratio of all PVs to be installed must be smaller than a maximum pre-specified DC:AC ratio denoted by κ max . Concretely, for all n ∈ N + and ∈ L n , the following is required: The second design, referred to as the alternative design, is explained in Section 2.2.2 and considers that the DC:AC ratio κ n, is known for all modules.

Optimal Inverter Sizing
We first present an assumption on solar irradiances and the maximum pre-specified DC:AC size.

Assumption 1.
The historical data on solar irradiance is such that the following holds: where ι max = max n,t ι n,t .
We have verified, based on the solar irradiance data obtained from PVWatts for San Antonio, that, for the common DC:AC ratio size of 1.1, the condition in Assumption 1 (Equation (7)), is satisfied. Based on Assumption 1, the following proposition offers a path to bypass the nonconvexity in (4a). Proposition 1. By Assumption 1, Constraint (4a) reduces to the ensuing linear constraint: p ac n,t, = dη inv η module A n, ι n,t , n ∈ N + , t ∈ T , ∈ L n .
Proof. Due to Equation (7), it holds that Substituting for p dc0 n, in (9b) using (1) yields Equation (10) suggests that the minimum in (4a) always takes on its first argument, which implies (8).
Notice that if Assumption 1 is not satisfied, then due to (4b), the placement and sizing optimization problem using (10) in place of (4a) implicitly enforces a maximum allowable DC:AC ratio, denoted by

Alternative Inverter Sizing
In case of a pre-specified value of κ n, , the next proposition provides a convex reformulation of (4a).
Proposition 2. Under specified DC:AC ratio κ n, , (4a) reduces to the following two linear constraints: Proof. Constraint (12b) simply states that the DC:AC ratio is fixed at κ n, . By substituting (12b) in place of S ac n, in (4a), we arrive at (12a).
Notice that, in (12a), the terms inside the minimum are dependent on fixed parameters and known scenarios and not on decision variables.

Placement and Sizing Constraints
A binary variable is introduced for the PV placement as follows: where b n, = 1 signifies the presence of a unit at node n and home . The number of installations per node is limited by a budget B n as follows: The following constraint is required for the set of nodes N ∅ where PV installation is not allowed: There is a minimum nameplate apparent power capacity available for installation denoted by S min ac n, . Furthermore, the nameplate apparent power capacity should be limited within a factor θ ≥ 1 of the AC production. Therefore, the following constraint is enforced: In reference (16), the expression dη inv η module A n, ι 0 is the unclipped nominal AC real power generation from the PV module at STC and θ refers to a constant that shows how larger the nameplate apparent power capacity can be in comparison to the unclipped real power generation at STC.
Finally, there is a minimum and maximum of solar panel size available for installation respectively denoted by A min n, and A max n, yielding

Real Power and Reactive Power Consumption
Each user node n ∈ N + consumes real and reactive power. These values are dependent on user behavior and are thus random variables. It can be assumed that these random variables are incorporated and accounted for in the set of scenarios T . In particular, at a user node n ∈ N + , user ∈ L n , per scenario t ∈ T , real power consumption and reactive power consumption are given by p c n,t, and q c n,t, , respectively.

Power Flows
As the real and reactive power generation or consumption changes from user to user at each scenario, the power flows in the distribution network will also be scenario dependent. Let P n,t and Q n,t respectively be the real and reactive power flow going into node n at scenario t; and v n,t be the squared magnitude of the voltage phasor at node n at scenario t. The LinDistFlow approximation of the power flow equations is adopted here [36] (where all quantities are measured per unit): v A n,t = v n,t + 2(r n P n,t + x n Q n,t ), n ∈ N + , t ∈ T , ∈ L n .
In reference (18), q s n is the reactive power injected by shunt capacitor at node n at nominal voltage, and r n and x n are respectively the resistance and reactance of line n. The voltage at the substation is considered to be fixed at one per unit. For every user node n ∈ N + , the voltage should be maintained close to the substation voltage. Thus, the following constraint carries out the voltage regulation: where is a small value, usually 0.03 or 0.05.

Objective Function
Three objectives are considered: 1. PV panel area cost a dc η module A n,l ι 0 for n ∈ N + and ∈ L n . The cost per kW is represented by a dc . 2. Inverter nameplate apparent power capacity cost denoted by a ac S ac n, for n ∈ N + and ∈ L n .
The cost per kVA is represented by a ac . 3. The term r n (P 2 n,t + Q 2 n,t )/V 2 1 that captures thermal losses [4] multiplied by the price, denoted by C ($/kWh), that utility buys from the market.

Optimization Problem
Let us introduce the following collection of variables: Then, according to Section 2.6, the objective function is written as The solution of (22) yields the power flows and voltages at every node n ∈ N and scenario t ∈ T , as well as the real and reactive power injected into the grid at every node n ∈ N + , user ∈ L n , and scenario t ∈ T . Furthermore, the binary installation variables b n, determine the optimal placement of the PV units while variables S ac n, and A n, respectively determine the PV nameplate apparent power capability and panel area. Problem (22) is a MISOCP due to the binary variables b and the SOC (4b).

Placement and Sizing with Alternative Inverter Design
With a specified DC:AC ratio, the optimal placement and sizing problem is given by minimize b,S ac ,A, p ac ,q ac , P,Q,v f (S ac , A, P, Q) subject to (4b), (12), (13)- (19), which is similar to (22) except for the fact that the two linear constraints of (12) replace (10). The next section details the input parameters required for the optimization problems (22) and (22 ), and gives the overall design procedure.

Numerical Data for Experiments and Design Procedure
This section details the distribution feeder used to test the method (Section 3.1), the generation of load (Section 3.2) and irradiance scenarios (Section 3.3), and the sources for installation and electricity costs (Section 3.4). Section 3.5 outlines the overall design procedure.

The Test Network
The IEEE 34-node distribution test feeder [37], shown in Figure 3, has been selected for the numerical studies. Node 1 is the substation and the remaining nodes constitute N + . The values for line impedances are provided in Table 1 while the values of peak real and reactive loads as well as shunt capacitors are included in Table 2. Voltage and power bases for the network are respectively V base = 24.9 kV and S base = 500 kVA.   Table 3. Specifically regarding the maximum panel area A max n,l , we have surveyed 348,000 detached single-family homes in San Antonio and have selected the minimum home size as the maximum available panel area [38].

Load Scenarios and Allocation of Users per Node
The load is assumed to operate in three scenarios: (1) at peak consumption, (2) at 150 % of peak consumption, and (3) at 50 % of peak consumption. These three scenarios are combined with irradiance scenarios elaborated in Section 3.3.
The allocation of users to nodes is as follows. Based on [39], the average residential load consumption is 6.59 kW. If the load of a particular node is less than or equal to 10 kW, then that node is considered to have one user. If the load of a particular node is greater than 10 kW, then the number of users of that node is found by dividing the load by 6 kW. The resulting number of users per node is shown in Table 4.  3  9  19  5  13  7  28  1  12  1  5  3  20  7  14  1  29  3  24  4  10  5  22  1  15  1  30  24  18  14  11  22  23  8  17  5 32 1

Irradiance Scenarios
Irradiance scenarios are based on the NREL PVWatts calculator. PVWatts includes solar resource data, system info, and the DC and AC output generation. First, the zip code 78249 is selected for the location. PVWatts obtains weather data including solar irradiance for the selected location. The default input parameters are then input to the PVWatts calculator. The output of the PVWatts calculator gives two sets of irradiance data. One is monthly energy (solar radiation), i.e., the average monthly plane-of-array (POA) irradiance ι m (kWh/m 2 /day), and the other is the hourly POA irradiance ι h (W/m 2 ). These are related by the following Equation [11]: Irradiance scenarios ι n,t are then calculated by dividing ι m with the average number of non-zero irradiance hours in month m and are shown in Table 5. The total number of scenarios is thus T = 36, i.e., 3 load scenarios × 12 irradiance scenarios. For n ∈ N + and t ∈ {1, ...12}, p c n,t is the peak load (see Table 2); for t ∈ {13, ...24}, p c n,t is 150% of the peak load, and for t ∈ {24, ...36}, p c n,t is 50% of the peak load. Table 5 shows the irradiance scenarios ι n,t for scenarios t = 1, ..., 12. The same values are repeated for all three load cases.

Installation and Electricity Costs
The cost function parameters are given next: 1. Installation Costs a ac , a dc : The inverter installation cost a ac is given as 0.75 $/W in [40]. The PV panel area cost a dc is given by 11.54 $/W, which is the sum of all costs $/W dc including module cost, balance of system, installation labor, and the system installed cost [40]. 2. Electricity Costs: According to the Wholesale Electricity Market Data of 2016 [41], a representative price of electricity at which the utility buys from the market is 0.037 $/kWh.

Design Procedure
An overview of our proposed approach is presented in the diagram of Figure 4. In this diagram, the first block collects the required input parameters required by the optimization problems (22) and (22 ). This block also provides the appropriate table or section in the paper that details the specific parameter values used in this study.

Input parameters
Optimal decisions Figure 4. A diagram of the approach. The first block collects and organizes the input parameters required for the optimization problem. Refer to the tables in parenthesis for specific values of these paremeters. The second block portrays the optimization problem that are carried out by CVX. Upon solving the optimization problems, optimal placement and sizing decisions as well as estimates of nodal voltages and branch power flows are output to the third block.
The optimization problems are then programmed in the CVX toolbox [42,43]-a specialized modeling package designed for specifying and solving convex programs. In particular, the CVX toolbox provides an automated way to translate the mathematical form of convex problems (22) and (22 ) to their standard optimization form. The standard form is understood by an optimization solver, which is called from inside CVX. The outputs obtained by CVX are the optimal placement and sizing decisions as well as estimates of nodal voltage levels and branch power flows during various operation scenarios, as depicted in the third block.
This study is tested using the previously mentioned available data, but the optimization model is very general, and can accept any combination of feeder, load and irradiance scenarios, and costs as inputs. The numerical results obtained by the procedure of Figure 4 are presented and analyzed in the next section.

Results and Discussion
In this section, we examine the results of the placement and sizing problem in terms of costs, voltage regulation, number of PV installations, as well as panel area sizes. The first part, Section 4.1, discusses the results solved by problem (22). The second part, Section 4.2, provides a comparison between the solutions of problem (22) and (22 ).

Results of Placement and Sizing with Optimal Inverter Design
Voltage regulation is the task of maintaining voltages across the distribution network close to the nominal value of the substation voltage. When there are no PV units present, the feeder voltage profile obtained by running the load-flow using the LinDistFlow is depicted in Figure 5. It can be observed that, when consumption is at 150% of the peak load, voltages drop as nodes get farther away from the substation. When a maximum installation of one PV unit per node is allowed, the optimal solution from problem (22) yields the voltage profile in Figure 6 where every nodal voltage in the system remains within appropriate bounds for every generation scenario. This constraint is enforced via (19), where = 0.03. This simple experiment motivates the voltage regulation benefits of placing PV generation units in distribution networks. In what follows, we will examine the optimal setups in cases where more homes per node are allowed to install PV units.    Nodes n 2 N n N?    Figure 8 for node 20 and B n = 5. The same applies for B n = 1, 10, 15, 24. The average nameplate DC rating of the PV module is depicted in Figure 9, which is calculated using A n,l through (1).   Nodes n 2 N n N? Using Figures 8 and 10, the maximum of the average panel area and the maximum of the average inverter capacity for each B n are listed in Table 6. For example, it follows from Figure 8 that, if B n = 5, the installations are allowed at nodes 11, 19, and 20. The average values of the panel area for allowed installations at nodes 11,19, and 20 are 83.95 m 2 , 40.33 m 2 , and 37.92 m 2 , respectively. The maximum of the three values is 83.9548 m 2 , which corresponds to the maximum of the average panel area for B n = 5. The same is applicable for B n = 1, 10, 15, 24. The maximum of the average inverter capacity is given as the maximum value of the average inverter capacity for each of the B n bar plots in Figure 10. For example, it is inferred from Figure 10 that, when B n = 5, the installations are allowed at nodes 11,19, and 20. The average values of the inverter capacity for allowed installations at nodes 11, 19, and 20 are, respectively, 33.25 kVA, 15.98 kVA, and 15.03 kVA. The maximum of the aforementioned three values is 33.25 kVA, which corresponds to the maximum of the average inverter capacity for B n = 5. Table 6 shows that, as the number of installations allowed per node increases, the maxima of the average panel area and the average inverter capacity decrease.  Table 7 lists the optimal value, installation cost, including inverter and DC cost, and thermal loss cost. From Table 7, it is observed that the optimal value and the installation cost remain the same for B n = 15 and 24. It is also observed that the DC costs remain the same for B n = 5 and B n = 10 although there is a significant difference between the maximum of the average panel area for B n = 5 and B n = 10 in Table 6. The reason is that the sum of the panel areas of all the allowed installations per node for B n = 5 and B n = 10 is the same and is equal to 735 m 2 . A similar observation holds for B n = 15 and B n = 24. In this work, the maximum value of A n, is relatively large, that is, 100 m 2 (cf. Section 3.1). Therefore, the results for B n = 1 give large panel sizes, but, for larger values of B n , e.g., for B n = 15, the resulting panel area sizes are realistic.

Comparison between Optimal and Alternative Inverter Design
Figures 11 and 12 provide the comparison of panel areas and inverter capacities obtained from the optimal inverter design of (22) and the alternative inverter design of (22 ) with B n = 24. The panel areas coming from the alternative design are nearly three times higher in comparison to the panel areas offered from the optimal design. The main finding is that the same inverter capacity can be achieved by both designs; however, the panel area resulting from the optimal design of (22) is much smaller than those of (22 ). Optimal inverter sizing is dictated by the feeder reactive power support needs, which are determined by the load and irradiance scenarios through the power flow equations of (22). 3 5 10 11 12 13 14 15 17 18 19 20 22 23 24 28 29 30 32 Nodes n 2 N n N?  Table 8 depicts the comparison between the maximum of average panel areas and the maximum of average inverter capacities resulting from the optimal design of (22) and the alternative design (22 ) with B n = 24. It is observed that although the maximum of average panel areas from (22 ) is three times higher than the maximum of average panel area from (22), the maximum of average inverter capacities is almost the same for both designs. It is concluded that the model given by (22) is less costly compared to the alternative model of (22 ) since the same inverter capacity is achieved by smaller panel areas. To bear witness, Table 9 shows the optimal values, installation costs, and thermal loss costs for the two designs with B n = 24. Table 9 reveals that the total cost and the installation costs of (22) are smaller than those of (22 ).

Conclusions
This paper develops a two-stage stochastic program that serves as a tool for optimally determining the placing and sizing of PV units in distribution grids. In particular, a novel analytical PV model that justifiably captures the mapping from solar irradiance to power injection is introduced in this work and is incorporated into the system-level study. By modeling the stochasticity of solar irradiance and loads via a finite set of scenarios and incorporating them in the power flow equations, optimal PV locations and sizes that minimize thermal loss costs are determined via two-stage stochastic programming. A comparison between two designs, one with pre-specified DC:AC ratio and another with pre-specified maximum DC:AC ratio based on historical data, shows that the latter method reduces costs by reducing the panel area. Overall, this paper develops a rigorous framework that can guide electric utility companies in identifying optimal locations for PV placement and sizing, assist with targeting customers with appropriate incentives, and encourage solar adoption.