Abstract
Energyintensive production sites are often supplied with energy by onsite energy systems. Commonly, the scheduling of the systems is performed sequentially, starting with the scheduling of the production system. Often, the onsite energy system is operated by a different company than the production system. In consequence, the production and the energy system schedule their operation towards misaligned objectives leading in general to suboptimal schedules for both systems. To reflect the independent optimization with misaligned objectives, the scheduling problem of the production system can be formulated as a bilevel problem. We formulate the bilevel problem with mixedinteger decision variables in the upper and the lower level, and propose an algorithm to solve this bilevel problem based on the deterministic and global algorithm by Djelassi, Glass and Mitsos (J Glob Optim 75:341–392, 2019. https://doi.org/10.1007/s10898019007643) for bilevel problems with coupling equality constraints. The algorithm works by discretizing the independent lowerlevel variables. In the scheduling problem considered herein, the only coupling equality constraints are energy balances in the lower level. Since an intuitive distinction is missing between dependent and independent variables, we specialize the algorithm and add a procedure to identify independent variables to be discretized. Thereby, we preserve convergence guarantees. The performance of the algorithm is demonstrated in two case studies. In the case studies, the production system favors different technologies for the energy supply than the energy system. By solving the bilevel problem, the production system identifies an energy demand, which leads to minimal cost. Additionally, we demonstrate the benefits of solving the bilevel problem instead of solving the common integrated or sequential problem.
Similar content being viewed by others
1 Introduction
Scheduling of production systems is an active research field and important for almost all kinds of industries (Harjunkoski et al. 2014; Castro et al. 2018). Recently, research in scheduling increasingly focuses on energy aspects (Gahm et al. 2016), where new challenges arise from more volatile electricity prices and more energy supply from renewable energy sources (Merkert et al. 2015; Mitsos et al. 2018).
Large energyintensive production systems are often supplied by onsite energy systems. Still, the onsite energy system is commonly not considered during the scheduling of the production system. Scheduling of production and energy systems is commonly performed sequentially: First, the production system is scheduled, and, second, the energy system is scheduled for the fixed energy demand. The fixed energy demand during energy system optimization can result in unnecessarily high energy cost because the production system does not account for the performance of the energy system. Integrated scheduling of production and energy system can reduce total cost. Agha et al. (2010) consider integrated scheduling of production and energy systems for operation. Leenders et al. (2020) extend the integrated scheduling of production and energy systems by the provision of control reserve, whereas Leenders et al. (2019b) also consider the synthesis of both systems. Thereby, the integrated scheduling assumes that the production system has full control over the energy system as well as complete information of the energy systems optimization problem.
However, in practice, systems are often operated by different companies. Thus, distributed optimization is performed. For this purpose, Allman and Zhang (2020) propose a solution algorithm to coordinate the optimization between different companies, i.e., an industrial process and its customers. The proposed algorithm considers that the different systems do not share their internal optimization problems with the other systems. The algorithm uses the method of Alternating Direction Method of Multipliers for distributed optimization (Boyd et al. 2010).
Wenzel et al. (2020) propose an algorithm to coordinate between different production plants in a large production site. Shared resources couple the production plants. The algorithm iteratively coordinates between the systems to meet the network balance of shared resources. The algorithm in Wenzel et al. (2020) is based on extensive earlier work of the authors, e.g., in Wenzel et al. (2016) an algorithm is proposed to adjust the prices for shared resources. Maxeiner and Engell (2020) compare different dualbased methods for the distributed optimization and apply the methods to a case study with coupled semibatch reactors. The reactors are coupled by a maximum for the combined feed flow rate.
Distributed optimization is important to take confidential issues into account while optimizing large industrial sites. In practice, each system often optimizes to its own objective and the decisions are taken sequentially. In this case, the overall problem cannot be considered as a singlelevel problem but should rather be considered as a hierarchical problem. This class of problem can be modeled as a Stackelberg game where the leader decides first, and subsequently, the follower decides according to the leader’s decision. Here, we consider a production site where the production system (leader) decides first by optimizing its objective, and the energy system (follower) satisfies the resulting energy demand while optimizing its own objective.
In a prior contribution (Leenders et al. 2019a, 2021), we proposed a method to coordinate the scheduling of production and energy systems with different objectives without requiring the subsystems to share their internal optimization problems. Since only incomplete information is shared, the method does not guarantee to identify the optimal solution in terms of the leader’s objective. Also other authors solved Stackelberg games for energy systems with exchange of incomplete information, e.g., between a utility company and customers (Maharjan et al. 2013; Soliman and LeonGarcia 2014; Yu and Hong 2016). In contrast to our previous work, in this work, we let the production system consider the energy system’s response with complete information. Thus, we consider complete information as in the integrated optimization but the production system does not have the full control over the energy system. Hence, we model the optimization problem as a bilevel problem with mixedinteger decision variables in the upper and lower level. The bilevel problem enables the identification of an optimal solution point for the production system in the given Stackelberg game situation. With the bilevel problem, we consider the sequential decision making between energy and production systems which is the common way to schedule their operation (Agha et al. 2010; Zhao et al. 2014; Zulkafli and Kopanos 2016). As an alternative, one can think of setting up a contract for demandside management between the systems. Depending on the design of the demandside management contract, an integrated optimization or a bilevel optimization should be applied. If the demandside management contract is designed so that the energy system cannot decide anything anymore on its own, an integrated optimization will provide the best solution. If the demandside management contract allows for independent decisions of the energy system, the demandside management contract will result in additional constraints in the bilevel problem. Thus, a Stackelberg game remains, and the bilevel problem would provide the optimal solution for the production system.
In bilevel problems, misaligned optimization problems are considered by an upper level (leader) and a lower level (follower). This hierarchical structure is realized by embedding the lowerlevel optimization problem in the constraints of the upperlevel optimization problem.
To the best of our knowledge, this work is the first to model the scheduling of production and energy systems as a bilevel problem. In the bilevel problem, the production system is considered as the upper level, and the energy system is the lower level. Here, we can model a bilevel problem since the production system has complete information on the energy system. The assignment of production system to the upper level and energy system to the lower level is chosen, since we assume that the production system announces its schedule first, and subsequently, the energy system fulfills the energy demand resulting from the production schedule. This is the same order of decision making as in the sequential optimization, which is the most used in industry (Pablos et al. 2021). Compared to the sequential optimization, the production system considers the sequential decision making in the bilevel optimization and benefits from this knowledge.
The resulting bilevel problem is characterized by a nonconvex lowerlevel problem. For this class of bilevel problems, solution algorithms are available for: nonlinear bilevel programming problems (NLBP) (Mitsos et al. 2008; Tsoukalas et al. 2009a, b; Wiesemann et al. 2013; Kleniati and Adjiman 2014a, b), mixedinteger nonlinear bilevel programming problems (MINLBP) (Mitsos 2010; Djelassi et al. 2019), and mixedinteger linear bilevel programming problems (MILBP) (Zeng and An 2014; Hemmati and Smith 2016; Fischetti et al. 2016; Yue et al. 2019).
In literature, others looked at scheduling based on a bilevel problem. Avraamidou and Pistikopoulos (2019) proposed an algorithm based on multiparametric programming to solve a MILBP. In their case study, the authors design and schedule a process with two production stages for three products. Yokoyama et al. (2019) solve a MILBP between a central power energy system and a distributed cogeneration system. The problem is solved by an algorithm that uses a KarushKuhnTucker reformulation. Kostarelou and Kozanidis (2021) propose a heuristic solution algorithm to solve a MILBP for the optimal pricebidding in dayahead electricity markets. In the MILBP, the upper level is the electricity producer and the lower level is a electricity consumer. The heuristic solution algorithm is compared to an exact solution algorithm and shows less computational requirements. Recently, Wogrin et al. (2020) present a review on applications of bilevel optimization in energy and electricity markets. As a challenge for further research, the authors identify lowerlevel problems including unitcommitment constraints with binary variables.
The production system considered in this paper results in a MILBP with coupling equality constraints, where the lowerlevel problem has unit commitment constraints with binary variables, i.e., binary variables if a unit is idle or running and binary variables for modeling partload performance. For its solution, we build on our previous work (Djelassi et al. 2019) that provides an extension of the methods in Mitsos et al. (2008) and Mitsos (2010). The extension allows the presence of coupling equality constraints. We use our previously proposed algorithm since this algorithm precedes other algorithms, which allowed us to collect lots of experience with this algorithm. From this experience and the performance in applications of industrialscale problems, we expect a good performance of the algorithm. Furthermore, the original algorithm can solve bilevel problems involving nonlinearities. In the algorithm proposed in this paper, we could model nonlinearities in the upperlevel problem.
The algorithms from our previous work (Mitsos et al. 2008; Mitsos 2010) solve bilevel programs by successively approximating the response of the lowerlevel program by a discretization of the lowerlevel feasible set. In Djelassi et al. (2019), we cope with the presence of coupling equality constraints by separating the lowerlevel variables into independent and dependent variables. Then, the independent variables are discretized as per the original algorithms, while the dependent variables are represented as variables which are fixed by the coupling equality constraints.
On the one hand, the bilevel problem of production system scheduling with an energy system as follower is a special case to the one considered in Djelassi et al. (2019), which allows us to skip certain subproblems of the algorithm. On the other hand, in Djelassi et al. (2019) we assume a known set of dependent lowerlevel variables, which are fixed uniquely by the coupling equality constraints. In our case, this assumption is violated in the sense that there exists no fixed set of dependent variables but rather a known number of dependent variables. For this purpose, we propose a procedure that determines the set of dependent variables. The choice of the dependent variable changes based on the energy system’s optimal solution. The identification of the dependent variables is part of an augmented algorithm.
This paper is organized as follows. In Sect. 2, we present the bilevel problem to be solved, i.e., scheduling of production and energy system. In Sect. 3, the algorithm is presented as well as the optimization problems used in the algorithm. In Sect. 4, we apply the algorithm to two case studies. The case studies are based on the production scheduling example from Kondili et al. (1993) and the energy system model from Voll et al. (2013) and are extended to a bilevel problem. With the case studies, we present the performance of the algorithm, and demonstrate the merits to solve bilevel problems instead of integrated and sequential optimization problems. For comparison, we also apply the method from Leenders et al. (2019a) for incomplete information exchange to the case studies. In Sect. 5, conclusions are presented.
2 Bilevel problem for scheduling production and energy systems
In this section, first, we introduce the bilevel problem to be solved, i.e., scheduling of production and energy systems. Second, we analyze the properties of the lowerlevel problem. With the properties, we devise a method for generating discretization points.
2.1 Formulation of the bilevel problem
The bilevel problem considers scheduling the production system in the upper level and scheduling the energy system in the lower level. The decision variables of the upper level, i.e., production systems, are the continuous variables \(\mathbf{x } \in {\mathbb {R}}^{n_x}\) and the binary variables \(\mathbf{y } \in \{0,1\}^{n_y}\). \(\mathbf{x }\) includes the energy demand \({\dot{E}}_{t,e}^\text {demand}\) in each time step t and for each energy form e. We denote the joint upperlevel variables as \(\mathbf{w }:=(\mathbf{x },~ \mathbf{y })\). The decision variables of the lower level, i.e., energy system, have the same notation as it is common in energy system modeling and are the power supplied by the energy conversion units \(\dot{\mathbf{V }}'\in {\mathbb {R}}^{n_V}\) and the operational state of the energy conversion units \(\mathbf{o }' \in \{0,1\}^{n_o}\). As it is the common notation in bilevel modeling, the decision variables of the lower level are written with a prime symbol \('\). For the representation of the lowerlevel variables in the upperlevel problem, the prime symbol \('\) is omitted. The mixedinteger linear bilevel problem (MILBP) considered in this paper has the following form:
The upperlevel optimization problem (scheduling of the production system) is presented in Eqs. (1) and (2) and the lowerlevel optimization problem (scheduling of energy system) in Eqs. (3)–(6).
The upperlevel objective \(f^\text {u}(\mathbf{w }, \dot{\mathbf{V }}, \mathbf{o })\) considers production cost \({\mathbf{c }^\text {PS}}^{T} \mathbf{w }\) and energy cost to be paid by the production system \({\mathbf{c }^\text {U,ES,V}}^{T} \dot{\mathbf{V }} + {\mathbf{c }^\text {U,ES,o}}^{T} \mathbf{o }\). The vectors \({\mathbf{c }^\text {PS}}^{T}\), \({\mathbf{c }^\text {U,ES,V}}^{T}\) and \({\mathbf{c }^\text {U,ES,o}}^{T}\) describe the cost depending on the upper and lowerlevel variables. \(\mathbf{w }\) are the upperlevel variables, and thus, the variables of the production system. \(\dot{\mathbf{V }}\) and \(\mathbf{o }\) represent the lowerlevel variables in the upper level. Constraints of the upper level consider the production recipe, task duration, etc. Here, we model the production system as a mixedinteger linear problem and summarize the constraints in matrix form with \(\mathbf{A }^\text {PS}\) and \(\mathbf{b }^\text {PS}\) as parameters of the production system. In the case study, we model the production system as a batch production system and use the StateTaskNetwork formulation (Kondili et al. 1993). However, also other models of the production system could be used in the upper level.
The lowerlevel objective \(f^\text {l}(\dot{\mathbf{V }}', \mathbf{o }')\) considers cost of the energy system \({\mathbf{c }^\text {L,ES,V}}^{T} \dot{\mathbf{V }}'\) \(+{\mathbf{c }^\text {L,ES,o}}^{T} \mathbf{o }'\) to supply the production system with energy. \({\mathbf{c }^\text {L,ES,V}}^{T}\) and \({\mathbf{c }^\text {L,ES,o}}^{T}\) are vectors for the cost depending on the lowerlevel variables. The lowerlevel constraints consider energy balances, partload performance, the operational limits of energy conversion units etc. \(\dot{\mathbf{V }}'\) is a vector of the power \({\dot{V}}_{t,u,e}'\) of energy form e provided by energy conversion unit u in time step t. \(\mathbf{o }'\) is a vector of the operational state \(o_{t,u}'\) of energy conversion unit u in time step t. \(o_{t,u}'\) is a binary variable and equals 1 if energy conversion unit u is operated in time step t. \(\dot{\mathbf{V }}'\) and \(\mathbf{o }'\) are the decision variables of the energy system.
The coupling equality constraints between lower and upper level, i.e., energy balances, are stated separately (Eq. (4)). In the coupling equality constraints, variables of the upper level are the energy demands of the production system \({\dot{E}}_{t,e}^\text {demand}\) for each energy form e in time step t. To clarify that this is an upper level decision variable, we also write \({\dot{E}}_{t,e}^\text {demand}\) under the min operator, even if it is an entry of the vector \(\mathbf{w }\). Variables of the lower level in the coupling equality constraints are the power \({\dot{V}}_{t,u,e}'\) of energy form e provided by energy conversion unit u in time step t.
In general, the behavior of energy conversion units is nonlinear, e.g., by a variable efficiency (Goderbauer et al. 2016). As it is common in energy system modeling, we linearize this nonlinear unit behavior by piecewiseaffine linear functions (Voll et al. 2013). For an easier separation into dependent and independent variables in the proposed algorithm (c.f. Sect. 3.2), we model each segment of the piecewiseaffine linear function as a separate energy conversion unit. Their operational states are connected via constraints. In the case study, we use the energy system model from Voll et al. (2013). However, also other energy system models could be used in the lowerlevel problem. Still, the partload performance needs to be modeled by piecewiseaffine functions, and all equations need to be linear as we assume this in our proof (Sect. 2.2 and Appendix B).
Here, all inequality constraints of the lower level are reformulated as parametric upper and lower bounds of the entries of \(\dot{\mathbf{V }}'\). Thereby, \(\dot{\text {V}}_{t,u,e}^{}(o_{t,u}')\) and \(\dot{\text {V}}_{t,u,e}^{+}(o_{t,u}')\) are affine linear functions (Eq. (5)). In Eq. (6), the connection between two energy forms is modeled. These connections appear only for specific energy conversion units, e.g., combinedheatandpower engines which supply electricity and heat simultaneously. These energy conversion units u with the corresponding two energy forms \(e_1\) and \(e_2\) are summarized in the set C. \(\text {a}_{u}\) and \(\text {b}_{u}\) are parameters to describe the connection between the energy forms.
2.2 Properties of the lowerlevel problem
The purpose of the energy system model (lowerlevel problem) is to identify optimal schedules with a medium time resolution, e.g., one hour. Thus, we neglect dynamics such as ramping constraints. Furthermore, we model an energy system without storage. Hence, no constraints to connect time steps need to be considered within the energy system model. Still, the algorithm is suitable to consider storage units, ramping constraints, and other constraints that connect time steps. For this purpose, the discretization points introduced later need to be defined for a specific energydemand curve and not for single energy demands. We expect that this extension would result in increased computational times.
In this paper, the lowerlevel decisions at one time step are independent of the decisions at all other time steps. Therefore and by linearity of the lowerlevel objective, the lowerlevel problem can be decomposed in a lowerlevel problem for each time step. The optimization problem of the lower level for a single time step t is:
The decision variables of the lower level are the output power of the energy conversion units \(\dot{\mathbf{V }}_{t}\) and the operational state of the energy conversion units \(\mathbf{o }_{t}\).
In Sect. 3, we present the algorithm to solve the bilevel problem from Eqs. (1)–(6). In the algorithm, we use the property that there always exists an optimal solution of the lowerlevel problem where all except one energy conversion unit per energy form e are operated at one of their operational limits, which we prove in the following two Propositions.
Proposition 1
Let the lowerlevel problem be given for a single energy form e and one time step t as
Therein, \(\dot{\mathbf{V }}_{t,e}\) is the vector of power supplied by the energy conversion units and \(\mathbf{o }_{t}\) is the vector of the operational state of each energy conversion unit. Note that the constraints to connect the energy forms (Eq. (10)) are omitted because only one energy form is considered.
For this problem, there exists an optimal solution in which at most one energy conversion unit is not operated at one of its operating limits. More precisely, let Problem (11) be feasible and let \((\mathbf{o }_{t}^*, \dot{\mathbf{V }}_{t,e}^*)\) be globally optimal in Problem (11). Then, there exists a solution \((\mathbf{o }_{t}^*, \tilde{\dot{\mathbf{V }}}_{t,e}\)) that is also globally optimal in Problem (11) and for which there exists at most one \(u \in U\) such that
Proof
Consider the case that \((\mathbf{o }_{t}^*, \dot{\mathbf{V }}_{t,e}^*)\) is given such that for zero or one \(u \in U\) the following equation hold:
Then, the result is proven immediately with \(\tilde{\dot{\mathbf{V }}}_{t,e} = \dot{\mathbf{V }}_{t,e}^*\).
Now consider instead that \(u_1, u_2 \in U, u_1 \ne u_2\) be given such that
and
Then, it follows from construction of Eq. (11) that all elements of the set
are feasible in Eq. (11). \(\dot{\mathbf{V }}_{t,e}^*\) is an optimal solution of an linear program on a facet of the feasible set. Accordingly, all points on that facet (points in M) are optimal in Eq. (11).
The point \((\mathbf{o }_{t}^*, \tilde{\dot{\mathbf{V }}}_{t,e})\) with \(\tilde{{\dot{V}}}_{t,u,e} = {\dot{V}}_{t,u,e}^*, \forall u \in U \setminus \{u_1, u_2\}\) and
lies within M and satisfies either \(\tilde{{\dot{V}}}_{t,u=u_1,e} = {\dot{V}}_{t,u=u_1,e}^+(\mathbf{o }_{t}^*)\) or \(\tilde{{\dot{V}}}_{t,u=u_2,e} = {\dot{V}}_{t,u=u_2,e}^(\mathbf{o }_{t}^*)\), proving the desired property. Note that in an optimal solution where two energy conversion units are not operated at their operational limits the cost factors \({c_{t,u,e}^\text {L,ES,V}}\) for these energy conversion units are equal. Otherwise, a change in the supplied power by the energy conversion units could result in a lower objective function value.
Finally, if there are more than two \(u \in U\) with \(\dot{\text {V}}_{t,u,e}^(\mathbf{o }_{t}^*)< {\dot{V}}_{t,u,e}^* < \dot{\text {V}}_{t,u,e}^+(\mathbf{o }_{t}^*)\), the above construction can be applied successively until the same result is reached. \(\square \)
We proved that there exists a solution for which only one energy conversion unit is not operated at one of its operational limits if there is only one form of energy e. More generally, in Appendix B, we show that the number of energy conversion units not operated at one of their operational limits can be reduced to the number of energy forms or below.
3 Algorithm to solve the bilevel problem
In Sects. 3.1–3.3, we first present the algorithm and second, in Sect. 3.4, we present the optimization problems considered in the algorithm, i.e., lowerbounding problem, lowerlevel problem, and auxiliary problem.
3.1 Algorithm
The proposed algorithm is based our algorithm from Djelassi et al. (2019). In Djelassi et al. (2019) we use discretization points from optimal lowerlevel solutions for representing the lowerlevel objective in the upperlevel problem. We assume that the lowerlevel variables are split into sets of dependent and independent variables. These sets are treated then differently in the discretization: independent variables are fixed and dependent variables are determined by the equality constraints.
In the bilevel problem in this paper, the choices for dependent and independent variables change for each discretization point. In the previous section and in the appendix, we proved that there are at most as many energy conversion units not operated at their operational limits as there are energy forms e considered. Thus, we can always set the power of the energy conversion units not operated at their operational limits as the dependent variables. The power supply by the energy conversion units operated at their operational limits are then the independent variables. Hence, there are at most as many dependent variables in an optimal solution point of the lowerlevel problem as energy forms are supplied by the energy system (c.f. Sect. 2.2).
We use these properties to identify discretization points from lowerlevel solutions, which means we identify independent and dependent variables. Thereby, the algorithm can solve the mixedinteger linear bilevel problem of production and energy system scheduling stated in Sect. 2.1.
In the following Sect. 3.2, we introduce the discretization points used in the algorithm. Afterward, we present the steps of the algorithm in Sect. 3.3.
3.2 Discretization points
A discretization point defines the independent and dependent variables for an optimal lowerlevel solution. Therein, the independent variables are fixed and the dependent variables are determined by the equality constraints. Discretization points are used to represent optimal lowerlevel solutions in the upperlevel problem.
In the bilevel problem of scheduling production and energy systems, the energy balances are the only coupling constraints between the upper and the lowerlevel problem. The energy balance is given in Eq. (4) and repeated here:
The energy demands \({\dot{E}}_{t,e}^\text {demand}\) are the upperlevel variables in the energy balance and the powers \({\dot{V}}_{t,u,e}\) provided by each energy conversion unit u are the lowerlevel variables. Thus, the only variable from the upperlevel problem in the lowerlevel problem are the energy demands \({\dot{E}}_{t,e}^\text {demand}\). Since discretization points are used to define optimal lowerlevel solutions in the upper level, discretization points are defined for given energy demands \({\dot{E}}_{t,e}^\text {demand}\). Thus, discretization points indicate the power supplied by each energy conversion unit if a particular energy demand occurs.
In Sect. 2.2 and Appendix B, we proved that there exists an optimal solution in which the number of energy conversion units not operated at one of their operational limits is less or equal to the number of energy forms e considered. We identify this optimal solution in the auxiliary problem (Sect. 3.4.3). This optimal solution is only valid for a specific energy demand. However, suppose we vary this energy demand, keep the power of the energy conversion units operated at their operational limits fixed, and compensate for the variation by adjusting the power of the energy conversion units not operated at their operational limits. In that case, the solution is still feasible until an energy conversion unit exceeds its operational limits. In this range of validity, the lowerlevel objective function value identified by the discretization point provides a lowerlevel feasible solution and, therefore, an upper bound of the lowerlevel objective function. Still, within the range of validity of a discretization point, another discretization point can give a tighter upper bound. We call the energy conversion units not operated at their operational limits free energy conversion units. These units define the dependent variables. The energy conversion units operated at their operational limits are named discretized energy conversion units and are the independent variables. For discretized energy conversion units, the operation is fixed in the discretization point k. These energy conversion units are either idle (indexset: \(D_{k}^\text {zero}\)) or operated at their minimal or maximal load (indexsets: \(D_{k}^\text {min}\) and \(D_{k}^\text {max}\)). Thus, the energy \({\dot{V}}^\text {D}_{k,t,u=d, e}\) supplied by these discretized energy conversion units is fixed in the discretization point k:
Here, \(\dot{\text {V}}^\text {min}_{u, e}\) and \(\dot{\text {V}}^\text {max}_{u, e}\) are the minimal and maximal load of energy conversion unit u, respectively.
For each discretization point k, time point t, and energy form e, the power of one energy conversion unit u is not fixed, and thus, is free. These free energy conversion units are summarized by the set \(d^\text {free}_{k,f}\). The index f counts the free energy conversion units for each discretization point k.
To fulfill each energy demand, the power of the free energy conversion units \({\dot{V}}^\text {D}_{k,t,u=d^\text {free}_{k,f}, e} \) is not limited. This unlimited power can lead to power values \({\dot{V}}^\text {D}_{k,t,u=d^\text {free}_{k,f},e}\) outside the operational limits of the free energy conversion unit. Outside the operational limits, the upper bound on the lowerlevel objective function is not considered anymore (c.f. Appendix A, Eq. (22) and Eq. (23)).
3.3 Steps of the algorithm
Algorithm 1 solves the MILBP by a lowerbounding problem, lowerlevel problem and auxiliary problem. The lowerbounding problem is a finite (discretizationbased) relaxation of the MILBP. The lowerlevel problem is solved for fixed upperlevel variables. The lowerlevel optimal solution is used to evaluate the upperlevel objective to generate an upper bound. This upper bound is valid in our case since there are no upperlevel constraints depending on the lowerlevel variables. Bilevel optimality of the upperbounding solution is assessed based on the lower bound provided by the lowerbounding problem. In an auxiliary problem, discretization points are identified from the solutions of the lowerlevel problem. The algorithm repeatedly solves these problems while the lowerbounding problem is tightened by adding discretization points until the optimality tolerance \(\epsilon ^\text {u}\) between upper and lower bound is reached.
Our algorithm exploits the structure of the lowerlevel problem. In the lowerlevel problem, all constraints are written for each time step and no constraint connect the time steps. The objective function only sums the cost of each time step. Thus, the lowerlevel problem can be decomposed into individual optimization problems for each time step t. Each of these individual optimization problems is parameterized only by its energy demand \({\dot{E}}_{t,e}^\text {demand}\). The solution obtained at one time step constitutes a valid discretization point for all time steps because discretization points are defined for energy demands in a single time step which can occur in multiple time steps. Thus, probably fewer iterations are needed to solve the bilevel problem. In general, the algorithm might also be suitable to consider constraints that connect time steps in the lowerlevel constraints. In this case, each discretization point defines the lowerlevel solution for a specific energydemand curve of the whole time horizon.
The algorithm terminates in finite time because there is a finite number of possible discretization points. The number is finite because there is a maximum number of combinations of free energy conversion units and discretized energy conversion units. In the worst case, an enumeration of all the discretization points would be necessary. However, in our applications of the algorithm, we observe that the algorithm does much better in practice and only needs a few iterations.
3.4 Subproblems of the algorithm
In this section, we present the optimization problems considered in the algorithm: lowerbounding problem, lowerlevel problem and auxiliary problem. To make the explanation more specific, we present the algorithm for the supply of two energy forms e, i.e., heat and electricity. These energy forms are assumed to be supplied by boilers, combinedheatandpower engines, and electricity grids.
3.4.1 Lowerbounding problem (LBD)
The lowerbounding problem is the upperlevel optimization problem (production system) while considering the constraints of the lowerlevel problem (energy system) and the lowerlevel objective by discretization points.
In the 1st iteration and, thus, without discretization points, the lowerbounding problem is composed from Eqs. (1), (2), (4), (5) and (6). Thus, in the 1st iteration, the lowerbounding problem corresponds to the integrated scheduling, where the production system has full control over the energy system.
After the 1st iteration, the optimal solutions of lowerlevel problems are considered by discretization points K. A discretization point represents the optimal solution of the lowerlevel problem for a particular energy demand. The lower level’s objective resulting from a discretization point \(\text {f}_{k,t}^\text {l,Discr. Point}\) is an upper bound on the lowerlevel objective \(f_{t}^\text {l,LBD}\) in the discretizaion points range of validity (Sect. 3.2). We model this upper bound by a bigM formulation:
The objective function value is only constrained if the binary variable \(\beta _{k,t}^\text {obj}\) equals 1. \(\beta _{k,t}^\text {obj}\) equals 1 if the power of the free energyconversion units is within the range of validity of the discretization point. Note that for a specific energy demand multiple discretization points can give an upper bound on the objective function.
The binary variables \(\beta _{k,t,f}^\text {lower}\) and \(\beta _{k,t,f}^\text {upper}\) identify if the power of the free energy conversion unit \({\dot{V}}^\text {D}_{k,t,u=d^\text {free}_{k,f}, e}\) is lower or higher than the operational limits. Thus, Eq. (23) ensures that the upper bound on the objective function in Eq. (22) is used if the power of the free energy conversion units is within their operational limits:
In Appendix A, equations are stated to identify if the power of the free energy conversion units is within the operational limits.
3.4.2 Lowerlevel problem (LLP)
The lowerlevel problem is the operation optimization of the energy system for a given energy demand. The lowerlevel problem can be solved independently for each time step t because there are no constraints that connect time steps in the lowerlevel. The lowerlevel problem was already stated in Eqs. (7)(10). Compared to the algorithm in Djelassi et al. (2019), here we do not have to evaluate in the upperbounding problem if the lowerlevel solution is feasible for the upper level. The evaluation is not necessary, since there are no lowerlevel variables in the constraints of the upper level. Hence, we can directly use the lowerlevel problem solutions to evaluate the upperlevel objective.
3.4.3 Auxiliary problem
The auxiliary problem identifies the discretization points from each lowerlevel solution. In discretization points, as few as possible energy conversion units are not operated at their operational limits. Thus, the objective of the auxiliary problem is to minimize the number of free energy conversion units (units that are not operated at their operational limits) while retaining the objective of the lowerlevel solution. The auxiliary problem considers the constraints of the lowerlevel problem. Because no constraints connecting time steps are considered in the lowerlevel problem, an auxiliary problem can be solved for each time step.
For each energy conversion unit, we define the 4 binary variables \(\alpha _{t,u}^{\text {min}}\), \(\alpha _{t,u}^{\text {max}}\), \(\alpha _{t,u}^{\text {zero}}\) and \(\alpha _{t,u}^{\text {free}}\). \(\alpha _{t,u}^{\text {min}}\) and \(\alpha _{t,u}^{\text {max}}\) identify if the energy conversion unit is operated at its minimal or maximal operational limit, respectively. \(\alpha _{t,u}^{\text {zero}}\) identifies if the energy conversion unit is idle. \(\alpha _{t,u}^{\text {free}}\) identifies if the energy conversion unit is operated between its operational limits.
The objective function of the auxiliary problem
is the minimization of the number of free energy conversion units in time step t.
In the constraints, the objective function value of the lowerlevel problem calculated with the variables of the auxiliary problem \(f_{t}^\text {l,aux}\) needs to be equal or lower than the objective function value from the lowerlevel problem \(\text {f}_{t}^\text {l,LLP}\):
The constraints of the lowerlevel problem need to hold in the auxiliary problem (Eqs. (8)–(10)). Additional constraints define the 4 binary variables \(\alpha _{t,u}^{\text {min}}\), \(\alpha _{t,u}^{\text {max}}\), \(\alpha _{t,u}^{\text {zero}}\) and \(\alpha _{t,u}^{\text {free}}\).
An energy conversion unit u is either operated at its operational limits, operated between its operational limits (free), or idle. Thus, for the sum of the binary variables we can state:
As stated at the beginning of Sect. 3.4, we show the equations to identify the energy conversion units at their operational limits for electricity grids, boilers and combinedheatandpower engines. Electricity grids are an example of energy conversion units without an operational limit. Boilers and combinedheatandpower engines are examples for energy conversion units with upper and lower operational limits. Combinedheatandpower engines are also an example for energy conversion units connecting two energy forms.
We model two electricity grids, one for the supply with electricity and one for the feedin of electricity into the grid. For the electricity grids, the 4 binary variables are defined in the following: The electricity grids have no upper operational limits and zero is the lower operational limit of the electricity grids. Thus, \(\alpha _{t,u}^{\text {max}}\) and \(\alpha _{t,u}^{\text {zero}}\) are defined to be zero:
\(D^\text {Grid}\) is a set containing all electricity grids.
We identify if the electricity grid is at the lower operational limit (\(\alpha _{t,u}^{\text {min}}=1\)) by:
\(\text {M}_{e=\text {el}}^\text {max}\) is a sufficiently large number such that the electricity demand from the electricity grid or the electricity supply to the electricity grid never exceeds this number. Thus, a electricity grid is identified as the free energy conversion unit for electricity (\(\alpha _{t,u}^{\text {free}}=\) 1) if the power \({\dot{V}}_{t,u,e=\text {el}}^\text {aux}\) is greater than 0.
The constraints to define the 4 binary variables for boilers and combinedheatandpower engines are given in the following: heat and electricity outputs are connected for a combinedheatandpower engine. Thus, if a combinedheatandpower engine is operated at its operational limit in heat supply, also the operational limit in the electricity supply is reached. Consequently, we identify if a combinedheatandpower engine is operated at its operational limit only for one energy form, i.e., heat. We identify if the power of a combinedheatandpower engine or a boiler is at its lower operational limit by:
If \(\alpha _{t,u}^{\text {min}}\) equals 0, the supplied power \({\dot{V}}_{t,u,e=\text {heat}}^\text {aux}\) needs to be lower or equal than the heat supply in maximal load \(\dot{\text {V}}^\text {max}_{u,e=\text {heat}}\). If \(\alpha _{t,u}^{\text {min}}\) equals 1, the supplied power \({\dot{V}}_{t,u,e=\text {heat}}^\text {aux}\) needs to be lower or equal than the heat supply in minimal partload \(\dot{\text {V}}^\text {min}_{u,e=\text {heat}}\) . Since the other constraints require that if a unit is operated the supplied power is greater or equal than the minimal partload, the unit is operated at its minimal operational limit. \(D^{CHP}\) and \(D^{Boiler}\) are sets with all combinedheatandpower engine and boilers, respectively.
If a combinedheatandpower engine or a boiler is operated at its upper operational limit \(\dot{\text {V}}^\text {max}_{u,e=\text {heat}}\) is identified by:
A similar explanation as for Eq. (30) applies for the upper operational limit.
Whether a combinedheatandpower engine or a boiler is idle is identified by checking if the power is within the upper and lower operational limit:
Thus, if the heat supply \({\dot{V}}_{t,u,e=\text {heat}}^\text {aux}\) is between the operational limits, the binary variables \(\alpha _{t,u}^{\text {min}}\), \(\alpha _{t,u}^{\text {max}}\) and \(\alpha _{t,u}^{\text {zero}}\) are zero and Eq. (26) sets \(\alpha _{t,u}^{\text {free}}\) to 1. In this case, the corresponding unit is identified as a free energy conversion unit for heat.
3.4.4 Integration of auxiliary problem in lowerlevel problem
It should be mentioned that the auxiliary problem can also be integrated into the lowerlevel problem if the number of free energy conversion units is known. For this purpose, the following constraints should be added:
Again, \(\alpha _{t,u}^{\text {free}}\) identifies if an energy conversion unit u is not operated at its operational limits (\(\alpha _{t,u}^{\text {free}}\)=1). The sum over \(\alpha _{t,u}^{\text {free}}\) is constrained by the number of allowed free energy conversion units \(\text {M}^\text {free}\). For the considered energy system in this paper, the energy system can supply 2 energy forms, and the maximum number of free energy conversion units \(\text {M}^\text {free}\) is 2 (c.f. Sect. 2.2).
In this paper, we use the auxiliary problem and present a more general formulation in which an identification of the number of free energy conversion units is not necessary.
4 Case studies
The algorithm is applied to solve the bilevel problem for scheduling production and energy system to two case studies. The production system is modeled based on the StateTaskNetwork formulation for batch production systems (Kondili et al. 1993). The production system in the case studies is based on the case study from Kondili et al. (1993) (Fig. 1). In both case studies, we use the same energy system model from Voll et al. (2013). The models of both systems are described in detail in our previous publication (Leenders et al. 2019a).
In the two case studies, the energy systems differ: in the first case study (CHP subsidies), we consider: 3 boilers (\(4\,\hbox {MW}\), \(1.5\,\hbox {MW}\), \(0.5\,\hbox {MW}\)) and 1 combinedheatandpower engine (\(3.5\,\hbox {MW}\)) which are connected to the electricity grid and the gas grid. In the second case study (Grid alternative), we consider: 3 boilers (\(4\,\hbox {MW}\), \(1.5\,\hbox {MW}\), \(0.5\,\hbox {MW}\)) and 2 combinedheatandpower engines (\(1.5\,\hbox {MW}\), \(1.5\,\hbox {MW}\)) which are connected to the electricity grid and the gas grid. The bigM parameters in Eqs. (22) and (29) cannot be calculated exactly. Thus, the values need to be defined big enough to properly model the reformulation as well as small enough to prevent bad numerical behavior. In the case studies, we didn’t experience any bad behavior from the choice of our bigM parameters.
For both case studies, we compare the bilevel optimization with three other optimization approaches: integrated optimization, sequential optimization and the method for incomplete information exchange from Leenders et al. (2019a). In the method from Leenders et al. (2019a), the energy system responds approximated demanddependent energy cost to the production system. The production system uses this information as basis for optimization. Thereby, the production system takes the misaligned objectives into account.
We recall that the integrated optimization of production and energy system optimizes both systems to the objective of the production system (upperlevel objective). For the production system, the integrated optimization is the ideal benchmark leading to the lowest cost, since, the energy system is operated in favor of the production system.
The sequential optimization is the most common optimization approach. In the sequential optimization, the production system is first minimized to the production cost. Therein, the production system has no information on the energy system. Thus, just the upperlevel problem is solved. The result is the production schedule and the energy demand. Subsequently, the energy system is optimized to the objective of the energy system. The energy demand is given by the previous production system optimization.
If we consider the situation of the production system as the leader and the energy system as the follower, both the integrated and the sequential optimization yield suboptimal solutions for the production system. The solutions are suboptimal because the response of the energy system is too optimistic or not anticipated, respectively. Although the solution of the integrated optimization promises the lowest costs for the production system, the energy system would follow its objective instead of the objective of the production system. To model this behavior, we fix the solution of the integrated optimization for the production system (upper level) variables and optimize subsequently the energy system (lower level). The cost increase for the production system is called regret since it expresses the excess costs that arise if a cooperative energy system is wrongly assumed. In contrast, the bilevel formulation assumes an independent energy system. Thus, the solution of the bilevel formulation provides the minimal realizable cost.
The algorithm and the benchmarks are executed on an Intel(R) Xeon(R) CPU E51660 v3 with 3 GHz running on openSUSE Tumbleweed with Kernelversion 4.17.13. The algorithm is implemented and the subproblems are written in C++ based on an early version of libALE (Djelassi and Mitsos 2019). The algorithm works in interaction with GAMS such that the subproblems are automatically formulated with their input data as GAMS code. The subproblems are then solved with GAMS 25.1.3 (GAMS Development 2018) using CPLEX 12.8.0.0 (IBM Corporation 2017) applying 8 threads. The sequential optimization and the integrated optimization problems are also formulated in GAMS 25.1.3 (GAMS Development 2018) and solved with CPLEX 12.8.0.0 (IBM Corporation 2017) applying 8 threads. The time limit for all optimization problems is set to \(1000\,\hbox {s}\), working memory is set to 30 GB, and the allowed absolute gap is \(10^{3}\). The optimality tolerance of the upperlevel objective function \(\epsilon ^\text {u}\) is set to 0.01. We choose such tight tolerances, since the optimization problems are solved fast and, thereby, we can identify the exact benefits of the bilevel solution compared to the common sequential and integrated optimization.
4.1 CHP subsidies
In this case study, the energy system gets subsidies for electricity produced by the combinedheatandpower engines, as it is the case, e.g., in Germany. The subsidies are not forwarded to the production system resulting in misaligned objectives. In Sect. 4.1.1, we describe the detailed setup and objectives. In Sect. 4.1.2, we present and discuss the results of the case study.
4.1.1 Formulation
In the bilevel problem for CHP subsidies, the production system is scheduled in the upperlevel problem for minimizing its production and energy cost. In the lowerlevel problem, the operation of the energy system is optimized. In the lowerlevel problem, the binary variables are: for each energy conversion unit and time step, a binary variable to decide if the energy conversion unit is operated, and a binary variable that allows to only buy electricity from the grid or either sell electricity to the grid at the same time.
The energy system gets subsidies for electricity produced by the combinedheatandpower engines, but the subsidies are not forwarded to the production system. The amount of subsidies are the German subsidies paid for combinedheatandpower engine with a capacity over \({2} \,\hbox {MW}\). The subsidies and energy prices are provided in Table 1. The prices for energy from the grid are not equal in the case studies to distinguish the case studies further.
In the following, we present the detailed formulation of the objective functions: The objective function of the production system \(f^\text {u}\) is the production cost \({\mathbf{c }^\text {PS}}^{T} \mathbf{w }\) and the energy cost to be paid by the production system (\({\mathbf{c }^\text {U,ES,V}}^{T} \dot{\mathbf{V }} + {\mathbf{c }^\text {U,ES,o}}^{T} \mathbf{o }\)):
The production cost \({\mathbf{c }^\text {PS}}^{T} \mathbf{w }\) consider fix cost \(OC^{fix}_{i,j}\) and variable cost \(OC^{var}_{i,j}\) for running task i on production unit j. \(W_{t,i,j}\) is a binary variable and equals 1 only in time step t when task i started on production unit j. \(B_{t,i,j}\) equals the batch size only in time step t when task i started on production unit j. Furthermore, variable cost \(OC_{s}^{stor}\) is considered for storing amount \(V_{t,s}\) of product s in time step t.
The energy cost \({\mathbf{c }^\text {U,ES,V}}^{T} \dot{\mathbf{V }} + {\mathbf{c }^\text {U,ES,o}}^{T} \mathbf{o }\) considers cost for purchasing gas, purchasing electricity, and revenues for selling electricity. The cost for electricity results from purchasing electricity \(V_{t,u=grid^{buy}, e=\text {el}}\) for a price of \(p^\text {el,buy}\). The revenues from selling electricity result from selling electricity \(V_{t,u=grid^{sell}, e=\text {el}}\) for a price of \(p^\text {el,sell}\). The cost for gas results from purchasing gas \(U^{gas}_{t}\) for the price of \(p^\text {gas}\). The amount of consumed gas is calculated by an affine function depending on \({\dot{V}}_{t,u,e=\text {heat}}\) and \(o_{t,u}\). For the cost to be paid to the energy system, a profit margin of the energy system could be added. Here, we assume only a profit margin for the energy system by subsidies for running combinedheatandpower engines.
The objective function of the energy system is the cost to be paid by the energy system:
These cost result from purchasing gas and electricity, revenues for selling electricity, and subsidies for running combinedheatandpower engines. The cost for gas is again calculated by the amount of gas \(U^{gas}_{t}\) and the price of gas \(p^\text {gas}\). The cost for electricity is calculated by the bought electricity \(V_{t,u=grid^{buy},e=\text {el}}\) and the price for electricity \(p^\text {el,buy}\). The revenues for selling electricity result from selling electricity \(V_{t,u=grid^{sell}, e=\text {el}}\) for a price of \(p^\text {el,sell}\). The revenues for selling electricity are increased by the subsidies \(p^{CHP,sell}\) for electricity produced by the combinedheatandpower engines. Further subsidies \(p^{CHP,prod}\) are gathered for electricity produced by the combinedheatandpower engines and not sold to the grid.
The case study CHP subsidies considers a time horizon of 12 h. Each time step has the same length \({\Delta }t\) of 1 h. In the last time step of the time horizon, the production system has supply 56 t of S7 and 108 t of S10. The parameters for equipment size, storage size, and operational cost of the production system are the same as in Leenders et al. (2019a). The parameters of the energy conversion units are taken from Voll et al. (2013).
4.1.2 Results
The optimal bilevel solution (\(f^{u,bilvl}={4936}\,\)€) saves \(3.3\,\%\) of the cost for the production system compared to the sequential optimization (\(f^{u,seq}={5106}\,\)€, c.f. Figure 2). The method from Leenders et al. (2019a) results in \(f^{u,inc.inf.}={5077}\,\)€ cost for the production system and saves \(0.6\,\%\) compared to the sequential optimization. The integrated optimization results in even lower cost (\(f^{u,int}={4637}\,\)€) than the bilevel optimization and saves \(9.2\,\%\) compared to sequential optimization. However, as mentioned previously, the integrated optimization assumes full cooperation of the energy system, which is not given in this case study. If we subsequently optimize the energy system to calculate the regret, the cost for the energy system decreases, but cost increases for the production system (\(f^{u,corr. int}={5117}\,\)€). The cost increase for the production system (regret) is \(9.4\,\%\). The regret results in even higher cost for the production system than in the sequential optimization (\(0.2\,\%\)). Thus, the bilevel optimization provides the minimal, realizable cost for the production system (Fig. 2).
The substantial cost benefits arise in the integrated optimization because the combinedheatandpower engines are not operated (c.f. Fig. 3). Thus, no heat and electricity are supplied by the combinedheatandpower engines and instead by the boilers and the electricity grid. Electricity from the electricity grid is cheaper for the production system, but for the energy system, the subsidies make the combinedheatandpower engines more beneficial. Thus, the production system favors that the energy system supplies electricity from the grid and the energy system favors to supply the electricity by the combinedheatandpower engines. In the sequential optimization, \(45.9\,\%\) of the electricity is covered by the combinedheatandpower engines. In hours where the energy system can produce more electricity than demanded, the energy system sells additional electricity to the grid.
In the bilevel optimization, \(20.1\,\%\) of the electricity demand is covered by combinedheatandpower engines because the energy system significantly benefits when using combinedheatandpower engines. The production system chooses a demand profile which results in low supply of electricity by the combinedheatandpower engines due to the relatively high cost of electricity covered by combinedheatandpower engines.
The subproblems of the bilevel algorithm, the method from Leenders et al. (2019a), the integrated optimization, and the sequential optimization are solved within the time limit and, thus, are solved to the predefined gap.
The sequential optimization and integrated optimization are solved each within \(2\,\hbox {s}\). The method from Leenders et al. (2019a) solves the problem in \(23\,\hbox {s}\). The proposed algorithm solves the bilevel optimization problem in \(262\,\hbox {s}\) and needs 4 iterations. The lowerlevel problem and the auxiliary problem are always solved well below \(1\,\hbox {s}\). The solution time of the lowerbounding problem increases with each iteration with \(<1\,\hbox {s}\), \(12\,\hbox {s}\), \(72\,\hbox {s}\) and \(178\,\hbox {s}\). The solution time increases since discretization points are added in each iteration. The algorithm identifies 13 discretization points in total. From the first iteration, 7 discretization points are identified, from the second iteration, 5 additional discretization points are identified, and finally in the third iteration, 1 additional discretization point is identified. With these 13 discretization points in the fourth iteration, the lowerbounding problem reaches the same result as the evaluation of the lowerlevel solution in the upperlevel objective and the algorithm terminates with the optimal bilevel solution. As expected, the cost resulting from the lowerbounding problem (LBD) increase in each iteration (Fig. 4), because in each iteration we add tightening constraints by the discretization points. No such trend exists for the optimal solution of the sum of the cost from the lowerbounding problem and the additional cost from evaluation of the lowerlevel solution in the upperlevel objective. Similar to the integrated optimization, these additional cost are named regret because they also arise from a subsequent optimization of the energy system. Since the lowest cost can only be reached by the optimal solution of the bilevel problem, the cost from the lowerbounding problem and the regret are never lower than the optimal solution of the bilevel problem (Fig. 4).
4.2 Grid alternative
In this case study, the energy system is only connected to the gas grid. Thus, the energy system provides heat and electricity, while it provides electricity only by combinedheatandpower engines. The production system can buy additional electricity directly from the electricity grid. First, we describe the detailed setup and the objectives (Sect. 4.2.1). Second, we present the results (Sect. 4.2.2).
4.2.1 Formulation
In the bilevel problem of Grid alternative, the production system is scheduled in the upper level to minimize its production and energy cost. The energy system is scheduled in the lower level. In the lowerlevel problem, we have the binary variables as in the case study CHP subsidies (Sect. 4.1.1).
In this case study, the production system pays a predefined price for heat and electricity to the energy system. Additionally, the production system is directly connected to the grid and can purchase electricity from the grid. Thus, the energy system has to cover the heat demand but not the electricity demand. The energy prices are given in Table 2.
The objective function of the upper level (production system) is \(f^\text {u}(\mathbf{w }, \dot{\mathbf{V }}, \mathbf{o })\) and considers production cost \({\mathbf{c }^\text {PS}}^{T} \mathbf{w }\) and energy cost (\({\mathbf{c }^\text {U,ES,V}}^{T} \dot{\mathbf{V }} + {\mathbf{c }^\text {U,ES,o}}^{T} \mathbf{o }\)) to be paid by the production system.:
The production cost \({\mathbf{c }^\text {PS}}^{T} \mathbf{w }\) is the same as in CHP subsidies (Eq. (35)). The energy cost \({\mathbf{c }^\text {U,ES,V}}^{T} \dot{\mathbf{V }}+ {\mathbf{c }^\text {U,ES,o}}^{T} \mathbf{o }\) consider cost for purchasing heat and electricity from the energy system as well as cost for electricity purchased directly from the grid. The cost for heat is calculated by the heat demand \({{E}}^\text {demand}_{t,e=\text {heat}}\) and the price for heat \(p^{heat}\). The cost for electricity from the energy system is calculated by the price for electricity from the energy system \(p^{el}_{ES}\) and the difference of electricity demand \({{E}}^\text {demand}_{t,e=\text {el}}\) and electricity already bought from the grid \(V_{t,u=grid^{buy}, e=\text {el}}\). The cost for electricity from the grid is calculated by the price for electricity from the grid \(p^{el}_{grid}\) and the amount of electricity bought from the grid \(V_{t,u=grid^{buy}, e=\text {el}}\).
The objective function of the lower level (energy system) is to maximize the profit (equal to minimization of negative profit). The profit of the energy system \(P_{}^\text {L,ES}\) considers revenues from selling heat and electricity to the production system, cost for purchasing gas and revenues for selling electricity to the grid:
The revenues from heat are calculated by the heat demand \({{E}}^\text {demand}_{t,e=\text {heat}}\) and the price for heat \(p^{heat}\). The revenues from selling electricity to the production system are calculated by the price for electricity \(p^{el}_{ES}\) and the difference between electricity demand \({{E}}^\text {demand}_{t,e=\text {el}}\) and electricity already bought from the grid \(V_{t,u=grid^{buy}, e=\text {el}}\). The cost of purchasing gas results from purchasing amount of gas \(U^{gas}_{t}\) to run the energy conversion units and the price for gas \(p^\text {gas}\). The amount of consumed gas is calculated by an affine function depending on \({\dot{V}}_{t,u,e=\text {heat}}\) and \(o_{t,u}\). The revenues from selling electricity result from selling amount of electricity \(V_{t,u=grid^{buy}, e=\text {el}}\) for a price of \(p^\text {el,sell}\).
In the last time step of the time horizon, the production system has supply the same amount as in the case study CHP subsidies, i.e., 56 t of S7 and 108 t of S10. All other parameters are the same as in CHP subsidies.
4.2.2 Results
Again, the bilevel optimization provides the minimal realizable cost for the production system (\(f^{u,bilvl}={6689}\,\)€). The bilevel optimization saves \(3.2\,\%\) compared to sequential optimization (\(f^{u,seq}={6910}\,\)€, Fig. 5). In this case study, the method from Leenders et al. (2019a) reaches the same cost (\(f^{u,inc.inf.}={6689}\,\)€) as the bilevel optimization. Still, as shown in the previous case study CHP subsidies, the identification of the bilevel solution is not guaranteed. The integrated optimization (\(f^{u,int}={5170}\,\)€) would result in \(25.2\,\%\) cost savings for the production system compared to the sequential optimization. As in CHP subsidies, the integrated optimization results in the best objective for the production system, but the solution from the integrated optimization is again not applicable in practice. The cost for the integrated optimization is increased after a subsequent lowerlevel optimization (\(f^{u,corr. int}={6989}\,\)€). The regret is \(26.3\,\%\) and consequently, the cost for the production system is even \(1.1\,\%\) higher than from the sequential optimization.
The cost benefits by the integrated optimization arise from energy supply by the combinedheatandpower engines (c.f. Fig. 6). The combinedheatandpower engines are operated such that electricity demand is totally supplied by the combinedheatandpower engines, because, in this case study, electricity from the energy system is cheaper than electricity from the grid for the production system. In the sequential optimization and in the bilevel optimization, only \(4\,\%\) and \(4.8\,\%\) of electricity demand is covered by combinedheatandpower engines respectively. This low coverage of electricity by the combinedheatandpower engines is caused because the energy system does not prefer to use combinedheatandpower engines to cover the electricity demand. This difference in the use of the combinedheatandpower engines results in the large cost differences between the integrated optimization and the other approaches.
The sequential and integrated optimizations are solved within \(2\,\hbox {s}\). The method from Leenders et al. (2019a) solves the problem within \(30\,\hbox {s}\). The proposed algorithm solves the bilevel optimization problem in \(153\,\hbox {s}\) and needs 3 iterations. The lowerlevel problem and the auxiliary problem are always solved well below \(1\,\hbox {s}\). The solution time of the lowerbounding problem increases with each iteration with \(<1\,\hbox {s}\), \(84\,\hbox {s}\) and \(68\,\hbox {s}\). The algorithm identifies 7 discretization points. Thus, fewer discretization points than time steps are needed, meaning that some discretization points are valid and used for multiple time steps. In the first iteration, 4 discretization points are identified, and in the second iteration, 3 discretization points are identified. The algorithm terminates in the third iteration and the optimal solution of the bilevel problem is identified.
As expected, the cost resulting from the lowerbounding problem increase in each iteration (Fig. 7) and the cost resulting from the evaluation of the lowerlevel solution in the upperlevel objective does not show a trend.
The case studies show that the proposed algorithm solves the bilevel problem efficiently with only a few iterations. Furthermore, the identified bilevel solution considers the misaligned objectives of production and energy system and if complete information on the energy system is available, the bilevel solution allows for the best solution in practical application.
5 Conclusions
The scheduling of production systems with onsite energy systems is commonly performed sequentially. An integrated optimization of both systems to an overall objective seems beneficial, but often, in practice, both systems have conflicting objectives. Bilevel optimization problems consider conflicting objectives between decisionmakers, i.e., a leader and a follower, and thus, lead to a more realistic modeling.
In this paper, we formulate a bilevel problem for production and energy system scheduling. To solve this bilevel problem, we select the relevant parts from the algorithm in Djelassi et al. (2019) and add a procedure to identify dependent and independent variables. Thereby, we can solve the bilevel problem of production and energy system scheduling.
The algorithm iteratively solves the bilevel problem, while 3 optimization problems are solved in each iteration: lowerbounding problem, lowerlevel problem, and auxiliary problem. In the lowerbounding problem, discretization points bound the lowerlevel objective function by solutions from the lowerlevel problem in previous iterations.
The algorithm is successfully applied to two case studies based on literature examples for scheduling a production system and an energy system. The solution of the bilevel problem reaches cost savings of \(3.3\,\%\) and \(3.2\,\%\) compared to the sequential optimization, and \(3.5\,\%\) and \(4.3\,\%\) compared to an integrated optimization including regret. Furthermore, cost savings are realized compared to a previous method from the authors based on incomplete information exchange.
Thus, on the one hand, the proposed algorithm solves the bilevel problem. On the other hand, the solution of the bilevel problem provides the best realizable solution for scheduling a production system which is supplied by an onsite energy systems.
Abbreviations
 \(B_{t,i,j}\) :

Size of batch started on production unit (continuous)
 \({\dot{E}}_{t,e}^\text {demand}\) :

Energy demand (continuous)
 \(\mathbf{o }\) :

Vector of operational states of energy conversion units (binary)
 \(o_{t,u}\) :

Operational state of energy conversion unit (binary)
 \(U^{gas}_{t}\) :

Gas consumption (continuous)
 \(\dot{\mathbf{V }}\) :

Vector of power supplied by energy conversion units (continuous)
 \(V_{t,s}\) :

Stored product (continuous)
 \({\dot{V}}_{t,u,e}\) :

Power supplied by energy conversion unit (continuous)
 \({\dot{V}}_{t,u,e}^\text {aux}\) :

Power supplied by energy conversion unit in auxiliary problem (continuous)
 \({\dot{V}}^\text {D}_{k,t,u, e}\) :

Power supplied by energy conversion unit in discretization point k (continuous)
 \({\Delta } \dot{\text {V}}_{e}\) :

Change in energy supply by energy conversion units (continuous)
 \(\mathbf{w }\) :

Joint upperlevel variables
 \(W_{t,i,j}\) :

Batch start on production unit (binary)
 \(\mathbf{x }\) :

Upperlevel continuous variables
 \(\mathbf{y }\) :

Upperlevel binary variables
 \(\alpha _{t,u}^{\text {min/max}}\) :

Identification for energy conversion unit is at minimal/maximal operational limit (binary)
 \(\alpha _{t,u}^{\text {zero}}\) :

Identification for energy conversion unit is idle (binary)
 \(\alpha _{t,u}^{\text {free}}\) :

Identification for energy conversion unit is operated between operational limits (binary)
 \(\beta _{k,t}^\text {obj}\) :

Identification for the discretization point is valid (binary)
 \(\beta _{k,t,f}^\text {lower}\) :

Identification for power is lower than operational limit (binary)
 \(\beta _{k,t,f}^\text {upper}\) :

Identification for power is higher than operational limit (binary)
 \(\mathbf{A }^\text {PS}\) :

Matrix of parameters of the production system
 \(\text {a}_{u}\) :

Parameter to model energy conversion units connecting energy forms
 \(\mathbf{b }^\text {PS}\) :

Vector of parameters of the production system
 \(\text {b}_{u}\) :

Parameter to model energy conversion units connecting energy forms
 \({\mathbf{c }^\text {L,ES,o}}^{T}\) :

Cost vector from operational states of energy conversion units for the lower level
 \({\mathbf{c }^\text {L,ES,V}}^{T}\) :

Cost vector from supplied power for the lower level
 \({\mathbf{c }^\text {U,ES,o}}^{T}\) :

Cost vector from operational states of energy conversion units for the upper level
 \({\mathbf{c }^\text {U,ES,V}}^{T}\) :

Cost vector from supplied power for the upper level
 \({\mathbf{c }^\text {PS}}^{T}\) :

Cost vector for upperlevel variables
 \(\text {f}_{k,t}^\text {l,Discr. Point}\) :

Lower level’s objective resulting from a discretization point
 \(\text {f}_{t}^\text {l,LLP}\) :

Objective function value from the lowerlevel problem
 \(\text {M}^\text {free}\) :

Number of allowed free energy conversion units
 \(\text {M}_{e}^\text {max/min}\) :

Large parameter for bigM reformulation depending on energy form
 \(\text {M}^\text {obj}\) :

Large parameter for bigM reformulation on the lowerlevel objective function
 \(\text {M}^\text {lower/upper}_{k,t,f}\) :

BigM to fulfill energy balance in discretization point
 \(\text {OC}_{s}^\text {stor}\) :

Cost of storing product
 \(\text {p}^\text {CHP,prod}\) :

Subsidies for onsite consumed electricity from combinedheatandpower engines
 \(\text {p}^\text {CHP,sell}\) :

Subsidies for electricity sold to the grid from combinedheatandpower engines
 \(\text {p}^\text {el,buy}\) :

Electricity price for purchase
 \(\text {p}^\text {el}_{ES/grid}\) :

Electricity price paid by the production system to the energy system/grid
 \(\text {p}^\text {el,sell}\) :

Electricity price for selling
 \(\text {p}^\text {heat}\) :

Price for heat
 \(\text {p}^\text {gas}\) :

Price for gas
 \({\Delta } t\) :

Length of time step
 \(\dot{\text {V}}^\text {min/max}_{u, e}\) :

Minimal/maximal load of energy conversion unit u
 \(\epsilon ^\text {u}\) :

Optimality tolerance
 \(u \in d^\text {free}_{k,f}\) :

Free energy conversion units in discretization point k
 \(e \in E\) :

Energy forms
 \(i \in I\) :

Tasks
 \(j \in J\) :

Production equipment
 \(k\in K\) :

Discretization points
 \(s \in S\) :

Products
 \(t \in T\) :

Time steps
 \(u \in U\) :

Energy conversion units
 \((u,e_1,e_2) \in C\) :

Energy conversion units connecting energy forms
 \(u \in D_{k}^\text {max/min}\) :

Energy conversion units at maximal/minimal operational limit in discretization point k
 \(u \in D_{k}^\text {zero}\) :

Idle energy conversion units in discretization point k
 \(u \in D^\text {Boiler}\) :

Boilers
 \(u \in D^\text {CHP}\) :

Combinedheatandpower engines
 \(u \in D^\text {Grid}\) :

Grids
References
Agha MH, Thery R, Hetreux G, Hait A, Lann JML (2010) Integrated production and utility system approach for optimizing industrial unit operations. Energy 35(2):611–627. https://doi.org/10.1016/j.energy.2009.10.032
Allman A, Zhang Q (2020) Distributed cooperative industrial demand response. J Process Control 86:81–93. https://doi.org/10.1016/j.jprocont.2019.12.011
Avraamidou S, Pistikopoulos EN (2019) A bilevel formulation and solution method for the integration of process design and scheduling. In: Muñoz SG, Laird C, Realff M (eds) Proceedings of the 9th International Conference on Foundations of ComputerAided Process Design. Elsevier, pp. 17–22. https://doi.org/10.1016/B9780128185971.500035
Boyd S, Parikh N, Chu E, Peleato B, Eckstein J (2010) Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations Trends® Mach Learn 3(1):1–122. https://doi.org/10.1561/2200000016
Castro PM, Grossmann IE, Zhang Q (2018) Expanding scope and computational challenges in process scheduling. Comput Chem Eng 114:14–42. https://doi.org/10.1016/j.compchemeng.2018.01.020
Djelassi H, Mitsos A (2019) libALE—a library for algebraiclogical expression trees. https://git.rwthaachen.de/avt.svt/public/libale.git
Djelassi H, Glass M, Mitsos A (2019) Discretizationbased algorithms for generalized semiinfinite and bilevel programs with coupling equality constraints. J Global Optim 75:341–392. https://doi.org/10.1007/s10898019007643
Fischetti M, Ljubić I, Monaci M, Sinnl M (2016) Intersection cuts for bilevel optimization. In: Louveaux Q, Skutella M (eds) Integer programming and combinatorial optimization. Springer International Publishing, Berlin, pp 77–88. https://doi.org/10.1007/9783319334615_7
Gahm C, Denz F, Dirr M, Tuma A (2016) Energyefficient scheduling in manufacturing companies: a review and research framework. Euro J Oper Res 248(3):744–757. https://doi.org/10.1016/j.ejor.2015.07.017
GAMS Development (2018) General Algebraic Modeling System (GAMS). http://www.gams.com/
Goderbauer S, Bahl B, Voll P, Lübbecke ME, Bardow A, Koster AM (2016) An adaptive discretization MINLP algorithm for optimal synthesis of decentralized energy supply systems. Comput Cheml Eng 95:38–48. https://doi.org/10.1016/j.compchemeng.2016.09.008
Harjunkoski I, Maravelias CT, Bongers P, Castro PM, Engell S, Grossmann IE, Hooker J, Méndez C, Sand G, Wassick J (2014) Scope for industrial applications of production scheduling models and solution methods. Comput Chem Eng 62:161–193. https://doi.org/10.1016/j.compchemeng.2013.12.001
Hemmati M, Smith JC (2016) A mixedinteger bilevel programming approach for a competitive prioritized set covering problem. Discrete Optim 20:105–134. https://doi.org/10.1016/j.disopt.2016.04.001
IBM Corporation (2017) IBM ILOG CPLEX Optimization Studio. User Guide, www.cplex.com
Kleniati PM, Adjiman CS (2014a) Branchandsandwich: a deterministic global optimization algorithm for optimistic bilevel programming problems. part i: Theoretical development. J Global Optim 60(3):425–458. https://doi.org/10.1007/s1089801301217
Kleniati PM, Adjiman CS (2014b) Branchandsandwich: a deterministic global optimization algorithm for optimistic bilevel programming problems. part ii: Convergence analysis and numerical results. J Global Optim 60(3):459–481. https://doi.org/10.1007/s1089801301208
Kondili E, Pantelides C, Sargent R (1993) A general algorithm for shortterm scheduling of batch operations  I. MILP formulation. Comput Chem Eng 17(2):211–227. https://doi.org/10.1016/00981354(93)80015F
Kostarelou E, Kozanidis G (2021) Bilevel programming solution algorithms for optimal pricebidding of energy producers in multiperiod dayahead electricity markets with nonconvexities. Optim. Eng. 22(1):449–484. https://doi.org/10.1007/s1108102009521y
Leenders L, Bahl B, Hennen M, Bardow A (2019a) Coordinating scheduling of production and utility system using a stackelberg game. Energy 175:1283–1295. https://doi.org/10.1016/j.energy.2019.03.132
Leenders L, Bahl B, Lampe M, Hennen M, Bardow A (2019b) Optimal design of integrated batch production and utility systems. Comput. Chem. Eng. 128:496–511. https://doi.org/10.1016/j.compchemeng.2019.03.031
Leenders L, Starosta A, Baumgärtner N, Bardow A (2020) Integrated scheduling of batch production and utility systems for provision of control reserve. In: Proceedings of ECOS 2020  33rd International Conference on Efficiency, Cost, Optimization, Simulation and Environmental Impact of Energy Systems, Osaka, Japan, pp. 712–723, https://doi.org/10.3929/ethzb000423722
Leenders L, Ganz K, Bahl B, Hennen M, Baumgärtner N, Bardow A (2021) Scheduling coordination of multiple production and utility systems in a multileader multifollower stackelberg game. Comput. Chem. Eng. 150:107321. https://doi.org/10.1016/j.compchemeng.2021.107321
Maharjan S, Zhu Q, Zhang Y, Gjessing S, Basar T (2013) Dependable demand response management in the smart grid: a Stackelberg game approach. IEEE Trans. Smart Grid 4(1):120–132. https://doi.org/10.1109/TSG.2012.2223766
Maxeiner LS, Engell S (2020) Comparison of dual based optimization methods for distributed trajectory optimization of coupled semibatch processes. Optim. Eng. 21(3):761–802. https://doi.org/10.1007/s11081020094997
Merkert L, Harjunkoski I, Isaksson A, Säynevirta S, Saarela A, Sand G (2015) Scheduling and energyindustrial challenges and opportunities. Comput. Chem. Eng. 72:183–198. https://doi.org/10.1016/j.compchemeng.2014.05.024
Mitsos A (2010) Global solution of nonlinear mixedinteger bilevel programs. J. Global Optim. 47(4):557–582. https://doi.org/10.1007/s108980099479y
Mitsos A, Lemonidis P, Barton PI (2008) Global solution of bilevel programs with a nonconvex inner program. J. Global Optim. 42(4):475–513. https://doi.org/10.1007/s108980079260z
Mitsos A, Asprion N, Floudas CA, Bortz M, Baldea M, Bonvin D, Caspari A, Schäfer P (2018) Challenges in process optimization for new feedstocks and energy sources. Comput. Chem. Eng. 113:209–221. https://doi.org/10.1016/j.compchemeng.2018.03.013
Pablos C, Merino A, Acebes LF, Pitarch JL, Biegler LT (2021) Dynamic optimization approach to coordinate industrial production and cogeneration operation under electricity price fluctuations. Comput Chem Eng. https://doi.org/10.1016/j.compchemeng.2021.107292
Soliman HM, LeonGarcia A (2014) Gametheoretic demandside management with storage devices for the future smart grid. IEEE Trans Smart Grid 5(3):1475–1485. https://doi.org/10.1109/TSG.2014.2302245
Tsoukalas A, Rustem B, Pistikopoulos EN (2009a) A global optimization algorithm for generalized semiinfinite, continuous minimax with coupled constraints and bilevel problems. J Global Optim 44(2):235–250. https://doi.org/10.1007/s108980089321y
Tsoukalas A, Wiesemann W, Rustem B (2009b) Global optimisation of pessimistic bilevel problems. In: Pardalos P, Coleman T (eds) Lectures on Global Optimization, American Mathematical Society, Providence, Rhode Island, pp 215–243, https://doi.org/10.1090/fic/055/10
Voll P, Klaffke C, Hennen M, Bardow A (2013) Automated superstructurebased synthesis and optimization of distributed energy supply systems. Energy 50:374–388. https://doi.org/10.1016/j.energy.2012.10.045
Wenzel S, Paulen R, Stojanovski G, Krämer S, Beisheim B, Engell S (2016) Optimal resource allocation in industrial complexes by distributed optimization and dynamic pricing. at  Automatisierungstechnik 64(6):428–442. https://doi.org/10.1515/auto20160003
Wenzel S, Riedl F, Engell S (2020) An efficient hierarchical marketlike coordination algorithm for coupled production systems based on quadratic approximation. Comput Chem Eng 134:106704. https://doi.org/10.1016/j.compchemeng.2019.106704
Wiesemann W, Tsoukalas A, Kleniati PM, Rustem B (2013) Pessimistic bilevel optimization. SIAM J Optim 23(1):353–380. https://doi.org/10.1137/120864015
Wogrin S, Pineda S, TejadaArango DA (2020) Applications of bilevel optimization in energy and electricity markets. In: Dempe S, Zemkoho A (Eds.) Bilevel Optimization. Springer Optimization and Its Applications, vol 161. Springer, Cham. https://doi.org/10.1007/9783030521196_5
Yokoyama R, Haizuka K, Wakui T (2019) Analysis on cooperation between central power utility and distributed cogeneration systems by bilevel mixedinteger linear programming. In: Proceedings of ECOS 2019—the 32nd international conference on efficiency, cost, optimization, simulation and environmental impact of energy systems, Wroclaw, Poland, pp 1663–1674
Yu M, Hong SH (2016) Supplydemand balancing for power management in smart grid: a stackelberg game approach. Appl. Energy 164:702–710. https://doi.org/10.1016/j.apenergy.2015.12.039
Yue D, Gao J, Zeng B, You F (2019) A projectionbased reformulation and decomposition algorithm for global optimization of a class of mixed integer bilevel linear programs. J. Global Optim. 73(1):27–57. https://doi.org/10.1007/s1089801806791
Zeng B, An Y (2014) Solving bilevel mixed integer program by reformulations and decomposition. http://www.optimizationonline.org/DB_HTML/2014/07/4455.html
Zhao H, Rong G, Feng Y (2014) Multiperiod planning model for integrated optimization of a refinery production and utility system. Ind Eng Chem Res 53(41):16107–16122. https://doi.org/10.1021/IE502717E
Zulkafli NI, Kopanos GM (2016) Planning of production and utility systems under unit performance degradation and alternative resourceconstrained cleaning policies. Appl Energy 183:577–602. https://doi.org/10.1016/j.apenergy.2016.08.060
Acknowledgements
Hatim Djelassi and Alexander Mitsos acknowledge the funding by Réseau de transport d’électricité (RTE, France) as part of the project Hierarchical Optimization for Worstcase Analysis of Power Grids. Ludger Leenders and André Bardow acknowledge the funding by the Swiss Federal Office of Energy’s SWEET programme as part of the project PATHFNDR.
Funding
Open Access funding enabled and organized by Projekt DEAL.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interests
The authors declare that there is no known conflict of interest regarding the publication of this paper
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Appendix A
1.1 Additional constraints of the discretization points in the lowerbounding problem
In this section, we provide the additional constraints of discretization points in the lowerbounding problem. By these additional constraints, we identify if the discretization point is valid, i.e., if the free energy conversion units are operated within their operational bounds.
For every discretization point k and time step t, the heat demand \({\dot{E}}_{t,e=\text {heat}}^\text {demand}\) of the production system needs to be covered by the heat supply \({\dot{V}}^\text {D}_{k,t,u,e=\text {heat}}\) of the energy conversion units:
The electricity demand \({\dot{E}}_{t,e=\text {el}}^\text {demand}\) needs to be covered by the electrical supply \({\dot{V}}^\text {D}_{k,t,u,e=\text {el}}\) of the energy conversion units:
The discretization points are defined in Sect. 3.2. In our case study, we considered two energy forms heat and electricity. In the energy system, we modeled boilers, combinedheatandpower engines, and the electricity grid. Thus, we define operational limits for energy conversion units supplying heat and electricity. The operational limits for boilers and combinedheatandpower engines are defined for the energy form heat. The heat and electricity supply of a combinedheatandpower engine is connected. Thus, the operational limits of the electricity supply can be defined by the operational limit of the heat supply. To identify if the operational limits of the free energy conversion unit hold, bigM formulations are used in the lowerbounding problem. For heatsupplying energy conversion units, the lower operational limit is identified by:
The binary variables \(\beta _{k,t,f}^\text {lower}\) identify if the power of the free energy conversion unit \({\dot{V}}^\text {D}_{k,t,u=d^\text {free}_{k,f}, e}\) is lower than the minimal load \(\dot{\text {V}}^\text {min}_{u=d^\text {free}_{k,f}, e}\). The bigM parameter \(M^\text {lower}_{k,t,f}\) needs to be chosen such that the heat balance can be fulfilled for every heat demand that can be supplied by the energy system.
\(M^\text {lower}_{k,t,f}\) is defined as the maximum heat \(\text {M}_{e=\text {heat}}^\text {max}\) that can be supplied by the energy system reduced by the heat already supplied by the other energy conversion units \(\dot{\text {V}}^\text {D}_{k,t,u=d, e=\text {heat}}\) and the minimal load of the free energy conversion unit \(\dot{\text {V}}^\text {min}_{u=d^\text {free}_{k,f}, e=\text {heat}}\):
To identify if the upper operational limit holds for heatsupplying energy conversion units, the following equation is stated:
The binary variable \(\beta _{k,t,f}^\text {upper}\) identifies if the power of the free energy conversion unit \({\dot{V}}^\text {D}_{k,t,u=d^\text {free}_{k,f}, e}\) is higher than the maximal load \(\dot{\text {V}}^\text {max}_{u=d^\text {free}_{k,f}, e}\). The bigM parameter \(\text {M}^\text {upper}_{k,t,f}\) needs to be chosen such that the heat balance can be fulfilled for every heat demand that can be supplied by the energy system. Therefore, \(\text {M}^\text {upper}_{k,t,f}\) is defined as the minimal heat that can be supplied by the energy system increased by the heat already supplied by the other energy conversion units, the maximal heat load of the largest combinedheatandpower engine \(\dot{\text {V}}^\text {max}_{e=\text {heat}}\) and the maximal load of the free energy conversion unit \(\dot{\text {V}}^\text {max}_{u=d^\text {free}_{k,f}, e=\text {heat}}\):
The parameter \(\text {M}_{e=\text {heat}}^\text {min}\) is the minimal heat that can be supplied and is commonly 0.
The maximal heat load of the largest combinedheatandpower engine \(\dot{\text {V}}^\text {max}_{e=\text {heat}}\) is required for the case a combinedheatandpower engine unit is selected as free energy conversion unit for electricity. Thus, with the parameter \(\text {M}^\text {upper}_{k,t,f}\), the heat power of the free energy conversion unit can be reduced such that the minimal heat supply can be reached in the heat balance.
In our model, we consider two types of electricity grids: electricity purchase and electricity sale. If an electricity grid is the free energy conversion unit, we also need to check if the operational limits hold. The lower operational limit of the electricity grids is 0. Whether the lower operational limit holds is identified by:
The bigM parameter \(\text {M}_{e=\text {el}}^\text {max}\) is the maximum electricity that the production system could demand from the energy system. For the lower operational limit, Eq. (45) checks if \({\dot{V}}^\text {D}_{k,t,u=d^\text {free}_{k,f}, e=\text {el}}\) is nonnegative.
The upper operational limit is never exceeded for electricity grids:
Appendix B
1.1 Extended proof for multiple energy forms
In this section, we extend the proof to multiple energy forms.
Proposition 2
Let the lowerlevel problem be given for multiple energy forms e and one time step t as
Therein, \(\dot{\mathbf{V }}_{t}\) is the vector of power supplied by the energy conversion units u in all energy forms \(e \in E\) and \(\mathbf{o }_{t}\) is the vector of the operational state of each energy conversion unit u.
For this problem, there exists an optimal solution in which the number of energy conversion units not operated at one of their operating limits is less or equal to the number of energy forms e considered. More precisely, let Problem (47) be feasible and let \((\mathbf{o }_{t}^*, \dot{\mathbf{V }}_{t,e}^*)\) be globally optimal in Problem (47). Then there exists a solution \((\mathbf{o }_{t}^*, \tilde{\dot{\mathbf{V }}}_{t,e}\)) that is also globally optimal in Problem (47) and for which there exists at most E elements \(u \in U\) such that
Note that a connecting energy conversion unit possesses two power flows that are subject to operational limits. Nevertheless, each connecting energy conversion unit is only counted once for the purposes of this proposition.
Proof
Consider the case that \((\mathbf{o }_{t}^*, \dot{\mathbf{V }}_{t,e}^*)\) is given such that for at most E elements of \(u \in U\) the following equation holds:
Then, the result is proven immediately with \(\tilde{\dot{\mathbf{V }}}_{t,e} = \dot{\mathbf{V }}_{t,e}^*\).
In the following, we prove that if we consider two energy forms \(e_1\) and \(e_2\), the maximum number of energy conversion units at their operational limits can be reduced to at maximum two in an optimal solution. This result can then be generalized to an arbitrary number of energy forms e if we iteratively consider two energy forms and reduce the number of the energy conversion units not at their operational limit to at maximum two.
For the case of the two energy forms \(e_1\) and \(e_2\), energy conversion units can either output energy form \(e_1\) or \(e_2\), or if they are a connecting energy conversion unit, they output both energy forms \(e_1\) and \(e_2\). The energy forms e output by an energy conversion unit u is given by the set \(E_u\). Let \(u_1, u_2, u_3 \in U, u_1 \ne u_2 \ne u_3\) be given such that
and
To prove Proposition 2, we distinguish 4 cases that can occur.

Case 1: All three energy conversion units output a single energy form

Case 2: One energy conversion unit is a connecting energy conversion unit and the other two energy conversion units output a single energy form

Case 3: Two energy conversion units are a connecting energy conversion unit and the other energy conversion unit outputs only a single energy form

Case 4: All three energy conversion units are connecting energy conversion units
In the following, we use the fact that if a connecting energy conversion unit reaches the operational limit in one energy form, also the operational limit in the other energy form is reached. Thus, the operational limits of a connecting energy conversion unit u outputting energy forms \(e_1\) and \(e_2\) can be written in terms of the limits in one energy form using Eq. (10):
Hence, we only have to consider the operational limits in one energy form.
Now, we prove the Proposition 2 for the four cases:
Case 1
Since none of the energy conversion units \(u_1, u_2, u_3\) are a connecting energy conversion unit, we can apply the procedure from the proof of Proposition 1 for the two energy conversion units producing the same energy form e. Thereby, the proof for this case is given.
Case 2
If the two energy conversion units that output a single energy form output the same energy form, we apply the procedure from Proposition 1. As a result, only two energy conversion units are not operated at their operational limits.
Otherwise, Energy conversion unit \(u_1\) outputs energy form \(e_1\), energy conversion unit \(u_2\) is a connecting energy conversion unit outputting energy forms \(e_1\) and \(e_2\), and energy conversion unit \(u_3\) outputs only energy form \(e_2\).
From construction of Eq. (47), it follows that all elements of the set
are feasible in Eq. (47). \(\dot{\mathbf{V }}_{t,e}^*\) is an optimal solution of an linear program on a facet of the feasible set. Accordingly, all points on that facet (points in M) are optimal in Eq. (47). Note that in the last equation of M the constant part \(a_{u=u_2}\) drops because it is written on the left and right side of the equation.
Following the idea of Eq. (17), we identify the change in the supplied power until one energy conversion unit reaches its operational limits. For convenience, we define this change in energy form \(e_1\) by:
With \({\Delta } \dot{\text {V}}_{e=e_1}^\text {Case2}\) we can manipulate the supplied power by the energy conversion units such that the point \((\mathbf{o }_{t}^*, \tilde{\dot{\mathbf{V }}}_{t,e})\) with \(\tilde{{\dot{V}}}_{t,u,e} = {\dot{V}}_{t,u,e}^*, \forall u \in U \setminus \{u_1, u_2, u_3\}, e \in E_u\) and
lies within M and satisfies either \(\tilde{{\dot{V}}}_{t,u=u_1,e=e_1} = {\dot{V}}_{t,u=u_1,e=e_1}^+(\mathbf{o }_{t}^*)\), \(\tilde{{\dot{V}}}_{t,u=u_2,e=e_1} = {\dot{V}}_{t,u=u_2,e=e_1}^(\mathbf{o }_{t}^*)\) or \(\tilde{{\dot{V}}}_{t,u=u_3,e=e_2} = {\dot{V}}_{t,u=u_3,e=e_2}^+(\mathbf{o }_{t}^*)\), proving the desired property. Then, only two energy conversion units are not operated at their operational limits.
Case 3
Energy conversion unit \(u_1\) outputs energy form \(e_1\), \(u_2\) and \(u_3\) are connecting energy conversion units and output energy forms \(e_1\) and \(e_2\).
From construction of Eq. (47), it follows that all elements of the set
are feasible in Eq. (47). \(\dot{\mathbf{V }}_{t,e}^*\) is an optimal solution of an linear program on a facet of the feasible set. Accordingly, all points on that facet (points in M) are optimal in Eq. (47). Note that again in the last equation of M the constant parts \(a_{u=u_2}\) and \(a_{u=u_3}\) are eliminated. Following the definition of Eq. (54), we define the change in energy form \(e_1\) until an energy conversion unit reaches its operational limits:
With \({\Delta } \dot{\text {V}}_{e=e_1}^\text {Case3}\), we can manipulate the supplied power by the energy conversion units such that the point \((\mathbf{o }_{t}^*, \tilde{\dot{\mathbf{V }}}_{t,e})\) with \(\tilde{{\dot{V}}}_{t,u,e} = {\dot{V}}_{t,u,e}^*, \forall u \in U \setminus \{u_1, u_2, u_3\}, e \in E_u\) and
lies within M and satisfies either \(\tilde{{\dot{V}}}_{t,u=u_1,e=e_1} = {\dot{V}}_{t,u=u_1,e=e_1}^+(\mathbf{o }_{t}^*)\), \(\tilde{{\dot{V}}}_{t,u=u_2,e=e_2} = {\dot{V}}_{t,u=u_2,e=e_2}^(\mathbf{o }_{t}^*)\) or \(\tilde{{\dot{V}}}_{t,u=u_3,e=e_2} = {\dot{V}}_{t,u=u_3,e=e_2}^+(\mathbf{o }_{t}^*)\), proving the desired property. Note that if \(b_{u=u_2}\)=\(b_{u=u_3}\), then \(u_1\) does not change its power supply.
With these changes in the supplied power, only two energy conversion units are not operated at their operational limits.
Case 4
This case only occurs if 3 connecting energy conversion units are not at their operational limits and do not have the same conversion factor \(b_{u}\). If at least 2 of the 3 have the same conversion factor \(b_{u}\), the special case from Case 3 can be applied and only the two equal energy conversion units change their power supply.
Energy conversion unit \(u_1\), \(u_2\) and \(u_3\) are connecting energy conversion units and output energy forms \(e_1\) and \(e_2\). From construction of Eq. (47), it follows that all elements of the set
are feasible in Eq. (47). \(\dot{\mathbf{V }}_{t,e}^*\) is an optimal solution of an linear program on a facet of the feasible set. Accordingly, all points on that facet (points in M) are optimal in Eq. (47). Note that again in the last equation of M the constant parts \(a_{u=u_1}\), \(a_{u=u_2}\) and \(a_{u=u_3}\) are shortened. Following the definition of the Eq. (54), we define the change in energy form \(e_1\) until an energy conversion unit reaches its operational limits:
With \({\Delta } \dot{\text {V}}_{e=e_1}^\text {Case4}\) we can manipulate the supplied power by the energy conversion units such that the point \((\mathbf{o }_{t}^*, \tilde{\dot{\mathbf{V }}}_{t,e})\) with \(\tilde{{\dot{V}}}_{t,u,e} = {\dot{V}}_{t,u,e}^*, \forall u \in U \setminus \{u_1, u_2, u_3\}, e \in E_u\) and
lies within M and satisfies either \(\tilde{{\dot{V}}}_{t,u=u_1,e=e_1} = {\dot{V}}_{t,u=u_1,e=e_1}^+(\mathbf{o }_{t}^*)\), \(\tilde{{\dot{V}}}_{t,u=u_2,e=e_2} = {\dot{V}}_{t,u=u_2,e=e_2}^(\mathbf{o }_{t}^*)\) or \(\tilde{{\dot{V}}}_{t,u=u_3,e=e_2} = {\dot{V}}_{t,u=u_3,e=e_2}^+(\mathbf{o }_{t}^*)\), proving the desired property. With these changes in the supplied power, only two energy conversion units are not operated at their operational limits.
Finally, if there are more than three energy conversion units \(u \in U\) with \(\dot{\text {V}}_{t,u,e}^(\mathbf{o }_{t}^*)< {\dot{V}}_{t,u,e}^* < \dot{\text {V}}_{t,u,e}^+(\mathbf{o }_{t}^*)\), the above constructions can be applied successively to three energy conversion units until the same result is reached. \(\square \)
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Leenders, L., Hagedorn, D.F., Djelassi, H. et al. Bilevel optimization for joint scheduling of production and energy systems. Optim Eng 24, 499–537 (2023). https://doi.org/10.1007/s11081021096940
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11081021096940