Run EPANET in matlab


#1

I would like to ask how can i run EPANET in MATLAB.
The main target for me not to use the toolkit in this process.
Thanks for helping.


#2

Hi:

There exist a MATLAB’s function named “DOS” that can runs some .exe apps modelled in MS-DOS Windows, see next example:

dos(‘C:\FOLDERX\epanet2d.exe inputfile.inp outputfile.txt outputfile.bin’);

Where:

… “epanet2d.exe” is the MS-DOS program. It can be found in the EPANET’s installation folder in your PC; you can copy this to another FOLDERX
… “inputfile.inp” is the EPANET INP file, (must be contained in the same FOLDERX)
… “outputfile.txt” and “outputfile.bin” will be generated in the same FOLDERX where you are working. These are reports that provides the results of the simulation of EPANET executed in MATLAB).

Yes, the input arguments can be separated by spaces and must be in this order.

You can control the contains of the reports “outputfile.txt” and “outputfile.bin” if specifices what you want in the INP file [REPORT] section, see next examples:

[REPORT]
Nodes All
Links All

[REPORT]
Status No
Summary No
Page 0

Regards