EPANET- how to convert the unit in EPANET using MATLAB

I need to convert the unit of Net2.inp (in EPANET) by using MATLAB.
For example, I would like to change the flow of all nodes from GMP unit to LPS unit.
So, how to execute the code in MATLAB. Kindly, help me. I am the beginner in MATLAB.
Thank you so much.

Hello,
use the following code after loading your network:

  • d.setBinFlowUnitsLPS

Regards.

2 Likes

Hello,
In my experience this code only modifies units, not values

1 Like

You have to do this manually. I’ve converted the three EPANET example networks to SI units and you can download them from here: https://www.dropbox.com/sh/ua92rpf5e4awr2j/AAC1kjECinJVqY6TBI_jhlW_a?dl=0

1 Like

EPANET 2.2 includes an API to change the units EN_setflowunits(). I guess it was included in the Matlab class. If it doesn’t work please open an issue on GitHub or report the issue here.

2 Likes

Hi
You can use my tool which also allows you to convert flow units directly without programming a single line of code. It is in Spanish, but it is very easy to use.

Download link here

Corunica

1 Like

Hi @TRJ, you can try the following example:

d.setFlowUnitsLPS; 
% or save in new file
d.setFlowUnitsLPS('NET1_LPS.inp');

Regards,
Marios

1 Like

Thank you so much. It is really awesome tool!!

Thank you so much for your suggestion!!

Thank you so much for your suggestion

Thank you so much. They are really useful!!