Skip to content

Commit 4614348

Browse files
committed
Fix bug where 0 flow meant no constraint
1 parent cab6a9c commit 4614348

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

switch_model/generators/extensions/hydro_simple.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ def define_components(mod):
161161
mod.hydro_avg_flow_mw = Param(
162162
mod.HYDRO_GEN_TS_RAW,
163163
within=NonNegativeReals,
164-
input_file='hydro_timeseries.csv',
165-
default=0.0)
164+
input_file='hydro_timeseries.csv')
166165

167166
# We use a scaling factor to improve the numerical properties
168167
# of the model. The scaling factor was determined using trial
@@ -172,7 +171,6 @@ def define_components(mod):
172171
mod.Enforce_Hydro_Avg_Flow = Constraint(
173172
mod.HYDRO_GEN_TS,
174173
rule=lambda m, g, hts:
175-
Constraint.Skip if m.hydro_avg_flow_mw[g, hts] == 0 else
176174
enforce_hydro_avg_flow_scaling_factor *
177175
# Compute the weighted average of the dispatch
178176
sum(m.DispatchGen[g, t] * m.tp_weight[t] for t in m.TPS_IN_HTS[hts])

0 commit comments

Comments
 (0)