MATLAB: Optimization of water network, pump scheduling

epanetoptimizepump schedule

Hi,
Im currently trying to minimise the pumping costs of a water distribution network by linking matlab with simulation software called epanet via epanet toolbox.
Through the toolkit I can obtain my Q and H values required for my objective function and also can allocate a pump schedule back to epanet to see what effect this has on my objective function.
I am trying to use NLP search method.
Questions
1)if I am minimizing a function over 24 t periods can i use vectors in the objective function.
E.g if i want to minimize the function x(i)*COST(i)*(-HL_P(i))*(Q_P(i)) where x,COST,HL_P and Q_P are all 24×1 matrices.
and where x(number of pumps operating) is explicitly constrained 0<=x<=4 . (I also have a number of implicit constraints to do with maintaining pressure and reducing pump switching)
2)is there a method which ensures x can remain an integer.
3)how can I minimize iteratively so each time period i=1:24 I call my values required for the objective function and send a new pump schedule.
Thanks!

Best Answer

Hi Adam,
You can use the EPANET Matlab Toolkit http://www.mathworks.com/matlabcentral/fileexchange/25100-epanet-matlab-toolkit to analyze your network.
You can make a Matlab objective function which makes an internal call to the EPANET network simulation to evaluate different pump settings etc.
I would also recommend using "optimtool", where you can choose a suitable optimization algorithm and set the constraints as you desire.
In case the optimization produces non-integer solutions, a trick would be to make a small modification inside the objective function and use "round" or "floor" on the variables you change.
Demetris
Related Question