# Simulation results¶

WNTR uses Pandas data objects to store simulation results. The use of Pandas facilitates a comprehensive set of time series analysis options that can be used to evaluate results. For more information on Pandas, see http://pandas.pydata.org/.

Results are stored in Pandas Panels. A Panel is a 3-dimensional database. One Panel is used to store nodes results and one Panel is used to store link results. The Panels are indexed by:

• Time in seconds from the start of the simulation

Conceptually, Panels can be visualized as blocks of data with 3 axis, as shown in Figure 8.

Node attributes include:

• Demand
• Expected demand (only when the WNTRSimulator is used)
• Leak demand (only when the WNTRSimulator is used)
• Pressure
• Quality (only when the EpanetSimulator is used. Water age, tracer percent, or chemical concentration is stored, depending on the mode of water quality analysis)
• Type (junction, tank, or reservoir)

• Velocity
• Flowrate
• Status (0 indicates closed, 1 indicates open)
• Type (pipe, pump, or valve)

The example simulation_results.py demonstrates use cases of simulation results. Node and link results are accessed using:

print(results.node)


The indices can be used to extract specific information from the Panels. For example, to access the pressure and demand at node ‘123’ at 1 hour:

print(results.node.loc['pressure',3600,'123'], results.node.loc['demand',3600,'123'])


To access the pressure for all nodes and times (the “:” notation returns all variables along the specified axis):

print(results.node.loc['pressure',:,:].head())


Attributes can be plotted as a time-series, as shown in Figure 9:

pressure_at_node123 = results.node.loc['pressure',:,'123']
pressure_at_node123.plot()


Attributes can be plotted on the water network model, as shown in Figure 10. In this figure, the node pressure at 1 hr and link flowrate at 1 hour are plotted on the network. A colorbar is included for both node and link attributes:

pressure_at_1hr = results.node.loc['pressure',3600,:]

results.node.to_excel('node_results.xls')