# Model Predictive Control for Flexible Job Shop Scheduling in Industry 4.0 +
## 3 Model Generation
### Generation of the Discrete Time Petri Net Model
The result of the Algorithms 1 and 2 is the Petri Net \(PN=(\mathbb{P},\mathbb{T},\mathbb{E},w,x^{0})\) and its state space description given by the matrices \(A,B^{+},B^{-}\) and the initial state \(x^{0}\). The state space description will be used for the scheduling scheme described in Section 4. As it was created by specific Algorithms it has some properties that will be exploited to prove important properties of the scheduling scheme. Those properties are discussed in the next section. ### Analysis and Discussion of the Discrete Time Petri Net Model

Before using the Petri Net model generated in Section 3.3 for the scheduling of the JMPMSF in Section 4, we will analyze its state space description (4) together with the non-negativity constraint (3). Some specific properties that will be exploited to prove important properties of the proposed scheduling scheme in Section 4 are given in the following lemma from our previous work [18]. **Lemma 1** (Properties of the automatically generated Petri Net). : _For the Petri Net \(PN=(\mathbb{P},\mathbb{T},\mathbb{E},w,x^{0})\) generated with the Algorithms 1 and 2, the following properties hold:_

1. _A steady state is a pair of state and input_ \((x^{s},u^{s})\) _with_ \(x^{s}=Ax^{s}+Bu^{s}\)_. As there is no steady state_ \((x^{s},u^{s})\) _with_ \(u^{s}\
eq 0,u^{s}\in\mathbb{N}^{m}\)_, we denote_ \(x^{s}\) _the_ steady state _and omit the input_ \(u\)_. The fact that there is no steady state with_ \(u^{s}\
eq 0\) _means that the Petri Net_ \(PN\) _has no T-invariant (__[_39_]_ _Definition_ 11.4)._
2. _The following statements are equivalent:_ _In the state_ \(x^{s}\) _no production is taking place, i.e., no production place_ \(P_{(\ldots,P)}\) _is marked_ \(\Leftrightarrow\)__\(x^{s}\) _is a steady state._
3. _The initial state_ \(x^{0}\) _generated in Algorithm_ 1 _is a steady state and_ \(x^{0}\in\mathbb{N}^{n}\)_._
4. _All parts_ \(\bar{x},\bar{x}\in\mathbb{N}^{n}\) _of a steady state_ \(x^{s}\) _are themselves steady states, i.e.,_ \(x^{s}=\bar{x}+\bar{x}=Ax^{s}\quad\Leftrightarrow\quad\bar{x}=A\bar{x}\)_,_ \(\bar{x}=A\bar{x}\)_._
5. _The precondition of every firing, which needs to be satisfied according to the non-negativity condition (_3_) in order to start a production process, forms a steady state for all inputs_ \(u\)_, i.e.,_ \(B^{-}u=AB^{-}u\quad\forall\;u\in\mathbb{N}^{m}\)_._
6. _A task which has been completed stays completed, i.e., once the completion places_ \(P_{(\ldots,\mathbb{C})}\) _are marked they stay marked._
7. _If_ \(x(0)\in\mathbb{N}^{n}\) _then_ \(x(k)=A^{k}x(0)\in\mathbb{N}^{n}\) _for all_ \(k\geq 0\) _and condition (_3_) is satisfied for_ \(x(k)\) _with_ \(u(k)=0\) _for all_ \(k\geq 0\)_._
8. _Every state_ \(x\) _eventually enters a steady state_ \(x^{s}=A^{n}x\Leftrightarrow\) _there is a_ \(\bar{k}<n\) _for which_ \(A^{\bar{k}}=A^{(\bar{k}+1)}=A^{n}\)_._
9. _If an operation_ \(O=(\tau^{\prime},I)\)_, i.e., a specific task_ \(\tau^{\prime}\) _of a job_ \(J\)_, can be started at a steady state_ \(x^{s,1}\)_, it can also be started in all steady states_ \(x^{s,2}\) _reachable from_ \(x^{s,1}\) _through a legal firing sequence respecting (_3_), or it was already completed in_ \(x^{s,2}\)_._

A proof of the Lemma 1 can be found in Appendix A. The Properties (P1)-(P6) define important features of steady states, that are not only important for theoretical analysis, but also required for a reasonable representation of a production system. If, in contrast to Property (P1), an action is necessary to keep the production system at rest, it tends to be unstable. If, in contrast to Property (P2), a production is going on while the system is at rest, either the model is flawed or the production does not yield any products, which would not be favorable. Initializing the system at rest as stated in Property (P3) is a common way of modeling. If Property (P4) was not fulfilled, there would be a steady state only due to two or more ongoing processes that cancel each other out.