mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 08:18:51 -06:00
Added minimum power to profiled generator
This commit is contained in:
@@ -314,6 +314,7 @@ function _from_json(json; repair = true)::UnitCommitmentScenario
|
|||||||
pu = ProfiledUnit(
|
pu = ProfiledUnit(
|
||||||
unit_name,
|
unit_name,
|
||||||
bus,
|
bus,
|
||||||
|
timeseries(scalar(dict["Minimum power (MW)"], default = 0.0)),
|
||||||
timeseries(dict["Maximum power (MW)"]),
|
timeseries(dict["Maximum power (MW)"]),
|
||||||
timeseries(dict["Cost (\$/MW)"]),
|
timeseries(dict["Cost (\$/MW)"]),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ end
|
|||||||
mutable struct ProfiledUnit
|
mutable struct ProfiledUnit
|
||||||
name::String
|
name::String
|
||||||
bus::Bus
|
bus::Bus
|
||||||
|
min_power::Vector{Float64}
|
||||||
capacity::Vector{Float64}
|
capacity::Vector{Float64}
|
||||||
cost::Vector{Float64}
|
cost::Vector{Float64}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ function _add_profiled_unit!(
|
|||||||
for t in 1:model[:instance].time
|
for t in 1:model[:instance].time
|
||||||
# Decision variable
|
# Decision variable
|
||||||
punits[sc.name, pu.name, t] =
|
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
|
# Objective function terms
|
||||||
add_to_expression!(
|
add_to_expression!(
|
||||||
|
|||||||
BIN
test/fixtures/case14-profiled.json.gz
vendored
BIN
test/fixtures/case14-profiled.json.gz
vendored
Binary file not shown.
@@ -141,6 +141,7 @@ end
|
|||||||
@test first_pu.name == "g7"
|
@test first_pu.name == "g7"
|
||||||
@test first_pu.bus.name == "b4"
|
@test first_pu.bus.name == "b4"
|
||||||
@test first_pu.cost == [100.0 for t in 1:4]
|
@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 first_pu.capacity == [100.0 for t in 1:4]
|
||||||
@test sc.profiled_units_by_name["g7"].name == "g7"
|
@test sc.profiled_units_by_name["g7"].name == "g7"
|
||||||
|
|
||||||
@@ -148,6 +149,7 @@ end
|
|||||||
@test second_pu.name == "g8"
|
@test second_pu.name == "g8"
|
||||||
@test second_pu.bus.name == "b5"
|
@test second_pu.bus.name == "b5"
|
||||||
@test second_pu.cost == [50.0 for t in 1:4]
|
@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 second_pu.capacity == [120.0 for t in 1:4]
|
||||||
@test sc.profiled_units_by_name["g8"].name == "g8"
|
@test sc.profiled_units_by_name["g8"].name == "g8"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user