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

README.md

GasModels.jl

Status:
CI
codecov
Documentation

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


GitHub Events

Total
Last Year

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 Email 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:


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

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/lanl-ansi/GasModels.jl

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

proxy.golang.org: github.com/lanl-ansi/GasModels.jl

proxy.golang.org: github.com/lanl-ansi/gasmodels.jl

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

.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/ci.yml actions
  • 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
.github/workflows/documentation.yml actions
  • actions/checkout v2 composite
  • julia-actions/setup-julia latest composite

Score: 11.409341148713658