Skip to content

Commit

Permalink
max/min duration -1 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliocanor committed Feb 28, 2023
1 parent 464cd37 commit 5e3d8a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/model/resources/thermal_storage/thermal_storage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,12 @@ function thermal_storage(EP::Model, inputs::Dict, setup::Dict)
@constraint(EP, cCPRatMin[y in dfTS[dfTS.Min_Generator_Core_Power_Ratio.>=0,:R_ID]],
vCCAP[y] * dfGen[y,:Eff_Down] * by_rid(y,:Min_Generator_Core_Power_Ratio) <=
EP[:vCAP][y] * dfGen[y,:Cap_Size])

# Limits on storage duration
@constraint(EP, cTSMinDur[y in TS], vTSCAP[y] >= dfGen[y,:Min_Duration] * vCCAP[y])
@constraint(EP, cTSMaxDur[y in TS], vTSCAP[y] <= dfGen[y,:Max_Duration] * vCCAP[y])
MIN_DURATION = intersect(TS, dfGen[dfGen.Min_Duration >= 0, :R_ID])
MAX_DURATION = intersect(TS, dfGen[dfGen.Max_Duration >= 0, :R_ID])
@constraint(EP, cTSMinDur[y in MIN_DURATION], vTSCAP[y] >= dfGen[y,:Min_Duration] * vCCAP[y])
@constraint(EP, cTSMaxDur[y in MAX_DURATION], vTSCAP[y] <= dfGen[y,:Max_Duration] * vCCAP[y])

### FUSION CONSTRAINTS ###
FUS = get_fus(inputs)
Expand Down

1 comment on commit 5e3d8a4

@cfe316
Copy link
Owner

@cfe316 cfe316 commented on 5e3d8a4 Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Please sign in to comment.