Post · 10 min read· pp. 273–280

Maintenance Scheduling

Maintenance scheduling constraints are implemented for the Generator, Link and Process components. The Process component follows the same formulation as the Link, applied to its internal power pp. For components marked as maintainable=True, two new variables are introduced: binary maintenance start variables ms∗,t∈{0,1}ms_{*,t} \in \{0,1\}, indicating that a maintenance event begins in snapshot tt, and continuous maintenance status variables m∗,t∈[0,1]m_{*,t} \in [0,1], indicating whether the component is undergoing maintenance (1) or available (0). The integrality of mm is implied through the window coverage equality below, so only msms enters the model as a binary. This turns the model into a mixed-integer linear programme (MILP).

Scheduling generator maintenance as an integer program dates back to Dopazo and Merrill (1975).[^1] The event-based formulation here follows the tradition of scheduling a given number of maintenance events of fixed duration[^2]; for a survey of alternative formulations and the tightness of their linear relaxations, see Andrade (2025).[^3] A broader review of maintenance scheduling in the electricity industry is given by Froger et al. (2016).[^4]

Event Count

The total number of maintenance start events must equal the specified number of events EE:

∑tms∗,t=E\sum_{t} ms_{*,t} = E

Constraint name: *-maint-event-count

Maintenance Windows

The duration per event dd (maintenance_duration) is given in elapsed time. For each potential start snapshot t′t', the coverage window cov(t′)\text{cov}(t') is the minimal run of consecutive snapshots whose weightings wtw_t accumulate to at least dd:

cov(t′)={t′,…,k(t′)},k(t′)=min⁡{k:∑t=t′kwt≥d}\text{cov}(t') = \{t', \dots, k(t')\}, \quad k(t') = \min\Big\{k : \sum_{t=t'}^{k} w_t \ge d\Big\}

The maintenance status equals the sum of all start events whose window covers the snapshot:

m∗,t=∑t′: t∈cov(t′)ms∗,t′m_{*,t} = \sum_{t' :\, t \in \text{cov}(t')} ms_{*,t'}

Together with m≤1m \leq 1, this single equality enforces contiguous maintenance blocks, forbids overlapping events and implies the integrality of mm.

Constraint name: *-maint-window

Round-up semantics

Each event lasts at least dd elapsed hours, overshooting by less than the weighting of the last covered snapshot. For uniform hourly snapshots and integer dd, the duration is exact.

Start Validity

Maintenance cannot start where the coverage window does not fit, i.e. where the remaining weighted horizon is shorter than dd or where the window would span snapshots in which the component is inactive:

ms∗,t′=0∀t′:cov(t′) incomplete or partially inactivems_{*,t'} = 0 \quad \forall t' : \text{cov}(t') \text{ incomplete or partially inactive}

Constraint name: *-maint-start-horizon

Effect on Dispatch Limits

During maintenance, the available capacity is reduced by a fraction α\alpha (maintenance_pu). When α=1\alpha = 1 (default), the component is fully unavailable during maintenance.

Non-Extendable Components

GeneratorLink

ConstraintName
gn,s,t≥g‾n,s,t⋅g^n,s⋅(1−αn,s⋅mn,s,t)g_{n,s,t} \geq \underline{g}_{n,s,t} \cdot \hat{g}_{n,s} \cdot (1 - \alpha_{n,s} \cdot m_{n,s,t})Generator-fix-p-lower
gn,s,t≤gˉn,s,t⋅g^n,s⋅(1−αn,s⋅mn,s,t)g_{n,s,t} \leq \bar{g}_{n,s,t} \cdot \hat{g}_{n,s} \cdot (1 - \alpha_{n,s} \cdot m_{n,s,t})Generator-fix-p-upper
ConstraintName
fl,t≥f‾l,t⋅f^l⋅(1−αl⋅ml,t)f_{l,t} \geq \underline{f}_{l,t} \cdot \hat{f}_{l} \cdot (1 - \alpha_{l} \cdot m_{l,t})Link-fix-p-lower
fl,t≤fˉl,t⋅f^l⋅(1−αl⋅ml,t)f_{l,t} \leq \bar{f}_{l,t} \cdot \hat{f}_{l} \cdot (1 - \alpha_{l} \cdot m_{l,t})Link-fix-p-upper

Extendable Components

For extendable components, the dispatch coupling involves the bilinear product g^n,s⋅mn,s,t\hat{g}_{n,s} \cdot m_{n,s,t}. Since g^n,s\hat{g}_{n,s} is a continuous variable (the optimised capacity), this product is linearised using a McCormick envelope with the auxiliary variable zn,s,t=g^n,s⋅mn,s,tz_{n,s,t} = \hat{g}_{n,s} \cdot m_{n,s,t}:

GeneratorLink

ConstraintName
gn,s,t≥g‾n,s,t⋅g^n,s−g‾n,s,t⋅αn,s⋅zn,s,tg_{n,s,t} \geq \underline{g}_{n,s,t} \cdot \hat{g}_{n,s} - \underline{g}_{n,s,t} \cdot \alpha_{n,s} \cdot z_{n,s,t}Generator-ext-p-lower
gn,s,t≤gˉn,s,t⋅g^n,s−gˉn,s,t⋅αn,s⋅zn,s,tg_{n,s,t} \leq \bar{g}_{n,s,t} \cdot \hat{g}_{n,s} - \bar{g}_{n,s,t} \cdot \alpha_{n,s} \cdot z_{n,s,t}Generator-ext-p-upper
ConstraintName
fl,t≥f‾l,t⋅f^l−f‾l,t⋅αl⋅zl,tf_{l,t} \geq \underline{f}_{l,t} \cdot \hat{f}_{l} - \underline{f}_{l,t} \cdot \alpha_{l} \cdot z_{l,t}Link-ext-p-lower
fl,t≤fˉl,t⋅f^l−fˉl,t⋅αl⋅zl,tf_{l,t} \leq \bar{f}_{l,t} \cdot \hat{f}_{l} - \bar{f}_{l,t} \cdot \alpha_{l} \cdot z_{l,t}Link-ext-p-upper

The McCormick envelope bounds on zz are:

ConstraintName
z∗,t≤g^∗−g^∗min⁡⋅(1−m∗,t)z_{*,t} \leq \hat{g}_{*} - \hat{g}^{\min}_{*} \cdot (1 - m_{*,t})*-maintcap_upper
z∗,t≤g^∗max⁡⋅m∗,tz_{*,t} \leq \hat{g}^{\max}_{*} \cdot m_{*,t}*-maintcap_upper_nommax
z∗,t≥g^∗+g^∗max⁡⋅(m∗,t−1)z_{*,t} \geq \hat{g}_{*} + \hat{g}^{\max}_{*} \cdot (m_{*,t} - 1)*-maintcap_lower_nommax
z∗,t≥g^∗min⁡⋅m∗,tz_{*,t} \geq \hat{g}^{\min}_{*} \cdot m_{*,t}*-maintcap_lower_nommin (only added where g^min⁡>0\hat{g}^{\min} > 0)

Together with z≥0z \geq 0, these form the convex hull of z=g^⋅mz = \hat{g} \cdot m for m∈{0,1}m \in \{0,1\} and g^min⁡≤g^≤g^max⁡\hat{g}^{\min} \leq \hat{g} \leq \hat{g}^{\max}. Since mm only takes integral values in any feasible solution, the linearisation is exact. It requires a finite p_nom_max. The auxiliary variable zz is internal and not written to the network outputs.

Committable Components

When combined with unit commitment (committable=True), the dispatch bounds scale the available capacity by un,s,t−αn,s⋅vn,s,tu_{n,s,t} - \alpha_{n,s} \cdot v_{n,s,t}, where v=u⋅mv = u \cdot m is the product of the commitment status and the maintenance status. This couples the two decisions exactly: at full maintenance (α=1\alpha = 1) the unit can be shut down (u=0u = 0), while fractional maintenance leaves the remaining capacity available if committed.

Generator (fixed capacity)Generator (modular capacity)Generator (extendable capacity)

ConstraintName
gn,s,t≥g‾n,s,t⋅g^n,s⋅(un,s,t−αn,s⋅vn,s,t)g_{n,s,t} \geq \underline{g}_{n,s,t} \cdot \hat{g}_{n,s} \cdot (u_{n,s,t} - \alpha_{n,s} \cdot v_{n,s,t})Generator-com-p-lower
gn,s,t≤gˉn,s,t⋅g^n,s⋅(un,s,t−αn,s⋅vn,s,t)g_{n,s,t} \leq \bar{g}_{n,s,t} \cdot \hat{g}_{n,s} \cdot (u_{n,s,t} - \alpha_{n,s} \cdot v_{n,s,t})Generator-com-p-upper
vn,s,t≤un,s,tv_{n,s,t} \leq u_{n,s,t}Generator-maint-status-le-status
vn,s,t≤mn,s,tv_{n,s,t} \leq m_{n,s,t}Generator-maint-status-le-maint
vn,s,t≥un,s,t+mn,s,t−1v_{n,s,t} \geq u_{n,s,t} + m_{n,s,t} - 1Generator-maint-status-lb

Together with v≥0v \geq 0, these McCormick inequalities give v=u⋅mv = u \cdot m exactly, since mm is binary. This holds for binary status (standard unit commitment) and for the relaxed continuous status of linearized_unit_commitment=True. The auxiliary variable vv is internal and not written to the network outputs.

For modular committables the status un,s,tmodu^{\mathrm{mod}}_{n,s,t} is the integer number of committed modules and g^n,smod\hat{g}^{\mathrm{mod}}_{n,s} the module size. The same product v=umod⋅mv = u^{\mathrm{mod}} \cdot m scales the committed capacity, with Un,s=g^n,smax⁡/g^n,smodU_{n,s} = \hat{g}^{\max}_{n,s} / \hat{g}^{\mathrm{mod}}_{n,s} bounding the module count.

ConstraintName
gn,s,t≥g‾n,s,t⋅g^n,smod⋅(un,s,tmod−αn,s⋅vn,s,t)g_{n,s,t} \geq \underline{g}_{n,s,t} \cdot \hat{g}^{\mathrm{mod}}_{n,s} \cdot (u^{\mathrm{mod}}_{n,s,t} - \alpha_{n,s} \cdot v_{n,s,t})Generator-com-mod-p-lower
gn,s,t≤gˉn,s,t⋅g^n,smod⋅(un,s,tmod−αn,s⋅vn,s,t)g_{n,s,t} \leq \bar{g}_{n,s,t} \cdot \hat{g}^{\mathrm{mod}}_{n,s} \cdot (u^{\mathrm{mod}}_{n,s,t} - \alpha_{n,s} \cdot v_{n,s,t})Generator-com-mod-p-upper
vn,s,t≤un,s,tmodv_{n,s,t} \leq u^{\mathrm{mod}}_{n,s,t}Generator-maint-modstatus-le-status
vn,s,t≤Un,s⋅mn,s,tv_{n,s,t} \leq U_{n,s} \cdot m_{n,s,t}Generator-maint-modstatus-le-maint
vn,s,t≥un,s,tmod−Un,s⋅(1−mn,s,t)v_{n,s,t} \geq u^{\mathrm{mod}}_{n,s,t} - U_{n,s} \cdot (1 - m_{n,s,t})Generator-maint-modstatus-lb
ConstraintName
gn,s,t−g‾n,s,t⋅g^n,s−M⋅un,s,t+g‾n,s,t⋅αn,s⋅zn,s,t≥−Mg_{n,s,t} - \underline{g}_{n,s,t} \cdot \hat{g}_{n,s} - M \cdot u_{n,s,t} + \underline{g}_{n,s,t} \cdot \alpha_{n,s} \cdot z_{n,s,t} \geq -MGenerator-com-ext-p-lower
gn,s,t−M⋅un,s,t≤0g_{n,s,t} - M \cdot u_{n,s,t} \leq 0Generator-com-ext-p-upper-bigM
gn,s,t−gˉn,s,t⋅g^n,s+gˉn,s,t⋅αn,s⋅zn,s,t≤0g_{n,s,t} - \bar{g}_{n,s,t} \cdot \hat{g}_{n,s} + \bar{g}_{n,s,t} \cdot \alpha_{n,s} \cdot z_{n,s,t} \leq 0Generator-com-ext-p-upper

Non-modular extendable committables keep the big-M status formulation with the McCormick capacity auxiliary z=g^⋅mz = \hat{g} \cdot m; modular committables use the integer-status product vv above instead.

Combination with other features

Maintenance scheduling can be combined with committable=True (unit commitment) and p_nom_extendable=True (capacity expansion). When all three are active, dispatch bounds use the big-M formulation with the McCormick auxiliary variable zz.

Caveats

  • For committable components, a unit may be shut down (u∗,t=0u_{*,t} = 0) during maintenance. If it stays committed (e.g. forced by minimum up time), start-up costs and minimum up/down times interact with maintenance events.
  • In rolling-horizon optimisation, the event count applies per horizon chunk and in-progress events are not carried over across chunk boundaries.

Mapping of symbols to component attributes

GeneratorLinkProcess

SymbolAttributeType
gn,s,tg_{n,s,t}n.generators_t.pDecision variable
mn,s,tm_{n,s,t}n.generators_t.maintenanceDecision variable
msn,s,tms_{n,s,t}n.generators_t.maintenance_startDecision variable
vn,s,tv_{n,s,t}internal, not written to outputsDecision variable
zn,s,tz_{n,s,t}internal, not written to outputsDecision variable
g^n,s\hat{g}_{n,s}n.generators.p_nomParameter
g^n,smin⁡\hat{g}^{\min}_{n,s}n.generators.p_nom_minParameter
g^n,smax⁡\hat{g}^{\max}_{n,s}n.generators.p_nom_maxParameter
g‾n,s,t\underline{g}_{n,s,t}n.generators_t.p_min_puParameter
gˉn,s,t\bar{g}_{n,s,t}n.generators_t.p_max_puParameter
αn,s\alpha_{n,s}n.generators.maintenance_puParameter
ddn.generators.maintenance_durationParameter
EEn.generators.maintenance_eventsParameter
SymbolAttributeType
fl,tf_{l,t}n.links_t.pDecision variable
ml,tm_{l,t}n.links_t.maintenanceDecision variable
msl,tms_{l,t}n.links_t.maintenance_startDecision variable
vl,tv_{l,t}internal, not written to outputsDecision variable
zl,tz_{l,t}internal, not written to outputsDecision variable
f^l\hat{f}_{l}n.links.p_nomParameter
f^lmin⁡\hat{f}^{\min}_{l}n.links.p_nom_minParameter
f^lmax⁡\hat{f}^{\max}_{l}n.links.p_nom_maxParameter
f‾l,t\underline{f}_{l,t}n.links_t.p_min_puParameter
fˉl,t\bar{f}_{l,t}n.links_t.p_max_puParameter
αl\alpha_{l}n.links.maintenance_puParameter
ddn.links.maintenance_durationParameter
EEn.links.maintenance_eventsParameter

The Process follows the Link formulation applied to its internal power pp.

SymbolAttributeType
pq,tp_{q,t}n.processes_t.pDecision variable
mq,tm_{q,t}n.processes_t.maintenanceDecision variable
msq,tms_{q,t}n.processes_t.maintenance_startDecision variable
vq,tv_{q,t}internal, not written to outputsDecision variable
zq,tz_{q,t}internal, not written to outputsDecision variable
p^q\hat{p}_{q}n.processes.p_nomParameter
p^qmin⁡\hat{p}^{\min}_{q}n.processes.p_nom_minParameter
p^qmax⁡\hat{p}^{\max}_{q}n.processes.p_nom_maxParameter
p‾q,t\underline{p}_{q,t}n.processes_t.p_min_puParameter
pˉq,t\bar{p}_{q,t}n.processes_t.p_max_puParameter
αq\alpha_{q}n.processes.maintenance_puParameter
ddn.processes.maintenance_durationParameter
EEn.processes.maintenance_eventsParameter

Examples

  • Maintenance Scheduling


    Schedules optimal maintenance windows for generators with contiguous downtime blocks, partial outages, and multiple events.

    Go to example


[^1]: J. F. Dopazo and H. M. Merrill (1975), Optimal Generator Maintenance Scheduling Using Integer Programming, IEEE Transactions on Power Apparatus and Systems, 94, 5, 1537-1545, doi:10.1109/T-PAS.1975.31996. [^2]: F. Fourcade, E. Johnson, M. Bara, P. Cortey-Dumont (1997), Optimizing nuclear power plant refueling with mixed-integer programming, European Journal of Operational Research, 97, 2, 269-280, doi:10.1016/S0377-2217(96)00197-X. [^3]: T. Andrade (2025), On the tightness of linear relaxations of alternative mixed integer programming formulations for the generator maintenance scheduling problem, arXiv:2502.08855. [^4]: A. Froger, M. Gendreau, J. E. Mendoza, É. Pinson, L.-M. Rousseau (2016), Maintenance scheduling in the electricity industry: A literature review, European Journal of Operational Research, 251, 3, 695-706, doi:10.1016/j.ejor.2015.08.045.

diagram 2026-07-23

diagram 2026-07-23