An Optimal Power and Energy Management by Hybrid Energy Storage Systems in Microgrids

A novel optimal power and energy management (OPEM) for centralized hybrid energy storage systems (HESS) in microgrids is presented in this paper. The proposed OPEM aims at providing multiple grid services by suitably exploiting the different power/energy features of electrochemical batteries (B) and supercapacitors (S). The first part of the paper focuses on the design and analysis of the proposed OPEM, by highlighting the advantages of employing hand-designed solutions based on Pontryagin’s minimum principle rather than resorting to pre-defined optimization tools. Particularly, the B power profile is synthesized optimally over a given time horizon in order to provide both peak shaving and reduced grid energy buffering, while S is employed in order to compensate for short-term forecasting errors and to prevent B from handling sudden and high-frequency power fluctuations. Both the B and S power profiles are computed in real-time in order to benefit from more accurate forecasting, as well as to support each other. Then, the effectiveness of the proposed OPEM is tested through numerical simulations, which have been carried out based on real data from the German island of Borkum. Particularly, an extensive and detailed performance analysis is performed by comparing OPEM with a frequency-based management strategy (FBM) in order to highlight the superior performance achievable by the proposed OPEM in terms of both power and energy management and HESS exploitation.


Introduction
Microgrids (MGs) represent one of the most viable and promising solutions for the power systems of the future because they can provide a number of advantages, such as increased energy and cost savings, as well as improved power quality [1,2].Enhanced MG performances can be achieved by means of advanced management and control strategies, which aim to optimize MG operations from technical and/or economic points of view [3,4].These strategies generally rely on energy storage systems (ESS), which are widely recognized as a key enabling technology for MGs [5][6][7][8].Particularly, high-energy-density ESS are generally employed for providing energy services, such as load levelling, peak shaving, energy arbitrage, back-up services and renewable energy source integration [9,10], whereas high-power-density ESS are the best solutions for providing power services, namely frequency regulation and power quality [11,12].
Several ESS technologies can be considered for grid applications in accordance with the services they are going to provide [13,14].In this regard, hydro and compressed-air ESS are well suited for providing energy services, but they require significant investment costs and environmental impact.Similarly, hydrogen-based ESS can provide energy services successfully and they are also able to release the stored energy in different forms (electrical, thermal, etc.).However, hydrogen-based ESS suffer from high costs, low efficiency and safety issues.Although electrochemical batteries are the most popular ESS in several applications, their use for providing energy and power services is still quite limited.Considering supercapacitors, flywheel and superconducting magnetic ESS, they are very suitable for power services due to their fast dynamic response.However, supercapacitors suffer from very poor energy content, while flywheel and superconducting magnetic ESS are characterized by safety and cost issues respectively.Despite the specific types of ESS, a literature review reveals that a single ESS technology may not be suitable for providing both energy and power services.Consequently, ESS economic viability is still an issue for grid applications, especially due to high investment costs.
In this regard, hybrid energy storage systems (HESS) represent a very promising solution; these consist of suitable combinations of both high energy and high power density ESS and thus, of ESS technologies characterized by complementary features [15][16][17][18][19][20].Consequently, HESS can benefit from the advantages of different ESS technologies, resulting in enhanced performance compared to single ESS.Regarding the high energy density storage unit of the HESS, electrochemical batteries (B), compressed-air or hydrogen-based ESS are generally considered, which are characterized by an adequate energy capacity but relatively slow dynamic performance.It is also possible to make an HESS by combining B with compressed-air or hydrogen-based ESS [16,17]; in these cases, B act as the high power density storage unit due to superior dynamic performances and lower energy density compared to the other ESS.However, the most common high power density storage unit of HESS generally consists of supercapacitors (S), but also of superconducting magnetic and flywheel ESS [18][19][20]; despite their poor energy content, these ESS are characterized by very large and fast power variations.
Among all the possible HESS configurations, the combination of B and S is surely the most popular configuration, and its advantages have been proved both theoretically and experimentally [21][22][23][24].In addition, such an HESS configuration can suit both small-scale and large-scale applications due to its inherent modularity.In this regard, B are more suited than S to provide energy services, such as load levelling and peak shaving, due to their higher energy density; whereas S are characterized by much higher power density than B, revealing them as a suitable choice for providing power services (power quality, short-term forecasting error compensation, etc.).As a result, an HESS can provide multiple grid services, thus achieving economic viability.However, this also requires appropriate power and energy management strategies, which should be developed based on the specific services to be provided and on the inherent HESS features, with the aim of exploiting the two (or more) energy storage units synergistically.
Several strategies for HESS management in MGs have been proposed in the literature .The most popular approach consists of decoupling low-frequency and high-frequency power components [26][27][28][29][30]; these have to be handled by B and S respectively in order to prevent B from coping with high-frequency power fluctuations (frequency-based management, FBM).Therefore, the power split is generally carried out by means of low/high pass filters.Another simple control approach considers pre-set rules that generally prioritize the employment of one ESS, while the other acts as a support unit (rule-based management, RBM) [31][32][33][34][35][36].Such control approaches are intuitive and simple to implement, but may not lead to optimal solutions.In order to increase their performances, both FBM and RBM may be combined with each other and/or with fuzzy logic algorithms in order to take into account HESS operating constraints [37][38][39].However, both FBM and RBM aim mainly at preventing unsuitable B overexploitation rather than providing multiple grid services optimally.This is instead fundamental for enabling HESS competitiveness in MGs, especially from an economic point of view.In this regard, a number of optimal approaches can be employed, which rely on the minimization of an appropriate objective function in order to achieve the desired performances, complying with both HESS and MG operating constraints simultaneously.A literature review reveals that very complex and sophisticated objective functions are generally considered, whose minimization is carried out by different optimal solving techniques [40], such as model predictive control [41][42][43], mixed-integer/linear programming [44,45], nonlinear programming [46,47] and dynamic programming [48,49].Viable alternatives consist of heuristic approaches [50,51], such as genetic algorithms and particle swarm optimization, which guarantee less computational efforts and execution times at the cost of reduced performances (sub-optimal solutions).However, the literature review also points out that much more focus is given to defining objective functions and operating constraints than to designing the optimal solving procedure, which is generally demanded of pre-defined solvers and tools [43][44][45][46][48][49][50][51].
A different management approach is proposed in this paper, which regards a novel hand-designed optimal power and energy management (OPEM) for an HESS made up of B and S. Particularly, an appropriate objective function is defined in order to enable B to provide both peak shaving and reduced grid energy buffering simultaneously, over a given time horizon and in accordance with B energy and power constraints.Unlike many other optimal control approaches proposed in the literature, the optimal solution is achieved analytically by applying the Pontryagin's minimum principle (PMP) [52][53][54][55][56], thus enabling fast and effective real-time implementation.The optimal design procedure also reveals the need for employing a sub-optimal solution in order to prevent B from excessive cycling, without significantly impairing the achievement of the OPEM goals.This would be prevented if pre-defined optimization tools were employed.Regarding the S power profile, it is determined in real-time in order to compensate for sudden power fluctuations and short-term forecasting errors to the maximum extent.The optimal B power profile is also updated in real-time in order to benefit from more accurate forecasting as time passes, as well as for supporting S in terms of charging/discharging needs.As a result, although B and S provide different services, they support themselves in accordance with their inherent features, thus exploiting the HESS configuration synergistically.
The paper is structured as follows: mathematical modelling of both MG and HESS is introduced in Section 2, whereas the design procedure of the proposed OPEM is described in detail in Section 3. Numerical simulation results are provided and discussed extensively in Section 4, which refer to the real case study of the German island of Borkum and include a comparison between the proposed OPEM and an FBM approach.Finally, concluding remarks are reported in Section 6.

Microgrid
An MG is made up of several distributed generators and loads and it is generally connected to the main grid through the point of common coupling (PCC), as shown in Figure 1.This also reveals the presence of a centralized HESS, which is assumed to be connected to the PCC directly.Consequently, the power balance at the PCC can be easily expressed as where g is the power exchanged with the main grid, r is the residual power at the PCC and s denotes the overall power exchanged by the centralized HESS.Particularly, the MG acts as either a load or a generator depending on the sign of r; this accounts for all generation and load contributions through p i and l j , which denote the power delivered by the i-th generator (positive value) and drawn by the j-th load (negative value) respectively.While a positive s value means that the HESS is discharging, otherwise an HESS charging process occurs.
A different management approach is proposed in this paper, which regards a novel handdesigned optimal power and energy management (OPEM) for an HESS made up of B and S. Particularly, an appropriate objective function is defined in order to enable B to provide both peak shaving and reduced grid energy buffering simultaneously, over a given time horizon and in accordance with B energy and power constraints.Unlike many other optimal control approaches proposed in the literature, the optimal solution is achieved analytically by applying the Pontryagin's minimum principle (PMP) [52][53][54][55][56], thus enabling fast and effective real-time implementation.The optimal design procedure also reveals the need for employing a sub-optimal solution in order to prevent B from excessive cycling, without significantly impairing the achievement of the OPEM goals.This would be prevented if pre-defined optimization tools were employed.Regarding the S power profile, it is determined in real-time in order to compensate for sudden power fluctuations and short-term forecasting errors to the maximum extent.The optimal B power profile is also updated in real-time in order to benefit from more accurate forecasting as time passes, as well as for supporting S in terms of charging/discharging needs.As a result, although B and S provide different services, they support themselves in accordance with their inherent features, thus exploiting the HESS configuration synergistically.
The paper is structured as follows: mathematical modelling of both MG and HESS is introduced in Section 2, whereas the design procedure of the proposed OPEM is described in detail in Section 3. Numerical simulation results are provided and discussed extensively in Section 4, which refer to the real case study of the German island of Borkum and include a comparison between the proposed OPEM and an FBM approach.Finally, concluding remarks are reported in Section 6.

Microgrid
An MG is made up of several distributed generators and loads and it is generally connected to the main grid through the point of common coupling (PCC), as shown in Figure 1.This also reveals the presence of a centralized HESS, which is assumed to be connected to the PCC directly.Consequently, the power balance at the PCC can be easily expressed as where g is the power exchanged with the main grid, r is the residual power at the PCC and s denotes the overall power exchanged by the centralized HESS.Particularly, the MG acts as either a load or a generator depending on the sign of r; this accounts for all generation and load contributions through pi and lj, which denote the power delivered by the i-th generator (positive value) and drawn by the jth load (negative value) respectively.While a positive s value means that the HESS is discharging, otherwise an HESS charging process occurs.In conclusion, it is worthy of note that MG network constraints are assumed to be satisfied for any r value, which derives from the historical database of the German island of Borkum.Consequently, since the HESS does not affect power and energy distribution within the MG due to its centralized configuration, the compliance with the MG network constraints is assumed satisfied also for any s value.

Hybrid Energy Storage System
Considering the centralized HESS already shown in Figure 1, it is made up of B and S. Therefore, its overall power and energy can be split as where s B and s S denote the power exchanged by B and S respectively, with e B and e S denoting their corresponding energy levels.These vary in accordance with s B and s S as where η c and η d denote the charging and discharging efficiencies.Hence, the power and energy of both B and S are bounded in accordance with the following constraints: e X,min ≤ e X ≤ e X,max , X ∈ {B, S} in which the upper and lower boundaries depend on the specific energy storage technology, size and operating conditions.

Optimal Power and Energy Management
The optimal power and energy management (OPEM) proposed in this paper aims at providing both energy and power services by exploiting the complementary features of B and S optimally.Consequently, focusing on energy services at first, both peak shaving and reduced grid energy buffering can be achieved simultaneously by minimizing the following objective function: where g denotes the forecasted power flow between the MG and the main grid, which depends on the forecasted residual power ( r) and B power profile ( s B ).While t represents the current time instant and T is a given time horizon, which represents the length of the time window subsequent to t and within which Θ 2 should be minimized.For this purpose, the evolution of s B over T must be synthesized optimally based on the evolution of the residual power forecasted over the same time window ( r).In this regard, it is worth noting that only B is considered for Θ 2 minimization because energy services generally require high energy density ESS, especially when large T is concerned.
In addition, Equation (8) aims at reducing the magnitude of g to the maximum extent, especially when it occurs at high rates.Consequently, it represents a suitable trade-off between peak shaving and reduced grid energy buffering, i.e., the overall energy exchanged between MG and the main grid.
In addition, the minimization of Equation ( 8) leads to an analytical optimal solution, thus enabling Energies 2017, 10, 1909 5 of 21 fast and effective real-time implementation, especially in comparison with more sophisticated and complex objective functions.
The overall control scheme of the proposed OPEM is depicted in Figure 2. The forecasted residual power profile over the given time horizon T is achieved through a forecasting service and updated every t r .Based on r, the proposed OPEM synthesizes s B * , also in accordance with S charging/discharging needs (∆ S ).Particularly, ∆ S is the average power required by S over t ∆ in order to cope with its unsuitable charging status.Consequently, s B * is updated every t B , which is the minimum value between t r and t ∆ .Then, s S * is determined every t S based on the errors between r and r.As a result, energy optimization is achieved by B through Θ 2 minimization, while power management is accomplished by S, which compensates for unpredictable power mismatches.
Energies 2017, 10, 1909 5 of 21 updated every tr.Based on r  , the proposed OPEM synthesizes sB * , also in accordance with S charging/discharging needs (ΔS).Particularly, ΔS is the average power required by S over tΔ in order to cope with its unsuitable charging status.Consequently, sB * is updated every tB, which is the minimum value between tr and tΔ.Then, sS * is determined every tS based on the errors between r̃ and r.As a result, energy optimization is achieved by B through Θ 2 minimization, while power management is accomplished by S, which compensates for unpredictable power mismatches.In conclusion, it is worth noting that the proposed OPEM has been designed in order to be implemented in real-time; this means that both sB * and sS * have to be computed at certain time refresh rates, namely every tB and tS respectively.Consequently, Θ 2 is minimized over a sliding time window because sB * is updated every tB, benefiting from more accurate forecasting and the knowledge of the actual B energy level (eB).The sS * is updated every tS, which should be much smaller than tB in order to enable the compensation for fast power variations and short-term forecasting errors.

Energy Optimization
The minimization of Θ 2 over T can be achieved by applying the Pontryagin's minimum principle (PMP), which allows the achievement of sB * by satisfying both Equation (6) and Equation (7) simultaneously.Particularly, the PMP was chosen for designing the proposed OPEM in order to achieve an analytical solution, thus easing OPEM implementation.In addition, PMP reveals very important information on the genesis of the optimal solution, giving the possibility of choosing suboptimal solutions that better fit with HESS features and/or MG goals.Therefore, the Hamiltonian function is introduced at first as in which λ is the Lagrange multiplier.Therefore, the substitution of Equations ( 5) and (9) into Equation ( 10) yields where: , .
Thus, based on Equation (11), λ is constant and, thus, it can be denoted by Λ in the following.Furthermore, PMP requires that H is minimized towards B s  , leading to In conclusion, it is worth noting that the proposed OPEM has been designed in order to be implemented in real-time; this means that both s B * and s S * have to be computed at certain time refresh rates, namely every t B and t S respectively.Consequently, Θ 2 is minimized over a sliding time window because s B * is updated every t B , benefiting from more accurate forecasting and the knowledge of the actual B energy level (e B ).The s S * is updated every t S , which should be much smaller than t B in order to enable the compensation for fast power variations and short-term forecasting errors.

Energy Optimization
The minimization of Θ 2 over T can be achieved by applying the Pontryagin's minimum principle (PMP), which allows the achievement of s B * by satisfying both Equation ( 6) and Equation (7) simultaneously.Particularly, the PMP was chosen for designing the proposed OPEM in order to achieve an analytical solution, thus easing OPEM implementation.In addition, PMP reveals very important information on the genesis of the optimal solution, giving the possibility of choosing sub-optimal solutions that better fit with HESS features and/or MG goals.Therefore, the Hamiltonian function is introduced at first as Energies 2017, 10, 1909 5 of 21 updated every tr.Based on r  , the proposed OPEM synthesizes sB * , also in accordance with S charging/discharging needs (ΔS).Particularly, ΔS is the average power required by S over tΔ in order to cope with its unsuitable charging status.Consequently, sB * is updated every tB, which is the minimum value between tr and tΔ.Then, sS * is determined every tS based on the errors between r̃ and r.As a result, energy optimization is achieved by B through Θ 2 minimization, while power management is accomplished by S, which compensates for unpredictable power mismatches.In conclusion, it is worth noting that the proposed OPEM has been designed in order to be implemented in real-time; this means that both sB * and sS * have to be computed at certain time refresh rates, namely every tB and tS respectively.Consequently, Θ 2 is minimized over a sliding time window because sB * is updated every tB, benefiting from more accurate forecasting and the knowledge of the actual B energy level (eB).The sS * is updated every tS, which should be much smaller than tB in order to enable the compensation for fast power variations and short-term forecasting errors.

Energy Optimization
The minimization of Θ 2 over T can be achieved by applying the Pontryagin's minimum principle (PMP), which allows the achievement of sB * by satisfying both Equation (6) and Equation (7) simultaneously.Particularly, the PMP was chosen for designing the proposed OPEM in order to achieve an analytical solution, thus easing OPEM implementation.In addition, PMP reveals very important information on the genesis of the optimal solution, giving the possibility of choosing suboptimal solutions that better fit with HESS features and/or MG goals.Therefore, the Hamiltonian function is introduced at first as in which λ is the Lagrange multiplier.Therefore, the substitution of Equations ( 5) and ( 9) into Equation ( 10) yields where: , .
Thus, based on Equation (11), λ is constant and, thus, it can be denoted by Λ in the following.Furthermore, PMP requires that H is minimized towards B s  , leading to 10,1909 updated every tr.Based on r  , the proposed OPEM synthesizes sB * , also in accord charging/discharging needs (ΔS).
Particularly, ΔS is the average power required by S ov to cope with its unsuitable charging status.Consequently, sB * is updated every tB, minimum value between tr and tΔ.Then, sS * is determined every tS based on the errors b r.As a result, energy optimization is achieved by B through Θ 2 minimization, management is accomplished by S, which compensates for unpredictable power mism In conclusion, it is worth noting that the proposed OPEM has been designed i implemented in real-time; this means that both sB * and sS * have to be computed at certai rates, namely every tB and tS respectively.Consequently, Θ 2 is minimized over a sliding because sB * is updated every tB, benefiting from more accurate forecasting and the kno actual B energy level (eB).
The sS * is updated every tS, which should be much smaller th to enable the compensation for fast power variations and short-term forecasting errors

Energy Optimization
The minimization of Θ 2  over T can be achieved by applying the Pontryagin's minim (PMP), which allows the achievement of sB * by satisfying both Equation (6) and simultaneously.Particularly, the PMP was chosen for designing the proposed OPEM achieve an analytical solution, thus easing OPEM implementation.In addition, PMP important information on the genesis of the optimal solution, giving the possibility of c optimal solutions that better fit with HESS features and/or MG goals.Therefore, the function is introduced at first as in which λ is the Lagrange multiplier.Therefore, the substitution of Equations ( 5) Equation ( 10) yields
Thus, based on Equation (11), λ is constant and, thus, it can be denoted by Λ in t Furthermore, PMP requires that H is minimized towards B s  , leading to ∂e B (10) in which λ is the Lagrange multiplier.Therefore, the substitution of Equations ( 5) and (9) into Equation (10) yields Particularly, ΔS is the average power required by S over tΔ in order to cope with its unsuitable charging status.Consequently, sB * is updated every tB, which is the minimum value between tr and tΔ.Then, sS * is determined every tS based on the errors between r̃ and r.As a result, energy optimization is achieved by B through Θ 2 minimization, while power management is accomplished by S, which compensates for unpredictable power mismatches.In conclusion, it is worth noting that the proposed OPEM has been designed in order to be implemented in real-time; this means that both sB * and sS * have to be computed at certain time refresh rates, namely every tB and tS respectively.Consequently, Θ 2 is minimized over a sliding time window because sB * is updated every tB, benefiting from more accurate forecasting and the knowledge of the actual B energy level (eB).
The sS * is updated every tS, which should be much smaller than tB in order to enable the compensation for fast power variations and short-term forecasting errors.

Energy Optimization
The minimization of Θ 2  over T can be achieved by applying the Pontryagin's minimum principle (PMP), which allows the achievement of sB * by satisfying both Equation (6) and Equation (7) simultaneously.Particularly, the PMP was chosen for designing the proposed OPEM in order to achieve an analytical solution, thus easing OPEM implementation.In addition, PMP reveals very important information on the genesis of the optimal solution, giving the possibility of choosing suboptimal solutions that better fit with HESS features and/or MG goals.Therefore, the Hamiltonian function is introduced at first as in which λ is the Lagrange multiplier.Therefore, the substitution of Equations ( 5) and (9) into Equation (10) yields where: , .
Thus, based on Equation (11), λ is constant and, thus, it can be denoted by Λ in the following.Furthermore, PMP requires that H is minimized towards where: Energies 2017, 10, 1909 6 of 21 Thus, based on Equation (11), λ is constant and, thus, it can be denoted by Λ in the following.Furthermore, PMP requires that optimal solutions that better fit with HESS features and/or MG goals.Therefore, the Hamiltonian function is introduced at first as in which λ is the Lagrange multiplier.Therefore, the substitution of Equations ( 5) and ( 9) into Equation ( 10) yields where: , .
Thus, based on Equation (11), λ is constant and, thus, it can be denoted by Λ in the following.Furthermore, PMP requires that H is minimized towards B s  , leading to is minimized towards s B , leading to Finally, the substitution of Equation ( 13) in Equation ( 9) yields Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enabling B to compensate for r completely.However, this would be feasible only if B was largely oversized in terms of both energy and power rates.Particularly, Equation (13) has to be lower or upper bounded in accordance with Equation (6); despite this, it may also lead to an e B evolution that does not comply with Equation (7).Hence, the fulfillment of the B energy constraint must be guaranteed by an appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an alternating sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Particularly, the generic k-th "ON" interval is characterized by the following relationship: in which the operator is defined as follows: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation ( 15), s B,k * can be either positive or negative in accordance with the following constraints: Thus, Equations ( 18) and ( 19) identify the two plane regions Energies 2017, 10, 1909 6 of 21 ( ) Finally, the substitution of Equation ( 13) in Equation ( 9) yields ( ) Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enabling B to compensate for r  completely.However, this would be feasible only if B was largely oversized in terms of both energy and power rates.Particularly, Equation ( 13) has to be lower or upper bounded in accordance with Equation (6); despite this, it may also lead to an eB evolution that does not comply with Equation ( 7).Hence, the fulfillment of the B energy constraint must be guaranteed by an appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an alternating sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Particularly, the generic k-th "ON" interval is characterized by the following relationship: Λ α σ β in which the operator is defined as follows: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation (15), sB,k * can be either positive or negative in accordance with the following constraints: ( ) Thus, Equations ( 18) and ( 19) identify the two plane regions R (+) and R (−) shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+) and R (−) because neither Equation (18) nor Equation ( 19) can be satisfied, as shown in Figure 3a.Consequently, sB,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λk is positive, as detectable in Figure 3b.In this case, R (−) and R (+) are partially overlapped and, thus, both positive and negative sB,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields (+) and Energies 2017, 10, 1909 ( ) Finally, the substitution of Equation ( 13) in Equation ( 9) yields ( ) Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enab compensate for r  completely.However, this would be feasible only if B was largely ov terms of both energy and power rates.Particularly, Equation ( 13) has to be lower or uppe in accordance with Equation (6); despite this, it may also lead to an eB evolution that does n with Equation ( 7).Hence, the fulfillment of the B energy constraint must be guarante appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an a sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Pa the generic k-th "ON" interval is characterized by the following relationship: ( )  Thus, Equations ( 18) and ( 19) identify the two plane regions R (+) and R (−) shown in Fig reveals that different situations occur depending on the sign of Λk, as also pointed out i When Λk is negative, there is no optimal solution outside R (+) and R (−) because neither Equ nor Equation ( 19) can be satisfied, as shown in Figure 3a.Consequently, sB,k * equals zero un outside the two plane regions.Different considerations have to be made when Λk is p detectable in Figure 3b.In this case, R (−) and R (+) are partially overlapped and, thus, both po negative sB,k * may exist simultaneously.Therefore, in order to select the optimal solution, expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields This reveals that different situations occur depending on the sign of Λ k , as also pointed out in Table 1.
When Λ k is negative, there is no optimal solution outside Energies 2017, 10, 1909 6 of 21 ( ) Finally, the substitution of Equation ( 13) in Equation ( 9) yields ( ) Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enabling B to compensate for r  completely.However, this would be feasible only if B was largely oversized in terms of both energy and power rates.Particularly, Equation ( 13) has to be lower or upper bounded in accordance with Equation (6); despite this, it may also lead to an eB evolution that does not comply with Equation ( 7).Hence, the fulfillment of the B energy constraint must be guaranteed by an appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an alternating sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Particularly, the generic k-th "ON" interval is characterized by the following relationship: in which the operator is defined as follows: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation (15), sB,k * can be either positive or negative in accordance with the following constraints: Thus, Equations ( 18) and ( 19) identify the two plane regions R (+) and R (−) shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+) and R (−) because neither Equation ( 18) nor Equation ( 19) can be satisfied, as shown in Figure 3a Thus, the substitution of Equation (20) in Equation ( 11) yields ( ) Finally, the substitution of Equation ( 13) in Equation ( 9) yields ( ) Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enabling B to compensate for r  completely.However, this would be feasible only if B was largely oversized in terms of both energy and power rates.Particularly, Equation ( 13) has to be lower or upper bounded in accordance with Equation (6); despite this, it may also lead to an eB evolution that does not comply with Equation ( 7).Hence, the fulfillment of the B energy constraint must be guaranteed by an appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an alternating sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Particularly, the generic k-th "ON" interval is characterized by the following relationship: in which the operator is defined as follows: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation (15), sB,k * can be either positive or negative in accordance with the following constraints: Thus, Equations ( 18) and ( 19) identify the two plane regions R (+) and R (−) shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+) and R (−) because neither Equation (18) nor Equation ( 19) can be satisfied, as shown in Figure 3a.Consequently, sB,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λk is positive, as detectable in Figure 3b.In this case, R (−) and R (+) are partially overlapped and, thus, both positive and negative sB,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields (−) because neither Equation (18) nor Equation ( 19) can be satisfied, as shown in Figure 3a Finally, the substitution of Equation ( 13) in Equation ( 9) yields ( ) Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enabling B to compensate for r  completely.However, this would be feasible only if B was largely oversized in terms of both energy and power rates.Particularly, Equation ( 13) has to be lower or upper bounded in accordance with Equation (6); despite this, it may also lead to an eB evolution that does not comply with Equation (7).Hence, the fulfillment of the B energy constraint must be guaranteed by an appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an alternating sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Particularly, the generic k-th "ON" interval is characterized by the following relationship: in which the operator is defined as follows: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation (15), sB,k * can be either positive or negative in accordance with the following constraints: ( ) Thus, Equations ( 18) and ( 19) identify the two plane regions R (+) and R (−) shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+) and R (−) because neither Equation (18) nor Equation ( 19) can be satisfied, as shown in Figure 3a.Consequently, s B,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λ k is positive, as detectable in Figure 3b.In this case, R (−) and R (+) are partially overlapped and, thus, both positive and negative s B,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields ( ) Finally, the substitution of Equation ( 13) in Equation ( 9) yields ( ) Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enabling B to compensate for r  completely.However, this would be feasible only if B was largely oversized in terms of both energy and power rates.Particularly, Equation ( 13) has to be lower or upper bounded in accordance with Equation (6); despite this, it may also lead to an eB evolution that does not comply with Equation (7).Hence, the fulfillment of the B energy constraint must be guaranteed by an appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an alternating sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Particularly, the generic k-th "ON" interval is characterized by the following relationship: in which the operator is defined as follows: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation (15), sB,k * can be either positive or negative in accordance with the following constraints: ( ) Thus, Equations ( 18) and ( 19) identify the two plane regions R (+) and R (−) shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+) and R (−) because neither Equation (18) nor Equation ( 19) can be satisfied, as shown in Figure 3a.Consequently, s B,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λ k is positive, as detectable in Figure 3b.In this case, R (−) and R (+) are partially overlapped and, thus, both positive and negative s B,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields (+) are partially overlapped and, thus, both positive and negative s B,k * may exist simultaneously.Therefore, in order to select the optimal solution, r can be expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields Particularly, ΔS is the average power required by S over tΔ in order to cope with its unsuitable charging status.Consequently, sB * is updated every tB, which is the minimum value between tr and tΔ.Then, sS * is determined every tS based on the errors between r̃ and r.As a result, energy optimization is achieved by B through Θ 2 minimization, while power management is accomplished by S, which compensates for unpredictable power mismatches.In conclusion, it is worth noting that the proposed OPEM has been designed in order to be implemented in real-time; this means that both sB * and sS * have to be computed at certain time refresh rates, namely every tB and tS respectively.Consequently, Θ 2 is minimized over a sliding time window because sB * is updated every tB, benefiting from more accurate forecasting and the knowledge of the actual B energy level (eB).
The sS * is updated every tS, which should be much smaller than tB in order to enable the compensation for fast power variations and short-term forecasting errors.

Energy Optimization
The minimization of Θ 2  over T can be achieved by applying the Pontryagin's minimum principle (PMP), which allows the achievement of sB * by satisfying both Equation ( 6) and Equation ( 7) simultaneously.Particularly, the PMP was chosen for designing the proposed OPEM in order to achieve an analytical solution, thus easing OPEM implementation.In addition, PMP reveals very important information on the genesis of the optimal solution, giving the possibility of choosing suboptimal solutions that better fit with HESS features and/or MG goals.Therefore, the Hamiltonian function is introduced at first as in which λ is the Lagrange multiplier.Therefore, the substitution of Equations ( 5) and ( 9) into Equation ( 10) yields where: , .
Thus, based on Equation (11), λ is constant and, thus, it can be denoted by Λ in the following.Furthermore, PMP requires that H is minimized towards s Particularly, ΔS is the average power required by S over tΔ in order to cope with its unsuitable charging status.Consequently, sB * is updated every tB, which is the minimum value between tr and tΔ.Then, sS * is determined every tS based on the errors between r̃ and r.As a result, energy optimization is achieved by B through Θ 2 minimization, while power management is accomplished by S, which compensates for unpredictable power mismatches.In conclusion, it is worth noting that the proposed OPEM has been designed in order to be implemented in real-time; this means that both sB * and sS * have to be computed at certain time refresh rates, namely every tB and tS respectively.Consequently, Θ 2 is minimized over a sliding time window because sB * is updated every tB, benefiting from more accurate forecasting and the knowledge of the actual B energy level (eB).
The sS * is updated every tS, which should be much smaller than tB in order to enable the compensation for fast power variations and short-term forecasting errors.

Energy Optimization
The minimization of Θ 2  over T can be achieved by applying the Pontryagin's minimum principle (PMP), which allows the achievement of sB * by satisfying both Equation ( 6) and Equation ( 7) simultaneously.Particularly, the PMP was chosen for designing the proposed OPEM in order to achieve an analytical solution, thus easing OPEM implementation.In addition, PMP reveals very important information on the genesis of the optimal solution, giving the possibility of choosing suboptimal solutions that better fit with HESS features and/or MG goals.Therefore, the Hamiltonian function is introduced at first as in which λ is the Lagrange multiplier.Therefore, the substitution of Equations ( 5) and ( 9) into Equation ( 10) yields where: , .where: , .
Thus, based on Equation (11), λ is constant and, thus, it can be de Furthermore, PMP requires that H is minimized towards B s  , leading values.The opposite occurs in the top half of the region, i.e., when ξ is lower than 0.5.


Once s B * is determined over any operating condition, the corresponding optimal grid profile (g ̃*opt ) can be achieved by means of Equation ( 9), as depicted in Figure 3. Particularly, when Λ k is negative, B provides suitable energy buffering within R (−) and R (+) , as highlighted in Figure 3a.Whereas this does not occur outside them, because this would increase Θ 2 unsuitably.This phenomenon depends on B charging and discharging efficiencies, i.e., more energy is drawn by B than B delivers back.This is proved by the fact that if both η c,B and η d,B were equal to one, β B would be zero in accordance with Equation (12).Consequently, R (−) and R (+) would span the negative semiplane, meaning that no "dead-zone" would occur further.However, it is worth noting that this phenomenon preserves B from excessive cycling, thus it can be accepted although it slightly affects peak shaving capability.
A seemingly anomalous evolution of g ̃*opt is achieved when Λ k is positive, as highlighted in Figure 3b.Particularly, g ̃*opt overcomes r ̃ when the latter lies below the average threshold of the overlapping region.Consequently, a local increase of Θ 2 occurs, but it is more than compensated by the following Θ 2 reduction.However, although Θ 2 minimization benefits from such an optimal solution, this does not contribute to peak shaving and reduced grid energy buffering purposes, also leading to B overexploitation.Therefore, the following sub-optimal solution is suggested: Λ α σ β in which the operator is defined as follows: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation (15), sB,k * can be either positive or negative in accordance with the following constraints: ( ) ( ) Thus, Equations ( 18) and ( 19) identify the two plane regions R (+) and R (−) shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+) and R (−) because neither Equation (18) nor Equation ( 19) can be satisfied, as shown in Figure 3a.Consequently, s B,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λ k is positive, as detectable in Figure 3b.In this case, R (−) and R (+) are partially overlapped and, thus, both positive and negative s B,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields ( ) ( ) Λ α σ β in which the operator is defined as follows: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: ( ) ( ) Thus, Equations ( 18) and ( 19) identify the two plane regions R (+) and R (−) shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+) and R (−) because neither Equation ( 18) nor Equation ( 19) can be satisfied, as shown in Figure 3a Thus, the substitution of Equation (20) in Equation ( 11) yields ( ) (−) for different r and Λ k values, together with optimal ( g * opt ) and sub-optimal ( g * ) grid profiles achieved assuming that no B power limitation occurs: (a) negative r and Λ k ; (b) positive r and Λ k .
Table 1.Optimal solution in accordance with both Λ k and r.
Once s B * is determined over any operating condition, the corresponding optimal grid profile ( g * opt ) can be achieved by means of Equation ( 9), as depicted in Figure 3. Particularly, when Λ k is negative, B provides suitable energy buffering within ( ) Finally, the substitution of Equation ( 13) in Equation ( 9) yields ( ) Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enabling B to compensate for r  completely.However, this would be feasible only if B was largely oversized in terms of both energy and power rates.Particularly, Equation ( 13) has to be lower or upper bounded in accordance with Equation (6); despite this, it may also lead to an eB evolution that does not comply with Equation (7).Hence, the fulfillment of the B energy constraint must be guaranteed by an appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an alternating sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Particularly, the generic k-th "ON" interval is characterized by the following relationship: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation ( 15), sB,k * can be either positive or negative in accordance with the following constraints: ( ) Thus, Equations ( 18) and ( 19) identify the two plane regions R (+)   and R (−)   shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+)   and R (−)   because neither Equation (18) nor Equation ( 19) can be satisfied, as shown in Figure 3a.Consequently, s B,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λ k is positive, as detectable in Figure 3b.In this case, R (−)   and R (+)   are partially overlapped and, thus, both positive and negative s B,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields (−) and ( ) Finally, the substitution of Equation ( 13) in Equation ( 9) yields ( ) Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enabling B to compensate for r  completely.However, this would be feasible only if B was largely oversized in terms of both energy and power rates.Particularly, Equation ( 13) has to be lower or upper bounded in accordance with Equation (6); despite this, it may also lead to an eB evolution that does not comply with Equation (7).Hence, the fulfillment of the B energy constraint must be guaranteed by an appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an alternating sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Particularly, the generic k-th "ON" interval is characterized by the following relationship: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation ( 15), sB,k * can be either positive or negative in accordance with the following constraints: ( ) Thus, Equations ( 18) and ( 19) identify the two plane regions R (+)   and R (−)   shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+)   and R (−)   because neither Equation (18) nor Equation ( 19) can be satisfied, as shown in Figure 3a.Consequently, s B,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λ k is positive, as detectable in Figure 3b.In this case, R (−)   and R (+)   are partially overlapped and, thus, both positive and negative s B,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields (+) , as highlighted in Figure 3a.Whereas this does not occur outside them, because this would increase Θ 2 unsuitably.This phenomenon depends on B charging and discharging efficiencies, i.e., more energy is drawn by B than B delivers back.This is proved by the fact that if both η c,B and η d,B were equal to one, β B would be zero in accordance with Equation (12).Consequently, Finally, the substitution of Equation ( 13) in Equation ( 9) yields ( ) Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enabling B to compensate for r  completely.However, this would be feasible only if B was largely oversized in terms of both energy and power rates.Particularly, Equation ( 13) has to be lower or upper bounded in accordance with Equation (6); despite this, it may also lead to an eB evolution that does not comply with Equation (7).Hence, the fulfillment of the B energy constraint must be guaranteed by an appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an alternating sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Particularly, the generic k-th "ON" interval is characterized by the following relationship: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation (15), sB,k * can be either positive or negative in accordance with the following constraints: ( ) Thus, Equations ( 18) and ( 19) identify the two plane regions R (+)   and R (−)   shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+)   and R (−)   because neither Equation (18) nor Equation ( 19) can be satisfied, as shown in Figure 3a.Consequently, s B,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λ k is positive, as detectable in Figure 3b.In this case, R (−)   and R (+)   are partially overlapped and, thus, both positive and negative s B,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields Finally, the substitution of Equation ( 13) in Equation ( 9) yields ( ) Based on Equation ( 14), it can be stated that Λ should be set to zero, thus enabling B to compensate for r  completely.However, this would be feasible only if B was largely oversized in terms of both energy and power rates.Particularly, Equation ( 13) has to be lower or upper bounded in accordance with Equation (6); despite this, it may also lead to an eB evolution that does not comply with Equation ( 7).Hence, the fulfillment of the B energy constraint must be guaranteed by an appropriate choice of Λ.
Based on the previous considerations, the overall time horizon T can be split into an alternating sequence of "ON" and "OFF" time intervals, Λ being thus piecewise constant over T [52].Particularly, the generic k-th "ON" interval is characterized by the following relationship: in which the operator is defined as follows: Whereas over the generic h-th "OFF" interval, the following constraints must be satisfied: Furthermore, referring to Equation (15), sB,k * can be either positive or negative in accordance with the following constraints: ( ) Thus, Equations ( 18) and ( 19) identify the two plane regions R (+)   and R (−)   shown in Figure 3.This reveals that different situations occur depending on the sign of Λk, as also pointed out in Table 1.When Λk is negative, there is no optimal solution outside R (+)   and R (−)   because neither Equation (18) nor Equation ( 19) can be satisfied, as shown in Figure 3a.Consequently, s B,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λ k is positive, as detectable in Figure 3b.In this case, R (−)   and R (+)   are partially overlapped and, thus, both positive and negative s B,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as Thus, the substitution of Equation (20) in Equation ( 11) yields (+) would span the negative semi-plane, meaning that no "dead-zone" would occur further.However, it is worth noting that this phenomenon preserves B from excessive cycling, thus it can be accepted although it slightly affects peak shaving capability.
A seemingly anomalous evolution of g * opt is achieved when Λ k is positive, as highlighted in Figure 3b.Particularly, g * opt overcomes r when the latter lies below the average threshold of the overlapping region.Consequently, a local increase of Θ 2 occurs, but it is more than compensated by the following Θ 2 reduction.However, although Θ 2 minimization benefits from such an optimal solution, this does not contribute to peak shaving and reduced grid energy buffering purposes, also leading to B overexploitation.Therefore, the following sub-optimal solution is suggested: Energies 2017, 10, 1909 8 of 21 As a result, a sub-optimal grid power profile is achieved ( g * ), as shown in Figure 3b.This slightly impairs Θ 2 minimization over T, but peak shaving, reduced grid energy buffering and B cycling are preserved successfully.

Power Management
The minimization of Θ 2 leads to the following result: However, Equation ( 23) relies on r, which does not generally match the corresponding actual profile due to unavoidable forecasting errors and unpredictable power fluctuations.Consequently, in order to compensate for these, Equation ( 1) can be subtracted from Equation ( 23), leading to: Therefore, substituting Equation (3) into Equation ( 24) and assuming s B equal to s B * , the following result is achieved: where δ r and δ g denote the power mismatches occurring on r and g respectively: Hence, based on Equation ( 25), S can compensate for δ r until it does not imply violating Equation ( 6) and Equation ( 7), leading to: When S reaches either e S,min or e S,max , no power compensation can be provided further.Therefore, r can be updated every t ∆ by accounting not only for more accurate forecasting but also for S charging/discharging needs.The latter can be denoted by ∆ S , i.e., the average power that S has to deliver or draw from B over a given time horizon (t ∆ ) in order to restore a suitable energy threshold (e S * ): In this regard, it is worth noting that ∆ S can be assumed to be incorporated into r in order to preserve the validity of Equation ( 9) and, thus, of all the subsequent equations.
In conclusion, it is also worthy of note that although B and S provide different services, they also support themselves to each other: S compensates for forecasting errors and power fluctuations, thus preventing B from sudden and frequent power variations.On the other hand, B is responsible for S energy reinstatement in accordance with ∆ S , thus ensuring its continuous operation.

Simulation Setup
The proposed OPEM has been tested by a simulation study, which was carried out in the Matlab environment by referring to the island of Borkum.It is a German island located in the North Sea (30.7 km 2 , 5181 inhabitants), characterized by both conventional and renewable energy source (RES) power plants, i.e., Combined Heat and Power (CHP), wind and photovoltaic.The overall installed power is about 6.8 MW on both medium and low voltage distribution systems, as pointed out in Table 2.In addition, the PCC consists of four submarine cables that enable a bidirectional power flow with the mainland.The simulations refer to the residual power profile at the PCC, which was achieved Energies 2017, 10, 1909 9 of 21 based on historical database (@2014).Regarding the HESS, it consists of an active configuration that allows B and S to be managed independently, their main specifications being summarized in Table 3.
Apart from the proposed OPEM, the employment of an FBM approach is also considered for comparison purposes, whose overall block control scheme is depicted in Figure 4.The low-frequency content of the residual power profile (r LF ) is determined by an appropriate digital low-pass filter, whose transfer function deprived from magnitude ripple is shown in Figure 5a.The B power profile is thus determined in accordance with its power and energy constraints, as pointed out in Table 4.In this regard, r avg denotes the averaged power foreseen within the given time horizon T, which is determined by taking into account B charging and discharging efficiencies as Particularly, r avg represents the average power exchanged between the MG and the main grid if full peak shaving is accomplished, as highlighted in Figure 5b.This power threshold is updated every t r in order to make the comparison between OPEM and FBM consistent.While the S power profile is computed in accordance with the high-frequency content of the residual power profile (r − r LF ), as still pointed out in Table 4.

OPEM Testing
The simulations focused on the OPEM performances at first and, especially, on energy optimization, and the corresponding results over three generic days and at T = 24 h are reported in Figures 6-8.Particularly, Figure 6 shows that the residual and grid power profiles differ from each other over each day.This is due to the optimal B management carried out by the proposed OPEM, which reduces both peak generation and load occurring on g compared to r, leading to a smoother g profile as well.It is also possible to note that some differences occur between the actual profiles (g, s B and e B ) and those forecasted at the start of each day ( g, s B and e B ), especially at the end of the time horizon.Particularly, focusing on the first two days, B is foreseen to be fully discharged at the end of each day in order to minimize the objective function within the given time horizon (24 h).As time passes, such discharging actions are postponed appropriately to the first hours of the following days in order to cope with more significant peak load demands, as well shown in Figure 6.This reveals the effectiveness of the proposed OPEM, which adapts the B profile appropriately in accordance with more accurate forecasting and over a sliding time horizon.In addition, the e B value at the end of each day is adapted every t B in order to match MG optimization needs of the following day.This does not generally occur in most of the management strategies proposed in the literature, which can only assure piecewise optimization.

OPEM Testing
The simulations focused on the OPEM performances at first and, especially, on energy optimization, and the corresponding results over three generic days and at T = 24 h are reported in Figures 6-8.Particularly, Figure 6 shows that the residual and grid power profiles differ from each other over each day.This is due to the optimal B management carried out by the proposed OPEM, which reduces both peak generation and load occurring on g compared to r, leading to a smoother g profile as well.It is also possible to note that some differences occur between the actual profiles (g, s B and e B ) and those forecasted at the start of each day (g , s B and ẽ B ), especially at the end of the time horizon.Particularly, focusing on the first two days, B is foreseen to be fully discharged at the end of each day in order to minimize the objective function within the given time horizon (24 h).As time passes, such discharging actions are postponed appropriately to the first hours of the following days in order to cope with more significant peak load demands, as well shown in Figure 6.This reveals the effectiveness of the proposed OPEM, which adapts the B profile appropriately in accordance with more accurate forecasting and over a sliding time horizon.In addition, the e B value at the end of each day is adapted every t B in order to match MG optimization needs of the following day.This does not generally occur in most of the management strategies proposed in the literature, which can only assure piecewise optimization.Referring now to power management, Figures 9-11 reveal the very good performances achieved by S in compensating for power fluctuations and forecasting errors.However, some uncompensated power fluctuations still occur when S is fully charged or discharged, as detectable by comparing Figure 9 with Figure 11.These fluctuations could be suppressed by decreasing t Δ , thus preventing S from reaching its maximum and minimum energy boundaries.However, such a t Δ reduction would

OPEM Testing
The simulations focused on the OPEM performances at first and, especially, on energy optimization, and the corresponding results over three generic days and at T = 24 h are reported in Figures 6-8.Particularly, Figure 6 shows that the residual and grid power profiles differ from each other over each day.This is due to the optimal B management carried out by the proposed OPEM, which reduces both peak generation and load occurring on g compared to r, leading to a smoother g profile as well.It is also possible to note that some differences occur between the actual profiles (g, s B and e B ) and those forecasted at the start of each day (g , s B and ẽ B ), especially at the end of the time horizon.Particularly, focusing on the first two days, B is foreseen to be fully discharged at the end of each day in order to minimize the objective function within the given time horizon (24 h).As time passes, such discharging actions are postponed appropriately to the first hours of the following days in order to cope with more significant peak load demands, as well shown in Figure 6.This reveals the effectiveness of the proposed OPEM, which adapts the B profile appropriately in accordance with more accurate forecasting and over a sliding time horizon.In addition, the e B value at the end of each day is adapted every t B in order to match MG optimization needs of the following day.This does not generally occur in most of the management strategies proposed in the literature, which can only assure piecewise optimization.Referring now to power management, Figures 9-11 reveal the very good performances achieved by S in compensating for power fluctuations and forecasting errors.However, some uncompensated power fluctuations still occur when S is fully charged or discharged, as detectable by comparing Figure 9 with Figure 11.These fluctuations could be suppressed by decreasing t Δ , thus preventing S from reaching its maximum and minimum energy boundaries.However, such a t Δ reduction would

OPEM Testing
The simulations focused on the OPEM performances at first and, especially, on energy optimization, and the corresponding results over three generic days and at T = 24 h are reported in Figures 6-8.Particularly, Figure 6 shows that the residual and grid power profiles differ from each other over each day.This is due to the optimal B management carried out by the proposed OPEM, which reduces both peak generation and load occurring on g compared to r, leading to a smoother g profile as well.It is also possible to note that some differences occur between the actual profiles (g, s B and e B ) and those forecasted at the start of each day (g , s B and ẽ B ), especially at the end of the time horizon.Particularly, focusing on the first two days, B is foreseen to be fully discharged at the end of each day in order to minimize the objective function within the given time horizon (24 h).As time passes, such discharging actions are postponed appropriately to the first hours of the following days in order to cope with more significant peak load demands, as well shown in Figure 6.This reveals the effectiveness of the proposed OPEM, which adapts the B profile appropriately in accordance with more accurate forecasting and over a sliding time horizon.In addition, the e B value at the end of each day is adapted every t B in order to match MG optimization needs of the following day.This does not generally occur in most of the management strategies proposed in the literature, which can only assure piecewise optimization.Referring now to power management, Figures 9-11 reveal the very good performances achieved by S in compensating for power fluctuations and forecasting errors.However, some uncompensated power fluctuations still occur when S is fully charged or discharged, as detectable by comparing Figure 9 with Figure 11.These fluctuations could be suppressed by decreasing t Δ , thus preventing S from reaching its maximum and minimum energy boundaries.However, such a t Δ reduction would Referring now to power management, Figures 9-11 reveal the very good performances achieved by S in compensating for power fluctuations and forecasting errors.However, some uncompensated power fluctuations still occur when S is fully charged or discharged, as detectable by comparing Figure 9 with Figure 11.These fluctuations could be suppressed by decreasing t ∆ , thus preventing S from reaching its maximum and minimum energy boundaries.However, such a t ∆ reduction would reduce t B and increase both the magnitude and frequency of ∆ S , which may lead to an unsuitable B overexploitation.Regarding the values of the objective function, these are reported in Table 6, together with those achieved by employing the optimal solution provided in Table 1 (OPEMopt).It is worthy of note that OPEMopt leads to almost the same Θ 2 values achieved by the proposed OPEM, with only differences of the order of 10 −4 occurring.
An energy analysis was performed in order to evaluate the effectiveness of the proposed OPEM also in terms of the reduced power flow between the MG and the main grid.Particularly, the generation and load contributions are computed separately as The corresponding results are summarized in Table 7. Considering the MG acting as a generator or a load separately, it can be noticed that both OPEM and OPEMopt reduce the energy exchange over each day and their corresponding results are quite similar to each other.However, the generation decreases more than the load, and consequently the net energy exchange between the MG and the    Regarding the values of the objective function, these are reported in Table 6, together with those achieved by employing the optimal solution provided in Table 1 (OPEMopt).It is worthy of note that OPEMopt leads to almost the same Θ 2 values achieved by the proposed OPEM, with only differences of the order of 10 −4 occurring.
An energy analysis was performed in order to evaluate the effectiveness of the proposed OPEM also in terms of the reduced power flow between the MG and the main grid.Particularly, the generation and load contributions are computed separately as The corresponding results are summarized in Table 7. Considering the MG acting as a generator or a load separately, it can be noticed that both OPEM and OPEMopt reduce the energy exchange over each day and their corresponding results are quite similar to each other.However, the generation    Regarding the values of the objective function, these are reported in Table 6, together with those achieved by employing the optimal solution provided in Table 1 (OPEMopt).It is worthy of note that OPEMopt leads to almost the same Θ 2 values achieved by the proposed OPEM, with only differences of the order of 10 −4 occurring.
An energy analysis was performed in order to evaluate the effectiveness of the proposed OPEM also in terms of the reduced power flow between the MG and the main grid.Particularly, the generation and load contributions are computed separately as The corresponding results are summarized in Table 7. Considering the MG acting as a generator or a load separately, it can be noticed that both OPEM and OPEMopt reduce the energy exchange over each day and their corresponding results are quite similar to each other.However, the generation Regarding the values of the objective function, these are reported in Table 6, together with those achieved by employing the optimal solution provided in Table 1 (OPEM opt ).It is worthy of note that OPEM opt leads to almost the same Θ 2 values achieved by the proposed OPEM, with only differences of the order of 10 −4 occurring.
An energy analysis was performed in order to evaluate the effectiveness of the proposed OPEM also in terms of the reduced power flow between the MG and the main grid.Particularly, the generation and load contributions are computed separately as e load (t) = The corresponding results are summarized in Table 7. Considering the MG acting as a generator or a load separately, it can be noticed that both OPEM and OPEM opt reduce the energy exchange over each day and their corresponding results are quite similar to each other.However, the generation decreases more than the load, and consequently the net energy exchange between the MG and the main grid increases compared to the case of no HESS.This was expected due to the additional losses of the HESS charging/discharging processes.However, this drawback is counterbalanced by a more significant reduction in terms of gross energy exchange, revealing reduced energy buffering provided by the main grid.
In conclusion, the HESS performance is summed up in Table 8, which accounts for the B and S cycling performances separately, namely the number of full charging/discharging cycles per day.It can be seen that B is characterized by about two charging-discharging cycles per day, whereas a greater number of S cycles per day occurs, as expected.Furthermore, the comparison between OPEM and OPEM opt highlights the increased B cycling and reduced S exploitation achieved by the latter.This reveals that the sub-optimal solution defined by Equation ( 22) is very suitable for preventing B overexploitation and peak shaving issues because the increase of Θ 2 is rather negligible, as already pointed out in Table 6.It is also worthy of note that the proposed OPEM accounts inherently for different B and S cycling capabilities by differentiating the services they have to provide, thus achieving optimal HESS exploitation.

OPEM vs. FBM
The comparison between OPEM and FBM was carried out over a generic week with different time horizons, whose corresponding results are depicted in Figures 12-23.Particularly, since S performance is almost unaffected by different values of the time horizon for both OPEM and FBM, only the evolutions achieved in the case T = 24 h are reported.Focusing on the g profile achieved by the proposed OPEM (Figure 12), it can be seen that power peaks are reduced compared to r, with a suitable smoothing occurring as well.Furthermore, focusing on both Figures 13 and 14, B performance is slightly affected by the variation of the time horizon, with significant differences only occurring in the case T = 3 h.This is justified by the fact that the proposed OPEM splits the given time horizon in a series of "ON" and "OFF" sub-intervals, whose length depends on the r shape and on the B energy and power rates.Consequently, as far as T hosts a number of these sub-intervals, its variation does not affect the real-time energy optimization carried out by OPEM.This is also corroborated by the values of the objective function reported in Table 9.However, it is worth noting that the worst performance is achieved in the case T = 3 h; this means that if further reductions of T occur, a further worsening of OPEM performances should be expected, because only local optimization would be achieved.Regarding S power services, Figure 15   Simulation results achieved by employing FBM in the same scenario are reported in Figures 18-23.They reveal limited differences between the r and g profiles, because B is idle at its maximum or minimum energy boundary for most of the time when large time horizons are considered.This is due to the un-optimized management of B power and energy constraints, leading to poor performance in terms of both peak shaving and reduced grid energy buffering.Since the reduction of T affects r avg significantly, better performances are achieved with relatively short time horizons, as pointed out in Table 9.However, it is worth noting that FBM energy management is always worse than that achieved by the proposed OPEM, regardless of the time horizon, thus revealing the effectiveness of the latter, whereas very good performances are achieved by S in compensating for the high-frequency power fluctuations occurring on r, as indicated in Figure 21.Furthermore, Figure 23 reveals that as S never reaches its maximum or minimum energy thresholds, it is thus able to provide this power service continuously over the given time horizon.In this regard, it is worthy of note that the weaker S performances achieved by OPEM is due mainly to the additional service it provides, that is, S compensates not only for sudden power fluctuations but also for short term forecasting errors.
variation does not affect the real-time energy optimization carried out by OPEM.This is also corroborated by the values of the objective function reported in Table 9.However, it is worth noting that the worst performance is achieved in the case T = 3 h; this means that if further reductions of T occur, a further worsening of OPEM performances should be expected, because only local optimization would be achieved.Regarding S power services, Figure 15       the B energy and power rates.Consequently, as far as T hosts a number of these sub-intervals, its variation does not affect the real-time energy optimization carried out by OPEM.This is also corroborated by the values of the objective function reported in Table 9.However, it is worth noting that the worst performance is achieved in the case T = 3 h; this means that if further reductions of T occur, a further worsening of OPEM performances should be expected, because only local optimization would be achieved.Regarding S power services, Figure 15       the B energy and power rates.Consequently, as far as T hosts a number of these sub-intervals, its variation does not affect the real-time energy optimization carried out by OPEM.This is also corroborated by the values of the objective function reported in Table 9.However, it is worth noting that the worst performance is achieved in the case T = 3 h; this means that if further reductions of T occur, a further worsening of OPEM performances should be expected, because only local optimization would be achieved.Regarding S power services, Figure 15       horizon in a series of "ON" and "OFF" sub-intervals, whose length depends on the r shape and on the B energy and power rates.Consequently, as far as T hosts a number of these sub-intervals, its variation does not affect the real-time energy optimization carried out by OPEM.This is also corroborated by the values of the objective function reported in Table 9.However, it is worth noting that the worst performance is achieved in the case T = 3 h; this means that if further reductions of T occur, a further worsening of OPEM performances should be expected, because only local optimization would be achieved.Regarding S power services, Figure 15                                          The weekly performances achieved by both OPEM and FBM in the case T = 12 h are summed up by the Pareto diagrams shown in Figure 24.Particularly, poor peak generation and load reduction is achieved by FBM due to the un-optimized management approach, which prevents B from being fully charged/discharged when needed.Much better results are achieved by the proposed OPEM, by means of which significant peak power reductions are achieved when the MG acts as either a generator or a load, as also pointed out in Table 10.In addition, the g profile achieved by OPEM is quite below the corresponding r profile; this means that the excess MG energy production is stored by the HESS and later employed for supplying the MG loads, leading to increased MG self-consumption.This occurs much less frequently when employing the FBM, which presents peak shaving capabilities similar to OPEM only when very short time horizons are considered.
An energy analysis was also performed in order to compare the proposed OPEM to FBM in terms of reduced power flow and/or energy saving.The corresponding results are reported in Table 11.This reveals that OPEM energy performances are slightly affected by the variation of the time horizon; this is justified by the fact that the reduction of the time horizon does not prevent B from reducing grid energy buffering, but only from detecting the load/generation peak suitably in advance.FBM energy performances improve with the reduction of the time horizon, but are always worse than those achieved by the proposed OPEM.It is worth noting that both OPEM and FBM reduce e net and e gross compared to the case of no HESS; although the reduction of a positive e net value implies additional losses, a more significant reduction of e gross is achieved, especially by OPEM, thus corroborating the effectiveness of the proposed management approach.
In conclusion, the HESS cycling performances are summed up in Table 12.This shows that the B and S cycling performances achieved by OPEM are almost unaffected by the variation of the time horizon, as expected; only slight differences occur in B cycling, as foreseen due to the energy analysis previously carried out.In contrast, the B cycling performances achieved by FBM are strictly related to the time horizon, that is, B cycles increase as T decreases; whereas S cycling is totally unaffected by T variations for both OPEM and FBM, as pointed out at the start of this subsection.The comparison between OPEM and FBM reveals an increased S exploitation achieved by the former, which is due mainly to the additional power service it provides (forecasting error compensation).
reducing grid energy buffering, but only from detecting the load/generation peak suitably in advance.FBM energy performances improve with the reduction of the time horizon, but are always worse than those achieved by the proposed OPEM.It is worth noting that both OPEM and FBM reduce e net and e gross compared to the case of no HESS; although the reduction of a positive e net value implies additional losses, a more significant reduction of e gross is achieved, especially by OPEM, thus corroborating the effectiveness of the proposed management approach.
In conclusion, the HESS cycling performances are summed up in Table 12.This shows that the B and S cycling performances achieved by OPEM are almost unaffected by the variation of the time horizon, as expected; only slight differences occur in B cycling, as foreseen due to the energy analysis previously carried out.In contrast, the B cycling performances achieved by FBM are strictly related to the time horizon, that is, B cycles increase as T decreases; whereas S cycling is totally unaffected by T variations for both OPEM and FBM, as pointed out at the start of this subsection.The comparison between OPEM and FBM reveals an increased S exploitation achieved by the former, which is due mainly to the additional power service it provides (forecasting error compensation).

Conclusions
The design of an optimal power and energy management (OPEM) for hybrid energy storage systems (HESS) in microgrids has been presented in this paper.The proposed OPEM enables a suitable and synergic exploitation of electrochemical batteries (B) and supercapacitors (S), thus providing multiple grid services simultaneously and optimally.Particularly, both peak shaving and reduced grid buffering are achieved through B, while S compensates for power fluctuations and forecasting errors.Numerical simulations carried out based on the real data of the German island of Borkum, highlighting very good peak shaving and reduced grid energy buffering capabilities achieved by OPEM, as proved by the decrease of the gross energy exchanged with the main grid.Furthermore, a comparison between OPEM and a conventional frequency-based management approach (FBM) shows the superior performances achieved by the former, even when employing relative short time horizons.Based on the proposed OPEM, optimal HESS sizing may be achieved by imposing specific targets, such as a desired peak shaving capability and/or averaged forecasting error compensation.These goals may Energies 2017, 10,1909 19 of 21 also require accurate tuning of OPEM time intervals, especially regarding the S charging reinstatement.All these aspects will be addressed in future work.

Figure 1 .
Figure 1.Schematic representation of an MG.

Figure 1 .
Figure 1.Schematic representation of an MG.

Figure 2 .
Figure 2. The overall block control scheme of the proposed OPEM.

Figure 2 .
Figure 2. The overall block control scheme of the proposed OPEM.

Figure 2 .
Figure 2. The overall block control scheme of the proposed OPEM.

Figure 2 .
Figure 2. The overall block control scheme of the proposed OPEM.

Figure 2 .
Figure 2. The overall block control scheme of the proposed OPEM.
h = e B,min or e B,max .
Whereas over the generic h-th "OFF" interval, the following constraints must be satis 0 to Equation (15), sB,k * can be either positive or negative in accord the following constraints: . Consequently, s B,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λ k is positive, as detectable in Figure 3b.In this case, R (−) and R (+) are partially overlapped and, thus, both positive and negative s B,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as

Figure 2 .
Figure 2. The overall block control scheme of the proposed OPEM.

Figure 2 .
Figure 2. The overall block control scheme of the proposed OPEM.
(21) states that positive s B,k * values prevail against negative ones in the bottom half of the overlapping region because the former determines lower optimal solutions that better fit with HESS features and/or MG goals.function is introduced at first as which λ is the Lagrange multiplier.Therefore, the substitution of Equation (

Figure 3 .
(21) states that positive s B,k * values prevail against negative ones in the bottom half of the overlapping region because the former determines lower H values.The opposite occurs in the top half of the region, i.e., when ξ is lower than 0.5.The two plane regions R (+) and R (−) for different r  and Λk values, together with optimal (g ̃*opt) and sub-optimal (g ̃*) grid profiles achieved assuming that no B power limitation occurs: (a) negative r  and Λk; (b) positive r  and Λk.

Figure 3 .
Figure 3.The two plane regions to Equation(15), sB,k * can be either positive or negative in accordance with the following constraints: . Consequently, s B,k * equals zero until r  lies outside the two plane regions.Different considerations have to be made when Λ k is positive, as detectable in Figure 3b.In this case, R (−) and R (+) are partially overlapped and, thus, both positive and negative s B,k * may exist simultaneously.Therefore, in order to select the optimal solution, r  can be expressed as max s S,min i f e S,min < e S < e S,max 0 i f e S = e S,min or e S = e S,max .
e S,max e S,min < e S < e S,max e S = e S,min s S * 0 s S = (−r + r LF ) s S,max s S,min 0

Figure 6 .
Figure 6.Residual and grid power profiles achieved by OPEM over three days: r ̃ and g ̃ (dark orange and orange, forecast at the start of each day), r (dark blue) and g (cyan).

Figure 7 .
Figure 7.The B power profiles achieved by OPEM over three days: s B (orange, forecast at the start of each day) and sB (red, actual evolution).

Figure 8 .
Figure 8.The B energy evolution achieved by OPEM over three days: ẽB (orange, forecast at the start of each day) and eB (green, actual evolution).

Figure 6 .
Figure 6.Residual and grid power profiles achieved by OPEM over three days: r and g (dark orange and orange, forecast at the start of each day), r (dark blue) and g (cyan).

Figure 6 .
Figure 6.Residual and grid power profiles achieved by OPEM over three days: r ̃ and g ̃ (dark orange and orange, forecast at the start of each day), r (dark blue) and g (cyan).

Figure 7 .
Figure 7.The B power profiles achieved by OPEM over three days: s B (orange, forecast at the start of each day) and sB (red, actual evolution).

Figure 8 .
Figure 8.The B energy evolution achieved by OPEM over three days: ẽB (orange, forecast at the start of each day) and eB (green, actual evolution).

Figure 7 .
Figure 7.The B power profiles achieved by OPEM over three days: s B (orange, forecast at the start of each day) and s B (red, actual evolution).

Figure 6 .
Figure 6.Residual and grid power profiles achieved by OPEM over three days: r ̃ and g ̃ (dark orange and orange, forecast at the start of each day), r (dark blue) and g (cyan).

Figure 7 .
Figure 7.The B power profiles achieved by OPEM over three days: s B (orange, forecast at the start of each day) and sB (red, actual evolution).

Figure 8 .
Figure 8.The B energy evolution achieved by OPEM over three days: ẽB (orange, forecast at the start of each day) and eB (green, actual evolution).

Figure 8 .
Figure 8.The B energy evolution achieved by OPEM over three days: e B (orange, forecast at the start of each day) and e B (green, actual evolution).

Energies 2017 ,
10, 1909 12 of 21reduce t B and increase both the magnitude and frequency of Δ S , which may lead to an unsuitable B overexploitation.

Figure 9 .
Figure 9. Power fluctuations and forecasting errors on residual power (δr, light purple) and grid power (δg, blue) achieved by employing the proposed OPEM over three days, together with the S power demand (ΔS, magenta).

Figure 10 .
Figure 10.The S power profiles achieved by OPEM over three days.

Figure 11 .
Figure 11.The S energy evolution achieved by the proposed OPEM over three days.

Figure 9 .
Figure 9. Power fluctuations and forecasting errors on residual power (δ r , light purple) and grid power (δ g , blue) achieved by employing the proposed OPEM over three days, together with the S power demand (∆ S , magenta).

Figure 9 .
Figure 9. Power fluctuations and forecasting errors on residual power (δr, light purple) and grid power (δg, blue) achieved by employing the proposed OPEM over three days, together with the S power demand (ΔS, magenta).

Figure 10 .
Figure 10.The S power profiles achieved by OPEM over three days.

Figure 11 .
Figure 11.The S energy evolution achieved by the proposed OPEM over three days.

Figure 10 .
Figure 10.The S power profiles achieved by OPEM over three days.

Figure 9 .
Figure 9. Power fluctuations and forecasting errors on residual power (δr, light purple) and grid power (δg, blue) achieved by employing the proposed OPEM over three days, together with the S power demand (ΔS, magenta).

Figure 10 .
Figure 10.The S power profiles achieved by OPEM over three days.

Figure 11 .
Figure 11.The S energy evolution achieved by the proposed OPEM over three days.

Figure 11 .
Figure 11.The S energy evolution achieved by the proposed OPEM over three days.
through Figure 17 reveal almost the same good performances shown in Figures 9-11 and already discussed in the previous subsection.
through Figure 17 reveal almost the same good performances shown in Figures 9-11 and already discussed in the previous subsection.

Figure 12 .
Figure 12.Residual and grid power profiles achieved by OPEM over a generic week by employing different time horizons.

Figure 13 .
Figure 13.The B power profiles achieved by OPEM over a generic week by employing different time horizons.

Figure 14 .
Figure 14.The B energy evolutions achieved by OPEM over a generic week by employing different time horizons.

Figure 15 .
Figure 15.Power fluctuations and forecasting errors on residual power (δr light purple) and grid power (δg, blue) by employing the proposed OPEM over a generic week at T = 24 h, together with the S power demand (ΔS, magenta).

Figure 12 .
Figure 12.Residual and grid power profiles achieved by OPEM over a generic week by employing different time horizons.
through Figure 17 reveal almost the same good performances shown in Figures 9-11 and already discussed in the previous subsection.

Figure 12 .
Figure 12.Residual and grid power profiles achieved by OPEM over a generic week by employing different time horizons.

Figure 13 .
Figure 13.The B power profiles achieved by OPEM over a generic week by employing different time horizons.

Figure 14 .
Figure 14.The B energy evolutions achieved by OPEM over a generic week by employing different time horizons.

Figure 15 .
Figure 15.Power fluctuations and forecasting errors on residual power (δr light purple) and grid power (δg, blue) by employing the proposed OPEM over a generic week at T = 24 h, together with the S power demand (ΔS, magenta).

Figure 13 .
Figure 13.The B power profiles achieved by OPEM over a generic week by employing different time horizons.
through Figure 17 reveal almost the same good performances shown in Figures 9-11 and already discussed in the previous subsection.

Figure 12 .
Figure 12.Residual and grid power profiles achieved by OPEM over a generic week by employing different time horizons.

Figure 13 .
Figure 13.The B power profiles achieved by OPEM over a generic week by employing different time horizons.

Figure 14 .
Figure 14.The B energy evolutions achieved by OPEM over a generic week by employing different time horizons.

Figure 15 .
Figure 15.Power fluctuations and forecasting errors on residual power (δr light purple) and grid power (δg, blue) by employing the proposed OPEM over a generic week at T = 24 h, together with the S power demand (ΔS, magenta).

Figure 14 .
Figure 14.The B energy evolutions achieved by OPEM over a generic week by employing different time horizons.
through Figure 17 reveal almost the same good performances shown in Figures 9-11 and already discussed in the previous subsection.

Figure 12 .
Figure 12.Residual and grid power profiles achieved by OPEM over a generic week by employing different time horizons.

Figure 13 .
Figure 13.The B power profiles achieved by OPEM over a generic week by employing different time horizons.

Figure 14 .
Figure 14.The B energy evolutions achieved by OPEM over a generic week by employing different time horizons.

Figure 15 .
Figure 15.Power fluctuations and forecasting errors on residual power (δr light purple) and grid power (δg, blue) by employing the proposed OPEM over a generic week at T = 24 h, together with the S power demand (ΔS, magenta).

Figure 15 . 21 Figure 16 .
Figure 15.Power fluctuations and forecasting errors on residual power (δ r light purple) and grid power (δ g , blue) by employing the proposed OPEM over a generic week at T = 24 h, together with the S power demand (∆ S , magenta).Energies 2017, 10, 1909 15 of 21

Figure 17 .
Figure 17.The S energy evolution achieved by OPEM over a generic week at T = 24 h.

Figure 16 . 21 Figure 16 .
Figure 16.The S power profiles achieved by OPEM over a generic week at T = 24 h.

Figure 17 .
Figure 17.The S energy evolution achieved by OPEM over a generic week at T = 24 h.

Figure 17 .
Figure 17.The S energy evolution achieved by OPEM over a generic week at T = 24 h.

Figure 17 .
Figure 17.The S energy evolution achieved by OPEM over a generic week at T = 24 h.

Figure 18 .
Figure 18.Residual and grid power profiles achieved by FBM over a generic week by employing different time horizons.

Figure 19 .
Figure 19.The B power profiles achieved by FBM over a generic week by employing different time horizons.

Figure 20 .
Figure 20.The B energy evolutions achieved by FBM over a generic week by employing different time horizons.

Figure 21 .
Figure 21.Power fluctuations and forecasting errors on residual power (δr, light purple) and grid power (δg, blue) by employing the proposed FBM over a generic week at T = 24 h, together with the S power demand (ΔS, magenta).

Figure 18 .
Figure 18.Residual and grid power profiles achieved by FBM over a generic week by employing different time horizons.

Figure 17 .
Figure 17.The S energy evolution achieved by OPEM over a generic week at T = 24 h.

Figure 18 .
Figure 18.Residual and grid power profiles achieved by FBM over a generic week by employing different time horizons.

Figure 19 .
Figure 19.The B power profiles achieved by FBM over a generic week by employing different time horizons.

Figure 20 .
Figure 20.The B energy evolutions achieved by FBM over a generic week by employing different time horizons.

Figure 21 .
Figure 21.Power fluctuations and forecasting errors on residual power (δr, light purple) and grid power (δg, blue) by employing the proposed FBM over a generic week at T = 24 h, together with the S power demand (ΔS, magenta).

Figure 19 .
Figure 19.The B power profiles achieved by FBM over a generic week by employing different time horizons.

Figure 17 .
Figure 17.The S energy evolution achieved by OPEM over a generic week at T = 24 h.

Figure 18 .
Figure 18.Residual and grid power profiles achieved by FBM over a generic week by employing different time horizons.

Figure 19 .
Figure 19.The B power profiles achieved by FBM over a generic week by employing different time horizons.

Figure 20 .
Figure 20.The B energy evolutions achieved by FBM over a generic week by employing different time horizons.

Figure 21 .
Figure 21.Power fluctuations and forecasting errors on residual power (δr, light purple) and grid power (δg, blue) by employing the proposed FBM over a generic week at T = 24 h, together with the S power demand (ΔS, magenta).

Figure 20 .
Figure 20.The B energy evolutions achieved by FBM over a generic week by employing different time horizons.

Figure 16 .
Figure 16.The S power profiles achieved by OPEM over a generic week at T = 24 h.

Figure 17 .
Figure 17.The S energy evolution achieved by OPEM over a generic week at T = 24 h.

Figure 18 .
Figure 18.Residual and grid power profiles achieved by FBM over a generic week by employing different time horizons.

Figure 19 .
Figure 19.The B power profiles achieved by FBM over a generic week by employing different time horizons.

Figure 20 .
Figure 20.The B energy evolutions achieved by FBM over a generic week by employing different time horizons.

Figure 21 .
Figure 21.Power fluctuations and forecasting errors on residual power (δr, light purple) and grid power (δg, blue) by employing the proposed FBM over a generic week at T = 24 h, together with the S power demand (ΔS, magenta).

Figure 21 . 21 Figure 22 .
Figure 21.Power fluctuations and forecasting errors on residual power (δ r , light purple) and grid power (δ g , blue) by employing the proposed FBM over a generic week at T = 24 h, together with the S power demand (∆ S , magenta).Energies 2017, 10, 1909 16 of 21

Figure 23 .
Figure 23.The S energy evolution achieved by FBM over a generic week at T = 24 h.

Figure 22 . 21 Figure 22 .
Figure 22.The S power profiles achieved by FBM over a generic week at T = 24 h.

Figure 23 .
Figure 23.The S energy evolution achieved by FBM over a generic week at T = 24 h.

Figure 23 .
Figure 23.The S energy evolution achieved by FBM over a generic week at T = 24 h.

Figure 24 .
Figure 24.Pareto diagram of r (gray) and g achieved by OPEM (blue) and FBM (red) at T = 12 h when the MG acts as a generator (values on the left) and as a load (sign-changed values on the right).

Figure 24 .
Figure 24.Pareto diagram of r (gray) and g achieved by OPEM (blue) and FBM (red) at T = 12 h when the MG acts as a generator (values on the left) and as a load (sign-changed values on the right).
. Consequently, s B,k * equals zero until r lies outside the two plane regions.Different considerations have to be made when Λ k is positive, as detectable in Figure3b.In this case,

Table 1 .
Optimal solution in accordance with both Λk and r  .

Table 3 .
HESS parameters and rated values.

Table 11 .
Weekly energy analysis.