Bi-level fuzzy stochastic-robust model for flexibility valorizing of renewable networked microgrids

This paper presents a new bi-level multi-objective model to valorize the microgrid (MG) flexibility based on flexible power management system. It considers the presence of renewable and flexibility resources including demand response program (DRP), energy storage system and integrated unit of electric spring with electric vehicles (EVs) parking (IUEE). The proposed bi-level model in the upper-level maximizes expected flexibility resources profit subject to flexibility constraints. Also, in the lower level, minimizing MG energy cost and voltage deviation function based on the Pareto optimization technique is considered as the objective functions; it is bounded by the linearized AC optimal power flow constraints, renewable and flexibility resources limits, and the MG flexibility restrictions. In the following, the proposed bi-level model using Karush–Kuhn–Tucker (KKT) technique is converted to a single-level counterpart, and the fuzzy decision-making method is employed to achieve the best compromise solution. Further, hybrid stochastic-robust programming models uncertain parameters of the proposed model, so that stochastic programming models uncertainties associated with demand, energy price, and the maximum renewables active generation. Also, to capture the flexible potential capabilities of the IUEE, robust optimization models the EVs’ parameters uncertainty. Finally, numerical results confirm the proposed model could jointly improve operation, economic and flexibility conditions of the MG and turned it to a flexi-optimized-renewable MG.


a. Background and Motivation
The unprecedented growing speed of renewable energy sources (RESs) in the power system, especially traditional distribution networks owing to their old, overstressed and redundant structure caused various challenges in the network operation and flexibility [1,2]. In other words, due to clean operation and low operating cost, they generally inject maximum output power as per climate changes to the network, leading to sharp power fluctuations [3]. Therefore, the intermittent nature of RESs in MG in terms of operating indices causes overvoltage, energy losses increase, MG lines overloading, etc. [4][5][6]. In addition, RESs together with other sources of uncertainty bring inconsistency between the results of day-ahead (DA) forecasting and real-time (RT) dispatch [7,8], where these challenges are generally addressed under the theme of reducing network flexibility [9]. Flexibility has recently been defined by system operators and legislated by organizations like the North American electric reliability corporation (NERC) and the international energy agency (IEA) [10]. It can be divided into two types: long-term planning flexibility and short-term operational flexibility. From the operational point of view, flexibility is the timely capability of an energy system in responding to oscillations and modifying generation and demand patterns [11].
To address the aforementioned issues application of FSs such as DRP, non-renewable distributed generations, ESS and EVs have been suggested at the distribution level [12]. These resources due to proper controllability can be effective in enhancing the flexibility and operation of the distribution network. But achieving such goals requires providing a suitable PMS for the MGO, however, uncoordinated operation of FSs imposes additional costs on the distribution/transmission system operator (DSO/TSO) through power imbalances [13]. FPMS by considering coordination between MGO, FSs and local resources could manage the operational flexibility of the network, by optimally controlling the https Λ E , Λ P Sets of polygon edge and piecewise segment in linearization methods, respectively.

U, D
Upward and downward power flexibility in MG, respectively (p.u).
active and reactive power of the mentioned resources [14]. The importance of this issue becomes clear when even stochastic DA scheduling or conservative methods will be inadequate in realtime dispatch, the former due to uncertainty forecasting error and the latter due to imposing an additional cost to the DSO/MGO [2]. There are a variety of approaches in the field of distribution network flexible operation using FSs. Ref. [14], presented a flexible power management algorithm for plug-in EVs to achieve the smooth daily demand profile. The authors of [2] have introduced a two-stage stochastic flexibility services management to procure 2 and manage flexibility services, aiming to minimize TSO-DSO interface deviations at the lowest cost (reserve and activation costs). In the presented model, flexibility service providers such as distributed energy resource (DER) aggregators and battery storage systems considering RESs, optimizes DA scheduling in the first stage, and real-time dispatch in the second stage. Also, another stochastic framework as a mixed-integer quadratic programming (MIQP) for optimizing MG operation has been developed in [15]. This framework by employing DERs and hybrid ESSs prepares reserve regulation capacity to system operator for minimizing MG operating cost. For maximizing RESs hosting capacity as well as minimizing energy loss a multi-objective multi-period NLP framework is presented in [6], in which using DRP and RESs active power curtailment, objectives are balanced. In [16], robust coordination of the DERs in both island and grid-connected multi-energy MGs operation is investigated. The overall objective function minimizes operating cost, and its constraints include network equations and balance of cooling, heating and electrical energies. It has used robust optimization for modeling load and RESs uncertainties and has been able to increase the energy efficiency of MG by managing the energy of various resources and storages. In [17], the capability of PMS in distribution network by considering bidirectional coordination between DSO and different active sources and loads has been reported. Based on numerical results obtained in [16], the PMS can simultaneously improve operation, flexibility and reliability indices, by optimally active and reactive power scheduling of RESs, ESSs and DRP. Also, the authors of [18,19] described the impact of EV's charger upgrading to a bidirectional setup on the operation of the distribution network. They have considered high penetrated EVs with the aim of minimizing operating cost [18] as well as maximizing voltage security [19]. Finally, in [20], to tackle supply-demand mismatch arising from wind and solar productions, application of ES and battery coupling system as a novel FS in a deterministic PMS framework was suggested.
In recent years, ES as a novel solution in DSM has come into the picture [21]. The ES through controlling serially connected non-critical (NCL) illustrated in Fig. 1, provides a supply-demand balance via the formed smart load and supports the parallel critical load (CL). ES due to the shared responsibility of active and reactive power compensation facilitates voltage and system frequency regulations, power factor correction, load response mechanism, harmonic suppression, etc. [22]. Also, a massive focus has been made on ES aimed at topology development, controlling issues resolving, modeling and performance improvement. Previous studies have generally been based on the independent operation of ESs in the network for voltage and frequency regulation [23][24][25]. To solve controlling issues of distributed ESs arising from computational complexity, slow transient response and single point failure, droop and consensus control have been proposed [26,27]. At last, regarding the ES flexibility, in [28], ES system flexibility from the technical perspective as a NLP framework has recently been investigated.

b. Research Gaps and Contributions
According to the review of the prior researches and Table 1, it can be seen that there are the following research gaps: • There has generally been limited research on the MG flexibility quantifying, and most researches have not valorized network flexibility [29]. While for cost-efficient management of MG, it is necessary to analyze the system flexibility economically. Also, the degree of improvement in the system flexibility is related to the incentive pricing of FSs' flexibility, which is never considered in the energy systems operation issues by considering MGO and FO interaction as bi-level model. • Over the years, different generations of ES have been presented in articles. In the prior versions of ES four issues encompassing active and reactive power controlling capabilities, power quality, investment cost and storage capacity have been highlighted. The IUEE using a bidirectional converter as a novel solution, can effectively control and exchange active and reactive powers with MG and participate in ancillary services markets. Also, the IUEE by integrating ES and EVs converters ( Fig. 1) eliminates the technical and economic problems of dispersed EVs converters. Besides, it promotes battery-based ES prototypes to a battery-free configuration due to EVs' energy transition. It will provide extensive capabilities to improve the technical and economic indices of the network. Simultaneous analysis of these indices in case of distributed operation of IUEEs along with other sources, is one of the priorities of this paper, which has not yet been studied.
• By the large-scale joint operation of IUEEs with other distributed FSs and RESs into the MG, the integrated management paradigm is no longer efficient for future MGs. Because it leads to MGO receives big data and decision-making process owing to the large set of possible feasible solutions becomes complex and time-consuming. This issue also needs to provide a managerial/operational solution, which to the best of our knowledge, no research work in the area of ES has been performed.
• Heterogeneity in the behavior of EVs is a major challenge in the operation of the IUEE, which along with other sources of uncertainty confronting the ways traditional distribution networks are operated and planned with many problems. Hence, different levels of EVs uncertainty need to be considered in the coordinated operation of IUEEs with other FSs.
To address the aforementioned research gaps, in this paper, a new bi-level model to valorize MG flexibility in presence of renewable and flexibility sources based on FPMS is presented.  To solve the problem, the KKT technique obtains a singlelevel framework for the proposed model. Also, the FDM approach is used to obtain the best compromise solution from the provided Pareto optimal set between the objectives of the lower-level problem. Further, this paper uses HSRP to meet the fourth research gap, where to achieve the robust IUEE capabilities in enhancing the operating, economic and flexibility conditions of the MG, BURO is used for EVs' uncertain parameters modeling [30]. In addition, SBSP models the uncertain parameters including load demand, market energy price and maximum RESs generation. In the SBSP method, scenarios are firstly generated by the Monte Carlo simulation (MCS), then the most probable and dissimilar scenarios based on the Kantorovich approach are selected [31]. This action reduces the model's computational inefficiency or intractability. In summary, the main and foremost contributions and features of this paper can be summarized as follows: • For the first time, the linearized bi-level and indirect coordinated mathematical modeling of flexibility and MG operators' interactions in the GAMS software is presented. In this model, impacts of different uncertainty levels and flexibility tolerances on the performance of FSs and techno-economic indices of MG in the context of a hybrid stochastic-robust programming are investigated.
• The value of MG flexibility in presence of IUEE by considering DRP and ESS as a bi-level model is determined.

c. Structure of the Paper
The remainder of this paper is structured as follows: The single-level formulation and the solution process of the proposed model are established in Section 2. Uncertain parameters modeling according to the HSRP is presented in Section 3. Numerical studies in four subsections are developed in Section 4, followed by the conclusion in Section 5.

Bi-level modeling
This section is dedicated to present the proposed bi-level model for determining the value of MG's flexibility considering RESs and active loads (ALs)/FSs. The upper-level model is expressed in (1a)-(6a), so that its objective function, (1a), maximizes the expected profits of ALs from the provision of flexibility services in MG. The ALs are including a cluster of IUEEs and ESSs distributed across the MG and incentive-based DRP. In this model, FO and MGO are considered independent agents, because they have different strategies/objectives. The FO exploits the ALs' flexibility services in the most efficient way so as to stay committed to the MG oscillations, while following the MGO restrictions technically and economically. Flexibility as an operational option is considered from the perspective of an economic index, which is the profit of flexibility. This profit is defined as the product of FIP and FE, where the FE depends on the FSs' capacity. Note that FE is considered as the upward and downward capacities of FSs [32]. If the active power of the ALs in scenario s is greater than their active power in the scenario corresponding to the deterministic model (scenario 1), the ALs operate in an upward mode. Otherwise, they are in downward mode [32]. Hence, in (1a), the expected flexibility profit is modeled for the two flexibility modes of the ALs. The constraints of the upper-level problem are stated in (2a)-(6a), which constraints (2a) and (3a) calculate the amount of MG flexibility in both upward and downward modes, respectively. In constraints (4a)-(6a), the flexibility of DRP, ESSs and IUEEs in the mentioned modes are modeled, respectively. It is noteworthy that the upper-level model requires the amount of FSs' active power and the value of MG flexibility, which these variables are calculated from the lower-level problem. Finally, the proposed model will be written as follows: Subject to: Subject to: The lower-level problem is modeled in (7a)-(26a). MG components are scheduled in the lower level with the aim of minimizing MEC and VDF. Eq. (7a) as the lower-level objective function minimizes the sum of weighted objective functions, where ω C and ω V represent the weight coefficients of MEC and VDF in the objective function, respectively. The value of these two coefficients is between zero and one so that their sum always equals one. By selecting different values for these two coefficients, the Pareto optimal set for MEC and VDF are obtained [33]. In the following, this paper uses the FDM method to achieve the best compromise solution between the feasible solutions of the mentioned functions, the details of which are expressed in algorithm (1) [34]. The constraints of the lower-level problem are expressed in (8a)-(26a). Eqs. (8a)-(12a) as LAC-OPF equations respectively describe bus's supply-demand balance for active and reactive powers, (8a) and (9a), active and reactive flow of distribution lines, (10a) and (11a), and the slack bus voltage angle, (12a). Also, Eqs. (13a)-(15a), as thermal operating limits of the MG, represent MG lines and distribution substation capacity limits, (13a) and (14a), and the bus voltage deviation constraint, (15a).
It is assumed that the MG is connected to the upstream distribution network through the distribution substation at the slack bus. Therefore, the amount of P S and Q S variables in other buses is zero. In this model, based on the theory of linearization in the distribution networks or MGs [18,19,35,36], it is assumed that the voltage angle difference between the two buses of MG lines is less than 6 degrees. Also, the variables of voltage magnitude (|V |) and voltage squared (V 2 ) are expressed as V +  The ALs operational formulation are presented in (16a)-(25a). Modeling of DRP is based on (16a)-(17a). In this model, it is assumed that DRP participants will be able to shift their energy consumption during on-peak hours (high energy prices) to offpeak hours (low energy prices). The acceptable range of consumer power changes in DRP is taken into account as (16a). Also, DRP participants tend to supply all of their shifted energy demand on the operating horizon. Therefore, constraint (17a) ensures that all participants' reduced energy during peak hours is supplied by MG at off-peak hours. In addition, the ESS constraints are modeled in (18a)-(20a), which are the limitations of the ESS stored energy and its charge and discharge rate limits, respectively. In the following, the operating limit of IUEE is considered in (21a)-(25a). Eq. (21a) refers to the stored energy in the EVs' battery located in the charging station, which should always have a positive value. Constraints (22a)-(25a) respectively represent daily EVs energy in the charging station, (22a), charging and discharging rates of EVs station, (23a) and (24a), and finally, the capacity of IUEE converter is modeled in (25a). The NCL serially connected to the IUEE is modeled as ZIP model; wherein the NCL voltage can be controlled by the IUEE as per the right side of Eqs. (8a) and (9a). The ZIP model as a comprehensive model covers all types of NCL models [37,38]. Hence, the term A IUEE equals one for buses with IUEE, otherwise, it is zero. In (21a)-(25a), CR IUEE respectively. Finally, the MG flexibility limit is expressed in (26a). According to [18], a MG is flexible if the difference between active power received from the upstream network in different scenarios compared to the deterministic scenario (scenario 1) is limited. This issue is considered in (26a), where ε F indicates flexibility tolerance. In fact, Eq. (26a) provides a flexibility limit for MGO against contingencies and uncertainties. By considering the intended flexibility range, the MGO optimizes the operating point of the MG devices and has a restricted range of feasible solutions.

Single-level modeling
To solve the bi-level problem expressed in (1a)-(26a) by existing mathematical approaches, in this section, the single-level counterpart is obtained. To this end, due to the linearity and convexity of the problem, the KKT method has been used in this paper [39]. In this method, the Lagrange function (L) of the lowerlevel problem is calculated, which equals the sum of the objective functions and the penalty functions of the constraints. Penalty function for constraints as a = b and a ≤ b can be expressed as λ.(b -a) and ϕ.max(0, a -b), respectively [18]. Now to solve the problem and calculate variables, it is necessary to obtain the Lagrange function derivation to the main problem variables and Lagrange coefficients (λ and ϕ). Accordingly, the lower-level model by the first order KKT optimality conditions is included in the upper-level problem, (1a)-(6a), and the single-level model is obtained. Henceforth, the upper-level problem contains the constraints of the KKT process for the lower-level problem. Therefore, the single-level formulation can be written as follows.

Objectivefunction(1a)
(1b) Subject to: The objective function of the new single-level problem is presented in (1b), which is the objective function of the upper-level problem (1a). Its constraints also include upper-level problem constraints (2b), and constraints obtained from the KKT process for the lower-level problem, (3b)-(36b). According to [40], the derivation of the Lagrange function relative to the Lagrange coefficients is equivalent to the constraints of the lower-level problem, which is stated in (3b). Also, Eqs.

Hybrid stochastic-robust programming of the proposed model
In the proposed model, to cope with the heterogeneity of EV owners, robust programming based on BURO in the worst-case uncertainty scenario models charge and discharge rates of EVs station in IUEE, CR IUEE and DR IUEE , initial energy of EVs connected to IUEE charger station, E IUEE,ini , and the daily EVs energy in the charging station, RE EV . Other uncertain parameters including load demand, P D and Q D , energy price, ρ, and active power output of wind and photovoltaic systems, P W and P PV , are modeled according to SBSP. In SBSP, the MCS approach first produces a multitude of scenarios [39], so that the probability of load and energy price is determined based on the normal probability distribution function (PDF), and the probability of wind and solar generation in each scenario follows Bernoulli and Beta PDF, respectively. The probability of each scenario equals the product of all uncertain parameters probability. Afterwards, the Kantorovich approach selects a certain number of the most probable and distinct scenarios via the scenario reduction technique, which is presented in more detail in [31]. In the BURO, it is assumed that the true value of uncertain parameters is between (1 -ψ).u and (1 + ψ).u, where ψ ≥ 0 represents uncertainty level and u is the normal value (forecasted) of the uncertain parameter. Note that in the worstcase scenario, the true value of the uncertain parameter based on its position in the problem is assumed in the upper or lower limit. Hence, the feasibility region of the problem in the robust scenario is less than the deterministic one [18]. Therefore, the fuzzy hybrid stochastic-robust modeling of the proposed problem is as follows:    Based on the above statement, to achieve a lower feasibility region in robust modeling than deterministic one, (1b)-(36b), it is necessary that in the worst-case scenario, the EVs uncertain parameters such as CR IUEE , DR IUEE and E IUEE,ini are bounded at their lower limit, and RE EV are set at the upper limit. Because in this condition, the amount of EVs energy requested from the MG is increased, and the charging/discharging rate is also reduced. In addition, since there is only one scenario (worst-case scenario) for EVs uncertain parameters, the scenario index (s) in problem (1c)-(9c) is removed from the CR IUEE , DR IUEE , E IUEE,ini and RE EV parameters. Finally, the SBSP and BURO scenarios are applied to the upper-level problem, so the scenario index (s) is used for other problem variables. Fig. 3 illustrate the proposed bi-level flexibility-oriented MG scheduling framework.

Test case and component modeling
In this section, the proposed FPMS is applied to a 32-bus test MG as shown in Fig. 4 [28]. Details of MG lines and substations as well as peak load data are sourced from [41]. This network has base power and voltage of 1000 kVA and 12.66 kV, which the permitted voltage range for the buses containing NCL/CL is equal to [0.9, 1.05]/[0.98, 1.02]. The hourly load is calculated by multiplying the peak load by the load factor in accordance with Fig. 5 [42]. The renewable installed capacities in MG are containing 2000 kW for a solar system at Bus 19, and 1500 and 1800 kW for two wind systems which are respectively allocated at Buses 10 and 14. The hourly generation of RESs equals the maximum RESs capacity multiplied by their power rates as are plotted in Fig. 5. Also, the energy price is taken from [19], which is 16 $/MWh for off-peak hours at 1:00 to 7:00, 30 $/MWh during on-peak hours (17:00-22:00), and for other hours it is 24 $/MWh. The IUEEs location, according to the performed ESs planning in [28] are considered at Buses 1-3, 10-15, 18, 19 and 22. The maximum capacity of IUEE's parking is 100 EVs with a penetration rate equivalent to Fig. 5.
The rest of EVs data are specified in [18,19,35]. Note that Buses 6-9, 20, 21, and 25-28 are supposed to have CLs, and DRP participants at Buses 3, 6, 15, 16, 22, 24, and 29-32 can change their consumption up to 40%. It is also assumed that 6 energy storages as battery with the capacity of 3 MWh, charge/discharge efficiency of 95% similar to EVs' batteries, charge/discharge rate of 1 MW, minimum stored energy or initial energy of 0.5 MWh are installed at Buses 6, 16, 24, 26, 28 and 31. Finally, to model stochastic uncertain parameters and start the simulation process, first, the MCS produces 1500 scenarios by assuming 10% standard deviation, then, the Kantorovich approach selects 30 dissimilar and probable scenarios.

Results and discussions
The proposed model is solved using GAMS software to obtain the best compromise solution [43]. In this paper, voltage magnitude is linearized by 5 segments approximation based on the piecewise linearization technique. Also, circular constraints   [35], wind and photovoltaic power rates [20], EVs' penetration rate in the charging station [35]. are approximated by 45 segments polygon. Based on these assumptions, the computational error for the voltage and power variables of the LAC-OPF is in the acceptable range of 0.5% and 2.2%, respectively [35]. Table 2 expresses the results of the NLP and MILP frameworks for the proposed problem. As the results show, the NLP framework with IPIOPT solver can find a locally optimal solution during 753.94 s, while this is not possible for MINOS solver owing to infeasible model status.
In the MILP framework with the CPLEX solver, with a lower run time rather than the CONOPT solver, the globally optimal solution is obtained. In subsequent, details of the numerical simulations are reported in 4 subsections.
(A) Determining optimal compromise solution: The Pareto front results of the proposed model, (1c)-(9c), for different uncertainty levels of EVs (Ψ ) are shown in Fig. 6. This figure shows the Table 2 The results of the different frameworks for the model. effect of changes in EVs' uncertainty on the economic (MEC) and technical (VDF) status of the MG. The negative MEC in this figure (horizontal axis) indicates the MG profit from selling energy to the upstream distribution network. As can be seen in this figure, the rise in the MEC leads to decline in the VDF. Because to stabilize the MG voltage, power injection by different local resources into the MG is controlled by the MGO, and consequently, by purchasing energy from the upstream grid the MEC is increased. However, in order to reduce the MEC (increase the profitability of the MG operation), it is necessary to inject high power by the local resources into the MG. To put it another way, on the one hand, the MG local resources should inject high power into the MG to reduce MEC, and on the other hand, in order to maintain the buses voltage in the allowed range, MGO limits power injection and thereby the MG revenue decreases (MEC increases). Table 3 shows the best compromise solution between MEC and VDF for different uncertainty level values. According to this table, MEC and VDF for Ψ = 0 are −110.5 $ and 0.982 p.u, respectively.    Table 3 is about 5.8%. Finally, increasing the level of EVs uncertainty from zero has caused the Pareto front shift to the right and upward, which implies an increase in VDF and MEC relative to the case Ψ = 0. Because according to (1c)-(9c), this issue raises the energy consumption of EVs and decreases the charge/discharge rate in the worst-case scenario, as a result, the MEC and VDF will increase.

Model
(B) Analyzing MG flexibility: This section is devoted to the MG flexibility analysis based on the proposed model. Fig. 7 shows flexibility profit changes (the upper-level objective function (1a)) based on the MEC. Note that the first point on the right in this figure is the case where the flexibility tolerance (ε F ) is 0 p.u. To make the analysis more assertive the value of the ε F goes up gradually, varies from 0 to 0.5 p.u in 10% steps. As can be seen the rise in flexibility profit leads to a rise in MEC. The reason for this is that when the flexibility tolerance is 0 p.u, highly flexible operating case among selected cases, the MG flexibility limit (26a) has not any degree of freedom. Therefore, FSs should be able to independently eliminate all oscillations in the MG active power in different scenarios in comparison to the deterministic scenario. It makes a strong commitment for FSs to improve the MG flexibility, so FSs flexibility profit is exponentially increased. However, at the point corresponding to ε F = 0.5 p.u, the weakest flexibility point, the MGO has wider range of energy exchange and flexibility commitment is minimal. Therefore, the MGO earns more revenue from the sale of energy relative to ε F = 0.0 p.u. In general, MGO using flexibility tolerance produced a trade-off between flexibility profit and MEC. The more the flexibility tolerance is increased, the more options are provided to the MGO to handle the uncertainties. Thus, in such a condition, MEC and flexibility profit would decrease, or a smaller amount of uncertainty would be covered by FSs. Moreover, increasing EVs' uncertainty level (UL) reduces the flexibility profit due to deteriorating flexibility provision of the IUEEs, based on the reasons stated in the prior section. The daily expected MG flexibility power in upward and downward operating modes, for different levels of EVs uncertainty and flexibility tolerance, are plotted in Fig. 8. As shown in this figure, the trend of hourly changes are the same as the oscillations in RESs generation (Fig. 5). Because it is supposed that the standard deviation of uncertain parameters in the stochastic model, for all simulation hours is 10%, so with increasing the RESs generation, the amount of power fluctuations will increase. Accordingly, FSs as the only source of flexibility in the MG are responsible to make up RESs volatilities in different scenarios. Further, due to the dependency of the FIP on flexibility demand, the FIP curves ( Fig. 9) approximately follow the upward and downward flexibility trend in Fig. 8. Now, turning to the details, enhancing the value of FT, due to increasing the freedom degree of MG flexibility, results in MG flexibility requirement reduction. Under such conditions, the FIP due to the lower MG flexibility demand will be reduced. As a result, the flexibility profit similar to the FIP and flexibility power will be decreased, (1a), which confirms the results of Fig. 7. As mentioned earlier, with decreasing charge and discharge rates and flexibility power of EVs respectively due to increased UL and FT, the MG flexibility power and FIP curves will shift downwards in both operating modes of FSs, as shown in Figs. 8 and 9.
(C) Considering the operation of renewable and flexibility resources: This section considers the daily operation of renewable and flexibility resources as per the point ε F = 0 shown in Fig. 10.
As is depicted in Fig. 10(a), RESs inject as much active power as the maximum installed capacity to the MG because of free operating cost. Note, RESs inject a certain amount of active power into the MG, regardless of the MG demand and the values of the ULs. Also, DRP participants in accordance with (16a) and (17a), to achieve low operating cost and high flexibility for the MG, as is illustrated in Fig. 10(b) shift most of their demand to 1:00 to 16:00, when the energy price varies from 16 to 24 $/MWh. They also decrease their demand between 17:00 and 22:00, when the energy price has risen (30 $/MWh). Such conditions are also established for ESSs according to Fig. 10(b), so that they receive high power from the MG between 1:00 and 7:00, when the energy price is minimal. They absorb low active power from the MG between 8:00 and 16:00 and 23:00-24:00 to be able to play an effective role in controlling MG flexibility. Then, ESSs according to FO commitment, inject total stored energy into the MG during on-peak hours, 17:00-22:00, when the energy price is at its highest. This performance reduces MEC and maximizes their flexibility profits. As shown in Fig. 10(c), IUEEs receive high active power from the MG to charge EVs' batteries during 1:00-7:00. Moreover, they are recharged between 13:00 and 16:00, when the energy stored in the EVs' batteries is injected into the MG  between 17:00 and 22:00, i.e. on-peak hours. This is commensurate with achieving high flexibility and reducing the charging cost of IUEEs based on (1a) and (7a). As shown in Fig. 10(d), to compensate the voltage drop due to ALs charging, IUEEs in the deterministic scenario (UL = 0) inject the highest reactive power into the MG from 1:00 to 7:00 compared to other ULs. The rest hours, although they inject notable reactive power to regulate the voltage oscillations, it is less than the reactive power injected between 1:00 and 7:00 because of high ALs charging. Since the voltage regulation of MG relies mainly on IUEEs due to utilizing bidirectional converter, they inject as much reactive power into the network as possible, though reactive power compensation is free of remuneration.
Based on Fig. 10(c), with increasing UL, since the charging and discharging rates of EVs contrary to the EVs energy consumption are decreased, the EVs charging interval is increased.
Thus, starting the charging interval for UL = 0.2 will be earlier than other ULs (23:00). This causes in the corresponding case, IUEEs to compensate voltage drop, inject more reactive power at 23:00 with respect to other cases. In addition, as stated in Section 4.2.b, the rising UL reduces the flexibility power of EVs, so to compensate flexibility shortage, DRP and ESS increase their charge and discharge power ( Fig. 10(b)).
(D) Evaluation of microgrid operating indices: In this section, the capability of the proposed model in improving the MG operating indices is evaluated. Table 4 Table 4. Overall, the extracted results signify the FSs using the provided robust feasible solution satisfy MGO flexibility requirements for improving renewable MG operation.
To sum up briefly, the proposed FPMS is employed as an effective tool for proper scheduling of FSs to increase the MG flexibility and expands the region of robustness. The outstanding feature of FPMS is implementing consistent responsibility-sharing among FSs. FSs by controlling the demand side based on system objectives and price patterns, overcome the high penetration of RESs and other uncertainty resources.
IUEE as a new method of decentralized DSM extends the MGO operational ability to provide a more active demand side, well-regulated voltage, and energy-efficient MG. The profitable deployment of IUEEs in the MG can optimize the costs of the system and causes the system to become more flexible. In addition, the reactive supporting feature that distributed IUEEs bring to the MG is exploited to reduce VDF more effectively. Also, implementing instantaneous demand response without customers'  dissatisfaction is so prominent difference between IUEE and various DRP approaches. Moreover, IUEEs resolve some prior ES topologies drawbacks such as limited capacity, high investment and operating cost, and environmental concerns. All in all, distributed large-scale flexibility synergy of FSs profitably compensates the challenges of uncertainties mismanagement, enhances MG operational status, and reaches the desired objectives of RESs integration in the most effective way. Further, by smart managing of FSs, FPMS avoids imposing the risk to the reliable operation of MG even in the stiff and weak power grid conditions.

Conclusion
This study is aimed to establish a flexibility management platform for MG, using the proposed bi-level hybrid stochasticrobust programming based on the KKT optimality conditions and FDM approach. In the proposed FPMS, a bi-level multi-objective model was developed to maximize flexibility profit arising from IUEE along with DRP and ESSs in the upper-level, as well as minimizing the MG operating cost and VDF in the lower level. The KKT method was employed to achieve the single-level formulation, and then the FDM obtained the best optimal compromise solution. The IUEE as a novel fast demand-side technology established a dynamic supply-demand balance in the MG. Besides IUEE by actively collaborating with other FSs provided a feasible solution to acceptably satisfy the critical customers' flexibility requirement for voltage quality. As the promising numerical results have corroborated, the proposed model was able to obtain the best compromise solution between the MEC and VDF, so that their gaps from their minimum points are 30% and 6%, respectively. It has also been able to decrease energy loss by about 47.18% in the worst-case scenario due to EVs uncertainty, and stabilize the voltage profile for CLs/NCLs buses around 75.3%/47.25%, respectively. The designed scheme with optimized scheduling of flexible assets could bring 100% flexibility for the MG operation and prepares suitable actions during the stressful operation of MG. Also, it will potentially promote the progress of modern smart grids towards achieving a highly efficient, synergetic and flexible network, and also facilitate operational decision making for MGO. Last but not least, coordinated management of distributed IUEEs with other FSs in the context of the proposed model, creates a flexi-optimized renewable modern MG economically and technically.
In future works, the IUEE performance will be analyzed by more technical and economic indices. Also, to enhance the obtained results in this paper, and the available operational flexibility as a necessary precondition for the effective grid integration with large shares of variable RESs, joint operation of IUEE with other possible flexibility options are investigated.