Hello everybody
I want to examine uncertainty of rainfall duration with the monte carlo method. So I should link SWMM with MATLAB program and run the program many times (here 1000 times). In each iteration I should change the duration of rainfall and so the temporal pattern of rainfall will be changed. Now I want to know is it possible that I change rainfall timeseries for a gage in each iteration?
At this stage I have prepared a code that generate different types of rainfall timeseries. How can I introduce these timeseries to the program that is linked with MATLAB in each iteration?
Best Regards
Replies
It is not hard to add the ability to change a variable during the run in SWMM 5. You need to alter the C and Delphi code but it is only a few lines of code in the engine and Delphi. I will add a blog with one example so you can see how it is done.
Another idea would be to use the ADD IN tools - what exactly are your trying to change during the simulation run?
The figure below shows what the Tools menu might look like after several add-in tools have been registered with it. The Configure Tools option is used to add, delete, or modify add-in tools. The options below this are the individual tools that have been made available (by this particular user) and can be launched by selecting them from the menu.
Dear Lionel,
This matter is explained in Appendix D of SWMM manual under the title of “Command line SWMM”. So in MATLAB you can use below format under DOS window:
"The address of place that SWMM is there" input file name.inp output file name
Hi Fateme Fallah,
I am doing something similar but in my case I am varying the infiltration factor. I am not very good with Matlab so require a bit of help on the coding. I would like to check if you have been successful in your attempt to link Matlab and SWMM 5? Would you be able to share with me on how you did it? Thank you!
I would suggest having your rainfall as an external time series and have that external time series change before each iteration.
MatLab
Change External Time Series
Call SWMM5.EXE and have a Raingage use the External Time Series
Repeat
I have not done this myself but it should be feasible.