Compare commits

..

2 Commits

Author SHA1 Message Date
e4cc95dae1 Bump version to 0.4.2 2025-11-27 09:01:25 -06:00
48094ded6b KnuOstWat2018: Fix eq_segprod_limit when min_uptime=1 2025-11-27 08:58:43 -06:00
11 changed files with 37 additions and 22 deletions

11
.gitignore vendored
View File

@@ -1,4 +1,3 @@
*-off.md
*.bak *.bak
*.gz *.gz
*.ipynb *.ipynb
@@ -20,7 +19,6 @@
.apdisk .apdisk
.com.apple.timemachine.donotpresent .com.apple.timemachine.donotpresent
.fseventsd .fseventsd
.idea
.ipy* .ipy*
.vscode .vscode
Icon Icon
@@ -34,11 +32,12 @@ benchmark/tables
benchmark/tmp.json benchmark/tmp.json
build build
docs/_build docs/_build
docs/src/tutorials/customizing.md
docs/src/tutorials/lmp.md
docs/src/tutorials/market.md
docs/src/tutorials/usage.md
instances/**/*.json instances/**/*.json
instances/_source instances/_source
local local
notebooks notebooks
docs/src/tutorials/usage.md
docs/src/tutorials/customizing.md
docs/src/tutorials/market.md
docs/src/tutorials/lmp.md
*-off.md

View File

@@ -11,12 +11,9 @@ 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.4.1] - 2025-11-05 ## [0.4.2] - 2025-11-27
### Fixed ### Fixed
- Fix multi-threading issues in Julia 1.12 - KnuOstWat2018: Fixed a bug in `eq_segprod_limit` constraint (#17)
### Changed
- The package now requires Julia 1.10 or newer
## [0.4.0] - 2024-05-21 ## [0.4.0] - 2024-05-21
### Added ### Added

View File

@@ -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.4.1" version = "0.4.2"
[deps] [deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"

View File

@@ -108,7 +108,7 @@ See official documentation at: https://anl-ceeesa.github.io/UnitCommitment.jl/
If you use UnitCommitment.jl in your research (instances, models or algorithms), we kindly request that you cite the package as follows: If you use UnitCommitment.jl in your research (instances, models or algorithms), we kindly request that you cite the package as follows:
* **Alinson S. Xavier, Aleksandr M. Kazachkov, Ogün Yurdakul, Jun He, Feng Qiu**. "UnitCommitment.jl: A Julia/JuMP Optimization Package for Security-Constrained Unit Commitment (Version 0.4)". Zenodo (2024). [DOI: 10.5281/zenodo.4269874](https://doi.org/10.5281/zenodo.4269874). * **Alinson S. Xavier, Aleksandr M. Kazachkov, Ogün Yurdakul, Feng Qiu**. "UnitCommitment.jl: A Julia/JuMP Optimization Package for Security-Constrained Unit Commitment (Version 0.4)". Zenodo (2024). [DOI: 10.5281/zenodo.4269874](https://doi.org/10.5281/zenodo.4269874).
If you use the instances, we additionally request that you cite the original sources, as described in the documentation. If you use the instances, we additionally request that you cite the original sources, as described in the documentation.

View File

@@ -107,7 +107,7 @@ Note that this curve also specifies the production limits. Specifically, the fir
```@raw html ```@raw html
<center> <center>
<img src="../../assets/cost_curve.png" style="max-width: 500px"/> <img src="../assets/cost_curve.png" style="max-width: 500px"/>
<div><b>Figure 1.</b> Piecewise-linear production cost curve.</div> <div><b>Figure 1.</b> Piecewise-linear production cost curve.</div>
<br/> <br/>
</center> </center>

View File

@@ -1,8 +1,8 @@
# Decomposition methods # Decomposition methods
## 1. Time decomposition for production cost modeling ## 1. Time decomposition
Solving unit commitment instances that have long time horizons (for example, year-long 8760-hour instances in production cost modeling) requires a substantial amount of computational power. To address this issue, UC.jl offers a time decomposition method, which breaks the instance down into multiple overlapping subproblems, solves them sequentially, then reassembles the solution. Solving unit commitment instances that have long time horizons (for example, year-long 8760-hour instances) requires a substantial amount of computational power. To address this issue, UC.jl offers a time decomposition method, which breaks the instance down into multiple overlapping subproblems, solves them sequentially, then reassembles the solution.
When solving a unit commitment instance with a dense time slot structure, computational complexity can become a significant challenge. For instance, if the instance contains hourly data for an entire year (8760 hours), solving such a model can require a substantial amount of computational power. To address this issue, UC.jl provides a time_decomposition method within the `optimize!` function. This method decomposes the problem into multiple sub-problems, solving them sequentially. When solving a unit commitment instance with a dense time slot structure, computational complexity can become a significant challenge. For instance, if the instance contains hourly data for an entire year (8760 hours), solving such a model can require a substantial amount of computational power. To address this issue, UC.jl provides a time_decomposition method within the `optimize!` function. This method decomposes the problem into multiple sub-problems, solving them sequentially.
@@ -57,7 +57,7 @@ solution = UnitCommitment.optimize!(
) )
``` ```
## 2. Scenario decomposition with Progressive Hedging for stochstic UC ## 2. Scenario decomposition with Progressive Hedging
By default, UC.jl uses the Extensive Form (EF) when solving stochastic instances. This approach involves constructing a single JuMP model that contains data and decision variables for all scenarios. Although EF has optimality guarantees and performs well with small test cases, it can become computationally intractable for large instances or substantial number of scenarios. By default, UC.jl uses the Extensive Form (EF) when solving stochastic instances. This approach involves constructing a single JuMP model that contains data and decision variables for all scenarios. Although EF has optimality guarantees and performs well with small test cases, it can become computationally intractable for large instances or substantial number of scenarios.

View File

@@ -67,21 +67,19 @@ function _add_production_piecewise_linear_eqs!(
(t < T ? Cw * switch_off[gn, t+1] : 0.0) (t < T ? Cw * switch_off[gn, t+1] : 0.0)
) )
else else
# Equation (47a)/(48a) in Kneuven et al. (2020) # Equation (47a) in Kneuven et al. (2020)
eq_segprod_limit_b[sc.name, gn, t, k] = @constraint( eq_segprod_limit_b[sc.name, gn, t, k] = @constraint(
model, model,
segprod[sc.name, gn, t, k] <= segprod[sc.name, gn, t, k] <=
g.cost_segments[k].mw[t] * is_on[gn, t] - g.cost_segments[k].mw[t] * is_on[gn, t] -
Cv * switch_on[gn, t] - Cv * switch_on[gn, t]
(t < T ? max(0, Cv - Cw) * switch_off[gn, t+1] : 0.0)
) )
# Equation (47b)/(48b) in Kneuven et al. (2020) # Equation (47b) in Kneuven et al. (2020)
eq_segprod_limit_c[sc.name, gn, t, k] = @constraint( eq_segprod_limit_c[sc.name, gn, t, k] = @constraint(
model, model,
segprod[sc.name, gn, t, k] <= segprod[sc.name, gn, t, k] <=
g.cost_segments[k].mw[t] * is_on[gn, t] - g.cost_segments[k].mw[t] * is_on[gn, t] -
max(0, Cw - Cv) * switch_on[gn, t] -
(t < T ? Cw * switch_off[gn, t+1] : 0.0) (t < T ? Cw * switch_off[gn, t+1] : 0.0)
) )
end end

BIN
test/fixtures/issue-0057.json.gz vendored Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -23,6 +23,7 @@ include("validation/repair_test.jl")
include("lmp/conventional_test.jl") include("lmp/conventional_test.jl")
include("lmp/aelmp_test.jl") include("lmp/aelmp_test.jl")
include("market/market_test.jl") include("market/market_test.jl")
include("regression.jl")
basedir = dirname(@__FILE__) basedir = dirname(@__FILE__)
@@ -54,6 +55,7 @@ function runtests()
lmp_aelmp_test() lmp_aelmp_test()
simple_market_test() simple_market_test()
stochastic_market_test() stochastic_market_test()
regression_test()
end end
return return
end end

19
test/src/regression.jl Normal file
View File

@@ -0,0 +1,19 @@
# UnitCommitment.jl: Optimization Package for Security-Constrained Unit Commitment
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
# Released under the modified BSD license. See COPYING.md for more details.
using UnitCommitment, HiGHS, JuMP
function regression_test()
@testset "GitHub Issue #57" begin
instance = UnitCommitment.read(fixture("issue-0057.json.gz"))
model = UnitCommitment.build_model(
instance = instance,
optimizer = HiGHS.Optimizer,
)
JuMP.set_silent(model)
UnitCommitment.optimize!(model)
solution = UnitCommitment.solution(model)
@test solution["Thermal production (MW)"]["gen_524d4c85"][1] == 90.0
end
end