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 from the results of the DCUCOPF scenario PCM_PEAK_DEMAND_WEEK.esce of the sample electric system ENET39 and from the dynamic scenario BAU_DYNAMIC.gsce of the sample gas system gNetwork1 (in "Tutorials" and folder …\Coupled\Intermediate Tutorial 1\gNetwork1
) available from the "Model Ready Datasets" category of the User Forum (https://forum.encoord.com/). 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.
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.KINGSTON_NY.P; header=KINGSTON_NY;title=Power in Electric Node KINGSTON_NY in [MW]')
-
Creates a table with the active power generation values at the electric node KINGSTON_NY. The column header for the table is "KINGSTON_NY" and the title of the table is "Power in Electric Node KINGSTON_NY in [MW]".
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.
The user may obtain tables with more columns as the ones reported in the following examples. We have hidden some columns when creating the pictures. |
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('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. The node table is the same as in the previous example.
table('EZN.IEEE39.!FGEN.%')
-
Creates a table with all fuel generators and their properties in the electric zone IEEE39.
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('GNO.%.P.[bar-g] > 40')
-
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 40 bar-g. The number of rows is equal to the time steps within the
ChartStartTime
, andChartEndTime
.
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.TURNERSFALLS_MA.PFGEN.[MW]','120[min]','17/07/2023 00:00','20/07/2023 23:00')
-
Creates a table with the integral of the power generated by all fuel generators connected to the electric node TURNERSFALLS_MA using the integral time step, start time, and end time specified in the input expression.
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]','17/07/2023 00:00','20/07/2023 23: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.
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.N3','GNO.N7','P;[bar-g]','Q;[ksm3/h]')
-
Creates a pathtable from gas nodes GNO.N3 to GNO.N7 showing the change in pressure and flow values along the path at the nodes, at the display time of the map window.