Transactive Energy Market for Energy Management in Microgrids: The Monash Microgrid Case Study

Transactive energy is a novel approach for energy management and trading, which can be used in microgrids to facilitate the integration of distributed energy resources (DERs) in existing networks. The key feature in transactive energy is using market-based solutions for energy management. Hence, an appropriate transactive energy market (TEM) framework should be designed to enable and incentivize DER owners to participate in different markets. The efficient implementation of TEM for microgrid energy management encompasses the application of a variety of design principles. In this rapidly developing area, this paper presents a complete proposal of the TEM as a framework for the design, implementation, and deployment of transactive energy solutions for energy management in microgrids. In particular, we outline the requirements to design an effective market mechanism for the TEM. The applicability of this perspective is demonstrated through the introduction of the Monash Microgrid as a real-world implementation of a TEM solution, where a complete hardware and software foundation is presented as a platform to deploy a market-based solution for microgrid energy management. This is further illustrated through an example scenario, where the application of TEM is discussed to demonstrate the impact of considered design choices on achieving desired objectives.


Introduction
The increasing penetration of distributed energy resources (DERs) to electricity networks is changing power grids from a centralized system, served by large-scale generators, transmission and distribution networks, to ones with embedded small-scale DERs [1]. In the evolving electricity system, customers benefit from using their DERs, such as rooftop solar photovoltaic (PV), to lower their electricity costs. Moreover, utilizing devices and energy management programs that enable load flexibility will help customers to act as a grid resource to provide energy flexibility. The efficient integration of DER can also provide benefits to non-DER owners by lowering total system costs. Increasing adoption of renewable DER is a developing trend in the path toward the decarbonization and decentralization of energy systems. Australia, for instance, currently has more than 2 million installed rooftop PV systems, making up 21.6% of the grid installed capacity. Local penetration in some areas is well above 30% of all customer premises [2]. While decarbonization through renewable energy penetration, and decentralization through DER integration come with opportunities to provide

Literature Survey
Market design for DER energy management is an active area of research in the literature. Recently, many researchers have proposed new market solutions to provide different services such as energy trading and flexibility services exchange [9]. The main objective of market design for energy service is to schedule load and generation resources before the delivery time to minimize energy costs. It can be achieved through local energy trading or managing load and generation resources for participation in external energy markets. Flexibility service aims to adjust power in a given moment for a given duration in a specific location within the network, which can be achieved through modifying generation and consumption patterns in reaction to market signals [10].
Market design for both energy and flexibility services have been investigated in the literature. A blockchain-based microgrid energy market is proposed in Reference [11], where components for efficient market design are presented. A contribution-based energy trading mechanism among microgrids is presented in Reference [12] to maximize consumers satisfaction, where energy trading is modeled as a non-cooperative energy competition game among the consumers. Wang et al. [13] propose a new energy trading framework that enables microgrids to trade energy in an independent market to maximize their average revenue, where learning automation and non-cooperative repeated game are combined to develop the trading scheme. A comprehensive review of potential approaches for market clearing in local energy markets is presented in Reference [14], in which scalability, computation and communication overheads, and incorporating network constraints are stressed as three main factors which need to be embraced in local market design.
An event-driven energy trading system among microgrids is designed in Reference [15], where the Stackelberg game model is employed to formulate energy trading, and a reward concept is proposed to promote energy trading for consumers. A holistic model for energy trading and scheduling of several interconnected microgrids is proposed in Reference [16] using Nash bargaining theory for incentivizing proactive energy trading. Energy trading in a prosumer-based community microgrid is presented in Reference [17], where a game-theoretic approach is employed to design pricing mechanisms in different levels. Jeong et al. [18] propose an energy trading system for retailers in a microgrid to maximize their revenues based on future forecasting and forecasting errors. A microgrid market is designed in [19] to optimally assign the net power mismatch to microgrids' agents to minimize dependency on the utility and market clearing cost. Liu et al. [20] propose an energy sharing model among prosumers in a microgrid, where dynamic price-based demand response is modeled for energy sharing.
Research in the field of TEM design for microgrids is just gaining momentum, and literature in this field is still emerging. A review of recent discussions on architectures, distributed ledger technologies, and local markets for microgrid transactive energy is presented in Reference [21], in which functional layers for designing transactive energy systems are discussed. Abrishambaf et al. [22] review research and industrial works on transactive energy and provide a classification of transactive energy system based on their application in network management, transactive control, and peer-to-peer markets. Akter et al. [23] present a comparative analysis of energy trading priorities for TEM design in residential microgrids. An integrated simulation environment for energy communities in local and wholesale markets is presented in Reference [24] to evaluate impact of the TEM on power systems.
A hierarchical TEM for energy trading within a microgrid is presented in Reference [25], where a cost benefit analysis is developed to assess financial benefits of local energy trading. Li et al. [26] develop a transactive energy trading framework for energy sharing between several islanded microgrids, where the dual decomposition is employed to solve the optimization problem in a distributed manner. An auction-based TEM for energy trading among active DERs is presented in Reference [27], where a double auction with average mechanism is employed as a pricing mechanism for energy trading. Marzband et al. [28] propose an algorithm for the optimum use of energy resources in home microgrids, where a market structure based on transactive energy is presented to increase market players' payoff. Building upon the current literature, this paper aims to extend the current research by outlining the requirements for TEM design in microgrids. In particular, we discuss the key DER requirements that provide the necessary foundation for TEM solutions in a smart microgrid. Then, we present the design requirements for a TEM, including transactive agent properties, potential services in the internal and external markets, and different pricing mechanisms for the microgrid market.

DER Integration; Benefits and Challenges
DER is a term to describe a collection of local energy resources including behind-the-meter generation (e.g., rooftop solar PV, small-scale combined heat and power units), energy storage (e.g., chemical-battery storage, thermal-phase-change material), electric vehicles (EVs) and flexible loads (e.g., electric water heaters). These are usually small-scale resources and are located on the customer side of the meter [29,30]. There is a range of benefits that DERs can provide in electricity networks. Distributed energy storage systems can help to defer investment in capital expenditure by reducing local peak demand. Power-electronic interfaced DERs can be used for voltage regulation in distribution networks. Furthermore, flexible loads in buildings, especially heating, ventilating, and air conditioning (HVAC) systems can be used to achieve demand side management objectives as well as providing ancillary services. Several studies have demonstrated how DERs can provide local energy balancing and ancillary services to improve power quality through reactive power compensation, asymmetry reduction, and load harmonic current compensation [31,32].
For individual DERs to unlock potential values for customers and the networks, they need to be aggregated and coordinated effectively. Poor management and coordination of DERs can result in increased network operation costs incurred by all customers [33]. There are several technical challenges associated with the DER integration. The increase in bidirectional power flows occurring due to the high DER penetration tends to raise the voltage level in the network. The increase in the distributed generations is leading to changes in power flow patterns by increasing periods in which power is being exported from distribution networks to transmission systems [34]. Also, significantly increased power export from solar systems may violate network constraints. The other challenge is the lack of visibility of DERs, leading to difficulty in operational forecasting, balancing load and generation, and maintaining the system security [35]. These challenges can be resolved through the orchestration and coordination of DERs in a smart microgrid, which provides value streams to DERs and incentivizes them to share their flexibilities. This would require integrating an information layer into the actual physical layer for data exchange. In this way, flexibility of DERs can be managed and coordinated in an appropriate way to provide various services for different stakeholders.

Smart Microgrids as a Solution
A microgrid is defined as a power system including different types of DERs grouped together within a limited geographic area, which is established to achieve specific local goals such as, carbon emission reduction, utilization of renewable energy resources, and cost reduction [36]. The microgrid structure and its different elements are illustrated in Figure 1. A microgrid can be a site within a private distribution network or a public distribution network, with one or more sources of electricity generation connected to the embedded network. Microgrid participants include consumers and prosumers with flexible load, on-site electricity storage, and various other types of DERs. A microgrid has a single connection point to the network, and supplies power to multiple third-parties. A control system controls dynamic supply and demand in the microgrid, and a third party system operator is in charge to manage and operate the microgrid [37]. The addition of ICT and active energy management layers to a microgrid converts it to a smart microgrid. Smart microgrid is a microgrid built upon smart grid technologies, which includes ICT-enabled energy consumers and producers who are able to manage themselves [38]. By efficiently using DERs, microgrids can benefit agents with lowering energy costs by shifting demand to lower price periods and by avoiding peak demand charges. Furthermore, microgrids can respond to changes in energy generation, demand and price through managing batteries and behind-the-meter generations. Allowing prosumers to share or trade energy, generated by renewable resources, with each other in a local energy market is another benefit of microgrids for customers. Through their interaction with the broader electricity network and the wholesale electricity market, microgrids could also reduce pressure on the network during high and peak demand and sell renewable generation in the wholesale market. Microgrids can also help the grid response to emergencies by providing frequency and voltage control services to the grid through the ancillary services markets.

Need for Transactive Energy Markets
Different approaches can be implemented for energy management in microgrids, which can be classified as passive, active, and transactive energy management. Details of different energy management mechanisms are shown in Figure 2. In passive energy management, a central operator manages all passive DERs. The direct load control program is an example of passive energy management, where consumers loads and flexibility are directly controlled by the central operator. Passive energy management does not consider DERs preferences, and all decisions are made centrally. Hence, the communication in passive management is unidirectional from the central controller of the utility company to the passive DERs. In active energy management, an optimization framework examines all flexible loads and generations to decide the best solution for the system, taking into account DERs data to incorporate their preferences in central optimization. Hence, bidirectional communication is needed for information exchange, which raises privacy concerns regarding private data of end-use DERs [39]. In both passive and active energy management approaches, the central operator is the decision maker for all of the system.  The third approach for energy management is transactive energy management, which allows both the demand and supply to actively negotiate the exchange of energy. Transactive energy is defined by GridWise Architecture Council (GWAC) as "a system of economic and control mechanisms that allows the dynamic balance of supply and demand across the entire electrical infrastructure using value as a key operational parameter [40]". Transactive energy encourages dynamic demand-side energy activities based on economic incentives and ensures that the economic signals are in line with operational goals to ensure system reliability without resorting to override control [41]. In transactive energy management, decision making is transferred to DERs. Through a distributed decision-making process, all DERs are able to decide on their actions in energy management, without revealing their private information.
Transactive energy management needs a new market framework for DERs to implement value-based signals to unlock more values for DERs and driving more efficient asset utilization and lower power system costs on the path to deep decarbonization [42]. TEM is such a new framework, which introduces several advantages in integrating DERs and microgrids into power systems. TEM provides the opportunity for small and mid-sized energy consumers or producers to exchange energy and other services in a distribution network under market rules. If energy providers and users can agree on the value of a service at a certain point in time and place, then the producer and consumer can each make a decision if they want to proceed with the transaction at that given price. However, the implementation of TEM needs a design pathway to manage its added complexity in a way that ensures transparency, choice, and ease of use to customers. In order to design a TEM as a framework in which the values of small-scale DERs can be optimized and remunerated, several design principles need to be embraced, particularly related to agents properties, pricing mechanisms, and internal and external market scenarios.

Transactive DER
In a TEM, all DERs are transactive agents that exhibit the fundamental behaviors of energy management and market participation. The energy management behavior encapsulates the functionality to manage, schedule, and control the DER's available flexibility, while the market participation behavior enables the DER to act as an independent competitive entity within the TEM framework. For DERs to be integrated efficiently in the TEM as a source of flexibility, their different preferences and requirements need to be considered. Hence, having a suitably representative model of each DER is of utmost importance to ensure effective participation in integration strategies.
The complexity of DER modeling would depend to a large extent on the type of DER involved. While modeling energy storage, solar PV, and EVs can be fairly straightforward, forecasting and controlling HVAC loads as a source of flexibility would require a detailed thermal modeling of the building. More generally, optimization-based and analytical models have worked well in the modeling and predictive control of energy storage and solar PV systems [43,44]. On the other hand, flexible loads in buildings, particularly HVAC systems, are more difficult to predict due to many uncertainties involved in occupancy-building interactions arising from both internal and external factors [45]. Nonetheless, for HVAC systems to be fully integrated in microgrid energy management, some form of online forecasting and control is required to accurately provide building flexibility values while correcting errors in market flexibility requests in real-time.
Transactive DERs are allowed to optimize their position based on forecasted load/generation and their preferences for the best outcome for them. They can hence choose to opt out of providing a service, unless they have been directly contracted to do so (e.g., for provision of frequency control services). Transactive DERs endeavor to adhere to market commitments through being responsive and adaptive to changing conditions. As the TEM is a request-based market, transactive DERs only provide the flexibility they choose to and cannot be forced to provide more, and this flexibility will be subject to overriding power quality control.

Pricing Mechanism
The core objective of a TEM is to use value-based signals to incentivize market players to provide efficient generation and demand decisions by managing their flexibilities, while taking into account the technical limitations of the network [42]. Hence, designing a pricing mechanism is a crucial step in implementing the TEM. The objective of designing the pricing mechanism is to provide right price signals to the right transactive agents to achieve the desired operational goals in the market [46]. Different dimensions can change the price, such as timing of when the energy consumption takes place, market players preferences and their location, and the amount of generation and demand in the market. Pricing mechanisms can be classified based on their attributes into different groups. The well-known approach in energy pricing is uniform pricing, where based on the demand and supply and market players preferences, a price would be indicated as the clearing price for all market players. Uniform price auctions, cooperative games, and coordinated distributed market clearing are examples of uniform pricing mechanism. The other approach for pricing mechanism is the differential pricing that allows to place a dynamic value on different aspects of the energy. Different prices can be generated based on the player preferences, source of energy (e.g., clean energy) [47], and location of energy (e.g., locational marginal pricing) [48].
Pricing mechanisms can also be classified based on the agents negotiation approach in the pricing process as single-issue or multi-issue pricing. In the single-issue pricing, agents receive a price signal from the market operator and indicate their offered flexibility based on their preferences. While in the multi-issue pricing, all agents are able to submit their offered flexibility, and its corresponding price to the market and market operator indicates the allocated flexibility to different agents as well as market clearing price. The pricing mechanism in TEM should be competition-based pricing, where prices from competitors will be used as the basis in setting the clearing price. Hence, the appropriate pricing mechanism should allow agents to negotiate on their actions based on their preferences.

Market Scenarios
A key starting point in developing the TEM is to identify the services that can be provided through competitive internal and external markets. TEM provides joint market and control functionality that allows agents to compete to provide the required service for the most efficient price [41]. As stated in Section 2, diverse types of services can be provided through interactive internal and external markets. Table 1 presents a classification of these services.

Type of Services Energy Flexibility Market objectives
Scheduling local resources at minimum cost in the time ahead, achieving an equilibrium point between local demand, local supply, and grid exchange.
Modifying generation and/or consumption patterns in reaction to market signals to provide services in internal and external markets (e.g., providing network services,or balancing local trading commitments) Potential approaches to achieve market objectives Different programs can be performed to provide energy services via the TEM. Energy service is a way to trade energy in different markets to reduce energy costs. Considering that local energy is mainly renewable-based generation and is cheaper than the grid supplied energy, decreasing the imported energy by the microgrid is a foremost step to reduce microgrid energy costs. This can be achieved by local energy trading in the microgrid, where energy is traded locally within the microgrid to decrease the imported energy from the grid. Also, orchestrated DERs operating as a microgrid can participate in external energy markets. It is envisaged that in a future grid, where retailers are managing the portfolio risk of an increasing amount of wholesale generation asset or contracts with an increasingly volatile demand from contracted customers, that customers may be able to help manage that risk (i.e., reduce exposure) cheaper than they can buy financial protection on the wholesale market. In addition, customers can expose themselves directly to wholesale prices if they have enough flexibility.

Flexibility Service
Transactive DERs are capable of modifying their production or consumption pattern based on the request of different entities such as retailers and network service providers (NSPs). Orchestrated flexibility of DERs can be used to provide network services for ensuring that the power system is operated in a safe, secure and reliable manner [49]. Microgrid can provide network services in energy and ancillary services markets. Ancillary service markets are in place in order to manage transactions for the network services for upward or downward adjustments in a short to very short term. These services are generally contracted to specific assets and are expected to be available (on notice) to provide the service when called upon. NSP can contract directly with the microgrid to provide these services. The ancillary services that microgrids can provide to the system can be categorized in two main groups: For each of these services, different scenarios and actions can be defined, where in each scenario a specific market objective should be identified. Depending on the type of service, different market intervals should be considered for the TEM. Hence, the designed framework should have the flexibility to work for different intervals. Also, agents' behavior in providing the requested service should be modeled to develop an appropriate algorithm for each scenario. In the next section, the TEM development process for an example scenario is explained.

Example Scenario: Demand Reduction Request from External Market
One of the services that transactive agents can provide in the TEM is demand reduction in response to an external signal. When there is a mismatch between generation and demand either due to high demand (e.g., hot day), or reduction in generation (e.g., coal generator shut down), microgrid receives an external signal, potentially from the retailer, asking to reduce the demand so the retailer can avoid exposure to high spot prices in the wholesale market. In return for doing so, microgrid receives a payment from the retailer. Once the signal is received, the TEM will automatically trigger a market event.
The input for the TEM is a price-volume flexibility request signal denoted by (F, λ F ), where F is the amount of requested flexibility, and λ F is the monetary reward per unit of energy. Upon receiving the flexibility request, the market operator requests transactive DERs to offer the flexibility that they can provide. The flexibility can be provided by a reduction in a building's energy demand (enabling flexible loads), reduction in EV charging rate, or a discharge from the battery (utilizing energy storage), combined with the predicted generation output from the solar panels (renewable generation). Agents use the forecasted load/generation and their preferences to offer the level of flexibility they are willing and able to provide in response to market requests. TEM uses a pricing mechanism to settle the market and to plan flexibility by determining commitments of DERs with accepted offers. Once settled, the market operator requests DERs to fulfill their commitments, and DER energy management system changes the DER control system states in accordance with the commitments made. This process in an automated process, which aims to limit human intervention so a rapid response can be provided. Upon delivering the requested flexibility, each DER will be paid a service fee for providing the flexibility, which would be based on the fulfilled commitments and market price for each time interval. This could either be by direct payment or through another model such as capacity payment.
Before entering the flexibility market, DERs first plan a demand profile for their flexible energy resources, considering their forecasted generation/load and their preferences in the market. Then in the market, agents decide on their actions considering their preferences and market price. The various responses of DERs to different price scenarios can be modeled analytically by a cost function. This cost function models the preferences of agents for providing different levels of flexibility through their different choices of cost function parameters [50]. For example, for a building, this cost function refers to discomfort cost incurred by building occupants, which arises from the change in the room temperature due to the change in HVAC load in response to flexibility request. For all agents, we represent the corresponding cost function as: where, f i is the offered energy flexibility by agent i, f i and f i are the minimum and maximum boundaries of flexibility of the agent. C i (.) is the discomfort cost incurred by agent due to providing the flexibility. In this function, α i , β i , and γ i are predetermined constant parameters, which represent the agent preferences in providing flexibility in each time slot and depend on the different conditions such as, weather, market price, and future loads. Objectives in the market are to provide the requested flexibility, and to minimize agents flexibility costs. Hence, the market objective can be written as (2) and Different pricing mechanisms can be applied to clear the market. Here, we explain two different pricing mechanisms: an auction-based and a distributed optimization pricing.

Auction-Based Pricing
First, an auction-based pricing mechanism is explained for the market clearing. The first step of the auction is bidding, where transactive agents submit their offers as O i = ( f i , λ i ) to participate in the auction, as a multi-issue negotiation. Each agent participates in the market by offering its maximum flexibility and uses (5) to calculate its marginal price The next step is clearing, in which after receiving all offers, the market operator generates the aggregated flexibility curve. Market clearing point is the intersection of the aggregated flexibility curve and the requested flexibility line. All agents with offered prices lower than the price at the intersection win the auction. If the aggregated flexibility is less than requested flexibility, all agents with offered price lower than λ F will be dispatched. Market clearing price is determined in settlement step, where both uniform price and pay-as-bid approaches can be applied. In the uniform pricing, price for all agents is equal to the price at the intersection, or λ F , whichever is the lower. In the case of pay-as-bid pricing, agents will be paid on their offered prices.

Distributed Optimization Pricing
In this section, a distributed approach for market clearing is explained, in which agents participate in the market as the price takers. The presented pricing mechanism is a single-issue, uniform pricing approach. In this approach, all agents are price takers and receive a price from the market operator for the flexibility market and respond to the market by announcing their offered flexibility. The objective function in (3) can be relaxed using Lagrangian multipliers to develop an iterative negotiation pricing mechanism [51]. In the negotiation process, TEM operator is the negotiation coordinator and agents react to the price by adjusting their flexibility. The TEM operator initiates the market by sending a price signal to all agents. Each agent needs to solve its local problem presented in (6) to update its flexibility in response to the market price Then, TEM operator updates price using (7) where, λ k+1 is the offered price by the market operator at iteration k + 1, ρ is the step size, and [.] λ F denotes the projection onto the feasible set (0, λ F ). The negotiation between TEM operator and agents continues till the convergence criterion in (8) is met.
where, is a small positive number indicating the algorithm termination. The price at convergence indicates the clearing price for all agents.

Project Overview
Monash University has committed to transitioning to net zero emissions by 2030. As a part of this transition, a microgrid is being developed to demonstrate how a 100% renewable electricity system can operate reliably, and the value it can provide to customers and the broader energy network. This Microgrid provides a realistic and useful platform for research into technological, business and customer behavioral features of the deployment of distributed resources and their coordination through microgrid operations. The microgrid system is intended to be a fully functioning local electricity network and trading market with dynamic optimization of resources interacting with an external energy market.
Monash Microgrid includes a range of customers and DER assets and is located at the Clayton campus, 20 km southeast of Melbourne's central business district. The microgrid network indicating different assets and their location is presented in Figure 3. The campus microgrid is composed of controllable loads totaling 3.5 MW, 1 MW of solar generation, two 22 kW EV chargers, and 1 MWh of battery storage. The energy management of these DERs and the microgrid as a whole will be achieved through the deployment of a smart microgrid platform. The microgrid's 3.5 MW controllable loads are the combination of the 20 mixed use and multi-tenanted buildings. The microgrid connected buildings closely replicate a real community with a variety of old and new buildings and a wide diversity of load profiles that emulate high occupancy spaces (arts theatre, laboratories and lecture theatres), light industrial (swimming pool complex), commercial (retail and staff offices) and residential (self-contained apartments). In addition to the buildings, the microgrid also has a number of EV chargers, which also act as controllable loads. The microgrid also includes 1 MW of solar generation through 8 separate PV systems installed on the rooftops of the buildings. While they are physically integrated with individual buildings, they can be considered as independent DERs when being managed and not as a generator of the building. The 1 MWh of battery storage is an integrated storage system consisting of a 120 kW/120 kWh lithium-ion battery and a 180 kW/900 kWh vanadium flow machine. As with the PV, the system has been installed and integrated with one of the buildings but can be managed as an independent DER.

Smart Microgrid Platform
The efficient energy management of the microgrid is achieved through a framework of progressive enablement layers, as illustrated in Figure 4, that introduces the compatibility with transactive energy governance. The foundational layers of DER Integration, Active Grid Management, and Smart Energy Management provide the functional and technological abstractions required to establish fundamental transactive microgrid behaviors. The formative completion with a governing TEM affords the managed operational autonomy required to classify as the framework as a smart microgrid. The detailed illustration of the enablement layers of transactive energy management is given in Figure 5. The DER Integration layer (Figure 5a) is a combined hardware and software deployment and integrated with each DER. An IoT Edge device is deployed on each DER with direct connections to the DER control systems and metering. A containerized IoT platform is installed on each device to provide a base for extending DER with data and control capabilities. Fundamental to the IoT platform is the decentralized transport of messages between nodes using a secure IoT message bus. It is crucial that DER can securely communicate with other DERs in the microgrid.
In preparation for the deployment of a smart microgrid platform, an enabling IoT hardware installation has been performed on all DERs in the Monash Microgrid. Ensuring the standards and maintenance requirements of the campus electrical infrastructure are met in a compliant and management manner necessitates a common method of physical integration, and installation of IoT functionality is applied to all DERs. This has been achieved through a uniform integration design that is implemented and installed using a common cabinet based hardware form factor. Connections to the DER's metering is through indirect Modbus TCP connections, where a gateway proxy communication between the meter and the IoT device. The PV systems are also connected by Modbus TCP through a gateway. Although the gateways do not provide further functionality, they do enforce a security precaution by keeping the DER and IoT systems on separate networks.  The integration design for buildings differ slightly in that while the specified building controller also enforces a network separation, the controller also performs additional functionality beyond just proxying communication. There are a variety of different building automation systems (BASs) deployed across the 20 buildings, and the functionality to map a common control interface to the individual BAS control actions should be implemented as extensions to the building control and not as IoT functions. By adding smart building controllers as the entry point to all BAS systems, a platform can be deployed encapsulating the complexities of exposing BAS control under a common campus standard for building control. Figure 6 shows the physical installation of the integration design for a building DER. The common cabinet form can be seen to house the IoT device (a), the building controller (b), along with their supporting electrical switches (c), and internal networking interface (d). The Active Grid Management layer (Figure 5b) introduces data monitoring and control capabilities to the microgrid DERs. These capabilities are deployed as extensions to the installed DER IoT platforms and allow the energy data and, where relevant, power quality data and control to be made available on the IoT message bus. These higher level DER capabilities allow the microgrid DERs to managed under the control of two active grid management cloud systems, a monitoring portal, and a power quality management system. The monitoring portal is a web based reporting and analytical application that combines and presents all available DER data in a single environment to ensure human operators can gain transparency and insight into the microgrid's operation. The power quality management system runs a live model of the microgrid using the latest data available from DERs to actively manage the microgrid power quality through detecting or predicting quality events and dispatching corrective or preventative actions to DERs with exposed power quality control capabilities.
The Smart Energy Management layer, presented in Figure 5d, adds two further sets of functionalities to the microgrid: DER energy management capabilities and a market-based solution for the aggregation, planning and dispatch of microgrid's DERs. The identified DER energy management functionality required for transactive energy is achieved through the addition of capabilities for demand forecasting, flexibility forecasting, and flexibility control. As illustrated in Figure 5c, each agent has a Flexibility Manager to indicate the range of flexibility which can be provided based on the demand and flexibility forecasts, and to control flexible assets in response to the flexibility requests from the market. Building on the preceding layers of DER Integration and Active Grid Management, these forecasting and control capabilities complete the functional foundation required for the market-based energy management solution of TEM.
While the TEM energy management functionality is a component of the Smart Energy Management layer, its complexity and decoupled foundation of DER flexibility capabilities warrant consideration as the final TEM governing layer of the Smart Microgrid Platform. This governing architecture is derived from the TEM design principles introduced in this paper with particular accommodation to the encapsulation of preference privacy and decision making within independent transactive DER.

TEM Implementation: Diagrams and Technical Architecture
The implementation of the TEM in the Smart Energy Management layer requires a distributed software solution, which provides the functionalities needed in achieving an efficient energy management. The key components of the TEM implementation and their interaction diagrams are presented in Figure 7. Figure 7a illustrates the key components of the TEM, where a central transactive microgrid system is paired with necessary transactive DER capabilities. The separation is reflective of the design principles of delegating aggregation, planning and orchestration to a distributed market mechanism while ensuring preference privacy and decision making are retained within the control of DER.  The core transactive DER capability is the Transactive Agent, which enables the participation in the TEM by responding to market requests (Figure 7b). The Transactive Microgrid system is the platform and host for a TEM Agent to orchestrate the flexible behavior of Transactive DERs in response to market signals received from both internal and external market requesters. Internal Requesters are microgrid monitoring capabilities that issue flexibility market requests in response to their monitoring function. For instance, a peak demand monitoring capability would issue a request to reduce the demand during the period for which a risk at exceeding a peak demand level has been forecast. External Requesters are capabilities which integrate with external systems such as energy or flexibility markets. An external demand response market would be integrated as an external requester capability, which would issue an internal flexibility market request corresponding to the external demand response signal. Signals from both internal and external requesters are resolved using the same Market capability that triggers the creation of internal markets to plan the coordination of Transactive DERs in the collective fulfillment market requests. The market plan is a collection of Transactive DER commitments to fulfill the market requester's flexibility request and will be recorded in Microgrid Transactive Energy Ledger.

DER
Agent's request diagram is given in Figure 7c. With the forecasts provided by the Flexibility Manager in conjunction with the DER preferences provided by the Preference Manager, the agent is equipped for considered responses to TEM signals. The Preference Manager provides a preference representation derived from the DER core function, such as HVAC schedules, and further data sourced from related business systems, such as a customer portal to record willingness to accept flexibility discomfort. Any accepted offer of the agents would be a commitment and needs to be delivered in the market. The delivery of commitments is managed by the Commitment Manager who manages the flexibility plan by sending flexibility signals to the Flexibility Manger, as presented in Figure 7d. The agent's commitments are recorded in the DER Transactive Energy Ledger.
The technical architecture of the Monash Microgrid software solution is presented in Figure 8. The DER agents are deployed on IoT devices of all transactive agents in the microgrid. The Market components are deployed as cloud services, communicating with agents via standard web protocols such as HTTPS or similar TCP messaging mechanism, represented as Application Bus. Multiple Docker containers are deployed on each edge device, with services supporting operational flow explained in Figure 7. These containers use internal messaging bus such as message queuing telemetry transport (MQTT) to communicate. The programming of different containers is implemented using the Java programming language. The cloud components include market requests, market settlement, and billing services. The market and billing systems have application program interfaces (APIs) exposed to user interfaces for Microgrid manager and market participants. To support interaction of the TEM with external requesters, the market API can also be exposed over the internet, to enable communication with the wholesale market or retailers. The configuration file server is hosted on the cloud. A directory is assigned to each edge node as a mirror of its local configuration directory. Configuration manager can dynamically update files in the cloud, which will then replicate to corresponding local drives on edge nodes.

Illustrative Example
In this section, we present and discuss an application of the TEM to implement the scenario discussed in Section 4.5 within the Monash Microgrid introduced in Section 5. This section aims to illustrate the impact of the consideration of design choices and pricing mechanisms on achieving different objectives in the market, and therefore, to highlight the value in using a framework to guide the design. We introduce two potential alternative objectives of maximizing individual DER value and minimizing DER discomfort costs. The results of simulating the pricing mechanisms are discussed in terms of both the operating objectives and the broader TEM design considerations.
It is assumed that the External Requester sends a signal for F = 800 kW demand reduction for one hour duration to the microgrid and the rewarding price for this reduction is λ F = 1.8 $/kWh. This price is an indicator of offers that Monash Microgrid is receiving from network providers to provide flexibility. All of the 20 flexible buildings in the microgrid participate in the market as transactive agents to provide the requested flexibility, where each building is represented by an agent. So hereafter, agent refers to a flexible building in the microgrid. The amount of flexibility that each agent can provide is indicated by the forecasts provided by the Flexibility Manager and this flexibility is bounded by a minimum and maximum limits. Each agent has a set of private preferences and chooses its flexibility cost parameters based on its preferences, obtained through the Preference Manager. The flexibility cost parameters, maximum available flexibility, and offered price in auction-based method for all agents are represented in Table 2. For all agents f i and γ i are assumed to be zero.    Simulation results for distributed optimization pricing are shown in Figure 10. The step size and the convergence criterion are set to 0.01 and 0.001 respectively. As shown in Figure 10a, after five iterations, the offered flexibility by agents converges to the requested flexibility, and the market rewarding price for agents is 1.72 $/kWh, which is less than λ F as shown in Figure 10b. The commitment of different agents as a percentage of their offered flexibility in different approaches are compared in Figure 11a. In the auction-based approach, the dispatched flexibility is based on agents' offers, and only agents with offers lower than the last dispatched agent's offer win the auction. While in the distributed optimization pricing, agents can iteratively offer their flexibility based on the offered price by the market operator. The total flexibility cost and total paid money to agents for different mechanisms are compared in Figure 11b. As illustrated, the lowest flexibility cost is obtained in the optimization-based method. This is due to the fact that the presented optimization-based pricing mechanism allows agents to minimize their flexibility cost at each iteration in response to the offered price by the market operator. The total paid money to agents is the highest in uniform price auction, as market price in this approach is the highest. The auction-based approach allows DERs to maximize their individual profit instead of minimizing the total flexibility cost of agents. In both auction-based and distributed pricing mechanisms, the aim is to compute a solution that achieves the TEM goal through the coordinated dispatch of transactive agents' flexibility. Subject to the design of the given pricing mechanism, the degree of an individual DER's participation in the dispatch coordination is ultimately determined through the decision authority that rests with the DER's transactive agent. While the decision on participation rests with each agent, the balance between the maximization of value and the minimization of flexibility cost is intrinsic to the function of the pricing mechanism and, therefore, not directly controllable through an agent's decision. Although both of the discussed pricing mechanisms are designed for the same end, it is evident in the results that they achieve this end with a distinct variation in the competitive opportunity and balance between value and discomfort cost.

Power Quality Manger
The competitive opportunity afforded to individual agents through the auction-based mechanism limits the flexibility provision to only the subset of agents whose offers were successful. This results in a higher total payout and an increased share of the total flexibility value distributed to the successful agents. This increased total and individual value come not only with the increased discomfort cost but also with the inevitable risks of a competitive auction environment. When considering these risks, particular consideration must be given to potentially lucrative collusive, predatory and entry deterring behaviors when the designing auction mechanisms for energy markets [52].
The iterative nature of the distributed optimization mechanism introduces a more involved method of participation, where all agents contribute to the provision of flexibility. Unlike the auction mechanism where an agent's successful participation is primarily whether they are included in the subset of those with accepted offers, successful participation in the distributed mechanism is a more interpretable consideration. This consideration is in fact an agent's enactment of their decision authority in the iterative re-evaluation of their offered quantity of flexibility in response to the offered price by the market operator and their own internal discomfort cost. Consequently, an agent's competitive opportunity when participating in the distributed mechanism is largely contained within their own efficiency of decision making and discomfort cost. While the distributed mechanism does share the same risk of exploitation by untrustworthy agents, it is constrained by the technical risk of scalability where the communication and processing overhead of the iterative computation will increase with the number of participating agents and therefore be limited by the minimum time taken to compute a solution [53].
With these considerations, it is evident that the outcomes of different pricing mechanisms are likely to align with some objectives for applying TEM but not others. An objective of creating a competitive environment where individual agents are able to maximize their own value is suited to an auction-based mechanism. Whereas the objective of ensuring the minimization of the total discomfort cost of all agents is best served with the application of distributed pricing mechanism. Hence, in designing an objective-driven application of TEM, it is a fundamental consideration to design the pricing mechanism in conjunction with a clear understanding of the relationship between the TEM objectives and the likely market outcomes that can be expected from the application of the pricing mechanism. In turn, these functional and technical considerations must align with broader organizational and objectives and regulatory constraints. These must be addressed in the formulation of an efficient and strategically optimized framework for the successful application of TEM within an organization and physical DER environment.

Conclusions and Discussion
In this paper, we present a complete proposal of TEM as a framework for the design, implementation, and deployment of transactive energy solutions for energy management in microgrids. This paper elaborates on requirements to design an effective mechanism for the TEM, in which transactive DER properties, market scenarios, and pricing mechanisms are discussed. Also, Monash Microgrid, as a real-world implementation of transactive energy mechanism, is introduced to demonstrate the applicability of the TEM for microgrid energy management. Market design for transactive energy management in microgrids is relatively a new concept. The outcomes of this paper highlight the importance of having a guideline to design an effective framework for TEM. There are still some required steps to implement a TEM for truly unlocking values of DERs. A number of research directions, which may benefit from further analysis, are provided as follows: - Valuation of network services provided by microgrids: In a disaggregated market, where DERs have access to different markets, splitting incentives for different markets is a challenging task. The challenge is to provide clear price signals to DERs to highlight the importance of services provided by DERs considering the complexity due to competing or additional price signals from other sectors of the electricity value chain. -Interaction of TEM with existing electricity system: The integration of the TEM into the existing electricity system requires regulatory and policy reformation. The ways in which TEM is expected to interact with other stakeholders, such as retailers and network operators depend on the new regulatory and policy framework. Because the need for policy reform is still emerging, how TEM is enabled and developed for microgrids needs to be considered in the context of electricity policy more broadly. - Managing power quality issues in the TEM: Due to the increase DER integration to the grid, power quality management has become an issue in microgrids. Flexible DERs can support local networks by providing active and reactive power flexibility. However, a fixed technical response to manage power quality issues will not achieve the best value for DERs or for the network. Therefore, it is crucial to incorporate power quality management in the pricing mechanism. Future research needs to be performed to design pricing mechanisms to adjust DERs and responsive DER' contribution to power quality management in a way that achieves customer equity. -Cybersecurity in smart microgrids: Grid modernization through the integration of cyber systems introduces cyber-attack issues, which may affect the resilience of microgrid and result in loss of benefits for DER owners. Hence, countermeasure techniques should be considered to counter cyber attacks. These techniques should embrace different areas, such as prevention, detection, response, and recovery.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: