Set hydraulics paramenters

Hello everybody!

I’m going through all MATLAB toolkit functions and examples (which can be found here: ) but I don’t understand how to set some specific parameters. In particular, when you open a .net file in EPANET 2, go to Project > Defaults… > Hydraulics, you can manually set e.g. Specific Gravity or Relative Viscosity. How can I do the same from MATLAB?

Thanks in advance for your help!

Hi @Pisciotta, you can check here:

Note: This branch is a development version where we update daily.

d = epanet('Net1.inp');



Thank you very much for your answer!

I had no idea about this new development version, so meanwhile I solved the problem by directly modifying the .inp file, where such parameters can be found. So I just opened the .inp file, searched below the [OPTIONS] header and changed the parameter’s value. If anybody need a general way to change parameters of this kind of format (KEY [spacing] VALUE) in Matlab, it could be useful to read my post:

I also suggest this tutorial on EPANET as further reading:

Of course using commands you mentioned is the best solution. Thanks again!

1 Like