Use Global Variable if the lookup table or relationship you need to define varies as a function of a variable that is computed outside of HEC-ResSim and provided as either an input time series or a constant value for the whole simulation.

When Global Variable is selected, the edit panel of the Independent Variable Definition dialog (below) will display the Global Variable pane; this pane contains the user interface to choose the global variable that will define the independent variable for the function.

Figure: Independent Variable Definition Dialog - Global Variable

The Model Variable pane includes:

  • A Global Variables table—a list of all the global variables defined for the current network.  If a Global Variable is not shown here, it is not of a type that can be used for an independent variable definition at this time and requires a State Variable script to convert it to the appropriate type.  At this time, only Time Series  and certain Scalar global variables can be used in the Independent Variable Definition window.  Time Series global variables obtain their value from a DSS record defined in the Time Series tab, while Scalar global variables have a constant value for all timesteps, set in the Alternative Editor's Global Variable tab.
  • A Select button—when you find the model variable you need, highlight it (click on it) in the table then click the Select button.

    NEW IN RESSIM 4.0 Double-clicking on the variable you want WILL also perform the selection.

  • A Selected Model (Global Variable) Time-Series textbox—The name of the global variable you selected from the table will appear here when you press the Select button. Be sure your selected global variable is shown in this field before you click the OK button to apply your selection.

  • A set of Time Series Options ("Figure: Time Series Options")—For global variables that are time-series data,, a value reflective of the state of that model variable is used to look up the dependent variables in the relationship you are defining. The Time Series options allow you to specify how the value of the global variable is to be selected or computed from the input time series. The time series options are specified as a combination of the Function and, if needed, the offset and or period used by the function. The Function are all used to identify or compute a value from the time series relative to the current timestep, so think of the time of the current timestep as the base time or origin. For example, if you selected Previous Value for the Function, the value returned from the global variable and used in the current timestep to lookup the value of the dependent variable from your function will be from the end of the previous timestep. The Time Series Options include:

    Figure: Time Series Options

    • Function—this is how the value for the selected global variable is to be selected or computed from the global variable time series. Options include:
      • Current Value—returns the value stored in the global variable for the current timestep.
      • Previous Value—returns the value stored in the global variable at the end of the previous timestep.
      • Offset Value—returns the value stored in the global variable at a time offset from the current timestep's time. This function activates the Offset field; you may enter a positive or negative value, in HOURS, for the offset.
        For example, if you enter an offset of 6 hours, the value obtained from the time series will be at time = current time + 6 hours.
      • Period Average, Period Maximum, Period Minimum—these functions will compute a value (average, maximum, or minimum) for the period of time specified in the time series relative to the current timestep's time. Both the Period and Offset fields are active for these functions.
        For example, if you want a 6 hour average computed from the time series data offset 3 hours back from the current timestep, you should select Period Average for the Function and enter -3 for the Offset and 6 for the period. These entries will return the average value of the global variable from the period -9 hours to 3 hours relative to the current timestep.
    • Offset—The offset adjusts the origin time and may be entered as a positive or negative value. A positive offset will obtain a value from the time series at a time forward from the time of the current timestep. A negative offset will look backward from the current timestep. Note—the offset is entered in units of hours, not timesteps; take this and the compute interval (timestep) into account when specifying the offset.
    • Period—The period is used to specify a range of time back from the origin over which a value is to be computed. Only positive values can be used to specify the period. Note—the period is entered in units of hours, not timesteps; take this and the compute interval (timestep) into account when specifying the period.