Comments (4)
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.
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:
i dont know how to load the file, thank you.
from wntr.
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:
- Load
proyecto 1.4. (cambio alturas).net
into EPANET. - Save the network as an inp file (file>export>network)
- Load this inp file into WNTR using the following command:
wn = wntr.network.WaterNetworkModel("/path/to/inp_file.inp")
from wntr.
Closed via #410
from wntr.
Related Issues (20)
- Create a control object or rule object from text input HOT 5
- Get the reactions tab in the inp file from a water network instance HOT 1
- Add PBV support to [VALVES] section
- Generating Interactive leaflet networks HOT 7
- Pipe status problem HOT 4
- AttributeError: 'WaterNetworkModel' object has no attribute 'write_inpfile' HOT 3
- Values in [DEMANDS] section are repetead and others are missing HOT 8
- Unable to remove leaks from network model HOT 3
- Not able to save the network with modified elements as an INP file. HOT 2
- EPANET Error 110 HOT 1
- leaflet map popups HOT 5
- Todini Index Calculation for the Net6 network - Values outside the range [0,1] HOT 5
- Update EPANET binaries for MacOS arm64 HOT 1
- Version compatibility for dependencies HOT 1
- Pressure Threshold for Resilience indices like Todini and MRI HOT 2
- Problems to run parallel processing with WNTR / EPANET HOT 1
- WARNING - Writing a minimal INP file without saved non-WNTR options (energy, etc.) -- obselete?
- GIS files written with wrong column title for 'name' HOT 1
- Allow import of 'base_demand' and 'demand_pattern' from GIS files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wntr.