Skip to content

Commit

Permalink
Added docstring for endogenous retirement constraint (#654)
Browse files Browse the repository at this point in the history
* Summary of features added by this PR: Added docstring for endogenous retirement constraint, Update endogenous_retirement.jl
  • Loading branch information
sambuddhac authored Mar 18, 2024
1 parent ed61046 commit cb81a60
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/multi_stage/endogenous_retirement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,24 @@ function endogenous_retirement!(EP::Model, inputs::Dict, setup::Dict)

end

@doc raw"""
endogenous_retirement_discharge!(EP::Model, inputs::Dict, num_stages::Int, cur_stage::Int, stage_lens::Array{Int, 1})
This function models the following constraint
```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 endogenous_retirement_discharge!(EP::Model, inputs::Dict, num_stages::Int, cur_stage::Int, stage_lens::Array{Int, 1})

println("Endogenous Retirement (Discharge) Module")
Expand Down

0 comments on commit cb81a60

Please sign in to comment.