lanl-ansi / gaspowermodels.jl Goto Github PK
View Code? Open in Web Editor NEWJulia packages for joint optimization of natural gas and power transmission networks
Home Page: https://lanl-ansi.github.io/GasPowerModels.jl/stable/
License: Other
Julia packages for joint optimization of natural gas and power transmission networks
Home Page: https://lanl-ansi.github.io/GasPowerModels.jl/stable/
License: Other
Hi,
I am trying to replicate the power gas model (belgium gas with IEEE14 bus) in python following the formulation in Convex Optimization for Joint Expansion Planning of Natural Gas and Power Systems. I ran into an issues with gas flow in parallel pipelines. I wonder if you have encountered the same issue. My model gave a very similar results for the gas flow as the gaspowermodel julia package. The only issue is that only one pipe has gas flow among parallel pipelines. For example, pipeline 1 and pipeline 2 are parallel pipelines that connect junction 1 and junction 2. The gas flow of pipeline 1 in my model is the sum of the gas flow of pipeline1 and pipeline 2 in the julia package model. I wonder whether this is an issue with the second order cone relaxation. Because equation 17 in the paper is greater or equal to, the flow can be 0 in pipeline2, which satisfies the weymouth equation. Meanwhile, the gas mass flow balance is met through pipeline1's transportation of gas. I have already set the binary flow direction variables of parallel pipelines to be the same. May I ask whether you have encountered the same issue and whether there is a fix? A picture of comparison of flow variables are attached? Thanks very much for your help.
This constraint looks for ql values at the junction level. Needs to be refactored to be at the consumer level. Input data files will need to be adjusted as well.
Hi,
May I ask if there is a way to fix a variable when run the gas power model? For example, the active power and reactive power flow on transmission line connecting node 6 to node 13 are fixed at 0. Thanks.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
Refactor data files to conform to PowerModels 0.6 data models that split load from buses
v0.1.0
@JuliaRegistrator register()
Create GasPowerModels parse routines which handle all the per unit/data correction routines in one place. Leverage the data correction and parse routines of GasModels and PowerModels
The wiki documentation leaves much to be desired in terms of clarity on how the data model captures the coupling between gas and electric power systems
Add a function which converts powerModels rate (per hour) in a per second rate
Add capability to model gas component dependencies on electricity (compressors)
Consider unifying the objectives (and problem formulations) min_ne, min_opf, and min_ne_opf as a single function. min_ne is min_ne_opf without opf and min_opf is min_ne_opf without ne. With 0 cost provided as inputs, min_ne_opf could be used to model all three examples. Is there value in modeling these three problems independently?
What versions of PowerModels is this code compatible with? The REQUIRE says,
PowerModels 0.5
Which would suggest versions 0.5 and 0.6. However, providing an upper bound is the best practice to prevent this code from breaking when a new version is released. For example,
PowerModels 0.5 0.7-
would explicitly state that it is compatible with versions 0.5 and 0.6.
Hi,
I followed the instruction to add the command (Pkg.add("GasPowerModels") and add JuMP Juniper Ipopt Cbc). Then I run the testing. But it gave me error as below. Thanks for your help.
[ Info: no explicit NLP constraints or objective provided using @NLconstraint or @NLobjective macros
IEEE 14 Belgian case: Error During Test at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/test/gpf.jl:15
Got exception outside of a @test
could not load library "/Users/carriesu/.julia/packages/Ipopt/Iu7vT/deps/usr/lib/libipopt.1.10.10.dylib"
dlopen(/Users/carriesu/.julia/packages/Ipopt/Iu7vT/deps/usr/lib/libipopt.1.10.10.dylib, 1): Library not loaded: @rpath/libgfortran.5.dylib
Referenced from: /Users/carriesu/.julia/packages/Ipopt/Iu7vT/deps/usr/lib/libipopt.1.10.10.dylib
Reason: image not found
Stacktrace:
[1] createProblem(::Int64, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Int64, ::Ipopt.var"#eval_f_cb#18"{Ipopt.Optimizer}, ::Ipopt.var"#eval_g_cb#20"{Ipopt.Optimizer}, ::Ipopt.var"#eval_grad_f_cb#19"{Ipopt.Optimizer}, ::Ipopt.var"#eval_jac_g_cb#21"{Ipopt.Optimizer,Array{Tuple{Int64,Int64},1}}, ::Ipopt.var"#eval_h_cb#22"{Ipopt.Optimizer,Array{Tuple{Int64,Int64},1}}) at /Users/carriesu/.julia/packages/Ipopt/Iu7vT/src/Ipopt.jl:224
[2] optimize!(::Ipopt.Optimizer) at /Users/carriesu/.julia/packages/Ipopt/Iu7vT/src/MOI_wrapper.jl:684
[3] optimize!(::MathOptInterface.Utilities.CachingOptimizer{Ipopt.Optimizer,MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}}) at /Users/carriesu/.julia/packages/MathOptInterface/C3lip/src/Utilities/cachingoptimizer.jl:170
[4] optimize!(::MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{Ipopt.Optimizer,MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}},MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Bridges.AllBridgedConstraints{Float64}}}) at /Users/carriesu/.julia/packages/MathOptInterface/C3lip/src/Bridges/bridgeoptimizer.jl:73
[5] optimize!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}}) at /Users/carriesu/.julia/packages/MathOptInterface/C3lip/src/Utilities/cachingoptimizer.jl:170
[6] optimize!(::Model, ::OptimizerFactory; bridge_constraints::Bool, ignore_optimize_hook::Bool) at /Users/carriesu/.julia/packages/JuMP/ibcEh/src/optimizer_interface.jl:132
[7] optimize! at /Users/carriesu/.julia/packages/JuMP/ibcEh/src/optimizer_interface.jl:105 [inlined]
[8] optimize_get_status_backend(::Model; solver::OptimizerFactory) at /Users/carriesu/.julia/packages/Juniper/N3gty/src/util.jl:271
[9] solve_root_model!(::Juniper.JuniperProblem) at /Users/carriesu/.julia/packages/Juniper/N3gty/src/model.jl:63
[10] optimize!(::Juniper.Optimizer) at /Users/carriesu/.julia/packages/Juniper/N3gty/src/MOI_wrapper/MOI_wrapper.jl:285
[11] optimize!(::MathOptInterface.Bridges.LazyBridgeOptimizer{Juniper.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Bridges.AllBridgedConstraints{Float64}}}) at /Users/carriesu/.julia/packages/MathOptInterface/C3lip/src/Bridges/bridgeoptimizer.jl:73
[12] optimize!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}}) at /Users/carriesu/.julia/packages/MathOptInterface/C3lip/src/Utilities/cachingoptimizer.jl:170
[13] optimize!(::Model, ::OptimizerFactory; bridge_constraints::Bool, ignore_optimize_hook::Bool) at /Users/carriesu/.julia/packages/JuMP/ibcEh/src/optimizer_interface.jl:132
[14] optimize! at /Users/carriesu/.julia/packages/JuMP/ibcEh/src/optimizer_interface.jl:105 [inlined]
[15] macro expansion at ./timing.jl:310 [inlined]
[16] optimize!(::GenericPowerModel{SOCWRForm}, ::GenericGasModel{StandardMISOCPForm}, ::OptimizerFactory) at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/src/core/base.jl:72
[17] solve_generic_model(::GenericPowerModel{SOCWRForm}, ::GenericGasModel{StandardMISOCPForm}, ::OptimizerFactory; solution_builder::Function) at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/src/core/base.jl:63
[18] run_generic_model(::Dict{String,Any}, ::Dict{String,Any}, ::Type{T} where T, ::Type{T} where T, ::OptimizerFactory, ::typeof(GasPowerModels.post_gpf); power_ref_extensions::Array{Any,1}, solution_builder::Function, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/src/core/base.jl:29
[19] run_generic_model(::String, ::String, ::Type{T} where T, ::Type{T} where T, ::OptimizerFactory, ::typeof(GasPowerModels.post_gpf); solution_builder::Function, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/src/core/base.jl:23
[20] run_generic_model at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/src/core/base.jl:21 [inlined]
[21] #run_gpf#26 at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/src/prob/gpf.jl:7 [inlined]
[22] run_gpf(::String, ::String, ::Type{T} where T, ::Type{T} where T, ::OptimizerFactory) at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/src/prob/gpf.jl:7
[23] top-level scope at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/test/gpf.jl:16
[24] top-level scope at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1115
[25] top-level scope at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/test/gpf.jl:16
[26] top-level scope at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1115
[27] top-level scope at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/test/gpf.jl:15
[28] include(::String) at ./client.jl:457
[29] top-level scope at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/test/runtests.jl:42
[30] include(::String) at ./client.jl:457
[31] top-level scope at none:6
[32] eval(::Module, ::Any) at ./boot.jl:331
[33] exec_options(::Base.JLOptions) at ./client.jl:272
[34] _start() at ./client.jl:506
Test Summary: | Error Total
test qp gf pf | 1 1
IEEE 14 Belgian case | 1 1
ERROR: LoadError: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/test/gpf.jl:14
in expression starting at /Users/carriesu/.julia/packages/GasPowerModels/aycKw/test/runtests.jl:42
ERROR: Package GasPowerModels errored during testing
Should include GasModels.jl, PowerModels.jl, InfrastructureModels.jl
Based on the current codebase, it looks like this dependency does not need to be called out explicitly.
Dear Sir,
Recently I installed the GasPowerModels package in Julia. Then I tried to add the Pavito solver. It was unsuccessful. It seems that the JuMP versions compatible with Pavito are different from those with GasModels. Without the Pavito solver, GasPowerModels cannot run. Could you please give me some advice on this issue?
The GasPowerModels is really a powerful tool to model the gas and power coupling scenarios. Many thanks for your sharing.
Sincerely yours,
Sean
——————————————————————————
julia> Pkg.add("Pavito")
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package JuMP [4076af6c]:
JuMP [4076af6c] log:
├─possible versions are: [0.18.3-0.18.6, 0.19.0-0.19.2, 0.20.0-0.20.1, 0.21.0-0.21.2] or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions [0.18.3-0.18.6, 0.19.0-0.19.2, 0.20.0-0.20.1, 0.21.0-0.21.2]
├─restricted by compatibility requirements with GasModels [5e113713] to versions: 0.19.1-0.19.2
│ └─GasModels [5e113713] log:
│ ├─possible versions are: [0.3.0, 0.3.2-0.3.5, 0.4.0-0.4.1, 0.5.0, 0.6.0] or uninstalled
│ ├─restricted to versions * by an explicit requirement, leaving only versions [0.3.0, 0.3.2-0.3.5, 0.4.0-0.4.1, 0.5.0, 0.6.0]
│ └─restricted by compatibility requirements with GasPowerModels [1fcaf345] to versions: 0.4.0-0.4.1
│ └─GasPowerModels [1fcaf345] log:
│ ├─possible versions are: 0.1.0-0.1.1 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.1.1
└─restricted by compatibility requirements with Pavito [cd433a01] to versions: 0.18.3-0.18.6 — no versions left
└─Pavito [cd433a01] log:
├─possible versions are: [0.1.1-0.1.2, 0.2.0] or uninstalled
└─restricted to versions * by an explicit requirement, leaving only versions [0.1.1-0.1.2, 0.2.0]
This will happen once a new version of GasModels is posted.
The nefd problem should be eliminated as it can be replaced with the new forms that assume fixed direction.
This function should be more appropriately named to add_consumer_generators
The implementation can be cleaned up a little bit using this new feature, lanl-ansi/PowerModels.jl#401
We need an implementation of status propagation between infrastructure systems. For example, if a PowerModels generator status = 0, PowerModels will remove the generator from ref. However, a GasModels receipt point might point at that generator as a consumer of gas. Given that the generator is removed, this will result in a dangling data pointer. So, we need to make this receipt status = 0 as well. This might require manual execution of the correct_network functions in GasModels and PowerModels
These need to be fully refactored to conform to the multi-network data structures
See if requirements for AmplNLWriter
and CoinOptServices
can be eliminated by using native Julia solvers.
Currently, parameters related to the definition of an objective function (e.g., gas_ne_weight
, power_ne_weight
, and obj_normalization
) are passed in via kwargs
. These should instead be migrated to the corresponding PowerModels
input file as global parameters. This should be done for all relevant test cases.
build_solution
, otherwise JuMP.value() can fail (see PowerModels fix, lanl-ansi/PowerModels.jl@b80f4fe)JuMP.optimize!
, and merge code into optimize_model!
optimize_model!
make optimizer
an optional kwarg (see, lanl-ansi/PowerModels.jl@8a8c9c0)build_model
-> instantiate_model
; build_solution
-> build_result
post_*
functions to build_*
post_(mn_)<prob name>(_<variant>)*
There should be al linear relaxation of the heat rate curve when the user chooses linear power models and linear gas models
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.