Graph Functions

This section describes the graph functions available in SAInt. These functions are used to analyze and aggregate object input properties and output results to understand their behavior. The function returns data already formatted for a table or plot function so to create out-of-the-box tables or charts. All functions starts with the prefix "g" to stress the need of a graphical output in the form of a table or chart.

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.

1. Graphical functions description

The graphical functions work with an expression selecting multiple objects of the same type and, optionally, specifying graphical parameters to be passed to a plot or nplot command. They perform a task on the set of property values for a certain time step given multiple objects.

As an example, check the simple expression of the function gsum. The form of th expression is GSUP.%.Q.(%), which reads like "select all external of type supply and extract the flow for each time step". SAInt will build a matrix with the number or rows defined by the number of time steps, and the number of columns equal to the number of supply points. The function gsum will calculate the sum over the rows.

An extended version of the basic expression is GSUP.%.Q.(%); dash; 3; red; Title= Test. This version of the expression processes the data in the same way as the basic form, but it also defines the graphical properties to be used when gsum is used as input to a plot command. The title of the chart will be "Test", and the represented line will be dashed, red and with a thickness of 3. The complete command for the example is: plot(gsum('GSUP.%.Q.(%); dash; 3; red; Title= Test')).

1.1. The function gsum

gsum('expr')

Returns a data series representing the sum of the values of a property for a set of objects evaluated by the specified input expression.

Examples:

plot(gsum('GSUP.%.Q.(%)'))

Plots the data series containing the sum of flows from all gas supplies at each time step of the simulation.

graph 01
table(gsum('GSUP.%.Q.(%)'), '02/02/2020 15:00', '02/02/2020 18:00')

Tabulates the data series containing the sum of flows from all gas supplies at each time step of the simulation. To restrict the output a start and end time are specified for the table function.

graph 01 2
nplot(gsum('FGEN.%.P.(%).[GW];3;indigo;[6.0;2.5;7]'), gsum('FUEL.%.F.(%);3;dash;darkorchid;[55000;26000;6]'))

Plots two data series in a single chart. The first data series is the sum of active power from all fuel generators at each simulation time step. The second data series is the sum of fuel consumption from all fuels at each simulation time step.

graph 02

1.2. The function gabssum

gabssum('expr')

Returns a data series representing the sum of the absolute values of a property for a set of objects evaluated by the specified input expression.

Examples:

plot(gabssum('GPI.%.Q.(%)'))

Plots the sum of absolute values of gas flows through all gas pipelines at each time step of the simulation.

graph 03
plot(gabssum('ESTR.%.P.(%)'))

Plots the sum of absolute values of power generated or consumed by all electric storages at each time step of the simulation. This example cannot be used with the reference network ENET39, but it is provided to showcase an application.

graph 04

1.3. The function gmean

gmean('expr')

Returns a data series representing the mean of the values of a property for a set of objects evaluated by the specified input expression.

Examples:

nplot(gmean('ENO.%.PG.(%);green;[160;0;8]'), gmean('ENO.%.PNSDEM.(%);red;4'))

Plots two data series in a single chart. The first data series is the mean active power generated at all electric nodes at each time step of the simulation. The second data series is the mean power not served at all electric nodes at each time step of the simulation (i.e., which is always zero in the optimization scenario).

graph 05
stackplot(gmean('ENO.%.PFGEN.(%);orange'),gmean('ENO.%.PPV.(%);green'))

Creates a stack plot of the mean power generated by all fuel generators and solar plants at all electric nodes, at each time step of the simulation.

graph 06

1.4. The function gabsmean

gabsmean('expr')

Returns a data series representing the mean of the absolute values of a property for a set of objects evaluated by the specified input expression.

Examples:

plot(gabsmean('LI.%.P.(%)'))

Plots the mean of absolute transmission flows through all electric lines at each time step of the simulation.

graph 07
plot(gabsmean('GBR.%.Q.(%);deepskyblue'))

Plots the mean of absolute flow values through all gas branches at each time step of the simulation.

graph 08

1.5. The function gdev

gdev('expr')

Returns a data series representing the sample standard deviation of the values of a property for a set of objects evaluated by the specified input expression.

Example:

table(gdev('FGEN.%.P.(%)'),'19/07/2023 01:00','19/07/2023 13:00')

Tabulates the sample standard deviation of the power generated by all fuel generators at each time step of the simulation within a start and end time. As an example, check the value calculated for the time step 04/01/2022 10:00 and the one you can derive by looking at the value from the expression FGEN.%.P.(34).

graph 09

1.6. The function gabsdev

gabsdev('expr')

Returns a data series representing the sample standard deviation of the absolute values of a property for a set of objects evaluated by the specified input expression.

Example:

table(gabsdev('LI.%.P.(%)'),'19/07/2023 01:00','19/07/2023 13:00')

Tabulates the sample standard deviation of the absolute value of the power through all lines at each time step of the simulation within a start and end time.

graph 10

1.7. The function gmax and gmin('expr')

gmax('expr') and gmin('expr')

These functions return a data series representing, respectively, the maximum and the minimum of the values of a property for a set of objects evaluated by the specified input expression.

Examples:

plot(gmax('ENO.%.PD.(%).[GW];[1.2;0.5;7]'))

Plots the maximum power demand at all electric nodes at each time step of the simulation.

graph 11
table(gmin('LI.%.PLP.(%)'),'19/07/2023 01:00','19/07/2023 13:00')

Returns a table with each time step of the simulation and the minimum active power loading over all the lines within the specified time window.

graph 12

1.8. The function gabsmax and gabsmin('expr')

gabsmax('expr') and gabsmin('expr')

These functions return a data series representing, respectively, the maximum and the minimum of the absolute value of a property for a set of objects evaluated by the specified input expression.

Example:

plot(gabsmax('LI.%.P.(%)'))

Plots the absolute values of maximum power flow through all electric lines at each time step of the simulation.

graph 13

1.9. The function gmaxat and gminat('expr')

gmaxat('expr') and gminat('expr')

Returns a list of objects representing where is the maximum or the minimum of the values of a property for a set of objects evaluated by the specified input expression.

Example:

subplot(plot(gmax('LI.%.LLP.(%);indigo;title=Maximum Active Power load in the System')),plot(gmaxat('LI.%.LLP.(%);Gray;column;Title=Line with Maximum Active Power Load')))

Creates a chart window with two plots. The first plot shows the maximum active power load over all lines in the system at each time step of the optimization. The second plots shows which line in the system have the the maximum load.

graph 14

1.10. The function gabsmaxat and gabsminat('expr')

gabsmaxat('expr') and `gabsminat('expr')

Returns a list of objects representing where is the maximum or the minimum of the absolute value of a property for a set of objects evaluated by the specified input expression.

Example:

table(gabsmaxat('LI.%.P.(%)'),gabsmax('LI.%.P.(%)'),'19/07/2023 01:00','19/07/2023 13:00')

Creates a table, bounded within a start and end time, with three columns:

First Column

Consists of rows with each time step of the simulation.

Second Column

List of transmission lines with the maximum power flow at each time step of the simulation.

Third Column

The maximum power flow among all transmission lines at each time step of the simulation.

graph 15