Skip to content

Commit

Permalink
add ts parameter calls in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Oct 13, 2024
1 parent 9e4de69 commit 2e4b706
Showing 1 changed file with 142 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ function construct_device!(

initial_conditions!(container, devices, D())

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
end

add_to_expression!(
container,
ActivePowerBalance,
Expand Down Expand Up @@ -135,6 +139,17 @@ function construct_device!(
add_constraints!(container, RampConstraint, devices, model, network_model)
add_constraints!(container, DurationConstraint, devices, model, network_model)

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_constraints!(
container,
ActivePowerVariableTimeSeriesLimitsConstraint,
ActivePowerRangeExpressionUB,
devices,
model,
network_model,
)
end

add_feedforward_constraints!(container, model, devices)

objective_function!(container, devices, model, get_network_formulation(network_model))
Expand Down Expand Up @@ -164,6 +179,10 @@ function construct_device!(

initial_conditions!(container, devices, D())

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
end

add_to_expression!(
container,
ActivePowerBalance,
Expand Down Expand Up @@ -227,6 +246,16 @@ function construct_device!(
add_constraints!(container, CommitmentConstraint, devices, model, network_model)
add_constraints!(container, RampConstraint, devices, model, network_model)
add_constraints!(container, DurationConstraint, devices, model, network_model)
if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_constraints!(
container,
ActivePowerVariableTimeSeriesLimitsConstraint,
ActivePowerRangeExpressionUB,
devices,
model,
network_model,
)
end

add_feedforward_constraints!(container, model, devices)

Expand Down Expand Up @@ -256,6 +285,10 @@ function construct_device!(

initial_conditions!(container, devices, ThermalBasicUnitCommitment())

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
end

add_to_expression!(
container,
ActivePowerBalance,
Expand Down Expand Up @@ -335,6 +368,17 @@ function construct_device!(
)
add_constraints!(container, CommitmentConstraint, devices, model, network_model)

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_constraints!(
container,
ActivePowerVariableTimeSeriesLimitsConstraint,
ActivePowerRangeExpressionUB,
devices,
model,
network_model,
)
end

add_feedforward_constraints!(container, model, devices)

objective_function!(container, devices, model, get_network_formulation(network_model))
Expand All @@ -361,6 +405,10 @@ function construct_device!(

initial_conditions!(container, devices, ThermalBasicUnitCommitment())

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
end

add_to_expression!(
container,
ActivePowerBalance,
Expand Down Expand Up @@ -423,6 +471,16 @@ function construct_device!(
)

add_constraints!(container, CommitmentConstraint, devices, model, network_model)
if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_constraints!(
container,
ActivePowerVariableTimeSeriesLimitsConstraint,
ActivePowerRangeExpressionUB,
devices,
model,
network_model,
)
end

add_feedforward_constraints!(container, model, devices)

Expand Down Expand Up @@ -829,6 +887,10 @@ function construct_device!(

initial_conditions!(container, devices, ThermalMultiStartUnitCommitment())

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
end

add_to_expression!(
container,
ActivePowerBalance,
Expand Down Expand Up @@ -931,6 +993,16 @@ function construct_device!(
network_model,
)
add_constraints!(container, ActiveRangeICConstraint, devices, model, network_model)
if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_constraints!(
container,
ActivePowerVariableTimeSeriesLimitsConstraint,
ActivePowerRangeExpressionUB,
devices,
model,
network_model,
)
end

add_feedforward_constraints!(container, model, devices)

Expand Down Expand Up @@ -965,6 +1037,10 @@ function construct_device!(
add_variables!(container, TimeDurationOff, devices, ThermalMultiStartUnitCommitment())
add_variables!(container, PowerOutput, devices, ThermalMultiStartUnitCommitment())

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
end

add_to_expression!(
container,
ActivePowerBalance,
Expand Down Expand Up @@ -1053,6 +1129,16 @@ function construct_device!(
network_model,
)
add_constraints!(container, ActiveRangeICConstraint, devices, model, network_model)
if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_constraints!(
container,
ActivePowerVariableTimeSeriesLimitsConstraint,
ActivePowerRangeExpressionUB,
devices,
model,
network_model,
)
end

add_feedforward_constraints!(container, model, devices)

Expand Down Expand Up @@ -1092,6 +1178,10 @@ function construct_device!(

initial_conditions!(container, devices, ThermalCompactUnitCommitment())

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
end

add_to_expression!(
container,
ActivePowerBalance,
Expand Down Expand Up @@ -1169,6 +1259,16 @@ function construct_device!(
add_constraints!(container, CommitmentConstraint, devices, model, network_model)
add_constraints!(container, RampConstraint, devices, model, network_model)
add_constraints!(container, DurationConstraint, devices, model, network_model)
if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_constraints!(
container,
ActivePowerVariableTimeSeriesLimitsConstraint,
ActivePowerRangeExpressionUB,
devices,
model,
network_model,
)
end

add_feedforward_constraints!(container, model, devices)

Expand Down Expand Up @@ -1202,6 +1302,10 @@ function construct_device!(

initial_conditions!(container, devices, ThermalCompactUnitCommitment())

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
end

add_to_expression!(
container,
ActivePowerBalance,
Expand Down Expand Up @@ -1270,6 +1374,16 @@ function construct_device!(
add_constraints!(container, CommitmentConstraint, devices, model, network_model)
add_constraints!(container, RampConstraint, devices, model, network_model)
add_constraints!(container, DurationConstraint, devices, model, network_model)
if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_constraints!(
container,
ActivePowerVariableTimeSeriesLimitsConstraint,
ActivePowerRangeExpressionUB,
devices,
model,
network_model,
)
end

add_feedforward_constraints!(container, model, devices)

Expand Down Expand Up @@ -1307,6 +1421,10 @@ function construct_device!(

initial_conditions!(container, devices, ThermalBasicCompactUnitCommitment())

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
end

add_to_expression!(
container,
ActivePowerBalance,
Expand Down Expand Up @@ -1382,6 +1500,16 @@ function construct_device!(
network_model,
)
add_constraints!(container, CommitmentConstraint, devices, model, network_model)
if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_constraints!(
container,
ActivePowerVariableTimeSeriesLimitsConstraint,
ActivePowerRangeExpressionUB,
devices,
model,
network_model,
)
end

add_feedforward_constraints!(container, model, devices)

Expand Down Expand Up @@ -1413,6 +1541,10 @@ function construct_device!(

initial_conditions!(container, devices, ThermalBasicCompactUnitCommitment())

if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
end

add_to_expression!(
container,
ActivePowerBalance,
Expand Down Expand Up @@ -1479,6 +1611,16 @@ function construct_device!(
)

add_constraints!(container, CommitmentConstraint, devices, model, network_model)
if haskey(get_time_series_names(model), ActivePowerTimeSeriesParameter)
add_constraints!(
container,
ActivePowerVariableTimeSeriesLimitsConstraint,
ActivePowerRangeExpressionUB,
devices,
model,
network_model,
)
end

add_feedforward_constraints!(container, model, devices)

Expand Down

0 comments on commit 2e4b706

Please sign in to comment.