-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Step-wise simulation #204
Comments
Right now, the step-wise simulation only works with the WNTRSimulator. We are currently working on features that will extend this to the EpanetSimulator. This includes the ability to initialize the water network model with simulation results (such as results from a previous timestep). We plan to push these updates to the dev branch in the next few weeks. |
Thanks! I'll stay tuned for the upcoming changes. |
I have looked at the repo history and couldn't find any related commits in the last few months. Did you finished this feature and I have missed it or is it still work in progress? In any case, I would greatly appreciate if you could provide an update on the current state of this topic. |
Hi @***@***.***>
We have not pushed into the main fork yet, but if you go to my (dbhart/WNTR) fork and the “realtime” branch you can find a stepwise simulator that may require a little work to make it stepwise (the example under the tests directory is set up for real time, but there is just a flag that is needed to make it run for an arbitrary time for each step). There is also a UML diagram for a flow example in the documentation.
I hope that helps, and we are looking forward to pushing into at least the dev branch of the main fork soon.
|
Thank you for your quick response! After analyzing the code I understand the flag that is required is the sim = rt.EpanetSimulator_RT(wn)
prov = rt.RealtimeProvider(timelimit=wn.options.time.duration,
outfile="temp.out",
infile="temp.in",
controls=controls)
for sensor in nodesens:
sim.add_sensor_instrument(sensor[0], 'node', sensor[1], sensor[2])
for sensor in linksens:
sim.add_sensor_instrument(sensor[0], 'link', sensor[1], sensor[2])
for controller in controllers:
sim.add_controller_instrument(controller[0], controller[1], controller[2])
sim.initialize(transmit=prov.proc_sensors, receive=prov.proc_controllers, stop=prov.check_time, file_prefix="temp")
for i in range(1, 101):
try:
sim.run_sim(until= i * 3600)
print("Simulating until " +str(i*3600) + " in "+str((end-start).seconds) + " seconds")
except:
print("Error")
res = sim.close() However, this approach prompts what I understand is an EPANET convergence warning after the first timestep.
Execution seems to continue without raising an error but no further timesteps are simulated and results obtained after invoking I don't know if I am missing something or this still requires further work on the library to make it functional. Thank you once again for your helpful attention! |
Is the step by step simulation for the Epanet simulator now available? |
We continue to develop the stepwise and realtime EPANET simulators in WNTR, but they are not quite ready to push to the USEPA main branch. It will take some time to get these updates fully documented and tested. We can create a separate branch with this capability as soon as it's ready, perhaps this summer. |
So maybe the step-wise simulator is avaliable now? |
The step-wise simulator is not available yet, we are finishing up documentation and tests. |
Hi!
I am trying to run a Epanet simulation step by step using the same approach proposed in issue #59. However, step time execution increases linearlly with time in my tests, sugesting that simulation is completly recomputed in each step.
I haven't found any information on this step-wise approach in the documentation. After a quick code lookup I have found ENnextH and ENrunH methods in the internal epanet bindings (wntr.epanet.toolkit module) which might be useful. However, it seems to me that they are not used in the exposed high level interface (wntr.sim.epanet module).
Is it possible to perform this step-wise simulation? If so, which is the proper approach to achieve it?
Thanks!
The text was updated successfully, but these errors were encountered: