I am going to implement the Epanet toolkit with Matlab 2013, Win8 (also I tried the same with Win 7), and 64 bits in three steps.
First, you have to find what C compiler need your Matlab version, because Windows with 64 bits doesnt has C compiler integrated (32 bits version has integrated c compiler by default ). For instance, I have Matlab R2013a, so I put in google: " c compiler matlab for R2013a Matlab version", and I found this link "http://www.mathworks.com/support/compilers/R2013a/index.html?sec=win64", so I installed Microsoft Visual C++ 2013 Professional.
Second, put "mex -setup" in your matlab console.
Third, select the compiler already instalated.



Error using loadlibrary (line 418)
ResponderEliminarThere was an error loading the library
"C:\Users\Admin\Dropbox\MATLAB\Epanet_Matlab_Toolkit\epanet2.dll"
C:\Users\Admin\Dropbox\MATLAB\Epanet_Matlab_Toolkit\epanet2.dll is not a valid Win32
application.
Error in epanetloadfile (line 30)
if ~libisloaded('epanet2') loadlibrary('epanet2', 'epanet2.h'); end
Error in Example (line 20)
epanetloadfile(wdsfile);
Caused by:
Error using loaddefinedlibrary
C:\Users\Admin\Dropbox\MATLAB\Epanet_Matlab_Toolkit\epanet2.dll is not a valid
Win32 application.
IAm GETTING THE ABOVE ERROR WHILE RUNNING THE example.m file ...
Unzip 'epanet2_64bit.zip' from this link 'https://github.com/KIOS-Research/EPANET-Matlab-Class/blob/master/LIBRARIES' ,and replace your files(.dll, and .h) with them.
ResponderEliminarThank you very much for sharing useful information. Now iam able to run matlab successfully and getting flows and pressures.
ResponderEliminarFew more questions to be answered??
How do i get the velocity information??
I want to construct the Adjaceny matrix of the network for both steady state and dynamic simulation...???
How this code is incorporated Valves and their loss coefficients as i am not seen any info about valves in the code...??
Maybe this can help you with the valves: "https://github.com/KIOS-Research/EPANET-Matlab-Class/tree/alpha", and search in the class definition ("epanet.m"), because I can add a new pipe with that for example:
ResponderEliminard.addPipe('NewFilePipeAdded.inp','pp1','32','10');
d.removeLinkID('NewFilePipeRemoved.inp','pp1');.
I never used the velocity information before, but you can ask in this linkedin group: "http://www.linkedin.com/groups/Release-new-EPANETMATLAB-Class-3780529.S.5794410990636388354". Good luck!
How can i construct ADJACENCY MATRIX form the steady state simulation??
ResponderEliminarhello everyone
ResponderEliminari am trying to optimize a WDN using differential evolution.
and the problem is,
EPAnet is not updating the set of diameter in next iteration.
what may be the reason??
please help me out.
PS: i am using epanet matlab toolkit by demetrious.
function [presure]=epanet(newnest)
Eliminar%% epanet
wdsfile='hanoi.inp';
epanetloadfile(wdsfile);
presure = zeros(1,32);
%presure newnest
for i=1:size(newnest,2)
[errcode]=ENsetlinkvalue(i,0,newnest(i));
end
presure = getdata('EN_PRESSURE');
epanetclose();