A Quadratic Programming-Based Power Dispatch Method for a DC-Microgrid

This Paper deals with the optimum energy management of Microgrid (MG) having Energy-Storage System(ESS)s. Recently, the importance of retaining the profits of MG owners and the needs of providing additional requirements to the electric grid are rising. To accommodate these needs systematically, the Quadratic Programming (QP), one of the simplest and effective optimization method, is gaining attention. The QP has been used for similar cases before, but unlike the known advantages of early QP studies, some of the subsequent papers have been conducted in an inappropriate direction and may be overshadowed. Therefore in this paper, an extended and more practical QP cost function considering the realistic operating conditions is proposed, and the advantages of the original methods are revisited with comparisons. As a result, the proposed method retains the genuine features of QP, such as peak power shaving and assuring the power reserve rate, and can be simply extended to include Electric Vehicle (EV)s into the optimization. Additionally, the practical issues of implementing the QP in real-time have been discussed and resulted in both improved optimization speed by 58% using the cost function reformulation and the robustness with the forecast mismatching.

Power generation from PV at time t P WT (t) Power generation from WT at time t P ESS (t) Power for an ESS charging(+) / discharging(-) at time t P EV (t) Power for an EV charging(+)/ discharging(-) at time t The associate editor coordinating the review of this manuscript and approving it for publication was Feng Wu.

P EV,i (t)
Power for i th EV charging(+)/ discharging(-) at time t P * EV,i (t) Power reference for i th EV charging(+)/ discharging(-) at time t P GRID (t) Power from the AC grid to DCMG at time t P LOAD (t) The load connected to the DCMG at time t B SoC (t) Battery SoC of ESS at time t B EV (t) EV SoC at time t B SoC (t − 1) B SoC at one step before the time t T s Time step for receding horizon P GRID, Max Maximum power limit of P GRID (kW) P GRID, Min Minimum power limit of P GRID (kW) P ESS, Max Charging power limit for ESS (kW) P ESS, Min Discharging power limit for ESS (kW) P EV, Max Charging power limit for an EV (kW) P EV, Min Discharging power limit for an EV (kW) P EV,Max, i Charging power limit for i th EV (kW) B SoC, Max Upper bound for BESS battery SoC

B SoC,Min
Lower bound for BESS battery SoC B EV, Max Upper bound for EV battery SoC B EV, Min Lower bound for EV battery SoC E ESS The energy in ESS (kWh) J The objective function for QP c SoC The weighting factor of the ESS SoC management c GRID (t) The weighting factor of the P GRID c EV, i The weighting factor of the ESS SoC management B * SoC (t) Target SoC of the BESS at t B SoC (24:  N-sized weighting vector for P G (t) made of a time series with c GRID (t) 1 N×1 One valued N-sized vector 0 N×N Zero valued N-sized square matrix LT N-sized lower triangular square matrix UT N-sized upper triangular square matrix I N N-sized diagonal matrix P PV ,Actual Actual P PV as a disturbance P PV _EST @x Estimated P PV at time x for a day P GRID,Ideal Optimal P GRID solution by known disturbance P PV ,Actual P GRID,Real Optimal P GRID solution by estimated disturbance P PV _EST @x B SoC,Ideal B SoC result by the known disturbance P PV ,Actual B SoC, Real B SoC result by the estimated disturbance P PV _EST @x B SoC,NewReal Corrected B SoC,Real to maximize the utilization of the battery

I. INTRODUCTION
The inherent intermittence of renewable energy sources such as PV and wind has increased the use of energy storage devices, which has led to the rapid growth of the battery-related industry. Despite such expansion, it is still considered that we are at the beginning of the ESS penetration phase and may not meet the requirements for a fully sustainable and reliable energy solution shortly. As an example, actively ongoing renewable energy plans in California still seem to be an ambitious goal to reach 100% renewable, as hot summer demands unprecedented ESS capacity, and winter requires constant baseline power by the conventional power sources [1]. However, even though the technological and economic issues we are facing are non-negligible, we must speed up replacing destructive energy sources such as nuclear fission, fossil fuels, etc. with environment-friendly and sustainable ones. Fortunately, we see a continuous growth of the total number of MG having renewable energy sources with ESSs [2], [3], and the renewables are the only source that posted growth in demand in the recent global outbreak [4]. However, due to the expansion of the localized VRE-based power generation, unexpected power curtailment is prevailing not to affect the stability of the existing power system, and the importance of the optimal energy utilization of the VRE is rising [5]- [8].
Therefore, the optimal operation of the MG having ESSs have been investigated [6]- [8], [15]- [17]. It has shown that BESS can effectively work as a solution for daily power intermittency and improve grid stability from many existing MGs test sites. It also brings flexible real-time power dispatch capability and enables the ancillary support features, such as reactive power, voltage, frequency support, and harmonics filtering or cancelation, which were traditionally provided by additional power generators and voltage regulators. [9]- [11], [14], [18], [19]. Also, there were attempts to find an optimal running schedule systematically using different types of available optimization methods such as single-objective optimization, multi-objective optimization, heuristic, and metaheuristic optimization, etc [5], [20], [21]. As previous researches addressed, to run an MG assisted by the ESS may not be a simple matter. With that said, the objective function that describes the physical relation of the power flow and the respective conservative energy law is pretty intuitive, and we may not need such a highly sophisticated optimization algorithm, but a simple convex optimization [22]. As an example, three BESSs were scheduled to achieve the curtailment free operation of a PV energy in a DCMG using the quadratic form of the cost function formulation [23]. Also, an economic schedule of hydrogen-based ESS in an MG having other different types of ESSs like battery and supercapacitor, and the VREs like PV and wind was discussed using the quadratic formulation. It dealt with the degradation of MG components and the dynamics of the system [24]. As introduced, the main contribution of [23], [24] was to open up the usability of the QP in deciding the power dispatch of ESSs. VOLUME 8, 2020 Furthermore, more QP oriented ESS power dispatching methods were introduced. Advanced features such as peak shaving and minimizing the electric bill were discussed together with a detailed explanation of the implementation. In [25], it suggested the day-to-day optimization technique using the forecasted PV data along with a load profile to determine the hourly power dispatch of an ESS during the day. It performs the optimization once more during the day when the corrective action is needed, i.e., when the forecast error is too large. Another method is the optimization using the receding horizon, similar to [23], [24]. It repeats the optimization at each time interval of the time horizon to obtain the next time step ESS action [26]. Principally, [25], [26] are using almost the same objective function in the aspect of maintaining the SoC of BESS. The difference is that [25] included a battery charging/discharging slope term to limit the battery's participation to the grid, which would affect the battery EOL and [26] added the effect of battery cost depreciation, which resulted in a negligible impact on determining the optimal solution in the end. However, both methods have the same issue caused by an equality constraint for the battery SoC management, which was not appeared in [23], [24]. As a result, the cost function becomes vulnerable to disturbance, especially when exposed to rapid changes, such as power generation changes in renewables, load changes, or sudden ancillary service requests.
In this paper, By using the genuine QP form for the SoC management of an ESS [24], the general and simple form of the QP cost function is proposed. Many comparative analysis are employed to show the risk of using the equality constraints inadequately and the advantage of the genuine cost function. Computational burden has drastically decreased using the proposed QP control-variable simplification by minimizing the number of decision variable in the cost function. Also, the way of including EV charging function into the QP cost function is explained and verified with simulation. Moreover, the practical issue when implementing power dispatch in realtime have been addressed. Even though the existing papers discussed real-time power dispatch, how newly measured data is used instantaneously and how the future information is adopted in RT may still be ambiguous [26], or the result may not be accurate due to a too sparse optimization interval [25]. So the problems that arise when using future predictions for optimization is explained and a way to reduce the side-effect of the prediction errors is explained. By having so, this paper aims to make it more feasible to keep the profits of MG operators stable without significant losses. Ultimately, we may be able to ensure the feasibility of stable MG business.

II. SYSTEM DESCRIPTION
We will consider an optimal operation of the DCMG given in FIGURE 1. A photovoltaic power generation system (Photo Voltaic) and a wind power generation system (Wind Turbine) are connected to the DC-bus and deliver powers P PV and P WT , respectively, through the MPPT operation of power converters. A BESS and an EV charger can charge or discharge powers from/to the DC-bus through bidirectional DC/DC converters. P ESS and P EV denote the charging (plus sign) and discharging (minus sign) powers of BESS and EV, respectively. The DC-bus is connected to the AC-grid through an AFE. P GRID names the power flow between AC-grid and DCMG, the positive sign means power consumption in the DCMG, and the negative sign means power injection into the AC-grid. So, any component pouring energy to the DC bus, which decreases in P GRID , has a negative sign.
The objective of DCMG is minimizing the electricity billing (or maximizing the benefit of the operator) over future time horizon while satisfying constraints of I) BESS SoC low/high limit; II) maximum/minimum power limit of each element in DCMG. It is also required to follow the charging profile of EV. The decision variables for the optimization would be P ESS and P EV that can be positive for charging and negative for discharging cases. The future values of P PV , P WT , and load value of P LOAD are assumed to be provided by proper prediction methods during optimization. The actual values, however, would be different from the predicted ones. We will pursue this problem through the following mathematical formulation.

A. PROBLEM FORMULATION
As shown in FIGURE 1, both the total cumulative power consumption and the peak power must be controlled to minimize the electricity bill. For simplicity, from now on, all power conversion efficiencies and battery charge/discharge efficiencies are ignored; therefore the total instantaneous power P GRID (t) supplied from/to AC-grid is, And (1) also stands for the power balance condition in DC BUS . The relationship between the BESS SoC and BESS power, that is, B SoC and P ESS , can be expressed as, where, E ESS is the maximum amount of energy that battery can hold. B SoC (t) and B SoC (t − 1) are battery SoC at time t and t-1, respectively. T s is time interval for updating the charging/discharging action. Also, the relationship between the EV SoC and EV charger power, that is, B EV and P EV , can be expressed as, where, E EV is the maximum amount of energy that EV battery can hold. B EV (t) and B EV (t − 1) are EV battery SoC at time t and t-1, respectively. There are physical limitations such as power ratings of the system components and battery SoC and that are written as, Also, charging and discharging power is directly related to the momentarily battery SoC levels and the total energy of BESS and EV as, In addition to the simple relationship between the SoC level and the charging power given in (9)(10)(11)(12), the battery charging profile determined by the SoC level is also an essential factor affecting P ESS and P EV . However, the charging profile forms another layer of analytical complexity, at least in this context, and to highlight the advantages of the proposed method, the battery charging profile and the battery roundtrip efficiency are neglected. Likewise, in order to solely emphasize the advantages and the effectiveness of the proposed cost function, it may be better to interpret the interactions among essential MG units such as BESS, PV, and Load only. So, (1) is minimized to (13), In II-E, EV charging feature is introduced to show the extendibility of the proposed method.

B. CONVENTIONAL QP OBJECTIVE FUNCTION
The QP optimization process will find an optimal solution minimizing the objective function J while satisfying all the constraints given. Following is the conventional objective function suggested in [25] and basically [26] have the same form except the quadratic term with a gain of c SoC , (14) where, c GRID (t) can be the electricity tariff for different times of the day and c SoC is a weighting factor that limits the charge / discharge power of the BESS. However, in contrast with the claims of [25], [26], the ESS power dispatching issues in MG using a QP may have more issues when considering the unexpected variation of renewables are appearing. Following is the equality constraints for the BESS SoC level at a specific time (24:00) given in [25], [26], where, B SoC (24 : 00) is the equality constraint at 24:00 and B SoC (0) is the initial constraint that is used for the day before. During the optimization process, decision variables in the objective function will converge to certain optimal values minimizing J numerically. There are inequality constraints that form a possible range of solutions like (4) ∼ (12), but the equality constraint (15) significantly narrows the range of available solutions. Therefore, due to the intermittent nature of DCMG, the solution may be limited or invalidated during optimization.

C. PROPOSED QP OBJECTIVE FUNCTION
Instead, we may be able to avoid using the problematic equality constraints by adopting a simple control structure to manage the SoC of BESS in the objective function.
The proposed SoC tracking objective function J is as follows, where, in this case, c SoC is the weighting factor of the SoC reference tracking performance, B * SoC is the target SoC of the battery.
Here, B * SoC (t), which is an SoC level reference, is newly introduced for a BESS SoC level management. The primary purpose is to include the SoC level term in the cost function without having the equality constraint, and B * SoC (t) can be changed as needed, which is in the case of protecting the battery from overcharging or expecting considerable surplus energy in the future, etc. When the gap between B * SoC (t) and B SoC (t) is large, the QP solver sees it as the increment in cost, and it tries to find the optimal P ESS (t) to reduce the discrepancy so that the battery SoC is managed. Therefore, we can make the QP avoid using a strict equality constraint, which may end up in a failure during optimization. This issue can be easily observed in the following simulation cases in III. VOLUME 8, 2020

D. FORMULATIONS FOR THE QUADRATIC PROGRAMMING
Following is the standard form of the QP used in QP solver [27], where x is the state vector that contains the state variables and the decision variables. The QP solver tries to find x that meets the given constraints in such a way that the objective function is minimized. H and f are the quadraticterm matrices and the first-order vector, respectively. A ieq and b ieq are for the inequality constraint matrix and vector, A eq and b eq are equality constraint matrix and vector, and lb and ub are the lower and upper bounds of the state vector x, respectively as, To optimize the objective function using the QP solver, we need to reconstruct the target function as well as the constraints into standard matrices and vector format. Also, as adopted in [26], the receding horizon method considering the N-step in the future is used to obtain the power dispatch value for the next time step.
Besides that, a more efficient and more straightforward way to describe the objective function by minimizing the size of the state vector is addressed. As a result, the computational burden is significantly reduced, and it is suitable for real-time applications.

1) THE PROPOSED OBJECTIVE FUNCTION
For the given N -sized receding horizon, (13) can be rewritten as, where, . . .
. and (16) can be reorganized in a matrix form as, where, . . .
It is assumed that P L (t) and d N (t) are available at each time step. The equality constraints, the inequality constraints, and upper/lower bound, can be reformed into the vector formats as, where, 1 m×n is a one-valued m × n matrix. In earlier approaches [25], [26], for the QP, the state vector x containing decision variables was defined as, Note that, however, P G (t) can be replaced by P L (t), d N (t) and P N (t) from the relations of (20). And B N (t) in (21) can be rewritten in a matrix form using P N (t) according to [28]. Taking this into account, P N can be the only decision variable, and the remaining state variables of x given in (27) are removed. Finally, the state vector x as well as the corresponding objective function J become, 211928 VOLUME 8, 2020 And the resulting H and f are as, where, LT def Lower and upper bound constraints (lb, ub) can be given simply as, And the other constraints are represented as, where, As a result, reducing the size of the matrix obtained by converting from equations (19) to (29) shortens the run time of the QP optimizer and when simulated with N = 144 for 24 hours and for a total of 2 days, the total optimization time taken is approximately 58% reduced (43.36 sec → 18.11sec) under the QP solver ''quadprog'' in the Optimization Toolbox in MATLAB [27] with the default solver setting on an Intel Core i7-10510U.

2) THE CONVENTIONAL OBJECTIVE FUNCTION
The power balance condition given in (18) does not change with the objective function, and the conventional objective function (14), as well as the strict equality constraints (15), is represented as, The coefficient matrix H and f for the QP becomes, where, 0 m×n is m × n matrix filled with zeros, and

E. EXTENSION TO EV CHARGING
When EV chargers are installed in a DCMG, the power balance equation (13) is extended as, And the respective cost function J in (16) for (13) will include the EV charging term as, where P * EV ,i is the reference charging power for the i th EV and c EV ,i is the weighting factor for prioritizing the charging sequence.
It is assumed that P * EV ,i s are provided by the BMSs of each EVs, which has its own charging profile. Here the EV charging term, P EV ,i would be independent decision variables. The reason is that the intermittent PV power, together with the load in an MG, becomes a priority management target to achieve the desired management goals such as shaving peak power demand or minimizing electricity bills. Then charging vehicles are considered by using surplus power at some moments of a day. In this formulation, we assume that V2G is not allowed.
For the given N -sized time horizon, (37) can be rewritten considering k EV chargers are installed at DCMG as, where, P EV, . . .
, and (38) can be reorganized in a QP matrix form considering multiple EVs VOLUME 8, 2020 using the condition (39) as, For the EV charging, it shares the same formulation done for BESS, PV, and load in (18)(19)(20)(21)(22)(23)(24)(25)(26). The EV parts, which are P * EV,i (t) and P EV,i (t), are introduced in a vector format as (40). Similarly, the maximum charging power for i th EV is bounded as, And the final form of the state vector x considering EV charging as well as the corresponding objective function J become, And the resulting H and f are as shown at the bottom of the next page. Lower and upper bound constraints (lb, ub) can be given simply as, And other inequality constraints are the same as (33).

III. COMPARISONS OF THE PROPOSED AND THE CONVENTIONAL METHODS AND OTHER APPLICATIONS
In this section, comparisons of the conventional equality constraint-based method and the proposed B * SoC tracking based method are performed. The DCMG system parameters are given in TABLE 1. It is assumed that P L (t) and d N (t) i.e., the exact predictions of future load and PV generation are available at each time step. There are a few ways to determine a building's electricity bill in South Korea. If a peak power meter is installed in a building, the annual base rate is calculated by the largest power demand metered in the period of July-September and December-February, including the current month demand. In the United States and Japan, the annual base rate is linked to the largest electricity demand in the past 12 months, including the month at the time of rate calculation (Duke Power, Tokyo Electric Power Company, etc.) [29]. Therefore, one of the important reasons to invest in an ESS in a building can be the peak power suppression to get the minimum electricity bill.

A. THE ROBUSTNESS OF THE PROPOSED METHOD
As shown in FIGURE 2, the proposed method can always keep the maximum power from the grid within 180 kW, whereas the conventional method does not. On the top of each figure in FIGURE 2, there are the letters 'P' and 'F', indicating success and failure of QP result for all receding horizons, respectively. In the analysis, there is a varying load profile obtained from the statistical building load profile in Korea [30]. As long as the solution exists, the maximum power consumed can be suppressed by adjusting P GRID,Max in (33). However, as shown in FIGURE 2 (b), the conventional method cannot provide any optimum solution from the beginning until it reaches the point where it can obtain a feasible solution. There exist ways to find a solution for the ESS dispatch by changing the equality constraint B * SoC . In FIGURE 2(b), the set point for B * SoC at 24:00 is 90%, and if we change the setpoint to a lower value the QP solver may provide a solution. However, how much we decrease is still unknown and can be found by trial and error.
In addition, it is also necessary to take into account the unavoidable disturbances of the load or the PV. To make a fair comparison, P GRID,Max is chosen to 200 kW so that both cases have their own optimum solutions. If a sudden load change occurs, it may not be able to obtain a solution using the conventional method. For example, if there is a change just before the moment when the equality constraint is applied, the QP will never be able to take into account the future changes until it encounters that change. Therefore, if the difference between the estimated load and the actual load begins to appear 4 hours ago, as shown in FIGURE 4 (b),  the recent version of QP implementations [25], [26] cannot give a solution at 24:00, but the proposed method can get a solution for all receding horizon as shown in FIGURE 3. In this case, the impact of QP failure is not very significant, but it means there is a risk when optimization is performed near the equality constraint.

B. ELECTRIC TARIFF COMPARISON
In this section, daily electric tariffs of the proposed and the conventional method are compared. From the hourly electric tariff used in [25] as shown in TABLE 2, daily accumu- (45) VOLUME 8, 2020  lated rates are calculated and indicated in FIGURE 5 and FIGURE 6. The maximum power coming from the grid, P GRID,Max , is set to 200kW so both methods can provide a solution for the given load and PV profile. Both methods shares the same gain for c SoC which is 1/2000. As a result the proposed method can make the electric bill 7 dollars cheaper than the conventional method per day basis. It may mean that there is not much performance difference in finding minimum value of the electric tariff as it is dominated by the hourly rates and can give out reasonable results. One thing to note is that there are differences in ESS SoC rising slope and falling slope. The proposed method charges/discharges ESS battery as long as there is remaining power keeping the P GRID,Max limit, while the conventional method adjust the slope as low as possible.

C. ELECTRIC POWER RESERVE RATE
One very important feature of the MG is the ancillary support capability. Among them, the frequency support [31] that requires active power, which was originally supported by the exclusive synchronous generators connected to the grid. It requires a certain amount of energy to be transferred from or to the grid for a certain period. Then it is important to maintain the SoC level of the ESS to react immediately the ancillary support demands. In that aspect, if the SoC level is retained tightly as a result of the optimization, then it is possible to use the spared energy for the ancillary services. As shown in FIGURE 7 (a), the proposed method can control the deviation between B SoC and B * SoC by adjusting c SoC , but the existing method is independent of gain change as shown in Figure 7 (b).

D. EV Charging Scenario with multiple EVs
Simulation is performed for the EV charging scinario in FIGURE 8. There are three different EVs charging at three different moments of a day. As described in II-E, we assumed that the EV charging power reference P * EV ,i (t) is given by the respective i th BMS of the car. The power dispatching is done while satisfying the DCMG optimization target, which is peak power shaving to 200kW. Each EV's maximum charging power is limited to 50kW, and all cars are connected  with batteries depleted. The charging profile used in this simulation is obtained by the currently available EV charging profile in nowadays EV market. EV #1 is connected around 07:00 and P EV ,1 has reached its maximum power roughly for an hour and decayed to zero after an hour. During that time, there is a margin of P GRID until reaching the 200kW level; EV #1 is charged without delay. However, when P EV ,2 is engaged around 13:00, the load demand is too high even the PV is delivering large portion of the load. As we can see, P EV ,2 is reached its maximum power but decreased quickly, and it is not charging from 15:00∼16:00 even though it's SoC is not reached 100% and charged long time after. This behavior can be explained that the QP prioritizes the DCMG optimization goal than the EV #2 charging request. The last EV, when the load is far below 200kW EV #3, is connected. In that case, P EV ,3 is reached its maximum charging speed as nothing is hindering from charging.

E. PARTICIPATION IN THE ELECTRIC POWER BIDDING MARKETS
The proposed cost function can be a QP canonical form in the aspect of including additional components (such as EVs, ESSs, other VREs, and loads) in MG, having dealt with the futuristic information to decide the best action at that moment. Therefore, this feature can be easily extended to the different timescales of the electricity markets such as the long-term daily market(over one day) and the intraday market, the deviation management market (few hours ahead), and even the regulation service market depending on the resolution and the size of the time horizon [24], [32]. The timely power dispatching requirements for the bidding market can also be satisfied by manipulating QP constraints, and the proposed cost function-based QP can react to meet the momentary goal in the time horizon.

IV. REAL-TIME IMPLEMENTATION ISSUES
The previous sections shows the effectiveness and the robustness of the proposed cost function under the ideal assumption that the exact predictions of future load and PV generation are available at each time step. In this section, we will discuss the impact of wrong predictions of d N (t), which is unavoidable in real time applications. FIGURE 9 depicts a 3D-map of the estimated PV power profile for each time horizon. The x-axis represents the passage of time (time horizon), and the y-axis is the axis for hourly forecasts with the estimation accuracy given in Table 3 [33]. And the z-axis is the amount of PV power generation. The black line pointing in the same direction as the y-axis is forecasted value in the near future order starting from TABLE 3. Hourly forecast accuracies of PV power generation [33].

FIGURE 10.
The comparison between the ideal (assuming that we know the exact future) and the real (estimates based) QP optimization results using the proposed objective function: (a) Ideal (P GRID,Ideal ) and realistic (P GRID,Real ) cases of P GRID ; (b) resulting ideal (B SoC,Ideal ) and realistic (B SoC,Real ) battery SoC of ESS. t 0 and is relocated along with the x-axis to show the difference between the actual and the estimates. Let us assume that we are at time t0 and perform the QP optimization to decide PESS for the next time period. However, due to the PV estimation error, the instantaneous optimal power dispatch may be missed out and the discrepancies affect continuously to the result during the optimization. As shown in FIGURE 10 (a), the mismatch between the measured P PV , P PV ,Actual , and the estimated P PV _EST @X at each time of x results in a deviation between P GRID,Real and P GRID,Ideal . Therefore, as shown in FIGURE 10 (b), the SoC of the BESS drops 10% more than the ideal case, indicating a loss in the electric power reserve rate. In particular, in the ideal case B SoC,Ideal , it increases the SoC valley point by making B SoC higher than the reference value B * SoC = 70% during 11:00 to 16:00, but in the actual situation, this effect is diminished and B SoC utilization is also reduced as in B SoC,Real . Considering that the target SoC level is a factor that determines the minimum value of B SoC , this SoC level issue can be compensated by giving a higher SoC reference and the result is shown in B SoC,NewReal . However,  to run the BESS in an optimal manner for the given objective function, we need to preserve an extra SoC room to charge the surplus energy. The room can be determined by taking into account environmental factors such as season and weather, as well as the prediction accuracy of load and solar power. However, it can be seen that B SoC,Real accurately follows the ideal SoC trajectory when the amount of PV power generation is small, that is, when the ratio of prediction error is small compared to the maximum power of PV as shown in FIGURE 11.
On the contrary, it can be seen from FIGURE 12 that the conventional objective function fails to optimize at the beginning of the optimization, it misses the timely charging action around 05:00 ∼ 08:00 due to the small discrepancy between the actual and the estimates. Therefore, it bring an error between B SoC,Real and B SoC,Ideal throughout the optimization. The red-shaded area means failure to limit the input power due to the optimization failure.

V. CONCLUSION
In this paper, an extended and computationally simplified QP cost function for ESS power dispatch in MG has been suggested. More practical issues, accompanied by its real-time implementation, are addressed and a considerable amount of analysis has shown the proper usage of the equality constraint that may lead to a failure in obtaining successive power dispatch of an ESS. Also, an effective and systematic way to include EVs in QP has been proposed. As a result, it systematically manages the appearance of EVs in the economic operation of ESS power management. And, the smarter way of decreasing the size of the cost function Hessian matrix is suggested and resulted in 58% of computation time reduction by decreasing the matrix size by 1/3. Moreover, practical issues of using forecasts in real-time optimization are addressed. Due to the unavoidable forecast error, the performance degradation of the optimization is inevitable, and a guideline to compensate for this is suggested. Furthermore, the advantage of the proposed cost function exposed to the forecast error is shown and used for emphasizing the robustness of the proposed method.