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.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. The expression for time could be one of the following (see example below):
-
a time withing the scenario time window expressed using the same date and time format of the active session of SAInt, like, for example the format
MM/dd/yyyy hh:mm(e.g., eight o’clock in the morning of January 21st of 2021 is "01/21/2021 08:00"). -
a positive natural number, which will increase the time of a specified amount of hours.
-
D/HH:MM: addsDdays to the active time of the simulation and sets the time to hourHHand minutesMM.Dis strictly positive.
Examples:
time('01/21/2021 08:00')-
Changes the display time to the date and time specified in the expression.
time('+3')-
Increases the display time of the map window by three hours.
time('1/5:45')-
if the displayed time February the 1st at 6 in the morning, the command resets to February 2nd (i.e., +1 day) at a quarter to six in the morning (i.e., 05:45).
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.
1.8. The function isf
isf('expr(1)','expr(2)', 'expr(time)', 'expr(3)')
Where:
-
expr(1): it is the expression for the branch objects of interest. -
expr(2): it is the expression for the node objects where injections occur. -
expr(time): expression indicating the timestamp for the calculation of ISFs. If not specified, the active time step is used. This is an optional argument. -
'expr(3)': expression to select a single reference node object. The reference node will be used as the angle reference node for the ISF calculations. This is an optional argument.
Injection Shift Factors (ISFs), also known as Generation Shift Factors (GSFs), quantify how a change in power injection at one node and a corresponding withdrawal at a reference node affects the power flow on a specific branch. They represent the sensitivity of line flows to nodal injections, assuming a linear (DC) power flow model.
In contingency analysis, ISFs are used to quickly estimate how re-dispatching generation or changing load patterns will influence network loading. By knowing the ISFs, operators can assess which lines are most affected by power transfers and determine corrective actions to prevent overloads after an outage. ISFs also form the basis for calculating Line Outage Distribution Factors (LODFs), since both describe how power redistributes in response to changes in network conditions. This makes ISFs fundamental tools for reliability studies, congestion management, and real-time grid security assessment.
Examples:
isf('LI.PROSPECT_CT_TO_SOUTHBURY_CT', 'ENO.SOUTHBURY_CT')-
injection shift factor for line PROSPECT_CT_TO_SOUTHBURY_CT and node SOUTHBURY_CT at the active time step.
isf('LI.PROSPECT_CT_TO_SOUTHBURY_CT', 'ENO.SOUTHBURY_CT', '22/07/2023 00:00')-
injection shift factor for line PROSPECT_CT_TO_SOUTHBURY_CT and node SOUTHBURY_CT at the time step 22/07/2023 00:00.
isf('LI.PROSPECT_CT_TO_SOUTHBURY_CT', 'ENO.SOUTHBURY_CT', '22/07/2023 00:00', 'ENO.PROSPECT_CT')-
injection shift factor for line PROSPECT_CT_TO_SOUTHBURY_CT and node SOUTHBURY_CT at the time step 22/07/2023 00:00, with ENO.PROSPECT_CT as the angle reference node.
isf('LI.PROSPECT_CT_TO_SOUTHBURY_CT', 'ENO.%')-
injection shift factors for line PROSPECT_CT_TO_SOUTHBURY_CT and all nodes in the model at the active time step.
isf('LI.%', 'ENO.SOUTHBURY_CT', '22/07/2023 00:00')-
injection shift factors for all lines in the model and node SOUTHBURY_CT at the time step 22/07/2023 00:00.
1.9. The function lodf
lodf('expr(1)','expr(2)', 'expr(time)')
Where:
-
expr(1): it is the expression for the branch object undergoing an outage. -
expr(2): it is the expression for the branch object selected to monitor the impact of the outage. -
expr(time): expression indicating the timestamp for the calculation of LODF. If not specified, the active time step is used. This is an optional argument.
Line Outage Distribution Factors (LODFs) are sensitivity coefficients used in power system analysis to estimate the change in power flow on transmission lines following the outage (disconnection) of another line, without performing a full power flow recalculation. Mathematically, LODF quantifies the fraction of the pre-outage flow on a failed line that will redistribute to other lines in the network.
In contingency analysis — an essential part of reliability assessment — LODFs enable rapid screening of potential outages ("N-1" or "N-k" contingencies) to identify lines that may become overloaded if another line fails. By using LODFs, system operators can efficiently predict post-contingency flows, evaluate network vulnerability, and plan remedial actions such as re-dispatching generation or adjusting topology.
Examples:
lodf('LI.PROSPECT_CT_TO_SOUTHBURY_CT', 'LI.SOUTHBURY_CT_TO_DANBURY_CT')-
LODF value for line LI.PROSPECT_CT_TO_SOUTHBURY_CT in case of an outage of line SOUTHBURY_CT_TO_DANBURY_CT at the active time step.
lodf('PROSPECT_CT_TO_SOUTHBURY_CT', 'LI.SOUTHBURY_CT_TO_DANBURY_CT', '21/07/2023 20:00')-
LODF value for line PROSPECT_CT_TO_SOUTHBURY_CT in case of an outage of line SOUTHBURY_CT_TO_DANBURY_CT at the time step 21/07/2023 20:00.