## 4 Mathematical Model
### Mathematical Model  
In the literature, there exist different mathematical model formulations for the standard flexible job shop scheduling problem. The mathematical model proposed by [PERSON] and [PERSON] [31] takes into account constraints on processing times, precedence between operations, and machine capacity in number of operations processed at the same time, which corresponds with the studied problem. However, this model does not take into consideration the constraints on machine capacity in the number of portions, machine availability time windows, sequence-dependent setup time, due dates of jobs, splitting of jobs, and batching of sub-lots. The developed mathematical model that integrates all these constraints is formulated as indicated through Equations (1) to (22):  
\[Min\ \sum_{i\in N}C_{i} \tag{1}\]  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]  
\[S_{iljk}+C_{iljk}\leq B*X_{iljk},\ \ \forall\ \ i\in N,l\in L_{i},j\in J_{i},k\in M_{ij} \tag{3}\]  
\[C_{iljk}-S_{iljk}\geq P_{ijk}-B*(1-X_{iljk}),\ \ \forall\ \ i\in N,l\in L_{i},j\in J_{i},k\in M_{2}\cup M_{3} \tag{4}\]  
\[C_{iljk}-S_{iljk}\geq P^{\prime}_{ijk}*Q_{i}-B*(1-X_{iljk}),\ \ \forall\ \ i\in N,l\in L_{i},j\in J_{i},\ k\in M_{1} \tag{5}\]  
\[S_{iljk}\geq C_{iljk}+s_{iljkg}-B*(1-F_{iljht^{\prime}gk}),\ \ \forall\ \ i\in N,l\in L_{i},j\in J_{i},h\in N,l^{\prime}\in L_{h},g\in J_{h}, \tag{6}\]  
\[\begin{split}&\\[C_{iljk}-C_{il^{\prime}jk}\leq B*(1-Z_{ill^{\prime}jk}),\ \ \forall\ \ i\in N,l,l^{\prime}\in L_{i},j\in J_{i},k\in M_{2}\cup M_{3} \tag{9}\]  
\[\sum_{h\in N\backslash\{0\}}\sum_{l^{\prime}\in L_{h}}\sum_{g\in I_{h}}F_{iljhl^ {\prime}gk}=1,\ \ \forall\ \ i\in N\backslash\{n+1\},l\in L_{i},j\in J_{i},k\in M_{ij}\cap M_{bg} \tag{10}\]  
\[\sum_{i\in N\backslash\{n+1\}}\sum_{l\in L_{i}}\sum_{j\in I_{i}}F_{iljhl^{ \prime}gk}=1,\ \ \forall\ \ h\in N\backslash\{0\},l^{\prime}\in L_{h},g\in J_{h},k\in M_{ij}\cap M_{bg} \tag{11}\]  
\[\sum_{k\in M_{ij}}S_{iljk}-\sum_{k\in M_{ij-1}}C_{ilj-1k}\geq 0,\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{12}\]  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]0  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]1  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]2  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]3  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]4  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]5  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]6  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]7  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]8  
\[C_{i}\geq\sum_{k\in M_{ij}}C_{iljk},\ \ \forall\ \ i\in N,\ l\in L_{i},\ j\in J_{i} \tag{2}\]9  
In the mathematical model presented previously, Equation (1) represents the objective function, which consists in minimizing the total flow time of jobs in the production system. It is defined as the sum of the completion times of all jobs since the release dates are equal to zero. The completion times of jobs are computed as the completion time of the last sub-lot derived from the considered job, as indicated in Equation (2). Note that, due to Equation (3), for given \(i\in N,l\in L_{i},\) and \(j\in J_{i},\) variables \(S_{iljk}\) and \(C_{iljk}\) are equal to zero if the machine \(k\in M_{ij}\) is not chosen to realize the operation of the considered sub-lot. On the other hand, when \(X_{iljk}\) is equal to 1, Equations (4) and (5) activate the relationship between the starting time and completion time of an operation of a sub-lot.