General Functions

This section describes the general functions available in SAInt. These functions are used to interact with objects via the map window, to edit the object’s properties in the editor, to navigate the map window or to change the display time.

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. General functions description

1.1. The function clear

clear()

Clears the command window in the SAInt-GUI.

1.2. The function edit

edit('expr')

Opens the property editor for the object specified in the input expression. Multiple objects of the same type can be specified. A multi-edit session will be activated in the property editor for the common properties.

Examples:

edit('GNO.%')

Opens a multi-edit window to edit common properties for all gas nodes in the network. All 29 nodes are selected for editing.

edit('GNO.N6.!GDEM.%')

Opens the property editor for editing the properties of the gas demand external connected to gas node GNO.N6. We have used % to make sure to select all possible demand externals.

edit('EZN.IEEE39.!LI.%')

Opens a multi-edit window to edit common properties for all electric lines, connected to electric zone IEEE39. All lines are selected as the model has only one zone.

1.3. The function time

time('expr')

Changes the display time on the map window.

Examples:

time('+1')

Increases the display time of the map window by one hour.

time('14/02/2023 11:00')

Changes the display time to the date and time specified in the expression.

time('1/5')

Sets the display time to hour 5 (value after "\") of the same day (value before "\")(the value 1 stands for "same day", smaller integer values for days before or bigger integer values for days later on").

time('2/6')

Sets the display time to hour six of the day after the initial (1 + 1 for the value of 2 before "\").

1.4. The function path

path('startnode','node(1)',..,'node(n)','endnode')

The function selects the shortest path from the start node to the end node. The path also covers the intermediate nodes if specified in the input expression.

Example:

path('GNO.N3','GNO.N7')

Marks the shortest path from gas nodes GNO.N3 to GNO.N7. Mandatory arguments are: 'startnode' and 'endnode' (as in the example). The user can specify other nodes to be crossed.

1.5. The function zoom

zoom('expr(1)',..,'expr(n)')

Zooms to the object(s), specified in the input expression, on the map window. It can also zoom to the object(s) based on a given condition (conditional expression). At least one expression is mandatory for the function to zoom in the active map view window.

It is possible to specify the name of the map view where to perform the zoom operation. Simply append to the object expression selecting the objects you want to zoon on with Map_View_Name.

Examples:

zoom('ENO.(%)')

Zooms to all electric nodes.

zoom('GNO.N5','GNO.N6')

Zooms to gas nodes GNO.N5 and GNO.N6 on the gas network map.

zoom('FGEN.%.FuelName == "NATURAL_GAS"')

Zooms to all electric nodes containing the fuel generators that uses the fuel NATURAL GAS.

1.6. The function mark or unmark

mark/unmark('expr')

The function marks or unmarks the object specified in the expression in the active map window. The input expression can also be a conditional expression allowing to select objects on certain criteria. The two functions accept more than one expression. At least one expression is mandatory for the function to work.

Examples:

mark('GSUP.(%)')

Marks all gas nodes containing gas supply objects on the map window.

mark('GSUP.(%)','GCS.(%)')

Marks all gas nodes containing gas supply and compressor objects on the map window.

mark('GSUP.%.NQ!X_H2 > 0.10')

Marks all gas nodes containing the gas supply objects, with a molar percentage of hydrogen (H2) greater than 10 %, on the map window for the active time step.

1.7. The function find

find('expr')

Checks the existence of the specific object given in the input expression. It can also find the object based on a given condition (conditional expression). Returns the ObjectType.ObjectId in case of existence and Object not found in case of non-existence. At least one expression is mandatory for the function to work. Multiple expressions could be used as arguments.

Examples:

find('GNO.N7')

Checks the existence of the gas node N7.

find('ENO.HARTFORD_CT.!EXT.%')

Returns a list of all externals connected to electric node ENO.HARTFORD_CT.