# Optimal Maintenance Schedule for a Wind Power Turbine with Aging Components
## 6 Optimal Maintenance Algorithm for Multiple Components  
For the planning period \([s,T]\), we call a PM plan in the multi-component setting any array \((x_{s},y_{s},z)\), where  
\[(x_{s},y_{s})=\{x_{t}^{j},y_{t}:\;1\leq j\leq n,\;s+1\leq t\leq T\}\]  
and all components are binary \(x_{t}^{j},y_{t},z\in\{0,1\}\) subject to the following linear constraints  
\[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\] \[\sum_{t=s+1}^{T}y_{t}=1-z,\] (8b) \[\sum_{i=1}^{n}x_{t}^{j}\geq y_{t},\quad t=s+1,\ldots T. \tag{8c}\]The equality \(x_{t}^{j}=1\) means that the plan \((\mathbf{x}_{s},\mathbf{y}_{s},z)\) suggests a PM replacement of the \(j\)-th component at time \(t\). On the other hand, the equality \(y_{t}=1\) means that according to the plan, \((\mathbf{x}_{s},\mathbf{y}_{s},z)\) at least one of the components should be replaced at time \(t\); this is guaranteed by constraint (8c) (constraint (8a) allows for several components to be replaced at such a time \(t\)). The equality \(z=1\) means that no PM is planned during the whole time period \([s+1,T]\). This is guaranteed by constraint (8b). Given the current ages of \(n\) components  
\[\mathbf{a}=(a^{1},\ldots,a^{n}),\]  
the first failure time is \(s+L_{\mathbf{a}}\), where  
\[L_{\mathbf{a}}=\min(L_{a^{1}}^{1},\ldots,L_{a^{n}}^{n}).\]  
Putting  
\[\gamma=\{j:L_{a^{j}}^{j}=L_{\mathbf{a}}\}\]  
we first mention a naive formula for the cost \(\tilde{F}_{(s,\mathbf{a})}\) assigned to a PM plan \((\mathbf{x}_{s},\mathbf{y}_{s},z)\) assuming that, at each maintenance event, all \(n\) components are replaced by the new ones. With  
\[\tilde{C}_{\mathbf{a}} =g_{0}+(T-s-L_{\mathbf{a}})c+\sum_{j\in\gamma}g^{j}+\sum_{j\
otin \gamma}(h^{j}+(L_{\mathbf{a}}+a^{j})m^{j}),\] \[\tilde{P}_{\mathbf{a}} =h_{0}+(T-t)c+\sum_{j=1}^{n}(h^{j}+(t-s+a^{j})m^{j}),\]  
where \(c\) is given by (5), put  
\[\tilde{F}_{(s,\mathbf{a})}(\mathbf{y}_{s},z)=\sum_{t=s+1}^{T}\Big{(}\tilde{C}_{\mathbf{a}} \mathbf{1}_{\{s+L_{\mathbf{a}}\leq t\}}+\tilde{P}_{\mathbf{a}}\mathbf{1}_{\{s+L_{\mathbf{a}}>t\}} \Big{)}y_{t}+\tilde{C}_{\mathbf{a}}\mathbf{1}_{\{s+L_{\mathbf{a}}\leq T\}}z.\]  
Here, the last term describes the option of planning no PM activity. This formula should be modified to incorporate the virtual replacement costs:  
\[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\]0  
where  
\[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\]1 \[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\]2  
Notice that the total cost function \(F_{(s,\mathbf{a})}(\mathbf{y}_{s},z)\) does not explicitly depend on \(\mathbf{x}_{s}\). The role of \(\mathbf{x}_{s}\) becomes explicit through the following additional constraint  
\[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\]3 \[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\]4  
This says that if \(y_{t}=1\), that is, if a PM for at least one component is scheduled at time \(t\), then for each component \(j\), there is a choice between two actions at time \(t\): either perform a PM, so that \(x_{t}^{j}=1\) and \(y_{t}-x_{t}^{j}=0\), or do not perform a PM and compensate for the current age of the component by increasing the cost function using the virtual replacement cost value (which corresponds to \(x_{t}^{j}=0\) and \(y_{t}-x_{t}^{j}=1\)). The optimal maintenance plan is the solution to the linear optimization problem:  
minimize \[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\]5 subject to \[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\]6 \[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\]7 \[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\]8 \[y_{t}\geq x_{t}^{j},\quad t=s+1,\ldots T,\;j=1,\ldots,n, \tag{8a}\]9  
This optimization problem is solved using the standard approach for the case when all variables are binary, and the objective function is a linear function of the variables \((y_{s+1},\dots,y_{T})\) and \(z\).