# How to get system statistics out of XPSWMM Model

source: Innovyze Support Portal

XPSWMM generates lots of system statistics such as total inflow and outflow of a node, peak flows through pipes.

Many of the statistics cannot be easily accessed through the user interface, and it will require a little bit extra work to get them.

# Interpolation vs Computed

It is important to understand the the differences between the computed and interpolated values.

As shown in the figure below (credit: SWMM5 hydrology reference manual), the circles are the values computed by the engine, in general, it is reported at each simulation timestep (Trout: routing timestep, some of the engine will half the timestep if the error doesn’t converge, therefore, the timestep might not be fixed). Since exporting all the computed timestep can be an overkill for most applications, time series for flow and depth are usually reported at bigger time intervals, which is interpolated from the computed values as shown in squares, it is just a simple linear interpolation between the two closest computed values.

For example, you might compute every 1 second but choose to report every 5 minutes.

## The implication is system statistics can only be accurately calculated by the engine.

For example, the peak value is calculated by updating the max value at every time step. You can calculated the peak flow from the reported time series, however, you might miss the true peak if it happened between the two reporting timestamps.

For a collection system, ideally we would like to see flow and depth changes gradually, and as a result, statistics calculated using a reporting interval of 5 min should give very similar results as the system reported statistics using all the computed values. Therefore, it is always a good idea to compare the reported peak with system computed peak.

# System Statistics

The best place to find system statistics is the 1D log.

For hydrology information, refer to the RUNOFF Tables

For hydraulics information, refer to the Hydraulics tables,

For example, we would like to get the summary of total inflow and outflow through the outfall nodes. Then we go to Table E19. As shown below, to get the total volume of the flow through this simple model is not easy manually. We will have to calculate it from the reported time series and input data. Since the inflow/outflow time series of a node is not reported, we don’t have too much from the results to calculate the inflow to a node. But if we check table E19, it is all there.

One problem with the 1D log is that it is not that easy to extract that information, a better way is to use the XPTables to extract the information automatically from the results.

# System Statistics XPTables

First open the XP Table tab,

Next, we create a table to report the volume for nodes.

It will take some time to figure out which variable is the one in the Table E16, but you only need to do this once.

- edit the variable of the table
- find the inflow/outflow volume folder
- drag the folder to the box on the right side

Now we have most of the values populated in this XPTable,

# Use the default template

Most of the system statistics and summaries are built into the default template. Using one of these templates probably will be easier than rolling out your own.

If you are starting a new project, choose “Use Default Template”,

You can see a long list of the XPTables. You can hide the ones that you are not interested by unchecking these tables.

## Import only the XPTables into an existing model

If you are already in the middle of a project, you can merge the XPTables from another model.

For example, you can create an empty model using the default template, then merge it into your existing model.

Only check the global Databases, this will import XPTables, and other records such as rainfall from the other model.

You can find more templates from the online resources page.