pyswmm / Stormwater-Management-Model

PySWMM Stormwater Management Model repository
Other
99 stars 77 forks source link

Expanding SWMM toolkitapi to allow modification of more properties #373

Closed lassiterdc closed 2 years ago

lassiterdc commented 2 years ago

Hello, a post was made about this a couple years ago but it doesn't look like it received attention.

I am interested in using Pyswmm for calibration and sensitivity analysis, but potentially important parameters like link roughness, subcatchment roughness, and those controlling subcatchment infiltration are not get-able or set-able.

Currently, the subcatchment parameters and conduit parameters that can be modified are listed here and here respectively.

In the short term, I'd really appreciate if someone had advice on how to generate a bunch of SWMM models with a list of around 500 different unique parameter sets (in other words, an order of magnitude too high to create by hand).

Longer term I was wondering, would it be possible to update the toolkitapi to allow for the adjustment of all link, node, and subcatchment parameters?

bemcdonnell commented 2 years ago

@lassiterdc i have no doubt that this would be useful. And I think we’d invite this feature in with open arms if you would be open to contributing it! I looked at doing this years ago and it’s honestly more complicated considering how swmm parses and validates numbers inside the same function. It would take quite a bit of efforts to document all the steps that take place from parse to validate. If you’d be willing to help, I think we could handing the coding aspects of it. Does that sound reasonable to you?

dickinsonre commented 2 years ago

I will say at one time I modified the Delphi code of SWMM to randomly generate parameters n a bunch off files but found it is better to have guided rather than random parameters.

lassiterdc commented 2 years ago

@bemcdonnell just to be clear, all I'm interested in doing is programmatically adjusting .inp files so it shouldn't be necessary to get inside the SWMM code at all. It's really just a matter of reading and editing a text file. It's definitely something I'd be interested in contributing, but right now I'm just trying to knock out a class project lol. I found another R library called swmmr that seems to have what I'm looking for, though I'm having some issues with that as well.

@dickinsonre I appreciate the suggestion. A monte carlo approach is certainly not the most efficient sampling scheme. I'll look into others once I have the basic framework in place.

bemcdonnell commented 2 years ago

You should check out python package SWMMIO, a close friend of Pyswmm.