GasModels.jl
A Julia/JuMP Package for Gas Network Optimization.
https://github.com/lanl-ansi/GasModels.jl
Category: Energy Storage
Sub Category: Hydrogen
Keywords
gas-flow gas-network-formulations network optimization
Keywords from Contributors
optimal-power-flow power-network water global-optimization minlp minlp-solver mixed-integer-nonlinear-programming mixed-integer-programming non-convex-optimization nonlinear-optimization
Last synced: about 14 hours ago
JSON representation
Repository metadata
A Julia/JuMP Package for Gas Network Optimization
- Host: GitHub
- URL: https://github.com/lanl-ansi/GasModels.jl
- Owner: lanl-ansi
- License: other
- Created: 2016-08-29T16:01:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-12-10T17:51:40.000Z (15 days ago)
- Last Synced: 2025-12-11T04:15:45.612Z (14 days ago)
- Topics: gas-flow, gas-network-formulations, network, optimization
- Language: Julia
- Homepage: https://lanl-ansi.github.io/GasModels.jl/latest/
- Size: 7.33 MB
- Stars: 78
- Watchers: 9
- Forks: 20
- Open Issues: 37
- Releases: 27
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
README.md
GasModels.jl
GasModels.jl is a Julia/JuMP package for Steady-State Gas Network Optimization.
It is designed to enable computational evaluation of emerging Gas network formulations and algorithms in a common platform.
The code is engineered to decouple problem specifications (e.g. Gas Flow, Expansion planning, ...) from the gas network formulations (e.g. CWP, DWP, CRDWP, ...).
This enables the definition of a wide variety of gas network formulations and their comparison on common problem specifications.
Core Problem Specifications
-
Gas Flow (gf)
-
Expansion Planning (ne)
-
Load Shed (ls)
-
Supported Formulations
All formulation names refer to how underlying physics of a gas network is modeled. For example, the LRWP model uses a linear representation of natural gas physics. If a model includes valves, then the resulting mathematical optimization problems will be mixed integer since valve controls are discrete.
| Formulation | Steady-State | Transient | Description |
|---|---|---|---|
| WP | Y | Y | Physics is modeled using nonlinear equations. |
| DWP | Y | N | Physics is modeled using nonlinear equations. Directionality of flow is modeled using discrete variables |
| CWP | Y | N | Physics is modeled using nonlinear equations. Pipe flow in each direction is modeled by a nonnegative continuous variable. Complementarity constraints are used to ensure that flow is zero in at least one direction. |
| CRDWP | Y | N | Physics is modeled using convex equations. Directionality of flow is modeled using discrete variables |
| LRDWP | Y | N | Physics is modeled using linear equations. Directionality of flow is modeled using discrete variables |
| LRWP | Y | N | Physics is modeled using linear equations. |
Basic Usage
Note: Different problem formulations require different types of solvers. For continuous models such as CWP, WP, and LRWP, it is recommended to use Ipopt. For formulations that involve discrete variables—such as DWP, CRDWP, and LRDWP—a mixed-integer nonlinear programming (MINLP) solver like Juniper is required. See the second example for details on configuring Juniper.
Once GasModels is installed, a optimizer is installed, and a network data file has been acquired, a Gas Flow can be executed with,
using GasModels, Ipopt
ipopt_solver = optimizer_with_attributes(Ipopt.Optimizer, "tol" => 1e-4, "print_level" => 0)
casepath = "case-6.m"
result = solve_ogf(casepath, CWPGasModel, ipopt_solver)
For discrete problems requiring the Juniper optimizer, refer to the following example:
using GasModels, Ipopt, Juniper, HiGHS
# Create Juniper solver for MINLP
nl_solver = optimizer_with_attributes(Ipopt.Optimizer, "tol" => 1e-4)
mip_solver = optimizer_with_attributes(HiGHS.Optimizer)
juniper_solver = optimizer_with_attributes(
Juniper.Optimizer,
"nl_solver" => nl_solver,
"mip_solver" => mip_solver
)
casepath = "case-6.m"
result = solve_ogf(casepath, DWPGasModel, juniper_solver)
Similarly, an expansion optimizer can be executed with,
solve_ne(casepath, FooGasModel, FooSolver())
where FooGasModel is the implementation of the mathematical program of the Gas equations you plan to use (i.e. DWPGasModel) and FooSolver is the JuMP optimizer you want to use to solve the optimization problem (i.e. IpoptSolver).
Acknowledgments
This code has been developed as part of the Advanced Network Science Initiative at Los Alamos National Laboratory.
The primary developer is Russell Bent, with significant contributions from Conrado Borraz-Sanchez, Hassan Hijazi, and Pascal van Hentenryck.
Special thanks to Miles Lubin for his assistance in integrating with Julia/JuMP.
License
This code is provided under a BSD license as part of the Multi-Infrastructure Control and Optimization Toolkit (MICOT) project, C15024.
Owner metadata
- Name: advanced network science initiative
- Login: lanl-ansi
- Email: ansi-info@lanl.gov
- Kind: organization
- Description: Los Alamos Advanced Network Science Initiative
- Website: https://lanl-ansi.github.io/
- Location: Los Alamos, NM
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/17053288?v=4
- Repositories: 79
- Last ynced at: 2023-08-03T12:24:54.080Z
- Profile URL: https://github.com/lanl-ansi
GitHub Events
Total
- Create event: 8
- Commit comment event: 8
- Issues event: 6
- Release event: 4
- Watch event: 8
- Delete event: 2
- Issue comment event: 16
- Push event: 42
- Pull request review comment event: 3
- Pull request review event: 5
- Pull request event: 11
- Fork event: 3
Last Year
- Create event: 7
- Commit comment event: 6
- Issues event: 6
- Release event: 3
- Watch event: 8
- Delete event: 2
- Issue comment event: 15
- Push event: 35
- Pull request review comment event: 3
- Pull request review event: 4
- Pull request event: 9
- Fork event: 3
Committers metadata
Last synced: about 2 months ago
Total Commits: 981
Total Committers: 16
Avg Commits per committer: 61.313
Development Distribution Score (DDS): 0.628
Commits in past year: 63
Committers in past year: 6
Avg Commits per committer in past year: 10.5
Development Distribution Score (DDS) in past year: 0.365
| Name | Commits | |
|---|---|---|
| Russell Bent | r****t@l****v | 365 |
| Kaarthik Sundar | k****r@g****m | 303 |
| Byron Tasseff | b****f@l****v | 101 |
| David M Fobes | d****s@l****v | 65 |
| carleton | c****c@l****v | 46 |
| Skyler Reid | 9****d | 40 |
| Sai Krishna Kanth Hari | h****h@g****m | 37 |
| Kaarthik Sundar | k****r@p****v | 8 |
| Jack Miner | 5****c | 4 |
| James Wernicke | w****e@l****v | 4 |
| Peter Watson | 4****4 | 2 |
| Reid | 4****0@w****v | 2 |
| Oscar Dowson | o****w | 1 |
| Julia TagBot | 5****t | 1 |
| Adam Mate | 3****e | 1 |
| ftuser | f****r@l****v | 1 |
Committer domains:
- lanl.gov: 5
- loft2003907.lanl.gov: 1
- win.lanl.gov: 1
- pn1715900.lanl.gov: 1
Issue and Pull Request metadata
Last synced: about 2 months ago
Total issues: 152
Total pull requests: 131
Average time to close issues: 7 months
Average time to close pull requests: 9 days
Total issue authors: 13
Total pull request authors: 13
Average comments per issue: 1.48
Average comments per pull request: 1.44
Merged pull request: 121
Bot issues: 0
Bot pull requests: 0
Past year issues: 5
Past year pull requests: 12
Past year average time to close issues: 3 months
Past year average time to close pull requests: 17 days
Past year issue authors: 2
Past year pull request authors: 6
Past year average comments per issue: 0.6
Past year average comments per pull request: 1.17
Past year merged pull request: 8
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- rb004f (87)
- ccoffrin (41)
- kaarthiksundar (5)
- adammate (4)
- tasseff (3)
- cvr (3)
- hskkanth (2)
- sonofwatt84 (2)
- 3ch01c (1)
- attobot (1)
- wenjingsu16 (1)
- JuliaTagBot (1)
- pseudocubic (1)
Top Pull Request Authors
- rb004f (62)
- hskkanth (15)
- kaarthiksundar (13)
- ccoffrin (10)
- tasseff (9)
- pseudocubic (9)
- 3ch01c (4)
- sonofwatt84 (2)
- odow (2)
- skylerreid (2)
- adammate (1)
- Robbybp (1)
- JuliaTagBot (1)
Top Issue Labels
- bug (1)
Top Pull Request Labels
- enhancement (5)
- bug (2)
Package metadata
- Total packages: 3
-
Total downloads:
- julia: 48 total
- Total dependent packages: 1 (may contain duplicates)
- Total dependent repositories: 0 (may contain duplicates)
- Total versions: 78
proxy.golang.org: github.com/lanl-ansi/GasModels.jl
- Homepage:
- Documentation: https://pkg.go.dev/github.com/lanl-ansi/GasModels.jl#section-documentation
- Licenses: other
- Latest release: v0.10.6 (published 3 months ago)
- Last Synced: 2025-10-29T20:10:29.335Z (about 2 months ago)
- Versions: 27
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
proxy.golang.org: github.com/lanl-ansi/gasmodels.jl
- Homepage:
- Documentation: https://pkg.go.dev/github.com/lanl-ansi/gasmodels.jl#section-documentation
- Licenses: other
- Latest release: v0.10.6 (published 3 months ago)
- Last Synced: 2025-10-29T20:10:29.906Z (about 2 months ago)
- Versions: 27
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
juliahub.com: GasModels
A Julia/JuMP Package for Gas Network Optimization
- Homepage: https://lanl-ansi.github.io/GasModels.jl/latest/
- Documentation: https://docs.juliahub.com/General/GasModels/stable/
- Licenses: BSD-3-Clause
- Latest release: 0.10.6 (published 3 months ago)
- Last Synced: 2025-10-29T20:10:35.584Z (about 2 months ago)
- Versions: 24
- Dependent Packages: 1
- Dependent Repositories: 0
- Downloads: 48 Total
-
Rankings:
- Dependent repos count: 9.94%
- Forks count: 10.378%
- Stargazers count: 11.463%
- Average: 13.688%
- Dependent packages count: 22.97%
Dependencies
- JuliaRegistries/TagBot v1 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- codecov/codecov-action v1 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/julia-processcoverage v1 composite
- julia-actions/julia-runtest latest composite
- julia-actions/setup-julia v1 composite
- actions/checkout v2 composite
- julia-actions/setup-julia latest composite
Score: 11.409341148713658