Optimising Building-to-Building and Building-for-Grid Services under Uncertainty: A Robust Rolling Horizon Approach

— Energy systems are undergoing radical changes that have resulted in buildings being regarded as proactive players with the potential to contribute positively to energy networks. This study investigates the role of active buildings (ABs) as prosumers in energy systems by introducing a building-to-building (B2B) strategy for energy exchange between residential units, as well as a building-for-grid (B4G) model by exploiting the demand ﬂexibility of residential microgrids (RMGs). The mid-market rate mechanism is adopted to produce local market price signals at RMG level. A robust rolling horizon controller is developed for real-time energy management of a community of ABs. This control philosophy can improve the robustness of the RMG in face of real-time weather and energy price prediction errors. The proposed method is a multi-level optimisation which pursues multiple goals while making a trade-off between operational cost and occupant comfort. Finally, the repercussions of COVID-19 induced power consumption resulting from changing lifestyle and building occupancy proﬁle is analysed by the proposed method as a case study. The results show that the proposed B2B and B4G strategy can reduce energy bills by 18.45%, while notable robust real-time control and computational efﬁciencies are achieved when benchmarked against conventional methods.

Output power of photovoltaic/combined heat and energy storage [kW] Charge/discharge power of each building from/to Buying/selling power inside RMG [kW] B2B strategy [kW] Active power of building j at time period t under B2B strategy [kW] Active power of building j at time period t under in building j [kW] Power consumption rate of each lighting device heating purpose [kW] Output power of combined heat and power for State of charge of energy storage [kWh] storage Charging/discharging binary variables of energy power from main grid Binary variable denoting the import/export B UILDING'S relationship to energy systems are evolving due to onsite generation, smart appliances and demandside response.36% of global energy consumption is attributed to building's embodied and operational energy use [1].One way to reduce building's environmental impact is optimal scheduling and control of building loads that can enable them to become active agents within the wider energy system.Such active buildings (ABs) can also exchange energy and information locally to form a residential microgrid (RMG) [2].These dynamic characteristics have become crystallised in the concept of smart local energy systems that include a broad range of soft (i.e.digital and cyber) and hard (i.e.distributed generation) infrastructure components, and additionally underline the concept of peer-to-peer energy trading [3] within a cluster of ABs.As well as cost and carbon saving, ABs seek to facilitate greater user choice, enable the possibility of energy transaction between ABs and maximising the use of distributed energy resources.
This requires a paradigm shift in the management of occupant comfort, maximising self-consumption and autonomy (in RMG), and maintaining virtual inertia and integrity (in the whole system).These requirements present two distinct opportunities for an RMG controller that supervises a community of ABs and their incorporated assets; first optimising the use of its communally-shared portfolio of energy resources, and second exploiting the possibility of energy exchange between buildings and/or with the utility grid.Following these goals can create a coordinated paradigm between ABs and energy networks, while facilitating the creation of community markets.These strategies supported by advanced telecommunication to enable real-time energy scheduling could be an efficient replacement for conventional load shedding [4].To realise this, an RMG controller needs to overcome several challenges, namely real-time data processing of advanced metering infrastructure, catering for occupant preferences, and satisfying a set of techno-economic constraints.RMG controllers should also be computationally (i.e.processing power/speed) and economically viable for a residential application.these units can play their part actively in the energy networks their perspective in the energy networks, demonstrating how These advances in the energy management of ABs, changed [10], and controllability [11].grouped based on interpretation [9], operational dependency resources are managed in an RMG.Smart appliances are a signal on how smart appliances and distributed energy market participation and real-time pricing [7], [8] that provide energy scheduling approaches are guided by interactive energy elements can bring about 30% cost saving.These optimal Zhang et.al [6] has shown that optimal management of RMG cerned with optimising the operation of RMG assets [5].investigated in the literature, with representative studies con-

Energy management and control of ABs have been widely
Literature Review B.
amount of information about uncertain data streams that result ances [23].Stochastic methods, nevertheless, require sizeable main grid [22], and the scheduling pattern of building appli-difference between buying and selling electricity from/to the illustrate the impact of uncertainty on operational cost, the constrained optimisation [11].Stochastic methods [22], [23] decision theory [24], robust optimisation [25], and chance-include stochastic optimisation [22], [23], information gap approach, several other methods have been explored.These of uncertainty, in addition to rolling horizon based real-time In order to account for the impact of multiple sources a substantial challenge for system operators.scale, is known as demand uncertainty which has always been as well as building-related renewable generation.This, at wider time of different assets, building thermophysical characteristics changes by variations in occupants' behaviour, operational not always accurate.This creates the possibility of sudden is made based on the predictions of future inputs, which is in the rolling horizon based methods is that a current decision constraints of the grid.The point that should be considered is coordinated with the building to respond to operational the operational cost, while the distribution system controller horizon based real-time optimisation method so as to minimise and day-ahead processes.Authors in [21] introduced a rolling in the building compensate the mismatch between real-time to supply the real-time demand, while the storage facilities updates the input results in a two stage optimisation so as as rolling horizon [19].For instance, in [20], the controller benefits from the idea of look-ahead control strategies such frameworks have been introduced for this purpose that draw control signals from the main grid in real-time [18].Several A controller within an RMG should be able to respond to the building appliances [17].
MINLP as they can provide efficient application in controlling integer linear programming (MILP) models are preferred to and increases the computation time.In this regard, mixed programming (MINLP), which require a powerful processor comfort models with an optimised mixed integer non-linear of the aforementioned studies however consider non-linear factors [15] or cost-based coefficients [16].The majority [14], or integrated into the main goal either using weighting tion, turning the problem into a multi-objective task [13], while the latter is considered as a separate objective func-occupant's comfort.The former is common among AB studies, the optimisation of two main objectives: energy cost and These scheduling and control methods generally consider generation.
the negative effect of reverse power flow caused by distributed has been considered as an effective approach in decreasing voltage fluctuation.Moreover, the demand-side management within a group of buildings can be effective in reducing the the authors have shown that energy management strategies dwelling units on voltage profile of the grid.In Reference [15], demand supply.Alwan et.al [15] investigated the effect of is considered as an important factor which can contribute to In [14], optimising the scheduling of controllable appliances in energy optimisation of an unbalanced distribution network.considered each building as an agent that can play its part while maintaining their user preferences [12].Authors in [13] ESS CHP Weather station Utility grid Flow of Energy Flow of data 1 In this study, building refers to a generic UK type family house for partial knowledge of input parameters.
(compared to conventional controllers) while accounting prediction uncertainties at a lower computational time ness of real-time energy management systems against • Introducing an RRH controller to maximise the robust-achieving an optimal energy management.

MINLP predecessors). It also pursues multiple goals in
require excessive processing power (as opposed to the participation using a linear robust controller that does not els, the proposed solution allows greater asset/building pliance/task constraints.Compared to current MILP mod-RMGs, with consideration for occupant comfort and ap- • A multi-level MILP optimisation model is proposed for butions of this paper are: nature of modern power systems planning.The main contri-down condition in 2020 which further highlighted the critical operational characteristics such as COVID-19 related lock-against a conventional controller, and also tested under atypical The performance of the proposed controller is benchmarked an MILP model which can be solved by commercial solvers. ABs in the local energy market.The proposed architecture is comfort, the former can guarantee the preference/benefits of latter makes a trade-off between energy bill and occupants proposed model is multi-level and multi-objective.While the the AB community level to create a local pricing market.The (B4G) strategies.The mid-market rate approach is adopted in to introduce building-to-building (B2B) and building-for-grid and building inertia) and shared distributed energy resources exploits flexibility in AB loads (through interruptible loads information gap decision theory.The proposed RMG controller increased (referred to as RRH hereafter) using the notion of the robustness in each consecutive dispatch time interval is to receive real-time weather and energy price data, while and global goals.A rolling horizon based method is adopted of buildings 1 which can actively co-operate to achieve local a multi-level real-time energy management for a community Hence, this study attempts to address this gap by proposing from the upstream network is sent to the distribution grid controller.The optimal starting time of each task, cost and comfort level, the output of building level (photovoltaic unit) and community level (energy storage, and combined heat and power) assets, and the value of B2B/B4G transactive tasks is then communicated by the controller.Cloud computing is assumed to enable real-time communication and control signal processing, while observing privacy issues.Therefore: • Real-time communication is assumed and a delay has not been considered.• The RMG controller is in charge of the entire RMG assetbase and all AB asset data.• RMG is connected to the main grid at point of integration.
• The energy sources within each building (e.g.photovoltaic unit) are controlled by RMG controller.

B. Robust Rolling Horizon (RRH) Controller
The rolling horizon approach, which is based on the concept of model predictive control, can be used for real-time energy management of RMGs.This method uses real-time data for each discrete time interval to solve the optimisation over a nominal control horizon while also accounting for future timeslots.Therefore at time period t 1 , the input data for upcoming intervals (i.e.t 2 ...t n ) are forecasted, so the optimised results are defined based on a predicted path.Forecast data uncertainty (especially for parameters prone to wide fluctuation) results in a simulation error (i.e. the difference between predicted and actual value).To reduce error, the conventional methods use smaller time intervals (i.e.reducing optimisation interval from 30min to 5min).However, this requires high computational time and power which may present difficulties when performing real-time controls.Additionally, smaller time intervals cannot solve the issue of future uncertainty.To address these issues, an information gap decision theory based technique has been proposed in this paper to increase the robustness of rolling horizon method.This method does not require excessive information on input parameters, and needs lower computational time compared to stochastic methods [26], making it suitable for dealing with input data with unknown behavioural patterns such as weather forecast.Generally, Figure 2 attempts to illustrate this approach.In the conventional method (Fig. 2-a) [21] and at time instance t 1 , the forecast error for a future instance of time (e.g.t m ) propagates into a simulation error.The proposed RRH method (Fig. 2-b) introduces a robustness degree for those input data that are more likely to change over operational horizon.By maximising the degree of robustness, the erroneous effect of the changeable forecasts on the control action is reduced.It should be noted that the optimal value of robustness is related to its tolerable value.The tolerable value of robustness is a parameter defined by the decision maker and increases the value of the objective function.This increase in cost is called cost of robustness.The bigger the tolerable value of robustness, the greater the system robustness.Therefore, in Fig. 2-b, the optimal value of dotted green line is related to the amount of increase in the objective function (i.e. from the solid green line to the dotted green line).

III. PROBLEM FORMULATION
The proposed mathematical model describes optimal operation of multiple ABs, and shared energy sources, which form an RMG, while they can communicate with the utility grid, and locally together.In the following, the technical and operational  constraints of RMG are introduced.Then, the AB flexibility strategies are discussed.

A. Objective Functions
In the proposed optimisation, the controller follows two conflicting objective functions, namely energy bill and occupants comfort index, defined as: where, in (3), P I j,t is the amount of power consumed by lighting devices to provide visual comfort (i.e.V B j,t ).Eq.( 4) is widely referred to as building resistance and capacitance Power consumption of these tasks is defined as: is the cost of purchasing natural gas from the main grid for power from/to the main grid, respectively, while the third term and second terms are cost and income of importing/exporting where, Eq. ( 1) represents the energy bill, in which the first thermodynamic model [16], in which H th j,t denotes the amount of power that is consumed for providing thermal comfort.
Fixed Power Consumption Tasks (i.e.ψ F i ): set of tasks which operate in a specific period (i.e.ψ Ap top ) with a fixed power consumption rate (e.g.cooker hob).Based on the preferred time window of these tasks, which is defined between their starting time (i.e.ψ Ap tst ) and ending time (i.e.ψ Ap t end ), their operation is described as: Variable Power Consumption Tasks (i.e.ψ V i ): these tasks operate with a variable consumption rate, such as washing machine and dishwasher.Constraints (5) should be modified so as to describe the operation of these tasks, as follows: According to constraint (6), the ON/OFF status of each task (i.e.χ Ap j,i,t ) controls the required power at each period (i.e.P Ap j,i,t ) so as to satisfy the variable power consumption at each operational period (i.e.P Ap j,i,o ).

C. Comfort Constraints
The comfort indices are related to comfort related tasks as explained in (3)-( 4).In addition to internal comfort providing technologies, outdoor illumination and temperature are considered as external factors which can affect the occupants comfort.These indices and their corresponding constraints are: where, (7) is the visual comfort index, while (8) shows the total illuminance level within each building, which is equal to the sum of natural illumination and that of lighting devices.Equation ( 9) limits the illuminance level.Besides, (10) represents the thermal comfort index, while (11) limits the buildings' indoor temperature.The quadratic term in (7) is linearised as follows: where, N is the number of linearisation intervals.Based on the piecewise linearisation technique, the parabolic curve

D. Energy Balance Constraints
In the designed RMG, heating and electricity energy demand of ABs is supplied by internal (e.g.combined heat and power and photovoltaic units) and external (e.g.electricity grid).The following energy balance constraints are introduced for the model.
where, (13) is the electric power balance, consisting of the consumption of different tasks and generation of various sources, while (14) represents the heating balance.The terms given in these equations are limited by their technical and operational constraints.The shared combined heat and power is the linking asset between heating and electricity energy.

E. RMG Asset Constraints
The central and individual energy providers of the RMG which are integrated to supply ABs load demand are limited by the following constraints.
Constraint (15) limits the output power of combined heat and power based on its rated power, while P CHP j,t could be converted to H CHP j,t by the the heat-to-power efficiency (i.e.η CHP P 2H ) of combined heat and power.Equations ( 16)-( 21) describe the energy storage model, in which (16) denotes the total state of charge of energy storage, while it is limited by (17).In order to prevent net accumulation, the state of charge of battery at the end of the period (i.e.t end ) should be equal to its initial value at the beginning of the period (i.e.t st ).The charge and discharge of each building from the central storage is limited by ( 18) and ( 19) respectively.Note that the P ESS c/d u is also the maximum allowable charge/discharge of all ABs.Constraint (20) is a limiting logic based on the binary variables χ ESS d j,t and χ ESSc j,t which prevent simultaneous charge and discharge.Constraint (21) represents that the amount of discharged power for each AB is limited by the value of charged power.This means that AB j can utilise the power from energy storage if it has contributed to its charging before.Finally, constraint (22) represents the output power of rooftop photovoltaic units based on the predicted output.

F. Utility Grid
The RMG can receive and send electrical power from/to the utility grid.These limits are represented in the following constraints: where, binary variable χ G j,t prevents the simultaneous import and export from/to the main grid.

G. Active Building Flexibility Strategies
Active building strategies advance the role of prosumers in the energy network by introducing flexibility measures, while taking into account critical denominators such as users' comfort.These strategies can be divided to those which serve the AB community and those which provide services for the gird.The former is referred to as B2B strategy while the latter deconstructs the idea of demand flexibility into its source and is called B4G strategy.
Building-to-Building Strategy: this strategy is developed based on the idea of peer-to-peer energy trading [3].According to this framework, buildings can participate in a local market based on their available generation capacity and demand flexibility.However, participating in peer-to-peer energy trading for an AB is subject to maintaining the techno-economic constraints and satisfying the occupant comfort.Furthermore, enrolling in B2B should bring about profit for each individual AB.This profit can be reflected in the energy bills.Finally, such a framework should not create security problems for the utility grid.The following equations represent the B2B strategy based on these criteria.
The value of B2B for each AB and its role (i.e.buyer or seller) in the local market is defined by (25a).Each AB can specify its role as buyer (i.e. when P B2B j,t takes its value from P buy j,t ) or seller (i.e. when P B2B j,t takes its value from P sell j,t ) in the B2B framework by managing its generation capacity (i.e.P AB G j,t ) and demand (i.e.P AB D j,t ) as indicated by constraints (25b) and (25c) respectively.Constraints (25b) and (25c) also ensure that the energy exchange would happen based on the RMG internal capacities.Note that, the generation and demand of each individual AB are obtained in the energy balance equations.Based on constraints (25d) and (25e) each building can be a buyer or a seller in each time period.The variable P B2B j,t is also added to the power balance equations in (13).Building-for-Grid Strategy: for the B4G strategy, a positive variable is defined (i.e.L f lex j,i,t ) to tolerate the power consumption of the adjustable power consumption tasks, through multiplying it by the building appliances' power usage (i.e.L f lex j,i,t × χ Ap j,i,t−o × P Ap j,i,o ).However, this will change the model to a non-linear one.Thus, the term χ Ap j,i,t−o P Ap j,i,o in ( 13) is replaced by L f lex j,i,t P Ap j,i,o , while the following linear model is defined for B4G.
where, constraint (26) introduces the upper and lower limits on the variable L f lex j,i,t based on the binary variable χ Ap j,i,t−o which has been defined in (5) for ON/OFF status of appliances.If a building appliance is on (i.e.χ Ap j,i,t−o = 1), the upper value the fair distribution of price between all buildings in the proportionally allocated between all producers.This enables the amount of energy that could be sold to the main grid is generation can sell their energy to the buyer buildings, whereas price is obtained by Eq. (28).Note that buildings with excess RMG local prices are defined as the average of import and ex-this method is shown in Fig. 3. Based on this mechanism, the the energy prices within the RMG.The illustrative concept of commonly used pricing mechanism, is adopted for establishing is required.In this study, the mid-market rate method [29], a in the B2B and B4G strategies, a suitable pricing mechanism to establish a local market and encourage ABs to participate and improvement in energy system reliability [28].In order advantages for the prosumers, such as energy bill reduction,

Participating in a local market can bring about several
Pricing Mechanism H.
their consumption to bring about lower cost for ABs.signal guides the controller to switch on appliances and adjust appliances) can be adjusted.This means that the market price than one means the load of an appliance (or collection of clarify, reducing the value of flexibility to an amount lower value of flexibility (i.e.L j f , l i e ,t x ) to assist B4G services.

IV. PROPOSED MULTI-LEVEL RMG CONTROL SCHEME
In order to accommodate the proposed mid-market rate pricing mechanism, B2B and B4G service provision models, the RMG controller has to consider three important factors.Firstly, it has to dispatch an ABs participation in B2B and B4G services only if that control action can provide added benefits (i.e.reduced energy bills).Secondly, participation in any local market for a building should honour occupant comfort constraints.Finally, the RMG controller should consider input parameter prediction errors when processing control signals for the community.To address these challenges, this study introduces a multi-level control framework as outlined in the following subsections.

A. Base-Case RMG Control (First Level)
An AB-specified market should present cost saving to the participants.In other words, energy bill of ABs after participating in the B2B and B4G should be lower than that without these strategies.Accordingly, the base-case level of the RMG control strategy minimises the energy bill in Eq. ( 1) without consideration for B2B and B4G constraints, as follows: The value obtained for ζ l1 is considered as a constraints for other levels of optimisation.The value obtained for total RMG generation and load is also utilised to define the mid-market rate local prices.This allows the definition of local prices without consideration for an individual AB's benefit, bringing about a fair distribution of benefit among all dwellings.

B. Multi-Objective Optimisation (Second Level)
This level exploits B2B and B4G strategies to obtain the greatest energy bill saving.The willingness to minimise the cost, however, brings it into a conflict with the occupants comfort.In this regard, it is required to solve this level as a multi-objective optimisation.In this study, the −constrained method is adopted to solve the optimisation problem.This method does not require manual definition of weights and can deal with convex and non-convex methods as opposed to other approaches such as weighted sum technique [30].These are important factors that should be considered, especially in automated control methods.In this method, one of the objective functions is transferred into the model constraints, while the other is optimised.The objective function that is considered as a constraint takes its limits from , which is derived from the maximum and minimum values of the objective function that is being considered as a constraint.
Noting that either objective function could be optimised, the energy bill is minimised in (32a) while the comfort level is defined as the model constraint in (32b).This process turns the model into a single-objective cost optimisation while the comfort level is constrained by .The value of is defined between maximum and minimum possible comfort level.The interval between the maximum and minimum value is divided into equal steps and the optimisation is solved for each value.
As aforementioned, energy bill with AB flexibility mechanisms should be lower; therefore, constraint (32c) is introduced in this level.The other constraints of this optimisation are (3)-( 27).This will enable the generation of all Pareto optimal solutions for a multi-objective problem.(27) as: flexibility.Accordingly, the energy bill of each AB is written allows ABs to reduce their prices by utilising their demand export price.In addition to the B2B strategy, the B4G method their excess generation with a price better than that of grid price compared to that of grid import, while sellers can sell and sellers.Those who buy energy can benefit from lower participating in the local market brings profit to both buyers are defined between grid import and export prices.Therefore, demand-generation scenarios.that constraint (32c) ensures that participating in the local functions is chosen as the best compromise solution [30].Note obtained, and the maximum value of the selected membership in which the minimum value of each membership function is solution.To do so, a fuzzy-based min-max method is adopted, are acceptable, there is a need to select the best compromise functions.Considering the fact that all Pareto optimal solution sation problem draws a Pareto optimal set for both objective (obtained when ζ is minimised solely).Solving this optimi-(obtained when Ξ is maximised solely) to its minimum value is decreased from the maximum value of occupants comfort In (32), the operational cost is minimised while the value of

OF = min
where ν(t) is the value of uncertain variable which deviates around the predicted value (i.e.ν (t)).The size of gap between ν(t) and ν (t) is defined by α which is called uncertainty variable.Based on this model, the fractional deviation of predicted parameter from the uncertain value is limited by α.The bigger the value of α, the larger the horizon of deviation.
In the proposed model, the predicted values of outside temperature (i.e.T out t ), natural illuminance level (i.e.V N t ), and photovoltaic unit output (i.e.P P V F t ) are considered as the weather-related uncertain data.While these parameters are weather-related, the first two data impose demand uncertainty while the third one reflects the generation uncertainty.The import/export electricity prices (i.e. λI/E t ) are also considered as the market related components of uncertainty.It is worth mentioning that these sources of uncertainty can even affect the local market prices.
Since these parameters are more likely to experience variation over the control horizon, the proposed RRH controller improves the system robustness in face of market price deviation (i.e.α p ) and weather-related forecasted data uncertainty (i.e.α w ) over the control horizon by scheduling AB assets and benefiting from the participation of occupants.Note that these deviations will be obtained based on the control mechanism.To achieve this control philosophy, the RRH controller solves the following optimisation: s.t : 5 illustrates the framework of the proposed RMG controller.The input data is transferred to the data receiver.Then, for the time period t, the model is solved in three levels, starting from the first level where energy bill is minimised without B2B and B4G strategies.The local prices are determined in this level, while the value of energy bill is considered as a constraint for outer levels.The second level takes into account two conflicting objective functions, while the process ends up with the RRH which improves the robustness of the described as follows [32]: controller in face of uncertainty.This model is mathematically tion gap decision theory to improve the robustness of RMG This study utilises the envelope-bounded model of informa-immune if the input data vary within an unknown threshold.means that the optimal value of objective function will remain objective function in face of uncertainty in the input data.This known.This method increases the immunity (i.e.robustness) of only requires an uncertainty set which does not need to be which is based on information gap decision theory technique, On the other hand, On the other hand, the proposed method eter, resulting in a dramatic increase in the computational time.
produce a large number of scenarios for each uncertain param-theory and stochastic methods.This case study is solved for different scenarios.
Case II: The proposed model with B2B and B4G strategies.
optimisation without AB flexibility measures.
gies.This case study solves the second and third levels of the Case I: The proposed model without B2B and B4G strate-following case studies: The effectiveness of the proposed model is evaluated by the supporting data are available online at [34].
and included tasks in each one is given in Table I.Other sleeping periods respectively.The information on buildings white and pale colours represents occupied, unoccupied and three types as a function of their occupancy profile.The bold, and then during a winter day.Buildings are categorised into factor index for each AB under normal operating condition Fig. 6 illustrates the occupancy profile and comfort weighting into three types as a function of their occupancy profile.
ABs are considered in the RMG.Buildings are categorised using 30-minute time windows, starting from 8:00AM.10 using CPLEX solver.The simulation is performed for 24 hours, simulated in general algebraic modelling system (GAMS) [33] The proposed problem is an MILP model which has been  inertia is utilised as an energy storage mechanism and indoor in response to market price.In doing so, the building thermal least not changed, especially during high market price periods higher price deviation, the imported power is decreased or at other words, in order to improve the robustness against the by RRH controller is robust against higher price deviation.In of compromise solution.This means that the decision made main grid in robust solution is almost twice as much as that latter.For example, at 17:00, the imported power from the how more grid power import occurs in former compared to comparing robust and compromise solutions of Case II shows delay the need for generation investment.On the other hand, high sell prices and low buy prices.In the grid level, it can try to achieve a high retail profit from prosumers by offering can be an effective alternative for profit-seeking retailers who than importing from the main grid (see Fig. 8).This strategy while those with energy needs purchased energy locally rather excess generation have sold their power to other buildings, in Case II (both scenarios).This demonstrates that ABs with the main grid.The energy export to the main grid is zero the B2B and B4G strategies affected the power exchange with cases I and II is shown in Fig. 9.This figure shows that utilising The energy exchange between RMG and the main grid in D. Energy Exchange with the Main Grid a higher operational profile.behaviour, while B4G strategy can be efficient for ABs with creates flexibility based on generation capacity and occupancy B4G strategy.Therefore, it can be concluded that B2B strategy tasks, the less an AB can contribute proactively to the grid in full range of adjustable appliances.The lower the number of (e.g.j 10 ) did not participate actively since they do not offer a consuming appliances.On the other hand, type two buildings more active as they are equipped with more adjustable power than j 6 .In B4G strategy, type three buildings (e.g.j 1 ) are same category.For instance, building j 1 received more energy price received more energy, compared to other buildings in the that need to start their tasks at hours with high rates of market ation window of buildings appliances, such that the buildings decisive factor in B2B strategy is the starting time and oper-can provide other ABs with their available capacity.Another type two buildings (i.e.unoccupied during office hours) which day) mostly played the role of the receiver, as opposed to the B2B strategy, type three buildings (i.e.occupied the whole are separately illustrated on the outer edges of the figure.In buildings j 1 (type three building), and j 10 (type two building) by B4G strategy.As an illustration, consumption patterns of and the right picture outlining the flexibility service provided outlining the power exchange between ABs in the B2B strategy   12 that examines variation of α t over the weighting factor ω for various levels of β.This figure shows that increasing ω raises the value of α t .This can be interpreted with Equation (34) in mind, that increasing ω raises the weight of weather-related robustness, resulting in a dramatic increase in the value of α t .
In another words, it is easier to increase the weather-related robustness as opposed to that of the market price.Besides, increasing the value of β raises the robustness degree.

G. Computational Efficiency
In order to evaluate the computational and economic merits of the proposed model, it is benchmarked against the conventional rolling horizon method within three different scenarios: [I] S 1 which portrays an optimistic future horizon in which predicted data and the subsequent reality for those forecasts are the same; [II] S 2 with across a 3 hour future horizon assumes the real weather to be 30% different to the initial forecast and the market price to be 15% different to the initial value and finally [III] S 3 which solves the same optimisation problem as S 1 using 5-min intervals (instead of 30 min).The results for these scenarios are outlined against the proposed RRH in Table III.Scenario S1 solves the model in 34.21s at each time step, while the proposed RRH model takes 42.15s.Comparing scenarios S 1 and S 2 shows that deviations between initial forecast and subsequent reality results in more operational cost.To overcome this problem, S 3 solved the model at finer time intervals that yields 8.6% cost reduction (compared to S 2 ), but at a penalty of much higher computational time (i.e.175.25 seconds each iteration).Against these results, the proposed RRH demonstrated superior performance in both computational (e.g.76% lower compared to S 3 ) and economic aspects (e.g.6.3% lower cost as opposed to S 2 ).The improved accuracy in scenario S 3 imposes considerably higher process-performs.This is demonstrated by a sensitivity analysis in Fig. ω ) are instrumental in how the robustness degree component ness (i.e.β) and the robustness degrees' weighting factor (i.e.
In the proposed RRH model, the tolerable value of robust-F.Robustness Analysis well-insulated buildings.
to stay within comfort bands) is even more pronounced in storage resources.Thermal neutrality (or the ability of an AB buildings is a major advantage to exploit as a virtual thermal gradually.The intrinsically slow thermal response of most hours with lower market price and thereafter allowed to fall temperature is increased to above the set point in morning building j 1 over the operation horizon for different cases. Temperature set point [ • C] Predicted outdoor illuminance level [lux] Predicted outdoor temperature [ • C] Predicted photovoltaic unit output [kW] Set of occupied periods of building j Set of time periods Set of linearisation intervals Set of buildings Set of tasks Index of time periods Operation period of building appliances Index of buildings Index of tasks Tolerable value of robustness Illumination set point [lux] vices Utilization/maintenance factor of lightening de-Duration of time periods [hour] [£/kW h] Predicted electricity import/export price Number of lightening devices in building j Illuminated space in building j [m 2 ] Gas energy price [£/kW h] Total number of buildings Thermal capacitance of building j [ • C/kWh] • C/kW] Thermal reactance of building j [ [kW] Maximum charge/discharge rate of each building grid [kW] Maximum power exchange rate with the main Power consumption of each task [kW] Rated power of combined heat and power [kW] Source flux value of building j storage [kWh] Maximum/minimum state of charge of energy Total occupied periods of building j j [ • C] Maximum/minimum temperature inside building Visual/thermal weight factors Maximum/minimum Illuminance level [lux] (G/D) R t M G Total generation/demand capacity of RMG [kW] building appliances Binary variable denoting the ON/OFF status of Weather related/market price robustness degree power [kW] of building j [lux] Illuminance level of building j [lux] Indoor temperature of building j [ • C] [kW] Imported/exported power from/to main grid Motivation A.

Fig. 1 :
photovoltaic unit, while combined heat and power and energy summarised in Fig.1.Each AB is equipped with an individual cessful data and energy exchange in an RMG.This concept is A bidirectional transaction framework is required for suc-The Residential Microgrid (RMG) Structure A.II. OVERVIEW OF RESIDENTIAL MICROGRID CONTROLLER
mal comfort-providing tasks are categorised into this group.defined based on the preferred comfort level.Visual and ther-Comfort-Providing Tasks: the consumption of these tasks is gorised into different groups, as outlined below.Operational characteristics of AB appliances can be cate-B.Operation of Different Tasks index towards 0. it (i.e. the space being too hot or too cold) moves the comfort comfort) is represented by 1 and degrees of departure from index of 0 to 1. Thermal neutrality (i.e.highest degree of development this bidirectional band is translated into a single 'too cold' to 'too hot' thermal spectrum, here for equation Bedford) normally a 7 point approach is used to represent a thermal comfort codes (i.e.BS EN ISO 7730, ASHREA or I j Tc ,t om ) comfort indices respectively.While in predominant factors ω V j,t and ω T j,t by virtual (i.e.I j Vc ,t om ) and thermal (i.e.dwelling unit, which is obtained by multiplying the weighting community (i.e.B) over the occupied period (i.e.T o j c ) of each given in (2) represents the comfort index of all ABs in the supplying the combined heat and power.The objective function sell can be sold to the main grid with the grid export price (i.e. is lower than average B2B price, while the excess generationG R t M G , as inFig.3-(b)): In this case, the local sell price II.RMG generation is higher than demand (D R t M G < prices compared to those of the main grid.market under this scenario can benefit from better buy and sell and export price.Therefore, buildings participating in the local under this scenario happens with the average of grid import (i.e.λR energy trading in Fig. 3-(a)): In this scenario, local buy (i.e.λR and demand (e.g.D R t M G ) vary at each time-slot, three However, due to the fact that the RMG local generation (e.g.port prices with the main grid (i.e.λR

Fig. 3 :
Fig. 3: Value of local market price under different

Fig. 4 :
Fig. 4: The conceptual difference of information gap decision

Fig. 6 :
Fig. 6: Occupancy profile and comfort weights of different buildings types.
allow the controller to oversee a flexible indoor temperature obtained for robust solution also shows that how ABs can with slightly lower values in the robust solution.The result comfort index of the AB fluctuated over the price variations, as shown in Fig. 11.It is evident from this figure that the the temperature of building has affected the comfort index, alternating their preferred comfort zones.These variations in a considerable role in improving the RMG robustness by to 23:00).This demonstrates that AB occupants can have particularly under high market price periods (i.e. from 19:30 however, experiences more fluctuation and lower temperatures, AB while considering the economic factors.Robust solution, the temperature around the preferred set point given by the compromise solution, the main goal of controller is to keep and compromise scenarios of Case II for building j 1 .In the by giving an example of the indoor temperature in robust contribution of occupants in improving system robustness, robustness should not be neglected.Fig. 11 highlights the The participation of occupants in improving the system markets.a considerable influence on the energy interaction in the local Therefore, social factors (i.e.occupant behaviour) can have decrease in participation of building in the local market.value of occupants comfort index resulted in a considerable occupants comfort index (i.e.0.96).However, increasing the exchanged more power in the local market at lower values of occupants comfort.As can be seen in this figure, building j 1 over the control horizon is depicted for different levels of illustrated in Fig. 10, where the power exchange of building The effect of occupants comfort on the B2B interaction is E. Role of Occupants (i.e. from 19:30 to 23:00).

Figure 8 demonstratesFig. 8 :
Figure 8 demonstrates Case II scenarios with the left picture C. Building Flexibility Values

Fig. 9 :
Fig. 9: Energy exchange with the main grid in different cases.

Fig. 11 :
Fig. 11: Variation of temperature and comfort index of

TABLE I :
building and task description.

TABLE II :
Root mean square error of Case III for each AB.

TABLE III :
Computation efficiency of different techniques.

TABLE IV :
Comparison of MILP and MINLP models.
dependencies," IEEE Transactions on Smart Grid, vol.11, no. 1, pp. 4-management system with demand charge tariff and appliance operational