# Algorithms for Optimal Power Flow Extended to Controllable Renewable Systems and Loads
###### Abstract  
In an effort to quantify and manage uncertainties inside power systems with penetration of renewable energy, uncertainty costs have been defined and different uncertainty cost functions have been calculated for different types of generators and electric vehicles. This article seeks to use the uncertainty cost formulation to propose algorithms and solve the problem of optimal power flow extended to controllable renewable systems and controllable loads. In a previous study, the first and second derivatives of the uncertainty cost functions were calculated  
cost of uncertainty, in the article written by [PERSON] et al. [5], the cost of uncertainty was calculated for a run-of-river hydroelectric power station, whose generation depends on the flow of the river from which the station feeds; it is exposed that the behavior of river flows is associated with a Gumbell distribution. In many cases, you may not have historical measurements of the resource you want to take advantage of (for example, in remote, non-interconnected areas). For these cases, a uniform distribution of the resource to be exploited could be assumed. [PERSON] et al. [6] propose the calculation of the cost of uncertainty for uniform distributions. The uncertainty in the loads can be modeled by a normal distribution [2]. [PERSON] et al. [7] describe the calculation of the uncertainty cost for controllable loads. The uncertainty cost calculation for controllable loads is also valid for any other load, since controllable loads have normal behavior. It is necessary to clarify that the results of the uncertainty cost functions in the previously mentioned works [4; 5; 6; 7] were validated using the Monte Carlo method. Now, to achieve a reliable operation, and so that the beginning of the operation about non-conventional renewable energy sources can be reflected in an economic benefit, it is necessary to perform Optimal Power Flows (OPFs) which consider costs of uncertainty. In the literature, there are models of optimal power flow that consider different costs of uncertainty and are solved analytically [3; 8] or through heuristic techniques [9; 10; 11; 12; 13; 14]. The OPFs have different applications and are generally differentiated by objective functions, restrictions, the type of network to be optimized, and so forth. In relation to OPF in [PERSON] et al. [3] an optimal power dispatch is presented considering two wind generators and their associated uncertainty cost in a system with two conventional generators. The work from [PERSON] et al. was supplemented by [PERSON] et al. [11] when solving an OPF using particle swarm optimization (PSO), considering the uncertainty costs of electric vehicles and wind generators in a 118 node IEEE power system. From the previously mentioned works [3; 4; 11], [PERSON] et al. [9] show the calculation of an OPF that takes into account the cost of uncertainty in wind and solar generators and that of the large-scale entry of electric vehicles. In this work, the 118-node IEEE system was used and the PSO algorithm was used to solve the optimization problem. [PERSON] and [PERSON] [15] propose the calculation of an OPF in various operating scenarios of the system. In their work, a simplified model of the Colombian network was considered, as well as the future agglomeration of solar and wind resources on the Caribbean coast [16]. These same authors, in a different work [12], showed the calculation of an OPF using the DEEPSO method (combination of particle swarm and differential evolution) for the IEEE system of 118 nodes with costs of uncertainty from wind generators, solar plants and electric vehicles. The optimal power flows mentioned so far have been formulated for large systems and their sources of uncertainty have been solar radiation, the speed of time and/or the delivery of energy to the grid by electric vehicles. However, with the penetration of distributed generation, the possibility arises that some clients of the system satisfy part or all of their demand for a certain time, becoming a controllable load.