Contents - Index


Variable Information

 

The Variable Info command presents a spreadsheet-like table where the variable name, guess value, lower and upper limits, display format, units and comment for each variable currently in the Equations window can be viewed or changed.  These data are initially set to default values.  The defaults, which are determined based on the first letter of the variable name, may be set with the Default Info command.  Variable information can be saved to or loaded from variable information files (*.VAR) in the Professional version.

 

 

The variable name appears in the first column and it can be edited should you wish to change it.  For example, you can change the name of all occurrences of variable k to kappa.  Alternatively, you may just want to change the case of the variable, e.g., kappa to KAPPA.  You can change variable A1 to A[1] to cause it to become an array variable.  Note that the names of individual array elements, e.g., m[1], cannot be changed.  However, if the Show array variables check box (discussed below) is not checked, then only the parent array name, e.g., m[ ], is displayed and the name of the parent array can be changed.  EES variables are case-insensitive.  They must start with a letter and they can consist of any keyboard characters except  ( ' | ) * / + - ^ { }.   When the OK button is pressed, EES will confirm that you wish to change the variable names and will then change every occurrence of each changed variable in the Equations, Diagram and Parametric Table windows. Note that changing variable names in this manner is much preferred to using the Find/Replace capability in the Equations window since none of the other information associated with a variable (e.g., guess value, units etc.) is lost. 

 

The Guess, Lower and Upper value fields may be either numerical values or names of any existing variable.  When a variable name is provided, EES uses the current value of that variable as the guess value or bound.  The words -inf (or -infinity) and inf or (infinity) are used to indicate unlimited lower and upper bounds, respectively.  The control above the Guess column toggles between Guess and Value.  If Guess is selected, as shown, the guess values will be displayed and they can be edited.  If Value is selected, the current values of the variables will be displayed and they cannot be edited.  The Professional version allows the guess value and limits to be specified with equations that can involve existing variables and numerical constants.  For example, the guess value for variable X can be set to (X_min+X_max)/2 provided that variables X_min and X_max have been defined.

 

String variables, identified by a $ as the last character in the variable name, are handled differently in the Variable Information dialog.  The Guess value field shows the currently defined string assigned to the variable, but it cannot be edited.  The Lower and Upper value fields are blank, as is the Units field. String variables will not be shown unless the Show string variables control at the upper left of the dialog is selected.

 

Before this dialog window appears, EES will attempt to solve equations that have a single unknown.  If the value of a variable has been precalculated, its precalculated value will be displayed instead of its guess value in the guess value column and the value will be shown in bold font, as seen for variables A_1, A_2 and others in the above figure.  These bold values can be edited and doing so will change the guess values.  In some cases, that will affect the calculated result for these variables.  

 

 

There are two display modes in the edit fields of the Variable Information dialog.  In Selection Mode, the active cell is outlined and there is a small box at the lower right of the cell, as shown above.  The contents of the cell can be copied to other cells above or below it by pressing the mouse button while the cursor is positioned within the small box and dragging the cursor to the desired location above or below in the same column.  While in Selection mode, Ctrl-C will copy the contents of the active cell to the clipboard and Ctrl-V will paste the contents of the clipboard to the active cell.  Selection and Edit modes are applicable to the Guess, Lower, Upper, Units, and Comment columns.  Clicking the mouse within the selected cell causes a change to Edit mode.  In Edit mode, the outline and small box will not be displayed.  Instead, the contents of the cell will initially be highlighted.  The usual editing procedures can be applied to modify the contents of the cell.  Pressing F2 causes the display to toggle between Edit Mode and Selection Mode.  Alternatively, clicking on any other cell or in the header or footer of the dialog will change the display to Selection Mode.   

 

The display format of a variable in the Solution Window, Parametric Table Window and Diagram Window is controlled by the three columns under the word Display.  Clicking the mouse button in these columns will cause a pop-up menu to appear displaying the Display options.  The first display column provides the options of A, N, F, E, G, S, or T.  A stands for Auto format.  When this format option (the default) is selected, EES will internally choose a format for displaying the value.  N indicates a specified number of significant figures.  Specify the number of significant figures in the next column.  EES will display the number showing the number of significant figures you specify.  F means Fixed Decimal format.  In this case, the number in the next column indicates the number of digits to the right of the decimal separator.  E indicates exponential format.  The number that follows the E in the next column is the number of digits to the right of the decimal separator.   G indicates engineering format.  Engineering format is similar to exponential format in that the value is shown with a number followed by an exponent.  However, in engineering format, that exponent is always an integer factor of 3.  The number of significant figures is entered in the next column.  S indicates that this is a string variable.   T indicates time format.  D indicates date format. The number in the second display column affects the number of significant figures displayed for numerical formats. For F and E formats, this value will the number of digits to the right of the decimal point.  For G (Engineering) format, this number will be the number of significant figures.  In T (time) format, F, '0', 'M' or 'S' will be displayed. '0' indicates the default format specified in the Windows operating system.   'M' indicates that only hours and minutes will be display while  'S' indicates that the display should show hours, minutes and seconds. In D (date) format, the number represents one of the ten date formats.  These formats are revealed by clicking on the cell.  The third field provide formatting options that take effect in the Solution Window, such as underlining, boxing, or bolding.

 

The units of the variable may be entered in the Units field.  Note that the display format and units of each variable can also be changed by clicking on the variable in the Solution Window.  The text entered in the Units field is used by EES when checking unit consistency of the equations.  Units shown in purple have been provided by EES.  Be sure these units are correct.  Click on the unit to accept it.  Its color will then change to black.  As an alternative to typing the units, it is possible to select the units from a Units List.  The Units List is accessed by selecting a cell in the Units column (so it is shown within a rectangle) and then clicking the right mouse button.

 

EES can display values of variables in the Solution Window converted for an alternate set of units, as shown below.  The alternate units can be entered in the Solution Window or in the Variable Information dialog.  To enter the alternate set of units, click on the Units control and select (Units).  The alternate units can then be entered in the Units column and it will be displayed in brown font as shown.

 

 

   

 

 

Variables in the main program will have columns for the Key variable designation and an optional comment.  Key variables are displayed in the Key Variables Solution Window with the comment.  In the Comment field, a | character is interpreted to be a line break character.  Note that the Variable Information dialog can be stretched, if necessary to accommodate long comments by dragging the Resize icon located at the lower right corner of the dialog.  Also, the edit field for the Units and Comments will automatically scroll as the left and right arrow keys are used if the text is too wide to be completely visible.

 

The Show array variables checkbox control at the upper left of the dialog window will be accessible if there are one or more arrays are in the Equations window.  When this control is selected, all array elements appear in the Variable Info dialog and the guess value, bounds, display format, and units can be set for each individual element as for any other variable.  However, when the control is de-selected, all arrays elements are represented by a single entry.  For example, m[ ] represents all array elements having the parent name m.  If any of the characteristics for a parent array are changed, that change is applied to ALL array elements.  For example, changing the guess value for m[ ] will result in the new guess value being applied to all array elements in array m.  However, other characteristics, such as the bounds, would not be affected.  The units field of the dialog will display 'mixed' if the units of the array variables are not all the same Note that the guess values and bounds for an array can be set to other arrays by entering the array name followed by open and closed square braces.  In the figure below, the guess values for all elements in the x array are set to the values of y with the same array index.  That is, the guess value for x[1] is y[1], the guess value for x[2] is y[2], and so on.  Similarly, the upper bounds for x[1], x[2], ... are set to z[1], z[2], etc.  Click the Apply button to make these changes after editing the fields.  The changes can be viewed by clicking the Show array variables checkbox to toggle the display of the array variables.  In addition, the array name can be changed by editing the name in the first column of the Variable Info dialog. 

 

Note that EES will make changes to the variable information only after a field is edited.  If, for example, you add new variables to the x array by increasing the index, and you wish to ensure that the guess values of all elements in the array are set to y[ ], you may need to change the y[ ] in the Guess field to something else, like 1 and then click the Apply button.  Then reset the Guess field to y[ ] and again click the Apply button to ensure that the changes are applied to all array elements.   Alternatively, click the 'Show array variables' check box so that it is not checked.  Make the changes to the array.  Then click the control again to show the array elements.  The change will be applied to all array elements.

 

 

If the Equations Window contains one or more internal Functions, Procedures, Modules or Subprograms, a control containing a list of all these internal routines and the Main program will appear at the center top of the Variable Information dialog as shown below.

 

 

The variable information for an internal routine can be specified after selecting the routine from this list.  Note that each Function/Procedure/Module/Subprogram has its own set of variables, as does the Main program.  Each Function/Procedure/Module may also have separate unit settings, which are set with the $UnitSystem directive.  The same variable name may be used the different routines and in the Main program.  Using this control, the set of variables corresponding to each function/procedure/module/subprogram can be selected, viewed, and changed.  Note that the assignment statements used in internal functions and procedures makes guess values and limits not applicable so these fields are not available for functions and procedures.  Also, the guess values and limits for variables that are inputs to a subprogram or module are controlled by the calling program and are thus not applicable.  The word "Input" will be displayed in gray, in place of the value in this case.  

 

The Update button operates in a similar manner to the Update Guesses command.  However, there are differences when the EES program employs modules.  As with the Update Guesses command, the Update button is enabled only if the calculations have been successfully completed.  Clicking the Update button will replace the guess value of each variable in the selected module or main program with its current value, i.e., the value determined in the last calculation.  If a module is called from the main program more than one time, the values can not be unambiguously determined so the Update button is disabled.  

 

When the OK button is pressed, all changes made to the variable information since the dialog window appeared are accepted and the dialog window is closed.  The Apply button acts just like the OK button, but the dialog window is not closed, so additional changes can be made.  The Cancel button will restore all fields to the condition they were in when the Variable Information dialog was first presented and then remove the dialog. Clicking the cancel box at the upper right of the dialog does the same thing as clicking the Cancel button. Note that changes made to the Equations window when the Apply button is clicked are not reset if the Cancel button is subsequently clicked.  Hold the Ctrl key down to bypass EES setting the units of all array elements to be the same as the units of the first array element.

 

Keyboard input, as well as the mouse clicks, can be used to move the input edit box to a different row or column in Selection Mode.  The up and down arrow keys move the focus up or down one row.  The left and right arrows change columns.  (Note that the Display columns are not selectable and so these are skipped when you press the arrow keys).  The PageUp and PageDown keys will move the focus up or down by one less than the number of displayed rows.  The Tab key moves the focus to the following column.  Shift-Tab move the focus to the previous column.  The Enter key moves the focus down one row.  

 

The width and height of the Variable Information dialog window can be enlarged from its default settings.  To change the height of the dialog, move the mouse to the top or bottom border of the window or to the resize icon at the lower right of the dialog window.  The cursor image should change to a double-arrow.  Press and hold the left mouse button down while dragging the mouse to a new position.  When the mouse button is released, the window will be resized.