Added minimum power to profiled generator

pull/28/head
Jun He 3 years ago
parent 319a787904
commit cb7f9e3b27

@ -314,6 +314,7 @@ function _from_json(json; repair = true)::UnitCommitmentScenario
pu = ProfiledUnit(
unit_name,
bus,
timeseries(scalar(dict["Minimum power (MW)"], default = 0.0)),
timeseries(dict["Maximum power (MW)"]),
timeseries(dict["Cost (\$/MW)"]),
)

@ -77,6 +77,7 @@ end
mutable struct ProfiledUnit
name::String
bus::Bus
min_power::Vector{Float64}
capacity::Vector{Float64}
cost::Vector{Float64}
end

@ -12,7 +12,7 @@ function _add_profiled_unit!(
for t in 1:model[:instance].time
# Decision variable
punits[sc.name, pu.name, t] =
@variable(model, lower_bound = 0, upper_bound = pu.capacity[t])
@variable(model, lower_bound = pu.min_power[t], upper_bound = pu.capacity[t])
# Objective function terms
add_to_expression!(

Binary file not shown.

@ -141,6 +141,7 @@ end
@test first_pu.name == "g7"
@test first_pu.bus.name == "b4"
@test first_pu.cost == [100.0 for t in 1:4]
@test first_pu.min_power == [60.0 for t in 1:4]
@test first_pu.capacity == [100.0 for t in 1:4]
@test sc.profiled_units_by_name["g7"].name == "g7"
@ -148,6 +149,7 @@ end
@test second_pu.name == "g8"
@test second_pu.bus.name == "b5"
@test second_pu.cost == [50.0 for t in 1:4]
@test second_pu.min_power == [0.0 for t in 1:4]
@test second_pu.capacity == [120.0 for t in 1:4]
@test sc.profiled_units_by_name["g8"].name == "g8"
end

Loading…
Cancel
Save