A survey of real-time optimal power flow

: There has been a strong increase of penetration of renewable energies into power systems. However, the renewables pose new challenges for the operation of the networks. Particularly, wind power is intermittently ﬂuctuating, and, therefore, the network operator has to fast update the operations correspondingly. This task should be performed by an online optimization. Therefore, real-time optimal power ﬂow (RT-OPF) has become an attractive topic in recent years. This paper presents an overview of recent studies on RT-OPF under wind energy penetration, offering a critical review of the major advancements in RT-OPF. It describes the challenges in the realization of the RT-OPF and presents available approaches to address these challenges. The paper focuses on a number of topics which are reviewed in chronological order of appearance: ofﬂine energy management systems (EMSs) (deterministic and stochastic approaches) and real-time EMSs (constraint satisfaction-based and OPF-based methods). The particular challenges associated with the incorporation of battery storage systems in the networks are explored, and it is concluded that the current research on RT-OPF is not sufﬁcient, and new solution approaches are needed.


Introduction
Optimal power flow (OPF) plays a substantial role in the operation of power systems. In general, OPF schedules the decision variables of the power system in an optimal way which simultaneously satisfies power flow balance equations and power system constraints (e.g., nodal voltages and apparent power in the feeders). The resulting optimization problem is usually large-scale non-convex and with mixed-integer variables. Various methods have been put forward to solve the OPF problem for different types of network topologies, voltage levels, with or without renewable energy generations (REGs) and embedded battery storage systems (BSSs). These approaches were assessed in detail in a number of review papers on OPF, published over the past decades [1][2][3][4][5][6][7][8][9][10][11][12][13][14].
Renewable energies are considered to be the major source of energy to satisfy demand in the near future. This is mostly due to the shrinking price of their technology, technological improvements in information and communications technology [15][16][17][18][19][20] and artificial intelligence [21,22], and strict emission policies The integration of REGs into energy networks leads to a transformation from passive to active energy networks. However, this transformation brings new challenges to the network operators. Since REGs are fluctuating, some amount of generated power cannot be accommodated in the network. This amount of power will be curtailed [23] because of technical or economic reasons, meaning that not all the potentials of the REGs are utilized. Therefore, many studies have been carried out to decrease the curtailment levels in energy networks [24][25][26][27][28][29]. A promising solution to reduce the curtailments is to use BSSs to store the excess energy and provide it back to the grid in a proper min u(t),l(t),y(t) f (x(t), u(t), l(t), y(t), ξ(t)) s.t. . x(t) = g(x(t), u(t), l(t), y(t), ξ(t)), In Equation (1), f denotes the objective function to be minimized, x represents the vector of state variables, u is the vector of continuous decision variables, l denotes the vector of integer decision variables, y represents the vector of binary decision variables, and ξ is the vector of random variables. Here, g denotes dynamic model equations with initial states of x 0 at t 0 , x min/max represents the There could be many different objective functions when formulating an OPF. The most common ones are the minimization of total generation costs [36,37], total network losses [25], and/or the maximization of total yield from the network [26] and environmental benefits [38,39]. The vector of state variables x could contain voltages of the PQ buses [40][41][42][43][44], active-reactive power at swing bus, and power flows in feeders [45]. The vector of continuous control variables u could include active and reactive power generation [40] (conventional and/or renewable generations) and charge and discharge power of the storage units [25,26]. The vector of discrete control variables l could consist of reference values of slack bus voltage [46,47] (for the sake of simplicity, some studies consider the slack bus voltage as a continuous variable [48,49]), and the vector of binary control variables could consist of the charge/discharge status of BSSs. The vector of random variables ξ could consist of REGs and/or load demand [35,50,51]. The random variables are the generated amounts of REGs usually considered as being stochastically distributed with a known probability density function ρ(ξ). The time step t could also be considered as an integer variable to be optimized in the optimization problem; for instance, it could be the number of daily charge/discharge hours of BSSs [26]. The dynamic model equations g generally consists of power flow equations at the buses [46] and the energy equations for batteries [25]. The inequality constraints could include lower and upper limits of state and decision variables.
The optimization problem in Equation (1) is a large-scale dynamic MINLP problem under uncertainty. This problem is difficult to be readily treated, and, therefore, a high number of studies either focused on specific instances of the problem or simplified the OPF problem by using various assumptions. For instance, OPF has been solved by linear programming (LP) [52,53], nonlinear programming (NLP) [37,54], quadratic programming [36,55,56], mixed-integer linear programming (MILP) [57,58], and MINLP [46,[59][60][61]. For a detailed review on these approaches, we refer the reader to the survey in [10].

Offline EMSs
Different methods have been proposed and used for offline energy management of energy networks. The methods are broadly classified into two main categories: (1) Deterministic EMSs, by which the outputs are determined using forecasted parameter values.
In other words, uncertainties are not considered when computing the solutions. (2) Stochastic EMSs, which consider the uncertainties and inaccuracies of the forecasted values when computing the solutions. It means the control strategies obtained in this way are more likely to be functional in practical applications under uncertainty.

Deterministic EMSs
Deterministic EMSs do not take into account the uncertainties in the energy networks. Therefore, they are based on the assumption that the forecasted values are accurate, neglecting the probable deviations from the actually realized values. For this, here, we adapt the general OPF problem formulation in Equation (1) for a deterministic OPF as follows: Energies 2018, 11, 3142 4 of 20 where, compared to Equation (1), ξ(t) has been removed from the objective function f and model equations g (usually, they are replaced by their nominal or expected values), meaning that there is no randomness in the problem formulation. Focusing on different aspects of Equation (2), a vast number of studies have been made on OPF for offline operation planning of energy networks, since it was proposed by Carpentier in 1962 [54]. Indeed, from 1962 to late 1990s, most of the studies focused on OPF without REGs. For instance, a reactive volt-ampere control method was proposed in reference [62] to minimize the losses of a power transmission network. Based on reference [54], the general problem of minimizing the total operation cost of a power system was formulated [63] as an NLP problem. This study [63] was later extended [37] and proposed a method to solve OPF considering active-reactive power and the tap ratios of transformers as decision variables to minimize losses or costs in a network. Besides, a unified approach based on the Carpentier's formulation [54] was proposed in another work [64] to solve the OPF problem.
Several studies have been conducted on the incorporation of security constraints in power flow formulations. For instance, the outage contingency constraints [65] were incorporated in a study [66], extending the OPF problem formulation described in reference [37]. Using sequential LP [67], the studies in references [68,69] solved a security constrained economic dispatch problem. Reference [70] proposed an approach for economic dispatch and security control using the combined quadratic-separable programming methods. Using sequential quadratic programming (SQP) [71][72][73], a study [74] presented a procedure for solving the problem of security-constrained economic dispatch.
Optimal reactive power flow has attracted the attention of numerous research studies. For instance, references [75,76] presented methodologies for the optimal planning of reactive power sources in a power system. A method for optimal dispatch of active-reactive power flow in large-scale networks was presented [36,56]. A dual augmented Lagrangian approach was proposed [77] for solving optimal active-reactive power flow. Using a heuristic method, a study [78] developed an optimization tool to find the optimal size and location of reactive power sources, while considering security constraints for a transmission network. Extending the interior point method introduced in reference [79], the authors of the study described in reference [80] solved an economic dispatch and a reactive power scheduling problems. A full alternating current (AC) OPF to find the reactive power margins from the point of voltage collapse was formulated [81]. Based on the Newton's method, a study [82] proposed an approach for the optimization of reactive power dispatch. Reference [83] proposed an LP-based trade-off method to solve the reactive power compensation problem, taking into account both technical and economic aspects. Reference [41] incorporated the costs of adjusting control devices into a reactive power flow optimization problem while minimizing energy losses. A planning approach for optimal capacitor allocation was proposed [84], aiming at minimizing energy losses while reducing installation costs. Incorporating the expected lifetime of devices in the optimization formulation, the optimal number and location of the capacitors were obtained in this study [84]. Reference [85] proposed an approach for OPF to manage voltages in interconnected networks through switching of the reactive power compensators, tap positions of transformers, etc.
A number of studies have incorporated discrete decision variables into the optimization problem formulation, leading to MINLP problems in which special methods to address integer variables are required. For instance, ref. [86] proposed a distributed algorithm for solving OPF problems for large-scale systems with discrete decision variables. Reference [87] proposed an iterative approach based on the Lagrangian multiplier to treat discrete variables in OPF computations. Reference [88] proposed an enhanced genetic algorithm [89,90] for solving OPF problems, including both continuous and discrete decision variables. The continuous decision variables in reference [88] included active power of generators and bus voltage magnitudes, whereas the discrete decision variables were the tap positions of transformers and switchable shunt devices.
From another perspective, many studies have focused on numerical approaches to solving OPF for different purposes. For instance, for the sake of fast and reliable computations, refs. [91][92][93] applied an LP method to power systems security control calculations. Reference [94] presented an LP-based approach for OPF to reschedule active power controls and satisfy voltage constraints. Using LP, ref. [95] presented a method to find an optimal solution for both planning and operation of large-scale systems. In reference [96], the authors extended the reduced gradient method [97] to solve OPF problems for large-scale networks. An OPF problem was solved in another study [98] using a Hessian method. Reference [99] proposed an approach to identify binding inequality constraints in OPF problems solved by the Newton method. A nonlinear interior point method to determine the maximum loadability of a power system was proposed [100]. Based on the Lagrangian relaxation decomposition procedure, ref. [101] developed a framework for multi-area OPF problem aiming at the independent dispatch of each individual area, while achieving the economic optimum of the whole system. Reference [102] proposed a method to solve dynamic constrained OPF as a semi-infinite programming problem with infinite constraints. A method for nonconvex OPF problems was proposed in ref. [103], which is based on the derivation of OPF dual as a convex linear matrix inequality optimization. Under certain conditions, the duality gap is zero, leading to the recovering of the global optimal solutions of the OPF from a dual optimal solution [103].
Since late 1990s, there has been a strong increase of penetration of REGs into energy networks. The optimal location of REGs was initially considered in a study [104] whose objective was to determine the optimal location of distributed generation units which could result in minimization of energy losses, feeders power, and reactive power requirements. Afterward, many studies focused on the different aspects of renewable energy penetration into the networks. For instance, ref. [105] developed an OPF framework to maximize the penetration of wind generation by optimally determining different control variables, e.g., generation curtailment, tap position of on-load tap changers, and reactive power absorption. Reference [106] presented OPF-based techniques to evaluate the distribution network capacity for the penetration of renewable energy sources.
More recently, BSSs have been used with REGs to decrease their curtailment levels and absorb their fluctuations. For this reason, many studies have been published on the optimal sizing and allocation of BSSs in the energy networks. For instance, refs. [107,108] proposed a method for optimal sizing and allocation of BSSs in a distribution network to decrease the wind power curtailment. Reference [109] developed an optimization technique for the sitting and sizing of BSSs in distribution networks. Using a genetic algorithm, an approach for the optimal allocation and economic analysis of BSSs in microgrids was proposed in ref. [110]. Optimal sizing and control methods for a zinc-bromine BSSs were also proposed [111]. Reference [112] developed a tool to be used in a decision-making process to install BSSs. This tool is based on a multi-objective optimization to determine the trade-off between annual cost, voltage regulation, and peak power reduction.
A growing number of studies have investigated the optimal operation of BSSs in energy networks. For instance, ref. [113] proposed an approach to optimally control BSSs in microgrids, aiming at minimizing the costs of energy import at the point of common coupling. An OPF with simple charge-discharge dynamics for large-scale BSSs was formulated [114]. Considering REG curtailments, BSSs, and flexible demand, a dynamic OPF framework for an active network management was developed in ref. [115]. Using a linear, lossless direct current (DC) OPF, another study [116] proposed a method to decrease REG curtailments in the presence of storage devices. An OPF problem was formulated [25], employing active-reactive power capabilities of BSSs [117,118] to increase the total yield of a distribution network. It is worth mentioning that utilizing the reactive power capability of distributed energy resources leads to significant economic [119] and technical benefits [120,121]. In addition, the BSSs described in reference [25] operate on the basis of a fixed length of charge and discharge periods, which was later extended [26] for flexible charge and discharge periods, though still with a fixed length of charge-discharge cycles. It is noted that the work in reference [26] provides identical operation strategies for different BSSs, which was later improved [122,123] by determining optimal decision variables for each individual BSS, resulting in a more complex and larger optimization problem.
In general, many mathematical models have been developed for optimization under uncertainty [142], each of which could be suitable for a specific type of application. For instance, robust optimization and worst-case scenario optimization [143] is used when an application does not tolerate any constraint violation. In the problem formulation of robust optimization, the uncertain variables are described as random values in defined intervals [143]. Robust optimization has attracted the interest of many researchers dealing with uncertainties in power systems [144][145][146][147][148][149][150]. For instance, using a DC model, an OPF algorithm to achieve robust operation when there exist uncertainties associated with REG and demand was developed in ref. [151].
In power systems, however, there are some types of constraints (e.g., lines currents) which are allowed to be out of their permissible limits only to some degree and/or for a limited time. For this reason, the chance constrained optimization method [152][153][154][155][156][157] can be used to formulate the OPF problem under uncertainty. In the problem formulation of chance constrained optimization, the uncertain variables are described as random variables with defined stochastic distributions. In particular, the distributions of the generation of renewable energy are non-Gaussian, e.g., wind energy is usually described by the beta distribution [158][159][160]. Based on the distribution function of the random penetration, chance constrained OPF [35,51,[161][162][163] aims at minimizing/maximizing an objective function, while satisfying certain constraints with a predefined probability level. For a chance-constrained OPF, if the model is linear, and the random variables are normally distributed, there exists an equivalent deterministic representation. Otherwise, the problem should be solved using an approximation method, e.g., the sample average approximation (SAA) [164], back-mapping [35,165], and inner-outer approximation [166,167].

Real-Time EMSs
In recent years, the penetration of REGs has been significantly increased, leading to increased complexity of the energy networks. Therefore, in addition to the uncertainty of load demand, the REG introduces further randomness and fluctuations to the network, which poses new challenges to system operators. The main difference between these two sources of uncertainty is that the load demand is more predictable than the REGs (particularly, wind energy) for very short-term forecasting [168][169][170][171]. Moreover, the fluctuations of the REGs, in particular wind power, are more considerable. To react to these fluctuations, the system operators need to update the operation strategies in real time. Different approaches have hitherto been proposed for the online management of the networks. Here, we classify these approaches into two main categories, as follows: (1) Constraint satisfaction-based RT-EMSs, which provide solutions to satisfy technical constraints.
The solutions obtained in this way may not be optimal. (2) OPF-based RT-EMSs, which provide '(sub)optimal' solutions in real time, while satisfying technical constraints.

Constraint Satisfaction-Based RT-EMSs
Constraint satisfaction-based RT-EMSs do not 'optimize' the decision variables of the networks. Therefore, the main focus is to find feasible (but not optimal) decision variables which, in real time, satisfy the network constraints, e.g., nodal voltages, apparent power in feeders, etc. For this, the general OPF problem formulation in Equation (1) is adapted as follows: . x(t) = g(x(t), u(t), l(t), y(t), ξ(t)), where there is no objective function to be minimized/maximized, but the model equations and inequality constraints must be satisfied. There is a vast amount of literature on such RT-EMSs, each of which focuses on a particular aspect of power systems. For instance, a real-time energy management algorithm for alleviating pulse loads in hybrid AC/DC microgrids with REG and energy storage systems (ESSs) was developed [172]. The main objective of the RT-EMS described in this study is to manage the power flow in the network in a way that the impacts of short-duration loads on the network stability are minimized. Another RT-EMS was introduced [173] for grid-connected plug-in hybrid electric vehicle charging parks with REGs. The developed method mainly aims at decreasing the overall daily costs of charging plug-in hybrid electric vehicles as well as the effects of the charging park on the main network.
A real-time control strategy was proposed [174] to dynamically balance electric consumption and generation, while considering REGs and ESSs in the network. This method is based on model predictive control (MPC) [175][176][177][178], by which the set points for traditional generation units and the ESSs are continuously updated regarding the state of charge of the BSSs and the forecasted REGs and demand. The MPC-based approach [174] was extended [179] to facilitate the day-ahead power reference-tracking functionality for the efficient operation of the network, while ensuring the operation of ESSs. The main objective of this study was smoothing and controlling of the power profile exchanged in the high-voltage/low-voltage (HV/MV) substation when high REGs are penetrated to the MV network.
Using intelligent systems methods, an autonomous regional network management system was developed [180], aiming at power flow management, automatic restoration, and voltage control. The utilization of constraint programming for autonomous power flow management was reported [181]. The method in reference [181] used artificial intelligence of constraint programming to determine the decision variables. The studies in references [180,181] were extended [27] to investigate the effects of the methods on reducing REG curtailments. In reference [27], a number of scenarios are provided to the closed-loop energy management algorithm to detect and mitigate thermal constraint violations.

OPF-Based RT-EMSs
Aiming at replacing the classical real-time economic dispatch, optimization-based RT-EMS represents the most advanced and challenging version of Equation (1), in which a large-scale stochastic dynamic MINLP problem should be solved in real time. As illustrated in Figure 1, the main idea of real-time OPF (RT-OPF) is to react to the fluctuations of uncertain parameters ξ in the energy network at every sampling time T S . These reactions could be either optimal or suboptimal. This is in contrast to offline OPF (deterministic and stochastic), where the optimal operation strategies are calculated only once for each prediction horizon T P . A general RT-OPF method is illustrated in Figure 2. The optimal set points of the controller are obtained by OPF in each T P , which are later corrected in real time on the basis of actual measurements. A feedback control system measures, monitors, and controls the variables to ensure the desired response of the network. S This is in contrast to offline OPF (deterministic and stochastic), where the optimal operation strategies are calculated only once for each prediction horizon P T . A general RT-OPF method is illustrated in Figure 2. The optimal set points of the controller are obtained by OPF in each P T , which are later corrected in real time on the basis of actual measurements. A feedback control system measures, monitors, and controls the variables to ensure the desired response of the network. In 1988 [182], Bacher and Van Meeteren presented the concept and mathematical formulation of an RT-OPF. Their work was based on a quadratic optimization method using a linear model. A real-time execution of optimal reactive power flow was presented [183]. The main objectives of this study are to avoid voltage violation and excessive adjustment of transformer tap settings and var source switches, while minimizing energy losses in the network. It is noted that the networks in references [182,183] included only traditional power generation units, i.e., REGs were not taken into account.
By means of learning architecture based on fully connected neuron networks and considering REGs, an RT-OPF approach to achieve a short sampling time (e.g., less than three minutes) was proposed [184]. The neural networks are trained on some scenarios of the uncertainties (i.e., REG and load demand) in the network. This method was verified by using a 23-bus distribution network including two wind generators. A risk-based RT-OPF approach was introduced [24], aiming at maximizing wind energy penetration while satisfying network constraints with a pre-specified risk level. Using multi-minute control cycles while considering uncertainty of wind power, the management system in reference [24] reduces the number of control actions of on-load tap changers and REGs.
A real-time gradient-based approach for OPF on radial distribution networks was proposed [185]. The method is based on the quasi-sequential approach proposed in reference [34], which was improved in another study [186]. The problem is broken down into two stages: simulation and optimization. In the simulation stage, model equations are solved to obtain the values of the state variables. In the optimization stage, the control strategies are determined by means of an NLP solver. Barrier terms are used in the objective function to penalize the violations of inequality constraints. However, this requires feasible guess points, which could be difficult to determine for the OPF. The key feature of the method in reference [185] is that the intermediate iterates of the OPF can be realized in the network in real-time. Although the intermediate solutions are not optimal, they satisfy power flow equations and network constraints.
In a study [187], the authors extended the work carried out previously [180,181] to focus on real-time testing and the application of the OPF to the distribution energy management problem. For this, the practical applicability of the OPF in an online closed-loop operation mode was demonstrated [187]. This study was further extended [27] to reduce REG curtailment. The results in reference [27] show that the use of the OPF-based RT-EMS leads to a lower REG curtailment compared to the constraint satisfaction-based RT-EMS. In 1988 [182], Bacher and Van Meeteren presented the concept and mathematical formulation of an RT-OPF. Their work was based on a quadratic optimization method using a linear model. A real-time execution of optimal reactive power flow was presented [183]. The main objectives of this study are to avoid voltage violation and excessive adjustment of transformer tap settings and var source switches, while minimizing energy losses in the network. It is noted that the networks in references [182,183] included only traditional power generation units, i.e., REGs were not taken into account.
By means of learning architecture based on fully connected neuron networks and considering REGs, an RT-OPF approach to achieve a short sampling time (e.g., less than three minutes) was proposed [184]. The neural networks are trained on some scenarios of the uncertainties (i.e., REG and load demand) in the network. This method was verified by using a 23-bus distribution network including two wind generators. A risk-based RT-OPF approach was introduced [24], aiming at maximizing wind energy penetration while satisfying network constraints with a pre-specified risk level. Using multi-minute control cycles while considering uncertainty of wind power, the management system in reference [24] reduces the number of control actions of on-load tap changers and REGs.
A real-time gradient-based approach for OPF on radial distribution networks was proposed [185]. The method is based on the quasi-sequential approach proposed in reference [34], which was improved in another study [186]. The problem is broken down into two stages: simulation and optimization. In the simulation stage, model equations are solved to obtain the values of the state variables. In the optimization stage, the control strategies are determined by means of an NLP solver. Barrier terms are used in the objective function to penalize the violations of inequality constraints. However, this requires feasible guess points, which could be difficult to determine for the OPF. The key feature of the method in reference [185] is that the intermediate iterates of the OPF can be realized in the network in real-time. Although the intermediate solutions are not optimal, they satisfy power flow equations and network constraints.
In a study [187], the authors extended the work carried out previously [180,181] to focus on real-time testing and the application of the OPF to the distribution energy management problem. For this, the practical applicability of the OPF in an online closed-loop operation mode was demonstrated [187]. This study was further extended [27] to reduce REG curtailment. The results in reference [27] show that the use of the OPF-based RT-EMS leads to a lower REG curtailment compared to the constraint satisfaction-based RT-EMS.
To decrease REG curtailment, ref. [188] proposed an online data-driven hourly power dispatch. This method uses a linear model and a probabilistic optimization method under uncertain penetration of REG. The dispatchable ranges of REG outputs are determined to cover most of the possible scenarios. On the basis of the dispatchable ranges, the operating base points for the conventional generation units are obtained for the upcoming hour. The operations are corrected when the observations of the actual REG are available. Furthermore, using the same computational framework previously developed [189][190][191], the authors in [192] adopt a multi-period AC OPF method to minimize the losses in the network by real-time control of REGs. penetration of REG. The dispatchable ranges of REG outputs are determined to cover most of the possible scenarios. On the basis of the dispatchable ranges, the operating base points for the conventional generation units are obtained for the upcoming hour. The operations are corrected when the observations of the actual REG are available. Furthermore, using the same computational framework previously developed [189][190][191], the authors in [192] adopt a multi-period AC OPF method to minimize the losses in the network by real-time control of REGs. A real-time approach for OPF in the presence of BSSs and wind farms was proposed [193]. Considering uncertain wind power, this method uses linear MPC to continuously update the planned wind power profiles. The method was tested and verified on a 14-bus transmission network with the sampling period of five minutes. A real-time algorithm was proposed [194] to automatically alleviate contingencies (e.g., feeder overloads and voltage constraint violations). A multi-stage stochastic optimization for real-time economic dispatch of pumped hydro storage was developed [195]. A feedback-based RT-OPF methodology was introduced [196] to satisfy system constraints in real-time. A distributed MPC-based RT-OPF method was proposed [197] for the operation of a network of smart microgrids.
An RT-OPF based on a prediction-realization approach was recently introduced and implemented [39,198]. In the prediction phase, several OPF problems corresponding to wind power scenarios are solved by means of parallel computation. The solutions are then saved as a lookup table. The prediction horizon is further divided into a number of sampling intervals. For each sampling interval, in the realization phase, a solution (i.e., operation strategy) is chosen from the lookup table on the basis of the actual value of wind power. The operation strategy is then realized in the network for the current sampling interval. Then, it proceeds from one interval to another, till the end of the prediction horizon, leading to a real-time prediction-realization framework.
The RT-OPF framework in references [39,198] was extended [46] to simultaneously optimize wind power curtailments of wind farms, variable reverse power flow [199][200][201], and discrete slack bus voltage. This resulted in a task for online solving of MINLP OPF problems. On the basis of a non-Gaussian stochastic distribution [158][159][160][202][203][204][205], in ref. [46] wind power scenarios are generated so that they cover the whole range of [0,1] pu. It means, with a certain degree of conservativeness, that the RT-OPF framework can offer a feasible solution for 'any' actual values of wind power. The RT-OPF framework in reference [46] was further extended [119] to incorporate reactive power dispatch of wind farms. In addition, the study in reference [119] proposed a reconciliation algorithm to overcome convergence issues [206] in RT-OPF computation. Furthermore, using graphical processing units and parallel computing, an approach to accelerate the OPF computations was proposed [129]. To account for fast variations in REGs, a distributed and parallel OPF for transmission networks was proposed in ref. [207].
Taking into account variable demand and REG during the period between two consecutive schedules, a study [208] proposed an RT-OPF strategy to decrease the computation burden. In this method, the scheduling intervals (e.g., 10 min) are divided into a certain number of subintervals (e.g., 1 min). The forecasted values of REG and demand are assumed to be available for the subintervals. The participation factors of conventional generators in the network are obtained by solving an OPF A real-time approach for OPF in the presence of BSSs and wind farms was proposed [193]. Considering uncertain wind power, this method uses linear MPC to continuously update the planned wind power profiles. The method was tested and verified on a 14-bus transmission network with the sampling period of five minutes. A real-time algorithm was proposed [194] to automatically alleviate contingencies (e.g., feeder overloads and voltage constraint violations). A multi-stage stochastic optimization for real-time economic dispatch of pumped hydro storage was developed [195]. A feedback-based RT-OPF methodology was introduced [196] to satisfy system constraints in real-time. A distributed MPC-based RT-OPF method was proposed [197] for the operation of a network of smart microgrids.
An RT-OPF based on a prediction-realization approach was recently introduced and implemented [39,198]. In the prediction phase, several OPF problems corresponding to wind power scenarios are solved by means of parallel computation. The solutions are then saved as a lookup table. The prediction horizon is further divided into a number of sampling intervals. For each sampling interval, in the realization phase, a solution (i.e., operation strategy) is chosen from the lookup table on the basis of the actual value of wind power. The operation strategy is then realized in the network for the current sampling interval. Then, it proceeds from one interval to another, till the end of the prediction horizon, leading to a real-time prediction-realization framework.
The RT-OPF framework in references [39,198] was extended [46] to simultaneously optimize wind power curtailments of wind farms, variable reverse power flow [199][200][201], and discrete slack bus voltage. This resulted in a task for online solving of MINLP OPF problems. On the basis of a non-Gaussian stochastic distribution [158][159][160][202][203][204][205], in ref. [46] wind power scenarios are generated so that they cover the whole range of [0,1] pu. It means, with a certain degree of conservativeness, that the RT-OPF framework can offer a feasible solution for 'any' actual values of wind power. The RT-OPF framework in reference [46] was further extended [119] to incorporate reactive power dispatch of wind farms. In addition, the study in reference [119] proposed a reconciliation algorithm to overcome convergence issues [206] in RT-OPF computation. Furthermore, using graphical processing units and parallel computing, an approach to accelerate the OPF computations was proposed [129]. To account for fast variations in REGs, a distributed and parallel OPF for transmission networks was proposed in ref. [207].
Taking into account variable demand and REG during the period between two consecutive schedules, a study [208] proposed an RT-OPF strategy to decrease the computation burden. In this method, the scheduling intervals (e.g., 10 min) are divided into a certain number of subintervals (e.g., 1 min). The forecasted values of REG and demand are assumed to be available for the subintervals. The participation factors of conventional generators in the network are obtained by solving an OPF problem. The OPF is performed only at the beginning of each scheduling interval, while also satisfying all the constraints of the subintervals by incorporating the generating costs of the subintervals. The operation strategies obtained in this way are named 'best-fit' participation factors [209,210]. They are then utilized to correct the decision variables of subintervals based on forecasted values of REG and demand. The RT-OPF approach [208] is only applicable when the total demand and losses in the network are greater than the REG. Otherwise, the approach needs to be adapted to incorporate REG curtailment and/or bidirectional power exchange with an upstream network and/or BSSs (like in [211,212]) in the formulation.
Hierarchical control methods are widely used to control the frequency in the network and to keep the active power of generation units near to the optimal operating point when there exist disturbances in the network. Recently, a distributed RT-OPF control strategy for smart grids was proposed [213], using a feedback mechanism to achieve the same objective as hierarchical controls, without the need of load forecast. Based on a dual ascent method and real-time measurements, a distributed feedback control approach for the problem of optimal reactive power flow was proposed [214]. In this method, the reactive power capability of micro-generators is utilized to minimize losses, while satisfying voltage constraints in LV or HV networks.
A feedback controller for photovoltaic inverters was developed [215] to seek inverter set points corresponding to AC OPF solutions. This study was recently extended [216] by improving the convergence properties of the feedback controllers for the case of time-varying network and ambient conditions. The development of an RT-OPF on a hybrid AC/DC smart grid test bed was reported [206]. When the AC OPF fails to converge, a DC optimization method (i.e., using a linearized model) is used to facilitate the convergence. On the basis of a gradient projection approach and a linearized distribution system flow model, a local reactive power control framework was developed [217] to fast respond to voltage mismatch in the networks with high penetration of REG.
The real-time active-reactive OPF framework in reference [119] was further extended [218] to optimally deal with spontaneous changes of wind power in the distribution networks with BSSs. The multi-phase multi-time-scale dynamic active-reactive OPF framework in reference [218] provides the possibility of simultaneous optimization of a huge number of mixed-integer decision variables (e.g., decision variables of wind farms, BSSs, slack bus voltage, active-reactive import/export powers, etc.) in a prediction horizon. Compared to other studies [25,26,122,123], this work determines fully flexible optimal operation strategies for BSSs, i.e., length of charge and discharge periods and length of charge-discharge cycles, and the number of cycles in the prediction horizon are decision variables to be optimized while considering the expended life costs of the batteries [219] in the objective function.

Conclusions and Future Challenges
In this review, we have given an account of various real-time approaches which have been applied to power system operation and planning. The assessed methods were classified into two main categories: constraint satisfaction-based real-time energy management and OPF-based energy management. The applications of these methods to different aspects of the power systems were investigated, confirming that the developed methods are very promising for power systems decision makers. However, the most important limitation of the previous studies lies in the fact that only few studies considered the optimal operation of battery storage systems (BSSs) in the networks, which could be of high interest to network operators in next years. It is noted that the real-time OPF (RT-OPF) containing BSSs cannot be readily treated as dynamic mixed-integer nonlinear programming (MINLP) OPF under uncertainties that need to be solved online. Although the area of MINLP optimization has experienced a vast growth in recent years, finding optimal solutions for 'large-scale' MINLP OPF problems is still a big challenge. Thus, the approaches to solve MINLP optimization problems still need to be mathematically improved. Besides, the increasing number of plug-in electric vehicles (EVs) in distribution networks can also make the problem more interesting in the future, in particular if EVs inject active-reactive power to the network through bidirectional power electronic inverters. This source of uncertainty could add more mixed-integer variables and dynamic equations to the system. Furthermore, the lifetime of power devices (e.g., batteries, power electronic devices, etc.) in the RT-OPF is still an open issue to be addressed. Considering all the above aspects, network operators should also secure the networks against equipment failures by solving 'online' security-constrained OPF which could be computationally very heavy. The issue of computation time, however, is expected to be resolved by the next generation of software and hardware, taking into account the rapid improvement of computer technology.
Author Contributions: E.M. wrote the paper and all the authors together refined the manuscript.
Funding: This research was funded by the Carl-Zeiss-Stiftung and the APC was funded by the German Research Foundation and the Open Access Publication Fund of the Technische Universität Ilmenau.

Conflicts of Interest:
The authors declare no conflict of interest.