Endogenous Retirement
GenX.endogenous_retirement_discharge!
— Methodendogenous_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}\]
GenX.get_retirement_stage
— Methodget_retirement_stage(cur_stage::Int, stage_len::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.
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 in before which the resource must retire due to endogenous lifetime retirements.