Skip to content

Commit

Permalink
Added docstring for endogenous retirement constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
sambuddhac committed Mar 18, 2024
1 parent ed61046 commit 87ee894
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/multi_stage/endogenous_retirement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ inputs:
* 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.
```math
\begin{aligned}
& RETCAP_{y,p} \geq \sum^p_{t=1} MINRET_{y,t} + \sum^r_{t=1}CAP_{y,t} - \sum^p_{t=1}RETCAP_{y,p}
\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:
```math
\begin{aligned}
\sum^p_{t=r+1}StageLength[t] \leq LifeTime[y]
\end{aligned}
```
"""
function get_retirement_stage(cur_stage::Int, lifetime::Int, stage_lens::Array{Int, 1})
years_from_start = sum(stage_lens[1:cur_stage]) # Years from start from the END of the current stage
Expand Down

0 comments on commit 87ee894

Please sign in to comment.