Overview of delays and functions
The purpose of a "Delays and functions" superblock is to allow the user to add delayed variables (using the Time delay block) or to incorporate additional variables (using mathematical expressions and if-then rules in the Script block).
On this page you can find out about:
Data flow in the Delays_and_functions superblock
The contents of a Delays_and_functions superblock may be:
-
Time_Delays superblock
Time_Delays superblock: In this superblock, the fields that need to be delayed are separated from the fields that do not need to be delayed.
-
The fields enter the input port block.
-
All the raw fields are ported to a port combiner block.
-
The raw fields are also ported to a second superblock named Create_Time_Delays.
-
The delayed fields leaving the Create_Time_Delays superblock are combined with the original fields in the Combine_Original_and_Delayed_Tags port combiner block
-
The fields leave the superblock via the output port.
Create_Time_Delays superblock:
-
The fields enter the input port block.
-
The Delay_Time script block may be used to generate the delay field (i.e. the field that determines the number of seconds by which to delay the output). It is possible to make this a fixed value or to write a set of rules that could use any number of fields to determine what the length of the delay should be.
Note: The delay field MUST be specified as number of seconds by which to delay the input fields
-
The fields to be delayed are selected by the field selector block.
-
The input fields enter the variable time delay block through the top input port and are delayed by an amount dictated by the field in the time delay input port (the bottom input port)
-
The delayed fields leave via the Output Port.
Create_New_Variables superblock:
-
The fields enter the input port block.
-
A script block may be used to generate additional variables.
-
The original fields from the input port are combined with those created in the script block in the port combiner block
-
The fields leave the Create_New_Variables superblock via the output port.
Time delays
-
Due to the sometimes long and variable lags as a result of material being transported over considerable distances or due to other transport phenomena, it may be necessary to lag certain variables so that they will add value when included in the model.
-
A block is available which keeps a history, defined by the user (say N seconds), of the fields of interest and is able to provide a value of the field at up to N timesteps ago.
Use of the Script block
-
The script block is used to add or modify tags in the blueprint
-
The scripting language is simple and intuitive, very similar to the Pascal programming language
-
Mathematical expressions and if/then rules may be configured in the script block and may make use of input variables, local variables and variables generated by the script.
Related topics: