# Model Predictive Control for Flexible Job Shop Scheduling in Industry 4.0 +
## 3 Model Generation
### Generation of the Discrete Time Petri Net Model
Therefore the production is not only started in the prediction, but also in closed loop. According to Property (P2), the resulting state is no steady state as a production place \(P_{(\ldots,P_{1})}\) is marked. Due to Property (P8), eventually another steady state is reached. According to Property (P2), a steady state is only reached when no production place \(P_{(\ldots,P)}\) is marked any more. As the only independent transitions \(T\in\mathbb{T}_{I}\) that do not mark another production place are finishing transitions \(T_{(\ldots,F)}\), this means that eventually a finishing transition fires. As every finishing transition \(T_{(\ldots,F)}\) created in lines 10 and 11 of Algorithm 2 marks a completion place \(P_{(\ldots,C)}\), eventually a completion place is marked. Due to Property (P6), once completion places are marked they stay marked and hence the completed operations stay completed. The condition in Lemma 4 can be exploited to guarantee the completion of a given production problem as long as it is finite and feasible, which we state in the following assumptions. As we generally allow the production problem to change, for example, through new jobs in the production problem, we assume that it is finite and feasible at the time when we investigate it. For a production problem that can always be extended, trying to argue that it will be completed a certain point in time is futile. Therefore, we will only analyze the properties of the production problems as it is at a certain point in time. **Assumption 1** (Finite production system). : _The given production problem formulated as in Section 2 is finite, meaning that it has a finite number of possible tasks \(n_{\tau}<\infty\), a finite number of jobs \(n_{I}<\infty\) and a finite number of machines \(n_{M}<\infty\) at a given time._

We state the central assumption that the production problem is feasible, meaning that all operations can be executed by the given machine pool, on the level of the initial production problem formulated in Section 2 as well as on the level of the Petri Net and its state space description described in Section 3. **Assumption 2** (Feasibility of the production problem [18]). : _All jobs \(J\in\mathcal{J}\) can be fulfilled by the given production system. This means that for every job \(J\in\mathcal{J}\) and every task \(\tau\in\mathcal{T}_{J}\) there exists at least one machine \(M\in\mathcal{M}\) with \(\tau\in\mathcal{T}_{M}\)._In terms of the Petri Net, there exists at least one state \(\hat{x}\) in which every completion place \(P_{(\ldots,C)}\) is marked and which is reachable from the initial state \(x^{0}\). In the state space, there exists at least one state \(\hat{x}\) with \(\hat{x}_{i}=1\) for every \(i\) where \(x^{\mathrm{ID}}_{i}=(\ldots,C)\) and which is reachable from the initial state \(x^{0}\), i.e., there exists a legal input trajectory \((u(0),\ldots,u(\hat{k}-1))\) leading from \(x(0)=x^{0}\) to \(\hat{x}=x(\hat{k})=A^{\hat{k}}x^{0}+\sum_{l=0}^{\hat{k}-1}A^{l}Bu(\hat{k}-1-l)\) and where the non-negativity constraint (3) is respected for all \(x(k),u(k)\) with \(k=0,\ldots,\hat{k}\). **Lemma 5** (Completion of the production problem). : _Given a Petri Net of a flexible manufacturing system in its state space form (3), (4) generated with the Algorithms 1 and 2 that fulfills the Assumptions 1 and 2. If there is only one steady state \(x^{F}\) for which not all optimal input trajectories \(u^{*}(\cdot|k)\) for the MPC problem (6) are such that \(u^{*}(0|k)\
eq 0\), then the production problem will be completed by the MPC and \(x^{F}\) is the final state of production system._

Proof of Lemma 5.: The steady state \(x^{F}\) is the only steady state for which the preconditions of Lemma 4 are not fulfilled. For all other steady states \(x^{s}\), all optimal input trajectories \(u^{*}(\cdot|k)\) for the MPC problem (6) are such that \(u^{*}(0|k)\
eq 0\). Therefore, Lemma 4 states that in all steady states except \(x^{F}\) at least one operation \(O\) is started.