Active participation of industrial enterprises in electricity markets - a generic modeling approach

Industrial enterprises represent a significant portion of electricity consumers with the potential of providing demand-side energy flexibility from their production processes and on-site energy assets. Methods are needed for the active and profitable participation of such enterprises in the electricity markets especially with variable prices, where the energy flexibility available in their manufacturing, utility and energy systems can be assessed and quantified. This paper presents a generic model library equipped with optimal control for energy flexibility purposes. The components in the model library represent the different technical units of an industrial enterprise on material, media, and energy flow levels with their process constraints. The paper also presents a case study simulation of a steel-powder manufacturing plant using the model library. Its energy flexibility was assessed when the plant procured its electrical energy at fixed and variable electricity prices. In the simulated case study, flexibility use at dynamic prices resulted in a 6% cost reduction compared to a fixed-price scenario, with battery storage and the manufacturing system making the largest contributions to flexibility.


Introduction
Ever increasing energy demands, integration of variable renewable energy resources and less reliance on building new generation capacity from conventional power plants is resulting in an increased challenge for power systems to match the supply and demand at all times during their operation. This gap between supply and demand is referred to as flexibility gap by authors in Papaefthymiou et al. (2018). Among the various options to address this gap, demand-side energy flexibility (DSEF) is considered to be one viable solution, in which electricity consumers adapt (increase, decrease or shift) their energy consumption, which is also referred to as demand-response (DR) (Roesch et al. 2019).
The focus of this work lies in developing models and methods that allow industrial consumers to evaluate their DSEF potential and to participate in DR in a semi-automated or fully automated manner.
The energy flexibility of industrial enterprises could play a significant role in closing the flexibility gap. In Germany, the industrial sector consumes 44% of the total electricity (Lund et al. 2015), thus a significant portion. According to a Umweltbundesamt report from 2015 (Langrock et al. 2015), there is a technical DR potential of 6.5 GW from the industrial sector in Germany for at least one hour; however, authors in Stede (2016) argue that under current regulatory and technical barriers, only 3.5 GW of the DR potential is estimated to be viable.
Two categories of DSEF can be distinguished according to SEDC (2016): One is explicit DSEF, where consumers receive control signals from system operators or committed schedules from external agents and directly adjust their power consumption accordingly. In return, they receive a contracted remuneration. The other is implicit DSEF, in which consumers react to price signals. Various price based programs are being introduced to leverage implicit DSEF based on price signals, such as time of use (ToU), critical peak pricing (CPP) and real-time pricing (RTP) (Albadi and El-Saadany 2008). To facilitate DSEF, new market actors such as "aggregators" are also evolving, which act as intermediaries between end-consumers and electricity market. Their main role is to pool distributed units and market their generation capacity or DSEF on the several markets such as spot market with variable prices, balancing market and others (Stede et al. 2020). According to a white paper on the Electricity Market 2.0 by the Federal Ministry of Economics Affairs and Energy(BMWi), Germany (German Federal Ministry for Economic Affairs and Energy (BMWi) 2015), "aggregators can also open up the potential for flexibilization in medium-sized and small electricity consumers to the extent that they have direct access to energy markets". It is expected that industrial enterprises can also procure their electricity at variable prices in the future. This might apply not only to large and energy-intensive industries but also small and medium-sized enterprises (SMEs).
In addition to easy access to electricity markets, another challenge for industrial enterprises is the effort involved in implementing and operating a local process control system that responds to dynamic price signals. Increased use of "digitalization" could be a key driver to tackle this challenge and to leverage energy flexibility. According to the report "SMEs Digital" from (BMWi) (German Federal Ministry for Economic Affairs and Energy (BMWi) 2018), 88% of all SMEs see a connection between digitalization and corporate success, but for 51% of those companies surveyed, digitalization is not the core part of their business strategy. The increased use of digitalization could therefore also prove to be a door opener for industrial enterprises, especially SMEs, to flexibly consume their energy and profitably participate in the electricity markets of today and tomorrow.
Against this background, key research questions are whether it is really worthwhile for industrial enterprises to exploit their energy flexibility on the basis of dynamic prices, and how the technical entry barriers can be lowered. Methods and models are therefore needed which, on the one hand, can characterize the energy flexibility, the achievable profits and the associated effort in a company-specific and operation-focused manner and, on the other hand, enable a partially or fully automated implementation.
The characterization and modeling of industrial enterprises' flexibility has been intensively investigated over the last years. Some research works (Tristán et al. 2020;Schott et al. 2019;Pierri et al. 2020;Weeber et al. 2017) present data models and characterization methodologies for available energy flexibility measures (EFMs) on-site, while some works (Seitz et al. 2019;Roesch et al. 2019;Schott et al. 2018) also discuss the overall conceptual layout for using EFMs by also presenting IT-based synchronization platforms between flexible companies and external demand response agents.
When comprehensive automated data acquisition and process control are introduced as part of digitalization, the basis is also created for the use of advanced methods of data analysis, optimization and control (Scheidt et al. 2020). To also use these methods to provide automated use of energy flexibility, models are needed that can represent the energy flows themselves as well as the flexibility in the energy flows. This in turn requires modeling of the energy-relevant devices, plants, processes as well as all interdependencies. On the one hand, these models can be used in off-line simulations to assess the flexibility potential, or to assist in decisions on how to best use or increase flexibility. On the other hand, as part of model-based controls, they can help to realize semi-automated or fully automated operations with flexibility utilization, e.g. in response to external price signals.
The paper (Roesch et al. 2019) argues that industrial enterprises face particular challenges in the optimal use of flexibility due to the complex nature of their production processes and interdependencies. In addition, each industrial enterprise is different from another based on their type of manufacturing, final products, and associated processes. This complexity challenge also applies in particular to the modeling of energy flows and their flexibilities, as well as the use of model-based control and optimization approaches for automated use of flexibility.
The contribution of this work to the solution of the above-mentioned research questions and challenges is the development of a model library that is as generic as possible in order to be able to map the energy flows and energy flexibilities of various industrial companies with reasonable effort and to use them for model-based control and optimization. For this purpose, the models presented capture the energy, material and media flows within industrial companies, take into account so-called process dependencies and boundary conditions with sufficient accuracy and at the same time ensure a minimum complexity for mathematical optimization. To be applicable to as many companies as possible, the models are kept as generic and modular as possible. The developed model library is published as an open-source tool under GNU General Public License v3.0) (Offenburg University 2021).
In the remainder the concept of the generic industrial enterprise model library is presented in detail, including the generic modeling of the manufacturing systems (MFS), the technical building services (TBS) and the energy systems (ES). Then, in a case study, the model library is used to model and analyze the flexibilities of a steel powder manufacturing plant, before the paper ends with a conclusion and outlook.

A generic industrial enterprise model library
A general industrial enterprise can be considered as composed of various industrial systems that work together to execute the intended production through core and auxiliary processes. The systems are interconnected by material, energy, media and data flows (Beier 2017). Focusing on modeling of energy flexibility, the proposed generic model library considers a industrial enterprise to be composed of three major technical units, namely MFS, TBS and ES, see Fig. 1. The research approach is taken from existing research works of (Beier et al. 2015;Tristán et al. 2020), where they represent the industrial facility in these sub-units for their methodology for energy flexible industrial systems.
Each of these three units can contain different types of sub-units representing different generic key functionalities in industrial enterprise, for e.g cooling or heating systems as part of TBS. These sub-units can in turn be broken down to the lowest level, where concrete individual machines, devices and plants are modeled as the ultimate consumers and producers of electricity that directly affect the electric load profiles and flexibility.
To model the enterprise's energy flexibility and DR potential, the control of the technical units has to be modeled in addition to the technical units themselves. In the generic model library, these control and management functionalities are combined and modeled in an additional fourth technical unit, the energy and manufacturing control (EMC) unit. It contains the optimal control algorithms and coordinates the processes and energy consumption of defined technical units, alongside with having interfaces to external signals based on the participation mechanisms.
The sections below describe each of the technical units and relevant modeling parameters and constraints that are also chosen as inputs for the modules of the library.

Manufacturing systems -MFS
The MFS is the central and value-adding part of every industrial enterprise, determining the main electricity consumption activities of the production process. This is the system which transforms the energy, media, raw material and information into final products for the company (Beier 2017). For modeling this system as generically as possible for the  Table 1 Modeling parameters and constraints for MFS in the model library. purpose of optimal load control for DSEF, the MFS was modeled in form of a resourcetask network (RTN) (Castro et al. 2009). Table 1 shows the corresponding modeling parameters and constraints.

Resources
The resources include raw materials that serve as inputs for the production systems, products that are finished goods having some required quantity at the end of the planning horizon, storage facilities that serve as buffers for materials in production systems and production machines which consume electricity and transform materials. Tasks represent the manufacturing steps or jobs that are carried out to produce an intermediate or final product depending on the production flow. When the task is executed, it uses a machine or combination of machines. The operation of machines in turn increases or decreases the quantity of raw materials and products inside storage facilities. Production machines alongside with electrical power might also require other media and energy such as compressed air, heating and cooling that is supplied by the TBS.
When the production is being carried out, it might require special operation conditions, such as temperature or air quality, which can be ensured by heating and ventilation systems available in the TBS. The energy flexibility available in the MFS comes from degrees of freedom in production planning, where the execution of flexible production tasks can be interrupted or shifted according to external price signals. The relevant constraints for the MFS described in Table 1 are provided to the optimizer in the EMC module to make optimal use of the available flexibility.

Technical building services -TBS
The MFS needs certain media for its manufacturing processes, which must be provided by the TBS in requested quantities and at the right time. For this purpose, the TBS system contains corresponding units for the generation and intermediate storage of these media. For simplicity it is assumed that media cannot flow back to the TBS system as they might in a real enterprise. The sub-units of the TBS that are currently modeled in the library include air system (CAS), process cooling system (PCS), process heating system (PHS) and a simplified version of heating, ventilation and air conditioning (HVAC). Other building utilities such as lighting or humidity control can be included in the future. The main source of energy flexibility in the TBS is in the intermediate storage facilities for media, as they allow to alter and shift the load of media generation units.  In the following, we discuss the sub-units and their components of TBS that are available in the library as modeling blocks.
Compressed air system: A CAS is widely used in most of the industrial enterprises to supply the compressed air supporting the manufacturing process and equipment, including machine tools, clamping, spraying, material separation and material handling and pneumatic utility (Javied et al. 2018). The flexibility in these systems lies in the storage of compressed air in pressurized storage tanks, which can offer DSEF by making the energy consumption of compressors flexible. However, such systems have process constraints as, for example, that the air supply pressure in air distribution circuits or storage tanks must not fall out of the specified required operation levels. Table 2 shows the elements inside the CAS and considered parameters and optimization constraints.  Process heating and cooling system: PCS and PHS are important systems that provide heating and cooling as utility to MFS. For example, the operation temperatures of machines are required to be under certain limits, or materials need heating and cooling treatment before and after the production. The energy flexibility in these systems mainly comes from available thermal storage capabilities. Further, these systems can also supply the thermal energy to HVAC systems to maintain the desired operation temperature range and personal comfort depending on the climatic conditions. Table 3 shows the relevant parameters and constraints for energy flexibility modeling.
Heating, ventilation and air conditioning: HVAC systems are important for maintaining indoor comfort for personnel and favorable operating conditions for production machinery. For the purpose of energy flexibility, only thermal comfort has been considered in the developed model library so far, where the goal is to maintain the desired indoor temperature against the outdoor temperature using the dynamic indoor temperature prediction as in works of Harder et al. (2020); Hietaharju et al. (2018). Based on the desired thermal comfort, a heating or cooling demand is generated, which is provided by dedicated heating or cooling devices or also by thermal storage via PCS and PHS. Table 4 shows the parameters required for the modeling of the building HVAC system.

Energy systems -ES
The ES of the industrial enterprise in the developed model library comprises on-site electricity generation and storage. This includes electricity supply from locally installed photovoltaics (PV), combined heat and power (CHP) units which can also supply heat energy to the thermal storage units inside the PHS, and battery energy storage (BES). Further systems such as wind turbines or diesel generators can also be added. For the purpose of modeling energy flexibility, the mentioned systems are not modeled in detail and a consideration on the power level is sufficient. BES play a particularly important role in terms of flexibility, because its operational constraints are not directly linked with the constraints of the MFS and TBS systems, and hence these system provide greater flexibility to the industrial enterprise. The optimizer inside the EMC module that also ensures the power balance with the external grid, optimally decides the power flows of all controllable ES components. Table 5 shows the generic parameters and constraints for the components of the ES.

Energy and manufacturing control -EMC
The EMC module in the model library serves as a central control entity equipped with model based optimization. The main objective is to adapt the overall load demand of the industrial enterprise at the connection point of the grid and hence provide available flexibility. It contains generic mixed-integer linear programming (MILP) based optimization formulations for the technical units, which automatically consider the defined input parameters and constraints (Tables 1, 2, 3, 4 and 5). Figure 2 shows the structural layout of the EMC. The generic formulation of technical units results in the load demand where each of the given variables in Eq. 1 are optimally determined based on the provided process constraints. A positive grid power P Grid,t indicates consumption from the grid, whereas a positive electric storage power P BES,t indicates discharge. Negative values indicate feed-in to the grid and storage charging, respectively. The objective function of the optimization algorithm is to minimize the daily electricity procurement costs and CHP fuel costs, which is written as, where λ electricity t in e/kWH represents the electricity price at time step "t", which can be either fixed if the industrial enterprise procures its electricity at flat rate, or be variable based on the prices on the electricity market. t represents the sampling time step of the optimization horizon, which can be chosen generically as well. The input data for price signals is retrieved by the EMC from the Market block in the model library as shown in shows the fuel costs of CHP for time step "t". In the future, for example when other on-site energy generation assets such as diesel generator are added, their respective costs must also be accounted for in the objective function.
The developed optimization formulations contains the boundary conditions such as production planning from MFS, process and operational constraints from TBS and ES. Based on these degrees of freedom, the optimizer decides the values of load demand of individual units, which affects P grid,t . Further, for any specific technical units, their direct load forecast can also be added as external parameters, and the EMC ignores the optimization formulation for those units.
Currently, the nature of the optimization is that it solves for all the time steps in optimization horizon T and finds a global solution. However, as a later work it is intended to develop a cascaded optimization with a moving horizon approach. This will help to tackle and simulate the short-term disturbances in process parameters and fluctuation in price signals.
The software implementation of the generic model library is done in object-oriented Python. The development style is taken as motivation from the structure of open-source power system modeling tool pandapower (Thurner et al. 2018), where different elements  of power grids can be defined generically and added in a data-based structure. Likewise, in this industrial enterprise model library, each of the technical units and their sub-units are represented by separate modules as classes and sub-classes with generic inputs. Figure 3 shows the corresponding modeling diagram. Once all units are created, the control-relevant parameters of the defined technical units become available in the EMC block, and are used there in generic optimization formulations.

Case study -simulation
To apply and validate the proposed methodology, a real-world case of a steel-powder manufacturing plant layout was taken from Yu et al. (2016). As we want to showcase our methodology, we model the manufacturing process using MFS based on tasks and resources. Further, the case study has a nitrogen plant, which we ignore in our analysis, and add CAS, PHS and CHP as additional units. For this, we also assume our parameters concerning the developed methodology. The basic purpose is to test the models developed in this exemplary industrial company. Figure 4 shows the technical units, their sub-units and interdependencies via material and energy flow for the chosen case study. The MFS is composed of manufacturing tasks starting from melting of iron and coke to a final product coming out from the blending machine. For simplification of modeling, the manufacturing task related to blast furnace is not taken into account as it is a complex process in itself as per (Yu et al. 2016). The specifications of the modeled tasks in MFS is provided in Table 6. The tasks of type "INT" can be interrupted and shifted to feasible times following its run time constraints, while tasks of type "UN-INT" cannot be interrupted once they start; however, their start times can be adjusted. In the listed tasks, FRF is of type "CONST", which means that it is executed at all times in the planning horizon and has a uniform electricity demand.
The parameters for the machines used by the manufacturing tasks are provided in Table 7.
The other resources in the modeled MFS include a raw material RM with initial quantity of 2000 tons which is fed into the first machine, a sprayer SPR. For each task a dedicated storage facility is considered with maximum storage facility capacity of 300 tons. As the represented MFS system is of continuous manufacturing type, for each task an output material product is defined which becomes the input material for the next manufacturing task. In the production line, the last task is blending BL. Hence, the material coming out of this task represents the final product, for which a minimum required value of 150 tons  was given. This represents the quantity that will be produced at the end of the planning horizon by the production process, which is ensured by the optimizer. From Fig. 4, it can be seen that the chosen case study also contains PCS, PHS, CAS and HVAC as part of the TBS which serve as utilities to manufacturing operation in the MFS. The details of the components and their parameters are shown in Table 8. Table 9 lists the parameters of sub-units of ES system, which include a BES, CHP and PV.
The maximum amount of power to be exchanged with the grid was limited to 1000 kW. A simulation horizon of 24 hours with a sampling time step of 15 minutes was chosen as optimization parameters inside the EMC, which formulates the time window of the optimization formulation accordingly. For solving the optimization problem inside the EMC, the commercially available solver GUROBI (Gurobi Optimization LLC 2021) was used with academic license. The hardware on which simulation was performed included a Windows PC with four 3.2 GHz processors with 16 GB of RAM. The relative MIP optimality criterion was chosen as 1% in the solver, and it took under 40 seconds to solve the simulated optimization problems. For the analysis, the following pricing mechanisms were assumed: • Fixed price where the value of λ buy is 0.256 e/kWh including all the taxes and levies that are applied to industrial consumers.
• Variable prices in range of 0.2 -0.32 e/kWh based on the variability in given wholesale electricity market prices plus the applied taxes and levies. Figures 5 and 6 show the simulation results for the load profiles of the machines in the MFS with fixed and variable price mechanism respectively. The resulting load profiles are the outcome of an optimal scheduling of the manufacturing tasks, while also following the given constraints for the MFS. In the case of fixed prices, the optimizer decides to schedule the tasks in such a way that the self-consumption of PV is increased, which reduces the overall electricity purchase costs. With variable price mechanism, the optimizer decides to execute and shift the operations of the tasks to time intervals when prices are lower.

Results -load profiles and states of TBS systems
Figures 7 and 8 show the effect of volatile prices on the load profiles of the components and corresponding state variables inside TBS respectively. The optimal operation with variable prices results in a shift of the load demands of the devices to intervals where prices are lower as compared to that with fixed price scenarios. The flexibility in shifting of the loads is dependent on boundary conditions of both input and state variables. For instance, it can be observed from Fig. 7 that the operation of binary controlled devices i-e compressor K2, chiller C1, and heat-pump HP-1 follow the respective run-time constraints.
Further, Fig. 8 shows that state variables such as the pressure of CAS storage, the temperature of thermal storages in PCS and PHS, and indoor thermal temperature follow the dynamic prices without violating their provided boundary limits. Figure 9 shows the results of the optimization of the ES. The energy content of the battery almost remains constant for fixed prices, except that it uses the available PV power after 16:00 HRS. However, for variable prices the optimizer decides to charge and discharge actions in direct relation to volatile prices, and the energy content of the battery varies accordingly between the given capacity limits. Figure 9 shows that also the CHP unit operates flexibility with respect to variable prices. Figure 10 shows the industrial enterprise's total load demand and its power exchange with the distribution grid for both fixed and variable prices. Figure 10 also shows the flexibility provided as a comparison between fixed and variable prices. When the prices are low, the industrial enterprise offers negative flexibility (red bars) by increasing its power from grid, and when prices are high, it offers positive flexibility (blue bars) by lowering its power intake from grid.

Results -overall load profile and flexibility assessment
The contribution of each system to the overall flexibility is shown in Fig. 11. For the modeled case, the greatest flexibility comes from the adjustment of production related tasks in the MFS and the energy storage capability of the battery. The flexibility of the CAS, the PCS and the PHS is limited because of the low rated power of the devices due to the given process constraints. Figure 12 shows the daily cost comparison between four case scenarios for which the simulations were performed for the modeled case study. The daily costs for this case are the sum of the total daily electricity purchase cost and fuel costs for CHP operation. These scenarios chosen for cost comparison are, From the figure, it becomes clear that for the modeled case, cost reduction is more pronounced when the industrial enterprise uses its flexible assets (BES and CHP) with variable costs, where cost reduction between Case 1 and Case 4 was around 6%. The cost reduction depends on several factors such as variability in dynamic prices, electrical ratings of loads inside the defined technical units, the capacity of storage, and fuel prices for CHP (or other flexible assets such as diesel generators). Further, operational constraints and their limits can also affect the load flexibility and hence the costs as well.

Results -daily costs
The goal of this work was to show the methodology and use of the developed model. A detailed cost-benefit analysis is to be carried out as part of the future work.

Conclusion and outlook
This paper presents a generic modeling framework with optimal energy management and control for industrial enterprises to define their manufacturing systems, utility processes, and energy systems at a modular level.
The developed framework also includes generic optimization formulations that take care of production constraints in the MFS, process constraints in the TBS and physical constraints in the ES for the defined units while providing the flexibility. Electricity prices are the external input to the optimization algorithm's cost function and serve as the industrial enterprise's interface to electricity markets.
The developed model framework was applied to a case study of a steel-powder manufacturing plant for validation and for assessing the energy flexibility in terms of variable price signals. The simulation results showed that the optimizer decides to shift the load profiles of defined technical units towards the lower price intervals using the available flexibility potential. For the modelled case, the MFS and the BES provided most of the flexibility.
In the case study, the proposed modeling framework fulfilled the requirements of the research task posed at the beginning: The framework enables the modeling of an exemplary industrial company with regard to its energy flexibility with little effort on the basis of a manageable number of company-specific parameters. The flexibility potential to be achieved by dynamic prices and the profit to be expected for the company could be estimated. The authors are convinced that this framework can be applied in the same way to a large number of other industrial companies and in this sense fulfills the claim of being "generic".
In terms of an outlook, it can be assumed that the digitalization of industrial enterprises will progress rapidly in the next few years and that this will also create new prerequisites for advanced energy management in these companies. Model libraries such as the one proposed here could then form the basis for "digital twins" of industrial enterprises energy flows and flexibility potentials that in many ways facilitate semi-automated and fully automated flexibility provision and marketing. In order to prepare and research this development, an experimental twin of industrial enterprise is being set up at Offenburg University of Applied Sciences in parallel to the model library, which provides selected subsystems of the MFS, TBS and ES in real hardware. This will then exchange data with the digital twin and its EMC software module via standard industrial communication systems and be controlled automatically by it. This will require the development of further model library features such as data transfer, communication and control for real hardware.
From the modeling perspective, the work described is still ongoing as part of a research project. A non-exhaustive list of planned future developments is: • Adding granularity to the developed models which includes the representation of additional process constraints and characterization parameters; • Extending the developed optimization formulations towards rolling horizon or Model Predictive Control (MPC) for energy management such as in works of Habib et al. (2018); Dongol et al. (2018); Sawant et al. (2020). This will provide the model library an ability to deal with short term process disturbances and variations in electricity market signals for provision of flexibility; • Extending the market block of the model library to represent new and innovative flexibility products for industrial enterprises and modeling of those in cost functions and performing cost-benefit analyses for industrial enterprises.

About this supplement
This article has been published as part of Energy Informatics Volume 4 Supplement 3, 2021: Proceedings of the 10th DACH+ Conference on Energy Informatics. The full contents of the supplement are available online at https:// energyinformatics.springeropen.com/articles/supplements/volume-4-supplement-3.
Authors' contributions RK, MS, and RG conceived the idea presented. RK worked on software implementation, performed formal analysis and research, wrote the initial draft, wrote and revised drafts, and performed visualization. MS and RG arranged resources, wrote and edited review drafts, conducted analysis, and performed activities involving project management, funding, and acquisition. All authors read and approved the final manuscript.

Funding
This work was funded by Germany's Federal Ministry of Economics and Energy (BMWi) for the ongoing project "GaIN -Gewinnbringende Partizipation der mittelständischen Industrie am Energiemarkt der Zukunft" (Fkz: 03EI6019E). Publication funding was provided by the German Federal Ministry for Economic Affairs and Energy.

Availability of data and materials
For the developed case study production layout information has been taken from the example of Yu et al. (2016) with adaptations and assumption to represent the developed methodology. The weather data as outdoor ambient temperature has been taken from weather station located at Offenburg University of Applied Sciences. The PV generation profile has been taken from a real roof-top generation installed at one industrial enterprise participating in the research project. The contents of the developed model library are published under open-source GNU General Public License as Github repository and can be viewed on Offenburg University (2021). The icons used in Fig. 1 are downloaded from open source icons website https://www.flaticon.com/.

Competing interests
The authors declare that they have no potential conflict of interest in relation to the study in this paper.