## 3 Mathematical Formulation of the Problem
### Total Cost of Maintenance  
A comprehensive maintenance strategy is to ensure both the cost-efficiency and the reliability of the production process. The total maintenance cost consists of the preventive and corrective maintenance cost components of maintenance (1) \(C_{M1}\) and maintenance (2) \(C_{M2}\), corresponding to the two scenarios (1 and 2) that are bound to happen in the production process (Figure 5). Figure 5: Integrated maintenance and control chart decision. Maintenance planning will minimize costs related to preventive and corrective maintenance. This work's maintenance strategy is preventive maintenance activities with minimal repair (PMMR) in the \"in-control\" state of the process, scheduled on the finite horizon \(H\cdot\Delta t\). The production horizon is equally divided into \(N\) parts of duration \(t_{p}\). The preventive action is performed at each \(i\cdot T\) (\(i=1,\ 2,\ \dots,\ N\)), in which the machine state is restored to as good as new. However, between two preventive activities, corrective maintenance is carried out with minimal repair. Besides, when the process is in the \"in-control\" state, it is assumed that the repair and replacement durations are negligible. The maintenance plan is established based on the optimal production and delivery plan, which reduces the failure rate and maintenance costs by meeting the customer requirements. The proposed maintenance policy is characterized by the optimum number, \(N^{\star}\), of preventive maintenance activities and the best adequate interval between them is noted as \(tp^{\star}\), which are obtained by minimizing Equation (29):  
\[C_{MT}=C_{M1}+C_{M2} \tag{29}\]  
With:  
\[C_{M1}=p_{1}\times\left(C_{pm}\times\left\lfloor\frac{H}{\frac{T}{M}}\right\rfloor +C_{cm}\times\varphi_{M}(U,N)\right) \tag{30}\]  
\(u=\{u(k),\ k\colon 1\dots,\,H\}\), where \(\varphi(U,\ N)\) is the average number of failures. It is corresponding to the obtained production planning specified by the vector and the number of preventive maintenance actions. Assuming that the prefect maintenance action is consistently applied at the end of the production period, the average number of failures is given by the following relation:  
\[\varphi_{M}(U,T)=\sum\limits_{j=0}^{N-1}\left[\sum\limits_{i=\left\lfloor j \times\frac{T}{M}\right\rfloor+1}^{\lfloor j(j+1)\times\frac{T}{M}\rfloor} \int\limits_{0}^{\Delta t}\lambda_{i}(t)dt\right]+\sum\limits_{i=(N\times \frac{T}{M})}^{H}\int\limits_{0}^{\Delta t}\lambda_{i}(t)dt \tag{31}\]  
\(\lfloor\ \rfloor\): the integer part, and  
\[T=\left\lfloor\frac{H.\Delta t}{N}\right\rfloor,\]  
\[C_{M2}=p_{2}\times\left( \begin{array}{c}C_{pm}\times\eta_{pc}+\sum\limits_{ j=0}^{n_{pc}-1}\left(C_{pm}\times\left\lfloor\frac{\left(\frac{\left(A0P_{1,j+1}-A0P_{1,j}- t_{p}\right)}{p}\right)}{\frac{t_{j}}{M}}\right\rfloor+C_{cm}\times\varphi_{j}( U,N_{j})\right)\\ +C_{pm}\times\left\lfloor\frac{H-\frac{A0P_{1,p_{pc}}}{P_{1,p_{pc}}}-t_{p_{ p}}}{\frac{t_{p}}{M}}\right\rfloor+C_{cm}\times\varphi_{\eta_{pc}}\left(U,N_{n_{pc}} \right)\end{array} \right) \tag{32}\]  
\[AOP_{1,0}=0\]  
\[t_{p0}=0\]  
where \(n_{pc}\) is the number of assignable causes, \(N_{j}\) is the number of preventive maintenance activities between two assignable causes, \(n_{pc}\), and \(Nn_{pc}\) is the number of preventive maintenance activities between the last assignable cause and the end of the production horizon \((H)\). \[\varphi_{Mj}(U,N_{j})=\sum\limits_{z=0}^{N_{j}} \begin{vmatrix}\frac{AOP_{1,j}}{ \frac{p}{\lambda}}\left|+tp_{j+}\right|(z+1)\times\frac{T_{j}}{\Delta t}\right| \\ \left|\frac{AOP_{1,j}}{\frac{p}{\lambda}}\right|\sum\limits_{+tp_{j+}}\left|z \times\frac{T_{j}}{\Delta t}\right|+1\end{vmatrix}