## 2 Problem Description and Assumptions
### Control Model Formulation  
To formulate the problem, for any specific time \(t\), the production unit and the subcontractor modes were described using a stochastic process \(\{\alpha_{1}(t),\ t>0\}\in\Omega_{1}=\{1,2,3\}\) and \(\{\alpha_{2}(t),\ t>0\}\in\Omega_{2}=\{1,2\}\), respectively. In particular, we note that when \(\alpha_{1}(t)=1\), the production system was operational and generating defects at a rate of \(\beta\). Further, when \(\alpha_{1}(t)=2\), the production system was in failure mode, where minimal maintenance was performed, which left the machine in an ABAO condition before the occurrence of the failure. When \(\alpha_{1}(t)=3\), major maintenance was undertaken, which completely mitigated the effects of the deterioration process since it restored the machine to an AGAN condition. Regarding the unavailability of the subcontractor, contrary to the assumption made in the literature, we assumed that the contractor was not always available to supply units due to technical disruptions; therefore, to make things simple, we proposed Markov dynamics  
Figure 1: Block diagram of the production system. for \(\alpha_{2}(t)\). More precisely, when \(\alpha_{2}(t)=1\), the subcontractor was available and they send flawless units to the production system, and when \(\alpha_{2}(t)=2\), subcontracting was not available, and thus, it stopped its operation due to the conduction of maintenance activities. The dynamics of the level of inventory was given by the next differential equation:  
\[\frac{\partial x(t)}{\partial(t)}=\frac{u_{1}(t)}{1-\beta\left(a\right)}+u_{2} (t)-d,\;\;x(0)=x_{0} \tag{1}\]  
where \(u_{1}(t)\) is the production rate of the machine at time \(t\), \(u_{2}(t)\) is the subcontracting rate, \(\beta(a)\) is the rate of defects at age \(a\), and \(d\) is the demand rate. The production rate at any time \(t\) satisfied \(0\leq u_{1}(t)\leq u_{max}\), where \(u_{max}\) is the maximum production rate for internal production. We assumed that the subcontractor satisfied only a fraction \(k_{1}\) of the customer demand to be profitable for the company, as presented in the following equation:  
\[u_{2}(t)=k_{1}\cdot d \tag{2}\]  
For the current problem, we conjectured that the production unit experienced progressive deterioration. We modeled this condition using the age of the production unit as a key metric of its amount of deterioration. Furthermore, by assuming that the age of the machine at time \(t\) implied an increasing function calculated from its production rate, then the cumulative age was defined as follows:  
\[\frac{\partial a(t)}{\partial(t)}=\eta_{o}\cdot u_{1}(t) \tag{3}\]  
\[a(T)=0 \tag{4}\]  
where \(\eta_{o}\) is a given constant and \(T\) indicates the last restart time of the machine. Equation (3) uses the production rate to determine the age of the production unit. Furthermore, of significant importance is the fact that the model incorporated the influence of a degradation process in its formulation. In particular, we state that the defect rate was increased by the pace of deterioration of the machine, as in [PERSON] and Tolio [39], as defined in the next equation:  
\[\beta(a)=b_{0}+b_{1}\Big{[}e^{-\eta_{1}a(t)\gamma_{2}}\Big{]} \tag{5}\]  
where \(b_{0}\) is the defect rate in an AGAN condition, \(b_{1}\) defines the upper limit for the rate of defects, and \(\eta_{1}\) and \(\eta_{2}\) are positive constants. The production unit was unreliable and exhibited Markov dynamics due to random failures and repairs; hence, it was not always operational. The availability of the production unit could be calculated with the next equation:  
\[\pi_{i}^{prod}\cdot Q(\cdot)=0\;y\;\sum_{i=1}^{3}\pi_{i}^{prod}=1 \tag{6}\]  
where \(Q(\cdot)\) refers to the transition rate matrix that is defined by the transition rates \(q_{ij}\) between mode \(i\) and mode \(j\) of the production unit. Additionally, \(\pi_{i}^{prod}\) is the fraction of time that the production unit is in mode \(i\).