Giter Club home page Giter Club logo

Comments (4)

kbonney avatar kbonney commented on July 23, 2024

Hi @aljdmn,

I took a look at your files and found that the two networks you are trying to compare do have some differences. For example, the pump curves are slightly different, there is slightly different topology in the bottom right part of the networks, and the pipe lengths do not match either.

If your goal is to get the proyecto 1.4. (cambio alturas).net file into WNTR, I would recommend saving it as a inp file using EPANET and load it into WNTR using wntr.network.WaterNetworkModel("/path/to/inp_file.inp").

from wntr.

aljdmn avatar aljdmn commented on July 23, 2024

Indeed my goal is create a python program to create and simulate the same things for example 'proyecto 1.4.' does. 'Proyecto 1.4. is a file to compare with my wntr code in similar parametres.

Yesterday, after reading the answer, i found the problem was the units, in wntr i wrote the units in International System, but creating the .inp file 'lastmodel.inp' from my wntr code, if i open it in Epanet after that, the units change.

I used this code to fix that: wntr.network.io.write_inpfile(wn,"C:\Users\domen\Desktop\lastmodel2.inp",units='SI')

But, if i load it again (for example to make changes) this Error ocurr:
image

image

i dont know how to load the file, thank you.

from wntr.

kbonney avatar kbonney commented on July 23, 2024

Using "SI" in write_inp will cause this issue when reading the inp file because "SI" is not an expected unit type for an EPANET inp file. Instead, the unit option needs to take its value from one of the following types listed in the "flow" column on this page in the EPANET documentation. This should probably be checked for when running the write_inp function to avoid confusions like this. Also, keep in mind that the unit option is meant to select the units of the output, not the input. WNTR is always SI so you don't need to specify that.

To match your original model you would want to set units="LPS". I ran the code this way, and the units look correct but the hydraulics are still different. Instead of recreating the model from scratch, which is likely introducing hard to detect errors, I suggest doing the following to create a WNTR model:

  1. Load proyecto 1.4. (cambio alturas).net into EPANET.
  2. Save the network as an inp file (file>export>network)
  3. Load this inp file into WNTR using the following command:
    wn = wntr.network.WaterNetworkModel("/path/to/inp_file.inp")

from wntr.

kaklise avatar kaklise commented on July 23, 2024

Closed via #410

from wntr.

Related Issues (20)

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.