setQualityType problem

Hi
In MATLAB,before I write the command “d.setQualityType(‘Chlorine’)” , the whole nodes initial quality inputs were alright, but when I write the mentioned command and after getting outputs, the nodes initial quality inputs would be the other numbers which I could not recognize how they have changed!
Could you help me what should I do?
Thanks.

Hi @Pedramjazayeri,

Please, can you send me an example to reproduce the behavior?

I tried the following example and the data are the same before and after.

start_toolkit;
d = epanet(‘Net1.inp’);
d.getNodeInitialQuality
d.setQualityType(‘Chlorine’);
d.getNodeInitialQuality

Regards,
Marios

1 Like

Hi @Mariosmsk
Thank you for your attention
It is important to say that I create a new network with the excel input file instead of using an available net such as net1.
I do the same as you told me but the problem has been remaining and the Nodes Initial Quality have changed when I write:
d.setQualityType(‘Chlorine’);
Please tell me your email address that I send my code
Kind regards

Hi, my email mariosmsk@gmail.com

1 Like

Hi @Mariosmsk
I sent it.
Yours Truely

I haven’t received any mail.

Regards,
Marios

1 Like

@Mariosmsk, I sent it again
Please check it out.

Best wishes,
Pedram

Hi @Pedramjazayeri,

As I answered to email. The function setQualityType must be called before made changes.
// When changing from CHEM to AGE or TRACE, nodes initial quality
// values must be returned to their original ones

Regards,
Marios

1 Like

Hi dear @Mariosmsk
Again and again I appreciate and thank you for your kindly correct tips.
Now the changes are ok, but when I run the network in MATLAB, some results of the junctions quality node have a tiny difference with the results of the junctions quality nodes in EPANET. In addition, I use EPANET DDL Toolkit version 2.2. For example, in the last period (24:00 o’clock), the quality node values are such as below:
EPANET(node 22): 0.2639
MATLAB (node 22): 0.2715
.
EPANET(node 13): 0.3852
MATLAB(node 13): 0.3962
What should I do to correct these differences?

Best Regards,
Pedram

Hi @Pedramjazayeri,

You can call the follow line of code before d.unload: d.saveInputFile('new.inp')
Next, you can compare the original Net1.inp with your new.inp

Please update your code:

minimumWaterVolume = 0.0000001;
Tank_Index(i)=d.addNodeTank(tankID, tankCoords, elevation, initialLevel, minimumWaterLevel, …
maximumWaterLevel, diameter, minimumWaterVolume);

Thanks,
Marios

1 Like
1 Like

Dear @Mariosmsk
According to your useful tip, the new problem has solved(Example 1 of EPANET). Thanks a billion.
But I have the same problem in the example 2 of EPANET when I want to model the network with my input file. As you told me to put the minimumWaterVolume = 0.0000001; I did it,but the differences have increased (for example in nodes 10 and 18). I would be grateful if you check my new code(net2) which I sent to your gmail.

Regards,
Pedram

Hi @Pedramjazayeri,

Sorry, I was confused with min vol in the Net1 file where is zero.

Please use the following equation in both networks:

ADDED_TANKS.Minimum_Volume= (pi * (ADDED_TANKS.Tank_diameters(i)/2)^2) *ADDED_TANKS.MinimumWaterLevel(i);

thanks,
Marios

1 Like

Hi dear @Mariosmsk
That was very kind of you, according to your beneficial tips, the problem has solved again.
Thanks a billion
Regards,
Pedarm