-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Pipe approximation constraint and new problem"
This reverts commit 4ca98ac.
- Loading branch information
Showing
6 changed files
with
24 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 16 additions & 16 deletions
32
test/ogf_comp_power_and_pipe_proxy.jl → test/ogf_comp_power_proxy.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
@testset "test new ogf" begin | ||
@testset "test wp new ogf" begin | ||
@testset "case 6 new ogf" begin | ||
@info "Testing OGF with compressor power and pipe weymouth proxy (linear)" | ||
@info "Testing OGF with compressor power proxy (linear)" | ||
data = GasModels.parse_file("../test/data/matgas/case-6-no-power-limits.m") | ||
result = run_ogf_comp_power_and_pipe_proxy(data, WPGasModel, nlp_solver) | ||
result = run_ogf_comp_power_proxy(data, WPGasModel, nlp_solver) | ||
@test result["termination_status"] in [LOCALLY_SOLVED, ALMOST_LOCALLY_SOLVED, OPTIMAL, :Suboptimal] | ||
@test isapprox(result["objective"], -230.534; atol = 1e-2) | ||
@test isapprox(result["objective"], -253.683; atol = 1e-2) | ||
GasModels.make_si_units!(result["solution"]) | ||
@test isapprox(result["solution"]["receipt"]["1"]["fg"], 100.53; atol = 1e-2) | ||
@test isapprox(result["solution"]["receipt"]["1"]["fg"], 123.6822; atol = 1e-2) | ||
end | ||
|
||
@testset "case 6 new ogf weymouth lin rel" begin | ||
@info "Testing OGF with compressor power proxy and pipe weymouth proxy" | ||
@info "Testing OGF with compressor power proxy Linear Relaxation of Pipe Weymouth Physics" | ||
data = GasModels.parse_file("../test/data/matgas/case-6-no-power-limits.m") | ||
result = run_ogf_comp_power_and_pipe_proxy(data, LRWPGasModel, lp_solver) | ||
result = run_ogf_comp_power_proxy(data, LRWPGasModel, lp_solver) | ||
@test result["termination_status"] in [LOCALLY_SOLVED, ALMOST_LOCALLY_SOLVED, OPTIMAL, :Suboptimal] | ||
@test isapprox(result["objective"], -230.534; atol = 1e-2) | ||
@test isapprox(result["objective"], -260.00; atol = 1e-2) | ||
GasModels.make_si_units!(result["solution"]) | ||
@test isapprox(result["solution"]["receipt"]["1"]["fg"], 100.53; atol = 1e-2) | ||
@test isapprox(result["solution"]["receipt"]["1"]["fg"], 130.00; atol = 1e-2) | ||
end | ||
|
||
|
||
@testset "case 6 wp new ogf binding energy constraint" begin | ||
@info "Testing OGF with compressor power and pipe weymouth proxy Binding Energy Cosntraint" | ||
@info "Testing OGF with compressor power proxy Binding Energy Cosntraint" | ||
data = GasModels.parse_file("../test/data/matgas/case-6.m") | ||
result = run_ogf_comp_power_and_pipe_proxy(data, WPGasModel, nlp_solver) | ||
result = run_ogf_comp_power_proxy(data, WPGasModel, nlp_solver) | ||
@test result["termination_status"] in [LOCALLY_SOLVED, ALMOST_LOCALLY_SOLVED, OPTIMAL, :Suboptimal] | ||
@test isapprox(result["objective"], -187.253; atol = 1e-2) | ||
@test isapprox(result["objective"], -237.718; atol = 1e-2) | ||
GasModels.make_si_units!(result["solution"]) | ||
@test isapprox(result["solution"]["receipt"]["1"]["fg"], 67.01; atol = 1e-2) | ||
@test isapprox(result["solution"]["receipt"]["1"]["fg"], 97.33; atol = 1e-2) | ||
end | ||
|
||
@testset "case 6 wp new ogf elevation constraint" begin | ||
@info "Testing OGF with compressor power and pipe weymouth proxy Elevation Cosntraint" | ||
@info "Testing OGF with compressor power proxy Elevation Cosntraint" | ||
data = GasModels.parse_file("../test/data/matgas/case-6-elevation.m") | ||
result = run_ogf_comp_power_and_pipe_proxy(data, WPGasModel, nlp_solver) | ||
result = run_ogf_comp_power_proxy(data, WPGasModel, nlp_solver) | ||
@test result["termination_status"] in [LOCALLY_SOLVED, ALMOST_LOCALLY_SOLVED, OPTIMAL, :Suboptimal] | ||
@test isapprox(result["objective"], -219.461; atol = 1e-2) | ||
@test isapprox(result["objective"], -245.251; atol = 1e-2) | ||
GasModels.make_si_units!(result["solution"]) | ||
@test isapprox(result["solution"]["receipt"]["1"]["fg"], 86.33; atol = 1e-2) | ||
@test isapprox(result["solution"]["receipt"]["1"]["fg"], 102.5677; atol = 1e-2) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters