Endogenous Retirement

GenX.endogenous_retirement_discharge! — Method
endogenous_retirement_discharge!(EP::Model, inputs::Dict, num_stages::Int, cur_stage::Int, stage_lens::Array{Int, 1})

This function models the following constraint

\[\begin{aligned} & RETCAP_{y,p} \geq \sum^p_{t=1} MINRET_{y,t} + \sum^r_{t=1}CAP_{y,t} - \sum^{(p-1)}_{t=1}RETCAP_{y,t} \end{aligned}\]

where $r \in \{1, ..., (p-1)\}$ is defined as the last stage such that if we built $y$ at the end of stage $r$, it would reach its end of life before the end of stage $p$. In other words, it is the largest index $r \in \{1, ..., (p-1)\}$ such that:

\[\begin{aligned} \sum^p_{t=r+1}StageLength_{t} \leq LifeTime_{y} \end{aligned}\]

source
GenX.get_retirement_stage — Method
get_retirement_stage(cur_stage::Int, lifetime::Int, stage_lens::Array{Int, 1})

This function determines the model stage before which all newly built capacity must be retired. Used to enforce endogenous lifetime retirements in multi-stage modeling.

Capacity built in stage $r$ must have retired by the beginning of stage $i$ once the years elapsed between the start of stage $r$ and the start of stage $i$ reach the technology's lifetime:

\[\text{ret\_stage}(i) = \max\{\, r < i \;:\; \sum_{t=r}^{i-1} L_t \geq EL \,\}\]

returning 0 when no stage qualifies. A unit reaching end of life partway through a stage therefore remains available for the whole of that stage and retires at the start of the next.

Measuring from the start of each stage, rather than from the end of the current one, only matters when stages have unequal lengths. With stages of 10, 5 and 8 years and an 8-year lifetime, capacity built at the start of stage 2 (year 10) reaches end of life in year 18, part way through stage 3 (years 15 to 23): it stays available for stage 3 and retires at the start of stage 4.

inputs:

  • cur_stage – An Int representing the current model stage $p$.
  • lifetime – An Int representing the lifetime of a particular resource.
  • stage_lens – An Int array representing the length $L$ of each model stage.

returns: An Int representing the model stage before which the resource must retire due to endogenous lifetime retirements; 0 if none.

source