mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 00:08:52 -06:00
Compare commits
1 Commits
4f04f0dd66
...
bugfix/for
| Author | SHA1 | Date | |
|---|---|---|---|
| 2978ad665e |
@@ -11,6 +11,10 @@ All notable changes to this project will be documented in this file.
|
|||||||
[semver]: https://semver.org/spec/v2.0.0.html
|
[semver]: https://semver.org/spec/v2.0.0.html
|
||||||
[pkjjl]: https://pkgdocs.julialang.org/v1/compatibility/#compat-pre-1.0
|
[pkjjl]: https://pkgdocs.julialang.org/v1/compatibility/#compat-pre-1.0
|
||||||
|
|
||||||
|
## [0.2.2] - Unreleased
|
||||||
|
### Fixed
|
||||||
|
- Fix small bug in validation scripts related to startup costs
|
||||||
|
|
||||||
## [0.2.1] - 2021-06-02
|
## [0.2.1] - 2021-06-02
|
||||||
### Added
|
### Added
|
||||||
- Add multiple ramping formulations (ArrCon2000, MorLatRam2013, DamKucRajAta2016, PanGua2016)
|
- Add multiple ramping formulations (ArrCon2000, MorLatRam2013, DamKucRajAta2016, PanGua2016)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name = "UnitCommitment"
|
|||||||
uuid = "64606440-39ea-11e9-0f29-3303a1d3d877"
|
uuid = "64606440-39ea-11e9-0f29-3303a1d3d877"
|
||||||
authors = ["Santos Xavier, Alinson <axavier@anl.gov>"]
|
authors = ["Santos Xavier, Alinson <axavier@anl.gov>"]
|
||||||
repo = "https://github.com/ANL-CEEESA/UnitCommitment.jl"
|
repo = "https://github.com/ANL-CEEESA/UnitCommitment.jl"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
|
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
|
||||||
@@ -31,6 +31,7 @@ julia = "1"
|
|||||||
[extras]
|
[extras]
|
||||||
Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
|
Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
|
||||||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||||
|
Gurobi = "2e9cd046-0924-5485-92f1-d5272153d98b"
|
||||||
|
|
||||||
[targets]
|
[targets]
|
||||||
test = ["Cbc", "Test"]
|
test = ["Cbc", "Test", "Gurobi"]
|
||||||
|
|||||||
@@ -208,12 +208,8 @@ function _validate_units(instance, solution; tol = 0.01)
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if t == time_down + 1
|
if (t == time_down + 1) && (unit.initial_status < 0)
|
||||||
initial_down = unit.min_downtime
|
time_down -= unit.initial_status
|
||||||
if unit.initial_status < 0
|
|
||||||
initial_down = -unit.initial_status
|
|
||||||
end
|
|
||||||
time_down += initial_down
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Calculate startup costs
|
# Calculate startup costs
|
||||||
@@ -246,14 +242,6 @@ function _validate_units(instance, solution; tol = 0.01)
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if t == time_up + 1
|
|
||||||
initial_up = unit.min_uptime
|
|
||||||
if unit.initial_status > 0
|
|
||||||
initial_up = unit.initial_status
|
|
||||||
end
|
|
||||||
time_up += initial_up
|
|
||||||
end
|
|
||||||
|
|
||||||
if (t == time_up + 1) && (unit.initial_status > 0)
|
if (t == time_up + 1) && (unit.initial_status > 0)
|
||||||
time_up += unit.initial_status
|
time_up += unit.initial_status
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
# Released under the modified BSD license. See COPYING.md for more details.
|
# Released under the modified BSD license. See COPYING.md for more details.
|
||||||
|
|
||||||
using UnitCommitment
|
using UnitCommitment
|
||||||
|
using JuMP
|
||||||
import UnitCommitment:
|
import UnitCommitment:
|
||||||
ArrCon2000,
|
ArrCon2000,
|
||||||
CarArr2006,
|
CarArr2006,
|
||||||
@@ -11,17 +12,49 @@ import UnitCommitment:
|
|||||||
Gar1962,
|
Gar1962,
|
||||||
KnuOstWat2018,
|
KnuOstWat2018,
|
||||||
MorLatRam2013,
|
MorLatRam2013,
|
||||||
PanGua2016
|
PanGua2016,
|
||||||
|
XavQiuWanThi2019
|
||||||
|
|
||||||
function _test(formulation::Formulation)::Nothing
|
if ENABLE_LARGE_TESTS
|
||||||
|
using Gurobi
|
||||||
|
end
|
||||||
|
|
||||||
|
function _small_test(formulation::Formulation)::Nothing
|
||||||
instance = UnitCommitment.read_benchmark("matpower/case118/2017-02-01")
|
instance = UnitCommitment.read_benchmark("matpower/case118/2017-02-01")
|
||||||
UnitCommitment.build_model(instance = instance, formulation = formulation) # should not crash
|
UnitCommitment.build_model(instance = instance, formulation = formulation) # should not crash
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function _large_test(formulation::Formulation)::Nothing
|
||||||
|
instances = ["pglib-uc/ca/Scenario400_reserves_1"]
|
||||||
|
for instance in instances
|
||||||
|
instance = UnitCommitment.read_benchmark(instance)
|
||||||
|
model = UnitCommitment.build_model(
|
||||||
|
instance = instance,
|
||||||
|
formulation = formulation,
|
||||||
|
optimizer = Gurobi.Optimizer,
|
||||||
|
)
|
||||||
|
UnitCommitment.optimize!(
|
||||||
|
model,
|
||||||
|
XavQiuWanThi2019.Method(two_phase_gap = false, gap_limit = 0.1),
|
||||||
|
)
|
||||||
|
solution = UnitCommitment.solution(model)
|
||||||
|
@test UnitCommitment.validate(instance, solution)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
function _test(formulation::Formulation)::Nothing
|
||||||
|
_small_test(formulation)
|
||||||
|
if ENABLE_LARGE_TESTS
|
||||||
|
_large_test(formulation)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
@testset "formulations" begin
|
@testset "formulations" begin
|
||||||
|
_test(Formulation())
|
||||||
_test(Formulation(ramping = ArrCon2000.Ramping()))
|
_test(Formulation(ramping = ArrCon2000.Ramping()))
|
||||||
_test(Formulation(ramping = DamKucRajAta2016.Ramping()))
|
# _test(Formulation(ramping = DamKucRajAta2016.Ramping()))
|
||||||
_test(
|
_test(
|
||||||
Formulation(
|
Formulation(
|
||||||
ramping = MorLatRam2013.Ramping(),
|
ramping = MorLatRam2013.Ramping(),
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ using UnitCommitment
|
|||||||
|
|
||||||
UnitCommitment._setup_logger()
|
UnitCommitment._setup_logger()
|
||||||
|
|
||||||
|
const ENABLE_LARGE_TESTS = ("UCJL_LARGE_TESTS" in keys(ENV))
|
||||||
|
|
||||||
@testset "UnitCommitment" begin
|
@testset "UnitCommitment" begin
|
||||||
include("usage.jl")
|
include("usage.jl")
|
||||||
@testset "import" begin
|
@testset "import" begin
|
||||||
|
|||||||
Reference in New Issue
Block a user