diff --git a/CtrEditor.code-workspace b/CtrEditor.code-workspace
index 3a35c04..83d5852 100644
--- a/CtrEditor.code-workspace
+++ b/CtrEditor.code-workspace
@@ -11,9 +11,6 @@
},
{
"path": "C:/Users/migue/AppData/Local/Temp/TSNet"
- },
- {
- "path": "../../Github/TSNet"
}
],
"settings": {
diff --git a/HydraulicSimulator/TSNet/TSNetINPGenerator.cs b/HydraulicSimulator/TSNet/TSNetINPGenerator.cs
index a1fa615..db37549 100644
--- a/HydraulicSimulator/TSNet/TSNetINPGenerator.cs
+++ b/HydraulicSimulator/TSNet/TSNetINPGenerator.cs
@@ -126,26 +126,58 @@ namespace CtrEditor.HydraulicSimulator.TSNet
var elevation = GetNodeElevation(node);
var sanitizedName = SanitizeNodeName(node.Name);
- // Buscar el adapter correspondiente en el simulation manager
+ // Buscar el adapter correspondiente en el simulation manager usando el nombre original (sin sanitizar)
+ LogToMCP($"INPGenerator: Buscando adaptador para nodo '{node.Name}'");
var tankAdapter = _simulationManager?.GetTankAdapterByNodeName(node.Name);
+ // Debug logging para diagnóstico
+ if (_simulationManager != null)
+ {
+ LogToMCP($"INPGenerator: SimulationManager disponible, buscando adaptador...");
+ if (tankAdapter == null)
+ {
+ LogToMCP($"INPGenerator: No se encontró adaptador para '{node.Name}'");
+ // Listar adaptadores disponibles para diagnóstico
+ LogToMCP($"INPGenerator: Adaptadores disponibles:");
+ var availableAdapters = _simulationManager.GetType().GetField("_tankAdapters",
+ System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ if (availableAdapters?.GetValue(_simulationManager) is System.Collections.IDictionary adapters)
+ {
+ foreach (System.Collections.DictionaryEntry entry in adapters)
+ {
+ var adapter = entry.Value;
+ var tankName = adapter?.GetType().GetProperty("Tank")?.GetValue(adapter)?.GetType().GetProperty("Nombre")?.GetValue(adapter?.GetType().GetProperty("Tank")?.GetValue(adapter));
+ LogToMCP($" - '{tankName}' (ID: {entry.Key})");
+ }
+ }
+ }
+ else
+ {
+ LogToMCP($"INPGenerator: ✅ Adaptador encontrado para '{node.Name}'");
+ }
+ }
+ else
+ {
+ LogToMCP($"INPGenerator: ❌ SimulationManager es null");
+ }
+
if (tankAdapter?.Configuration != null)
{
// Usar configuración real del tanque
var config = tankAdapter.Configuration;
// Debug: Log de generación INP
- System.Diagnostics.Debug.WriteLine($"INPGenerator: Generando tanque {node.Name}");
- System.Diagnostics.Debug.WriteLine($" config.InitialLevelM: {config.InitialLevelM}");
- System.Diagnostics.Debug.WriteLine($" config.MaxLevelM: {config.MaxLevelM}");
- System.Diagnostics.Debug.WriteLine($" config.DiameterM: {config.DiameterM}");
+ LogToMCP($"INPGenerator: Generando tanque {node.Name}");
+ LogToMCP($" config.InitialLevelM: {config.InitialLevelM}");
+ LogToMCP($" config.MaxLevelM: {config.MaxLevelM}");
+ LogToMCP($" config.DiameterM: {config.DiameterM}");
content.AppendLine($" {sanitizedName,-15}\t{elevation.ToString("F2", CultureInfo.InvariantCulture)} \t{config.InitialLevelM.ToString("F2", CultureInfo.InvariantCulture)} \t{config.MinLevelM.ToString("F2", CultureInfo.InvariantCulture)} \t{config.MaxLevelM.ToString("F2", CultureInfo.InvariantCulture)} \t{config.DiameterM.ToString("F2", CultureInfo.InvariantCulture)} \t0 \t");
}
else
{
// Fallback a valores por defecto si no hay configuración
- System.Diagnostics.Debug.WriteLine($"INPGenerator: WARNING - No se encontró configuración para tanque {node.Name}, usando valores por defecto");
+ LogToMCP($"INPGenerator: WARNING - No se encontró configuración para tanque {node.Name}, usando valores por defecto");
content.AppendLine($" {sanitizedName,-15}\t{elevation.ToString("F2", CultureInfo.InvariantCulture)} \t1.0 \t0.0 \t2.0 \t1.0 \t0 \t");
}
}
@@ -415,6 +447,15 @@ namespace CtrEditor.HydraulicSimulator.TSNet
return string.IsNullOrEmpty(result) ? "UnknownNode" : result;
}
+ ///
+ /// Método de logging simple para debug - usa Console.WriteLine por ahora
+ ///
+ private static void LogToMCP(string message)
+ {
+ // Usar Console.WriteLine para debug que es capturado por el sistema de logging
+ Console.WriteLine($"[DEBUG TSNetINPGenerator] {message}");
+ }
+
#endregion
}
}
diff --git a/Python/tsnet/__init__.py b/Python/tsnet/__init__.py
new file mode 100644
index 0000000..caf3c8e
--- /dev/null
+++ b/Python/tsnet/__init__.py
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+
+"""Top-level package for tsnet."""
+
+from tsnet import network
+from tsnet import simulation
+from tsnet import postprocessing
+from tsnet import utils
+
+__author__ = """Lu Xing"""
+__email__ = 'xinglu@utexas.edu'
+__version__ = '0.2.2'
diff --git a/Python/tsnet/docs/.DS_Store b/Python/tsnet/docs/.DS_Store
new file mode 100644
index 0000000..74b7907
Binary files /dev/null and b/Python/tsnet/docs/.DS_Store differ
diff --git a/Python/tsnet/docs/Makefile b/Python/tsnet/docs/Makefile
new file mode 100644
index 0000000..fb1e0e2
--- /dev/null
+++ b/Python/tsnet/docs/Makefile
@@ -0,0 +1,163 @@
+# Minimal makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = python -msphinx
+SPHINXPROJ = tsnet
+SOURCEDIR = .
+BUILDDIR = _build
+
+# Put it first so that "make" without argument is like "make help".
+help:
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+.PHONY: help Makefile
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+clean:
+ rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/WNTR.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/WNTR.qhc"
+
+applehelp:
+ $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
+ @echo
+ @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
+ @echo "N.B. You won't be able to view it unless you put it in" \
+ "~/Library/Documentation/Help or install it in your application" \
+ "bundle."
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/WNTR"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/WNTR"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+latexpdfja:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through platex and dvipdfmx..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
+
+coverage:
+ $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
+ @echo "Testing of coverage in the sources finished, look at the " \
+ "results in $(BUILDDIR)/coverage/python.txt."
+
+xml:
+ $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
+ @echo
+ @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+
+pseudoxml:
+ $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
+ @echo
+ @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
diff --git a/Python/tsnet/docs/_templates/layout.html b/Python/tsnet/docs/_templates/layout.html
new file mode 100644
index 0000000..03baf94
--- /dev/null
+++ b/Python/tsnet/docs/_templates/layout.html
@@ -0,0 +1,10 @@
+{% extends "!layout.html" %}
+ {% block footer %} {{ super() }}
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/Python/tsnet/docs/abbrev.rst b/Python/tsnet/docs/abbrev.rst
new file mode 100644
index 0000000..55e8a79
--- /dev/null
+++ b/Python/tsnet/docs/abbrev.rst
@@ -0,0 +1,18 @@
+====================
+Abbreviations
+====================
+
+
+**API**: Application programming interface
+
+**EPA**: Environmental Protection Agency
+
+**IDE**: Integrated development environment
+
+**SI**: International System of Units
+
+**US**: United States
+
+**MOC**: Method of Characteristics
+
+**TSNET**: Transient Simulation in water Networks
diff --git a/Python/tsnet/docs/apidocs/modules.rst b/Python/tsnet/docs/apidocs/modules.rst
new file mode 100644
index 0000000..1b9817f
--- /dev/null
+++ b/Python/tsnet/docs/apidocs/modules.rst
@@ -0,0 +1,7 @@
+tsnet
+=====
+
+.. toctree::
+ :maxdepth: 4
+
+ tsnet
diff --git a/Python/tsnet/docs/apidocs/tsnet.network.rst b/Python/tsnet/docs/apidocs/tsnet.network.rst
new file mode 100644
index 0000000..60db880
--- /dev/null
+++ b/Python/tsnet/docs/apidocs/tsnet.network.rst
@@ -0,0 +1,46 @@
+tsnet.network package
+=====================
+
+Submodules
+----------
+
+tsnet.network.control module
+----------------------------
+
+.. automodule:: tsnet.network.control
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+tsnet.network.discretize module
+-------------------------------
+
+.. automodule:: tsnet.network.discretize
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+tsnet.network.model module
+--------------------------
+
+.. automodule:: tsnet.network.model
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+tsnet.network.topology module
+-----------------------------
+
+.. automodule:: tsnet.network.topology
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+
+Module contents
+---------------
+
+.. automodule:: tsnet.network
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/Python/tsnet/docs/apidocs/tsnet.postprocessing.rst b/Python/tsnet/docs/apidocs/tsnet.postprocessing.rst
new file mode 100644
index 0000000..cf0e849
--- /dev/null
+++ b/Python/tsnet/docs/apidocs/tsnet.postprocessing.rst
@@ -0,0 +1,22 @@
+tsnet.postprocessing package
+============================
+
+Submodules
+----------
+
+tsnet.postprocessing.time\_history module
+-----------------------------------------
+
+.. automodule:: tsnet.postprocessing.time_history
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+
+Module contents
+---------------
+
+.. automodule:: tsnet.postprocessing
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/Python/tsnet/docs/apidocs/tsnet.rst b/Python/tsnet/docs/apidocs/tsnet.rst
new file mode 100644
index 0000000..88cd6b9
--- /dev/null
+++ b/Python/tsnet/docs/apidocs/tsnet.rst
@@ -0,0 +1,20 @@
+tsnet package
+=============
+
+Subpackages
+-----------
+
+.. toctree::
+
+ tsnet.network
+ tsnet.postprocessing
+ tsnet.simulation
+ tsnet.utils
+
+Module contents
+---------------
+
+.. automodule:: tsnet
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/Python/tsnet/docs/apidocs/tsnet.simulation.rst b/Python/tsnet/docs/apidocs/tsnet.simulation.rst
new file mode 100644
index 0000000..485342c
--- /dev/null
+++ b/Python/tsnet/docs/apidocs/tsnet.simulation.rst
@@ -0,0 +1,46 @@
+tsnet.simulation package
+========================
+
+Submodules
+----------
+
+tsnet.simulation.initialize module
+----------------------------------
+
+.. automodule:: tsnet.simulation.initialize
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+tsnet.simulation.main module
+----------------------------
+
+.. automodule:: tsnet.simulation.main
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+tsnet.simulation.single module
+------------------------------
+
+.. automodule:: tsnet.simulation.single
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+tsnet.simulation.solver module
+------------------------------
+
+.. automodule:: tsnet.simulation.solver
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+
+Module contents
+---------------
+
+.. automodule:: tsnet.simulation
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/Python/tsnet/docs/apidocs/tsnet.utils.rst b/Python/tsnet/docs/apidocs/tsnet.utils.rst
new file mode 100644
index 0000000..c1929cb
--- /dev/null
+++ b/Python/tsnet/docs/apidocs/tsnet.utils.rst
@@ -0,0 +1,46 @@
+tsnet.utils package
+===================
+
+Submodules
+----------
+
+tsnet.utils.calc\_parabola\_vertex module
+-----------------------------------------
+
+.. automodule:: tsnet.utils.calc_parabola_vertex
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+tsnet.utils.memo module
+-----------------------
+
+.. automodule:: tsnet.utils.memo
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+tsnet.utils.print\_time\_delta module
+-------------------------------------
+
+.. automodule:: tsnet.utils.print_time_delta
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+tsnet.utils.valve\_curve module
+-------------------------------
+
+.. automodule:: tsnet.utils.valve_curve
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+
+Module contents
+---------------
+
+.. automodule:: tsnet.utils
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/Python/tsnet/docs/authors.rst b/Python/tsnet/docs/authors.rst
new file mode 100644
index 0000000..e122f91
--- /dev/null
+++ b/Python/tsnet/docs/authors.rst
@@ -0,0 +1 @@
+.. include:: ../AUTHORS.rst
diff --git a/Python/tsnet/docs/conf.py b/Python/tsnet/docs/conf.py
new file mode 100644
index 0000000..2bf52a8
--- /dev/null
+++ b/Python/tsnet/docs/conf.py
@@ -0,0 +1,209 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# tsnet documentation build configuration file, created by
+# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+# If extensions (or modules to document with autodoc) are in another
+# directory, add these directories to sys.path here. If the directory is
+# relative to the documentation root, use os.path.abspath to make it
+# absolute, like shown here.
+#
+import os
+import sys
+sys.path.insert(0, os.path.abspath('../'))
+import tsnet
+import shlex
+import sphinx_rtd_theme
+# -- General configuration ---------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#
+# needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = [
+ 'sphinx.ext.autodoc',
+ 'sphinx.ext.doctest',
+ 'sphinx.ext.todo',
+ 'sphinx.ext.coverage',
+ 'sphinx.ext.viewcode',
+ 'sphinx.ext.napoleon',
+ 'sphinx.ext.autosummary',
+ 'sphinx.ext.mathjax',
+ 'sphinx.ext.githubpages',
+ "sphinx_rtd_theme",
+ 'sphinx.ext.intersphinx'
+ ]
+
+# Napoleon settings
+napoleon_google_docstring = True
+napoleon_numpy_docstring = True
+napoleon_include_init_with_doc = False
+napoleon_include_private_with_doc = False
+napoleon_include_special_with_doc = True
+napoleon_use_admonition_for_examples = False
+napoleon_use_admonition_for_notes = False
+napoleon_use_admonition_for_references = False
+napoleon_use_ivar = False
+napoleon_use_param = True
+napoleon_use_rtype = True
+
+viewcode_import = True
+autodoc_member_order = 'bysource'
+autoclass_content = 'both'
+numfig=True
+numfig_format = {'figure': 'Figure %s', 'table': 'Table %s', 'code-block': 'Listing %s'}
+
+math_numfig = True
+math_eqref_format = "Eq.{number}"
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# autosummary
+import glob
+autosummary_generate = glob.glob("apidocs/*.rst")
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+#
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'content'
+
+# General information about the project.
+project = u'TSNet'
+copyright = u"2019, Lu Xing"
+author = u"Lu Xing, Lina Sela"
+
+# The version info for the project you're documenting, acts as replacement
+# for |version| and |release|, also used in various other places throughout
+# the built documents.
+#
+# The short X.Y version.
+version = tsnet.__version__
+# The full version, including alpha/beta/rc tags.
+release = tsnet.__version__
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This patterns also effect to html_static_path and html_extra_path
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = True
+
+
+# -- Options for HTML output -------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+#
+# html_theme = 'classic'
+
+html_theme = "sphinx_rtd_theme"
+
+# html_theme = 'bootstrap'
+# html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
+
+# Theme options are theme-specific and customize the look and feel of a
+# theme further. For a list of options available for each theme, see the
+# documentation.
+#
+html_theme_options = {'body_max_width':'100%' }
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+html_show_sphinx = False
+
+
+# -- Options for HTMLHelp output ---------------------------------------
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'tsnetdoc'
+
+
+# -- Options for LaTeX output ------------------------------------------
+
+latex_elements = {
+ # The paper size ('letterpaper' or 'a4paper').
+ #
+ # 'papersize': 'letterpaper',
+
+ # The font size ('10pt', '11pt' or '12pt').
+ #
+ # 'pointsize': '10pt',
+
+ # Additional stuff for the LaTeX preamble.
+ #
+ # 'preamble': '',
+
+ # Latex figure (float) alignment
+ #
+ # 'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass
+# [howto, manual, or own class]).
+latex_documents = [
+ (master_doc, 'TSNet.tex',
+ u'TSNet Documentation',
+ u"Lu Xing, Lina Sela", 'manual'),
+]
+
+# latex_logo = 'logo.png'
+
+# -- Options for manual page output ------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ (master_doc, 'TSNet',
+ u'TSNet Documentation',
+ [author], 1)
+]
+
+
+# -- Options for Texinfo output ----------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ (master_doc, 'TSNet',
+ u'TSNet Documentation',
+ author,
+ 'TSNet',
+ 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+
+
diff --git a/Python/tsnet/docs/content.rst b/Python/tsnet/docs/content.rst
new file mode 100644
index 0000000..3f69ffe
--- /dev/null
+++ b/Python/tsnet/docs/content.rst
@@ -0,0 +1,27 @@
+Welcome to TSNet's documentation!
+======================================
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Contents:
+
+ readme
+ installation
+ limitations
+ usage
+ transient
+ results
+ examples
+ validation
+ contributing
+ authors
+ history
+ API documentation
+ abbrev
+ reference
+
+Indices and tables
+==================
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
\ No newline at end of file
diff --git a/Python/tsnet/docs/contributing.rst b/Python/tsnet/docs/contributing.rst
new file mode 100644
index 0000000..e582053
--- /dev/null
+++ b/Python/tsnet/docs/contributing.rst
@@ -0,0 +1 @@
+.. include:: ../CONTRIBUTING.rst
diff --git a/Python/tsnet/docs/environment.yml b/Python/tsnet/docs/environment.yml
new file mode 100644
index 0000000..efea6e4
--- /dev/null
+++ b/Python/tsnet/docs/environment.yml
@@ -0,0 +1,16 @@
+
+name: tsnet
+channels:
+ - defaults
+ - conda-forge
+dependencies:
+ - python=3.6
+ - numpy
+ - scipy
+ - networkx
+ - pandas
+ - matplotlib
+ - plotly
+ - folium
+ - utm
+ - sphinx
\ No newline at end of file
diff --git a/Python/tsnet/docs/examples.rst b/Python/tsnet/docs/examples.rst
new file mode 100644
index 0000000..e4dcff6
--- /dev/null
+++ b/Python/tsnet/docs/examples.rst
@@ -0,0 +1,317 @@
+====================
+Example Applications
+====================
+
+Example 1 - End-valve closure
+-----------------------------
+
+This example shows how to simulate the closure of a
+valve located at the boundary of a network. The first example
+network is shown below in :numref:`tnet1`, adopted from [[STWY67],WOLB05]_.
+It comprises 9 pipes, 8 junctions, one reservoir, 3 closed loops,
+and one valve located at the downstream end of the system.
+There are five steps that the user needs to take to run the
+transient simulation using the TSNet package:
+
+.. _tnet1:
+.. figure:: figures/Tnet1.PNG
+ :scale: 100 %
+ :alt: tnet1
+
+ Tnet1 network graphics
+
+1. Import TSNet package, read the EPANET INP file,
+ and create transient model object.
+
+.. literalinclude:: ../examples/Tnet1_valve_closure.py
+ :lines: 1-4
+
+2. Set the wave speed for all pipes to :math:`1200m/s`,
+ time step to :math:`0.1s`, and simulation period
+ to :math:`60s`.
+
+.. literalinclude:: ../examples/Tnet1_valve_closure.py
+ :lines: 6-11
+
+3. Set valve operating rules, including how long it takes
+ to close the valve (:math:`tc`), when to start close the
+ valve (:math:`ts`), the opening percentage when the closure
+ is completed (:math:`se`), and the shape of the closure
+ operating curve (:math:`m`, :math:`1` stands for linear closure,
+ :math:`2` stands for quadratic closure).
+
+.. literalinclude:: ../examples/Tnet1_valve_closure.py
+ :lines: 13-19
+
+4. Compute steady state results to establish the initial
+ condition for transient simulation.
+
+.. literalinclude:: ../examples/Tnet1_valve_closure.py
+ :lines: 21-24
+
+5. Run transient simulation and specify the name of the results file.
+
+.. literalinclude:: ../examples/Tnet1_valve_closure.py
+ :lines: 26-28
+
+After the transient simulation, the results at nodes and links
+will be returned and stored in the transient model (tm) instance.
+The time history of flow rate on the start node of pipe P2
+throughout the simulation can be retrieved by:
+
+>>> print(tm.links['P2'].start_node_flowrate)
+
+To plot the head results at N3:
+
+.. literalinclude:: ../examples/Tnet1_valve_closure.py
+ :lines: 31-42
+
+yields :numref:`tnet1_node`:
+
+.. _tnet1_node:
+.. figure:: figures/tnet1_node.png
+ :width: 600
+ :alt: tnet1_node
+
+ Tnet1 - Head at node N3.
+
+Similarly, to plot the flow rate results in pipe P2:
+
+.. literalinclude:: ../examples/Tnet1_valve_closure.py
+ :lines: 45-58
+
+yields :numref:`tnet1_pipe`:
+
+.. _tnet1_pipe:
+.. figure:: figures/tnet1_pipe.png
+ :width: 600
+ :alt: tnet1_pipe
+
+ Tnet1 - Flow rate at the start and end node of pipe P2.
+
+
+
+Example 2 - Pump operations
+---------------------------
+
+This example illustrates how the package models
+a transient event resulting from a controlled pump shut-off
+, i.e., the pump speed is ramped down. This example
+network, Tnet2, is shown below in :numref:`tnet2`. Tnet2 comprises 113 pipes,
+91 junctions, 2 pumps, 2 reservoir, 3 tanks, and one valve located in the
+middle of the network.
+A transient simulation of 50 seconds is generated by shutting off PUMP2.
+There are five steps user needs to take:
+
+.. _tnet2:
+.. figure:: figures/Tnet2.PNG
+ :width: 600
+ :alt: tnet2
+
+ Tnet2 network graphics
+
+1. Import TSNet package, read the EPANET INP file,
+ and create transient model object.
+
+.. literalinclude:: ../examples/Tnet2_pump_shutdown.py
+ :lines: 1-4
+
+2. Set the wave speed for all pipes to be :math:`1200m/s` and
+ simulation period to be :math:`50s`. Use suggested time
+ step.
+
+.. literalinclude:: ../examples/Tnet2_pump_shutdown.py
+ :lines: 6-10
+
+3. Set pump operating rules, including how long it takes
+ to shutdown the pump (:math:`tc`), when to the shut-off starts
+ (:math:`ts`), the pump speed multiplier value when the shut-off
+ is completed (:math:`se`), and the shape of the shut-off
+ operation curve (:math:`m`, :math:`1` stands for linear closure,
+ :math:`2` stands for quadratic closure).
+
+.. literalinclude:: ../examples/Tnet2_pump_shutdown.py
+ :lines: 12-18
+
+4. Compute steady state results to establish the initial
+ condition for transient simulation.
+
+.. literalinclude:: ../examples/Tnet2_pump_shutdown.py
+ :lines: 20-23
+
+5. Run transient simulation and specify the name of the results file.
+
+.. literalinclude:: ../examples/Tnet2_pump_shutdown.py
+ :lines: 25-27
+
+
+After the transient simulation, the results at nodes and links
+will be returned to the transient model (tm) instance, which is then
+stored in **Tnet2.obj**.
+The actual demand discharge at JUNCTION-105 throughout the simulation
+can be retrieved by:
+
+>>> print(tm.nodes['JUNCTION-105'].demand_discharge)
+
+To plot the head results at JUNCTION-105:
+
+.. literalinclude:: ../examples/Tnet2_pump_shutdown.py
+ :lines: 30-41
+
+yields :numref:`tnet2_node`:
+
+.. _tnet2_node:
+.. figure:: figures/tnet2_node.png
+ :width: 600
+ :alt: tnet2_node
+
+ Tnet2 - Head at node JUNCTION-105.
+
+Similarly, to plot the velocity results in PIPE-109:
+
+.. literalinclude:: ../examples/Tnet2_pump_shutdown.py
+ :lines: 44-55
+
+yields :numref:`tnet2_pipe`:
+
+.. _tnet2_pipe:
+.. figure:: figures/tnet2_pipe.png
+ :width: 600
+ :alt: tnet2_pipe
+
+ Tnet2 - Velocity at the start and end node of PIPE-109.
+
+
+Example 3 - Burst and leak
+---------------------------
+
+This example reveals how TSNet simulates pipe bursts and leaks.
+This example network, adapted from [OSBH08]_, is shown below in :numref:`tnet3`.
+Tnet3 comprises 168 pipes, 126 junctions, 8 valve, 2 pumps,
+one reservoir, and two tanks.
+The transient event is generated by a burst and a background leak.
+There are five steps that the user would need to take:
+
+.. _tnet3:
+.. figure:: figures/Tnet3.PNG
+ :width: 600
+ :alt: tnet3
+
+ Tnet3 network graphics
+
+
+1. Import TSNet package, read the EPANET INP file,
+ and create transient model object.
+
+.. literalinclude:: ../examples/Tnet3_burst_leak.py
+ :lines: 1-4
+
+2. The user can import custom wave speeds for each pipe.
+ To demonstrate how to assign different wave speed,
+ we assume that the wave speed for the pipes is normally distributed
+ with mean of :math:`1200 m/s` and standard deviation of
+ :math: `100m/s`. Then, assign the randomly generated wave speed
+ to each pipe in the network according to the order the pipes
+ defined in the INP file. Subsequently, set the simulation period
+ as :math:`20s`, and use suggested time step.
+
+.. literalinclude:: ../examples/Tnet3_burst_leak.py
+ :lines: 6-12
+
+3. Define background leak location, JUNCTION-22,
+ and specify the emitter coefficient.
+ The leak will be included in the initial condition calculation.
+ See WNTR documentation [WNTRSi]_ for more info about leak simulation.
+
+.. literalinclude:: ../examples/Tnet3_burst_leak.py
+ :lines: 14-16
+
+4. Compute steady state results to establish the initial
+ condition for transient simulation.
+
+.. literalinclude:: ../examples/Tnet3_burst_leak.py
+ :lines: 24-27
+
+5. Set up burst event, including burst location, JUNCTION-20,
+ burst start time (:math:`ts`),
+ time for burst to fully develop (:math:`tc`), and the final emitter
+ coefficient (final_burst_coeff).
+
+.. literalinclude:: ../examples/Tnet3_burst_leak.py
+ :lines: 18-22
+
+6. Run transient simulation and specify the name of the results file.
+
+.. literalinclude:: ../examples/Tnet3_burst_leak.py
+ :lines: 29-31
+
+After the transient simulation, the results at nodes and links
+will be returned to the transient model (tm) instance,
+which is subsequently stored in **Tnet3.obj**.
+
+
+To understand how much water has been lost through the leakage
+at JUNCTION-22, we can plot the leak discharge results at JUNCTION-22:
+
+.. literalinclude:: ../examples/Tnet3_burst_leak.py
+ :lines: 34-45
+
+yields :numref:`tnet3_leak`:
+
+
+.. _tnet3_leak:
+.. figure:: figures/tnet3_leak.png
+ :width: 600
+ :alt: tnet3_leak
+
+ Tnet3 - Leak discharge at node JUNCTION-22.
+
+Similarly, to reveal how much water has been wasted through the burst event
+at JUNCTION-20, we can plot the burst discharge results at JUNCTION-20:
+
+.. literalinclude:: ../examples/Tnet3_burst_leak.py
+ :lines: 48-58
+
+yields :numref:`tnet3_burst`:
+
+.. _tnet3_burst:
+.. figure:: figures/tnet3_burst.png
+ :width: 600
+ :alt: tnet3_burst
+
+ Tnet3 - Burst discharge at node JUNCTION-20.
+
+Additionally, to plot the velocity results in LINK-40:
+
+.. literalinclude:: ../examples/Tnet3_burst_leak.py
+ :lines: 61-72
+
+yields :numref:`tnet3_pipe`:
+
+.. _tnet3_pipe:
+.. figure:: figures/tnet3_pipe.png
+ :width: 600
+ :alt: tnet3_pipe
+
+ Tnet3 - Velocity at the start and end node of LINK-40.
+
+Moreover, we can plot head results at some further nodes, such as
+JUNCTION-8, JUNCTION-16, JUNCTION-45, JUNCTION-90, by:
+
+.. literalinclude:: ../examples/Tnet3_burst_leak.py
+ :lines: 75-90
+
+The results are demonstrated in :numref:`tnet3_multi`. It can be noticed that
+the amplitude of the pressure transient at JUNCTION-8 and JUNCTION-16
+is greater than that at other two junctions which are further away from
+JUNCTION-20, where the burst occurred.
+
+.. _tnet3_multi:
+.. figure:: figures/tnet3_multi.png
+ :width: 600
+ :alt: tnet3_multi
+
+ Tnet3 - Head at multiple junctions.
+
+
+More examples are includeded in https://github.com/glorialulu/TSNet/tree/master/examples.
diff --git a/Python/tsnet/docs/figures/DemandMultiplier.png b/Python/tsnet/docs/figures/DemandMultiplier.png
new file mode 100644
index 0000000..b2549ba
Binary files /dev/null and b/Python/tsnet/docs/figures/DemandMultiplier.png differ
diff --git a/Python/tsnet/docs/figures/MOC_grid.png b/Python/tsnet/docs/figures/MOC_grid.png
new file mode 100644
index 0000000..458de8d
Binary files /dev/null and b/Python/tsnet/docs/figures/MOC_grid.png differ
diff --git a/Python/tsnet/docs/figures/MOC_grid_device.png b/Python/tsnet/docs/figures/MOC_grid_device.png
new file mode 100644
index 0000000..6dbe603
Binary files /dev/null and b/Python/tsnet/docs/figures/MOC_grid_device.png differ
diff --git a/Python/tsnet/docs/figures/MOC_grid_net.png b/Python/tsnet/docs/figures/MOC_grid_net.png
new file mode 100644
index 0000000..fe4c0cb
Binary files /dev/null and b/Python/tsnet/docs/figures/MOC_grid_net.png differ
diff --git a/Python/tsnet/docs/figures/MOC_grid_unsteady.png b/Python/tsnet/docs/figures/MOC_grid_unsteady.png
new file mode 100644
index 0000000..cddbb54
Binary files /dev/null and b/Python/tsnet/docs/figures/MOC_grid_unsteady.png differ
diff --git a/Python/tsnet/docs/figures/MOC_time_example.png b/Python/tsnet/docs/figures/MOC_time_example.png
new file mode 100644
index 0000000..da9ab01
Binary files /dev/null and b/Python/tsnet/docs/figures/MOC_time_example.png differ
diff --git a/Python/tsnet/docs/figures/Tnet1.PNG b/Python/tsnet/docs/figures/Tnet1.PNG
new file mode 100644
index 0000000..61e93cf
Binary files /dev/null and b/Python/tsnet/docs/figures/Tnet1.PNG differ
diff --git a/Python/tsnet/docs/figures/Tnet2.PNG b/Python/tsnet/docs/figures/Tnet2.PNG
new file mode 100644
index 0000000..f41929d
Binary files /dev/null and b/Python/tsnet/docs/figures/Tnet2.PNG differ
diff --git a/Python/tsnet/docs/figures/Tnet3.PNG b/Python/tsnet/docs/figures/Tnet3.PNG
new file mode 100644
index 0000000..6a1a43c
Binary files /dev/null and b/Python/tsnet/docs/figures/Tnet3.PNG differ
diff --git a/Python/tsnet/docs/figures/chart.png b/Python/tsnet/docs/figures/chart.png
new file mode 100644
index 0000000..0e5d90f
Binary files /dev/null and b/Python/tsnet/docs/figures/chart.png differ
diff --git a/Python/tsnet/docs/figures/highlight.pdf b/Python/tsnet/docs/figures/highlight.pdf
new file mode 100644
index 0000000..debb263
Binary files /dev/null and b/Python/tsnet/docs/figures/highlight.pdf differ
diff --git a/Python/tsnet/docs/figures/highlight.png b/Python/tsnet/docs/figures/highlight.png
new file mode 100644
index 0000000..cca11b8
Binary files /dev/null and b/Python/tsnet/docs/figures/highlight.png differ
diff --git a/Python/tsnet/docs/figures/operate.py b/Python/tsnet/docs/figures/operate.py
new file mode 100644
index 0000000..7fa69a6
--- /dev/null
+++ b/Python/tsnet/docs/figures/operate.py
@@ -0,0 +1,139 @@
+import numpy as np
+import matplotlib.pyplot as plt
+def valveclosing(dt, tf, valve_op):
+ """Define valve operation curve (percentage open v.s. time)
+
+ Parameters
+ ----------
+ dt : float
+ Time step
+ tf : float
+ Simulation Time
+ valve_op : list
+ Contains parameters to define valve operation rule
+ valve_op = [tc,ts,se,m]
+ tc : the duration takes to close the valve [s]
+ ts : closure start time [s]
+ se : final open percentage [s]
+ m : closure constant [unitless]
+
+ Returns
+ -------
+ s : list
+ valve operation curve
+ """
+
+ [tc,ts,se,m] = valve_op
+ tn = int(tf/dt)
+ # abrupt closure
+ if tc ==0:
+ s = np.array([(1- (i*dt- ts))**1 for i in range(tn)])
+ s[s>1] = 1
+ s[s<1] = se
+ # gradual closure
+ else:
+ t = np.array([(i*dt- ts)/tc for i in range(tn)])
+ t[t>1] = 1
+ t[t<0] = 0
+ s = np.array([1 - (1-se)*t[i]**m for i in range(tn)])
+ s[s>1] = 1
+ s[s0] = se
+ s[s<0] = 0
+ # gradual opening
+ else:
+ t = np.array([(i*dt- ts)/tc for i in range(tn)])
+ t[t>1] = 1
+ t[t<0] = 0
+ s = np.array([se* (t[i])**m for i in range(tn)])
+ s[s<0] = 0
+ s[s>se] = se
+ return s
+
+dt = 0.1
+tf = 2
+t = np.arange(0, tf, dt)
+
+tc = 1 # pump closure period
+ts = 0 # pump closure start time
+se = 0 # end open percentage
+
+m = 1 # closure constant
+valve_op = [tc,ts,se,m]
+s1 = valveclosing(dt, tf, valve_op)
+
+m = 2 # closure constant
+valve_op = [tc,ts,se,m]
+s2 = valveclosing(dt, tf, valve_op)
+
+tc = 1 # pump closure period
+ts = 0 # pump closure start time
+se = 1 # end open percentage
+
+m = 1 # closure constant
+valve_op = [tc,ts,se,m]
+s3 = valveopening(dt, tf, valve_op)
+
+m = 2 # closure constant
+valve_op = [tc,ts,se,m]
+s4 = valveopening(dt, tf, valve_op)
+
+import matplotlib
+matplotlib.rcParams['pdf.fonttype'] = 42
+fig = plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='k')
+plt.subplot(1, 2, 1)
+plt.plot(t,s1,'k-', label='m=1')
+plt.plot(t,s2,'r-', label='m=2')
+plt.xlim([t[0],t[-1]])
+plt.title('(a)')
+plt.xticks([0,1,t[-1]],['ts','ts + tc','tf'])
+plt.yticks([0,0.2,0.4,0.6,0.8,1.0],['se','0.2','0.4','0.6','0.8','1.0'])
+plt.xlabel("Time [s]")
+plt.ylabel("Valve opening ratio")
+plt.legend(loc='best')
+plt.grid(True)
+
+plt.subplot(1, 2, 2)
+plt.plot(t,s3,'k-', label='m=1')
+plt.plot(t,s4,'r-', label='m=2')
+plt.xlim([t[0],t[-1]])
+plt.title('(b)')
+plt.xticks([0,1,t[-1]],['ts','ts + tc','tf'])
+plt.yticks([0,0.2,0.4,0.6,0.8,1.0],['0','0.2','0.4','0.6','0.8','se'])
+plt.xlabel("Time [s]")
+plt.legend(loc='best')
+plt.grid(True)
+
+fig.savefig('./docs/figures/valve_operating.pdf', format='pdf',dpi=500)
diff --git a/Python/tsnet/docs/figures/time.PNG b/Python/tsnet/docs/figures/time.PNG
new file mode 100644
index 0000000..a0f6e3b
Binary files /dev/null and b/Python/tsnet/docs/figures/time.PNG differ
diff --git a/Python/tsnet/docs/figures/tnet0_calibration.png b/Python/tsnet/docs/figures/tnet0_calibration.png
new file mode 100644
index 0000000..228479b
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet0_calibration.png differ
diff --git a/Python/tsnet/docs/figures/tnet0_network.png b/Python/tsnet/docs/figures/tnet0_network.png
new file mode 100644
index 0000000..ab3e9df
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet0_network.png differ
diff --git a/Python/tsnet/docs/figures/tnet1_leak.png b/Python/tsnet/docs/figures/tnet1_leak.png
new file mode 100644
index 0000000..8b70543
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet1_leak.png differ
diff --git a/Python/tsnet/docs/figures/tnet1_node.png b/Python/tsnet/docs/figures/tnet1_node.png
new file mode 100644
index 0000000..1b4e5bc
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet1_node.png differ
diff --git a/Python/tsnet/docs/figures/tnet1_pipe.png b/Python/tsnet/docs/figures/tnet1_pipe.png
new file mode 100644
index 0000000..a2d3202
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet1_pipe.png differ
diff --git a/Python/tsnet/docs/figures/tnet2_node.png b/Python/tsnet/docs/figures/tnet2_node.png
new file mode 100644
index 0000000..4b1688d
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet2_node.png differ
diff --git a/Python/tsnet/docs/figures/tnet2_pipe.png b/Python/tsnet/docs/figures/tnet2_pipe.png
new file mode 100644
index 0000000..c8cd21e
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet2_pipe.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_burst.png b/Python/tsnet/docs/figures/tnet3_burst.png
new file mode 100644
index 0000000..1dc160e
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_burst.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_burst_hammer.png b/Python/tsnet/docs/figures/tnet3_burst_hammer.png
new file mode 100644
index 0000000..b5e9986
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_burst_hammer.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_compare_surge_tank.png b/Python/tsnet/docs/figures/tnet3_compare_surge_tank.png
new file mode 100644
index 0000000..be98ba1
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_compare_surge_tank.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_leak.png b/Python/tsnet/docs/figures/tnet3_leak.png
new file mode 100644
index 0000000..d1940ec
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_leak.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_multi.png b/Python/tsnet/docs/figures/tnet3_multi.png
new file mode 100644
index 0000000..d52dbab
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_multi.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_node.png b/Python/tsnet/docs/figures/tnet3_node.png
new file mode 100644
index 0000000..143b87d
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_node.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_pipe.png b/Python/tsnet/docs/figures/tnet3_pipe.png
new file mode 100644
index 0000000..d2db878
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_pipe.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_pump_hammer_002.png b/Python/tsnet/docs/figures/tnet3_pump_hammer_002.png
new file mode 100644
index 0000000..a4d59d2
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_pump_hammer_002.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_pump_timestep_hammer&tesnet.png b/Python/tsnet/docs/figures/tnet3_pump_timestep_hammer&tesnet.png
new file mode 100644
index 0000000..fa8193f
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_pump_timestep_hammer&tesnet.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_unsteady_friction.png b/Python/tsnet/docs/figures/tnet3_unsteady_friction.png
new file mode 100644
index 0000000..ba4fef7
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_unsteady_friction.png differ
diff --git a/Python/tsnet/docs/figures/tnet3_valve_hammer.png b/Python/tsnet/docs/figures/tnet3_valve_hammer.png
new file mode 100644
index 0000000..b449473
Binary files /dev/null and b/Python/tsnet/docs/figures/tnet3_valve_hammer.png differ
diff --git a/Python/tsnet/docs/figures/valve_closure.png b/Python/tsnet/docs/figures/valve_closure.png
new file mode 100644
index 0000000..431da5b
Binary files /dev/null and b/Python/tsnet/docs/figures/valve_closure.png differ
diff --git a/Python/tsnet/docs/figures/valve_opening.png b/Python/tsnet/docs/figures/valve_opening.png
new file mode 100644
index 0000000..210c2a7
Binary files /dev/null and b/Python/tsnet/docs/figures/valve_opening.png differ
diff --git a/Python/tsnet/docs/figures/wavespeed.png b/Python/tsnet/docs/figures/wavespeed.png
new file mode 100644
index 0000000..e04bfd7
Binary files /dev/null and b/Python/tsnet/docs/figures/wavespeed.png differ
diff --git a/Python/tsnet/docs/history.rst b/Python/tsnet/docs/history.rst
new file mode 100644
index 0000000..2506499
--- /dev/null
+++ b/Python/tsnet/docs/history.rst
@@ -0,0 +1 @@
+.. include:: ../HISTORY.rst
diff --git a/Python/tsnet/docs/index.rst b/Python/tsnet/docs/index.rst
new file mode 100644
index 0000000..610c69a
--- /dev/null
+++ b/Python/tsnet/docs/index.rst
@@ -0,0 +1,24 @@
+Transient Simulation in water Networks (TSNet)
+==============================================
+
+.. figure:: figures/highlight.png
+ :width: 600
+ :alt: highlight
+
+
+TSNet is a Python package designed to perform transient simulation in water
+distribution networks. The software includes capability to:
+
+* Create transient models based on EPANET INP files
+* Operate valves and pumps
+* Add disruptive events including pipe bursts and leaks
+* Model open and closed surge tanks
+* Choose between steady,quasi-steady, and unsteady friction models
+* Perform transient simulation using Method of characteristics (MOC) techniques
+* Visualize results
+
+Indices and tables
+==================
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
diff --git a/Python/tsnet/docs/installation.rst b/Python/tsnet/docs/installation.rst
new file mode 100644
index 0000000..7abeacf
--- /dev/null
+++ b/Python/tsnet/docs/installation.rst
@@ -0,0 +1,92 @@
+.. highlight:: shell
+
+============
+Installation
+============
+
+Setup Python Environment
+------------------------------
+
+TSNet is tested against Python versions 3.5, 3.6, and 3.7.
+It can be installed on Windows, Linux, and Mac OS X operating systems.
+Python distributions, such as Anaconda, are recommended to manage the Python
+environment as they already contain (or easily support installation of) many
+Python packages (e.g. SciPy, NumPy, pandas, pip, matplotlib, etc.) that are
+used in the TSNet package. For more information on Python package
+dependencies, see :ref:`Dependencies`.
+
+Stable Release (for users)
+--------------------------
+
+To install TSNet, run this command in your terminal:
+
+.. code-block:: console
+
+ $ pip install tsnet
+
+This is the preferred method to install tsnet, as it will always install the
+most recent stable release.
+
+If you don't have `pip`_ installed, this `Python installation guide`_ can guide
+you through the process.
+
+.. _pip: https://pip.pypa.io
+.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
+
+
+From Sources (for developers)
+-----------------------------
+
+The sources for TSNet can be downloaded from the `Github repo`_.
+
+You can either clone the public repository:
+
+.. code-block:: console
+
+ $ git clone git://github.com/glorialulu/tsnet
+
+Or download the `tarball`_:
+
+.. code-block:: console
+
+ $ curl -OL https://github.com/glorialulu/tsnet/tarball/master
+
+Once you have a copy of the source, you can install it with:
+
+.. code-block:: console
+
+ $ python setup.py install
+
+
+.. _Github repo: https://github.com/glorialulu/tsnet
+.. _tarball: https://github.com/glorialulu/tsnet/tarball/master
+
+.. _Dependencies:
+
+Dependencies
+------------
+
+Requirements for TSNet include Python (3.5, 3.6, or 3.7) along with
+several Python packages.
+The following Python packages are required::
+
+1. Numpy [VaCV11]_: the fundamental package needed for scientific computing with Python
+ included in Anaconda distribution
+ http://www.numpy.org/
+
+2. Matplotlib [Hunt07]_: Python 2D plotting library
+ included in Anaconda distribution
+ http://matplotlib.org/
+
+3. NetworkX [HaSS08]_: Network creation and manipulation engine,
+ install on a python-enabled command line with `pip install wntr`
+ https://networkx.github.io/
+
+4. WNTR [WNTRSi]_: Water Network Tool for Resilience
+ install on a python-enabled command line with `pip install wntr`
+ http://wntr.readthedocs.io
+
+5. pytest: Unit Tests engine
+ install on a python-enabled command line with `pip install -U pytest`
+ https://docs.pytest.org/en/latest/
+
diff --git a/Python/tsnet/docs/limitations.rst b/Python/tsnet/docs/limitations.rst
new file mode 100644
index 0000000..bc816ed
--- /dev/null
+++ b/Python/tsnet/docs/limitations.rst
@@ -0,0 +1,61 @@
+=====================================
+Software Conventions and Limitations
+=====================================
+
+Units
+------
+
+All data in TSNet is stored in the following International System (SI) units:
+
+* Length = :math:`m`
+* Diameter = :math:`m`
+* Water pressure = :math:`m`
+ (this assumes a fluid density of 1000 :math:`kg/m^3`)
+* Elevation = :math:`m`
+* Mass = :math:`kg`
+* Time = :math:`s`
+* Demand = :math:`m^3/s`
+* Velocity = :math:`m/s`
+* Acceleration = :math:`g` (1 :math:`g` = 9.8 :math:`m/s^2`)
+* Volume = :math:`m^3`
+
+If the unit system specified in .inp file is US units,
+it will be converted to SI unit in the simulation process.
+When setting up analysis in TSNet, all input values
+should be specified in SI units.
+All simulation results are also stored in SI units.
+
+
+Modelling Assumptions and Limitations
+-------------------------------------
+
+TSNet is constantly under development. Current software limitations are
+as follows:
+
+* Demands on the start and end nodes of pumps and valves are not supported.
+ If demands are defined on these nodes in the .inp file, they will be
+ ignored in transient simulation, and the simulation results may
+ not be accurate due to discrepancies between the initial conditions
+ and the first step in transient simulation. Warnings will be printed.
+
+* Multi-branch junctions on the start and end nodes of pumps and valves
+ are not supported. It is assumed that valves and pumps are connected
+ by pipes in series.
+
+* During transient simulation, demands are pressure dependent .
+
+* Pipe Friction coefficients are converted to Darcy-Weisbach coefficients
+ based on initial conditions.
+
+* Pipe bursts and leaks occur only on the nodes.
+
+* Transient simulation relies on a feasible steady state solution;
+ hence, it is essential to verify that the steady state simulation
+ succeeds without errors.
+
+
+
+
+
+
+
diff --git a/Python/tsnet/docs/logo.jpg b/Python/tsnet/docs/logo.jpg
new file mode 100644
index 0000000..d080ab0
Binary files /dev/null and b/Python/tsnet/docs/logo.jpg differ
diff --git a/Python/tsnet/docs/logo.png b/Python/tsnet/docs/logo.png
new file mode 100644
index 0000000..ba20bd1
Binary files /dev/null and b/Python/tsnet/docs/logo.png differ
diff --git a/Python/tsnet/docs/readme.rst b/Python/tsnet/docs/readme.rst
new file mode 100644
index 0000000..34f7d69
--- /dev/null
+++ b/Python/tsnet/docs/readme.rst
@@ -0,0 +1,106 @@
+Introduction to TSNet
+=======================
+TSNet performs transient simulation in water networks using Method of Characteristics (MOC).
+
+
+* Free software: MIT license
+* Github: https://github.com/glorialulu/TSNet.git
+* Documentation: https://tsnet.readthedocs.io.
+
+Overview
+---------
+Hydraulic transients in water distribution networks (WDNs),
+typically induced by pipe bursts, valve operations, and pump operations,
+can disturb the steady-state flow conditions by introducing extreme pressure
+variability and imposing abrupt internal pressure force
+onto the pipeline systems [WOLB05]_.
+These disturbances have been identified as one of the major contributing factors
+in the many pipe deterioration and catastrophic failure in WDNs [RERS15]_,
+thereby wasting a significant amount of treated water and creating unexpected
+possibilities of contamination intrusion [ASCE17]_.
+Consequently, transient simulation, as a prominent approach to
+understand and predict the behavior of hydraulic transients,
+has become an essential requirement for ensuring the distribution safety and
+improving the efficiency in the process of design and operation of WDNs.
+In addition to improving design and operation of WDNs,
+various other transient-based applications, such as network calibration,
+leak detection, sensor placement, and condition assessment,
+has also enhanced the popularity and necessity of transient simulation
+
+Acknowledgedly, a number of commercial software for transient simulation
+in water distribution systems is available in the market;
+however, the use of these software for research purposes is limited.
+The major restriction is due to the fact that the programs are packed
+as black boxes, and the source codes are not visible,
+thus prohibiting any changes, including modification of
+existing and implementation of new elements, in the source codes.
+Additionally, the commercial software is designed to perform only
+single transient simulations and do not have the capabilities to automate or
+run multiple transient simulations.
+Users are required to modify the boundary conditions using the GUI,
+perform the simulation, and manually record the hydraulic responses
+in the various conditions,
+which significantly complicated the research process.
+
+There is a clear gap that currently available simulation software
+are not suitable for many research applications beyond the
+conventional design purposes.
+Hence, the motivation of this work is two-fold:
+
+1. Provide users with open source and freely available python code
+and package for simulating transients in water distribution systems
+that can be integrated with other case specific applications,
+e.g. sensor placement and event detection; and
+
+2. Encourage users and developers to further develop and
+extend the transient model.
+
+
+Features
+--------
+
+TSNet is a Python package designed to perform transient simulation in water
+distribution networks. The software includes capability to:
+
+* Create transient models based on EPANET INP files
+* Operating valves and pumps
+* Add disruptive events including pipe bursts and leakages
+* Choose between steady,quasi-steady, and unsteady friction models
+* Perform transient simulation using Method of characteristics (MOC) techniques
+* Visualize results
+
+For more information, go to https://tsnet.readthedocs.io.
+
+
+Version
+-------
+
+TSNet is a ongoing research project in the University of Texas at Austin.
+The current version is 0.2.2, which is still a pre-release.
+
+Contact
+-------
+
+* Lu Xing, the University of Texas at Austin, xinglu@utexas.edu
+* Lina Sela, the University of Texas at Austin, linasela@utexas.edu
+
+Disclaimer
+----------
+
+No warranty, expressed or implied, is made as to the correctness of the
+results or the suitability of the application.
+
+
+Cite TSNet
+-----------
+
+To cite TSNet, use one of the following references:
+
+Xing, Lu, and Lina Sela. "Transient simulations in water distribution networks:
+TSNet python package." Advances in Engineering Software 149 (2020): 102884.
+
+
+License
+-------
+
+TSNet is released under the MIT license. See the LICENSE.txt file.
diff --git a/Python/tsnet/docs/reference.rst b/Python/tsnet/docs/reference.rst
new file mode 100644
index 0000000..a3c4fa5
--- /dev/null
+++ b/Python/tsnet/docs/reference.rst
@@ -0,0 +1,35 @@
+=========
+Reference
+=========
+
+.. [WYSS93] Wylie, E. B., Streeter, V. L., & Suo, L. (1993). Fluid transients in systems (Vol. 1, p. 464). Englewood Cliffs, NJ: Prentice Hall.
+
+.. [WNTRSi] Klise, K. A., Hart, D., Moriarty, D., Bynum, M. L., Murray, R., Burkhardt, J., & Haxton, T. (2017). Water network tool for resilience (WNTR) user manual. US Environmental Protection Agency, EPA/600/R-17/264, Cincinnati, OH.
+
+.. [LAJW99] Larock, B. E., Jeppson, R. W., & Watters, G. Z. (1999). Hydraulics of pipeline systems. CRC press.
+
+.. [STWV96] Street, R. L., Watters, G. Z., & Vennard, J. K. (1996). Elementary fluid mechanics. J. Wiley.
+
+.. [WOLB05] Wood, D. J., Lingireddy, S., Boulos, P. F., Karney, B. W., & McPherson, D. L. (2005). Numerical methods for modeling transient flow in distribution systems. Journal‐American Water Works Association, 97(7), 104-115.
+
+.. [RERS15] Rezaei, H., Ryan, B., & Stoianov, I. (2015). Pipe failure analysis and impact of dynamic hydraulic conditions in water supply networks. Procedia Engineering, 119, 253-262.
+
+.. [ASCE17] ASCE. (2017). 2017 infrastructure report card. Reston, VA: ASCE.
+
+.. [VaCV11] van der Walt, S., Colbert, S.C., and Varoquaux, G. (2011). The NumPy array: A structure for efficient numerical computation. Computing in Science and Engineering, 13, 22-30.
+
+.. [HaSS08] Hagberg, A.A., Schult, D.A., and Swart P.J. (2008). Exploring network structure, dynamics, and function using NetworkX. In Proceedings of the 7th Python in Science Conference (SciPy2008), August 19-24, Pasadena, CA, USA.
+
+.. [Hunt07] Hunter, J.D. (2007). Matplotlib: A 2D graphics environment. Computing in Science and Engineering, 9(3), 90-95.
+
+.. [MISI08] Misiūnas, D. (2008). Failure monitoring and asset condition assessment in water supply systems. Vilnius Gediminas Technical University.
+
+.. [STWY67] Streeter, V. L., & Wylie, E. B. (1967). Hydraulic transients (No. BOOK). mcgraw-hill.
+
+.. [OSBH08] Ostfeld, A., Uber, J. G., Salomons, E., Berry, J. W., Hart, W. E., Phillips, C. A., ... & di Pierro, F. (2008). The battle of the water sensor networks (BWSN): A design challenge for engineers and algorithms. Journal of Water Resources Planning and Management, 134(6), 556-568.
+
+.. [VIBS06] Vítkovský, J. P., Bergant, A., Simpson, A. R., & Lambert, M. F. (2006). Systematic evaluation of one-dimensional unsteady friction models in simple pipelines. Journal of Hydraulic Engineering, 132(7), 696-708.
+
+.. [VABR95] Vardy, A. E., & Brown, J. M. (1995). Transient, turbulent, smooth pipe friction. Journal of hydraulic research, 33(4), 435-456.
+
+.. [HAMMER] Bentley, W. H. Transient Analysis Software.
\ No newline at end of file
diff --git a/Python/tsnet/docs/results.rst b/Python/tsnet/docs/results.rst
new file mode 100644
index 0000000..6200d9e
--- /dev/null
+++ b/Python/tsnet/docs/results.rst
@@ -0,0 +1,121 @@
+====================
+Simulation Results
+====================
+
+Results Structure
+-----------------
+
+Simulation results are returned and saved in the
+:class:`tsnet.network.model.TransientModel` object
+for each node and link in the networks.
+
+Node results include the following attributes:
+
+ - Head [m]
+ - Emitter discharge (including leaks and bursts) [:math:`m^3/s`]
+ - Actual demand discharge [:math:`m^3/s`]
+
+Link results include the following attributes:
+
+ - Head at start node [m]
+ - Flow velocity at start node [:math:`m^3/s`]
+ - Flow rate at start node [:math:`m^3/s`]
+ - Head at end node [m]
+ - Flow velocity at end node [:math:`m^3/s`]
+ - Flow rate at end node [:math:`m^3/s`]
+
+
+The result for each attribute is a Numpy array, representing the time
+history of the simulation results, the length of
+which equals the total number of simulation time steps (:math:`tn`).
+
+For example, the results of head, emitter discharge and demand discharge
+at node 'JUNCTION-105' can be accessed by:
+
+.. code:: python
+
+ node = tm.get_node['JUNCTION-105']
+ head = node.head
+ emitter_discharge = node.emitter_discharge
+ demand_discharge = node.demand_discharge
+
+To obtain the results on pipe 'LINK-40':
+
+.. code:: python
+
+ pipe = tm.get_link('LINK-40')
+ start_head = pipe.start_node_head
+ end_head = pipe.end_node_head
+ start_velocity = pipe.start_node_velocity
+ end_velocity = pipe.end_node_velocity
+ start_flowrate = pipe.start_node_flowrate
+ end_flowrate = pipe.end_node_flowrate
+
+
+Time Step and Time Stamps
+-------------------------
+
+Additionally, the time step (in seconds) and the time stamps (in seconds
+from the start of the simulation) are also stored in the
+:class:`tsnet.network.model.TransientModel` object. They can be retrieved
+by:
+
+.. code:: python
+
+ dt = tm.time_step
+ tt = tm.simulation_timestamps
+
+The results can then be plotted with respect to the time stamps using
+**matplotlib** or any other preferred package, as shown in :numref:`tnet2_node`:
+
+.. code:: python
+
+ import matplotlib.pyplot as plt
+ plt.plot(tt ,head)
+
+.. _tnet2_node:
+.. figure:: figures/tnet2_node.png
+ :width: 600
+ :alt: tnet2_node
+
+ Head results at JUNCTION-105
+
+Results Retrieval
+------------------
+
+The :class:`tsnet.network.model.TransientModel` object, including
+the information of the network, operation rules, and the simulated results,
+is saved in the file **results_obj.obj**, located in the current folder.
+The name of the results file is defined by the input parameter `result_obj`.
+If `result_obj` is not given, the default results file is `results.obj`.
+
+To retrieve the results from a previously completed simulation,
+one can read the :class:`tsnet.network.model.TransientModel` object
+from the **results_obj.obj** file and access results from the objet by:
+
+.. code:: python
+
+ import pickle
+ file = open('results.obj', 'rb')
+ tm = pickle.load(file)
+
+
+Runtime and Progress
+---------------------
+
+At the beginning of transient simulation,
+TSNet will report the approximation simulation time
+based on the calculation time of first few time
+steps and the total number of time steps.
+Additionally, the computation progress will also printed on the screen
+as the simulation proceeds, as shown in :numref:`time`.
+
+.. _time:
+.. figure:: figures/time.PNG
+ :width: 200
+ :alt: time
+
+ Runtime output about calculation time and process.
+
+
+
diff --git a/Python/tsnet/docs/transient.rst b/Python/tsnet/docs/transient.rst
new file mode 100644
index 0000000..f63e26a
--- /dev/null
+++ b/Python/tsnet/docs/transient.rst
@@ -0,0 +1,915 @@
+==================================
+Transient Modeling Framework
+==================================
+The framework of performing transient simulation using TSNet is shown in :numref:`flowchart`
+The main steps of transient modelling and simulation in TSNet
+are described in subsequent sections.
+
+.. _flowchart:
+.. figure:: figures/chart.png
+ :width: 400
+ :alt: flowchart
+
+ Flowchart of transient simulation in TSNet
+
+Transient Model
+---------------
+
+The transient model inherits the
+WNTR water network model [WNTRSi]_,
+which includes
+junctions, tanks, reservoirs, pipes, pumps, valves,
+patterns,
+curves,
+controls,
+sources,
+simulation options,
+and node coordinates.
+It can be built directly from an EPANet INP file.
+Sections of EPANet INP file that are not compatible with WNTR are
+described in [WNTRSi]_.
+
+Compared with WNTR water network model,
+TSNet transient model adds the features
+designed specifically for transient simulation, such as
+spatial discretization,
+temporal discretization,
+valve operation rules,
+pump operation rules,
+burst opening rules,
+surge tanks, and
+storage of time history results.
+For more information on the water network model, see
+:class:`~tsnet.network.model.TransientModel` in the API documentation.
+
+A transient model can be created directly from an EPANET INP file.
+The following example build a transient model.
+
+
+.. code:: python
+
+ inp_file = 'examples/networks/Tnet1.inp'
+ tm = tsnet.network.TransientModel(inp_file)
+
+
+Initial Conditions
+------------------
+
+TSNet employed WNTR [WNTRSi]_ for simulating the steady state
+in the network to establish the initial conditions for
+the upcoming transient simulations.
+
+**WNTRSimulators** can be used to run demand-driven (DD) or
+pressure-dependent demand (PDD) hydraulics simulations, with the
+capacity of simulating leaks. The default simulation engine is DD.
+An initial condition simulation can be run using the following code:
+
+.. code:: python
+
+ t0 = 0. # initialize the simulation at 0 [s]
+ engine = 'DD' # demand driven simulator
+ tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+:math:`t_0` stands for the time when the initial condition will be
+calculated. More information on the initializer can be found in
+the API documentation, under
+:class:`~tsnet.simulation.initialize.Initializer`.
+
+
+
+Transient Simulation
+---------------------------------
+
+After the initial conditions are obtained, TSNet adopts
+the Method of Characteristics (MOC)
+for solving governing transient flow equations.
+A transient simulation can be run using the following code:
+
+.. code:: python
+
+ results_obj = 'Tnet1' # name of the object for saving simulation results
+ tm = tsnet.simulation.MOCSimulator(tm, results_obj)
+
+
+The results will be returned to the transient model (tm) object,
+and then stored in the 'Tnet1.obj' file for the easiness of retrieval.
+
+In the following sections, an overview of the solution approaches
+and boundary conditions is presented,
+based on the following literature [LAJW99]_ , [MISI08]_, [WYSS93]_.
+
+Governing Equations
+""""""""""""""""""""""""""""""""""""""""""
+
+Mass and Momentum Conservation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The transient flow is governed by the mass and momentum conservation
+equation [WYSS93]_:
+
+.. math::
+ \frac{\partial H}{\partial t} + \frac{a^2}{g} \frac{\partial V}{\partial x} - gV\sin \alpha = 0
+
+ \frac{1}{g}\frac{\partial V}{\partial t} + \frac{\partial H}{\partial x} + h_f = 0
+
+where
+:math:`H` is the head,
+:math:`V` is the flow velocity in the pipe,
+:math:`t` is time,
+:math:`a` is the wave speed,
+:math:`g` is the gravity acceleration,
+:math:`\alpha` is the pipe slope,
+and :math:`h_f` represents the head loss per unit length due to friction.
+
+Method of Characteristics (MOC)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The Method of Characteristics (MOC) method is used to solve the system of
+governing equations above. The essence of MOC is to transform the set of
+partial differential equations to an equivalent set of ordinary differential
+equations that apply along specific lines, i.e., characteristics lines
+(C+ and C-), as shown below [LAJW99]_:
+
+.. math::
+ C+: \ \ \ \frac{dV}{dt} + \frac{g}{a} \frac{dH}{dt} + g h_f - \frac{g}{a}V\sin\alpha = 0
+ \ \ \ \text{ along } \frac{dx}{dt} = a
+
+ C-: \ \ \ \frac{dV}{dt} - \frac{g}{a} \frac{dH}{dt} + g h_f - \frac{g}{a}V\sin\alpha = 0
+ \ \ \ \text{ along } \frac{dx}{dt} = -a
+
+
+Headloss in Pipes
+^^^^^^^^^^^^^^^^^
+
+Steady/ quasi-steady friction model
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+TSNet adopts Darcy-Weisbach equation to compute head loss, regardless of the
+friction method defined in the EPANET .inp file. This package computes
+Darcy-Weisbach coefficients (:math:`f`) based on the head loss per unit length
+(:math:`{h_f}_0`) and flow velocity (:math:`V_0`) in initial condition,
+using the following equation:
+
+.. math::
+ f = \frac{{h_f}_0}{V_0^2/2gD}
+
+where
+:math:`D` is the pipe diameter,
+and :math:`g` is gravity acceleration.
+
+Subsequently, in transient simulation the headloss (:math:`h_f`) is calculated
+based on the following equation:
+
+.. math::
+ h_f = f\frac{V^2}{2gD}
+
+
+
+Unsteady friction model
+~~~~~~~~~~~~~~~~~~~~~~~
+
+In addition to the steady friction model, TSNet includes the quasi-steady and
+the unsteady friction models.
+The head loss term (:math:`h_f`) can be expressed as a sum of steady/quasi-steady part
+(:math:`{h_f}_s`) and unsteady part (:math:`{h_f}_u`), i.e., :math:`h_f={h_f}_s+ {h_f}_u`.
+TSNet incorporates the instantaneous acceleration-based model [VIBS06]_ to calcualte the
+unsteady friction:
+
+.. math::
+ {h_f}_u = \frac{k_u}{2g} \left( \frac{\partial V}{\partial t} + a \cdot \mbox{sign}(V) \left| \frac{\partial V}{\partial x}\right| \right)
+
+where
+:math:`{h_f}_u` is the head loss per unit length due to unsteady friction,
+:math:`\frac{\partial V}{\partial t}` is the local instantaneous acceleration,
+:math:`\frac{\partial V}{\partial x}` is the convective instantaneous acceleration, and
+:math:`k_u` is Brunone's friction coefficient, which can be analytically determined using
+Vardy's sheer decay coefficient (:math:`C^*`) [VABR95]_:
+
+.. math::
+ k_u = \frac{C^*}{2}
+
+.. math::
+ C^* = \left\{ \begin{array}{rl}
+ 0.00476 & \mbox{laminar flow } (Re \leq 2000)\\
+ \frac{7.41}{Re^{\log{(14.3/Re^{0.05})}}} & \mbox{turbulent flow } (Re > 2000)
+ \end{array} \right.
+
+TSNet allows the user to choose the friction model using TSNet API simply by specifying
+the friction model to be used in :class:`~tsnet.simulation.MOCSimulator`.
+The friction argument can take three values: 'steady', 'quasi-steady', and 'unsteady':
+
+.. code:: python
+
+ results_obj = 'Tnet3' # name of the object for saving simulation results
+ friction = 'unsteady' # or "steady" or "quasi-steady", by default "steady"
+ tm = tsnet.simulation.MOCSimulator(tm, results_obj, friction)
+
+
+Pressure-driven Demand
+^^^^^^^^^^^^^^^^^^^^^^^
+
+During the transient simulation in TSNet, the demands are treated as
+pressure-dependent discharge; thus, the actual demands will vary from
+the demands defined in the INP file.
+The actual demands (:math:`d_{actual}`) are modeled based on the
+instantaneous pressure head at the node and the demand discharge coefficients,
+using the following equation:
+
+.. math::
+ d_{actual} = k \sqrt{H_p}
+
+where :math:`H_p` is the pressure head
+and :math:`k` is the demand discharge coefficient,
+which is calculated from the initial demand (:math:`d_0`)
+and pressure head (:math:`{H_p}_0`):
+
+.. math::
+ k = \frac{d_0}{\sqrt{{H_p}_0}}
+
+It should be noted that if the pressure head is negative,
+the demand flow will be treated zero,
+assuming that a backflow preventer is installed on each node.
+
+
+Choice of Time Step
+"""""""""""""""""""
+
+The determination of time step in MOC is not a trivial task. There are two
+constraints that have to be satisfied simultaneously:
+
+1. The Courant's criterion has to be satisfied for each pipe,
+ indicating the maximum time step allowed in the network transient analysis
+ will be:
+
+.. math::
+ \Delta t \leqslant \min{\left(\frac{L_i}{N_i a_i}\right)} \text{, }
+ i = 1 \text{, } 2 \text{, ..., } n_p
+
+2. The time step has to be the same for all the pipes in the network, therefore
+ restricting the wave travel time :math:`\frac{L_i}{N_ia_i}` to be the same
+ for any computational unit in the network. Nevertheless, this is not
+ realistic in a real network, because different pipe lengths
+ and wave speeds usually cause different wave travel times. Moreover,
+ the number of sections in the :math:`i^{th}` pipe (:math:`N_i`) has to
+ be an integer due to the grid configuration in MOC; however, the
+ combination of time step and pipe length is likely to produce
+ non-integer value of :math:`N_i`, which then requires further adjustment.
+
+This package adopted the wave speed adjustment scheme [WYSS93]_ to make
+sure the two criterion stated above are satisfied.
+
+To begin with, the maximum allowed time step (:math:`{\Delta t}_{max}`) is
+calculated, assuming that there are two computational units
+on the critical pipe (i.e., the pipe that results in the smallest travel time,
+which depends on the length and the wave speed for that pipe):
+
+.. math::
+ \Delta t_{max} = \min{\left(\frac{L_i}{2a_i}\right)} \text{, }
+ i = 1 \text{, } 2 \text{, ..., } n_p
+
+After setting the initial time step, the following adjustments will be performed.
+Firstly,
+the :math:`i^{th}` pipes (:math:`p_i`) with length (:math:`L_i`) and wave
+speed (:math:`a_i`) will be discretized into (:math:`N_i`) segments:
+
+.. math::
+ N_i = \text{round}\left(\frac{L_i}{a_i \Delta t_{max}}\right) \text{, }
+ i = 1, 2, \dots, n_p
+
+Furthermore, the discrepancies introduced by the rounding of :math:`N_i`
+can be compensated by correcting the wave speed (:math:`a_i`).
+
+.. math::
+ \Delta t = \mbox{argmin}_{\phi,\Delta t}{\left \{\sum_{i=1}^{n_p}{{\phi_i}^2} \ \ \big | \ \ \Delta t = \frac{L_i}{a_i(1 \pm \phi_i)N_i} \ \ i = 1, 2, \dots, n_p \right\} }
+
+Least squares approximation is then used to determine :math:`\Delta t`
+such that the sum of squares of the wave speed adjustments
+(:math:`\sum{{\phi_i}^2}`) is minimized [MISI08]_.
+Ultimately, an adjusted
+:math:`\Delta t` can be determined and then used in the transient simulation.
+
+It should be noted that even if the user defined time step satisfied the
+Courant's criterion, it will still be adjusted.
+
+If the user defined time step is greater than :math:`{\Delta t}_{max}`, a
+fatal error will be raised and the program will be killed; if not, the
+user defined value will be used as the initial guess for the upcoming
+adjustment.
+
+.. code:: python
+
+ dt = 0.1 # time step [s], if not given, use the maximum allowed dt
+ tf = 60 # simulation period [s]
+ tm.set_time(tf,dt)
+
+
+The determination of time step is not
+straightforward, especially in large networks.
+Thus, we allow the user
+to ignore the time step setting, in which case
+:math:`{\Delta t}_{max}` will be used as the initial guess for the upcoming adjustment.
+
+Alternatively, the user can also specify the number of segments on the critical pipe:
+
+.. code:: python
+
+ N = 3 # number of computational units on the critical pipe, default 2.
+ tf = 60 # simulation period [s]
+ tm.set_time_N(tf,N)
+
+
+Example
+^^^^^^^
+
+We use a small network, shown in :numref:`MOC_time`,
+to illustrate how time step is determined
+as well as the benefits and drawbacks of combining or removing small pipes.
+:numref:`MOC_time` (a) shows a network of three pipes with length of 940m, 60m, and 2000m, respectively.
+The wave speed for all the pipes is equal to 1000m/s.
+The procedure for determine the time step is as follows:
+
+
+* Calculate the maximum time step (:math:`\Delta t_{max}`)
+ allowed by Courant's criterion, assuming that there are two computational units
+ on the critical pipe (i.e., the pipe that results in the smallest travel time,
+ which depends on the length and the wave speed for that pipe), i.e., for pipe 2 :math:`N_2 = 2`.}
+
+
+ .. math::
+ \Delta t_{max} = \min{\left(\frac{L_i}{2a_i}\right)} = \left(\frac{L_2}{N_2a_2}\right) = \frac{60}{2\times 1000} = 0.03s
+
+
+* Compute the required number of computational units for all other
+ pipes, i.e, :math:`N_1` for pipe 1 and :math:`N_3` for pipe 3, using :math:`\Delta t_{max}` as the time step.
+ Since the number of computational units on each pipe has to be integer,
+ the numbers are rounded to the closest integer, thus introducing discrepancies in the time step of different pipes.
+
+ .. math::
+ N_1 &= \text{round}\left(\frac{L_1}{a_1 \Delta t_{max}}\right) = \frac{940}{1000\times0.03} = 31
+
+ N_3 &= \text{round}\left(\frac{L_3}{a_3 \Delta t_{max}}\right) = \frac{2000}{1000\times0.03} = 67
+
+
+ With these number of computational units, the time steps for each pipe become:
+
+ .. math::
+ \Delta t_1 = \frac{L_1}{N_1a_1}=0.03032s
+
+ \Delta t_3 = \frac{L_3}{N_3a_3}=0.02985s
+
+
+ However, all the pipes have to have the same time step for marching forward;
+ hence, we need to adjust the wave speed to match the time step for all pipes.
+
+ .. math::
+ \Delta t =\frac{L_i}{a_i^{adj}N_i}
+
+
+* Compensate the discrepancies introduced by rounding number of
+ computation units through adjusting wave speed from :math:`a_i` to :math:`a_i^{adj}=a_i(1+\phi_i)`.
+ The sum of squared adjustments (:math:`\sum{{\phi_i}^2}`) is minimized to obtain the minimal overall
+ adjustment. In this example, the wave speeds of the three pipes are adjusted by
+ :math:`\phi_1 = 0.877\, \phi_2 = -0.196\%, \phi_3 =0.693\%`, respectively.
+
+* Finally, the time step can be calculated based on the number of
+ computational units and the adjusted wave speed of each one of three pipes that now share
+ the same time step:
+
+ .. math::
+ \Delta t = \frac{L_i}{a_i(1 \pm \phi_i)N_i}=0.03006s
+
+
+.. _MOC_time:
+.. figure:: figures/MOC_time_example.png
+ :width: 600
+ :alt: MOC_time
+
+ Example network for determining the time step: (a) before combing pipes; (b): after combing pipes.
+
+
+Noticeably, the maximum allowed time step for this network is fairly small.
+Meanwhile, the total number of segments (:math:`31+2+67=100`) is relatively large;
+thus, in order to conduct a transient simulation of :math:`10s`,
+the overall number of computation nodes in x-t plane will be :math:`10/0.03006\times100=33267`.
+The computation efforts can be significantly reduced by, for example, combing/removing the shorted pipe, i.e., pipe 2.
+:numref:`MOC_time` (b) illustrates the network after combing pipe 1 and pipe 2.
+Following the same steps shown above, it can be determined that the maximum time step is :math:`0.5s`, and
+the number of computation units for pipes 1 and 2 are :math:`2` and :math:`4`, respectively,
+thus significantly reducing the total number of computation nodes in x-t plane required
+for :math:`10s` simulation to :math:`10/0.5\times(2+4)=26`.
+
+
+In this example, we implicitly assumed that pipe properties were the same (e.g., diameter, material),
+however these properties affect wave propagation, reflection, and damping.
+Hence, despite the benefits in reducing computation costs,
+merging or removing pipes to improve computational efficiency
+is not straightforward and requires careful considerations of how these changes will affect modeling accuracy.
+In other words, any discontinuity or change in pipe properties will create changes in wave propagation, and hence,
+if removed will change the model.
+For example, suppose pipe 1 and 3 in :numref:`MOC_time` have the same diameter,
+while pipe 2 has smaller diameter,
+then a certain portion of wave speed will be reflected at junctions connecting the pipes.
+However, if pipe 2 is to be removed, and pipe 1 is then connected to pipe 3, which exhibit the same diameter,
+there will be no reflection observed in the new junction, thus altering the wave propagation in the network.
+Therefore, precautions are required before removing or combing the short pipes,
+or modifying network topology in general.
+
+Moreover, the simulation time step can be controlled by specifying
+large number of segments in the critical pipe, which will also control the
+wave speed adjustments (:math:`\phi`), as shown in :numref:`wavev`
+calculated for network Tnet1.
+The black curve shows the reduction in the simulation time step as the number of segments
+in the critical pipe increases.
+Subsequently, the decreased time step results in a reduction in wave speed adjustment
+(:math:`a^{adj} = a\times(1+\phi)`), as illustrated by the red curve.
+The red line represents the average wave speed adjustment and the shaded area
+represents the maximum and minimum wave speed adjustments for all pipes in the network.
+For example, when the critical pipe is divided into 40 segments, the time step is reduced
+to less than 0.001s, and
+the adjustment of wave speed is reduced to about 0.005, which is negligibly small.
+However, there is obviously a computational trade-off between numerical accuracy and
+computational efficiency.
+
+.. _wavev:
+.. figure:: figures/wavespeed.png
+ :width: 400
+ :alt: wavev
+
+ Time step (black, left y-axis) versus the number of computational
+ units on the critical pipe and the wave speed adjustments (red, right y-axis)
+ showing the mean (red line) and the max-min range (shaded area).
+
+
+
+Numerical Scheme
+"""""""""""""""""""
+The explicit MOC technique adopted to solve the compatibility equations
+is explained in a simple network.
+:numref:`MOC_grid_net` illustrates a simple piped network
+and the corresponding MOC characteristic grid on the x-t plane.
+Boundary nodes (represented by the void circles),
+are defined by the physical elements in the network (or any discontinuity),
+such as tanks, junctions, valves, pumps, leaks and bursts.
+Inner nodes (represented by solid circles) are numerically specified to divide a single
+pipe into several segments, i.e., *computational units*, so that the propagation of pressure waves
+can be properly modeled.
+The heads, :math:`H`, and flow velocities, :math:`V`, are computed for each computational node,
+either boundary or inner node, and at each time based on the information at a previous time.
+Depending on the type of the computational node (i.e. inner or boundary)
+and the specific boundary condition,
+the flows and heads may be allocated and computed differently.
+:numref:`MOC_grid` shows a general example of two computational units for computing flow velocities and heads.
+Note that for inner nodes, where there is no change in pipe or flow conditions,
+:math:`H_2^t = H_3^t` and :math:`V_2^t = V_3^t`.
+Otherwise, additional head/flow boundary conditions will be introduced between points 2 and 3
+in addition to the two compatibility equations.
+Detailed descriptions about different boundary conditions are discussed in the next section.
+
+
+.. _MOC_grid_net:
+.. figure:: figures/MOC_grid_net.png
+ :width: 600
+ :alt: MOC_grid_net
+
+ Topology of a simple network
+
+
+.. _MOC_grid:
+.. figure:: figures/MOC_grid.png
+ :width: 400
+ :alt: MOC_grid
+
+ MOC characteristic grids in x-t plane for two adjacent computational units
+
+
+Steady/quasi-steady Friction Model
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The solution of the compatibility equations is achieved by integrating
+the above equations along specific characteristic lines of the numerical grid,
+which are solved to compute the head and flow velocity, :math:`H_i^t,V_i^t`,
+at new point in time and space given that the conditions at the previous time step are known.
+The two characteristic equations describing the hydraulic transients with steady friction model
+(:math:`h_f = {h_f}_s = f\frac{V^2}{2gD}`) are discretized and formulated as:
+
+
+.. math::
+ :label: com_steady
+
+ C+: &\qquad {} (V_i^t - V_{i-1}^{t-1}) + \frac{g}{a} (H_i^{t} - H_{i-1}^{t-1} )
+ + \frac{f\Delta t}{2D}V_{i-1}^{t-1} |V_{i-1}^{t-1}|
+ + \frac{g\Delta t}{a} V_{i-1}^{t-1}\sin\alpha= 0\\
+ C-: &\qquad {} (V_i^t - V_{i+1}^{t-1}) - \frac{g}{a} (H_i^{t} - H_{i+1}^{t-1} )
+ - \frac{f\Delta t}{2D}V_{i+1}^{t-1} |V_{i+1}^{t-1}|
+ - \frac{g\Delta t}{a} V_{i+1}^{t-1}\sin\alpha= 0
+
+
+Once the MOC characteristic grid and numerical scheme are established,
+the explicit time marching MOC scheme can be conducted in the computational units shown
+in :numref:`MOC_grid` as follows:
+
+* First, given initial conditions, the heads and flow velocities
+ at all computational nodes are known, and are updated for the next time step,
+ i.e. :math:`H_2^{t}, V_2^{t}, H_3^{t}`,
+ and :math:`V_3^{t}` will be updated based on
+ :math:`H_1^{t-1}, V_1^{t-1}, H_4^{t-1},` and :math:`V_4^{t-1}`.
+
+* Then, the relation between :math:`H_2^t` and :math:`V_2^t` with known
+ :math:`H_1^{t-1}, V_1^{t-1}`, and properties of the computation unit 1,
+ such as wave speed (:math:`a_1`) and friction factor(:math:`f_1`) are established
+ along the positive characteristic line (:math:`C^+`):
+
+ .. math::
+ V_2^t + \frac{g}{a_1} H_2^t = V_1^{t-1} + \frac{g}{a_1} H_1^{t-1}
+ -\frac{f_1\Delta t}{2D_1}V_1^{t-1} |V_1^{t-1}| + \frac{g\Delta t}{a_1} V_1^{t-1}\sin\alpha_1
+
+
+* Similarly, :math:`H_3^t` and :math:`V_3^t` is updated using the compatibility equations
+ along the negative characteristic line (:math:`C^-`) and
+ conditions at previous time step, :math:`H_4^{t-1}, V_4^{t-1}` :
+
+ .. math::
+ V_3^t - \frac{g}{a_2} H_3^t = -V_4^{t-1} + \frac{g}{a_2} H_4^{t-1}
+ + \frac{f_2\Delta t}{2D_2}V_4^{t-1} |V_4^{t-1}| - \frac{g \Delta t}{a_2} V4^{t-1}\sin\alpha_2
+
+* Subsequently, the system of equations is supplemented using
+ the boundary conditions at the node connecting the two computation units,
+ such as energy equations that specify the relation between :math:`H_2^t` and :math:`H_3^t`
+ and continuity equations for :math:`V_2^t` and :math:`V_3^t`.
+ Different boundary conditions can be defined to characterize different connections,
+ including valves, pumps, surge tanks, and pipe-to-pipe junctions with/or without
+ leak, burst, and demand.
+ For example, if the connection is a pipe-to-pipe junction with a leak, the boundary conditions
+ can be defined as:
+
+ .. math::
+ H_2^t = H_3^t; V_2^t A_1 = V_3^t A_2 + k_l \sqrt{H_2^t}
+
+ where, :math:`k_l` is the leakage coefficient and
+ :math:`A_1, A_2` are the cross-sectional area of computation units 1 and 2, respectively.
+ More boundary conditions are discussed in the next section.
+
+* Ultimately, the system of equations containing compatibility equations,
+ and the two boundary conditions
+ can be solved for the four unknowns, i.e.,:math:`H_2^t, V_2^t, H_3^t`, and :math:`V_3^t`,
+ thus completing the time marching from :math:`t-1` to :math:`t`.
+
+Unsteady Friction Model
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The local (:math:`\frac{\partial{V}}{\partial{x}}`)
+and convective instantaneous (:math:`\frac{\partial{V}}{\partial{t}}`)acceleration terms
+are approximated using finite-difference schemes
+on the characteristic grid, as shown in :numref:`MOC_grid_unsteady`.
+The explicit fist-order finite difference scheme is implemented such that the computation
+of the acceleration terms does not interact with adjacent computational sections,
+thus preserving the original structure of the MOC scheme.
+Mathematically, the acceleration terms along positive and negative characteristic lines can
+be represented as:
+
+.. math::
+ C^+: & \frac{\partial{V}}{\partial{t}}^+ = \frac{V_1^{t-1}-V_1^{t-2}}{\Delta t}
+ & \frac{\partial{V}}{\partial{x}}^+ = \frac{V_2^{t-1}-V_1^{t-1}}{\Delta x} \\
+ C^-: & \frac{\partial{V}}{\partial{t}}^- = \frac{V_4^{t-1}-V_4^{t-2}}{\Delta t}
+ & \frac{\partial{V}}{\partial{x}}^- = \frac{V_4^{t-1}-V_3^{t-1}}{\Delta x}
+
+
+
+.. _MOC_grid_unsteady:
+.. figure:: figures/MOC_grid_unsteady.png
+ :width: 400
+ :alt: MOC_grid_unsteady
+
+ MOC characteristic grid with finite difference unsteady friction
+
+Subsequently, the formulation of unsteady friction can be incorporated into
+the compatibility equations with
+additional terms describing the instantaneous acceleration-based unsteady friction model,
+as below:
+
+
+.. math::
+ :label: com_unsteady
+
+ C+: \qquad {}(V_i^t - V_{i-1}^{t-1}) + \frac{g}{a} (H_i^{t} - H_{i-1}^{t-1} )
+ + \frac{g}{a} \Delta t V_{i-1}^{t-1}\sin\alpha
+ + \frac{f\Delta x}{2D}V_{i-1}^{t-1} |V_{i-1}^{t-1}|\\
+ + \frac{k_u}{2g} \left[ (V_{i-1}^{t-1} - V_{i-1}^{t-2}) +
+ \mbox{sign}(V_{i-1}^{t-1}) \left|V_i^{t-1} - V_{i-1}^{t-1} \right| \right] = 0\\
+ C-: \qquad {} (V_i^t - V_{i+1}^{t-1}) - \frac{g}{a} (H_i^{t} - H_{i+1}^{t-1} )
+ + \frac{g}{a} \Delta t V_{i+1}^{t-1}\sin\alpha
+ - \frac{f\Delta x}{2D}V_{i+1}^{t-1} |V_{i+1}^{t-1}|\\
+ - \frac{k_u}{2g} \left[ (V_{i+1}^{t-1} - V_{i+1}^{t-2}) +
+ \mbox{sign}(V_{i+1}^{t-1}) \left|V_{i+1}^{t-1} - V_{i}^{t-1} \right| \right] = 0
+
+
+Boundary Conditions
+"""""""""""""""""""
+
+Boundary conditions are required to characterize the devices or discontinuities,
+such as such as tanks, junctions, valves, pumps, leaks and bursts, between two computational units.
+Supplemented by the boundary conditions specifying the relations between :math:`H_2 ^t, H_3^t, V_2^t, V_3^t` as
+in :numref:`MOC_grid` or :numref:`MOC_grid_unsteady`,
+the compatibility equations (:eq:`com_steady` or :eq:`com_unsteady`)
+can then be solved to obtain :math:`H_2 ^t, H_3^t, V_2^t`, and :math:`V_3^t`.
+The following sections discuss the boundary conditions for devices and discontinuities in detail.
+
+Surge tanks
+^^^^^^^^^^^^
+
+The modeling of water hammer protection devices, including the open and closed surge tanks,
+are also incorporated in TSNet.
+An open surge tank is modeled as an open chamber connected directly to a pipeline
+and is open to the atmosphere [WYSS93]_.
+Initially, the water head (:math:`z`) in the tank equals to the hydraulic head in the upstream pipeline.
+During transient simulation, the open surge tank moderates pressure transients by
+storing the excess water when a pressure jump occurs in the pipeline connection, or supplying water
+in the event of a pressure drop.
+Then, the boundary conditions at the open surge tank can be formulated as:
+
+.. math::
+ :label: open_surge
+
+ &V_2^t A_1 - V_3^t A_2 = Q_T^t &\mbox{continuity}
+
+ &H_2^t = H_3^t &\mbox{energy conservation}
+
+ &H_2^t = z^t &\mbox{energy conservation}
+
+ &z^t = z^{t-1} + \frac{\Delta t }{a A_T}\left(Q_T^t + Q_T^{t-1}\right) &\mbox{tank water level}
+
+where :math:`Q_T` is the flow rate into the surge tank,
+:math:`z` is the water level in the surge tank, and
+:math:`A_T` is the cross-sectional area of the surge tank.
+With six equations (two compatity equations and four boundary conditions)
+and six unknowns (:math:`V_2^t, V_3^t, H_2^t, H_3^t, z^t, Q_T^t`),
+the above system of equations can be solved at each time step.
+Other devices can be modeled as well by defining the corresponding boundary conditions to
+replace :eq:`open_surge`.
+
+In TSNet, an open surge tank is assumed to exhibit infinite height so that the tank never overflows.
+The user can add an open surge tank to an existing network in the TSNet model by defining the desired
+location and the cross-sectional area of the surge tank, as shown:
+
+.. code:: python
+
+ tank_node = 'JUNCTION-90'
+ tank_area = 10 # tank cross sectional area [m^2]
+ tm.add_surge_tank(tank_node, [tank_area], 'open')
+
+Although the infinite height assumption is not realistic, due to the modeling simplicity,
+open surge tanks can serve an good initial approach for investigating the placement of surge protection devices.
+In fact, the major disadvantages of open surge tanks is that it typically cannot accommodate
+large pressure transients unless the tank is excessively tall and large, which limits its usefulness.
+
+Hence, we also included closed surge tank, i.e., air chamber,
+in TSNet as more realistic water hammer protection devices.
+An air chamber is a relatively small sealed vessel with compressed air at its top and
+water in the bottom [WYSS93]_.
+During transient simulation, the closed surge tank also moderates pressure transients
+by slowing down the deceleration or the acceleration of water flow. For example, when pressure
+in the upstream connection increases, water flows into the tank, water level in the tank increases,
+air volume compresses, and air pressure increases,
+thus slowing down the acceleration of the water inflow into the tank and the increase in pressure.
+Similarly, when pressure in the upstream connection drops, water flows from the tank,
+then water level in the chamber decreases, air volume increases, and air pressure decreases,
+thus slowing the deceleration of the water flow and the decrease of pressure head.
+The boundary conditions characterizing close surge tank in the computational units
+shown in :numref:`MOC_grid` are formulated as:
+
+.. math::
+ & V_2^t A_1 - V_3^t A_2 = Q_T^t &\mbox{continuity}
+
+ & H_2^t = H^3_t &\mbox{energy conservation}
+
+ & H_A^t = H2^t + H_b - z_t &\mbox{energy conservation}
+
+ & z^t = z^{t-1} + \frac{\Delta t }{a A_T}\left(Q_T^t + Q_T^{t-1}\right) &\mbox{tank water level}
+
+ & H_A^t \mathcal{V}_A^t = \mbox{constant} &\mbox{perfect gas law}
+
+ & \mathcal{V}_A^t = \mathcal{V}_A^{t-1} - A_T \left(z^t-z^{t-1}\right) &\mbox{tank air volume}
+
+
+where :math:`Q_T` is the flow rate into the surge tank,
+:math:`z` is the water level in the surge tank,
+:math:`H_A, \mathcal{V}_A` are the total head, and the volume of the air in the surge tank,
+:math:`H_b` is the barometric pressure, and
+:math:`A_T` is the cross-sectional area of the surge tank.
+
+The user can add a closed surge tank by specifying the location, cross-sectional area,
+total height of the surge tank, and initial water height in the tank:
+
+.. code::
+
+ tank_node = 'JUNCTION-90'
+ tank_area = 10 # tank cross sectional area [m^2]
+ tank_height = 10 # tank height [m]
+ water_height = 5 # initial water level [m]
+ tm.add_surge_tank(tank_node, [tank_area,tank_height,water_height], 'closed')
+
+
+Valve Operations
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. Two types of valve are included in TSNet: end valve, located on the boundary
+ of a network, and inline valve, located in the middle of the network and
+ connected by one pipe on each end.
+
+Valve operations, including closure and opening, are supported in TSNet.
+The default valve shape is gate valve, the valve characteristics curve
+of which is defined according to [STWV96]_.
+The following examples illustrate how to perform valve operations.
+
+Valve closure can be simulated by defining
+the valve closure start time (:math:`ts`),
+the operating duration (:math:`t_c`),
+the valve open percentage when the closure is completed (:math:`se`),
+and the closure constant (:math:`m`), which characterizes
+the shape of the closure curve.
+These parameters essentially define the valve closure curve.
+For example, the code below will yield the blue curve
+shown in :numref:`valve_closure`.
+If the closure constant (:math:`m`) is
+instead set to :math:`2`, the valve curve will then correspond to the
+orange curve in :numref:`valve_closure`.
+
+
+.. code:: python
+
+ tc = 1 # valve closure period [s]
+ ts = 0 # valve closure start time [s]
+ se = 0.5 # end open ratio
+ m = 1 # closure constant [dimensionless]
+ valve_op = [tc,ts,se,m]
+ tm.valve_closure('VALVE',valve_op)
+
+.. _valve_closure:
+.. figure:: figures/valve_closure.png
+ :width: 500
+ :alt: valve_closure
+
+ Valve closure operating rule
+
+Furthermore, valve opening can be simulated by defining a similar set of
+parameters related to the valve opening curve. The valve opening curves
+with :math:`m=1` and :math:`m=2` are illustrated in :numref:`valve_opening`.
+
+.. code:: python
+
+ tc = 1 # valve opening period [s]
+ ts = 0 # valve opening start time [s]
+ se = 0.5 # end open ratio
+ m = 1 # opening constant [dimensionless]
+ valve_op = [tc,ts,se,m]
+ tm.valve_opening('VALVE',valve_op)
+
+
+.. _valve_opening:
+.. figure:: figures/valve_opening.png
+ :width: 500
+ :alt: valve_opening
+
+ Valve opening operating rule
+
+
+Pump Operations
+^^^^^^^^^^^^^^^^
+
+The TSNet also includes the capability to perform controlled pump operations
+by specifying how the pump rotation speed changes over time.
+Explicitly, during pump start-up, the rotational speed of the pump
+is increased based on the user defined operating rule.
+The pump is then modeled using the two compatibility equations,
+a continuity equation, the pump characteristic curve at given rotation speed,
+and the affinity laws [LAJW99]_, thus resulting in
+the rise of pump flowrate and the addition of mechanical energy.
+Conversely, during pump shut-off, as the rotational speed of the pump
+decreased according to the user defined operating rule,
+the pump flowrate and the addition of mechanical energy decline.
+However, pump shut-off due to power failure,
+when the reduction of pump rotation speed
+depends on the characteristics of the pump (such as the rotate moment of inertia),
+has not been included yet.
+
+The following example shows how to add pump shut-off event to the network,
+where the parameters are defined in the same manner as in valve closure:
+
+.. code:: python
+
+ tc = 1 # pump closure period
+ ts = 0 # pump closure start time
+ se = 0 # end open percentage
+ m = 1 # closure constant
+ pump_op = [tc,ts,se,m]
+ tm.pump_shut_off('PUMP2', pump_op)
+
+Correspondingly, the controlled pump opening can be simulated using:
+
+.. code:: python
+
+ tc = 1 # pump opening period [s]
+ ts = 0 # pump opening start time [s]
+ se = 1 # end open percentage [s]
+ m = 1 # opening constant [dimensionless]
+ pump_op = [tc,ts,se,m]
+ tm.pump_start_up('PUMP2',pump_op)
+
+It should be noted that a check valve is assumed in each pump, indicating
+that the reverse flow will be prevented immediately.
+
+
+Leaks
+^^^^^^^
+
+In TSNet, leaks and bursts are assigned to the network nodes.
+A leak is defined by specifying the leaking node name and the
+emitter coefficient (:math:`k_l`):
+
+.. code:: python
+
+ emitter_coeff = 0.01 # [ m^3/s/(m H20)^(1/2)]
+ tm.add_leak('JUNCTION-22', emitter_coeff)
+
+
+Existing leaks should be included in the initial condition solver
+(WNTR simulator);
+thus, it is necessary to define the leaks before calculating
+the initial conditions.
+For more information about the inclusion of leaks in steady state
+calculation, please refer to WNTR documentation [WNTRSi]_.
+During the transient simulation, the leaking node is modeled
+using the two compatibility equations, a continuity equation, and an orifice
+equation which quantifies the leak discharge (:math:`Q_l`):
+
+.. math::
+ Q_l = k_l \sqrt{{H_p}_l}
+
+where :math:`{H_p}_l` is the pressure head at the leaking node.
+Moreover, if the pressure head is negative, the leak discharge
+will be set to zero, assuming a backflow preventer is installed
+on the leaking node.
+
+
+Bursts
+^^^^^^
+
+The simulation of burst and leaks is very similar. They share similar
+set of governing equations. The only difference is that the burst opening
+is simulated only during the transient calculation and not included in the
+initial condition calculation.
+In other words, using burst, the user can model new and evolving condition,
+while the leak model simulates an existing leak in the system.
+In TSNet, the burst is assumed to be developed
+linearly, indicating that the burst area increases linearly from zero to
+a size specified by the user during the specified time period.
+Thus, a burst event can be modeled by defining the start and end time of the
+burst, and the final emitter coefficient when the burst
+is fully developed:
+
+.. code:: python
+
+ ts = 1 # burst start time
+ tc = 1 # time for burst to fully develop
+ final_burst_coeff = 0.01 # final burst coeff [ m^3/s/(m H20)^(1/2)]
+ tm.add_burst('JUNCTION-20', ts, tc, final_burst_coeff)
+
+
+Demand Pulse
+^^^^^^^^^^^^
+
+TSNet simulates transients generated by instantaneous demand pulse by allowing the demand
+coefficient to change with time
+We assume that the amplitude of a demand pulse (:math:`pa(t)`) follows a symmetrical trapezoidal
+time-domain function, as illustrated in :numref:`demandpulse`; thus,
+the demand pulse can be modeled by defining the start time (:math:`ts`),
+the total duration (:math:`tc`), the transmission time (:math:`tp`),
+and the peak of the amplitude (:math:`dp`).
+Moreover, it should be noted that the assumed trapezoidal pulse shape is defined by method
+*demandpulse()* in :class:`~tsnet.network.model` module.
+It can be easily modified to take any shape with moderate coding efforts.
+Subsequently, the time-varying demand coefficient is defined as
+:math:`k(t) = k_0 + k_0\times pa(t)`.
+
+
+.. _demandpulse:
+.. figure:: figures/DemandMultiplier.png
+ :width: 300
+ :alt: demandpulse
+
+ Demand pulse curve
+
+A demand pulse shape is defined and assigned to a specified junction:
+
+.. code:: python
+
+ tc = 1 # total demand period [s]
+ ts = 1 # demand pulse start time [s]
+ tp = 0.2 # demand pulse transmission time [s]
+ dp = 1 # demand peak amplitude [unitless]
+ demand_pulse = [tc,ts,tp,dpa]
+ tm.add_demand_pulse('N2',demand_pulse)
+
+
+
+
+
diff --git a/Python/tsnet/docs/usage.rst b/Python/tsnet/docs/usage.rst
new file mode 100644
index 0000000..9b5dc0b
--- /dev/null
+++ b/Python/tsnet/docs/usage.rst
@@ -0,0 +1,37 @@
+===============
+Getting Started
+===============
+
+To use tsnet in a project, open a Python console and import the package::
+
+ import tsnet
+
+Simple example
+---------------
+
+A simple example, Tnet1_valve_closure.py is included in the examples folder.
+This example demonstrates how to:
+
+* Import tsnet
+
+* Generate a transient model
+
+* Set wave speed
+
+* Set time step and simulation period
+
+* Perform initial condition calculation
+
+* Define valve closure rule
+
+* Run transient simulation and save results to .obj file
+
+* Plot simulation results
+
+.. literalinclude:: ../examples/Tnet1_valve_closure.py
+ :lines: 2-42
+
+
+Three additional EPANET INP files and example files are also included
+in the TSNet examples repository in the examples folder.
+Example networks range from a simple 8-node network to a 126-node network.
diff --git a/Python/tsnet/docs/validation.rst b/Python/tsnet/docs/validation.rst
new file mode 100644
index 0000000..8693ae1
--- /dev/null
+++ b/Python/tsnet/docs/validation.rst
@@ -0,0 +1,163 @@
+======================
+Comparison with Hammer
+======================
+
+During the development process, we have consistently compared TSNet results with
+Bentley Hammer [HAMMER]_ using different networks and many different transient events.
+In this section, we present the comparison between TSNet and Hammer results.
+The Hammer models used to generate the events is also included
+in the GitHub example directory (https://github.com/glorialulu/TSNet/tree/master/examples/networks)
+for the user's reference.
+
+
+Tnet 0
+^^^^^^^^^
+
+We first show the comparison for a simple network,
+consisting of one reservoir, two pipes, and one valve, as illustrated in :numref:`tnet0_network`.
+The wave speed for both pipes is :math:`1200m/s`, and lengths and diameters are given in the figure.
+The transient event is generated by closing the end-valve at the beginning of the simulation
+during 2s; thus, the flow rate at the end valve decreases linearly from :math:`0.05m^3/s` at :math:`t=0s` to
+:math:`0m^3/s` at :math:`t=2s` and remains zero thereafter.
+:numref:`tnet0_hammer` (a) shows the flow rate through the valve, and
+:numref:`tnet0_hammer` (b) presents the pressure transients generated at node N-1 during 60s simulation period.
+The solid line represents TSNet results and the dashed-dotted line shows Hammer results.
+These results indicate a perfect match between TSNet and Hammer simulation results for this simple network.
+
+
+.. _tnet0_network:
+.. figure:: figures/tnet0_network.png
+ :width: 500
+ :alt: tnet0_network
+
+ Topology of a simple network.
+
+.. _tnet0_hammer:
+.. figure:: figures/tnet0_calibration.png
+ :width: 500
+ :alt: tnet0_hammer
+
+ Comparison of TSNet and Hammer results: (a) flow at the valve; (b) pressure head at N-1.
+
+
+Tnet 3
+^^^^^^^
+
+We then show the comparison between TSNet and Hammer results for
+a more complicated network, Tnet3,
+for three different transient events:
+
+1. Shut down of PUMP-1,
+
+2. Burst at JUNCTION-73, and
+
+3. Closure of VALVE-1.
+
+The results for the three transient-generating events are shown in
+:numref:`pump_hammer`, :numref:`burst_hammer`, and :numref:`valve_hammer`, respectively.
+
+.. The Hammer model that was used to generate the events is also included
+ in the GitHub example directory for the user's reference.
+
+* We would like to note beforehand that we do not expect to
+ obtain the exact same results from TSNet
+ as Hammer since different numerical schemes were implemented,
+ such as wave speed adjustment, pressure dependent demand, and boundary conditions.
+
+.. In fact, due to the fact that Hammer is a closed-source software,
+ we do not know precisely what numerical schemes are implemented in Hammer,
+ which directly motivated us to develop TSNet in the first place.
+
+
+Pump shut-down
+~~~~~~~~~~~~~~~~~
+
+Both TSNet and Hammer are utilized to simulate
+the shut down of PUMP-1.
+The time step is specified as 0.002s in both software.
+:numref:`pump_hammer` reports the pressure change with respect to the nominal pressure
+at multiple junctions, where the solid lines represent TSNet results
+and the dashed lines show Hammer results.
+TSNet and Hammer results are very similar to each other
+in terms of attenuation and phase shift throughout the 20s simulation period,
+despite slight discrepancies, which can be explained by
+the different wave speed adjustment schemes and boundary condition configurations adopted
+by the two software.
+
+.. _pump_hammer:
+.. figure:: figures/tnet3_pump_hammer_002.png
+ :width: 500
+ :alt: pump_hammer
+
+ Comparison of pressure transients at multiple junctions generated by shutting down PUMP-1 in TNet3:
+ TSNet (solid lines) Hammer (dashed lines) results.
+
+.. Moreover, we tested the consistency of the solution when altering
+ the time step of the simulation in TSNet and Hammer.
+ We simulated the pump shut-down event with different time steps, i.e., :math:`dt = \{0.002s, 0.0055, 0.0115s\}`
+ and plot the results in :numref:`convergence`.
+ The green and purple lines represent the pressure at JUNCTION-30, and JUNCTION-90, respectively,
+ and the different line types (solid, dashed, dotted) represent different time steps (see legend).
+ :numref:`convergence` (a) represents the results from TSNet, and
+ :numref:`convergence` (b) shows the results from Hammer.
+ We observe that the pressure transients simulated by TSNet with different time steps, resemble closely
+ with each other, and all of pressure traces disclose anticipated level of details about the reflection,
+ transmission, propagation, and attenuation of the pressure waves.
+ However, the Hammer predicts significantly different and uncharacteristic results with time steps larger than
+ 0.002s (i.e., :math:`dt =\{0.0055s, 0.0115s\}`), with small transient amplitude, delayed pressure peaks,
+ and high attenuation.
+ The pressure transients exhibit consistency only when the time step is smaller than 0.002s,
+ which is the reason why we chose time step as 0.002s to compare the results from Hammer and TSNet.
+
+
+
+
+Burst event
+~~~~~~~~~~~
+
+Aburst event was simulated at Junction-73 using both TSNet and Hammer.
+:numref:`burst_hammer` reports the pressure change with respect to the nominal pressure
+at multiple junctions, where the solid lines represent TSNet results,
+and the dashed lines show Hammer results.
+It can be observed that during the first transient cycle, i.e., around 0-8s,
+TSNet and Hammer results exhibit very good agreement with each other.
+Although the discrepancies increase a bit in terms of attenuation and phase shift during the latter period,
+the overall match is satisfactory considering that different time step and wave speed adjustment schemes
+are adopted in the two software.
+
+
+.. _burst_hammer:
+.. figure:: figures/tnet3_burst_hammer.png
+ :width: 500
+ :alt: burst_hammer
+
+ Comparison of pressure transients at multiple junctions generated by the burst at JUNCTION-73 in Tnet3:
+ TSNet (solid lines) Hammer (dashed lines) results.
+
+Valve closure
+~~~~~~~~~~~~~
+
+Both TSNet and Hammer are utilized to simulate
+the closure of VALVE-1.
+The comparison of the results is presented in :numref:`valve_hammer`.
+Again, adequate resemblance can be observed between the TSNet (a) and
+Hammer results (b). Considering that pressure transients are of smaller amplitude and
+more chaotic, the results are presented in two separate plots with same scale for clarity.
+
+.. _valve_hammer:
+.. figure:: figures/tnet3_valve_hammer.png
+ :width: 500
+ :alt: valve_hammer
+
+ Comparison of pressure transients at multiple junctions generated by closing VALVE-1 in Tnet3:
+ (a): TSNet results, (b): Hammer results.
+
+
+.. In summary, we are able to show adequate consistency between TSNet and Hammer
+ results in two networks undergoing different transient events.
+ In the Reservoir-Pipe-Valve network, shown in :numref:`tnet0_network`, TSNet and Hammer predict exact same
+ pressure and flow results when a transient event is generated by gradually closing the end-valve.
+ In the larger network, TSNet and Hammer results are remarkably similar with each other despite minor discrepancies
+ due to the differences in modeling and numerical schemes.
+ Moreover, as presented in :numref:`convergence`,
+ TSNet performs better with relatively large time step than Hammer.
\ No newline at end of file
diff --git a/Python/tsnet/docs/wordlist.txt b/Python/tsnet/docs/wordlist.txt
new file mode 100644
index 0000000..f08a770
--- /dev/null
+++ b/Python/tsnet/docs/wordlist.txt
@@ -0,0 +1,2 @@
+tsnet
+moc
diff --git a/Python/tsnet/examples/.DS_Store b/Python/tsnet/examples/.DS_Store
new file mode 100644
index 0000000..9a05d23
Binary files /dev/null and b/Python/tsnet/examples/.DS_Store differ
diff --git a/Python/tsnet/examples/Tnet00_valve_closure.py b/Python/tsnet/examples/Tnet00_valve_closure.py
new file mode 100644
index 0000000..062cdf4
--- /dev/null
+++ b/Python/tsnet/examples/Tnet00_valve_closure.py
@@ -0,0 +1,28 @@
+import tsnet
+# Open an example network and create a transient model
+inp_file = 'networks/Tnet00.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+dt = 0.1
+tf = 60 # simulation period [s]
+tm.set_time(tf,dt)
+
+# Set valve closure
+tc = 0 # valve closure period [s]
+ts = 2 # valve closure start time [s]
+se = 0 # end open percentage [s]
+m = 1 # closure constant [dimensionless]
+valve_op = [tc,ts,se,m]
+tm.valve_closure('3',valve_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet0' # name of the object for saving simulation results
+tm1 = tsnet.simulation.MOCSimulator(tm, results_obj)
\ No newline at end of file
diff --git a/Python/tsnet/examples/Tnet0_valve_closure.py b/Python/tsnet/examples/Tnet0_valve_closure.py
new file mode 100644
index 0000000..1281d56
--- /dev/null
+++ b/Python/tsnet/examples/Tnet0_valve_closure.py
@@ -0,0 +1,85 @@
+import tsnet
+# Open an example network and create a transient model
+inp_file = '/Users/luxing/Code/TSNet/examples/networks/Tnet0.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+dt = 0.01
+tf = 25 # simulation period [s]
+tm.set_time(tf,dt)
+
+# Set valve closure
+tc = 0 # valve closure period [s]
+ts = 0 # valve closure start time [s]
+se = 0 # end open percentage [s]
+m = 1 # closure constant [dimensionless]
+valve_op = [tc, ts, se, m]
+tm.valve_closure('3',valve_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'PDD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet0' # name of the object for saving simulation results
+friction = 'steady'
+tm1 = tsnet.simulation.MOCSimulator(tm, results_obj, friction)
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+tm.set_time(tf,dt)
+tm.valve_closure('3',valve_op)
+
+# Initialize steady state simulation
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+friction = 'quasi-steady'
+tm2 = tsnet.simulation.MOCSimulator(tm, results_obj, friction)
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+
+tm.set_time(tf,dt)
+
+
+# Set valve closure
+tm.valve_closure('3',valve_op)
+
+# Initialize steady state simulation
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+friction = 'unsteady'
+tm3 = tsnet.simulation.MOCSimulator(tm, results_obj, friction)
+#%%
+# report results
+import matplotlib.pyplot as plt
+node = '2'
+head1 = tm1.get_node(node).head
+t1 = tm1.simulation_timestamps
+head2 = tm2.get_node(node).head
+t2 = tm2.simulation_timestamps
+head3 = tm3.get_node(node).head
+t3 = tm3.simulation_timestamps
+fig = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(t1, head1, 'k',label='steady', linewidth=2.5)
+plt.plot(t2, head2, 'b', label='quasi-steady', linewidth=2.5)
+plt.plot(t3, head3, 'r',label='unsteady', linewidth=2.5)
+plt.xlim([t1[0],t1[-1]])
+plt.xlabel("Time [s]")
+plt.ylabel("Pressure Head [m]")
+plt.legend(loc='best')
+plt.show()
+fig.savefig('tnet0_unsteady_friction.pdf', format='pdf',dpi=500)
diff --git a/Python/tsnet/examples/Tnet0_valve_closure_surge_tank.py b/Python/tsnet/examples/Tnet0_valve_closure_surge_tank.py
new file mode 100644
index 0000000..cce3fbf
--- /dev/null
+++ b/Python/tsnet/examples/Tnet0_valve_closure_surge_tank.py
@@ -0,0 +1,120 @@
+import tsnet
+# Open an example network and create a transient model
+inp_file = '/Users/luxing/Code/TSNet/examples/networks/Tnet0.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+dt = 0.1
+tf = 60 # simulation period [s]
+tm.set_time(tf,dt)
+
+# Set valve closure
+tc = 0 # valve closure period [s]
+ts = 2 # valve closure start time [s]
+se = 0 # end open percentage [s]
+m = 1 # closure constant [dimensionless]
+valve_op = [tc,ts,se,m]
+tm.valve_closure('3',valve_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+tank_height = 100 # tank height [m]
+water_height = 50 # initial water level [m]
+tank_node = '2'
+tank_area = 100 # tank cross sectional area [m^2]
+tm.add_surge_tank(tank_node, [tank_area], 'open')
+
+# Transient simulation
+results_obj = 'Tnet0' # name of the object for saving simulation results
+tm1 = tsnet.simulation.MOCSimulator(tm, results_obj)
+
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+tm.set_time(tf,dt)
+
+# Set valve closure
+tm.valve_closure('3',valve_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+tank_height = 100 # tank height [m]
+water_height =40 # initial water level [m]
+tank_node = '2'
+tank_area = 10 # tank cross sectional area [m^2]
+tm.add_surge_tank(tank_node, [tank_area,tank_height,water_height], 'closed')
+
+# Transient simulation
+results_obj = 'Tnet0' # name of the object for saving simulation results
+tm2 = tsnet.simulation.MOCSimulator(tm, results_obj)
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+tm.set_time(tf,dt)
+
+# Set valve closure
+tm.valve_closure('3',valve_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet0' # name of the object for saving simulation results
+tm3 = tsnet.simulation.MOCSimulator(tm, results_obj)
+
+
+#%%
+# report results
+import matplotlib.pyplot as plt
+node = '3'
+norm_head_nl1 = tm1.get_node(node).head - tm1.get_node(node).head[0]
+norm_head_nl2 = tm2.get_node(node).head - tm2.get_node(node).head[0]
+norm_head_nl3 = tm3.get_node(node).head - tm3.get_node(node).head[0]
+
+fig1 = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(tm.simulation_timestamps,norm_head_nl1,'r-',label='w surge tank $A_s=10m^2$', linewidth=2.5)
+plt.plot(tm.simulation_timestamps,norm_head_nl2,'g-',label='w surge tank $A_s=100m^2$', linewidth=2.5)
+plt.plot(tm.simulation_timestamps,norm_head_nl3,'k-',label='wo surge tank', linewidth=2.5)
+plt.xlim([tm.simulation_timestamps[0],tm.simulation_timestamps[-1]])
+plt.title('Node %s' %node)
+plt.xlabel("Time [s]")
+plt.ylabel("Pressure Head Change [m]")
+plt.legend(loc='best')
+plt.grid(False)
+plt.show()
+# fig1.savefig('./docs/figures/tnet1_node.png', format='png',dpi=100)
+
+#%%
+# report results
+import matplotlib.pyplot as plt
+node1 = tm1.get_node(tank_node)
+t1 = tm1.simulation_timestamps
+node2 = tm2.get_node(tank_node)
+t2 = tm1.simulation_timestamps
+fig = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(t1, node1.tank_flow_timeseries, 'r',label='w surge tank $A_s=10m^2$', linewidth=2.5)
+plt.plot(t2, node2.tank_flow_timeseries, 'g',label='w surge tank $A_s=100m^2$', linewidth=2.5)
+plt.xlim([t1[0],t1[-1]])
+plt.xlabel("Time [s]")
+plt.ylabel("Flow into tank [m^3s]")
+plt.legend(loc='best')
+plt.grid(True)
+plt.show()
diff --git a/Python/tsnet/examples/Tnet1_demand_pulse.py b/Python/tsnet/examples/Tnet1_demand_pulse.py
new file mode 100644
index 0000000..330b010
--- /dev/null
+++ b/Python/tsnet/examples/Tnet1_demand_pulse.py
@@ -0,0 +1,84 @@
+import tsnet
+#%%
+# Open an example network and create a transient model
+inp_file = '/Users/luxing/Code/TSNet/examples/networks/Tnet1.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+dt = 0.1 # time step [s], if not given, use the maximum allowed dt
+tf = 20 # simulation period [s]
+tm.set_time(tf,dt)
+
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Add demand pulse
+tc = 1 # total demand period [s]
+ts = 1 # demand pulse start time [s]
+tp = 0.2 # demand pulse increase time [s]
+dp = 1 # demand pulse increase multiples [s]
+demand_pulse = [tc,ts,tp,dp]
+tm.add_demand_pulse('N2',demand_pulse)
+
+# Transient simulation
+results_obj = 'Tnet1' # name of the object for saving simulation results
+tm = tsnet.simulation.MOCSimulator(tm, results_obj)
+node = 'N2'
+node = tm.get_node(node)
+head1 = node.head
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+dt = 0.1 # time step [s], if not given, use the maximum allowed dt
+tf = 20 # simulation period [s]
+tm.set_time(tf,dt)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Add demand pulse
+tc = 1 # total demand period [s]
+ts = 1 # demand pulse start time [s]
+tp = 0.2 # demand pulse increase time [s]
+dp = 1 # demand pulse increase multiples [s]
+demand_pulse = [tc,ts,tp,dp]
+tm.add_demand_pulse('N2',demand_pulse)
+
+tc = 1 # total demand period [s]
+ts = 2 # demand pulse start time [s]
+tp = 0.2 # demand pulse increase time [s]
+dp = 1 # demand pulse increase multiples [s]
+demand_pulse = [tc,ts,tp,dp]
+tm.add_demand_pulse('N4',demand_pulse)
+
+# Transient simulation
+results_obj = 'Tnet1' # name of the object for saving simulation results
+tm = tsnet.simulation.MOCSimulator(tm, results_obj)
+node = 'N2'
+node = tm.get_node(node)
+head2 = node.head
+
+
+# report results
+import matplotlib.pyplot as plt
+
+fig = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(tm.simulation_timestamps,head1, 'k', label ='dpa =1', linewidth=2.5)
+plt.plot(tm.simulation_timestamps,head2, 'r', label ='dpa =2', linewidth=2.5)
+plt.xlim([tm.simulation_timestamps[0],tm.simulation_timestamps[-1]])
+plt.xlabel("Time [s]")
+plt.ylabel("Pressure Head [m]")
+plt.legend(loc='best')
+plt.show()
+fig.savefig('demand_pulse_N2.pdf', format='pdf',dpi=500)
diff --git a/Python/tsnet/examples/Tnet1_valve_closure.py b/Python/tsnet/examples/Tnet1_valve_closure.py
new file mode 100644
index 0000000..cbbb602
--- /dev/null
+++ b/Python/tsnet/examples/Tnet1_valve_closure.py
@@ -0,0 +1,28 @@
+import tsnet
+# Open an example network and create a transient model
+tm = tsnet.network.TransientModel('/Users/luxing/Code/TSNet/examples/networks/Tnet1.inp')
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+
+# Set time options
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Set valve closure
+ts = 5 # valve closure start time [s]
+tc = 1 # valve closure period [s]
+se = 0 # end open percentage [s]
+m = 2 # closure constant [dimensionless]
+tm.valve_closure('VALVE',[tc,ts,se,m])
+
+# Initialize steady state simulation
+t0=0
+tm = tsnet.simulation.Initializer(tm,t0)
+
+# Transient simulation
+tm = tsnet.simulation.MOCSimulator(tm)
+
+# report results
+node = ['N2','N3']
+tm.plot_node_head(node)
diff --git a/Python/tsnet/examples/Tnet1_valve_closure_surge_tank.py b/Python/tsnet/examples/Tnet1_valve_closure_surge_tank.py
new file mode 100644
index 0000000..fefc2d7
--- /dev/null
+++ b/Python/tsnet/examples/Tnet1_valve_closure_surge_tank.py
@@ -0,0 +1,125 @@
+import tsnet
+import numpy as np
+# Open an example network and create a transient model
+inp_file = '/Users/luxing/Code/TSNet/examples/networks/Tnet1.inp'
+# Set valve closure
+tc = 0.6 # valve closure period [s]
+ts = 0 # valve closure start time [s]
+se = 0 # end open percentage [s]
+m = 1 # closure constant [dimensionless]
+valve_op = [tc,ts,se,m]
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+dt = 0.1 # time step [s], if not given, use the maximum allowed dt
+tf = 60 # simulation period [s]
+n = 6
+tm.set_time_N(tf,n)
+
+# Set valve closure
+tm.valve_closure('VALVE', valve_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+tank_height = 10 # tank height [m]
+water_height = 5 # initial water level [m]
+tank_node = 'N5'
+tank_area = 10 # tank cross sectional area [m^2]
+tm.add_surge_tank(tank_node, [tank_area,tank_height,water_height], 'closed')
+# Transient simulation
+results_obj = 'Tnet1' # name of the object for saving simulation results
+friction = 'steady'
+tm1 = tsnet.simulation.MOCSimulator(tm, results_obj,friction)
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+tm.set_time_N(tf,n)
+
+tm.valve_closure('VALVE', valve_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+tank_height = 10 # tank height [m]
+water_height = 5 # initial water level [m]
+tank_node = 'N5'
+tank_area = 100 # tank cross sectional area [m^2]
+tm.add_surge_tank(tank_node, [tank_area,tank_height,water_height], 'closed')
+# Transient simulation
+results_obj = 'Tnet1' # name of the object for saving simulation results
+friction = 'steady'
+tm2= tsnet.simulation.MOCSimulator(tm, results_obj,friction)
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+tm.set_time_N(tf,n)
+
+tm.valve_closure('VALVE', valve_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+# Transient simulation
+results_obj = 'Tnet1' # name of the object for saving simulation results
+friction = 'steady'
+tm3= tsnet.simulation.MOCSimulator(tm, results_obj,friction)
+#%%
+# report results
+import matplotlib.pyplot as plt
+node = 'N2'
+head1 = tm1.get_node(node).head
+t1 = tm1.simulation_timestamps
+head2 = tm2.get_node(node).head
+t2 = tm2.simulation_timestamps
+head3 = tm3.get_node(node).head
+t3 = tm3.simulation_timestamps
+fig = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(t1, head1, 'r',label='w surge tank $A_s=10m^2$', linewidth=2.5)
+plt.plot(t2, head2, 'g', label='wo surge tank $A_s=100m^2$', linewidth=2.5)
+plt.plot(t3, head3, 'k', label='wo surge tank', linewidth=2.5)
+plt.xlim([t1[0],t1[-1]])
+plt.title(node)
+plt.xlabel("Time [s]")
+plt.ylabel("Pressure Head [m] ")
+plt.legend(loc='best')
+plt.show()
+
+# %%
+# report results
+import matplotlib.pyplot as plt
+node1 = tm1.get_node(tank_node)
+t1 = tm1.simulation_timestamps
+node2 = tm2.get_node(tank_node)
+t2 = tm1.simulation_timestamps
+fig = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(t1, node1.tank_flow_timeseries, 'r',label='w surge tank $A_s=10m^2$', linewidth=2.5)
+#plt.plot(t2, node2.tank_flow_timeseries, 'g',label='w surge tank $A_s=100m^2$', linewidth=2.5)
+plt.xlim([t1[0],t1[-1]])
+plt.xlabel("Time [s]")
+plt.ylabel("Flow into tank [m^3/s]")
+plt.legend(loc='best')
+plt.grid(True)
+plt.show()
+
+
+fig = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(t1, node1.water_level_timeseries, 'r',label='w surge tank $A_s=10m^2$', linewidth=2.5)
+#plt.plot(t2, node2.water_level_timeseries, 'g',label='w surge tank $A_s=100m^2$', linewidth=2.5)
+plt.xlim([t1[0],t1[-1]])
+plt.xlabel("Time [s]")
+plt.ylabel("Water level in tank [m]")
+plt.legend(loc='best')
+plt.show()
diff --git a/Python/tsnet/examples/Tnet1_valve_closure_unsteafy_friction.py b/Python/tsnet/examples/Tnet1_valve_closure_unsteafy_friction.py
new file mode 100644
index 0000000..22e83af
--- /dev/null
+++ b/Python/tsnet/examples/Tnet1_valve_closure_unsteafy_friction.py
@@ -0,0 +1,111 @@
+import tsnet
+import numpy as np
+# Open an example network and create a transient model
+inp_file = '/Users/luxing/Code/TSNet/examples/networks/Tnet1.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+dt = 0.1 # time step [s], if not given, use the maximum allowed dt
+tf = 60 # simulation period [s]
+n = 100
+tm.set_time_N(tf,n)
+
+# Set valve closure
+tc = 0.6 # valve closure period [s]
+ts = 0 # valve closure start time [s]
+se = 0 # end open percentage [s]
+m = 1 # closure constant [dimensionless]
+valve_op = [tc,ts,se,m]
+percent_open = np.linspace(100,0,11)
+kl = [1/0.2, 2.50, 1.25, 0.625, 0.333, 0.17,
+ 0.100, 0.0556, 0.0313, 0.0167, 0.0]
+curve = [(percent_open[i], kl[i]) for i in range(len(kl))]
+tm.valve_closure('VALVE', valve_op,curve)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet1' # name of the object for saving simulation results
+friction = 'steady'
+tm1 = tsnet.simulation.MOCSimulator(tm, results_obj,friction)
+
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+tm.set_time_N(tf,n)
+
+# Set valve closure
+tc = 0.6 # valve closure period [s]
+ts = 0 # valve closure start time [s]
+se = 0 # end open percentage [s]
+m = 1 # closure constant [dimensionless]
+valve_op = [tc,ts,se,m]
+tm.valve_closure('VALVE',valve_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet1' # name of the object for saving simulation results
+friction = 'quasi-steady'
+tm2 = tsnet.simulation.MOCSimulator(tm, results_obj,friction)
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+tm.set_time_N(tf,n)
+
+
+# Set valve closure
+tc = 0.6 # valve closure period [s]
+ts = 0 # valve closure start time [s]
+se = 0 # end open percentage [s]
+m = 1 # closure constant [dimensionless]
+valve_op = [tc,ts,se,m]
+tm.valve_closure('VALVE',valve_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet1' # name of the object for saving simulation results
+friction = 'unsteady'
+tm3 = tsnet.simulation.MOCSimulator(tm, results_obj,friction)
+
+#%%
+# report results
+import matplotlib.pyplot as plt
+node = 'N2'
+head1 = tm1.get_node(node).head
+t1 = tm1.simulation_timestamps
+head2 = tm2.get_node(node).head
+t2 = tm2.simulation_timestamps
+head3 = tm3.get_node(node).head
+t3 = tm3.simulation_timestamps
+fig = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(t1, head1, 'k',label='steady', linewidth=2.5)
+plt.plot(t2, head2, 'b', label='quasi-steady', linewidth=2.5)
+plt.plot(t3, head3, 'r',label='unsteady', linewidth=2.5)
+plt.xlim([t1[0],t1[-1]])
+plt.xlabel("Time [s]")
+plt.ylabel("Pressure Head [m]")
+plt.legend(loc='best')
+plt.show()
+fig.savefig('tnet1_unsteady_friction.pdf', format='pdf',dpi=500)
+# %%
diff --git a/Python/tsnet/examples/Tnet2_pump_shutdown.py b/Python/tsnet/examples/Tnet2_pump_shutdown.py
new file mode 100644
index 0000000..96a22cf
--- /dev/null
+++ b/Python/tsnet/examples/Tnet2_pump_shutdown.py
@@ -0,0 +1,59 @@
+import tsnet
+# open an example network and create a transient model
+inp_file = '/Users/luxing/Code/TSNet/examples/networks/Tnet2.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.)
+# Set time step
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Set pump shut off
+tc = 1 # pump closure period
+ts = 1 # pump closure start time
+se = 0 # end open percentage
+m = 1 # closure constant
+pump_op = [tc,ts,se,m]
+tm.pump_shut_off('PUMP2', pump_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or PPD
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet2' # name of the object for saving simulation results.head
+tm = tsnet.simulation.MOCSimulator(tm,results_obj)
+#%%
+# report results
+import matplotlib.pyplot as plt
+node = 'JUNCTION-105'
+node = tm.get_node(node)
+fig = plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='w')
+plt.plot(tm.simulation_timestamps, node._head, 'k', lw=3)
+plt.xlim([tm.simulation_timestamps[0],tm.simulation_timestamps[-1]])
+# plt.title('Pressure Head at Node %s '%node)
+plt.xlabel("Time [s]", fontsize=14)
+plt.ylabel("Pressure Head [m]", fontsize=14)
+
+
+# plt.legend(loc='best')
+# plt.grid(True)
+plt.show()
+# fig.savefig('./docs/figures/tnet2_node.png', format='png',dpi=100)
+
+pipe = 'PIPE-109'
+pipe = tm.get_link(pipe)
+fig = plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='w')
+plt.plot(tm.simulation_timestamps,pipe.start_node_velocity,label='Start Node')
+plt.plot(tm.simulation_timestamps,pipe.end_node_velocity,label='End Node')
+plt.xlim([tm.simulation_timestamps[0],tm.simulation_timestamps[-1]])
+plt.title('Velocity of Pipe %s '%pipe)
+plt.xlabel("Time [s]")
+plt.ylabel("Velocity [m/s]")
+plt.legend(loc='best')
+plt.grid(True)
+plt.show()
+# fig.savefig('./docs/figures/tnet2_pipe.png', format='png',dpi=100)
+
diff --git a/Python/tsnet/examples/Tnet2_pump_shutdown_surgetank.py b/Python/tsnet/examples/Tnet2_pump_shutdown_surgetank.py
new file mode 100644
index 0000000..370f64e
--- /dev/null
+++ b/Python/tsnet/examples/Tnet2_pump_shutdown_surgetank.py
@@ -0,0 +1,83 @@
+import tsnet
+# open an example network and create a transient model
+inp_file = '/Users/luxing/Code/TSNet/examples/networks/Tnet2.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.)
+# Set time step
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Set pump shut off
+tc = 1 # pump closure period
+ts = 0 # pump closure start time
+se = 0 # end open percentage
+m = 1 # closure constant
+pump_op = [tc,ts,se,m]
+tm.pump_shut_off('PUMP2', pump_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or PPD
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet2' # name of the object for saving simulation results.head
+tm1 = tsnet.simulation.MOCSimulator(tm,results_obj)
+
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.)
+# Set time step
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Set pump shut off
+tc = 1 # pump closure period
+ts = 0 # pump closure start time
+se = 0 # end open percentage
+m = 1 # closure constant
+pump_op = [tc,ts,se,m]
+tm.pump_shut_off('PUMP2', pump_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or PPD
+
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+tank_node = 'JUNCTION-105'
+tank_height = 10 # tank height [m]
+water_height = 5 # initial water level [m]
+tank_area = 10 # tank cross sectional area [m^2]
+tm.add_surge_tank(tank_node, [tank_area,tank_height,water_height], 'closed')
+
+# Transient simulation
+results_obj = 'Tnet2' # name of the object for saving simulation results.head
+
+tm2 = tsnet.simulation.MOCSimulator(tm,results_obj)
+
+#%%
+
+# report results
+import matplotlib.pyplot as plt
+node = '169'
+head1 = tm1.get_node(node).head
+t1 = tm1.simulation_timestamps
+head2 = tm2.get_node(node).head
+t2 = tm2.simulation_timestamps
+fig = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(t1, head1, 'k',label='wo surge tank', linewidth=2.5)
+plt.plot(t2, head2, 'r', label='w surge tank', linewidth=2.5)
+plt.xlim([t1[0],t1[-1]])
+plt.xlabel("Time [s]")
+plt.ylabel("Pressure Head [m]")
+plt.legend(loc='best')
+plt.show()
+fig.savefig('tnet2_surge_tank.pdf', format='pdf',dpi=500)
+# fig.savefig('./docs/figures/tnet2_node.png', format='png',dpi=100)
+
+
diff --git a/Python/tsnet/examples/Tnet2_pump_shutdown_unsteady_friction.py b/Python/tsnet/examples/Tnet2_pump_shutdown_unsteady_friction.py
new file mode 100644
index 0000000..91ddf17
--- /dev/null
+++ b/Python/tsnet/examples/Tnet2_pump_shutdown_unsteady_friction.py
@@ -0,0 +1,107 @@
+import tsnet
+# open an example network and create a transient model
+inp_file = 'networks/Tnet2.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.)
+# Set time step
+tf = 10 # simulation period [s]
+tm.set_time(tf)
+
+# Set pump shut off
+tc = 1 # pump closure period
+ts = 0 # pump closure start time
+se = 0 # end open percentage
+m = 1 # closure constant
+pump_op = [tc,ts,se,m]
+tm.pump_shut_off('PUMP2', pump_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or PPD
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet2' # name of the object for saving simulation results.head
+friction ='steady'
+tm1 = tsnet.simulation.MOCSimulator(tm,results_obj,friction)
+
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.)
+# Set time step
+tf = 10 # simulation period [s]
+tm.set_time(tf)
+
+# Set pump shut off
+tc = 1 # pump closure period
+ts = 0 # pump closure start time
+se = 0 # end open percentage
+m = 1 # closure constant
+pump_op = [tc,ts,se,m]
+tm.pump_shut_off('PUMP2', pump_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or PPD
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet2' # name of the object for saving simulation results.head
+friction ='quasi-steady'
+tm2 = tsnet.simulation.MOCSimulator(tm,results_obj,friction)
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.)
+# Set time step
+tf = 10 # simulation period [s]
+tm.set_time(tf)
+
+# Set pump shut off
+tc = 1 # pump closure period
+ts = 0 # pump closure start time
+se = 0 # end open percentage
+m = 1 # closure constant
+pump_op = [tc,ts,se,m]
+tm.pump_shut_off('PUMP2', pump_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or PPD
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'Tnet2' # name of the object for saving simulation results.head
+friction ='unsteady'
+tm3 = tsnet.simulation.MOCSimulator(tm,results_obj,friction)
+#%%
+
+# report results
+import matplotlib.pyplot as plt
+node = 'JUNCTION-105'
+head1 = tm1.get_node(node).head
+t1 = tm1.simulation_timestamps
+head2 = tm2.get_node(node).head
+t2 = tm2.simulation_timestamps
+head3 = tm3.get_node(node).head
+t3 = tm3.simulation_timestamps
+fig = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(t1, head1, 'k',label='steady', linewidth=2.5)
+plt.plot(t2, head2, 'b', label='quasi-steady', linewidth=2.5)
+plt.plot(t3, head3, 'r',label='unsteady', linewidth=2.5)
+plt.xlim([t1[0],t1[-1]])
+plt.xlabel("Time [s]")
+plt.ylabel("Pressure Head [m]")
+plt.legend(loc='best')
+plt.show()
+fig.savefig('tnet2_unsteady_friction.pdf', format='pdf',dpi=500)
+# fig.savefig('./docs/figures/tnet2_node.png', format='png',dpi=100)
+
+
diff --git a/Python/tsnet/examples/Tnet3_burst_leak.py b/Python/tsnet/examples/Tnet3_burst_leak.py
new file mode 100644
index 0000000..d6e9191
--- /dev/null
+++ b/Python/tsnet/examples/Tnet3_burst_leak.py
@@ -0,0 +1,91 @@
+import tsnet
+# open an example network and create a transient model
+inp_file = '/Users/luxing/Code/TSNet/examples/networks/Tnet3.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+import numpy as np
+wavespeed = np.random.normal(1200., 100., size=tm.num_pipes)
+tm.set_wavespeed(wavespeed)
+# Set time step
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Add leak
+# emitter_coeff = 0.01 # [ m^3/s/(m H20)^(1/2)]
+# tm.add_leak('JUNCTION-22', emitter_coeff)
+
+# Add burst
+ts = 1 # burst start time
+tc = 1 # time for burst to fully develop
+final_burst_coeff = 0.01 # final burst coeff [ m^3/s/(m H20)^(1/2)]
+tm.add_burst('JUNCTION-20', ts, tc, final_burst_coeff)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'PDD' # or Epanet
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+result_obj = 'Tnet3' # name of the object for saving simulation results
+tm = tsnet.simulation.MOCSimulator(tm,result_obj)
+
+# report results
+import matplotlib.pyplot as plt
+node = 'JUNCTION-22'
+node = tm.get_node(node)
+fig = plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(tm.simulation_timestamps,node.emitter_discharge)
+plt.xlim([tm.simulation_timestamps[0],tm.simulation_timestamps[-1]])
+plt.title('Leak discharge at Node %s '%node)
+plt.xlabel("Time [s]")
+plt.ylabel("Leak discharge [m^3/s]")
+plt.legend(loc='best')
+plt.grid(True)
+plt.show()
+# fig.savefig('./docs/figures/tnet3_leak.png', format='png',dpi=100)
+
+node = 'JUNCTION-20'
+node = tm.get_node(node)
+fig = plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(tm.simulation_timestamps,node.emitter_discharge)
+plt.xlim([tm.simulation_timestamps[0],tm.simulation_timestamps[-1]])
+plt.title('Burst discharge at Node %s '%node)
+plt.xlabel("Time [s]")
+plt.ylabel("Burst discharge [m^3/s]")
+plt.legend(loc='best')
+plt.grid(True)
+plt.show()
+# fig.savefig('./docs/figures/tnet3_burst.png', format='png',dpi=100)
+
+pipe = 'LINK-40'
+pipe = tm.get_link(pipe)
+fig = plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(tm.simulation_timestamps,pipe.start_node_velocity,label='Start Node')
+plt.plot(tm.simulation_timestamps,pipe.end_node_velocity,label='End Node')
+plt.xlim([tm.simulation_timestamps[0],tm.simulation_timestamps[-1]])
+plt.title('Velocity of Pipe %s '%pipe)
+plt.xlabel("Time [s]")
+plt.ylabel("Velocity [m/s]")
+plt.legend(loc='best')
+plt.grid(True)
+plt.show()
+# fig.savefig('./docs/figures/tnet3_pipe.png', format='png',dpi=100)
+
+node1 = tm.get_node('JUNCTION-8')
+node2 = tm.get_node('JUNCTION-16')
+node3 = tm.get_node('JUNCTION-45')
+node4 = tm.get_node('JUNCTION-90')
+fig = plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(tm.simulation_timestamps, node1._head, label='JUNCTION-8')
+plt.plot(tm.simulation_timestamps, node2._head, label='JUNCTION-16')
+plt.plot(tm.simulation_timestamps, node3._head, label='JUNCTION-45')
+plt.plot(tm.simulation_timestamps, node4._head, label='JUNCTION-90')
+plt.xlim([tm.simulation_timestamps[0],tm.simulation_timestamps[-1]])
+plt.title('Head on Junctions')
+plt.xlabel("Time [s]")
+plt.ylabel("Head [m]")
+plt.legend(loc='best')
+plt.grid(True)
+plt.show()
+# fig.savefig('./docs/figures/tnet3_multi.png', format='png',dpi=100)
diff --git a/Python/tsnet/examples/Tnet3_burst_surge_tank.py b/Python/tsnet/examples/Tnet3_burst_surge_tank.py
new file mode 100644
index 0000000..26a489a
--- /dev/null
+++ b/Python/tsnet/examples/Tnet3_burst_surge_tank.py
@@ -0,0 +1,140 @@
+import tsnet
+# open an example network and create a transient model
+inp_file = 'networks/Tnet3.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+import numpy as np
+wavespeed = 1200
+tm.set_wavespeed(wavespeed)
+# Set time step
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Add burst
+ts = 1 # burst start time
+tc = 1 # time for burst to fully develop
+final_burst_coeff = 0.01 # final burst coeff [ m^3/s/(m H20)^(1/2)]
+tm.add_burst('JUNCTION-73', ts, tc, final_burst_coeff)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or Epanet
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+result_obj = 'Tnet3' # name of the object for saving simulation results
+tm1 = tsnet.simulation.MOCSimulator(tm,result_obj)
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+import numpy as np
+tm.set_wavespeed(wavespeed)
+# Set time step
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Add burst
+ts = 1 # burst start time
+tc = 1 # time for burst to fully develop
+final_burst_coeff = 0.01 # final burst coeff [ m^3/s/(m H20)^(1/2)]
+tm.add_burst('JUNCTION-73', ts, tc, final_burst_coeff)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or Epanet
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# add air chamber
+tank_node = 'JUNCTION-89'
+tank_area = 10 # tank cross sectional area [m^2]
+tank_height = 10 # tank height [m]
+water_height = 5 # initial water level [m]
+tm.add_surge_tank(tank_node, [tank_area,tank_height,water_height], 'closed')
+
+# Transient simulation
+result_obj = 'Tnet3' # name of the object for saving simulation results
+tm2 = tsnet.simulation.MOCSimulator(tm,result_obj)
+
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+import numpy as np
+tm.set_wavespeed(wavespeed)
+# Set time step
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Add burst
+ts = 1 # burst start time
+tc = 1 # time for burst to fully develop
+final_burst_coeff = 0.01 # final burst coeff [ m^3/s/(m H20)^(1/2)]
+tm.add_burst('JUNCTION-73', ts, tc, final_burst_coeff)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or Epanet
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# add air chamber
+tank_node = 'JUNCTION-89'
+tank_area = 10 # tank cross sectional area [m^2]
+
+tm.add_surge_tank(tank_node, [tank_area], 'open')
+
+# Transient simulation
+result_obj = 'Tnet3' # name of the object for saving simulation results
+tm3 = tsnet.simulation.MOCSimulator(tm,result_obj)
+
+#%%
+# report results
+import matplotlib.pyplot as plt
+node1 = 'JUNCTION-16'
+node2 = 'JUNCTION-20'
+node3 = 'JUNCTION-30'
+node4 = 'JUNCTION-45'
+node5 = 'JUNCTION-90'
+fig, axs = plt.subplots(1,3,figsize=(15,5), dpi=80, facecolor='w', edgecolor='k')
+axs[0].plot(tm1.simulation_timestamps,tm1.get_node(node1).head-tm1.get_node(node1).head[0],'C0-',label='JUNCTION-16', linewidth=2.5)
+axs[0].plot(tm1.simulation_timestamps,tm1.get_node(node2).head-tm1.get_node(node2).head[0],'C1-',label='JUNCTION-20', linewidth=2.5)
+axs[0].plot(tm1.simulation_timestamps,tm1.get_node(node3).head-tm1.get_node(node3).head[0],'C2-', label='JUNCTION-30',linewidth=2.5)
+axs[0].plot(tm1.simulation_timestamps,tm1.get_node(node4).head-tm1.get_node(node4).head[0],'C3-', label='JUNCTION-45',linewidth=2.5)
+axs[0].plot(tm1.simulation_timestamps,tm1.get_node(node5).head-tm1.get_node(node5).head[0],'C4-',label='JUNCTION-90', linewidth=2.5)
+axs[0].set_xlim([tm1.simulation_timestamps[0],tm1.simulation_timestamps[-1]])
+axs[0].set_ylim([-45,15])
+axs[0].set_xlabel("Time [s]")
+axs[0].set_ylabel("Head change [m]")
+axs[0].legend(loc='best')
+axs[0].set_title('(a)')
+#axs[0].show()
+#fig.savefig('tnet3_wo_surge_tank.pdf', format='pdf',dpi=100)
+
+axs[1].plot(tm2.simulation_timestamps,tm2.get_node(node1).head-tm2.get_node(node1).head[0],'C0',label='JUNCTION-16', linewidth=2.5)
+axs[1].plot(tm2.simulation_timestamps,tm2.get_node(node2).head-tm2.get_node(node2).head[0],'C1',label='JUNCTION-20', linewidth=2.5)
+axs[1].plot(tm2.simulation_timestamps,tm2.get_node(node3).head-tm2.get_node(node3).head[0],'C2',label='JUNCTION-30', linewidth=2.5)
+axs[1].plot(tm2.simulation_timestamps,tm2.get_node(node4).head-tm2.get_node(node4).head[0],'C3',label='JUNCTION-45', linewidth=2.5)
+axs[1].plot(tm2.simulation_timestamps,tm2.get_node(node5).head-tm2.get_node(node5).head[0],'C4',label='JUNCTION-90', linewidth=2.5)
+axs[1].set_xlim([tm1.simulation_timestamps[0],tm1.simulation_timestamps[-1]])
+axs[1].set_ylim([-45,15])
+axs[1].set_xlabel("Time [s]")
+#axs[1].set_ylabel("Head [m]")
+axs[1].legend(loc='lower right')
+axs[1].set_title('(b)')
+
+axs[2].plot(tm3.simulation_timestamps,tm3.get_node(node1).head-tm3.get_node(node1).head[0],'C0',label='JUNCTION-16', linewidth=2.5)
+axs[2].plot(tm3.simulation_timestamps,tm3.get_node(node2).head-tm3.get_node(node2).head[0],'C1',label='JUNCTION-20', linewidth=2.5)
+axs[2].plot(tm3.simulation_timestamps,tm3.get_node(node3).head-tm3.get_node(node3).head[0],'C2',label='JUNCTION-30', linewidth=2.5)
+axs[2].plot(tm3.simulation_timestamps,tm3.get_node(node4).head-tm3.get_node(node4).head[0],'C3',label='JUNCTION-45', linewidth=2.5)
+axs[2].plot(tm3.simulation_timestamps,tm3.get_node(node5).head-tm3.get_node(node5).head[0],'C4',label='JUNCTION-90', linewidth=2.5)
+axs[2].set_xlim([tm1.simulation_timestamps[0],tm1.simulation_timestamps[-1]])
+axs[2].set_xlabel("Time [s]")
+axs[2].set_ylim([-45,15])
+#axs[1].set_ylabel("Head [m]")
+axs[2].legend(loc='lower right')
+axs[2].set_title('(c)')
+
+plt.show()
+plt.tight_layout()
+fig.savefig('tnet3_compare_surge_tank.pdf', format='pdf', bbox_inches = 'tight',dpi=100)
diff --git a/Python/tsnet/examples/Tnet3_burst_unsteady_friction.py b/Python/tsnet/examples/Tnet3_burst_unsteady_friction.py
new file mode 100644
index 0000000..58253ca
--- /dev/null
+++ b/Python/tsnet/examples/Tnet3_burst_unsteady_friction.py
@@ -0,0 +1,161 @@
+import tsnet
+# open an example network and create a transient model
+inp_file = '/Users/luxing/Code/TSNet/examples/networks/Tnet3.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+import numpy as np
+wavespeed = np.random.normal(1200., 100., size=tm.num_pipes)
+tm.set_wavespeed(wavespeed)
+# Set time step
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Add burst
+ts = 1 # burst start time
+tc = 1 # time for burst to fully develop
+final_burst_coeff = 0.01 # final burst coeff [ m^3/s/(m H20)^(1/2)]
+tm.add_burst('JUNCTION-73', ts, tc, final_burst_coeff)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or Epanet
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+result_obj = 'Tnet3' # name of the object for saving simulation results
+tm1 = tsnet.simulation.MOCSimulator(tm,result_obj)
+#%%
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+import numpy as np
+tm.set_wavespeed(wavespeed)
+# Set time step
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Add burst
+ts = 1 # burst start time
+tc = 1 # time for burst to fully develop
+final_burst_coeff = 0.01 # final burst coeff [ m^3/s/(m H20)^(1/2)]
+tm.add_burst('JUNCTION-73', ts, tc, final_burst_coeff)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or Epanet
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+result_obj = 'Tnet3' # name of the object for saving simulation results
+friction ='quasi-steady'
+tm2 = tsnet.simulation.MOCSimulator(tm,result_obj,friction)
+
+#%% tm = tsnet.network.TransientModel(inp_file)
+# Set wavespeed
+tm = tsnet.network.TransientModel(inp_file)
+tm.set_wavespeed(wavespeed)
+# Set time step
+tf = 20 # simulation period [s]
+tm.set_time(tf)
+
+# Add burst
+ts = 1 # burst start time
+tc = 1 # time for burst to fully develop
+final_burst_coeff = 0.01 # final burst coeff [ m^3/s/(m H20)^(1/2)]
+tm.add_burst('JUNCTION-73', ts, tc, final_burst_coeff)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0s
+engine = 'DD' # or Epanet
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+result_obj = 'Tnet3' # name of the object for saving simulation results
+friction ='unsteady'
+tm3 = tsnet.simulation.MOCSimulator(tm,result_obj,friction)
+#%%
+# report results
+import matplotlib.pyplot as plt
+node1 = 'JUNCTION-16'
+node2 = 'JUNCTION-20'
+node3 = 'JUNCTION-30'
+node4 = 'JUNCTION-45'
+node5 = 'JUNCTION-90'
+fig = plt.figure(figsize=(8,5), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(tm1.simulation_timestamps,tm1.get_node(node1).head-tm1.get_node(node1).head[0],'C0--', linewidth=2.5)
+plt.plot(tm1.simulation_timestamps,tm1.get_node(node2).head-tm1.get_node(node2).head[0],'C1--', linewidth=2.5)
+plt.plot(tm1.simulation_timestamps,tm1.get_node(node3).head-tm1.get_node(node3).head[0],'C2--', linewidth=2.5)
+plt.plot(tm1.simulation_timestamps,tm1.get_node(node4).head-tm1.get_node(node4).head[0],'C3--', linewidth=2.5)
+plt.plot(tm1.simulation_timestamps,tm1.get_node(node5).head-tm1.get_node(node5).head[0],'C4--', linewidth=2.5)
+
+#plt.plot(tm2.simulation_timestamps,tm2.get_node(node1).head-tm2.get_node(node1).head[0],'C0', ls='dotted', linewidth=2.5)
+#plt.plot(tm2.simulation_timestamps,tm2.get_node(node2).head-tm2.get_node(node2).head[0],'C1', ls='dotted', linewidth=2.5)
+#plt.plot(tm2.simulation_timestamps,tm2.get_node(node3).head-tm2.get_node(node3).head[0],'C2', ls='dotted', linewidth=2.5)
+#plt.plot(tm2.simulation_timestamps,tm2.get_node(node4).head-tm2.get_node(node4).head[0],'C3', ls='dotted', linewidth=2.5)
+#plt.plot(tm2.simulation_timestamps,tm2.get_node(node5).head-tm2.get_node(node5).head[0],'C4', ls='dotted', linewidth=2.5)
+
+plt.plot(tm3.simulation_timestamps,tm3.get_node(node1).head-tm3.get_node(node1).head[0],'C0', label='JUNCTION-16', linewidth=2.5)
+plt.plot(tm3.simulation_timestamps,tm3.get_node(node2).head-tm3.get_node(node2).head[0],'C1', label='JUNCTION-20', linewidth=2.5)
+plt.plot(tm3.simulation_timestamps,tm3.get_node(node3).head-tm3.get_node(node3).head[0],'C2', label='JUNCTION-30', linewidth=2.5)
+plt.plot(tm3.simulation_timestamps,tm3.get_node(node4).head-tm3.get_node(node4).head[0],'C3', label='JUNCTION-45', linewidth=2.5)
+plt.plot(tm3.simulation_timestamps,tm3.get_node(node5).head-tm3.get_node(node5).head[0],'C4', label='JUNCTION-90', linewidth=2.5)
+
+plt.xlim([tm1.simulation_timestamps[0],tm1.simulation_timestamps[-1]])
+plt.xlabel("Time [s]")
+plt.ylabel("Head [m]")
+plt.legend(loc='lower right')
+plt.show()
+fig.savefig('tnet3_unsteady_friction.pdf', format='pdf',dpi=100)
+
+
+#%%
+# report results
+import matplotlib.pyplot as plt
+node1 = 'JUNCTION-16'
+node2 = 'JUNCTION-20'
+node3 = 'JUNCTION-30'
+node4 = 'JUNCTION-45'
+node5 = 'JUNCTION-90'
+fig, axs = plt.subplots(1,3,figsize=(15,5), dpi=80, facecolor='w', edgecolor='k')
+axs[0].plot(tm1.simulation_timestamps,tm1.get_node(node1).head-tm1.get_node(node1).head[0],'C0-',label='JUNCTION-16', linewidth=2.5)
+axs[0].plot(tm1.simulation_timestamps,tm1.get_node(node2).head-tm1.get_node(node2).head[0],'C1-',label='JUNCTION-20', linewidth=2.5)
+axs[0].plot(tm1.simulation_timestamps,tm1.get_node(node3).head-tm1.get_node(node3).head[0],'C2-', label='JUNCTION-30',linewidth=2.5)
+axs[0].plot(tm1.simulation_timestamps,tm1.get_node(node4).head-tm1.get_node(node4).head[0],'C3-', label='JUNCTION-45',linewidth=2.5)
+axs[0].plot(tm1.simulation_timestamps,tm1.get_node(node5).head-tm1.get_node(node5).head[0],'C4-',label='JUNCTION-90', linewidth=2.5)
+axs[0].set_xlim([tm1.simulation_timestamps[0],tm1.simulation_timestamps[-1]])
+axs[0].set_ylim([-45,20])
+axs[0].set_xlabel("Time [s]")
+axs[0].set_ylabel("Head change [m]")
+axs[0].legend(loc='lower right')
+axs[0].set_title('(a)')
+#axs[0].show()
+#fig.savefig('tnet3_wo_surge_tank.pdf', format='pdf',dpi=100)
+
+axs[1].plot(tm2.simulation_timestamps,tm2.get_node(node1).head-tm2.get_node(node1).head[0],'C0-',label='JUNCTION-16', linewidth=2.5)
+axs[1].plot(tm2.simulation_timestamps,tm2.get_node(node2).head-tm2.get_node(node2).head[0],'C1-',label='JUNCTION-20', linewidth=2.5)
+axs[1].plot(tm2.simulation_timestamps,tm2.get_node(node3).head-tm2.get_node(node3).head[0],'C2-',label='JUNCTION-30', linewidth=2.5)
+axs[1].plot(tm2.simulation_timestamps,tm2.get_node(node4).head-tm2.get_node(node4).head[0],'C3-',label='JUNCTION-45', linewidth=2.5)
+axs[1].plot(tm2.simulation_timestamps,tm2.get_node(node5).head-tm2.get_node(node5).head[0],'C4-',label='JUNCTION-90', linewidth=2.5)
+axs[1].set_xlim([tm1.simulation_timestamps[0],tm1.simulation_timestamps[-1]])
+axs[1].set_ylim([-45,20])
+axs[1].set_xlabel("Time [s]")
+#axs[1].set_ylabel("Head [m]")
+axs[1].legend(loc='lower right')
+axs[1].set_title('(b)')
+
+axs[2].plot(tm3.simulation_timestamps,tm3.get_node(node1).head-tm3.get_node(node1).head[0],'C0',label='JUNCTION-16', linewidth=2.5)
+axs[2].plot(tm3.simulation_timestamps,tm3.get_node(node2).head-tm3.get_node(node2).head[0],'C1',label='JUNCTION-20', linewidth=2.5)
+axs[2].plot(tm3.simulation_timestamps,tm3.get_node(node3).head-tm3.get_node(node3).head[0],'C2',label='JUNCTION-30', linewidth=2.5)
+axs[2].plot(tm3.simulation_timestamps,tm3.get_node(node4).head-tm3.get_node(node4).head[0],'C3',label='JUNCTION-45', linewidth=2.5)
+axs[2].plot(tm3.simulation_timestamps,tm3.get_node(node5).head-tm3.get_node(node5).head[0],'C4',label='JUNCTION-90', linewidth=2.5)
+axs[2].set_xlim([tm1.simulation_timestamps[0],tm1.simulation_timestamps[-1]])
+axs[2].set_xlabel("Time [s]")
+axs[2].set_ylim([-45,20])
+#axs[1].set_ylabel("Head [m]")
+axs[2].legend(loc='lower right')
+axs[2].set_title('(c)')
+
+plt.show()
+plt.tight_layout()
+fig.savefig('tnet3_compare_unsteady_friction.pdf', format='pdf', bbox_inches = 'tight',dpi=100)
diff --git a/Python/tsnet/examples/networks/Tnet0.inp b/Python/tsnet/examples/networks/Tnet0.inp
new file mode 100644
index 0000000..f7e4f43
--- /dev/null
+++ b/Python/tsnet/examples/networks/Tnet0.inp
@@ -0,0 +1,141 @@
+[TITLE]
+
+
+[JUNCTIONS]
+;ID Elev Demand Pattern
+ 2 0 0 ;
+ 3 0 0 ;
+ 4 0 50 ;
+
+[RESERVOIRS]
+;ID Head Pattern
+ 1 750 ;
+
+[TANKS]
+;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
+
+[PIPES]
+;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
+ 1 1 2 1200 600 0.02 0 Open ;
+ 2 2 3 2400 1200 0.02 0 Open ;
+
+[PUMPS]
+;ID Node1 Node2 Parameters
+
+[VALVES]
+;ID Node1 Node2 Diameter Type Setting MinorLoss
+ 3 3 4 158 PRV 100000 0 ;
+
+[TAGS]
+
+[DEMANDS]
+;Junction Demand Pattern Category
+
+[STATUS]
+;ID Status/Setting
+ 3 Open
+
+[PATTERNS]
+;ID Multipliers
+
+[CURVES]
+;ID X-Value Y-Value
+
+[CONTROLS]
+
+
+
+[RULES]
+
+
+
+[ENERGY]
+ Global Efficiency 75
+ Global Price 0
+ Demand Charge 0
+
+[EMITTERS]
+;Junction Coefficient
+
+[QUALITY]
+;Node InitQual
+
+[SOURCES]
+;Node Type Quality Pattern
+
+[REACTIONS]
+;Type Pipe/Tank Coefficient
+
+
+[REACTIONS]
+ Order Bulk 1
+ Order Tank 1
+ Order Wall 1
+ Global Bulk 0
+ Global Wall 0
+ Limiting Potential 0
+ Roughness Correlation 0
+
+[MIXING]
+;Tank Model
+
+[TIMES]
+ Duration 0:00
+ Hydraulic Timestep 1:00
+ Quality Timestep 0:05
+ Pattern Timestep 1:00
+ Pattern Start 0:00
+ Report Timestep 1:00
+ Report Start 0:00
+ Start ClockTime 12 am
+ Statistic NONE
+
+[REPORT]
+ Status No
+ Summary No
+ Page 0
+
+[OPTIONS]
+ Units LPS
+ Headloss D-W
+ Specific Gravity 1
+ Viscosity 1
+ Trials 40
+ Accuracy 0.001
+ CHECKFREQ 2
+ MAXCHECK 10
+ DAMPLIMIT 0
+ Unbalanced Continue 10
+ Pattern 1
+ Demand Multiplier 1.0
+ Emitter Exponent 0.5
+ Quality None mg/L
+ Diffusivity 1
+ Tolerance 0.01
+
+[COORDINATES]
+;Node X-Coord Y-Coord
+ 2 -1167.70 8919.75
+ 3 293.21 8919.75
+ 4 704.78 8886.13
+ 1 -2319.96 8909.47
+
+[VERTICES]
+;Link X-Coord Y-Coord
+
+[LABELS]
+;X-Coord Y-Coord Label & Anchor Node
+ -2423.20 9069.59 "Reservoir"
+ -1705.20 8870.76 "Pipe1"
+ -468.04 8881.81 "Pipe2"
+ -1208.13 9043.82 "Junc2"
+ 231.48 9053.50 "Junc3"
+ 612.95 9040.58 "Junc4"
+
+[BACKDROP]
+ DIMENSIONS 0.00 0.00 10000.00 10000.00
+ UNITS None
+ FILE
+ OFFSET 0.00 0.00
+
+[END]
diff --git a/Python/tsnet/examples/networks/Tnet00.inp b/Python/tsnet/examples/networks/Tnet00.inp
new file mode 100644
index 0000000..89d9f10
--- /dev/null
+++ b/Python/tsnet/examples/networks/Tnet00.inp
@@ -0,0 +1,138 @@
+[TITLE]
+
+
+[JUNCTIONS]
+;ID Elev Demand Pattern
+ 3 0 0 ;
+ 4 0 50 ;
+
+[RESERVOIRS]
+;ID Head Pattern
+ 1 750 ;
+
+[TANKS]
+;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
+
+[PIPES]
+;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
+ 1 1 3 1200 1200 0.02 0 Open ;
+
+[PUMPS]
+;ID Node1 Node2 Parameters
+
+[VALVES]
+;ID Node1 Node2 Diameter Type Setting MinorLoss
+ 3 3 4 158 PRV 100000 0 ;
+
+[TAGS]
+
+[DEMANDS]
+;Junction Demand Pattern Category
+
+[STATUS]
+;ID Status/Setting
+ 3 Open
+
+[PATTERNS]
+;ID Multipliers
+
+[CURVES]
+;ID X-Value Y-Value
+
+[CONTROLS]
+
+
+
+
+[RULES]
+
+
+
+
+[ENERGY]
+ Global Efficiency 75
+ Global Price 0
+ Demand Charge 0
+
+[EMITTERS]
+;Junction Coefficient
+
+[QUALITY]
+;Node InitQual
+
+[SOURCES]
+;Node Type Quality Pattern
+
+[REACTIONS]
+;Type Pipe/Tank Coefficient
+
+
+[REACTIONS]
+ Order Bulk 1
+ Order Tank 1
+ Order Wall 1
+ Global Bulk 0
+ Global Wall 0
+ Limiting Potential 0
+ Roughness Correlation 0
+
+[MIXING]
+;Tank Model
+
+[TIMES]
+ Duration 0:00
+ Hydraulic Timestep 1:00
+ Quality Timestep 0:05
+ Pattern Timestep 1:00
+ Pattern Start 0:00
+ Report Timestep 1:00
+ Report Start 0:00
+ Start ClockTime 12 am
+ Statistic NONE
+
+[REPORT]
+ Status No
+ Summary No
+ Page 0
+
+[OPTIONS]
+ Units LPS
+ Headloss D-W
+ Specific Gravity 1
+ Viscosity 1
+ Trials 40
+ Accuracy 0.001
+ CHECKFREQ 2
+ MAXCHECK 10
+ DAMPLIMIT 0
+ Unbalanced Continue 10
+ Pattern 1
+ Demand Multiplier 1.0
+ Emitter Exponent 0.5
+ Quality None mg/L
+ Diffusivity 1
+ Tolerance 0.01
+
+[COORDINATES]
+;Node X-Coord Y-Coord
+ 3 293.21 8919.75
+ 4 704.78 8886.13
+ 1 -2319.96 8909.47
+
+[VERTICES]
+;Link X-Coord Y-Coord
+
+[LABELS]
+;X-Coord Y-Coord Label & Anchor Node
+ -2423.20 9069.59 "Reservoir"
+ -1208.85 8765.43 "Pipe1"
+ 231.48 9053.50 "Junc3"
+ 612.95 9040.58 "Junc4"
+
+[BACKDROP]
+ DIMENSIONS 0.00 0.00 10000.00 10000.00
+ UNITS None
+ FILE
+ OFFSET 0.00 0.00
+
+[END]
diff --git a/Python/tsnet/examples/networks/Tnet1.inp b/Python/tsnet/examples/networks/Tnet1.inp
new file mode 100644
index 0000000..b9978b7
--- /dev/null
+++ b/Python/tsnet/examples/networks/Tnet1.inp
@@ -0,0 +1,166 @@
+[TITLE]
+
+
+[JUNCTIONS]
+;ID Elev Demand Pattern
+ N3 0 0 ;
+ N2 0 25 ;
+ N5 0 0 ;
+ N4 0 25 ;
+ N6 0 0 ;
+ N7 0 0 ;
+ N8 0 100 ;
+
+[RESERVOIRS]
+;ID Head Pattern
+ R1 191 ;
+
+[TANKS]
+;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
+
+[PIPES]
+;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
+ P1 R1 N3 610 900 92 0 Open ;
+ P2 N3 N4 914 750 107 0 Open ;
+ P3 N3 N2 610 600 98 0 Open ;
+ P4 N4 N6 457 450 105 0 Open ;
+ P5 N4 N2 549 450 100 0 Open ;
+ P6 N5 N2 671 750 93 0 Open ;
+ P7 N5 N7 1000 900 105 0 Open ;
+ P8 N6 N5 457 600 105 0 Open ;
+ P9 N2 N6 488 450 140 0 Open ;
+
+[PUMPS]
+;ID Node1 Node2 Parameters
+
+[VALVES]
+;ID Node1 Node2 Diameter Type Setting MinorLoss
+ VALVE N7 N8 184 FCV 10000 0 ;
+
+[TAGS]
+
+[DEMANDS]
+;Junction Demand Pattern Category
+
+[STATUS]
+;ID Status/Setting
+ VALVE Open
+
+[PATTERNS]
+;ID Multipliers
+
+[CURVES]
+;ID X-Value Y-Value
+
+[CONTROLS]
+
+
+[RULES]
+
+
+[ENERGY]
+ Global Efficiency 75
+ Global Price 0
+ Demand Charge 0
+
+[EMITTERS]
+;Junction Coefficient
+
+[QUALITY]
+;Node InitQual
+
+[SOURCES]
+;Node Type Quality Pattern
+
+[REACTIONS]
+;Type Pipe/Tank Coefficient
+
+
+[REACTIONS]
+ Order Bulk 1
+ Order Tank 1
+ Order Wall 1
+ Global Bulk 0
+ Global Wall 0
+ Limiting Potential 0
+ Roughness Correlation 0
+
+[MIXING]
+;Tank Model
+
+[TIMES]
+ Duration 0:00
+ Hydraulic Timestep 1:00
+ Quality Timestep 0:05
+ Pattern Timestep 1:00
+ Pattern Start 0:00
+ Report Timestep 1:00
+ Report Start 0:00
+ Start ClockTime 12 am
+ Statistic NONE
+
+[REPORT]
+ Status No
+ Summary No
+ Page 0
+
+[OPTIONS]
+ Units LPS
+ Headloss H-W
+ Specific Gravity 1
+ Viscosity 1
+ Trials 40
+ Accuracy 0.001
+ CHECKFREQ 2
+ MAXCHECK 10
+ DAMPLIMIT 0
+ Unbalanced Continue 10
+ Pattern 1
+ Demand Multiplier 1.0
+ Emitter Exponent 0.5
+ Quality None mg/L
+ Diffusivity 1
+ Tolerance 0.01
+
+[COORDINATES]
+;Node X-Coord Y-Coord
+ N3 87.45 6543.21
+ N2 961.93 5658.44
+ N5 2649.18 5658.44
+ N4 1414.36 6965.59
+ N6 2361.11 6965.02
+ N7 3750.55 5656.40
+ N8 4091.79 5653.12
+ R1 -529.84 7427.98
+
+[VERTICES]
+;Link X-Coord Y-Coord
+
+[LABELS]
+;X-Coord Y-Coord Label & Anchor Node
+ -149.18 7047.33 "P1"
+ 601.85 6944.44 "P2"
+ 478.40 6296.30 "P3"
+ 1887.86 7170.78 "P4"
+ 992.80 6522.63 "P5"
+ 1774.69 5617.28 "P6"
+ 3184.16 5607.00 "P7"
+ 2582.45 6306.08 "P8"
+ 1620.37 6584.36 "P9"
+ -632.72 7366.26 "R1"
+ -77.16 6481.48 "N3"
+ 1404.32 7201.65 "N4"
+ 2350.82 7160.49 "N6"
+ 859.05 5576.13 "N2"
+ 2677.61 5561.25 "N5"
+ 3636.83 5596.71 "VALVE"
+ 3667.70 5864.20 "N7"
+ 4048.35 5853.91 "N8"
+
+[BACKDROP]
+ DIMENSIONS 0.00 0.00 10000.00 10000.00
+ UNITS None
+ FILE
+ OFFSET 0.00 0.00
+
+[END]
diff --git a/Python/tsnet/examples/networks/Tnet2.inp b/Python/tsnet/examples/networks/Tnet2.inp
new file mode 100644
index 0000000..0c18e48
--- /dev/null
+++ b/Python/tsnet/examples/networks/Tnet2.inp
@@ -0,0 +1,484 @@
+[TITLE]
+Scenario: Base
+Date: 6/26/2019 2:45:30 PM
+
+[JUNCTIONS]
+;ID Elev Demand Pattern
+ 275 10 0 ;
+ 273 8 0 ;
+ 271 6 0 ;
+ 269 0 0 ;
+ 267 21 0 ;
+ 265 0 0 ;
+ 263 0 0 ;
+ 261 0 0 ;
+ 259 25 0 ;
+ 257 17 0 ;
+ 255 27 40.39 1 ;
+ 253 36 54.52 1 ;
+ 251 30 24.16 1 ;
+ 249 18 0 ;
+ 247 18 70.38 1 ;
+ 243 14 4.34 1 ;
+ 241 13 0 ;
+ 239 13 44.61 1 ;
+ 237 14 15.61 1 ;
+ 231 5 16.48 1 ;
+ 229 10.5 64.18 1 ;
+ 225 8 22.8 1 ;
+ 219 4 41.32 1 ;
+ 217 6 24.22 1 ;
+ 215 7 92.19 1 ;
+ 213 7 13.94 1 ;
+ 211 7 8.67 1 ;
+ 209 -2 0.87 1 ;
+ 208 16 0 ;
+ 207 9 69.39 1 ;
+ 206 1 0 ;
+ 205 21 65.36 1 ;
+ 204 21 0 ;
+ 203 2 1 5 ;
+ 201 0.1 44.61 1 ;
+ 199 -2 119.32 1 ;
+ 197 23 17.04 1 ;
+ 195 15.5 0 ;
+ 193 18 71.31 1 ;
+ 191 25 81.9 1 ;
+ 189 4 107.92 1 ;
+ 187 12.5 0 ;
+ 185 16 25.65 1 ;
+ 184 16 0 ;
+ 183 11 0 ;
+ 181 8 0 ;
+ 179 8 0 ;
+ 173 -4 0 ;
+ 171 -4 39.34 1 ;
+ 169 -5 0 ;
+ 167 -5 14.56 1 ;
+ 166 -2 2.6 1 ;
+ 164 5 0 ;
+ 163 5 9.42 1 ;
+ 161 4 15.8 1 ;
+ 159 6 41.32 1 ;
+ 157 13.1 51.79 1 ;
+ 153 66.2 44.17 1 ;
+ 151 33.5 144.48 1 ;
+ 149 16 27.07 1 ;
+ 147 18.5 8.55 1 ;
+ 145 1 27.63 1 ;
+ 143 -4.5 6.2 1 ;
+ 141 4 9.85 1 ;
+ 139 31 5.89 1 ;
+ 131 6 42.75 1 ;
+ 129 51 0 ;
+ 127 56 17.66 1 ;
+ 125 11 45.6 1 ;
+ 123 11 1 2 ;
+ 121 -2 41.63 1 ;
+ 120 0 0 ;
+ 119 2 176.13 1 ;
+ 117 13.6 117.71 1 ;
+ 115 14 52.1 1 ;
+ 113 2 20.01 1 ;
+ 111 10 141.94 1 ;
+ 109 20.3 231.4 1 ;
+ 107 22 54.64 1 ;
+ JUNCTION-105 28.5 135.37 1 ;
+ 103 43 133.2 1 ;
+ 101 42 189.95 1 ;
+ 61 0 0 ;
+ 60 0 0 ;
+ 50 116.5 0 ;
+ 40 131.9 0 ;
+ 20 129 0 ;
+ 15 32 1 3 ;
+ 10 147 0 ;
+ 305-A 16.9067526676344 0 ;
+ 305-B 16.9067526676344 0 ;
+
+[RESERVOIRS]
+;ID Head Pattern
+ River 220 ;
+ Lake 167 ;
+
+[TANKS]
+;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
+ 3 129 29 4 35.5 164 84496.2760109511 ;
+ 2 116.5 23.5 6.5 40.3 50 12762.7201552085 ;
+ 1 131.9 13.1 0.0999999999999943 32.1 85 567.450173054656 ;
+
+[PIPES]
+;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
+ 204 184 205 4530 12 130 0 Open ;
+ 203 183 185 510 8 130 0 Open ;
+ 202 185 184 99.9 8 130 0 Open ;
+ 201 40 179 1190 12 130 0 Open ;
+ 199 179 183 210 12 130 0 Open ;
+ 191 271 171 760 24 130 0 Open ;
+ 189 171 173 500 30 141 0 Open ;
+ 187 169 171 1270 30 141 0 Open ;
+ 186 187 204 99.9 8 130 0 Open ;
+ 185 167 169 300 8 130 0 Open ;
+ 183 265 169 590 30 141 0 Open ;
+ 181 164 166 490 14 130 0 Open ;
+ 180 163 164 150 14 130 0 Open ;
+ 179 161 163 430 30 141 0 Open ;
+ 177 159 161 2000 30 141 0 Open ;
+ 175 157 159 2910 30 141 0 Open ;
+ 173 119 157 2080 30 141 0 Open ;
+ 169 125 153 4560 8 130 0 Open ;
+ 163 151 153 1170 12 130 0 Open ;
+ 161 149 151 1020 8 130 0 Open ;
+ 159 147 149 880 12 130 0 Open ;
+ 155 147 145 2200 12 130 0 Open ;
+ 153 145 141 3510 12 130 0 Open ;
+ 151 15 143 1650 8 130 0 Open ;
+ 149 143 141 1400 8 130 0 Open ;
+ 147 139 141 2050 8 130 0 Open ;
+ 145 129 139 2750 8 130 0 Open ;
+ 137 129 131 6480 16 130 0 Open ;
+ 135 127 129 900 24 130 0 Open ;
+ 133 20 127 785 20 130 0 Open ;
+ 131 125 127 3240 24 130 0 Open ;
+ 129 121 125 930 24 130 0 Open ;
+ 125 123 121 1500 30 141 0 Open ;
+ 123 121 119 2000 30 141 0 Open ;
+ 122 121 120 2050 8 130 0 Open ;
+ 121 120 117 1870 12 130 0 Open ;
+ 120 119 120 730 12 130 0 Open ;
+ 119 115 117 2180 12 130 0 Open ;
+ 117 263 JUNCTION-105 2725 12 130 0 Open ;
+ 116 113 193 1660 12 130 0 Open ;
+ 115 107 115 1950 8 130 0 Open ;
+ 114 115 113 2000 8 130 0 Open ;
+ 113 111 113 1680 12 130 0 Open ;
+ 112 115 111 1160 12 130 0 Open ;
+ 111 109 111 2000 12 130 0 Open ;
+ PIPE-109 103 109 3940 16 130 0 Open ;
+ 107 JUNCTION-105 107 1470 12 130 0 Open ;
+ 105 101 JUNCTION-105 2540 12 130 0 Open ;
+ 103 101 103 1350 16 130 0 Open ;
+ 101 10 101 14200 18 110 0 Open ;
+ 60 River 60 1231 24 140 0 Open ;
+ 50 2 50 99 99 199 0 Open ;
+ 40 1 40 99 99 199 0 Open ;
+ 20 3 20 99 99 199 0 Open ;
+ 329 61 123 45500 30 140 0 Open ;
+ 325 269 271 1290 8 130 0 Open ;
+ 323 201 275 300 12 130 0 Open ;
+ 321 163 265 1200 30 141 0 Open ;
+ 319 273 205 645 12 130 0 Open ;
+ 317 273 275 2230 8 130 0 Open ;
+ 315 181 271 290 24 130 0 Open ;
+ 313 269 189 646 12 130 0 Open ;
+ 311 193 267 1170 12 130 0 Open ;
+ 309 265 267 1580 8 130 0 Open ;
+ 307 261 263 350 12 130 0 Open ;
+ 305 117 261 645 12 130 0 Open ;
+ 303 257 261 1400 8 130 0 Open ;
+ 301 259 263 1400 8 130 0 Open ;
+ 299 257 259 350 8 130 0 Open ;
+ 297 120 257 645 8 130 0 Open ;
+ 295 249 251 1450 12 130 0 Open ;
+ 293 255 251 1100 8 130 0 Open ;
+ 291 255 253 1100 10 130 0 Open ;
+ 289 50 255 925 10 130 0 Open ;
+ 287 247 255 1390 10 130 0 Open ;
+ 285 247 249 100 12 130 0 Open ;
+ 283 239 249 430 12 130 0 Open ;
+ 281 241 247 445 10 130 0 Open ;
+ 277 241 243 2200 12 130 0 Open ;
+ 275 239 241 350 12 130 0 Open ;
+ 273 237 239 510 12 130 0 Open ;
+ 271 237 229 790 8 130 0 Open ;
+ 269 211 237 2080 12 130 0 Open ;
+ 263 229 231 1960 12 130 0 Open ;
+ 261 213 229 2200 8 130 0 Open ;
+ 257 217 225 1560 12 130 0 Open ;
+ 251 217 219 2050 14 130 0 Open ;
+ 249 215 217 1660 16 130 0 Open ;
+ 247 213 215 4285 16 130 0 Open ;
+ 245 211 213 990 16 130 0 Open ;
+ 243 209 211 1210 16 130 0 Open ;
+ 241 208 209 885 12 130 0 Open ;
+ 240 206 208 510 12 130 0 Open ;
+ 239 275 207 1430 12 130 0 Open ;
+ 238 207 206 450 12 130 0 Open ;
+ 237 205 207 1200 12 130 0 Open ;
+ 235 199 273 725 12 130 0 Open ;
+ 233 201 203 120 24 130 0 Open ;
+ 231 199 201 630 24 141 0 Open ;
+ 229 173 199 4000 24 141 0 Open ;
+ 225 111 197 2790 12 130 0 Open ;
+ 223 197 191 1150 12 130 0 Open ;
+ 221 161 195 2300 8 130 0 Open ;
+ 219 193 195 360 12 130 0 Open ;
+ 217 191 193 520 12 130 0 Open ;
+ 215 267 189 1230 12 130 0 Open ;
+ 213 191 187 2560 12 130 0 Open ;
+ 211 169 269 646 12 130 0 Open ;
+ 209 189 187 500 8 130 0 Open ;
+ 207 189 183 1350 12 130 0 Open ;
+ 205 204 185 1325 12 130 0 Open ;
+ P-1 119 305-A 1640 12 130 0 Open ;
+ P-2 305-B 151 1820 12 130 0 Open ;
+
+[PUMPS]
+;ID Node1 Node2 Parameters
+ PUMP1 60 61 HEAD 335 ;
+ PUMP2 Lake 10 HEAD 10 ;
+
+[VALVES]
+;ID Node1 Node2 Diameter Type Setting MinorLoss
+ TCV-1 305-A 305-B 6 TCV 0.2 0 ;
+
+[TAGS]
+
+[DEMANDS]
+;Junction Demand Pattern Category
+
+[STATUS]
+;ID Status/Setting
+ TCV-1 Open
+
+[PATTERNS]
+;ID Multipliers
+;
+ 1 1.34 1.94 1.46 1.44 0.76 0.92
+ 1 0.85 1.07 0.96 1.1 1.08 1.19
+ 1 1.16 1.08 0.96 0.83 0.79 0.74
+ 1 0.64 0.64 0.85 0.96 1.24 1.67
+;
+ 2 0 0 0 0 0 1219
+ 2 0 0 0 1866 1836 1818
+ 2 1818 1822 1822 1817 1824 1816
+ 2 1833 1817 1830 1814 1840 1859
+;
+ 3 620 620 620 620 620 360
+ 3 360 0 0 0 0 360
+ 3 360 360 360 360 0 0
+ 3 0 0 0 0 360 360
+;
+ 4 1637 1706 1719 1719 1791 1819
+ 4 1777 1842 1815 1825 1856 1801
+ 4 1819 1733 1664 1620 1613 1620
+ 4 1616 1647 1627 1627 1671 1668
+;
+ 5 4439 4531 4511 4582 4531 4582
+ 5 4572 4613 4643 4643 4592 4613
+ 5 4531 4521 4449 4439 4449 4460
+ 5 4439 4419 4368 4399 4470 4480
+;
+ ValveClosure 1
+
+[CURVES]
+;ID X-Value Y-Value
+;PUMP: PUMP: PUMP: PUMP: PUMP:
+ 335 0 200
+ 335 8000 138
+ 335 14000 86
+;PUMP: PUMP: PUMP: PUMP: EFFICIENCY:
+ 335E 0 75
+ 335E 8000 75
+ 335E 14000 75
+;PUMP: PUMP: PUMP: PUMP: PUMP:
+ 10 0 104
+ 10 2000 92
+ 10 4000 63
+;PUMP: PUMP: PUMP: PUMP: EFFICIENCY:
+ 10E 0 75
+ 10E 2000 75
+ 10E 4000 75
+
+[CONTROLS]
+
+
+
+
+[RULES]
+
+
+
+
+[ENERGY]
+ Global Efficiency 75
+ Global Price 0
+ Demand Charge 0
+
+[EMITTERS]
+;Junction Coefficient
+
+[QUALITY]
+;Node InitQual
+
+[SOURCES]
+;Node Type Quality Pattern
+
+[REACTIONS]
+;Type Pipe/Tank Coefficient
+
+
+[REACTIONS]
+ Order Bulk 1
+ Order Tank 1
+ Order Wall 1
+ Global Bulk 0
+ Global Wall 0
+ Limiting Potential 0
+ Roughness Correlation 0
+
+[MIXING]
+;Tank Model
+
+[TIMES]
+ Duration 24:00
+ Hydraulic Timestep 1:00
+ Quality Timestep 0:05
+ Pattern Timestep 1:00
+ Pattern Start 0:00
+ Report Timestep 1:00
+ Report Start 0:00
+ Start ClockTime 12 am
+ Statistic NONE
+
+[REPORT]
+ Status No
+ Summary No
+ Page 0
+
+[OPTIONS]
+ Units GPM
+ Headloss H-W
+ Specific Gravity 1
+ Viscosity 0.985218181818182
+ Trials 40
+ Accuracy 0.001
+ CHECKFREQ 2
+ MAXCHECK 10
+ DAMPLIMIT 0
+ Unbalanced Continue 10
+ Pattern 1
+ Demand Multiplier 1
+ Emitter Exponent 0.5
+ Quality Trace Lake
+ Diffusivity 1
+ Tolerance 0.01
+
+[COORDINATES]
+;Node X-Coord Y-Coord
+ 275 31.07 8.29
+ 273 29.16 7.38
+ 271 26.14 11.17
+ 269 25.03 12.14
+ 267 23.38 12.95
+ 265 25.39 13.60
+ 263 20.32 21.57
+ 261 20.79 21.45
+ 259 20.80 23.40
+ 257 21.17 23.32
+ 255 33.51 2.45
+ 253 32.17 1.88
+ 251 34.15 1.10
+ 249 35.02 1.81
+ 247 35.02 2.05
+ 243 37.04 0.00
+ 241 35.87 2.11
+ 239 35.76 2.31
+ 237 35.37 3.08
+ 231 38.38 2.54
+ 229 36.16 3.49
+ 225 43.53 7.38
+ 219 44.86 9.32
+ 217 42.11 8.67
+ 215 39.95 8.73
+ 213 35.26 6.16
+ 211 34.20 5.54
+ 209 33.76 6.59
+ 208 32.54 6.81
+ 207 31.00 6.61
+ 206 31.66 6.64
+ 205 29.20 6.46
+ 204 23.81 10.69
+ 203 31.14 8.89
+ 201 30.89 8.57
+ 199 29.42 8.44
+ 197 20.97 15.18
+ 195 23.18 14.72
+ 193 22.88 14.35
+ 191 22.10 14.07
+ 189 24.15 11.37
+ 187 23.64 11.04
+ 185 24.79 9.80
+ 184 25.15 9.52
+ 183 25.29 10.04
+ 181 25.72 10.83
+ 179 25.86 10.38
+ 173 26.87 11.59
+ 171 26.65 11.80
+ 169 25.68 12.74
+ 167 25.88 12.98
+ 166 26.48 15.13
+ 164 25.98 15.14
+ 163 25.39 14.98
+ 161 25.10 15.28
+ 159 23.12 17.50
+ 157 24.85 20.16
+ 153 28.13 22.63
+ 151 28.29 21.39
+ 149 29.62 20.74
+ 147 30.24 20.38
+ 145 33.02 19.29
+ 143 37.47 21.97
+ 141 35.68 23.08
+ 139 33.28 24.54
+ 131 37.89 29.55
+ 129 30.32 26.39
+ 127 29.29 26.40
+ 125 24.59 25.64
+ 123 23.37 27.31
+ 121 23.54 25.50
+ 120 22.08 23.10
+ 119 23.70 22.76
+ 117 21.67 21.29
+ 115 20.98 19.18
+ 113 22.04 16.61
+ 111 20.21 17.53
+ 109 17.64 18.92
+ 107 18.45 20.46
+ JUNCTION-105 16.97 21.28
+ 103 12.96 21.31
+ 101 13.81 22.94
+ 61 23.70 29.03
+ 60 23.90 29.94
+ 50 33.01 3.01
+ 40 27.02 9.81
+ 20 29.44 26.91
+ 15 38.68 23.76
+ 10 9.00 27.85
+ 305-A 25.08 22.31
+ 305-B 25.82 22.10
+ River 24.15 31.06
+ Lake 8.00 27.53
+ 3 29.41 27.27
+ 2 32.99 3.45
+ 1 27.46 9.84
+
+[VERTICES]
+;Link X-Coord Y-Coord
+ PUMP1 23.81 29.49
+ PUMP2 8.50 27.69
+
+[LABELS]
+;X-Coord Y-Coord Label & Anchor Node
+ 21.91 30.01 "PUMP1"
+ 7.86 28.64 "PUMP2"
+ 15.90 22.66 "JUNCTION-105"
+ 13.69 19.85 "PIPE-109"
+
+[BACKDROP]
+ DIMENSIONS 6.16 -1.55 46.70 32.61
+ UNITS None
+ FILE
+ OFFSET 0.00 0.00
+
+[END]
diff --git a/Python/tsnet/examples/networks/Tnet3.inp b/Python/tsnet/examples/networks/Tnet3.inp
new file mode 100644
index 0000000..1f1f24f
--- /dev/null
+++ b/Python/tsnet/examples/networks/Tnet3.inp
@@ -0,0 +1,649 @@
+[TITLE]
+
+
+[JUNCTIONS]
+;ID Elev Demand Pattern
+ JUNCTION-0 376.06999999999999 0.763534 PATTERN-0 ;
+ JUNCTION-1 192.0 0 ;
+ JUNCTION-2 363.13999999999999 0.830000 PATTERN-0 ;
+ JUNCTION-3 428.06999999999999 4.400000 PATTERN-0 ;
+ JUNCTION-4 477.81 3.836466 PATTERN-0 ;
+ JUNCTION-5 494.23000000000002 3.529833 PATTERN-0 ;
+ JUNCTION-6 505.0 1.850000 PATTERN-0 ;
+ JUNCTION-7 535.23000000000002 0 ;
+ JUNCTION-8 493.42000000000002 1.540000 PATTERN-0 ;
+ JUNCTION-9 488.29000000000002 0 ;
+ JUNCTION-10 333.62 0.341497 PATTERN-0 ;
+ JUNCTION-11 344.10000000000002 1.049859 PATTERN-0 ;
+ JUNCTION-12 379.5 0.025149 PATTERN-0 ;
+ JUNCTION-13 325.94999999999999 0 ;
+ JUNCTION-14 416.85000000000002 0 ;
+ JUNCTION-15 423.49000000000001 1.320167 PATTERN-0 ;
+ JUNCTION-16 383.0 0 ;
+ JUNCTION-17 385.06 25.715680 PATTERN-0 ;
+ JUNCTION-18 478.14999999999998 6.182285 PATTERN-0 ;
+ JUNCTION-19 558.92999999999995 4.603554 PATTERN-0 ;
+ JUNCTION-20 617.73000000000002 2.580000 PATTERN-0 ;
+ JUNCTION-21 652.41999999999996 0 ;
+ JUNCTION-22 625.96000000000004 4.290000 PATTERN-0 ;
+ JUNCTION-23 604.34000000000003 3.194580 PATTERN-0 ;
+ JUNCTION-24 636.61000000000001 0 ;
+ JUNCTION-25 653.92999999999995 5.970000 PATTERN-0 ;
+ JUNCTION-26 683.42999999999995 0 ;
+ JUNCTION-27 690.64999999999998 12.442156 PATTERN-0 ;
+ JUNCTION-28 701.69000000000005 2.092553 PATTERN-0 ;
+ JUNCTION-29 846.27999999999997 0 ;
+ JUNCTION-30 636.0 116.764931 PATTERN-0 ;
+ JUNCTION-31 600.42999999999995 2.370000 PATTERN-0 ;
+ JUNCTION-32 625.85000000000002 6.160000 PATTERN-0 ;
+ JUNCTION-33 622.77999999999997 0.958345 PATTERN-0 ;
+ JUNCTION-34 200.0 0 ;
+ JUNCTION-35 651.97000000000003 9.239535 PATTERN-0 ;
+ JUNCTION-36 634.11000000000001 0 ;
+ JUNCTION-37 677.04999999999995 3.286911 PATTERN-0 ;
+ JUNCTION-38 646.50999999999999 0 ;
+ JUNCTION-39 703.19000000000005 4.907129 PATTERN-0 ;
+ JUNCTION-40 741.63 3.393717 PATTERN-0 ;
+ JUNCTION-41 700.22000000000003 3.052871 PATTERN-0 ;
+ JUNCTION-42 728.04999999999995 11.414126 PATTERN-0 ;
+ JUNCTION-43 653.09000000000003 3.310000 PATTERN-0 ;
+ JUNCTION-44 678.5 5.167447 PATTERN-0 ;
+ JUNCTION-45 747.32000000000005 9.354966 PATTERN-0 ;
+ JUNCTION-46 820.24000000000001 4.365034 PATTERN-0 ;
+ JUNCTION-47 640.47000000000003 0 ;
+ JUNCTION-48 637.45000000000005 0 ;
+ JUNCTION-49 623.89999999999998 1.140000 PATTERN-0 ;
+ JUNCTION-50 611.08000000000004 3.811622 PATTERN-0 ;
+ JUNCTION-51 623.67999999999995 3.010000 PATTERN-0 ;
+ JUNCTION-52 613.26999999999998 4.918378 PATTERN-0 ;
+ JUNCTION-53 607.63 3.030000 PATTERN-0 ;
+ JUNCTION-54 602.11000000000001 4.190000 PATTERN-0 ;
+ JUNCTION-55 603.34000000000003 3.080000 PATTERN-0 ;
+ JUNCTION-56 606.94000000000005 0 ;
+ JUNCTION-57 617.97000000000003 0.431655 PATTERN-0 ;
+ JUNCTION-58 610.21000000000004 22.020000 PATTERN-0 ;
+ JUNCTION-59 620.95000000000005 0 ;
+ JUNCTION-60 623.99000000000001 0 ;
+ JUNCTION-61 625.38 0 ;
+ JUNCTION-62 625.39999999999998 0 ;
+ JUNCTION-63 623.95000000000005 0 ;
+ JUNCTION-64 623.13 0 ;
+ JUNCTION-65 619.37 0 ;
+ JUNCTION-66 619.72000000000003 0 ;
+ JUNCTION-67 624.5 0 ;
+ JUNCTION-68 617.08000000000004 20.900000 PATTERN-0 ;
+ JUNCTION-69 626.0 2.460000 PATTERN-0 ;
+ JUNCTION-70 619.11000000000001 6.250000 PATTERN-0 ;
+ JUNCTION-71 632.17999999999995 2.030000 PATTERN-0 ;
+ JUNCTION-72 622.35000000000002 2.793147 PATTERN-0 ;
+ JUNCTION-73 620.37 2.630000 PATTERN-0 ;
+ JUNCTION-74 622.34000000000003 1.070000 PATTERN-0 ;
+ JUNCTION-75 629.15999999999997 2.546853 PATTERN-0 ;
+ JUNCTION-76 622.54999999999995 2.670000 PATTERN-0 ;
+ JUNCTION-77 624.63999999999999 1.820000 PATTERN-0 ;
+ JUNCTION-78 618.01999999999998 0 ;
+ JUNCTION-79 617.88999999999999 0 ;
+ JUNCTION-80 616.88999999999999 0 ;
+ JUNCTION-81 623.58000000000004 3.460000 PATTERN-0 ;
+ JUNCTION-82 618.75999999999999 10.220000 PATTERN-0 ;
+ JUNCTION-83 617.71000000000004 7.541160 PATTERN-0 ;
+ JUNCTION-84 619.92999999999995 2.878840 PATTERN-0 ;
+ JUNCTION-85 620.25 0 ;
+ JUNCTION-86 623.48000000000002 0 ;
+ JUNCTION-87 622.25999999999999 0 ;
+ JUNCTION-88 621.69000000000005 0 ;
+ JUNCTION-89 626.80999999999995 7.340000 PATTERN-0 ;
+ JUNCTION-90 644.09000000000003 0 ;
+ JUNCTION-91 637.44000000000005 0 ;
+ JUNCTION-92 628.24000000000001 0 ;
+ JUNCTION-93 643.74000000000001 13.990000 PATTERN-0 ;
+ JUNCTION-94 633.48000000000002 2.130000 PATTERN-0 ;
+ JUNCTION-95 630.86000000000001 2.969609 PATTERN-0 ;
+ JUNCTION-96 629.13999999999999 6.100391 PATTERN-0 ;
+ JUNCTION-97 628.99000000000001 4.450000 PATTERN-0 ;
+ JUNCTION-98 643.04999999999995 5.966633 PATTERN-0 ;
+ JUNCTION-99 641.88999999999999 7.173367 PATTERN-0 ;
+ JUNCTION-100 637.89999999999998 5.888099 PATTERN-0 ;
+ JUNCTION-101 645.09000000000003 0.661901 PATTERN-0 ;
+ JUNCTION-102 1094.0699999999999 102.100000 PATTERN-0 ;
+ JUNCTION-103 1031.73 0.755915 PATTERN-1 ;
+ JUNCTION-104 860.63999999999999 0.044085 PATTERN-1 ;
+ JUNCTION-105 0.0 0 ;
+ JUNCTION-106 0.0 0 ;
+ JUNCTION-109 0.0 0 ;
+ JUNCTION-110 0.0 0 ;
+ JUNCTION-111 418.0 0 ;
+ JUNCTION-112 418.0 0 ;
+ JUNCTION-113 359.0 0 ;
+ JUNCTION-114 359.0 0 ;
+ JUNCTION-115 533.0 0 ;
+ JUNCTION-116 533.0 0 ;
+ JUNCTION-117 404.0 0 ;
+ JUNCTION-118 404.0 0 ;
+ JUNCTION-119 849.0 0 ;
+ JUNCTION-120 849.0 0 ;
+ JUNCTION-121 957.0 0 ;
+ JUNCTION-122 957.0 0 ;
+ JUNCTION-123 758.0 0 ;
+ JUNCTION-124 758.0 0 ;
+ JUNCTION-125 434.0 0 ;
+ JUNCTION-126 434.0 0 ;
+ JUNCTION-128 0.0 0 ;
+
+[RESERVOIRS]
+;ID Head Pattern
+ RESERVOIR-129 425.0 ;
+
+[TANKS]
+;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
+ TANK-130 843.89999999999998 15.159000 0.000000 32.100000 186.000000 0.000000 ;
+ TANK-131 1137.0999999999999 17.945000 0.000000 41.900000 106.000000 0.000000 ;
+
+[PIPES]
+;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
+ LINK-0 JUNCTION-126 JUNCTION-118 7401.000000 20.453411 138.000000 0.000000 Open ;
+ LINK-1 JUNCTION-17 JUNCTION-0 359.000000 7.999894 139.000000 0.000000 Open ;
+ LINK-2 JUNCTION-0 JUNCTION-2 324.000000 7.999894 139.000000 0.000000 Open ;
+ LINK-3 JUNCTION-3 JUNCTION-4 697.000000 7.999810 139.000000 0.000000 Open ;
+ LINK-6 JUNCTION-5 JUNCTION-4 574.000000 7.999807 139.000000 0.000000 Open ;
+ LINK-7 JUNCTION-5 JUNCTION-6 238.000000 7.999912 139.000000 0.000000 Open ;
+ LINK-8 JUNCTION-6 JUNCTION-7 502.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-9 JUNCTION-8 JUNCTION-6 396.000000 7.999894 139.000000 0.000000 Open ;
+ LINK-10 JUNCTION-9 JUNCTION-8 377.000000 7.999894 139.000000 0.000000 Open ;
+ LINK-11 JUNCTION-18 JUNCTION-9 308.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-12 JUNCTION-9 JUNCTION-8 837.000000 7.999841 139.000000 0.000000 Open ;
+ LINK-13 JUNCTION-2 JUNCTION-113 180 8.000000 138.000000 0.000000 Open ;
+ LINK-14 JUNCTION-114 JUNCTION-10 599.000000 7.999901 138.000000 0.000000 Open ;
+ LINK-15 JUNCTION-1 JUNCTION-109 125.000000 16.000000 138.000000 0.000000 Open ;
+ LINK-16 JUNCTION-10 JUNCTION-11 409.000000 7.999841 138.000000 0.000000 Open ;
+ LINK-17 JUNCTION-110 JUNCTION-34 124.000000 12.000000 138.000000 0.000000 Open ;
+ LINK-18 JUNCTION-128 JUNCTION-1 320.000000 30.000000 138.000000 0.000000 Open ;
+ LINK-19 RESERVOIR-129 JUNCTION-128 153 30.000000 138.000000 0.000000 Open ;
+ LINK-20 JUNCTION-12 JUNCTION-13 597.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-21 JUNCTION-12 JUNCTION-11 671.000000 7.999810 138.000000 0.000000 Open ;
+ LINK-22 JUNCTION-14 JUNCTION-12 332.000000 7.999863 139.000000 0.000000 Open ;
+ LINK-23 JUNCTION-5 JUNCTION-15 2089.000000 7.999852 139.000000 0.000000 Open ;
+ LINK-24 JUNCTION-15 JUNCTION-3 150 8.000000 139.000000 0.000000 Open ;
+ LINK-25 JUNCTION-15 JUNCTION-111 190 8.000000 140.000000 0.000000 Open ;
+ LINK-26 JUNCTION-112 JUNCTION-14 196 8.000000 140.000000 0.000000 Open ;
+ LINK-27 JUNCTION-14 JUNCTION-16 928.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-28 JUNCTION-17 JUNCTION-18 1382.000000 16.000290 138.000000 0.000000 Open ;
+ LINK-29 JUNCTION-18 JUNCTION-116 731.000000 16.000150 138.000000 0.000000 Open ;
+ LINK-30 JUNCTION-0 JUNCTION-4 1570.000000 7.999764 139.000000 0.000000 Open ;
+ LINK-31 JUNCTION-29 JUNCTION-28 1402.000000 24.000489 138.000000 0.000000 Open ;
+ LINK-32 JUNCTION-45 JUNCTION-46 1811.000000 7.999830 140.000000 0.000000 Open ;
+ LINK-33 JUNCTION-23 JUNCTION-124 1845.000000 12.000000 140.000000 0.000000 Open ;
+ LINK-34 JUNCTION-122 JUNCTION-123 2433.000000 12.000000 140.000000 0.000000 Open ;
+ LINK-35 JUNCTION-34 JUNCTION-30 10260.284142 24.000979 138.000000 0.000000 Open ;
+ LINK-36 JUNCTION-41 JUNCTION-39 1066.000000 7.999947 138.000000 0.000000 Open ;
+ LINK-37 JUNCTION-2 JUNCTION-3 1066.000000 7.999796 139.000000 0.000000 Open ;
+ LINK-38 JUNCTION-11 JUNCTION-10 1000.000000 7.999805 138.000000 0.000000 Open ;
+ LINK-39 JUNCTION-117 JUNCTION-17 1537.000000 16.000075 138.000000 0.000000 Open ;
+ LINK-40 JUNCTION-20 JUNCTION-21 2125.000000 20.000594 138.000000 0.000000 Open ;
+ LINK-41 JUNCTION-20 JUNCTION-115 3227.000000 16.000327 138.000000 0.000000 Open ;
+ LINK-42 JUNCTION-19 JUNCTION-125 2125.000000 20.000167 138.000000 0.000000 Open ;
+ LINK-43 JUNCTION-19 JUNCTION-20 942.000000 20.000000 138.000000 0.000000 Open ;
+ LINK-44 JUNCTION-21 JUNCTION-22 1257.000000 20.000439 138.000000 0.000000 Open ;
+ LINK-45 JUNCTION-22 JUNCTION-23 1101.000000 24.000739 138.000000 0.000000 Open ;
+ LINK-46 JUNCTION-23 JUNCTION-30 1175.000000 24.000727 138.000000 0.000000 Open ;
+ LINK-47 JUNCTION-22 JUNCTION-24 292.000000 24.000000 138.000000 0.000000 Open ;
+ LINK-48 JUNCTION-24 JUNCTION-25 178.000000 24.000000 138.000000 0.000000 Open ;
+ LINK-49 JUNCTION-25 JUNCTION-26 336.000000 24.000000 138.000000 0.000000 Open ;
+ LINK-50 JUNCTION-26 JUNCTION-27 196.00 24.000000 138.000000 0.000000 Open ;
+ LINK-51 JUNCTION-27 JUNCTION-28 144.000000 24.000000 138.000000 0.000000 Open ;
+ LINK-52 JUNCTION-30 JUNCTION-31 1146.000000 12.000000 138.000000 0.000000 Open ;
+ LINK-53 JUNCTION-31 JUNCTION-32 1699.000000 12.000000 138.000000 0.000000 Open ;
+ LINK-54 JUNCTION-32 JUNCTION-33 645.000000 12.000000 138.000000 0.000000 Open ;
+ LINK-55 JUNCTION-33 JUNCTION-57 754.000000 8.413870 138.000000 0.000000 Open ;
+ LINK-56 JUNCTION-19 JUNCTION-35 1113.000000 7.999903 140.000000 0.000000 Open ;
+ LINK-57 JUNCTION-35 JUNCTION-36 507.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-58 JUNCTION-35 JUNCTION-37 246.000000 7.999947 140.000000 0.000000 Open ;
+ LINK-59 JUNCTION-37 JUNCTION-20 739.000000 7.999947 138.000000 0.000000 Open ;
+ LINK-60 JUNCTION-35 JUNCTION-38 552.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-61 JUNCTION-37 JUNCTION-39 348.000000 8.000000 138.000000 0.000000 Open ;
+ LINK-62 JUNCTION-39 JUNCTION-40 998.000000 8.296935 139.000000 0.000000 Open ;
+ LINK-63 JUNCTION-40 JUNCTION-41 619.000000 8.000000 138.000000 0.000000 Open ;
+ LINK-64 JUNCTION-40 JUNCTION-42 538.000000 7.999947 138.000000 0.000000 Open ;
+ LINK-65 JUNCTION-42 JUNCTION-41 668.000000 8.000000 138.000000 0.000000 Open ;
+ LINK-66 JUNCTION-42 JUNCTION-27 2581.000000 8.019783 138.000000 0.000000 Open ;
+ LINK-67 JUNCTION-24 JUNCTION-43 544.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-68 JUNCTION-43 JUNCTION-25 420.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-69 JUNCTION-43 JUNCTION-44 373.000000 7.999947 140.000000 0.000000 Open ;
+ LINK-70 JUNCTION-44 JUNCTION-26 556.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-71 JUNCTION-44 JUNCTION-28 752.000000 7.999947 140.000000 0.000000 Open ;
+ LINK-72 JUNCTION-29 TANK-130 242.000000 24.000000 138.000000 0.000000 Open ;
+ LINK-73 JUNCTION-21 JUNCTION-47 91.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-74 JUNCTION-47 JUNCTION-48 805.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-75 JUNCTION-48 JUNCTION-49 574.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-76 JUNCTION-49 JUNCTION-22 158.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-77 JUNCTION-49 JUNCTION-50 577.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-78 JUNCTION-50 JUNCTION-51 388.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-79 JUNCTION-51 JUNCTION-48 236.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-80 JUNCTION-51 JUNCTION-52 393.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-81 JUNCTION-52 JUNCTION-47 549.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-82 JUNCTION-52 JUNCTION-50 1381.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-83 JUNCTION-23 JUNCTION-53 919.000000 9.999941 139.000000 0.000000 Open ;
+ LINK-84 JUNCTION-53 JUNCTION-54 386.000000 9.999970 139.000000 0.000000 Open ;
+ LINK-85 JUNCTION-54 JUNCTION-31 229.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-86 JUNCTION-53 JUNCTION-56 232.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-87 JUNCTION-56 JUNCTION-55 390.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-88 JUNCTION-55 JUNCTION-54 254.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-89 JUNCTION-55 JUNCTION-56 873.000000 7.999947 140.000000 0.000000 Open ;
+ LINK-90 JUNCTION-32 JUNCTION-57 945.000000 7.999947 140.000000 0.000000 Open ;
+ LINK-91 JUNCTION-57 JUNCTION-33 230.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-92 JUNCTION-31 JUNCTION-58 1155.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-93 JUNCTION-58 JUNCTION-59 413.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-94 JUNCTION-59 JUNCTION-60 943.000000 7.999947 140.000000 0.000000 Open ;
+ LINK-95 JUNCTION-60 JUNCTION-59 196.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-96 JUNCTION-60 JUNCTION-61 133.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-97 JUNCTION-61 JUNCTION-62 138.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-98 JUNCTION-62 JUNCTION-63 187.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-99 JUNCTION-63 JUNCTION-64 134.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-100 JUNCTION-64 JUNCTION-65 300.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-101 JUNCTION-65 JUNCTION-66 108 8.000000 139.000000 0.000000 Open ;
+ LINK-102 JUNCTION-66 JUNCTION-67 420.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-103 JUNCTION-67 JUNCTION-61 209.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-104 JUNCTION-66 JUNCTION-67 398.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-105 JUNCTION-68 JUNCTION-58 381.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-106 JUNCTION-64 JUNCTION-65 872.000000 7.999947 140.000000 0.000000 Open ;
+ LINK-107 JUNCTION-65 JUNCTION-68 199.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-108 JUNCTION-63 JUNCTION-62 713.000000 7.999947 140.000000 0.000000 Open ;
+ LINK-109 JUNCTION-68 JUNCTION-69 1095.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-110 JUNCTION-69 JUNCTION-70 231.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-111 JUNCTION-70 JUNCTION-71 695.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-112 JUNCTION-70 JUNCTION-72 528.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-113 JUNCTION-73 JUNCTION-69 938.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-114 JUNCTION-72 JUNCTION-74 169.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-115 JUNCTION-74 JUNCTION-73 127.000000 8.000000 140.000000 0.000000 Open ;
+ LINK-116 JUNCTION-72 JUNCTION-75 928.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-117 JUNCTION-75 JUNCTION-74 336.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-118 JUNCTION-75 JUNCTION-76 772.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-119 JUNCTION-76 JUNCTION-77 417.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-120 JUNCTION-77 JUNCTION-73 655.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-121 JUNCTION-76 JUNCTION-78 167.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-122 JUNCTION-78 JUNCTION-79 169.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-123 JUNCTION-79 JUNCTION-80 195.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-124 JUNCTION-80 JUNCTION-81 333.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-125 JUNCTION-81 JUNCTION-77 186 10.000000 139.000000 0.000000 Open ;
+ LINK-126 JUNCTION-78 JUNCTION-71 895.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-127 JUNCTION-80 JUNCTION-82 372.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-128 JUNCTION-82 JUNCTION-83 205.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-129 JUNCTION-83 JUNCTION-84 430.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-130 JUNCTION-84 JUNCTION-81 152.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-131 JUNCTION-84 JUNCTION-83 1586.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-132 JUNCTION-82 JUNCTION-85 174.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-133 JUNCTION-85 JUNCTION-86 456.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-134 JUNCTION-86 JUNCTION-87 341.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-135 JUNCTION-87 JUNCTION-85 507.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-136 JUNCTION-87 JUNCTION-88 195.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-137 JUNCTION-88 JUNCTION-79 250.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-138 JUNCTION-88 JUNCTION-89 191.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-139 JUNCTION-89 JUNCTION-86 926.000000 7.999947 140.000000 0.000000 Open ;
+ LINK-140 JUNCTION-89 JUNCTION-90 464.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-141 JUNCTION-90 JUNCTION-91 178.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-142 JUNCTION-91 JUNCTION-92 167.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-143 JUNCTION-92 JUNCTION-33 403.000000 10.000000 139.000000 0.000000 Open ;
+ LINK-144 JUNCTION-90 JUNCTION-93 143.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-145 JUNCTION-93 JUNCTION-94 331.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-146 JUNCTION-94 JUNCTION-92 157.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-147 JUNCTION-93 JUNCTION-94 1805.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-148 JUNCTION-92 JUNCTION-95 177.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-149 JUNCTION-95 JUNCTION-96 332.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-150 JUNCTION-96 JUNCTION-95 1432.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-151 JUNCTION-91 JUNCTION-97 489.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-152 JUNCTION-97 JUNCTION-96 122.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-153 JUNCTION-97 JUNCTION-98 285.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-154 JUNCTION-98 JUNCTION-99 597.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-155 JUNCTION-99 JUNCTION-100 148.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-156 JUNCTION-100 JUNCTION-101 812.000000 7.999900 139.000000 0.000000 Open ;
+ LINK-157 JUNCTION-101 JUNCTION-98 152.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-158 JUNCTION-100 JUNCTION-101 620.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-159 JUNCTION-98 JUNCTION-99 784.000000 7.999947 139.000000 0.000000 Open ;
+ LINK-160 JUNCTION-97 JUNCTION-71 1214.000000 8.000000 139.000000 0.000000 Open ;
+ LINK-161 JUNCTION-45 JUNCTION-46 718.000000 10.000000 138.000000 0.000000 Open ;
+ LINK-162 JUNCTION-46 JUNCTION-120 315.000000 10.000000 138.000000 0.000000 Open ;
+ LINK-163 JUNCTION-119 JUNCTION-104 201 10.000000 138.000000 0.000000 Open ;
+ LINK-164 JUNCTION-103 JUNCTION-102 930.000000 12.000000 140.000000 0.000000 Open ;
+ LINK-165 JUNCTION-102 TANK-131 559.000000 16.000000 140.000000 0.000000 Open ;
+ LINK-166 JUNCTION-29 JUNCTION-105 169.000000 11.974181 140.000000 0.000000 Open ;
+ LINK-167 JUNCTION-106 JUNCTION-104 84.000000 8.000000 138.000000 0.000000 Open ;
+ LINK-168 JUNCTION-103 JUNCTION-121 291.000000 12.000000 140.000000 0.000000 Open ;
+ LINK-169 JUNCTION-103 JUNCTION-104 4700.000000 10.121698 138.000000 0.000000 Open ;
+
+[PUMPS]
+;ID Node1 Node2 Parameters
+ PUMP-170 JUNCTION-105 JUNCTION-106 HEAD CURVE-1 ;
+ PUMP-172 JUNCTION-109 JUNCTION-110 HEAD CURVE-1 ;
+
+[VALVES]
+;ID Node1 Node2 Diameter Type Setting MinorLoss
+ VALVE-173 JUNCTION-111 JUNCTION-112 6.000000 TCV 0.2000000 0 ;
+ VALVE-174 JUNCTION-113 JUNCTION-114 6.000000 TCV 0.2000000 0 ;
+ VALVE-175 JUNCTION-115 JUNCTION-116 10.000000 TCV 0.2000000 0 ;
+ VALVE-176 JUNCTION-117 JUNCTION-118 6.000000 TCV 0.2000 0 ;
+ VALVE-177 JUNCTION-119 JUNCTION-120 6.000000 TCV 0.2000000 0 ;
+ VALVE-178 JUNCTION-121 JUNCTION-122 6.000000 TCV 0.2000000 0 ;
+ VALVE-179 JUNCTION-123 JUNCTION-124 8.000000 TCV 0.2000000 0 ;
+ VALVE-180 JUNCTION-125 JUNCTION-126 8.000000 TCV 0.20000 0 ;
+
+[TAGS]
+
+[DEMANDS]
+;Junction Demand Pattern Category
+
+[STATUS]
+;ID Status/Setting
+ VALVE-173 Open
+ VALVE-174 Open
+ VALVE-175 Open
+ VALVE-176 Open
+ VALVE-177 Open
+ VALVE-178 Open
+ VALVE-179 Open
+ VALVE-180 Open
+
+[PATTERNS]
+;ID Multipliers
+;
+ PATTERN-0 1.560000 1.360000 1.170000 1.130000 1.080000 1.040000
+ PATTERN-0 1.200000 0.640000 1.080000 0.530000 0.290000 0.900000
+ PATTERN-0 1.110000 1.060000 1.000000 1.650000 0.550000 0.740000
+ PATTERN-0 0.640000 0.460000 0.580000 0.640000 0.710000 0.660000
+ PATTERN-0 0.680000 0.430000 0.370000 0.330000 0.230000 0.210000
+ PATTERN-0 0.060000 0.100000 0.100000 0.140000 0.090000 0.100000
+ PATTERN-0 0.090000 0.090000 0.030000 0.230000 0.270000 0.720000
+ PATTERN-0 0.930000 1.130000 1.390000 1.940000 1.900000 1.830000
+ PATTERN-0 2.730000 1.740000 1.290000 1.410000 1.390000 1.350000
+ PATTERN-0 1.190000 1.340000 0.950000 1.270000 1.280000 1.090000
+ PATTERN-0 1.010000 1.130000 1.000000 0.770000 0.670000 0.760000
+ PATTERN-0 0.760000 0.710000 0.580000 0.860000 0.960000 0.970000
+ PATTERN-0 0.820000 0.710000 0.650000 0.620000 0.440000 0.480000
+ PATTERN-0 0.550000 0.560000 0.610000 0.600000 0.440000 0.460000
+ PATTERN-0 0.440000 0.400000 0.440000 0.690000 0.760000 1.190000
+ PATTERN-0 1.330000 1.730000 1.970000 2.370000 2.280000 2.100000
+;
+ PATTERN-1 80.000000 80.000000 80.000000 80.000000 80.000000 80.000000
+ PATTERN-1 80.000000 80.000000 80.000000 80.000000 80.000000 80.000000
+ PATTERN-1 80.000000 80.000000 80.000000 80.000000 80.000000 80.000000
+ PATTERN-1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+ PATTERN-1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+ PATTERN-1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+ PATTERN-1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+ PATTERN-1 0.000000 0.000000 0.000000 0.000000 80.000000 80.000000
+ PATTERN-1 80.000000 80.000000 80.000000 80.000000 80.000000 80.000000
+ PATTERN-1 80.000000 80.000000 80.000000 80.000000 80.000000 80.000000
+ PATTERN-1 80.000000 80.000000 80.000000 80.000000 80.000000 0.000000
+ PATTERN-1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+ PATTERN-1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+ PATTERN-1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+ PATTERN-1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
+ PATTERN-1 0.000000 0.000000 0.000000 80.000000 80.000000 80.000000
+;
+ PATTERN-2 0.800000 0.840000 0.880000 0.970000 1.070000 1.010000
+ PATTERN-2 0.960000 0.970000 0.990000 1.080000 1.180000 1.190000
+ PATTERN-2 1.190000 1.220000 1.250000 1.250000 1.260000 1.220000
+ PATTERN-2 1.190000 1.160000 1.140000 1.120000 1.110000 1.100000
+ PATTERN-2 1.100000 1.060000 1.020000 1.010000 1.010000 1.000000
+ PATTERN-2 1.000000 0.850000 0.710000 0.700000 0.690000 0.740000
+ PATTERN-2 0.790000 0.800000 0.800000 0.800000 0.810000 0.770000
+ PATTERN-2 0.740000 0.740000 0.750000 0.780000 0.810000 0.800000
+;
+ PATTERN-3 423.300000 225.000000 26.700000 26.700000 26.700000 26.700000
+ PATTERN-3 26.700000 26.700000 26.700000 202.100000 377.500000 202.100000
+ PATTERN-3 25.800000 25.900000 25.900000 26.000000 26.000000 26.100000
+ PATTERN-3 26.100000 26.100000 26.200000 26.300000 26.300000 26.300000
+ PATTERN-3 26.300000 26.300000 26.400000 239.900000 453.500000 240.500000
+ PATTERN-3 27.400000 267.800000 508.100000 462.100000 416.000000 327.500000
+ PATTERN-3 238.900000 133.000000 27.100000 27.100000 27.100000 27.100000
+ PATTERN-3 27.100000 248.000000 468.900000 360.700000 252.400000 449.500000
+ PATTERN-3 646.500000 336.600000 26.800000 198.900000 371.100000 198.400000
+ PATTERN-3 25.800000 25.800000 25.800000 25.800000 25.800000 25.900000
+ PATTERN-3 26.000000 26.000000 26.000000 26.100000 26.200000 26.200000
+ PATTERN-3 26.200000 26.200000 26.300000 26.300000 26.300000 26.300000
+ PATTERN-3 26.300000 228.300000 430.200000 657.200000 884.200000 884.200000
+ PATTERN-3 884.300000 884.400000 884.500000 884.500000 884.500000 663.300000
+ PATTERN-3 442.100000 234.200000 26.300000 47.200000 68.000000 352.200000
+ PATTERN-3 636.400000 331.200000 26.000000 26.100000 26.100000 224.700000
+
+[CURVES]
+;ID X-Value Y-Value
+;PUMP: PUMP: PUMP: PUMP: PUMP:
+ CURVE-0 0.000000 445.000000
+ CURVE-0 790.000000 365.000000
+ CURVE-0 1460.000000 120.000000
+;PUMP: PUMP: PUMP: PUMP: PUMP:
+ CURVE-1 0.000000 730.000000
+ CURVE-1 1000.000000 500.000000
+ CURVE-1 1350.000000 260.000000
+;PUMP: PUMP: PUMP: PUMP: PUMP:
+ CURVE-2 0.000000 740.000000
+ CURVE-2 2000.000000 530.000000
+ CURVE-2 3240.000000 205.000000
+
+[CONTROLS]
+
+
+
+
+[RULES]
+
+
+
+
+
+[ENERGY]
+ Global Efficiency 75.000000
+ Global Price 0
+ Demand Charge 0.000000
+
+[EMITTERS]
+;Junction Coefficient
+
+[QUALITY]
+;Node InitQual
+
+[SOURCES]
+;Node Type Quality Pattern
+
+[REACTIONS]
+;Type Pipe/Tank Coefficient
+
+
+[REACTIONS]
+ Order Bulk 1
+ Order Tank 1
+ Order Wall 1
+ Global Bulk 0.000000
+ Global Wall 0.000000
+ Limiting Potential 0
+ Roughness Correlation 0
+
+[MIXING]
+;Tank Model
+
+[TIMES]
+ Duration 1:00
+ Hydraulic Timestep 0:30
+ Quality Timestep 0:05
+ Pattern Timestep 0:30
+ Pattern Start 0:00
+ Report Timestep 1:00
+ Report Start 0:00
+ Start ClockTime 8:00 AM
+ Statistic NONE
+
+[REPORT]
+ Status No
+ Summary No
+ Page 0
+
+[OPTIONS]
+ Units GPM
+ Headloss H-W
+ Specific Gravity 1.000000
+ Viscosity 1.1e-005
+ Trials 40
+ Accuracy 0.001
+ CHECKFREQ 2
+ MAXCHECK 10
+ DAMPLIMIT 0
+ Unbalanced Stop
+ Pattern PATTERN-0
+ Demand Multiplier 1.000000
+ Emitter Exponent 0.500000
+ Quality None mg/L
+ Diffusivity 100
+ Tolerance 0.010000
+
+[COORDINATES]
+;Node X-Coord Y-Coord
+ JUNCTION-0 10660.89 12699.67
+ JUNCTION-1 232.34 198.38
+ JUNCTION-2 10096.30 12963.00
+ JUNCTION-3 8407.85 12291.24
+ JUNCTION-4 9496.42 11972.35
+ JUNCTION-5 9011.59 11369.17
+ JUNCTION-6 9013.79 11080.51
+ JUNCTION-7 9250.29 11199.54
+ JUNCTION-8 9581.36 10752.81
+ JUNCTION-9 10733.82 11618.76
+ JUNCTION-10 9928.19 13544.98
+ JUNCTION-11 8807.74 13153.79
+ JUNCTION-12 7701.69 12907.40
+ JUNCTION-13 6876.11 12848.50
+ JUNCTION-14 8251.47 12444.71
+ JUNCTION-15 8259.98 12265.86
+ JUNCTION-16 6336.78 11924.32
+ JUNCTION-17 11390.23 12721.86
+ JUNCTION-18 11057.11 11140.34
+ JUNCTION-19 18876.92 11353.89
+ JUNCTION-20 17934.43 10606.32
+ JUNCTION-21 17059.69 8043.82
+ JUNCTION-22 17247.33 6999.27
+ JUNCTION-23 17410.54 5888.57
+ JUNCTION-24 17999.87 7351.33
+ JUNCTION-25 18109.38 7395.83
+ JUNCTION-26 19053.01 7351.84
+ JUNCTION-27 19106.85 7553.33
+ JUNCTION-28 19686.69 7293.81
+ JUNCTION-29 21853.72 7382.88
+ JUNCTION-30 17071.34 5128.88
+ JUNCTION-31 15171.37 5740.90
+ JUNCTION-32 13238.08 6332.93
+ JUNCTION-33 12424.38 7418.33
+ JUNCTION-34 1250.49 498.88
+ JUNCTION-35 19673.06 10686.87
+ JUNCTION-36 20403.76 10472.92
+ JUNCTION-37 18985.90 10631.23
+ JUNCTION-38 18607.97 10713.49
+ JUNCTION-39 19166.06 10506.15
+ JUNCTION-40 19099.54 10176.22
+ JUNCTION-41 17861.02 9889.20
+ JUNCTION-42 18385.78 9430.10
+ JUNCTION-43 18490.35 6790.82
+ JUNCTION-44 18645.08 7129.68
+ JUNCTION-45 21195.36 8702.78
+ JUNCTION-46 21278.01 7694.47
+ JUNCTION-47 16855.92 8656.03
+ JUNCTION-48 16904.90 7714.24
+ JUNCTION-49 16927.55 6903.29
+ JUNCTION-50 16551.63 7560.14
+ JUNCTION-51 16614.08 8245.07
+ JUNCTION-52 16228.29 7895.69
+ JUNCTION-53 15807.37 6484.02
+ JUNCTION-54 15143.01 5790.53
+ JUNCTION-55 15452.25 5855.21
+ JUNCTION-56 15614.75 6241.36
+ JUNCTION-57 12641.61 7580.16
+ JUNCTION-58 12889.67 5314.84
+ JUNCTION-59 14170.10 5753.98
+ JUNCTION-60 13812.99 6116.38
+ JUNCTION-61 13623.60 5755.55
+ JUNCTION-62 13553.54 5928.47
+ JUNCTION-63 13138.41 6329.93
+ JUNCTION-64 12860.32 6023.02
+ JUNCTION-65 12449.32 5619.02
+ JUNCTION-66 12955.43 5888.95
+ JUNCTION-67 13301.09 5801.58
+ JUNCTION-68 12578.78 5441.85
+ JUNCTION-69 10677.34 4900.98
+ JUNCTION-70 10181.06 5473.86
+ JUNCTION-71 11140.24 5728.02
+ JUNCTION-72 9885.02 5770.85
+ JUNCTION-73 8969.76 5646.52
+ JUNCTION-74 9308.85 5671.41
+ JUNCTION-75 9946.22 6083.37
+ JUNCTION-76 9607.47 6199.74
+ JUNCTION-77 9051.85 6450.38
+ JUNCTION-78 10166.55 6572.87
+ JUNCTION-79 9485.75 6648.12
+ JUNCTION-80 9568.49 6824.95
+ JUNCTION-81 8741.43 6287.84
+ JUNCTION-82 8978.26 6693.00
+ JUNCTION-83 8345.05 6938.19
+ JUNCTION-84 8751.56 6635.61
+ JUNCTION-85 9279.58 7087.57
+ JUNCTION-86 9876.13 7369.96
+ JUNCTION-87 9804.94 7308.79
+ JUNCTION-88 9879.39 6704.35
+ JUNCTION-89 10235.12 6748.13
+ JUNCTION-90 10216.80 7677.21
+ JUNCTION-91 11071.02 7420.24
+ JUNCTION-92 11350.46 7397.70
+ JUNCTION-93 10935.56 7058.08
+ JUNCTION-94 11167.17 7199.21
+ JUNCTION-95 11919.97 7225.08
+ JUNCTION-96 12279.69 6864.49
+ JUNCTION-97 12009.44 6806.61
+ JUNCTION-98 11504.57 6811.20
+ JUNCTION-99 10798.43 6305.49
+ JUNCTION-100 10495.63 6494.15
+ JUNCTION-101 11456.95 7127.08
+ JUNCTION-102 25891.06 3341.73
+ JUNCTION-103 24306.48 3387.26
+ JUNCTION-104 22275.22 7224.91
+ JUNCTION-105 22205.02 7496.88
+ JUNCTION-106 22698.70 7650.31
+ JUNCTION-109 694.79 -18.12
+ JUNCTION-110 862.27 205.84
+ JUNCTION-111 8270.97 12259.89
+ JUNCTION-112 8176.75 12053.87
+ JUNCTION-113 9457.16 13032.31
+ JUNCTION-114 9711.67 13144.65
+ JUNCTION-115 12096.99 10755.48
+ JUNCTION-116 11965.70 10646.33
+ JUNCTION-117 14008.10 13489.78
+ JUNCTION-118 13980.49 13520.62
+ JUNCTION-119 22395.73 7684.44
+ JUNCTION-120 22300.21 7726.14
+ JUNCTION-121 23322.75 3866.35
+ JUNCTION-122 23012.94 4255.69
+ JUNCTION-123 20282.88 5465.74
+ JUNCTION-124 20326.50 5404.05
+ JUNCTION-125 21576.64 13167.78
+ JUNCTION-126 21563.80 13128.27
+ JUNCTION-128 269.38 602.32
+ RESERVOIR-129 21.20 583.42
+ TANK-130 21873.08 6912.07
+ TANK-131 25900.14 3983.02
+
+[VERTICES]
+;Link X-Coord Y-Coord
+
+[LABELS]
+;X-Coord Y-Coord Label & Anchor Node
+ 16759.25 11079.85 "JUNCTION-20"
+ 16667.28 9546.98 "LINK-40"
+ 17326.41 8029.44 "JUNCTION-22"
+ 9539.44 8075.43 "JUNCTION-90"
+ 9064.25 10589.33 "JUNCTION-8"
+ 5891.21 11815.63 "JUNCTION-16"
+ 21235.22 8719.23 "JUNCTION-45"
+
+[BACKDROP]
+ DIMENSIONS -1295.01 -677.25 27195.15 14222.23
+ UNITS None
+ FILE
+ OFFSET 0.00 0.00
+
+[END]
diff --git a/Python/tsnet/examples/networks/bug.inp b/Python/tsnet/examples/networks/bug.inp
new file mode 100644
index 0000000..6ab63fb
--- /dev/null
+++ b/Python/tsnet/examples/networks/bug.inp
@@ -0,0 +1,1021 @@
+[TITLE]
+modena -- Bragalli, D'Ambrosio, Lee, Lodi, Toth (2008)
+
+[JUNCTIONS]
+;ID Elev Demand Pattern
+ 1 39.49 0.06 1 ;
+ 2 39.62 1.45 1 ;
+ 3 38.70 5.13 1 ;
+ 4 37.25 2.76 1 ;
+ 5 36.27 0.96 1 ;
+ 6 35.95 0.78 1 ;
+ 7 35.95 1.03 1 ;
+ 8 36.09 2.12 1 ;
+ 9 36.18 1.16 1 ;
+ 10 37.00 1.78 1 ;
+ 11 36.50 0.44 1 ;
+ 12 37.39 0.03 1 ;
+ 13 38.07 0.57 1 ;
+ 14 37.02 0.36 1 ;
+ 15 41.26 3.30 1 ;
+ 16 39.35 0.03 1 ;
+ 17 39.53 2.10 1 ;
+ 18 36.59 4.67 1 ;
+ 19 36.76 0.00 1 ;
+ 20 37.72 1.53 1 ;
+ 21 37.31 4.61 1 ;
+ 22 37.62 1.06 1 ;
+ 23 36.99 1.32 1 ;
+ 24 35.20 2.74 1 ;
+ 25 35.11 0.59 1 ;
+ 26 34.65 0.45 1 ;
+ 27 34.33 0.64 1 ;
+ 28 36.15 7.11 1 ;
+ 29 36.30 0.93 1 ;
+ 30 36.10 0.04 1 ;
+ 31 36.14 0.02 1 ;
+ 32 35.80 2.93 1 ;
+ 33 33.26 2.34 1 ;
+ 34 33.34 1.94 1 ;
+ 35 33.51 1.19 1 ;
+ 36 32.70 1.41 1 ;
+ 37 32.65 2.98 1 ;
+ 38 32.56 2.11 1 ;
+ 39 33.56 7.74 1 ;
+ 40 31.59 4.29 1 ;
+ 41 31.38 7.78 1 ;
+ 42 32.67 3.75 1 ;
+ 43 33.50 2.37 1 ;
+ 44 33.57 1.42 1 ;
+ 45 33.77 0.32 1 ;
+ 46 34.14 1.14 1 ;
+ 47 33.68 1.23 1 ;
+ 48 33.71 1.37 1 ;
+ 49 31.68 1.18 1 ;
+ 50 33.34 1.81 1 ;
+ 51 32.83 0.97 1 ;
+ 52 32.78 0.55 1 ;
+ 53 39.28 2.77 1 ;
+ 54 37.12 0.65 1 ;
+ 55 36.48 1.38 1 ;
+ 56 36.42 8.28 1 ;
+ 57 36.13 1.22 1 ;
+ 58 36.05 3.85 1 ;
+ 59 36.77 2.62 1 ;
+ 60 35.48 2.78 1 ;
+ 61 35.05 1.56 1 ;
+ 62 35.10 1.16 1 ;
+ 63 37.95 1.22 1 ;
+ 64 38.44 2.93 1 ;
+ 65 37.81 1.13 1 ;
+ 66 38.22 1.12 1 ;
+ 67 38.73 0.48 1 ;
+ 68 38.95 1.37 1 ;
+ 69 39.70 2.26 1 ;
+ 70 40.59 1.31 1 ;
+ 71 40.81 1.06 1 ;
+ 72 41.06 0.38 1 ;
+ 73 41.45 1.76 1 ;
+ 74 41.83 0.56 1 ;
+ 75 41.44 0.00 1 ;
+ 76 41.09 4.64 1 ;
+ 77 40.74 1.03 1 ;
+ 78 38.60 3.08 1 ;
+ 79 36.91 1.60 1 ;
+ 80 36.75 4.49 1 ;
+ 81 36.81 1.25 1 ;
+ 82 37.05 0.87 1 ;
+ 83 35.88 0.72 1 ;
+ 84 36.45 0.49 1 ;
+ 85 36.16 3.92 1 ;
+ 86 34.99 0.94 1 ;
+ 87 35.61 3.33 1 ;
+ 88 34.89 4.17 1 ;
+ 89 35.59 1.44 1 ;
+ 90 35.70 1.84 1 ;
+ 91 35.20 2.00 1 ;
+ 92 35.64 2.24 1 ;
+ 93 35.93 0.20 1 ;
+ 94 37.64 2.27 1 ;
+ 95 37.17 1.44 1 ;
+ 96 37.10 2.67 1 ;
+ 97 36.97 0.60 1 ;
+ 98 37.00 2.76 1 ;
+ 99 36.74 0.05 1 ;
+ 100 34.78 2.06 1 ;
+ 101 34.26 3.19 1 ;
+ 102 33.66 4.69 1 ;
+ 103 33.78 1.70 1 ;
+ 104 33.75 0.02 1 ;
+ 105 33.38 0.10 1 ;
+ 106 34.85 1.11 1 ;
+ 107 34.27 1.02 1 ;
+ 108 34.30 0.88 1 ;
+ 109 33.95 2.33 1 ;
+ 110 33.92 0.31 1 ;
+ 111 32.32 0.45 1 ;
+ 112 34.76 2.96 1 ;
+ 113 34.21 8.12 1 ;
+ 114 34.92 1.76 1 ;
+ 115 32.96 5.96 1 ;
+ 116 30.69 0.00 1 ;
+ 117 30.59 6.34 1 ;
+ 118 30.73 0.00 1 ;
+ 119 30.70 0.00 1 ;
+ 120 31.02 3.03 1 ;
+ 121 31.03 1.85 1 ;
+ 122 31.75 1.77 1 ;
+ 123 32.00 1.48 1 ;
+ 124 32.05 0.00 1 ;
+ 125 32.10 1.32 1 ;
+ 126 33.76 2.24 1 ;
+ 127 32.27 1.26 1 ;
+ 128 31.86 5.39 1 ;
+ 129 32.42 1.00 1 ;
+ 130 33.00 1.61 1 ;
+ 131 33.63 4.71 1 ;
+ 132 36.37 2.64 1 ;
+ 133 35.69 2.11 1 ;
+ 134 35.52 1.51 1 ;
+ 135 35.56 0.84 1 ;
+ 136 35.92 1.05 1 ;
+ 137 35.37 1.16 1 ;
+ 138 35.06 2.45 1 ;
+ 139 34.12 1.66 1 ;
+ 140 39.35 0.00 1 ;
+ 141 39.10 0.00 1 ;
+ 142 39.84 0.00 1 ;
+ 143 39.84 0.80 1 ;
+ 144 39.45 0.33 1 ;
+ 145 39.70 0.34 1 ;
+ 146 37.95 1.02 1 ;
+ 147 37.61 1.23 1 ;
+ 148 37.95 0.09 1 ;
+ 149 35.69 0.43 1 ;
+ 150 35.32 1.56 1 ;
+ 151 35.81 0.80 1 ;
+ 152 35.81 1.38 1 ;
+ 153 36.02 0.53 1 ;
+ 154 38.25 0.59 1 ;
+ 155 37.50 2.33 1 ;
+ 156 37.54 0.03 1 ;
+ 157 37.08 0.31 1 ;
+ 158 36.76 8.49 1 ;
+ 159 35.88 0.32 1 ;
+ 160 35.77 0.21 1 ;
+ 161 34.70 0.02 1 ;
+ 162 35.37 1.23 1 ;
+ 163 34.99 0.99 1 ;
+ 164 35.93 0.55 1 ;
+ 165 36.27 0.78 1 ;
+ 166 32.67 0.27 1 ;
+ 167 32.75 0.27 1 ;
+ 168 32.88 0.07 1 ;
+ 169 34.09 9.47 1 ;
+ 170 36.09 2.64 1 ;
+ 171 36.05 1.02 1 ;
+ 172 36.04 0.88 1 ;
+ 173 36.02 0.49 1 ;
+ 174 31.76 0.00 1 ;
+ 175 31.91 1.12 1 ;
+ 176 31.80 0.00 1 ;
+ 177 31.48 0.00 1 ;
+ 178 31.12 0.01 1 ;
+ 179 31.10 0.00 1 ;
+ 180 31.19 0.00 1 ;
+ 181 30.39 0.00 1 ;
+ 182 30.55 0.01 1 ;
+ 183 31.13 1.84 1 ;
+ 184 31.81 0.04 1 ;
+ 185 32.34 1.68 1 ;
+ 186 32.83 2.37 1 ;
+ 187 33.69 0.09 1 ;
+ 188 33.17 1.23 1 ;
+ 189 33.23 3.90 1 ;
+ 190 33.34 1.17 1 ;
+ 191 33.77 1.70 1 ;
+ 192 33.77 2.15 1 ;
+ 193 32.20 4.00 1 ;
+ 194 34.41 4.46 1 ;
+ 195 33.39 0.05 1 ;
+ 196 34.34 0.01 1 ;
+ 197 35.03 4.12 1 ;
+ 198 34.44 0.39 1 ;
+ 199 34.53 0.15 1 ;
+ 200 34.94 1.82 1 ;
+ 201 34.70 3.43 1 ;
+ 202 36.70 0.62 1 ;
+ 203 36.20 4.17 1 ;
+ 204 35.03 2.26 1 ;
+ 205 36.77 1.01 1 ;
+ 206 36.20 0.54 1 ;
+ 207 37.88 0.77 1 ;
+ 208 38.03 0.33 1 ;
+ 209 36.86 1.15 1 ;
+ 210 37.24 1.53 1 ;
+ 211 36.66 0.00 1 ;
+ 212 36.49 0.30 1 ;
+ 213 37.30 0.32 1 ;
+ 214 40.30 0.56 1 ;
+ 215 39.85 0.00 1 ;
+ 216 41.00 0.19 1 ;
+ 217 41.16 1.42 1 ;
+ 218 35.05 0.59 1 ;
+ 219 33.92 1.48 1 ;
+ 220 32.14 0.92 1 ;
+ 221 34.17 0.33 1 ;
+ 222 35.10 0.06 1 ;
+ 223 31.55 0.46 1 ;
+ 224 31.75 0.72 1 ;
+ 225 32.07 0.00 1 ;
+ 226 31.94 0.00 1 ;
+ 227 31.66 0.20 1 ;
+ 228 31.04 0.08 1 ;
+ 229 31.05 1.30 1 ;
+ 230 38.49 1.07 1 ;
+ 231 35.68 1.03 1 ;
+ 232 35.39 0.03 1 ;
+ 233 34.89 1.15 1 ;
+ 234 34.86 1.43 1 ;
+ 235 34.99 4.86 1 ;
+ 236 32.54 4.71 1 ;
+ 237 34.41 1.34 1 ;
+ 238 36.16 1.87 1 ;
+ 239 35.30 0.82 1 ;
+ 240 35.17 0.94 1 ;
+ 241 32.92 0.09 1 ;
+ 242 33.07 1.28 1 ;
+ 243 31.91 0.43 1 ;
+ 244 32.00 0.51 1 ;
+ 245 32.05 0.00 1 ;
+ 246 32.05 0.01 1 ;
+ 247 30.70 0.01 1 ;
+ 248 31.33 0.00 1 ;
+ 249 36.30 1.75 1 ;
+ 250 35.83 1.03 1 ;
+ 251 36.95 1.26 1 ;
+ 252 38.01 1.36 1 ;
+ 253 36.65 0.14 1 ;
+ 254 36.91 0.00 1 ;
+ 255 36.77 1.96 1 ;
+ 256 31.50 2.21 1 ;
+ 257 38.65 0.62 1 ;
+ 258 39.54 0.00 1 ;
+ 259 39.58 0.50 1 ;
+ 260 39.58 0.11 1 ;
+ 261 40.55 0.12 1 ;
+ 262 40.79 0.22 1 ;
+ 263 40.95 1.28 1 ;
+ 264 37.76 0.19 1 ;
+ 265 35.96 0.22 1 ;
+ 266 36.81 1.19 1 ;
+ 267 36.21 1.69 1 ;
+ 268 35.61 0.43 1 ;
+ 273 40 0 1 ;
+ 274 40 0 1 ;
+
+[RESERVOIRS]
+;ID Head Pattern
+ 269 20 ;
+ 270 20 ;
+ 271 20 ;
+ 272 20 ;
+
+[TANKS]
+;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
+ 275 50 10 0 20 30 0 ;
+
+[PIPES]
+;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
+ 1 1 16 46.84 125.00 130.00 0.00 Open ;
+ 2 16 2 267.68 100.00 130.00 0.00 Open ;
+ 3 2 3 541.07 100.00 130.00 0.00 Open ;
+ 4 3 4 542.29 100.00 130.00 0.00 Open ;
+ 5 4 5 404.72 100.00 130.00 0.00 Open ;
+ 6 5 206 151.67 100.00 130.00 0.00 Open ;
+ 7 206 6 341.57 100.00 130.00 0.00 Open ;
+ 8 1 140 39.91 100.00 130.00 0.00 Open ;
+ 9 140 143 269.73 100.00 130.00 0.00 Open ;
+ 10 143 145 45.92 100.00 130.00 0.00 Open ;
+ 11 145 146 890.09 100.00 130.00 0.00 Open ;
+ 12 146 148 33.79 100.00 130.00 0.00 Open ;
+ 13 148 63 6.03 100.00 130.00 0.00 Open ;
+ 14 63 149 367.92 125.00 130.00 0.00 Open ;
+ 15 149 150 97.66 125.00 130.00 0.00 Open ;
+ 16 150 60 322.19 100.00 130.00 0.00 Open ;
+ 17 60 61 359.48 100.00 130.00 0.00 Open ;
+ 18 61 218 199.59 100.00 130.00 0.00 Open ;
+ 19 1 141 57.06 200.00 130.00 0.00 Open ;
+ 20 141 142 223.41 200.00 130.00 0.00 Open ;
+ 21 142 144 47.03 200.00 130.00 0.00 Open ;
+ 22 144 257 782.67 200.00 130.00 0.00 Open ;
+ 23 257 53 231.87 125.00 130.00 0.00 Open ;
+ 24 53 251 279.84 100.00 130.00 0.00 Open ;
+ 25 251 57 145.70 100.00 130.00 0.00 Open ;
+ 26 57 58 81.10 100.00 130.00 0.00 Open ;
+ 27 58 59 550.17 100.00 130.00 0.00 Open ;
+ 28 53 230 155.63 100.00 130.00 0.00 Open ;
+ 29 230 252 357.81 100.00 130.00 0.00 Open ;
+ 30 252 3 267.32 100.00 130.00 0.00 Open ;
+ 31 3 13 612.50 100.00 130.00 0.00 Open ;
+ 32 13 12 160.50 100.00 130.00 0.00 Open ;
+ 33 12 11 531.71 100.00 130.00 0.00 Open ;
+ 34 1 258 41.91 200.00 130.00 0.00 Open ;
+ 35 258 259 95.22 200.00 130.00 0.00 Open ;
+ 36 259 260 25.13 200.00 130.00 0.00 Open ;
+ 37 260 215 158.12 200.00 130.00 0.00 Open ;
+ 38 215 261 95.40 200.00 130.00 0.00 Open ;
+ 39 261 77 52.92 200.00 130.00 0.00 Open ;
+ 40 77 262 44.92 200.00 130.00 0.00 Open ;
+ 41 262 216 127.05 200.00 130.00 0.00 Open ;
+ 42 216 263 56.68 200.00 130.00 0.00 Open ;
+ 43 263 76 181.29 200.00 130.00 0.00 Open ;
+ 44 76 217 220.90 200.00 130.00 0.00 Open ;
+ 45 217 75 67.65 200.00 130.00 0.00 Open ;
+ 46 75 74 36.06 200.00 130.00 0.00 Open ;
+ 47 74 73 242.29 150.00 130.00 0.00 Open ;
+ 48 73 72 70.45 150.00 130.00 0.00 Open ;
+ 49 72 71 112.83 150.00 130.00 0.00 Open ;
+ 50 71 70 105.72 150.00 130.00 0.00 Open ;
+ 51 70 69 199.42 150.00 130.00 0.00 Open ;
+ 52 69 68 180.64 125.00 130.00 0.00 Open ;
+ 53 68 78 288.76 125.00 130.00 0.00 Open ;
+ 54 78 154 69.26 100.00 130.00 0.00 Open ;
+ 55 154 79 718.45 100.00 130.00 0.00 Open ;
+ 56 79 155 390.78 100.00 130.00 0.00 Open ;
+ 57 155 156 24.00 125.00 130.00 0.00 Open ;
+ 58 156 95 504.52 125.00 130.00 0.00 Open ;
+ 59 95 96 41.78 150.00 130.00 0.00 Open ;
+ 60 96 97 367.93 150.00 130.00 0.00 Open ;
+ 61 97 157 101.86 150.00 130.00 0.00 Open ;
+ 62 157 98 125.36 150.00 130.00 0.00 Open ;
+ 63 98 158 699.76 150.00 130.00 0.00 Open ;
+ 64 158 136 448.05 200.00 130.00 0.00 Open ;
+ 65 136 159 114.29 200.00 130.00 0.00 Open ;
+ 66 159 160 197.30 200.00 130.00 0.00 Open ;
+ 67 160 137 235.98 200.00 130.00 0.00 Open ;
+ 68 137 135 224.87 200.00 130.00 0.00 Open ;
+ 69 135 222 176.73 125.00 130.00 0.00 Open ;
+ 70 222 161 76.44 100.00 130.00 0.00 Open ;
+ 71 161 131 356.94 100.00 130.00 0.00 Open ;
+ 72 131 242 443.79 100.00 130.00 0.00 Open ;
+ 73 242 130 20.55 100.00 130.00 0.00 Open ;
+ 74 130 241 113.33 100.00 130.00 0.00 Open ;
+ 75 241 168 25.96 100.00 130.00 0.00 Open ;
+ 76 168 167 145.04 100.00 130.00 0.00 Open ;
+ 77 167 166 55.24 100.00 130.00 0.00 Open ;
+ 78 166 129 208.22 100.00 130.00 0.00 Open ;
+ 79 129 125 190.43 100.00 130.00 0.00 Open ;
+ 80 125 246 70.98 100.00 130.00 0.00 Open ;
+ 81 246 245 52.04 100.00 130.00 0.00 Open ;
+ 82 245 124 34.03 100.00 130.00 0.00 Open ;
+ 83 124 225 79.47 100.00 130.00 0.00 Open ;
+ 84 225 226 277.99 100.00 130.00 0.00 Open ;
+ 85 176 227 86.03 100.00 130.00 0.00 Open ;
+ 86 227 177 296.25 100.00 130.00 0.00 Open ;
+ 87 177 180 111.30 100.00 130.00 0.00 Open ;
+ 88 180 178 123.37 100.00 130.00 0.00 Open ;
+ 89 178 179 196.27 100.00 130.00 0.00 Open ;
+ 90 179 228 198.46 100.00 130.00 0.00 Open ;
+ 91 228 229 75.62 100.00 130.00 0.00 Open ;
+ 92 229 121 110.14 100.00 130.00 0.00 Open ;
+ 93 121 118 423.57 100.00 130.00 0.00 Open ;
+ 94 118 117 116.57 100.00 130.00 0.00 Open ;
+ 95 117 181 100.61 100.00 130.00 0.00 Open ;
+ 96 181 182 164.84 100.00 130.00 0.00 Open ;
+ 97 182 116 47.49 100.00 130.00 0.00 Open ;
+ 98 116 247 87.54 100.00 130.00 0.00 Open ;
+ 99 49 184 189.27 150.00 130.00 0.00 Open ;
+ 100 184 41 244.80 150.00 130.00 0.00 Open ;
+ 101 41 248 293.47 150.00 130.00 0.00 Open ;
+ 102 248 40 308.64 150.00 130.00 0.00 Open ;
+ 103 40 39 566.57 150.00 130.00 0.00 Open ;
+ 104 226 176 95.14 100.00 130.00 0.00 Open ;
+ 105 247 183 248.55 100.00 130.00 0.00 Open ;
+ 106 183 49 187.78 100.00 130.00 0.00 Open ;
+ 107 39 38 357.67 125.00 130.00 0.00 Open ;
+ 108 38 37 700.57 100.00 130.00 0.00 Open ;
+ 109 37 193 404.46 100.00 130.00 0.00 Open ;
+ 110 193 36 160.86 125.00 130.00 0.00 Open ;
+ 111 36 194 557.42 125.00 130.00 0.00 Open ;
+ 112 194 27 127.02 150.00 130.00 0.00 Open ;
+ 113 27 26 46.66 150.00 130.00 0.00 Open ;
+ 114 26 195 674.32 150.00 130.00 0.00 Open ;
+ 115 195 33 50.76 125.00 130.00 0.00 Open ;
+ 116 26 196 138.54 100.00 130.00 0.00 Open ;
+ 117 196 25 199.33 100.00 130.00 0.00 Open ;
+ 118 25 232 231.12 100.00 130.00 0.00 Open ;
+ 119 232 24 187.06 100.00 130.00 0.00 Open ;
+ 120 24 231 240.64 100.00 130.00 0.00 Open ;
+ 121 231 7 173.44 125.00 130.00 0.00 Open ;
+ 122 7 6 23.58 100.00 130.00 0.00 Open ;
+ 123 6 28 526.74 125.00 130.00 0.00 Open ;
+ 124 28 249 500.72 100.00 130.00 0.00 Open ;
+ 125 249 29 15.29 100.00 130.00 0.00 Open ;
+ 126 7 8 265.92 125.00 130.00 0.00 Open ;
+ 127 8 23 355.51 125.00 130.00 0.00 Open ;
+ 128 23 207 189.78 125.00 130.00 0.00 Open ;
+ 129 207 208 28.18 125.00 130.00 0.00 Open ;
+ 130 208 22 129.34 125.00 130.00 0.00 Open ;
+ 131 22 21 361.24 125.00 130.00 0.00 Open ;
+ 132 21 264 223.52 150.00 130.00 0.00 Open ;
+ 133 20 210 185.17 150.00 130.00 0.00 Open ;
+ 134 210 209 154.95 150.00 130.00 0.00 Open ;
+ 135 209 19 34.71 200.00 130.00 0.00 Open ;
+ 136 264 20 31.14 150.00 130.00 0.00 Open ;
+ 137 19 253 42.52 200.00 130.00 0.00 Open ;
+ 138 253 18 356.45 200.00 130.00 0.00 Open ;
+ 139 18 211 128.82 200.00 130.00 0.00 Open ;
+ 140 211 212 140.66 200.00 130.00 0.00 Open ;
+ 141 212 11 113.32 200.00 130.00 0.00 Open ;
+ 142 11 10 555.23 150.00 130.00 0.00 Open ;
+ 143 10 4 272.68 150.00 130.00 0.00 Open ;
+ 144 59 203 315.88 100.00 130.00 0.00 Open ;
+ 145 203 202 284.93 100.00 130.00 0.00 Open ;
+ 146 202 31 97.93 125.00 130.00 0.00 Open ;
+ 147 265 32 262.94 100.00 130.00 0.00 Open ;
+ 148 32 33 635.82 100.00 130.00 0.00 Open ;
+ 149 33 34 415.73 150.00 130.00 0.00 Open ;
+ 150 34 35 122.60 150.00 130.00 0.00 Open ;
+ 151 265 31 29.56 100.00 130.00 0.00 Open ;
+ 152 59 205 33.80 100.00 130.00 0.00 Open ;
+ 153 205 88 377.12 100.00 130.00 0.00 Open ;
+ 154 88 89 629.17 150.00 130.00 0.00 Open ;
+ 155 89 90 133.28 200.00 130.00 0.00 Open ;
+ 156 90 91 348.05 200.00 130.00 0.00 Open ;
+ 157 91 234 292.89 300.00 130.00 0.00 Open ;
+ 158 234 109 488.99 300.00 130.00 0.00 Open ;
+ 159 138 235 289.88 100.00 130.00 0.00 Open ;
+ 160 235 110 486.72 100.00 130.00 0.00 Open ;
+ 161 102 106 260.92 200.00 130.00 0.00 Open ;
+ 162 106 91 163.58 200.00 130.00 0.00 Open ;
+ 163 48 108 424.07 200.00 130.00 0.00 Open ;
+ 164 108 109 173.66 200.00 130.00 0.00 Open ;
+ 165 109 110 99.55 150.00 130.00 0.00 Open ;
+ 166 110 111 307.92 150.00 130.00 0.00 Open ;
+ 167 59 204 283.84 100.00 130.00 0.00 Open ;
+ 168 204 200 141.49 125.00 130.00 0.00 Open ;
+ 169 200 100 58.27 125.00 130.00 0.00 Open ;
+ 170 100 199 79.59 150.00 130.00 0.00 Open ;
+ 171 199 198 39.41 150.00 130.00 0.00 Open ;
+ 172 198 101 126.25 150.00 130.00 0.00 Open ;
+ 173 29 30 61.39 100.00 130.00 0.00 Open ;
+ 174 30 31 73.73 100.00 130.00 0.00 Open ;
+ 175 31 250 83.16 125.00 130.00 0.00 Open ;
+ 176 250 197 118.22 150.00 130.00 0.00 Open ;
+ 177 197 101 297.21 150.00 130.00 0.00 Open ;
+ 178 101 221 17.08 200.00 130.00 0.00 Open ;
+ 179 221 139 58.11 200.00 130.00 0.00 Open ;
+ 180 139 219 135.50 200.00 130.00 0.00 Open ;
+ 181 139 192 255.85 100.00 130.00 0.00 Open ;
+ 182 192 191 40.65 100.00 130.00 0.00 Open ;
+ 183 219 102 161.59 200.00 130.00 0.00 Open ;
+ 184 191 190 136.29 100.00 130.00 0.00 Open ;
+ 185 190 105 57.23 125.00 130.00 0.00 Open ;
+ 186 105 189 164.02 125.00 130.00 0.00 Open ;
+ 187 189 35 192.86 125.00 130.00 0.00 Open ;
+ 188 105 104 234.58 100.00 130.00 0.00 Open ;
+ 189 104 103 215.82 100.00 130.00 0.00 Open ;
+ 190 102 103 231.93 100.00 130.00 0.00 Open ;
+ 191 91 138 134.12 150.00 130.00 0.00 Open ;
+ 192 138 112 175.33 150.00 130.00 0.00 Open ;
+ 193 112 113 231.12 150.00 130.00 0.00 Open ;
+ 194 112 92 607.94 100.00 130.00 0.00 Open ;
+ 195 257 147 122.13 150.00 130.00 0.00 Open ;
+ 196 147 63 40.06 150.00 130.00 0.00 Open ;
+ 197 63 64 301.37 150.00 130.00 0.00 Open ;
+ 198 64 65 102.07 125.00 130.00 0.00 Open ;
+ 199 65 80 1094.73 100.00 130.00 0.00 Open ;
+ 200 65 66 199.73 100.00 130.00 0.00 Open ;
+ 201 66 67 160.59 100.00 130.00 0.00 Open ;
+ 202 67 68 82.49 100.00 130.00 0.00 Open ;
+ 203 80 266 137.42 100.00 130.00 0.00 Open ;
+ 204 266 84 229.41 100.00 130.00 0.00 Open ;
+ 205 84 267 111.38 125.00 130.00 0.00 Open ;
+ 206 267 85 105.08 125.00 130.00 0.00 Open ;
+ 207 85 173 292.34 125.00 130.00 0.00 Open ;
+ 208 173 172 47.39 125.00 130.00 0.00 Open ;
+ 209 172 92 324.07 125.00 130.00 0.00 Open ;
+ 210 93 268 120.76 100.00 130.00 0.00 Open ;
+ 211 268 114 187.57 100.00 130.00 0.00 Open ;
+ 212 89 92 314.62 150.00 130.00 0.00 Open ;
+ 213 92 93 157.18 100.00 130.00 0.00 Open ;
+ 214 93 238 103.32 100.00 130.00 0.00 Open ;
+ 215 238 133 308.21 100.00 130.00 0.00 Open ;
+ 216 133 239 205.05 100.00 130.00 0.00 Open ;
+ 217 239 134 234.72 100.00 130.00 0.00 Open ;
+ 218 134 162 109.11 150.00 130.00 0.00 Open ;
+ 219 162 163 262.04 150.00 130.00 0.00 Open ;
+ 220 163 240 152.57 150.00 130.00 0.00 Open ;
+ 221 240 135 240.23 150.00 130.00 0.00 Open ;
+ 222 114 113 381.95 100.00 130.00 0.00 Open ;
+ 223 113 115 374.77 100.00 130.00 0.00 Open ;
+ 224 115 236 318.59 125.00 130.00 0.00 Open ;
+ 225 236 111 104.73 125.00 130.00 0.00 Open ;
+ 226 111 220 43.25 100.00 130.00 0.00 Open ;
+ 227 220 122 406.87 100.00 130.00 0.00 Open ;
+ 228 122 123 386.74 100.00 130.00 0.00 Open ;
+ 229 123 175 106.49 100.00 130.00 0.00 Open ;
+ 230 175 174 85.64 100.00 130.00 0.00 Open ;
+ 231 174 223 214.06 100.00 130.00 0.00 Open ;
+ 232 223 224 117.61 100.00 130.00 0.00 Open ;
+ 233 224 124 203.24 100.00 130.00 0.00 Open ;
+ 234 16 17 29.27 100.00 130.00 0.00 Open ;
+ 235 17 214 170.94 100.00 130.00 0.00 Open ;
+ 236 214 15 252.74 100.00 130.00 0.00 Open ;
+ 237 15 213 325.90 100.00 130.00 0.00 Open ;
+ 238 213 14 350.99 100.00 130.00 0.00 Open ;
+ 239 14 12 118.26 100.00 130.00 0.00 Open ;
+ 240 4 54 207.60 125.00 130.00 0.00 Open ;
+ 241 54 55 285.73 125.00 130.00 0.00 Open ;
+ 242 55 56 322.72 125.00 130.00 0.00 Open ;
+ 243 56 57 265.11 100.00 130.00 0.00 Open ;
+ 244 10 9 406.85 100.00 130.00 0.00 Open ;
+ 245 9 8 518.87 100.00 130.00 0.00 Open ;
+ 246 9 5 397.02 100.00 130.00 0.00 Open ;
+ 247 58 60 493.32 100.00 130.00 0.00 Open ;
+ 248 60 151 140.28 100.00 130.00 0.00 Open ;
+ 249 151 152 195.40 100.00 130.00 0.00 Open ;
+ 250 152 83 175.12 100.00 130.00 0.00 Open ;
+ 251 83 153 145.50 100.00 130.00 0.00 Open ;
+ 252 153 84 132.26 100.00 130.00 0.00 Open ;
+ 253 218 62 54.37 100.00 130.00 0.00 Open ;
+ 254 62 87 317.19 100.00 130.00 0.00 Open ;
+ 255 87 171 294.19 125.00 130.00 0.00 Open ;
+ 256 171 170 100.68 125.00 130.00 0.00 Open ;
+ 257 170 92 238.22 150.00 130.00 0.00 Open ;
+ 258 85 87 339.22 100.00 130.00 0.00 Open ;
+ 259 85 94 585.54 100.00 130.00 0.00 Open ;
+ 260 95 94 247.16 100.00 130.00 0.00 Open ;
+ 261 94 254 148.81 100.00 130.00 0.00 Open ;
+ 262 254 99 102.14 100.00 130.00 0.00 Open ;
+ 263 99 255 387.72 100.00 130.00 0.00 Open ;
+ 264 255 132 289.01 100.00 130.00 0.00 Open ;
+ 265 132 133 282.41 100.00 130.00 0.00 Open ;
+ 266 79 82 232.85 100.00 130.00 0.00 Open ;
+ 267 82 81 210.57 100.00 130.00 0.00 Open ;
+ 268 81 80 49.94 100.00 130.00 0.00 Open ;
+ 269 80 83 280.35 100.00 130.00 0.00 Open ;
+ 270 83 62 331.04 100.00 130.00 0.00 Open ;
+ 271 62 86 225.62 100.00 130.00 0.00 Open ;
+ 272 86 88 187.69 125.00 130.00 0.00 Open ;
+ 273 88 233 157.87 100.00 130.00 0.00 Open ;
+ 274 233 201 243.89 100.00 130.00 0.00 Open ;
+ 275 201 100 101.29 100.00 130.00 0.00 Open ;
+ 276 132 165 356.71 100.00 130.00 0.00 Open ;
+ 277 165 164 69.68 100.00 130.00 0.00 Open ;
+ 278 164 134 155.34 100.00 130.00 0.00 Open ;
+ 279 134 126 906.52 100.00 130.00 0.00 Open ;
+ 280 126 127 315.00 100.00 130.00 0.00 Open ;
+ 281 113 169 632.68 150.00 130.00 0.00 Open ;
+ 282 169 126 184.15 100.00 130.00 0.00 Open ;
+ 283 127 244 123.24 100.00 130.00 0.00 Open ;
+ 284 244 243 67.54 100.00 130.00 0.00 Open ;
+ 285 243 128 140.38 100.00 130.00 0.00 Open ;
+ 286 128 129 382.62 100.00 130.00 0.00 Open ;
+ 287 106 237 294.04 100.00 130.00 0.00 Open ;
+ 288 237 107 406.02 100.00 130.00 0.00 Open ;
+ 289 107 108 111.83 100.00 130.00 0.00 Open ;
+ 290 109 188 457.93 350.00 130.00 0.00 Open ;
+ 291 188 51 165.68 350.00 130.00 0.00 Open ;
+ 292 51 52 38.63 350.00 130.00 0.00 Open ;
+ 293 52 256 422.28 100.00 130.00 0.00 Open ;
+ 294 256 120 243.49 100.00 130.00 0.00 Open ;
+ 295 120 118 220.11 100.00 130.00 0.00 Open ;
+ 296 120 119 204.87 100.00 130.00 0.00 Open ;
+ 297 119 117 111.09 100.00 130.00 0.00 Open ;
+ 298 119 116 205.38 100.00 130.00 0.00 Open ;
+ 299 119 118 55.48 100.00 130.00 0.00 Open ;
+ 300 35 47 110.86 200.00 130.00 0.00 Open ;
+ 301 47 187 112.89 100.00 130.00 0.00 Open ;
+ 302 187 44 77.84 100.00 130.00 0.00 Open ;
+ 303 44 43 153.46 100.00 130.00 0.00 Open ;
+ 304 43 42 464.02 100.00 130.00 0.00 Open ;
+ 305 42 41 481.27 100.00 130.00 0.00 Open ;
+ 306 49 185 214.32 200.00 130.00 0.00 Open ;
+ 307 185 186 383.55 200.00 130.00 0.00 Open ;
+ 308 186 52 96.32 200.00 130.00 0.00 Open ;
+ 309 44 45 90.52 100.00 130.00 0.00 Open ;
+ 310 45 46 184.64 100.00 130.00 0.00 Open ;
+ 311 46 50 291.38 100.00 130.00 0.00 Open ;
+ 312 50 51 260.28 100.00 130.00 0.00 Open ;
+ 313 47 48 28.45 200.00 130.00 0.00 Open ;
+ 317 273 1 1000 250 130 0 Open ;
+ 319 274 136 100 230 130 0 Open ;
+ 320 275 203 50 200 130 0 Open ;
+
+[PUMPS]
+;ID Node1 Node2 Parameters
+ 314 269 52 HEAD 314 ;
+ 315 270 209 HEAD 315 ;
+ 316 271 273 HEAD 316 ;
+ 318 272 274 HEAD 318 ;
+
+[VALVES]
+;ID Node1 Node2 Diameter Type Setting MinorLoss
+
+[TAGS]
+
+[DEMANDS]
+;Junction Demand Pattern Category
+
+[STATUS]
+;ID Status/Setting
+
+[PATTERNS]
+;ID Multipliers
+;
+ 1 0.3 0.3 0.2 0.2 0.2 0.5
+ 1 0.5 1 1 1 1 0.9
+ 1 0.4 0.4 0.4 0.4 0.8 0.8
+ 1 0.8 0.8 0.6 0.6 0.5 0.4
+;
+ 2 1 1 1 1 1 1
+ 2 1 1 1 1 1 1
+ 2 1 1 1 1 1 1
+ 2 1 1 1 1 1 1
+
+[CURVES]
+;ID X-Value Y-Value
+;PUMP:
+ 314 10 80
+ 314 50 75
+ 314 80 65
+;PUMP:
+ 316 10 110
+ 316 30 100
+ 316 50 80
+;PUMP:
+ 315 10 79
+ 315 20 69
+ 315 30 40
+;PUMP:
+ 318 10 90
+ 318 20 80
+ 318 30 55
+
+[CONTROLS]
+
+
+
+
+[RULES]
+
+
+
+
+[ENERGY]
+ Global Efficiency 90
+ Global Price 0
+ Demand Charge 0
+
+[EMITTERS]
+;Junction Coefficient
+
+[QUALITY]
+;Node InitQual
+
+[SOURCES]
+;Node Type Quality Pattern
+
+[REACTIONS]
+;Type Pipe/Tank Coefficient
+
+
+[REACTIONS]
+ Order Bulk 1
+ Order Tank 1
+ Order Wall 1
+ Global Bulk 0
+ Global Wall 0
+ Limiting Potential 0
+ Roughness Correlation 0
+
+[MIXING]
+;Tank Model
+
+[TIMES]
+ Duration 24:00
+ Hydraulic Timestep 1:00
+ Quality Timestep 0:05
+ Pattern Timestep 2:00
+ Pattern Start 0:00
+ Report Timestep 1:00
+ Report Start 0:00
+ Start ClockTime 12 am
+ Statistic NONE
+
+[REPORT]
+ Status Yes
+ Summary No
+ Page 0
+
+[OPTIONS]
+ Units LPS
+ Headloss H-W
+ Specific Gravity 1.0
+ Viscosity 1.0
+ Trials 40
+ Accuracy 0.001
+ CHECKFREQ 2
+ MAXCHECK 10
+ DAMPLIMIT 0
+ Unbalanced Continue 10
+ Pattern 1
+ Demand Multiplier 1.0
+ Emitter Exponent 0.5
+ Quality Age mg/L
+ Diffusivity 1.0
+ Tolerance 0.01
+
+[COORDINATES]
+;Node X-Coord Y-Coord
+ 1 1650094.63 4944639.00
+ 2 1650348.88 4944585.00
+ 3 1650592.63 4945068.00
+ 4 1650829.50 4945554.00
+ 5 1651029.88 4945905.50
+ 6 1651232.38 4946354.50
+ 7 1651227.63 4946378.00
+ 8 1650986.00 4946490.50
+ 9 1650757.00 4946024.50
+ 10 1650577.50 4945659.50
+ 11 1650064.50 4945875.00
+ 12 1649881.13 4945376.00
+ 13 1650029.25 4945313.50
+ 14 1649770.50 4945419.00
+ 15 1649922.38 4944957.00
+ 16 1650100.25 4944685.50
+ 17 1650073.75 4944698.00
+ 18 1649896.88 4946121.00
+ 19 1650065.00 4946470.50
+ 20 1649998.63 4946733.50
+ 21 1650051.00 4946979.00
+ 22 1650379.13 4946826.00
+ 23 1650670.25 4946655.00
+ 24 1651438.88 4946731.50
+ 25 1651852.38 4946763.00
+ 26 1652162.25 4946635.00
+ 27 1652182.25 4946677.00
+ 28 1651699.38 4946109.00
+ 29 1652135.63 4945859.50
+ 30 1652188.25 4945828.00
+ 31 1652250.75 4945788.50
+ 32 1652137.88 4946048.50
+ 33 1652747.88 4946233.50
+ 34 1653164.75 4946233.50
+ 35 1653238.38 4946135.50
+ 36 1652471.50 4947147.50
+ 37 1652974.13 4946893.00
+ 38 1653000.50 4947593.00
+ 39 1652997.88 4947950.00
+ 40 1653465.13 4947628.00
+ 41 1653953.13 4947276.50
+ 42 1653669.25 4946887.50
+ 43 1653412.88 4946500.50
+ 44 1653325.38 4946374.50
+ 45 1653405.75 4946332.50
+ 46 1653576.75 4946261.50
+ 47 1653305.50 4946224.00
+ 48 1653327.63 4946206.00
+ 49 1654320.88 4947050.50
+ 50 1653865.63 4946305.00
+ 51 1654128.63 4946356.50
+ 52 1654151.00 4946388.00
+ 53 1651249.88 4944650.00
+ 54 1651009.13 4945449.00
+ 55 1651234.38 4945272.50
+ 56 1651454.00 4945036.00
+ 57 1651631.75 4944839.00
+ 58 1651706.13 4944872.00
+ 59 1652209.75 4945096.00
+ 60 1651938.88 4944437.00
+ 61 1652230.25 4944648.50
+ 62 1652461.25 4944548.00
+ 63 1651242.38 4944380.50
+ 64 1651105.25 4944112.50
+ 65 1651206.00 4944094.00
+ 66 1651172.75 4943897.00
+ 67 1651089.50 4943759.50
+ 68 1651047.88 4943688.50
+ 69 1650871.63 4943730.00
+ 70 1650699.50 4943831.00
+ 71 1650643.50 4943741.50
+ 72 1650545.13 4943797.50
+ 73 1650520.88 4943731.00
+ 74 1650299.25 4943830.50
+ 75 1650312.00 4943864.00
+ 76 1650129.50 4944033.00
+ 77 1650062.38 4944332.50
+ 78 1651328.75 4943618.50
+ 79 1652035.13 4943543.00
+ 80 1652295.38 4943960.00
+ 81 1652274.00 4943915.00
+ 82 1652177.13 4943728.00
+ 83 1652378.50 4944227.50
+ 84 1652613.25 4944096.00
+ 85 1652813.00 4944165.50
+ 86 1652520.50 4944765.50
+ 87 1652776.00 4944502.50
+ 88 1652571.63 4944946.00
+ 89 1653166.63 4944737.00
+ 90 1653208.38 4944863.50
+ 91 1653384.13 4945164.00
+ 92 1653347.25 4944479.50
+ 93 1653436.50 4944350.00
+ 94 1652876.63 4943584.00
+ 95 1652898.75 4943338.00
+ 96 1652902.50 4943296.00
+ 97 1653228.75 4943125.00
+ 98 1653309.50 4943022.00
+ 99 1653025.75 4943691.50
+ 100 1652573.75 4945380.00
+ 101 1652700.00 4945571.00
+ 102 1653007.75 4945362.00
+ 103 1653126.88 4945561.50
+ 104 1653249.50 4945739.00
+ 105 1653037.88 4945841.50
+ 106 1653240.25 4945242.50
+ 107 1653586.00 4945851.50
+ 108 1653657.00 4945938.00
+ 109 1653793.75 4945830.50
+ 110 1653877.13 4945776.00
+ 111 1654144.25 4945621.50
+ 112 1653650.88 4945006.00
+ 113 1653850.25 4944888.50
+ 114 1653644.13 4944567.00
+ 115 1654038.25 4945213.00
+ 116 1654814.75 4946886.50
+ 117 1655054.13 4946778.50
+ 118 1654981.88 4946686.50
+ 119 1654952.13 4946733.50
+ 120 1654764.13 4946651.50
+ 121 1655205.88 4946327.00
+ 122 1654560.50 4945469.50
+ 123 1654911.50 4945305.00
+ 124 1655494.63 4944952.50
+ 125 1655475.63 4944804.50
+ 126 1654567.88 4944497.00
+ 127 1654739.50 4944761.00
+ 128 1655066.00 4944789.00
+ 129 1655412.50 4944625.00
+ 130 1655182.00 4944156.00
+ 131 1655000.88 4943750.00
+ 132 1653583.88 4943834.50
+ 133 1653737.00 4944072.00
+ 134 1654039.88 4943759.50
+ 135 1654630.13 4943284.00
+ 136 1654391.75 4942756.00
+ 137 1654787.38 4943123.00
+ 138 1653500.25 4945096.50
+ 139 1652763.88 4945531.50
+ 140 1650107.63 4944676.50
+ 141 1650145.63 4944665.00
+ 142 1650352.50 4944579.50
+ 143 1650357.88 4944574.50
+ 144 1650376.25 4944620.50
+ 145 1650381.38 4944614.00
+ 146 1651251.13 4944414.50
+ 147 1651260.13 4944416.50
+ 148 1651237.25 4944384.00
+ 149 1651579.00 4944230.50
+ 150 1651645.38 4944302.00
+ 151 1652019.13 4944321.50
+ 152 1652208.25 4944271.00
+ 153 1652519.13 4944189.50
+ 154 1651329.50 4943687.50
+ 155 1652392.63 4943383.50
+ 156 1652393.38 4943359.50
+ 157 1653184.25 4943033.00
+ 158 1654010.50 4942993.00
+ 159 1654455.63 4942851.00
+ 160 1654626.38 4942950.50
+ 161 1654827.25 4943438.00
+ 162 1654111.88 4943677.50
+ 163 1654341.00 4943549.50
+ 164 1653947.88 4943634.00
+ 165 1653878.00 4943632.00
+ 166 1655342.50 4944429.00
+ 167 1655290.50 4944410.00
+ 168 1655221.38 4944282.00
+ 169 1654399.38 4944572.00
+ 170 1653136.13 4944368.00
+ 171 1653035.25 4944362.50
+ 172 1653147.88 4944201.00
+ 173 1653102.13 4944214.00
+ 174 1655032.00 4945217.50
+ 175 1655018.25 4945301.50
+ 176 1655514.13 4945400.50
+ 177 1655702.38 4945732.00
+ 178 1655636.25 4945947.50
+ 179 1655473.38 4946058.00
+ 180 1655702.00 4945843.50
+ 181 1655004.88 4946866.00
+ 182 1654848.63 4946920.00
+ 183 1654504.88 4947010.00
+ 184 1654147.63 4947127.50
+ 185 1654320.63 4946836.00
+ 186 1654196.13 4946476.50
+ 187 1653374.00 4946313.50
+ 188 1654034.00 4946220.50
+ 189 1653117.88 4945984.50
+ 190 1652987.50 4945869.00
+ 191 1652919.50 4945750.50
+ 192 1652879.75 4945759.50
+ 193 1652625.50 4947099.50
+ 194 1652295.38 4946618.50
+ 195 1652739.13 4946283.50
+ 196 1652044.50 4946708.50
+ 197 1652433.00 4945703.00
+ 198 1652664.75 4945450.00
+ 199 1652626.63 4945439.50
+ 200 1652531.63 4945339.50
+ 201 1652665.13 4945336.00
+ 202 1652217.38 4945696.50
+ 203 1652211.63 4945412.00
+ 204 1652469.38 4945212.50
+ 205 1652212.00 4945062.50
+ 206 1651102.75 4946039.00
+ 207 1650501.50 4946742.50
+ 208 1650496.13 4946770.00
+ 209 1650076.63 4946503.50
+ 210 1649932.25 4946560.50
+ 211 1649851.13 4946001.00
+ 212 1649984.88 4945956.00
+ 213 1649627.88 4945098.00
+ 214 1650151.88 4944850.00
+ 215 1649929.63 4944395.00
+ 216 1650210.88 4944252.00
+ 217 1650325.75 4943930.50
+ 218 1652407.25 4944555.50
+ 219 1652869.63 4945446.50
+ 220 1654186.38 4945631.50
+ 221 1652715.75 4945564.50
+ 222 1654757.00 4943407.50
+ 223 1655204.38 4945090.00
+ 224 1655307.38 4945032.50
+ 225 1655520.50 4945027.50
+ 226 1655510.63 4945305.50
+ 227 1655546.63 4945480.00
+ 228 1655316.13 4946179.00
+ 229 1655280.25 4946245.50
+ 230 1651133.00 4944753.00
+ 231 1651333.63 4946515.00
+ 232 1651621.00 4946776.50
+ 233 1652620.25 4945096.50
+ 234 1653535.38 4945415.00
+ 235 1653638.50 4945351.50
+ 236 1654106.25 4945524.00
+ 237 1653382.38 4945500.00
+ 238 1653496.88 4944266.00
+ 239 1653901.25 4943949.00
+ 240 1654462.38 4943456.50
+ 241 1655230.88 4944258.00
+ 242 1655162.75 4944163.00
+ 243 1654925.75 4944801.00
+ 244 1654858.25 4944795.00
+ 245 1655479.00 4944922.50
+ 246 1655494.88 4944873.00
+ 247 1654742.88 4946936.50
+ 248 1653702.88 4947431.00
+ 249 1652127.00 4945847.00
+ 250 1652323.25 4945747.50
+ 251 1651497.63 4944781.50
+ 252 1650826.88 4944939.50
+ 253 1650026.00 4946453.50
+ 254 1653025.75 4943589.50
+ 255 1653405.25 4943607.00
+ 256 1654542.00 4946550.00
+ 257 1651141.13 4944445.00
+ 258 1650052.63 4944638.00
+ 259 1650012.63 4944551.50
+ 260 1649989.63 4944541.50
+ 261 1650020.38 4944365.00
+ 262 1650106.88 4944325.50
+ 263 1650209.75 4944195.50
+ 264 1650017.88 4946758.00
+ 265 1652260.88 4945816.50
+ 266 1652433.00 4943954.00
+ 267 1652708.25 4944155.00
+ 268 1653541.75 4944409.50
+ 273 1650167.10 4944470.34
+ 274 1654419.98 4942506.99
+ 269 1654257.63 4946332.50
+ 270 1650149.75 4946528.50
+ 271 1650191.75 4944416.50
+ 272 1654428.63 4942467.00
+ 275 1652007.68 4945436.25
+
+[VERTICES]
+;Link X-Coord Y-Coord
+
+[LABELS]
+;X-Coord Y-Coord Label & Anchor Node
+
+[BACKDROP]
+ DIMENSIONS 1649324.15 4942192.85 1656006.10 4948224.15
+ UNITS None
+ FILE
+ OFFSET 0.00 0.00
+
+[END]
diff --git a/Python/tsnet/examples/networks/bug_mod.inp b/Python/tsnet/examples/networks/bug_mod.inp
new file mode 100644
index 0000000..24fa16e
--- /dev/null
+++ b/Python/tsnet/examples/networks/bug_mod.inp
@@ -0,0 +1,1026 @@
+[TITLE]
+modena -- Bragalli, D'Ambrosio, Lee, Lodi, Toth (2008)
+
+[JUNCTIONS]
+;ID Elev Demand Pattern
+ 1 39.49 0.06 1 ;
+ 2 39.62 1.45 1 ;
+ 3 38.70 5.13 1 ;
+ 4 37.25 2.76 1 ;
+ 5 36.27 0.96 1 ;
+ 6 35.95 0.78 1 ;
+ 7 35.95 1.03 1 ;
+ 8 36.09 2.12 1 ;
+ 9 36.18 1.16 1 ;
+ 10 37.00 1.78 1 ;
+ 11 36.50 0.44 1 ;
+ 12 37.39 0.03 1 ;
+ 13 38.07 0.57 1 ;
+ 14 37.02 0.36 1 ;
+ 15 41.26 3.30 1 ;
+ 16 39.35 0.03 1 ;
+ 17 39.53 2.10 1 ;
+ 18 36.59 4.67 1 ;
+ 19 36.76 0.00 1 ;
+ 20 37.72 1.53 1 ;
+ 21 37.31 4.61 1 ;
+ 22 37.62 1.06 1 ;
+ 23 36.99 1.32 1 ;
+ 24 35.20 2.74 1 ;
+ 25 35.11 0.59 1 ;
+ 26 34.65 0.45 1 ;
+ 27 34.33 0.64 1 ;
+ 28 36.15 7.11 1 ;
+ 29 36.30 0.93 1 ;
+ 30 36.10 0.04 1 ;
+ 31 36.14 0.02 1 ;
+ 32 35.80 2.93 1 ;
+ 33 33.26 2.34 1 ;
+ 34 33.34 1.94 1 ;
+ 35 33.51 1.19 1 ;
+ 36 32.70 1.41 1 ;
+ 37 32.65 2.98 1 ;
+ 38 32.56 2.11 1 ;
+ 39 33.56 7.74 1 ;
+ 40 31.59 4.29 1 ;
+ 41 31.38 7.78 1 ;
+ 42 32.67 3.75 1 ;
+ 43 33.50 2.37 1 ;
+ 44 33.57 1.42 1 ;
+ 45 33.77 0.32 1 ;
+ 46 34.14 1.14 1 ;
+ 47 33.68 1.23 1 ;
+ 48 33.71 1.37 1 ;
+ 49 31.68 1.18 1 ;
+ 50 33.34 1.81 1 ;
+ 51 32.83 0.97 1 ;
+ 52 32.78 0.55 1 ;
+ 53 39.28 2.77 1 ;
+ 54 37.12 0.65 1 ;
+ 55 36.48 1.38 1 ;
+ 56 36.42 8.28 1 ;
+ 57 36.13 1.22 1 ;
+ 58 36.05 3.85 1 ;
+ 59 36.77 2.62 1 ;
+ 60 35.48 2.78 1 ;
+ 61 35.05 1.56 1 ;
+ 62 35.10 1.16 1 ;
+ 63 37.95 1.22 1 ;
+ 64 38.44 2.93 1 ;
+ 65 37.81 1.13 1 ;
+ 66 38.22 1.12 1 ;
+ 67 38.73 0.48 1 ;
+ 68 38.95 1.37 1 ;
+ 69 39.70 2.26 1 ;
+ 70 40.59 1.31 1 ;
+ 71 40.81 1.06 1 ;
+ 72 41.06 0.38 1 ;
+ 73 41.45 1.76 1 ;
+ 74 41.83 0.56 1 ;
+ 75 41.44 0.00 1 ;
+ 76 41.09 4.64 1 ;
+ 77 40.74 1.03 1 ;
+ 78 38.60 3.08 1 ;
+ 79 36.91 1.60 1 ;
+ 80 36.75 4.49 1 ;
+ 81 36.81 1.25 1 ;
+ 82 37.05 0.87 1 ;
+ 83 35.88 0.72 1 ;
+ 84 36.45 0.49 1 ;
+ 85 36.16 3.92 1 ;
+ 86 34.99 0.94 1 ;
+ 87 35.61 3.33 1 ;
+ 88 34.89 4.17 1 ;
+ 89 35.59 1.44 1 ;
+ 90 35.70 1.84 1 ;
+ 91 35.20 2.00 1 ;
+ 92 35.64 2.24 1 ;
+ 93 35.93 0.20 1 ;
+ 94 37.64 2.27 1 ;
+ 95 37.17 1.44 1 ;
+ 96 37.10 2.67 1 ;
+ 97 36.97 0.60 1 ;
+ 98 37.00 2.76 1 ;
+ 99 36.74 0.05 1 ;
+ 100 34.78 2.06 1 ;
+ 101 34.26 3.19 1 ;
+ 102 33.66 4.69 1 ;
+ 103 33.78 1.70 1 ;
+ 104 33.75 0.02 1 ;
+ 105 33.38 0.10 1 ;
+ 106 34.85 1.11 1 ;
+ 107 34.27 1.02 1 ;
+ 108 34.30 0.88 1 ;
+ 109 33.95 2.33 1 ;
+ 110 33.92 0.31 1 ;
+ 111 32.32 0.45 1 ;
+ 112 34.76 2.96 1 ;
+ 113 34.21 8.12 1 ;
+ 114 34.92 1.76 1 ;
+ 115 32.96 5.96 1 ;
+ 116 30.69 0.00 1 ;
+ 117 30.59 6.34 1 ;
+ 118 30.73 0.00 1 ;
+ 119 30.70 0.00 1 ;
+ 120 31.02 3.03 1 ;
+ 121 31.03 1.85 1 ;
+ 122 31.75 1.77 1 ;
+ 123 32.00 1.48 1 ;
+ 124 32.05 0.00 1 ;
+ 125 32.10 1.32 1 ;
+ 126 33.76 2.24 1 ;
+ 127 32.27 1.26 1 ;
+ 128 31.86 5.39 1 ;
+ 129 32.42 1.00 1 ;
+ 130 33.00 1.61 1 ;
+ 131 33.63 4.71 1 ;
+ 132 36.37 2.64 1 ;
+ 133 35.69 2.11 1 ;
+ 134 35.52 1.51 1 ;
+ 135 35.56 0.84 1 ;
+ 136 35.92 1.05 1 ;
+ 137 35.37 1.16 1 ;
+ 138 35.06 2.45 1 ;
+ 139 34.12 1.66 1 ;
+ 140 39.35 0.00 1 ;
+ 141 39.10 0.00 1 ;
+ 142 39.84 0.00 1 ;
+ 143 39.84 0.80 1 ;
+ 144 39.45 0.33 1 ;
+ 145 39.70 0.34 1 ;
+ 146 37.95 1.02 1 ;
+ 147 37.61 1.23 1 ;
+ 148 37.95 0.09 1 ;
+ 149 35.69 0.43 1 ;
+ 150 35.32 1.56 1 ;
+ 151 35.81 0.80 1 ;
+ 152 35.81 1.38 1 ;
+ 153 36.02 0.53 1 ;
+ 154 38.25 0.59 1 ;
+ 155 37.50 2.33 1 ;
+ 156 37.54 0.03 1 ;
+ 157 37.08 0.31 1 ;
+ 158 36.76 8.49 1 ;
+ 159 35.88 0.32 1 ;
+ 160 35.77 0.21 1 ;
+ 161 34.70 0.02 1 ;
+ 162 35.37 1.23 1 ;
+ 163 34.99 0.99 1 ;
+ 164 35.93 0.55 1 ;
+ 165 36.27 0.78 1 ;
+ 166 32.67 0.27 1 ;
+ 167 32.75 0.27 1 ;
+ 168 32.88 0.07 1 ;
+ 169 34.09 9.47 1 ;
+ 170 36.09 2.64 1 ;
+ 171 36.05 1.02 1 ;
+ 172 36.04 0.88 1 ;
+ 173 36.02 0.49 1 ;
+ 174 31.76 0.00 1 ;
+ 175 31.91 1.12 1 ;
+ 176 31.80 0.00 1 ;
+ 177 31.48 0.00 1 ;
+ 178 31.12 0.01 1 ;
+ 179 31.10 0.00 1 ;
+ 180 31.19 0.00 1 ;
+ 181 30.39 0.00 1 ;
+ 182 30.55 0.01 1 ;
+ 183 31.13 1.84 1 ;
+ 184 31.81 0.04 1 ;
+ 185 32.34 1.68 1 ;
+ 186 32.83 2.37 1 ;
+ 187 33.69 0.09 1 ;
+ 188 33.17 1.23 1 ;
+ 189 33.23 3.90 1 ;
+ 190 33.34 1.17 1 ;
+ 191 33.77 1.70 1 ;
+ 192 33.77 2.15 1 ;
+ 193 32.20 4.00 1 ;
+ 194 34.41 4.46 1 ;
+ 195 33.39 0.05 1 ;
+ 196 34.34 0.01 1 ;
+ 197 35.03 4.12 1 ;
+ 198 34.44 0.39 1 ;
+ 199 34.53 0.15 1 ;
+ 200 34.94 1.82 1 ;
+ 201 34.70 3.43 1 ;
+ 202 36.70 0.62 1 ;
+ 203 36.20 4.17 1 ;
+ 204 35.03 2.26 1 ;
+ 205 36.77 1.01 1 ;
+ 206 36.20 0.54 1 ;
+ 207 37.88 0.77 1 ;
+ 208 38.03 0.33 1 ;
+ 209 36.86 1.15 1 ;
+ 210 37.24 1.53 1 ;
+ 211 36.66 0.00 1 ;
+ 212 36.49 0.30 1 ;
+ 213 37.30 0.32 1 ;
+ 214 40.30 0.56 1 ;
+ 215 39.85 0.00 1 ;
+ 216 41.00 0.19 1 ;
+ 217 41.16 1.42 1 ;
+ 218 35.05 0.59 1 ;
+ 219 33.92 1.48 1 ;
+ 220 32.14 0.92 1 ;
+ 221 34.17 0.33 1 ;
+ 222 35.10 0.06 1 ;
+ 223 31.55 0.46 1 ;
+ 224 31.75 0.72 1 ;
+ 225 32.07 0.00 1 ;
+ 226 31.94 0.00 1 ;
+ 227 31.66 0.20 1 ;
+ 228 31.04 0.08 1 ;
+ 229 31.05 1.30 1 ;
+ 230 38.49 1.07 1 ;
+ 231 35.68 1.03 1 ;
+ 232 35.39 0.03 1 ;
+ 233 34.89 1.15 1 ;
+ 234 34.86 1.43 1 ;
+ 235 34.99 4.86 1 ;
+ 236 32.54 4.71 1 ;
+ 237 34.41 1.34 1 ;
+ 238 36.16 1.87 1 ;
+ 239 35.30 0.82 1 ;
+ 240 35.17 0.94 1 ;
+ 241 32.92 0.09 1 ;
+ 242 33.07 1.28 1 ;
+ 243 31.91 0.43 1 ;
+ 244 32.00 0.51 1 ;
+ 245 32.05 0.00 1 ;
+ 246 32.05 0.01 1 ;
+ 247 30.70 0.01 1 ;
+ 248 31.33 0.00 1 ;
+ 249 36.30 1.75 1 ;
+ 250 35.83 1.03 1 ;
+ 251 36.95 1.26 1 ;
+ 252 38.01 1.36 1 ;
+ 253 36.65 0.14 1 ;
+ 254 36.91 0.00 1 ;
+ 255 36.77 1.96 1 ;
+ 256 31.50 2.21 1 ;
+ 257 38.65 0.62 1 ;
+ 258 39.54 0.00 1 ;
+ 259 39.58 0.50 1 ;
+ 260 39.58 0.11 1 ;
+ 261 40.55 0.12 1 ;
+ 262 40.79 0.22 1 ;
+ 263 40.95 1.28 1 ;
+ 264 37.76 0.19 1 ;
+ 265 35.96 0.22 1 ;
+ 266 36.81 1.19 1 ;
+ 267 36.21 1.69 1 ;
+ 268 35.61 0.43 1 ;
+ 273 40 0 1 ;
+ 274 40 0 1 ;
+ 276 36.86 0 ;
+
+[RESERVOIRS]
+;ID Head Pattern
+ 269 20 ;
+ 270 20 ;
+ 271 20 ;
+ 272 20 ;
+
+[TANKS]
+;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
+ 275 50 10 0 20 30 0 ;
+
+[PIPES]
+;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
+ 1 1 16 46.84 125.00 130.00 0.00 Open ;
+ 2 16 2 267.68 100.00 130.00 0.00 Open ;
+ 3 2 3 541.07 100.00 130.00 0.00 Open ;
+ 4 3 4 542.29 100.00 130.00 0.00 Open ;
+ 5 4 5 404.72 100.00 130.00 0.00 Open ;
+ 6 5 206 151.67 100.00 130.00 0.00 Open ;
+ 7 206 6 341.57 100.00 130.00 0.00 Open ;
+ 8 1 140 39.91 100.00 130.00 0.00 Open ;
+ 9 140 143 269.73 100.00 130.00 0.00 Open ;
+ 10 143 145 45.92 100.00 130.00 0.00 Open ;
+ 11 145 146 890.09 100.00 130.00 0.00 Open ;
+ 12 146 148 33.79 100.00 130.00 0.00 Open ;
+ 13 148 63 6.03 100.00 130.00 0.00 Open ;
+ 14 63 149 367.92 125.00 130.00 0.00 Open ;
+ 15 149 150 97.66 125.00 130.00 0.00 Open ;
+ 16 150 60 322.19 100.00 130.00 0.00 Open ;
+ 17 60 61 359.48 100.00 130.00 0.00 Open ;
+ 18 61 218 199.59 100.00 130.00 0.00 Open ;
+ 19 1 141 57.06 200.00 130.00 0.00 Open ;
+ 20 141 142 223.41 200.00 130.00 0.00 Open ;
+ 21 142 144 47.03 200.00 130.00 0.00 Open ;
+ 22 144 257 782.67 200.00 130.00 0.00 Open ;
+ 23 257 53 231.87 125.00 130.00 0.00 Open ;
+ 24 53 251 279.84 100.00 130.00 0.00 Open ;
+ 25 251 57 145.70 100.00 130.00 0.00 Open ;
+ 26 57 58 81.10 100.00 130.00 0.00 Open ;
+ 27 58 59 550.17 100.00 130.00 0.00 Open ;
+ 28 53 230 155.63 100.00 130.00 0.00 Open ;
+ 29 230 252 357.81 100.00 130.00 0.00 Open ;
+ 30 252 3 267.32 100.00 130.00 0.00 Open ;
+ 31 3 13 612.50 100.00 130.00 0.00 Open ;
+ 32 13 12 160.50 100.00 130.00 0.00 Open ;
+ 33 12 11 531.71 100.00 130.00 0.00 Open ;
+ 34 1 258 41.91 200.00 130.00 0.00 Open ;
+ 35 258 259 95.22 200.00 130.00 0.00 Open ;
+ 36 259 260 25.13 200.00 130.00 0.00 Open ;
+ 37 260 215 158.12 200.00 130.00 0.00 Open ;
+ 38 215 261 95.40 200.00 130.00 0.00 Open ;
+ 39 261 77 52.92 200.00 130.00 0.00 Open ;
+ 40 77 262 44.92 200.00 130.00 0.00 Open ;
+ 41 262 216 127.05 200.00 130.00 0.00 Open ;
+ 42 216 263 56.68 200.00 130.00 0.00 Open ;
+ 43 263 76 181.29 200.00 130.00 0.00 Open ;
+ 44 76 217 220.90 200.00 130.00 0.00 Open ;
+ 45 217 75 67.65 200.00 130.00 0.00 Open ;
+ 46 75 74 36.06 200.00 130.00 0.00 Open ;
+ 47 74 73 242.29 150.00 130.00 0.00 Open ;
+ 48 73 72 70.45 150.00 130.00 0.00 Open ;
+ 49 72 71 112.83 150.00 130.00 0.00 Open ;
+ 50 71 70 105.72 150.00 130.00 0.00 Open ;
+ 51 70 69 199.42 150.00 130.00 0.00 Open ;
+ 52 69 68 180.64 125.00 130.00 0.00 Open ;
+ 53 68 78 288.76 125.00 130.00 0.00 Open ;
+ 54 78 154 69.26 100.00 130.00 0.00 Open ;
+ 55 154 79 718.45 100.00 130.00 0.00 Open ;
+ 56 79 155 390.78 100.00 130.00 0.00 Open ;
+ 57 155 156 24.00 125.00 130.00 0.00 Open ;
+ 58 156 95 504.52 125.00 130.00 0.00 Open ;
+ 59 95 96 41.78 150.00 130.00 0.00 Open ;
+ 60 96 97 367.93 150.00 130.00 0.00 Open ;
+ 61 97 157 101.86 150.00 130.00 0.00 Open ;
+ 62 157 98 125.36 150.00 130.00 0.00 Open ;
+ 63 98 158 699.76 150.00 130.00 0.00 Open ;
+ 64 158 136 448.05 200.00 130.00 0.00 Open ;
+ 65 136 159 114.29 200.00 130.00 0.00 Open ;
+ 66 159 160 197.30 200.00 130.00 0.00 Open ;
+ 67 160 137 235.98 200.00 130.00 0.00 Open ;
+ 68 137 135 224.87 200.00 130.00 0.00 Open ;
+ 69 135 222 176.73 125.00 130.00 0.00 Open ;
+ 70 222 161 76.44 100.00 130.00 0.00 Open ;
+ 71 161 131 356.94 100.00 130.00 0.00 Open ;
+ 72 131 242 443.79 100.00 130.00 0.00 Open ;
+ 73 242 130 20.55 100.00 130.00 0.00 Open ;
+ 74 130 241 113.33 100.00 130.00 0.00 Open ;
+ 75 241 168 25.96 100.00 130.00 0.00 Open ;
+ 76 168 167 145.04 100.00 130.00 0.00 Open ;
+ 77 167 166 55.24 100.00 130.00 0.00 Open ;
+ 78 166 129 208.22 100.00 130.00 0.00 Open ;
+ 79 129 125 190.43 100.00 130.00 0.00 Open ;
+ 80 125 246 70.98 100.00 130.00 0.00 Open ;
+ 81 246 245 52.04 100.00 130.00 0.00 Open ;
+ 82 245 124 34.03 100.00 130.00 0.00 Open ;
+ 83 124 225 79.47 100.00 130.00 0.00 Open ;
+ 84 225 226 277.99 100.00 130.00 0.00 Open ;
+ 85 176 227 86.03 100.00 130.00 0.00 Open ;
+ 86 227 177 296.25 100.00 130.00 0.00 Open ;
+ 87 177 180 111.30 100.00 130.00 0.00 Open ;
+ 88 180 178 123.37 100.00 130.00 0.00 Open ;
+ 89 178 179 196.27 100.00 130.00 0.00 Open ;
+ 90 179 228 198.46 100.00 130.00 0.00 Open ;
+ 91 228 229 75.62 100.00 130.00 0.00 Open ;
+ 92 229 121 110.14 100.00 130.00 0.00 Open ;
+ 93 121 118 423.57 100.00 130.00 0.00 Open ;
+ 94 118 117 116.57 100.00 130.00 0.00 Open ;
+ 95 117 181 100.61 100.00 130.00 0.00 Open ;
+ 96 181 182 164.84 100.00 130.00 0.00 Open ;
+ 97 182 116 47.49 100.00 130.00 0.00 Open ;
+ 98 116 247 87.54 100.00 130.00 0.00 Open ;
+ 99 49 184 189.27 150.00 130.00 0.00 Open ;
+ 100 184 41 244.80 150.00 130.00 0.00 Open ;
+ 101 41 248 293.47 150.00 130.00 0.00 Open ;
+ 102 248 40 308.64 150.00 130.00 0.00 Open ;
+ 103 40 39 566.57 150.00 130.00 0.00 Open ;
+ 104 226 176 95.14 100.00 130.00 0.00 Open ;
+ 105 247 183 248.55 100.00 130.00 0.00 Open ;
+ 106 183 49 187.78 100.00 130.00 0.00 Open ;
+ 107 39 38 357.67 125.00 130.00 0.00 Open ;
+ 108 38 37 700.57 100.00 130.00 0.00 Open ;
+ 109 37 193 404.46 100.00 130.00 0.00 Open ;
+ 110 193 36 160.86 125.00 130.00 0.00 Open ;
+ 111 36 194 557.42 125.00 130.00 0.00 Open ;
+ 112 194 27 127.02 150.00 130.00 0.00 Open ;
+ 113 27 26 46.66 150.00 130.00 0.00 Open ;
+ 114 26 195 674.32 150.00 130.00 0.00 Open ;
+ 115 195 33 50.76 125.00 130.00 0.00 Open ;
+ 116 26 196 138.54 100.00 130.00 0.00 Open ;
+ 117 196 25 199.33 100.00 130.00 0.00 Open ;
+ 118 25 232 231.12 100.00 130.00 0.00 Open ;
+ 119 232 24 187.06 100.00 130.00 0.00 Open ;
+ 120 24 231 240.64 100.00 130.00 0.00 Open ;
+ 121 231 7 173.44 125.00 130.00 0.00 Open ;
+ 122 7 6 23.58 100.00 130.00 0.00 Open ;
+ 123 6 28 526.74 125.00 130.00 0.00 Open ;
+ 124 28 249 500.72 100.00 130.00 0.00 Open ;
+ 125 249 29 15.29 100.00 130.00 0.00 Open ;
+ 126 7 8 265.92 125.00 130.00 0.00 Open ;
+ 127 8 23 355.51 125.00 130.00 0.00 Open ;
+ 128 23 207 189.78 125.00 130.00 0.00 Open ;
+ 129 207 208 28.18 125.00 130.00 0.00 Open ;
+ 130 208 22 129.34 125.00 130.00 0.00 Open ;
+ 131 22 21 361.24 125.00 130.00 0.00 Open ;
+ 132 21 264 223.52 150.00 130.00 0.00 Open ;
+ 133 20 210 185.17 150.00 130.00 0.00 Open ;
+ 134 210 209 154.95 150.00 130.00 0.00 Open ;
+ 135 209 19 34.71 200.00 130.00 0.00 Open ;
+ 136 264 20 31.14 150.00 130.00 0.00 Open ;
+ 137 19 253 42.52 200.00 130.00 0.00 Open ;
+ 138 253 18 356.45 200.00 130.00 0.00 Open ;
+ 139 18 211 128.82 200.00 130.00 0.00 Open ;
+ 140 211 212 140.66 200.00 130.00 0.00 Open ;
+ 141 212 11 113.32 200.00 130.00 0.00 Open ;
+ 142 11 10 555.23 150.00 130.00 0.00 Open ;
+ 143 10 4 272.68 150.00 130.00 0.00 Open ;
+ 144 59 203 315.88 100.00 130.00 0.00 Open ;
+ 145 203 202 284.93 100.00 130.00 0.00 Open ;
+ 146 202 31 97.93 125.00 130.00 0.00 Open ;
+ 147 265 32 262.94 100.00 130.00 0.00 Open ;
+ 148 32 33 635.82 100.00 130.00 0.00 Open ;
+ 149 33 34 415.73 150.00 130.00 0.00 Open ;
+ 150 34 35 122.60 150.00 130.00 0.00 Open ;
+ 151 265 31 29.56 100.00 130.00 0.00 Open ;
+ 152 59 205 33.80 100.00 130.00 0.00 Open ;
+ 153 205 88 377.12 100.00 130.00 0.00 Open ;
+ 154 88 89 629.17 150.00 130.00 0.00 Open ;
+ 155 89 90 133.28 200.00 130.00 0.00 Open ;
+ 156 90 91 348.05 200.00 130.00 0.00 Open ;
+ 157 91 234 292.89 300.00 130.00 0.00 Open ;
+ 158 234 109 488.99 300.00 130.00 0.00 Open ;
+ 159 138 235 289.88 100.00 130.00 0.00 Open ;
+ 160 235 110 486.72 100.00 130.00 0.00 Open ;
+ 161 102 106 260.92 200.00 130.00 0.00 Open ;
+ 162 106 91 163.58 200.00 130.00 0.00 Open ;
+ 163 48 108 424.07 200.00 130.00 0.00 Open ;
+ 164 108 109 173.66 200.00 130.00 0.00 Open ;
+ 165 109 110 99.55 150.00 130.00 0.00 Open ;
+ 166 110 111 307.92 150.00 130.00 0.00 Open ;
+ 167 59 204 283.84 100.00 130.00 0.00 Open ;
+ 168 204 200 141.49 125.00 130.00 0.00 Open ;
+ 169 200 100 58.27 125.00 130.00 0.00 Open ;
+ 170 100 199 79.59 150.00 130.00 0.00 Open ;
+ 171 199 198 39.41 150.00 130.00 0.00 Open ;
+ 172 198 101 126.25 150.00 130.00 0.00 Open ;
+ 173 29 30 61.39 100.00 130.00 0.00 Open ;
+ 174 30 31 73.73 100.00 130.00 0.00 Open ;
+ 175 31 250 83.16 125.00 130.00 0.00 Open ;
+ 176 250 197 118.22 150.00 130.00 0.00 Open ;
+ 177 197 101 297.21 150.00 130.00 0.00 Open ;
+ 178 101 221 17.08 200.00 130.00 0.00 Open ;
+ 179 221 139 58.11 200.00 130.00 0.00 Open ;
+ 180 139 219 135.50 200.00 130.00 0.00 Open ;
+ 181 139 192 255.85 100.00 130.00 0.00 Open ;
+ 182 192 191 40.65 100.00 130.00 0.00 Open ;
+ 183 219 102 161.59 200.00 130.00 0.00 Open ;
+ 184 191 190 136.29 100.00 130.00 0.00 Open ;
+ 185 190 105 57.23 125.00 130.00 0.00 Open ;
+ 186 105 189 164.02 125.00 130.00 0.00 Open ;
+ 187 189 35 192.86 125.00 130.00 0.00 Open ;
+ 188 105 104 234.58 100.00 130.00 0.00 Open ;
+ 189 104 103 215.82 100.00 130.00 0.00 Open ;
+ 190 102 103 231.93 100.00 130.00 0.00 Open ;
+ 191 91 138 134.12 150.00 130.00 0.00 Open ;
+ 192 138 112 175.33 150.00 130.00 0.00 Open ;
+ 193 112 113 231.12 150.00 130.00 0.00 Open ;
+ 194 112 92 607.94 100.00 130.00 0.00 Open ;
+ 195 257 147 122.13 150.00 130.00 0.00 Open ;
+ 196 147 63 40.06 150.00 130.00 0.00 Open ;
+ 197 63 64 301.37 150.00 130.00 0.00 Open ;
+ 198 64 65 102.07 125.00 130.00 0.00 Open ;
+ 199 65 80 1094.73 100.00 130.00 0.00 Open ;
+ 200 65 66 199.73 100.00 130.00 0.00 Open ;
+ 201 66 67 160.59 100.00 130.00 0.00 Open ;
+ 202 67 68 82.49 100.00 130.00 0.00 Open ;
+ 203 80 266 137.42 100.00 130.00 0.00 Open ;
+ 204 266 84 229.41 100.00 130.00 0.00 Open ;
+ 205 84 267 111.38 125.00 130.00 0.00 Open ;
+ 206 267 85 105.08 125.00 130.00 0.00 Open ;
+ 207 85 173 292.34 125.00 130.00 0.00 Open ;
+ 208 173 172 47.39 125.00 130.00 0.00 Open ;
+ 209 172 92 324.07 125.00 130.00 0.00 Open ;
+ 210 93 268 120.76 100.00 130.00 0.00 Open ;
+ 211 268 114 187.57 100.00 130.00 0.00 Open ;
+ 212 89 92 314.62 150.00 130.00 0.00 Open ;
+ 213 92 93 157.18 100.00 130.00 0.00 Open ;
+ 214 93 238 103.32 100.00 130.00 0.00 Open ;
+ 215 238 133 308.21 100.00 130.00 0.00 Open ;
+ 216 133 239 205.05 100.00 130.00 0.00 Open ;
+ 217 239 134 234.72 100.00 130.00 0.00 Open ;
+ 218 134 162 109.11 150.00 130.00 0.00 Open ;
+ 219 162 163 262.04 150.00 130.00 0.00 Open ;
+ 220 163 240 152.57 150.00 130.00 0.00 Open ;
+ 221 240 135 240.23 150.00 130.00 0.00 Open ;
+ 222 114 113 381.95 100.00 130.00 0.00 Open ;
+ 223 113 115 374.77 100.00 130.00 0.00 Open ;
+ 224 115 236 318.59 125.00 130.00 0.00 Open ;
+ 225 236 111 104.73 125.00 130.00 0.00 Open ;
+ 226 111 220 43.25 100.00 130.00 0.00 Open ;
+ 227 220 122 406.87 100.00 130.00 0.00 Open ;
+ 228 122 123 386.74 100.00 130.00 0.00 Open ;
+ 229 123 175 106.49 100.00 130.00 0.00 Open ;
+ 230 175 174 85.64 100.00 130.00 0.00 Open ;
+ 231 174 223 214.06 100.00 130.00 0.00 Open ;
+ 232 223 224 117.61 100.00 130.00 0.00 Open ;
+ 233 224 124 203.24 100.00 130.00 0.00 Open ;
+ 234 16 17 29.27 100.00 130.00 0.00 Open ;
+ 235 17 214 170.94 100.00 130.00 0.00 Open ;
+ 236 214 15 252.74 100.00 130.00 0.00 Open ;
+ 237 15 213 325.90 100.00 130.00 0.00 Open ;
+ 238 213 14 350.99 100.00 130.00 0.00 Open ;
+ 239 14 12 118.26 100.00 130.00 0.00 Open ;
+ 240 4 54 207.60 125.00 130.00 0.00 Open ;
+ 241 54 55 285.73 125.00 130.00 0.00 Open ;
+ 242 55 56 322.72 125.00 130.00 0.00 Open ;
+ 243 56 57 265.11 100.00 130.00 0.00 Open ;
+ 244 10 9 406.85 100.00 130.00 0.00 Open ;
+ 245 9 8 518.87 100.00 130.00 0.00 Open ;
+ 246 9 5 397.02 100.00 130.00 0.00 Open ;
+ 247 58 60 493.32 100.00 130.00 0.00 Open ;
+ 248 60 151 140.28 100.00 130.00 0.00 Open ;
+ 249 151 152 195.40 100.00 130.00 0.00 Open ;
+ 250 152 83 175.12 100.00 130.00 0.00 Open ;
+ 251 83 153 145.50 100.00 130.00 0.00 Open ;
+ 252 153 84 132.26 100.00 130.00 0.00 Open ;
+ 253 218 62 54.37 100.00 130.00 0.00 Open ;
+ 254 62 87 317.19 100.00 130.00 0.00 Open ;
+ 255 87 171 294.19 125.00 130.00 0.00 Open ;
+ 256 171 170 100.68 125.00 130.00 0.00 Open ;
+ 257 170 92 238.22 150.00 130.00 0.00 Open ;
+ 258 85 87 339.22 100.00 130.00 0.00 Open ;
+ 259 85 94 585.54 100.00 130.00 0.00 Open ;
+ 260 95 94 247.16 100.00 130.00 0.00 Open ;
+ 261 94 254 148.81 100.00 130.00 0.00 Open ;
+ 262 254 99 102.14 100.00 130.00 0.00 Open ;
+ 263 99 255 387.72 100.00 130.00 0.00 Open ;
+ 264 255 132 289.01 100.00 130.00 0.00 Open ;
+ 265 132 133 282.41 100.00 130.00 0.00 Open ;
+ 266 79 82 232.85 100.00 130.00 0.00 Open ;
+ 267 82 81 210.57 100.00 130.00 0.00 Open ;
+ 268 81 80 49.94 100.00 130.00 0.00 Open ;
+ 269 80 83 280.35 100.00 130.00 0.00 Open ;
+ 270 83 62 331.04 100.00 130.00 0.00 Open ;
+ 271 62 86 225.62 100.00 130.00 0.00 Open ;
+ 272 86 88 187.69 125.00 130.00 0.00 Open ;
+ 273 88 233 157.87 100.00 130.00 0.00 Open ;
+ 274 233 201 243.89 100.00 130.00 0.00 Open ;
+ 275 201 100 101.29 100.00 130.00 0.00 Open ;
+ 276 132 165 356.71 100.00 130.00 0.00 Open ;
+ 277 165 164 69.68 100.00 130.00 0.00 Open ;
+ 278 164 134 155.34 100.00 130.00 0.00 Open ;
+ 279 134 126 906.52 100.00 130.00 0.00 Open ;
+ 280 126 127 315.00 100.00 130.00 0.00 Open ;
+ 281 113 169 632.68 150.00 130.00 0.00 Open ;
+ 282 169 126 184.15 100.00 130.00 0.00 Open ;
+ 283 127 244 123.24 100.00 130.00 0.00 Open ;
+ 284 244 243 67.54 100.00 130.00 0.00 Open ;
+ 285 243 128 140.38 100.00 130.00 0.00 Open ;
+ 286 128 129 382.62 100.00 130.00 0.00 Open ;
+ 287 106 237 294.04 100.00 130.00 0.00 Open ;
+ 288 237 107 406.02 100.00 130.00 0.00 Open ;
+ 289 107 108 111.83 100.00 130.00 0.00 Open ;
+ 290 109 188 457.93 350.00 130.00 0.00 Open ;
+ 291 188 51 165.68 350.00 130.00 0.00 Open ;
+ 292 51 52 38.63 350.00 130.00 0.00 Open ;
+ 293 52 256 422.28 100.00 130.00 0.00 Open ;
+ 294 256 120 243.49 100.00 130.00 0.00 Open ;
+ 295 120 118 220.11 100.00 130.00 0.00 Open ;
+ 296 120 119 204.87 100.00 130.00 0.00 Open ;
+ 297 119 117 111.09 100.00 130.00 0.00 Open ;
+ 298 119 116 205.38 100.00 130.00 0.00 Open ;
+ 299 119 118 55.48 100.00 130.00 0.00 Open ;
+ 300 35 47 110.86 200.00 130.00 0.00 Open ;
+ 301 47 187 112.89 100.00 130.00 0.00 Open ;
+ 302 187 44 77.84 100.00 130.00 0.00 Open ;
+ 303 44 43 153.46 100.00 130.00 0.00 Open ;
+ 304 43 42 464.02 100.00 130.00 0.00 Open ;
+ 305 42 41 481.27 100.00 130.00 0.00 Open ;
+ 306 49 185 214.32 200.00 130.00 0.00 Open ;
+ 307 185 186 383.55 200.00 130.00 0.00 Open ;
+ 308 186 52 96.32 200.00 130.00 0.00 Open ;
+ 309 44 45 90.52 100.00 130.00 0.00 Open ;
+ 310 45 46 184.64 100.00 130.00 0.00 Open ;
+ 311 46 50 291.38 100.00 130.00 0.00 Open ;
+ 312 50 51 260.28 100.00 130.00 0.00 Open ;
+ 313 47 48 28.45 200.00 130.00 0.00 Open ;
+ 317 273 1 1000 250 130 0 Open ;
+ 319 274 136 100 230 130 0 Open ;
+ 320 275 203 50 200 130 0 Open ;
+ 315 209 276 30 200 130 0 Open ;
+
+[PUMPS]
+;ID Node1 Node2 Parameters
+ 314 269 52 HEAD 314 ;
+ 316 271 273 HEAD 316 ;
+ 318 272 274 HEAD 318 ;
+ 321 270 276 HEAD 315 ;
+
+[VALVES]
+;ID Node1 Node2 Diameter Type Setting MinorLoss
+
+[TAGS]
+
+[DEMANDS]
+;Junction Demand Pattern Category
+
+[STATUS]
+;ID Status/Setting
+
+[PATTERNS]
+;ID Multipliers
+;
+ 1 0.3 0.3 0.2 0.2 0.2 0.5
+ 1 0.5 1 1 1 1 0.9
+ 1 0.4 0.4 0.4 0.4 0.8 0.8
+ 1 0.8 0.8 0.6 0.6 0.5 0.4
+;
+ 2 1 1 1 1 1 1
+ 2 1 1 1 1 1 1
+ 2 1 1 1 1 1 1
+ 2 1 1 1 1 1 1
+
+[CURVES]
+;ID X-Value Y-Value
+;PUMP: PUMP:
+ 314 10 80
+ 314 50 75
+ 314 80 65
+;PUMP: PUMP:
+ 316 10 110
+ 316 30 100
+ 316 50 80
+;PUMP: PUMP:
+ 315 10 79
+ 315 20 69
+ 315 30 40
+;PUMP: PUMP:
+ 318 10 90
+ 318 20 80
+ 318 30 55
+
+[CONTROLS]
+
+
+
+
+
+[RULES]
+
+
+
+
+
+[ENERGY]
+ Global Efficiency 90
+ Global Price 0
+ Demand Charge 0
+
+[EMITTERS]
+;Junction Coefficient
+
+[QUALITY]
+;Node InitQual
+
+[SOURCES]
+;Node Type Quality Pattern
+
+[REACTIONS]
+;Type Pipe/Tank Coefficient
+
+
+[REACTIONS]
+ Order Bulk 1
+ Order Tank 1
+ Order Wall 1
+ Global Bulk 0
+ Global Wall 0
+ Limiting Potential 0
+ Roughness Correlation 0
+
+[MIXING]
+;Tank Model
+
+[TIMES]
+ Duration 24:00
+ Hydraulic Timestep 1:00
+ Quality Timestep 0:05
+ Pattern Timestep 2:00
+ Pattern Start 0:00
+ Report Timestep 1:00
+ Report Start 0:00
+ Start ClockTime 12 am
+ Statistic NONE
+
+[REPORT]
+ Status Yes
+ Summary No
+ Page 0
+
+[OPTIONS]
+ Units LPS
+ Headloss H-W
+ Specific Gravity 1.0
+ Viscosity 1.0
+ Trials 40
+ Accuracy 0.001
+ CHECKFREQ 2
+ MAXCHECK 10
+ DAMPLIMIT 0
+ Unbalanced Continue 10
+ Pattern 1
+ Demand Multiplier 1.0
+ Emitter Exponent 0.5
+ Quality Age mg/L
+ Diffusivity 1.0
+ Tolerance 0.01
+
+[COORDINATES]
+;Node X-Coord Y-Coord
+ 1 1650094.63 4944639.00
+ 2 1650348.88 4944585.00
+ 3 1650592.63 4945068.00
+ 4 1650829.50 4945554.00
+ 5 1651029.88 4945905.50
+ 6 1651232.38 4946354.50
+ 7 1651227.63 4946378.00
+ 8 1650986.00 4946490.50
+ 9 1650757.00 4946024.50
+ 10 1650577.50 4945659.50
+ 11 1650064.50 4945875.00
+ 12 1649881.13 4945376.00
+ 13 1650029.25 4945313.50
+ 14 1649770.50 4945419.00
+ 15 1649922.38 4944957.00
+ 16 1650100.25 4944685.50
+ 17 1650073.75 4944698.00
+ 18 1649896.88 4946121.00
+ 19 1650065.00 4946470.50
+ 20 1649998.63 4946733.50
+ 21 1650051.00 4946979.00
+ 22 1650379.13 4946826.00
+ 23 1650670.25 4946655.00
+ 24 1651438.88 4946731.50
+ 25 1651852.38 4946763.00
+ 26 1652162.25 4946635.00
+ 27 1652182.25 4946677.00
+ 28 1651699.38 4946109.00
+ 29 1652135.63 4945859.50
+ 30 1652188.25 4945828.00
+ 31 1652250.75 4945788.50
+ 32 1652137.88 4946048.50
+ 33 1652747.88 4946233.50
+ 34 1653164.75 4946233.50
+ 35 1653238.38 4946135.50
+ 36 1652471.50 4947147.50
+ 37 1652974.13 4946893.00
+ 38 1653000.50 4947593.00
+ 39 1652997.88 4947950.00
+ 40 1653465.13 4947628.00
+ 41 1653953.13 4947276.50
+ 42 1653669.25 4946887.50
+ 43 1653412.88 4946500.50
+ 44 1653325.38 4946374.50
+ 45 1653405.75 4946332.50
+ 46 1653576.75 4946261.50
+ 47 1653305.50 4946224.00
+ 48 1653327.63 4946206.00
+ 49 1654320.88 4947050.50
+ 50 1653865.63 4946305.00
+ 51 1654128.63 4946356.50
+ 52 1654151.00 4946388.00
+ 53 1651249.88 4944650.00
+ 54 1651009.13 4945449.00
+ 55 1651234.38 4945272.50
+ 56 1651454.00 4945036.00
+ 57 1651631.75 4944839.00
+ 58 1651706.13 4944872.00
+ 59 1652209.75 4945096.00
+ 60 1651938.88 4944437.00
+ 61 1652230.25 4944648.50
+ 62 1652461.25 4944548.00
+ 63 1651242.38 4944380.50
+ 64 1651105.25 4944112.50
+ 65 1651206.00 4944094.00
+ 66 1651172.75 4943897.00
+ 67 1651089.50 4943759.50
+ 68 1651047.88 4943688.50
+ 69 1650871.63 4943730.00
+ 70 1650699.50 4943831.00
+ 71 1650643.50 4943741.50
+ 72 1650545.13 4943797.50
+ 73 1650520.88 4943731.00
+ 74 1650299.25 4943830.50
+ 75 1650312.00 4943864.00
+ 76 1650129.50 4944033.00
+ 77 1650062.38 4944332.50
+ 78 1651328.75 4943618.50
+ 79 1652035.13 4943543.00
+ 80 1652295.38 4943960.00
+ 81 1652274.00 4943915.00
+ 82 1652177.13 4943728.00
+ 83 1652378.50 4944227.50
+ 84 1652613.25 4944096.00
+ 85 1652813.00 4944165.50
+ 86 1652520.50 4944765.50
+ 87 1652776.00 4944502.50
+ 88 1652571.63 4944946.00
+ 89 1653166.63 4944737.00
+ 90 1653208.38 4944863.50
+ 91 1653384.13 4945164.00
+ 92 1653347.25 4944479.50
+ 93 1653436.50 4944350.00
+ 94 1652876.63 4943584.00
+ 95 1652898.75 4943338.00
+ 96 1652902.50 4943296.00
+ 97 1653228.75 4943125.00
+ 98 1653309.50 4943022.00
+ 99 1653025.75 4943691.50
+ 100 1652573.75 4945380.00
+ 101 1652700.00 4945571.00
+ 102 1653007.75 4945362.00
+ 103 1653126.88 4945561.50
+ 104 1653249.50 4945739.00
+ 105 1653037.88 4945841.50
+ 106 1653240.25 4945242.50
+ 107 1653586.00 4945851.50
+ 108 1653657.00 4945938.00
+ 109 1653793.75 4945830.50
+ 110 1653877.13 4945776.00
+ 111 1654144.25 4945621.50
+ 112 1653650.88 4945006.00
+ 113 1653850.25 4944888.50
+ 114 1653644.13 4944567.00
+ 115 1654038.25 4945213.00
+ 116 1654814.75 4946886.50
+ 117 1655054.13 4946778.50
+ 118 1654981.88 4946686.50
+ 119 1654952.13 4946733.50
+ 120 1654764.13 4946651.50
+ 121 1655205.88 4946327.00
+ 122 1654560.50 4945469.50
+ 123 1654911.50 4945305.00
+ 124 1655494.63 4944952.50
+ 125 1655475.63 4944804.50
+ 126 1654567.88 4944497.00
+ 127 1654739.50 4944761.00
+ 128 1655066.00 4944789.00
+ 129 1655412.50 4944625.00
+ 130 1655182.00 4944156.00
+ 131 1655000.88 4943750.00
+ 132 1653583.88 4943834.50
+ 133 1653737.00 4944072.00
+ 134 1654039.88 4943759.50
+ 135 1654630.13 4943284.00
+ 136 1654391.75 4942756.00
+ 137 1654787.38 4943123.00
+ 138 1653500.25 4945096.50
+ 139 1652763.88 4945531.50
+ 140 1650107.63 4944676.50
+ 141 1650145.63 4944665.00
+ 142 1650352.50 4944579.50
+ 143 1650357.88 4944574.50
+ 144 1650376.25 4944620.50
+ 145 1650381.38 4944614.00
+ 146 1651251.13 4944414.50
+ 147 1651260.13 4944416.50
+ 148 1651237.25 4944384.00
+ 149 1651579.00 4944230.50
+ 150 1651645.38 4944302.00
+ 151 1652019.13 4944321.50
+ 152 1652208.25 4944271.00
+ 153 1652519.13 4944189.50
+ 154 1651329.50 4943687.50
+ 155 1652392.63 4943383.50
+ 156 1652393.38 4943359.50
+ 157 1653184.25 4943033.00
+ 158 1654010.50 4942993.00
+ 159 1654455.63 4942851.00
+ 160 1654626.38 4942950.50
+ 161 1654827.25 4943438.00
+ 162 1654111.88 4943677.50
+ 163 1654341.00 4943549.50
+ 164 1653947.88 4943634.00
+ 165 1653878.00 4943632.00
+ 166 1655342.50 4944429.00
+ 167 1655290.50 4944410.00
+ 168 1655221.38 4944282.00
+ 169 1654399.38 4944572.00
+ 170 1653136.13 4944368.00
+ 171 1653035.25 4944362.50
+ 172 1653147.88 4944201.00
+ 173 1653102.13 4944214.00
+ 174 1655032.00 4945217.50
+ 175 1655018.25 4945301.50
+ 176 1655514.13 4945400.50
+ 177 1655702.38 4945732.00
+ 178 1655636.25 4945947.50
+ 179 1655473.38 4946058.00
+ 180 1655702.00 4945843.50
+ 181 1655004.88 4946866.00
+ 182 1654848.63 4946920.00
+ 183 1654504.88 4947010.00
+ 184 1654147.63 4947127.50
+ 185 1654320.63 4946836.00
+ 186 1654196.13 4946476.50
+ 187 1653374.00 4946313.50
+ 188 1654034.00 4946220.50
+ 189 1653117.88 4945984.50
+ 190 1652987.50 4945869.00
+ 191 1652919.50 4945750.50
+ 192 1652879.75 4945759.50
+ 193 1652625.50 4947099.50
+ 194 1652295.38 4946618.50
+ 195 1652739.13 4946283.50
+ 196 1652044.50 4946708.50
+ 197 1652433.00 4945703.00
+ 198 1652664.75 4945450.00
+ 199 1652626.63 4945439.50
+ 200 1652531.63 4945339.50
+ 201 1652665.13 4945336.00
+ 202 1652217.38 4945696.50
+ 203 1652211.63 4945412.00
+ 204 1652469.38 4945212.50
+ 205 1652212.00 4945062.50
+ 206 1651102.75 4946039.00
+ 207 1650501.50 4946742.50
+ 208 1650496.13 4946770.00
+ 209 1650086.64 4946505.02
+ 210 1649932.25 4946560.50
+ 211 1649851.13 4946001.00
+ 212 1649984.88 4945956.00
+ 213 1649627.88 4945098.00
+ 214 1650151.88 4944850.00
+ 215 1649929.63 4944395.00
+ 216 1650210.88 4944252.00
+ 217 1650325.75 4943930.50
+ 218 1652407.25 4944555.50
+ 219 1652869.63 4945446.50
+ 220 1654186.38 4945631.50
+ 221 1652715.75 4945564.50
+ 222 1654757.00 4943407.50
+ 223 1655204.38 4945090.00
+ 224 1655307.38 4945032.50
+ 225 1655520.50 4945027.50
+ 226 1655510.63 4945305.50
+ 227 1655546.63 4945480.00
+ 228 1655316.13 4946179.00
+ 229 1655280.25 4946245.50
+ 230 1651133.00 4944753.00
+ 231 1651333.63 4946515.00
+ 232 1651621.00 4946776.50
+ 233 1652620.25 4945096.50
+ 234 1653535.38 4945415.00
+ 235 1653638.50 4945351.50
+ 236 1654106.25 4945524.00
+ 237 1653382.38 4945500.00
+ 238 1653496.88 4944266.00
+ 239 1653901.25 4943949.00
+ 240 1654462.38 4943456.50
+ 241 1655230.88 4944258.00
+ 242 1655162.75 4944163.00
+ 243 1654925.75 4944801.00
+ 244 1654858.25 4944795.00
+ 245 1655479.00 4944922.50
+ 246 1655494.88 4944873.00
+ 247 1654742.88 4946936.50
+ 248 1653702.88 4947431.00
+ 249 1652127.00 4945847.00
+ 250 1652323.25 4945747.50
+ 251 1651497.63 4944781.50
+ 252 1650826.88 4944939.50
+ 253 1650026.00 4946453.50
+ 254 1653025.75 4943589.50
+ 255 1653405.25 4943607.00
+ 256 1654542.00 4946550.00
+ 257 1651141.13 4944445.00
+ 258 1650052.63 4944638.00
+ 259 1650012.63 4944551.50
+ 260 1649989.63 4944541.50
+ 261 1650020.38 4944365.00
+ 262 1650106.88 4944325.50
+ 263 1650209.75 4944195.50
+ 264 1650017.88 4946758.00
+ 265 1652260.88 4945816.50
+ 266 1652433.00 4943954.00
+ 267 1652708.25 4944155.00
+ 268 1653541.75 4944409.50
+ 273 1650167.10 4944470.34
+ 274 1654419.98 4942506.99
+ 276 1650110.43 4946512.74
+ 269 1654257.63 4946332.50
+ 270 1650149.75 4946528.50
+ 271 1650191.75 4944416.50
+ 272 1654428.63 4942467.00
+ 275 1652007.68 4945436.25
+
+[VERTICES]
+;Link X-Coord Y-Coord
+
+[LABELS]
+;X-Coord Y-Coord Label & Anchor Node
+
+[BACKDROP]
+ DIMENSIONS 1649324.15 4942192.85 1656006.10 4948224.15
+ UNITS None
+ FILE
+ OFFSET 0.00 0.00
+
+[END]
diff --git a/Python/tsnet/examples/networks/simple_pump.inp b/Python/tsnet/examples/networks/simple_pump.inp
new file mode 100644
index 0000000..9cc33b0
--- /dev/null
+++ b/Python/tsnet/examples/networks/simple_pump.inp
@@ -0,0 +1,134 @@
+[TITLE]
+
+
+[JUNCTIONS]
+;ID Elev Demand Pattern
+ 1 0 0 ;
+ 2 0 0 ;
+ END 0 1 ;
+
+[RESERVOIRS]
+;ID Head Pattern
+ T 100 ;
+
+[TANKS]
+;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
+
+[PIPES]
+;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
+ p1 T 1 1000 600 100 0 Open ;
+ p2 2 END 1000 600 100 0 Open ;
+
+[PUMPS]
+;ID Node1 Node2 Parameters
+ pump 1 2 HEAD 1 ;
+
+[VALVES]
+;ID Node1 Node2 Diameter Type Setting MinorLoss
+
+[TAGS]
+
+[DEMANDS]
+;Junction Demand Pattern Category
+
+[STATUS]
+;ID Status/Setting
+
+[PATTERNS]
+;ID Multipliers
+
+[CURVES]
+;ID X-Value Y-Value
+;PUMP:
+ 1 0 133
+ 1 200 100
+ 1 400 2
+
+[CONTROLS]
+
+[RULES]
+
+[ENERGY]
+ Global Efficiency 75
+ Global Price 0
+ Demand Charge 0
+
+[EMITTERS]
+;Junction Coefficient
+
+[QUALITY]
+;Node InitQual
+
+[SOURCES]
+;Node Type Quality Pattern
+
+[REACTIONS]
+;Type Pipe/Tank Coefficient
+
+
+[REACTIONS]
+ Order Bulk 1
+ Order Tank 1
+ Order Wall 1
+ Global Bulk 0
+ Global Wall 0
+ Limiting Potential 0
+ Roughness Correlation 0
+
+[MIXING]
+;Tank Model
+
+[TIMES]
+ Duration 0
+ Hydraulic Timestep 1:00
+ Quality Timestep 0:05
+ Pattern Timestep 1:00
+ Pattern Start 0:00
+ Report Timestep 1:00
+ Report Start 0:00
+ Start ClockTime 12 am
+ Statistic None
+
+[REPORT]
+ Status No
+ Summary No
+ Page 0
+
+[OPTIONS]
+ Units LPS
+ Headloss H-W
+ Specific Gravity 1
+ Viscosity 1
+ Trials 40
+ Accuracy 0.001
+ CHECKFREQ 2
+ MAXCHECK 10
+ DAMPLIMIT 0
+ Unbalanced Continue 10
+ Pattern 1
+ Demand Multiplier 1.0
+ Emitter Exponent 0.5
+ Quality None mg/L
+ Diffusivity 1
+ Tolerance 0.01
+
+[COORDINATES]
+;Node X-Coord Y-Coord
+ 1 1583.33 5000.00
+ 2 3416.67 5037.04
+ END 5435.19 5000.00
+ T -435.19 5074.07
+
+[VERTICES]
+;Link X-Coord Y-Coord
+
+[LABELS]
+;X-Coord Y-Coord Label & Anchor Node
+
+[BACKDROP]
+ DIMENSIONS 0.00 0.00 10000.00 10000.00
+ UNITS None
+ FILE
+ OFFSET 0.00 0.00
+
+[END]
diff --git a/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg
new file mode 100644
index 0000000..4d40397
--- /dev/null
+++ b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg
@@ -0,0 +1,426 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg.dwh b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg.dwh
new file mode 100644
index 0000000..83a7969
Binary files /dev/null and b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg.dwh differ
diff --git a/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg.sqlite b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg.sqlite
new file mode 100644
index 0000000..e403e32
Binary files /dev/null and b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg.sqlite differ
diff --git a/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.hmr b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.hmr
new file mode 100644
index 0000000..b142db9
Binary files /dev/null and b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.hmr differ
diff --git a/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.hof b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.hof
new file mode 100644
index 0000000..66b5422
Binary files /dev/null and b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.hof differ
diff --git a/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.hut b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.hut
new file mode 100644
index 0000000..9bd4a88
--- /dev/null
+++ b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.hut
@@ -0,0 +1,198 @@
+
+ -----------------------------------
+ | HAMMER Engine 08.11.06.113 |
+ -------------------------------------------------------------------------------
+ Based on Technology Originally Developed by GENIVAR(EHG). Compiled by IVF.
+ Copyright (C) 2011 Bentley Systems, Incorporated. All Rights Reserved.
+ -------------------------------------------------------------------------------
+
+ Type of Run: Full
+ Date of Run: 03/21/20
+ Time of Run: 12:33 pm
+ Data File: Tnet0.wtg.sqlite.$$$
+ Hydrograph File: Not Selected
+ Labels: Long
+
+
+ *** SYSTEM INFORMATION ***
+
+ ---------------------------------------------------
+ | ITEM | VALUE |
+ ---------------------------------------------------
+ | | |
+ | Time Step (s) | |
+ | Automatic | 0.1000 |
+ | User-Selected | 0.1000 |
+ | Total Number | 600 |
+ | Total Simulation Time (s) | 60.00 |
+ | Units | cms, m |
+ | Total Number of Nodes | 3 |
+ | Total Number of Pipes | 2 |
+ | Specific Gravity | 1.00 |
+ | Wave Speed (m/s) | 1200 |
+ | Vapour Pressure(m) | -10.0 |
+ | Reports | |
+ | Number of Nodes | All |
+ | Number of Time Steps | All |
+ | Number of Paths | 0 |
+ | Output | |
+ | Standard | No |
+ | Cavities (Open/Close) | No |
+ | Adjustments | |
+ | Adjusted Variable | Wave Speed |
+ | Warning Limit (%) | 50.00 |
+ | Minimize | Adjustments |
+ | Calculate Transient Forces | No |
+ | Use Auxiliary Data File | Yes |
+ ---------------------------------------------------
+
+ *** PREFERENCE AND DEBUG INFORMATION ***
+
+ --------------------------------------------------------
+ | ITEM | VALUE |
+ --------------------------------------------------------
+ | | |
+ | Tolerances | |
+ | Initial Flow Consistency Value | 0.0006 |
+ | Initial Head Consistency Value | 0.030 |
+ | Criterion for Fr. Coef. Flag | 0.020 |
+ | Adjustments | |
+ | Elevation Decrease | 0.00 |
+ | Extreme Heads Display | |
+ | All Times | Yes |
+ | After First Extreme | No |
+ | Friction Coefficient | |
+ | Model | Steady |
+ | 1,000,000 x Kinematic Viscosity | n/a |
+ | Debug Parameters | |
+ | Level | Null |
+ --------------------------------------------------------
+
+ *** NODE INFORMATION ***
+
+ ----------------------------------------------------------------------------------------------------
+ | | CATEGORY | TYPE | ELEVATION | | | VAP PRESS |
+ | LABEL | DESCRIPTION | DESCRIPTION | (m) | X COORD | Y COORD | (m) |
+ ----------------------------------------------------------------------------------------------------
+ | | | | | | | |
+ | 1 | Reservoir | 1 or more | 0.0 | 0.0 | 0.0 | -10.0 |
+ | D2A-3 | Valve | to atmos. | 0.0 | 2613.2 | 10.3 | -10.0 |
+ | 2 | Junction | 2 or more | 0.0 | 1152.3 | 10.3 | -10.0 |
+ ----------------------------------------------------------------------------------------------------
+
+
+
+ *** NODE DATA ***
+
+ ----------------------------------------------------------------------
+ | LABEL | DATA |
+ ----------------------------------------------------------------------
+ | | |
+ | 1 | |
+ | | |
+ | D2A-3 | Initial/typical Outflow: 0.0500 |
+ | | Corresponding Pressure: 749.9 |
+ | | Operating Time: 2 |
+ | | Time Lag: 0 |
+ | | |
+ | 2 | |
+ ----------------------------------------------------------------------
+
+
+
+ *** CONNECTIVITY ***
+
+ ---------------------------------------------
+ | PIPE LABEL | FROM NODE | TO NODE |
+ ---------------------------------------------
+ | | | |
+ | 2 | 2 | D2A-3 |
+ | 1 | 1 | 2 |
+ ---------------------------------------------
+
+
+
+ *** PIPE INFORMATION ***
+
+ -----------------------------------------------------------------------------------------
+ | | LENGTH | DIAMETER | WAVESPEED | D-W | CHECK |
+ | LABEL | (m) | (mm) | (m /s) | FR. COEF. | VALVE |
+ -----------------------------------------------------------------------------------------
+ | | | | | | |
+ | 2 | 2400.0 | 1200.00 | 1200.0 | *0.021 | |
+ | 1 | 1200.0 | 600.00 | 1200.0 | 0.018 | |
+ -----------------------------------------------------------------------------------------
+ * Darcy-Weisbach friction coefficient exceeds 0.020
+
+ *** INITIAL PIPE CONDITIONS ***
+
+ -------------------------------------------------------------------------------------
+ | FROM | HEAD | TO | HEAD | FLOW | VEL |
+ | NODE | (m) | NODE | (m) | (cms) | (m/s) |
+ -------------------------------------------------------------------------------------
+ | | | | | | |
+ | 2 | 749.9 | D2A-3 | 749.9 | 0.0 | 0.0 |
+ | 1 | 750.0 | 2 | 749.9 | 0.0 | 0.2 |
+ -------------------------------------------------------------------------------------
+
+ -----------------------------------
+ | HAMMER Engine 08.11.06.113 |
+ -------------------------------------------------------------------------------
+ Based on Technology Originally Developed by GENIVAR(EHG). Compiled by IVF.
+ Copyright (C) 2011 Bentley Systems, Incorporated. All Rights Reserved.
+ -------------------------------------------------------------------------------
+
+
+ *** List of end points with possible discrepancies in input values ***
+
+ NOTE: End points where initial surges generated are included.
+
+ 2:D2A-3
+
+ -----------------------------------
+ | HAMMER Engine 08.11.06.113 |
+ -------------------------------------------------------------------------------
+ Based on Technology Originally Developed by GENIVAR(EHG). Compiled by IVF.
+ Copyright (C) 2011 Bentley Systems, Incorporated. All Rights Reserved.
+ -------------------------------------------------------------------------------
+
+
+ *** LIST OF SORTED VAPOUR AND AIR POCKETS ***
+
+
+ No vapour/air pockets were formed.
+
+
+
+ -----------------------------------
+ | HAMMER Engine 08.11.06.113 |
+ -------------------------------------------------------------------------------
+ Based on Technology Originally Developed by GENIVAR(EHG). Compiled by IVF.
+ Copyright (C) 2011 Bentley Systems, Incorporated. All Rights Reserved.
+ -------------------------------------------------------------------------------
+
+
+ *** SUMMARY FOR Default Project-Base-Tnet0.wtg.sqlite.$$$ ***
+
+ --------------------------------------------------------------------------------
+ | END | MAX. PRESS. | MIN. PRESS. | MAX. HEAD | MIN. HEAD |
+ | POINT | (mH) | (mH) | (m) | (m) |
+ --------------------------------------------------------------------------------
+ | | | | | |
+ | 2:2 | 759.3 | 740.6 | 759.3 | 740.6 |
+ | 2:D2A-3 | 761.8 | 738.3 | 761.8 | 738.3 |
+ | 1:1 | 750.0 | 750.0 | 750.0 | 750.0 |
+ | 1:2 | 759.3 | 740.6 | 759.3 | 740.6 |
+ --------------------------------------------------------------------------------
+
+
+
+
+
+ *** Maximum pressure in entire network is 761.8 mH at point 2:D2A-3
+
+ *** Minimum pressure in entire network is 738.3 mH at point 2:D2A-3
+
+
+
+Elapsed time: 0 s.
diff --git a/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.out b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.out
new file mode 100644
index 0000000..56ad424
Binary files /dev/null and b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.out differ
diff --git a/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.rpc b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.rpc
new file mode 100644
index 0000000..9969789
--- /dev/null
+++ b/Python/tsnet/examples/networks/tnet0_hammer/Tnet0.wtg_1_58.rpc
@@ -0,0 +1,53 @@
+ Page 1 Sat Mar 21 12:33:32 2020
+
+******************************************************************
+* W A T E R G E M S *
+* Hydraulic and Water Quality *
+* Analysis for Pipe Networks *
+* Version 8.11 *
+******************************************************************
+
+
+ Number of Junctions................ 2
+ Number of Reservoirs............... 1
+ Number of Tanks ................... 0
+ Number of Pipes ................... 2
+ Number of Pumps ................... 0
+ Number of Variable Speed Pumps .... 0
+ Number of Valves .................. 0
+ Headloss Formula .................. Darcy-Weisbach
+ Hydraulic Timestep ................ 1.00 hrs
+ Hydraulic Accuracy ................ 0.001000
+ Status Check Frequency ............ 2
+ Maximum Trials Checked ............ 10
+ Damping Limit Threshold ........... 0.000000
+ Maximum Trials .................... 40
+ Quality Analysis .................. None
+ Specific Gravity .................. 1.00
+ Relative Kinematic Viscosity ...... 0.99
+ Relative Chemical Diffusivity ..... -769230769230769150.00
+ Demand Multiplier ................. 1.00
+ Total Duration .................... 0.00 hrs
+ Reporting Criteria:
+ No Nodes
+ No Links
+
+[Analysis Started]
+Sat Mar 21 12:33:32 2020
+
+[Steady State]
+< 0:00:00 Balancing the network:>
+ Trial 1: relative flow change = 1.968338
+ Trial 2: relative flow change = 0.152481
+ Trial 3: relative flow change = 0.011763
+ Trial 4: relative flow change = 0.000069
+< 0:00:00 Balanced after 4 trials; relative flow change = 0.000069>
+
+Flow Supplied 792.48 gpm
+Flow Demanded 792.48 gpm
+Flow Stored 0.00 gpm
+
+ 0:00:00 Reservoir 63 is emptying
+
+[Analysis Ended]
+Sat Mar 21 12:33:32 2020
diff --git a/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg
new file mode 100644
index 0000000..25f957d
--- /dev/null
+++ b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg
@@ -0,0 +1,454 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg.dwh b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg.dwh
new file mode 100644
index 0000000..492f0fa
Binary files /dev/null and b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg.dwh differ
diff --git a/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg.sqlite b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg.sqlite
new file mode 100644
index 0000000..0de149b
Binary files /dev/null and b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg.sqlite differ
diff --git a/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.hmr b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.hmr
new file mode 100644
index 0000000..c53cbb3
Binary files /dev/null and b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.hmr differ
diff --git a/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.hof b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.hof
new file mode 100644
index 0000000..160fc73
Binary files /dev/null and b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.hof differ
diff --git a/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.hut b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.hut
new file mode 100644
index 0000000..18ad21f
--- /dev/null
+++ b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.hut
@@ -0,0 +1,1596 @@
+
+ *** WARNING: The wavespeed or length approximations deviate excessively from the entered values.
+ Reduce the time step, or lengthen short pipes and/or subdivide longer pipes.
+
+
+ -----------------------------------
+ | HAMMER Engine 08.11.06.113 |
+ -------------------------------------------------------------------------------
+ Based on Technology Originally Developed by GENIVAR(EHG). Compiled by IVF.
+ Copyright (C) 2011 Bentley Systems, Incorporated. All Rights Reserved.
+ -------------------------------------------------------------------------------
+
+ Type of Run: Full
+ Date of Run: 03/20/20
+ Time of Run: 09:52 pm
+ Data File: BWSN_Network_1.wtg.sqlite.$$$
+ Hydrograph File: Not Selected
+ Labels: Long
+
+
+ *** SYSTEM INFORMATION ***
+
+ ---------------------------------------------------
+ | ITEM | VALUE |
+ ---------------------------------------------------
+ | | |
+ | Time Step (s) | |
+ | Automatic | 0.0270 |
+ | User-Selected | 0.0020 |
+ | Total Number | 10000 |
+ | Total Simulation Time (s) | 20.00 |
+ | Units | cfs, ft |
+ | Total Number of Nodes | 123 |
+ | Total Number of Pipes | 172 |
+ | Specific Gravity | 1.00 |
+ | Wave Speed (ft/s) | Variable |
+ | Vapour Pressure(ft) | -32.8 |
+ | Reports | |
+ | Number of Nodes | All |
+ | Number of Time Steps | All |
+ | Number of Paths | 0 |
+ | Output | |
+ | Standard | No |
+ | Cavities (Open/Close) | No |
+ | Adjustments | |
+ | Adjusted Variable | Wave Speed |
+ | Warning Limit (%) | 50.00 |
+ | Minimize | Adjustments |
+ | Calculate Transient Forces | No |
+ | Use Auxiliary Data File | Yes |
+ ---------------------------------------------------
+
+ *** PREFERENCE AND DEBUG INFORMATION ***
+
+ --------------------------------------------------------
+ | ITEM | VALUE |
+ --------------------------------------------------------
+ | | |
+ | Tolerances | |
+ | Initial Flow Consistency Value | 0.0200 |
+ | Initial Head Consistency Value | 0.100 |
+ | Criterion for Fr. Coef. Flag | 0.020 |
+ | Adjustments | |
+ | Elevation Decrease | 0.00 |
+ | Extreme Heads Display | |
+ | All Times | Yes |
+ | After First Extreme | No |
+ | Friction Coefficient | |
+ | Model | Steady |
+ | 1,000,000 x Kinematic Viscosity | n/a |
+ | Debug Parameters | |
+ | Level | Null |
+ --------------------------------------------------------
+
+ *** NODE INFORMATION ***
+
+ ----------------------------------------------------------------------------------------------------
+ | | CATEGORY | TYPE | ELEVATION | | | VAP PRESS |
+ | LABEL | DESCRIPTION | DESCRIPTION | (ft) | X COORD | Y COORD | (ft) |
+ ----------------------------------------------------------------------------------------------------
+ | | | | | | | |
+ | VALVE-180 | Valve | var. types | 434.0 | 21395.8 | 13403.2 | -32.8 |
+ | VALVE-176 | Valve | var. types | 404.0 | 13720.1 | 13599.9 | -32.8 |
+ | VALVE-175 | Valve | var. types | 533.0 | 11944.5 | 10664.5 | -32.8 |
+ | VALVE-174 | Valve | var. types | 359.0 | 9369.6 | 12982.9 | -32.8 |
+ | VALVE-173 | Valve | var. types | 418.0 | 7745.6 | 12079.7 | -32.8 |
+ | VALVE-178 | Valve | var. types | 957.0 | 22991.7 | 4273.8 | -32.8 |
+ | VALVE-177 | Valve | var. types | 849.0 | 21965.2 | 7831.7 | -32.8 |
+ | VALVE-179 | Valve | var. types | 758.0 | 20305.3 | 5422.2 | -32.8 |
+ | PUMP-172 | Pump | var spd | 0.0 | 757.3 | 112.0 | -32.8 |
+ | PUMP-170 | Pump | const spd | 0.0 | 22430.7 | 7591.7 | -32.8 |
+ | TANK-131 | Prot equip | surge tank | 1137.1 | 25878.9 | 4001.1 | -32.8 |
+ | TANK-130 | Prot equip | surge tank | 843.9 | 21851.9 | 6930.2 | -32.8 |
+ | RESERVOIR-129| Reservoir | 1 or more | 0.0 | 0.0 | 601.5 | -32.8 |
+ | JUNCTION-128| Junction | 2 or more | 0.0 | 248.2 | 620.4 | -32.8 |
+ | JUNCTION-110| Junction | 2 or more | 0.0 | 841.1 | 224.0 | -32.8 |
+ | JUNCTION-109| Junction | 2 or more | 0.0 | 673.6 | 0.0 | -32.8 |
+ | JUNCTION-106| Junction | 2 or more | 0.0 | 22677.5 | 7668.4 | -32.8 |
+ | JUNCTION-105| Junction | 2 or more | 0.0 | 22183.8 | 7515.0 | -32.8 |
+ | JUNCTION-104| Consumptio | 1 or more | 860.6 | 22727.3 | 7989.0 | -32.8 |
+ | JUNCTION-103| Consumptio | 1 or more | 1031.7 | 24285.3 | 3405.4 | -32.8 |
+ | JUNCTION-102| Consumptio | 1 or more | 1094.1 | 25869.9 | 3359.9 | -32.8 |
+ | JUNCTION-101| Consumptio | 1 or more | 645.1 | 11435.8 | 7145.2 | -32.8 |
+ | JUNCTION-100| Consumptio | 1 or more | 637.9 | 10474.4 | 6512.3 | -32.8 |
+ | JUNCTION-99| Consumptio | 1 or more | 641.9 | 10777.2 | 6323.6 | -32.8 |
+ | JUNCTION-98| Consumptio | 1 or more | 643.0 | 11483.4 | 6829.3 | -32.8 |
+ | JUNCTION-97| Consumptio | 1 or more | 629.0 | 11988.2 | 6824.7 | -32.8 |
+ | JUNCTION-96| Consumptio | 1 or more | 629.1 | 12258.5 | 6882.6 | -32.8 |
+ | JUNCTION-95| Consumptio | 1 or more | 630.9 | 11898.8 | 7243.2 | -32.8 |
+ | JUNCTION-94| Consumptio | 1 or more | 633.5 | 11146.0 | 7217.3 | -32.8 |
+ | JUNCTION-93| Consumptio | 1 or more | 643.7 | 10914.4 | 7076.2 | -32.8 |
+ | JUNCTION-92| Junction | 2 or more | 628.2 | 11329.3 | 7415.8 | -32.8 |
+ | JUNCTION-91| Junction | 2 or more | 637.4 | 11049.8 | 7438.4 | -32.8 |
+ | JUNCTION-90| Junction | 2 or more | 644.1 | 10195.6 | 7695.3 | -32.8 |
+ | JUNCTION-89| Consumptio | 1 or more | 626.8 | 10213.9 | 6766.2 | -32.8 |
+ | JUNCTION-88| Junction | 2 or more | 621.7 | 9858.2 | 6722.5 | -32.8 |
+ | JUNCTION-87| Junction | 2 or more | 622.3 | 9783.7 | 7326.9 | -32.8 |
+ | JUNCTION-86| Junction | 2 or more | 623.5 | 9854.9 | 7388.1 | -32.8 |
+ | JUNCTION-85| Junction | 2 or more | 620.2 | 9258.4 | 7105.7 | -32.8 |
+ | JUNCTION-84| Consumptio | 1 or more | 619.9 | 8730.4 | 6653.7 | -32.8 |
+ | JUNCTION-83| Consumptio | 1 or more | 617.7 | 8323.8 | 6956.3 | -32.8 |
+ | JUNCTION-82| Consumptio | 1 or more | 618.8 | 8957.1 | 6711.1 | -32.8 |
+ | JUNCTION-81| Consumptio | 1 or more | 623.6 | 8720.2 | 6306.0 | -32.8 |
+ | JUNCTION-80| Junction | 2 or more | 616.9 | 9547.3 | 6843.1 | -32.8 |
+ | JUNCTION-79| Junction | 2 or more | 617.9 | 9464.5 | 6666.2 | -32.8 |
+ | JUNCTION-78| Junction | 2 or more | 618.0 | 10145.3 | 6591.0 | -32.8 |
+ | JUNCTION-77| Consumptio | 1 or more | 624.6 | 9030.7 | 6468.5 | -32.8 |
+ | JUNCTION-76| Consumptio | 1 or more | 622.5 | 9586.3 | 6217.9 | -32.8 |
+ | JUNCTION-75| Consumptio | 1 or more | 629.2 | 9925.0 | 6101.5 | -32.8 |
+ | JUNCTION-74| Consumptio | 1 or more | 622.3 | 9287.7 | 5689.5 | -32.8 |
+ | JUNCTION-73| Consumptio | 1 or more | 620.4 | 8948.6 | 5664.6 | -32.8 |
+
+
+ | JUNCTION-72| Consumptio | 1 or more | 622.3 | 9863.8 | 5789.0 | -32.8 |
+ | JUNCTION-71| Consumptio | 1 or more | 632.2 | 11119.0 | 5746.1 | -32.8 |
+ | JUNCTION-70| Consumptio | 1 or more | 619.1 | 10159.9 | 5492.0 | -32.8 |
+ | JUNCTION-69| Consumptio | 1 or more | 626.0 | 10656.1 | 4919.1 | -32.8 |
+ | JUNCTION-68| Consumptio | 1 or more | 617.1 | 12557.6 | 5460.0 | -32.8 |
+ | JUNCTION-67| Junction | 2 or more | 624.5 | 13279.9 | 5819.7 | -32.8 |
+ | JUNCTION-66| Junction | 2 or more | 619.7 | 12934.2 | 5907.1 | -32.8 |
+ | JUNCTION-65| Junction | 2 or more | 619.4 | 12428.1 | 5637.1 | -32.8 |
+ | JUNCTION-64| Junction | 2 or more | 623.1 | 12839.1 | 6041.1 | -32.8 |
+ | JUNCTION-63| Junction | 2 or more | 624.0 | 13117.2 | 6348.0 | -32.8 |
+ | JUNCTION-62| Junction | 2 or more | 625.4 | 13532.3 | 5946.6 | -32.8 |
+ | JUNCTION-61| Junction | 2 or more | 625.4 | 13602.4 | 5773.7 | -32.8 |
+ | JUNCTION-60| Junction | 2 or more | 624.0 | 13791.8 | 6134.5 | -32.8 |
+ | JUNCTION-59| Junction | 2 or more | 621.0 | 14148.9 | 5772.1 | -32.8 |
+ | JUNCTION-58| Consumptio | 1 or more | 610.2 | 12868.5 | 5333.0 | -32.8 |
+ | JUNCTION-57| Consumptio | 1 or more | 618.0 | 12620.4 | 7598.3 | -32.8 |
+ | JUNCTION-56| Junction | 2 or more | 606.9 | 15593.5 | 6259.5 | -32.8 |
+ | JUNCTION-55| Consumptio | 1 or more | 603.3 | 15431.0 | 5873.3 | -32.8 |
+ | JUNCTION-54| Consumptio | 1 or more | 602.1 | 15121.8 | 5808.6 | -32.8 |
+ | JUNCTION-53| Consumptio | 1 or more | 607.6 | 15786.2 | 6502.1 | -32.8 |
+ | JUNCTION-52| Consumptio | 1 or more | 613.3 | 16207.1 | 7913.8 | -32.8 |
+ | JUNCTION-51| Consumptio | 1 or more | 623.7 | 16592.9 | 8263.2 | -32.8 |
+ | JUNCTION-50| Consumptio | 1 or more | 611.1 | 16530.4 | 7578.3 | -32.8 |
+ | JUNCTION-49| Consumptio | 1 or more | 623.9 | 16906.3 | 6921.4 | -32.8 |
+ | JUNCTION-48| Junction | 2 or more | 637.5 | 16883.7 | 7732.4 | -32.8 |
+ | JUNCTION-47| Junction | 2 or more | 640.5 | 16834.7 | 8674.2 | -32.8 |
+ | JUNCTION-46| Consumptio | 1 or more | 820.2 | 21256.8 | 7712.6 | -32.8 |
+ | JUNCTION-45| Consumptio | 1 or more | 747.3 | 21174.2 | 8720.9 | -32.8 |
+ | JUNCTION-44| Consumptio | 1 or more | 678.5 | 18623.9 | 7147.8 | -32.8 |
+ | JUNCTION-43| Consumptio | 1 or more | 653.1 | 18469.2 | 6808.9 | -32.8 |
+ | JUNCTION-42| Consumptio | 1 or more | 728.0 | 18364.6 | 9448.2 | -32.8 |
+ | JUNCTION-41| Consumptio | 1 or more | 700.2 | 17839.8 | 9907.3 | -32.8 |
+ | JUNCTION-40| Consumptio | 1 or more | 741.6 | 19078.3 | 10194.3 | -32.8 |
+ | JUNCTION-39| Consumptio | 1 or more | 703.2 | 19144.9 | 10524.3 | -32.8 |
+ | JUNCTION-38| Dead end | 1 pipe | 646.5 | 18586.8 | 10731.6 | -32.8 |
+ | JUNCTION-37| Consumptio | 1 or more | 677.0 | 18964.7 | 10649.3 | -32.8 |
+ | JUNCTION-36| Dead end | 1 pipe | 634.1 | 20382.6 | 10491.0 | -32.8 |
+ | JUNCTION-35| Consumptio | 1 or more | 652.0 | 19651.9 | 10705.0 | -32.8 |
+ | JUNCTION-34| Junction | 2 or more | 200.0 | 1229.3 | 517.0 | -32.8 |
+ | JUNCTION-33| Consumptio | 1 or more | 622.8 | 12403.2 | 7436.5 | -32.8 |
+ | JUNCTION-32| Consumptio | 1 or more | 625.8 | 13216.9 | 6351.0 | -32.8 |
+ | JUNCTION-31| Consumptio | 1 or more | 600.4 | 15150.2 | 5759.0 | -32.8 |
+ | JUNCTION-30| Consumptio | 1 or more | 636.0 | 17050.1 | 5147.0 | -32.8 |
+ | JUNCTION-29| Junction | 2 or more | 846.3 | 21832.5 | 7401.0 | -32.8 |
+ | JUNCTION-28| Consumptio | 1 or more | 701.7 | 19665.5 | 7311.9 | -32.8 |
+ | JUNCTION-27| Consumptio | 1 or more | 690.7 | 19085.7 | 7571.5 | -32.8 |
+ | JUNCTION-26| Junction | 2 or more | 683.4 | 19031.8 | 7370.0 | -32.8 |
+ | JUNCTION-25| Consumptio | 1 or more | 653.9 | 18088.2 | 7414.0 | -32.8 |
+ | JUNCTION-24| Junction | 2 or more | 636.6 | 17978.7 | 7369.5 | -32.8 |
+ | JUNCTION-23| Consumptio | 1 or more | 604.3 | 17389.3 | 5906.7 | -32.8 |
+ | JUNCTION-22| Consumptio | 1 or more | 626.0 | 17226.1 | 7017.4 | -32.8 |
+ | JUNCTION-21| Junction | 2 or more | 652.4 | 17038.5 | 8061.9 | -32.8 |
+ | JUNCTION-20| Consumptio | 1 or more | 617.7 | 17913.2 | 10624.4 | -32.8 |
+ | JUNCTION-19| Consumptio | 1 or more | 558.9 | 18855.7 | 11372.0 | -32.8 |
+ | JUNCTION-18| Consumptio | 1 or more | 478.1 | 11035.9 | 11158.5 | -32.8 |
+ | JUNCTION-17| Consumptio | 1 or more | 385.1 | 11369.0 | 12740.0 | -32.8 |
+ | JUNCTION-16| Dead end | 1 pipe | 383.0 | 6315.6 | 11942.4 | -32.8 |
+ | JUNCTION-15| Consumptio | 1 or more | 423.5 | 8238.8 | 12284.0 | -32.8 |
+ | JUNCTION-14| Junction | 2 or more | 416.9 | 8230.3 | 12462.8 | -32.8 |
+ | JUNCTION-13| Dead end | 1 pipe | 326.0 | 6854.9 | 12866.6 | -32.8 |
+
+
+ | JUNCTION-12| Consumptio | 1 or more | 379.5 | 7680.5 | 12925.5 | -32.8 |
+ | JUNCTION-11| Consumptio | 1 or more | 344.1 | 8786.5 | 13171.9 | -32.8 |
+ | JUNCTION-10| Consumptio | 1 or more | 333.6 | 9907.0 | 13563.1 | -32.8 |
+ | JUNCTION-9 | Junction | 2 or more | 488.3 | 10712.6 | 11636.9 | -32.8 |
+ | JUNCTION-8 | Consumptio | 1 or more | 493.4 | 9560.2 | 10770.9 | -32.8 |
+ | JUNCTION-7 | Dead end | 1 pipe | 535.2 | 9229.1 | 11217.7 | -32.8 |
+ | JUNCTION-6 | Consumptio | 1 or more | 505.0 | 8992.6 | 11098.6 | -32.8 |
+ | JUNCTION-5 | Consumptio | 1 or more | 494.2 | 8990.4 | 11387.3 | -32.8 |
+ | JUNCTION-4 | Consumptio | 1 or more | 477.8 | 9475.2 | 11990.5 | -32.8 |
+ | JUNCTION-3 | Consumptio | 1 or more | 428.1 | 8386.7 | 12309.4 | -32.8 |
+ | JUNCTION-2 | Consumptio | 1 or more | 363.1 | 10075.1 | 12981.1 | -32.8 |
+ | JUNCTION-1 | Junction | 2 or more | 192.0 | 211.1 | 216.5 | -32.8 |
+ | JUNCTION-0 | Consumptio | 1 or more | 376.1 | 10639.7 | 12717.8 | -32.8 |
+ ----------------------------------------------------------------------------------------------------
+
+
+
+ *** NODE DATA ***
+
+ ----------------------------------------------------------------------
+ | LABEL | DATA |
+ ----------------------------------------------------------------------
+ | | |
+ | VALVE-180 | Type of Valve: globe |
+ | | Diameter: 8 |
+ | | Disch. Coeff. at Full Opening: 6.261 |
+ | | No. of Oper. Rule Records: 2 |
+ | | Oper. Rule First Time: 0 |
+ | | Oper. Rule First Rel. Closure: 0 |
+ | | Oper. Rule Last Time: 1000000 |
+ | | Oper. Rule Last Rel. Closure: 0 |
+ | | Control Type: PRV |
+ | | Control Value: 0 |
+ | | Control Status: throttled |
+ | | |
+ | VALVE-176 | Type of Valve: globe |
+ | | Diameter: 6 |
+ | | Disch. Coeff. at Full Opening: 3.522 |
+ | | No. of Oper. Rule Records: 2 |
+ | | Oper. Rule First Time: 0 |
+ | | Oper. Rule First Rel. Closure: 0 |
+ | | Oper. Rule Last Time: 1000000 |
+ | | Oper. Rule Last Rel. Closure: 0 |
+ | | Control Type: PRV |
+ | | Control Value: 0 |
+ | | Control Status: throttled |
+ | | |
+ | VALVE-175 | Type of Valve: globe |
+ | | Diameter: 10 |
+ | | Disch. Coeff. at Full Opening: 9.783 |
+ | | No. of Oper. Rule Records: 2 |
+ | | Oper. Rule First Time: 0 |
+ | | Oper. Rule First Rel. Closure: 0 |
+ | | Oper. Rule Last Time: 1000000 |
+ | | Oper. Rule Last Rel. Closure: 0 |
+ | | Control Type: PRV |
+ | | Control Value: 0 |
+ | | Control Status: throttled |
+ | | |
+
+
+ | VALVE-174 | Type of Valve: globe |
+ | | Diameter: 6 |
+ | | Disch. Coeff. at Full Opening: 3.522 |
+ | | No. of Oper. Rule Records: 2 |
+ | | Oper. Rule First Time: 0 |
+ | | Oper. Rule First Rel. Closure: 0 |
+ | | Oper. Rule Last Time: 1000000 |
+ | | Oper. Rule Last Rel. Closure: 0 |
+ | | Control Type: PRV |
+ | | Control Value: 0 |
+ | | Control Status: throttled |
+ | | |
+ | VALVE-173 | Type of Valve: globe |
+ | | Diameter: 6 |
+ | | Disch. Coeff. at Full Opening: 1000000 |
+ | | No. of Oper. Rule Records: 2 |
+ | | Oper. Rule First Time: 0 |
+ | | Oper. Rule First Rel. Closure: 0 |
+ | | Oper. Rule Last Time: 1000000 |
+ | | Oper. Rule Last Rel. Closure: 0 |
+ | | Control Type: PRV |
+ | | Control Value: 0 |
+ | | Control Status: throttled |
+ | | |
+ | VALVE-178 | Type of Valve: globe |
+ | | Diameter: 6 |
+ | | Disch. Coeff. at Full Opening: 3.522 |
+ | | No. of Oper. Rule Records: 2 |
+ | | Oper. Rule First Time: 0 |
+ | | Oper. Rule First Rel. Closure: 0 |
+ | | Oper. Rule Last Time: 1000000 |
+ | | Oper. Rule Last Rel. Closure: 0 |
+ | | Control Type: PRV |
+ | | Control Value: 0 |
+ | | Control Status: throttled |
+ | | |
+ | VALVE-177 | Type of Valve: globe |
+ | | Diameter: 6 |
+ | | Disch. Coeff. at Full Opening: 3.522 |
+ | | No. of Oper. Rule Records: 2 |
+ | | Oper. Rule First Time: 0 |
+ | | Oper. Rule First Rel. Closure: 0 |
+ | | Oper. Rule Last Time: 1000000 |
+ | | Oper. Rule Last Rel. Closure: 0 |
+ | | Control Type: PRV |
+ | | Control Value: 0 |
+ | | Control Status: throttled |
+ | | |
+ | VALVE-179 | Type of Valve: globe |
+ | | Diameter: 8 |
+ | | Disch. Coeff. at Full Opening: 6.261 |
+ | | No. of Oper. Rule Records: 2 |
+ | | Oper. Rule First Time: 0 |
+ | | Oper. Rule First Rel. Closure: 0 |
+ | | Oper. Rule Last Time: 1000000 |
+ | | Oper. Rule Last Rel. Closure: 0 |
+ | | Control Type: PRV |
+ | | Control Value: 0 |
+ | | Control Status: throttled |
+ | | |
+
+
+ | PUMP-172 | Inertia of Pump and Motor: 2373 |
+ | | Nominal Flow: 2.443 |
+ | | Nominal Head: 433.8 |
+ | | Nominal Speed: 20 |
+ | | Nominal Percent Efficiency: 75 |
+ | | Closure Time of Valve: 0 |
+ | | Diameter of Valve: 184 |
+ | | Specific Speed: 1280 |
+ | | Control Variable: Speed |
+ | | No. of Oper. Rule Records: 3 |
+ | | Oper. Rule First Time: 0 |
+ | | Oper. Rule First Control Value: 20 |
+ | | Oper. Rule Last Time: 20 |
+ | | Oper. Rule Last Control Value: 0 |
+ | | Report Period: 0 |
+ | | |
+ | PUMP-170 | Specific Speed: 1280 |
+ | | Nominal Flow: 2.900 |
+ | | Nominal Head: 293.3 |
+ | | |
+ | TANK-131 | Surge Tank Diameter: 1272 |
+ | | Throat Diameter: 16 |
+ | | Head Loss Coeff. (Outflow): 0 |
+ | | Ratio of Losses (In/out): 1 |
+ | | Check Valve Installed: 0 |
+ | | Initial Water Level: 1155 |
+ | | Top Elevation of Tank: 1179 |
+ | | Report Period: 0 |
+ | | Weir Coefficient: 0 |
+ | | |
+ | TANK-130 | Surge Tank Diameter: 2232 |
+ | | Throat Diameter: 24 |
+ | | Head Loss Coeff. (Outflow): 0 |
+ | | Ratio of Losses (In/out): 1 |
+ | | Check Valve Installed: 0 |
+ | | Initial Water Level: 859.1 |
+ | | Top Elevation of Tank: 876 |
+ | | Report Period: 0 |
+ | | Weir Coefficient: 0 |
+ | | |
+ | RESERVOIR-129| |
+ | | |
+ | JUNCTION-128 | |
+ | | |
+ | JUNCTION-110 | |
+ | | |
+ | JUNCTION-109 | |
+ | | |
+ | JUNCTION-106 | |
+ | | |
+ | JUNCTION-105 | |
+ | | |
+ | JUNCTION-104 | |
+ | | |
+ | JUNCTION-103 | |
+ | | |
+ | JUNCTION-102 | |
+ | | |
+
+
+ | JUNCTION-101 | |
+ | | |
+ | JUNCTION-100 | |
+ | | |
+ | JUNCTION-99 | |
+ | | |
+ | JUNCTION-98 | |
+ | | |
+ | JUNCTION-97 | |
+ | | |
+ | JUNCTION-96 | |
+ | | |
+ | JUNCTION-95 | |
+ | | |
+ | JUNCTION-94 | |
+ | | |
+ | JUNCTION-93 | |
+ | | |
+ | JUNCTION-92 | |
+ | | |
+ | JUNCTION-91 | |
+ | | |
+ | JUNCTION-90 | |
+ | | |
+ | JUNCTION-89 | |
+ | | |
+ | JUNCTION-88 | |
+ | | |
+ | JUNCTION-87 | |
+ | | |
+ | JUNCTION-86 | |
+ | | |
+ | JUNCTION-85 | |
+ | | |
+ | JUNCTION-84 | |
+ | | |
+ | JUNCTION-83 | |
+ | | |
+ | JUNCTION-82 | |
+ | | |
+ | JUNCTION-81 | |
+ | | |
+ | JUNCTION-80 | |
+ | | |
+ | JUNCTION-79 | |
+ | | |
+ | JUNCTION-78 | |
+ | | |
+ | JUNCTION-77 | |
+ | | |
+ | JUNCTION-76 | |
+ | | |
+ | JUNCTION-75 | |
+ | | |
+ | JUNCTION-74 | |
+ | | |
+ | JUNCTION-73 | |
+ | | |
+
+
+ | JUNCTION-72 | |
+ | | |
+ | JUNCTION-71 | |
+ | | |
+ | JUNCTION-70 | |
+ | | |
+ | JUNCTION-69 | |
+ | | |
+ | JUNCTION-68 | |
+ | | |
+ | JUNCTION-67 | |
+ | | |
+ | JUNCTION-66 | |
+ | | |
+ | JUNCTION-65 | |
+ | | |
+ | JUNCTION-64 | |
+ | | |
+ | JUNCTION-63 | |
+ | | |
+ | JUNCTION-62 | |
+ | | |
+ | JUNCTION-61 | |
+ | | |
+ | JUNCTION-60 | |
+ | | |
+ | JUNCTION-59 | |
+ | | |
+ | JUNCTION-58 | |
+ | | |
+ | JUNCTION-57 | |
+ | | |
+ | JUNCTION-56 | |
+ | | |
+ | JUNCTION-55 | |
+ | | |
+ | JUNCTION-54 | |
+ | | |
+ | JUNCTION-53 | |
+ | | |
+ | JUNCTION-52 | |
+ | | |
+ | JUNCTION-51 | |
+ | | |
+ | JUNCTION-50 | |
+ | | |
+ | JUNCTION-49 | |
+ | | |
+ | JUNCTION-48 | |
+ | | |
+ | JUNCTION-47 | |
+ | | |
+ | JUNCTION-46 | |
+ | | |
+ | JUNCTION-45 | |
+ | | |
+ | JUNCTION-44 | |
+ | | |
+
+
+ | JUNCTION-43 | |
+ | | |
+ | JUNCTION-42 | |
+ | | |
+ | JUNCTION-41 | |
+ | | |
+ | JUNCTION-40 | |
+ | | |
+ | JUNCTION-39 | |
+ | | |
+ | JUNCTION-38 | Initial Vapour Vol: 0 |
+ | | |
+ | JUNCTION-37 | |
+ | | |
+ | JUNCTION-36 | Initial Vapour Vol: 0 |
+ | | |
+ | JUNCTION-35 | |
+ | | |
+ | JUNCTION-34 | |
+ | | |
+ | JUNCTION-33 | |
+ | | |
+ | JUNCTION-32 | |
+ | | |
+ | JUNCTION-31 | |
+ | | |
+ | JUNCTION-30 | |
+ | | |
+ | JUNCTION-29 | |
+ | | |
+ | JUNCTION-28 | |
+ | | |
+ | JUNCTION-27 | |
+ | | |
+ | JUNCTION-26 | |
+ | | |
+ | JUNCTION-25 | |
+ | | |
+ | JUNCTION-24 | |
+ | | |
+ | JUNCTION-23 | |
+ | | |
+ | JUNCTION-22 | |
+ | | |
+ | JUNCTION-21 | |
+ | | |
+ | JUNCTION-20 | |
+ | | |
+ | JUNCTION-19 | |
+ | | |
+ | JUNCTION-18 | |
+ | | |
+ | JUNCTION-17 | |
+ | | |
+ | JUNCTION-16 | Initial Vapour Vol: 0 |
+ | | |
+ | JUNCTION-15 | |
+ | | |
+
+
+ | JUNCTION-14 | |
+ | | |
+ | JUNCTION-13 | Initial Vapour Vol: 0 |
+ | | |
+ | JUNCTION-12 | |
+ | | |
+ | JUNCTION-11 | |
+ | | |
+ | JUNCTION-10 | |
+ | | |
+ | JUNCTION-9 | |
+ | | |
+ | JUNCTION-8 | |
+ | | |
+ | JUNCTION-7 | Initial Vapour Vol: 0 |
+ | | |
+ | JUNCTION-6 | |
+ | | |
+ | JUNCTION-5 | |
+ | | |
+ | JUNCTION-4 | |
+ | | |
+ | JUNCTION-3 | |
+ | | |
+ | JUNCTION-2 | |
+ | | |
+ | JUNCTION-1 | |
+ | | |
+ | JUNCTION-0 | |
+ ----------------------------------------------------------------------
+
+
+
+ *** CONNECTIVITY ***
+
+ ---------------------------------------------
+ | PIPE LABEL | FROM NODE | TO NODE |
+ ---------------------------------------------
+ | | | |
+ | PUMP-172-A | JUNCTION-109| PUMP-172 |
+ | PUMP-172-B | PUMP-172 | JUNCTION-110|
+ | PUMP-170-A | JUNCTION-105| PUMP-170 |
+ | PUMP-170-B | PUMP-170 | JUNCTION-106|
+ | LINK-98 | JUNCTION-62 | JUNCTION-63 |
+ | LINK-97 | JUNCTION-61 | JUNCTION-62 |
+ | LINK-96 | JUNCTION-60 | JUNCTION-61 |
+ | LINK-95 | JUNCTION-60 | JUNCTION-59 |
+ | LINK-94 | JUNCTION-59 | JUNCTION-60 |
+ | LINK-93 | JUNCTION-58 | JUNCTION-59 |
+ | LINK-92 | JUNCTION-31 | JUNCTION-58 |
+ | LINK-91 | JUNCTION-57 | JUNCTION-33 |
+ | LINK-90 | JUNCTION-32 | JUNCTION-57 |
+ | LINK-89 | JUNCTION-55 | JUNCTION-56 |
+ | LINK-88 | JUNCTION-55 | JUNCTION-54 |
+ | LINK-87 | JUNCTION-56 | JUNCTION-55 |
+ | LINK-86 | JUNCTION-53 | JUNCTION-56 |
+ | LINK-85 | JUNCTION-54 | JUNCTION-31 |
+ | LINK-84 | JUNCTION-53 | JUNCTION-54 |
+ | LINK-83 | JUNCTION-23 | JUNCTION-53 |
+
+
+ | LINK-82 | JUNCTION-52 | JUNCTION-50 |
+ | LINK-81 | JUNCTION-52 | JUNCTION-47 |
+ | LINK-80 | JUNCTION-51 | JUNCTION-52 |
+ | LINK-79 | JUNCTION-51 | JUNCTION-48 |
+ | LINK-78 | JUNCTION-50 | JUNCTION-51 |
+ | LINK-77 | JUNCTION-49 | JUNCTION-50 |
+ | LINK-76 | JUNCTION-49 | JUNCTION-22 |
+ | LINK-75 | JUNCTION-48 | JUNCTION-49 |
+ | LINK-74 | JUNCTION-47 | JUNCTION-48 |
+ | LINK-73 | JUNCTION-21 | JUNCTION-47 |
+ | LINK-72 | JUNCTION-29 | TANK-130 |
+ | LINK-71 | JUNCTION-44 | JUNCTION-28 |
+ | LINK-70 | JUNCTION-44 | JUNCTION-26 |
+ | LINK-69 | JUNCTION-43 | JUNCTION-44 |
+ | LINK-68 | JUNCTION-43 | JUNCTION-25 |
+ | LINK-67 | JUNCTION-24 | JUNCTION-43 |
+ | LINK-66 | JUNCTION-42 | JUNCTION-27 |
+ | LINK-65 | JUNCTION-42 | JUNCTION-41 |
+ | LINK-64 | JUNCTION-40 | JUNCTION-42 |
+ | LINK-63 | JUNCTION-40 | JUNCTION-41 |
+ | LINK-62 | JUNCTION-39 | JUNCTION-40 |
+ | LINK-61 | JUNCTION-37 | JUNCTION-39 |
+ | LINK-60 | JUNCTION-35 | JUNCTION-38 |
+ | LINK-59 | JUNCTION-37 | JUNCTION-20 |
+ | LINK-58 | JUNCTION-35 | JUNCTION-37 |
+ | LINK-57 | JUNCTION-35 | JUNCTION-36 |
+ | LINK-56 | JUNCTION-19 | JUNCTION-35 |
+ | LINK-55 | JUNCTION-33 | JUNCTION-57 |
+ | LINK-54 | JUNCTION-32 | JUNCTION-33 |
+ | LINK-53 | JUNCTION-31 | JUNCTION-32 |
+ | LINK-52 | JUNCTION-30 | JUNCTION-31 |
+ | LINK-51 | JUNCTION-27 | JUNCTION-28 |
+ | LINK-50 | JUNCTION-26 | JUNCTION-27 |
+ | LINK-49 | JUNCTION-25 | JUNCTION-26 |
+ | LINK-48 | JUNCTION-24 | JUNCTION-25 |
+ | LINK-47 | JUNCTION-22 | JUNCTION-24 |
+ | LINK-46 | JUNCTION-23 | JUNCTION-30 |
+ | LINK-45 | JUNCTION-22 | JUNCTION-23 |
+ | LINK-44 | JUNCTION-21 | JUNCTION-22 |
+ | LINK-43 | JUNCTION-19 | JUNCTION-20 |
+ | LINK-40 | JUNCTION-20 | JUNCTION-21 |
+ | LINK-39 | VALVE-176 | JUNCTION-17 |
+ | LINK-38 | JUNCTION-11 | JUNCTION-10 |
+ | LINK-37 | JUNCTION-2 | JUNCTION-3 |
+ | LINK-36 | JUNCTION-41 | JUNCTION-39 |
+ | LINK-35 | JUNCTION-34 | JUNCTION-30 |
+ | LINK-33 | JUNCTION-23 | VALVE-179 |
+ | LINK-32 | JUNCTION-45 | JUNCTION-46 |
+ | LINK-31 | JUNCTION-29 | JUNCTION-28 |
+ | LINK-30 | JUNCTION-0 | JUNCTION-4 |
+ | LINK-29 | JUNCTION-18 | VALVE-175 |
+ | LINK-28 | JUNCTION-17 | JUNCTION-18 |
+ | LINK-27 | JUNCTION-14 | JUNCTION-16 |
+ | LINK-26 | VALVE-173 | JUNCTION-14 |
+ | LINK-24 | JUNCTION-15 | JUNCTION-3 |
+ | LINK-23 | JUNCTION-5 | JUNCTION-15 |
+ | LINK-22 | JUNCTION-14 | JUNCTION-12 |
+ | LINK-21 | JUNCTION-12 | JUNCTION-11 |
+ | LINK-20 | JUNCTION-12 | JUNCTION-13 |
+ | LINK-19 | RESERVOIR-129| JUNCTION-128|
+
+
+ | LINK-18 | JUNCTION-128| JUNCTION-1 |
+ | LINK-17 | JUNCTION-110| JUNCTION-34 |
+ | LINK-16 | JUNCTION-10 | JUNCTION-11 |
+ | LINK-15 | JUNCTION-1 | JUNCTION-109|
+ | LINK-13 | JUNCTION-2 | VALVE-174 |
+ | LINK-12 | JUNCTION-9 | JUNCTION-8 |
+ | LINK-11 | JUNCTION-18 | JUNCTION-9 |
+ | LINK-10 | JUNCTION-9 | JUNCTION-8 |
+ | LINK-9 | JUNCTION-8 | JUNCTION-6 |
+ | LINK-8 | JUNCTION-6 | JUNCTION-7 |
+ | LINK-7 | JUNCTION-5 | JUNCTION-6 |
+ | LINK-6 | JUNCTION-5 | JUNCTION-4 |
+ | LINK-3 | JUNCTION-3 | JUNCTION-4 |
+ | LINK-2 | JUNCTION-0 | JUNCTION-2 |
+ | LINK-1 | JUNCTION-17 | JUNCTION-0 |
+ | LINK-169 | JUNCTION-103| JUNCTION-104|
+ | LINK-167 | JUNCTION-106| JUNCTION-104|
+ | LINK-166 | JUNCTION-29 | JUNCTION-105|
+ | LINK-165 | JUNCTION-102| TANK-131 |
+ | LINK-164 | JUNCTION-103| JUNCTION-102|
+ | LINK-162 | JUNCTION-46 | VALVE-177 |
+ | LINK-161 | JUNCTION-45 | JUNCTION-46 |
+ | LINK-160 | JUNCTION-97 | JUNCTION-71 |
+ | LINK-159 | JUNCTION-98 | JUNCTION-99 |
+ | LINK-158 | JUNCTION-100| JUNCTION-101|
+ | LINK-157 | JUNCTION-101| JUNCTION-98 |
+ | LINK-156 | JUNCTION-100| JUNCTION-101|
+ | LINK-155 | JUNCTION-99 | JUNCTION-100|
+ | LINK-154 | JUNCTION-98 | JUNCTION-99 |
+ | LINK-153 | JUNCTION-97 | JUNCTION-98 |
+ | LINK-152 | JUNCTION-97 | JUNCTION-96 |
+ | LINK-151 | JUNCTION-91 | JUNCTION-97 |
+ | LINK-150 | JUNCTION-96 | JUNCTION-95 |
+ | LINK-149 | JUNCTION-95 | JUNCTION-96 |
+ | LINK-148 | JUNCTION-92 | JUNCTION-95 |
+ | LINK-147 | JUNCTION-93 | JUNCTION-94 |
+ | LINK-146 | JUNCTION-94 | JUNCTION-92 |
+ | LINK-145 | JUNCTION-93 | JUNCTION-94 |
+ | LINK-144 | JUNCTION-90 | JUNCTION-93 |
+ | LINK-143 | JUNCTION-92 | JUNCTION-33 |
+ | LINK-142 | JUNCTION-91 | JUNCTION-92 |
+ | LINK-141 | JUNCTION-90 | JUNCTION-91 |
+ | LINK-140 | JUNCTION-89 | JUNCTION-90 |
+ | LINK-139 | JUNCTION-89 | JUNCTION-86 |
+ | LINK-138 | JUNCTION-88 | JUNCTION-89 |
+ | LINK-137 | JUNCTION-88 | JUNCTION-79 |
+ | LINK-136 | JUNCTION-87 | JUNCTION-88 |
+ | LINK-135 | JUNCTION-87 | JUNCTION-85 |
+ | LINK-134 | JUNCTION-86 | JUNCTION-87 |
+ | LINK-133 | JUNCTION-85 | JUNCTION-86 |
+ | LINK-132 | JUNCTION-82 | JUNCTION-85 |
+ | LINK-131 | JUNCTION-84 | JUNCTION-83 |
+ | LINK-130 | JUNCTION-84 | JUNCTION-81 |
+ | LINK-129 | JUNCTION-83 | JUNCTION-84 |
+ | LINK-128 | JUNCTION-82 | JUNCTION-83 |
+ | LINK-127 | JUNCTION-80 | JUNCTION-82 |
+ | LINK-126 | JUNCTION-78 | JUNCTION-71 |
+ | LINK-125 | JUNCTION-81 | JUNCTION-77 |
+ | LINK-124 | JUNCTION-80 | JUNCTION-81 |
+ | LINK-123 | JUNCTION-79 | JUNCTION-80 |
+
+
+ | LINK-122 | JUNCTION-78 | JUNCTION-79 |
+ | LINK-121 | JUNCTION-76 | JUNCTION-78 |
+ | LINK-120 | JUNCTION-77 | JUNCTION-73 |
+ | LINK-119 | JUNCTION-76 | JUNCTION-77 |
+ | LINK-118 | JUNCTION-75 | JUNCTION-76 |
+ | LINK-117 | JUNCTION-75 | JUNCTION-74 |
+ | LINK-116 | JUNCTION-72 | JUNCTION-75 |
+ | LINK-115 | JUNCTION-74 | JUNCTION-73 |
+ | LINK-114 | JUNCTION-72 | JUNCTION-74 |
+ | LINK-113 | JUNCTION-73 | JUNCTION-69 |
+ | LINK-112 | JUNCTION-70 | JUNCTION-72 |
+ | LINK-111 | JUNCTION-70 | JUNCTION-71 |
+ | LINK-110 | JUNCTION-69 | JUNCTION-70 |
+ | LINK-109 | JUNCTION-68 | JUNCTION-69 |
+ | LINK-108 | JUNCTION-63 | JUNCTION-62 |
+ | LINK-107 | JUNCTION-65 | JUNCTION-68 |
+ | LINK-106 | JUNCTION-64 | JUNCTION-65 |
+ | LINK-105 | JUNCTION-68 | JUNCTION-58 |
+ | LINK-104 | JUNCTION-66 | JUNCTION-67 |
+ | LINK-103 | JUNCTION-67 | JUNCTION-61 |
+ | LINK-102 | JUNCTION-66 | JUNCTION-67 |
+ | LINK-101 | JUNCTION-65 | JUNCTION-66 |
+ | LINK-100 | JUNCTION-64 | JUNCTION-65 |
+ | LINK-99 | JUNCTION-63 | JUNCTION-64 |
+ | LINK-42 | JUNCTION-19 | VALVE-180 |
+ | LINK-0 | VALVE-180 | VALVE-176 |
+ | LINK-41 | JUNCTION-20 | VALVE-175 |
+ | LINK-14 | VALVE-174 | JUNCTION-10 |
+ | LINK-25 | JUNCTION-15 | VALVE-173 |
+ | LINK-168 | JUNCTION-103| VALVE-178 |
+ | LINK-163 | VALVE-177 | JUNCTION-104|
+ | LINK-34 | VALVE-178 | VALVE-179 |
+ ---------------------------------------------
+
+
+
+ *** PIPE INFORMATION ***
+
+ -----------------------------------------------------------------------------------------
+ | | LENGTH | DIAMETER | WAVESPEED | D-W | CHECK |
+ | LABEL | (ft) | (in.) | (ft /s) | FR. COEF. | VALVE |
+ -----------------------------------------------------------------------------------------
+ | | | | | | |
+ | PUMP-172-A | 1.0 | 99.00 | 3937.0 | 0.000 | |
+ | PUMP-172-B | 1.0 | 99.00 | 3937.0 | 0.000 | |
+ | PUMP-170-A | 1.0 | 99.00 | 3937.0 | 0.000 | |
+ | PUMP-170-B | 1.0 | 99.00 | 3937.0 | 0.000 | |
+ | LINK-98 | 187.0 | 8.00 | 3937.0 | *0.035 | |
+ | LINK-97 | 138.0 | 8.00 | 3937.0 | *0.040 | |
+ | LINK-96 | 133.0 | 8.00 | 3937.0 | *0.027 | |
+ | LINK-95 | 196.0 | 8.00 | 3937.0 | *0.035 | |
+ | LINK-94 | 943.0 | 8.00 | 3937.0 | *0.040 | |
+ | LINK-93 | 413.0 | 8.00 | 3937.0 | *0.029 | |
+ | LINK-92 | 1155.0 | 10.00 | 3937.0 | *0.024 | |
+ | LINK-91 | 230.0 | 8.00 | 3937.0 | *0.032 | |
+ | LINK-90 | 945.0 | 8.00 | 3937.0 | *0.029 | |
+ | LINK-89 | 873.0 | 8.00 | 3937.0 | *0.032 | |
+ | LINK-88 | 254.0 | 8.00 | 3937.0 | *0.030 | |
+ | LINK-87 | 390.0 | 8.00 | 3937.0 | *0.030 | |
+ | LINK-86 | 232.0 | 8.00 | 3937.0 | *0.030 | |
+
+
+ | LINK-85 | 229.0 | 10.00 | 3937.0 | *0.027 | |
+ | LINK-84 | 386.0 | 10.00 | 3937.0 | *0.027 | |
+ | LINK-83 | 919.0 | 10.00 | 3937.0 | *0.025 | |
+ | LINK-82 | 1381.0 | 8.00 | 3937.0 | *0.036 | |
+ | LINK-81 | 549.0 | 8.00 | 3937.0 | *0.033 | |
+ | LINK-80 | 393.0 | 8.00 | 3937.0 | *0.032 | |
+ | LINK-79 | 236.0 | 8.00 | 3937.0 | *0.040 | |
+ | LINK-78 | 388.0 | 8.00 | 3937.0 | *0.038 | |
+ | LINK-77 | 577.0 | 8.00 | 3937.0 | *0.030 | |
+ | LINK-76 | 158.0 | 8.00 | 3937.0 | *0.027 | |
+ | LINK-75 | 574.0 | 8.00 | 3937.0 | *0.030 | |
+ | LINK-74 | 805.0 | 8.00 | 3937.0 | *0.033 | |
+ | LINK-73 | 91.0 | 8.00 | 3937.0 | *0.031 | |
+ | LINK-72 | 242.0 | 24.00 | 3937.0 | 0.016 | |
+ | LINK-71 | 752.0 | 8.00 | 3937.0 | *0.022 | |
+ | LINK-70 | 556.0 | 8.00 | 3937.0 | *0.025 | |
+ | LINK-69 | 373.0 | 8.00 | 3937.0 | *0.020 | |
+ | LINK-68 | 420.0 | 8.00 | 3937.0 | *0.024 | |
+ | LINK-67 | 544.0 | 8.00 | 3937.0 | *0.021 | |
+ | LINK-66 | 2581.0 | 8.02 | 3937.0 | *0.023 | |
+ | LINK-65 | 668.0 | 8.00 | 3937.0 | *0.025 | |
+ | LINK-64 | 538.0 | 8.00 | 3937.0 | *0.025 | |
+ | LINK-63 | 619.0 | 8.00 | 3937.0 | 0.000 | |
+ | LINK-62 | 998.0 | 8.30 | 3937.0 | *0.024 | |
+ | LINK-61 | 348.0 | 8.00 | 3937.0 | *0.022 | |
+ | LINK-60 | 552.0 | 8.00 | 3937.0 | 0.015 | |
+ | LINK-59 | 739.0 | 8.00 | 3937.0 | *0.024 | |
+ | LINK-58 | 246.0 | 8.00 | 3937.0 | *0.025 | |
+ | LINK-57 | 507.0 | 8.00 | 3937.0 | 0.015 | |
+ | LINK-56 | 1113.0 | 8.00 | 3937.0 | *0.024 | |
+ | LINK-55 | 754.0 | 8.41 | 3937.0 | *0.036 | |
+ | LINK-54 | 645.0 | 12.00 | 3937.0 | *0.026 | |
+ | LINK-53 | 1699.0 | 12.00 | 3937.0 | *0.025 | |
+ | LINK-52 | 1146.0 | 12.00 | 3937.0 | *0.023 | |
+ | LINK-51 | 144.0 | 24.00 | 3937.0 | 0.015 | |
+ | LINK-50 | 76.0 | 24.00 | 3937.0 | 0.015 | |
+ | LINK-49 | 336.0 | 24.00 | 3937.0 | 0.015 | |
+ | LINK-48 | 178.0 | 24.00 | 3937.0 | 0.015 | |
+ | LINK-47 | 292.0 | 24.00 | 3937.0 | 0.015 | |
+ | LINK-46 | 1175.0 | 24.00 | 3937.0 | *0.021 | |
+ | LINK-45 | 1101.0 | 24.00 | 3937.0 | 0.015 | |
+ | LINK-44 | 1257.0 | 20.00 | 3937.0 | *0.024 | |
+ | LINK-43 | 942.0 | 20.00 | 3937.0 | *0.026 | |
+ | LINK-40 | 2125.0 | 20.00 | 3937.0 | *0.023 | |
+ | LINK-39 | 1537.0 | 16.00 | 3937.0 | *0.032 | |
+ | LINK-38 | 1000.0 | 8.00 | 3937.0 | *0.048 | |
+ | LINK-37 | 1066.0 | 8.00 | 3937.0 | *0.038 | |
+ | LINK-36 | 1066.0 | 8.00 | 3937.0 | *0.025 | |
+ | LINK-35 | 10260.3 | 24.00 | 3937.0 | 0.020 | |
+ | LINK-33 | 1845.0 | 12.00 | 3937.0 | 0.014 | |
+ | LINK-32 | 1811.0 | 8.00 | 3937.0 | *0.041 | |
+ | LINK-31 | 1402.0 | 24.00 | 3937.0 | 0.015 | |
+ | LINK-30 | 1570.0 | 8.00 | 3937.0 | *0.037 | |
+ | LINK-29 | 731.0 | 16.00 | 3937.0 | *0.030 | |
+ | LINK-28 | 1382.0 | 16.00 | 3937.0 | *0.034 | |
+ | LINK-27 | 928.0 | 8.00 | 3937.0 | 0.015 | |
+ | LINK-26 | 69.0 | 8.00 | 3937.0 | 0.000 | |
+ | LINK-24 | 50.0 | 8.00 | 3937.0 | 0.000 | |
+ | LINK-23 | 2089.0 | 8.00 | 3937.0 | 0.018 | |
+ | LINK-22 | 332.0 | 8.00 | 3937.0 | *0.046 | |
+
+
+ | LINK-21 | 671.0 | 8.00 | 3937.0 | *0.044 | |
+ | LINK-20 | 597.0 | 8.00 | 3937.0 | 0.015 | |
+ | LINK-19 | 51.0 | 30.00 | 3937.0 | *0.020 | |
+ | LINK-18 | 320.0 | 30.00 | 3937.0 | *0.020 | |
+ | LINK-17 | 124.0 | 12.00 | 3937.0 | 0.018 | |
+ | LINK-16 | 409.0 | 8.00 | 3937.0 | *0.072 | |
+ | LINK-15 | 125.0 | 16.00 | 3937.0 | 0.019 | |
+ | LINK-13 | 56.0 | 8.00 | 3937.0 | *0.127 | |
+ | LINK-12 | 837.0 | 8.00 | 3937.0 | *0.032 | |
+ | LINK-11 | 308.0 | 8.00 | 3937.0 | *0.033 | |
+ | LINK-10 | 377.0 | 8.00 | 3937.0 | *0.030 | |
+ | LINK-9 | 396.0 | 8.00 | 3937.0 | *0.033 | |
+ | LINK-8 | 502.0 | 8.00 | 3937.0 | 0.015 | |
+ | LINK-7 | 238.0 | 8.00 | 3937.0 | *0.042 | |
+ | LINK-6 | 574.0 | 8.00 | 3937.0 | 0.000 | |
+ | LINK-3 | 697.0 | 8.00 | 3937.0 | *0.046 | |
+ | LINK-2 | 324.0 | 8.00 | 3937.0 | *0.034 | |
+ | LINK-1 | 359.0 | 8.00 | 3937.0 | *0.031 | |
+ | LINK-169 | 4700.0 | 10.12 | 3937.0 | 0.017 | |
+ | LINK-167 | 84.0 | 8.00 | 3937.0 | 0.017 | |
+ | LINK-166 | 169.0 | 11.97 | 3937.0 | 0.017 | |
+ | LINK-165 | 559.0 | 16.00 | 3937.0 | 0.015 | |
+ | LINK-164 | 930.0 | 12.00 | 3937.0 | 0.014 | |
+ | LINK-162 | 315.0 | 10.00 | 3937.0 | *0.022 | |
+ | LINK-161 | 718.0 | 10.00 | 3937.0 | *0.037 | |
+ | LINK-160 | 1214.0 | 8.00 | 3937.0 | *0.039 | |
+ | LINK-159 | 784.0 | 8.00 | 3937.0 | *0.037 | |
+ | LINK-158 | 620.0 | 8.00 | 3937.0 | *0.033 | |
+ | LINK-157 | 152.0 | 8.00 | 3937.0 | *0.039 | |
+ | LINK-156 | 812.0 | 8.00 | 3937.0 | *0.030 | |
+ | LINK-155 | 148.0 | 8.00 | 3937.0 | 0.000 | |
+ | LINK-154 | 597.0 | 8.00 | 3937.0 | *0.036 | |
+ | LINK-153 | 285.0 | 8.00 | 3937.0 | *0.028 | |
+ | LINK-152 | 122.0 | 8.00 | 3937.0 | *0.032 | |
+ | LINK-151 | 489.0 | 8.00 | 3937.0 | *0.030 | |
+ | LINK-150 | 1432.0 | 8.00 | 3937.0 | *0.034 | |
+ | LINK-149 | 332.0 | 8.00 | 3937.0 | *0.031 | |
+ | LINK-148 | 177.0 | 8.00 | 3937.0 | *0.028 | |
+ | LINK-147 | 1805.0 | 8.00 | 3937.0 | *0.032 | |
+ | LINK-146 | 157.0 | 8.00 | 3937.0 | *0.028 | |
+ | LINK-145 | 331.0 | 8.00 | 3937.0 | *0.031 | |
+ | LINK-144 | 143.0 | 8.00 | 3937.0 | *0.120 | |
+ | LINK-143 | 403.0 | 10.00 | 3937.0 | *0.024 | |
+ | LINK-142 | 167.0 | 10.00 | 3937.0 | *0.027 | |
+ | LINK-141 | 178.0 | 10.00 | 3937.0 | *0.029 | |
+ | LINK-140 | 464.0 | 10.00 | 3937.0 | *0.029 | |
+ | LINK-139 | 926.0 | 8.00 | 3937.0 | *0.034 | |
+ | LINK-138 | 191.0 | 10.00 | 3937.0 | *0.031 | |
+ | LINK-137 | 250.0 | 10.00 | 3937.0 | *0.023 | |
+ | LINK-136 | 195.0 | 8.00 | 3937.0 | *0.024 | |
+ | LINK-135 | 507.0 | 8.00 | 3937.0 | *0.038 | |
+ | LINK-134 | 341.0 | 8.00 | 3937.0 | *0.356 | |
+ | LINK-133 | 456.0 | 8.00 | 3937.0 | *0.035 | |
+ | LINK-132 | 174.0 | 8.00 | 3937.0 | *0.034 | |
+ | LINK-131 | 1586.0 | 8.00 | 3937.0 | *0.029 | |
+ | LINK-130 | 152.0 | 8.00 | 3937.0 | *0.031 | |
+ | LINK-129 | 430.0 | 8.00 | 3937.0 | *0.026 | |
+ | LINK-128 | 205.0 | 8.00 | 3937.0 | 0.015 | |
+ | LINK-127 | 372.0 | 8.00 | 3937.0 | *0.039 | |
+ | LINK-126 | 895.0 | 8.00 | 3937.0 | *0.034 | |
+
+
+ | LINK-125 | 60.0 | 10.00 | 3937.0 | *0.079 | |
+ | LINK-124 | 333.0 | 10.00 | 3937.0 | *0.133 | |
+ | LINK-123 | 195.0 | 10.00 | 3937.0 | *0.030 | |
+ | LINK-122 | 169.0 | 8.00 | 3937.0 | 0.000 | |
+ | LINK-121 | 167.0 | 8.00 | 3937.0 | *0.043 | |
+ | LINK-120 | 655.0 | 10.00 | 3937.0 | *0.029 | |
+ | LINK-119 | 417.0 | 8.00 | 3937.0 | *0.034 | |
+ | LINK-118 | 772.0 | 8.00 | 3937.0 | *0.039 | |
+ | LINK-117 | 336.0 | 8.00 | 3937.0 | *0.033 | |
+ | LINK-116 | 928.0 | 8.00 | 3937.0 | *0.036 | |
+ | LINK-115 | 127.0 | 8.00 | 3937.0 | 0.015 | |
+ | LINK-114 | 169.0 | 8.00 | 3937.0 | 0.000 | |
+ | LINK-113 | 938.0 | 10.00 | 3937.0 | *0.031 | |
+ | LINK-112 | 528.0 | 8.00 | 3937.0 | *0.036 | |
+ | LINK-111 | 695.0 | 8.00 | 3937.0 | *0.039 | |
+ | LINK-110 | 231.0 | 8.00 | 3937.0 | *0.029 | |
+ | LINK-109 | 1095.0 | 10.00 | 3937.0 | *0.027 | |
+ | LINK-108 | 713.0 | 8.00 | 3937.0 | *0.031 | |
+ | LINK-107 | 199.0 | 8.00 | 3937.0 | *0.030 | |
+ | LINK-106 | 872.0 | 8.00 | 3937.0 | *0.042 | |
+ | LINK-105 | 381.0 | 10.00 | 3937.0 | *0.027 | |
+ | LINK-104 | 398.0 | 8.00 | 3937.0 | *0.048 | |
+ | LINK-103 | 209.0 | 8.00 | 3937.0 | *0.034 | |
+ | LINK-102 | 420.0 | 8.00 | 3937.0 | *0.048 | |
+ | LINK-101 | 65.0 | 8.00 | 3937.0 | *0.025 | |
+ | LINK-100 | 300.0 | 8.00 | 3937.0 | *0.039 | |
+ | LINK-99 | 134.0 | 8.00 | 3937.0 | *0.031 | |
+ | LINK-42 | 2125.0 | 20.00 | 3937.0 | *0.032 | |
+ | LINK-0 | 7401.0 | 20.50 | 3937.0 | *0.032 | |
+ | LINK-41 | 3227.0 | 16.00 | 3937.0 | *0.030 | |
+ | LINK-14 | 599.0 | 8.00 | 3937.0 | *0.024 | |
+ | LINK-25 | 57.0 | 8.00 | 3937.0 | 0.000 | |
+ | LINK-168 | 291.0 | 12.00 | 3937.0 | 0.014 | |
+ | LINK-163 | 76.0 | 10.00 | 3937.0 | 0.000 | |
+ | LINK-34 | 2433.0 | 12.00 | 3937.0 | 0.014 | |
+ -----------------------------------------------------------------------------------------
+ * Darcy-Weisbach friction coefficient exceeds 0.020
+
+
+
+ *** INITIAL PIPE CONDITIONS ***
+
+ -------------------------------------------------------------------------------------
+ | FROM | HEAD | TO | HEAD | FLOW | VEL |
+ | NODE | (ft) | NODE | (ft) | (cfs) | (ft/s) |
+ -------------------------------------------------------------------------------------
+ | | | | | | |
+ | JUNCTION-109| 424.9 | PUMP-172 | 424.9 | 2.4 | 0.0 |
+ | PUMP-172 | 868.5 | JUNCTION-110| 868.5 | 2.4 | 0.0 |
+ | JUNCTION-105| 858.8 | PUMP-170 | 858.8 | 2.9 | 0.1 |
+ | PUMP-170 | 1158.0 | JUNCTION-106| 1158.0 | 2.9 | 0.1 |
+ | JUNCTION-62 | 867.0 | JUNCTION-63 | 867.0 | 0.0 | 0.0 |
+ | JUNCTION-61 | 867.0 | JUNCTION-62 | 867.0 | 0.0 | 0.1 |
+ | JUNCTION-60 | 867.0 | JUNCTION-61 | 867.0 | 0.0 | 0.1 |
+ | JUNCTION-60 | 867.0 | JUNCTION-59 | 867.0 | 0.0 | -0.1 |
+ | JUNCTION-59 | 867.0 | JUNCTION-60 | 867.0 | 0.0 | 0.0 |
+ | JUNCTION-58 | 867.0 | JUNCTION-59 | 867.0 | 0.0 | 0.1 |
+ | JUNCTION-31 | 867.1 | JUNCTION-58 | 867.0 | 0.3 | 0.5 |
+ | JUNCTION-57 | 867.0 | JUNCTION-33 | 867.0 | 0.0 | 0.1 |
+ | JUNCTION-32 | 867.0 | JUNCTION-57 | 867.0 | 0.1 | 0.2 |
+
+
+ | JUNCTION-55 | 867.1 | JUNCTION-56 | 867.1 | 0.0 | -0.1 |
+ | JUNCTION-55 | 867.1 | JUNCTION-54 | 867.1 | 0.0 | 0.1 |
+ | JUNCTION-56 | 867.1 | JUNCTION-55 | 867.1 | 0.0 | 0.1 |
+ | JUNCTION-53 | 867.1 | JUNCTION-56 | 867.1 | 0.1 | 0.1 |
+ | JUNCTION-54 | 867.1 | JUNCTION-31 | 867.1 | 0.1 | 0.3 |
+ | JUNCTION-53 | 867.1 | JUNCTION-54 | 867.1 | 0.1 | 0.2 |
+ | JUNCTION-23 | 867.2 | JUNCTION-53 | 867.1 | 0.2 | 0.3 |
+ | JUNCTION-52 | 864.6 | JUNCTION-50 | 864.6 | 0.0 | 0.0 |
+ | JUNCTION-52 | 864.6 | JUNCTION-47 | 864.6 | 0.0 | 0.1 |
+ | JUNCTION-51 | 864.6 | JUNCTION-52 | 864.6 | 0.0 | 0.1 |
+ | JUNCTION-51 | 864.6 | JUNCTION-48 | 864.6 | 0.0 | -0.1 |
+ | JUNCTION-50 | 864.6 | JUNCTION-51 | 864.6 | 0.0 | 0.0 |
+ | JUNCTION-49 | 864.6 | JUNCTION-50 | 864.6 | 0.0 | 0.1 |
+ | JUNCTION-49 | 864.6 | JUNCTION-22 | 864.6 | -0.1 | -0.3 |
+ | JUNCTION-48 | 864.6 | JUNCTION-49 | 864.6 | 0.0 | -0.1 |
+ | JUNCTION-47 | 864.6 | JUNCTION-48 | 864.6 | 0.0 | -0.1 |
+ | JUNCTION-21 | 864.6 | JUNCTION-47 | 864.6 | -0.1 | -0.1 |
+ | JUNCTION-29 | 859.4 | TANK-130 | 859.1 | 10.7 | 3.4 |
+ | JUNCTION-44 | 863.0 | JUNCTION-28 | 862.5 | 0.4 | 1.2 |
+ | JUNCTION-44 | 863.0 | JUNCTION-26 | 862.9 | 0.2 | 0.5 |
+ | JUNCTION-43 | 863.5 | JUNCTION-44 | 863.0 | 0.6 | 1.7 |
+ | JUNCTION-43 | 863.5 | JUNCTION-25 | 863.6 | -0.2 | -0.5 |
+ | JUNCTION-24 | 864.0 | JUNCTION-43 | 863.5 | 0.4 | 1.2 |
+ | JUNCTION-42 | 863.9 | JUNCTION-27 | 862.8 | 0.3 | 0.9 |
+ | JUNCTION-42 | 863.9 | JUNCTION-41 | 863.9 | -0.2 | -0.5 |
+ | JUNCTION-40 | 863.9 | JUNCTION-42 | 863.8 | 0.2 | 0.5 |
+ | JUNCTION-40 | 863.9 | JUNCTION-41 | 863.9 | 0.0 | 0.0 |
+ | JUNCTION-39 | 864.1 | JUNCTION-40 | 863.9 | 0.2 | 0.5 |
+ | JUNCTION-37 | 864.3 | JUNCTION-39 | 864.1 | 0.4 | 1.1 |
+ | JUNCTION-35 | 864.3 | JUNCTION-38 | 864.3 | 0.0 | 0.0 |
+ | JUNCTION-37 | 864.3 | JUNCTION-20 | 864.5 | -0.2 | -0.7 |
+ | JUNCTION-35 | 864.3 | JUNCTION-37 | 864.3 | 0.2 | 0.4 |
+ | JUNCTION-35 | 864.3 | JUNCTION-36 | 864.3 | 0.0 | 0.0 |
+ | JUNCTION-19 | 864.5 | JUNCTION-35 | 864.3 | 0.2 | 0.5 |
+ | JUNCTION-33 | 867.0 | JUNCTION-57 | 867.0 | 0.0 | -0.1 |
+ | JUNCTION-32 | 867.0 | JUNCTION-33 | 867.0 | 0.2 | 0.3 |
+ | JUNCTION-31 | 867.1 | JUNCTION-32 | 867.0 | 0.3 | 0.4 |
+ | JUNCTION-30 | 867.2 | JUNCTION-31 | 867.1 | 0.4 | 0.5 |
+ | JUNCTION-27 | 862.8 | JUNCTION-28 | 862.5 | 13.2 | 4.2 |
+ | JUNCTION-26 | 862.9 | JUNCTION-27 | 862.8 | 12.9 | 4.1 |
+ | JUNCTION-25 | 863.6 | JUNCTION-26 | 862.9 | 12.7 | 4.1 |
+ | JUNCTION-24 | 864.0 | JUNCTION-25 | 863.6 | 12.9 | 4.1 |
+ | JUNCTION-22 | 864.6 | JUNCTION-24 | 864.0 | 13.4 | 4.3 |
+ | JUNCTION-23 | 867.2 | JUNCTION-30 | 867.2 | -1.6 | -0.5 |
+ | JUNCTION-22 | 864.6 | JUNCTION-23 | 867.2 | -14.1 | -4.5 |
+ | JUNCTION-21 | 864.6 | JUNCTION-22 | 864.6 | -0.6 | -0.3 |
+ | JUNCTION-19 | 864.5 | JUNCTION-20 | 864.5 | -0.3 | -0.1 |
+ | JUNCTION-20 | 864.5 | JUNCTION-21 | 864.5 | -0.6 | -0.3 |
+ | VALVE-176 | 864.5 | JUNCTION-17 | 864.5 | 0.1 | 0.1 |
+ | JUNCTION-11 | 864.5 | JUNCTION-10 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-2 | 864.5 | JUNCTION-3 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-41 | 863.9 | JUNCTION-39 | 864.1 | -0.2 | -0.5 |
+ | JUNCTION-34 | 868.2 | JUNCTION-30 | 867.2 | 2.4 | 0.8 |
+ | JUNCTION-23 | 867.2 | VALVE-179 | 968.2 | -12.6 | -16.1 |
+ | JUNCTION-45 | 1155.8 | JUNCTION-46 | 1155.8 | 0.0 | 0.0 |
+ | JUNCTION-29 | 859.4 | JUNCTION-28 | 862.5 | -13.6 | -4.3 |
+ | JUNCTION-0 | 864.5 | JUNCTION-4 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-18 | 864.5 | VALVE-175 | 864.5 | -0.1 | -0.1 |
+ | JUNCTION-17 | 864.5 | JUNCTION-18 | 864.5 | -0.1 | 0.0 |
+ | JUNCTION-14 | 864.5 | JUNCTION-16 | 864.5 | 0.0 | 0.0 |
+
+
+ | VALVE-173 | 864.5 | JUNCTION-14 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-15 | 864.5 | JUNCTION-3 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-5 | 864.5 | JUNCTION-15 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-14 | 864.5 | JUNCTION-12 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-12 | 864.5 | JUNCTION-11 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-12 | 864.5 | JUNCTION-13 | 864.5 | 0.0 | 0.0 |
+ | RESERVOIR-129| 425.0 | JUNCTION-128| 425.0 | 2.4 | 0.5 |
+ | JUNCTION-128| 425.0 | JUNCTION-1 | 425.0 | 2.4 | 0.5 |
+ | JUNCTION-110| 868.5 | JUNCTION-34 | 868.2 | 2.4 | 3.1 |
+ | JUNCTION-10 | 864.5 | JUNCTION-11 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-1 | 425.0 | JUNCTION-109| 424.9 | 2.4 | 1.7 |
+ | JUNCTION-2 | 864.5 | VALVE-174 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-9 | 864.5 | JUNCTION-8 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-18 | 864.5 | JUNCTION-9 | 864.5 | 0.0 | 0.1 |
+ | JUNCTION-9 | 864.5 | JUNCTION-8 | 864.5 | 0.0 | 0.1 |
+ | JUNCTION-8 | 864.5 | JUNCTION-6 | 864.5 | 0.0 | 0.1 |
+ | JUNCTION-6 | 864.5 | JUNCTION-7 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-5 | 864.5 | JUNCTION-6 | 864.5 | 0.0 | -0.1 |
+ | JUNCTION-5 | 864.5 | JUNCTION-4 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-3 | 864.5 | JUNCTION-4 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-0 | 864.5 | JUNCTION-2 | 864.5 | 0.0 | 0.1 |
+ | JUNCTION-17 | 864.5 | JUNCTION-0 | 864.5 | 0.0 | 0.1 |
+ | JUNCTION-103| 1117.4 | JUNCTION-104| 1155.8 | -2.8 | -5.1 |
+ | JUNCTION-106| 1158.0 | JUNCTION-104| 1155.8 | 2.9 | 8.3 |
+ | JUNCTION-29 | 859.4 | JUNCTION-105| 858.8 | 2.9 | 3.7 |
+ | JUNCTION-102| 1149.9 | TANK-131 | 1155.0 | -10.3 | -7.3 |
+ | JUNCTION-103| 1117.4 | JUNCTION-102| 1149.9 | -9.9 | -12.6 |
+ | JUNCTION-46 | 1155.8 | VALVE-177 | 1155.8 | 0.0 | -0.1 |
+ | JUNCTION-45 | 1155.8 | JUNCTION-46 | 1155.8 | 0.0 | 0.0 |
+ | JUNCTION-97 | 866.9 | JUNCTION-71 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-98 | 866.9 | JUNCTION-99 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-100| 866.9 | JUNCTION-101| 866.9 | 0.0 | 0.0 |
+ | JUNCTION-101| 866.9 | JUNCTION-98 | 866.9 | 0.0 | -0.1 |
+ | JUNCTION-100| 866.9 | JUNCTION-101| 866.9 | 0.0 | 0.0 |
+ | JUNCTION-99 | 866.9 | JUNCTION-100| 866.9 | 0.0 | 0.0 |
+ | JUNCTION-98 | 866.9 | JUNCTION-99 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-97 | 866.9 | JUNCTION-98 | 866.9 | 0.1 | 0.2 |
+ | JUNCTION-97 | 866.9 | JUNCTION-96 | 866.9 | 0.0 | -0.1 |
+ | JUNCTION-91 | 867.0 | JUNCTION-97 | 866.9 | 0.0 | 0.1 |
+ | JUNCTION-96 | 866.9 | JUNCTION-95 | 866.9 | 0.0 | -0.1 |
+ | JUNCTION-95 | 867.0 | JUNCTION-96 | 866.9 | 0.0 | 0.1 |
+ | JUNCTION-92 | 867.0 | JUNCTION-95 | 867.0 | 0.1 | 0.2 |
+ | JUNCTION-93 | 867.0 | JUNCTION-94 | 867.0 | 0.0 | 0.0 |
+ | JUNCTION-94 | 867.0 | JUNCTION-92 | 867.0 | -0.1 | -0.2 |
+ | JUNCTION-93 | 867.0 | JUNCTION-94 | 867.0 | 0.0 | -0.1 |
+ | JUNCTION-90 | 867.0 | JUNCTION-93 | 867.0 | 0.0 | 0.0 |
+ | JUNCTION-92 | 867.0 | JUNCTION-33 | 867.0 | -0.3 | -0.5 |
+ | JUNCTION-91 | 867.0 | JUNCTION-92 | 867.0 | -0.1 | -0.2 |
+ | JUNCTION-90 | 867.0 | JUNCTION-91 | 867.0 | -0.1 | -0.1 |
+ | JUNCTION-89 | 866.9 | JUNCTION-90 | 866.9 | -0.1 | -0.1 |
+ | JUNCTION-89 | 866.9 | JUNCTION-86 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-88 | 866.9 | JUNCTION-89 | 866.9 | 0.0 | -0.1 |
+ | JUNCTION-88 | 866.9 | JUNCTION-79 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-87 | 866.9 | JUNCTION-88 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-87 | 866.9 | JUNCTION-85 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-86 | 866.9 | JUNCTION-87 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-85 | 866.9 | JUNCTION-86 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-82 | 866.9 | JUNCTION-85 | 866.9 | 0.0 | -0.1 |
+ | JUNCTION-84 | 866.9 | JUNCTION-83 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-84 | 866.9 | JUNCTION-81 | 866.9 | 0.0 | -0.1 |
+
+
+ | JUNCTION-83 | 866.9 | JUNCTION-84 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-82 | 866.9 | JUNCTION-83 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-80 | 866.9 | JUNCTION-82 | 866.9 | 0.0 | 0.1 |
+ | JUNCTION-78 | 866.9 | JUNCTION-71 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-81 | 866.9 | JUNCTION-77 | 866.9 | 0.0 | -0.1 |
+ | JUNCTION-80 | 866.9 | JUNCTION-81 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-79 | 866.9 | JUNCTION-80 | 866.9 | 0.0 | 0.1 |
+ | JUNCTION-78 | 866.9 | JUNCTION-79 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-76 | 866.9 | JUNCTION-78 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-77 | 866.9 | JUNCTION-73 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-76 | 866.9 | JUNCTION-77 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-75 | 866.9 | JUNCTION-76 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-75 | 866.9 | JUNCTION-74 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-72 | 866.9 | JUNCTION-75 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-74 | 866.9 | JUNCTION-73 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-72 | 866.9 | JUNCTION-74 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-73 | 866.9 | JUNCTION-69 | 867.0 | 0.0 | -0.1 |
+ | JUNCTION-70 | 866.9 | JUNCTION-72 | 866.9 | 0.0 | 0.1 |
+ | JUNCTION-70 | 866.9 | JUNCTION-71 | 866.9 | 0.0 | 0.0 |
+ | JUNCTION-69 | 867.0 | JUNCTION-70 | 866.9 | 0.1 | 0.1 |
+ | JUNCTION-68 | 867.0 | JUNCTION-69 | 866.9 | 0.1 | 0.2 |
+ | JUNCTION-63 | 867.0 | JUNCTION-62 | 867.0 | 0.0 | 0.0 |
+ | JUNCTION-65 | 867.0 | JUNCTION-68 | 867.0 | 0.0 | 0.1 |
+ | JUNCTION-64 | 867.0 | JUNCTION-65 | 867.0 | 0.0 | 0.0 |
+ | JUNCTION-68 | 867.0 | JUNCTION-58 | 867.0 | -0.1 | -0.2 |
+ | JUNCTION-66 | 867.0 | JUNCTION-67 | 867.0 | 0.0 | 0.0 |
+ | JUNCTION-67 | 867.0 | JUNCTION-61 | 867.0 | 0.0 | -0.1 |
+ | JUNCTION-66 | 867.0 | JUNCTION-67 | 867.0 | 0.0 | 0.0 |
+ | JUNCTION-65 | 867.0 | JUNCTION-66 | 867.0 | 0.0 | -0.1 |
+ | JUNCTION-64 | 867.0 | JUNCTION-65 | 867.0 | 0.0 | 0.0 |
+ | JUNCTION-63 | 867.0 | JUNCTION-64 | 867.0 | 0.0 | 0.1 |
+ | JUNCTION-19 | 864.5 | VALVE-180 | 864.5 | 0.1 | 0.0 |
+ | VALVE-180 | 864.5 | VALVE-176 | 864.5 | 0.1 | 0.0 |
+ | JUNCTION-20 | 864.5 | VALVE-175 | 864.5 | 0.1 | 0.1 |
+ | VALVE-174 | 864.5 | JUNCTION-10 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-15 | 864.5 | VALVE-173 | 864.5 | 0.0 | 0.0 |
+ | JUNCTION-103| 1117.4 | VALVE-178 | 1101.4 | 12.6 | 16.1 |
+ | VALVE-177 | 1155.8 | JUNCTION-104| 1155.8 | 0.0 | -0.1 |
+ | VALVE-178 | 1101.4 | VALVE-179 | 968.2 | 12.6 | 16.1 |
+ -------------------------------------------------------------------------------------
+
+ -----------------------------------
+ | HAMMER Engine 08.11.06.113 |
+ -------------------------------------------------------------------------------
+ Based on Technology Originally Developed by GENIVAR(EHG). Compiled by IVF.
+ Copyright (C) 2011 Bentley Systems, Incorporated. All Rights Reserved.
+ -------------------------------------------------------------------------------
+
+
+ *** List of end points with possible discrepancies in input values ***
+
+ NOTE: End points where initial surges generated are included.
+
+ PUMP-172-A:PUMP-172
+ PUMP-172-B:PUMP-172
+ LINK-33:VALVE-179
+ LINK-168:VALVE-178
+ LINK-34:VALVE-178
+ LINK-34:VALVE-179
+
+ Check valve at node "PUMP-172" closes in 0.46 seconds.
+
+
+
+
+ LEVELS ARE IN INPUT UNITS : FT OR M
+
+ EXTREME LEVELS IN SURGE TANK AT NODE "TANK-131" ARE AS FOLLOWS:
+
+ MAXIMUM LEVEL IN SURGE TANK ABOVE PIPE = 17.95
+
+ MINIMUM LEVEL IN SURGE TANK ABOVE PIPE = 17.92
+
+
+
+
+
+
+ LEVELS ARE IN INPUT UNITS : FT OR M
+
+ EXTREME LEVELS IN SURGE TANK AT NODE "TANK-130" ARE AS FOLLOWS:
+
+ MAXIMUM LEVEL IN SURGE TANK ABOVE PIPE = 15.16
+
+ MINIMUM LEVEL IN SURGE TANK ABOVE PIPE = 15.16
+
+
+
+ -----------------------------------
+ | HAMMER Engine 08.11.06.113 |
+ -------------------------------------------------------------------------------
+ Based on Technology Originally Developed by GENIVAR(EHG). Compiled by IVF.
+ Copyright (C) 2011 Bentley Systems, Incorporated. All Rights Reserved.
+ -------------------------------------------------------------------------------
+
+
+ *** LIST OF SORTED VAPOUR AND AIR POCKETS ***
+
+
+ No vapour/air pockets were formed.
+
+
+
+ -----------------------------------
+ | HAMMER Engine 08.11.06.113 |
+ -------------------------------------------------------------------------------
+ Based on Technology Originally Developed by GENIVAR(EHG). Compiled by IVF.
+ Copyright (C) 2011 Bentley Systems, Incorporated. All Rights Reserved.
+ -------------------------------------------------------------------------------
+
+
+ *** SUMMARY FOR Default Project-Base-BWSN_Network_1.wtg.sqlite. ***
+
+ --------------------------------------------------------------------------------
+ | END | MAX. PRESS. | MIN. PRESS. | MAX. HEAD | MIN. HEAD |
+ | POINT | (ftH) | (ftH) | (ft) | (ft) |
+ --------------------------------------------------------------------------------
+ | | | | | |
+ | PUMP-172-A:JUNCTION-109| 475.4 | 374.4 | 475.4 | 374.4 |
+ | PUMP-172-A:PUMP-172| 475.4 | 374.4 | 475.4 | 374.4 |
+ | PUMP-172-B:PUMP-172| 938.2 | 769.2 | 938.2 | 769.2 |
+ | PUMP-172-B:JUNCTION-110| 938.3 | 769.2 | 938.3 | 769.2 |
+ | PUMP-170-A:JUNCTION-105| 866.5 | 846.7 | 866.5 | 846.7 |
+ | PUMP-170-A:PUMP-170| 866.5 | 846.8 | 866.5 | 846.8 |
+ | PUMP-170-B:PUMP-170| 1165.2 | 1145.1 | 1165.2 | 1145.1 |
+ | PUMP-170-B:JUNCTION-106| 1165.2 | 1145.0 | 1165.2 | 1145.0 |
+ | LINK-98:JUNCTION-62| 332.2 | 164.9 | 957.6 | 790.3 |
+ | LINK-98:JUNCTION-63| 333.6 | 165.6 | 957.5 | 789.6 |
+ | LINK-97:JUNCTION-61| 331.5 | 167.5 | 956.8 | 792.9 |
+ | LINK-97:JUNCTION-62| 332.2 | 164.9 | 957.6 | 790.3 |
+ | LINK-96:JUNCTION-60| 331.9 | 170.2 | 955.9 | 794.2 |
+ | LINK-96:JUNCTION-61| 331.5 | 167.5 | 956.8 | 792.9 |
+ | LINK-95:JUNCTION-60| 331.9 | 170.2 | 955.9 | 794.2 |
+ | LINK-95:JUNCTION-59| 332.4 | 173.8 | 953.4 | 794.8 |
+ | LINK-94:JUNCTION-59| 332.4 | 173.8 | 953.4 | 794.8 |
+ | LINK-94:JUNCTION-60| 331.9 | 170.2 | 955.9 | 794.2 |
+ | LINK-93:JUNCTION-58| 333.1 | 188.0 | 943.3 | 798.2 |
+ | LINK-93:JUNCTION-59| 332.4 | 173.8 | 953.4 | 794.8 |
+ | LINK-92:JUNCTION-31| 314.0 | 193.0 | 914.4 | 793.4 |
+ | LINK-92:JUNCTION-58| 333.1 | 188.0 | 943.3 | 798.2 |
+ | LINK-91:JUNCTION-57| 324.9 | 154.0 | 942.8 | 771.9 |
+ | LINK-91:JUNCTION-33| 317.4 | 148.9 | 940.2 | 771.6 |
+ | LINK-90:JUNCTION-32| 314.2 | 156.0 | 940.0 | 781.9 |
+ | LINK-90:JUNCTION-57| 324.9 | 154.0 | 942.8 | 771.9 |
+ | LINK-89:JUNCTION-55| 309.2 | 170.7 | 912.6 | 774.0 |
+ | LINK-89:JUNCTION-56| 303.4 | 165.0 | 910.3 | 772.0 |
+ | LINK-88:JUNCTION-55| 309.2 | 170.7 | 912.6 | 774.0 |
+ | LINK-88:JUNCTION-54| 309.3 | 182.4 | 911.4 | 784.5 |
+ | LINK-87:JUNCTION-56| 303.4 | 165.0 | 910.3 | 772.0 |
+ | LINK-87:JUNCTION-55| 309.2 | 170.7 | 912.6 | 774.0 |
+ | LINK-86:JUNCTION-53| 300.2 | 172.4 | 907.8 | 780.0 |
+ | LINK-86:JUNCTION-56| 303.4 | 165.0 | 910.3 | 772.0 |
+ | LINK-85:JUNCTION-54| 309.3 | 182.4 | 911.4 | 784.5 |
+ | LINK-85:JUNCTION-31| 314.0 | 193.0 | 914.4 | 793.4 |
+ | LINK-84:JUNCTION-53| 300.2 | 172.4 | 907.8 | 780.0 |
+ | LINK-84:JUNCTION-54| 309.3 | 182.4 | 911.4 | 784.5 |
+ | LINK-83:JUNCTION-23| 292.7 | 197.0 | 897.0 | 801.4 |
+ | LINK-83:JUNCTION-53| 300.2 | 172.4 | 907.8 | 780.0 |
+ | LINK-82:JUNCTION-52| 288.5 | 181.9 | 901.8 | 795.2 |
+ | LINK-82:JUNCTION-50| 292.3 | 180.9 | 903.4 | 792.0 |
+
+ | LINK-81:JUNCTION-52| 288.5 | 181.9 | 901.8 | 795.2 |
+ | LINK-81:JUNCTION-47| 258.3 | 165.6 | 898.7 | 806.1 |
+ | LINK-80:JUNCTION-51| 277.8 | 171.3 | 901.5 | 795.0 |
+ | LINK-80:JUNCTION-52| 288.5 | 181.9 | 901.8 | 795.2 |
+ | LINK-79:JUNCTION-51| 277.8 | 171.3 | 901.5 | 795.0 |
+ | LINK-79:JUNCTION-48| 262.7 | 160.5 | 900.2 | 798.0 |
+ | LINK-78:JUNCTION-50| 292.3 | 180.9 | 903.4 | 792.0 |
+ | LINK-78:JUNCTION-51| 277.8 | 171.3 | 901.5 | 795.0 |
+ | LINK-77:JUNCTION-49| 274.5 | 181.6 | 898.4 | 805.5 |
+ | LINK-77:JUNCTION-50| 292.3 | 180.9 | 903.4 | 792.0 |
+ | LINK-76:JUNCTION-49| 274.5 | 181.6 | 898.4 | 805.5 |
+ | LINK-76:JUNCTION-22| 269.0 | 187.2 | 895.0 | 813.2 |
+ | LINK-75:JUNCTION-48| 262.7 | 160.5 | 900.2 | 798.0 |
+ | LINK-75:JUNCTION-49| 274.5 | 181.6 | 898.4 | 805.5 |
+ | LINK-74:JUNCTION-47| 258.3 | 165.6 | 898.7 | 806.1 |
+ | LINK-74:JUNCTION-48| 262.7 | 160.5 | 900.2 | 798.0 |
+ | LINK-73:JUNCTION-21| 245.2 | 156.4 | 897.6 | 808.8 |
+ | LINK-73:JUNCTION-47| 258.3 | 165.6 | 898.7 | 806.1 |
+ | LINK-72:JUNCTION-29| 17.5 | 4.5 | 863.7 | 850.8 |
+ | LINK-72:TANK-130 | 15.2 | 15.2 | 859.1 | 859.1 |
+ | LINK-71:JUNCTION-44| 210.4 | 135.7 | 888.9 | 814.2 |
+ | LINK-71:JUNCTION-28| 182.4 | 116.1 | 884.1 | 817.8 |
+ | LINK-70:JUNCTION-44| 210.4 | 135.7 | 888.9 | 814.2 |
+ | LINK-70:JUNCTION-26| 202.6 | 133.3 | 886.1 | 816.7 |
+ | LINK-69:JUNCTION-43| 237.4 | 162.5 | 890.5 | 815.6 |
+ | LINK-69:JUNCTION-44| 210.4 | 135.7 | 888.9 | 814.2 |
+ | LINK-68:JUNCTION-43| 237.4 | 162.5 | 890.5 | 815.6 |
+ | LINK-68:JUNCTION-25| 235.0 | 162.3 | 888.9 | 816.3 |
+ | LINK-67:JUNCTION-24| 254.4 | 179.2 | 891.0 | 815.9 |
+ | LINK-67:JUNCTION-43| 237.4 | 162.5 | 890.5 | 815.6 |
+ | LINK-66:JUNCTION-42| 198.2 | 78.1 | 926.2 | 806.2 |
+ | LINK-66:JUNCTION-27| 194.7 | 126.4 | 885.4 | 817.0 |
+ | LINK-65:JUNCTION-42| 198.2 | 78.1 | 926.2 | 806.2 |
+ | LINK-65:JUNCTION-41| 227.2 | 109.4 | 927.5 | 809.6 |
+ | LINK-64:JUNCTION-40| 186.1 | 68.1 | 927.7 | 809.7 |
+ | LINK-64:JUNCTION-42| 198.2 | 78.1 | 926.2 | 806.2 |
+ | LINK-63:JUNCTION-40| 186.1 | 68.1 | 927.7 | 809.7 |
+ | LINK-63:JUNCTION-41| 227.2 | 109.4 | 927.5 | 809.6 |
+ | LINK-62:JUNCTION-39| 220.8 | 104.7 | 924.0 | 807.9 |
+ | LINK-62:JUNCTION-40| 186.1 | 68.1 | 927.7 | 809.7 |
+ | LINK-61:JUNCTION-37| 246.2 | 126.7 | 923.3 | 803.8 |
+ | LINK-61:JUNCTION-39| 220.8 | 104.7 | 924.0 | 807.9 |
+ | LINK-60:JUNCTION-35| 276.8 | 146.7 | 928.7 | 798.7 |
+ | LINK-60:JUNCTION-38| 286.7 | 148.1 | 933.2 | 794.6 |
+ | LINK-59:JUNCTION-37| 246.2 | 126.7 | 923.3 | 803.8 |
+ | LINK-59:JUNCTION-20| 296.0 | 188.3 | 913.8 | 806.1 |
+ | LINK-58:JUNCTION-35| 276.8 | 146.7 | 928.7 | 798.7 |
+ | LINK-58:JUNCTION-37| 246.2 | 126.7 | 923.3 | 803.8 |
+ | LINK-57:JUNCTION-35| 276.8 | 146.7 | 928.7 | 798.7 |
+ | LINK-57:JUNCTION-36| 297.8 | 162.1 | 931.9 | 796.2 |
+ | LINK-56:JUNCTION-19| 359.7 | 245.7 | 918.6 | 804.6 |
+ | LINK-56:JUNCTION-35| 276.8 | 146.7 | 928.7 | 798.7 |
+ | LINK-55:JUNCTION-33| 317.4 | 148.9 | 940.2 | 771.6 |
+ | LINK-55:JUNCTION-57| 324.9 | 154.0 | 942.8 | 771.9 |
+ | LINK-54:JUNCTION-32| 314.2 | 156.0 | 940.0 | 781.9 |
+ | LINK-54:JUNCTION-33| 317.4 | 148.9 | 940.2 | 771.6 |
+ | LINK-53:JUNCTION-31| 314.0 | 193.0 | 914.4 | 793.4 |
+ | LINK-53:JUNCTION-32| 314.2 | 156.0 | 940.0 | 781.9 |
+ | LINK-52:JUNCTION-30| 272.3 | 152.3 | 908.3 | 788.3 |
+ | LINK-52:JUNCTION-31| 314.0 | 193.0 | 914.4 | 793.4 |
+
+ | LINK-51:JUNCTION-27| 194.7 | 126.4 | 885.4 | 817.0 |
+ | LINK-51:JUNCTION-28| 182.4 | 116.1 | 884.1 | 817.8 |
+ | LINK-50:JUNCTION-26| 202.6 | 133.3 | 886.1 | 816.7 |
+ | LINK-50:JUNCTION-27| 194.7 | 126.4 | 885.4 | 817.0 |
+ | LINK-49:JUNCTION-25| 235.0 | 162.3 | 888.9 | 816.3 |
+ | LINK-49:JUNCTION-26| 202.6 | 133.3 | 886.1 | 816.7 |
+ | LINK-48:JUNCTION-24| 254.4 | 179.2 | 891.0 | 815.9 |
+ | LINK-48:JUNCTION-25| 235.0 | 162.3 | 888.9 | 816.3 |
+ | LINK-47:JUNCTION-22| 269.0 | 187.2 | 895.0 | 813.2 |
+ | LINK-47:JUNCTION-24| 254.4 | 179.2 | 891.0 | 815.9 |
+ | LINK-46:JUNCTION-23| 292.7 | 197.0 | 897.0 | 801.4 |
+ | LINK-46:JUNCTION-30| 272.3 | 152.3 | 908.3 | 788.3 |
+ | LINK-45:JUNCTION-22| 269.0 | 187.2 | 895.0 | 813.2 |
+ | LINK-45:JUNCTION-23| 292.7 | 197.0 | 897.0 | 801.4 |
+ | LINK-44:JUNCTION-21| 245.2 | 156.4 | 897.6 | 808.8 |
+ | LINK-44:JUNCTION-22| 269.0 | 187.2 | 895.0 | 813.2 |
+ | LINK-43:JUNCTION-19| 359.7 | 245.7 | 918.6 | 804.6 |
+ | LINK-43:JUNCTION-20| 296.0 | 188.3 | 913.8 | 806.1 |
+ | LINK-40:JUNCTION-20| 296.0 | 188.3 | 913.8 | 806.1 |
+ | LINK-40:JUNCTION-21| 245.2 | 156.4 | 897.6 | 808.8 |
+ | LINK-39:VALVE-176| 527.6 | 389.5 | 931.6 | 793.5 |
+ | LINK-39:JUNCTION-17| 567.0 | 415.6 | 952.1 | 800.7 |
+ | LINK-38:JUNCTION-11| 619.2 | 446.5 | 963.3 | 790.6 |
+ | LINK-38:JUNCTION-10| 627.1 | 459.1 | 960.7 | 792.7 |
+ | LINK-37:JUNCTION-2| 589.0 | 441.0 | 952.1 | 804.2 |
+ | LINK-37:JUNCTION-3| 527.3 | 372.3 | 955.4 | 800.4 |
+ | LINK-36:JUNCTION-41| 227.2 | 109.4 | 927.5 | 809.6 |
+ | LINK-36:JUNCTION-39| 220.8 | 104.7 | 924.0 | 807.9 |
+ | LINK-35:JUNCTION-34| 731.3 | 568.9 | 931.3 | 768.9 |
+ | LINK-35:JUNCTION-30| 272.3 | 152.3 | 908.3 | 788.3 |
+ | LINK-33:JUNCTION-23| 292.7 | 197.0 | 897.0 | 801.4 |
+ | LINK-33:VALVE-179| 235.3 | 142.6 | 993.3 | 900.6 |
+ | LINK-32:JUNCTION-45| 426.1 | 397.1 | 1173.4 | 1144.5 |
+ | LINK-32:JUNCTION-46| 349.4 | 326.6 | 1169.6 | 1146.8 |
+ | LINK-31:JUNCTION-29| 17.5 | 4.5 | 863.7 | 850.8 |
+ | LINK-31:JUNCTION-28| 182.4 | 116.1 | 884.1 | 817.8 |
+ | LINK-30:JUNCTION-0| 578.9 | 432.9 | 955.0 | 809.0 |
+ | LINK-30:JUNCTION-4| 483.7 | 327.8 | 961.5 | 805.6 |
+ | LINK-29:JUNCTION-18| 476.2 | 324.6 | 954.3 | 802.8 |
+ | LINK-29:VALVE-175| 414.6 | 270.8 | 947.6 | 803.8 |
+ | LINK-28:JUNCTION-17| 567.0 | 415.6 | 952.1 | 800.7 |
+ | LINK-28:JUNCTION-18| 476.2 | 324.6 | 954.3 | 802.8 |
+ | LINK-27:JUNCTION-14| 539.5 | 380.2 | 956.4 | 797.0 |
+ | LINK-27:JUNCTION-16| 583.4 | 412.3 | 966.4 | 795.3 |
+ | LINK-26:VALVE-173| 537.6 | 380.2 | 955.6 | 798.2 |
+ | LINK-26:JUNCTION-14| 539.5 | 380.2 | 956.4 | 797.0 |
+ | LINK-24:JUNCTION-15| 531.7 | 375.7 | 955.2 | 799.2 |
+ | LINK-24:JUNCTION-3| 527.3 | 372.3 | 955.4 | 800.4 |
+ | LINK-23:JUNCTION-5| 469.7 | 312.1 | 963.9 | 806.4 |
+ | LINK-23:JUNCTION-15| 531.7 | 375.7 | 955.2 | 799.2 |
+ | LINK-22:JUNCTION-14| 539.5 | 380.2 | 956.4 | 797.0 |
+ | LINK-22:JUNCTION-12| 580.0 | 412.6 | 959.5 | 792.1 |
+ | LINK-21:JUNCTION-12| 580.0 | 412.6 | 959.5 | 792.1 |
+ | LINK-21:JUNCTION-11| 619.2 | 446.5 | 963.3 | 790.6 |
+ | LINK-20:JUNCTION-12| 580.0 | 412.6 | 959.5 | 792.1 |
+ | LINK-20:JUNCTION-13| 636.3 | 462.8 | 962.3 | 788.8 |
+ | LINK-19:RESERVOIR-129| 425.0 | 425.0 | 425.0 | 425.0 |
+ | LINK-19:JUNCTION-128| 429.0 | 421.1 | 429.0 | 421.1 |
+ | LINK-18:JUNCTION-128| 429.0 | 421.1 | 429.0 | 421.1 |
+ | LINK-18:JUNCTION-1| 258.8 | 208.1 | 450.8 | 400.1 |
+
+ | LINK-17:JUNCTION-110| 938.3 | 769.2 | 938.3 | 769.2 |
+ | LINK-17:JUNCTION-34| 731.3 | 568.9 | 931.3 | 768.9 |
+ | LINK-16:JUNCTION-10| 627.1 | 459.1 | 960.7 | 792.7 |
+ | LINK-16:JUNCTION-11| 619.2 | 446.5 | 963.3 | 790.6 |
+ | LINK-15:JUNCTION-1| 258.8 | 208.1 | 450.8 | 400.1 |
+ | LINK-15:JUNCTION-109| 475.4 | 374.4 | 475.4 | 374.4 |
+ | LINK-13:JUNCTION-2| 589.0 | 441.0 | 952.1 | 804.2 |
+ | LINK-13:VALVE-174| 592.2 | 444.3 | 951.2 | 803.3 |
+ | LINK-12:JUNCTION-9| 470.3 | 314.0 | 958.6 | 802.3 |
+ | LINK-12:JUNCTION-8| 467.9 | 309.6 | 961.3 | 803.0 |
+ | LINK-11:JUNCTION-18| 476.2 | 324.6 | 954.3 | 802.8 |
+ | LINK-11:JUNCTION-9| 470.3 | 314.0 | 958.6 | 802.3 |
+ | LINK-10:JUNCTION-9| 470.3 | 314.0 | 958.6 | 802.3 |
+ | LINK-10:JUNCTION-8| 467.9 | 309.6 | 961.3 | 803.0 |
+ | LINK-9:JUNCTION-8| 467.9 | 309.6 | 961.3 | 803.0 |
+ | LINK-9:JUNCTION-6| 459.2 | 299.8 | 964.2 | 804.8 |
+ | LINK-8:JUNCTION-6| 459.2 | 299.8 | 964.2 | 804.8 |
+ | LINK-8:JUNCTION-7| 431.3 | 268.6 | 966.5 | 803.8 |
+ | LINK-7:JUNCTION-5| 469.7 | 312.1 | 963.9 | 806.4 |
+ | LINK-7:JUNCTION-6| 459.2 | 299.8 | 964.2 | 804.8 |
+ | LINK-6:JUNCTION-5| 469.7 | 312.1 | 963.9 | 806.4 |
+ | LINK-6:JUNCTION-4| 483.7 | 327.8 | 961.5 | 805.6 |
+ | LINK-3:JUNCTION-3| 527.3 | 372.3 | 955.4 | 800.4 |
+ | LINK-3:JUNCTION-4| 483.7 | 327.8 | 961.5 | 805.6 |
+ | LINK-2:JUNCTION-0| 578.9 | 432.9 | 955.0 | 809.0 |
+ | LINK-2:JUNCTION-2| 589.0 | 441.0 | 952.1 | 804.2 |
+ | LINK-1:JUNCTION-17| 567.0 | 415.6 | 952.1 | 800.7 |
+ | LINK-1:JUNCTION-0| 578.9 | 432.9 | 955.0 | 809.0 |
+ | LINK-169:JUNCTION-103| 106.5 | 51.7 | 1138.2 | 1083.4 |
+ | LINK-169:JUNCTION-104| 303.2 | 285.9 | 1163.9 | 1146.6 |
+ | LINK-167:JUNCTION-106| 1165.2 | 1145.0 | 1165.2 | 1145.0 |
+ | LINK-167:JUNCTION-104| 303.2 | 285.9 | 1163.9 | 1146.6 |
+ | LINK-166:JUNCTION-29| 17.5 | 4.5 | 863.7 | 850.8 |
+ | LINK-166:JUNCTION-105| 866.5 | 846.7 | 866.5 | 846.7 |
+ | LINK-165:JUNCTION-102| 61.2 | 44.0 | 1155.3 | 1138.0 |
+ | LINK-165:TANK-131| 17.9 | 17.9 | 1155.0 | 1155.0 |
+ | LINK-164:JUNCTION-103| 106.5 | 51.7 | 1138.2 | 1083.4 |
+ | LINK-164:JUNCTION-102| 61.2 | 44.0 | 1155.3 | 1138.0 |
+ | LINK-162:JUNCTION-46| 349.4 | 326.6 | 1169.6 | 1146.8 |
+ | LINK-162:VALVE-177| 316.1 | 297.6 | 1165.1 | 1146.6 |
+ | LINK-161:JUNCTION-45| 426.1 | 397.1 | 1173.4 | 1144.5 |
+ | LINK-161:JUNCTION-46| 349.4 | 326.6 | 1169.6 | 1146.8 |
+ | LINK-160:JUNCTION-97| 315.3 | 133.9 | 944.3 | 762.9 |
+ | LINK-160:JUNCTION-71| 314.5 | 144.9 | 946.7 | 777.1 |
+ | LINK-159:JUNCTION-98| 304.2 | 93.1 | 947.3 | 736.1 |
+ | LINK-159:JUNCTION-99| 308.3 | 82.8 | 950.1 | 724.7 |
+ | LINK-158:JUNCTION-100| 312.6 | 85.5 | 950.5 | 723.4 |
+ | LINK-158:JUNCTION-101| 303.9 | 84.5 | 948.9 | 729.6 |
+ | LINK-157:JUNCTION-101| 303.9 | 84.5 | 948.9 | 729.6 |
+ | LINK-157:JUNCTION-98| 304.2 | 93.1 | 947.3 | 736.1 |
+ | LINK-156:JUNCTION-100| 312.6 | 85.5 | 950.5 | 723.4 |
+ | LINK-156:JUNCTION-101| 303.9 | 84.5 | 948.9 | 729.6 |
+ | LINK-155:JUNCTION-99| 308.3 | 82.8 | 950.1 | 724.7 |
+ | LINK-155:JUNCTION-100| 312.6 | 85.5 | 950.5 | 723.4 |
+ | LINK-154:JUNCTION-98| 304.2 | 93.1 | 947.3 | 736.1 |
+ | LINK-154:JUNCTION-99| 308.3 | 82.8 | 950.1 | 724.7 |
+ | LINK-153:JUNCTION-97| 315.3 | 133.9 | 944.3 | 762.9 |
+ | LINK-153:JUNCTION-98| 304.2 | 93.1 | 947.3 | 736.1 |
+ | LINK-152:JUNCTION-97| 315.3 | 133.9 | 944.3 | 762.9 |
+ | LINK-152:JUNCTION-96| 316.3 | 136.9 | 945.4 | 766.0 |
+
+ | LINK-151:JUNCTION-91| 305.6 | 122.7 | 943.0 | 760.1 |
+ | LINK-151:JUNCTION-97| 315.3 | 133.9 | 944.3 | 762.9 |
+ | LINK-150:JUNCTION-96| 316.3 | 136.9 | 945.4 | 766.0 |
+ | LINK-150:JUNCTION-95| 313.3 | 131.5 | 944.1 | 762.4 |
+ | LINK-149:JUNCTION-95| 313.3 | 131.5 | 944.1 | 762.4 |
+ | LINK-149:JUNCTION-96| 316.3 | 136.9 | 945.4 | 766.0 |
+ | LINK-148:JUNCTION-92| 312.5 | 132.6 | 940.7 | 760.8 |
+ | LINK-148:JUNCTION-95| 313.3 | 131.5 | 944.1 | 762.4 |
+ | LINK-147:JUNCTION-93| 301.8 | 108.6 | 945.5 | 752.4 |
+ | LINK-147:JUNCTION-94| 310.0 | 120.5 | 943.5 | 754.0 |
+ | LINK-146:JUNCTION-94| 310.0 | 120.5 | 943.5 | 754.0 |
+ | LINK-146:JUNCTION-92| 312.5 | 132.6 | 940.7 | 760.8 |
+ | LINK-145:JUNCTION-93| 301.8 | 108.6 | 945.5 | 752.4 |
+ | LINK-145:JUNCTION-94| 310.0 | 120.5 | 943.5 | 754.0 |
+ | LINK-144:JUNCTION-90| 301.0 | 113.0 | 945.1 | 757.1 |
+ | LINK-144:JUNCTION-93| 301.8 | 108.6 | 945.5 | 752.4 |
+ | LINK-143:JUNCTION-92| 312.5 | 132.6 | 940.7 | 760.8 |
+ | LINK-143:JUNCTION-33| 317.4 | 148.9 | 940.2 | 771.6 |
+ | LINK-142:JUNCTION-91| 305.6 | 122.7 | 943.0 | 760.1 |
+ | LINK-142:JUNCTION-92| 312.5 | 132.6 | 940.7 | 760.8 |
+ | LINK-141:JUNCTION-90| 301.0 | 113.0 | 945.1 | 757.1 |
+ | LINK-141:JUNCTION-91| 305.6 | 122.7 | 943.0 | 760.1 |
+ | LINK-140:JUNCTION-89| 322.9 | 135.7 | 949.7 | 762.5 |
+ | LINK-140:JUNCTION-90| 301.0 | 113.0 | 945.1 | 757.1 |
+ | LINK-139:JUNCTION-89| 322.9 | 135.7 | 949.7 | 762.5 |
+ | LINK-139:JUNCTION-86| 331.0 | 142.1 | 954.5 | 765.6 |
+ | LINK-138:JUNCTION-88| 328.5 | 144.0 | 950.2 | 765.7 |
+ | LINK-138:JUNCTION-89| 322.9 | 135.7 | 949.7 | 762.5 |
+ | LINK-137:JUNCTION-88| 328.5 | 144.0 | 950.2 | 765.7 |
+ | LINK-137:JUNCTION-79| 331.1 | 152.8 | 949.0 | 770.7 |
+ | LINK-136:JUNCTION-87| 330.7 | 143.8 | 952.9 | 766.0 |
+ | LINK-136:JUNCTION-88| 328.5 | 144.0 | 950.2 | 765.7 |
+ | LINK-135:JUNCTION-87| 330.7 | 143.8 | 952.9 | 766.0 |
+ | LINK-135:JUNCTION-85| 333.9 | 148.4 | 954.1 | 768.6 |
+ | LINK-134:JUNCTION-86| 331.0 | 142.1 | 954.5 | 765.6 |
+ | LINK-134:JUNCTION-87| 330.7 | 143.8 | 952.9 | 766.0 |
+ | LINK-133:JUNCTION-85| 333.9 | 148.4 | 954.1 | 768.6 |
+ | LINK-133:JUNCTION-86| 331.0 | 142.1 | 954.5 | 765.6 |
+ | LINK-132:JUNCTION-82| 335.0 | 152.3 | 953.8 | 771.1 |
+ | LINK-132:JUNCTION-85| 333.9 | 148.4 | 954.1 | 768.6 |
+ | LINK-131:JUNCTION-84| 331.8 | 150.3 | 951.7 | 770.3 |
+ | LINK-131:JUNCTION-83| 337.2 | 153.6 | 954.9 | 771.3 |
+ | LINK-130:JUNCTION-84| 331.8 | 150.3 | 951.7 | 770.3 |
+ | LINK-130:JUNCTION-81| 324.2 | 147.5 | 947.8 | 771.0 |
+ | LINK-129:JUNCTION-83| 337.2 | 153.6 | 954.9 | 771.3 |
+ | LINK-129:JUNCTION-84| 331.8 | 150.3 | 951.7 | 770.3 |
+ | LINK-128:JUNCTION-82| 335.0 | 152.3 | 953.8 | 771.1 |
+ | LINK-128:JUNCTION-83| 337.2 | 153.6 | 954.9 | 771.3 |
+ | LINK-127:JUNCTION-80| 333.1 | 155.7 | 950.0 | 772.5 |
+ | LINK-127:JUNCTION-82| 335.0 | 152.3 | 953.8 | 771.1 |
+ | LINK-126:JUNCTION-78| 328.0 | 155.3 | 946.0 | 773.3 |
+ | LINK-126:JUNCTION-71| 314.5 | 144.9 | 946.7 | 777.1 |
+ | LINK-125:JUNCTION-81| 324.2 | 147.5 | 947.8 | 771.0 |
+ | LINK-125:JUNCTION-77| 321.7 | 146.4 | 946.3 | 771.1 |
+ | LINK-124:JUNCTION-80| 333.1 | 155.7 | 950.0 | 772.5 |
+ | LINK-124:JUNCTION-81| 324.2 | 147.5 | 947.8 | 771.0 |
+ | LINK-123:JUNCTION-79| 331.1 | 152.8 | 949.0 | 770.7 |
+ | LINK-123:JUNCTION-80| 333.1 | 155.7 | 950.0 | 772.5 |
+ | LINK-122:JUNCTION-78| 328.0 | 155.3 | 946.0 | 773.3 |
+ | LINK-122:JUNCTION-79| 331.1 | 152.8 | 949.0 | 770.7 |
+
+ | LINK-121:JUNCTION-76| 321.8 | 149.0 | 944.4 | 771.6 |
+ | LINK-121:JUNCTION-78| 328.0 | 155.3 | 946.0 | 773.3 |
+ | LINK-120:JUNCTION-77| 321.7 | 146.4 | 946.3 | 771.1 |
+ | LINK-120:JUNCTION-73| 324.3 | 151.9 | 944.7 | 772.3 |
+ | LINK-119:JUNCTION-76| 321.8 | 149.0 | 944.4 | 771.6 |
+ | LINK-119:JUNCTION-77| 321.7 | 146.4 | 946.3 | 771.1 |
+ | LINK-118:JUNCTION-75| 314.5 | 140.8 | 943.7 | 769.9 |
+ | LINK-118:JUNCTION-76| 321.8 | 149.0 | 944.4 | 771.6 |
+ | LINK-117:JUNCTION-75| 314.5 | 140.8 | 943.7 | 769.9 |
+ | LINK-117:JUNCTION-74| 322.0 | 150.0 | 944.4 | 772.4 |
+ | LINK-116:JUNCTION-72| 322.2 | 150.7 | 944.6 | 773.1 |
+ | LINK-116:JUNCTION-75| 314.5 | 140.8 | 943.7 | 769.9 |
+ | LINK-115:JUNCTION-74| 322.0 | 150.0 | 944.4 | 772.4 |
+ | LINK-115:JUNCTION-73| 324.3 | 151.9 | 944.7 | 772.3 |
+ | LINK-114:JUNCTION-72| 322.2 | 150.7 | 944.6 | 773.1 |
+ | LINK-114:JUNCTION-74| 322.0 | 150.0 | 944.4 | 772.4 |
+ | LINK-113:JUNCTION-73| 324.3 | 151.9 | 944.7 | 772.3 |
+ | LINK-113:JUNCTION-69| 322.6 | 152.6 | 948.6 | 778.6 |
+ | LINK-112:JUNCTION-70| 328.7 | 158.6 | 947.8 | 777.7 |
+ | LINK-112:JUNCTION-72| 322.2 | 150.7 | 944.6 | 773.1 |
+ | LINK-111:JUNCTION-70| 328.7 | 158.6 | 947.8 | 777.7 |
+ | LINK-111:JUNCTION-71| 314.5 | 144.9 | 946.7 | 777.1 |
+ | LINK-110:JUNCTION-69| 322.6 | 152.6 | 948.6 | 778.6 |
+ | LINK-110:JUNCTION-70| 328.7 | 158.6 | 947.8 | 777.7 |
+ | LINK-109:JUNCTION-68| 331.1 | 177.7 | 948.2 | 794.8 |
+ | LINK-109:JUNCTION-69| 322.6 | 152.6 | 948.6 | 778.6 |
+ | LINK-108:JUNCTION-63| 333.6 | 165.6 | 957.5 | 789.6 |
+ | LINK-108:JUNCTION-62| 332.2 | 164.9 | 957.6 | 790.3 |
+ | LINK-107:JUNCTION-65| 334.7 | 174.7 | 954.0 | 794.0 |
+ | LINK-107:JUNCTION-68| 331.1 | 177.7 | 948.2 | 794.8 |
+ | LINK-106:JUNCTION-64| 333.7 | 167.2 | 956.8 | 790.4 |
+ | LINK-106:JUNCTION-65| 334.7 | 174.7 | 954.0 | 794.0 |
+ | LINK-105:JUNCTION-68| 331.1 | 177.7 | 948.2 | 794.8 |
+ | LINK-105:JUNCTION-58| 333.1 | 188.0 | 943.3 | 798.2 |
+ | LINK-104:JUNCTION-66| 335.2 | 174.0 | 954.9 | 793.8 |
+ | LINK-104:JUNCTION-67| 332.0 | 168.2 | 956.5 | 792.7 |
+ | LINK-103:JUNCTION-67| 332.0 | 168.2 | 956.5 | 792.7 |
+ | LINK-103:JUNCTION-61| 331.5 | 167.5 | 956.8 | 792.9 |
+ | LINK-102:JUNCTION-66| 335.2 | 174.0 | 954.9 | 793.8 |
+ | LINK-102:JUNCTION-67| 332.0 | 168.2 | 956.5 | 792.7 |
+ | LINK-101:JUNCTION-65| 334.7 | 174.7 | 954.0 | 794.0 |
+ | LINK-101:JUNCTION-66| 335.2 | 174.0 | 954.9 | 793.8 |
+ | LINK-100:JUNCTION-64| 333.7 | 167.2 | 956.8 | 790.4 |
+ | LINK-100:JUNCTION-65| 334.7 | 174.7 | 954.0 | 794.0 |
+ | LINK-99:JUNCTION-63| 333.6 | 165.6 | 957.5 | 789.6 |
+ | LINK-99:JUNCTION-64| 333.7 | 167.2 | 956.8 | 790.4 |
+ | LINK-42:JUNCTION-19| 359.7 | 245.7 | 918.6 | 804.6 |
+ | LINK-42:VALVE-180| 486.5 | 375.9 | 920.5 | 809.9 |
+ | LINK-0:VALVE-180 | 486.5 | 375.9 | 920.5 | 809.9 |
+ | LINK-0:VALVE-176 | 527.6 | 389.5 | 931.6 | 793.5 |
+ | LINK-41:JUNCTION-20| 296.0 | 188.3 | 913.8 | 806.1 |
+ | LINK-41:VALVE-175| 414.6 | 270.8 | 947.6 | 803.8 |
+ | LINK-14:VALVE-174| 592.2 | 444.3 | 951.2 | 803.3 |
+ | LINK-14:JUNCTION-10| 627.1 | 459.1 | 960.7 | 792.7 |
+ | LINK-25:JUNCTION-15| 531.7 | 375.7 | 955.2 | 799.2 |
+ | LINK-25:VALVE-173| 537.6 | 380.2 | 955.6 | 798.2 |
+ | LINK-168:JUNCTION-103| 106.5 | 51.7 | 1138.2 | 1083.4 |
+ | LINK-168:VALVE-178| 170.0 | 106.7 | 1127.0 | 1063.7 |
+ | LINK-163:VALVE-177| 316.1 | 297.6 | 1165.1 | 1146.6 |
+ | LINK-163:JUNCTION-104| 303.2 | 285.9 | 1163.9 | 1146.6 |
+
+ | LINK-34:VALVE-178| 157.4 | 93.0 | 1114.4 | 1050.0 |
+ | LINK-34:VALVE-179| 239.6 | 147.2 | 997.6 | 905.2 |
+ --------------------------------------------------------------------------------
+
+
+
+
+
+ *** Maximum pressure in entire network is 1165.2 ftH at point LINK-167:JUNCTION-106
+
+ *** Minimum pressure in entire network is 4.5 ftH at point LINK-166:JUNCTION-29
+
+
+
+Elapsed time: 167 s.
diff --git a/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.out b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.out
new file mode 100644
index 0000000..2f96099
Binary files /dev/null and b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.out differ
diff --git a/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.rpc b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.rpc
new file mode 100644
index 0000000..7219fc3
--- /dev/null
+++ b/Python/tsnet/examples/networks/tnet3_hammer/tnet3.wtg_1_58.rpc
@@ -0,0 +1,80 @@
+ Page 1 Fri Mar 20 21:52:34 2020
+
+******************************************************************
+* W A T E R G E M S *
+* Hydraulic and Water Quality *
+* Analysis for Pipe Networks *
+* Version 8.11 *
+******************************************************************
+
+
+ Number of Junctions................ 130
+ Number of Reservoirs............... 1
+ Number of Tanks ................... 2
+ Number of Pipes ................... 172
+ Number of Pumps ................... 2
+ Number of Variable Speed Pumps .... 0
+ Number of Valves .................. 8
+ Headloss Formula .................. Hazen-Williams
+ Hydraulic Timestep ................ 0.50 hrs
+ Hydraulic Accuracy ................ 0.001000
+ Status Check Frequency ............ 2
+ Maximum Trials Checked ............ 10
+ Damping Limit Threshold ........... 0.000000
+ Maximum Trials .................... 40
+ Quality Analysis .................. None
+ Specific Gravity .................. 1.00
+ Relative Kinematic Viscosity ...... 0.00
+ Relative Chemical Diffusivity ..... -769230769230769150.00
+ Demand Multiplier ................. 1.00
+ Total Duration .................... 1.00 hrs
+ Reporting Criteria:
+ No Nodes
+ No Links
+
+[Analysis Started]
+Fri Mar 20 21:52:34 2020
+
+[0:00:00]
+< 0:00:00 Balancing the network:>
+ Trial 1: relative flow change = 1.203840
+ Trial 2: relative flow change = 0.965026
+ Trial 3: relative flow change = 0.672653
+ Trial 4: relative flow change = 0.276990
+ Trial 5: relative flow change = 0.043313
+ Trial 6: relative flow change = 0.002033
+ Trial 7: relative flow change = 0.000310
+< 0:00:00 Balanced after 7 trials; relative flow change = 0.000310>
+
+Flow Supplied 1096.50 gpm
+Flow Demanded 912.60 gpm
+Flow Stored 183.89 gpm
+
+ 0:00:00 Reservoir 190 is emptying
+ 0:00:00 Tank 192 is filling at 15.16 ft
+ 0:00:00 Tank 191 is emptying at 17.95 ft
+
+[0:30:00]
+< 0:30:00 Balancing the network:>
+ Trial 1: relative flow change = 0.009964
+ Trial 2: relative flow change = 0.000054
+< 0:30:00 Balanced after 2 trials; relative flow change = 0.000054>
+
+Flow Supplied 1095.17 gpm
+Flow Demanded 803.80 gpm
+Flow Stored 291.37 gpm
+
+
+[1:00:00]
+< 1:00:00 Balancing the network:>
+ Trial 1: relative flow change = 0.009497
+ Trial 2: relative flow change = 0.000068
+< 1:00:00 Balanced after 2 trials; relative flow change = 0.000068>
+
+Flow Supplied 1093.85 gpm
+Flow Demanded 700.45 gpm
+Flow Stored 393.40 gpm
+
+
+[Analysis Ended]
+Fri Mar 20 21:52:34 2020
diff --git a/Python/tsnet/examples/networks/tutorial.inp b/Python/tsnet/examples/networks/tutorial.inp
new file mode 100644
index 0000000..d2abbe3
--- /dev/null
+++ b/Python/tsnet/examples/networks/tutorial.inp
@@ -0,0 +1,153 @@
+[TITLE]
+
+
+[JUNCTIONS]
+;ID Elev Demand Pattern
+ 2 700 0 ;
+ 3 0 0 ;
+ 4 0 0 ;
+ 5 0 0 ;
+ 6 0 0 ;
+ 7 0 0 ;
+
+[RESERVOIRS]
+;ID Head Pattern
+ 1 700 ;
+
+[TANKS]
+;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
+ 8 830 4 0 20 60 0 ;
+
+[PIPES]
+;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
+ 1 2 3 1000 12 100 0 Open ;
+ 2 3 7 1000 12 100 0 Open ;
+ 3 3 4 1000 12 100 0 Open ;
+ 4 4 6 1000 12 100 0 Open ;
+ 5 7 6 1000 12 100 0 Open ;
+ 6 7 8 1000 12 100 0 Open ;
+ 7 4 5 1000 12 100 0 Open ;
+ 8 5 6 1000 12 100 0 Open ;
+
+[PUMPS]
+;ID Node1 Node2 Parameters
+ 9 1 2 HEAD 1 ;
+
+[VALVES]
+;ID Node1 Node2 Diameter Type Setting MinorLoss
+
+[TAGS]
+
+[DEMANDS]
+;Junction Demand Pattern Category
+
+[STATUS]
+;ID Status/Setting
+
+[PATTERNS]
+;ID Multipliers
+
+[CURVES]
+;ID X-Value Y-Value
+;PUMP:
+ 1 600 150
+
+[CONTROLS]
+
+[RULES]
+
+[ENERGY]
+ Global Efficiency 75
+ Global Price 0
+ Demand Charge 0
+
+[EMITTERS]
+;Junction Coefficient
+
+[QUALITY]
+;Node InitQual
+
+[SOURCES]
+;Node Type Quality Pattern
+
+[REACTIONS]
+;Type Pipe/Tank Coefficient
+
+
+[REACTIONS]
+ Order Bulk 1
+ Order Tank 1
+ Order Wall 1
+ Global Bulk 0
+ Global Wall 0
+ Limiting Potential 0
+ Roughness Correlation 0
+
+[MIXING]
+;Tank Model
+
+[TIMES]
+ Duration 0
+ Hydraulic Timestep 1:00
+ Quality Timestep 0:05
+ Pattern Timestep 1:00
+ Pattern Start 0:00
+ Report Timestep 1:00
+ Report Start 0:00
+ Start ClockTime 12 am
+ Statistic None
+
+[REPORT]
+ Status No
+ Summary No
+ Page 0
+
+[OPTIONS]
+ Units GPM
+ Headloss H-W
+ Specific Gravity 1
+ Viscosity 1
+ Trials 40
+ Accuracy 0.001
+ CHECKFREQ 2
+ MAXCHECK 10
+ DAMPLIMIT 0
+ Unbalanced Continue 10
+ Pattern 1
+ Demand Multiplier 1.0
+ Emitter Exponent 0.5
+ Quality None mg/L
+ Diffusivity 1
+ Tolerance 0.01
+
+[COORDINATES]
+;Node X-Coord Y-Coord
+ 2 -1905.56 6988.89
+ 3 -227.78 6988.89
+ 4 -227.78 5544.44
+ 5 -227.78 4133.33
+ 6 1650.00 5544.44
+ 7 1650.00 6988.89
+ 1 -3516.67 6977.78
+ 8 3483.33 6988.89
+
+[VERTICES]
+;Link X-Coord Y-Coord
+ 8 261.11 4166.67
+ 8 805.56 4255.56
+ 8 1283.33 4611.11
+ 8 1561.11 5066.67
+
+[LABELS]
+;X-Coord Y-Coord Label & Anchor Node
+ -3783.33 7588.89 "SOURCE"
+ -2727.78 6611.11 "PUMP"
+ 3494.44 6688.89 "TANK"
+
+[BACKDROP]
+ DIMENSIONS 0.00 0.00 10000.00 10000.00
+ UNITS None
+ FILE
+ OFFSET 0.00 0.00
+
+[END]
diff --git a/Python/tsnet/examples/simple_pump.py b/Python/tsnet/examples/simple_pump.py
new file mode 100644
index 0000000..7453c50
--- /dev/null
+++ b/Python/tsnet/examples/simple_pump.py
@@ -0,0 +1,56 @@
+import tsnet
+# Open an example network and create a transient model
+inp_file = 'networks/simple_pump.inp'
+tm = tsnet.network.TransientModel(inp_file)
+
+# Set wavespeed
+tm.set_wavespeed(1200.) # m/s
+# Set time options
+dt = 0.1 # time step [s], if not given, use the maximum allowed dt
+tf = 60 # simulation period [s]
+tm.set_time(tf)
+
+# Set pump shut off
+tc = 1 # pump closure period
+ts = 0 # pump closure start time
+se = 0 # end open percentage
+m = 1 # closure constant
+pump_op = [tc,ts,se,m]
+tm.pump_shut_off('pump', pump_op)
+
+# Initialize steady state simulation
+t0 = 0. # initialize the simulation at 0 [s]
+engine = 'DD' # demand driven simulator
+tm = tsnet.simulation.Initializer(tm, t0, engine)
+
+# Transient simulation
+results_obj = 'simple_pump' # name of the object for saving simulation results
+tm = tsnet.simulation.MOCSimulator(tm, results_obj)
+
+# report results
+import matplotlib.pyplot as plt
+node = '2'
+node = tm.get_node(node)
+fig1 = plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(tm.simulation_timestamps,node.head)
+plt.xlim([tm.simulation_timestamps[0],tm.simulation_timestamps[-1]])
+plt.title('Pressure Head at Node %s '%node)
+plt.xlabel("Time [s]")
+plt.ylabel("Pressure Head [m]")
+plt.legend(loc='best')
+plt.grid(True)
+plt.show()
+# fig1.savefig('./docs/figures/tnet1_node.png', format='png',dpi=100)
+
+pipe = 'p2'
+pipe = tm.get_link(pipe)
+fig = plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='k')
+plt.plot(tm.simulation_timestamps,pipe.start_node_flowrate,label='Start Node')
+plt.plot(tm.simulation_timestamps,pipe.end_node_flowrate,label='End Node')
+plt.xlim([tm.simulation_timestamps[0],tm.simulation_timestamps[-1]])
+plt.title('Velocity of Pipe %s '%pipe)
+plt.xlabel("Time [s]")
+plt.ylabel("Velocity [m/s]")
+plt.legend(loc='best')
+plt.grid(True)
+plt.show()
diff --git a/Python/tsnet/network/__init__.py b/Python/tsnet/network/__init__.py
new file mode 100644
index 0000000..b4a6546
--- /dev/null
+++ b/Python/tsnet/network/__init__.py
@@ -0,0 +1,11 @@
+"""
+The tsnet.network package contains methods to define
+1. a water network geometry,
+2. network topology,
+3. network control, and
+4 .spatial and temporal discretization.
+
+"""
+
+from .topology import topology
+from .model import TransientModel
diff --git a/Python/tsnet/network/control.py b/Python/tsnet/network/control.py
new file mode 100644
index 0000000..93a9a7b
--- /dev/null
+++ b/Python/tsnet/network/control.py
@@ -0,0 +1,260 @@
+"""
+The tsnet.network.control module includes method to define
+network controls of the pump and valve.These control modify
+parameters in the network during transient simulation.
+
+"""
+import numpy as np
+
+def valveclosing(dt, tf, valve_op):
+ """Define valve operation curve (percentage open v.s. time)
+
+ Parameters
+ ----------
+ dt : float
+ Time step
+ tf : float
+ Simulation Time
+ valve_op : list
+ Contains parameters to define valve operation rule
+ valve_op = [tc,ts,se,m]
+ tc : the duration takes to close the valve [s]
+ ts : closure start time [s]
+ se : final open percentage [s]
+ m : closure constant [unitless]
+
+ Returns
+ -------
+ s : list
+ valve operation curve
+ """
+
+ [tc,ts,se,m] = valve_op
+ tn = int(tf/dt)
+ # abrupt closure
+ if tc ==0:
+ s = np.array([(1- (i*dt- ts))**1 for i in range(tn)])
+ s[s>1] = 1
+ s[s<1] = se
+ # gradual closure
+ else:
+ t = np.array([(i*dt- ts)/tc for i in range(tn)])
+ t[t>1] = 1
+ t[t<0] = 0
+ s = np.array([1 - (1-se)*t[i]**m for i in range(tn)])
+ s[s>1] = 1
+ s[s0] = se
+ s[s<0] = 0
+ # gradual opening
+ else:
+ t = np.array([(i*dt- ts)/tc for i in range(tn)])
+ t[t>1] = 1
+ t[t<0] = 0
+ s = np.array([se* (t[i])**m for i in range(tn)])
+ s[s<0] = 0
+ s[s>se] = se
+ return s
+
+def pumpclosing(dt, tf, pump_op):
+ """Define pump operation curve (percentage open v.s. time)
+
+ Parameters
+ ----------
+ dt : float
+ Time step
+ tf : float
+ Simulation Time
+ valve_op : list
+ Contains parameters to define valve operation rule
+ valve_op = [tc,ts,se,m]
+ tc : the duration takes to close the valve [s]
+ ts : closure start time [s]
+ se : final open percentage [s]
+ m : closure constant [unitless]
+
+ Returns
+ -------
+ s : list
+ valve operation curve
+ """
+ [tc,ts,se,m] = pump_op
+ # do not allow the pump to be fully closed due to numerical issues
+ if se == 0.:
+ se = 0.0001
+
+ tn = int(tf/dt)
+ # gradual closure
+ if tc != 0:
+ s = np.array([(1- (i*dt- ts)/tc)**m for i in range(tn)])
+ s[s>1] = 1
+ s[s1] = 1
+ t[t<0] = 0
+ s = np.array([1 - (1-se)*t[i]**m for i in range(tn)])
+ s[s>1] = 1
+ s[s0] = se
+ s[s<0] = 0
+ # gradual opening
+ else:
+ t = np.array([(i*dt- ts)/tc for i in range(tn)])
+ t[t>1] = 1
+ t[t<0] = 0
+ s = np.array([se* (t[i])**m for i in range(tn)])
+ s[s<0] = 0
+ s[s>se] = se
+ return s
+
+def burstsetting(dt,tf,ts,tc,final_burst_coeff):
+ """ Calculate the burst area as a function of simulation time
+
+ Parameters
+ ----------
+ dt : float
+ Time step
+ tf : float
+ Simulation Time
+ ts : float
+ Burst start time
+ tc : float
+ Time for burst to fully develop
+ final_burst_coeff : list or float
+ Final emitter coefficient at the burst nodes
+ """
+
+ tn = int(tf/dt)
+ if tc !=0 :
+ s = np.array([(i*dt- ts)/tc for i in range(tn)])
+ s[s>1] = 1
+ s[s<0] = 0
+ burst_A = final_burst_coeff * s
+ else:
+ s = np.array([(i*dt- ts) for i in range(tn)])
+ s[s>0] = 1
+ s[s<0] = 0
+ burst_A = final_burst_coeff * s
+
+ return burst_A
+
+
+def demandpulse(dt, tf, tc, ts, tp, dp):
+ """Calculate demand pulse multiplier
+
+ Parameters
+ dt : float
+ Time step
+ tf : float
+ Simulation Time
+ tc : float
+ Total pulse duration
+ ts : float
+ Pulse start time
+ tp : float
+ Pulse increase time
+ dp : float
+ Pulse multiplier
+ """
+ tn = int(tf/dt)
+ x = np.linspace(0,tf,tn)
+ t_change = tp
+ stay = tc - 2*tp
+ if t_change !=0 :
+ s = np.piecewise(x, [x<=ts, (x>ts)& (x<= ts+t_change),
+ (x>ts+t_change) & (x<=ts+t_change+stay),
+ (x>ts+t_change+stay) & (x<=ts+tc),
+ x>ts+tc],
+ [0, lambda x: (x-ts)/t_change,
+ 1, lambda x: 1- (x-ts-t_change-stay)/t_change,
+ 0])
+
+ pulse_mul = dp * s
+
+ else:
+ s = np.piecewise(x, [x<=ts,(x>ts) & (x<=ts+stay), x>ts+tc],
+ [0, 1, 0])
+ pulse_mul = dp * s
+
+ # import matplotlib.pyplot as plt
+
+ # fig1 = plt.figure(figsize=(4,4), dpi=150, facecolor='w', edgecolor='k')
+ # plt.plot(x,pulse_mul, 'k', lw=2.5)
+ # plt.xlim(ts-0.2,ts+tc+0.2)
+ # plt.ylim(-0.1,1.2)
+ # plt.xticks([ts,ts+tp,ts+tc],('ts', 'ts+tp', 'ts+tc'))
+ # plt.yticks([dp], ['dp'])
+ # plt.xlabel("Time [s]")
+ # plt.ylabel("Demand pulse multiplier")
+ # plt.vlines(ts+tp, -0.1, 1, 'k', linestyles='dotted')
+ # plt.vlines(ts, -0.1, 0, 'k', linestyles='dotted')
+ # plt.vlines(ts+tc, -0.1, 0, 'k', linestyles='dotted')
+ # plt.hlines(dp, ts-0.2, ts+tp, 'k', linestyles='dotted')
+ # plt.show()
+ # fig1.savefig("DemandMultiplier.pdf", format='pdf',dpi=500, bbox_inches = 'tight')
+ return pulse_mul
diff --git a/Python/tsnet/network/discretize.py b/Python/tsnet/network/discretize.py
new file mode 100644
index 0000000..e47d98d
--- /dev/null
+++ b/Python/tsnet/network/discretize.py
@@ -0,0 +1,166 @@
+"""
+The tsnet.network.discretize contains methods to perform
+spatial and temporal discretization by adjusting wave speed
+and time step to solve compatibility equations in case of
+uneven wave travel time.
+
+"""
+
+from __future__ import print_function
+import numpy as np
+
+def discretization(tm, dt):
+ """Discretize in temporal and spatial space using wave speed adjustment scheme.
+
+ Parameters
+ ----------
+ tm : tsnet.network.geometry.TransientModel
+ Network
+ dt : float
+ User defined time step
+
+ Returns
+ -------
+ tm : tsnet.network.geometry.TransientModel
+ Network with updated parameters
+ """
+
+ max_dt = max_time_step(tm)
+ if dt > max_dt:
+ raise ValueError("time step is too large. Please define \
+ a time step that is less than %.5f " %max_dt)
+ else :
+ Ndis = cal_N(tm, dt)
+
+ # add number of segments as a new attribute to each pipe
+ i = 0
+ for _, pipe in tm.pipes():
+ pipe.number_of_segments = int(Ndis[i])
+ i+=1
+ # adjust wave speed and calculate time step
+ tm = adjust_wavev(tm)
+ return tm
+
+
+def max_time_step(tm):
+ """Determine the maximum time step based on Courant's criteria.
+
+ Parameters
+ ----------
+ tm : tsnet.network.geometry.TransientModel
+ Network
+
+ Returns
+ -------
+ max_dt : float
+ Maximum time step allowed for this network
+ """
+ max_dt = np.inf
+
+ for _, pipe in tm.pipes():
+ dt = pipe.length / (2. * pipe.wavev)
+ if max_dt > dt :
+ max_dt = dt #- 0.001 # avoid numerical issue which cause N = 0
+ return max_dt
+
+def discretization_N(tm, dt):
+ """Discretize in temporal and spatial space using wave speed adjustment scheme.
+
+ Parameters
+ ----------
+ tm : tsnet.network.geometry.TransientModel
+ Network
+ dt : float
+ User defined time step
+
+ Returns
+ -------
+ tm : tsnet.network.geometry.TransientModel
+ Network with updated parameters
+ """
+
+ Ndis = cal_N(tm, dt)
+
+ # add number of segments as a new attribute to each pipe
+ i = 0
+ for _, pipe in tm.pipes():
+ pipe.number_of_segments = int(Ndis[i])
+ i+=1
+ # adjust wave speed and calculate time step
+ tm = adjust_wavev(tm)
+ return tm
+
+
+def max_time_step_N(tm, N):
+ """Determine the maximum time step based on Courant's criteria.
+
+ Parameters
+ ----------
+ tm : tsnet.network.geometry.TransientModel
+ Network
+
+ Returns
+ -------
+ max_dt : float
+ Maximum time step allowed for this network
+ """
+ max_dt = np.inf
+ for _, pipe in tm.pipes():
+ dt = pipe.length / (N * pipe.wavev)
+ if max_dt > dt :
+ max_dt = dt #- 1e-5 # avoid numerical issue which cause N = 0
+ return max_dt
+
+def cal_N(tm, dt):
+ """Determine the number of computation unites ($N_i$) for each pipes.
+
+ Parameters
+ ----------
+ tm : tsnet.network.geometry.TransientModel
+ Network
+ dt : float
+ Time step for transient simulation
+ """
+ N = np.zeros((tm.num_pipes,1))
+
+ for _, pipe in tm.pipes() :
+ # N[int(pipe.id)-1] = int(2*np.int(pipe.length/ (2. * pipe.wavev *dt)))
+ N[int(pipe.id)-1] = round(int(pipe.length/ (pipe.wavev *dt)))
+ return N
+
+
+def adjust_wavev(tm):
+ """Adjust wave speed and time step to solve compatibility equations.
+
+ Parameters
+ ----------
+ tm : tsnet.network.geometry.TransientModel
+ Network
+
+ Returns
+ -------
+ tm : tsnet.network.geometry.TransientModel
+ Network with adjusted wave speed.
+ dt : float
+ Adjusted time step
+ """
+
+ from numpy import transpose as trans
+ phi = [np.longdouble(pipe.length / pipe.wavev / pipe.number_of_segments)
+ for _, pipe in tm.pipes()]
+ phi = np.array(phi).reshape((len(phi), 1))
+ tm.wavespeed_adj = np.sum(phi**2)
+ theta = np.longdouble(1/ np.matmul(trans(phi), phi) * \
+ np.matmul(trans(phi), np.ones((len(phi), 1))))
+
+ # adjust time step
+ dt = np.float64(1/theta)
+
+ # adjust the wave speed of each links
+ for _, pipe in tm.pipes():
+ pipe.wavev = np.float64(pipe.wavev * phi[int(pipe.id)-1] * theta)
+
+ # set time step as a new attribute to TransientModel
+ tm.time_step =dt
+ return tm
+
diff --git a/Python/tsnet/network/model.py b/Python/tsnet/network/model.py
new file mode 100644
index 0000000..7a1a279
--- /dev/null
+++ b/Python/tsnet/network/model.py
@@ -0,0 +1,510 @@
+"""
+The tsnet.network.geometry read in the geometry defined by EPANet
+.inp file, and assign additional parameters needed in transient
+simulation later in tsnet.
+
+"""
+
+from __future__ import print_function
+import wntr
+from wntr.network.elements import LinkStatus
+import matplotlib.pyplot as plt
+import networkx as nx
+import numpy as np
+import logging
+import warnings
+from wntr.network import WaterNetworkModel
+from tsnet.network.discretize import (
+ discretization, max_time_step,
+ discretization_N, max_time_step_N)
+from tsnet.network.control import (
+ valveclosing,
+ valveopening,
+ pumpclosing,
+ pumpopening,
+ burstsetting,
+ demandpulse
+)
+from tsnet.postprocessing import detect_cusum
+
+logger = logging.getLogger(__name__)
+
+class TransientModel (WaterNetworkModel):
+ """ Transient model class.
+ Parameters
+ -------------------
+ inp_file_name: string
+ Directory and filename of EPANET inp file to load into the
+ WaterNetworkModel object.
+ """
+
+ def __init__ (self, inp_file):
+ super().__init__(inp_file)
+ self.simulation_timestamps = []
+ self.time_step = 0.
+ self.simulation_period = 0.
+ self.initial_velocity = []
+ self.initial_head = []
+ # assign ID to each links, start from 1.
+ i =1
+ for _, link in self.links():
+ link.id = i
+ i+=1
+ for _,valve in self.valves():
+ valve.valve_coeff = None
+ # assign ID to each links, start from 1.
+ i =1
+ for _, node in self.nodes():
+ node.id = i
+ node._leak_status = False
+ node.burst_status = False
+ node.blockage_status = False
+ node.pulse_status = False
+ node.emitter_coeff = 0.
+ node.block_per = 0.
+ node.transient_node_type = node.node_type
+ i+=1
+
+ # calculate the slope and area for each pipe
+ for _, pipe in self.pipes():
+ pipe.area = pipe.diameter**2. * np.pi / 4.
+ try:
+ theta = np.sin(np.arctan(pipe.end_node.elevation -
+ pipe.start_node.elevation)/pipe.length)
+ except:
+ theta = 0.0
+ pipe.theta = theta
+
+ # set operating default value as False
+ for _, link in self.links():
+ link.operating = False
+
+ def set_wavespeed(self, wavespeed=1200, pipes=None):
+ """Set wave speed for pipes in the network
+
+ Parameters
+ ----------
+ wavespeed : float or int or list, optional
+ If given as float or int, set the value as wavespeed
+ for all pipe; If given as list set the corresponding
+ value to each pipe, by default 1200.
+ pipes : str or list, optional
+ The list of pipe to define wavespeed,
+ by default all pipe in the network.
+ """
+ generator = 0
+ if pipes == None :
+ generator = 1
+ pipes = self.pipes()
+ num_pipes = self.num_pipes
+ else:
+ pipes = [self.get_link(pipe) for pipe in list(pipes)]
+ num_pipes = len(pipes)
+
+ if isinstance(wavespeed,(float,int)):
+ # if wavespeed is a float, assign it to all pipes
+ wavespeed = wavespeed * np.ones(num_pipes)
+ elif isinstance(wavespeed, (list,tuple,np.ndarray)):
+ # if wavespeed is a list, assign each elements
+ # to the respective pipes.
+ if not len(wavespeed) == num_pipes:
+ raise ValueError('The length of the wavespeed \
+ input does not equal number of pipes. ')
+ else:
+ raise ValueError('Wavespeed should be a float or a list')
+
+ # assign wave speed to each pipes
+ i= 0
+ if generator == 1:
+ for _, pipe in pipes:
+ pipe.wavev = wavespeed[i]
+ i+=1
+ else:
+ for pipe in pipes:
+ pipe.wavev = wavespeed[i]
+ i+=1
+
+ def set_roughness(self,roughness, pipes=None):
+ """Set roughness coefficient for pipes in the network
+
+ Parameters
+ ----------
+ roughness : float or int or list
+ If given as float or int, set the value as roughness
+ for all pipe; If given as list set the corresponding
+ value to each pipe. Make sure to define it using the
+ same method (H-W or D-W) as defined in .inp file.
+ pipes : str or list, optional
+ The list of pipe to define roughness coefficient,
+ by default all pipe in the network.
+ """
+ generator = 0
+ if pipes == None :
+ generator = 1
+ pipes = self.pipes()
+ num_pipes = self.num_pipes
+ else:
+ pipes = [self.get_link(pipe) for pipe in list(pipes)]
+ num_pipes = len(pipes)
+
+ if isinstance(roughness,(float,int)):
+ # if roughness is a float, assign it to all mentioned pipes
+ roughness = roughness * np.ones(num_pipes)
+ elif isinstance(roughness, (list,tuple,np.ndarray)):
+ # if roughness is a list, assign each elements
+ # to the respective pipes.
+ if not len(roughness) == num_pipes:
+ raise ValueError('The length of the roughness \
+ input does not equal number of input pipes. ')
+ else:
+ raise ValueError('Roughness should be a float or a list')
+
+ # assign roughness to each input pipes
+ i= 0
+ if generator == 1:
+ for _, pipe in pipes:
+ pipe.roughness = roughness[i]
+ i+=1
+ else:
+ for pipe in pipes:
+ pipe.roughness = roughness[i]
+ i+=1
+
+ def set_time(self, tf, dt=None):
+ """Set time step and duration for the simulation.
+
+ Parameters
+ ----------
+ tf : float
+ Simulation period
+ dt : float, optional
+ time step, by default maximum allowed dt
+ """
+ if dt == None:
+ dt = max_time_step(self)
+ self.simulation_period = tf
+ self = discretization(self, dt)
+ print('Simulation time step %.5f s' % self.time_step)
+
+ def set_time_N(self, tf, N=2):
+ """Set time step and duration for the simulation.
+
+ Parameters
+ ----------
+ tf : float
+ Simulation period
+ N : integer
+ Number of segments in the critical pipe
+ """
+ dt = max_time_step_N(self,N)
+ self.simulation_period = tf
+ self = discretization_N(self, dt)
+ print('Simulation time step %.5f s' % self.time_step)
+
+ def add_leak(self, name, coeff):
+ """Add leak to the transient model
+
+ Parameters
+ ----------
+ name : str, optional
+ The name of the leak nodes, by default None
+ coeff : list or float, optional
+ Emitter coefficient at the leak nodes, by default None
+ """
+
+ leak_node = self.get_node(name)
+ leak_node.emitter_coeff += coeff
+ leak_node._leak_status = True
+
+ def add_burst(self, name, ts, tc, final_burst_coeff):
+ """Add leak to the transient model
+
+ Parameters
+ ----------
+ name : str
+ The name of the leak nodes, by default None
+ ts : float
+ Burst start time
+ tc : float
+ Time for burst to fully develop
+ final_burst_coeff : list or float
+ Final emitter coefficient at the burst nodes
+ """
+
+ burst_node = self.get_node(name)
+ burst_node.burst_coeff = burstsetting(self.time_step, self.simulation_period,
+ ts, tc, final_burst_coeff)
+ burst_node.burst_status = True
+
+ def add_blockage(self, name, percentage):
+ """Add blockage to the transient model
+
+ Parameters
+ ----------
+ name : str
+ The name of the blockage nodes, by default None
+ percentage : list or float
+ The percentage of the blockage flow discharge
+ """
+ blockage_node = self.get_node(name)
+ blockage_node.block_per = percentage
+ blockage_node.block_status = True
+
+ def valve_closure(self, name, rule, curve=None):
+ """Set valve closure rule
+
+ Parameters
+ ----------
+ name : str
+ The name of the valve to close
+ rule : list
+ Contains paramters to define valve operation rule
+ rule = [tc,ts,se,m]
+ tc : the duration takes to close the valve [s]
+ ts : closure start time [s]
+ se : final open percentage [s]
+ m : closure constant [unitless]
+ curve: list
+ [(open_percentage[i], 1/kl[i]) for i ]
+ List of open percentage and the corresponding
+ inverse of valve coefficient
+ """
+
+ valve = self.get_link(name)
+ if valve.link_type.lower() != 'valve':
+ raise RuntimeError('The name of valve to operate is not associated with a vale')
+
+ if valve.status.name == 'Closed':
+ warnings.warn("Valve %s is already closed in its initial setting. \
+The initial setting has been changed to open to perform the closure." %name)
+ valve.status = LinkStatus.Open
+
+ valve.operating = True
+ valve.operation_rule = valveclosing(self.time_step, self.simulation_period, rule)
+
+ if curve == None:
+ valve.valve_coeff = None
+ else:
+ p = [i for (i,j) in curve]
+ kl = [j for (i,j) in curve]
+ valve.valve_coeff = [p,kl]
+
+
+ def valve_opening(self, name, rule, curve=None):
+ """Set valve opening rule
+
+ Parameters
+ ----------
+ name : str
+ The name of the valve to close
+ rule : list
+ Contains paramters to define valve operation rule
+ rule = [tc,ts,se,m]
+ tc : the duration takes to open the valve [s]
+ ts : opening start time [s]
+ se : final open percentage [s]
+ m : closure constant [unitless]
+ curve: list
+ [(open_percentage[i], kl[i]) for i ]
+ List of open percentage and the corresponding
+ valve coefficient
+ """
+ valve = self.get_link(name)
+ if valve.link_type.lower() != 'valve':
+ raise RuntimeError('The name of valve to operate is not associated with a vale')
+
+ if valve.initial_status.name == 'Open' or valve.initial_status.name == 'Active':
+ warnings.warn("Valve %s is already open in its initial setting. \
+The initial setting has been changed to closed to perform the opening." %name)
+ valve.status = LinkStatus.Closed
+
+ valve.operating = True
+ valve.operation_rule = valveopening(self.time_step, self.simulation_period, rule)
+
+ if curve == None:
+ valve.valve_coeff = None
+ else:
+ p = [i for (i,j) in curve]
+ kl = [j for (i,j) in curve]
+ valve.valve_coeff = [p,kl]
+
+ def pump_shut_off(self, name, rule):
+ """Set pump shut off rule
+
+ Parameters
+ ----------
+ name : str
+ The name of the pump to shut off
+ rule : list
+ Contains paramaters to define valve operation rule
+ rule = [tc,ts,se,m]
+ tc : the duration takes to close the pump [s]
+ ts : closure start time [s]
+ se : final open percentage [s]
+ m : closure constant [unitless]
+ """
+ pump = self.get_link(name)
+
+ if pump.link_type.lower() != 'pump':
+ raise RuntimeError('The name of pump to operate is not associated with a pump')
+
+ if pump.initial_status.name == 'Closed':
+ warnings.warn("Pump %s is already closed in its initial setting. \
+The initial setting has been changed to open to perform the closure." %name)
+ pump.status= LinkStatus.Open
+ pump.operating = True
+ pump.operation_rule = pumpclosing(self.time_step, self.simulation_period, rule)
+
+ def pump_start_up(self, name, rule):
+ """Set pump start up rule
+
+ Parameters
+ ----------
+ name : str
+ The name of the pump to shut off
+ rule : list
+ Contains paramaters to define valve operation rule
+ rule = [tc,ts,se,m]
+ tc : the duration takes to close the valve [s]
+ ts : closure start time [s]
+ se : final open percentage [s]
+ m : closure constant [unitless]
+ """
+ pump = self.get_link(name)
+ if pump.link_type.lower() != 'pump':
+ raise RuntimeError('The name of pump to operate is not associated with a pump')
+
+ # Turn the pump on and run initial calculation
+ # to get the nominal flow and head
+ pump.status = LinkStatus.Open
+ sim = wntr.sim.EpanetSimulator(self)
+ results = sim.run_sim()
+ pump.nominal_flow = results.link['flowrate'].loc[0,name]
+ node1 = self.links[name].start_node.name
+ node2 = self.links[name].end_node.name
+ pump.nominal_pump_head = abs(results.node['head'].loc[0,node1]-
+ results.node['head'].loc[0,node2])
+
+ # Turn the pump back to closed
+ pump.status = LinkStatus.Closed
+ pump.operating = True
+ pump.operation_rule = pumpopening(self.time_step, self.simulation_period, rule)
+
+ def add_demand_pulse(self, name, rule):
+ """ Add demand pulse to junction
+
+ Parameters
+ ----------
+ name : str or list
+ The name of junctions to add demand pulse
+ rule : list
+ Contains paramters to define valve operation rule
+ rule = [tc,ts,stay,dp,m]
+ tc : total duration of the pulse [s] [s]
+ ts : start time of demand [s]
+ stay: duration of the demand to stay at peak level [s]
+ dp : demand pulse multiplier [uniteless]
+ """
+ [tc, ts, tp, dp] = rule
+ demand_node = self.get_node(name)
+ demand_node.pulse_coeff = demandpulse(self.time_step, self.simulation_period,
+ tc, ts, tp, dp)
+ demand_node.pulse_status = True
+
+
+ def add_surge_tank(self, name, shape, tank_type='open'):
+ """ Add surge tank
+
+ Parameters
+ ----------
+ name : str
+ the name of the node to add a surge tank
+ shape : list
+ if closed: [As, Ht, Hs]
+ As : cross-sectional area of the surge tank
+ Ht : tank height
+ Hs : initial water height in the surge tank
+ if open: [As]
+ tank_type : int
+ type of the surge tank, "closed" or "open",
+ by default 'open'
+ """
+ surge_node = self.get_node(name)
+ surge_node.tank_flow = 0
+ shape.append(0.)
+ if tank_type == 'open':
+ surge_node.transient_node_type = 'SurgeTank'
+ elif tank_type == 'closed':
+ surge_node.transient_node_type = 'Chamber'
+ surge_node.tank_height = shape[1]
+ surge_node.water_level = shape[-2]
+ else :
+ print ("tank type can be 'closed' or 'open'.")
+ surge_node.tank_shape = shape # append tank flow
+
+
+
+
+ def detect_pressure_change(self, name, threshold, drift, show=False, ax=None):
+ """Detect pressure change in simulation results
+
+ Parameters
+ ----------
+ name : str
+ The name of the node
+ threshold : positive number, optional (default = 1)
+ amplitude threshold for the change in the data.
+ drift : positive number, optional (default = 0)
+ drift term that prevents any change in the absence of change.
+ show : bool, optional (default = True)
+ True (1) plots data in matplotlib figure, False (0) don't plot.
+ ax : a matplotlib.axes.Axes instance, optional (default = None).
+ """
+ time = self.simulation_timestamps
+ x = self.get_node(name)._head
+ ta, tf, amp = detect_cusum(time, x, threshold, drift,
+ show, ax=None)
+ ta = [time[i] for i in ta]
+ tf = [time[i] for i in tf]
+ print ('%s changes detected in pressure results on node %s' %(len(ta), name))
+
+ return ta, tf, list(amp)
+
+ def plot_node_head(self, name, ax=None):
+ """Detect pressure change in simulation results
+
+ Parameters
+ ----------
+ name : str or list
+ The name of node
+ ax : a matplotlib.axes.Axes instance, optional (default = None).
+ """
+ try:
+ import matplotlib.pyplot as plt
+ except ImportError:
+ print('matplotlib is not available.')
+ else:
+ if ax is None:
+ fig, ax = plt.subplots(1, 1, figsize=(8,4),dpi=100, facecolor='w', edgecolor='k')
+ if not type(name) is list:
+ name = [name]
+ nodes = [self.get_node(i) for i in name]
+ time = self.simulation_timestamps
+
+ for i,node in enumerate(nodes):
+ ax.plot(time, node._head, lw=2, label=name[i])
+ plt.xlim([self.simulation_timestamps[0],self.simulation_timestamps[-1]])
+ # plt.title('Pressure Head at Node(s) ')
+ plt.xlabel("Time [s]", fontsize=14)
+ plt.ylabel("Pressure Head [m]", fontsize=14)
+ plt.legend(loc='best', framealpha=.5, numpoints=1)
+ plt.grid(False)
+ plt.show()
+
+
+
+
+
+
+
+
diff --git a/Python/tsnet/network/topology.py b/Python/tsnet/network/topology.py
new file mode 100644
index 0000000..00d8ad3
--- /dev/null
+++ b/Python/tsnet/network/topology.py
@@ -0,0 +1,126 @@
+"""
+The tsnet.network.topology figure out the topology, i.e.,
+upstream and downstream adjacent links for each pipe, and
+store the information in lists.
+
+"""
+import wntr
+
+def topology(wn):
+ """Figure out the topology of the network
+
+ Parameters
+ ----------
+ wn : wntr.network.model.WaterNetworkModel
+ .inp file used for EPAnet simulation
+ npipe : integer
+ Number of pipes
+
+ Returns
+ -------
+ links1 : list
+ The id of adjacent pipe on the start node.
+ The sign represents the direction of the pipe.
+ + : flowing into the junction
+ - : flowing out from the junction
+ links2 : list
+ The id of adjacent pipe on the end node.
+ The sign represents the direction of the pipe.
+ + : flowing into the junction
+ - : flowing out from the junction
+ utype : list
+ The type of the upstream adjacent links.
+ If the link is not pipe, the name of that link
+ will also be included.
+ If there is no upstream link, the type of the start node
+ will be recorded.
+ dtype : list
+ The type of the downstream adjacent links.
+ If the link is not pipe, the name of that link
+ will also be included.
+ If there is no downstream link, the type of the end node
+ will be recorded.
+ """
+ npipe = wn.num_pipes
+ length = wn.query_link_attribute('length')
+ if wntr.__version__>= '0.2.2':
+ G = wn.get_graph(link_weight = length)
+ else:
+ G = wn.get_graph()
+ G.weight_graph(link_attribute = length)
+
+ # add 'id' attribute to networkx links
+ i =1
+ for ln, link in wn.links():
+ G.edges[link.start_node_name,link.end_node_name, ln]['id'] = i
+ i+=1
+
+ # allocate the parameters
+ links1 = [0] * len(wn.links)
+ links2 = [0] * len(wn.links)
+ utype = [('Pipe',0)] * npipe
+ dtype = [('Pipe',0)] * npipe
+
+ # Adjcant pipes for each pipe IN:+; OUT:-
+ for _, link in wn.links():
+ pn = link.id
+ links1[int(pn)-1] = [int(p['id'])
+ for _, attr in G.pred[link.start_node_name].items()
+ for _,p in attr.items()
+ if p['id'] != pn]
+
+ for _, attr in G.succ[link.start_node_name].items() :
+ for _,p in attr.items():
+ if p['id'] != pn:
+ links1[int(pn)-1].append(-1* int(p['id']))
+
+
+ # right (end) adjcant pipes
+ links2[int(pn)-1] = [int(p['id'])
+ for _, attr in G.pred[link.end_node_name].items()
+ for _,p in attr.items()
+ if p['id'] != pn]
+
+ for _, attr in G.succ[link.end_node_name].items():
+ for _,p in attr.items():
+ if p['id'] != pn:
+ links2[int(pn)-1].append(-1*int(p['id']))
+
+ #figure out downstream type and upstream type
+ for _,pipe in wn.pipes():
+ pn = pipe.id-1
+ if links1[pn] :
+ if max(map(abs, links1[pn])) > npipe:
+ utype[pn] = [(l.link_type,l.name)
+ for _,l in wn.links()
+ if l.id == abs(links1[pn][0])][0]
+
+ if links1[abs(links1[pn][0])-1] and links2[abs(links1[pn][0])-1]:
+ links1[pn] = [i
+ for i in [links1[abs(links1[pn][0])-1], links2[abs(links1[pn][0])-1]]
+ if abs(i[0]) -1 != pn][0]
+ else:
+ links1[pn] = ['End']
+
+ else:
+ utype[pn] = (wn.nodes[pipe.start_node_name].transient_node_type,
+ wn.nodes[pipe.start_node_name])
+
+ if links2[pn] :
+ if max(map(abs, links2[pn])) > npipe:
+ dtype[pn] = [(l.link_type,l.name)
+ for _,l in wn.links()
+ if l.id == abs(links2[pn][0])][0]
+
+ if links1[abs(links2[pn][0])-1] and links2[abs(links2[pn][0])-1]:
+ links2[pn] = [i
+ for i in [links1[abs(links2[pn][0])-1], links2[abs(links2[pn][0])-1]]
+ if abs(i[0]) -1 != pn][0]
+ else:
+ links2[pn] = ['End']
+
+ else:
+ dtype[pn] = (wn.nodes[pipe.end_node_name].transient_node_type,
+ wn.nodes[pipe.end_node_name])
+
+ return links1, links2, utype, dtype
\ No newline at end of file
diff --git a/Python/tsnet/postprocessing/__init__.py b/Python/tsnet/postprocessing/__init__.py
new file mode 100644
index 0000000..4cc33ea
--- /dev/null
+++ b/Python/tsnet/postprocessing/__init__.py
@@ -0,0 +1,7 @@
+"""
+The tsnet.postprocessing package contains functions to
+postprocess the simulation results.
+
+"""
+from .time_history import plot_head_history, plot_velocity_history
+from .detect_cusum import detect_cusum
\ No newline at end of file
diff --git a/Python/tsnet/postprocessing/detect_cusum.py b/Python/tsnet/postprocessing/detect_cusum.py
new file mode 100644
index 0000000..3bb58a9
--- /dev/null
+++ b/Python/tsnet/postprocessing/detect_cusum.py
@@ -0,0 +1,190 @@
+"""
+The tsnet.postprocessing.detect_cusum module contains function to perform
+Cumulative sum algorithm (CUSUM) to detect abrupt changes in data.
+
+"""
+
+import numpy as np
+import matplotlib.dates as mdates
+
+def detect_cusum(time, x, threshold, drift, show,
+ ending=True, ax=None):
+
+ """
+ Parameters
+ ----------
+ time : 1D array-like
+ time.
+ x : 1D array_like
+ data.
+ threshold : positive number, optional (default = 1)
+ amplitude threshold for the change in the data.
+ drift : positive number, optional (default = 0)
+ drift term that prevents any change in the absence of change.
+ ending : bool, optional (default = False)
+ True (1) to estimate when the change ends; False (0) otherwise.
+ show : bool, optional (default = True)
+ True (1) plots data in matplotlib figure, False (0) don't plot.
+ ax : a matplotlib.axes.Axes instance, optional (default = None).
+
+ Returns
+ -------
+ tai : 1D array_like, int
+ index of when the change started.
+ taf : 1D array_like, int
+ index of when the change ended (if `ending` is True).
+ amp : 1D array_like, float
+ amplitude of changes (if `ending` is True).
+
+ Notes
+ -----
+ Tuning of the CUSUM algorithm according to Gustafsson (2000)[1]_:
+ Start with a very large `threshold`.
+ Choose `drift` to one half of the expected change, or adjust `drift` such
+ that `g` = 0 more than 50% of the time.
+ Then set the `threshold` so the required number of false alarms (this can
+ be done automatically) or delay for detection is obtained.
+ If faster detection is sought, try to decrease `drift`.
+ If fewer false alarms are wanted, try to increase `drift`.
+ If there is a subset of the change times that does not make sense,
+ try to increase `drift`.
+
+ Note that by default repeated sequential changes, i.e., changes that have
+ the same beginning (`tai`) are not deleted because the changes were
+ detected by the alarm (`ta`) at different instants. This is how the
+ classical CUSUM algorithm operates.
+
+ If you want to delete the repeated sequential changes and keep only the
+ beginning of the first sequential change, set the parameter `ending` to
+ True. In this case, the index of the ending of the change (`taf`) and the
+ amplitude of the change (or of the total amplitude for a repeated
+ sequential change) are calculated and only the first change of the repeated
+ sequential changes is kept. In this case, it is likely that `ta`, `tai`,
+ and `taf` will have less values than when `ending` was set to False.
+
+ See this IPython Notebook [2]_.
+
+ References
+ ----------
+ .. [1] Gustafsson (2000) Adaptive Filtering and Change Detection.
+ .. [2] hhttp://nbviewer.ipython.org/github/demotu/BMC/blob/master/notebooks/DetectCUSUM.ipynb
+
+ """
+
+ x = np.atleast_1d(x).astype('float64')
+ time = np.atleast_1d(time).astype('float64')
+ gp, gn = np.zeros(x.size), np.zeros(x.size)
+ gp_real, gn_real = np.zeros(x.size), np.zeros(x.size)
+ ta, tai, taf = np.array([[], [], []], dtype=int)
+ tap, tan = 0, 0
+ amp = np.array([])
+
+# # Find changes (online form)
+# for i in range(1, x.size):
+# s = x[i] - x[i-1]
+# gp[i] = gp[i-1] + s - drift # cumulative sum for + change
+# gn[i] = gn[i-1] - s - drift # cumulative sum for - change
+# if gp[i] < 0:
+# gp[i], tap = 0, i
+# if gn[i] < 0:
+# gn[i], tan = 0, i
+# if gp[i] > threshold or gn[i] > threshold: # change detected!
+# ta = np.append(ta, i) # alarm index
+# tai = np.append(tai, tap if gp[i] > threshold else tan) # start
+# gp[i], gn[i] = 0, 0 # reset alarm
+# # THE CLASSICAL CUSUM ALGORITHM ENDS HERE
+
+ # Find changes (online form)
+ # add gp_real and gn_rel to track the actual amplitude of the transient
+ for i in range(1, x.size):
+ s = x[i] - x[i-1]
+ gp[i] = gp[i-1] + s - drift # cumulative sum for + change
+ gp_real[i] = gp_real[i-1] + s
+ gn[i] = gn[i-1] - s - drift # cumulative sum for - change
+ gn_real[i] = gn_real[i-1] - s
+
+ if gp[i] < 0:
+ gp[i], gp_real[i], tap = 0, 0, i
+ if gn[i] < 0:
+ gn[i], gn_real[i], tan = 0, 0, i
+ if gp_real[i] > threshold or gn_real[i] > threshold: # change detected!
+ ta = np.append(ta, i) # alarm index
+ tai = np.append(tai, tap if gp_real[i] > threshold else tan) # start
+ gp[i], gn[i] = 0, 0 # reset alarm
+ gp_real[i], gn_real[i] = 0, 0
+ # THE CLASSICAL CUSUM ALGORITHM ENDS HERE
+
+ # Estimation of when the change ends (offline form)
+ if tai.size and ending:
+ tai2, _, _ = detect_cusum(time[::-1],x[::-1], threshold, drift, ending=False, show=False)
+ taf = x.size - tai2[::-1] - 1
+ # Eliminate repeated changes, changes that have the same beginning
+ tai, ind = np.unique(tai, return_index=True)
+ ta = ta[ind]
+ # taf = np.unique(taf, return_index=False) # corect later
+ if tai.size != taf.size:
+ if tai.size < taf.size:
+ taf = taf[[np.argmax(taf >= i) for i in ta]]
+ else:
+ ind = [np.argmax(i >= ta[::-1])-1 for i in taf]
+ ta = ta[ind]
+ tai = tai[ind]
+ # Delete intercalated changes (the ending of the change is after
+ # the beginning of the next change)
+ ind = taf[:-1] - tai[1:] > 0
+ if ind.any():
+ ta = ta[~np.append(False, ind)]
+ tai = tai[~np.append(False, ind)]
+ taf = taf[~np.append(ind, False)]
+ # Amplitude of changes
+ amp = x[taf] - x[tai]
+ if show:
+ _plot(time, x, threshold, drift, ending, ax, ta, tai, taf,
+ gp_real, gn_real)
+
+ return tai, taf, amp
+
+
+def _plot(time, x, threshold, drift, ending, ax, ta, tai, taf, gp, gn):
+ """Plot results of the detect_cusum function, see its help."""
+
+ try:
+ import matplotlib.pyplot as plt
+ except ImportError:
+ print('matplotlib is not available.')
+ else:
+ if ax is None:
+ fig, ax = plt.subplots(1, 1, figsize=(8,4), dpi=100, facecolor='w', edgecolor='k')
+
+ ax.plot(time , x, 'k-', lw=2)
+ if len(ta):
+ ax.plot(time[tai], x[tai], '>', mfc='r', mec='r', ms=10,
+ label='Start')
+
+ if ending:
+ ax.plot(time[taf], x[taf], '<', mfc='r', mec='r', ms=10,
+ label='End')
+ ax.legend(loc='best', framealpha=.5, numpoints=1)
+ ax.set_xlim([time[0], time[-1]])
+ ax.set_xlabel('Time [s]', fontsize=14)
+ ax.set_ylabel('Pressure Head [m]', fontsize=14)
+ ymin, ymax = x[np.isfinite(x)].min(), x[np.isfinite(x)].max()
+ yrange = ymax - ymin if ymax > ymin else 1
+ ax.set_ylim(ymin - 0.1*yrange, ymax + 0.1*yrange)
+
+# ax2.plot(time, gp, 'y-', label='+')
+# ax2.plot(time, gn, 'm-', label='-')
+# ax2.set_xlim([time[0], time[-1]])
+# ax2.set_xlabel('Time', fontsize=14)
+# ax2.set_ylim(-0.01*threshold, 1.1*threshold)
+# ax2.axhline(threshold, color='r')
+# ax2.set_ylabel('Cumulative Sum (c)', fontsize=14)
+# # ax2.set_title('Time series of the cumulative sums of ' +
+# # 'positive and negative changes')
+# ax2.set_title('(b)', fontsize=14)
+# ax2.legend(loc='best', framealpha=.5, numpoints=1)
+# plt.tight_layout()
+ plt.show()
+
+
+
diff --git a/Python/tsnet/postprocessing/time_history.py b/Python/tsnet/postprocessing/time_history.py
new file mode 100644
index 0000000..d0002bd
--- /dev/null
+++ b/Python/tsnet/postprocessing/time_history.py
@@ -0,0 +1,61 @@
+"""
+The tsnet.postprocessing.time_history module contains functions
+to plot the time history of head and velocity at the start and
+end point of a pipe
+"""
+from __future__ import print_function
+import matplotlib.pyplot as plt
+
+def plot_head_history(pipe,H,wn,tt):
+ """Plot Head history on the start and end node of a pipe
+
+ Parameters
+ ----------
+ pipe : str
+ Name of the pipe where you want to report the head
+ H : list
+ Head results
+ wn : wntr.network.model.WaterNetworkModel
+ Network
+ tt : list
+ Simulation timestamps
+ """
+
+ pipeid = wn.links[pipe].id-1
+ plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='k')
+ plt.plot(tt,H[pipeid][0,:], 'b-',label='Start Node')
+ plt.plot(tt,H[pipeid][-1,:], 'r-',label='End Node')
+ plt.xlim([tt[0],tt[-1]])
+ plt.title('Pressure Head of Pipe %s '%pipe)
+ plt.xlabel("Time")
+ plt.ylabel("Pressure Head (m)")
+ plt.legend(loc='best')
+ plt.grid(True)
+ plt.show()
+
+def plot_velocity_history(pipe,V,wn,tt):
+ """Plot Velocity history on the start and end node of a pipe
+
+ Parameters
+ ----------
+ pipe : str
+ Name of the pipe where you want to report the head
+ V : list
+ velocity results
+ wn : wntr.network.model.WaterNetworkModel
+ Network
+ tt : list
+ Simulation timestamps
+ """
+
+ pipeid = wn.links[pipe].id-1
+ plt.figure(figsize=(10,4), dpi=80, facecolor='w', edgecolor='k')
+ plt.plot(tt,V[pipeid][0,:], 'b-',label='Start Node')
+ plt.plot(tt,V[pipeid][-1,:], 'r-',label='End Node')
+ plt.xlim([tt[0],tt[-1]])
+ plt.title('Velocity Head of Pipe %s ' %pipe)
+ plt.xlabel("Time")
+ plt.ylabel("Velocity (m/s)")
+ plt.legend(loc='best')
+ plt.grid(True)
+ plt.show()
\ No newline at end of file
diff --git a/Python/tsnet/requirements.txt b/Python/tsnet/requirements.txt
new file mode 100644
index 0000000..c62de9d
--- /dev/null
+++ b/Python/tsnet/requirements.txt
@@ -0,0 +1,7 @@
+networkx
+pandas
+numpy
+scipy
+matplotlib
+plotly
+wntr
diff --git a/Python/tsnet/requirements_dev.txt b/Python/tsnet/requirements_dev.txt
new file mode 100644
index 0000000..93d9996
--- /dev/null
+++ b/Python/tsnet/requirements_dev.txt
@@ -0,0 +1,11 @@
+pip==21.1
+bumpversion==0.5.3
+wheel==0.32.1
+watchdog==0.9.0
+flake8==3.5.0
+tox
+coverage==4.5.1
+Sphinx==1.8.1
+twine==1.12.1
+pytest
+pytest-runner
diff --git a/Python/tsnet/simulation/__init__.py b/Python/tsnet/simulation/__init__.py
new file mode 100644
index 0000000..164986a
--- /dev/null
+++ b/Python/tsnet/simulation/__init__.py
@@ -0,0 +1,7 @@
+"""
+The tsnet.simulation package contains methods to run transient simulation
+using MOC method
+
+"""
+from .main import MOCSimulator
+from .initialize import Initializer
diff --git a/Python/tsnet/simulation/initialize.py b/Python/tsnet/simulation/initialize.py
new file mode 100644
index 0000000..66121f0
--- /dev/null
+++ b/Python/tsnet/simulation/initialize.py
@@ -0,0 +1,252 @@
+"""
+The tsnet.simulation.initialize contains functions to
+1. Initialize the list containing numpy arrays for velocity and head.
+2. Calculate initial conditions using Epanet engine.
+3. Calculate D-W coefficients based on initial conditions.
+4. Calculate demand coefficients based on initial conditions.
+
+"""
+
+import wntr
+import numpy as np
+import warnings
+from tsnet.utils import calc_parabola_vertex
+
+def Initializer(tm, t0, engine='DD'):
+ """Initial Condition Calculation.
+
+ Initialize the list containing numpy arrays for velocity and head.
+ Calculate initial conditions using Epanet engine.
+ Calculate D-W coefficients based on initial conditions.
+ Calculate demand coefficients based on initial conditions.
+
+ Parameters
+ ----------
+ tm : tsnet.network.geometry.TransientModel
+ Simulated network
+ t0 : float
+ time to calculate initial condition
+ engine : string
+ steady state calculation engine:
+ DD: demand driven;
+ PDD: pressure dependent demand,
+ by default DD
+
+
+ Returns
+ -------
+ tm : tsnet.network.geometry.TransientModel
+ Network with updated parameters
+ """
+ # adjust the time step and discretize each pipe
+
+ tn = int(tm.simulation_period/tm.time_step) # Total time steps
+ print ('Total Time Step in this simulation %s' %tn)
+
+ # create new attributes for each pipe to store head and velocity results
+ # at its start and end node.
+ for _, pipe in tm.pipes():
+ pipe.start_node_head = np.zeros(tn)
+ pipe.start_node_velocity = np.zeros(tn)
+ pipe.start_node_flowrate = np.zeros(tn)
+ pipe.end_node_head = np.zeros(tn)
+ pipe.end_node_velocity = np.zeros(tn)
+ pipe.end_node_flowrate = np.zeros(tn)
+
+ # create new attributes for each node to store head and discharge results
+ for _,node in tm.nodes():
+ node.demand_discharge = np.zeros(tn)
+ node.emitter_discharge = np.zeros(tn)
+
+ # calculate initial conditions using EPAnet engine
+ for _,node in tm.nodes():
+ if node._leak_status == True:
+ node.add_leak(tm, area=node.emitter_coeff/np.sqrt(2*9.81),
+ discharge_coeff = 1, start_time = t0)
+ if engine.lower() == 'dd':
+ tm.options.hydraulic.demand_model = 'DD'
+ sim = wntr.sim.EpanetSimulator(tm)
+ results = sim.run_sim()
+ elif engine.lower() == 'pdd':
+ tm.options.hydraulic.demand_model = 'PDD'
+ sim = wntr.sim.EpanetSimulator(tm)
+ results = sim.run_sim()
+ else:
+ raise Exception("Unknown initial calculation engine. \
+ The engine can only be 'DD' or 'PDD'.")
+
+ for _,node in tm.nodes():
+ node.initial_head = results.node['head'].loc[t0, node.name]
+
+ for _,link in tm.links():
+ link.initial_flow = results.link['flowrate'].loc[t0, link.name]
+ nu = 1.004e-6
+ for _, pipe in tm.pipes():
+ # assign the initial conditions to the latest result arrays
+
+ V = np.sign(results.link['flowrate'].loc[t0, pipe.name])*\
+ results.link['velocity'].loc[t0, pipe.name]*\
+ np.ones(pipe.number_of_segments+1)
+
+ H = [results.node['head'].loc[t0, pipe.start_node_name] +\
+ i* ((results.node['head'].loc[t0, pipe.end_node_name]-
+ results.node['head'].loc[t0, pipe.start_node_name])/
+ (pipe.number_of_segments))
+ for i in range(pipe.number_of_segments+1)]
+
+ H = np.array(H)
+ pipe.initial_head = H
+ pipe.initial_velocity = V
+ pipe.initial_Re = np.abs(V[0]*pipe.diameter/nu)
+
+ # assign the initial conditions to the results attributes
+ pipe.start_node_velocity[0] = V[0]
+ pipe.end_node_velocity[0] = V[-1]
+ pipe.start_node_head[0] = H[0]
+ pipe.end_node_head[0] = H[-1]
+ pipe.start_node_flowrate[0] = V[0]*pipe.area
+ pipe.end_node_flowrate[0] = V[-1]*pipe.area
+
+ # calculate demand coefficient
+ Hs = H[0]
+ He = H[-1]
+ demand = [0,0] # demand at start and end node
+ try :
+ demand[0] = results.node['demand'].loc[t0, pipe.start_node_name]
+ # demand[0] = tm.nodes[pipe.start_node_name].demand_timeseries_list.at(t0)
+ except:
+ demand[0] = 0.
+ try :
+ demand[1] = results.node['demand'].loc[t0, pipe.end_node_name]
+ # demand[1] = tm.nodes[pipe.end_node_name].demand_timeseries_list.at(t0)
+ except :
+ demand[1] = 0.
+ try :
+ Hsa = H[0] -pipe.start_node.elevation
+ except:
+ Hsa = 1.
+ try :
+ Hea = H[-1]- pipe.end_node.elevation
+ except :
+ Hea=1.
+ pipe = cal_demand_coef(demand, pipe, Hsa, Hea, t0)
+
+ # calculate demnad discharge and emitter discharge
+ if pipe.start_node.node_type == 'Junction':
+ pipe.start_node.emitter_discharge[0] = pipe.start_node.emitter_coeff * np.sqrt(Hsa)
+ pipe.start_node.demand_discharge[0] = pipe.start_node.demand_coeff * np.sqrt(Hsa)
+ if pipe.end_node.node_type == 'Junction':
+ pipe.end_node.emitter_discharge[0] = pipe.end_node.emitter_coeff * np.sqrt(Hea)
+ pipe.end_node.demand_discharge[0] = pipe.end_node.demand_coeff * np.sqrt(Hea)
+
+ # calculate roughness coefficient
+ Vp = V[0]
+ hl = abs(Hs - He)
+ pipe = cal_roughness_coef(pipe, Vp, hl )
+
+ # set initial conditions as a new attribute to TransientModel
+ tm.initial_head = H
+ tm.initial_velocity = V
+
+ # add pump operation points
+ tm = pump_operation_points(tm)
+
+ return tm
+
+def cal_demand_coef(demand, pipe, Hs, He, t0=0.):
+
+ """Calculate the demand coefficient for the start and end node of the pipe.
+
+ Parameters
+ ----------
+ demand : list
+ Demand at the start (demand[0]) and end demand[1] node
+ pipe : object
+ Pipe object
+ Hs : float
+ Head at the start node
+ He : float
+ Head at the end node
+ t0 : float, optional
+ Time to start initial condition calculation, by default 0
+
+ Returns
+ -------
+ pipe : object
+ Pipe object with calculated demand coefficient
+ """
+
+ try:
+ start_demand_coeff = demand[0]/ np.sqrt(Hs)
+ except :
+ start_demand_coeff = 0.
+
+ try:
+ end_demand_coeff = demand[1] / np.sqrt(He)
+ except :
+ end_demand_coeff = 0.
+ pipe.start_node.demand_coeff = start_demand_coeff # [m^3/s/(m H20)^(1/2)]
+ pipe.end_node.demand_coeff = end_demand_coeff # [m^3/s/(m H20)^(1/2)]
+ return pipe
+
+def cal_roughness_coef(pipe, V, hl):
+ """Calculate the D-W roughness coefficient based on initial conditions.
+
+ Parameters
+ ----------
+ pipe : object
+ Pipe object
+ V : float
+ Initial flow velocity in the pipe
+ hl : float
+ Initial head loss in the pipe
+
+ Returns
+ -------
+ pipe : object
+ Pipe object with calculated D-W roughness coefficient.
+ """
+
+ g = 9.8
+ H_tol = 1e-3
+ V_tol = 1e-5
+
+ if abs(V) >= V_tol and hl >= H_tol:
+ pipe.roughness = hl / (pipe.length/pipe.diameter) / (V**2/2/g)
+ else:
+ pipe.roughness = 0
+
+ if pipe.roughness >0.08:
+ warnings.warn("%s :the friction coefficient %.4f is too large. \
+ The D-W coeff has been set to 0.03 "
+ %(pipe.name, pipe.roughness))
+ pipe.roughness = 0.03
+ if pipe.roughness!= 0:
+ pipe.roughness_height = max(10**(-1/1.8/np.sqrt(pipe.roughness)) - 6.9/pipe.initial_Re, 0)
+ else:
+ pipe.roughness_height = 0
+ return pipe
+
+def pump_operation_points(tm):
+ #add operation points to the pump
+ for _, pump in tm.pumps():
+ opt_point = (pump.initial_flow, abs(pump.end_node.initial_head-pump.start_node.initial_head))
+ def_points = pump.get_pump_curve().points
+ # single-point pump curve
+ if len(def_points) == 1:
+ (flow, head) = def_points[0]
+ def_points.append((0., 1.33*head))
+ def_points.append((2*flow, 0.))
+ elif len(def_points) != 3:
+ raise Exception("TSNet only support one-point or three-point pump curve.")
+
+ dist = []
+ for (i,j) in def_points:
+ dist.append(np.sqrt((i - opt_point[0])**2 + (j - opt_point[1])**2))
+
+ pump.get_pump_curve().points.remove(def_points[dist.index(min(dist))])
+ pump.get_pump_curve().points.append(opt_point)
+
+ pump.curve_coef = calc_parabola_vertex(pump.get_pump_curve().points)
+
+ return tm
diff --git a/Python/tsnet/simulation/main.py b/Python/tsnet/simulation/main.py
new file mode 100644
index 0000000..8d96d69
--- /dev/null
+++ b/Python/tsnet/simulation/main.py
@@ -0,0 +1,462 @@
+"""
+The tsnet.simulation.main module contains function to perform
+the workflow of read, discretize, initial, and transient
+simulation for the given .inp file.
+
+"""
+from __future__ import print_function
+from tsnet.network import topology
+from tsnet.simulation.single import inner_pipe, left_boundary, right_boundary
+from tsnet.utils import valve_curve, memo, print_time_delta
+from tsnet.utils import calc_parabola_vertex
+import numpy as np
+import warnings
+from datetime import datetime
+import pickle
+
+def MOCSimulator(tm, results_obj='results', friction='steady'):
+ """ MOC Main Function
+
+ Parameters
+ ----------
+ tm : tsnet.network.model.TransientModel
+ Network
+ results_obj: string, optional
+ the name of the results file, by default 'results'
+ friction: string, optional
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ Returns
+ ------
+ tm : tsnet.network.model.TransientModel
+ Simulated network
+ """
+ # determine network topology
+ links1, links2, utype, dtype = topology(tm)
+
+ tt = ['x']
+ tt.append(0)
+ dt = tm.time_step
+ tn = int(tm.simulation_period/tm.time_step) # Total time steps
+ # check whether input is legal
+ if not friction in ['steady', 'unsteady', 'quasi-steady']:
+ print ("Please specify a friction model from 'steady', 'unsteady', and 'quasi-steady'")
+
+ # determine which node of the adjacent pipe should be call:
+ # if the adjacent pipe is entering the junction, then -2
+ # if the adjacent pipe is leaving the junction, then 1
+ a = {1:-2, -1:1}
+ b = {1:-1, -1:0}
+ # generat a list of pipe
+ p = []
+ # results from last time step
+ H = [0] * tm.num_pipes
+ V = [0] * tm.num_pipes
+ # results at current time step
+ HN = [0] * tm.num_pipes
+ VN = [0] * tm.num_pipes
+ # results for local and convective
+ # instantaneous acceleration
+ dVdt = [0] * tm.num_pipes
+ dVdx = [0] * tm.num_pipes
+ Hb = 10.3 # barometric head
+ for _, pipe in tm.pipes():
+ p.append(pipe)
+
+ # initial condition
+ for _, pipe in tm.pipes():
+ pn = pipe.id-1
+ H[pn] = pipe.initial_head
+ V[pn] = pipe.initial_velocity
+ if friction == 'unsteady':
+ dVdt[pn] = np.zeros_like(V[pn])
+ dVdx[pn] = np.diff(V[pn])/(pipe.length/pipe.number_of_segments)
+ else:
+ dVdt[pn] = np.zeros_like(V[pn])
+ dVdx[pn] = np.zeros_like(V[pn][:-1])
+ for _,node in tm.nodes():
+ if node.pulse_status == True:
+ node.base_demand_coeff = node.demand_coeff
+ if node.transient_node_type == 'SurgeTank' or node.transient_node_type == 'Chamber':
+ if node.transient_node_type == 'Chamber':
+ m = 1.2
+ Ha = node.initial_head - node.water_level + Hb # air pressure head
+ Va = node.tank_shape[0]*(node.tank_height-node.water_level) # air volume
+ node.air_constant = Ha * Va**m
+ node.tank_shape.insert(2,node.air_constant)
+ elif node.transient_node_type == 'SurgeTank':
+ node.water_level = node.initial_head
+ node.tank_shape.insert(1,node.water_level)
+ node.water_level_timeseries = np.zeros(tn)
+ node.tank_flow_timeseries = np.zeros(tn)
+ node.water_level_timeseries[0] = node.water_level
+ starttime = datetime.now()
+ # Start Calculation
+ for ts in range(1,tn):
+ # check the discrepency between initial condition and the
+ # first step in the transient simulation.
+ if ts == 2:
+ for _,pipe in tm.pipes():
+ diff1 = pipe.start_node_head[1] - pipe.start_node_head[0]
+ diff2 = pipe.end_node_head[1] - pipe.end_node_head[0]
+ if abs(diff1)> 5e-1:
+ print('Initial condition discrepancy of pressure (%.4f m) on the %s node' %(diff1,pipe.start_node.name))
+ if abs(diff2)> 5e-1:
+ print('Initial condition discrepancy of pressure (%.4f m) on the %s node'%(diff2,pipe.end_node.name))
+ if ts == 3:
+ timeperstep = (datetime.now() - starttime) /2.
+ est = timeperstep *tn
+ print ('Estimated simulation time %s' %est)
+
+ t = ts*dt
+ tt.append(t)
+ tp = ts/tn*100
+ if ts % int(tn/10) == 0 :
+ print('Transient simulation completed %i %%...' %tp )
+ # for burst node: emitter_coeff = burst_coeff[ts]
+ for _,node in tm.nodes():
+ if node.burst_status == True:
+ node.emitter_coeff = node.burst_coeff[ts]
+ if node.pulse_status == True:
+ node.demand_coeff = node.base_demand_coeff*(1.+node.pulse_coeff[ts])
+
+ # initialize the results at this time step
+ for _, pipe in tm.pipes():
+ pn = pipe.id-1
+ HN[pn] = np.zeros_like(H[pn])
+ VN[pn] = np.zeros_like(V[pn])
+
+ for _,pipe in tm.pipes():
+ pn = pipe.id-1
+ # Assumption:
+ # when a pipe is connected with a pump or valve,
+ # the connection is not branch junction.
+
+ # inner pipes
+ if links1[pn] and links2[pn] and \
+ links1[pn] != ['End'] and links2[pn] != ['End']:
+ # list to store information about pump and vale
+ # pump[0] and valve[0] for upstream elemnets
+ # pump[1] and valve[1] for downstream elements
+ pump = [[],[]]; valve = [0,0]
+ # upstream
+ if utype[pn][0] == 'Pump':
+ # three points for pump charatersitics curve
+ pump[0] = [tm.links[utype[pn][1]].curve_coef, "d"]
+ if pipe.start_node.name == tm.links[utype[pn][1]].start_node.name:
+ pump[0][1] = "s" # suction side
+ # calculate the coordinate of the three points
+ # based on the pump speed
+ if tm.links[utype[pn][1]].operating == True:
+ points = tm.links[utype[pn][1]].get_pump_curve().points
+ po = tm.links[utype[pn][1]].operation_rule[ts]
+ points=[(i*po,j*po**2) for (i,j) in points]
+ pump[0][0] = calc_parabola_vertex(points)
+
+ elif utype[pn][0] == 'Valve':
+ # determine valve friction coefficients based on
+ # open percentage
+ if tm.links[utype[pn][1]].operating == True:
+ valve[0] = valve_curve(tm.links[utype[pn][1]].operation_rule[ts]*100,
+ tm.links[utype[pn][1]].valve_coeff)
+ else :
+ if tm.links[utype[pn][1]].initial_status.name == 'Open':
+ valve[0] = valve_curve(100,tm.links[utype[pn][1]].valve_coeff)
+ elif tm.links[utype[pn][1]].initial_status.name == 'Closed':
+ valve[0] = valve_curve(0,tm.links[utype[pn][1]].valve_coeff)
+ # downstream
+ if dtype[pn][0] == 'Pump':
+ pump[1] = [tm.links[dtype[pn][1]].curve_coef,"d"]
+ if pipe.end_node.name == tm.links[dtype[pn][1]].start_node.name:
+ pump[1][1] = "s" # suction side
+ if tm.links[dtype[pn][1]].operating == True:
+ points = tm.links[dtype[pn][1]].get_pump_curve().points
+ po = tm.links[dtype[pn][1]].operation_rule[ts]
+ points=[(i*po,j*po**2) for (i,j) in points]
+ pump[1][0] = calc_parabola_vertex(points)
+
+ elif dtype[pn][0] == 'Valve':
+ if tm.links[dtype[pn][1]].operating == True:
+ valve[1] = valve_curve(tm.links[dtype[pn][1]].operation_rule[ts]*100,
+ tm.links[dtype[pn][1]].valve_coeff)
+ else :
+ if tm.links[dtype[pn][1]].initial_status.name == 'Open':
+ valve[1] = valve_curve(100,tm.links[dtype[pn][1]].valve_coeff)
+ elif tm.links[dtype[pn][1]].initial_status.name == 'Closed':
+ valve[1] = valve_curve(0,tm.links[dtype[pn][1]].valve_coeff)
+
+ HN[pn], VN[pn] = inner_pipe(pipe, pn, dt,
+ links1[pn], links2[pn], utype[pn], dtype[pn], p,
+ H[pn], V[pn], HN[pn], VN[pn],
+ [H[abs(i)-1][a[np.sign(i)]] for i in links1[pn]],
+ [V[abs(i)-1][a[np.sign(i)]] for i in links1[pn]],
+ [H[abs(i)-1][a[np.sign(i)]] for i in links2[pn]],
+ [V[abs(i)-1][a[np.sign(i)]] for i in links2[pn]],
+ pump, valve, friction, dVdt[pn], dVdx[pn],
+ [dVdt[abs(i)-1][a[np.sign(i)]] for i in links1[pn]],
+ [dVdx[abs(i)-1][b[np.sign(i)]] for i in links1[pn]],
+ [dVdt[abs(i)-1][a[np.sign(i)]] for i in links2[pn]],
+ [dVdx[abs(i)-1][b[np.sign(i)]] for i in links2[pn]])
+ # record results
+ pipe.start_node_velocity[ts] = VN[pn][0]
+ pipe.end_node_velocity[ts] = VN[pn][-1]
+ pipe.start_node_flowrate[ts] = VN[pn][0]*pipe.area
+ pipe.end_node_flowrate[ts] = VN[pn][-1]*pipe.area
+ pipe.start_node_head[ts] = HN[pn][0]
+ pipe.end_node_head[ts] = HN[pn][-1]
+
+ if pipe.start_node.transient_node_type == 'Junction':
+ if HN[pn][0] - pipe.start_node.elevation >0:
+ h = HN[pn][0] - pipe.start_node.elevation
+ pipe.start_node.demand_discharge[ts] = pipe.start_node.demand_coeff * np.sqrt(h)
+ pipe.start_node.emitter_discharge[ts] = pipe.start_node.emitter_coeff * np.sqrt(h)
+ else: # assume reverse flow preventer installed
+ pipe.start_node.emitter_discharge[ts] = 0.
+ pipe.start_node.demand_discharge[ts] = 0.
+ warnings.warn("Negative pressure on node %s. Backflow stopped by reverse flow preventer." %pipe.start_node.name)
+
+ if pipe.end_node.transient_node_type == 'Junction':
+ if HN[pn][-1] -pipe.end_node.elevation >0:
+ h = HN[pn][-1] -pipe.end_node.elevation
+ pipe.end_node.emitter_discharge[ts] = pipe.end_node.emitter_coeff * np.sqrt(h)
+ pipe.end_node.demand_discharge[ts] = pipe.end_node.demand_coeff * np.sqrt(h)
+ else: # assume reverse flow preventer installed
+ pipe.end_node.emitter_discharge[ts] = 0.
+ pipe.end_node.demand_discharge[ts] = 0.
+ warnings.warn("Negative pressure on node %s Backflow stopped by reverse flow preventer." %pipe.start_node.name)
+
+ # left boundary pipe
+ elif not links1[pn] or links1[pn] == ['End']:
+ pump = [[],[]]; valve = [0,0]
+ # LEFT BOUNDARY
+ if utype[pn][0] == 'Reservoir' or utype[pn][0] == 'Tank':
+ # head B.C.
+ HN[pn][0] = pipe.initial_head[0]
+ elif utype[pn][0] == 'Junction':
+ VN[pn][0] = pipe.initial_velocity[0]
+ elif utype[pn][0] == 'Valve':
+ if tm.links[utype[pn][1]].operating == True:
+ # velocity B.C.
+ VN[pn][0] = pipe.initial_velocity[0] * \
+ tm.links[utype[pn][1]].operation_rule[ts]
+ else :
+ if tm.links[utype[pn][1]].initial_status.name == 'Open':
+ VN[pn][0] = pipe.initial_velocity[0]
+ elif tm.links[utype[pn][1]].initial_status.name == 'Closed':
+ valve[0] = 0
+ elif utype[pn][0] == 'Pump':
+ # source pump
+ # pump[0][0]: elevation of the reservoir/tank
+ # pump[0][1]: three points for pump characteristic curve
+ pump[0] = [[tm.links[utype[pn][1]].start_node.initial_head][0],
+ tm.links[utype[pn][1]].curve_coef]
+ if tm.links[utype[pn][1]].operating == True:
+ points = tm.links[utype[pn][1]].get_pump_curve().points
+ po = tm.links[utype[pn][1]].operation_rule[ts]
+ points= [(i*po,j*po**2) for (i,j) in points]
+ pump[0][1] = calc_parabola_vertex(points)
+ else:
+ warnings.warn ('Pipe %s miss %s upstream.' %(pipe, utype[pn][0]))
+
+ # RIGHT BOUNDARY
+ if dtype[pn][0] == 'Pump':
+ pump[1] = [tm.links[dtype[pn][1]].curve_coef,"d"]
+ if pipe.end_node.name == tm.links[dtype[pn][1]].start_node.name:
+ pump[1][1] = "s" # suction side
+ if tm.links[dtype[pn][1]].operating == True:
+ points = tm.links[dtype[pn][1]].get_pump_curve().points
+ po = tm.links[dtype[pn][1]].operation_rule[ts]
+ points=[(i*po,j*po**2) for (i,j) in points]
+ pump[1][0] = calc_parabola_vertex(points)
+
+ elif dtype[pn][0] == 'Valve':
+ if tm.links[dtype[pn][1]].operating == True:
+ valve[1] = valve_curve(tm.links[dtype[pn][1]].operation_rule*100,
+ tm.links[dtype[pn][1]].valve_coeff)
+ else :
+ if tm.links[dtype[pn][1]].initial_status.name == 'Open':
+ valve[1] = valve_curve(100, tm.links[dtype[pn][1]].valve_coeff)
+ elif tm.links[dtype[pn][1]].initial_status.name == 'Closed':
+ valve[1] = valve_curve(0, tm.links[dtype[pn][1]].valve_coeff)
+ # if also the right valve end
+ if links2[pn] == ['End']:
+ links2[pn] = []
+
+ elif dtype[pn][0] == 'Junction':
+ VN[pn][-1] = pipe.initial_velocity[-1]
+
+ HN[pn], VN[pn] = left_boundary(pipe, pn,
+ HN[pn], VN[pn], H[pn], V[pn],
+ links2[pn], p, pump, valve, dt,
+ [H[abs(i)-1][a[np.sign(i)]] for i in links2[pn]],
+ [V[abs(i)-1][a[np.sign(i)]] for i in links2[pn]],
+ utype[pn], dtype[pn],
+ friction, dVdt[pn], dVdx[pn],
+ [dVdt[abs(i)-1][a[np.sign(i)]] for i in links2[pn]],
+ [dVdx[abs(i)-1][b[np.sign(i)]] for i in links2[pn]],)
+ # record results
+ pipe.start_node_velocity[ts] = VN[pn][0]
+ pipe.end_node_velocity[ts] = VN[pn][-1]
+ pipe.start_node_head[ts] = HN[pn][0]
+ pipe.end_node_head[ts] = HN[pn][-1]
+ pipe.start_node_flowrate[ts] = VN[pn][0]*pipe.area
+ pipe.end_node_flowrate[ts] = VN[pn][-1]*pipe.area
+
+ try:
+ if HN[pn][0]- pipe.start_node.elevation >0:
+ h = HN[pn][0]- pipe.start_node.elevation
+ pipe.start_node.demand_discharge[ts] = pipe.start_node.demand_coeff * np.sqrt(h)
+ pipe.start_node.emitter_discharge[ts] = pipe.start_node.emitter_coeff * np.sqrt(h)
+ else: # assume reverse flow preventer installed
+ pipe.start_node.emitter_discharge[ts] = 0.
+ pipe.start_node.demand_discharge[ts] = 0.
+ warnings.warn("Negative pressure on node %s.\
+ Backflow stopped by reverse flow preventer." %pipe.start_node.name)
+ except:
+ pass
+
+ try:
+ if HN[pn][-1]-pipe.end_node.elevation >0:
+ h = HN[pn][-1]-pipe.end_node.elevation
+ pipe.end_node.emitter_discharge[ts] = pipe.end_node.emitter_coeff * np.sqrt(h)
+ pipe.end_node.demand_discharge[ts] = pipe.end_node.demand_coeff * np.sqrt(h)
+ else: # assume reverse flow preventer installed
+ pipe.end_node.emitter_discharge[ts] = 0.
+ pipe.end_node.demand_discharge[ts] = 0.
+ warnings.warn("Negative pressure on node %s.\
+ Backflow stopped by reverse flow preventer." %pipe.start_node.name)
+ except:
+ pass
+
+ # right boundary pipe
+ elif not links2[pn] or links2[pn] == ['End']:
+ pump = [[],[]]; valve = [0,0]
+ # RIGHT boundary
+ if dtype[pn][0] == 'Reservoir' or dtype[pn][0] == 'Tank':
+ HN[pn][-1] = pipe.initial_head[-1] # head of reservoir
+ elif dtype[pn][0] == 'Junction':
+ VN[pn][-1] = pipe.initial_velocity[-1]
+ elif dtype[pn][0] == 'Valve':
+ if tm.links[dtype[pn][1]].operating == True:
+ # valve velocity condition
+ VN[pn][-1] = pipe.initial_velocity[-1]* \
+ tm.links[dtype[pn][1]].operation_rule[ts]
+ else :
+ if tm.links[dtype[pn][1]].initial_status.name == 'Open':
+ VN[pn][-1] = pipe.initial_velocity[-1]
+ elif tm.links[dtype[pn][1]].initial_status.name == 'Closed':
+ VN[pn][-1] = 0
+ # source pump
+ elif dtype[pn][0] == 'Pump':
+ # pump[1][0]: elevation of the reservoir/tank
+ # pump[1][1]: three points for pump characteristic curve
+ pump[1] = [[tm.links[utype[pn][1]].end_node.initial_head][0],
+ tm.links[dtype[pn][1]].curve_coef]
+ if tm.links[dtype[pn][1]].operating == True:
+ points = tm.links[dtype[pn][1]].get_pump_curve().points
+ po = tm.links[dtype[pn][1]].operation_rule[ts]
+ points=[(i*po,j*po**2) for (i,j) in points]
+ pump[1][1] = calc_parabola_vertex(points)
+ else :
+ warnings.warn('Pipe %s miss %s downstream.' %(pipe, dtype[pn][0]))
+ # LEFT boundary
+ if utype[pn][0] == 'Pump':
+ pump[0] = [tm.links[utype[pn][1]].curve_coef,"d"]
+ if pipe.start_node.name == tm.links[utype[pn][1]].start_node.name:
+ pump[0][1] = "s" # suction side
+ if tm.links[utype[pn][1]].operating == True:
+ points = tm.links[utype[pn][1]].get_pump_curve().points
+ po = tm.links[utype[pn][1]].operation_rule[ts]
+ points=[(i*po,j*po**2) for (i,j) in points]
+ pump[0][0] = calc_parabola_vertex(points)
+
+ elif utype[pn][0] == 'Valve':
+ if tm.links[utype[pn][1]].operating == True:
+ valve[0] = valve_curve(tm.links[utype[pn][1]].operation_rule[ts]*100,
+ tm.links[utype[pn][1]].valve_coeff)
+ else :
+ if tm.links[utype[pn][1]].initial_status.name == 'Open':
+ valve[0] = valve_curve(100,tm.links[utype[pn][1]].valve_coeff)
+ elif tm.links[utype[pn][1]].initial_status.name == 'Closed':
+ valve[0] = valve_curve(0,tm.links[utype[pn][1]].valve_coeff)
+
+
+ HN[pn], VN[pn] = right_boundary(pipe, pn,
+ H[pn], V[pn], HN[pn], VN[pn],
+ links1[pn], p, pump, valve, dt,
+ [H[abs(i)-1][a[np.sign(i)]] for i in links1[pn]],
+ [V[abs(i)-1][a[np.sign(i)]] for i in links1[pn]],
+ utype[pn], dtype[pn],
+ friction, dVdt[pn], dVdx[pn],
+ [dVdt[abs(i)-1][a[np.sign(i)]] for i in links1[pn]],
+ [dVdx[abs(i)-1][b[np.sign(i)]] for i in links1[pn]],)
+ # record results
+ pipe.start_node_velocity[ts] = VN[pn][0]
+ pipe.end_node_velocity[ts] = VN[pn][-1]
+ pipe.start_node_head[ts] = HN[pn][0]
+ pipe.end_node_head[ts] = HN[pn][-1]
+ pipe.start_node_flowrate[ts] = VN[pn][0]*pipe.area
+ pipe.end_node_flowrate[ts] = VN[pn][-1]*pipe.area
+
+ try:
+ if HN[pn][0]- pipe.start_node.elevation >0:
+ h = HN[pn][0]- pipe.start_node.elevation
+ pipe.start_node.demand_discharge[ts] = pipe.start_node.demand_coeff * np.sqrt(h)
+ pipe.start_node.emitter_discharge[ts] = pipe.start_node.emitter_coeff * np.sqrt(h)
+ else: # assume reverse flow preventer installed
+ pipe.start_node.emitter_discharge[ts] = 0.
+ pipe.start_node.demand_discharge[ts] = 0.
+ warnings.warn("Negative pressure on node %s.\
+ Backflow stopped by reverse flow preventer." %pipe.start_node.name)
+ except:
+ pass
+
+ try:
+ if HN[pn][-1]-pipe.end_node.elevation >0:
+ h = HN[pn][-1]-pipe.end_node.elevation
+ pipe.end_node.emitter_discharge[ts] = pipe.end_node.emitter_coeff * np.sqrt(h)
+ pipe.end_node.demand_discharge[ts] = pipe.end_node.demand_coeff * np.sqrt(h)
+ else: # assume reverse flow preventer installed
+ pipe.end_node.emitter_discharge[ts] = 0.
+ pipe.end_node.demand_discharge[ts] = 0.
+ warnings.warn("Negative pressure on node %s.\
+ Backflow stopped by reverse flow preventer." %pipe.start_node.name)
+ except:
+ pass
+
+ # march in time
+ for _, pipe in tm.pipes():
+ pn = pipe.id-1
+ # calculate instantaneous local acceleration
+ # only for unsteady friction factor
+ if friction == 'unsteady':
+ dVdt[pn] = (VN[pn] - V[pn] )/dt
+ dVdx[pn] = np.diff(V[pn])/(pipe.length/pipe.number_of_segments)
+ H[pn] = HN[pn]
+ V[pn] = VN[pn]
+
+ for _,node in tm.nodes():
+ if node.transient_node_type == 'SurgeTank' or node.transient_node_type == 'Chamber':
+ node.tank_shape[-2] = max(node.water_level,0)
+ node.tank_shape[-1] = node.tank_flow
+ node.water_level_timeseries[ts] = max(node.water_level,0)
+ node.tank_flow_timeseries[ts] = node.tank_flow
+
+ for _, pipe in tm.pipes():
+ if not isinstance(pipe.start_node._head, np.ndarray):
+ pipe.start_node._head = np.copy(pipe.start_node_head)
+ if not isinstance(pipe.end_node._head, np.ndarray):
+ pipe.end_node._head = np.copy(pipe.end_node_head)
+
+ tm.simulation_timestamps = tt[1:]
+
+
+ # save object to file
+ if results_obj != 'no':
+ import pickle
+ filehandler = open(results_obj +'.obj','wb')
+ pickle.dump(tm, filehandler)
+ else:
+ pass
+
+ return tm
diff --git a/Python/tsnet/simulation/single.py b/Python/tsnet/simulation/single.py
new file mode 100644
index 0000000..d763d34
--- /dev/null
+++ b/Python/tsnet/simulation/single.py
@@ -0,0 +1,479 @@
+"""
+The tsnet.simulation.single contains methods to perform MOC
+transient simulation on a single pipe, including
+1. inner pipe
+2. left boundary pipe (without C- charateristic grid)
+3. right boundary pipe (without C+ characteristic grid)
+
+"""
+import numpy as np
+from tsnet.simulation.solver import (
+ inner_node_steady,
+ inner_node_quasisteady,
+ inner_node_unsteady,
+ valve_node,
+ pump_node,
+ source_pump,
+ valve_end,
+ dead_end,
+ rev_end,
+ add_leakage,
+ surge_tank,
+ air_chamber
+)
+
+def inner_pipe (linkp, pn, dt, links1, links2, utype, dtype, p,
+ H0, V0, H, V, H10, V10, H20, V20, pump, valve,
+ friction, dVdt, dVdx,
+ dVdt10, dVdx10, dVdt20, dVdx20):
+ """MOC solution for an individual inner pipe.
+
+ Parameters
+ ----------
+ linkp : object
+ Current pipe object
+ pn : int
+ Current pipe ID
+ dt : float
+ Time step
+ H : numpy.ndarray
+ Head of current pipe at current time step [m]
+ V : numpy.ndarray
+ Velocity of current pipe at current time step [m/s]
+ links1 : list
+ Upstream adjacent pipes
+ links2 : list
+ Downstream adjacent pipes
+ utype : list
+ Upstream adjacent link type, and if not pipe, their name
+ dtype : list
+ Downstream adjacent link type, and if not pipe, their name
+ p : list
+ pipe list
+ H0 : numpy.ndarray
+ Head of current pipe at previous time step [m]
+ V0 : numpy.ndarray
+ Velocity of current pipe at previous time step [m/s]
+ H10 : list
+ Head of left adjacent nodes at previous time step [m]
+ V10 : list
+ Velocity of left adjacent nodes at previous time step [m/s]
+ H20 : list
+ Head of right adjacent nodes at previous time step [m]
+ V20 : list
+ Velocity of right adjacent nodes at previous time step [m/s]
+ pump : list
+ Characteristics of the pump
+ valve : list
+ Characteristics of the valve
+ friction: str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdt: numpy.ndarray
+ local instantaneous acceleration approximation to be used
+ for unsteady friction calculation, 0 if not
+ in unsteady friction mode [m/s^2]
+ dVdx: numpy.ndarray
+ convective instantaneous acceleration approximation to be used
+ for unsteady friction calculation, 0 if not
+ in unsteady friction mode [m/s^2]
+ dVdt10 : list
+ local instantaneous acceleration of left adjacent nodes at previous time step [m]
+ dVdx10 : list
+ convective instantaneous acceleration of left adjacent nodes at previous time step [m/s]
+ dVdt20 : list
+ local instantaneous acceleration of right adjacent nodes at previous time step [m]
+ dVdx20 : list
+ convective instantaneous acceleration of right adjacent nodes at previous time step [m/s]
+
+ Returns
+ -------
+ H : numpy.ndarray
+ Head results of the current pipe at current time step. [m]
+ V : numpy.ndarray
+ Velocity results of the current pipe at current time step. [m/s]
+ """
+
+ # Properties of current pipe
+ g = 9.8 # m/s^2
+ link1 = [p[abs(i)-1] for i in links1]
+ link2 = [p[abs(i)-1] for i in links2]
+ n = linkp.number_of_segments # spatial discretization
+
+ # inner nodes
+ if friction == 'steady':
+ H[1:-1], V[1:-1] = inner_node_steady(linkp, H0, V0, dt, g)
+ elif friction == 'quasi-steady':
+ H[1:-1], V[1:-1] = inner_node_quasisteady(linkp, H0, V0, dt, g)
+ else:
+ H[1:-1], V[1:-1] = inner_node_unsteady(linkp, H0, V0, dt, g,
+ dVdx, dVdt)
+
+ # Pipe start
+ V1 = V10; H1 = H10 #list
+ V2 = V0[1]; H2 = H0[1]
+ dVdx1 = dVdx10 ; dVdt1 = dVdt10
+ dVdx2 = dVdx[0]; dVdt2 = dVdt[1]
+
+ if utype[0] == 'Pipe':
+ if linkp.start_node.transient_node_type == 'SurgeTank':
+ shape = linkp.start_node.tank_shape
+ H[0], V[0], Qs = surge_tank(shape, link1, linkp,
+ H1, V1, H2, V2, dt, g, 0, np.sign(links1), [-1],
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ linkp.start_node.water_level = H[0]
+ linkp.start_node.tank_flow = Qs
+ elif linkp.start_node.transient_node_type == 'Chamber':
+ shape = linkp.start_node.tank_shape
+ H[0], V[0], Qs, zp = air_chamber(shape, link1, linkp,
+ H1, V1, H2, V2, dt, g, 0, np.sign(links1), [-1],
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ linkp.start_node.water_level = zp
+ linkp.start_node.tank_flow = Qs
+ else:
+ elev = linkp.start_node.elevation
+ emitter_coeff = linkp.start_node.emitter_coeff + linkp.start_node.demand_coeff
+ block_per = linkp.start_node.block_per
+ H[0], V[0] = add_leakage(emitter_coeff, block_per, link1, linkp, elev,
+ H1, V1, H2, V2, dt, g, 0, np.sign(links1), [-1],
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ elif utype[0] == 'Pump':
+ pumpc = pump[0]
+ H[0], V[0] = pump_node(pumpc, link1, linkp,
+ H1, V1, H2, V2, dt, g, 0, np.sign(links1), [-1],
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ elif utype[0] == 'Valve':
+ valvec = valve[0]
+ H[0], V[0] = valve_node(valvec, link1, linkp,
+ H1, V1, H2, V2, dt, g, 0, np.sign(links1), [-1],
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+
+ # Pipe end
+ V1 = V0[n-1]; H1 = H0[n-1]
+ V2 = V20; H2 = H20
+ dVdx1 = dVdx[n-1] ; dVdt1 = dVdt[n-1]
+ dVdx2 = dVdx20; dVdt2 = dVdt20
+ if dtype[0] == 'Pipe':
+ if linkp.end_node.transient_node_type == 'SurgeTank':
+ shape = linkp.end_node.tank_shape
+ H[n], V[n], Qs = surge_tank(shape, linkp, link2,
+ H1, V1, H2, V2, dt, g, n, [1], np.sign(links2),
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ linkp.end_node.water_level = H[n]
+ linkp.end_node.tank_flow = Qs
+ elif linkp.end_node.transient_node_type == 'Chamber':
+ shape = linkp.end_node.tank_shape
+ H[n], V[n], Qs,zp = air_chamber(shape, linkp, link2,
+ H1, V1, H2, V2, dt, g, n, [1], np.sign(links2),
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ linkp.end_node.water_level = zp
+ linkp.end_node.tank_flow = Qs
+ else:
+ elev = linkp.end_node.elevation
+ emitter_coeff = linkp.end_node.emitter_coeff + linkp.end_node.demand_coeff
+ block_per = linkp.end_node.block_per
+ H[n], V[n] = add_leakage(emitter_coeff, block_per,linkp, link2, elev,
+ H1, V1, H2, V2, dt, g, n, [1], np.sign(links2),
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ elif dtype[0] == 'Pump':
+ pumpc = pump[1]
+ H[n], V[n] = pump_node(pumpc, linkp, link2,
+ H1, V1, H2, V2, dt, g, n, [1], np.sign(links2),
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+
+ elif dtype[0] == 'Valve':
+ valvec = valve[1]
+ H[n], V[n] = valve_node(valvec, linkp, link2,
+ H1, V1, H2, V2, dt, g, n, [1], np.sign(links2),
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ return H, V
+
+def left_boundary(linkp, pn, H, V, H0, V0, links2, p, pump, valve, dt,
+ H20, V20, utype, dtype,
+ friction, dVdt, dVdx, dVdt20, dVdx20) :
+ """MOC solution for an individual left boundary pipe.
+
+ Parameters
+ ----------
+ linkp : object
+ Current pipe object
+ pn : int
+ Current pipe ID
+ H : numpy.ndarray
+ Head of current pipe at current time step [m]
+ V : numpy.ndarray
+ Velocity of current pipe at current time step [m/s]
+ links2 : list
+ Downstream adjacent pipes
+ p : list
+ pipe list
+ pump : list
+ Characteristics of the pump
+ valve : list
+ Characteristics of the valve
+ n : int
+ Number of discretization of current pipe
+ dt : float
+ Time step
+ H0 : numpy.ndarray
+ Head of current pipe at previous time step [m]
+ V0 : numpy.ndarray
+ Velocity of current pipe at previous time step [m/s]
+ H20 : list
+ Head of right adjacent nodes at previous time step [m]
+ V20 : list
+ Velocity of right adjacent nodes at previous time step [m/s]
+ utype : list
+ Upstream adjacent link type, and if not pipe, their name
+ dtype : list
+ Downstream adjacent link type, and if not pipe, their name
+ friction: str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdt: numpy.ndarray
+ local instantaneous velocity approximation to be used
+ for unsteady friction calculation, 0 if not
+ in unsteady friction mode [m/s^2]
+ dVdx: numpy.ndarray
+ convective instantaneous velocity approximation to be used
+ for unsteady friction calculation, 0 if not
+ in unsteady friction mode [m/s^2]
+ dVdt20 : list
+ local instantaneous acceleration of right adjacent nodes at previous time step [m]
+ dVdx20 : list
+ convective instantaneous acceleration of right adjacent nodes at previous time step [m/s]
+
+ Returns
+ -------
+ H : numpy.ndarray
+ Head results of the current pipe at current time step. [m]
+ V : numpy.ndarray
+ Velocity results of the current pipe at current time step. [m/s]
+ """
+
+ link2 = [p[abs(i)-1] for i in links2]
+ # Properties of current pipe
+ f = linkp.roughness # unitless
+ D = linkp.diameter # m
+ g = 9.8 # m/s^2
+ a = linkp.wavev # m/s
+ n = linkp.number_of_segments # spatial discretization
+ KD = linkp.roughness_height
+
+ # inner nodes
+ if friction == 'steady':
+ H[1:-1], V[1:-1] = inner_node_steady(linkp, H0, V0, dt, g)
+ elif friction == 'quasi-steady':
+ H[1:-1], V[1:-1] = inner_node_quasisteady(linkp, H0, V0, dt, g)
+ else:
+ H[1:-1], V[1:-1] = inner_node_unsteady(linkp, H0, V0, dt, g,
+ dVdx, dVdt)
+
+ # Pipe start (outer boundayr conditions)
+ V2 = V0[1]; H2 = H0[1]
+ dVdx2 = dVdx[0]; dVdt2= dVdt[1]
+ if utype[0] == 'Reservoir' or utype[0] == 'Tank':
+ H[0], V[0] = rev_end (H2, V2, H[0], 0, a, g, f, D, dt,
+ KD, friction, dVdx2, dVdt2)
+ elif utype[0] == 'Valve':
+ H[0], V[0] = valve_end (H2, V2, V[0], 0, a, g, f, D, dt,
+ KD, friction, dVdx2, dVdt2)
+ elif utype[0] == 'Junction':
+ elev = linkp.start_node.elevation
+ H[0], V[0] = dead_end (linkp , H2, V2, elev, 0, a, g, f, D, dt,
+ KD, friction, dVdx2, dVdt2)
+ elif utype[0] == 'Pump': #source pump
+ H[0], V[0] = source_pump(pump[0], linkp, H2, V2, dt, g, [-1],
+ friction, dVdx2, dVdt2)
+
+ # Pipe end (inner boundary conditions)
+ V1 = V0[n-1]; H1 = H0[n-1] # upstream node
+ V2 = V20; H2 = H20 # downstream nodes
+ dVdx1 = dVdx[n-1] ; dVdx2 = dVdx20
+ dVdt1 = dVdt[n-1] ; dVdt2 = dVdt20
+
+ if dtype[0] == 'Pipe':
+ if linkp.end_node.transient_node_type == 'SurgeTank':
+ shape = linkp.end_node.tank_shape
+ H[n], V[n], Qs = surge_tank(shape, linkp, link2,
+ H1, V1, H2, V2, dt, g, n, [1], np.sign(links2),
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ linkp.end_node.water_level = H[n]
+ linkp.end_node.tank_flow = Qs
+
+ elif linkp.end_node.transient_node_type == 'Chamber':
+ shape = linkp.end_node.tank_shape
+ H[n], V[n], Qs, zp = air_chamber(shape, linkp, link2,
+ H1, V1, H2, V2, dt, g, n, [1], np.sign(links2),
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ linkp.end_node.water_level = zp
+ linkp.end_node.tank_flow = Qs
+ else:
+ elev = linkp.end_node.elevation
+ emitter_coeff = linkp.end_node.emitter_coeff + linkp.end_node.demand_coeff
+ block_per = linkp.end_node.block_per
+ H[n], V[n] = add_leakage(emitter_coeff, block_per,linkp, link2, elev,
+ H1, V1, H2, V2, dt, g, n, [1], np.sign(links2),
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+
+ elif dtype[0] == 'Pump':
+ pumpc = pump[1]
+ H[n], V[n] = pump_node(pumpc, linkp, link2,
+ H1, V1, H2, V2, dt, g, n, [1], np.sign(links2),
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+
+ elif dtype[0] == 'Valve':
+ valvec = valve[1]
+ if links2 == []:
+ H[n], V[n] = valve_end (H1, V1, V[n], n, a, g, f, D, dt,
+ KD, friction, dVdx1, dVdt1)
+ else:
+ H[n], V[n] = valve_node(valvec, linkp, link2,
+ H1, V1, H2, V2, dt, g, n, [1], np.sign(links2),
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+
+ elif dtype[0] == 'Junction':
+ elev = linkp.end_node.elevation
+ H[n], V[n] = dead_end (linkp, H1, V1, elev, n, a, g, f, D, dt,
+ KD, friction, dVdx1, dVdt1)
+
+ return H, V
+
+def right_boundary(linkp, pn, H0, V0, H, V, links1, p, pump, valve, dt,
+ H10, V10, utype, dtype,
+ friction, dVdt, dVdx, dVdt10, dVdx10):
+ """MOC solution for an individual right boundary pipe.
+
+ Parameters
+ ----------
+ linkp : object
+ Current pipe object
+ pn : int
+ Current pipe ID
+ H : numpy.ndarray
+ Head of current pipe at current time step [m]
+ V : numpy.ndarray
+ Velocity of current pipe at current time step [m/s]
+ links1 : list
+ Upstream adjacent pipes
+ p : list
+ pipe list
+ pump : list
+ Characteristics of the pump
+ valve : list
+ Characteristics of the valve
+ n : int
+ Number of discretization of current pipe
+ dt : float
+ Time step
+ H0 : numpy.ndarray
+ Head of current pipe at previous time step [m]
+ V0 : numpy.ndarray
+ Velocity of current pipe at previous time step [m/s]
+ H10 : list
+ Head of left adjacent nodes at previous time step [m]
+ V10 : list
+ Velocity of left adjacent nodes at previous time step [m/s]
+ utype : list
+ Upstream adjacent link type, and if not pipe, their name
+ dtype : list
+ Downstream adjacent link type, and if not pipe, their name
+ friction: str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdt: numpy.ndarray
+ local instantaneous velocity approximation to be used
+ for unsteady friction calculation, 0 if not
+ in unsteady friction mode [m/s^2]
+ dVdx: numpy.ndarray
+ convective instantaneous velocity approximation to be used
+ for unsteady friction calculation, 0 if not
+ in unsteady friction mode [m/s^2]
+ dVdt10 : list
+ local instantaneous acceleration of left adjacent nodes at previous time step [m]
+ dVdx10 : list
+ convective instantaneous acceleration of left adjacent nodes at previous time step [m/s]
+
+ Returns
+ -------
+ H : numpy.ndarray
+ Head results of the current pipe at current time step. [m]
+ V : numpy.ndarray
+ Velocity results of the current pipe at current time step. [m/s]
+ """
+
+ # Properties of current pipe
+ link1 = [p[abs(i)-1] for i in links1]
+ f = linkp.roughness # unitless
+ D = linkp.diameter # m
+ g = 9.8 # m/s^2
+ a = linkp.wavev # m/s
+ n = linkp.number_of_segments # spatial discretization
+ KD = linkp.roughness_height
+
+ # inner nodes
+ if friction == 'steady':
+ H[1:-1], V[1:-1] = inner_node_steady(linkp, H0, V0, dt, g)
+ elif friction == 'quasi-steady':
+ H[1:-1], V[1:-1] = inner_node_quasisteady(linkp, H0, V0, dt, g)
+ else:
+ H[1:-1], V[1:-1] = inner_node_unsteady(linkp, H0, V0, dt, g,
+ dVdx, dVdt)
+
+ # Pipe start (inner boundary conditions)
+ V1 = V10; H1 = H10 # upstream node
+ V2 = V0[1]; H2 = H0[1] # downstream node
+ dVdx1 = dVdx10 ; dVdx2 = dVdx[0]
+ dVdt1 = dVdt10 ; dVdt2 = dVdt[1]
+ if utype[0] == 'Pipe':
+ if linkp.start_node.transient_node_type == 'SurgeTank':
+ shape = linkp.start_node.tank_shape
+ H[0], V[0], Qs = surge_tank(shape, link1, linkp,
+ H1, V1, H2, V2, dt, g, 0, np.sign(links1), [-1],
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ linkp.start_node.water_level = H[0]
+ linkp.start_node.tank_flow = Qs
+ if linkp.start_node.transient_node_type == 'Chamber':
+ shape = linkp.start_node.tank_shape
+ H[0], V[0], Qs, zp = air_chamber(shape, link1, linkp,
+ H1, V1, H2, V2, dt, g, 0, np.sign(links1), [-1],
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ linkp.start_node.water_level = zp
+ linkp.start_node.tank_flow = Qs
+
+ else:
+ elev = linkp.start_node.elevation
+ emitter_coeff = linkp.start_node.emitter_coeff + linkp.start_node.demand_coeff
+ block_per = linkp.start_node.block_per
+ H[0], V[0] = add_leakage(emitter_coeff, block_per,link1, linkp, elev,
+ H1, V1, H2, V2, dt, g, 0, np.sign(links1), [-1],
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+
+ elif utype[0] == 'Pump':
+ pumpc = pump[0]
+ H[0], V[0] = pump_node(pumpc, link1, linkp,
+ H1, V1, H2, V2, dt, g, 0, np.sign(links1), [-1],
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ elif utype[0] == 'Valve':
+ valvec = valve[0]
+ H[0], V[0] = valve_node(valvec, link1, linkp,
+ H1, V1, H2, V2, dt, g, 0, np.sign(links1), [-1],
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+
+ # Pipe end (outer boundary conditions )
+ V1 = V0[n-1]; H1 = H0[n-1]
+ dVdx1 = dVdx[n-1]
+ dVdt1 = dVdt[n-1]
+ if dtype[0] == 'Reservoir' or dtype[0] == 'Tank':
+ H[n], V[n] = rev_end (H1, V1, H[n], n, a, g, f, D, dt,
+ KD, friction, dVdx1, dVdt1)
+ if dtype[0] == 'Valve':
+ H[n], V[n] = valve_end (H1, V1, V[n], n, a, g, f, D, dt,
+ KD, friction, dVdx1, dVdt1)
+ if dtype[0] == 'Junction':
+ elev = linkp.end_node.elevation
+ H[n], V[n] = dead_end (linkp ,H1, V1, elev, n, a, g, f, D, dt,
+ KD, friction, dVdx1, dVdt1)
+
+
+ return H, V
\ No newline at end of file
diff --git a/Python/tsnet/simulation/solver.py b/Python/tsnet/simulation/solver.py
new file mode 100644
index 0000000..521b86a
--- /dev/null
+++ b/Python/tsnet/simulation/solver.py
@@ -0,0 +1,1216 @@
+"""
+The tsnet.simulation.solver module contains methods to solver MOC
+for different grid configurations, including:
+1. inner_node
+2. valve_node
+3. pump_node
+4. source_pump
+5. valve_end
+6. dead_end
+7. rev_end
+8. add_leakage
+
+"""
+from __future__ import print_function
+import numpy as np
+import warnings
+
+def Reynold(V, D):
+ """ Calculate Reynold number
+
+ Parameters
+ ----------
+ V : float
+ velocity
+ D : float
+ diameter
+
+ Returns
+ -------
+ Re : float
+ Reynold number
+ """
+ nu = 1.004e-6 # kinematic viscosity [m^2/s]
+ Re = np.abs(V*D/nu)
+
+ return Re
+
+def quasi_steady_friction_factor(Re, KD):
+ """ Update friction factor based on Reynold number
+
+ Parameters
+ ----------
+ Re : float
+ velocity
+ KD : float
+ relative roughness height (K/D)
+
+ Returns
+ -------
+ f : float
+ quasi-steady friction factor
+ """
+
+ a = -1.8*np.log10(6.9/Re + KD)
+ f = (1./a)**2.
+ return f
+
+
+def unsteady_friction(Re, dVdt, dVdx, V, a, g):
+ """ Calculate unsteady friction
+
+ Parameters
+ ----------
+ Re : float
+ velocity
+ dVdt : float
+ local instantaneous acceleration
+ dVdx : float
+ instantaneous convective acceleration
+ V : float
+ velocity
+ a : float
+ wave speed
+ g: float
+ gravitational acceleration
+
+ Returns
+ -------
+ Ju : float
+ unsteady friction factor
+ """
+
+ # calculate Vardy's shear decay coefficient (C)
+ if Re< 2000: # laminar flow
+ C = 4.76e-3
+ else:
+ C = 7.41 / Re**(np.log10(14.3/Re**0.05))
+
+ # calculate Brunone's friction coefficient
+ k = np.sqrt(C)/2.
+ " TO DO: check the sign of unsteady friction"
+ Ju = k/g/2.* (dVdt + a* np.sign(V) * np.abs(dVdx))
+ return Ju
+
+def cal_friction(friction, f, D, V, KD, dt, dVdt, dVdx, a, g ):
+ """ Calculate friction term
+
+ Parameters
+ ----------
+ friction : str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ f : float
+ steady friction factor
+ D : float
+ pipe diameter
+ V : float
+ pipe flow velocity
+ KD : float
+ relative roughness height
+ dt : float
+ time step
+ dVdt : float
+ local instantaneous acceleration
+ dVdx : float
+ convective instantaneous acceleration
+ a : float
+ wave speed
+ g : float
+ gravitational accelerations
+
+ Returns
+ -------
+ float
+ total friction, including steady and unsteady
+ """
+ tol = 1
+
+ if friction == 'steady':
+ Ju = 0
+ Js = f*dt/2./D*V*abs(V) #steady friction
+ else:
+ Re = Reynold(V, D)
+ if Re < tol:
+ Js = 0
+ else:
+ f = quasi_steady_friction_factor(Re, KD)
+ Js = f*dt/2./D*V*abs(V)
+ if friction == 'quasi-steady':
+ Ju = 0
+ elif friction == 'unsteady':
+ Ju = unsteady_friction(Re, dVdt, dVdx, V, a, g)
+ return Ju + Js
+
+def cal_Cs( link1, link2, H1, V1, H2, V2, s1, s2, g, dt,
+ friction, dVdx1, dVdx2, dVdt1, dVdt2):
+ """Calculate coefficients for MOC characteristic lines
+
+ Parameters
+ ----------
+ link1 : object
+ Pipe object of C+ charateristics curve
+ link2 : object
+ Pipe object of C- charateristics curve
+ H1 : list
+ List of the head of C+ charateristics curve
+ V1 : list
+ List of the velocity of C+ charateristics curve
+ H2 : list
+ List of the head of C- charateristics curve
+ V2 : list
+ List of the velocity of C- charateristics curve
+ s1 : list
+ List of signs that represent the direction of the flow
+ in C+ charateristics curve
+ s2 : list
+ List of signs that represent the direction of the flow
+ in C- charateristics curve
+ dt : float
+ Time step
+ g : float
+ Gravity acceleration
+ friction : str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdx1 : list
+ List of convective instantaneous acceleration on the
+ C+ characteristic curve
+ dVdx2 : list
+ List of convective instantaneous acceleration on the
+ C- characteristic curve
+ dVdt1 : list
+ List of local instantaneous acceleration on the
+ C+ characteristic curve
+ dVdt2 : list
+ List of local instantaneous acceleration on the
+ C- characteristic curve
+
+ Returns
+ -------
+ A1: list
+ list of left adjacent pipe cross-section area
+ A2: list
+ list of right adjacent pipe cross-section area
+ C1: list
+ list of left adjacent pipe MOC coefficients
+ C2: list
+ list of right adjacent pipe MOC coefficients
+ """
+
+ # property of left adjacent pipe
+ f1 = [link1[i].roughness for i in range(len(link1))] # unitless
+ D1 = [link1[i].diameter for i in range(len(link1))] # m
+ a1 = [link1[i].wavev for i in range(len(link1))] # m/s
+ A1 = [np.pi * D1[i]**2. / 4. for i in range(len(link1))] # m^2
+ C1 = np.zeros((len(link1),2), dtype=np.float64)
+ theta1 = [link1[i].theta for i in range((len(link1)))]
+ KD1 = [link1[i].roughness_height for i in range(len(link1))]
+
+ for i in range(len(link1)):
+ # J = f1[i]*dt/2./D1[i]*V1[i]*abs(V1[i])
+ J = cal_friction(friction, f1[i], D1[i], V1[i], KD1[i],
+ dt, dVdt1[i], dVdx1[i], a1[i], g )
+ C1[i,0] = s1[i]*V1[i] + g/a1[i]*H1[i] - s1[i]*J + g/a1[i]* dt *V1[i]*theta1[i]
+ C1[i,1] = g/a1[i]
+
+ # property of right adjacent pipe
+ f2 = [link2[i].roughness for i in range(len(link2))] # unitless
+ D2 = [link2[i].diameter for i in range(len(link2))] # m
+ a2 = [link2[i].wavev for i in range(len(link2))] # m/s
+ A2 = [np.pi * D2[i]**2. / 4. for i in range(len(link2))] # m^2
+ C2 = np.zeros((len(link2),2),dtype=np.float64)
+ theta2 = [link2[i].theta for i in range((len(link2)))]
+ KD2 = [link2[i].roughness_height for i in range(len(link2))]
+
+ for i in range(len(link2)):
+ # J = f2[i]*dt/2./D2[i]*V2[i]*abs(V2[i])
+ J = cal_friction(friction, f2[i], D2[i], V2[i], KD2[i],
+ dt, dVdt2[i], dVdx2[i], a2[i], g)
+ C2[i,0] = s2[i]*V2[i] + g/a2[i]*H2[i] - s2[i]* J + g/a2[i]* dt *V2[i]*theta2[i]
+ C2[i,1] = g/a2[i]
+
+ return A1, A2, C1, C2
+
+
+
+def inner_node_unsteady(link, H0, V0, dt, g, dVdx, dVdt):
+ """Inner boundary MOC using C+ and C- characteristic curve with unsteady friction
+
+ Parameters
+ ----------
+ link : object
+ current pipe
+ H0 : list
+ head at previous time step
+ V0 : list
+ velocity at previous time step
+ dt : float
+ Time step
+ g : float
+ Gravity acceleration
+ dVdx : list
+ List of convective instantaneous acceleration
+ dVdt : list
+ List of local instantaneous acceleration
+ Returns
+ -------
+ HP : float
+ Head at current pipe inner nodes at current time
+ VP : float
+ Velocity at current pipe inner nodes at current time
+ """
+ HP = np.zeros(len(H0))
+ VP = np.zeros(len(V0))
+ # property of current pipe
+ f = link.roughness # unitless
+ D = link.diameter # m
+ a = link.wavev # m/s
+ # A = np.pi * D**2. / 4. # m^2
+ theta = link.theta
+ KD = link.roughness_height
+ ga = g/a
+ tol = 1e-1
+ for i in range(1,len(H0)-1):
+ V1 = V0[i-1]; H1 = H0[i-1]
+ V2 = V0[i+1]; H2 = H0[i+1]
+ dVdx1 = dVdx[i-1] ; dVdx2 = dVdx[i]
+ dVdt1 = dVdt[i-1] ; dVdt2 = dVdt[i+1]
+ C = np.zeros((2,1), dtype=np.float64)
+
+ Re = Reynold(V1, D)
+ if Re = 0:
+ VP = (-bq + np.sqrt(delta))/(2*aq)
+ elif delta > -1.0e-7 and delta <0 :
+ VP = (-bq)/(2*aq)
+ else:
+ VP = (-bq)/(2*aq)
+ warnings.warn('Error: The quadratic equation has no real solution (valve)')
+
+ if VP >=0 : # positive flow
+ if nn == 0: # pipe start
+ VP = VP
+ HP = (C2[0,0] + VP) / C2[0,1]
+ else: # pipe end
+ VP = VP*A2[0]/A1[0]
+ HP = (C1[0,0] - VP) / C1[0,1]
+
+ else : # reverse flow
+ # reconstruct the quadratic equation
+ # parameters of the quadratic polynomial
+ aq = 1
+ bq = 2*g*KL_inv* (-A1[0]/A2[0]/C2[0,1]-1/C1[0,1])
+ cq = 2*g*KL_inv* (-C2[0,0]/C2[0,1]+C1[0,0]/C1[0,1])
+
+ # solve the quadratic equation
+ delta = bq**2 - 4*aq*cq
+
+ if delta >= 0:
+ VP = (-bq - np.sqrt(delta))/(2*aq)
+ elif delta > -1.0e-7 and delta <0 :
+ VP = (-bq)/(2*aq)
+ else:
+ VP = (-bq)/(2*aq)
+ warnings.warn('Error: The quadratic equation has no real solution (valve)')
+
+ if nn == 0: # pipe start
+ VP = VP*A1[0]/A2[0]
+ HP = (C2[0,0] + VP ) / C2[0,1]
+ else: # pipe end
+ VP = VP
+ HP = (C1[0,0] - VP) / C1[0,1]
+ return HP, VP
+
+
+def pump_node(pumpc,link1, link2, H1, V1, H2, V2, dt, g, nn, s1, s2,
+ friction, dVdx1, dVdx2, dVdt1, dVdt2):
+ """ Inline pump node MOC calculation
+
+ Parameters
+ ----------
+ pumpc : list
+ Parameters (a, b,c) to define pump characteristic cure,
+ so that
+ .. math:: h_p = a*Q**2 + b*Q + c
+ link1 : object
+ Pipe object of C+ charateristics curve
+ link2 : object
+ Pipe object of C- charateristics curve
+ H1 : list
+ List of the head of C+ charateristics curve
+ V1 : list
+ List of the velocity of C+ charateristics curve
+ H2 : list
+ List of the head of C- charateristics curve
+ V2 : list
+ List of the velocity of C- charateristics curve
+ dt : float
+ Time step
+ g : float
+ Gravity acceleration
+ nn : int
+ The index of the calculation node
+ s1 : list
+ List of signs that represent the direction of the flow
+ in C+ charateristics curve
+ s2 : list
+ List of signs that represent the direction of the flow
+ in C- charateristics curve
+ friction : str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdx1 : list
+ List of convective instantaneous acceleration on the
+ C+ characteristic curve
+ dVdx2 : list
+ List of convective instantaneous acceleration on the
+ C- characteristic curve
+ dVdt1 : list
+ List of local instantaneous acceleration on the
+ C+ characteristic curve
+ dVdt2 : list
+ List of local instantaneous acceleration on the
+ C- characteristic curve
+ """
+
+ try :
+ list(link1)
+ except:
+ link1 = [link1]
+ V1 = [V1] ; H1 = [H1]
+ dVdx1 = [dVdx1]; dVdt1 = [dVdt1]
+
+ try :
+ list(link2)
+ except:
+ link2 = [link2]
+ V2 = [V2] ; H2 = [H2]
+ dVdx2 = [dVdx2]; dVdt2 = [dVdt2]
+
+ A1, A2, C1, C2 = cal_Cs( link1, link2, H1, V1, H2, V2, s1, s2, g, dt,
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+
+ # pump power function
+ ap, bp, cp = pumpc[0]
+ ap = ap * A1[0]**2.
+ bp = bp * A1[0]
+
+ # parameters of the quadratic polynomial
+ aq = 1
+ bq = 1/ap * (bp - 1/C1[0,1] - A1[0]/C2[0,1]/A2[0])
+ cq = 1/ap * (-C2[0,0]/C2[0,1] + C1[0,0]/C1[0,1] + cp)
+
+ # solve the quadratic equation
+ delta = bq**2. - 4.*aq*cq
+ if delta >= 0:
+ VP = (-bq + np.sqrt(delta))/(2*aq)
+ elif delta > -1.0e-7 and delta <0 :
+ VP = (-bq)/(2*aq)
+ else:
+ VP = (-bq)/(2*aq)
+ warnings.warn('Error: The quadratic equation has no real solution (pump)')
+
+ hp = ap*VP**2. + bp*VP + cp # head gain
+
+ if VP > 0 and hp >=0 : # positive flow & positive head gain
+ if nn == 0: # pipe start
+ VP = VP*A1[0]/A2[0]
+ HP = (C2[0,0] + VP ) / C2[0,1]
+ else: # pipe end
+ VP = VP
+ HP = (C1[0,0] - VP) / C1[0,1]
+ elif VP<0 :
+ warnings.warn( "Reverse flow stopped by check valve!")
+ VP = 0
+ if nn == 0: # pipe start
+ HP = (C2[0,0] + VP ) / C2[0,1]
+ else :
+ HP = (C1[0,0] - VP) / C1[0,1]
+ # hp = cp
+ # # suction or discharge side?
+ # if pumpc[1] == "s": # suction side
+ # if nn == 0: # pipe start
+ # HP = (C2[0,0] + VP ) / C2[0,1]
+ # else :
+ # HP = (C1[0,0] - VP) / C1[0,1]
+ # else: #discharge
+ # if nn == 0: # pipe start
+ # HP = (C1[0,0] - VP) / C1[0,1] + hp
+ # else :
+ # HP = (C2[0,0] + VP ) / C2[0,1] + hp
+ else: # positive flow and negative head gain
+ warnings.warn( "Negative head gain activates by-pass!")
+ hp = 0
+ # suction or discharge side?
+ if pumpc[1] == "s": # suction side
+ if nn == 0: # pipe start
+ HP = (C2[0,0] + VP ) / C2[0,1]
+ else :
+ HP = (C1[0,0] - VP) / C1[0,1]
+ else:
+ if nn == 0: # pipe start
+ HP = (C1[0,0] - VP) / C1[0,1] + hp
+ else :
+ HP = (C2[0,0] + VP ) / C2[0,1] +hp
+
+
+ return HP, VP
+
+def source_pump(pump, link2, H2, V2, dt, g, s2,
+ friction, dVdx2, dVdt2):
+ """Source Pump boundary MOC calculation
+
+ Parameters
+ ----------
+ pump : list
+ pump[0]: elevation of the reservoir/tank
+ pump[1]: Parameters (a, b,c) to define pump characteristic cure,
+ so that
+ .. math:: h_p = a*Q**2 + b*Q + c
+ link2 : object
+ Pipe object of C- charateristics curve
+ H2 : list
+ List of the head of C- charateristics curve
+ V2 : list
+ List of the velocity of C- charateristics curve
+ dt : float
+ Time step
+ g : float
+ Gravity acceleration
+ s2 : list
+ List of signs that represent the direction of the flow
+ in C- charateristics curve
+ friction : str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdx2 : list
+ List of convective instantaneous acceleration on the
+ C- characteristic curve
+ dVdt2 : list
+ List of local instantaneous acceleration on the
+ C- characteristic curve
+ """
+ pumpc = pump[1]
+ Hsump = pump[0]
+ try :
+ list(link2)
+ except:
+ link2 = [link2]
+ V2 = [V2] ; H2 = [H2]
+ dVdx2 = [dVdx2]; dVdt2 = [dVdt2]
+
+ _, A2, _, C2 = cal_Cs( link2, link2, H2, V2, H2, V2, s2, s2, g, dt,
+ friction, dVdx2, dVdx2, dVdt2, dVdt2)
+
+ # pump power function
+ ap, bp, cp = pumpc
+ ap = ap * A2[0]**2.
+ bp = bp * A2[0]
+
+ # parameters of the quadratic polynomial
+ aq = ap * C2[0,1]**2.
+ bq = bp*C2[0,1] - 2.*ap*C2[0,0]*C2[0,1] - 1
+ cq = ap*C2[0,0]**2. - bp*C2[0,0] + Hsump + cp
+
+ # solve the quadratic equation
+ delta = bq**2. - 4.*aq*cq
+ if delta >= 0:
+ HP = (-bq - np.sqrt(delta))/(2*aq)
+ elif delta > -1.0e-7 and delta <0 :
+ HP = (-bq)/(2*aq)
+ else:
+ HP = (-bq)/(2*aq)
+ warnings.warn('The quadratic equation has no real solution (pump)')
+
+ if HP > Hsump:
+ VP = np.float64(-C2[0,0] + C2[0,1]*HP)
+ else :
+ HP = Hsump
+ VP = np.float64(-C2[0,0] + C2[0,1]*HP)
+
+ if VP <= 0 : # positive flow
+ warnings.warn( "Reverse flow stopped by check valve!")
+ VP = 0
+ HP = (C2[0,0] + VP ) / C2[0,1]
+
+ return HP, VP
+
+
+
+def valve_end(H1, V1, V, nn, a, g, f, D, dt,
+ KD, friction, dVdx2, dVdt2):
+ """ End Valve boundary MOC calculation
+
+ Parameters
+ ----------
+ H1 : float
+ Head of the C+ charateristics curve
+ V1 : float
+ Velocity of the C+ charateristics curve
+ V : float
+ Velocity at the valve end at current time
+ nn : int
+ The index of the calculation node
+ a : float
+ Wave speed at the valve end
+ g : float
+ Gravity acceleration
+ f : float
+ friction factor of the current pipe
+ D : float
+ diameter of the current pipe
+ dt : float
+ Time step
+ KD : float
+ relative roughness height
+ friction : str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdx2 : list
+ List of convective instantaneous acceleration on the
+ C- characteristic curve
+ dVdt2 : list
+ List of local instantaneous acceleration on the
+ C- characteristic curve
+ """
+ J = cal_friction(friction, f, D, V, KD, dt, dVdt2, dVdx2, a, g )
+ if nn == 0 :
+ # HP = H1 + a/g*(V - V1) + a/g*f*dt/(2.*D)*V1*abs(V1)
+ HP = H1 + a/g*(V - V1) + a/g*J
+ VP = V
+ else :
+ HP = H1 - a/g*(V - V1) - a/g*J
+ VP = V
+ return HP,VP
+
+def dead_end(linkp, H1, V1, elev, nn, a, g, f, D, dt,
+ KD, friction, dVdx1, dVdt1):
+ """Dead end boundary MOC calculation with pressure dependant demand
+
+ Parameters
+ ----------
+ linkp : object
+ Current pipe
+ H1 : float
+ Head of the C+ charateristics curve
+ V1 : float
+ Velocity of the C+ charateristics curve
+ elev : float
+ Elevation at the dead end node
+ nn : int
+ The index of the calculation node
+ a : float
+ Wave speed at the valve end
+ g : float
+ Gravity acceleration
+ f : float
+ friction factor of the current pipe
+ D : float
+ diameter of the current pipe
+ dt : float
+ Time step
+ KD : float
+ relative roughness height
+ friction : str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdx1 : list
+ List of convective instantaneous acceleration on the
+ C+ characteristic curve
+ dVdt1 : list
+ List of local instantaneous acceleration on the
+ C+ characteristic curve
+ """
+
+ A = np.pi/4. * linkp.diameter**2.
+ J = cal_friction(friction, f, D, V1, KD, dt, dVdt1, dVdx1, a, g )
+ if nn == 0: # dead end is the start node of a pipe
+ k = linkp.start_node.demand_coeff + linkp.start_node.emitter_coeff
+ aq = 1
+ bq = -a/g*k/A
+ # cq = a/g *V1 - a/g*f*dt/(2.*D)*V1*abs(V1) - H1 - g/a*dt*V1*linkp.theta + elev
+ cq = a/g *V1 - a/g*J - H1 - g/a*dt*V1*linkp.theta + elev
+ # solve the quadratic equation
+ delta = bq**2. - 4.*aq*cq
+ if delta >= 0:
+ HP = (-bq - np.sqrt(delta))/(2*aq)
+ HP = HP**2. + elev
+ elif delta > -1.0e-7 and delta <0 :
+ HP = (-bq)/(2*aq)
+ HP = HP**2. +elev
+ else:
+ HP = (-bq)/(2*aq)
+ HP = HP**2. +elev
+ warnings.warn("""The quadratic equation has no real solution (dead end).
+ The results might not be accurate.""")
+ VP = V1 - g/a*H1 - f*dt/(2.*D)*V1*abs(V1) + g/a*HP - g/a*dt*V1*linkp.theta
+ else : # dead end is the end node of a pipe
+ k = linkp.end_node.demand_coeff + linkp.end_node.emitter_coeff
+ aq = 1
+ bq = a/g*k/A
+ # cq = -a/g *V1 + a/g*f*dt/(2.*D)*V1*abs(V1) - H1 - g/a*dt*V1*linkp.theta + elev
+ cq = -a/g *V1 + a/g*J - H1 - g/a*dt*V1*linkp.theta + elev
+ # solve the quadratic equation
+ delta = bq**2. - 4.*aq*cq
+ if delta >= 0:
+ HP = (-bq + np.sqrt(delta))/(2*aq)
+ HP = HP**2. + elev
+ elif delta > -1.0e-7 and delta <0 :
+ HP = (-bq)/(2*aq)
+ HP = HP**2. + elev
+ else:
+ HP = (-bq)/(2*aq)
+ HP = HP**2. + elev
+ warnings.warn("The quadratic equation has no real solution (dead end).\
+The results might not be accurate.")
+ VP = V1 + g/a *H1 - f*dt/(2.*D)*V1*abs(V1) - g/a*HP + g/a*dt*V1*linkp.theta
+ return HP,VP
+
+def rev_end( H2, V2, H, nn, a, g, f, D, dt,
+ KD, friction, dVdx2, dVdt2):
+ """Reservoir/ Tank boundary MOC calculation
+
+ Parameters
+ ----------
+ H2 : list
+ List of the head of C- charateristics curve
+ V2 : list
+ List of the velocity of C- charateristics curve
+ H : float
+ Head of the reservoir/tank
+ nn : int
+ The index of the calculation node
+ a : float
+ Wave speed at the valve end
+ g : float
+ Gravity acceleration
+ f : float
+ friction factor of the current pipe
+ D : float
+ diameter of the current pipe
+ dt : float
+ Time step
+ KD : float
+ relative roughness height
+ friction : str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdx2 : list
+ List of convective instantaneous acceleration on the
+ C- characteristic curve
+ dVdt2 : list
+ List of local instantaneous acceleration on the
+ C- characteristic curve
+ """
+ J = cal_friction(friction, f, D, V2, KD, dt, dVdt2, dVdx2, a, g )
+ if nn == 0 :
+ VP = V2 + g/a*(H - H2) - J
+ HP = H
+ else:
+ VP = V2 - g/a*(H - H2) - J
+ HP = H
+ return HP, VP
+
+def add_leakage(emitter_coef, block_per, link1, link2, elev,
+ H1, V1, H2, V2, dt, g, nn, s1, s2,
+ friction, dVdx1=0, dVdx2=0, dVdt1=0, dVdt2=0):
+ r"""Leakage Node MOC calculation
+
+ Parameters
+ ----------
+ emitter_coef : float
+ float, optional
+ Required if leak_loc is defined
+ The leakage coefficient of the leakage
+ .. math:: Q_leak = leak_A [ m^3/s/(m H20)^(1/2)] * \sqrt(H)
+ link1 : object
+ Pipe object of C+ charateristics curve
+ link2 : object
+ Pipe object of C- charateristics curve
+ H1 : list
+ List of the head of C+ charateristics curve
+ V1 : list
+ List of the velocity of C+ charateristics curve
+ H2 : list
+ List of the head of C- charateristics curve
+ V2 : list
+ List of the velocity of C- charateristics curve
+ dt : float
+ Time step
+ g : float
+ Gravity acceleration
+ nn : int
+ The index of the calculation node
+ s1 : list
+ List of signs that represent the direction of the flow
+ in C+ charateristics curve
+ s2 : list
+ List of signs that represent the direction of the flow
+ in C- charateristics curve
+ friction : str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdx1 : list
+ List of convective instantaneous acceleration on the
+ C+ characteristic curve
+ dVdx2 : list
+ List of convective instantaneous acceleration on the
+ C- characteristic curve
+ dVdt1 : list
+ List of local instantaneous acceleration on the
+ C+ characteristic curve
+ dVdt2 : list
+ List of local instantaneous acceleration on the
+ C- characteristic curve
+ """
+
+ emitter_coef = emitter_coef # m^3/s//(m H2O)^(1/2)
+
+ try :
+ list(link1)
+ except:
+ link1 = [link1]
+ V1 = [V1] ; H1 = [H1]
+ dVdx1 = [dVdx1]; dVdt1 = [dVdt1]
+ try :
+ list(link2)
+ except:
+ link2 = [link2]
+ V2 = [V2] ; H2 = [H2]
+ dVdx2 = [dVdx2]; dVdt2 = [dVdt2]
+
+ A1, A2, C1, C2 = cal_Cs(link1, link2, H1, V1, H2, V2, s1, s2, g, dt,
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+
+ a = np.dot(C1[:,0], A1) + np.dot(C2[:,0],A2)
+ b = np.dot(C1[:,1], A1) + (1-block_per)*np.dot(C2[:,1],A2)
+ # parameters of the quadratic polynomial
+ # a1 = b**2.
+ # b1 = -(2.*a*b +emitter_coef**2)
+ # c1 = a**2.
+ a1 = b**2
+ b1 = -2*a*b - emitter_coef**2.
+ c1 = a**2 + emitter_coef**2.*elev
+
+ # solve the quadratic equation
+ delta = b1**2 - 4*a1*c1
+ if delta >= 0:
+ HP = (-b1 - np.sqrt(delta))/(2*a1)
+ elif delta > -1.0e-7 and delta <0 :
+ HP = (-b1)/(2*a1)
+ else:
+ HP = (-b1)/(2*a1)
+ warnings.warn('Error: The quadratic equation has no real solution (leakage)')
+
+ if nn == 0: # pipe start
+ VP = np.float64(-C2[:,0]+ C2[:,1]*HP)
+ else: # pipe end
+ VP = np.float64(C1[:,0] - C1[:,1]*HP)
+ return HP, VP
+
+
+def surge_tank(tank, link1, link2, H1, V1, H2, V2, dt, g, nn, s1, s2,
+ friction, dVdx1, dVdx2, dVdt1, dVdt2):
+
+ """Surge tank node MOC calculation
+
+ Parameters
+ ----------
+ tank : int
+ tank shape parameters
+ [As, z, Qs]
+ As : cross-sectional area of the surge tank
+ z : water level in the surge tank at previous time step
+ Qs : water flow into the tank at last time step
+ link1 : object
+ Pipe object of C+ charateristics curve
+ link2 : object
+ Pipe object of C- charateristics curve
+ H1 : list
+ List of the head of C+ charateristics curve
+ V1 : list
+ List of the velocity of C+ charateristics curve
+ H2 : list
+ List of the head of C- charateristics curve
+ V2 : list
+ List of the velocity of C- charateristics curve
+ dt : float
+ Time step
+ g : float
+ Gravity acceleration
+ nn : int
+ The index of the calculation node
+ s1 : list
+ List of signs that represent the direction of the flow
+ in C+ charateristics curve
+ s2 : list
+ List of signs that represent the direction of the flow
+ in C- charateristics curve
+ friction : str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdx1 : list
+ List of convective instantaneous acceleration on the
+ C+ characteristic curve
+ dVdx2 : list
+ List of convective instantaneous acceleration on the
+ C- characteristic curve
+ dVdt1 : list
+ List of local instantaneous acceleration on the
+ C+ characteristic curve
+ dVdt2 : list
+ List of local instantaneous acceleration on the
+ C- characteristic curve
+ """
+
+ try :
+ list(link1)
+ except:
+ link1 = [link1]
+ V1 = [V1] ; H1 = [H1]
+ dVdx1 = [dVdx1]; dVdt1 = [dVdt1]
+ try :
+ list(link2)
+ except:
+ link2 = [link2]
+ V2 = [V2] ; H2 = [H2]
+ dVdx2 = [dVdx2]; dVdt2 = [dVdt2]
+
+ A1, A2, C1, C2 = cal_Cs(link1, link2, H1, V1, H2, V2, s1, s2, g, dt,
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+
+ As, z, Qs = tank
+ at = 2.* As/dt
+
+ HP = ((np.dot(C1[:,0], A1) + np.dot(C2[:,0],A2) + at*z + Qs ) /
+ (np.dot(C1[:,1], A1) + np.dot(C2[:,1],A2) + at))
+
+ VP2 = -C2[:,0]+ C2[:,1]*HP
+ VP1 = C1[:,0] - C1[:,1]*HP
+ QPs = (np.sum(np.array(VP1)*np.array(A1)) -
+ np.sum(np.array(VP2)*np.array(A2)))
+
+ if nn == 0: # pipe start
+ VP = np.float64(VP2)
+ else: # pipe end
+ VP = np.float64(VP1)
+ return HP, VP, QPs
+
+def air_chamber(tank, link1, link2, H1, V1, H2, V2, dt, g, nn, s1, s2,
+ friction, dVdx1, dVdx2, dVdt1, dVdt2):
+
+ """Surge tank node MOC calculation
+
+ Parameters
+ ----------
+ tank : int
+ tank shape parameters
+ [As, ht, C, z, Qs]
+ As : cross-sectional area of the surge tank
+ ht : tank height
+ C : air constant
+ z : water level in the surge tank at previous time step
+ Qs : water flow into the tank at last time step
+ link1 : object
+ Pipe object of C+ charateristics curve
+ link2 : object
+ Pipe object of C- charateristics curve
+ H1 : list
+ List of the head of C+ charateristics curve
+ V1 : list
+ List of the velocity of C+ charateristics curve
+ H2 : list
+ List of the head of C- charateristics curve
+ V2 : list
+ List of the velocity of C- charateristics curve
+ dt : float
+ Time step
+ g : float
+ Gravity acceleration
+ nn : int
+ The index of the calculation node
+ s1 : list
+ List of signs that represent the direction of the flow
+ in C+ charateristics curve
+ s2 : list
+ List of signs that represent the direction of the flow
+ in C- charateristics curve
+ friction : str
+ friction model, e.g., 'steady', 'quasi-steady', 'unsteady',
+ by default 'steady'
+ dVdx1 : list
+ List of convective instantaneous acceleration on the
+ C+ characteristic curve
+ dVdx2 : list
+ List of convective instantaneous acceleration on the
+ C- characteristic curve
+ dVdt1 : list
+ List of local instantaneous acceleration on the
+ C+ characteristic curve
+ dVdt2 : list
+ List of local instantaneous acceleration on the
+ C- characteristic curve
+ """
+
+ try :
+ list(link1)
+ except:
+ link1 = [link1]
+ V1 = [V1] ; H1 = [H1]
+ dVdx1 = [dVdx1]; dVdt1 = [dVdt1]
+ try :
+ list(link2)
+ except:
+ link2 = [link2]
+ V2 = [V2] ; H2 = [H2]
+ dVdx2 = [dVdx2]; dVdt2 = [dVdt2]
+
+ A1, A2, C1, C2 = cal_Cs(link1, link2, H1, V1, H2, V2, s1, s2, g, dt,
+ friction, dVdx1, dVdx2, dVdt1, dVdt2)
+ # parameters
+ Hb = 10.3 # barometric pressure head
+ m = 1.2
+ As, ht, C, z, Qs = tank # tank properties and results at last time step
+ at = 2.* As/dt
+ Va = (ht-z)*As # air volume at last time step
+ Cor = 0
+ a = np.dot(C1[:,0], A1) + np.dot(C2[:,0],A2)
+ b = np.dot(C1[:,1], A1) + np.dot(C2[:,1],A2)
+
+ def tank_flow(QPs, Qs, a, b, As, ht, C, z, at, Va, Cor, m, Hb):
+ return (((a-QPs)/b + Hb - z - (Qs+QPs)/at - Cor*QPs*np.abs(QPs))
+ * (Va- (Qs+QPs)*As/at)**m - C)
+
+ def tank_flow_prime(QPs, Qs, a, b, As, ht, C, z, at, Va, Cor, m, Hb):
+ p1 = (-m*As/at * (Va- (Qs+QPs)*As/at)**(m-1)*
+ ((a-QPs)/b + Hb - z - (Qs+QPs)/at - Cor*QPs*np.abs(QPs)))
+ p2 = (-1/b -1/at - Cor*2.*QPs*np.sign(QPs))* (Va- (Qs+QPs)*As/at)**m
+ return p1+p2
+
+ # solve nonlinear equation for tank flow at this time step
+ from scipy import optimize
+ QPs = optimize.newton(
+ tank_flow, Qs, fprime=tank_flow_prime,
+ args=(Qs, a, b, As, ht, C, z, at, Va, Cor, m, Hb),
+ tol=1e-10)
+
+ zp = z + (Qs+QPs)/at
+ HP = (a - QPs)/b
+ VP2 = -C2[:,0] + C2[:,1]*HP
+ VP1 = C1[:,0] - C1[:,1]*HP
+
+ if nn == 0: # pipe start
+ VP = np.float64(VP2)
+ else: # pipe end
+ VP = np.float64(VP1)
+ return HP, VP, QPs, zp
\ No newline at end of file
diff --git a/Python/tsnet/utils/__init__.py b/Python/tsnet/utils/__init__.py
new file mode 100644
index 0000000..c4369f0
--- /dev/null
+++ b/Python/tsnet/utils/__init__.py
@@ -0,0 +1,8 @@
+"""
+The tsnet.utils package contains helper functions.
+"""
+
+from .calc_parabola_vertex import calc_parabola_vertex
+from .valve_curve import valve_curve
+from .memo import memo
+from .print_time_delta import print_time_delta
diff --git a/Python/tsnet/utils/calc_parabola_vertex.py b/Python/tsnet/utils/calc_parabola_vertex.py
new file mode 100644
index 0000000..8dd7f6b
--- /dev/null
+++ b/Python/tsnet/utils/calc_parabola_vertex.py
@@ -0,0 +1,20 @@
+"""
+The tsnet.utils.calc_parabola_vertex contains function to
+calculate the parameters of a parabola based on the
+coordinated of three points on the curve.
+
+"""
+def calc_parabola_vertex(points):
+ """Adapted and modifed to get the unknowns for defining a parabola
+
+ Parameters
+ ----------
+ points : list
+ Three points on the pump characteristics curve.
+ """
+ [(x1,y1),(x2,y2),(x3,y3)] = points
+ denom = (x1-x2) * (x1-x3) * (x2-x3)
+ A = (x3 * (y2-y1) + x2 * (y1-y3) + x1 * (y3-y2)) / denom
+ B = (x3*x3 * (y1-y2) + x2*x2 * (y3-y1) + x1*x1 * (y2-y3)) / denom
+ C = (x2 * x3 * (x2-x3) * y1+x3 * x1 * (x3-x1) * y2+x1 * x2 * (x1-x2) * y3) / denom
+ return A,B,C
\ No newline at end of file
diff --git a/Python/tsnet/utils/memo.py b/Python/tsnet/utils/memo.py
new file mode 100644
index 0000000..d6b5f12
--- /dev/null
+++ b/Python/tsnet/utils/memo.py
@@ -0,0 +1,25 @@
+import sys
+from functools import update_wrapper
+
+
+def decorator(d):
+ """Make function d a decorator: d wraps a function fn."""
+ def _d(fn):
+ return update_wrapper(d(fn), fn)
+ update_wrapper(_d, d)
+ return _d
+
+def memo(f):
+ """Decorator that caches the return value for each call to f(args).
+ Then when called again with same args, we can just look it up."""
+ cache = {}
+ def _f(*args):
+ try:
+ return cache[args]
+ except KeyError:
+ cache[args] = result = f(*args)
+ return result
+ except TypeError:
+ # some element of args can't be a dict key
+ return f(*args)
+ return _f
\ No newline at end of file
diff --git a/Python/tsnet/utils/print_time_delta.py b/Python/tsnet/utils/print_time_delta.py
new file mode 100644
index 0000000..6c5c080
--- /dev/null
+++ b/Python/tsnet/utils/print_time_delta.py
@@ -0,0 +1,14 @@
+
+def print_time_delta(seconds):
+ seconds = int(seconds)
+ days, seconds = divmod(seconds, 86400)
+ hours, seconds = divmod(seconds, 3600)
+ minutes, seconds = divmod(seconds, 60)
+ if days > 0:
+ return '%dd%dh%dm%ds' % (days, hours, minutes, seconds)
+ elif hours > 0:
+ return '%dh%dm%ds' % (hours, minutes, seconds)
+ elif minutes > 0:
+ return '%dm%ds' % (minutes, seconds)
+ else:
+ return '%ds' % (seconds,)
\ No newline at end of file
diff --git a/Python/tsnet/utils/valve_curve.py b/Python/tsnet/utils/valve_curve.py
new file mode 100644
index 0000000..c7ccc0a
--- /dev/null
+++ b/Python/tsnet/utils/valve_curve.py
@@ -0,0 +1,32 @@
+"""
+The tsnet.utils.valve_curve contains function to define
+valve characteristics curve, gate valve by default.
+
+"""
+import numpy as np
+
+def valve_curve(s, coeff=None):
+ """Define valve curve
+
+ Parameters
+ ----------
+ s : float
+ open percentage
+ valve : str, optional
+ [description], by default 'Gate'
+
+ Returns
+ -------
+ k : float
+ Friction coefficient with given open percentage
+ """
+ if coeff== None:
+ percent_open = np.linspace(100,0,11)
+ # loss coefficients for a gate valve
+ kl = [1/0.2, 2.50, 1.25, 0.625, 0.333, 0.17,
+ 0.100, 0.0556, 0.0313, 0.0167, 0.0]
+ k = np.interp(s, percent_open[::-1], kl[::-1])
+ else:
+ percent_open, kl = coeff
+ k = np.interp(s, percent_open[::-1], kl[::-1])
+ return k
diff --git a/Services/MCPServer.cs b/Services/MCPServer.cs
index dce54b4..a1e3a41 100644
--- a/Services/MCPServer.cs
+++ b/Services/MCPServer.cs
@@ -393,7 +393,12 @@ namespace CtrEditor.Services
description = "Start the physics simulation",
inputSchema = new {
type = "object",
- properties = new { }
+ properties = new {
+ duration = new {
+ type = "number",
+ description = "Duration in seconds to run the simulation (optional)"
+ }
+ }
}
},
new {