Table Functions

This section describes the table functions available in SAInt. These functions are used to tabulate object input properties and output results to analyze and compare the data within a defined time window.

The functions are listed in Section 1 with their syntax, description, and output examples. The syntax of the functions includes expr which refers to the input expression. The examples shown are based on the dynamic scenarios of the sample electricity (ENET09_13) and gas (GNET29_18) networks available in the user’s Projects folder (C:\...\Documents\encoord\SAInt-v3\Projects). Please consider the type of object used in the expression to select the correct network. Scenario results must be available for the expression to be executed correctly in the command window. Note that the sample electricity (ENET09_13) model uses a stochastic profile for the hydro reservoir. This is why the user may get different results from the ones presented here or each time the same command is used in the active session of SAInt.

The user can easily copy and paste the code in the command window and replicate the examples.

In the context of table functions, the time expression is an optional parameter that can be used to specify the start and end times of the tabulated data. If a time expression is not provided, the default start time and end time for the tabulated data are given by the ChartStartTime and ChartEndTime properties in the scenario editor. However, if a specific time instant is required any table function will use the display time of the map window unless otherwise defined in the input expression.

1. Table functions description

The main functions creating tables in SAInt are described in the following sections with examples demonstrating how to use them.

SAInt allows to specify the title and header variables in the input expression for all table functions to define the title of the table and the name displayed in the header row, respectively.

Example:

table('ENO.Node4.P; header=Node 4;title=Power in Electric Node 4 in [MW]')

Creates a table with the active power generation values at the electric node Node4. The column header for the table is Node 4 and the title of the table is Power in Electric Node 4 in [MW].

table 00

1.1. The function table

table('expr(1)',..,'expr(n)','starttime','endtime')

Creates a separate table for each of the input expressions. If no start and end times are defined, it uses the default start time and end time given by the ChartStartTime and ChartEndTime properties in the scenario editor. At least one expression is mandatory.

Examples:

table('GNO.%')

Creates a table with gas node properties as columns and gas nodes as rows. In the following picture, some of the columns automatically displayed have been hidden.

table 01
table('GNO.%','GPI.%')

Creates separate tables for all gas nodes and pipelines with their respective properties. The node table is the same as in the previous example. The pipeline table is displayed in the following picture.

table 02
table('EZN.INDUSTRIAL.!FGEN.%')

Creates a table with all fuel generators and their properties in the electric zone INDUSTRIAL.

table 03
table('ENO.%.PG','+5','+10')

Creates a time-series table with columns equal to the number of electric nodes. Each column contains rows with values of the active power generated at the specific node from 5th to 10th hour of the simulation.

table 04
table('GNO.%.P.[bar-g] > 30')

Creates a Boolean table with columns equal to the number of gas nodes. Each column contains rows with True/False values indicating if the pressure at a specific gas node is greater than 30 [bar-g]. The number of rows is equal to the time steps within the ChartStartTime, and ChartEndTime.

table 05

1.2. The function inttable

inttable('expr(1)',..,'expr(2)','timestep','starttime','endtime')

Creates a separate table with the integral values for each of the input expressions. If no start time and end times are defined, it uses the default values specified by the ChartStartTime, and ChartEndTime properties in the scenario editor. The timestep is a mandatory parameter defining the time window for integration. At least one expr must be specified.

Consider to use as 'starttime' and 'endtime' values defining a time window giving integer values when divided by 'timestep'. This avoids having biased figures for the last calculated value.

Example:

inttable('ENO.Node3.PFGEN.[MW]','120[min]','03/01/2022 00:00','04/01/2022 00:00')

Creates a table with the integral of the power generated by all fuel generators connected to the electric node Node3 using the integral time step, start time, and end time specified in the input expression.

table 06

1.3. The function meantable

meantable('expr(1)',..,'expr(n)','timestep','starttime','endtime')

Creates a separate table with mean values for each of the input expressions. If no start time and end times are defined, it uses the default values specified by the ChartStartTime, and ChartEndTime properties in the scenario editor. The timestep is a mandatory parameter defining the time window for averaging. At least one expr must be specified.

Example:

meantable('ENET.PFGEN.[MW]','2[h]','03/01/2022 00:00','04/01/2022 00:00')

Creates a table with the mean power generated by all fuel generators using the mean time step, start time, and end time specified in the input expression.

table 07

1.4. The function pathtable

pathtable('startnode','node(1)',..,'node(n)','endnode','property(1)',..,'property(n)','time')

Creates a table with the change in specified property values along the path for each node. By default, the shortest path from the start to the end node is used. Intermediate nodes can also be defined, but are optional. The default time of the pathtable is the display time of the Map Window. At least one property is mandatory.

Example:

pathtable('GNO.CGS_01','GNO.CGS_02','GNO.CGS_07','P;[bar-g]','Q;[ksm3/h]')

Creates a pathtable from gas nodes CGS_01 to CGS_07 via CGS_02 showing the change in pressure and flow values along the path at the nodes, at the display time of the map window.

table 08