**2. Mathematical Model**

The problem of the optimal location of PV plants in DC networks considering load variations corresponds to a nonlinear, non-convex and non-differentiable optimization problem that combines discrete and continuous variables, which generates an MINLP problem [47]. The main interest in this formulation is to minimize the greenhouse emissions produced by diesel generators interconnected to DC rural (isolated) networks [48,49]. The complete mathematical model is presented below:

**Objective function:**

$$\min z = \sum\_{t=1}^{T} \sum\_{i=1}^{N} R\_i^{\otimes t} p\_{i,t}^{\odot \chi} \Delta t,\tag{1}$$

where *z* are the total greenhouse emissions in pounds; *Rgei* is the rate of greenhouse emissions per kilowatt-hour; *pcgi*,*t* is the total power generation in the conventional generators (diesel sources); and Δ*t* is the period of time under analysis, typically Δ*t* = 1 h. Note that *N* is the total number of nodes in the DC grid and *T* is the number of periods of time, *N* and *T* being the sizes of the sets of nodes N and periods of time T , respectively.

**Set of constraints:**

$$p\_{i,t}^{\xi\xi} + y\_i^{pv} p\_{i,t}^{pv,nom} - p\_{i,t}^d = \upsilon\_{i,t} \sum\_{j=1}^N G\_{ij} \upsilon\_{j,t} \qquad \forall \{i \in \mathcal{N}, t \in \mathcal{T}\} \tag{2}$$

$$\delta\_{ij,t} = \mathcal{g}\_{ij} \left( v\_{i,t} - v\_{j,t} \right), \qquad \forall \left\{ ij \in \mathcal{L}, t \in \mathcal{T} \right\} \tag{3}$$

$$p\_{i,t}^{\text{cg,min}} \le p\_{i,t}^{\text{cg}} \le p\_{i,t}^{\text{cg,max}}, \qquad \forall \{i \in \mathcal{N}, t \in \mathcal{T}\} \tag{4}$$

$$-i\_{ij}^{\max} \le i\_{ij,t} \le i\_{ij}^{\max}, \qquad \forall \{ij \in \mathcal{L}, t \in \mathcal{T}\} \tag{5}$$

$$\begin{array}{ll} \upsilon\_{i}^{\min} \le \upsilon\_{i,t} \le \upsilon\_{i}^{\max}, & \forall \left\{ i \in \mathcal{N}, t \in \mathcal{T} \right\} \\ 0 \le y\_{i}^{pv} \le p\_{i}^{pv, \max} x\_{i}^{pv}, & \forall \left\{ i \in \mathcal{N}, \right\} \end{array} \tag{6}$$

 , *N* ∑ *i*=1 *xpvi* ≤ *NG*max *pv* , (8)

where *ppv*,*nom i*,*t* and *pdi*,*t* are the nominal power injection of the PV generator and the power consumption in the node *i* during the period of time *t*; *ypvi* defines the size of the PV generator connected to the node *i*; *ppv*,*nom i*,*t* is the nominal power of the PV generators, which is dependent on the solar forecasting in the zone of influence of the DC network; *vi*,*<sup>t</sup>* and *vj*,*<sup>t</sup>* represent the voltage value in the nodes *i* and *j* respectively during the time *t*; *Gij* is the component of the conductance matrix that relates nodes *i* and *j*, whose value depends on the physical connections between nodes (i.e., it is dependent on the grid configuration); *iij*,*<sup>t</sup>* represents the value of the current that flows between nodes *i* and *j* in the period time *t*, which depends on the conductor conductance named *gij*; *pcg*,min *i*,*t* and *pcg*,max *i*,*t* represent the minimum and maximum capabilities of power generation in the diesel generators connected at the node *i* in the period of time *t*; *ppv*,max *i* is the maximum nominal size of the PV source that can be connected in the node *i*; *i*max *ij* corresponds to the maximum current that can flow through the conductor that connects nodes *i* and *j*; *v*min *i* and *v*max *i* are the minimum and maximum voltage bounds allowed at each node; *xpvi* is a binary variable that defines whether a PV source is installed (*xpvi* = 1 if the PV source is installed and *xpvi* = 0 otherwise) at node *i*; *NG*max *pv* defines the maximum number of PV generators available to be located into the grid. (The components *Gij* and *gij* have the same magnitude;

*i*  , notwithstanding, these differ by sign, *gij* = 1*rij* being positive; i.e., *Gij* = <sup>−</sup>*gij*. *rij* is the resistance value of the conductor located between nodes *i* and *j*.)

The mathematical model defined from (1) to (8) has the following interpretation [22,50]: the objective function (1) quantifies the total greenhouse emissions produced by the diesel generators during their operation; in (2) is presented the power balance equation per node, which is typically known as power flow constraint, this being a non-affine constraint. Expression (3) shows the calculation of the current flow through *ij*th branch as a function of the voltage drop; in (4) is defined the box constraint related with the power capabilities in the diesel generators; in (5) the thermal bounds of the network conductors are presented in Amperes; meanwhile, (6) defines the voltage regulation bounds of the grid, which are defined by regulatory entities. Expression (7) determines the possibility of locating a PV generator in the network by defining its maximum ranks admissible for a generation. Finally, in (8) is presented the constraint associated with the maximum number of generators available for installation.

Note that the mathematical optimization model is complex to be solved, since it combines binary and integer variables, this model being an MINLP [45]. Additionally, the most complicated constraint is the power balance defined in (2), since it represents the hyperbolic relation between voltage and currents in electrical DC networks with constant power loads [51], which is a non-affine nonlinear constraint without convex properties.

Even though in specialized literature it has been reported, some approaches to solving this problem by decoupling it into a master-slave optimization problem with metaheuristics (i.e., genetic algorithms with particle swarm derived approaches [47]), no reports with the multiperiod structure (1)–(8) were found. For this reason, we are concentrating on the mathematical formulation and not on the solution technique. Since recent publications use the GAMS package and its large-scale nonlinear optimizers to solve similar problems [44,48], we decided to use the GAMS package in conjunction with the CONOPT solver as a solution strategy.
