(DA-DOPF): A Day-Ahead Dynamic Optimal Power Flow With Renewable Energy Integration in Smart Grids

The performance of a power system can be measured and evaluated by its power flow analysis. Along with the penetration of renewable energies such as wind and solar, the power flow problem has become a complex optimization problem. In addition to this, constraint handling is another challenging task of this problem. The main critical problem of this dynamic power system having such variable energy sources is the intermittency of these VESs and complexity of constraint handling for a real-time optimal power flow (RT-OPF) problem. Therefore, optimal scheduling of generation sources with constraint satisfaction is the main goal of this study. Hence, a renewable energy forecasting–based, day-ahead dynamic optimal power flow (DA-DOPF) is presented in this paper with the forecasting of solar and wind patterns by using artificial neural networks. Moreover, contribution factors are calculated using triangular fuzzy membership function (T-FMF) in the sub-interval time slots. Furthermore, the superiority of feasible (SF) solution constraint handling approach is used to avoid the constraint violation of inequality constraints of optimal power flow. The IEEE 30-bus transmission network has been amended to integrate a solar photovoltaic and wind farm in different buses. In this approach, the computing program is based on MATPOWER which is a tool of MATLAB for load flow analysis which uses the Newton–Raphson technique because of its rapid convergence. Meteorological information has been gathered during the time frame January 1, 2015, to December 31, 2017, from Danyore Weather Station (DWS) at Hunza, Pakistan. A Levenberg–Marquardt calculation–based artificial neural network model is utilized to foresee the breeze speed and sunlight-based irradiance in light of its versatile nature. Finally, the results are discussed analytically to select the best generation schedule and control variable values.


INTRODUCTION
Optimal power flow (OPF) is an efficient and legitimately organized tool to control the settings of decision variables of the power system. The trade-off can be accomplished between the economy and the security of the power system by getting an ideal arrangement of these control factors. In this manner, OPF is a critical tool to give an ideal arrangement of control boundaries while fulfilling the imperatives (Surender Reddy et al., 2014;Surender Reddy et al., 2017). Generally, the OPF problem is formulated as a highly complex and non-linear optimization problem due to finding the feasible values in a large number of continuous and discrete control variables (Carpentier, 1962). Moreover, equality and inequality constraints can further enhance its computational complexity. OPF can also be integrated with other energy management systems (EMSs), to provide preventive and secure modes of operation. In the preventive mode, they can prevent frequency-mode problems which can be worse in terms of the blackout, while in the secure mode, they made corrective changes in the power flow pattern to provide feasible economic conditions. Researchers have been involved in the development of OPF to make it more reliable and to get optimal solutions with fast convergence (Momoh et al., 1997).
Since the OPF study provides the knowledge of feasible control variables under constraints on different variables, they are a major tool for the reliable operation of the power system. The significance of OPF issue is very much distinguished, and different old-style strategies, for example, gradient method (GM) (Dommel and Tinney, 1968a;Lee et al., 1985), Newton algorithm (NA) (Talukdar et al., 1983;Sun et al., 1984), linear programming (LP) (Fahd and Sheble, 1992), and quadratic programming (QP) (Reid and Hasdorff, 1973) have been applied to tackle the issues of being trapped in local minima, step size, and slow convergence. Recently, hybrid energy systems are getting more importance in which energy sources of two or more forms are combined. This combination minimizes the different attributes of the power system such as cost, loss, and emission and also increases the reliability and the life span of the power system (Chedid and Rahman, 1997;Chedid et al., 2000). Hence, hybrid renewable energy systems (HRESs) are becoming popular these days, even though the intermittency of VESs is a problem to integrate these sources. However, the combination of different renewable energy sources compensates each other to improve the stochastic nature of these sources (Banos et al., 2011;Ahn et al., 2012). There are two types of HRESs, standalone and grid-connected. Standalone systems have storage devices to fulfill load demands in a time of shortage of solar or wind energy. Though on account of the frameworkassociated system, storage devices can be taken out as the power deficiency can be repaid from the network power. These network-associated HRESs give power either to the heap or to the matrix, where in grid-connected systems, the power electronics converters are installed to address the issues of frequency, voltage stability, reactive power compensation, harmonics filtering, and load sharing. HRESs can be further classified into two categories: island HRESs and grid-connected HRESs. Island HRESs supply to the local loads, while grid-connected HRESs are those in which RESs are at distributed places.
The generation cost minimization is one of the common objectives of OPF by finding the optimal combination of generators, and this can be considered an economic dispatch problem. Due to pollution issues, this economic dispatch (ED) problem can be further solved as an economic environmental dispatch (EED) problem. Furthermore, depleting reserves of fossil fuel and global warming issues forced the energy-based research toward the utilization of clean and green energy sources. Nevertheless, uncertainties of these weather-driven renewable energy sources make it difficult to schedule dispatchable generation. With the increase in the penetration of clean and green electricity generation sources like wind and solar (PV), it is necessary to guide research toward the formulation of generation scheduling problem by paying attention to the intermittent and non-dispatchable characteristics of such sources. Since wind and solar are free and abundant in nature, penetration of these VESs minimizes the overall cost of electricity generation. Moreover, the voltage stability of the power system is always at stake due to the increasing electricity demand. Therefore, OPF algorithms are quite capable of handling the voltage stability issue by managing the power flow in transmission lines.
While paying attention to the scheduling of non-dispatchable sources of energy, it is desirable to incorporate artificial intelligence (AI) and machine learning (ML) algorithms with the traditional OPF program. Nowadays, AI and ML algorithms are performing tasks much like a human would do. In particular, artificial neural networks (ANNs) can predict process models for process control using the data collected by the sensors and transducers. Moreover, these algorithms are capable of learning patterns and producing results in alternate ways instead of doing hectic calculations. They are inspired by the biological neural system of the human brain and are capable of duplicating the learning, consolidation, adaptation, and generalization skills of the human brain (McCulloch and Walter, 1943). When it comes to non-linear problems, ANNs are the most powerful tools to solve them. ANNs consist of neurons, which are the highly interconnected processing units. Information is passed between these neurons. Each neuron decides based on two input values: one is an input and the other is the weight. The ANNs are not developed to perform a specific task; in fact, they are designed to learn patterns by gathering, storing, and generalizing information. ANNs consist of many layers, and to reach the target, different stochastic algorithms renew the weights of ANNs. The backpropagation network (BPN) is the most common algorithm to update weights in the ANN (İnal and Aras, 2005). In the past decade, the use of ANNs has been increasing substantially, and this is due to their versatility, robustness, availability of data, and increased computational power. Their ability to learn from sequence patterns enables ANNs to work with noise data, fuzzy information, and non-linear and ill-defined problems. Their fault tolerance capability further expands the implementation of ANNs. Recently, ANNs have become an ideal tool to apply in the fields of medicine, economics, meteorology, psychology, neurology, and many others. Medical imaging, identification of military targets, market forecasting, weather forecasting, flood forecasting, and electrical and thermal load forecasting are some common examples of ANN applications.
It is suggested that the integration of VESs enhances the overall efficiency of the existing grid. However, it is an obvious fact that these sources are weather dependent like a photovoltaic (PV) cell depending on solar irradiance or sunlight intensity to produce electrical energy. Similarly, wind turbines produce electrical energy by using the natural pressure of the wind. Moreover, this natural dependence forces the utility to install these generation sources at distributed places, which are favorable for these sources in regard to electricity generation. Although these VESs bring stability and reliability to the power system and are the cause of a green and clean environment, yet many concerns are associated with the integration of these VESs into the existing grid. The intermittent nature of these VESs makes it difficult to guess the available power from these sources. However, the utility needs to know the available power to estimate the reserve capacity of the generation system. Additionally, on the facade of force framework activity and control, the circulated idea of these sources and a variety of inaccessible forces makes it hard to set the estimations of control factors of the force framework. Subsequently, the force framework administrator needs notable anticipated estimations of these control factors to keep up the overall influence stream in the framework. Along these lines, there is space to build up a strategy to give the most plausible estimations of control factors of the force framework to the framework administrator. In such a manner, the proposed strategy will utilize an ANN model to anticipate the breeze and sunlight-based irradiance for wind and sun-oriented age plants. Afterward, it will foresee the practical warm age plants to limit the age cost regarding punishment cost, save cost, and all-out cost. In doing so, we need to make sure that the variables of the power system will remain within their boundary limits. Therefore, the power system will remain at its state of equilibrium.
From the above discussion, it is revealed that there is enough room to propose the optimal scheduling strategy, which can handle the intermittency of VESs. This study is presented to solve the power flow problem in a dynamic power system. The major components of this dynamic power system are conventional thermal generators, wind farms, and solar PV plants. The key problem of this study is to schedule these power generation sources at optimal values. Moreover, along with different constraints of the power system, the problem becomes more complicated. Furthermore, VESs like wind and solar generators cannot be scheduled in the same manner as conventional thermal generators, due to the inherent property of weather dependency, e.g., wind velocity and solar irradiation. The uncertainty and intermittency of these VESs make this challenge more difficult. In addition to this, load on a power system is variable, and the availability of VESs is irrelevant to this variable load. A system operator cannot know the actual real-time (RT) conditions for a specified day-ahead (DA) schedule. To solve this day-ahead dynamic optimal power flow (DA-DOPF) problem, an RT-OPF problem is integrated with the ANN model to predict the wind speed and solar irradiance. Therefore, the novelty of the proposed DA-DOPF approach is a two-stage optimization approach consisting of an LM algorithm-based ANN model and particle swarm optimization-based economic load dispatch along with OPF problem constraints with an effective constraint handling technique. The former precisely generates the available power of VESs with respect to the wind speed and solar irradiance, and the latter provides the best-fit generation schedule of the generation sources along with the satisfaction of power system constraints. Our proposed study characterizes the structure of the predicted output of the ANN model and RT-OPF. And to the best of authors' knowledge, it is not presented in the previous existing literature. Furthermore, the main contribution of the present study is listed in the next section.

Contribution of the Paper
The real contributions of this work are given as follows: • The improvement in RT-OPF is evaluated by incorporating ANN-based predictive modeling in the OPF program. Here, the ANN uses real and noticed climatic information which incorporates both meteorological changes and barometric impacts, such as temperature and overcast cover. • Improvement in loss minimization is achieved by using the Levenberg-Marquardt (LM) algorithm for the adopted three-layer shallow ANN (Section VI). • An efficient constraint handling technique is adopted to guide the search process toward a global optimal solution and thoroughly discussed in Section IV-E. • Real-time scheduling of generation sources is achieved in a single run of the program by incorporating T-FMF, to compute the CFs at the start of DA-DOPF. • A systematic approach is used to combine all the abovementioned techniques with a particle swarm optimization (PSO) economic dispatched algorithm for the IEEE 30-bus system, and critical analysis of simulation results has been done to identify the effectiveness of the proposed approach.
Simulations results depict that the proposed approach efficiently handles the complexities of the OPF problem. Moreover, the present study shows the efficient integration of RESs and maximum power utilization from these sources can be made possible by using NNs.
The remainder of this paper is organized as follows: Section II presents literature review. Section III provides details of inspiration. Section IV presents the numerical demonstration and issue definition. Section V gives the force models of VESs. The breeze and sun-oriented determining models are discussed in Section VI. The proposed DA-DOPF approach is introduced in Section VII. The results and conversations are examined in detail in Section VIII. Conclusions are outlined in Section IX. and dependable activity of the power system. The power system administrator needs to limit the general age cost, limit system misfortune, and keep up as far as possible by controlling the responsive power stream in the current transmission system. Subsequently, OPF is a fundamental instrument for power system administrators in the activity and control of power systems. Notwithstanding, because of the non-linear and non-convex nature alongside different limitations, numerous calculations and improvement methods are created to tackle the OPF issue. These methods are comprehensively grouped into two classifications: 1) traditional advancement procedures and 2) transformative enhancement strategies. A wide assortment of traditional improvement strategies have been utilized to tackle OPF such as non-straight programming (Dommel and Tinney, 1968b;Alsac and Stott., 1974;Happ, 1977;Mamandur and Chenoweth, 1981;Shoults and Sun, 1982;Habibollahzadeh et al., 1989), direct programming (Stadlin and Fletcher, 1982;Mota-Palomino and Quintana, 1986;Abou El-Ela and Abido, 1992), quadratic programming (Reid and Lawrence, 1973;Burchett et al., 1984;Aoki et al., 1987), Newton-based procedures (Sun et al., 1984;Santos and Da Costa, 1995), successive unconstrained minimization strategy (Rahli and Pirotte, 1999), and inside-point techniques (Momoh and Zhu, 1999). All these techniques for streamlining have some normal disadvantages such as issues of non-assembly, non-direct target capacities and requirements, introductory supposition, and step size. A nitty gritty overview identified with these issues is introduced by Momoh et al. (1999a) and Momoh et al. (1999b). For the most part, these old-style methods use inclination-based advancement calculations to linearize the goal work. The OPF issue is profoundly non-direct and has numerous neighborhood minima, for example, multi-modal, so these procedures do not perform well to track down the doable arrangement. Moreover, the OPF issue is nondifferentiable, non-smooth, and non-curved, while these procedures depend on inclination strategies. In this manner, it is fundamental to grow such methods that can beat these challenges. As of late, on the facade of transformative calculations, new improvement procedures have been created. These high-level enhancement procedures are computationally effective, quick, and solid. These techniques do not suffer from convergence issues and local optimality. Some common examples of these techniques are genetic algorithm (GA) (Lai et al., 1997), Osman et al.'s algorithm (Osman et al., 2004), simulated annealing (SA) by Miranda et al. (1998), tabu search (TS), and PSO (Abido, 2002a;Abido, 2002b), respectively. With due respect to these advanced techniques, unfortunately, it has been found that they have a problem of pre-mature convergence and parameter selection. It is difficult to fine-tune the parameters of these algorithms and to handle constraints. These difficulties lead to the infeasible solution, computational time complexities. Therefore, there is always a trade-off between the complexity and the solution.
In AlRashidi and El-Hawary (2009) and Frank et al. (2012), the detailed comparison to solve the OPF problem is discussed. Improved GA has been used to find the feasible values of control variables of the load flow problem by Lai et al. (1997). In Abido et al. (2002b), the PSO algorithm is used while solving an OPF problem. Variants of PSO are presented by Kennedy and Russell (1995), Kennedy (2000), Saber et al. (2007), Dutta and Singh (2008), and Gnanadass and Venkataramana (2008). Niknam et al. (2012a) examined an improved PSO to streamline the various goals of OPF at the same time while considering generator fuel cost, genuine power misfortune, fossil fuel byproduct, and solidness file of voltage as numerous targets for enhancement. In the work of Niknam et al. (2012b), the shuffle frog leaping algorithm (SFLA) and SA have acquainted with managing the non-bended nature of old enough expense target work. The ideal estimations of control factors have been accomplished utilizing a versatile genuine coded biogeography-based improvement calculation; subsequently, precision and heartiness are observers in the aftereffects of OPF (Ramesh Kumar and Premalatha, 2015). The ideal power stream issue is introduced as a multi-target enhancement issue and has been settled utilizing a concordance search calculation with an all-encompassing quick non-ruled arranging and positioning method, so the best tradeoff arrangement is extricated in various cases (Sivasubramani and Swarup, 2011). Recently, the conventional stochastic methods were also used for weather prediction.  and  presented another forecasting model based on meteorological radiations and cloud cover radiations for solar radiations. All these mathematical stochastic models and probability density functions use radiation theories and meteorological data collected by sensors to predict the solar radiations (Tobiska, 2000;Reddy and Ranjan., 2003). Additionally, for wind speed anticipating, analysts have built up certain models, because of recursive least-squares relapse or auto-regressive coordinated moving normal techniques, much precisely figure on account of noticed time-arrangement information and their connections Landberg et al., 2003).
Similarly, after the development of the probabilistic optimal power flow (POPF), the direction of research is shifted toward the development of model and calculation methods. In Huynh et al. (2018), the probabilistic power flow methodology for large-scale power systems incorporating renewable energy sources is presented. Dynamic radial basis functions of neural networks are used to generalize three-phase robust load flow for radial and meshed power systems with and without uncertainty in energy resources (Baghaee et al., 2018). The Markov chain quasi-Monte-Carlo sampling method is utilized to perform POPF with correlated wind power uncertainty in Sun et al. (2019). In Wang and Guo (2018), a real-time power balancing critical time scale is achieved with intermittent power sources. The bidding methodology in a joint hydro-electric and wind park is proposed by Kneevi et al. (2019). Baghaee et al. (2017) introduced the fuzzy unscented transform for uncertainty quantification of correlated wind/PV microgrids. An efficient approach for practical approximations and heuristic approaches for managing shiftable loads in the multi-period optimal power flow are discussed by Avramidis et al. (Iason-Iraklis et al., 2021).
As of late, ANNs are the focal point of consideration for sun and wind-oriented gauging because of their characteristic ability to deal with the non-linearities of forecast goals (Kalogirou,   . Furthermore, integration of fuzzy rules and wavelet transformation with NNs gives new directions to the research by Barbounis et al. (2006), Cao and Cao (2006), and Chaabene and Ben Ammar (2008). Moreover, to reduce the prediction error and to enhance the convergence rate, different algorithms are presented by the researchers in recent literature. Mishra et al. (2015) published a scaled conjugate algorithm to train an MLPbased ANN for least squares (LS) and minimum mean square error (MMSE). Stefenon et al. (2020) presented the well-known BFGS quasi-Newton optimization method to achieve better performance of the ANN. Plumb et al. (2005) discussed the predictive ability of artificial neural network (ANN) models along with four classes of training algorithms. It has been found in the previous literature that constraint handling techniques are not considered in a day-ahead OPF problem along with the prediction of available real power from VESs. Moreover, the complexity of real-time OPF is pretty much high due to the multiple runs of the program. The idea presented in this work is different from that of the earlier proposed work, and its focus is on the prediction of solar irradiance and wind speed by the ANN, and then it is used to calculate the available power from these VESs. In addition to this, the LM algorithm is used to minimize the prediction error and to increase the convergence rate of the ANN. Along with this, T-FMF is used to calculate the CFs for VESs in each subinterval. The SF solution constraint handling approach is used to handle constraint violation. Moreover, 24-h variable load is assumed to be known, and each 1-h interval is subdivided into six sub-intervals each of 10 min to find the values of control variables to convert the conventional OPF into the DA-DOPF. In the end, the optimal schedule of generation sources and feasible values of control variables are presented in Section VIII for each subinterval, which shows the effectiveness of the study.

PROBLEM OVERVIEW AND MOTIVATION
This work considers and solves the OPF problem of the power system having multiple VESs. The main components of this system comprise the conventional thermal generators, wind farms, and solar PV plants on different buses. The scheduling of generation sources in such a system is a challenging task due to the integration of VESs because VESs are weather dependent and a little change in climate conditions may affect the available output power of these sources. Moreover, the load is variable, and the power system operator is responsible to fulfill this load demand by scheduling the generation sources at the optimal generation point. In a hybrid system, an optimal scheduling approach is presented by Yang et al. (2013) to manage a wind, solar, and storage system. Gayme and Topcu (2012) figured an OPF issue to track down the ideal estimations of factors of a power system having a capacity limit. Levron et al. (2013) introduced a strategy to deal with the capacity gadgets of the microgrid. The customary OPF is a static improvement issue in a power system having no wellspring of shifting yield power like solar and wind. In conventional OPF, the lone goal is to satisfy the heap need by running the OPF program at various stretches. To take care of the OPF issue with the wind age, the creators utilized the stochastic model to anticipate the wind speed by Jabr et al. (Jabr and Pal, 2009). Here, the OPF issue is defined to limit the fossil fuel byproduct, power misfortune, and age cost with and without valve point impact in Dubey et al. (2015). The issue with infiltration of wind age and DC OPF is tackled by Zhang and Giannakis (2013). Nowadays, the integration of renewable energy is rapidly expanding and trending in many power systems of the world. VESs are principally nature-friendly and contaminationfree, and they can serve longer as compared to conventional generation sources. However, VESs are weather dependent, and therefore, available real power is always variable. For example, cloud cover on a clear day suddenly decreases an available output power from the PV plant. Similarly, variation in wind speed affects the available output power of wind turbines. Therefore, power output from these sources varies from minute to minute scale. Hence, the power system operator needs an efficient power flow program that is capable of running again and again to maintain power flow in the system by scheduling generation sources, managing tap changing, and connecting and disconnecting VAR compensation devices. Although the methods reported earlier are quite capable of solving the OPF problem, there is an opportunity available to develop a new technique to solve OPF dynamically. Hence, the motivation behind this study is listed as follows: • ANNs are incorporated to schedule the generation sources more accurately. • An efficient constraint handling approach is considered to find the most feasible solution. • To reduce the complexity of the OPF program, contribution factors (CFs) are calculated prior to running the load flow for each sub-interval.
Therefore, in this study, the ANN is used to predict the meteorological values for the power models of solar and wind power generators, and CFs are calculated using T-FMF, before going into the load flow loop of the program. Furthermore, to guide the search process of optimization toward a feasible solution, the SF constraint handling technique is used in the single run of the DA-DOPF program. And to the best of the authors' knowledge, such a mechanism has not been developed before to solve the real-time OPF.

DA-DOPF PROBLEM FORMULATION
The DA-DOPF problem is formulated as an optimization problem with the objective of minimizing generation cost of conventional thermal generators along with the cost equations of VESs. A general optimization problem subjected to constraints can be expressed as follows: minimize: where a {a 1 , a 2 , . . . , a n } T represents a vector of independent decision variables and b {b 1 , b 2 , . . . , b n } T represents the dependent decision variable vector. The inequality constraints are g j (a, b) where j {1, 2, . . ., M, }, and the equality constraints are h k (a, b), where k {1, 2, . . ., N}. Total numbers of inequality and equality constraints are M and N, respectively. Table 1 shows the state and control variables. Def. 1. Control (independent) variables: The following equation represents a set of control variables: where GN represents the number of generators, CN is the number of VAR compensation devices, and NT represents the number of transformers. Def. 2. State (dependent) variables: The following equation represents a set of state or dependent variables: where LN is the number of load buses and TL is the number of transmission lines. Nevertheless, definite interpretation of Eqs. 1-5 can be taken from Ilyas et al. (2020a).

Objective Functions
To assess the effectiveness of the proposed technique, three minimization objective functions have been formulated for the DA-DOPF problem. The IEEE 30-bus modified system model is considered in this study. The summary of the system model is given in Table 2. The slack bus is responsible to balance the active power flow in the system, and it is known as the swing bus. The voltage magnitude (V) and angle (δ) are taken as 1 p.u. and zero, respectively, for a swing bus. The formulation of optimization objectives is presented subsequently.

Minimization of Cost Without Valve Point Effect
Generally, the cost function is quadratic and the cost curve is plotted in between real power (MW) and fuel cost ($/hr). Similarly, the objective function for cost minimization without valve point is presented as where OF cost represents the cost in $/hr. a i , b i , and c i are cost coefficients of thermal generators, listed in Table 3.

Minimization of Cost With Valve Point Effect
The cost function as a function of valve point effect can be expressed as

OF costvp
Ng i 0 (a i + b i P gi + c i P 2 gi |d i × sin(e i × (P min gi − P gi ))|) $/h, where a i , b i , c i , d i , and e i are again the cost coefficients with valve point effect and P min gi is the minimum power limit on the ith generator.

Minimization of Cost for Multi-Fuel Thermal Generators
In a power system, each generation station has different fossil fuels to produce electricity, e.g., coal, gas, and oil. The generation station with multi-fuel has a piece-wise quadratic relationship between power and cost, and the number of pieces depends on the type of fuel used. The cost of the ith generator considering multifuel is expressed as where k is the type of fuel such as diesel, natural gas, or heavy furnace oil. In this work, there are two generators considered multi-fuel and remaining one has a single-fuel function as explained earlier. Cost coefficients for single-fuel generators are given in Table 3 and those for multi-fuel generators are given in Table 4, whereas the precise meaning of Eqs. 6-8 is given in Ilyas et al. (2020a)

VES Cost Model
In a power system, VESs are generally owned by private bodies. They sell power to the utility under a predefined contract. Therefore, the control and operation of VESs are in the hands of private bodies. In contrast to the conventional generation sources, VESs do not require any fuel to produce electrical energy as they utilize wind speed or sunlight to produce electrical energy which is freely available in nature. However, these private bodies charge some operation and maintenance cost to run their plants (Wijesinghe and Lai, 2011). The cost of electricity generation from these VESs mainly comprises direct cost, reserve cost, and penalty cost. The direct cost for wind and the solar plant can be calculated as in Biswas et al. (2017) and given as where P w and P PV represent the scheduled output power from the wind farm and solar photovoltaic, respectively, and g w and h pv represent direct cost coefficients of VESs. As the VESs are weather dependent and due to the variable patterns of wind speed and solar irradiance, there is always uncertainty associated with the production of electricity generation from VESs. This intermittency of VESs makes it difficult to schedule generation sources. Hence, the burden on the power system operator (SO) increases in terms of optimal scheduling of its generation sources. Moreover, this variability increases the operational cost of electricity production as it becomes compulsory for the system operator to have reserve generation capacity to balance the natural fluctuations of VESs. This also introduces some computational difficulty to calculate the aggregated cost of electricity generation in OPF. Therefore, reserve and penalty cost models are introduced and integrated with the cost function in mathematical modeling as presented by Reddy et al. (2014). Def. 3. Cost in case of overestimation: If the available power from a VES is less than the contractually agreed scheduled power, then the reserve cost model for wind power can be stated as where P Wsh , i and P Wav , i represent scheduled and available power capacities from a wind power source, respectively, and k rw , i represents the reserve cost coefficient for wind. Def. 4. Cost in case of underestimation: In contrast to the above stated case, if the available power exceeds the scheduled power, then the system operator (SO) will pay a penalty as per the following cost model: where k Pw , i denotes the penalty cost coefficient for the ith windmill. Similarly, the reserve and the penalty cost of solar can be calculated.
Cost coefficients used in this study are given in Table 5. The reserve and penalty cost for wind and the solar plant can be calculated as in Biswas et al. (2017) and given in Eqs. 11-14. Finally, the cumulative objective function to minimize the cost is given as where f cost i is the cost of the ith thermal generator which may be single fuel and multi-fuel. The second term represents the direct cost of wind and solar. The third term represents the reserve cost of wind and solar, and the fourth term represents the penalty cost of wind and solar.

Equality Constraints
• The nodal active power balance at the ith bus is given as follows: • The nodal reactive power balance at the ith bus is given as where elements of the admittance matrix are calculated as Equality constraints shown in Eqs. 16-18 are thoroughly discussed by Chen et al. (2018). The convergence process of load flow will not violate the equality constraint limits eventually.

Inequality Constraints
• Real power limits of generation sources including maximum penetration of wind and solar can be written as   (Biswas et al., 2017).

Direct cost coefficient
Wind g w 1.6 Solar g s 1.6

Reserve cost coefficient
Wind k rw 3 Solar k rs 3
• Reactive power limits of generation sources can be written as • Voltage limits of generator buses are given as where NG is the total number of thermal generators, wind and solar plant.
• The line thermal limit of all branches is given as where TL ij gives the thermal limit of the power flow line from node i to j.
• For the secure operation of the power system, it is compulsory to maintain the load bus voltages within the allowable range. Load bus voltage limits are given as The specific meaning of each variable in Eqs. 19−23 is well explained by Chen et al. (2018). Feasible values of control or independent variables among the inequality constraints are selected by the optimization algorithm within their allowable boundaries. An effective constraint handling technique to pick the feasible values of state or dependent variables is discussed in Section IV-E.

Constraint Handling Approach
While using an evolutionary algorithm (EA) to solve an optimization problem, it is important to use a proper constraint handling approach (CHA). An EA equipped with a proper CHA can guide the search process toward a globally feasible solution. CHAs are able to use the information hidden in infeasible solutions, and hence, they do not discard any infeasible solution immediately by Tessema et al. (2006). Deb (2000a) proposed an efficient method to handle the constraint diversification. Equality constraints are converted to inequality constraints by introducing the tolerance factor δ in equality constraints. The ultimate constraint violation for an infeasible solution is calculated as in Biswas et al. (2018) and Deb (2000b) and given in Eqs. 24, 25: where w h is the weighting parameter for constraint violation, and where G i , max is the maximum value of constraint violation from the G i (X) set. Consequently, equality constraints in three are converted into inequality constraints. A brief description of CHA is presented in the next section.

SF
In the SF approach, two fitness values of the objective function (X i , X j ) are always compared to each other, and a decisive logic is used to discard the less feasible value. The algorithmic logic to pick a superior solution is explained in Algorithm 1.
The SF approach always picks a feasible solution when other belongs to the infeasible search space. On the contrary, a solution having a smaller fitness value has been picked when both belong to a feasible region F. Similarly, a solution with the lowest overall constraint violation K(X) in Eq. 24 has been picked when both do not belong to the feasible space F. That is how this approach pushes infeasible solutions toward feasible space and converges the search process to an optimal solution.

Wind Generator Model
In this work, a wind farm that has 25 wind turbines is associated with transport 13, as demonstrated in Figure 1. Every turbine has 3 MW appraised power. In any case, the accessible power got from a wind farm differs from the wind speed. Along these lines, to compute the accessible genuine power, the model introduced by Biswas et al. (2017) is utilized. The yield power of a wind turbine relies upon wind speed and can be numerically communicated through Eq. 26 taken from Biswas et al. (2017): where p wr is the rated power of the wind turbine and v, v r , v in , v out are the actual and rated speed and cut-in and cut-out speed, respectively. The rated values are considered as v r 16 m/s, v in 3 m/s, and v out 25 m/s.

Power Model
For the solar power, the energy conservation model given by Biswas et al. (2017) is expressed through the following equation: where G, G std , R c , and P sr are forecasted solar radiation, solar radiations at STP, actual solar irradiation, and rated output power, respectively. In simulations, G std 800 W/ m 2 , R c 120 W/m 2 are considered.

WIND AND SOLAR FORECASTING MODEL
As the VESs are intermittent, the variability of the available power from these sources poses a challenge to meet the variable load demand of the power system. Therefore, it is important to predict the wind speed and solar irradiance before scheduling the generation sources. For this purpose, the ANN is used to predict wind speed and solar irradiance. The details are given below.

Fundamentals of ANN
In energy engineering systems, the ANN is being used extensively for modeling and prediction purposes. The requirement to set up an ANN is the historical datasets. In the case of weather forecasting, historical data can be collected by using sensors, which can continuously monitor and record different attributes of weather. The meteorological data used in this paper are collected during the period from January 1, 2015, to December 31, 2017, from Danyore Weather Station (DWS) at Hunza, Pakistan, and Lahore Weather Station (LWS) at Lahore, Pakistan. Different algorithms are used to predict wind speed and solar irradiance by using the ANN. The basic ANN equation to map the output Y via a non-linear input feature vector X given in Eq. 28 is taken from Quej et al. (2017). The architecture diagram of the presented ANN is given in Figure 2. However, for the backpropagation error minimization, the LM algorithm is finally adopted because it is efficient in handling errors in shallow networks. The details of this algorithm are given below.

LM Algorithm
This algorithm uses two numerical minimization methods: gradient descent and Gauss-Newton. The former algorithm is based on backpropagation (BP) training of the NN. It has been widely used in weather forecasting because of its ability to model non-linear separable problems by Qazi et al. (2015). In the latter method, the sum of squared errors is minimized by assuming that the least-squares function is locally quadratic in the parameters and finding the minimum of this quadratic. When the parameters are found far away from the feasible value, the LM method adopts the gradient-descent method. On the contrary, the Gauss-Newton method is opted when the parameters are found near the feasible value. The LM algorithm modifies the parameter updates, and the update function U(k) can be computed using Eq. 29 given in Qazi et al. (2015): where first-order derivatives of the network errors for the weights and biases are included in a Jacobian matrix J, ε is the network error vector, β is a non-negative scalar number called the damping factor, and I is a diagonal identity matrix. The performance parameters used for the LM algorithm are given in Table 6. The values of these parameters are selected as default settings by the NN tool of Matlab program.

Overview of the Proposed Approach
Recently, numerical optimization techniques are used in the development of EA, which are population-based and a potential candidate to solve optimization problems, and can efficiently avoid the problems of classical methods, e.g., lack of convergence or step size issues. PSO has been used in many power flow studies to solve OPF because of its efficient population-based heuristic nature and flexible and well-balanced approach of global and local exploration (Abido, 2002c). Moreover, scheduling and planning of power systems having VESs is a difficult task due to the unpredictable available power of VESs. It is worth mentioning here that many researchers have used ANNs for weather forecasting to estimate the generated power of VESs in the smart grid (Moghaddam and Seifi, 2011). This study is carried out to solve a DA-DOPF problem for a power system having renewable energy sources. The main objective of this study is to schedule the generation sources at optimal values so that the cost of electricity generation remains at its minimum value, with the satisfaction of OPF constraints as explained earlier in Section IV. The said objective is achieved by using the PSO/ELD algorithm in conjunction with the ANN which is used to forecast the solar radiation and wind speed pattern on an hourly basis to calculate the available power of VESs. Moreover, the developed technique is equipped with an effective constraint handling approach to handle the violation of inequality constraints. Therefore, to handle the diversification of these inequality constraints, the SF constraint handling technique is used. Hence, the proposed approach differs from other available approaches found in the literature regarding violation of equality constraints on dependent variables (Surender Reddy and Bijwe, 2016;Grover-Silva et al., 2018). Moreover, the 1-h interval is divided into fifteen sub-intervals to achieve the dynamic generation schedule. It is worth mentioning here that the idea of using T-FMF to calculate CFs is never used before which provides the sub-interval variation of VESs and makes it easy to analyze the setting of control variables.

PSO
Numerical optimization has the ability to overcome convergence or step size problems in classical optimization techniques. PSO has been used in many power flow studies to solve OPF because of its efficient population-based heuristic nature and flexible and well-balanced approach of global and local exploration by Abido Frontiers in Energy Research | www.frontiersin.org August 2021 | Volume 9 | Article 696837 (2002c). Moreover, scheduling and planning of power systems having VESs is a difficult task due to the unpredictable available power of VESs. It is worth mentioning here that many researchers have used ANNs for the purpose of weather forecasting to estimate the generated power of VESs in the smart grid (Moghaddam and Seifi, 2011). This study is carried out to solve a DA-DOPF problem for a power system having renewable energy sources. The main objective of this study is to schedule the generation sources at optimal values so that the cost of electricity generation remains at its minimum value, with the satisfaction of OPF constraints as explained earlier in Section IV. The said objective is achieved by using the PSO-economic load dispatch (ELD) algorithm in conjunction with the ANN which is used to forecast the solar radiation and wind speed pattern on an hourly basis to calculate the available power of VESs. Moreover, the developed technique is equipped with an effective constraint handling approach to handle the violation of inequality constraints. Therefore, to handle the diversification of these inequality constraints, the SF constraint handling technique is used. Hence, the proposed approach differs from other available approaches found in the literature regarding violation of equality constraints on dependent variables (PSO is a nature-inspired optimization algorithm that starts with the random initialization of solutions). This swarm of solutions moves with a randomized velocity within the search space. Each solution of this swarm is known as a particle. Every particle remembers its last position in the search space to achieve the best position. The objective function fitness value at this position is saved as "pbest." To achieve the most optimal fitness value, the position of a global version of the swarm is saved as "gbest" which is the overall minimum value of objective function achieved at the present iteration of the algorithm loop. Before the next search iteration, the velocity of every particle is updated so that the swarm moves toward the global best value. Basic elements and mathematics of this algorithm are briefly stated and defined as follows: Particle, X(t): It represents a solution of the m-dimensional vector, where the number of optimized parameters is given by m. Each search point is known as a particle. The value of the objective function for X(t) can be a possible solution. The position of X(t) can be influenced by different optimized parameters.
Population, pop(t): It is a set of n particles which is known as the population of size n. At each iteration t, the population vector can be written as pop(t) [X 1 (t), . . . , X n (t)] T .
Particle velocity, V(t): The particles are directed to be moving with velocity V j (t) within the search space. This movement is responsible to find the optimal value of the objective function. At every generation, each particle can be assigned an updated velocity to move within the search space given in the  following equation as explained by Surender Reddy and Bijwe (2016) and Grover-Silva et al. (2018): where V t i is the initial velocity; pb t i − X t i is the self-influence; gb t − X t i is the global influence; c 1 is called the cognitive parameter and c 2 is called the social parameter, which both are called acceleration coefficients; and U t 1 and U t 2 are two random numbers that vary between 0 and 1 and the position is updated according to the following expression: Inertia weight, w(t): To influence the moving capabilities of a particle inertia weight, w(t) is used. Global exploration capabilities of the algorithm can be enhanced at the start by assigning a large inertia weight. In contrast, at the end of the search process, they can be reduced to improve the local search ability of a particle. The inertial weight reduction can be achieved by using an annealing decrement function as follows: where α is a decrement constant and its value is less than 1. While solving for minimization problems, the personal best pb i at iteration t + 1 is calculated as where f: F n → F is the fitness function. The global best position gb in each algorithm loop t is calculated as where i ∈ pop(t). Here, it is important to note that, at every iteration, each particle knows its personal best "pb" and remembers this value till the next iteration. While at the time "t," the overall minimum value of swarm is known as the global best position "gb." In the next loop, updated velocities and positions are assigned to each particle of the swarm. Now to calculate the fitness of objective function, these particle positions are used. In this algorithmic flow, the minimum fitness value achieved by the entire swarm is called new gbest, and the minimum fitness value is achieved by the particle itself and is called new pbest. This process repeats until the user-defined stopping criteria (limitation of maximum iteration) are satisfied. The control parameters used for the PSO algorithm are given in Table 7. The values of these parameters are selected by a training algorithm with different patterns of parameters and fine-tuning.

T-FMF
The contributing factors (CFs) for VESs are calculated by using T-FMF which is derived from the fuzzy decision-making approach. Hence, variation in the real power of VESs during the sub-interval is realized by the use of T-FMF; in this way, CFs are calculated at the start of the algorithm loop, which helps to inspect the variation in real power loss and overall cost of the network. Moreover, the proposed technique is capable of calculating the most economical generation schedule by assigning CFs to VESs. Therefore, generation cost is kept at its minimum value along with the reduction in line loss of the system. The FMF values μ for RES contributions are computed and defined as in Ilyas et al. (2020a) by the following equation: for cf j ≤ y 1 (cf j − y 1 )/(y 2 − y 1 ) for y 1 < cf j < y 2 1 for cf j ≥ y 2 .
Here, cf j shows the value of CF. In this work, y 1 and y 2 are considered as 0 and 1.25, respectively, as given by Kaur and Jain (2017), while the aggregated real power from VESs is expressed through the following equation:

Computational Flow
As has been discussed in the earlier sections, the intermittency of VESs in electricity generation introduces a challenge to develop an efficient DA-OPF program. All the available approaches in the literature can handle this challenge effectively. Therefore, this paper proposed a technically and computationally efficient approach to solve the DA-OPF problem. The computational flow starts from the prediction of solar intensity and wind speed pattern which is used in the calculation of available power from VESs. Then, CFs are calculated using T-FMF to consider the dynamic behavior of VESs. The variable load pattern is assumed to be available at the start of the DA-DOPF loop. Therefore, the remaining load is being calculated which is beyond the available generation capacity of VESs. Furthermore, thermal generators are scheduled at the optimal values to cater to the remaining load. In addition, the SF constraint handling approach is used to avoid the constraint violation referring to the limits of the dependent variables. In the end, a confident and global feasible solution is achieved from the search space. The computational flow of the proposed approach is further elaborated in Algorithm 2. Moreover, continuity of the steps is represented pictorially in Figure 3.

System Model
In this work, for understanding and analyzing solar and wind, the standard IEEE 30-bus system of 41 branches is used and VESs are integrated at different buses. A 75 MW wind farm is inserted at bus 11 having 25 wind turbines each of 3 MW. Similarly, a solar PV plant of capacity 60 MW is integrated at 13. Moreover, bus 1 is taken as a slack bus, and at buses 2, 5, and 8, conventional thermal generators are placed. The maximum connected load at once is assumed to be 283.4 MW. Furthermore, a variable load is assumed to be available at every hour. The amended system model is shown in Figure 1. The summary of the IEEE 30-bus system model is given in Table 2. Nevertheless, the proposed approach is generic such that it can be easily implemented on any system model with more buses.

Climatic Data Representation in 1D and 2D
Meteorological data are smartly classified in 2D arrays as given in Eqs. 37, 38. In data matrices, the row shows the number of days in a month and column shows the number of hours in a day. Here, each element represents the measured value of solar irradiance and wind speed. To show the periodic nature of solar irradiance, meteorological data are plotted in a 2D plot in Figure 4. Similarly, the stochastic nature can be analyzed by a 2D plot of wind data in Figure 5. The variable nature of solar irradiance and wind speed in a single day is shown in a 1D plot in Figure 6.

Forecasting Performance Evaluation
The accuracy of the ANN models is analyzed based on the maximum prediction error (MPE) and root mean square error (RMSE). However, various training algorithms are tested. During the trial process, the algorithms are compared based on RMSE and resemblance of predicted values to target values. Comparison of different algorithms suggests that the LM algorithm performs better than others on the input data; therefore, it is adopted for  Frontiers in Energy Research | www.frontiersin.org August 2021 | Volume 9 | Article 696837 14 the training phase of the network. Besides, it is tracked down that the eight neurons in the hidden layer related to the LM preparing calculation give the best presentation and the least forecast error. In Figure 7, the performance curve of solar irradiance is plotted against epochs, and it has been found that desired results are obtained at the 171st epoch. Similarly, for wind in Figure 8, it can be noticed that the best results are achieved after 1,000 epochs because of a large number of parameters and sparseness in the data. Furthermore, regression plots of solar and wind generation are shown in Figures 9, 10, respectively. It is obvious from these plots that the NN is well trained and data are well fit during all phases of the algorithm. Furthermore, to highlight the superiority of the LM algorithm to some other algorithms, the RMSE is presented in Table 8. It can be noticed that the least error has been achieved by the proposed algorithm.

Performance Evaluation of Proposed DA-DOPF
The DA-DOPF optimized Eq. 15 represents that the scheduling period considered in this study is 1 h which is further divided into six sub-intervals of 10 min. Therefore, by keeping in mind the intermittent nature of VESs, it is considered in this work that the  proposed DA-DOPF is performed every 10 min for the dynamic dispatch of generation sources. Moreover, optimizing energy for each hour and optimal generation cost are calculated for (24 × 10) sub-intervals based on CFs of VESs. The contribution of thermal generators and VESs in these sub-intervals is shown in the bar chart plotted in Figure 11. Table 9 shows the optimal contribution of generation sources (GSs) along with voltages and reactive power settings. Furthermore, the optimized cost for sub-intervals is also presented in Table 9 which is calculated using the PSO-based optimization ELD program. As per predicted values of solar irradiance and wind speed, available VES power is calculated. Penalty and reserve costs for wind and solar are computed using Eqs. 11, 13, respectively. In addition, to consider the variable nature of the connected load, the varying load pattern for 24 h is shown in Figure 12. Therefore, the cumulative basic cost with valve point effect and cost with  multi-fuel are calculated in multiple runs of the algorithm. Consequently, the convergence plot of PSO for this optimization problem is shown in Figure 13, where the x-axis shows the number of iterations and the optimal value of the objective function (overall cost) is found at the 60th epoch of the algorithm. However, detailed numerical analysis is presented subsequently.

Numerical Result Comparison
This sub-section presents the comparison of numerical results while optimizing the cost for DA-DOPF. Dependent (state) variables are listed column-wise in Table 9 with their boundary limits. In addition to this allowable limit of the dependent and independent variables, bus data and branch data considered in this study are taken from Zimmerman and Murillo-Sánchez (2016). During the optimization algorithm, the active and reactive power of all generation sources and voltages of generator buses are considered constraints. Additionally, the SF constraint handling technique is used to handle the constraint violation for these variables. The effectiveness of the CH technique can be seen from the listed values of these variables for a different interval of DA-DOPF. Moreover, the approximated (CPU) time of the algorithm run is given in Table 9. Furthermore, a comparison of the presented approach with some previously mentioned techniques is given in Table 10. The main advantage of the SF constraint handling approach can be noticed from this comparison. It utilizes the information hidden in the infeasible solution and does not discard it straight away. Therefore, the solution found by the proposed technique is most optimal, and the reduction in generation cost is noticeable. Moreover, it is worth mentioning here that the proposed approach is compared based on the constraint handling techniques in conjunction with different optimization algorithms. Furthermore, it is also compared with some multi-objective optimization cases. Yet, in all these comparisons, the proposed approach is found best, and the values of basic cost, cost with multi-fuel, and system loss are presented column-wise in bold text. For Interval 6 of optimizing basic fuel cost, DA-DOPF/SF algorithms lead to fuel costs of 675.33 $/h. It is important to explain here that the on front of the inequality constraint of generator reactive power and load bus voltage, presented results are satisfactory and operating voltages of all buses of the IEEE 30-bus system remain within their allowable limits. The voltage profile of the system is plotted in Figure 14. A cursory glance at the voltage profile graph shows that most buses do not fall below the value of 1.0 p.u. On the contrary, voltages never exceed the value of 1.08 p.u. Therefore, the overvoltage problem during load management is controlled through the proposed constraint handling technique. Hence, the faithful operation of the power system is assured without any voltage stress for connected load at the PQ buses.

CONCLUSION
In the previously presented studies, conventional day-ahead optimal power flow (CDA-OPF) and real-time optimal power flow (RT-OPF) approaches did not cover the effects of the integration of VESs. Additionally, the variability of available power introduces the additional challenge to consider the scenarios of over-and underestimation. On the contrary, constraint violation techniques are also not considered in the available literature. Therefore, in this study, the day-ahead dynamic optimal power flow (DA-DOPF) problem is carried out with effects of intermittency of VESs. Moreover, to handle the constraint violation, the SF constraint handling technique is used. Therefore, an infeasible solution was not discarded straight away. Hence, a more confident and optimal solution is computed using the optimization program based on the PSO algorithm. In addition to this, the proposed approach is combined with the NN-based prediction model which is used to forecast dayahead wind and solar irradiance. Moreover, T-FMF calculates the membership value of VESs in the synergy of generation. Hence, DA-DOPF has been run for the six sub-intervals, and an optimal generation schedule is computed while ensuring the physical and security limits of the power system. Finally, the proposed approach is tested for an amended IEEE 30-bus system. The optimization program is coded in MATLAB 2018a and uses the MATPOWER  toolbox for computing load flow. Consequently, results obtained from these simulations are presented in tabular form as well as in graphical plots. However, the approach is quite different from the available literature, yet the comparison is done based on minimum generation cost and real loss. It is worth mentioning here that the presented approach was found superior in numerical analysis to the other similar approaches.
Nevertheless, the authors suggest the future scope with the induction of more renewable energy sources, MPPT for solar arrays, battery storage system, and more number of buses in the power system, as well as future scope in the integration of FACT devices and optimal placement of distributed generation sources and FACT devices.

DATA AVAILABILITY STATEMENT
The datasets presented in this study can be found in online repositories. The names of the repository/repositories and accession number(s) can be found below: IEEE Standard Bus System.