usepa / wntr Goto Github PK
View Code? Open in Web Editor NEWAn EPANET compatible python package to simulate and analyze water distribution networks under disaster scenarios.
License: Other
An EPANET compatible python package to simulate and analyze water distribution networks under disaster scenarios.
License: Other
According to EPAnet INP-file specifications, the demands in section [DEMANDS] should replace the demands as specified in [JUNCTIONS]. In io.py there is a line (1347) that makes sure that this happens based on category 'EN2 base', but it is commented out. Hence any demands in the [DEMANDS] sections is added to the node. Can this line be activated again safely or does this affect anything else?
It seems that the EmitterCoeff (Ke) of a node is not properly converted from flowunit/psi0.5 to flowunit/m0.5. Considering that pressure in SI is given in meters, Ke should be multiplied by 0.7032 ** 0.5 instead of 0.7032.
Hello,
I came across a "Simulation did not converge. Jacobian is singular at iteration 0". I added a node with zero demand, and this occurs only in PDD mode and WNTR simulator. Changing the node's demand to something small e.g. 0.001 m3/s or 0.1 m3/s does not solve the problem. However, when I use the WNTR simulator or Epanet Simulator in Demand-driven mode no error occurs. Any known remedies to this issue?
I must clarify that the network i use is a modified Net1.inp.
This is my code:
wn=wntr.network.WaterNetworkModel('Net1.inp')
negative_demand=-0.005
wn.add_junction('10IN',base_demand=negative_demand,
demand_pattern=None, elevation=cpmodel.wn.get_node('10').elevation+1,
coordinates=(cpmodel.wn.get_node('10').coordinates[0]+0.5,cpmodel.wn.get_node('10').coordinates[1]+0.5))
wn.get_node('10IN').nominal_pressure=0
wn.get_node('10IN').minimum_pressure=1
wn.add_pipe('pipe1','10IN','10',length=1.225)
wn.add_junction('10F',base_demand=0,
demand_pattern=None, elevation=cpmodel.wn.get_node('10').elevation-0.5,
coordinates=(cpmodel.wn.get_node('10').coordinates[0]-0.5,cpmodel.wn.get_node('10').coordinates[1]-0.5))
wn.get_node('10F').nominal_pressure=0
wn.get_node('10F').minimum_pressure=1
wn.add_pipe('pipe2','10F','10',length=1.225)
Adding the following produces the problem
wn.add_junction('32F',base_demand=0.1,
demand_pattern=None, elevation=cpmodel.wn.get_node('32').elevation+0.5,
coordinates=(cpmodel.wn.get_node('32').coordinates[0]-0.5,cpmodel.wn.get_node('32').coordinates[1]-0.5))
wn.get_node('32F').nominal_pressure=0
wn.get_node('32F').minimum_pressure=1
wn.add_pipe('pipe3','32F','32',length=1.225)
sim = wntr.sim.WNTRSimulator(wn, mode='PDD')
results= sim.run_sim()
Also, when i remove the nominal and minimum pressure declarations it runs without problem.
Thanks in advance!
I'm trying to estimate the change in system pressure due to a pipe break and i'm struggling to figure out how to do this in a pressure-dependent way in WNTR. This is what I currently do:
While this works, I can't figure out a way to reasonably define the base demand and demand profile. These values are arbitrarily set. If i do not have demand at these junctions and only leaks, no flow will go to these points, which also doesn't make sense.
Any ideas on how to simulate water loss (and pressure changes) due to pipe breaks?
Hello,
I am not sure how to remove a pattern from a wntr.network.model.WaterNetworkModel object. I get the error:
('cannot remove %s %s, still used by %s', 'PatternRegistry', 'PDD10', {('10', 'Junction'), }).
However, I cannot find a way to delete patterns from PatternRegistry.
Thanks in advance!
Dionysis
Then wouldn't have to do the conversion on wntr.add_* or on the results.
Something like: wn = wntr.network.WaterNetworkModel(units='USC')
Gets me EPANET inp files defaults.
(If only the US would have switched over with the Brit's these thoughts wouldn't even cross my mind :) )
i'm trying to run simulations using the wntr.EpanetSimulator() function in parallel and i keep getting back epanet errors "EPANET Error 200" or "EPANET Error 224". the error implies i do not have a supply nodes but I explicitly call wntr.add_reservoir()/wntr.add_tank() beforehand, it's unclear to me why this is happening.
i also assert that the network is completely connected (using the wntr.to_undirected() function), and that there is at least one supply node (length of wntr.reservoir_name_list + wntr.tank_name_list).
the os im using is linux (ubuntu), any pointers as why this is happening? my hunch is the parallelization of writing and running multiple files at once
Because of issues with using travis with the USEPA user, we need to indicate that pull requests should go to sandialabs/WNTR instead so that the changes are tested. But issues should still go on this repo?
I have no trouble running WNTRSimulator with the default 24-hour setting in my model. But when I tried to run extended simulation of 48 hours, the simulation cannot solve. Here's what I did.
inp_file = 'AvgDay_460MGD_March2018_original.inp'
wn_0 = wntr.network.WaterNetworkModel(inp_file)
wn_0.options.time.duration = 48*3600
sim_0 = wntr.sim.WNTRSimulator(wn_0, mode = 'PDD')
results_0 = sim_0.run_sim()
The error I received is "RuntimeError: Exceeded maximum number of trials." I don't know if it's because my water network has issues or it has something to do with WNTRSimulator.
My WNTR version is 2.0.1.
Hi,
I have successfully imported the network file (i.e. *.inp). However running the wntr simulator I keep on getting the following error:
ValueError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\managers.py in create_block_manager_from_blocks(blocks, axes)
1650 blocks = [make_block(values=blocks[0],
-> 1651 placement=slice(0, len(axes[0])))]
1652
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\blocks.py in make_block(values, placement, klass, ndim, dtype, fastpath)
3094
-> 3095 return klass(values, ndim=ndim, placement=placement)
3096
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\blocks.py in init(self, values, placement, ndim)
86 'Wrong number of items passed {val}, placement implies '
---> 87 '{mgr}'.format(val=len(self.values), mgr=len(self.mgr_locs)))
88
ValueError: Wrong number of items passed 1, placement implies 25
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
in
1 # Simulate hydraulics
2 sim = wntr.sim.EpanetSimulator(wn)
----> 3 results = sim.run_sim()
C:\ProgramData\Anaconda3\lib\site-packages\wntr\sim\epanet.py in run_sim(self, file_prefix, save_hyd, use_hyd, hydfile)
96 logger.debug('Completed run')
97 #os.sys.stderr.write('Finished Closing\n')
---> 98 return self.reader.read(outfile)
99
C:\ProgramData\Anaconda3\lib\site-packages\wntr\epanet\io.py in read(self, filename, custom_handlers)
2761 logger.exception('Failed to process file: %s', e)
2762
-> 2763 df = pd.DataFrame(data.transpose(), index =index, columns = reporttimes)
2764 df = df.transpose()
2765
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\frame.py in init(self, data, index, columns, dtype, copy)
422 else:
423 mgr = init_ndarray(data, index, columns, dtype=dtype,
--> 424 copy=copy)
425
426 # For data is list-like, or Iterable (will consume into list)
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\construction.py in init_ndarray(values, index, columns, dtype, copy)
165 values = maybe_infer_to_datetimelike(values)
166
--> 167 return create_block_manager_from_blocks([values], [columns, index])
168
169
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\managers.py in create_block_manager_from_blocks(blocks, axes)
1658 blocks = [getattr(b, 'values', b) for b in blocks]
1659 tot_items = sum(b.shape[0] for b in blocks)
-> 1660 construction_error(tot_items, blocks[0].shape[1:], axes, e)
1661
1662
C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\internals\managers.py in construction_error(tot_items, block_shape, axes, e)
1689 raise ValueError("Empty data passed with indices specified.")
1690 raise ValueError("Shape of passed values is {0}, indices imply {1}".format(
-> 1691 passed, implied))
1692
1693
i try to run the following code
input = wntr.network.WaterNetworkModel("model.inp")
and get the resulting error
-packages/wntr/epanet/io.py", line 1680, in _read_options
setattr(opts, words[0].lower(), float(words[1]))
ValueError: could not convert string to float: 'psi'
any suggestions on how to resolve the error? should i be making changes to the .inp file?
HeadLoss units are not properly converted when using the epanet package
Hello,
Thank you for developing this great tool. I'm wondering if there is a way to extract the pumping energy and assign it to a variable using the tool. I see that the cost of pumping is included in the results generated from "wntr.metrics.cost", however, I'm not able to separate the pumping energy consumption.
Thanks
WNTR uses Pandas Panels to store simulation results. The development team is looking at alternatives to replicate this functionality.
When Matplotlib is not installed, this error is generated upon import. According to the docs, Matplotlib is an optional dependency. However, I can find no way to use the WNTR package without installing Matplotlib.
I also see this when using the continuumio/anaconda3:5.0.1 docker image, which does have matplotlib pre-installed. So apparently there's some compatibility problems there as well.
Traceback (most recent call last):
File "./epanet_worker.py", line 1, in <module>
from wntr import network
File "/opt/conda/lib/python3.6/site-packages/wntr/__init__.py", line 6, in <module>
from wntr import graphics
File "/opt/conda/lib/python3.6/site-packages/wntr/graphics/__init__.py", line 4, in <module>
from wntr.graphics.network import plot_network, plot_interactive_network
File "/opt/conda/lib/python3.6/site-packages/wntr/graphics/network.py", line 20, in <module>
node_size=20, node_range = [None,None], node_cmap=plt.cm.jet, node_labels=False,
NameError: name 'plt' is not defined
The difference between pipe.status and pipe.initial_status is not well documented.
I had thought pipe.status would be written as "Status" in the .INP file. Instead the pipe.initial_status is written as "Status". After tracing this issue, I understand why this difference exists.
https://wntr.readthedocs.io/en/latest/apidoc/wntr.network.elements.html#wntr.network.elements.Pipe
not documented are most useful properties: length, diameter, roughness, minor_loss, and others
Hello,
I am experiencing a strange issue when performing a step-wise simulation. The set-up: a) I import a .inp file like example Net1 b) I set the time options to time.duration = 1 hour and same for hydraulic timestep c) I use WNTRSimulator d) I loop for 24 hours running the sim again for the same water network, but advancing the time.start_clocktime by one hour.
The problem: At certain steps, the results are empty data frames.
Strange behaviour: If you force the simulation to run again when the results are an empty dataframe, then the new results are not an empty dataframe and also correct hydraulically speaking.
You can replicate the issue with the code below and you can note that at hour 12 and 23 (starting count from 0) the results are empty dataframes.
I use Anaconda 5.1.0, python version 3.6 and I installed WNTR with pip.
import wntr
import pandas as pd
inp_file = 'C:/...../WNTR-master/examples/networks/Net1.inp'
wn.options.time.duration = 3600
wn.options.time.hydraulic_timestep = 3600
wn.options.time.pattern_timestep =7200
pres=pd.DataFrame()
stat=pd.DataFrame()
for hour in range(0,24):
print(hour)
sim = wntr.sim.WNTRSimulator(wn)
results= sim.run_sim(solver_options=solv_opts, convergence_error=True)
print(results.node["pressure"])
pres=pres.append(results.node["pressure"],ignore_index = True)
print(results.link["status"])
stat=stat.append(results.link["status"],ignore_index = True)
wn.options.time.start_clocktime=wn.options.time.start_clocktime+3600
The strange solution is to add this check inside the loop after results=sim.run_sim() command:
while results.node["pressure"].empty:
print("empty")
results=sim.run_sim()
Any help would be more than welcome!
I use 'wntr.network.WaterNetworkModel' to load an inf file,but occured the error:
File "D:\anaconda\lib\site-packages\wntr\epanet\io.py", line 615, in _read_pipes
if current[7].upper() == 'CV':
IndexError: list index out of range
why?
Hello,
I have problem with Epanet Simulation of network, which contains a GPV.
In this network GPV has a string setting, which is a reference to defined headloss curve.
I get EPANET Error 200 as I guess only float value is accepted.
Any ideas of how to make it work? I would appreciate all suggestions ;)
Heres the exact error code:
File "C:\DEV\Python\lib\site-packages\wntr\sim\epanet.py", line 81, in run_sim
File "C:\DEV\Python\lib\site-packages\wntr\epanet\toolkit.py", line 187, in EN
open
File "C:\DEV\Python\lib\site-packages\wntr\epanet\toolkit.py", line 156, in _e
rror
wntr.epanet.toolkit.EpanetException: EPANET Error 200
And here's the inp section with GPV
;ID Node1 Node2 Diameter Type Setting MinorLoss
967 16_71 valve 55.4 GPV head_curve 0 ;
Hello. I start work with WNTR. It will help me in my master thesis. I have a problem with plotting in Pycharm IDE. When I used a getting_started script in Pycharm I don't got any graph. I have every required python package. However When I used Spyder in terminal i got a small picture of graph.
What's the problem. Pycharm doesn't support WNTR or I have problem with python package?
(I use Python 3.6.7 in Ubuntu 18.04)
Helo,
is possible to get atribute of reservoir e.g. elevation from imported WDS model? I can't use query_node_attribute
because reservoir isn't a node in WNTR. Is any method to get this attribute?
WNTRSimulator simulates a single timestep every time run_sim is called even if the sim_time is past the duration
This is particularly an issue when turning a constant power pump off and then back on. The flow in a constant power pump should never be 0.
After running wn_skel wntr.morph.skeletonize(wn)
, the new demands are not written to the .inp file using wn_skel.write_inpfile
or the wntr.epanet.io.InpFIle.write
class method. See attached script.
net3skel.py.txt
Net3.inp.txt
i'm trying to remove a pipe from my epanet model using the following code
wntr.remove_link('pipeA')
however i get the error code back 'NoneType' object has no attribute 'update'
i tried to loop through every single pipe in my system and each trial gives me the same error back. i even tried re-exporting the .inp file multiples times on epanet. any pointers as to why?
the network im using is in the link below https://ceprofs.civil.tamu.edu/kbrumbelow/Micropolis/index.htm
I installed WNTR 0.1.5 and I am using the following version of Python in Spyder 3:
3.6.3 |Anaconda custom (64-bit)| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)]
I re-created, without mistakes, the two scripts performing hydraulic simulations and the interaction with networkx, and have saved them in a folder. In the same folder, I created a sub-folder called "networks", where I saved the .inp files made available on GitHub.
However, when I run either script, I get the following error:
RuntimeError: networks/Net3.inp:9: Non-comment outside of valid section!
This same error occurs when I change .inp file, so I am not sure what happens - never played with .inp files before. That number 9 may point at row 9 in the .inp file, but I could not spot anything weird or that could match the error description.
Any help would be much appreciated.
I am new in programming. trying to use wntr for my research. running
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32 .
and using Spyder to code.
I am trying to use the epanet.toolkit to get values from an inp file however the command requires enter an iCode for the components. How do I get this input.
import wntr
inp_file = "umee/hanoi.inp"
wn = wntr.network.WaterNetworkModel(inp_file)
wntr.graphics.plot_network(wn, title=wn)
wntr.epanet.toolkit.runepanet(inp_file)
wntr.epanet.toolkit.ENepanet(inpfile="umee/hanoi.inp",rptfile="umee/hanoi.rpt",binfile="umee/hanoi.bin")
wntr.epanet.toolkit.ENepanet.ENgetcount() # trying to get linkcount
Appropriately, ValueError: invalid literal for int() with base 10:
is raised if a non-integer value is entered as a rule's Priority value in the inp file.
However, in cases where Priority is manually or programmaticaly assigned a float value such as '1.0', this still raises an error. The same inp file opens and runs fine in EPANET.
This can be resolved by converting the parsed string value for Priority to float first and then to int.
Hello. I want to inquire about error while studying WNTR Simulator.
An error occurs during the calculation of 'Compute water service availability, for each operation' in the hydraulics.
Warning (from warnings module):
File "C:\Users\syste\AppData\Local\Programs\Python\Python36\lib\site-packages\wntr\sim\hydraulics.py", line 713
last_segment = (-0.5)j_d/(nomP-minP)((P-minP)/(nomP-minP))**(-0.5)
RuntimeWarning: divide by zero encountered in power
Warning (from warnings module):
File "C:\Users\syste\AppData\Local\Programs\Python\Python36\lib\site-packages\wntr\sim\hydraulics.py", line 713
last_segment = (-0.5)j_d/(nomP-minP)((P-minP)/(nomP-minP))**(-0.5)
RuntimeWarning: invalid value encountered in multiply
I hope you will let me know the solution to this.
Thank you.
Hello,
I'm trying to run the Getting Started example and get the following error:
OSError: [WinError 126] The specified module could not be found
Hello, I am new to coding and am trying to utilize WNTR for a project. I am having issues calling into the pumps to pull the "power" attribute and have it match the model. Both units are in HP. It is either prints out "1" or "None."
wntr.network.model.Pump('~@Pump-1','I-Pump-1','O-Pump-1', wn)._base_power
print(wntr.network.elements.Pump('~@Pump-1','I-Pump-1','O-Pump-1', wn)._base_power)
I can have it call into the model for junction or pipe attributes and can modify those as desired. I am just unsure of the proper pathway to call for pumping power and how to modify it once I can call to it.
the reference provides 5 different units of flow, how can we know which one is reported when we run the EPANET simulator?
https://wntr.readthedocs.io/en/latest/units.html
code:
epanet_sim = wntr.sim.EpanetSimulator(wntr_object)
results = epanet_sim.run_sim()
flows = results.link['flowrate']
@michaelbynum I downloaded psv_support from your folk. When I tried to install it. I got this error message
D:\Research_Y2\WNTR-psv_support>python setup.py install
running install
running bdist_egg
running egg_info
writing top-level names to wntr.egg-info\top_level.txt
writing wntr.egg-info\PKG-INFO
writing dependency_links to wntr.egg-info\dependency_links.txt
reading manifest file 'wntr.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'LICENSE.txt'
writing manifest file 'wntr.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
copying wntr\sim\aml\evaluator.cpp -> build\lib.win32-3.5\wntr\sim\aml
copying wntr\sim\aml\evaluator_wrap.cpp -> build\lib.win32-3.5\wntr\sim\aml
copying wntr\sim\network_isolation\network_isolation.cpp -> build\lib.win32-3.5\wntr\sim\network_isolation
copying wntr\sim\network_isolation\network_isolation_wrap.cpp -> build\lib.win32-3.5\wntr\sim\network_isolation
running build_ext
building 'wntr.sim.aml._evaluator' extension
error: [WinError 2] The system cannot find the file specified
Could you help me identify the problem?
Here's my script
inp_file = 'AvgDay_460MGD_March2018.inp'
wn_0 = wntr.network.WaterNetworkModel(inp_file)
sim_0 = wntr.sim.WNTRSimulator(wn_0)
results_0 = sim_0.run_sim()
I got the following error message
"Traceback (most recent call last):
File "", line 13, in
results_0 = sim_0.run_sim()
File "C:\Users\ll69\AppData\Local\Continuum\anaconda2\lib\site-packages\wntr\sim\core.py", line 215, in run_sim
model = HydraulicModel(self._wn, self.mode)
File "C:\Users\ll69\AppData\Local\Continuum\anaconda2\lib\site-packages\wntr\sim\hydraulics.py", line 70, in init
self._set_link_attributes()
File "C:\Users\ll69\AppData\Local\Continuum\anaconda2\lib\site-packages\wntr\sim\hydraulics.py", line 383, in _set_link_attributes
raise ValueError('Currently only PRVs, FCVs, and TCVs are supported.')
ValueError: Currently only PRVs, FCVs, and TCVs are supported."
I notice I have a number of PSV valves in my network. How should I go about avoiding this error message? Thank you.
Hello,
I am trying to run multiple simulations using the EpanetSimulator but some of the networks I am working on produce the following error: ERROR:wntr.epanet.toolkit: EPANET error: 302.
The problem is that once this error occurs I am unable to continue using the EpanetSimulator unless I reset the whole script. I was wondering if there is a work around this.
changing the speed to a non-zero value should open the pump
A few issues related to using the result_types option of EpanetSimulator:
The documentation on wntr.sim.epanet.EpanetSimulator defines that result_types should be a dict, however documentation on wntr.epanet.io.BinFile, where result_types is passed, defines 'results_type' as a list. Possible typo(s)?
When the user-specified result_types is passed from wntr.sim.epanet.EpanetSimulator as a parameter for wntr.epanet.io.BinFile:
self.reader = wntr.epanet.io.BinFile(result_types=result_types)
, result_types is saved to wntr.epanet.io.BinFile attribute self.items. self.items however is only used in the custom handler methods.
When wntr.sim.epanet.EpanetSimulator.run_sim() reaches its end and calls:
return self.reader.read(outfile)
, wntr.epanet.io.BinFile.read() is executed with kwarg custom_handlers = False
, resulting in the items specified by result_types are never being used.
There doesn't seem to be any simple way to use the custom handlers without writing a custom child class of wntr.epanet.io.BinFile?
Maybe I am misunderstanding the intended use of result_types from the API documentation, in which case perhaps the related docs need to be updated to clarify.
venv/local/lib/python3.5/site-packages/networkx/classes/function.py", line 648, in set_node_attributes
G.nodes[n][name] = values
TypeError: unhashable type: 'dict'
I reverted to 1.11 ( pip install networkx==1.11 ) and problem when away.
Here's link to migration guide: https://networkx.github.io/documentation/stable/release/migration_guide_from_1.x_to_2.0.html
We should try to detect empty pipes and issue a warning. These can cause incorrect negative pressures due to differences in elevation.
Hello.
While freezing code with cx_Freeze I encountered problem with WNTR and SciPy . While trying to launch windows returns traceback:
Traceback (most recent call last):
0 File "C:\DEV\Python\lib\site-packagesch_Freeze\initscripts_startup_.py", line 14, in runmodule.run()
File "C:\DEV\Python\lib\site-packages\cx_Freeze\initscripts\ConsoIe.py", line 26, in run
e\ec(code, m.dict)File "SampleAPP.py", line 18, in < module>
File "C:\DEV\Python\lib\site-packageszntrLinit_.py", line 1, in < module>
from wntr import epanetFile "C\DEV\Python\lib\site- packages\wntr\epanet_init_.py", line 4, in < module>
from .io import IoniIe #, BinFiIe, HydFile, RptFiIeFile "C:\DEV\Python\lib\site-packageszntr\epanet\io.py", line 32, in < module>
import wntr.networkFile "C\DEV\Python\lib\site- packages\wntr\network_init_.py", line 6, in < module>
from .eIements import Junction, Reservoir, Tank, Pipe, Pump, Valve, Pattern, TimeSeries, Demands, Curve, SourceFile "C\DEV\Python\lib\site- packages\wntr\network\elements.py", line 37, in < module>
from scipy.optimize import fsolveFile "C\DEV\Python\lib\site- packages\scipy\optimize_init_.py", line 271, in < module>
from ._minimize import *File "C:\DEV\Python\lib\site-packages\scipy\optimize_minimize.py", line 21, in < module>
from scipy.sparse.linalg import LinearOperatorFile "C\DEV\Python\lib\site-packages\scipy\parse_init_.py", line 241, in < module>
from . import csgraphFile "C\DEV\Python\lib\site-packages\scipstparse\csgraphLinit_.py", line 165, in < module>
from ._shortest_path import shortest_path, floyd_warshall, dijkstraAImportError: cannot import name 'shortest_path'
(Converted this traceback from image with ocr so it can contain some typos. Anyone encountered this problem and knows how to solve it? I would be really thankfull.
I can provide more information if needed.
Im using newest version of wntr, python 3.6.5. 64 bit.
What would it take to have support for this option in the wntr solver?
Its inclusion in the calculation of wntr.metrics.expected_demand
can result in unexpected values from wntr.metrics.water_service_availability
when using the wntr simulator.
i notice that a .bin file is not writing to file when i call the following command on my wntr object "wn". the ".inp" and ".rpt" files are writing just fine.
simulation = wntr.sim.EpanetSimulator(wn)
results = simulation.run_sim()
as a result i keep getting an error back "enData.ENopen(inpfile, rptfile, outfile)...wntr.epanet.toolkit.EpanetException: EPANET Error 200".
any pointers as to why the .bin file is not saving?
When reading an INP file, the initial quality is not read. Probably because the function _read_quality() in io.py is never called.
I simply added a line 'self._read_quality()' below 'self._read_demands()' in io.py and this seems to solve the issue. Is this correct or do I miss something?
the question is pretty self explanatory, i tried digging around the junction object directories and couldn't find anything. any tips would be appreciated!
I successfully installed WNTR-psv and loaded WNTR-psv into python.
Here's my code
inp_file = 'AvgDay_460MGD_March2018_original.inp'
wn_0 = wntr.network.WaterNetworkModel(inp_file)
sim_0 = wntr.sim.WNTRSimulator(wn_0)
results_0 = sim_0.run_sim()
Here's what the screen shows
Traceback (most recent call last):
File "", line 2, in
results_0 = sim_0.run_sim()
File "C:\Users\ll69\AppData\Local\Continuum\anaconda3\lib\site-packages\wntr\sim\core.py", line 463, in run_sim
solver_status, mesg = _solver_helper(model, solver, solver_options)
File "C:\Users\ll69\AppData\Local\Continuum\anaconda3\lib\site-packages\wntr\sim\core.py", line 732, in _solver_helper
sol = _solver.solve(model)
File "C:\Users\ll69\AppData\Local\Continuum\anaconda3\lib\site-packages\wntr\sim\solvers.py", line 99, in solve
J = model.evaluate_jacobian(x=None)
File "C:\Users\ll69\AppData\Local\Continuum\anaconda3\lib\site-packages\wntr\sim\aml\aml.py", line 336, in evaluate_jacobian
raise ValueError('The number of constraints and variables must be equal.')
ValueError: The number of constraints and variables must be equal.
I don't quite understand what this error means. The INP file is based on a real drinking water distribution network that runs well with EpanetSimulator.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.