Code Monkey home page Code Monkey logo

gasmodels.jl's People

Contributors

3ch01c avatar adammate avatar ccoffrin avatar hskkanth avatar juliatagbot avatar jwernicke avatar kaarthiksundar avatar pseudocubic avatar rb004f avatar tasseff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gasmodels.jl's Issues

Non-binary version of compressor/control valve direction constraints

When compression ratio >= 1 for compressors, the following constraint can be used to enforce one way direction of compression

f * (1 - \alpha) <= 0.

The reciprocal constraint can be used for control valves.

Note that binary variables are still needed if the min compression is anything other than 1.

Friction Factor

Change data format to use a friction factor instead of a resistance. Compute the resistance needed for the mathematical in the constraint template (similar to admittance values in Power Systems).

Create a constraint_template.jl

Create a constraint_template.jl so that parameters of constraints can be passed as variables or constants (or a mix). See PowerModels.jl for an example

Compressor Horsepower constraints

Implement a constraint of the form r * f (\alpha^m-1) \le E to enforce constraints on horsepower for compressors. For backwards compatibility, assume E is infinity of the data is not provided (and don't post the constraint). Also, for now, the current relaxation implementations will complete relax this constraint. (see MISOCP).

Test REQUIRE

In the test/REQUIRE includes,

AmplNLWriter
CoinOptServices

but in runtests there are guards of the form,

if (Pkg.installed("AmplNLWriter") != nothing && Pkg.installed("CoinOptServices") != nothing)
...
end

If AmplNLWriter, CoinOptServices remain in REQUIRE, these guards are not need. Otherwise AmplNLWriter, CoinOptServices should be removed from REQUIRE.

On a side note, I briefly used AmplNLWriter, CoinOptServices in the PowerModels CI, but pulling in the packages ended up taking so long the CI ran out of time! So I stopped using them.

Filter Depreciation Warning

When running tests there are several of these warnings,

WARNING: filter(flt, itr) is deprecated, use Iterators.filter(flt, itr) instead.

See if these can be resolved.

Constraint Return Values

Consider removing the constraint return values, e.g.,

c1 = @constraint(gm.model, -(1-yp)*gm.ref[:max_flow] <= f)
c2 = @constraint(gm.model, f <= (1-yn)*gm.ref[:max_flow])
return Set([c1, c2])   

In PowerModels these were not being used anyone and they were causing a performance issue. So I removed them.

Explore removing qlfirm as a field

Supporting the concepts of both qlfirm and qlmin/qlmax seems counter intuitive to many people. However, there are some use cases that needed both of these concept. Now that there is support for multiple loads at a junction, it is time to revisit this. It might be possible to support these use cases with multiple loads.

Load Priorities

  • Provided optional data fields for giving priorities to consumers
  • Add extended objective function, which does load shedding with priority

Repo Metadata

In the github interface add, a description, keywords, and setup the website to link to the documentation on github pages.

Tests of ls.jl and nels.jl

There should be at least one test for these models or they should be moved to a code base where they are used.

Status Value Consistency

Questions

  • Should the field be optional or required?
  • Should the value be 0/1 or false/true?

The PowerModels convention is,

  • required for all compenents
  • values are in 0/1 to play nice with Matlab data formats, where data tables cannot have mixed types

Compressor and Control Valve Data Model

Modify the compressor and control valve data model so that they (de)compress in only one direction (implied in the from->to direction). If flow goes in the opposite direction, then no (de)compression occurs.

Bi-directional regulation objects will require two sequential objects in the data, one that (de)compresses in one direction and one in the other direction

Data format updates

  • status flag on input for all component types
  • field names for x,y coordinates
  • load values in output data of LS model

Json Data: Component ids... Strings or Integers

The internal data structures of GasModels.jl assume all component ids are integers, however the json data input format uses strings for component ids, but all references to these ids use their integer equivalent. This should be unified as strings or integers, not a mix.

Connections List

In the data file, what do you think about breaking the connections into two separate component lists, pipes and compressors?

Relaxation Scheme Tests

See if the functions in relaxation_scheme.jl are being used. If so, add a test. If not, remove the file.

CHANGELOG.md

Consider adding a CHANGELOG.md file in the root directory to document what changes between versions.

flux and flux square variable

Right now there are separate calls for flux and flux square variable creation. Flux square is just used for in the relaxation model of flux, so we should create these in the MISCOP version of the problem

Problem in the definition of run_soc_gf and run_nl_gf

Hi,

I believe functions run_soc_gf and run_nl_gf have a misspell on their definition, calling run_pf instead of run_gf. In file GasModels.jl/src/prob/gf.jl one finds the following functions:

" entry point into running the gas flow feasability problem "
function run_gf(file, model_constructor, solver; kwargs...)
    return run_generic_model(file, model_constructor, solver, post_gf; kwargs...) 
end

""
function run_soc_gf(file, solver; kwargs...)
    return run_pf(file, MISOCPGasModel, solver; kwargs...)
end

""
function run_nl_gf(file, solver; kwargs...)
    return run_pf(file, MINLPGasModel, solver; kwargs...)
end

When using GasModels in Julia and after defining a solver (with Pavito), executing run_soc_gf("../test/data/gaslib-40.json", solver) will yield an error whilst running run_soc_gf("../test/data/gaslib-40.json", MISOCPGasModel, solver) will return results. Both run_soc_gf and run_nl_gf call function run_pf which is undefined in the remainder of the source code.

Mathematical model on the GasModels.jl manual

Hi,
One question regarding the math in the online documentation. Before integration, when writing p dp/dx = - λ a² ϕ |ϕ| / (2 D) it should be equal to writing d(p²)/dx = - λ a² ϕ |ϕ| / D. Thus, after integration you should get p²(L) - p²(0) = - L λ a² ϕ |ϕ| / D = - L λ a² f |f| / (A² D), however you have an extra ½ in your equations. Am I missing something? If not, the implementation in the code is affected by this ½ factor or is just a glitch in the manual.

Thank you for your work on GasModels.jl and your decision on releasing the code. I'm planning on using it for lecturing purposes, if there is no conflict.

Best regards.

Julia v0.6 Required?

Is Julia v0.6 a strick requirement of GasModels? Based on other reqs it looks like v0.5 would be fine.

Units

Currently, GasModels. jl assumes all input is in the correct units. We need to support different types of units and have "make_per_unit" like function to normalize everything into the correct units.

Update Test Usage

As of Julia v0.5,

if VERSION >= v"0.5.0-dev+7720"
    using Base.Test
else
    using BaseTestNext
    const Test = BaseTestNext
end

Can be replaced with,

using Base.Test

BaseTestNext can then be removed from REQUIRE.

Test Robustness

There seems to be an issue with robustness in runtests.jl. I found that if you have gurobi installed the 6 tests listed below fail. The reason for the failures appears to be a miss-match in the value of the objective function at algorithm termination.

I would guess this is because the solver being used for testing is changed based on which solvers are installed, combined with the fact that the test problems are sufficiently challenging, so the runtime can effect their performance.

Best practice for unit tests is to use open source solvers, and to test on toy models so that the solver algorithm can complete in a few seconds.

Test Summary:          | Pass  Fail  Total
  test misocp ne       |   42     3     45
  A1 MISCOP case       |    2            2
  A2 MISCOP case       |    2            2
  A3 MISCOP case       |    2            2
  gaslib 40 case 10%   |    2            2
  gaslib 40 case 5%    |    2            2
  gaslib 40 case 25%   |    2            2
  gaslib 40 case 50%   |    2            2
  gaslib 40 case 75%   |    2            2
  gaslib 40 case 100%  |    2            2
  gaslib 40 case 125%  |    1            1
  gaslib 40 case 150%  |    1            1
  gaslib 135 case 5%   |    2            2
  gaslib 135 case 10%  |    2            2
  gaslib 135 case 25%  |    2            2
  gaslib 135 case 50%  |    2            2
  gaslib 135 case 75%  |    2            2
  gaslib 135 case 100% |    2            2
  gaslib 135 case 125% |    1            1
  gaslib 135 case 150% |    1            1
  gaslib 135 case 200% |    1            1
  gaslib 582 case 5%   |    1     1      2
  gaslib 582 case 10%  |    2            2
  gaslib 582 case 25%  |    1     1      2
  gaslib 582 case 50%  |    1     1      2
  gaslib 582 case 200% |    1            1
  gaslib 582 case 300% |    1            1

Anonymous JuMP Variables

variable definitions like this,

gm.var[:p] = @variable(gm.model, 
   gm.ref[:junction][i]["pmin"]^2 <= p[i in keys(gm.ref[:junction])] <= gm.ref[:junction][i]["pmax"]^2, 
   start = getstart(gm.ref[:junction], i, "p_start", gm.ref[:junction][i]["pmin"]^2)
)
return gm.var[:p]

should be changed to this format so that the variables in the JuMP model are anonymous.

gm.var[:p] = @variable(gm.model, 
   [i in keys(gm.ref[:junction])], basename="p",
   lowerbound = gm.ref[:junction][i]["pmin"]^2,
   upperbound = gm.ref[:junction][i]["pmax"]^2, 
   start = getstart(gm.ref[:junction], i, "p_start", gm.ref[:junction][i]["pmin"]^2)
)
return gm.var[:p]

The key point is that the variable index set do does not have an identifier in front of it.

On a related note, the current convention in PowerModels is not to return anything in variable_ and constraint_ functions.

Area being calculated as pi*D/4 instead of pi*D^2/4.

Hi,

In the definitions for the friction and resistance terms, functions calc_pipe_resistance_thorley and calc_resistor_resistance_simple in
src/core/data.jl, the cross-sectional area is being computed as:

A     = (pi*D) / 4 # cross sectional area

instead of

A     = (pi*D^2) / 4 # cross sectional area

Considering that the resistance term is computed as,

resistance = ( (D * A^2) / (lambda * L * a_sqr)) * (data["baseP"]^2 / data["baseQ"]^2)

and the dimensions of baseQ are mass/time, the resistance term will be dimensionless only if the dimensions of A are m^2 instead of m. Unless there is some discrepancy in dimensions I am not understanding.

Best regards.

Coverage Reports

The CodeCov reports do not seem to be going through. Double check the settings at the end of the travis file are correct. Most likely the token information is out of date.

scip.set file

Is this file needed in the root directory? It seems that SCIP is not used in the tests.

JuMP Version

Probably extending the JuMP version to JuMP 0.17 0.19- will still be fine. The METADATA managers prefer the widest possible version bounds.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.