Skip to content

Commit 043c1a4

Browse files
authored
Merge pull request #221 from OpenWaterAnalytics/master
update dev
2 parents 521c96c + f7bc19a commit 043c1a4

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

CITATION.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## If you use this software, please cite it as below.
2+
3+
D.G. Eliades, M. Kyriakou, S. Vrachimis and M.M. Polycarpou, "EPANET-MATLAB Toolkit: An Open-Source Software for Interfacing EPANET with MATLAB", in *Proc. 14th International Conference on Computing and Control for the Water Industry (CCWI)*, The Netherlands, Nov 2016, p.8. (doi:10.5281/zenodo.831493)
4+
5+
```
6+
@INPROCEEDINGS{Eliades2016,
7+
author={Eliades, Demetrios G. and Kyriakou, Marios and Vrachimis, Stelios and Polycarpou, Marios M.},
8+
title={EPANET-MATLAB Toolkit: An Open-Source Software for Interfacing EPANET with MATLAB},
9+
booktitle={Proc. 14th International Conference on Computing and Control for the Water Industry (CCWI)},
10+
year={2016},
11+
pages={8},
12+
address = {The Netherlands},
13+
month={Nov},
14+
DOI={10.5281/zenodo.831493}}
15+
```

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ The `EPANET-Matlab Toolkit` is based/inspired on the [EPANET-Matlab Toolkit](htt
212212
|getLinkVelocity|Current computed flow velocity (read only)|
213213
|getLinkVertices|Retrieves the coordinate's of a vertex point assigned to a link.|
214214
|getLinkVerticesCount|Retrieves the number of internal vertex points assigned to a link|
215+
|getLinkVolumes|Get link volumes|
215216
|getLinkWallReactionCoeff|Pipe wall chemical reaction coefficient|
216217
|getNodeActualDemand|Retrieves the computed value of all actual demands|
217218
|getNodeActualDemandSensingNodes|Retrieves the computed demand values at some sensing nodes|

epanet_matlab_toolkit/epanet.m

+14-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@
390390

391391
end
392392
properties (Constant = true)
393-
classversion='v2.2.2 - Last Update: 07/08/2022';
393+
classversion='v2.2.3 - Last Update: 19/09/2022';
394394

395395
LOGOP={'IF', 'AND', 'OR'} % Constants for rule-based controls: 'IF', 'AND', 'OR' % EPANET Version 2.2
396396
RULEOBJECT={'NODE', 'LINK', 'SYSTEM'}; % Constants for rule-based controls: 'NODE', 'LINK', 'SYSTEM' % EPANET Version 2.2
@@ -8603,6 +8603,7 @@ function setCurveValue(obj, index, curvePnt, value)
86038603
Fmean = mean(obj.getComputedTimeSeries.Flow,1); % ignores events also you can use getComputedHydraulicTimeSeries
86048604

86058605
Fsign = sign(Fmean);
8606+
A = zeros(obj.getNodeCount);
86068607
Nidx = obj.getLinkNodesIndex;
86078608
for i = 1:size(Nidx,1)
86088609
if Fsign(i) == 1
@@ -8612,6 +8613,18 @@ function setCurveValue(obj, index, curvePnt, value)
86128613
end
86138614
end
86148615
end
8616+
function V = getLinkVolumes(obj)
8617+
% Get link volumes
8618+
% Link volume = pi * (diameter/2).^2 * length
8619+
L = obg.getLinkLength;
8620+
D = obj.getLinkDiameter;
8621+
if obj.Units_SI_Metric
8622+
unt = 100;
8623+
else
8624+
unt = 328.08399;
8625+
end
8626+
V = pi*((D/unt).^2/4).*L;
8627+
end
86158628
function valueIndex = addCurve(obj, varargin)
86168629
% Adds a new curve appended to the end of the existing curves. (EPANET Version 2.1)
86178630
% Returns the new curve's index.

examples/gui/networkviewer.mlapp

27.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)