Automatic Calibration Epanet

Hello,

Is there a way to make an automate calibration with epanet?

I can put the demands, the patterns, the ways that tanks are filling and emptying, the pumps…

But next, to set the real flow and real pressure with the model, does a tool exist?

Thanks

Hello,
I am looking for a toolkit to calibrate. Any help please ?
Is there an algorithm ?
Thanks

Hello,

I am working with the Epanet Toolkit and the book “Libro-Iniciacion-Toolkit-de-Epanet-ingles” I am working with VBA and Excel. Everything works fine.

But I would like to know if there is a way to make a code to calibrate an Epanet model. I want to calibrate it with real data (a day of observation pressure and flow).

I would like to create a function to minimize the difference between the model and the real data.
Does a function exist?

Thank you
Bastien

Hi,
You can write a program with EPANET MATLAB Toolkit linked a optimization tools for calibration for your model.

Hello,
Thank for your message. I will try. Thanks
Have a good day

Hello,

I found a code in Internet, by Luis Sanchez, with Matlab : https://www.youtube.com/watch?v=FB34sha2KyQ But what is the function : funObjetivoRed(). How to create it on Matlab or VBA, …

global Q P 

% 1. Bibliotec epanet2.dll and epanet 2.h

wdsfile='chateaubourg.inp';
epanetloadfile(wdsfile);

% 2. Lecture of datas : tubes

Long=getdata('EN_LENGTH');
Diam=getdata('EN_DIAMETER');
RugInic=getdata('EN_ROUGHNESS');
Pinic=getdata('EN_PRESSURE');
Qinic=getdata('EN_NODECOUNT');
NumNod=getdata('EN_NODECOUNT');
NumTub=getdata('EN_LINKCOUNT');


% 3. Datas of calibration

CotasRug=[0.001*ones(9,1);0.05*ones(9,1)]; %valors of rug
NodPresionKwnown=[1,6]; % node with presion known
Pobs=[40.30,38.83]; % presion observed


% 4. Algorythm of optimization

[RugCalibrated, ValorFObj, CondSalida]=ga(@(rug) funObjetivoRed(rug,Diam,Long,vdsfile,NodPresionKwnown,Pobs),9,[],[],[],[],CotasRug(:,1),CotasRug(:,2));
ValorFObj, CondSalida
TablaRug=RugInic',RugCalibrated']
TablaP=[NodPresionKwnown',Pobs',P(NodPresionKwnown)']

And it doesn’t take into account the calibration of the valve, only rugosity.

Thanks
Bastien

function FObj=funObjetivoRed(rug,diam,Long,Letra,NodPresionConocidas,Pobs)
global Q P
% Esta es la función Objetivo.
% 1.- Asignación de los valores de rugosidad, diametro y Longitud.
%Rugosidad=rug*ones(1,9);
Rugosidad=rug;
Diametro=diam;
Longitud=Long;
% 2.- Uso de la función Calculo Hidraulico.
[P,Q]=funCalculoHidraulico(Rugosidad,Diametro,Longitud,Letra);
% 3.- Evaluación de la Funció Objetivo.
% Se comparan las presiones calculadas con las observadas en los nodos
% donde se conocen las presiones.
suma=0;
for j=1:length(NodPresionConocidas)
i=NodPresionConocidas(j);
suma=suma+(Pobs(j)-P(i))^2;
end;
FObj=sqrt(suma/length(NodPresionConocidas));

Hello,
Thank you for your answer and explication. It helps.
thank you
Bastien