Development and evaluation of risk treatment paths within energy-oriented production planning and control

Production planning and control pursues high delivery reliability and short delivery time of the production system at the lowest possible costs. Especially in energy-intensive industries, energy cost account for a significant amount of manufacturing costs. The consideration of variable electricity market prices using energy-flexibility measures facilitates reduced costs by adapting the load profile of production to an electricity price forecast. However, it also increases the production planning and control system’s complexity by additional input variables and possible risks due to the influence of flexibility measures on the production system. In the case of unexpected events, such as failure of machines or faulty materials, it is difficult to adapt the complex production system to the new situation quickly. There is a risk of high additional costs by various causes, such as delays in deadlines or load peaks. Therefore, this paper presents an approach for developing and evaluating risk treatment paths, which include possible combinations of risks and measures for the mitigation of risk effects. The advantage of these paths compared to a situational reaction is that all effects and possible further interactions can be considered and thus overall cost-efficient solutions can be found. The approach is based on the determination of interactions through interpretive structural modelling and the calculation of conditional probabilities using Bayesian Networks. The approach was implemented in MATLAB® and applied using real order and energy data from a foundry. The results show that the presented approach enables structured and data-based comparison of risk treatment paths.


Introduction
Operational production planning and control (PPC) is an area of in-house production planning and includes the tasks of lot size planning, scheduling and sequence planning [1]. The PPC has ambitious goals for the performance of the production system: high delivery reliability and short delivery time, which should be achieved with the lowest possible production costs [2].
In practice, this is still a challenging task for those responsible. According to a study in which almost 100 company representatives were interviewed, 80% of the participants stated that the amount of information and the level of detail in their PPC systems did not meet the employees' needs. The study also showed that the employees do not rely on their PPC systems' functionality and results in two out of three companies [3].
New approaches for increasing the performance or reducing production costs, therefore, always arise in this area of tension and need to distinguish themselves by high transparency and comprehensibility to gain acceptance and be thoroughly used. With increasingly volatile electricity prices, the reduction of electricity costs by exploiting price effects is set to gain importance in countering rising energy prices in the future [4].
In general, the characteristics of the price effects mentioned depend greatly on present electricity procurement strategies. A portfolio of different electricity products is available for larger and energy-intensive companies, containing long term base blocks, peak blocks and short-term 1 3 spot market products. The deviation from the load that was purchased through these products leads to penalties. Furthermore, load peaks are of particular importance. When calculating the grid charges of companies, the annual maximum load is included. If load peaks exceed the annual maximum load, grid charges can increase drastically [5].
One promising approach is that of energy-flexible production systems, which adapt quickly and efficiently to changes in the energy market by using energy-flexibility measures (EFM), such as the change of job sequence or the interruption of processes [4]. The prerequisite for this is a socalled energy-oriented PPC, which integrates the concept of energy-flexibility into the production system during planning and control tasks [6]. On the one hand, this offers energyintensive industries in particular the opportunity to save electricity costs without severely restricting the production system's performance. On the other hand, it increases the already high complexity of the PPC by implementing additional energy-related boundary conditions. As a result, production control must quickly make decisions should unexpected events occur, considering the various interactions and effects between action options. Suppose unexpected events occur in an energy-flexible production system. In that case, the systems' electrical load profiles must be considered in addition to logistical target values, because these can lead to high additional costs if there are any deviations from the planned load profile.
In the upper part of Fig. 1, typical faults in the orders are shown. An unplanned follow-up order on machine two results in increased stocks. A fault occurs on machine one, which leads to repair work and a delay in the delivery date of the affected order 3. The effects of these faults on the electrical load profile are shown in the lower part of Fig. 1. Machine One's fault has the effect of deviating from the initially purchased load profile, which can lead to penalties. In addition to a deviation, the unplanned follow-up order on machine two causes a load peak, leading to the abovementioned increased grid charges.
In many cases, the influencing factors and interactions of energy-flexible production systems are thus too complex to find a cost-efficient measure when an unexpected event occurs. This may represent a major obstacle to EFM implementation, since the production system's performance should not be endangered for price advantages on the electricity markets [7,8]. To avoid restricting the production system's performance by any additional adjustments, companies could therefore decide to only consider logistical goals and capacities in their production planning and not consider fluctuating electricity prices based on forecasts.
Through the risk treatment of a production plan, possible adverse events are excluded beforehand by plan adjustments or measures to compensate for the effects of errors are already known. Thus, this paper presents an approach with which risk treatment paths can be developed and evaluated within the energy-oriented PPC framework. The development of the paths considers that several risks can occur one after the other, with different conditional probabilities and interactions. In this way, it is avoided that suitable measures are used for the first risks with a minor extend of damage, and so, sufficient measures are no longer available for subsequent risks with a significant extent of damage. It also includes the identification of the probability of occurrence of risks, as well as the modelling of possible interactions between risks and measures, and thereby increases the transparency and planning security for the logistical goals.
The state of the art for relevant topics in this study is explained in the following. Section 3 introduces the scientific concept. The approach for development and evaluation of risk treatment paths is introduced in Sect. 4. Its implementation in a MATLAB ® tool is explained in Sect. 5. The exemplary application of the approach using the tool is then described in Sect. 6. Conclusions and a preview of possible future developments are presented in Sect. 7.

State of the art
The approach presented here for the "Development and evaluation of risk treatment paths within energy-oriented production planning and control" is sought to be embedded in the general environment of energy-oriented PPC, in which the targeted evaluation of risks and measures is to be implemented. As relevant energy-intensive production systems show great complexity and large numbers of possible Fig. 1 Impacts of exemplarily unexpected events on logistic goals and load profiles risks and measures with often inscrutable entanglements of mutual effects and impacts on risk and measure occurrence, the consideration of tools for modelling of interrelationships and dependencies between risks and measures is necessary. The following sections give an insight into the state of research in these fields of energy-oriented PPC, risk and measure evaluation and the modelling of interrelationships and dependencies.

Energy-oriented PPC
Keller et al. [6] suggest a medium-and short-term add-on module for the enterprise resource planning system to implement energy-oriented production planning. The result is an energy demand plan that is coordinated with the production plan. Mitra et al. [9] investigate the optimal production planning and control with time-changing energy prices for continuous, energy-intensive chemical industry processes. To do this, they formulate a deterministic, mixed-integer optimisation problem as a model of temporally discrete transitions between states to solve a flexible job-shop scheduling problem. Moon et al. [10] utilise a non-linear mixed-integer optimisation, considering distributed energy resources and energy storage. Rager et al. [11] present an energy-oriented scheduling approach for parallel machine environments, which is based on evolutionary algorithms. The approach focuses on allocating and sequencing production orders on identical parallel machines within a fixed planning horizon. A method for integrated scheduling of batch process and combined heat and power plant is presented by Agha [12]. The discrete time modelling and mixed-integer linear programming-based approach reduce energy costs and harmful gas emissions by optimising the use of cogeneration and more efficient exploitation of utility resources. Schulz et al. [13] developed an approach for considering the three strategies for reducing energy costs: energy efficiency, energyflexibility and avoiding peak loads. It is based on constructing a mathematical model that considers volatile energy prices and an iterated local search algorithm. Possible additional costs due to the deviation from an originally intended plan are taken into account by Schultz et al. [14] and Rösch et al. [15]. The deviations are responded to with situational measures when they occur, this means that there is no risk treatment with sufficient lead time to avoid risks or to define countermeasures for events. This may lead to actions based on incomplete situation overviews and improper handling with undesired results.

Evaluation of risks and measures in PPC
Risks are basically described as the product of the likelihood of occurrence and the extent of the damage [16]. There are various approaches to identify and manage risks in the production system environment. Chauhan et al. [17] show to how risks within the development process of new products can be estimated and compensated with an integrated approach. Niesen et al. [18] provide a tool for online simulation of production processes to identify critical situations before they occur. Geiger and Reinhart [19] show an approach for machine scheduling under consideration of uncertainties. Simon et al. [20] apply four strategies for the risk evaluation of energy-flexibility. The strategy for evaluating the influence of EFM on production risks complements classic risk management with all possible influences of EFM on the identified risks. Klöber-Koch et al. [21] integrate production risks into a classic PPC system to make predictions about the risk situation during planning and take these into account in planning. Therefore, risks and the production system are modelled. The risks are evaluated regarding their mutual effects and their effects on logistical target values. Finally, suitable preventive measures are incorporated into production planning.
In energy-flexible production systems, the general modelling of energy-flexibility is useful for modelling measures. In Schott et al. [22], the aim is to build a generally applicable data model for modelling performance-related flexibility, which allows transferability between different industries and offers the possibility of standardising the description of energy-flexibility.

Modelling interrelationships and dependencies in complex systems
It is essential to record the structure between risk and measure interactions in complex systems to quantify them. Klöber-Koch et al. [23] use interpretive structural modelling (ISM) to structure risks in production systems. A structural self-interaction matrix (SSIM) is created based on an existing risk inventory. This assigns mutual dependencies and effects to the system elements, i.e., risks, based on expert knowledge in a pairwise comparison. Pfohl et al. [24] and Shakya and Chauhan [25] also use the ISM methodology to model risk interdependencies. Pereira et al. [26] and Daultani et al. [27] use Bayesian Networks to structure risk interdependencies, interactions and dependencies. Bayesian Networks are acyclic graphs made up of nodes and directed arrow connectors, which indicate their dependencies. Pereira et al. [26] also use what is known as an analytic hierarchy process (AHP) to analyse the influence of individual risks. Wu et al. [28] integrate the Bayesian Networks approach into the ISM methodology. The system structure of the identified risks is first generated according to the ISM method and then expanded to include the calculation of conditional probabilities of risk occurrence.

Need for research
According to the current state of the art, there are several approaches with which a production plan can be drawn up that consider variable prices from electricity exchanges. Approaches to production control show the possibilities for initiating measures to reduce costs depending on the situation in the event of a malfunction. The work on risk management in the production area shows how the risk aversion of planners and possible uncertainties in the planning process can be considered during the planning process. However, the complex origins of energy costs from load peaks and absolute demand quantity deviations and the use of predefined energy-flexibility measures are not subject to the presented approaches for risk treatment in production planning. This is necessary to be able to integrate all the experts involved. In addition to PPC experts, these are, for example, electricity purchasing and energy management. It is another requirement to weigh up the effects on various additional energyrelated criteria transparently, such as penalties and increased network charges. Therefore, a need for research exists into approaches to risk treatment that operative PPC can apply in the context of energy-flexible production systems. Figure 2 presents a graphical overview of the approach that is being presented in this paper. It depicts all necessary expert inputs and sources of information, functions and process steps, and the resulting documents and data. The main process steps are:

Scientific concept
• The structuring of causal relations in the considered system of risks and measures. • The parallel calculation of risk and measure profiles for single elements. • The combination of the first two steps towards identically structured profiles for possible element combinations. • The discretisation of time and energy. The approach is limited to electrical energy demand in production systems. Other forms of industrial energy use, such as fossil fuels or gases, are excluded. The overall consideration applies to production stations, such as facilities or production resource units and their respective processes within industrial enterprises. Processes must be formalised to discrete production timetables, including process step time data and electrical power demands to enable direct and quantitative consideration of disturbance effects. Inhouse experts must be capable of supplying information on interdependencies and interactions within the system of elements and must be able to estimate conditional probabilities according to empirical data or their experience. Energy storage, on-site electricity generation and intraday spot market trade are not considered to be energy-flexibility measures in the strict sense of pertinent literature. They are seen as "third-order periphery" with very little to no manufacturing impact [29] and are therefore modelled separately.
For the presented approach, a risk inventory as well as a list of preventive countermeasures and EFM must be available and cover a specified set of data for all elements, e.g., changes in setup, transport or wait time, average and maximum change of electrical load and additional intralogistics or setup processes. Next to risk and measure inventories, basic information on cost factors, production system target values and energy supply must be available. Also, in the sense of energy-oriented PPC, planned energy schedules for the focused process and the superordinate production unit, e.g., the factory it belongs to, must be presented.
In Fig. 2, the box numbers indicate the section in which the process step is presented in the following part of this paper.

Description of the approach
This chapter presents the approach for developing and evaluating risk treatment paths. Section 4.1 presents the evaluation and calculation of risk and measure effects. In Sect. 4.2, the modelling of the causal structures between the elements is being introduced. The hereby generated structure is then being picked up in Sect. 4.3 and complemented to the modelling of risk measure paths. A time and energy-related discretisation is carried out in Sect. 4.4, before the approach is being concluded by evaluating the generated overall risk situation in Sect. 4.5.
In the following, the term "element(s)" is used for the general naming of risk treatment measures (RTMs), EFMs and risks. Furthermore, EFMs are RTMs summarised in the term "measures." The similar treatment of risks and measures, which are the opposite, enables their consideration in a uniform and common system that is essential for the approach presented in the following. A "system" is a quantity of identified elements and their significant dependencies and interactions.

Evaluation and calculation of risk and measure effects
Risks and measures must be known and inventoried (compare Fig. 2) before starting the hereby presented approach, which commences with evaluating and structuring known risks and already identified possible measures derived from them. Risks, in general, might be associated with specific schedule deviations, disruptions in the dimensions of time and all logistic target measures, as well as all sorts of undesired impacts. Measures are generally aimed at the prevention and compensation of risk-induced damage. The identification of risks and RTM can be accomplished by applying creative methods, such as morphological analysis and brainstorming or via collective methods, such as checklists, strengths, weaknesses, opportunities and threats (SWOT) analysis. Furthermore, analytic search methods like bow-tieanalysis, empirical data analysis, fault tree analysis, failure mode and effects analysis (FMEA) and root cause analysis (RCA) can be used [30]. However, these methods are not explained in more detail here, as the approach is applied after identifying individual risks. As mentioned before, the impact of the identified possible risk events can be quantified by modelling eventrelated extents of damage and associated probabilities of occurrence. For this, specific information is to be obtained. Based on Refs. [20,22,31], risk and measure data from the identified inventories must contain identifiers and variables for specifying the process steps to which the specified elements refer. Also, time-related information, such as activation, deactivation, minimal effect and regeneration durations of elements are required. For quantifying the actual effects on energy-oriented PPC target parameters, risk and measureinduced negative and positive deviations of wait time, transport time, lead time and process start times must be stated for every individual element. PPC target parameters are for example, lead time, capacity, stock or delivery reliability.
Furthermore, impacts of elements on quality, setup and intralogistics processes must be specified via respective variables. Finally, risk or measure-induced maximum and average load change capabilities complete the dataset. In addition to the risk-and measure-specific information, basic data on the production and energy procurement situations are required. For example, the sequence and dependency of processes, order data, and the systems' electrical energy demand and price forecasts are relevant.
With this information, it is possible to calculate the identified risks' extent of damage and measure impacts. In this approach, risk and measure effects are quantified in the dimensions of selected target variables of energy-flexible production systems. The underlying principle is that individual elements' values can be added to calculate combined extents of damage for risk-measure combinations. Table 1 lists the parameters selected for this purpose: The time unit (TU) mentioned in Table 1 refers to the smallest specified time slice and prescribes the approach's temporal resolution. For the consideration of energy-oriented production systems, the spot-market trading time-slots of 15 min are an appropriate choice for one TU. Not all parameters that are presented directly in the discrete and absolute dimensions of time, electrical power or energy consumption are mathematically related to target values or overall values from the production system to ensure summability.
Next, the probability of occurrence for single risk events and measures is modelled to conclude a complete risk quantification. According to Ref. [34], damage distributions for individual damages can be described by a random variable with an associated probability distribution. The damage amount can, for example, be related to the maximum damage and thus lies between 0 and 1. Several distribution functions are available and commonly used for this task. For modelling specific damage cases, these distribution functions can be selected and in part be tailored to the distributions of actual use cases by adjusting function parameters. If only the full damage is relevant or even possible in the case of a specific risk occurring, the assignment of a simple probability value can be sufficient. The targeted selection and parameterisation of a distribution can generate a higher number of evaluation options and increase the observation's granularity. However, this also leads to a correspondingly higher effort and knowledge requirement.
As well as risks, RTM should hereafter be modelled as the product of the probability of their occurrence and their effect. While risk events are regarded as uncertain, the application of RTM and EFM is always considered to be planned and therefore certain in this approach. Hence their probability of occurrence is generally set to the value of 1 (100%). This seemingly unrequired step is justified by the system's feature that states that the probabilities of occurrence of individual elements not only serve to consider the respective singular risk or measure situation, but are also used as starting values for the calculation of probabilities of occurrence of paths that emerge from the considered individual elements. The assignment of a dummy probability of occurrence of 100% is necessary to create compatible structures in the modelling of risks and measures and enable the uniform presentation of risks and measures in the standardised procedure for calculating the probability of occurrence for paths is presented in the following.
After the evaluation of individual elements has been carried out, a systematic quantification of system structures and causality between elements must be provided. The structural aspect of this requirement will be presented in the following section.

Modelling the causal structure of risks and measures
The methodology of interpretive structural modelling (ISM) is used to structure risk dependencies and interactions by several state-of-the-art-sources in Sect. 2.3. Its advantages are the structured approach, the relatively simple provision of input data and the derivation of complex logical and graphical structures from simple logical relationships with defined tools. Thus, the hereby presented method also applies parts of the ISM methodology for modelling causal structures of risks and measures. The approach aims to generate a graphical representation of dependencies and interactions of objects and to identify relationships [24]. For this, ISM methodology involves a series of defined steps. Firstly, all relevant elements in the system under consideration must be listed. When applying the ISM methodology to systems of risks, RTMs and EFMs, this step identifies risks and measures. A structural self-interaction matrix (SSIM) is generated based on the recorded portfolio. Here, the identification letters V, A, X and O are entered in cells of pairwise element comparison and thus formalise influence between the system elements. Influence in this step of the method means any form of dependence, mutual exclusion or targeted and un-targeted effect relationship between the system elements of risks RTM and EFM. An example SSIM and the meanings of the appropriated code letters according to Refs. [24,25,35] are listed in Fig. 3. From the basic SSIM, the binary initial reachability matrix (IRM) is generated using the transformations rules depicted in Fig. 4.
The IRM is then transferred to the final reachability matrix (FRM) via transitivity conditions [24,25,35]. Transitivity in this context is the consideration of connections of indirectly linked logical elements. Subsequently, nodes A and C are to be equally connected by the value of one in the respective FRM cell if, in the IRM, a node A is directly connected to another node B, and node B is directly connected to a third node C [35,36].
At this stage of the approach, further ISM-associated steps are omitted. The underlying goal of structuring the system of interactions between risks, RTM and EFM is to derive complex paths of element combinations from the simple, paired indication of dependencies and interactions in the SSIM. The further course of the approach presented here is based on the FRM. It can be understood as an adjacency matrix extended by indirect element connections. Adjacency matrices are matrices that formalise the topology of direct relations of elements within systems of complex interactions by binary variables [37]. By applying the transitivity concept to the IRM, the adjacency matrix is extended by information on indirect interactions. The FRM then contains all information that is necessary to derive paths by specifying paired connections. The matrix representation is transformed into a directed graph by representing the system elements as nodes and connecting the nodes with directed edges for each "1" entry in the FRM. This digraph is cyclic and therefore contains loops. Paths that are extracted directly from this representation are endless and repetitive. The graph must be reduced to the essential compounds to eliminate these properties. For this purpose, all the connectors that do not increase the accessibility of individual elements are removed by transitive reduction. The repeated appearance of elements in extracted paths is thus eliminated. The result of the transitive reduction is a graph that only shows the most direct paths of the original cyclic graph without repetitions of elements and loops, but with the same accessibility. This form of visualisation considerably simplifies the understanding of the path term, compared to a binary matrix [37] and makes it possible to visually track paths.
By transferring simple, paired information into a complex visual model of paths, the framework for continuing risk and measure modelling by applying it to combinations of individual elements has been provided. Below, the generated structural framework is used for modelling risk-measure paths. It is worth mentioning that the presented procedure considers all possible combinations of elements according to the SSIM specifications to ensure complete consideration of the possible interactions down to the last detail.
After Sect. 4.3, the procedure of setting up the required system elements and their structure provides a framework for modelling element interactions in the following.

Modelling of risk measure paths
Based on the structuring of element interrelations, the probability of occurrence and the indirect damage impact of the path occurrence are modelled in this section. The Bayesian Network theory is applied for path occurrence probabilities.

Modelling probability of occurrence for paths via Bayesian Network theory
The Bayesian Network theory offers a method for transferring the presented structural model into a stochastic model of probabilities of occurrence for risk measure paths by providing a framework for modelling uncertainty [38] and representing objects in uncertainly defined fields [26]. In the directed acyclic graph (DAG) previously presented, elements of the system under consideration are represented as a set of variable nodes and directed connectors between the variables in Bayesian Networks [39]. Nodes represent random variables and edges represent the causal relationships between them [40]. Each variable has a finite number of possible conditions. The acyclic structure implies that conditional independence exists between specific nodes. If two nodes are not in a closed circle, conditional independence can be assumed [41].
The determination of probabilities of occurrence of paths in Bayesian Networks is based on conditional probabilities theory [39,41]. Dependencies, interactions and exclusions of variables are described by the probability of occurrence of the state of a random variable depending on the state of the preceding variable [26,39]. For each node in the DAG, a conditional probabilities distribution must be defined, for example, in the form of tables [39,41] (see Fig. 6). For the overall probability of a path, the conditional probabilities of all included elements are multiplied. If, for example, two elements A and B are present in the considered system of single elements, where element A excludes element B, the value "0" must be chosen as element B's probability depending on element A: P(B | A) = 0. If the target element of a considered pairing is to be explicitly applied to the source element, e.g., as it is the case for RTM application, its probability must be set to the value "1". Generally, conditional probabilities between 0 and 1 (0…100%) are possible.
Based on the FRM, all the possible source nodes can be determined for each possible target node. The extracted combinations of source and target repeatedly appear in different arrangements of a relatively manageable number.
Further simplifications can be made to reduce the effort of defining conditional probabilities for targets depending on sources in complex systems: the number of possible states of all source and target nodes is limited to two. State "1" means that an element has occurred or has been implemented. State "2" means the opposite. This implies that a total of four conditional probabilities can be defined for target nodes with two source nodes. Since the calculation of probabilities of occurrence of paths is always based on the assumption of the occurrence or the use of the respective preceding path element, only state "1" is relevant. This fact reduces the parameterisation effort for the experts significantly. For example, for the digraph presented in Fig. 5, twenty-four possible combinations would have to be parametrised. The simplifications presented here comply with the so-called NOISY-OR approach to the parametrisation of Bayesian Networks [42].

Modelling damage impact of path occurrence
The reason for aiming to ensure the addability of target parameters for risk extent of damage or measure impact is the calculation of impacts in the same dimensions for paths of possible risk-measure combinations. As Fig. 7 shows, with each partial step of a path, arrays of the extent of damage of the path elements are added up successively.
The development of the extent of damage of a path is always traceable at any time and for any stage of composition. Based on the accumulation of target parameters, the situation of all the element combinations can be evaluated compactly and uniformly by re-deriving information from them. With the probability of occurrence, an individual profile can be created for each element and path from the presented format (see Fig. 7). The element-centred part of the approach presented so far must now be re-related to the determining dimensions in the context of planning in energy-oriented PPC, which are time and energy.

Time and energy-related discretisation
In addition to the presentation of the causal structure of interactions and interdependencies in the system of risks and measures, their effects must be classified in terms of time, since the specific deviations of the elements were determined independently of the specific point in time in the previous steps of the approach. To locate risk-or measureinduced effects in the production plan, risks and measures must be related to a particular process step. If the process step affected by a risk is known, the earliest time at which the risk may occur can be determined. This is also necessary for measures, because the time of the processes affected by the measures must be considered. In general, the discretisation is always based on a planning period whose length t is defined in the input. Figure 8 depicts an exemplary planning period and its subdivision for one machine. The orders are scheduled for the machine with buffers. Every order contains a specified number m of products that are displayed as units. For every unit, the lead time is split according to Ref. [2]. Time-related effects of system elements are generally considered as effects on these time components.
When specifying points in time, the entire event always refers to the timeline specified in the input process plan. EFMs that do not consist of changes in process parameters or manipulated variables of the production system are referred to as the energy-flexibility of the production system's periphery according to the corresponding assumption in Sect. 4.2. These measures are not to be included in the general term and catalogue of measures, as they are not based on adaptations inside the production system, such as changes in order sequence or processing flows. Peripheral energy-flexibility includes the use of energy storage and inhouse generation facilities, as well as the short-term procurement of electricity through intraday spot market trades. Their possible compensatory effects on the changed load profile of the process and the company's overall load profile depend on the input parameters provided. The compensation of load curve deviations by the means mentioned is then realised automatically. Figure 9 depicts the process of time-discrete consideration of risk and measure impact and the effects of third-order periphery EFMs on the load profile that is carried out for every single possible path identified:

Evaluation of the overall risk situation
After modelling risk, RTM and EFM, as well as paths of their possible combinations within the considered system, the respectively present overall risk situation is to be evaluated. During the following evaluation, the risk and measureinduced changes of cost and the corresponding changes in energy-flexibility and overall risk situation are to be assessed and quantified. Conflicting objectives between the three target figures must be considered by production managers when deciding on preventive risk compensation during production planning.

Costs
An appropriate cost model, which can be integrated into the presented methodology and is generally transferable to energy-flexible production systems, must be set up to determine the risk and measure-induced cost changes. To this end, the approach presented adds refinements to the general  [30], which is based on Refs. [43,44].
To consider the influence of risks, measures and their combinations on a production system, only the resulting changes in the cost situation are relevant for monetary quantification. Accordingly, costs are understood as risk-and measure-induced additional costs or cost reductions.
Following Ref. [43], the first level of classification in the cost model is divided into event and infrastructure costs. The latter corresponds to the cost changes that result from the use of production peripherals and electricity trading. Variable measure costs are subdivided into costs for load balancing by use of energy storage, plant operation and potential primary energy costs for on-site electricity generation and costs for short-term trading on the intraday spot market. In the context of this paper, these costs are understood as costs of peripheral energy-flexibility. The costs for actual measures, namely production-internal risk compensation and energyflexibility measures, since they are assigned to components of paths, are considered event costs. As they are presented in Ref. [31], fixed-measure costs are not relevant in the system. Event costs include all the costs that can arise in the production system due to risk occurrence or preventive use of EFM and RTM within the production system's scope.
Event costs are further subdivided into production, logistics and delay costs. Delay costs arise from late or early delivery, which is fined via contractual penalties [44]. Logistics costs summarise intralogistics, delivery and storage costs. Additional storage costs are to be understood as capital commitment costs due to inventory build-up [44,45] while delivery costs may be charged for unscheduled usage of external logistic services.
The generic term production costs include machine, material, personnel and energy costs. Maintenance, planning, and additional shift costs are considered with a common factor for personnel cost, following [44]. Machine costs are calculated from an hourly machine rate. Costs for non-utilisation, as in Ref. [44], or additional interest costs are not considered. Material costs arise from the needs for additional raw materials, operating materials, tools [44] and setup procedures. Energy costs include cost changes due to costs for increased market prices, penalties for deviations from quantity tolerances, costs due to increased grid charges in the case of violations of the annual peak load, and deviations in the required emissions trading volumes. Figure 10 summarises the structure of the cost model. The calculations of all cost components are based on previously determined parameters of the extents of damage and impacts or associated interim values for all single elements and all identified paths. This is made possible by the handling of single-element and path effects within a unified system. All the cost components are traceable for every standalone risk or measure, every complete path

Risk
As described in Sect. 2.2, risk quantification is based on the following relationship: When risks and measures in energy-flexible production systems are considered in this approach, the risks' extents of damage or the impacts of the measures are primarily modelled in the presented dimensions of energy-oriented PPC target parameters (for instance ∆LT) or a monetary dimension. Accordingly, the formula can be paraphrased for any target value or cost deviation.

Energy-flexibility
To evaluate single element or combination effects in the planning phase energy-oriented PPC, the remaining reactive energy-flexibility for subsequent interventions in the level of production control is relevant. The evaluation parameter "energy flexibility" is considered to indicate remaining flexibility for interventions that are not defined by the risk treatment. This can be relevant if a planning period contains events that cannot be identified during risk identification due to missing knowledge. Examples include critical products such as complex moulds in the foundry process, as well as the possibility of urgent orders from important customers.
Pertinent literature on the modelling and quantification of energy-flexibility focusses on several characterising components. The potential load change or the dimension "states" of the considered production station and EFM costs and the time characteristics are most frequently named [20,22,31]. In this approach, the on-site generation of electricity, electricity storage and load balancing by spot market trading are separated from measures within the production system. Accordingly, the degree of utilisation of the potentials of peripheral energy-flexibility must be separately quantified. Costs are already being considered in a cost model and therefore not included in the following proceedings.
For each of the above-mentioned characterising components of energy-flexibility, a dimensionless key figure, which may represent relative changes in positive and negative directions display constellations without any effects on energy-flexibility, must be defined. The combination of these key figures can then be obtained by multiplication because they do not have any units. This allows adjustments to the approach by adding factors for later refinements or customisation.
(1) Risk = probability of occurence ⋅ damage In the component for the dimension of time EF t , the planning scope for shifting processes and the corresponding loads can be derived from the buffer times Δt buffer . Risks negatively influence buffer times due to delays in process steps. With the increasing risk-or action-induced consumption of buffer times Δt buffer,is , the remaining energy-flexibility decreases in relation to the planned state ( Δt buffer,plan ). If a gain in buffer time is achieved by risks occurring or measures implemented, the energy-flexibility increases accordingly: For the key figure component of the state dimension,EF states , the process internal load shift potential left available after the effect of risks, measures or paths, expressed as ( ΔP effect ), can be used for quantification. The energy-flexibility decreases with an increasing occupied share of load lifting and load shedding potential ΔP max,process : The closer the average loads of the storage facility ( P storage,is ) and on-site generation unit ( P onsitegen,is ) are to their respective nominal values ( P storage,rated , P onsitegen,rated ), the smaller is the scope remaining for intervention in production control. Consequently, the degree of utilisation of the potentials of the technical energy-flexibility ( EF tech ) must be quantified: All values that are utilised in the calculations of the measure presented here for energy-flexibility have already been obtained in the previous course of the method presented.
By multiplying the components, a dimensionless measure of energy-flexibility, EF , is obtained:

Connection of the evaluation parameters in a trilemma
The three evaluation variables are plotted in a trilemma that displays specific risk-measure situations as a field of tension in order to visualise the conflict between the energy-oriented PPC key figures costs, energy-flexibility and risk. The aim is to represent relative changes in the positive and negative directions for each variable as deviations from a zero point in the centre of a triangle side, as shown in Fig. 11: Δt buffer,plan (P storage,is + P onsitegen,is ) (P storage,rated + P onsitegen,rated ) Therefore, the evaluation parameters must be transformed and brought into a dimensionless form. Additionally, the trilemma parameters must be set to zero for the original production plan. The measure of energy-flexibility is transformed as follows: To transform the cost dimension into a trilemma parameter for paths, only the changes in costs induced by the measures included for a considered path ( ΔC tot,i M ) are related to the original absolute planned costs for the input production schedule, C plan . Thus, C rel,i becomes negative for cost savings, positive for a measure-related increase in costs and is "0" if the cost situation remains unchanged: The exclusion of the monetary effect of risks that are included in considered paths for the calculation of the trilemma cost parameter is needed for consistency with the third trilemma parameter of risk. The risk R rel,i is expressed in the trilemma relative to the maximum risk value ( R C,max ) present in the system from the effect of individual elements or paths. The respective calculation uses the monetary risk R C,i : A negative risk indicator R rel,i represents a positive effect of a considered path or single element on the overall risk situation. In this case, the terms opportunity or chance, as definitional opposites of the term risk, can be used to describe the situation.
With the quantification via the trilemma parameters and the corresponding visualisation, decision-makers in production planning are given a tool to weigh up the considered production system's risk situation and choose the planning compensation measures according to their risk preference. They can primarily weigh up risk and cost and use the evaluation of energy-flexibility as an additional criterion if two similar paths exist or if changes in customer orders in the future planning period under consideration are critical or very difficult to assess. Thus, the presented method enables structured and data-based comparisons instead of purely experience-based weighing of options. Filtering of the vast number of paths is made possible by the trilemma risk criterion, on which further analysis and in-depth comparison of data-based damage effects and probability of occurrence information by manual selection can be established. The possibility of disregarding certain situations, in which extreme amounts of potential damage are dragged down to low-risk criterion values by minimal probabilities of occurrence (or vice versa) is intercepted by the general possibility of data-based threshold monitoring for each of the dimensions of damage defined in the risk and path profiles.

Implementation in MATLAB®
For the application, the approach presented has been implemented in MATLAB ® . The results are visualised and selectable in a MATLAB ® AppDesigner graphical user interface (GUI). The created interface is divided into several tabs. Input data is read by the program from a specially created, standardised Comma-separated values (CSV) file. This enables the user-friendly collection of the required data. As the tab structure and tasks provide a good impression of the program capabilities and display options, it is listed in Table 2. Figure 12 shows the tab structure's graphical layout in the GUI and demonstrates the "Risk Dashboard: Paths" tab as a screenshot of the tool.

Description of the use case
The method and its software implementation are demonstrated using the example of a foundry. The foundry industry is generally energy-intensive due to the physical   Fig. 13, consists of the process steps of melting plan preparation (1), mould preparation (2), core preparation (3), raw material loading (4), four separately considered process steps for melting the raw material in four furnaces (5)(6)(7)(8), additional loading (9), the addition of additives in the treatment ladle (10), the transfer of the melt into the ladle (11), forklift transport of the casting ladle to the casting fields (12), casting (13), cooling (14), demoulding (15), transporting the castings to finishing (16) and post-processing (17). The small furnaces 1 and 4 are used for direct feeding of the melt treatment ladle (10) or for pre-melting sump material for furnaces 2 (6) and 3 (7). The sump can be supplemented by additional recharging. The production plan presented is transferred to a table of process step times and loads to generate a resulting planned load schedule. The duration of the associated planning period is 65 TUs, which equals 16.25 h. For the casting process, ten identified risks were preprioritised in advance and described with the necessary information for automated utilisation by the software, e.g., the risk of a defective mould core or casting damage while demoulding. The risks are always listed in relation to the process step for classification in the production plan. In addition to the risks, the system considers one preventive RTM per risk and three additional EFMs for the use case. Measures include adjusting furnace operation parameters or changing the casting order, for example. Further input data sets derived from the use case are the overall electricity procurement schedule of the considered company, calculatory cost factors, basic information and the SSIM.

Application and results
A total of 7544 possible paths for the interactions and dependencies of the 23 individual elements specified in the SSIM have been identified by the method. As an example, the Risk Dashboard for path P4968 is presented in Fig. 12.
The randomly selected exemplary path P4968 consists of the elements R5, R6, R7, M1 and M2. Thus, a planning period is modelled in which the occurrence of R5, R6 and R7 is assumed before M1 and M2 are applied. The three risks considered are the possibilities of crane failure at the casting field, failure of the forklift for transport to the casting fields and the failure of furnace number 4. To counteract them measures M1 and M2 are deployed. The composition of the path results from the specified element interactions and dependencies in the SSIM.
Due to the number of coinciding elements (five), the path's extent of damage is greater than for an individual risk, but the probability of occurrence is very low. To directly compare the different measure and consequence risk constellations, starting from certain risks, the corresponding paths can be selected under the tab "Path comparison" and then be matched in pairs regarding the characteristics of costs and deviations from target values. Non-relevant constellations can be filtered out by applying a certain minimum value of risk to reduce the large number of paths.
To decide the specific measures to be taken, two almost similar paths that are only distinguished by these measures must be considered. Between the paths, the preferred relationship between risk reduction and costs can be selected. In addition, flexibility can be considered to ensure that a chosen path offers sufficient flexibility for possible interventions that are not considered in risk management in production planning.
For example, path P4969 can be compared to the abovementioned path P4968, as it is identical to P4968 but includes RTM M3 as an additional element. Measure M3 (change of process parameters in furnace 3) lowers the average power consumption of melting in furnace 3 by 400 kW. The application of M3 on P4968 leads to a decrease of the energy-flexibility trilemma parameter from 0.563 to 0.7382. Path-induced additional overall costs C tot increase from €2449 to €2686 in absolute numbers, including risk and measure related cost deviations. The relative cost trilemma parameter, which only considers measure-induced cost deviations, ranges from − 0.02673 to − 0.0111. Risk decreases from 2.396E−08 to 1.737E−08. The overall results indicate that the application of RTM M3 may reduce the relative risk by roughly − 27.5% at the absolute price of €237. This exemplary constellation can now be interpreted and compared to all the alternative paths and the respective calculation results by users according to their respective risk adversity.
The results show how the structuring of risk and measure interdependencies and interactions, the construction of a general format for the quantification of risk-induced damage and measure impact, the discretisation of risk and measure effects in the dimensions of time and energy and the presented approach to the triple evaluation work together to enable risk-aware decision support in the planning of energy-flexible production systems. The presented software implementation carries out these steps automatically and visualises the results fully and directly. Only the required input data and information must be provided in the given structure on the user side. Similar paths are listed subsequently and are visually displayed as node-arc-combinations to ensure easy comparability for the user. However, considering the targeted search for specific elements or their combinations, the user interface could be improved in the coming versions.

Conclusion and outlook
The method for risk handling developed supports the work of operational production planning and control through the structured assessment of risks and measures. In doing so, complex interactions between effects and conditional probabilities of occurrence are considered, which could not be dealt with intuitively. The feasibility and applicability were demonstrated by developing a tool in MATLAB ® and using it in a real industrial application. The method increases the manageability of risks in energy-flexible production systems. If companies are enabled to plan and control in an energy-oriented manner, this means adapting to volatile renewable energy systems, which can then be better integrated into the energy system. Thus, the approach supports both the profitability of companies and the achievement of the energy transition goals.
Three areas for further developments and additions have been identified to achieve even better results. These are the identification and evaluation of risks, the creation and evaluation of the paths as well as the selection and integration of paths into the production plan.
In the approach presented, the identification and classification of risks and measures is essentially based on creative techniques and the use of expert knowledge. The information provided by the experts could be abstracted and evaluated using approaches such as fuzzy logic to compensate for misjudgements. The integration of historical plant data and production data facilitates data mining approaches that can be utilised to detect possible events and identify the values for the risk and measurement inventory.
Within the development and evaluation of the paths, the calculation of probabilities of occurrence for paths can be enhanced by applying Copula theory. Copulas allow the calculation of combined distribution functions and thereby generate greater depth and variety of probability information. More detailed modelling of the possibilities of on-site electricity generation, as well as the integration of framework conditions and strategies for strategic energy storage use, may raise the additional economic potential of energyoriented PPC. A more in-depth consideration could be given to risks to peripheral energy-flexibility, for example, risks relating to independent generation and electricity storage. In the presentation within the evaluation framework, the trilemma size R rel , related to the present maximum value is only meaningful with significance to the relative negative impacts. Large maxima of the risk value distort the informative value of the figure. A more in-depth examination and modelling of the trilemma variables can increase the benefit of this form of presentation as a decision support tool in energy-oriented production planning.
Potential dependencies between the planning period's length and the number of risks and resulting effects on the calculation period should be examined in detail in further studies. Also, the programme's stability might be affected by, e.g., a significant increase in the number of risks.
To select paths and their integration into production plans, it is necessary to develop a structured approach that supports the decision-makers. To do this, the company's respective risk preferences must be identified, and any differences specific to the order or production segment must also be considered. Furthermore, an approach needs to be developed with which the appropriate path can then be selected based on the key figure. This path is then to be integrated into the original production plan by an appropriate approach. Figure 14 shows an example of how a distinction must be made between preventive and reactive measures on the path. Preventive measures modify the production plan, while reactive measures are alternatives to an actual plan that are selected when specific limit values, are exceeded or not reached. In the example, an order for machine 1 is divided as a preventive measure to limit the effects of damage of a certain risk. As a reactive measure, an order is moved from machine 2 to machine 3 if a critical value (shown here in a simplified form as "x > 1") is violated.
The approaches to be developed to integrate the measures into the production plans need to be suitable for both the process and manufacturing industries. Therefore, suitable solutions must be developed to assign measures to continuous processes and individual orders.