Copyright: 2003 S.A. Klein


EES Help Index

Windows	Menu Commands

Equations	File Menu

Arrays	Edit Menu

Solution	Search Menu

Residuals	Options Menu

Parametric Tables	Calculate Menu

Plot Windows	Tables Menu

Lookup Tables	Plot Menu

Integral Tables   	Windows Menu

Diagram Windows	Help Menu

Formatted Equations	Textbook Menu

Report Window

Debug Window

Functions and Procedures	Input / Output

Fluid Property Information 	String Variables

Mathematical Functions	Complex Numbers

String Functions	European Numerical Format

Thermophysical Functions	Exporting results to a disk file

Internal Functions	Lookup File Formats

Internal Procedures	Array Range Notation

Library files	Constants

External Functions	 	Plots

External Procedures	LaTeX/PDF Report generator

IF - THEN - ELSE	 	Greek and special symbols

LOOKUP

Unit Conversions

Modules and Subprograms

Multiple External Routines

Special Topics	Professional Version

Directives	Differences from Commercial Version

Unit Checking 	Hot areas and Child Diagram Windows

Differential / Integral Equations	Macro Files

Configuration Options	Dynamic Data Exchange

Curve Fitting	Distributable Programs

2-D Interpolation	Library Manager

3-D plots	Formatted text in Diagram Windows

Debugging Help

EES File Types

Acknowledgements


Acknowledgements

The sparse matrix solution method used by EES to solve equations was developed with help and program fragments from Professor F.L. Alvarado, Dept. of Electrical and Computer Engineering, University of Wisconsin - Madison.  His contributions were particularly appreciated early in the development of EES.

A special acknowledgement is appropriate for Professor W.A. Beckman, Mechanical Engineering Department, University of Wisconsin - Madison.  His suggestions and encouragement for many years made development of the EES program possible.

The three-dimensional plotting package is based on a modification of the public domain GLScene package (http://www.glscene.org/).

The genetic optimization method implemented in EES is derived from the public domain Pikaia optimization program (version 1.2, April 2002) written by Paul Charbonneau and Barry Knapp at National Center for Atmospheric Research (NCAR) (http://www.hao.ucar.edu/public/research/si/pikaia/pikaia.html).


Window_Equations
Equations (WINDOWS menu)

The Equations window operates very much like a word processor.  The equations which EES is to solve are entered in this window.  Editing the text in the Equations window is facilitated with the Cut, Copy, Clear, Paste, and Undo commands in the Edit menu and the Find, Replace and Next commands in the Search menu.  Most of the capabilities of the Edit menu, as well as bookmarks in the Search menu created with the $Bookmark directive can be accessed by pressing the right mouse button anywhere within the Equations window.  The following menu will appear.

1.	Blank lines may be used to make the Equations window more legible.  Comments are enclosed in braces {comment} or within quote marks "comment" and may span multiple lines.  Comments within braces may be nested in which case only the outermost set of braces are recognized.  Comments within quote marks will also be displayed in the Formatted Equations window and long comments will be automatically wrapped to fit the width of the window.   Pressing the right mouse button in the Equations window will cause a pop-up menu to appear with a menu item to place (or remove) brace or quote comments around the selected text.  The color and font of the comments can be set in the Equations Display Tab of the Preferences dialog.

       The units of a numerical constant can be specified by enclosing the units in brackets after the constant.   For example:

P_4=100 [bar]

The pop-up menu that appears when you right-click in the Equations window has a Units List item.  Selecting that item will bring up the Units List dialog that holds many of of the common unit strings eliminating the need to key in the unit string and its brackets.

Note:  EES versions previous to 6.646 allowed the units of a variable on the left side of an equal sign to be assigned units that were specified in a comment statement that began with a units specification.  This capability is no longer provided.  Information provided in a comment is not used to set units.

2.	Equations may be entered in any order.  The order of the equations has no effect on the solution, since EES will block the equations and reorder them for efficient solution.

3.	The mathematical operators used in the equations conform to the rules used in FORTRAN or Pascal.  For example, the equation

X =  3 + 4 * 5

will result in X having a value of 23.  The caret symbol (^) or ** can be used to indicate raising to a power.  Arguments of functions are enclosed in parentheses.  EES does not require a variable to appear by itself on the left-hand side of the equation, as do FORTRAN and most other programming languages.  It is equivalent to enter the above equation as

(X - 3) / 4 = 5

4.	Upper and lower case letters are not distinguished.  EES will (optionally) change the case of all variables to match the manner in which they first appear in the Equations window depending on the settings made with the Preferences dialog in the Options menu.  However, this change is made only when the equation is first compiled or modified or when the Check/Format command in the Calculate menu is issued.

5.	Variable names must start with a letter and consist of any keyboard characters except  ( ) * / + - ^ { } ;.  The maximum variable length is 30 characters.  Array variables are identified with square braces around the array index or indices, e.g., X[5,3].  The quantity within the braces must be a number, except within the control of the SUM, PRODUCT or DUPLICATE commands.  As a general rule, variables should not be given names which correspond to those of built-in functions (e.g., PI, SIN, ENTHALPY).

6.	EES has an upper limit of 6000 variables (12,000 for the Professional version) in the main program but the number of variables may be limited to a smaller value by available memory. Note that variables in a module are added to the variables in the main program each time the module is called.

7.	Equations are normally entered one per line.  Multiple equations may be entered on one line if they are separated by a semicolon (U.S. format) or colon (European format).  There is no limit on the length of an equation, although the use of short equations is encouraged.  Long equations are accommodated by the provision of a horizontal scroll bar which appears if any of the equations is wider than the window.  Alternatively, long lines may be wrapped within the window so that a horizontal scroll bar is not needed by making appropriate choices in the Equations tab of the Preferences dialog.   An equation may be entered on two or more lines provided that each line, except the last, ends with the line break character, which is an ampersand (&).  The ampersand character is removed by EES so that it is not included in the equation.  The ampersand character is useful primarily when creating a LaTeX/PDF report as LaTeX will not automatically wrap long equations.

8.	EES compiles equations into a compact stack-based form.  The compiled form is saved  in memory so that an equation needs to be compiled only when it is first used or when it is changed.  Any error detected during the compilation or solution process will result in an explanatory error message and highlighting of the line in which the problem was discovered.

9.	Equations can be imported from other .EES files or from .TXT files containing ASCII characters using the Merge command in the File menu or with the $INCLUDE directive.  EES files can also be imported from versions of EES on other operating systems, e.g., the Macintosh, if they are saved in Export format, as described in the Save As command.

10.	If the Show Subscripts and Greek Symbols option in the  Preferences dialog is selected, then the format of variables entered in Equations window will be enhanced in several ways.  Greek names (e.g., alpha, beta) will display as greek symbols.  Array variables, e.g., XZ[2] will display with the array index as a subscript.  The underscore character will usually indicate a subscript, e.g., X_1 but X_dot, X_ddot, X_hat, and  X_bar will place a dot, double-dot, hat (^) or bar, respectively over the variable name.  The vertical bar indicates a superscript.  For example, G|o will be displayed as G superscript o.  |star and |plus will be replaced with superscript * and superscript +, respectively.

11. Selecting a variable in the Equations window will cause a small hint window to appear just below the variable.  The hint window will show the value of the variable, if calculations have been completed, and variable unit.  The variable can be easily selected by double-clicking.  This capability makes it unnecessary to refer to the Solutions window to determine values of EES variables.  After a variable has been selected, right-clicking will bring up a pop-up menu that has Variable Info as one of the menu items.  Selecting Variable Info will bring up a small dialog window in which the format and units of the variable can be entered.  This is perhaps the easiest way to enter the units of a variable.

12.	The dimensional and unit consistency of the equations entered into the Equations Window can be checked with the Check Units command.

13. Equations can be imported or exported from/to other applications by using Cut, Copy and Paste commands in the Edit menu.  The Merge and Load Library commands in the File menu and the $INCLUDE directive may also be used to import the equations from an existing file.  The Merge command will import the equations from an EES or text file and place them in the Equations window at the cursor position.  Equations imported with the $INCLUDE directive will not appear in the Equations window.

14. Clicking the right mouse button in the Equations window will bring up a pop-up menu, shown below,  that will allow commenting (or uncommenting), character highlighting (with yellow background), cutting, copying or printing of the selected text.  A units list is also available in the pop-up menu to simplify entering the units of constants.

15. If EES is configured to operate in complex mode, all variables as assumed to have real and imaginary components.  The complex mode configuration can be changed in the Preferences dialog or with the $Complex On/Off directive.

16.  The Professional version of EES provides a splitter bar on the Equations window that allows two simultaneous views of the text in the Equations window.


Splitter Bar (Professional version)

The Professional version of EES provides a splitter bar on the Equations window that allows two simultaneous views of the text in the Equations window.  The position of the splitter is indicated by a small red rectangle just above the scroll bar for the lower (main) window.  Initially, the splitter is at its uppermost position so that only one view is available, as shown below.

Moving the cursor over the red rectangle, or anywhere on the Equations window at the same vertical position as the red rectangle, will cause the cursor to change to the splitter bar icon.  To move the splitter bar, press and hold the left mouse button down when the splitter bar icon is visible and then drag the splitter bar to a new location.

Changes made in one view are immediately transferred to the other.  However, when two views are available, the Undo capability is disabled.


Residuals
Residuals (WINDOWS menu)

The Residuals window indicates the equation blocking and calculation order used by EES, in addition to the relative and absolute residual values.  The absolute residual, abbreviated as Abs. Res., is the difference between the left and right hand sides of the equation using the calculated values for the variables.  The relative residual, Rel. Res., is the absolute value of Abs. Res. divided by the value of the left-hand side of the equation, assuming that it is not equal to zero.  During the calculations, a solution is considered to be found if the maximum relative residual value for all equations is less than the Residual Tolerance specified with the Stop Criteria in the Options menu.

The block number shown in the Residuals window indicates the order in which EES is solving the set of equations.  Block D is used to identify variables that are set in the Diagram window. Block M identifies variables that are set as independent variables with the Min/Max or Min/Max Table commands.   Block T indicates that the variable is set in the Parametric Table.  Block 0 is used for equations having a single unknown which are solved individually.  The order in which equations having block 0 appear is the order in which they are solved.  After the block 0 equations are solved, EES will then simultaneously solve all equations in block 1, then block 2, and so on until all equations are solved.  The order in which equations are shown within a block for block numbers greater than 0 is irrelevant. Bold block numbers are used to identify equations that were not solved to the specified tolerance.

EES will check the consistency of the units in each equation in the Residuals window if the "Check Units automatically" control in the General tab of the Preferences dialog is selected.  OK will be displayed if the unit check is successful.  A ? will be display if the unit check fails.  An X will be displayed if unit checking has been disabled for this equation.  Clicking the right mouse button on an equation will bring up a pop-up menu that has 3 items.  The first menum item "Jump to Equation window', will move the focus to the Equations window and place the cursor on the equation that was selected in the Residuals window.  The second item, "Check Units" will check the units for the selected equation.  Selecting this menu item will display the message from the unit checking processor.  If there is a unit consistency problem, the message dialog will offer the opportunity to open the Variable Information dialog specialized for the equation being considered in which the units of each variable in the equation can be viewed and/or changed.  The third item will enable or disable unit checking for this equation.

The equations shown in the Residuals window will have one or more variables displayed in bold font.  The variable(s) shown in bold are determined by the equation(s) in the block.

If EES is configured to manipulate complex numbers, two equations, one each for the real and imaginary parts, will be generated for each equation entered in the Equations window.  The real and imaginary equations are identified with a (r) and (i) just to the left of the equation.

It is possible to display the Residuals window in a debugging situation.  If the number of equations is less than the number of unknowns, EES will not be able to solve the equation set, but the Residuals window can be made visible by selecting it from the Windows menu.  Normally, the block numbers appear in sequential order.  When one or more equations are missing, EES will skip a block number at the point in which it encounters this problem.  The equations in the following blocks should be carefully reviewed to determine whether they are correctly and completely entered.

The information in the Residuals window is useful in coaxing a stubborn set of equations to converge. The bold block numbers will indicate which equations have not been successfully solved by EES.  The bold variable(s) are determined by the equations.  In this way, the block of equations and the associated variables which EES could not solve can be identified.  Check these equations to be sure that there is a solution.  You may need to change the guess values or bounds for the variables in this block using the Variable Info command.

Double-clicking the left mouse button on an equation in the Residuals window will cause the Equations window to be brought to the front with the selected equation highlighted.  Alternatively, right-clicking on the equation will bring up a popup menu with a 'Jump to Equations window' menu item' that will produce the same behavior.

The entire contents of the Residuals window will be copied as tab-delimited text to the Clipboard if the Copy command is issued when the Residuals window is foremost.

The colored text in the column headings does not print properly on some black and white printers. You can force text to print in black by deselecting the Print in Color control in the Print dialog.

Tip:  Use the Find command in the Search menu to find a particular variable or equation in the Residuals window.


Parametric Table
Parametric Table Window (WINDOWS menu)

The Parametric Table Window holds one or more Parametric tables.  Each Parametric Table operates somewhat like a spreadsheet.  The table is generated with the New Parametric Table command.  There is no limit to the number of Parametric Tables than can be generated, other than available memory.  Each column in a Parametric Table holds values for a selected variable.  Numerical (or string constants if the column holds a string variable)  can be entered into the cells.  Entered values are assumed to be independent variables and are shown in black type.  Entering a value in the Parametric Table produces the same effect as setting that variable to the value with an equation in the Equations window.  A Warning will be issued if a variable is set to a value in both the Equations Window and the Parametric Table when the Solve Table command is issued.  Dependent variables will be determined and entered into the table when the Solve Table or Min/Max Table command is issued.  The dependent variables are, by default, shown in colored or styled text.  The font/color choice for the dependent variables can be changed in the Preferences command in the Options menu.

1.	A table is generated using the New Parametric Table command in the Table menu.  The variables which are to appear in the table are selected from a list of variables currently appearing in the Equations window.  Each new Parametric Table must be given a name by the user.  The name appears in the tabs at the top of the Parametric Table Window.  The name and tab position can later be changed by right-clicking on the tab.

2.	Variables may be added to or deleted from a selected Parametric Table using the Insert/Delete Vars command in the Table menu.  This menu can also be accessed by clicking the right mouse button in the column name header cell (topmost row) and selecting Add Column from the pop-up menu that appears.

3.   The display format and units of the variable in each column of the table can be changed by clicking the right mouse button on the name at the top of the column.  A pop-up menu will appear having Properties as one of the menu choices.  If Properties is selected, the Format Table dialog window will appear in which the display format, units, column width, and column position can be entered.  The column number is displayed at the upper left corner of each column header cell.

4.	Values in a column of the Parametric Table can be entered, cleared, or changed by clicking the right mouse button within the column header cell.  A pop-up menu will appear having Alter Values as one of the menu choices. Selecting Alter Values will bring up the Change Table Column Values dialog which provides a very easy way to enter or clear values in the column.  A quicker way to bring up the dialog is to click the left mouse button on the triangular icon [image] at the upper right of column header cell. Either method will bring up the change table column values dialog. Changes to the values in the Parametric table can also be made using the Alter Values command.

5.	Each row of the Parametric Table is a separate calculation which is initiated by the Solve Table command.  The number of rows is selected when the table is generated.  However rows can be inserted or deleted by clicking the right mouse button in the first column of the table on the row for which the insertion or deletion is to occur.  A pop-up menu will appear having Insert Row and Delete Row(s) as menu choices.  Rows can also be inserted and deleted using the Insert/Delete Runs command in the Table menu. The Solve Table command allows specification of the the rows for which calculations will be done.  In the Professional version, the start and stop rows can be specified with EES variables.

6.	A range of cells in the table can be copied to the Clipboard, after which they can be pasted into a different part of the table, into the Lookup Table, or into another application such as a word processor or a spreadsheet.  One or more rows in the table can be selected by clicking the left mouse button  in the row header column (the leftmost column).  If the mouse is dragged to other rows while the left mouse button remains down, these rows will be added to the selection.  A similar procedure can be use used to select one or more columns.  An alternative way to copy a range of cells is as follows:  Select the cell at the upper left of the range by clicking the mouse button when the cursor is positioned in the cell.  Now, hold the Shift key down and click in the cell at the lower right of the range, using the scroll bars to bring it into view if necessary.  Regardless of how they are selected, the selected cells will be shown in a highlighted color. At this point, you can either select Copy from the Edit menu or press the right mouse button to bring up a pop-up menu containing the Copy command.  Either way will allow the selected cells to be placed on the on the clipboard.  Use the Select All command if you wish to select the entire table.  If you wish to include the column name and units along with the numerical information in each column, hold the Shift key down while issuing the Copy command.

7.	One or more Parametric Tables can be printed using the Print command.  However, if you wish to print only a selected range of the table, select the range in the manner described above and the press the right mouse button.  The pop-up menu which appears has a Print Selected menu option.

8.	The background color and a border around selected rows in the table can be can be changed by selecting the rows and clicking the right mouse button in the first column on one of the selected rows.  A pop-up menu will appear having Background Color and Add Border as menu options.  Rows can be inserted or deleted by selecting other menu choices in the pop-up menu.

9.	Values in one or more columns of a Parametric table can be sorted in numerically increasing or descreasing order by clicking the right mouse button within the column header cell.  A pop-up menu will appear having Sort as one of the menu choices.

10.	A table can be duplicated by right-clicking on the tab.  A dialog will appear with a Duplicate button as shown below.  This dialog also allows the position of the tab and the tab background color to be changed.  An optional note consisting of up to 255 characters can be placed here for reference.


Select Plot Window

This dialog window appears only when a plot command has been selected and there is more than one plot window.  Select the plot window for which the command is to operate by clicking on the plot window name.


Solution
Solution (WINDOWS menu)

The Solution window will automatically appear in front of all other windows after the calculations, initiated with the Solve, Min/Max, or Uncertainty Propagation commands in the Calculate menu, are completed.  The values and units of all variables appearing in the Equations window will be displayed in alphabetical order using as many columns as can fit across the window.  If the 'Show local function/procedure/module values' control in the Options tab of the Preferences dialog is selected, the local variables in all internal functions, procedures, and modules (but not those in library files) will be displayed in separate tabbed windows in the Solution window.  The uncertainty propagation results are also displayed in a separate tabbed window.

The format of the variables and their units can be changed using the Variable Info command in the Options menu, or more simply, directly from the Solution window.  (The format can also be changed from U.S. to European format styles.)  Clicking the left mouse button on a variable selects that variable which is then displayed in inverse video.  Clicking the left mouse button on a selected variable deselects it.  Double-clicking the left mouse button (or clicking the right mouse button) brings up the Format Variable dialog window in which the numerical format and units of ALL selected variables.  Pressing the Enter key will also bring up the Format Variable dialog window.  The selected variables can also be highlighted (with underlining, bold, etc.) or hidden from the Solution window.  Once hidden, variables can be made visible again with the Display controls in the Variable Info dialog window.  If EES is configured to operate with complex numbers, the format of complex variables can be changed from rectangular or polar form.

Additional information pertaining to the operation of follows.

1. 	The Solution window is normally accessible only after the calculations are completed.  The Solution menu item in the Windows menu will be dimmed when the Solution window is not accessible.

2.	The unit settings made in the Unit System in the Options menu will be displayed at the top of the Solution window if any of the built-in (or user-supplied) thermophysical property or trigonometric functions are used.

3.	If Automatic Unit Checking is selected, the unit consistency of each equation will be checked and a message with the results of the unit checking will be displayed at the bottom of the Solution window.  The Automatic Unit Checking can be turned on or off with the "Check Units Automatically"checkbox control in the Options tab of the Preferences dialog or with the $CheckUnits directive.  Note:  To enter the units of internal functions and procedures it is necessary to enable the "Show Function/Procedure/Module values" checkbox in the Options tab of the Preferences dialog or include a $CHECKUNITS ON directive.

4.	The Solution window will normally be cleared if any change is made in the Equations window.  However, it is possible to configure EES so that the Solution window remains visible after changing the Equations window by setting the appropriate control in the Preferences command in the Options menu.

5.	The number of columns displayed on the screen can be altered by making the window larger or smaller.

6.	If EES is unable to solve the equation set and terminates with an error, the values of the variables at the last iteration will be displayed in the Solution window.  Variables that were not evaluated are shown in gray.

7.	When the Solution window is foremost, the Copy command in the Edit menu will appear as Copy Solution.  The Copy Solution command will copy the selected variables (shown in inverse video) to the Clipboard both as text and as a picture.  If no variables are selected, then the entire contents of the window will be copied.  The text will provide for each variable a line containing the variable name, its value, and its units.  The picture will appear exactly as it does in the Solution window.  To force a black and white picture, hold the Shift key down when you issue the Copy Solution command.)  Either the text or the picture can be pasted into another application, such as a word processor.  Most word processors will, by default, paste the text.  To paste the picture instead of the text, select the Paste Special command.

8.   The colored text (blue for units, red for unit settings) does not print properly on some black and white printers.  You can force text to print in black by deselecting the Print Text in Color control in the Print dialog.

9.   If Display subscripts and Greek symbols in the General Display tab in the Preferences dialog is selected, the underscore character will indicate the start of a subscript.  The following characters in the variable name will be displayed in smaller type and lower case.  Additional underscores within the same variable name will be changed into commas.  Similarly, the vertical bar character signifies the start of a superscript.  For example, G|o will be displayed as:

Array variables will also be changed to appear as subscripted variables.  Variables which have the name of Greek symbols, such as alpha, beta, and gamma, will appear in Symbol font.  If the variable name is all in capital letters, the Greek symbol will be shown as a capital letter.  A dot or bar can be positioned over the variable name by adding _dot, _hat, or _bar to the name.  For example, X_dot=5 will display as:

X_ddot will display with a double-dot centered over the X.  X_infinity will display as X subscripted with the infinity symbol.   X|star and X|plus will display as an X with a superscript  * or  +, respectively.  A summary of the display options is provided in the Greek and Special Symbols page.  The Formatted Equations and Parametric Table windows will also display variables with subscripts/superscripts provided the Display subscripts and Greek symbols option in the Preferences dialog window is selected.

10.  The values of internal functions, procedures, modules and subprograms are displayed in separate tabbed windows of the Solution window if the "Show Function/Procedure/Module values" checkbox in the Options tab of the Preferences dialog is selected (the default) or if a $CHECKUNITS ON directive is included in the Equations window.


Plot Windows

Variables which appear in the Parametric Table may be plotted with the New Plot Window or Overlay Plot commands in the Plot menu.  The New Plot Window command provides a choice of X-Y, bar, or X-Y-Z plot styles.  The New Plot Window and Overlay Plot dialog windows offer a number of plotting options such as choice of line type and plot symbol, linear/logarithmic scaling, spline fitting, tick frequency and grid line control.  These options can be set initially when the plot is first drawn or at later time using the Plot window controls described below or the Modify Axes and Modify Plot commands in the Plot menu.

Each plot window is identified by a title that appears on the tab displayed in the Plot Window.  This title is entered when the plot is first created.  The title can be modified by right-clicking on the tab or by entering the modified title in the Modify Plot dialog.  The tab position can be modified by right-clicking on the tab.  Buttons are also provided to duplicate or delete the selected plot.

There is no limit (other than memory limitations) to the number of plot windows that can be created and an unlimited number of overlayed plots may be drawn in each plot window using the Overlay Plot command.  Two X (bottom and top) and two Y (left and right) axis scales are provided for plot overlays.  The appearance of the plot can be changed in many ways using the commands in the Plot menu and controls in the plot windows.  The plot window controls are as follows.

1.	Moving Text

Text fields to label the X and Y axes are automatically generated when a plot is constructed.  (Additional text can be added to the plot using the Text button on the plot toolbar.  If the plot toolbar is not visible, use the Show Toolbar command to make it visible).  You can move one or more selected text item(s) by dragging the mouse to the desired location.  Clicking the left mouse button on a text item will select it.  Multiple items can be selected if the Shift key is depressed.  Selected text items are displayed within a red dotted rectangle.  To unselect the text, click the mouse in the plot window at a location where there is no text, lines, or boxes.  Selected text items can also be moved with the arrow keys.  Each arrow key press moves all selected text one pixel in the arrow direction.

2.	Moving the Plot

The plot and associated text can be moved to any location in the plot window by clicking the mouse button within the plot rectangle and dragging the mouse.

3.	Resizing the Plot

The plot rectangle can be changed to any desired size by moving the mouse to the lower right corner of the plot rectangle.  (If the tool bar is visible, a resize icon will be displayed in the lower right corner of the plot to visually indicate the resize hot area.)  The cursor will change to the sizing cursor when the mouse is located over the appropriate location.  Press the mouse button and move it while holding the mouse button down to change the plot rectangle size.  The axis scales are redrawn in their new locations. The size and positions of all text items and lines are moved and scaled in proportion to the new plot size so that they maintain their relative location and size.  (You can prevent the plot text font sizes from changing if you hold the Ctrl key down while resizing the plot.)

4.	Modifying the Axis Information

The axis scaling can be changed in two ways.  When the mouse cursor passes over any of the axes of the plot, it will change to left-right (y-axes) or up-down (x-axes) arrows.  Hold the left mouse button down while dragging the mouse to a new location will cause the selected axis to move to this new location.  Alternatively, the axis scaling and all other properties of the axis can be changed the by double-clicking the mouse on the axis scale or with the Modify Axes command in the Plot menu.  Either action will bring up the Modify Axis dialog window.

5.	Modifying the Plot Information

The line type, color plot symbol, and other information relating to a 2-D plot can be viewed or modified by double-clicking the mouse anywhere within the plot rectangle (but not on a text item).  This action will bring up the Modify Plot dialog.  The Modify plot dialog window can also be made to appear with the Modify Plot menu item in the Plot menu.  Double-clicking (or right-clicking) the mouse on a 3-D plot will toggle the visibility of the 3-D plot controls which appear in a panel at the bottom of the plot window.

6.	Crosshairs

Holding the Shift and Ctrl keys down will change the cursor into crosshairs for 2-D plots.  The coordinates at the intersection of the crosshairs can be viewed in the plot window title bar.  Plots generated with the Property Plot command will display all thermodynamic properties corresponding to the state fixed by the cursor position.

7.	Adding Text, Lines, Rectangles, Ellipses, and other Objects

A plot toolbar provides buttons to add text, lines and arrows, rectangles, and ellipses.  If the toolbar is not visible, use the Show Toolbar to display it in the plot window.  Alternatively, clicking the right mouse button anywhere in the plot window outside of the plot rectangle will toggle the visibility of the plot window tool bar.  Holding the Shift key down while drawing a line causes the line to be horizontal, vertical, or on the closes 45 degree angle.  Holding the Shift key down while drawing a rectangle or ellipses forces the aspect ratio to be constant.  Note that you can also copy graphic objects from other applications, such as MathType or Powerpoint, and paste them into the plot window.  These objects can then be move or resized in the same manner as EES objects.

8.	Modifying and Deleting Text, Lines/Arrows, Rectangles and Ellipses

When you click on a text item, a red dotted box will be drawn around it to indicate that this item is selected.  Clicking on a line, rectangle or ellipse will display that item with small boxes each each side indicating that it is selected. Additional items can be selected by holding the Shift key down.  All selected items will be moved when you drag the mouse to a new location.  Double-clicking the left mouse button (or clicking the right mouse button) on a text item, line/arrow, rectangle, or ellipse will bring up a dialog window in which the characteristics of the selected items can be changed.  When it first appears, the text dialog box displays the characteristics of the first selected text item.  Any change made to a text characteristic in the dialog window will be applied to all selected text items.  If a text characteristic, such as the font size, is not changed in the dialog window, then the font size of the selected text items will not be changed.  When more then one item is selected, the align button in the plot toolbar will be enabled.  Clicking this button will provide access to alignment controls to allow the alignment of selected items relative to each other.  The selected items can be copied or cut using the Copy or Cut commands.  The Paste command can then be applied to move them from the clipboard to this plot or to any other EES plot window.  The Delete key provides the same function as the Cut command.  If you accidently delete text or lines, use the Paste command to restore them.

9.	Copying the Plot

When a plot window is foremost and no text items or lines/arrows are selected, the Copy command in the Edit menu will appear as Copy Plot.  This command will place an exact copy of the entire plot window on Clipboard as a Picture.  This picture can then be pasted into other applications.  The plot is placed on the Clipboard as both MetaFilePict (picture) and/or a high resolution Bitmap depending on the setting made in the Plot tab of the Preferences dialog.  If only one format is selected, the Paste command in the application will paste the plot.  If both Picture and Bitmap formats are available on the clipboard, select the image type you wish by using the Paste Special command in the application's Edit menu.  The Picture is much more memory efficient, but when printing to a high resolution printer, the bitmap will produce a higher quality image. Note that the Bitmap will be created in black and white if the Copy in Color control in the Plot tab of the Preferences dialog is not checked.  The black and white bitmap requires much less memory and prints better on a black and white printer.

10.	Moving the Top and Right Axis Scales

The 2nd axis scales (initially located at the top of the plot for the X axis and to the right of the plot for the Y-axis) can be moved to other locations by holding the Ctrl key down while pressing the arrow keys.  The up/down arrows control the position of the X2 scale and the left/right arrows control the position of the Y2 scale.

11.	Duplicating or Deleting a Plot Window

An entire plot window can be duplicated or deleted by right-clicking on its tab at the top of the plot window.  A small dialog will appear, as shown below, having a Duplicate and a Delete button as shown below.   The duplicate plot provides a convenient means of creating a plot template so that all of your plots have the same appearance.  The Delete cannot be undone so be careful. The dialog also provides controls to move the position of the tab and to change the tab background color.

12.	Adding Descriptive Text

A text string consisting of up to 255 characters is available to store notes or any information you wish for each plot window.  The text string can be printed when the plot is printed.  The descriptive text can be added or changed  when the plot is generated or by right-clicking on the tab at the top of the plot window.

13.  Animating Plot Windows

14. Saving the Plot

All plots are automatically saved with the EES file.  However, in some circumstances, you may wish to save a file just containing the plot.  Right-clicking the plot tab at the top of the plot window will bring up the dialog window below.  Clicking the Save button in will allow you to save the specified plot as a bitmap (.BMP), JPEG (.JPG), Windows Metafile (.WMF), or Windows Enhanced Metafile (.EMF).  If plot window animation is enabled, each frame will be separately saved.  The filenames will have _n appended where n is the frame number.

14.	Navigating Through Multiple Plot Windows

Each plot is identified with a tab at the top of the plot window.  Clicking on the tab displays that plot.  Alternatively, pressing the left or right arrow keys when no objects or text items are selected will display the previous or next plot.  This method of changing the plot window display is more convenient when there are many plots.


3-D Plot Controls

The 3-D plot control panel can be made visible or hidden by double-clicking or right-clicking the mouse in the plot window.  The Show/Hide Toolbar command in the Plot menu also provides this function.

The Axes checkbox has 3 positions.  Clicking in the box rotates through the positions.  If the box is checked, X, Y, and Z axis lines are drawn through the plot origin with red, green, and blue dotted lines, respectively.  If the box is checked with a white background, axis labels will be displayed to help identify the rotational position.  If the box is unchecked, the axis lines are not drawn.

If the Perspective checkbox is checked, a perspective projection of the 3-D surface is displayed.  If the box is not checked, orthogonal projection is employed.  Perspective projection appears more correct to the eye but orthogonal projection is easier interpret.

The Color checkbox has three positions.  If the box is unchecked, the surface is displayed with a uniform gray color.  The color can be controlled with the slider to the right of the color checkbox.  If the box is checked, the value of Z (or the value of an optional color variable) is represented on the surface in grayscale (check with gray background) or colors (check with white background) .  The optional color variable is chosen in the X-Y-Z Plot Setup.  If a variable is not chosen, the color variable is Z itself.

The Resolution slider controls the size of the polygons used to form the surface plot.  High resolution (slider bar to the right) results in a crisp plot, but rendering and rotating may be sluggish.  You may want to experiment with this control to determine a suitable compromise between display speed and quality.

Scale

Slider controls are provided to separately scale the X, Y and Z axes.  Moving the slider to the right increases the scale factor for the selected axis.  The slider can be moved with the mouse or with the left/right arrow keys.  The check boxes for X and Y control the visibility of surface grid lines.  The vertical slider scales the X, Y, and Z directions uniformily.  Moving the slider down increases the apparent size of the plot in the window.  This slider can also be controlled with the up/down arrow keys. The lower and upper limits of the plotting range can be changed for the X and Y axes by right-clicking on the slider control.

Grid Position

The option of displaying grids in each of the orthogonal planes is controlled with the checkboxes.  For example, the grid in the YZ plane will be visible if the checkbox preceding X is checked.  The grid can be moved to any position within the range of values chosen in the X-Y-Z Plot Setup using the mouse or the left/right arrow keys.  The current location of the grid is shown in the box to the right of the slider.  A value can be directly entered into this box which will cause the grid to move to the specified value.

Clicking the Top button will rotate the display so that the view is of the X-Y plane looking down the positive Z-axis towards the origin.  The Front button presents a Y-Z plane viewed along the positive X axis.  The Side button displays the X-Z plane fromthe positive Y axis.

Tool Bar

The tool bar provide buttons to place text, lines, boxes, and circles on the plot in the same manner as for X-Y plot windows.  An align button is also provided.  The help button displays this page.

Position Indication

Holding the Shift and Ctrl keys down will cause the 3-D coordinates to be displayed in the window caption, provided that the X and Y-axis grids are visible.  The information displayed is the current locations of the X and Y grids, followed by the value of Z on the surface for the given X and Y.  If the color corresponds to a variable other than Z, its value on the surface at the specified X and Y is also shown.  If the X and Y grids are moved using the mouse while the Shift and Ctrl keys are held down, the information in the window caption will be automatically updated.


Plot Window Animation (Professional Version)

The Professional version provides the capability to animate individual plots, objects (e.g., arrows, boxes, circles) and text on the plot so that they are displayed in a specified order and frequency.  Each frame of the animation can be separately saved to a file so that a movie can be made using Microsoft Movie Maker or similar applications.

To enable the animation, right click on the tab at the top of the plot window.  A dialog, similar to that appearing below, will appear.

Click on the word Animation.  A check will appear before the word when animation is enabled.  Click again to disable animation.  The animation speed can be set from slow (one frame every 5 sec) to fast (one frame every 0.02 sec) with the slider control. If the Loop checkbox is enabled, the animation, started by clicking the left mouse button at a point outside the plot rectangle, will loop indefinitely.  The looping capability can also be set with the Loop button on the plot animation control panel (see below).  If the plot window is saved by clicking the Save button when animation is enabled, each animation frame will be saved in a separate file.

If Animation has been enabled, the animation control panel shown below will be visible on the plot window.   The first button starts the animation.  The second pauses the animation at the current frame.  The third button stops the animation and reset it.  The last button controls looping.  If the button is depressed, as shown, looping is enabled.  Click the button to disable looping.

When animation is enabled, controls to set the content in each frame will be visible in the plot dialogs.  For example, when you right-click in the plot window (or select Modify Plot from the Plot menu) you will see the Modify Plot dialog with animation controls, as shown below.

Each plot overlay can be displayed in a separate frame.  The frames are numbered in sequential order.  Frame 0 is reserved for items that will be displayed in all frames.  The frame for which the plot is to appear is set in the animation group box.  If the setting is >= 5, as above, the selected plot will appear in frame 5 and remain visible in successive plots.  IF the setting is = 5, the plot will only be shown in frame 5.  The frame numbers are set by default to the order in which the plot overlays occur.

Similar capability is provided for plot objects and text.  Right clicking on a plot object or text will bring up a dialog in which the frame number can be specified.  Frame numbers for plot objects and text are, by default, set to zero so that they appear in all frames.  Changing the frame number in the animation group box will allow the object or text to be selectively shown in separate frames.

Return to Plot windows


Lookup Table Window
Lookup Table Window (WINDOWS menu)

Lookup Tables and Lookup Files (residing on the disk) provide the means of using tabular information in the solution of the equations.

A Lookup Table is created using the New Lookup Table command in the Tables menu.  The number of rows and columns in the table are specified when the table is created.  These specifications may be later altered with Insert/Delete Lookup Rows and Insert/Delete Lookup Cols  commands in the Tables menu.  A Lookup Table can also be created by reading an existing Lookup File on disk with the Open Lookup Table command.  See Lookup File Formats for more information.

Each Lookup Table that is created or read in appears in the Lookup Table Window and is accessed by a tab at the top of the window.  The functions that use the tabular data in the Lookup table refer to the data by the (case-insensitive) name on the tab.  Clicking the left mouse button on the tab displays the information for that Lookup table.  The name can be changed by right-clicking the mouse on the tab.  There is an upper limit of 9000 rows and 1000 columns in the commercial version of EES for any Lookup Table.  There is no limit on the number of Lookup Tables that can be displayed in the Lookup Window, other than available memory.

Values in a column of the Lookup Table can be entered, cleared, or changed by either clicking the left mouse button on the triangular icon [image] at the upper right of the header cell or clicking the right mouse button in the column header cell.  In this case, a pop-up menu will appear having Alter Values as one of the menu choices.  Selecting Alter Values will bring up the Change Table Column Values dialog which provides a very easy way to enter or clear values in the column.  A Sort menu option is also available by clicking the right mouse button in the column header cell.  Data can be pasted into the Lookup table using the Paste command.  The names and units of the columns in the table can be pasted using the Paste Special command.

A column in a Lookup Table can hold either numerical or string information.  If the column is to contain string information, the format style must be set to STRING.  This format specification is made in the Format Table Column dialog which appears when the mouse is clicked in the column header cell.  String data in the Lookup table are accessed with the LOOKUP$ and LOOKUP$ROW functions.

The INTERPOLATE command provides convenient interpolation or extrapolation of the data in any Lookup Table.  In addition, the LOOKUP, LOOKUPCOL, and LOOKUPROW functions allow data in any Lookup Table to be linearly interpolated (forward and backward) and used in the solution of the equation in the Equations Window.  The column titles, units, and the format of the values in each column many be changed by clicking the left mouse button on the column title.  When used within a function or procedure, the LOOKUP function can also be used to set values in a specified Lookup Table.

A range of cells in the table can be copied to the clipboard, after which they can be pasted into a different part of the table, into the Parametric Table, or into another application such as a word processor or a spreadsheet.  One or more rows in the table can be selected by clicking the left mouse button  in the row header column (the leftmost column).  If the mouse is dragged to other rows while the left mouse button remains down, these rows will be added to the selection.  A similar procedure can be use used to select one or more columns. An alternative way to copy a range of cells is as follows:  Select the cell at the upper-left of the range by clicking the mouse button when the cursor is positioned in the cell.  Now, hold the Shift key down and click in the cell at the lower-right of the range, using the scroll bars to bring it into view if necessary.   Regardless of how they are selected, the selected cells will be shown in inverse. At this point, you can either select Copy from the Edit menu or press the right mouse button to bring up a pop-up menu containing the Copy command.  Either way will allow the selected cells to be placed on the on the clipboard.  Use the Select All command if you wish to select the entire table.  If you wish to include the column name and units along with the numerical information in each column, hold the Shift key down while issueing the Copy command.

A Lookup Table can be saved as a Lookup file on the disk using the Save Lookup Table command. Lookup files (in disk files) can be directly accessed with the Differentiate, INTERPOLATE, INTERPOLATE1, INTERPOLATE2, LOOKUP, LOOKUPCOL, and LOOKUPROW functions by providing the file name, instead of the Lookup Table name, as the first argument.  The filename should be enclosed within single quote marks or defined with a string variable.  Both binary (.LKT) and ASCII (.TXT and .CSV) Lookup file formats can be used in these functions.


Diagram Window
Diagram Window (WINDOWS menu)

The Diagram window can be used in two ways.  First, it provides a place to display a graphic objects or text relating to the problem which is being solved.  Second, the Diagram window can be used for both input and output of information and for report generation.

The graphics objects placed in the Diagram window can be simple shapes such as lines, circles or boxes that are drawn using the tools in EES or they can be complex graphics such as a picture or a scanned image copied from another application.   In the Professional version, formatted text, including equations, can be copied from a word processor.  The Diagram window has development and application modes.  Changes in the Diagram window are made in the development mode.

The Diagram window is commonly used to display a schematic diagram of a system identifying state point locations to help interpret the equations in the Equations  window.   A Calculate button can be placed on the Diagram window to initiate the calculations.  Input data can be read from the Diagram window and used in the calculations. The selected outputs can then be displayed on the Diagram window.  In the Professional version, 'hot areas' can be defined that, when clicked, open additional child Diagram windows which, in turn, can have their own child Diagram windows.  Buttons can be placed on the Diagram windows to save and load inputs, display plots,  display a help file, link to other files and applications, and to print the window.

Ctrl-D is a keyboard shortcut for the Diagram window.  If the Diagram window is not foremost, Ctrl-D brings it to the front, making it visible if necessary.  If the Diagram window is foremost, Ctrl-D toggles the  visibility of the tool bar.  Shift-Ctrl-D toggles the visibility of the tool bar in the Diagram window and all child diagram windows.

Click on a topic for more information:

Creating the Diagram

Development (toolbar) and Application Modes

Moving the Diagram

Resizing the Diagram Window

Adding lines, arrows, boxes, and circles

Adding and Moving Text in the Diagram Window

Grouping Graphic Objects and Text

Using Drop-Down Lists to Set the Values of One or More EES Variables

Adding a Calculate Button

Adding a Plot Window Access Button

Selecting and Aligning Text and Graphic Items

Cut, Copy, and Paste Selected Text Items

Exporting the Diagram Window

Saving and Loading Diagram Inputs

Adding a Help button to the Diagram Window

Creating Links to other Programs

Creating Hot Areas and Child Diagram Windows

Moving the Hot Area for a Child Diagram Window

Navigating through the Diagram Windows

Adding a Print Button

Adding an Audio-Visual item


Creating the Diagram

The Diagram window and child diagram windows (Professional version) provide a drawing environment in which you can create a graphic representing the problem at hand.  You can also place text and buttons on the drawing.  The text can be descriptive text, input variables, or output variables.  The Professional version also supports formatted text and tables. The buttons can be used to initiate calculations, show plots, display help, link to other programs, print, show movies or for other purposes.

There are two ways to place graphic items in the Diagram window.  First, a graphic items can be created in any drawing program that produces an object drawing such as Microsoft Draw (included in Word for Windows), Corel Draw, Designer, or PowerPoint.  Copy the drawing and then Paste it into the Diagram Window while in development mode.   A scanned image or picture can also be used as the diagram provided that it is copied as an picture, rather than a bitmap or .jpg file.  An easy way to convert any graphic into a picture is to paste the bitmap into PowerPoint, PaintBrush or other program that converts graphical images.  Then copy the image from this program into the Diagram window.  The second way to place a graphic item in the Diagram window is to use the diagram window toolbar.  The toolbar, which can be made visible using the  Show/Hide Diagram Tool bar menu item, provides capability to draw graphic primitives such as lines/arrows, circles, and rectangles.  Click on a toolbar button and then draw the graphic item in the Diagram window.

When the toolbar is visible, the Diagram Window is in development mode and changes can be made to the diagram.  Any item on the Diagram window can be dragged to a new location.  The arrow keys can be used for fine movements.  Right-clicking on any graphic or text item will display a pop-up menu of options including Cut, Copy, and menu items to move the graphic forward or backward.  The foremost items are shown in front of those further back.

The pop-up menu also provides a Properties menu item.  Selecting the Properties menu item (or double-clicking on the item) will bring up the properties dialog for that item and then the characteristics of that graphic item can be changed by modifying the fields in the dialog.  The properties dialog provides inputs for the location (top-left corner) and size of the graphic object.  In the Professional version, these inputs can be supplied as EES variables, as shown in the figure below.  In this case, the location of the item can be controlled by changing the values of Left1 and Top1.  If Left1 or Top1 is set to a large negative number, the object is located off of the screen and thereby hidden.   (Objects return to their original location when the Diagram window is in development mode).  The values of EES variables that are used in this manner can be conveniently set using a Drop-Down list item.  A common use for this capability is to have EES display one of several pictures, depending on the selection from the drop-down list.  The picture that is to be hidden is moved off screen.  An example of this capability is provided in the Moveable_Figures.EES example file.  This example can be opened by selecting Diagram Window from the Examples menu and then selecting the Moveable Figures item.

T


Development and Application Modes

The Diagram window (and child Diagram windows) operate in two modes.  When the toolbar is visible, the Diagram window is in development mode.  The toolbar can be made visible or hidden using the Show/Hide Diagram Tool Bar command or by clicking on the Diagram Window speedbutton.

In the development mode, all objects such as text, graphic objects generated in EES (lines/arrows, rectangles, ellipses)  or in an external program, links, buttons, and hot areas can be copied, moved, resized, modified, or deleted.  Right-clicking on a text or graphic object brings up a popup menu. The Properties item in this menu allows the characteristics of the selected item to be modified.  Input variables are disabled in development mode and calculations initiated with the Calculate button are suppressed.

When the toolbar is hidden, the Diagram window is in application mode.  In application mode, it is not possible to move any of the objects or change their display characteristics.  Input variables are enabled and calculations can be initiated using the optional calculate button or the commands in the Calculate menu.


The Diagram Window Toolbar

The toolbar is visible in the Diagram window or Child Diagram window when the window is in Development mode. The available tools are shown below.

Add text	Add Calculate button

Add lines or arrows	Add Show Plot button

Add box	Add Print Button

Add ellipse or circle	Add Help Button

Group selected items	Ungroup items

Align selected items

Add Link Button	Add audio-visual item

Add Load Diagram Inputs button	Add Save Diagram Inputs button


Moving the Diagram

Selected items in the Diagram or child Diagram windows can be repositioned in the Diagram window in the development mode by pressing and holding the left mouse button down anywhere within the selected item(s) while sliding the diagram to its new location.  Alternatively, the up, down, left or right arrow keys will also move the selected items.

To move all items in the Diagram to a different location, use the Select All command and then drag the selected items to their new location or use the arrow keys.


Moving the Hot Area for a Child Diagram Window

The 'hot area' that brings up a child Diagram window when it receives a mouse click can be moved in two ways.  It is necessary to be in Development mode to move the hot area.

 First, if the Ctrl and Shift keys are depressed and the mouse cursor is positioned within the red-dotted rectangle that shows the boundary of the hot area (see figure below), the hot area rectangle will move with the arrow keys.

Second, a right click within the red-dotted rectangle with the Ctrl and Shift keys depressed will bring up a pop-up menu.  Select the Properties menu item from this pop-up menu to bring-up the following dialog in which the coordinates of the hot area can be set.  Note the location and size of a child Diagram window while it is in Application mode may be specified with EES variables, as indicated for the left coordinate below.   The value of the EES variable may be set in the Equations window, in a Parametric table or in a text input item on a Diagram window.


Resizing the Diagram Window

In development mode, the graphic items, text, and buttons can be resized by double-clicking the left mouse button (or clicking the right mouse button) anywhere within the Diagram window or child Diagram window except on a text, graphic item or button.  After a positive confirmation, all object in the Diagram window will then be resized to fit in the Diagram window.

Individual graphic items can be resized in two ways. First, clicking on an item will select it displaying small boxes at each corner.  Selecting a corning with the mouse and dragging it to a new location will resize the item.  Alternatively, right-clicking on the item will bring up a popup menu with Properties as a menu item. The location and size of the selected object can be specified in the Properties dialog.


Adding lines, arrows, boxes and circles

Graphic items, such as lines (or arrows), boxes, and circles can be placed on the Diagram window or Child diagram window using the buttons in the Diagram window toolbar.  The Diagram window must be in Development mode in order to access the toolbar.   The operation of all of these tools is simlar.  Click on the appropriate button in the toolbar.  The button will then appear in a selected or "down' state.  Then move the mouse to the upper left corner of the item and press and hold the left mouse button down while dragging the mouse to the lower right corner.  Note that the line tool remains in a selected state so that additional lines can be drawn without having to press the toolbar button again.  Click on the line toolbar button to terminate the line drawing process.

Any graphic item placed on the Diagram windows can be edited in Development mode by right-clicking on the item and selecting the Properties item from the popup menu.


Adding and Moving Text in the Diagram Window

Use the Add Text button in the toolbar to add a text item to the Diagram window.  A dialog window will appear with radio buttons for Text, Input Variable, or Output Variable.  The Professional version also offers the option of adding Formatted text.  Clicking the Text radio button will display and enable an edit box in which the text can be entered, as shown in the above figure on the left.  The text will initially appear in a default position within the Diagram window (or child Diagram window) when the dialog is dismissed.  It can then be dragged to a new position by pressing and holding the left mouse button down while sliding the text to the desired location.  The text or any of its characteristics can later be changed while in development mode by double-clicking the left mouse button (or by clicking the right mouse button) while the cursor is positioned over the text.  Note that the left and top positions of the text can be EES variables as indicated in the above figure on the right.  In this case, the position of the text item in application mode is set to the value of the EES variable.  The units are screen pixels.  The EES variable can be set in the Equations window or in a Drop-Down list.

The Input and Output Variable options function in a similar manner, except that the text which appears on the Diagram window is the value of an EES variable.  The EES variable is selected from an alphabetical list of currently defined variables in the Equations window that appears when the Input or Output radio button is selected.  The variable name and the units may (optionally) be displayed with the variable value.  It is possible to programatically change a text specification in the Diagram window from an Output to an Input or vice versa using the capabilities provided in Drop-Down lists.

Two input options are available for entering information into string variables.  A string variable is identified with a $ as the last character in its name and it contains string information, rather than a numerical value.  String variables do not have associated units. When a string variable is selected for input, the option of including the units is replaced with an option for providing a list of alternative choices for the string variable.  An Edit button will appear which will allow the existing choices to be viewed and/or changed, as seen in the above figure on the right. The string choices are displayed in a drop-down list box which displays the available choices when the user clicks in the box.  The drop-down list can be dragged to any location in the Diagram window while in development mode.  An additional capability is that the strings in the drop-down list can be used to set the values of one or more EES variables.

An Input Variable will be displayed with the value enclosed in an editable rectangle or as a drop-down list for strings.  Input variables provide the same function as an equation in the Equations window which sets the variable to a value.  When either the Solve or Min/Max commands are issued, EES will first examine the Diagram window (if it is visible on the screen) to see which variables, if any, are set.  Calculations can also be initiated directly from the Diagram window with an optional Calculate button.  A value which is set in the open Diagram window cannot also be set in the Equations window.  After the calculations are completed, the newly-calculated values of the Output variables will be displayed on the Diagram window.  If the Diagram window is foremost when the Solve command is issued, it will be updated with the calculated output values and remain foremost.  The Solution window will not be displayed.  However, it can be viewed by selecting Solution from the Windows menu.


Formatted Text (Professional Version)

Formatted text items can be placed in the Diagram window and in child diagram windows.  A formatted text item can consist of one or more lines of formatted text with embedded font, font size, font style, and font color information.  The text item can include line breaks, tabs, equations and figures.  The text can optionally be linked to the program it was generated in.  The text item can also be a table, copied from a spreadsheet program.  In addition, EES variables can be included in the text so that the current value of the variable is automatically displayed.

Creating a Formatted Text Item

Formatted text items can be created or edited when the Diagram window is in Development mode.  There are two ways to create a new item.  One way is to click the Text button on the toolbar.  This action will bring up the  Add Diagram Text Item dialog.  Click the Formatted text button at the upper left and enter the text in the large edit box that appears.   An easier way is to simply copy the text from any application such as a word processor or spreadsheet program and then use the EES Paste command while the Diagram window is in front.  If a formatted text item is selected, the Paste command will add the text to the existing text item.  Otherwise a new text item will be created.

Ofte,n applications place information on the Clipboard in more than one format.  In this case, EES will present a dialog window with options for the Paste operation.  This dialog provides the equivalent of the Paste Special menu item that is available in some applications.  The possible options are shown and explained below.

Text will paste the selection as a multiple-line text item.  The text can then be edited in the Diagram window when EES is configured in Development mode.  And non-text information in the selection is lost.

Enhanced metafile, Picture, Bitmap, and Device Independent Bitmap will all paste the selection into the Diagram window as a picture.  It will not be possible to edit the text or graphics that is pasted.  An advantage of this choice is that the selection will be pasted exactly as it appeared in the original program.

Linked Object

This option will paste the selection in manner in which it can be edited by the original program.  Double-clicking on the item after it is pasted into the Diagram window while in Development mode will start the original program and copy the item into that program where it can be edited.  Closing the original program will place the revised selection into the Diagram window, replacing the original selection.

Resizing and Moving a Formatted Text Item

Select the formatted text item by clicking on it while in Development mode.  A selected item will be displayed with a red dotted line border and 'resize' boxes, as shown for a table item below.

It may be necessary to resize the item when it is first pasted in.  To resize, click the left mouse button on one of the eight resize boxes and drag it to a new location.  To move the formatted text item to a different location in the window, click anywhere in the region between the red dotted line and the border of the text item and drag the text item to a new location.

Editing a Formatted Text Item

The Diagram window must be in Development mode in order to edit the Formatted text item. Select the item by clicking on it.  Click again at the point that you wish to edit.  Text can then be edited in the usual manner.  Formatted options are available by clicking the right mouse button which will display the following popup menu.

Inserting EES Variable Information into a Formatted Text Item

The calculated value of one or more EES variables, optionally including its units and the EES variable name, can be inserted into a formatted text item while in Development mode.  The contents of the text item are automatically updated as the EES variables are changed.  This capability is similar to that available for Output variables in the Diagram Window.  It differs in that it allows the calculated variable to be placed in a formatted paragraph or table, simplifying the construction of the Diagram window and facilitating report generation.

To insert a variable, place the cursor at the insertion point and click the right mouse button to bring up the menu shown above.  Select the Insert Variable command which will display the following dialog.

Select the EES variable you wish to insert from the list on the left.  Typing the first letter of a variable will scroll the list to a variable beginning with that letter.  Check the Hide array variables control to eliminate array variables from list.  Indicate whether you wish to include the variable name and units with the EES variable by clicking the appropriate radio button.  In Development mode, EES will display the inserted variable with a #, followed by 1, 2, or 3 (depending which of the three radio button options was selected) and then the EES variable name.  For example, if variable XYZ is inserted with its value and units, it will appear as #2XYZ in the formatted text item.  When the Diagram window is in Application mode, the insertion indicator will be replaced with the current EES variable information.

Deleting a Formatted Text Item

To delete a formatted text item, place the Diagram window in Development mode and select the item by clicking on it.  Then press the right mouse button.  A pop up menu will appear with Properties as one of the menu item choices.  Select the Properties command.  A dialog will appear with a Delete button.  Clicking the Delete button will remove the formatted text item.


Grouping Graphic Objects and Text

Graphic objects can be drawn on the Diagram Window and Child Diagram windows using the drawing tools on the toolbar palette or pasted using the clipboard from other drawing applications.  Text items can be created using the text tool on the toolbar palette.

In Development mode, two or more graphic and/or text items can be grouped.  However, only simple text items can be included in a group.  Text items which provide input or output on the Diagram window can not be grouped.

Grouped items act just like a single item.  A group can be resized, moved, copied and pasted.  A group can be included in another group to form nested groups.  To create a group, select the items that are to be in group and then click the Group button the toolbar.  Alternatively, right click on one of the selected items and select the Group menu command from the pop-up menu that appears.  Group information is saved with other file information when the Save command is issued.  To ungroup a previously defined group, click on the grouped item and then click the Ungroup button on the toolbar.  Alternatively, right click on the grouped item and select the Ungroup menu command from the pop-up menu.

Note that EES versions before V6.125 cannot read files that have been saved with Group information.


Using Drop-Down Lists to Set One or More EES Variables

When a string variable is selected for input in the Diagram Window, a check box option to Use string list will be available.  An Edit button will appear to the right of the Use string list check box which will allow the existing choices to be viewed and/or changed in a dialog window, as shown in the figure on the left.  The strings that entered into this dialog will appear in the Diagram window as a drop-down list box which displays the available choices when the user clicks in the box as shown in in the figure on the right .

The Read strings from file option is available in the Professional version.  In this case, the string information resides in a separate file.  EES will check date-time stamp of this file each time it displays the drop-down list and update the choices as needed.  The Read strings from file option allows the string choices in the Diagram window to be changed without any required changes in the EES file or the EES Distributable program.

It is possible to use the strings in the drop-down list to set the values of one or more EES variables.  This is accomplished by following the string that is to be displayed with characters // and then with one or more EES equations on one line.  The total length of the line must be less than 255 characters.  For example, suppose you wish to use a drop-down list to have a user select the density and thermal conductivity of one of several substances.  You could create a drop-down list with the following strings

Copper // density=8933; conductivity=400

Aluminum // density=2700; conductivity=237

Nickel // density=8900; conductivity= 91

Zinc // density=7140; conductivity= 116

User Input // density=?; conductivity=?

When an item from the drop-down list is selected or when calculations are initiated, EES will execute the equations to the right of the // characters and update the Diagram Window display.  If the Format Display control in the Modify Diagram Text dialog is checked, the drop-down list will only show the characters to the left of //.

An interesting extension of this concept is provided in the last string of this list which is 'User Input // density=?; conductivity=?'.  In this case, EES interprets the '=?' to mean that that the value of the variable should be entered in an edit box.  In order for this to work, the variables density and conductivity must be displayed on the Diagram window as Output variables.  When the 'User Input' item is selected, EES will look for these Output variables and change them to Input variables.  The general capability afforded by the '=?' notation is that selected variables can be changed from Output to Input or from Input to Output variables on the Diagram Window by a user selection from a drop-down list.

Note that you can also use the $INCLUDE directive in the drop-down string, as in the following example.

Program 1 // $Include IncludePrgm1.txt

When Program 1 is selected in Application mode, EES will open and compile the equations in file IncludePrgrm1.txt.  These equations will be executed when the calculations are initiated.  The .txt file can contain any number of EES equations, thereby eliminating the 255 character limitation.


Adding a Calculate Button

One or more Calculate buttons can be placed on the Diagram window (and on child Diagram windows) by selecting the Create Calculate button in the Diagram window tool bar.  By default, the Calculate button caption is "Calculate" and pressing the button provides exactly the same function as selecting Solve from the Calculate menu or pressing F2. The calculate button caption and the action taken when the Calculate button is clicked can be changed by right-clicking the button and providing the desired text while in development mode.  A bitmap picture can also be optionally displayed on the button.

While in development mode, the Calculate button can be dragged to any location on the window.  Finer positioning is available by pressing the left, right, up, or down arrow keys which move the button one pixel for each press. The width and height of the button can be changed by holding the Ctrl key down while pressing arrow keys.  The right arrow increases the button width by one pixel.  Left arrow decreases the width.  Down arrow increases the height and up arrow reduces the height.

If the Calculate button is configured to solve a table, the first and last rows in the table will be the same values as used the last time the table was solved.  In the Professional version, the first and last rows can be specified with EES variables in the Solve Table dialog and their values can be entered in the Diagram window.

Note that multiple Calculate buttons can be placed on the Diagram window and configured to do different tasks, i.e., Solve, Solve Table, etc.  Multiple Calculate buttons are only useful in conjunction with the $IF directive.


Adding a Plot Window Access Button

A Plot Window access button can be placed on the Diagram window or child Diagram window by selecting the Add Plot Window button in the toolbar.

A dialog window will appear after clicking this toolbar button in which the caption and plot window for the plot window access button can be specified.  The plot window is selected from the drow-down list. The names appearing in this list are the names on the tabs of the plot window.  Clicking OK in this dialog window will create a plot window access button.

The location and size of the plot window access button can be specified in the plot window button dialog.  Alternatively, the plot window access button can be dragged to any location when then toolbar is visible.  Finer positioning is available by pressing the left, right, up, or down arrow keys which move the button one pixel for each press. The width and height of the button can be changed by holding the Ctrl key down while pressing arrow keys.  The right arrow increases the button width by one pixel.  Left arrow decreases the width.  Down arrow increases the height and up arrow reduces the height.

Right-clicking on the plot window access button when the toolbar is visible (i.e., in Development mode)  will bring up the dialog so that the plot window or button caption can be changed.   When the toolbar is hidden (application mode) clicking the plot window access button will move the specified plot window foremost.  If the plot window does not exist, this button will do nothing.


Selecting and Aligning Text and Graphic Items

One or more text and graphic items in the Diagram window or child diagram window can be selected by clicking the left mouse button on the item while in development mode.  A red dotted box will be displayed around each selected text item.  A selected graphic object will be displayed with its 'handles' (small boxes on each edge) showing. Hold the Shift key down to select more than one item or to unselect a selected item.  Use the Select All command to select all item on the Diagram window.   All selected items can be moved at once using the mouse or the arrow keys.

The align button in the toolbar [image] can be used to facilitate alignment of the selected items relative to one another.

If all of the selected items are text items, pressing the right mouse button will bring up a dialog box in which the font, size, color, and style of the selected text items can be changed as a group.  When it first appears, the dialog box displays the characteristics of the first selected text item.  Any change made to a text characteristic in the dialog window will be applied to all selected text items.  If a text characteristic, such as the font size, is not changed in the dialog window, then the font size of the selected text items will not be changed.  Similar capability is provided if all selected items are graphic objects.  Clicking anywhere in the Diagram window that is not on a text or graphic object unselects all selected items.


Cut, Copy, and Paste Selected Text Items (Professional Version)

Selected items in the Diagram window or child Diagram window can can cut, copied, and/or pasted while in development mode.  This feature is most useful when you wish to cut or copy text items from the main Diagram window to a Child Diagram window or to the Diagram window in another EES program.  However, you can also paste the selected items into another application such as PowerPoint, CorelDraw or Word.

Use the Select All command to select all graphic and text items in the Diagram window.

If no items are selected, the Copy command will copy the entire contents of the Diagram window.  The menu item in the Edit menu will display 'Copy Diagram'.


Exporting the Diagram Window

The Copy command can be used to copy the contents of the Diagram window or a child Diagram window to the Clipboard.  The information on the clipboard can then be pasted into a word processor or other application.  If you hold the Ctrl key depressed during the copy process, the text items added with the Add Diagram Text command will not be included with the diagram.

Use the Clear  command to delete an existing diagram and associated text.


Creating Hot Areas and Child Diagram Windows (Professional Version)

A 'Hot Area' is a rectangular region on a Diagram Window that will open a child Diagram Window when the cursor is positioned in the region and the left mouse button is clicked.  The child Diagram window includes all of the features of the main Diagram Window, including the ability to have hot areas with its own child windows.

To create a hot area, move the cursor to the upper left of the region and drag it to the lower right while holding both the Ctrl and Shift keys down.  When the mouse button is let up, a window will appear in which you provide a name for the child Diagram Window.  The child Diagram Window will appear whenever you click the mouse in the designated area.  You can copy a figure into this window and add text and graphic objects using the command in the tool bar in the same manner as in the main Diagram window.  Note that the tool bar must be visible (i.e., development mode) to move or modify any text or graphic objects.

The characteristics of the child Diagram Window can be changed by clicking the right mouse button in the region while holding the Ctrl and Shift keys down.  A dialog window showing the name of the child Diagram window, the name of its parent (i.e., the window from which this child Diagram window is accessed), an enable checkbox and the position of the 'hot area' region in the parent window.

Note that the location and size of the hot area can be specified with EES variables or with numerical values.  The child Diagram window and its associated hot area can also be deleted with this dialog.  Note that deleting a child diagram window will also result in deletion of all child Diagram windows that descend from this window.  You may wish to change the parent of these descendants before deleting the Diagram window.

Child Diagram windows can be printed using the Print menu item.  Selecting the Diagram check box will bring up a window in which the child diagram windows that are to be printed can be selected.

The main Diagram window or any child Diagram window can be accessed from the Diagram window menu command in the Windows menu.

Hold the Ctrl and Shift keys down to see an outline of all currently defined hot areas in the foremost diagram window.  A hot area can be moved as explained in Moving the Hot Area for a Child Diagram Window.

Child Diagram windows have navigation buttons at the lower right corner.

Earlier versions of EES stored pictures pasted into Child Diagram windows in separate files having a .WMF filename extension.  EES now stores these pictures in the .EES file along with all other information, so .WMF files are no longer used.


Saving and Loading Diagram Inputs
Saving User Inputs

Save [image] and Load Inputs [image] buttons can be placed on the Diagram window (but not on a child Diagram window) by selecting the Show/Hide Save or Load Inputs buttons in the Diagram window toolbar.  Save and Load buttons are normally needed only for Distributable programs, since regular EES programs always save all program information with the normal Save command.  This capability is available only in the Professional version.

When the user clicks the Save button, a standard file save dialog will appear in which the name of the a file can be entered.  The default name is the same name as the EES file with a filename extension of .VAR.  The filename and directory information can be changed but the filename extension must be .VAR in order for EES to recognize the file.  If confirmed, a file containing the current values of the all EES variables, including the current values of inputs, is written to the disk.  This .VAR file can later be loaded with the Load button.  A standard file open dialog will appear in which a .VAR file can be selected.  The Diagram windows will be updated with the values of the variables found in this file.

When opening one of the ten EES files contained in the Distributable program, EES will look for a .VAR file in the same directory the Distributable program having the same parent name as the EES file.  If a .VAR file is found with this parent name, automatically loaded and the input information on the Diagram windows will be updated.

The Save button is disabled until calculations have been successfully completed.  In this way, it is not possible to write a set of input information that will not successfully calculate.  Both the Save and Load buttons will be disabled if the Diagram window does not contain input variables.

By default, the Save button caption is "Save" and the Load button caption "Load".  The captions can be changed by right-clicking on the button and providing the desired text while in development mode.

While in development mode, the Load and Save buttons can be dragged to any location on the window.  Finer positioning is available by pressing the left, right, up, or down arrow keys which move the selected button one pixel for each press. The width and height of the button can be changed by holding the Ctrl key down while pressing arrow keys.  The right arrow increases the button width by one pixel.  Left arrow decreases the width.  Down arrow increases the height and up arrow reduces the height.


Adding a Help Button

A Help button can be placed on the Diagram window or child Diagram window when the window is in development mode. Click on the Show/Hide Help button on the toolbar which is identified with a yellow circle containing a question mark symbol.   The Help button will appear along with a small dialog in which you may enter the caption for the Help button and the name of the help file that will be displayed when the user selects the Help button in Application mode. This file can either be an ASCII text file (*.TXT), a Windows help file (*.HLP) or an HTML file (*.HTM).  EES will automatically determine the file type independent of the filename extension.  The help button can be removed by clicking the Show/Hide Help button in development mode.

While in development mode, the Help button can be dragged to any location on the window.  Finer positioning is available by pressing the left, right, up, or down arrow keys which move the button one pixel for each press. The width and height of the button can be changed by holding the Ctrl key down while pressing arrow keys.  The right arrow increases the button width by one pixel.  Left arrow decreases the width.  Down arrow increases the height and up arrow reduces the height.


Creating Links (Professional Version)

Link buttons can be placed on the Diagram window or child Diagram windows by selecting the Create Link button in the toolbar [image] in the Professional version.  A dialog window will appear after clicking this toolbar button in which the caption and link properties can be specified and assigned to a button which will appear on the foremost diagram window.  The caption, bitmap picture, and properties can be changed at a later time by right-clicking on the link button while the Diagram window is in development mode.

Six different types of links can be created:

Link type 1:  Start an External Program

This link type allows any program, including a second copy of EES, to be started when the user clicks the link button in the Diagram window while in application-mode.  The link button property only requires the name of the file that is to be opened when the application starts.   The name of the application is not required as that information is determined by EES from information in the Windows operating system registry.  As an example, the following link property will start a second copy of EES and load file TEST.EES in the C:\EES32 directory.

c:\ees32\TEST.EES

EES can communicate with other programs using lookup files.  The $SAVELOOKUP and $OPENLOOKUP directives make this process more convenient.  In addition, EES will check the date/time stamp of any lookup file it uses and if the file is changed, it will be automatically reloaded.

Link type 2: Open EES File

This link type will close the existing EES file and open the EES file specified as the link button property.  EES will check to see that the current EES file is saved, and if not, ask for confirmation before closing the existing file.  This option is useful when the results of one EES program provides data for use in the next EES program.  For example, information can be calculated and saved in a Lookup Table that is automatically loaded in the next EES program with the $OPENLOOKUP directive.  Alternatively, a Link button (type 6) can be placed on the Diagram window to open a specified Lookup file.

Link type 3: Open Distributable File

This link type is applicable only to distributable programs created with the Make Distributable Program command.  Distributable programs can include up to 5 EES files.  As with option 2, this link type allows one EES file to open another, but in the case of a distributable program the EES file must be one of the five included with the distributable program.  It is referred to by its number, 1 to 5.

Link type 4: Open Child Diagram Window

This link type is applicable if one or more child Diagram Windows have been created.  A list box showing the names of all child Diagram windows is provided.  Clicking the button will open the specified child Diagram Window, just as if the user had clicked the mouse within the hot area for the child Diagram window.  However, the button can be positioned anywhere in the window.

Link type 5: Play Macro adapted with EES variables

This link type will play a predefined Macro file that has been stored with a .EMF filename extension.  The first parameter that must be supplied in the edit box is the macro filename, including the .EMF filename extension. All other parameters are optional.

It is possible to provide information to the macro file that allows its capability to be programmed.  This is done by providing parameters after the macro file name separated with a space or comma.  These parameters can be EES variable names, numerical values, or strings.  EES will process the Macro file looking for the character sequence %%N where N is an integer value.  If this sequence is found, %%N is replaced with the Nth parameter.  For example, suppose the macrofile name doPropPlot.EMF has a line that contains

PropPlot %%1 PH 2 %%2 %%3 0 DoQLines

If the Play Macro link information is

doPropPlot.EMF R$, Thigh, 0

EES will replace %%1 with the value of the EES string variable R$, %%2 with the value of EES variable Thigh, and %%3 with 0. The property plot will then be drawn.  Note that calculations must be completed to enable the button.

Link type 6: Open a Lookfile File

A Link button can be placed on the Diagram window that, when clicked, will display the familiar Open File dialog.  A user can then select a Lookup file having a filename extension of .LKT, .TXT, or .CSV and that Lookup file will be opened.  After the selection has been made, an EES string variable having the same name as the caption of the Link button is created and its value is set to the name of the Lookup table that has been read in.  EES does not allow spaces in a variable name so any spaces in the caption are set to underscores.  Also, the maximum length of the variable is 29.  The last character of the EES variable name is set to $ to indicate that it is a string variable. As an example, if the caption of the Link button is "Open Lookup File', clicking the button will read the file, create variable Open_Lookup_File$ and set the value of this variable to the name of the Lookup table that was created.   If the Lookup table already exists, it will not be re-read.

Clicking OK in the Link Properties dialog will create the link button. The button can be dragged to any location while the Diagram Window is in development mode.  Right-clicking on the link button while in development mode will bring up the Link Properties dialog so that link properties can be changed or the button can be deleted.

While in development mode, the Link button can be dragged to any location on the window.  Finer positioning is available by pressing the left, right, up, or down arrow keys which move the button one pixel for each press. The width and height of the button can be changed by holding the Ctrl key down while pressing arrow keys.  The right arrow increases the button width by one pixel.  Left arrow decreases the width.  Down arrow increases the height and up arrow reduces the height.


Navigating through the Diagram Windows

The main Diagram window can have 'hot areas' which bring up child Diagram windows when clicked.  The child Diagram window can also have 'hot areas' forming grandchildren and so on.  Each child Diagram window will have a small 'home' button that is initially placed in the lower right corner of the child diagram window.    Clicking this button will close the window and bring up the main Diagram window.  If the parent of the Diagram window is not the main Diagram window, a second button with a left arrow will also be displayed at the lower right.  Clicking this button will close the child Diagram window and bring its parent, effectively moving back one level.

The home and up-level bounds can be moved to other locations by dragging them with the mouse in Development mode.   Finer positioning is available by pressing the left, right, up, or down arrow keys which move the button one pixel for each press. The width and height of the button can be changed by holding the Ctrl key down while pressing arrow keys.  The right arrow increases the button width by one pixel.  Left arrow decreases the width.  Down arrow increases the height and up arrow reduces the height.  Right-clicking on the home button provide a dialog that allows the button caption to be entered or changed.


Adding a Print Button to the Diagram Windows

A Print button can be placed on the Diagram window or child Diagram window when the window is in development mode.  Click on the Show/Hide Print button on the toolbar [image].

The Print button can be dragged to any location in the window while the toolbar is visible.   Finer positioning is available by pressing the left, right, up, or down arrow keys which move the button one pixel for each press. The width and height of the button can be changed by holding the Ctrl key down while pressing arrow keys.  The right arrow increases the button width.  The caption can be changed or removed by right-clicking on the button.  The button can be removed by clicking the Show/Hide Print button on the tool bar.

Clicking the left mouse button on the Print button while in application mode will print the contents of the window to the default printer that has been selected with Printer Setup command.

Return to Diagram Window


Adding an Audio-Visual item

Audio-visual items such as movie files (having an .avi file name extension) or sounds (having a .wav filename extension) can be placed on the Diagram window or child Diagram windows by selecting the Add Audio-Visual item button in the toolbar  [image].  The following dialog window will appear after clicking this toolbar button.

The Browse button facilitates selection of the audio-visual file.  Any file that following the MDI interface should be acceptable, including files that have a .avi or .wav file name extension.  If a movie file is seleced, EES will automatically fill in the Width and Height of the movie.  These fields can be changed.  If the Lock aspect ratio button is selected, changing either width or height will result in an automatic change in the height or width to ensure that the original aspect ratio remains unchanged.

If the Show control buttons is checked, a control bar [image]  will be placed below the audio-visual item. The bar has the familiar play, pause, stop, step, previous control buttons.  If the control buttons are not selected for display, then the movie is controlled by the left and right mouse buttons.  To play, click the left mouse button within the item rectangle while in Application mode.  To pause a playing item, click the left mouse button within the item rectangle.  Clicking the right-mouse button stops a playing move and resets it to the beginning.

The audio-visual control information can be viewed or changed by right-clicking in the item rectangle while in Development mode.


Report Window (Professional Version)

The Report Window operates just like a typical word processor offering the usual choice of fonts, font sizes, text style, color, highlighting, tabs, left and right indents, etc. Graphics can be pasted into the window at the cursor position.  The graphics can be equations copied from the Formatted Equations window, a plot from the Plot window, or any graphics in the Diagram window.  Graphics can also be pasted from other applications.  In addition, the Report Window can include EES variables that are automatically updated as their values change.

To include the name, value, and/or units of an EES variable, click on the EES button [image] in the tool bar or, alternatively, click the right mouse button and select Insert Variable from the   popup menu.  Either action will bring up the following dialog.

Select the variable you wish to insert from the list on the list and then indicate with the check boxes the information about this variable that is to be inserted in the ReportWindow.  Click OK.  The information inserted in this manner is automatically updated in the Report Window when changes occurs.

Note that the Report Window provides buttons to Import and Export text.  The Import button will insert the contents of a selected .RTF or .TXT file at the cursor position.  The Export file will export the entire file to a specified .RTF or .TXT file.  The .RTF files can include graphics.  For example, you can include a graphical letter head in an .RTF file and import it whenever you wish to prepare a formatted report. The report can be printed, by clicking the print button.

The [image] button on the toolbar shows or hides the coding that EES uses to identify variables.  In some cases, the hidden text will interfere with the ability to add text.  If this problem occurs, click this button and you should then be able to enter text anywhere.  Exposing the coding also helps to identify where in the text the EES variables have been placed.  Click the text again to hide the coding.


Formatted Equations
Formatted Equations (WINDOWS menu)

The Formatted Equations window displays the equations entered in the Equations window  in easier to read mathematical notation.  Comments appearing in the Equations window within quote marks will be displayed in the Formatted Equations window with the quote marks removed.  Comments within braces will not be displayed in the Formatted Equations window.  Long comments that span multiple lines in the Equations window will be broken so as to fit within the Formatted Equations window and the printout of the formatted equations.

Clicking the right mouse button anywhere within the Formatted Equations window will bring up the following popup menu:

Selecting the first menu item will close the Formatted Equations window and move the focus to the Equations window with the cursor positioned on the equation that was selected in the Formatted Equations window.  If the $Bookmark directive is use, the specified bookmarks will appear at the bottom of this menu.

The next two menu items control whether or not unit information is displayed.  If checked, as shown above, Display Units for Constants will show the units of numerical constants that are set in the Equations window by following the numerical value with the units enclosed in brackets.  This is the only way to specify the units of numerical constants.  The units of EES variables can be set in several ways such as in the Solution Window, and the Variable Information dialog.  EES may set the units of some variables automatically.  If you wish to see the units of the variables select the Display Units for Variables item.

If Display subscripts and Greek symbols in the General Display tab in the Preferences dialog is selected, the underscore character will indicate the start of a subscript.  The following characters in the variable name will be displayed in smaller type and lower case.  Additional underscores within the same variable name will be changed into commas.  Similarly, the vertical bar character signifies the start of a superscript.  For example, G|o will be displayed as:

Array variables will also be changed to appear as subscripted variables.  Variables which have the name of Greek symbols, such as alpha, beta, and gamma, will appear in Symbol font.  If the variable name is all in capital letters, the Greek symbol will be shown as a capital letter.  A dot or bar can be positioned over the variable name by adding _dot, _hat, or _bar to the name.  For example, X_dot=5 will display as:

X_ddot will display with a double-dot centered above the X.  X_infinity will display as X subscripted with the infinity symbol.   The Solution and Parametric Table windows will also display variables with subscripts or superscripts indicating subscripts provided the Display subscripts and Greek symbols option in the Preferences dialog window is selected.

The equations displayed in the Formatted Equations window are internally represented as Windows metapict (picture) objects.  You can copy one or more equations or the comments from the Formatted Equations window to other applications, such as a word processor.  To copy an equation, first select it by clicking the left mouse button anywhere within the equation rectangle.  A selected equation will be displayed in inverse video.  You may select additional equations.  Alternatively, the Select Display command in the Edit menu can be used to select all of the equations and comments which are currently visible in the Formatted Equations window.  Copy the equations to the clipboard with the Copy command.  The equations will be deselected after the copy operation.  Once on the Clipboard, the equations may be pasted into other applications using the Paste command in the application's Edit menu.  The pasted equations will appear as a picture in the external application.  Comments normally appear in blue text in the Formatted Equations window and they will appear in color when copied to the Clipboard.  If you wish to have the comments displayed in black, hold down the Shift key while issuing the Copy command.

Equations cannot be edited in the Formatted Equations window.  However, clicking the right mouse button anywhere within the equation rectangle will bring the Equations window to the front with the equation selected where it can be edited.


Format Variable

The appearance of any item in the Solution Window  can be changed.  Clicking on the item will bring up this dialog window.

Pop-up menus are provided for the style, foreground and background colors, digits, and highlight fields.  In complex number mode, an additional pop-up menu is provided for Rectangular, Polar (degrees) and Polar (radians) format.  The style menu provides display format styles of Auto, Fixed Decimal and Exponential.  The digits field shows the number of digits to the right of the decimal point (for Fixed decimal) or the number of significant figures (for Exponential format) that will appear in the display.  This digits field is not active when Auto format is selected.  The display format only affects the presentation of the result;  the number of significant digits used in the calculation is not affected by this choice.

The highlight and foreground and background color fields provide options for displaying the selected item in a manner in which it will be easily found when there are many variables appearing in the Solution Window.  Using a yellow background color provides an affect similar to using a highlighter marker on conventional paper.

A field is also provided for units.  Units are displayed following the numerical value of the variable and used in the unit checking algorithms.  Right clicking or double-clicking in the Units field will bring up the Units List dialog from which you can select a units string - eliminating the need to key the string in.


Debug Window (Windows Menu)

The Debug Window displays diagnostic information of three types.

Incorrect Degrees of Freedom

An option to show the Debug Window will appear after an attempt to calculate fails because the number of equations is not equal to the number of unknowns.  In this case, the Debug window provides two lists of variables.  The first list shows all variables which are referenced only once in the Equations Window.  These variables are possibly spelled wrong or otherwise are not directly used in the problem, except for informational purposes.  The second list shows the variables which are most likely to be involved in any missing or extra equations.  The information used to construct this second list is determined by examination of the blocking order of the equations in the Residuals window.  You may also find the information in the Residuals Window helpful in identifying the problem with your equation set.  Clicking the left mouse button on a variable name in the Debug window will bring the Equations Window to the front with that variable name selected.

Constrained Solution

The Debug Window can also appear if the solution to a problem is constrained.  If an affirmative response is provided in the dialog that requests more information, the Debug window will appear showing all variables that are constrained along with their values and lower and upper bounds.  The affected equations will also be displayed.  Clicking on a variable will open the Variable Information dialog with the cursor positioned on the limit that is constraining the solution.

Unit Checking Summary

The Check Units command will display its finding in the Debug window.  Each equation that is found to have a dimensional or unit inconsistency will be displayed (in black) followed by an explanation (in blue).  Clicking either mouse button on the equation will produce a pop-up menu that has three menu items.  The first (Jump to Equations window)  will jump the focus to the offending equation in the Equations window.  The second menu item (Set Variable Units) will bring up an abbreviated form of the Variable Information dialog window showing only the variables in that equation.  The last item will disable unit checking for this equation.


Format Table Column

This dialog window provides four sets of information pertaining to the data in the selected table column.

The column title is the name of the variable for the Parametric , Arrays , and Integral tables.  This title identifies the column and cannot be changed.  The column title for Lookup tables, however, may be changed.  The data in this column may be referenced by its title, as explained in the Interpolate and Lookup commands.  The units of the data in the column may be changed for all four table types.  Right clicking or double-clicking in the Units field will bring up the Units List dialog from which you can select a units string - eliminating the need to key the units string in.

The display format of the data in the column can be changed by selecting the style and digits for the formatted numbers.  This choice does not affect the calculation accuracy, but just the display.  The background color of the data in the column can also be changed by clicking on the background color control menu.  The background color can be used to highlight the data or for other purposes such as to indicate which columns in a Parametric table require user input values.  Note that the format style can be set to STRING for the Lookup Table.  The STRING specification is required if the column is to hold string rather than numerical data

The column can be moved to a different position in the table by clicking on the spin button arrows.  The number displayed in the column box is the column number that this column will appear in when the OK button is clicked.  Note that column numbers are shown at the upper left of each column header cell.

The sum, average, and standard deviation of the values in the selected column are displayed in the Statistics box.  The values in these boxes can not be edited, but they can be copied.  If a column holds the results from an Uncertainty Propagation Table command, the Sum field will display the sum value along with the uncertainty of the sum calculated as the square root of the sum of the squares of the uncertainty values in the column.  Note that the sum of values in a Parametric table column is displayed when the "Include a Sum Row in the Parametric Table check box is selected in the General tab of the Preferences dialog.  Also, the SUMPARAMETERIC and SUMLOOKUP functions return the sum of the values in the Parametric and Lookup tables, respectively.


Change Table Column Values

This dialog can be invoked for Parametric and Lookup tables by clicking the right mouse button in the column header cell or in a range of selected cells in one column.  A pop-up menu will appear having Alter Values as a menu option.  The dialog provides an easy way to enter values into a column within the Parametric or Lookup Tables.  An alternative way to invoke this dialog is to left click on the triangular icon [image] in  the upper left corner of the header table cell.  This capability provides similar capability to that in the Alter Values command (for the Parametric table) but it is somewhat more convenient to use.

The affected rows are displayed at the upper right. By default, the changes will occur for all rows in the table.  The values can either be cleared or set, depending on the radio button setting.  Clearing the table in this manner is not really needed since the Cut command in the Edit menu will provide the same capability.

The value to be placed in the first row of the selected row range must be specified in the First Value field.  Beneath this field is a second field in which the last value in the range, the increment, or a multiplier can be specified, depending on the selection shown in the drop-down control.  If Increment is selected, the value of successive rows in the table are determined by adding the value in the increment field to the previous value.  Similarily, if Multiplier  is selected, successive values are determined by multiplying the previous value by the value indicated in the field.  If Last value is selected, the increment will be chosen such that the last row is assigned the value that is provided in the box.

In some situations, it is necessary to fill a table with a pattern of some type.  For example, you may wish to enter 1, 2, 3, 4, and 5 in the first 5 rows of the column and then repeat these values in the next five rows and so on down the table.  Alternatively, you may wish to enter 1, 1, 1, 1, 1 in the first 5 rows followed by 2, 2, 2, 2, 2 in the next five rows and so on.  The capability to enter patterns of this type is provided with the controls that are above the OK and Cancel buttons.  Click the check box to enable the controls.  Select Repeat Pattern every to enter a repeating pattern of the form 1, 2, 3, 4, 5.  Select Apply Pattern Every to enter a sequence such as 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, etc.  The pattern is specified by the first value and the last value / increment / multiplier.  The pattern repeats every N rows where N is the value you provide.  The pattern is applied to rows indicated with the First Row and Last Row controls.


Sort

Values in a Parametric or Lookup table can be sorted in numerically increasing or descreasing order.  The column for which the sort is to be conducted is designated by clicking the right mouse button in the column header cell and then selecting the Sort menu item.

The Sort dialog window will then appear for the designated column.

If the Apply to button is set to This column, only the designated column will be sorted.  If All columns is selected, the sorting order will be determined for the designated column and applied to all other columns in the table.  The range of rows can be specified.  Note that the sort may not work properly if the range includes blank cells.


String Variables

EES supports numerical and string variables.  A string variable is identified with a variable name that ends with the $ character, as in Basic.  The variable name must begin with a letter and consist of 30 or fewer characters, including the $ characters.

String variables can be set to string constants which are enclosed with single quote marks, e.g.

A$='carbon dioxide'

String variables can be set equal to other string variables, e.g.,

B$=C$

String functions are provided to manipulate string variable and to convert them to or from numerical values.

String variables may be passed as arguments to internal  functions, Procedures Modules, or external functions and Procedures.

In general string variables can be used in EES equations anywhere in which character information is provided.  For example, the name of a fluid provided to a thermophysical property function may be a string variable, e.g.,

h=enthalpy(R$,T=T,P=P)

A string variable may be used to supply the name of a Lookup file or the name of a column for use with the Interpolate or Lookup commands, e.g.,

m=Interpolate(File$,Col1$,Col2$,Col1$=x)

k=Lookup(File$,Row,Col$)

A string variable may be used to supply the units of other variables.  For example,

U$='kJ/kg'

h=15 "[U$]"

The comment to the right of the 15 sets the units of variable h to U$.  The units could also be set in the Variable Info dialog or by clicking on h in the Solution window.  In any case, EES will recognize that U$ is a string variable and set the units of h to the string that is assigned to U$.

String variables may be supplied to the Equations Window using the Diagram Window, either with an edit box or with a pull-down list of alternatives.  See the Diagram Window for more information.


Numerical Format

The format for numerical values in Europe and other locations differs from that in the U.S. in several respects.  Most noticably, the decimal point in the U.S. represention of a number is replaced by a comma.  EES can be configured to support this format by setting the Decimal Separator to a comma in the Regional Settings dialog of the Windows Control Panel.  EES can only use a decimal point (U.S. format) or a comma as the decimal separator.  EES must be restarted after a change to the Decimal Separator is made.

Note that if the decimal separator is changed, the list separator and multiple equation characters are also changed as indicated in the following table.

US	European

Decimal separator	. (decimal point)	, (comma)

List separator	, (comma)	; (semicolon)

Multiple equations  on one line separator	; (semicolon)	: (number sign)

The decimal point key on the numeric keypad will generate a decimal point or comma as appropriate depending on the settings in the Windows Regional Setttings Control Panel for the Decimal Separator.

EES saves the numerical format information with the file it saves and it will automatically convert from one format to another, if necessary, when the file is opened.


Complex Numbers

EES will solve equations involving complex variables of the form a+b*i if the Do Complex Algebra control in the Complex tab of the Preferences dialog is checked.  The imaginary number operator may be set to either i or j in the Preferences dialog although i is used in the following discussion.

Whet set in complex mode, every (non-string) EES variable is represented internally as two variables corresponding to the real and imaginary parts.  The real part is identified by appending _r to the variable name.  The imaginary part has an appended _i.  If, for example, you enter the equation

X=Y

EES will create variables X_r, X_i, Y_r and Y_i corresponding to the real and imaginary components of the variables.  You will normally not have to refer to the renamed variables, although they will appear with these names in the Variable Info and New Parametric Table dialogs, as well as in column headers of the Parametric Table.  However, you can set the value of a real or imaginary part of a complex number by entering the real or imaginary variable name on the left of an equation in the Equations window. For example, the following equation will set the imaginary part of variable omega to 0.

omega_i=0

Any later attempt to set the imaginary part of omega will cause EES to display an error message.  If, for example, you also enter the equation, omega = 3 in the Equations window, EES will present an error message when you attempt to solve because the omega=3 equation sets both the real and imaginary parts of omega and the imaginary part would have already been set.  You could, of course, enter omega_r=3.

Complex numbers can be entered in either rectangular or polar form.  In rectangular form, the complex number is entered using the imaginary number operator (i or j) with a multiplication symbol (*) separating the imaginary number operator from variables or constants.  A complex constant can be entered in polar form by entering the magnitude (also called absolute value) of the number and the angle separated with the < symbol.  The < character will be displayed in the Solution and Formatted Equations windows as ∠.  Alternatively, the CIS function can be employed in place of the < symbol, as shown in the example below.  The angle can be entered in either degrees or radians.  If no designation is provided, the angle is assumed to be in the same units as indicated for trigonometric functions in the Unit System dialog.  However, you can ensure that the angle you enter is in degrees or radians regardless of the unit system setting by appending deg or rad to the number (with no spaces).  For example, the value of Y can be set to the same complex constant in any one of the following four ways.

Y=2 + 3 * i

Y=3.606 < 56.31deg

Y=3.606*cis(56.31)

Y=3.606 <0.9828rad

The use of deg or rad to indicate the units of the angle is strongly recommended for three reasons.  First, the value of the constant you enter will not be changed by the unit system setting.  Second, you can do all calculations with the unit setting in radians which is more efficient.  Third, if you designate the angle to be in degrees, the degree sign will be shown with the angle in the Formatted Equations window.  The output display of the number in the Solution Window can be set for degrees or radians (in polar notation) independent of how the number is entered.  The display is changed by clicking the right mouse button on the value and selecting the display options from the Format Variable dialog.

Internally, EES creates two equations for each equation that is entered in the Equations window.  One equation is used to equate the real parts of the variables whereas the second equation equates the imaginary parts.  The actual set of equations used in complex mode is most clearly seen by viewing the Residuals window which displays the residual and blocking order for each equation.  Equations used for the real and imaginary parts are identified with (r) and (i), respectively.

When configured in complex mode, some EES functions, such as Min and Max, are not accessible.  However, most of the mathematical functions have been modified for complex number evaluations.  For example, the sin, cos, ln, and exp functions will accept and return appropriate complex numbers.  User-written functions, procedures, and external routines can be used but they will accept and return real numbers only.  (Modules are currently not supported in complex mode.)  Only the real part of a complex variable will be placed in the argument list of internal or external functions, procedures, and modules.

There are a few built-in functions that operate only in complex number mode.  They are Real, Imag, Magnitude, Angle, AngleDeg, AngleRad, Cis and Conj. These functions all take one (complex number) argument and set the real part of the complex variable to the selected value.

One limitation of the manner in which EES implements complex numbers is that EES can only return one solution, although two or more solutions may exist.  There is, however, a simple way to coax EES into providing multiple solutions.  Consider the problem of determining the five roots to the complex equation  z^5 + 9 + 9*i = 0.  Entering this equation into the Equations window and solving with the default guess values will produce a solution of z=1.176+1.176 i.  or 1.663∠45° in polar coordinates.  This is a correct solution to the equation, but there are others.  To find a different solution (without changing guess values), divide the equation by the difference between z and the value of this root.  This can be done by entering the following equations.

(z^5+9+9*i)/(z-z1)=0

z1=1.663<45deg

Solving a second time will produce a different root equal to 1.663<(-99deg).  This process can be repeated to find all five roots.


Commercial and Professional Versions

EES provides many additional features such as curve-fitting, linear regression, property plots, contour plots, uncertainty analyses, solutions to complex and differential equations and others. EES is available in both Commercial and Professional versions. All of the major capabilities are provided in the Commercial version. The Professional version provides the following additional capabilities.

 1.  A Make Distributable command is provided to create a special purpose version of EES that will run one to five preselected problems. EES, the problems, and supporting files are placed in a single executable file that can be freely distributed to others. They do not need to own EES to run the calculations or create/change/view the plots and tables. The equations can be hidden from the user, if desired.

2.	A Diagram window is provided in the Commercial version in which a picture can be imported and text, input variables, and calculated variables may be superimposed in this window. The capabilities of the Diagram Window are expanded in the Professional version to define 'hot areas' in the Diagram Window which, when clicked, bring up Child Diagram windows.  The Child Diagram Window has all of the capabilities of a Diagram Window including the ability to launch other Child Diagram Windows. Link buttons may be placed on any of the Diagram windows to start external programs, run a macro, start another EES file or other tasks.

3.	A series of EES instructions (i.e., a macro) can be recorded with the Build Macro command in the File menu. EES can later be started from the Windows Run command or from a different program to replay all of the instructions in the Macro file. Used in this manner, EES can be directed to solve a set of equations in a specified text or EES file and put the solution into another specified text file without ever appearing on the screen using Dynamic Data Exchange (DDE)

4.   Variable information can be read from or saved to a file.  A variable information file has a .VAR filename extension, but it is a text file that can be opened in a word processor or spreadsheet.  Variable information data can be saved to an existing .VAR file.  In this case, the file is updated with the current information for the variables that are in use.  Information in the file concerning variables that are not currently in use is not modified or deleted.  If a program contains one or more modules, a dropdown list appears at the top center of the Variable Info dialog from which the module or main program can be selected.  Variable information are read or saved for the selected module or main program.  Variable information files make it very easy to prepare and use a file containing your common variables with appropriate guess values, limits, and units.

5.	The Professional version allows a maximum of 12,000 variables and equations and the number of rows in the Parametric table is limited only by available memory.

6.	The Professional version provides high accuracy properties for water substance at pressures up to 1,000 MPa using the STEAM_IAPWS formulation.

7.	The Report Window is provided in the Professional version.

8.   Plots can be animated with the Professional version.

9  The genetic optimization algorithm is an option in the Professional version.

10.  The professional version allows the results of the optimization process to be logged to a text file.


EES File Types and Filename Extensions

EES works with a number of different file types, as distinguished by their filename extensions.  The list below identifies each filename type and provides a short description of its use.

Extension        	Purpose

.CSV	Comma separated variable (.CSV) files provide data that can be read by EES with the Open Lookup Table command.  The file does not provide any information concerning the column names or data format.  The number of values in the first row of the file determines the number of columns in the table.  The number of rows in the table is equal to the number of rows of data.  Values on each row are separated with the list separator character.  Each row ends with a linefeed - carriage return.  Note that .CSV files can be directly read or saved with popular spreadsheet programs, so the .CSV format provide an easy way to exchange Lookup file information with other applications.  The .CSV format can also be used to read and write files with the $IMPORT and $EXPORT directives.

.CTX	Context (.CTX) files are used with .HLP files to provide an index to a specific function or procedure that is described (along with others) in a .HLP file.  The .CTX file format is described in Help for Library files.

.DFT	The EES.DFT holds identification and default information needed by EES at startup.  This file MUST be located in the EES main folder.  EES will not operate unless this file is present.

.DLF	Dynamiccally linked Function (.DLF) can be written in C, C++, Pascal, and other high level languages that support linked lists and dynamic linked libary files.  These files can provide external functions that can be called by EES. Multiple functions can be placed in a .DLL file.

.DLL	EES can access one or more external programs that are compiled in a particular format as dynamic link library (.DLL) files.  External programs can also be provided as .FDL, .DLF, and .DLP file formats.  The advantage of the .DLL format over the other types is that more than one external procedure can be provided in a .DLL file.  Additional infomation is provided under Multiple External Routines in a Single DLL.

.DLP	Dynamiccally linked Procedure (.DLP) can be written in C, C++, Pascal, and other high level languages that support linked lists and dynamic linked libary files.  These files can be provide external procedures that can be called by EES.  Multiple procedures can be placed in a .DLL file.

.DVI	Default Variable Information (.DVI) files are binary files containing default information for the guess value, bounds and format as a function of the first letter of the variable name.  The .DVI files are created with the Store button in the Default Variable Information dialog and read when the Load button in that dialog is clicked.

.EMF	EES Macro Files (.EMF) store macro commands in an ASCII (text) file that can be replayed.  The instruction in the macro file can be executed by opening the file with the Open or Create Macro command and clicking the Play button.  This command also allows new macro files to be created or existing macro files to be edited.  A macro file can also be played from another program using DDE (Dynamic Data Exchange) commands.  EES macro files can only be used with the Professional version.

.FDL	An .FDL file provide an externally compiled procedure that can be called by EES.  The filename originally was intended for refer to FORTRAN Dynamic library, but the external program can be written and compiled in any language that supports Windows dynamic link library files.  .DLP and .DLL files also provide external procedures in dynamic link library format.  The .FDL file format differs from the .DLP file in the manner in which the arguments are provided.  In particular, the .FDL file format uses linked lists which are not supported in older FORTRAN compilers.  The .DLL format can incorporate more than a single procedure whereas the .FDL file is limited to one callable procedure.

.EES	EES saves all problem information including tables, plots, equations, variables and diagrams, in .EES files.  .EES files are binary and can only be read by EES.  If an EES file has somehow become corrupted and it cannot be read by EES, it may be possible to recover the equations that were saved in the file by opening the file with WordPad or a similar application.

.HTM and .HTP	Help (.HLP) and HTML (.HTM) files are used to provide user information.  The file that you are reading now is the EES.HLP file.  .HLP files that use the Windows Help program can be prepared for internal or external functions and procedures. .HTM files that open a browser program can also be used to provide online help.   More information is provided in Help for Library Files.

.INI	EES stores user specifications made in the Create LaTeX/PDF Report dialog in a small file called EES_TeX.ini.  This file, if present, should be in the same directory as the EES application.  If the file is deleted, EES will use its own internal defaults.

.LIB	Library files  (.LIB) can be used to store EES internal function, procedures and modules.   When EES starts, it will automatically load all of the functions and procedures in the library files which are found in the EES USERLIB\ subdirectory. Library files can also be loaded manually using the Load Library command in the File Menu or automatically using the $INCLUDE directive.

.LKT	LOOKUP (.LKT) files are the native form for storing tabular data in a lookup file.  The .LKT file stores the column header information and number format as well as the values in the table.  The .LKT file is a binary file and it can only be saved (Save Lookup Table) or opened (Open Lookup Table) by EES.  EES can also read lookup file information in .CSV and .TXT file formats, but the .LKT format is more compact and faster.  See Lookup file formats for more information.

.MDI	Make Distributable Information (.MDI) files store all of the information needed to recreate a distributable program.  The .MDI file is created by clicking the button with the disk icon at the lower right of the Make Distributable dialog.  The stored information is retrieved using the button with the folder icon, also at the lower right. The .MDI files facilitate making repeated changes to a distributable file.  This capability is provided only for the Professional version.

.NWM	The EES.NWM file is placed in the EES main folder if a second EES application is started and the user checks the 'Do not show this dialog next time' check box when the warning for multiple copies of EES is presented.  If the EES.NWM file is present, the warning will not be displayed.  To return to the default behavior in which a warning is displayed when a second EES application is started, simply delete the EES.NWM file.

.PAR	Parametric (.PAR) files are created by the Store Parametric Table command.  A .PAR file store information for in selected parametric table to a binary disk file.  All information related to the parametric table is saved.  The file can later be read to recreate the table with the Retrieve Parametric Table command.  The original purpose of .PAR files was to get around the EES implementation limit of one Parametric Table in older versions of EES.  EES now allows an unlimited number of Parametric Tables which eliminates the need for .PAR files.

.PDF	Portable Document Interface (.PDF) files are created by the Create LaTeX/PDF Report command if the Create PDF document option is selected.   In the case the PDFLaTeX.exe program is used to compile the .TEX file into a .PDF file which can be viewed with Abode Acrobat.

.PRF	EES Preference files (.PRF) hold default values of units settings selected in the Unit System dialog, stop criteria and integration tolerances specified in the Tolerances dialog, default variable information, and all of the information in the Preferences dialog.  In addition, the .PRF file holds recently accessed file names (formerly stored in the EES.FNL file) and default directory information.  A .PRF file is created when the Store button in clicked in the Unit System, Tolerances, and Preferences dialogs.  EES will automatically load the EES.prf file when it is started if it is found in the same directory as the EES application.   An existing .PRF file in any directory can be loaded with the Load button in the Preferences dialog or with a $INCLUDE directive.

.TEX	TeX (.TEX) files are created by the Create LaTeX/PDF Report command.

.TXB 	Textbook (.TXB) files hold information that can be used to create a user menu at the right of the menu bar.  Originally, the user menu was used to provide information to coordinate with textbooks that used EES, but any user menu can be created.  .TXB files can be loaded manually with the Load Textbook command or automatically, by placing the file in the EES \USERLIB folder.  The format of the ASCII .TXB file is described under Textbook Index file.

.TXT	Text (.TXT) files are used in several ways by EES.  .TXT files that contain equations, perhaps functions, procedures, or modules, can be merged into an EES program using the $INCLUDE directive.  Lookup files can be saved (Save Lookup Table) or opened (Open Lookup Table) with the .TXT format.  See Lookup file formats for more information. The .TXT format can be used to read and write files with the $IMPORT and $EXPORT directives. Text files can also be used to provide help information for internal or external functions and procedures. The LibraryManager.text file is written by the EES Library Manager which controls loading of library files at startup.

.UNT	Units List (.UNT) files hold unit strings facilitating the entering of units information for EES variables.  .UNT files can be created with a text editor or more simply using the Units List dialog.

.VAR 	Variable (.VAR) files save the name, guess, lower bound, upper bound, and format for all EES variables in the main program or a module.  .VAR files can be read and saved in the Variable Information dialog or using the Load/Save buttons in the Diagram window.  The Professional version is required for using .VAR files. .VAR files are particularly useful with the Diagram window in that user inputs can be saved and later re-loaded.  Other application for .VAR files are to provide multiple sets of guesses and to automate setting information for commonly used variable names. See Variable Information Files and Saving and Loading Diagram Inputs for more information.

.WMF	Windows Meta File (.WMF) were used in earlier versions of EES to save figures in child diagram windows.  These figures are now saved within the .EES files (or within a distributable program) and are no longer generated by EES.

.XPT	Export files (.XPT) can be saved or read by Windows, Macintosh, and DOS versions of EES.  The .XPT file includes equations, variable information, the first Parametric table and up to one Lookup table in a text format.  Plots and diagrams are not saved and some advanced features, such as string variables and multiple Parametric tables are not supported.  The .XPT file is a text file and it can be viewed with any text editor.  There is no reason to use the .XPT file format except for transferring files between different operating systems.


$Directives

Directives are instructions to the EES compiler appearing within the EES Equations window.  The directives are:

$Arrays ON/OFF

$BookMark

$CheckUnits ON/OFF  and  AutoON/AutoOff

$Common

$Complex ON/OFF

$Export

$IF and $IFNOT

$Import

$Include

$IntegralTable

$LocalVariables ON/OFF

$OpenLookup/$SaveLookup

$Private

$Reference

$SumRow ON/OFF

$TabStops

$UnitSystem

$Warnings ON/OFF


$Common

The $COMMON directive provides a means for passing information from the main program to internal functions, procedures, and modules.  Use of $COMMON provides an alternative to passing values as arguments. This directive is similar in concept to the COMMON statement in FORTRAN.  It differs in that information flow is one-way.  Variable values can be passed from the main program to the function, procedure or module.  However, if thefunction, procedure or module changes the value of a variable in COMMON, the change will not be seen in the main program..

The $COMMON statement must directly follow the FUNCTION or PROCEDURE declaration on a line by itself.  Variables appearing in the $COMMON statement are separated with commas, as in the following example.

FUNCTION  TESTCOMMON(X)

$COMMON B,C,D {variables B,C, and D are from the main program}

       TESTCOMMON:=X+B+C+D

 END

 B=4;  C=5;  D=6

 G=TESTCOMMON(3)

$COMMON should only be used with functions, procedures, and modules appearing in the Equations window.  It should not be used with library functions.  Note that Array Range Notation (e.g., X[1..5] can be used in the $COMMON directive.


$Arrays ON/OFF

EES provides an option in the Preferences dialog to display array variables, e.g., X[5], in a separate Arrays window, rather than in the Solution window.  This option and other preferences are not saved with a EES program but rather with the user preferences.  In some situations, it is desirable for the EES program to control whether the Arrays window is used or not used.  This can be done simply with the following directives which are placed in the Equations window.

$Arrays On

will ensure that array variables are displayed in the Arrays window.

$Arrays Off

will place array variables in the Solution window.


$Bookmark

In EES programs having many equations, it is convenient to be able to quickly jump to particular locations in the Equations and Formatted Equations windows.  The $Bookmark directive provides this capability.  The format of the $Bookmark directive is

$Bookmark Name

The $Bookmark directive must be on a line by itself with the $ character in the first column.  Name is any name that you wish to associate with the text that follows the $Bookmark directive.  The Name that you supply will be sorted in alphabetical order and placed in the lower section of the Search menu and in the popup menu that appears when you press the right mouse button within the Equations or Formatted Equations window.  Selecting the Name from either of these menus will adjust the vertical scrolling of the Equations or Formatted Equations window so that the information following the selected $Bookmark directive appears near the top of the window.


$Warnings ON/OFF

EES provides an option in the Preferences dialog to display warning messages, should any occur.  Warnings can occur for a variety of reasons.  For example, a warning may be generated by a property correlation if is used beyond its range of applicability.  A warning if generated if the equations that have been solved appear to be singular.  A user-generated warning message can be displayed with the WARNING procedure.

If the option to display warning messages is enabled and warnings have occurred, EES will display an alert message indicating that the warnings have occurred and give the user the option of viewing the messages.  If the option to display warning message is disabled, the warnings and the alert will not be available.  An exception to this behavior occurs for warnings generated by the WARNING procedure which are always displayed, no matter what the user's setting for warning messages.

In some situations, it is necessary to ensure that the warnings are set as you expect, particularily for Distributable programs.  In this case, it is convenient to use the $Warning directive, which overrides the setting in the Preferences dialog.

For example, EES approximates the subcooled properties of many fluids by assuming them to be incompressible.  Ordinarily this approximation provides excellent results, but EES will issue a warning in any case if the Show Warnings option is selected in the Preferences dialog.  To overide this setting, place the directive

$Warnings Off

in the Equations Window.

To ensure that warnings are always on, use

$Warnings On


$Complex ON/OFF

EES provides an option in the Complex tab of the Preferences dialog to enable or disable complex algebra.  This directive provides a means of setting the option for complex numbers in the Equations Window.  To allow complex algebra, enter

$Complex On

To disable it, enter

$Complex Off


$OpenLookup/$SaveLookup (Professional version)

The $OPENLOOKUP directive (available in the Professional version) opens a file having the specified name and reads that file into the Lookup Table.  The file can be have .CSV, .TXT or .LKT Lookup file format.  The filename should include the filename extension.  The filename may be a string constant (enclosed within single quotes) or a string variable that has been previously assigned to the filename, as in the following examples.

$OPENLOOKUP 'C:\EES32\myTable.lkt'

{File$ has been previously set to a valid lookup file name}

$OPENLOOKUP FILE$

When EES encounters this directive, it will first check to see if it has already opened a Lookup table with this filename.  If the Lookup table has already been opened and the time/date information for the disk file has not changed, no action will be taken.  Otherwise the table will be read.

If a single question mark (?) is provided as a file name, EES will present a Windows open file dialog and use then substitute the selected file name for the ? after opening the file.  If two question marks are provided, EES will open the selected file, but not make the substitution so that the open file dialog is presented during every execution.

The $OpenLookup directive can have an optional second parameter which must be a string variable name.  The name of the Lookup file that is opened is assigned to this variable.  For example:

$OpenLookup ?? myLookupFile$

will bring up a standard file input dialog from which the file name can be selected.  That Lookup file will be opened and copied into the Lookup Table and the string variable myLookupFile$ will be set to the name of the file.

The $SAVELOOKUP directive will save a specified Lookup table into a disk file after calculations are completed.  The format is:

$SAVELOOKUP 'LookupTableName'   'C:\EES32\myTable.lkt'

'LookupTableName' is the name of the Lookup Table (as seen on the tabs in the Lookup Table Window) that is to be saved.  'LookupTableName can be a string constant contained in single quotes or a string variable.  The last parameter is the name of the file.  This name must be a string constant, a string variable that has been set to a valid file name or a ? or ??.  If a ? is provided, EES will display a standard save file dialog from which the name of the file can be selected.  That file name will then overwrite the ? so that the save file dialog does not reappear>  For example,

$SAVELOOKUP 'LookupTableName'   ?

will save the data in the lookup table name 'LookupTableName' into a  file that is selected from the save file dialog.  The ? will be overwritten with the selected filename.  If ?? is provided, it will not be overwritten and the save file dialog will appear after every calculation.

Lookup tables are automatically saved and opened when an EES file is saved and opened.  It is not necessary to use the $OPENLOOKUP and $SAVELOOKUP directives for this purpose.  The directives are useful for chaining EES programs, i.e., when the an EES program writes information into the Lookup Table using the Lookup command in a function or procedure so that a following EES program can use that information.

The Lookup command can be used to save calculated results in the Lookup Table.  Several EES programs can be chained in sequential operation by saving the Lookup table as a Lookup file in one EES program and loading that Lookup file in the next EES program.  Link buttons on the Diagram window facilitate the chaining process.

Directives


$IntegralTable

The $IntegralTable directive is used in conjunction with the equation-based Integral function.  The equation-based Integral function does not employ the Parametric table to specify the values of the integration variable, as does the table-based Integral function.  Rather, the lower and upper limits and optionally, the step size of the integration variable is specified as arguments within the Integral function, e.g.,

F = INTEGRAL(Integrand, VarName, LowerLimit, UpperLimit, StepSize)  {StepSize is optional}

Normally, EES does not keep intermediate values of any variable used during the numerical integration.  Such information is needed if you with to know the trajectory or path of variables as well as their values at a specified time.  The $IntegralTable directive instructs EES to store the intermediate values in an Integral Table.  The values can then can be plotted, printed, or copied to another application.

The format of the $IntegralTable directive is:

$IntegralTable t:0.1,  x,y,z

where

t is the integration variable.  It of course can have any legal EES variable name.  t is used here as an example.  This variable must appear in one or more equation-based Integral functions within the Equations window.  The first column in the Integral Table will hold values of this variable.

The colon and number (or variable name) following the integration variable are optional.   If a number is supplied, this number will be taken to be the output step size and integration variables will be reported in the Integral Table at the specified step size.  The step size may be a variable name, rather than a number, provided that the variable has been set to a constant value preceding the $IntegralTable directive.  If a step size is not specified, EES will select a step size.  Note that the step size used to report integration results is totally independent of the step size of used in the numerical integration.  If the numerical integration step size and output step size are not factors, linear regression will be used to determine the integrated quantities at the specified steps.

x, y, z ... are variables in the EES program.  Algebraic equations involving variables are not accepted.  A separate column will be created in the Integral Table for each specified variable.  Array range notation, e.g., X[1..5] can be used.  The variables must be separated by a space or list delimiter (comma or semicolon)

When calculations are initiated, EES will first check to ensure that all variables in the $IntegralTable command are used in the equations.  If no errors are found, an Integral Table will be created and filled with intermediate values results from the numerical integration.  Values from this table can then be plotted, printed, and copied, in exactly the same manner as for other tables.  When the $IntegralTable directive is used with the Solve Table command, an Integral Table is produced for each run (i.e., row) of the Parametric Table.  Only one Integral Table can be viewed at one time. The run number control in the upper left cell of the Integral Table indicates the Parametric Table run number for which data are currently displayed.  This run number may be changed by clicking on the up/down arrows or by directly entering the run number.  The data in the table will be automatically updated when the run number is changed.

The Integral Table is NOT saved with when the EES file is saved.  The table can be restored by repeating the calculation.  If an Integral Table exists when calculations are initiated, it will be deleted if a new Integral Table is created.

A short program illustrating the application of the $IntegralTable directive appears below.

______________________________________________________________________

"This program demonstrates the use of the Integral function.  Here it is used to

calculate the velocity and position of a freely falling object, subject to aerodynamic

drag.

This example illustrates

1.  The use of the Integral Function to solve coupled differential equations

2.  The use of the Convert Function.

3.  The use of the $IntegralTable directive to store intermediate results during numerical integration

The following directive instructs EES to store values of v (velocity)  and z (elevation) as a function of t (time)

at increments of 0.2 sec.

"

$integraltable t:0.2,  v,z

F=M*g*Convert(lbm-ft/s^2,lbf)  "Newton's Law - the Convert function replaces g_c"

M*a*Convert(lbm-ft/s^2,lbf)=F-F_d "force balance"

Area=1 "[ft^2] cross-sectional area"

F_d=C_d*Area*(1/2*rho*v^2)*Convert(lbm-ft/s^2,lbf) "definition of drag coefficient"

C_d=0.2 "drag coefficient"

M=1.0 "[lbm] mass of object"

rho=density(Air,T=70,P=14.7)  "density of air"

g=32.17 "[ft/s^2]  gravitational acceleration"

v_0=0 "[ft/s]";  z_0=0 "[ft]"

v=v_0+integral(a,t,0,5) "velocity as a function of t between 0 and 5 seconds"

z=z_0+integral(v,t,0,5)  "vertical position as a function of t between 0 and 5 seconds"


$UnitSystem

The unit system is needed only when the built-in thermophysical (e.g., enthalpy) or trigonometric (e.g., sine) functions are used.  Normally, the unit system is specified with the Unit System menu command.  However, the unit system can also be specified with the $UnitSystem directive which has the following format:

$UnitSystem SI[or ENG]  MASS[or MOLE]  DEG[or RAD]  KPA[or PA or MPA or BAR or PSIA or ATM] C[or F] K[or R] J[or KJ]

The unit specifications can be made in any order and only those which are to be changed need to be provided.

Note it is not possible to specify a mixed unit system.  That is, if the unit system is SI, specifying F for the temperature will result in temperature units of C, not F.  Similarly specifying psia for pressure will result in pressure units of kPa.  The J and KJ specifications are only recognized for SI units.

Since the unit system specifications are saved with an EES file, there is no need to provide a $UnitSystem directive in an EES file.  However, the unit system is not saved with text files that may be read into EES, possibly under the control of a macro command file.  In this case, the $UnitSystem directive may be need to ensure that the unit system is configured as needed.

See also:  $IF/IFNOT directive

    UnitSystem function


$Import

The $Import directive provides a simple way of reading selected variables from an ASCII file.  The data could be provided from a file written using the $Export directive or another application. The combination of $Export and $Import directives provides a convenient way to transfer information from one EES program to another or to itself.

The format of the $Import Directive is

$Import  'FileName', Var1, Var2, X[1..5], S$...

FileName can be either a string constant (within single quotes) or a string variable containing the name of the file that the values will be read from.  If FileName is specified to be 'CLIPBOARD', the values of the variables will be read from the clipboard in text format.

Var1, Var2, X[1..5] represent variables that are used in your EES program.  Note that array range notation is supported as are string variables.

The $Import directive can be placed anywhere in the Equations Window.  Multiple $Import directives are permitted, and they will be evaluated in the order that they occur in the Equations Window.

Example:  File text.csv contains the following data:

1.2,  3.4  5

'string 1'  'string 2'  6

$Import 'text.csv'  X[1..3], A$, B$, C

After solving, variables X[1], X[2], X[3], A$, B$, and C will be set to the values in the file.

One possible application of the $Import and $Export directive occurs for 'harmonic steady-state' problems in which it is necessary to initialize variables at time zero to the values they have at some final time.  The values of these variables would be determined by solving one or more differential equations.  Use the $Export directive to write the final values to the clipboard.  Use the $Import directive to read the initial values from the clipboard.  Repeated executions should identify the harmonic steady-state if the problem converges with this successive substitution strategy.

Also see the $Export directive.


$Export

The $Export directive provides a simple way of writing selected variables to an ASCII file.  This file can then be read by a $Import directive, the Open Lookup Table command in EES or by another application, such as a spreadsheet program.  If the filename extension is .CSV (comma-separated values), the data will be written as a CSV ASCII text file that is easily recognized by spreadsheet applications and by the $Import directive.  In this format, each value is separated by a list separator character.  If the filename extension is .TXT, EES will assume that the data should be written with header information in the EES Lookup file format that can be read directly by the Open Lookup Table command.  The header information will include the name of the variable, its units, and its display format.

The format of the $Export Directive is

$Export /A /T 'FileName', Var1, Var2, X[1..5], ...

The /A is optional.  If present, it indicates that the values should be appended to the existing file, if it exists.

The /T is optional.  Normally, results are exported for each run in the Parametric table.  If the /T is present, only the results for the last run in the Parametric table will be exported.  This option is ignored if the calculations do not involve the Parametric table.

FileName can be either a string constant (within single quotes) or a string variable containing the name of the file that the values will be written to.  If filename is specified to be 'CLIPBOARD', the output will be placed as delimited text on the clipboard.  A maximum of 65,000 characters can be written to the clipboard.

Var1, Var2, X[1..5] represent variables that are used in the main section (not in a Module) of your EES program.  Note that array range notation is supported.

The $Export directive can be placed anywhere in the Equations Window.  Multiple $Export directives are permitted, and they will be evaluated in the order that they occur in the Equations Window.

The Lookup command can be used to write (as well as read) values in the Lookup Table.  Saving the Lookup table as a .CSV file also provides export capability, but the $Export/$Import directives are much more convenient for this purpose.

Example:

T$='C:\temp\junk.csv'

A=5

B=A^2

C=A^3

$Export T$ A,B,C

$Export 'CLIPBOARD' A,B,C

After solving, file C:\temp\junk.csv will be written with the values

5.00000000E+00,2.50000000E+01,1.25000000E+02

These values will also be placed on the clipboard from which they can be pasted into any application.

See also:  $Import directive


$INCLUDE

The $INCLUDE directive provides an automatic method for loading a library file,  an ASCII text file containing EES equations, or a .VAR file that holds variable information.   The The format is:

$INCLUDE FILENAME

FILENAME is any DOS filename and it must include the filename extension which can be: .TXT, .LIB, .FDL, .DLF, or .DLP.  The filename should also include the complete path name, e.g., C:\EESW\myDefn.TXT.  However, if a path name is not provided, EES will look in the current directory.  If EES is unable to find the file, it will provide the opportunity to browse so that you can locate it.  The $INCLUDE statement must be on a line by itself, starting in column 1.  It is best to place the $INCLUDE directives at the top of the Equations Window to ensure that the directive is processed before compilation of the equations is initiated.

.TXT Files

If the filename extension is .TXT, EES expects FILENAME to be an ASCII text file containing EES equations (without errors).  EES will include these equations with others in the Equations window during compilation.  However, the equations and the variables associated with these equations will be hidden.  Nested use of the $INCLUDE directive is not supported so that the text file must not contain any $INCLUDE statements.

Equations can also be entered from a file with the Merge command in the File menu.  The difference between the Merge command and the $INCLUDE directive is that equations entered with the Merge command are placed directly into the Equations window as if they were typed and they remain visible.  The text entered with the $INCLUDE directive will be hidden.

Note that the Equations window has a limit of 128 kBytes of text.  Further, the speed of editing is reduced as the size of the text in the Equations window increases.  Use of the $INCLUDE directive can eliminate these problems.

Library Files

If the filename extension is .LIB, .FDL, .DLF, or .DLP, EES will expect the file to be a library file of a type corresponding to the filename extension.   EES internal functions and procedures are recognized with the .LIB extension, whereas external functions use a .DLF extension and external procedures use either the .FDL or .DLP extension.  EES will automatically load the referenced library file if it is not already loaded.  Note that library files can also be loaded automatically when EES is started by placing them in the USERLIB subdirectory or by applying the Load Library command.

.VAR Files

If the filename extension is .VAR, EES will expect the file to be a .VAR (Variable information) file that is written with the Save Inputs button in a Diagram Window or with the Save option in the Variable Information dialog in the Professional version of EES.

.PRF Files

If the filename extension is .PRF, EES will expect the file to be a .PRF (EES Preferences) file.  A .PRF file holds default values of units settings selected in the Unit System dialog, stop criteria and integration tolerances specfied in the Tolerances dialog, default variable information, and all of the information in the Preferences dialog.   .PRF files are created when the Store button in clicked in the Unit System, Tolerances, and Preferences dialogs.  A  .PRF fils can be loaded with the Load button in the Preferences dialog or with a $INCLUDE directive.

.UNT Files

If the filename extension is .UNT, EES will expect the file to be a Units List file that holds units strings.  Units List files can be created with a text editor or with the Units List dialog.


$IF and $IFNOT

The $IF and $IFNOT directives allow conditional exclusion of EES equations that are entered in the Equations window.

The format of these directive is

$IF Condition

...

...

$ELSE

...

...

$ENDIF

These directives test the condition that follows the $IF/IFNOT keyword.  If the condition is true (for the $IF directive) or not true (for the $IFNOT directive), the equations that follow the $IF/IFNOT directive up to the $ELSE (if present) or the $ENDIF keyword are compiled and included with other equations in the EES Equations window.  If the condition is false, the equations are ignored.  Multiple $IF/IFNOT directives can be used and they may be nested.

Recognized condition keywords are:

MIN/MAX

This condition is true if calculations have been initiated with the Min/Max or Min/Max Table commands.

PARAMETRICTABLE

This condition returns true if calculations have been initiated with the Solve Table, Min/Max Table or Uncertainty Propagation Table commands.  It otherwise returns false.

PARAMETRICTABLE='Table Name'

The condition returns true if calculations initiated with the Solve Table, Min/Max Table or Uncertainty Propagation Table commands are applied to the Parametric Table named 'Table Name'.   The table name should be a string constant enclosed in single quotes.  String variable names are not accepted.

TABLERUN#=Value

The condition returns true if calculations are initiated with the Solve Table, Min/Max Table or Uncertainty Propagation Table commands and the run (or row) in the Parametric Table that is currently being solved is equal to Value.  Value must be an integer number.  When this directive is used, EES must recompile the equations in the Equations window after every run in the Parametric Table, so the calculation speed is reduced.

DIAGRAMWINDOW

This condition is true if the main Diagram Window is displayed on the screen.  In this case, any input variables that are defined in the Diagram Window will be used while compiling the equations.  If the Diagram Window is hidden (by selecting the close button at the upper right corner of the window), any input variables defined in the Diagram window are ignored and the DIAGRAMWINDOW condition is false.

UNITSYSTEM('XX')

 'XX' can be any of the following unit specifications:  'SI', 'Eng', 'Mass', 'Molar', 'Deg', 'Rad', 'kPa', 'bar', 'psia', 'atm', 'C', 'K', 'F', 'R', 'Pa', 'MPa', and 'KJ'

The UNITSYSTEM condition returns true if the unit specification provided as the argument with the UNITSYSTEM condition is selected in the Unit System dialog.

StringVariable$='String constant'

StringVariable$ is any EES string variable that is defined before the $IF directive.  The string variable can be defined in the Equations window or in the Diagram window. The text to the right of the equal sign is a string constant.  Single quotes around the string constant are optional.  Upper and lower case letters are not distinguished when testing equivalence between a string variable and string constant.  A dropdown list of strings is the most convenient means of setting a string variable in the Diagram window

A common use of this directive is to set variables that are used with the Solve command but not with the Solve Table command.

Examples:

The following example tests to see if calculation are being run for a Parametric Table.  If not, the value of Row is set to 1.  Presumably, Row would be set to a value in the Parametric Table.  The use of this directive in this way eliminates the need to comment out the Row=1 equation when the Parametric table is being solved.

$IFNOT  ParametricTable

   Row=1	{This equation is used only if a Parametric Table is not used}

$endif

x=Row^2

$IF UNITSYSTEM('F')

TR=(T-32)/1.8  {This equation converts the temperature from F to C}

$ELSE

TR=T

$ENDIF

X$='abc'

$IF X$='abc

    y=3 {This equation is executed only if X$='abc'}

$ELSE

    y=5

$ENDIF


$LocalVariables ON/OFF

This directive controls whether the values of local variables used in Functions Procedures, Modules and Subprograms will be displayed in the Solution and Residuals windows.  If ON, the local values of all Functions, Procedures, Modules, and Subprograms that appear in the Equations window will be displayed after a calculation in the Solution window.  (Functions, Procedures, Modules and/or Subprograms that have been loaded from a library file will not be displayed.)  This directive overrides the Show function/procedure/module value setting in the Options tab of the Preferences dialog.

EES only checks the first 5 letters of this keyword, so it is acceptable to use $LOCAL ON/OFF


$CheckUnits ON/OFF and AutoOn/AutoOff

The CHECKUNITS directive controls whether the unit checking algorithms will be applied to the equations that follow.  The format of this directive is

$CHECKUNITS On/Off/AutoOn/AutoOff

 Like other directives, $CHECKUNITS should be on a line by itself.

By default, unit checking is on  for all equations.  When EES encounters a $CHECKUNITS Off directive, equations that follow will not be subject to unit checking.  $CHECKUNITS On restores the unit checking to the equations that follow.  For example, the following CHECKUNITS directives would eliminate the unit checking warning that would normally occur because the units of the constant 3 are not specified

$CHECKUNITS Off

Y=2 [m]

X=3 + 4*Y + 5*Y^2

$CHECKUNITS On

Automatic unit checking is controlled with the Check Units Automatically option is set in the General Tab of the Preferences dialog.   When automatic unit checking is enabled, the unit consistency of all equations will be checked each time the Solve or Solve Table command is applied.  The results of the unit checking will be summarized in the Equations window. Also, when automatic unit checking is on, the Residuals window will display a Units column indicating OK, ? or X for the status of the unit checking of each equation.  OK indicates that the units appear to be correct.  ? indicates a problem was found.  X indicates that the equation was not checked for unit consistency.  The X will appear if the equation follows a $CHECKUNITS Off directive or if the unit checking was disabled for this equation by right-clicking on it in the Residuals window.

$CHECKUNITS AutoOn/AutoOff overrides the setting in the Preferences dialog.  To ensure that automatic unit checking is on, place the following directive at the top of the EES file.

$CHECKUNITS AutoOn


$Private

Library files can contain EES Functions, Procedures, Modules and/or Subprograms.  These library files can be loaded manually with the Load Library command or automatically by placing the library file in the USERLIB folder.

The name of each Function, Procedure, Module, and Subprogram in the loaded library files can normally be seen with the Function Information dialog by selecting the EES library routines radio button.  Help information, if available, can be accessed for the routine and the EES code can be viewed.  However, in some cases, you do not want a routine to be displayed in the Function Information listing.  It may be intended for private use or to only support other routines or perhaps you just don't want others to view the code.  Including the $Private directive will remove the routine from the Function Info display.

For example, if the following two functions were saved in a .lib file and saved in the USERLIB folder, only the SSQ function would be seen from the Function Info dialog.

Function MyFunc(X,Y)

$Private

   MyFunc:=sqrt(X^2+Y^2)

end

Function SSQ(X,Y)

{$SSQ

 SSQ returns the square root of the sum of the squares of its two arguments}

   g=MyFunc(X,Y)

   SSQ:=g

end


$SumRow ON/OFF

EES provides an option in the Preferences dialog to display a sum row in the Parametric table.  This option and other preferences are not saved with a EES program but rather with the user preferences.  In some situations, it is desirable for the EES program to control whether the sum row is to be used.  This can be done simply with the following directives which are placed in the Equations window.

$SumRow On

will ensure that sum row in the Parametric table is visible.

$SumRow Off

will ensure that the sum row is hidden, overriding the setting in the Preferences window.


$Reference

The $REFERENCE directive allows the default reference state for a specified fluid to be changed.  The format for this directive is

$REFERENCE Fluid ReferenceID

where

Fluid is the name of the fluid, e.g., R134a.

ReferenceID is one of the following:

DFT - 	the reference is reset to the default value.  See the fluid property information for the specified fluid to determine the default reference state

NBP -	the values of specific enthalpy and specific entropy are each set to 0 for saturated liquid at the normal boiling point.  Note that this option is not applicable to fluids for which the critical pressure is less than one atmosphere.  In this case, the reference will be reset to the default value.

ASH -	the values of specific enthalpy and specific entropy are each set to 0 for saturated liquid at -40°C (-40°F). This is the ASHRAE standard reference.   Note that this option is not applicable to fluids for which the critical temperature is less than -40°C.  In this case, the reference will be reset to the default value.

IIR -	the value of specific enthalpy is set to 200 kJ/kg and the value of specific entropy is set to 1.0 kJ/kg-K for saturated liquid at 0°C (273.15 K). This is the standard reference state for the International Institute of Referigeration.   Note that this option is not applicable to fluids for which the critical temperature is less than 0°C.  In this case, the reference will be reset to the default value.

See also: Property Plots


Arrays
Arrays (WINDOWS menu)

EES allows the use of array variables.  EES array variables have the array index in square brackets, e.g., X[5] and Y[6,2].  In most ways, array variables are just like ordinary variables.  Each array variable has its own guess value, lower and upper bounds and display format.  However, simple arithmetic operations are supported for array indices so that the use of array variables can be more convenient in some problems.  The Insert/Modify Array command provides an easy way to enter the values of an array.  A detailed discussion of the use of array variables appears in Chapter 7 of the manual.  Array range notation can be used to simplify passing of array variables to functions and procedures.

The index value of an array can be any one of the following:

  i)   a numerical quantity or expression

  ii)  an EES variable that has been set to a value ahead of the statement with the array reference

  iii) an EES variable that is set to a value in the Parametric table

  iv)  the TableRun# keyword.

The values of all variables including array variables are normally displayed in the Solution window after calculations are completed.  However, array variables may optionally be displayed in a separate Arrays window, rather than in the Solution window.  This option is controlled with the  Use Arrays window check box in the Preferences dialog of the Options menu.  If this option is selected, the Arrays window will automatically be produced after calculations are completed showing all array values used in the problem in alphabetical order with the array index value in the first column.

The values in the Arrays window may be plotted using the New Plot Window or Overlay Plot command in the Plot menu.  Part or all of the data in the Arrays window can be copied to another application by selecting the data followed by the Copy command in the Edit menu.  Data in the table can be copied in the same manner as for the Parametric table.  If you wish to include the column name and units along with the numerical information in each column, hold the Shift key down while issuing the Copy command.

The numerical format of the values in any column of the Arrays window can be changed by clicking the right mouse button on the array name at the top of the column.  The Format Table Column dialog window will appear in which the display type, number of digits, units and column number can be changed.

The array name and all array characteristics (e.g., guess value, bounds, display format, and units) can be changed or viewed in the Variable Information dialog window.  If the Show Array Elements checkbox in the Variable Info dialog is de-selected, then only the parent names of the arrays, e.g., X[ ] are shown.  Any changes made to the parent array are applied to all elements in the array.


Integral Table

An Integral Table is automatically generated during calculations when one or more equation-based Integral functions are in use and the $IntegralTable directive is supplied.  The Integral Table holds intermediate values of specified variables that occur during the numerical integration process.  The values in this table can be plotted using the New Plot Window and Overlay Plot commands.  The values can also be printed or copied in the same manner as for data in the Parametric table.

When the $IntegralTable directive is used with the Solve Table command, an Integral Table is produced for each run (i.e., row) of the Parametric Table.  All of these Integral tables appear in the Integral Table window and a set of tabs is provided at the top of the window to facilitate access to any one of the tables.

Use the IntegralValue function to retrieve defined values from the Integral table.

The Integral Table is NOT saved with EES problem information.  It can be restored by repeating the calculations.

See the $IntegralTable directive for more information.


$Tabwidth

The $TABWIDTH directive is now called the $TABSTOPS directive.  Both directive keywords are accepted.


$Tabstops

The $TABSTOPS directive sets tab stops that used in the Equations window.  One to five tab stops may be set with this directive.  The format of this directive is

$TABSTOPS   TabStop1 TabStop2 ... TabStop5  Units

where 	TabStop1 through 5 must be numerical values, separated by one or more spaces or list delimeters.  The tab stop values should be entered in increasing numerical order.

Units must be either in or cm.  If no units are specified, in is assumed if the Unit System is set to English units and cm is assumed for SI units.

Example:

$TABSTOPS   0.5   2  3 in

will set the tabstops at 0.5, 2 and 3 inches.

Tabstops can also be set in the Equations tab of the Preferences dialog.  However, if a $TABSTOPS directive appears in the Equations window, the setting made with this directive override the default settings appearing in the Preferences dialog.

In earlier versions, tab spacing was set with the $TABWIDTH directive.  This directive is still accepted but it is assumed to have the same format as the $TABSTOPS directive.


File Menu

The File menu holds commands for opening, saving, and printing EES files. Press Alt-F to access this menu with keystrokes.  The File Menu commands are:

New

Open

Merge

Save

Save As

Print

Printer Setup

Load Library

Load Textbook

Make Distributable Program

Open or Create Macro

Create LaTeX/PDF Report

Exit

Recent Files (optional)


Open
Open (FILE Menu)

The Open command will allow you to access and continue working on any file previously saved with the Save or Save As commands.  EES recognizes EES File and Import File formats.  EES files have a .EES filename extension whereas Import files have an .XPT file extension.  The format is selected with the radio button controls at the bottom right of the File Open dialog window.  The EES file format is the default and it should be used at all times except when you are importing an EES file saved by EES from a different operating system, e.g., the Macintosh version.  Select the file you wish to open by clicking on its name or by using the Tab key to move to the list and the up and down arrow keys to move within the list.  You can also open text files which have a .TXT extension.  In this case, however, EES assumes that the file contains text information which you wish to read into the Equations window.

After opening a file, EES will next attempt to compile the equations appearing in the Equations window.  You can prevent the compilation, if you wish, by holding down the Ctrl key when selecting the Open command and keeping it depressed until the file is completely read.


New
New (FILE Menu)

New initiates a new work session.  All variables, tables, and plots will be cleared and EES will be reconfigured to its default settings.  If an unsaved problem exists, you will be prompted to save the file with as is done with the Save As command.


Merge
Merge (FILE Menu)

Merge allows the equations in another .EES file or the text in a .TXT file to be merged into the existing Equations Window at the cursor position.  Merging allows equations which you have entered previously to be reused. For example, you may define your own set of functions and merge them at the top of every problem without having to retype them. The Merge command differs from the Open command in that Merge will leave the existing equations intact and not affect the tables and variable information.  The Merge command also differs from the $INCLUDE directive in that the merged equations will be placed into the Equations window and will be visible thereafter.


Save As
Save As (FILE Menu)

Save will save all information relating to the problem session in a disk file.  A dialog will appear in which you specify the drive, directory [optional] and a filename.  EES appends .EES to the file name.  You normally need not provide the .EES extension.

EES supports several different file types which can be selected from the 'Save as type' list box.  The Export file type will append an .XPT extension to a file name.  Files saved with the .XPT extension are saved in a generic manner which allows then to be read by EES operating on any computer type.  This file format requires more space and is processed more slowly than the conventional format with the .EES extension; it should be used only when you wish to convert the file for use with EES on Macintosh.  The Text file type will append a .TXT filename extension.  In this case, only the text in the Equations Window will be saved in a standard ASCII file.

The Library type appends a .lib filename extension.  If a file is saved as a library file with a .Lib filename extension in the USERLIB\ subdirectory, the functions and procedures in that file will be automatically read in when EES is started.   Library files can also be read using the Load Library command or the $INCLUDE directive.  See Library files for additional information.

EES normally saves every variable defined during the work session regardless of whether or not it currently is in use when the Save or Save As command is issued.  For example, if you define a variable X with the equation X=6 and later decide that the equation should read X1=6, EES will still keep the variable X and all of its characteristics in memory, e.g., guess value, bounds, units, and format. The commercial version of EES can store up to 6000 variables.  The Professional version allows many more variables.  For very large problems, particularly problems using array variables, EES could run out of space.  In cases when there are many variables that are not in use, EES will display a check box in the Save As dialog with the caption "Purge XXX Unused Variables" .To save only those variables which are currently in use, click this checkbox.  When purging variables, it is advisable to save the file with a new name.  In this case, the original file can be recovered if a problem develops.  Note:  The unused variables are not purged until you open the file that you saves.

EES version 6 uses a file structure that is different from earlier versions.  That means older EES programs can not read files saved with version 6.  However, a checkbox is provided in the Save As dialog to store the file in the older format.  In this case, only the first Parametric Table, the first Lookup Table and no more than 10 plot windows will be saved, as these limits were in effect for earlier versions of EES.  The file format for EES files changes from time to time.  If you need to send an EES file to someone who has an earlier version of EES, click the Save in Older Format checkbox to ensure that they willl be able to read your file.


Save
Save (FILE Menu)

Save will save all information relating to the problem session in an .EES file on the disk using the file name which was last used.  The problem information can be later restored with the Open command.  Use the Save As command to save the problem information with a different name.

An autosave file option is provided with a control in the Options tab of the Preferences dialog.  If the autosave option is selected, EES will automatically save your file at a specified time interval with the same filename used in the Save (or Save A)s command, except that a tilde (~) is prepended to the filename.   Under normal operation, the autosave file is deleted at the end of the worksession, so do not depend upon it for permanent storage.  You should always save any file that you intend to use at a later time using the Save or Save As commands. However, if EES quits unexpectedly, the last saved copy of the backup file should still be available.

For additional file safety, EES will first check during a file save operation to see if a file with the name provided for the Save operation already exists.  If the file does exist (and it is more recent than the backup produced by the autosave option) EES will rename this file by adding a tilde (~) to the file name.   EES will delete this backup file if the Save operation is successful.  However, if any problems are encountered during the Save operation, the backup file having a name beginning with a tilde should still be available.

A check mark will appear to the left of the word Save in the File menu if the current problem information has been saved on disk.  The current file name follows the word Save in the File menu.  Any change in the problem information will cause the check mark to disappear.


Print
Print (FILE Menu)

Each EES window relating to the current problem will be displayed in the Print dialog window with a check box preceding its name.  If an X appears in the box, the information in the corresponding window will be printed.  By default, windows which are currently visible will be checked when the Print dialog window first appears.  To change a selection, click the mouse button in the check box or use the arrow keys to move the cursor to the check box and press the space bar.

If the Diagram Window check box is selected and there are child diagram windows, a small dialog window will appear allowing the user to select the diagram windows which are to be printed.  The Lookup Table/Files check box operates in a similar manner when there are one or more Lookup files are in use.  In this case, selecting the Lookup Table/Files check box will cause the Select Lookup files dialog will appear in which you can specify which Lookup files you wish to print.  Note that, for either of these check boxes, it is necessary to unselect the check box and then reselect it in order to change the items that are to be printed.

Note that printing options, such the font, font size and line spacing can be selected under the printer tab in the Preferences dialog window.

EES will print all of the pages for the selected windows if the All radio button in the Page Range box is selected.  Alternatively, selected pages can be printed by clicking the Pages radio button and entering the pages that are to be printed in the edit box.  A range of pages is specified by using a hyphen (or minus sign), e.g., 2-5.  Use a comma or space to separate items.  For example, entering 2, 4, 5-8 will result in the printing of pages 2, 4 and 5 through 8.

A control is provided for printing multiple copies.  One copy is selected by default.

If the Page Breaks control is set, each window will be printed on a separate page.

If the Print in Color control is selected, EES will attempt to print selected windows using the same colors as appear on the screen.   For example, the colors of Type 1 and Type 2 comments are controlled with setting in the General Display Tab of the Preferences dialog.  Colored text may not print clearly on some black and white printers.  When this control is deselected, all text will be printed in black.

Pressing the Preview button will display an approximate rendering of each page on the screen. Pressing the Print button will direct the output to the selected Windows printing device.  The printing device can be changed using the Printers program in the Control Panel.  Alternatively, the Printer Setup command in the EES File menu can be used to change the printer or to change printer characteristics, such as portrait or landscape paper orientation.

To print a selected range of the Equations window, Parametric table, Lookup table, Arrays table, or Integral table, select the range and press the right mouse button.  A pop-up menu will appear containing a Print Selected menu item.  The output will be directed to the default printer with the options that have been set previously with the Printer Setup command.

See also:  Create LaTeX/PDF Report


Select Lookup Files

Tabular data can be accessed with the Lookup  command from the Lookup Table, or from Lookup files stored on the disk.  The Lookup files in use can be printed, along with other problem information.  To print a Lookup file, select the file by clicking on the file name in the list box.


Printer Setup
Printer Setup (FILE Menu)

The Printer Setup command displays the Windows printer driver dialog window for the default printing device.  Choose the default printing device in the Control Panel of the Main window.   The dialog window allows options specific to the printer type to be controlled.  Note that this command allows you to select portrait or landscape paper orientation.


Load Library
Load Library (FILE Menu)

An especially powerful feature of EES is that the user can supply functions and procedures which operate just like the built-in functions.  These user-supplied routines can be written in EES and saved as Library files.  External Functions and External Procedures written in a high level language and linked with EES.

When EES starts, it will preload all of the library and externally compiled files which are found in the EES USERLIB\ subdirectory unless directed otherwise by the Library Manager.  In addition, you can have EES automatically load a library file by using the $INCLUDE directive or you can manually load any library or externally compiled file from any directory at any time with the Load Library command.

Load Library will bring up the Windows Open File dialog.  Select the file type (library file, external function, external procedure, FORTRAN file) by clicking in the file type selection list.  This action will display all files of the selected file type in the current directory.  Click on the file you wish to load.  Once loaded the library and external files remain in memory until EES is closed.


Make Distributable Program (Professional version)

This command will create a special purpose version of EES which can run up to 10 preselected problems.  EES, the problems, and all supporting files are placed in a single executable file which can be freely distributed to others.  They do not need to own EES to run the calculations or create/change/view the plots and tables.

The Diagram Window provides a convenient way of employing the distributable program capability.  You can create an EES file with selected input and output variables displayed on the Diagram Window with the Add Diagram Text command.  You can create 'hot areas' on the Diagram window which, when clicked, cause additional (child) Diagram windows to appear.  Each child Diagram window can have a diagram, text, and input and output variables.   Users provide values for the input variables.  You can place a Calculate button on the Diagram window which initiates the Solve or Solve Table commands.  After the calculations are concluded, the calculated results are displayed in the output variables on the Diagram window.  The users need not change or view the equations in the Equations or Formatted Equations windows.  Indeed, the Make Distributable Program dialog provides an option which can prevent a user from viewing your equations, if you wish.  A Save Inputs button can be placed on the Diagram window so that the user can save the current set of inputs.

After selecting Make Distributable Program, the multi-tabbed dialog window shown above will appear.  The first tab provides an edit field for the name of the executable program you will be generating.  To be sure that you know where the generated program will be placed, you should enter the complete path and filename.  However, it is unnecessary to enter the filename extension, since .EXE will be assumed.  You can, if you wish, set an expiration date after which the distributable program will no longer function;  it will instead display a message indicating that the program has expired.   The Force US Setting checkbox, will, if checked, ensure that the decimal point is used as the decimal separator regardless of the setting on the user's computer.  You have the option to display a small window with explanatory text when this EES distributable program is started.  Click the check box if you wish to have this capability and enter the message in the edit field provided.  This message box will be accessible with the Help menu so users can read it again.

The remaining ten tabs provide information for each EES file that you wish to include with the program.  You must enter the name of the EES file in the first edit field.   Use the Browse button to make this process easier.  The EES file will be copied into the executable file that is created, so it need not be provided along with the executable.  The next edit field allows you to enter the name of a help file that will provide help information specific to this EES program.  The help file can be of three types:  an ASCII text file (*.txt), a Windows help file (*.hlp) or an HTML file (*.htm).  EES will automatically determine the file type independently of the filename extension.  The Help file will be associated with a menu item appearing in the Help menu.

Note that help files are NOT copied into the Distributable program and therefore they must be provided in separate files.  These files must be located in the same directory as the Distributable program or in a folder that resides in the same directory as the Distributable program.   The use of an Installation program or Zip file  is recommended to create a file that will install the Distributable program and the files that it requires (external libraries and help files) in the proper locations.

As noted above, the distributable program can incorporate up to ten preselected EES files.  When the distributable program is started, the first file will automatically be loaded by default.  However, any one of the ten files can be selected as the file that appears at startup by providing /# as a parameter where # is an integer between 1 and 10.  For example, entering MyDistrib.exe /2 in the Windows Run dialog will start the distributable program and display EES file 2.  The other files can be selected from the recently-accessed file list at the bottom of the File menu.  The names that appear in the File menu are entered in the third edit field for each file.  By default, the name is the filename without the path or filename extension.  However, it can be edited to be any name that you wish to see in the File menu.

The remaining items in the dialog window are a series of check boxes which control the capabilities the user will have when running the distributable version.   If you want you user to have the ability to view the equations window, click the 'Equations Window Visible' check box.  You can make this window read-only by clicking the following check box.  However, even if the user changes the equations, the changes cannot be saved with the distributable version.  The advantage of this feature is that you can freely distribute any program you generate in EES to others.

Two small buttons are provided just below the Cancel button in the Make Distributable dialog.  These buttons allow saving and loading of scripting files to simplify the process of creating distributable programs.  The button on the right saves all of the information in the Make Distributable dialog window into a file having a .MDI (Make Distributable Information) filename extension.  The other button will open *.MDI files and fill all of the field in the Make Distributable dialog window using the information in the file.


Create LaTeX/PDF Report

Overview

The purpose of this command is to generate a report including the Diagram, equations, solution, tables, and plots.  In this respect, this command is similar to the Print command.  However, the Create LaTeX/PDF Report command does not directly print but instead creates a TeX document in LaTeX2e.  The TeX document is an ASCII file with a .tex filename extension that must be processed by a LaTeX2e compiler.  LaTeX2e produces a .dvi (device independent) output file that can be viewed and printed by various utilities.  However, the PDFLaTeX accessory that is included with the TeX compiler can also produce a .pdf (portable document interface) file that can be viewed and printed with Adobe Acrobat Reader.  To make use of the output generated by this command you will need to install the LaTeX2e compiler and Adobe Acrobat Reader, if they are not already installed on your computer.  Both of these programs are available at no cost.

Setup

The recommended installation of Latex2E is MiKTeX.  The MiKTeX homepage is http://miktex.org.  EES has been tested with both MiKTeX versions 1.20e and version 2.  The following installation directions are applicable to MiKTeX version 2.1.  Download the distribution zip file in one step by either clicking on the appropriate link in the MiKTeX home page or entering the following URL into your browser program:  http://www.miktex.org/2.1/index.html.  Instructions for downloading the MikTeX files are provided on this webpage.  The downloading is facilitated by the MikTeX Setup Wizard.  Clicking on this option causes a small file to be downloaded which supervises the remaining download process.  Run the Setup.exe wizard program and select the download radio button.  Some of the downloading sites are slow so you may want to try a few.  Select the small option.  After the files have been downloaded, run the setup.exe program again and select the Install radio button.  This installation program will install MiKTeX into the directory that you specify.  EES must know the directory path of the PDFLaTeX.exe program that is provided with MiKTeX so make a note of the directory that you are installing the MiKTex package into.  To configure EES to work with the MikTeX package, start EES and select the Create LaTeX/PDF Report command from the File menu.  Click the Setup button in the PDF LaTeX box and enter the directory information for the PDFLaTeX.exe program.

Adobe Acrobat Reader can be downloaded from http://www.adobe.com/products/acrobat/readstep.html.   Select the language and operating system from the dialogs provided on this webpage and download file Adobe .exe file to a temporary directory.  Execute this file to install Adobe Acrobat Reader.  Adobe Acrobat can also be installed from the EES CD when you install EES.

Using the Report Generator

A dialog will appear after selecting the Create LaTeX/PDF Report command that provides a number of options to control the content and formatting of the report.  At the top of the dialog is an edit field for a filename.  By default, this filename is set to the name of the EES file but with a .tex filename extension.  The filename can be changed, but is should have a .tex filename extension if it is to be recognized by the pdflatex application.  The Browse button to the right of the filename should make it easy to select an alternative location for the file.

The Title field is by default filled with the EES filename and the date.  This title, which can be changed to whatever you wish, will be displayed centered at the top of report.

On the left side of the dialog are controls to select the windows that will be included in the report.  Each window is represented with a group box with one or more options.  If the group box is displayed in grayed text, the corresponding window is not available.  The title of each group box begins with a left bracket character.  If the window is to be included in the report, the character following the left bracket must be an X or a number.  Click on the group name to change the selection.  The Parametric Table, Solution,  Lookup Table and Plot windows have tabs with the possibility of accessing more than one window.  If there are multiple windows, a dialog will appear when you click on the group name to allow selection of the windows, tables or plots that are to be included in the report.  In this case, the number enclosed in the brackets in the group name is the number of windows tables or plots that are to be included.  If there is only one possibility, such as for the Equations, an X rather than a number will be enclosed within the brackets if the window is to be included.

One limitation of the LaTeX report is that it will not automatically fit the contents to the width of the paper.  For example, long equations may end up running off the right margin.  Each group box provides controls to deal with this situation.  Long equations are the major problem.  You can control this situation somewhat by modifying the equations you enter in the Equations window.  For example, a long equation can be broken into two or more shorter equations by introducing some new variables.  Also, EES allows you to break an equation so that it continues on the following line if the last character on the line is a &.  The LaTeX report will also attempt to break the equation at the & symbol, but depending on the formatting, it may produce a LaTeX error.  If you are familiar with LaTeX code, you can of course modify the .TeX file as needed.  The check boxes in the Equations group box allow multiple equations that are entered on a single line in EES to appear on separate lines in the report and comments that appear on the same line as the equation to be be placed on a separate line.  Both of these options help to reduce the long line problem.  Other tools available to deal with long lines are the font size and margins that are specified on the right side of the dialog.

If the Color checkbox is selected, EES will use color for the Diagram Window, plots, and text.  For example, the comments in the equations will be displayed in the same color that is used on the screen.

The Solution and table group boxes each have a field to specify the number of columns that will be used to display the data in the report.  The .TeX processor does not wrap the information if it is too wide for the page, but you can control this problem quite well by specifying the number of columns.  The width of the Diagram and plot windows can be directly entered.  The figures will be scaled to the width you specify while maintaining the existing aspect ration.

The Diagram and Plots that are to be included in the LaTeX document are stored in separate files having a .jpg filename extension in the same directory as the .tex file.  These .jpg files have same parent name as the .tex file with the addition of _D for the diagram and _P1, _P2, etc. for the plots.  When creating a .jpg file, a decision must be made to balance the file size with file quality.  The user has control over this decision with the JPG quality input box.  The allowable values are 1 to 99.  Low values result in small .jpg file sizes (which result in small .pdf file sizes) but sacrifice graphic quality.  Large values result in high quality graphics, but at an expense of great file sizes.  The default value, 75, seems to provide a reasonable balance.

The PDFLaTeX group box on the right side of the dialog contains three checkboxes.  If the Create PDF document checkbox is selected, EES will attempt to start the PDFLatex.exe application to compile that .tex file that it has just saved.  If the Display PDF document checkbox is selected, EES will attempt to start Abode Acrobat to display the .pdf file. If the Delete TEX document checkbox is selected, the LaTeX file will be deleted leaving only the .PDF file.   EES must know where the PDFLaTeX.exe application resides.  As noted above, the default location is C:\textmf\miktex\bin\pdflatex.exe or C:\program files\textmf\miktex\bin\pdflatex.exe. You can specify or change the default location by clicking on the Setup button.

When you click the Create button, EES will write the information in the dialog to a small file called EES_TeX.ini so that it is available as the default the next time you enter this dialog.  This file will be placed in the Default File Folder specified in the Directories tab of the Preferences dialog.  If no directory specification is provided there, the file will be placed in the same directory as the EES application.  Also, note that EES will save your file when starting the Create LaTeX/PDF report command with a filename created by appending a ~ to the current name.  Should any problems occur that cause EES to stop, your file can be recovered.


Load Textbook

The Load Textbook command reads a Textbook index file with the filename extension (.TXB) and uses the information in this file to create a Textbook menu at the far right of the menu bar.  The Textbook menu provides convenient access to set of problems, such as those developed for use with a text.  See Textbook index file for more information.


Open or Create Macro (Professional Version)

Background Information

A macro is a set of instructions to EES that are read from an ASCII file.  The filename extension for a macro file is .EMF, which signifies EES Macro File.  The instructions allow EES to open a file, solve the equations, create and solve a table, store calculated results in a file, print, and other functions.  In fact, most of the capabilities provided with the menu commands in EES can be implemented with macro instructions.  In addition, EES can directly communicate with Microsoft WORD with the WORD macro commands.

Using the macro file capability, EES can be run from the Windows command line, from the Macro Play button in EES, or it can be controlled from another program using Dynamic Data Exchange (DDE) commands.  The macro file name is placed after the EES executable file name.  For example, to start EES and have it run the commands in file myMac.emf stored in the C:\EES32 directory, you would enter:

C:\EES32\EES.EXE c:\EES32\myMac.emf

The .emf filename extension is required.  Otherwise EES will consider the file to be a normal EES file.

When EES is started with this command, it will remain hidden while it opens the macro file and executes each of the instructions in that file.  Provided that no errors are encountered, all of the instructions will be executed in the order in which they appear and then EES will quit.  EES writes an ASCII log file called EESMacro.LOG that indicates what instructions it has completed and any error messages.  This log file is placed in the same directory as the EES executable.

Creating an EES Macro File

The easiest way to create an EES Macro file is to use the Open or Create Macro command.  After selecting this command, EES will prompt the user to provide a name for the macro file.  Enter an existing macro file name to open that file or a new name to create a new macro file. Then a small window will appear at the bottom of the screen listing the macro equivalents of the instructions you provide to EES with the normal menu commands.  For example, when you apply the Open command, EES will add a line to the window of the form.

OPEN C:\myfile.EES

The macro command window is editable, so that you can modify the commands that appear in this window or delete them if you wish.  Most of the EES menu commands will produce a macro instruction.  The Open or Create Macro command name is changed to Close Macro after you open a macro command window.  When you are done entering instructions, select the Close Macro command to close the macro file.  Clicking the Play button will signal EES to play the macro commands that appear in the window.

The major purpose of the macro capability is to allow an external program to use the EES solving engine.  Using the macro file, EES can be instructed to open an existing EES or .TXT file and solve the equations in that file.  EES macro files provide instructions to save the contents of the Solution and Parametric Table windows so that the solution can be returned to the program that called EES.  The Solution or Parametric table can also be copied to the clipboard using the Copy macro command.

Macro commands


Macro Commands

AlterValues 'Table 1' P2 Rows=1..10  First=100 Last=550

{Enter values into the Parametric Table named 'Table 1' for the column holding variable P2 setting the values of rows 1 to 10 to values starting at 100 and ending at 550. You can specify Inc=50 instead of providing Last=550}

Check	Check the equations.  A summary statement is not issued.  This command is useful only in rare situations in which it is necessary to have EES review the existing equations before processing following Macro commands.

Copy ArraysTable R1 C1:R10 C4 	{Copy the specified range of the Arrays table to the clipboard.  If no range is provided, the entire table is copied}

Copy IntegralTable R1 C1:R10 C4 	{Copy the specified range of the Integral table to the clipboard.  If no range is provided, the entire table is copied}

Copy EquationWindow L3 C1:L5 C9 	{Copy the characters in the Equations WIndow starting with character 1 on line 3 through character 9 on line 5}

Copy LookupTable 'Lookup 1' R1 C1:R10 C4 	{Copy the specified range of the Lookup table with name 'Lookup 1' to the clipboard.  If no range is provided, the entire table is copied}

Copy ParametricTable 'Table 1' R1 C1:R10 C4 	{Copy the specified range of the Parametric table named 'Table 1' to the clipboard.  If no range is provided, the entire table is copied}

Copy PlotWindow 3                 	{Copies the graphics in Plot Window 3 in both metafile bitmap formats}

Copy SolutionWindow               	{Copies the entire contents of the Solution window in ASCII format}

DeletePlot 1	{Delete Plot Window 1.}

LoadLib C:\EES32\myLib.lib	{Load a library file called C:\EES32\myLib.lib}

Lookup['Lookup 1', 2,3]=10	{Set the value in row 2 column 3 of the Lookup table having name 'Lookup 1' to 10}

Maximize G  a,b,c	{Maximize variable G with respect to variables a, b, and c.  Note that the all variables must be defined in the Equations Window and variables a, b, and c must have non-infinite lower and upper limits.  Error checking is not provided.}

Merge C:\EES32\Examples\Regen.ees 	/56  {Merge the specified file with the current contents of the Equations window after character position 56.  If the /number is not provided the file will be merged to the bottom of the existing equations.}

Minimize G  a,b,c	{Minimize variable G with respect to variables a, b, and c.  Note that the all variables must be defined in the Equations Window and variables a, b, and c must have non-infinite lower and upper limits.  Error checking is not provided.}

ModifyAxis X Plot=1 Min=100 Max=600 Int=100 Linear Grids=on Showscale=off Size=10 Style=BoldItalic Format=A3 Color=Black

{Change the scaling of the X axis of plot window 1 to the specified minimum, maximum and interval in linear or log coordinates.  The scale numbers are shown in bold italic with fontsize 10 using automatic format. The gridlines and scale can be turned on or off.  Use Y for the left Y axis and Y2 for the right Y axis.  Color controls the color of the plot text and it must be recognized color name.}

ModifyPlot 1 Width=12 cm Height=15 cm	 GridColor=Teal

{Change the size of plot rectangle for the specified plot window.  If the plot window number is not provided, the command is applied to the foremost plot window.  Size can be specified in cm or in.  The grid color must be a recognized color name.}

New	{Clear the workspace and bring up an empty Equations window}

NewLookup 'Lookup 1' Rows=24  Cols=2    	{creates a new Lookup table having name 'Lookup 1' with 24 rows and 2 columns}

NewPlot  Table=PAR2  X=P2  Y=T2  Rows=1..10  Line=1  Symbol=1  SymbolSize=6  Color=Red

{Create a new plot window and Plot T2 vs P2 using the first 10 rows of data from table in Tab 2 of the Parametric table window}

NewTable 'Table 1'  Rows=10 X Y Z	Create a new Parametric table having name 'Table 1' with 10 rows and columns for variables X, Y and Z}

Open C:\EES32\Examples\Regen.ees 	{open the specified file}

OpenLookup  C:\EES32\myTable.lkt   	{open the specified Lookup file}

OverlayPlot 1 Table=Par2  X=P[4]  Y=Eff  Rows=1..10  Line=1  Symbol=4  SymbolSize=10 Color=Blue Right

{overlay a plot of Eff vs. P[4] from data in rows 1..10 of the table in Tab 2 of the Parametric table.   Use the right Y-scale.  Use plot symbol 4 with a size of 10 pixels.  Allowable sizes range from 4 to 18.  To plot other tables, use LookN for Tab N of the Lookup table, Arr for Arrays table or Int for Integral table.}

Parametric['Table 1',1,4]=20	{Set the value in row 1 column 4 of the Parametric table named 'Table 1' to 20}

Paste Lookup 'Lookup 1' R2 C3	{Paste the contents of the clipboard into the Lookup table named 'Lookup 1' starting at row 2 column 3.}

Paste Parametric 'Table 1' R2 C3	{Paste the contents of the clipboard into the Parametric table named 'Table 1' starting at row 2 column 3.}

Print Diag Equ For Arr Par2 Look3 Plot1

{Print the Diagram, Equations, FormattedEqns, Arrays, the Parametric table in the second tab of the Parametric Table, the Lookup Table in the 3rd tab of the Lookup Table and Plot 1 windows}

PrintSetup  PRINTER='\\SEL\Sandy'  Orientation=PORTRAIT  Copies=1

{Set the printer specifications}

PropPlot Steam TS 4 11000 5300 2100 660 6 0.074 0.94 3.37 12 45 155 DoQLines

 	{Create a TS property plot for Steam.  Include 4 constant pressure lines and 6 constant entropy lines at the specified values and draw lines of constant quality}

PropPlot AirH2O PSY 6 10 15 20 25 30 35 4 0.8 0.85 0.9 095  P=101.3  Mollier

{Create a Psychrometric chart with wetbulb lines of 10, 15, 20, 35, 30, 35 C and specific volume lines of 0.8, 0.85, 0.90, and 0.95 m3/kg at a total pressure of 101 kPa in Mollier form.  The P=101.3 and Mollier are optional.}

QUIT	{Close the EES application}

ResetGuesses	{Reset the guess values of all variables to their default values}

Run Program name and parameters	{The Run command will start the indicated program with the given parameters, just as if this string were entered with the Run command in the Windows Start menu.  For example, to start EXCEL enter:

          Run EXCEL

You can start EXCEL and open the file C:\temp\TEST.xls with the following macro command:

           Run  c:\temp\text.xls

EES knows that the .xls filename extension is an EXCEL file.  Using the Run command, it is possible to start external programs that read data exported by EES and then have EES import the data output by the program.}

SAVE	{Save the current file with its existing file name}

SaveArrays myArrays.txt	{Save the contents of the Arrays table to a file called myArrays.txt.

SaveLookup 'Lookup 1' myTable.txt	{Save the contents of the Lookup table having the tab name 'Lookup 1' to a file called mytable.txt.

SaveSolution mySoln.txt /Append	{Save the contents of the Solution window to an existing file called mySoln.txt.  The /Append option will allow writing to the bottom of the file without deleting the existing information.}

SaveTable 'Table 1' myTable.txt /Append	{Save the contents of the table named 'Table 1' in the Parametric Table Window to an existing file called myTable.txt.  The /Append option will allow writing to the bottom of the file without deleting the existing information.}

Show Arrays	{Bring the Arrays table the front}

Show Diagram	{Bring the Diagram window to the front}

Show Equations	{Bring the Equations window to the front}

Show Format	{Bring the Formatted Equations window to the front}

Show Integrals	{Bring the Integrals table the front}

Show Lookup 'Table Name'	{Bring the Lookuptable to the front.  The name of the Lookup table (surrounded with single quotes) can be optionally provided in which case the table having this name on its tab will be selected.}

Show Parametric 'Table Name'	{Bring the Parametric table to the front.  The name of the Parametric table (surrounded with single quotes) can be optionally provided in which case the table having this name on its tab will be selected.}

Show Plot 'Plot Name'	{Bring the plot to the front.  The name of the plot (surrounded with single quotes)  can be optionally provided in which case the plot window having this name on its tab will be selected.}

Show Residuals	{Bring the Residuals window to the front}

Show Solution	{Bring the Solutions window to the front}

Solve	{Solve as if the Solve command has been issued}

SolveTable 'Table 1' Rows=1..10 	{Solve rows 1 through 10 of the Parametric Table having the name 'Table 1'.  If no range is specified, all rows are solved.}

StopCrit  It=100  Time=3600  Res= 1.0E-0006  Var= 1.0E-0006

{Set the Stop Criteria properties as indicated}

Units C kPa MASS DEG 	{Set the Units as indicated.  Mixed units, e.g., C and psia, are not supported.}

UpdateGuesses	{Update the guess values of all variables to the last set of calculated values}

VarInfo  P2   Lower=200 Upper=500 Guess=300

{Set the lower bound, upper bound, and guess value for variable P as specified}

WORD.FileNew	{Start WORD and create a new empty document.}

WORD.FileOpen('FileName')	{Start WORD and open the specified Word file.  It is necessary to provide the complete file name.}

WORD.FileSaveAs('FileName')	{Save the current WORD document with the specified filename.}

WORD.Hide	{Hide the open WORD document.}

WORD.Insert('any text here')	{Insert the text contained with single quotes into the WORD document at the current position.}

WORD.Paste	{Paste the current contents of the Clipboard into WORD.}

WORD.PasteSpecial(formatType)	{Paste the current contents of the Clipboard into WORD in the specfied format.  The formatType can be TEXT, PICTURE, BITMAP, DEVICE INDEPENDENT BITMAP, and ENHANCED METAFILE.}

WORD.Quit	{Close the communication with WORD.}

WORD.Show	{Make the open WORD document visible.}

Note that any of the commands can be sent directly from an external program to EES with the application's DDEExecute command.  For example, the following command issued from EXCEL Visual Basic will cause EES to execute its SOLVETABLE command for Table 1.  Note that when macro commands must be enclosed in square brackets.

Application.DDEExecute ChannelNumber, "[SOLVETABLE 'TABLE 1', Rows=1..10]"


Recognized Color Names

Black

Blue

Red

Green

Purple

Maroon

Yellow

Lime

Olive

Aqua

Gray

Fuchsia

Navy

Teal

Silver


Dynamic Data Exchange (DDE) (Professional Version)

The easiest way to run an EES macro file from another application is to simply start EES and provide the macro file name (with an .EMF filename extension) as a parameter on the command line.  However, this disadvantage of this method is that EES quits when the macro file commands have been executed.  If it is necessary to call EES repeatedly, this method becomes very inefficient as EES must be repeatedly loaded into memory.  An alternative approach is to use dynamic data exchange (DDE) messages.  Many popular programs support the DDE message exchange format including MATLAB and EXCEL.

EES must be running to receive a DDE message.  This is not really a problem as EES can be started from a remote application using the Windows CreateProcess command.  However, when EES starts, it normally displays its splash screen and waits for the user to click the OK button.  To avoid having EES display the splash screen and wait for user input, supply /HIDE as a parameter on the command line, i.e., start EES with the following command.

C:\EES32\EES.EXE /HIDE

After receiving this command EES will start in a minimized mode.  Its icon will be visible in the Windows task bar, but the program will otherwise not be visible on the screen.

The calling program must next send EES a series of messages according to the DDE message protocol.  The first message that must be sent is the WM_DDE_INITIATE message.  This message is normally sent using the Windows SendMessage command.  The SendMessage command requires four parameters.  The first should be a broadcast message to all running applications.  The second must beWM_DDE_INITIATE .  The third is the handle of the calling application.  EES will use this handle to send message back to the calling application.  The final parameter is a global atom referring to 'EES', so that EES knows to act on this initiate message.  Shown below is a code fragment in Delphi 4 that sends the WM_DDE_INITIATE message to EES.

procedure TForm1.doInitiate(Sender: TObject);

  var theApp, theTopic:Atom;

       lParam:longInt;

begin

  theApp:=GlobalAddAtom('EES');

  theTopic:=GlobalAddAtom('');

  lParam:=MakeLong(theApp,theTopic);

  SendMessage(HWND(-1),wm_DDE_Initiate,Handle,lParam);

  GlobalDeleteAtom(theApp);

  GlobalDeleteAtom(theTopic);

end;

EES will respond to the WM_DDE_INITIATE  message by sending the application a WM_DDE_ACK message.  Included in this message is the handle to the EES application, here called EESWindowHandle, that the calling program must provide in following messages.  A code segment that receives the WM_DDE_ACK message may appear as shown below.

procedure TForm1.GetACK(var theMessage:TMessage);

  var AppName,TopicName:charString;

      S:shortString;

 begin

    EESWindowHandle:=theMessage.wParam;

 end;

After the WM_DDE_INITIATE message has been received by EES, the calling application can next send a WM_DDE_REQUEST message to play a macro.  The information sent to EES includes a global atom referring to the string 'PLAY' and a character string containing the DOS filename of the macro file.  The complete file name should be sent, including the directory information and the .EMF filename extension.  The code fragment below shows how this is done.

procedure TForm1.PlayMacro(Sender: TObject);

  var cfile,command:atom;

       lParam:longint;

       CSTR:charString;

begin

  StrCopy(CStr,'c:\ees32\myMacro.emf');

  cfile:=GlobalAddAtom(CStr);

  Command:=GlobalAddAtom('PLAY');

  lParam:=MakeLong(cfile,Command);

  PostMessage(EESWindowHandle,wm_DDE_REQUEST,Handle,lParam);

end;

After receiving this message, EES will open the macro file and execute the instructions therein.  It will then send a WM_DDE_ACK message to inform the calling program that the calculations are completed.  When EES executes a macro file, it writes results to a specified text file.  The calling application can open this text file to retrieve the results.

EES will also recognize other commands. The RUN filename request can be sent to EES using code shown below.  When EES receives this request, it will open the specified file, solve the equations using the Solve command and write the Solution window to a file having the same name as the EES file with a .TXT filename extension.

procedure TForm1.RunFileMacro(Sender: TObject);

  var cfile,command:atom;

       lParam:longint;

       CSTR:charString;

begin

  StrCopy(CStr,'c:\ees32\myFile.EES');

  cfile:=GlobalAddAtom(CStr);

  Command:=GlobalAddAtom('RUN');

  lParam:=MakeLong(cfile,Command);

  PostMessage(EESWindowHandle,wm_DDE_REQUEST,Handle,lParam);

end;

The QUIT command which terminates EES.  Here's how it can be sent.

procedure TForm1.QuitClick(Sender: TObject);

  var cformat,command:atom;

      lParam:longint;

begin

  cformat:=GlobalAddAtom('');

  Command:=GlobalAddAtom('QUIT');

  lParam:=MakeLong(cformat,Command);

  PostMessage(EESWindowHandle,wm_DDE_REQUEST,Handle,lParam);

end;

EES will also execute any macro command sent by DDE that is implemented in the its Macro Command list.  These commands must must be enclosed with in square brackets, as shown.

procedure TForm1.ExecuteBtnClick(Sender: TObject);

  var cformat,command:atom;

      lParam:longint;

      CString:array[0..256] of char;

begin

  StrPCopy(CString,'[Open C:\EES32\Examples\Regen.EES]');

  cformat:=GlobalAddAtom(' ');

  Command:=GlobalAddAtom(CString);

  lParam:=MakeLong(cformat,Command);

  PostMessage(EESWindowHandle,wm_DDE_REQUEST,Handle,lParam); end;

See the EXCEL and MATLAB examples for additional information.


Calling EES from MATLAB

Shown below is a small MATLAB M file called EES_MATLAB.m that plays an EES Macro file.

_____________________________________________________________________________________

% This file shows how EES and MATLAB can be coupled through file transfer

%% First start a DDE conversation between MATLAB and EES

chan = ddeinit('EES','DDE');

% Now let EES load the EES file

rc = ddeexec(chan,'[Open EES_MATLab.ees]');

% Create a File in MATLAB such that it can be read by EES with the $Import directive

var1 = 1;

var2 = 2;

var3 = 3;

var4 = 4;

var5 = 5;

t = 0;

for i = 1:10

  t = t + 1

  save MatLabInput.txt var1 var2 var3 var4 var5 t -ascii

  % Ask EES solve the previously loaded program

  rc = ddeexec(chan,'[Solve]');

  % Read a file created by EES through the $EXPORT command into MATLAB

  erg = csvread('EESOutput.csv')

end

% Terminate the DDE conversation between MATLAB and EES

ddeterm(chan);

_____________________________________________________________________________________

The EES file called by MATLAB is as follows:

_____________________________________________________________________________________

$Import 'C:\ees32\ees_MATLAB\MatLabInput.txt',  var1, var2, var3, var4, var5, t

erg = (var1 + var2 + var3 + var4 + var5) * t

$Export 'C:\ees32\ees_MATLAB\EESOutput.csv', erg

_____________________________________________________________________________________

Place the EES_MATLAB.m and EES_MATLAB.EES files in the C:\EES32\EES_MATLAB directory.  In order to run this macro from MATLAB, EES must be running in the background so start EES and then minimize it.  Start MATLAB and enter the following commands

CD C:\EES32\EES_MATLAB

EES_MATLAB

Note that the Professional version of EES is required to run these examples.


Executing EES Macro Commands from EXCEL

This EXCEL sheet contains a macro that will call EES.  It should serve as a model of how EES and EXCEL can interact.  This example will not work under Windows 98.  It requires NT or 2000.

The macro will start EES and open the file C:\ees32\examples\EXCEL_EES.ees.  It will then copy two columns of data representing temperature and presssure to the clipboard, paste them iinto the first two columns of the EES Parametric table 'Table 1', solve the table and copy the the calculated results back to the clipboard.  In this case, the calculated results are the specific enthalpy, entropy, and volume for for refrigerant R134a. The EXCEL macro then paste the result into the EXCEL sheet and quits EES.  The EXCEL macro is executed when the Calculate button in the Visual Basic form is clicked.  The EXCEL example and the EES file that it executes are in the EES32\ Examples folder with file names EXCEL_EES.xls and EXCEL_EES.ees.

Private Sub cmdDDE_Click()

    Dim ChannelNumber As Integer

    Dim myShell As String

    ChannelNumber = -1

    myShell = frmEESDDE.txtApp.Text

    On Error Resume Next

    'Copy selected rows into clipboard which will be pasted into a Parametric Table in EES'

    Range("A17:B26").Select

    Selection.Copy

    'Open EES

    Shell_R = Shell(myShell, 1)

    If Shell_R <> "" Then

        'Initiate DDE

        ChannelNumber = Application.DDEInitiate(app:="ees", topic:="")

        If ChannelNumber <> -1 Then

            Application.DDEExecute ChannelNumber, "[Open C:\EES32\Examples\EXCEL_EES.ees]"

            Application.DDEExecute ChannelNumber, "[Paste Parametric 'Table 1' R1 C1]"

            Application.DDEExecute ChannelNumber, "[SOLVETABLE 'TABLE 1', Rows=1..10]"

            Application.DDEExecute ChannelNumber, "[COPY ParametricTable 'Table 1' R1 C3:R10 C5]"

            'Paste results from EES into EXCEL'

            ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range("C17:E26")

            'Quit EES and Terminate DDE

            DDEExecute ChannelNumber, "QUIT"

            Application.DDETerminate ChannelNumber

        Else

            MsgBox "Unable to initiate connection to EES", vbExclamation, "EES DDE"

        End If

        frmEESDDE.Hide

    Else

            MsgBox "The application, " & myShell & ", was not found", vbExclamation, "EES DDE"

    End If

End Sub


Textbook index file

A textbook index file is an ASCII text file identified with a .TXB filename extension.  A textbook index file can be loaded manually using the Load Textbook command or automatically, by placing the textbook index file and associated problem files in a subdirectory within the USERLIB subdirectory.  EES will display a Textbook menu item to the right of the Help menu after loading the textbook index file.  The format of the textbook index file is as follows:

Menu Title

1

Textbook information line 1

Textbook information line 2

Textbook information line 3

Reserved

>Menu item 1

Descriptive problem name1 | FileName1.EES | HelpFile1.HLP | NO.BMP

Descriptive problem name2 | FileName2.EES | HelpFile2.HTM | NO.BMP

Descriptive problem name3 | FileName3.EES | HelpFile3.TXT | NO.BMP

....

>Menu item 2

Descriptive problem name4 | FileName4.EES | HelpFile4.HLP | NO.BMP

Descriptive problem name5 | FileName5.EES | HelpFile5.HLP | NO.BMP

Descriptive problem name6 | FileName6.EES | NO.HLP | NO.BMP

....

>-

...

>Menu item 3

>>SubMenu 1

Descriptive problem name7 | FileName7.EES | HelpFile1.HLP | NO.BMP

Descriptive problem name8 | FileName8.EES | HelpFile2.HLP | NO.BMP

Descriptive problem name9 | FileName9.EES | NO.HLP | NO.BMP

>>SubMenu 2

Descriptive problem name10 | FileName10.EES | HelpFile10.HLP | NO.BMP

Descriptive problem name11 | FileName11.EES | HelpFile11.HLP | NO.BMP

Descriptive problem name12 |..\USERLIB\EXAMPLES\ FileName12.EES | NO.HLP | NO.BMP

...

...

...

The first line in the file is the menu title.  This title is the name of the menu which will appear in the menu bar to the right of the Help menu.

The following line is a version number used internally by EES.  EES currently ignores this line but a 1 should be provided, as shown.

The following three lines provide information about the textbook or problem set.  This information will be displayed whenever any menu item is selected from the Textbook menu.  A fourth line containing the word "reserved" is provided for possible future use.  EES currently ignores the information on this line, but it must be provided.

The following lines contain a menu item name (preceded by an identifying > character) and then one or more problem descriptions.  The menu item name is the name that will appear in the Textbook menu list.  The combination of >- will place a break line in the menu.  Note that a second level of menu nesting is supported.  If a menu item name is preceded with >>, this menu item will become a 'flyout' menu which is displayed when the parent menu item is chosen.

Each problem description line contains four pieces of information, separated by a | character.  The first item is a descriptive name for the problem, which may be up to 128 characters.  The second item is the filename for the EES program file.  This filename may be partially or fully qualified with directory information, e.g., C:\myBook\Chapter1\Problem1.EES.  However, in most cases, directory information is not necessary and it should not be included.  If the filename begins with ..\  EES will interpret the .. to mean the directory that the EES application is located in.  So a filename of ..\USERLIB\EXAMPLES\TEST.EES will find the file TEST.EES in the EXAMPLES subdirectory, no matter where the EES application is installed.

The third item is an optional help file which is to be associated with this file.  The help file can be an ASCII text file (*.txt), a Windows help file produced by a Help formatting program (*.hlp) or an HTML file (*.htm).  Although it is wise to use the conventional filename extensions, EES will accept any filename extension and automatically determine the appropriate file type.  If no help file is available, enter NO.HLP for this field.  The final item is the DOS filename for a figure associated with the problem.  EES does not currently use the figure, but a figure name must be provided.  Use NO.BMP as a placeholder.

The textbook index file should be placed in the same location (i.e., floppy disk, subdirectory, or folder) with all of the referenced EES program and help files.

When the user selects a command from the Textbook menu, a dialog window will appear showing a list of the descriptive names of the problems for that menu item.   The user can then select a name from the list and the file associated with that problem will be opened.  The Textbook menu provides a very convenient method to group many problems of a particular type, such as those associated with a textbook.


Exit
Exit (FILE Menu)

Exit provides a graceful way to quit EES.  If there have been any changes, you will be asked if you wish to save your file before EES quits.


Select Lookup Files

Your equations access one or more Lookup files and possibly the data in the Lookup Table window as well.  Click on the names of the Lookup files that you wish to print.  Click a second time to deselect the file.


Edit Menu

The Edit menu includes commands to move text, table fragments, and the plots to and from the Clipboard.  Press Alt-E to access this menu with keystrokes.  For more information, select the Edit menu command name.

Undo

Cut

Copy

Paste

Delete

Select All

Insert/Modify Array


Undo
Undo (EDIT Menu)

Undo simply restores the window to the condition it was in before the last operation.  Undo is not available for all windows or for all operations.  The Undo menu item will be dimmed and not selectable if the Undo capability is not available.


Cut

Cut (EDIT Menu)

The Cut command provides slightly different functions depending on which window is foremost when the command is issued.  In some case, the menu name will be changed to make the function more clear, e.g., Cut line for a plot window.

Cut will remove the selected text from the Equations window and place it in the Clipboard from which it can be restored with the Paste command.  Text may be selected by dragging.

If a plot window is foremost Cut will remove the selected text item or line/arrow and place it on the Clipboard.  This item can then be pasted onto any EES plot window using the Paste command.

Cut will remove selected graphic and text items from the Diagram or child Diagram windows and place them on the Clipboard.  They can then be pasted into other Diagram windows in EES or into other applications as a picture.


Copy
Copy (EDIT Menu)

The behavior of the Copy command depends on which window is foremost.

Copy will place the selected text from the Equations window in the Clipboard from which it can be restored with the Paste command.  Text may be selected by dragging.

When the Parametric, Lookup,  Arrays, or Integral table window is in front, the Copy command will copy the selected cells in the table as tab-delimited text.  This text can be directly pasted in a spreadsheet application.   By default, only the selected cells will be copied.  However, if the Shift key is depressed while the Copy Table command is issued, the Header and Units of each column will also be copied to the Clipboard.  Use the Select All command to select all of the cells in the table.

If one of the Plot Windows is foremost, the Copy command will first check to see if a text item or line is selected (i.e., displayed with an enclosing red dotted box).  If a selected item is found Copy will place that item on the Clipboard, from which it can later be pasted.  If a selected item is not found, Copy will move the entire Plot window into the Clipboard from which it can be pasted into other applications.  The plot image can be copied in two ways: as an enhanced Windows metafile and as a bitmap. The Windows metafile is a vector image that requires relatively little memory. Starting with version 6.101, it is placed on the clipboard at a default resolution of 600 pixels per inch so that when copied to another application, such as a word processor, the image will print with the same quality that it would have if it were printed from EES.  The bitmap can also produce a high quality image, but is requires considerable memory, particularly if a color copy is requested.  The option of copying in color, copying as a bitmap, and the copy resolution (100, 300,  600, and 1200 dots per inch) are determined by setting in the Plots tab of the Preferences dialog. Use the Paste Special command in the external application to select Device Independent Bitmap if you wish to paste the bitmap.

Note that the plot will be copied to the clipboard in black and white unless Copy in color is checked in the Plots tab of the Preferences dialog. The black and white bitmap requires less memory and generally prints better on a black and white printer.

Copy Solution will place the contents of the Solution on the Clipboard both as ASCII text with each variable on a separate line and as a picture of the formatted Solution window. Use the Paste Special in an another application, such as a word processor, to select either the text or the picture for pasting.  See the description of the Solution window for more information.

Copy will place the entire contents of the Residuals window on the Clipboard as text.  Tabs separate the different items on each line of the Residuals window.  The Clipboard contents can be pasted into a word processor.

Copy will place selected items in the Diagram or child Diagram window on the Clipboard.  These items can then be pasted into another EES Diagram window or into another application.  If no items are selected the Copy command will copy the entire contents of the Diagram window.


Paste
Paste (EDIT Menu)

The Paste command function depends on which window is foremost when the command is issued.

Paste moves the text stored in the Clipboard to the cursor position in the Equations window.  Text is placed in the Clipboard with the Cut or Copy commands in EES or in other applications.

When Paste is used in the Parametric or Lookup Table windows, the numerical values stored in the Clipboard will be copied to the table starting in the cell in which the cursor is currently located.  Data can be moved between the Parametric and Lookup Tables using the Cut, Copy, and Paste commands.  The names and units of columns in the Lookup table can be pasted using the Paste Special command.

If a Plot window is foremost, and a text item or line/arrow was previously copied to the Clipboard, the Paste menu item will display 'Paste text item' or 'Paste line'.  A text item or line can be copied from one EES plot window and pasted into another.


Clear
Delete (EDIT Menu)

Delete functions in a manner that depends on which window is foremost when the command is applied.  When the Equations window is foremost, Delete will remove the selected text from the Equations window.  Clear differs from Cut in that the text is not placed in the Clipboard.  Delete is also used to remove an selected items from the Diagram Window or to delete selected rows or columns from the Parametric or Lookup Table windows.


Select All

Select All will operate on the window which is foremost.

In the Equations window, Select All will select all of the text.  All cells will be selected in the Parametric, Lookup, or Arrays window if one of these table windows are in front.

Select All will select all graphic and text items in the Diagram or child Diagram window if the window is in development mode.

Select All can also be used to select the visible equations and comments in the Formatted Equations window or to select the visible variables in the Solution window.  In this case, the command name will appear as Select Display.  Only the items that are currently visible will be selected.

The selected items can then be placed on the Clipboard using the Copy command.


Insert/Modify Array

This command provides an easy way to enter or modify the values in EES Arrays.

The dropdown edit rectangle at the top of the dialog displays the names of all of the arrays that are defined in the Equations window.  Select the name of the array for which you wish to enter or modify values.  If no arrays are defined, this rectangle will display -> Enter array name.  Enter the name of the new array.

The number of columns and rows in the array can be adjusted with the Rows and Columns controls.  Scroll bars will appear as needed to allow access to array cells that are not visible in the window.

The two speed buttons provide access to Copy and Paste.  The top button is the Copy button.  It is enabled only if two or more cells in the table are selected.  To select a range of cells, click the mouse in the upper left cell.  Hold the Shift key down and click in the lower right cell.  The Copy button should then be enabled .  The Paste button is enabled only if text has been placed on the clipboard.  To paste text into this window, click the mouse in the upper left cell for which the paste operation is to start.  Pasting will proceed to the right and down the table.  The copy and paste capability make it possible to import or export data to and from a spreadsheet.

Enter the values of the array elements that you wish to define in the table.  When you click the OK button, EES will convert the values that you have entered into EES equations and enter these into the Equations window.  The entered will be placed within comments of the form:

{Array A}

{Array A end}

where A is the array name.  Do not delete or edit these comments.  EES uses these comments to locate the position in the equations window in which the array elements are defined.  If you later wish to redefine the array, EES will find the previous array using these comments and overwrite the array with the newly entered values.


Search Menu

The Search menu provides two functions.  The top part of the menu provides the Find/Replace capability that can be used in the Equations and Residuals windows.  The lower part of the menu will be visible only if one or more $Bookmark directives exist in the Equations window.  In this case, selecting the bookmark menu item while in the Equations or Formatted Equations windows will jump the focus to the equation or comment following the $Bookmark directive, scrolling the window as necessary.

Find

Replace

Next

Bookmarks


Replace
Replace (SEARCH Menu)

Replace will search the Equations window for the first occurrence of the text in the 'Find what' input box starting at the cursor position and replace it with the text in the 'Replace with' input box.  The 'Match case', 'Match whole word only' controls operate as described for the Find command.  Clicking the 'Replace All' button repeats the replace operation for each occurrence of the 'Find what' string beginning at the cursor position and ending at the bottom of the Equations window.


Find
Find (SEARCH Menu)

Find will search the Equations window for the first occurrence of the text entered in the 'Find what' input box.  The search is case-insensitive unless the 'Match case' check box control is selected.  The 'Match whole word only' check box control will, if selected, only find whole words which match the text.  For example, if the text to find is AT, text such as CAT will not be found when using the 'Match whole word only'.  The search starts at the cursor position and proceeds up or down depending on the setting in the Find dialog window.


Next
Next (SEARCH Menu)

Next repeats the last Find or Replace command with the same settings.  The F6 function key can be used in place of the menu command.


Options Menu

The Options menu incorporates different groups of commands listed below.  The first group provides commands for setting the guess values and bounds of variables and information on built-in functions.  The second group allows default unit and stop criteria information to be changed.  The Preferences command allows the display and other EES options to be configured. Finally, the Show/Hide Diagram Tool Bar controls allows the Diagram Window to be configured in development or application mode.    Alt-O accesses this menu from the keyboard.

Variable Info

Function Info

Unit Conversion Info

Constants

Unit System

Stop Criteria

Default Info

Show/Hide Diagram Tool Bar

Preferences


Function Information
Function Info (OPTIONS Menu)

The Function Information command will bring up a dialog window listing the built-in and user-defined internal functions, procedures and modules in library files.

Five buttons at the top of the dialog window determine whether information is supplied for the built-in mathematical, thermophysical functions , and solid/liquid properties, or user-supplied library files and external routines. Select the function or procedure from the list box on the left.  To select a function, click on the function name in the scrollable list.  The Function Info button will be enabled if descriptive or help information is available for the function you selected.  Click the button to view the information.  Depending on the format of the available information, the Function Info button may start the Windows Help program or your browser.

EES Library files are normal EES files which have one or more internal functions, procedures or modules and which have been saved with a .LIB filename extension.  Library files which reside in the USERLIB\ subdirectory in the EES application directory or the working directory are automatically loaded when EES starts unless directed otherwise by the Library manager.  Library files can also be loaded from using the $INCLUDE directive or the Load Library command.  The functions, procedures, and modules in library files are not visible in the Equations Window.  They operate much like the built-in functions.  A single .LIB file can hold one or more Functions, Procedures, and Modules.  In this situation, the .LIB file is identified as a folder in the in the list of routines, as seen in the figure above for files rk4.lib, SETP.lib and ThermoPhysical_Props.lib.  Click on this folder to view an expanded list of the names of all of the routines contained in the file.  Click the View Code button to see the EES code for each routine.

External functions and procedures are dynamically linked library files.  These are files written external to EES, but they can be called from within EES.  External functions are written in C or Pascal and are identified with a .DLF filename extension.  There are two formats for external procedures identified with .FDL and .DLP filename extensions.  External procedures written in FORTRAN must use the .FDL format and those written in C or Pascal usually use the .DLP format as well.   All external functions and procedures found in the USERLIB\ subdirectory are loaded automatically when EES is started unless directed otherwise by the Library Manager.  External routines can also be loaded manually with the Load Library command.  External EES functions and procedures allow the user to add any additional relations, e.g., additional property data.  See the Chapter 6 of the EES manual for additional information on how the user can develop external functions and procedures in C, Pascal, or FORTRAN.

Thermophysical property functions require specification of a substance.  The substances for which property data are available are shown in the Substance list on the right.  Click on the substance name in the scrollable list to select the substance.  Substances represented by their chemical formula (e.g., CO2) are modeled as an ideal gas and use JANAF table reference values for enthalpy and entropy.  Substances with their name spelled out (e.g., CarbonDioxide) are modeled as real fluids and do not use JANAF table reference values.  Psychometric functions are applicable only to the substance AirH2O.  The type of model (ideal gas or real gas) will be displayed above the substance list whenever a substance is selected.  Additional information regarding all built-in functions is provided in the manual

An example of the function will be shown in the box at the bottom.  You can edit the Example box information.  If you click the Paste button, the contents of the Example box will be pasted into the Equations window at the cursor position.


Solid/Liquid Properties

Clicking the Solid/Liquid Property button in the Function Information dialog changes the display to appear as follows.

The list on the left shows the property functions that have been currently implemented which include:

beta_  	volumetric coefficient of thermal expansion

c_	specific heat

k_	thermal conductivity

mu_	viscosity

rho_	density

E_	modulus of elasticity

alpha_	linear thermal expansion coefficient

nu_	Poisson's ratio

DELTAL\L_293_ change in length relative to the length at 293 K

On the right are names of materials to which these functions can be applied.  An example indicating the format of the function use appears in the examples box.  Note that Temperature can be a numerical value, and EES variable, or an algebraic expression that evaluates to the desired temperature in the scale selected in the Unit System dialog.  Details such as the source of the data and the applicable range of the correlation can be obtained by clicking the Function Info or Info buttons.

The Solid/Liquid properties library is different from other EES property  functions in several respects.  The substance name must be supplied as a string constant (within single quotes) or string variable.  (The quotes are optional for the fluid property functions.)  The solid/liquid property functions require only one numerical parameter and that is the temperature.  The T= indicator used in the fluid property functions is not used in the Solid/Liquid property functions.

The Solid/Liquid property functions are not truly built into EES but rather implemented in a user-accessible internal function library file named Solid-Liquid_Props.lib. The property data are stored in EES Lookup files having a .LKT filename extension.  The library and data files are in the UserLib/Solid-Liquid_Props folder.   The library file uses the Interpolate command to determine the property data values.  You can add additional property data and other functions if you wish as explained in the Solid/Liquid Properties help file that is accessed by clicking the Function Info button.  Use the Open command to open the Solid-Liquid_Props.lib file to view or modify the EES code.  Use the Open Lookup Table command to view or modify the data for any substance.

If the Solid-Liquid_Props folder is renamed or moved out of the USERLIB folder the Solid/Liquid properties button will be disabled.  The USERLIB folder is located in the working directory.


Variable Information
Variable Information (OPTIONS Menu)

The Variable Info command presents a spreadsheet-like table where the variable name, guess value, lower and upper limits, display format, and units of 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, for example, to 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 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 name and will then change every occurrence of the variable in the Equations, Diagram and Parametric Table windows.

The Guess, Lower and Upper value fields may be either numerical values or any existing variable name.  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) can be used to indicate unlimited lower and upper bounds, respectively.

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, the lower and upper bound will be shown in italics.  Holding the right mouse button down while the cursor is positioned in the Guess column will cause the display to change from the guess value to the current value.  The display will change back to the guess value when the right mouse button in released.  You can copy the value to the guess value by holding the right button down while clicking the left mouse button.  If you wish to update all variables, rather than just one at a time, click the Update button.

As shown in the figure above, there are two display modes.  In Selection Mode, the active cell is outlined and there is a small box at the lower right of the cell.  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.  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, and Units 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 Solutions Window or Parametric Table 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, F, E, or S.  A stands for Auto format.  When this format option (the default) is selected, EES will internally choose a format for displaying the value.  F means Fixed Decimal format.  In this case, the number in the second field indicates the number of digits to the right of the decimal point.  E indicates exponential format.  The number in the second display column is the number of significant figures displayed.  S indicates that this is a string variable.  The third field provide formatting options which take effect in the Solutions Window, such as underlining, boxing, or bolding.

The units of the variable (or any other desired information) 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 Solutions Window.  The text entered in the Units field are used by EES only for display purposes in the Solution and Parametric Table windows. However, note that EES does provide the cabability to convert units using the Convert function.

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 not 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 and units, would not be affected.  These 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.

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.  Note that each function/procedure/module/subprogram has its own set of variables, as does the Main program.  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 statments used in internal functions and procedures makes guess values and limits not applicable so these fields are not available for functions and procedures. The variable set that appears when the Variable Info dialog first appears is determined by the position of the cursor in the Equations window.  If the cursor is positioned on an equation in a module, the variables for that module will be displayed.

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 unambigously 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.  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.

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.


Variable Information Files (Professional Version)

Variable information for a Module, Subprogram or main EES program can be saved to or loaded from a disk file.  The file operations are accomplished using the two small buttons at the upper right of the Variable Information dialog.

Variable information is saved in a file having a .VAR filename extension.  However, the information in this file is in tab-delimited ASCII format so that it can be opened, viewed or modified with a word processor or spreadsheet.

Variable information data can be saved to an existing .VAR file.  In this case, the file is updated with the current information for the variables that are in use.  Information in the file concerning variables that are not currently in use is not modified or deleted.   For example, suppose you have a program that uses variables X, Y, and Z.  You save the variable information to an existing file that already has variable information for variables A, B, C, and X.  The information for variables A, B, and C is not altered.  The variable information for X is updated to the current settings and variable information for Y and Z are appended to the file.

If a program contains one or more Modules or Subprograms, a dropdown list appears at the top center of the Variable Info dialog from which the module or main program can be selected.   In this case, the Save or Open Variable Information operation will be applied only to the selected module, subprogram or main program.  Variables that in a module or subprogram are stored in the variable information file with the module/subprogram name so that the same variable names can be used in modules/subprograms and the main program with no confusion.

There are several important applications for variable information files.  The first application is to provide different sets of guess values for a problem that has difficulty converging.  Each set of guesses can be stored in a separate file and loaded as needed.  A more general application is to use a variable information file to store information for variables that you use repeatedly in your problems.  For example, if you commonly use variables T1, T2, and T3 in your problems, you can set their guess values, limits and units in the Variable Information dialog and Save the information in a Variable information file.  Then, when preparing your next problem, you can open this variable information file and the guess values, limits and units will be automatically updated.  Used in this way, the variable information files provide a similar capability to that available with the Default Variable Information command, but in this case, the saved information does not need to relate to the first letter in the variable name.


Unit Conversion Info (Options menu)

EES provides a powerful unit conversion function which has the following format:

Convert('From', 'To')

From and To are character strings identifying the unit type such as 'Btu/hr-ft^2-R' or 'mph'.  (Note that the single quotes marks around the unit identifier are optional.)  Many of the unit identifiers are obvious, but not all.  The purpose of this window is to display the unit identifiers that have been defined.

Click on the dimension in the list at the left.  All of the units which have been defined with that dimension are listed in the list on the right.  Note that only the defined units having the selected dimension are listed.  For example, if you click on Area, only Acre and Hectares will be displayed.  However, any combination of units having the dimensions indicated at the top of the right list (e.g., L^2 for Area) can be used in the Convert function.

Note that unit combinations, such as Btu/hr-ft^2-R, can be assigned to variables.  The rules for combining units are:

1) Only one divide symbol can appear in a unit grouping

2) All units to the right of the division sign are assumed to be in the denominator

3) Units are separated with a - (minus), * (star) or Alt-250 which which appears as a dot (·)

4) Multiple groups can be used provided that they are enclosed in parentheses and separated by a *, e.g., (Btu/lb_m)*(lb_m/hr)

See the Convert function for addtional inforamtin.

You can add additional units if needed.  They are stored in the UNITS.TXT file.  The UNITS.TXT file must be placed in the working directory.  This file is automatically read when EES is started or when the EES.prf file is loaded.  An existing .prf file in any directory can be loaded with the Load button in the Preferences dialog or with a $INCLUDE directive. in the main EES directory.  Instructions for adding new units are provided at the top of the UNITS.TXT file.

Note that a list of frequently used units composed of the basic units in this dialog can be entered and accessed so that you need not continuously key in unit string information.  See the Units List dialog for details.


Units List

EES can check the unit consistency of each equation in the Equations Window.  This is a very important capability since experience has proven that unit errors is a very common problem both for students and practicing engineers.  However, in order for EES to check unit consistency, the units of each variable used in the equations must be specified.  There are several ways to enter unit information.  Units can be entered as a comment following an equation in the Equations window, as in the following example:

L = 15 [m]

Units for each variable can also be entered in the Variable Information dialog and by right clicking on a variable in the Solutions window or Parametric table.  In each case, it is necessary to enter the unit designation from the keyboard, and this chore can be cumbersome.  The Units List eliminates the need to key in the units.

The Units List can be accessed from the Equations window, the Variable Information dialog, the Parametric table and the Solutions window by clicking the right mouse button and selecting Units List from the pop up menu.  This action will bring up the following dialog window.

The title bar shows the name of the units list file.  EES provides two default lists named SI_DefaultUnits.unt and ENG_DefaultUnits.unt that hold common units for the SI and English system, respectively.  The units are shown in the list.  Clicking on the desired unit and then clicking the Paste button will paste that unit string into the window that the Units List was accessed from, eliminating the need to enter the units.  Note that double-clicking on a units string in the list has the same effect as clicking the Paste button.  If the units list was accessed from the Equations window, the unit string will be enclosed within quotes and square braces before it is pasted into the Equations window.

The name of the current units list file is shown in the title bar of the units list dialog.  Note that the filename extension is .UNT, but the units file is a simple text (.txt) file that contains the desired unit strings.  It is possible to develop customized units lists in separate .UNT files.  The buttons located on the panel at the right of the dialog facilitate this process.

Load brings up a file open dialog from which a previously stored units list file (.UNT or .TXT) can be selected.  The unit strings in this file will then be displayed in the units list.

Save brings up a file save dialog that saves the current units list in a specified .UNT or .TXT file.  Note that EES will automatically read the SI_DefaultUnits.UNT or the ENG_DefaultUnits.UNT file, depending on the current unit system setting, if this file is found in the working directory.  Note:  if you make a change to the units list and Exit without clicking the Save button, the changes will be in effect only for the current EES session.

Add New allows a new unit string to be added to the current list.  Note that the information in this list is case insensitive.  EES will not add a units string if it already exists.

Merge will add all of the units strings in the currently open EES file to the existing units list file.

Remove will remove the selected units string from the units list.

Clear All will remove all units strings from the units list.

If any changes are made to the units list, the Exit button will be enabled.  Clicking the Exit button will close the dialog, keeping any changes that have been made, but without pasting any information into a window.  This behavior differs from the Cancel button in which the dialog is closed without saving any changes, and the Paste button in which the dialog is closed with the specified changes, but the selected units string is pasted into the window that was open when the units dialog was opened.

Note that you can edit the .UNT file with a text editor if you wish.  If the .UNT file is located in a write-protected directory, it will not be possible for EES to save any specified changes.  An error condition will be displayed.  This situation occurs when EES is run from a write-protected server.  In this case, it will be necessary to Save the units file into a directory that provides write permission to the user.  An ideal location is the working directory.  A units file, other than the default file, can be automatically loaded with the $INCLUDE directive.


Constants (Options menu)

EES allows the user to specify names for constants to simplify their use in equations.  The constants may have dimensions and values for both the SI and English system may be specified.  The constants are stored in the Constants.txt file.  The Constants.txt file should be placed in the working directory.  This file is automatically read when EES is started or when the EES.prf file is loaded.  An existing .PRF file in any directory can be loaded with the Load button in the Preferences dialog or with a $INCLUDE directive.

The Constants menu item in the Options menu will bring up a dialog displaying all constants that have been predefined.  The list of constants can be reordered by clicking on the column headings.  For example, to display the list of constant names in alphabetical order, click on Name at the upper left of the dialog.

Note that constants have a # symbol as the last character in their name.  The # symbol distinguishes constants from variables.  Like variables, the constants can be used in the equations in the Equations window.  Constants may have associated units which are used when the Check Units command is applied.  However, constants are not variables.  Their values cannot be changed and they do not appear in the Solution window or in the Variable Information dialog.  Constants are displayed with the value and units in the Formatted Equations window.

Two values are associated with each constant, depending on the choice of unit system (SI or ENG) made in the Unit System dialog.  The values and units that are displayed will change if the unit system is changed.  It is, of course, possible to have the same value in both sets of units.

Clicking the Paste button will copy the symbol name into the Equations window at the cursor position, so that it need not be typed.  The Done button will close the dialog window.

New constants can be entered directly by editing the Constants.txt file or more conveniently, by using the Add New Constant dialog that appears when the Add button is clicked.   If a new constant is added, a Store button will appear.  Clicking the Store button will store the modified constant information into the current Constants.txt file.


Add New Constant

The Add New Constant dialog simplifies the process of adding new constants to the Constants.txt file.  The alternative is to directly edit the Constants.txt file with a word processor.

The Name of the constant must be an EES variable name consisting of less than 30 characters.  It must begin with a letter and consist of letters and numbers.  It further must end with the # character.

The Description provides a physical description of the constant.

Each constant is associated with two values.  The value that is use is selected depending on whether SI or English units are selected in the Unit System dialog.  Edit boxes are provided for the value and units in both the SI and English system.  It is not necessary to enter both the SI and English system values, provided that the SI and English units are provided.  If one of the value fields is left blank, EES will automatically convert the value using the units that are provided.  The SI and English units must be compatible and they must be recognizable to EES.  The value and units may, of course, be the same in both unit sets if you wish.

Click OK to return to Constants dialog window.  The Paste button in that dialog will now appear as a Store button.  Clicking the Store button will write the changed constant information to the Constants. txt file in the working directory.


Unit System

The Unit System dialog, located on the first tab of the Preferences dialog, allows the units that will be used in the built-in mathematical and thermophysical property functions to be specified.

The unit system information will be changed just for the duration of the problem session if the OK button is pressed.  Note that the selected units are saved with other problem information when the Save or Save As command in the File menu is issued.  This information is then restored with the problem using the Open command.

The Store button will save the unit system information along with information on other tabs in the Preferences dialog in an EES Preferences (*.prf) file in the working directory.   Unit system specifications are saved with other file information when an .EES file is saved so that the Store button is needed only to store default values in a .prf file.   An existing .prf file from any directory can also be loaded with the Load button or with a $INCLUDE directive.

Specific Properties controls the units for specific enthalpy, internal energy, entropy, and volume.  When Mass Basis is selected, these property values will be determined on a per unit mass (kg or lbm) basis.  When Mole Basis is selected, the specific property values will be determined on a per unit mole (kmol or lbmol) basis.

The Energy Units group only appears when the Unit System is selected to be SI.  If J is selected, specific internal energy and enthalpy will be in units of J/kg or J/kmol, depending on the Specific Properties selection.  Specific entropy will be in J/kg-K or J/kmol-K.  A convenient choice of units is pressure in Pa and Energy in J since this combination avoids the need to provide a conversion factor of 1000 into equations.  However, with the Convert function and Unit Checking capabilities built into EES, the unit system choices are not really important in this respect.

The unit system information is only needed for built-in function calls.  EES does not provide automatic unit conversion for the values of variables although it can provide automatic unit checking of your equations.

Note that the unit system can also be set with the $UnitSystem directive and the current unit settings can be determined within an EES program using the UNITSYSTEM function.

When the Unit System is changed from SI to English or from Engish to SI, EES will load the default English or SI units list (SI_DefaultUnits.unt or ENG_DefaultUnits.unt), provided that no unsaved changes have been made to the current units list.  The files are stored in the working directory.

See also:  Preferences


Stop Criteria

Stop Criteria Parameters

EES is a numerical solver and, in most problems, it uses an iterative procedure to solve the equations that you have entered. The Stop Criteria tab of the Preferences dialog, shown below, allows the user to enter parameters control the accuracy of the iterative calculations. The calculations will be stopped if any of the four conditions are met.

Relative (as opposed to absolute) equation residuals are used to test convergence.  A relative equation residual is the difference between the left-hand and right-hand sides of an equation divided by the magnitude of the left-hand side of the equation, assuming its absolute value is greater than 1E-20.  Both the relative and absolute residuals can be viewed in the Residuals Window.

EES will stop the calculations if, during an iteration, none of the variables were changed by amount greater than the value provided in the 'Change in Variables <' parameter.  To eliminate this test, enter a small value such as 1E-20 for this parameter so that the calculations are stopped by one of the other criteria.

If the OK button is pressed, the changes made in the Stop Criteria parameters, as well as the parameters on other tabs, will be in effect only for this session.  Note, however, that the Stop Criteria parameters are stored along with other information in the .EES file when the Save or Save As command is used.  The setting are restored when the file is opened with the Open command.  If the Store button is pressed, all of the information in the Preferences dialog, including the Stop Criteria, will be stored in a specified .prf file in the working directory.  Alternatively, the Load button can be used to load a previously stored .PRF file from any directory.

See also:  Integration Parameters

                Preferences


Default Variable Information
Default Information (OPTIONS Menu)

Each new variable in the Equations window is assigned a guess value, lower and upper bounds, display format, and units.  These quantities can be changed using the Variable Info command in the Options menu.

By default, every new variable has a guess value of 1.0 with lower and upper bounds of -/+ infinity.  The default display format is Auto, which directs EES to select a display format which depends on the magnitude of the variable.  However, these defaults can be changed with this command based on the first letter of the variable name.  If, for example, all variables in your equations beginning with letter T are temperatures in K, you may want to set the default guess value for T to 300, with lower and upper bounds of 0 and 1000.  You may also want to set the display to F 1 corresponding to Fixed Decimal format with 1 digit to the right of the decimal point.  The default units for variables beginning with the letter may be entered in the units field. This units are used by EES for display purposes and in unit checking.

There are two ways to use the Default Information command.  If your problems tend to always use the same nomenclature, it is best to set the variable once and for all with the Store button.  The Store button will cause the variable defaults to be permanently saved so that they will be in effect at the  start of the program the next time EES is run.  The default variable information is stored along with other preferences in the EES.prf file.  The Default Information command can also be used to selectively change  the information for existing variables.  For example, if you set the  units for variables beginning with T to K in the Default Information dialog and select the OK button, then all existing variables which begin with letter T will be changed to have units of K.  Only the changes made in the Default Information dialog will be applied to existing variables.

The OK button sets the current default setting for this problems session only.

The Store button can be used in two ways.  In either case, a dialog will appear in which a filename can be entered.  If the filename extension is .DVI (Default Variable Information), EES will store the guess value, bounds and format as a function of the first letter of the variable name.  The .DVI files created in this way can be read when the Load button.  Alternatively, if the filename extension is .prf, the default variable information and all other defaults will be saved in an EES Preferences (*.prf) file.   Note that all default information including the unit system and tolerances, as well as the specifications in the Preferences dialog are stored in the .prf file in the working directory.   The EES.prf file is automatically loaded when EES is started.  An existing .PRF file in any directory can be loaded with the Load button in the Preferences dialog or with a $INCLUDE directive.


Show/Hide Diagram Tool Bar

This command is enabled when the Diagram window or a child Diagram window is foremost.  When enabled, selecting this command will toggle the state of the tool bar for the foremost Diagram window.  When the tool bar is visible, the Diagram window is in development mode.  Text and graphic objects such as (lines/arrows, rectangles, and ellipses) may be moved, changed or deleted in development mode.  An Align button is provided to facilitate alignment of objects relative to one another.  When the tool bar is hidden, all text and graphic objects are locked and the window is in application mode.  Input is accepted for input variables and calculations can be initiated using the input variables supplied in the Diagram window.  The tool bar visibility can also be toggled using the Diagram Window button on the speedbutton bar just below the menu bar.  See the description of the Diagram window for more detail.


Add Diagram Text
Add Diagram Text Button

The Add Text button on the Diagram window tool bar allows text of three types to be placed on the Diagram Window.  The text options are simple text, input variable, or output variable.

There are two ways to enter into this dialog window.  Selecting Add Diagram Text from the Options menu will create a new text item to be displayed on the Diagram window.  Alternatively, double-clicking the left mouse button (or clicking the right mouse button) on an existing text item or a selected set of text items in the Diagram window will allow modifications to be made to the characteristics of that text item or set of text items.

If the Text radio button is chosen a field will be provided to enter the text.  A panel will appear to the right of the radio button with small buttons to facilitate entry of subscripts and superscripts and symbols.  To enter a sub or superscript, select the text which is to be subscripted or superscripted and then click the sub or superscript button.  The three additional buttons to the right of the sub and superscript buttons facilitate entry of lower or upper case Greek letters and useful symbols.  The symbol entry buttons operate as follows.  Press and hold the mouse button down on one of the three symbol buttons.  A palette of symbols will be displayed to the right of the button.  While holding the mouse button depressed, slide the mouse cursor to the symbol palette and position it over the symbol you wish to select.  When the mouse button is released, that symbol will be added to the text item at the current insertion point.

If either the Input variable or Output variable radio buttons are selected, two check boxes will be visible with titles 'Include Variable Name', and 'Include Units'.  If the 'Include Variable Name' box is checked, the EES variable name and an equal sign will be placed to the left of the edit box (for an input) or displayed numerical value (for an output).  If the 'Include Units' box is checked, the units that have been specified for this variable will be displayed to the right of the edit box (input variable) or numerical value (output variable).

An Apply button is visible when a new text item is being developed.  The Apply button accepts the current characteristics and places the current text item on the Diagram window, just as if the OK button were selected.  In this way many text items can be generated without having to close the Add Diagram Text dialog window.  Clicking on the Cancel button, however, will remove all text items generated while this dialog window was open.

A series of text items in the Diagram Window can be selected in development mode (i.e., with the tool bar visible).  A red dotted box will be displayed around each selected item.  Pressing the right mouse button when more than one text item is selected will bring up a modified version of this dialog window in which the font, size, color, and style of the selected text items can be changed as a group.  This dialog also provides a facility for aligning the selected text items.  When it first appears, the dialog box displays the characteristics of the first selected text item.  Any change made to a text characteristic in the dialog window will be applied to all selected text items.  If a text characteristic, such as the font size, is not changed in the dialog window, then the font size of the selected text items will not be changed.  In this way, it is possible to align text items or change just their font without affecting other characteristics such as the size or color.

See the Diagram Window description for more information.


Preferences
Preferences (OPTIONS Menu)

The Preferences window has tabs that provide separate dialogs for:

Unit System

Stop Criteria

Integration Parameters

Program Options

General Display Tab

Equations Display Tab

Printer Display

Plot Options

Complex numbers

Default Directories

Pressing the OK button will set the Preferences for this session only. The Store button will cause the Preferences to be saved in an EES Preferences (*.prf) file.  Note that all of the information in the Preferences dialog  including the unit system, stop criteria and integration parameters are stored in the .prf file.

If the EES.prf file exists in the working directory, it will be automatically loaded when EES is started, effectively setting all of the program defaults.  Alternatively, an existing .prf file can be loaded from any directory with the Load button in the Preferences dialog or with a $INCLUDE directive.


Integration Parameters
Integration Auto-Step Parameters

EES uses numerical integration to determine the value of an integral or to solve differential equations.  The equation-based Integral function can use either a fixed user-supplied step or an automatic step adjusted to meet some accuracy criteria.  If a fixed step is used, an option is provided to use Richardson Extrapolation to improve the numerical estimate.  The parameters in the tabbed section of the Tolerances dialog, shown below, only affect the step size that EES automatically selects during numerical integration with the equation-based integral function.

The two radio buttons control whether EES will use a fixed or a variable step.  Note that this option is used only when the step size is not specified in the equation-based Integral function. If the "Use fixed step size' button is selected, EES will use a fixed step equal to the interval divided by the number of steps indicated by the user.  If the "Use Richardson Extrapolation" box is checked, the Richardson extrapolation algorithm will be used with the fixed step size.  If "Vary step at intervals of" is selected, EES will check the numerical situation of the integration process every N steps where N is input by the user.  During this checking process, EES may decrease, increase, or maintain the current step size.  The minimum and maximum allowable steps and tolerances which control whether the step size is changed are input by the user.  The test that is done is as follows:

Every N steps EES will compare the value of the integral for that step with the value obtained using two half steps.  The difference between these two values is the truncation error.  The truncation error is normalized by dividing it by the value of the integral for the two half-steps, assuming that it differs from zero.  If the normalized truncation error is greater than the value provided for 'Reduce step if rel. error >' the step size if reduced, assuming that it is greater than the minimum allowable step size.  If the normalized truncation error is less than the value provided for 'Increase step if rel. error <', the step is increased, provided that the increased step size does not exceed the maximum allowable step.  Otherwise, no change is made to the step size.

Note that there is an indirect relation between the Stop Criteria parameters and the integration truncation error parameters.  If the Stop Criteria parameters are set to allow convergence with errors larger than that used to reduce the step size, the calculation time and solution accuracy will both be adversely affected.

Also note that Richardson Extrapolation will not be used if the variable step size algorithm is employed.  However, if the step size is specified in the equation-based Integral command, e.g.,

Z=integral(X^2,X,0,1,0.1)

the specified step size (0.1 in the example above) is used overriding the setting made in this dialog.  If the "Use Richardson Extrapolation" box is checked, the extrapolation algorithm will be employed regardless of which radio button is selected.

________________________________________________________

Pressing the OK button will set the Stop Criteria and Integration tolerances for this session only.

Pressing the Store button will save the Integration tolerances along with all other information in the Preferences dialog an EES Preferences (*.prf) file.  EES will automatically load the EES.prf file when it is started if it is found in the same directory as the EES application.  An existing .prf file from any directory can be loaded with the Load button in the Preferences dialog or with a $INCLUDE directive.  Note that the Stop Criteria and Integration tolerances are saved with other file information when the file is saved so that the Store button should be used only to store default values in a .prf file

See also:  Stop Criteria

                Preferences


Options Tab (Preferences dialog)

Autosave every XXX minutes instructs EES to save all information at regular intervals.  The information is saved to a temporary .EES file that has the same name as the open EES file, but with a tilde (~) preceding the filename.  For example, file C:\EES32\ABC.EES will be autosaved as C:\EES32\~ABC.EES.  Under normal operation, the autosave file is deleted when a new file is created or opened or when EES is closed at the end of the worksession, so do not depend upon it for permanent storage.  You should always save any file that you intend to use at a later time using the Save or Save As commands. However, if EES quits unexpectedly, the last saved copy of the backup file should still be available in your directory.

Allow = in functions/procedure equations removes the forced distinction between the assignment statements in functions and procedures and the equalities used in the main body of the EES Equations window.  The equations used in functions/procedures are similar to those used in FORTRAN or Pascal.  In assignment statements, the variable on the left of the equation is set to the value on the right of the equation.  The equation X:=X+1 is permitted in a Function or Procedure, but not in a module or in the main body of EES.  To accentuate this difference, Functions and Procedures normally use the := sign (as in Pascal) rather than an = sign in the equations.  Select this option only if you wish to override this requirement.

Show function/procedure/module values controls whether the values of local variables used in Functions Procedures, Modules and Subprograms will be displayed in the Solution window.  If this control is selected, the local values of all Functions, Procedures, Modules, and Subprograms that appear in the Equations window will be displayed in separate tabbed windows in the Solution window after calculations are completed.   (Functions, Procedures, Modules and/or Subprograms that have been loaded from a library file will not be displayed.)  In addition, if the Check Units Automatically option described below is enabled, the unit checking in Functions, Procedures, Modules, and Subprograms will not be reported unless the Show function/procedure/module values is enabled.  This option can also be turned on or off with the $LOCAL directive.

Hide Solution window after change will cause the Solution, Arrays and Residuals windows to be hidden if a change is made to the Equations window after a calculation is completed.

Include a Sum row in the Parametric Table will display the sum of the values in each column of theParametric Table in the bottom row of the table.  The values in the Sum row are updated after the Solve Table or Min/Max Table calculations are completed.  The option can also be turned on or off with the $SUMROW directive.

Place array variable in the Arrays window allows array variables (variables which include brackets surrounding a subscript number) to appear in a separate Arrays window.   If this option is selected, the Arrays  window will automatically be created after calculations are completed showing all array values used in the problem in alphabetical order with the array index value in the first column.  This option can also be turned on or off with the $ARRAYS directive.

Display warning messages controls whether or not warning messages appear after calculations are completed.  Warning messages may be generated internally if, for example, thermodynamic property correlations are being applied beyond their range of applicability, or by the user with the WARNING procedure.  This option can also be turned on or off with the $WARNINGS directive.  Warnings will be visible in the Warnings window accessible from the Windows menu.  Note that the generation of warnings can in some cases significantly increase computational time.

Maintain a list of most recent files in File menu will, if selected, provide menu items for up to eight recently opened files.  Selecting any of these menu items will open the corresponding file, just as if the Open command were selected.  The file names are stored in a file called EES.FNL.  You can delete this file if you wish to reset the list.  This option should be disabled when there are multiple users, as in a network installation.

Display menu speedbar will, if selected, present a series of buttons on a palette directly below the main menu.  These buttons provide quick access to the most frequently applied EES menu commands.  The menu speedbar can be hidden by deselecting this option.

Check Units automatically will, if enabled, check the unit consistency of each equation when the Solution Window or Residuals window is displayed.  If the Show function/procedure/module values option in this dialog is enabled, the unit consistency for equations in internal functions, procedures, modules and subprograms will also be reported.  This option can also be turned on or off with the $CHECKUNITS directive.

Use enhanced convergence techniques will, if checked, algebraically rearrange equations into equivalent forms that converge more readily, reducing the need to provide guess values.

Return to Preferences dialog


General Display Tab (Preferences dialog)

The font and font size can be selected from the drop-down lists.  The new font and font size will display in all of the EES windows.  The printer display is unaffected.  The printer font and font size is selected separately in the Printer Display Tab.

Display subscripts and Greek symbols controls the appearance of EES variables in the Solution, Formatted Equations, Parametric Table and Diagram windows.  If this option is selected, the underscore will be used to signify the start of a subscript.  The following characters in the variable name will be displayed in smaller type and lower case.  Additional underscores within the same variable name will be changed into commas.  Array variables will also be changed to appear as subscripted variables.  Variables which have the name of Greek symbols, such as alpha, beta, and gamma, will appear in Symbol font.  If the variable name is entirely in capital letters, the Greek symbol will be shown as a capital letter.  A dot, double-dot, or bar can be positioned over the variable name by adding _dot, _ddot, or _bar to the name.  For example, X_dot=5 will display as:

X_infinity will display as X subscripted with the infinity symbol.

The vertical bar character signifies the start of a superscript.  For example, G|o will be displayed as:

|star will display a superscript * and |plus will display superscript +.

A complete listing of the formatting options is provided in the Greek and Special Symbols page.

The Calculated Table Values and Entered Table Values pertain to the display of values in the Parametric Table.  Entered table values are values which are provided by the user, either directly by typing the value or indirectly through application of the Alter Values dialog.  Calculated values are provided by EES during the Solve Table or Min/Max Table commands.  Two fields are provides for each category to set the color and the font style of the display.  Note that a separate font style can be selected for printing in the Printer Preferences tab.

Return to Preferences dialog


Equations Display Tab (Preferences Dialog)

EES can display comments in two different colors and/or styles which are selected by the user with the two drop drop down controls that follow the comment type label.  Comment Type 2 is distinguished from Comment Type 1 by having an exclamation character ! as the first character in the comment.  Both Type 1 and Type 2 commands must be enclosed within braces or single quotes.  If braces are used, the comment will be displayed in the Equations window but not in the Formatted Equations window.  For example,

{!This is a Type 2 comment}

"!This is also a Type 2 comment and it will display in the Formatted Equations Window}

"This is a Type 1 comment."

Display function names (as typed, lower case, upper case) affects the appearance of built-in function names (e.g, ENTHALPY, SIN).

Display keywords (as typed, lower case, upper case) affects the appearance of EES keywords (e.g., IF, FUNCTION, DUPLICATE, substance names)

Wrap long lines in the Equations window eliminates the need for the horizontal scroll bar.  Lines which are too long to fit within the window are wrapped to the following line.  The line continuation symbol (..) is displayed in the left margin to indicate that current line is a continuation of the previous line.

Display line break indicator controls whether the line continuation symbols indicating the position of line breaks will be visible.  This option is applicable only if word wrapping is in effect.

Display uniform case for variable names causes EES to change every variable name to the upper case or lower case sequence as it first appears in the Equations window when the equations are compiled.  Equation compilation only occurs as needed when the equation is changed.  To force recompilation (and thus reformatting) of the equations, select the Check/Format command.

Tab Stops sets the tab stops used in the Equations window.  One to five tab stops can be entered in this edit field, separated by spaces, as shown above.  The units of the tab stop settings are cm (in SI units) or inches (in English units). Tab stops can also be specified with the $TABSTOPS directive.  If a $TABSTOPS directive appears in the Equations window, the setting made in this field are overriden.

Return to Preferences dialog


Printer Display Tab (Preferences Dialog)

Font and size provide choices for the type in which the printed output will appear.

Printed output line spacing provides single, space and one-half, or double-space options.

Printed comment style 1 and Printed comment style 2 fields allow a font style to be set for each comment type.  Comment type 2 is distinguished from comment style 1 by having an exclamation mark (!) as its first character.  These controls allow the comments to be printed in a different style than is displayed on the screen.  This option is particularly useful when the comments are displayed in color on the screen but are to be printed on a black and white printer.

Print calculated table values and Print entered table values pertain to the printed appearance of values in the Parametric Table. Entered values are values in the Parametric table that have been directly or indirectly entered by the user.  Calculated values are filled by EES during the Solve Table or Min/Max Table commands. The screen display of these table entries is controlled with fields in the General Display Tab.  It is convenient to set the printed display differently than the screen display when color is used in the screen display and printing occurs on a black and white printer.

Note that the Printer Dialog provides a Print in color control.  If this option is selected, EES will attempt to print with the same colors as seen on the screen.

Indent long line in Equations window affects the printing of long equations or comments in the Equations window.  If checked, the second and following lines will be indented by about 3 characters.

Return to Preferences dialog


Plots Tab (Preferences Window)

In this tab of the Preferences dialog, controls are provided for setting default characteristics of the plots and the snap to grid option when moving text on the plot windows or diagram window.

The default characteristics that may be set are the plot width and height, the font, font size, font style, grid line visibility and color, and the major and minor tick sizes for the axis scales.  The plot width and height are entered in cm or in.  However, these inputs are converted to pixels and stored as an integer value.  Depending on your equipment and video setting, a pixel is either 1/96 or 1/120 inch.  The up/down arrow to right of the plot width and height boxes changes the plot size by 1 pixel for each click.

Ticks are the short line segments on the axis scale.  Major ticks are placed on the scale at the point where the axis numbers appear whereas minor ticks occur between the axis numbers.  Ticks which are drawn into the plot rectangle are represented with positive numbers.  The plot can be configured for outdented ticks by specifying negative values for the tick sizes.  These default characteristics are applied whenever a new plot is generated.

Resolution is relevant only when the Copy command is used to copy the plot to the Clipboard.  The plot will be copied to the clipboard as a picture (enhanced metafile), as a bitmap, or as both a picture and bitmap depending on the setting of the radio buttons in the Copy as box.  The resolution of the copy may be specified as  100, 300, 600, or 1200 dots per inch.   Higher resolutions generally produce a better image, but in the case of the bitmap copy, they result in much greater memory utilization particularly if the copy is done in color.  After a plot has been copied to the Clipboard, it can be pasted into another application using the application's Paste or Paste Special command.  If the plot is copied as both a picture and bitmap, the paste special command provides a choice of picture, picture (enhanced), bitmap, device independent bitmap.  Selecting Picture will paste the enhanced metafile.  The device independent bitmap will paste the bitmap.  You may want to test both of these options to see which provides the best choice for a high quality image in your application.

The Copy in Color check box controls whether the Copy command will reproduce the plot in color or in black and white.

Return to Preferences dialog


Complex Tab (Preferences Dialog)

This tab of Preferences dialog provides controls for complex number operations.

Complex number capabilities will be enabled only if the Do Complex Algebra checkbox is checked.  The imaginary operator (sqrt(-1)) can be represented with either letter i or j, depending on the radio button setting.  Changing this setting does not affect the Equations window.  If you change from i to j, you must manually change the text in the Equations window accordingly.

Return to Preferences dialog


Default Directories Tab

This preferences window allows three default directories to be specified.

Default file folder specifies the folder that EES will use for the Constants.txt, Units.txt and the units list (*.unt) files.  If this field is left blank, the default file folder will be the same folder as the working directory.  The Constants.txt, Units.txt and default unit  files found in the specified folder will be opened and read, replacing the information that may have been read earlier.  Also, EES will use the Default file folder whenever the Open or Save As... commands are issued.  If the directory specified in this field does not exist or if no directory is specified, EES will initially use the file folder that EES is located in and thereafter, it will use the last accessed folder.  The Default file folder provides a method of allowing each use to have his or her own personal settings although EES may reside on a write-protected network.  Note that the Default directory information is stored in the EES.prf file.  This file must be loaded in order to determine the default directory information.  EES will automatically load the EES.prf file found in the same directory as the EES application.  An existing .PRF file can be loaded from any directory with the Load button in the Preferences dialog or with a $INCLUDE directive.

When EES is started, it transparently loads library files  from the USERLIB folder located in the directory in which the EES application is located.  However, if a valid directory name is provided in the Additional user library folder field, EES will use also open all of the library files in this directory at startup.

Default macro folder is used when the Build Macro command (Professional version)  is issued.  If no folder name is provided, EES will use the directory in which EES is located.


Working Directory

When EES starts, it reads a number of files that contain information specified by the user.  This information is provided in the following files:

EES.PRF

The EES.PRF file stores the settings of many parameters specified in the Preferences dialog including the default unit system, the color scheme, plot defaults, and others.

UNITS.TXT

The UNITS.TXT file stores the units that EES recognizes and conversion information needed to use the Convert function and unit checking.

SI_DEFAULTUNITS.UNT and ENG-DEFAULTUNITS.UNT

The files provide a list of commonly used units that appears when you right-click in the Equations window, Solution window, or Variable Information.

CONSTANTS.TXT

The CONSTANTS.TXT file stores the user-specified constants and associate units that are viewed or added with the Constants menu command.

USERLIB folder

The USERLIB folder contains library files, external routines, the solid-liquid property data, user-supplied property data, textbook files, the Library manager, and other information configurable by the user.

Normally EES expects to find these files in the same directory as the EES application, i.e., the working directory is the directory that the EES application is in.  However, when the EES application is shared by multiple users, as in a network application, it is desirable for EES to look for these files in a user-specified working directory. The best way to specify the working directory in this situation is with a shortcut.  You create a shortcut by righ-clicking on the EES.exe file and selecting the Make Shortcut menu item.  Doing this will create a shortcut file (also called a .LNK file) with information that can be supplied to EES when it starts.  Right clicking on the shortcut icon will bring up the following dialog.

Specify the directory that is to be used as the working directory in the Start in:  field.  EES will thereafter look in this directory for the files noted above.  Note that, to operate as a working directory, the EES.PRF file must be placed in the specified directory.  The UNITS.TXT, CONSTANTS.TXT, SI_DEFAULTUNITS.UNT,  ENG-DEFAULTUNITS.UNT and the USERLIB folder can optionally be placed in this directory as well.  If found in the working directory, the UNITS.TXT, CONSTANTS.TXT, SI_DEFAULTUNITS.UNT,  ENG-DEFAULTUNITS.UNT will overwrite the information that may have been loaded in the EES application startup directory.  On the other hand, library files loaded from the USERLIB folder from the application startup directory will remain in memory.  Additional library files and property data can be placed in the USERLIB folder in the working directory.


Calculate Menu

All calculations in EES are initiated from one of the following commands in this menu.  Alt-C accesses this menu from the keyboard.

Check/Format

Solve

Solve Table

Min/Max

Min/Max Table

Uncertainty Propagation

Uncertainty Propagation Table

Check Units

Update Guesses

Reset Guesses


Check/Format
Check/Format (CALCULATE Menu)

The Check/Format command will recompile all equations in the Equations window.  The Equations Window display will be updated with the equation formatting options set with the Preferences command in the Options menu.  Any syntax error will be indicated with a message.  If no syntax errors are found, the number of equations and variables will be displayed.


Solve
Solve (CALCULATE Menu)

The Solve command will first check the syntax of any newly entered or modified equations in the Equations window.  If no errors are found, and if the number of equations is equal to the number of variables, the equations will be compiled and the solution algorithm will be initiated.   An information dialog will display the progress of the solution.  When the calculations are completed, click the mouse or press a key to remove the information dialog and view the solution which will appear in the Solution window.  If the number of equations is not equal to the number of unknowns, EES will present a dialog providing the option to view the Debug Window.  The Debug and Residuals windows may help identify missing variables or equations.

See also: Solve Table    Residuals


Solve Table
Solve Table (CALCULATE Menu)

Solve Table will initiate the calculations for each row in a selected or all Parametric Tables.  The name of the Parametric Table and the first and last runs for which calculations will be done are shown in the Solve Table dialog.  By default, the Parametric Table that is foremost in the Parametric Table Window is selected as the table for which caculations will be initiated.  Use the table name drop down control to choose a different table if necessary.

Each row of the table is a separate problem.  The range of rows in the table for which calculations are to be done can be specified.  The values of independent variables are shown in black.  Blank cells (or cells with normal type from a previous Solve Table command) are dependent variables and are shown in blue by default. (The font/color of the Parametric table columns can be set with the Preferences command.)  The values of these variables will be calculated and entered in the table.

The table name drop down control provides an option to initiate calculations for all tables currently existing in the Parametric Table Window. In this case, the row range for each table is either the range that was run during the last calculation for this table or the entire table if calculations have not been done previously.

If the Update guess values control is selected (shown with an X) the guess values for each run will be set to the calculated values from the previous run;  otherwise each run will be initiated with the guess values specified with the Variable Info command.

Normally EES will stop if an error occurs during the calculation, display an error message and highlight the equation that caused the error.  In some cases you may not wish to stop.  Unchecking the Stop if errir occurs control will cause EES to continue the calculations for the remaining rows in the table.  A message will be displayed after all of the table calculations are completed indicating the rows in which an error occurred.  Note that warnings that occur will be displayed in the Warnings window if the Show Warnings checkbox is selected in the General tab of the Preferences dialog or if a $Warnings On directive is provided.

If the Use Input from Diagram control is selected, values of variables will be set from text input field in the Diagram window before the table calculations are initiated.

If Automatic unit checking is enabled and the calculations fail the unit checking tests, a message will be displayed.  Unchecking the Show unit checking warnings will eliminate this message.  Automatic unit checking can be enabled or disable with a checkbox in the General tab of the Preferences dialog or with a $CheckUnits AutoOn directive.

If Solve in reverse order is checked, the table will be solved starting with the last run and proceeding to the first run.  Under most circumstances, the order does not matter, but it may affect the convergence when Update guess values is selected.

In the Professional version, the start and stop runs for the Parametric table calculations can be set to EES variables.  Clicking in the First Run box will allow a selection of First Run Number or First Run Variable.  If First Run Number is selected, a number corresponding to the first row in the Parametric table for which calculations are to be done is entered.  If First Run Variable is selected, as shown below, a drop down list appears from which an EES variable can be selected.  In this case, the variable is time_start.  The value of this variable is used as the first run.  The same capability is provided for the Last Run box.  The values of the variables should be between 1 and the number of rows in the table.  A warning will be issued is this is not the case.


Min/Max
Min/Max (CALCULATE Menu)

Min/Max is used to find the minimum or maximum of an undetermined variable in an equation set for which there is one or more (limited to 10) degrees of freedom.  EES will first check the syntax of the equations.  If no errors are found, a dialog window will appear presenting the undetermined variables in two lists.

Click the Minimize or Maximize radio button above the left list.  The variable which is to be minimized/maximized is selected from the list on the left by clicking on its name or using the up/down arrow keys.  The independent variable(s) whose value(s) will be changed in searching for the optimum are selected from the list on the right.  It is necessary to select as many independent variables as there are degrees of freedom (i.e., the difference between the number of variables and the number of equations).  The number of independent variables which must be selected is indicated above the right-hand list.  To select (or deselect) a variable using the mouse, click on its name in the list.  Using the keyboard, move the cursor to the variable name and press the space bar to toggle to the selection.

If there is one degree of freedom, EES will minimize/maximize the selected variable using either a Golden Section search or a Quadratic Approximations method, depending on the settings of the radio buttons at the bottom of the dialog box.  The Quadratic Approximation method is usually faster, but the Golden Section method is more reliable.  Multidimensional optimization may be done using the Direct Search,  Variable Metric or Genetic method.  The Variable Metric method, which uses numerical derivatives, seems to be the most efficient method (when it works). The Direct Search method is best for problems in whichh the optimum is constrained to be on a bound or when numerical derivatives are not reliable.  The Genetic method, available in the Professional version,  is surely the most robust but it is also the slowest of the methods.

EES requires finite lower and upper bounds to be set for each independent variable.  Careful selection of the bounds and the guess value(s) of the independent variables will improve the likelihood of finding an optimum.  You can view or change the bounds and guess value for each selected independent variable by clicking the Bounds button.  This will bring up an abbreviated version of the Variable Info dialog containing just the selected independent variables.  See the description of the Variable Info command for additional information on setting the bounds.

For all methods except the genetic method, the maximum number of times in which the equations are solved (i.e., the number of function calls) may be specified, along with the relative tolerance.  Calculations will stop if: 1) the relative change in the independent variable(s) between two successive steps is less than the specified relative tolerance; or 2) the number of steps exceeds the specified maximum.  EES will also stop the calculations if the equations cannot be solved with the specified value(s) of the independent variables within the tolerance and allowable number of iterations specified with the Stop Criteria command in the Options menu and the "Stop if error occurs" check box is checked.  In some cases, the error occurs because the choice of independent variable(s) is not valid and you do not wish the stop the optimization process.  In this case, uncheck the "Stop if error occurs" check box.

The Professional version provides an option to log the optimization results to a specfied text file.  Clicking the check box will allow two options:  logging of the the best points as they are found or logging of all points.  Each entry in the log file includes the value of the dependent variable (objective function), the value(s) of the independent variables and the number of function calls at this time.  The generation number is also logged for the genetic method.  These results are written as a tab-delimeted text file that can be read directly into WORD, EXCEL or other similar programs.

Note:  The Min/Max command can be used for other purposes, such as to find limits of integration.

The optimization calculations will begin after the OK button is clicked.  A dialog, similar to that shown below, will indicate the progess of the optimization process.  The current optimum value of the dependent variable (Q_dot_refrigeration in the example below) is shown below the elapsed time.  The values of the independent variables (FEED[1] and FEED[2] in the example below) are also displayed.  Both the current values, i.e., the values that are being tested at this time, and the best values, i.e., the values the produced the optimum shown below the elapsed time, are displayed.

Clicking the Abort button will terminate the calculations.  The values of the independent variable(s) will be set to the those values which resulted in the optimum value of the dependent variable.


Golden Section Search

The Golden Section search method is one of two methods used in EES to find a minimum or maximum when there is one degree of freedom.  The alternative method is the Recursize Quadratic Approximations method.  The Golden Section method is illustrated in the figure above.

EES requires that you specify the possible range for the independent variable, X, before the search begins.  This initial range is indicated by the values of a and b.  Trial points are located at a fraction g from each end of the range.  On each iteration, fraction (1-g) of the range is eliminated, as represented by the shaded area at the left of the graph.  The process is then repeated with the reduced range.   The trial points are again located at a fraction g from each end of the reduced range.  However, to minimize trial points, one of the two trial points from the previous iteration is reused.  This is point 2 in the figure.

The value of fraction g is dictated by the requirement that a point should be reused if it is not in a region that is eliminated.   After eliminating the area to the left of point 1, point 2 remains.  Point 2 was should now be situated so that it is fraction g from away from the new left bound.

At point 2:  g (b-a) - (1-g) (b-a) = g [(1-g) (b-a)]

Solving,   g = 0.61803 which is called the Golden Section.

Now point 3 is located at a position g away from the right bound and the process is repeated until one of the stopping critieria terminates the search.

Return to Min/Max.


Quadratic Approximations Optimization Method

The Quadratic Approximations optimization method is one of two methods used in EES to find a minimum or maximum when there is one degree of freedom.  The alternative method is the Golden Section method.

EES requires that you specify the possible range for the independent variable, X, before the search begins.  EES evaluates the objective function, f, at the bounds of this range and at one point within the range.  The objective function is then assumed to depend on X in a quadratic manner, i.e.,

f = a X^2+b X+c

Knowing the values of X and f at three points (the bounds and one point within the range) allows the coefficients, a, b, and c to be determined by solving 3 linear equations and 3 unknowns.  Next, the optimum value of the objective function is estimated by setting the derivative of f with respect to X to zero to yield Xopt=-b/(2*a).  The value of the objective function at this new value of Xopt is determined.  Ideally, this point has a smaller value of the objective function (for minimization) than any of the original trial points.  The point having the largest value of the objective function is eliminated and the process is repeated until convergence is achieved.

Return to Min/Max.


Direct Search (Conjugate Directions) method

The Direct Search optimization method is one of two optimization alternatives provided when the number of independent variables is greater than one.  The other alternative is the Variable Metric method.

This optimization algorithm is sometimes called the Conjugate directions method or Powell's method, after it originator.  The basic idea behind this method is to use a series of one-dimensional searches to locate the optimum which is a function of variables X1, X2, ....  Given a starting point, it seems reasonable to search for an optimum value of X1  holding X2, X3, etc. constant.  Then after finding the optimum value of X1, the process is repeated for the other dimensions.  The one-dimensional searches do not necessarily require numerical derivatives giving this algorithm an advantage when used with with functions that are not easily differentiable.  However, the procedure of searching for an optimum holding all independent variables except one constant is not necessarily efficient, as seen in the figure on the left.

It would be much more efficient to search along a set of directions that is conjugate to the objective function, as represented by Z1, Z2 in the figure on the right. The algorithm used in EES is due to Powell and described in Numerical Recipes, by Press et al, Cambridge University Press, 1989.  The method attempts to orient the search direction in the conjugate directions as additional information from each iteration is collected.

Return to Min/Max.


Variable Metric Optimization Method

The Variable Metric optimization method is one of two optimization alternatives provided when the number of independent variables is greater than one.  The other alternative is the Direct Search method.

The Variable Metric optimization method is basically a multidimensional version of the Quadratic Approximations method.  The basic idea is to fit the objective function to a quadratic function of all independent variables.  The quadratic function is then differentiated and set to zero to locate a new trial point.  An algorithm for the Variable Metric method is presented in Numerical Recipes, by Press et al, Cambridge University Press, 1989. The method necessarily requires numerical derivatives.  In fact, second derivatives (the Hessian matrix) are needed which may cause problems in some circumstances when the equations are not solved to tight tolerances.  As with the Quadratic Approximations method, when the Variable Metric method works, it works well and it is usually more efficient than the Direct Search method implemention in EES.   The algorithm is implemented in the following manner.

Return to Min/Max.


Genetic Method (Professional Version)

The genetic method is a robust optimization algorithm that is designed to reliably locate a global optimum even in the presence of local optima.  It is, however, quite slow.   This algorithm should be considered when the Direct Search and Variable Metric methods have failed and you are prepared to wait for calculations to reveal the true optimum point.

The genetic method implemented in EES is derived from the public domain Pikaia optimization program (version 1.2, April 2002) written by Paul Charbonneau and Barry Knapp at National Center for Atmospheric Research (NCAR).  A detailed explanation of genetic optimization algorithms in general and specific details of the Pikaia program are provided on the Pikaia website (http://www.hao.ucar.edu/public/research/si/pikaia/pikaia.html).  The information available on this website is the best source of information on the theory of the genetic optimization method implemented in EES.  The information provided below is not intended to substitute for the Pikaia documentation, but rather to provide the user with necessary information to effectively use this optimization method.

The genetic method intends to mimic the processes occuring in biological evolution.  A population of individuals (i.e., sample points) is initially chosen at random from the range specified by the bounds of the independent variables.  The individuals in this population are surveyed to determine their fitness (i.e., the values of the objective function as quantified by the value of the variable that is to be minimized or maximized).  Then a new generation of individuals is generated in a stochastic manner by 'breeding' selected members of the current population.  The characteristics of an individual that are passed on to the next generation are represented by encoded values of its independent variables.  The probability that an individual in the current population will be selected for breeding the next generation is an increasing function of its fitness.  The 'breeding' combines the characteristics of two parents in a stochastic manner.  Additional random variations are introduced by the possibility of 'mutations' for which the offspring may have characteristics that differ markedly from those of the parents.  In the current implementation, the number of individuals in the population remains constant for each generation.

The two parameters in the genetic method that are most responsible for identifying an optimum and for the associated computing effort are the number of individuals in a population and the number of generations to explore.  The parameters are controlled by slider bars in the Min/Max dialog, as shown below.

Numbers are not shown on the slider bars due to a lack of space.  The number of individuals can range from 16 (far left) to 128 (far right).  The number of generations ranges from 16 (far left) to 2048 (far right). For both slider controls, each tick mark represents a value that is a factor of 2 greater than the value at the position to its left.  There are a number of other parameters in the genetic algorithm (e.g., the mutation rate, the number of significant figures to encode, etc.).  These and others have been set to the default values suggested in the Pikaia program and are not changeable within EES.

Unlike the Direct Search and Variable Metric methods, the genetic method is not affected by the guess values of the independent parameters.  However, the lower and upper bounds on the independent parameters are extremely important since the initial population and subsequent stochastic selections are chosen from within the bounds.  Use care in selecting the bounds.

As mentioned previously, the genetic method is robust but slow.  The number of function evaluations required is approximately equal to the product of the number of individuals and the number of generations.  Setting both slides to their rightmost positions will result in more than 262,000 function evaluations.  Depending on the complexity of the objective function, the calculations may require just short of forever to complete.  The progress of the optimization is displayed during the calculations, as shown below.  The best value of the objective function that has been found is displayed in green type below the elapsed time.  The values of the independent variables that produced this optimum are shown in the 'Best value' column at the bottom right.  The number of generations completed is represented by the progress bar above the Abort button.  Should you tire of waiting for the calculations to complete, you can click the Abort button.  The Solution window will then display the best point found up to time when the calculations were terminated.

Return to Min/Max.


Min/Max Table
Min/Max Table (CALCULATE Menu)

Min/Max Table provides the same capability as the Min/Max command, except that the calculations will be repeated for each row in the selected Parametric Table.  When there are more than one Parametric tables, the selected Parametric table is the one that is foremost in the Parametric Table Window when the Min/Max Table command is issued.  The name of the Parametric Table for which the optimization will be done is shown in a text box at the lower right of the dialog.

A dialog window, very similar to that shown for the Min/Max command, will appear in which the variable to be maximized or minimized and the independent variable(s) can be selected.  In this case, however, the variable which is to be optimized and all of the independent variables (whose values will be varied in seeking the optimum) must appear in the Parametric Table.  The start and stop runs in the Parametric Table for which the calculations will be done may be specified.  Values in the Parametric Table which are shown in black type (on a color monitor) are fixed and are treated just as if they were set to that value with an equation in the Equations window. The variable which is optimized and the independent variable(s) must be the same for each run.  If no errors are encountered, the optimum is computed and the values of the remaining columns in the table are entered for each run.


Update Guesses
Update Guesses (CALCULATE Menu)

Update Guesses replaces the guess value of each variable in the Equations window with the value determined in the last calculation.  This command improves the computational efficiency of an EES calculation since it ensures that a consistent set of guess values is available for the next calculation.  Exactly the same function is provided with the Update button in the Variable Info dialog window, but this command is more accessible.


Reset Guesses
Reset Guesses (CALCULATE Menu)

Reset Guesses replaces the current guess value of each variable with the default guess value for that variable.  Unless otherwise specified, the default guess values of all variables are 1.0.  This command should be used only if you experience convergence difficulties and wish to try solving the equation set again with the guess values set to their default values.


Check Units

The Check Units command will check the  dimensional and unit conversion consistency of all equations in the Equations window.  The unit checking will be extended to equations in internal functions, procedures, Modules and Subprograms if the Show Function/Procedure/Module values option in the Options tab of the Preferences dialog is selected or if a $LOCAL ON directive is provided in the Equations window.  The results are reported in the Debug window.

It is necessary to enter the units of each variable for the checking process to function.  There are three ways to enter the units for variables.

  1.  Entering units in the Equations Window

The units of a numerical constant in the Equations window can be set by enclosing the units in square brackets following the value.  For example:

P=140 [kPa]

When EES executes this statement, it will recognize that P is set to a numerical constant and the units of P will set to those of the constant, unless they are already set to something else.

Note:  In previous versions of EES, it was possible to set the units of a variable using a comment.  This capability is no longer provided.  The information within a comment not used by EES for any purpose.  However, the units of any variable appearing in the Equations window can be set by selecting the variable and clicking the right mouse button.  A popup menu will appear with a Variable Info item.  Selecting the Variable Info menu item will bring up the following dialog window in which the format and units of the selected variable can be specified.

Note that the units can be selected from a list of units by right-clicking while the cursor is positioned in the Units field of the above dialog.

  2.  Entering units in the Solutions Window

After solving an equation set, variables are displayed in the Solution window.  The units of a variable can be entered from the Solution window by clicking the right mouse button on the variable.  The units of more than one variable can be set at one time by clicking the left mouse button on each variable that is to have its units changed and then clicking the right mouse button.  The units of all selected variables will be changed.  Note that the variables in internal functions and procedures are not displayed in the Solution window unless the "Show Function/Procedure/Module values" checkbox in the Options tab of the Preferences dialog is selected or a $LOCALVARIABLES ON directive is provided in the Equations window.

 3.  Entering units in the Variable Information dialog window

Variables in the main program and in modules and subprograms can be entered in the Variable Information dialog window.  A similar window is provided for internal functions and procedures when right-clicking on an equation in the Debug window while using the Check Units command.

The checking algorithm cannot know the units of pure constants that do not have dimensional information, so it is best to avoid them in your equations.  Instead it would be preferable to set the units of the constants (by appending the units in brackets), define constants or use the Convert function.  For example, suppose you have two variables, L_inch and L_feet, whose units are set to inches and feet, respectively which are used in the following equation.

L_inch=L_feet*12

When the Check Units command is issued, the Debug window will appear and this equation will be flagged as having an error because the units of 12 are not known.

There are several ways to correct this problem.  Perhaps the simplest is to assign units to the numerical constant, 12, so that the equation reads

L_inch=L_feet*12 [in/ft]

Alternatively, the Convert function can be employed as shown next

L_inch=L_feet*convert(ft,in)

The Check Units command will display the equation and an explanatory message for each equation that is found to have dimensional consistency or unit consistency errors.  If you click the left mouse button on an equation, the focus will jump to that equation in the Equations window.  If you click the right mouse button on an equation, an abbreviated form of the Variable Information dialog window will appear showing just the variables that appear in that equation.

If the "Check Units Automatically" checkbox in the Options tab of the Preferences dialog is selected or a $CHECKUNITS ON directive appears in the Equations window, units of all equations will be automatically checked when the equations are solved.  A summary of the unit checking process will appear in the Solutions window.

See also: 	Solution Window

Unit Conversion Info


Uncertainty Propagation

In many cases, an important quantity is not directly measured by rather calculated as a function of one or more variables that are directly measured, i.e., Y = f( X1, X2, ....).  The measured variables, X1, X2, etc. have with a random variability which is referred to as its uncertainty.  In EES, that uncertainty is displayed with a ± symbol, e.g., X1 = 300 ± 2.

The purpose of this command is to calculate how the uncertainties in each of the measured variables propagate into the value of the calculated quantity, Y.   The method for determining this uncertainty propagation is described in NIST Technical Note 1297 (Taylor B.N. and Kuyatt, C.E., Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results, National Institute of Standards and Technology Technical Note 1297, 1994).  Assuming the individual measurements are uncorrelated and random, the uncertainty in the calculated quantity can be determined as

where U represents the uncertainty of the variable.

After selecting this command, EES will present two lists of variables.  Select the variable for which the uncertainty propagation is to be determined from the list on the left.  Select one or more Measured variables from the list on the right.  To specify the uncertainty associated with the Measured variables, click the Set Uncertainties button below the right list.  A second dialog window will appear in which the absolute or relative (fraction of the measured value) uncertainties for each selected measured variable can be specified.  An uncertainty value for each measured variable must be provided.  Click the OK button to set the uncertainties and close the Specify Uncertainties dialog window.  Click the OK button Uncertainty Propagation dialog to start the calculations.

Note that the variables initially appearing in the Measured variables list are constants, i.e., values that are independent of the values of other variables.  However, some variables (shown in red) that initially appear in the Calculated variable list can be moved to the Measured variables list.  For example, consider the following simplistic set of equations.

Row=1

X=Lookup('Lookup 1',Row,1)

Y=Lookup('Lookup 1',Row,2)

Z=X^2+Y^3

In this case, X and Y are read from the first row of a Lookup table.  Z is a function of X and Y and the uncertainty propagation of X and Y into Z is to be determined.  Selecting the Uncertainty Propagation command produces the following display:

Row is the only variable initially appearing in the Measured variables list since it is the only variable that is completely independent of all other variables.  However, X and Y (which are both functions of Row) can be moved the Measured variables list by selecting each variable and then clicking the arrow button (or dragging the selection to the Measured variables list).  After this is done, the display will appear as:

and the uncertainty propagation of X and Y into Z can be determined as intended.

After the calculations are completed, EES will display an abbreviated Solution Window containing the calculated and measured variables and their respective uncertainties.  The uncertainty associated with the calculated variable can be assigned to another EES variable using the UncertaintyOf function.  The partial derivative of the calculated variable with respect to each measured variable will be displayed.  In addition the % of the total uncertainty in the calculated variable resulting from the uncertainty in each measured variable will also be displayed.  This % is calculated as the ratio of the square of the product of the partial derivative and uncertainty of each measured variable to the square of the uncertainty in the calculated variable.

See also:  	Uncertainty Propagation Table

UncertaintyOf


Uncertainty Propagation Table

This command provides the same function as the Uncertainty Propagation command, namely the determination of the uncertainty propagation in a calculated variable.  The difference is that this command allows the uncertainty calculations to be repeated for one or more measurements in a selected Parametric Table.  The Parametric Table for which calculations will be done can be selected with the drop-down control at the upper right of the dialog.

The calculated and measured variables must all be in the Parametric Table before this command is used.  After selecting the command, the Uncertainty Propagation dialog window will appear in which the calculated quantity is selected from list of variables in the left list and the measured variable(s) are selected from the list on the right.  Note that all variables that participate in the uncertainty calculations must be the same Parametric table.

After selecting the Uncertainty Propagation Table menu item, a dialog will appear in which variables in the Parametric table can be selected for the uncertainty calculations, as in the following example.

The uncertainty values associated with the measured variables can be set by clicking the Set uncertainties button.

Note that the absolute or relative uncertainty can be specified with a numerical value or with a variable that appears in the Parametric table with specified values, e.g., U_t in the above example.

The Parametric Table calculations will proceed after the OK button is selected, just as if the Solve Table command were applied.  The value and uncertainty for the calculated variable and each measured variable will be displayed in the Parametric Table after the calculations are completed.  The calculated variable can then be plotted with error bars representing the propagated uncertainty using the New Plot Window command.  If a sum row is displayed in the Parametric table, the uncertainty value shown will be the square root of the sum of the squared values of the uncertainties in all rows.  This value is an estimate of the uncertainty of the sum.  The sum row can be made visible or hidden using the Preferences command.

See also:  Uncertainty Propagation


Tables Menu

The Tables menu contains three sets of commands.  The first set of commands provides capability to set up and alter the data of a Parametric Table.  The Parametric table operates in a manner similar to a spreadsheet.  The power of the Parametric table is that it allows the equations in the Equations window to be solved repeatedly while varying the values of one or more of the variables.  The second set of commands provides capability to create, manipulate, and save a Lookup Table.  A Lookup Table can be used to provide tabular data from which EES will interpolate using the Lookup, LookupCol, and LookupRow functions.  The third set, which consists on just one command, provides multiple linear regression for the data in the Parametric, Lookup, Arrays or Integral Table data.

New Parametric Table

Alter Values

Retrieve Parametric Table

Store Parametric Table

Insert/Delete Runs

Insert/Delete Vars

Delete Parametric Table

New Lookup Table

Open Lookup Table

Save Lookup Table

Insert/Delete Lookup Rows

Insert/Delete Lookup Cols

Delete Lookup Table

Linear Regression


New Parametric Table
New Parametric Table (TABLES Menu)

New Parametric Table creates a new Parametric Table, deleting any existing table.  The Parametric Tables is used in EES to automate repetitive calculations with different values of one or more variables.

A dialog window will appear into which information must be entered in order to construct the table.  The number of runs, which corresponds to rows in the table, is entered in the box at the top.  All variables (both independent and dependent) which are to appear in the table are selected from the alphabetical list on the left.  To select a variable, click on its name or use the up/down arrows to move the cursor onto the name.  Hold the Shift key down to select a range of variable names. Click the Add button to move the selected variables to the list on the right.  (As a shortcut, double-clicking the mouse on a name in the list will both select and add that variable to the list on the right.)  The variables in the right-hand list will each be assigned a column in the Parametric Table in the order in which they appear in the list.  A variable can be removed from the table list on the right by clicking on its name in the right list and then clicking the Remove button or by double-clicking on its name.  Pressing the OK button will create the Parametric Table, overwriting any existing table.

The Parametric Table operates somewhat like a spreadsheet.  Numerical values can be entered in any of the cells.  Entered values are assumed to be independent variables and are shown in black type on a color monitor.  Dependent variables calculated by EES are shown in blue (color monitor) or with a preceding arrow mark.  Entering a value in a table produces the same effect as setting that variable to the value with an equation in the Equations window.  Dependent variables will be determined and entered into the table when the Solve Table or Min/Max Table command is issued.  If a variable is set in the table, it should not also be set in the Equations window;  otherwise the problem will be overspecified.  Each row of the table is a separate calculation.  The independent variables may differ from one row to the next.  However, for every row, the number of independent variables plus the number of equations in the Equations window must equal the total number of variables in the problem.


Alter Values
Alter Values (TABLES Menu)

Alter Values provides an automatic way to enter or clear the values in a Parametric Table of a variable for multiple runs.  This capability can also be accessed left-clicking on the triangular icon [image] in the upper right corner of the table header cell or by right-clicking in the column header cell and selecting Alter Values from the pop-up menu that appears.  Either method will bring up the Change Table Column Values dialog which provides the capability to enter patterns of values, in addition to the capabilities provided by the Alter Values menu command.  Of course, it is also possible to simply type (or delete) the values directly into a Parametric table.

The runs (i.e., rows) affected are specified at the upper left of the dialog window and the name of the Parametric table is shown at the upper right.  If there is more than one Parametric Table, clicking on the table name will allow other Parametric tables to be chosen.   The variable for which changes are to be made is selected from the list by clicking on its name or by using the up/down arrow keys.  The column in the Parametric Table for this variable will be cleared if the Clear Values radio button is selected.  If Set Values is selected, values for the selected variable will be entered automatically in the table starting with the value in the First Value input box.  Successive values in the table will be generated using one of the following choices depending on the setting of the list box just below First Value.

Last Value - 	an increment such that the last value is as specified

Increment -  	the specified fixed increment

Multiplier - 	the specified fixed multiplier

The OK button will insert the specified values into the Parametric Table and then exit the Alter Table dialog.  The Apply button will also insert the specified values into the Parametric Table, but control will remain in the Alter Values dialog window so other changes can be made.  The Cancel button will return the Parametric table to the same state it was in before the Alter Values command was issued.

The numerical values entered in a table, either from the keyboard or through the Alter Values command, identify independent variables in the equation set;  they are shown in black type, distinguished from the dependent variables calculated by EES which are shown in blue, by default.  The colors for dependent and independent values can be chosen in the Preferences dialog.   Independent variables are fixed to a constant for each run, just as if there were an equation in the Equations Window setting the variable to the constant.  Dependent variables are automatically entered in the table with the Solve Table or Min/Max Table commands.  If a value is set in a table, it should not also be set in the Equations window;  otherwise an error message will be displayed indicating that the problem has been overspecified.


Retrieve Parametric Table

The Retrieve Parametric Table command will read a specified .PAR file and restore the Parametric table to the same condition it was in when the Store Parametric Table command was issued.

The Retrieve Parametric Table command was originally developed to overcome the limitation of a single Parametric Table in earlier versions of EES.  However, EES now allows an unlimited number of Parametric Tables to be defined, so it should no longer necessary to Store and Retrieve Parametric Tables.  The Retrieve Parametric Table is provided to allow Parametric Tables saved in older versions of EES to be opened and to allow Parametric Tables from one EES file to be ported to another EES file.


Store Parametric Table

Store Parametric Table saves the selected Parametric Table to a binary disk file which, by default, has a .PAR filename extension.  All information related to the Parametric Table is saved.  The file can later be read to recreate the table with the Retrieve Parametric Table command.

The original purpose of the Store and Retrieve Parametric Table commands was to get around the EES implementation limit of one Parametric Table in older versions of EES.  EES now allows an unlimited number of Parametric Tables which eliminates this reason for using these commands.  However, it is possible to create a Parametric Table in one EES file and Retrieve that table in a different EES file.  If the variables in the table are not already defined, EES will create them.


Insert/Delete Runs
Insert/Delete Runs (TABLES Menu)

Insert/Delete Runs allows the number of runs in a selected Parametric Table to be changed by inserting or deleting one or more rows in the table at a specified position.  The Parametric Table for which this change is to be applied is selected from the drop-down control at the top of the dialog.


Insert/Delete Vars
Insert/Delete Variables (TABLES Menu)

Insert/Delete Vars allows additional variables to be added to or removed from a selected Parametric Table.  The Parametric Table for which this command is to be applied is selected from the drop-down control at the top of the dialog. This command also allows the columns in the Parametric Table to be placed in a different order.

The list on the right shows the variables which currently appear in the Parametric Table.  Variables which appear in the Equations window are shown in the list on the left.  To add a variable to the Parametric Table, click on its name (or use the up/down arrow keys), causing it to be highlighted.  Click the Add button to move the highlighted variable name to the list on the right.  (Double-clicking the mouse on a variable name in the left list both selects that variable and adds it to the list on the right.)  A variable can be deleted from the table by selecting it from the list on the right, followed by clicking on the Remove button or by double-clicking on the variable name.

Variables will appear in columns of the Parametric Table in the same order as they appear in the list on the right.  The order of the variables in this list can be changed by pressing and holding the left mouse button on a variable name while sliding it up or down to a new position in the list.  The column order of an existing Parametric table can also be changed by clicking on the column header cell as described which will bring up the Format Table Column dialog.


Delete Parametric Table
Delete Parametric Table (TABLES Menu)

The Delete Parametric Table command will, present a dialog that shows all Parametric Tables in the Parametric Table Window. Select the Parametric Tables that you wish to delete by clicking on their names in the list.  Selected files will be deleted when the OK button is clicked.


New Lookup Table
New Lookup Table (TABLE Menu)

This command will create a new Lookup Table with the specified number of rows and columns.  A name must be provided for the Lookup Table.  This is the name that must be used with commands that use the Lookup Table, including the Lookup, Lookup$, LookupRow, Interpolate, and Differentiate commands.  The name will appear on a tab at the top of the Lookup Table Window.  Additional information can be found in the description of the Lookup Table Window window.


Paste Special (Lookup Table)

Data can be pasted into a Lookup Table via the Clipboard from another application, such as a spreadsheet.  The Paste command will initiate the paste, starting in the row and column in which the cursor is located.  However, the names of each column and the units cannot be pasted in this manner.  The Paste Special command has been developed to provide this capability.

If text data are contained in the Clipboard, the Paste Special control will appear in the upper left cell of the lookup table, as shown.

Clicking on the Paste Special Control will bring up the Paste Special Options dialog shown below.

Paste data starting in row 1 provides a normal paste of data into the Lookup table starting in row 1.  This capability is same as that provided by the Paste command except that in this case, the paste starts in row 1 and the specified column, rather than in the row and column in which the cursor is located.

Paste column names and data assumes that the first row of data on the Clipboard contains the names of each column, separated by tabs.  The second and subsequent rows of information on the Clipbaord are assumed to be data that is pasted into the Lookup table, starting in row 1 and the specified column.  Note that each item in a row of data is separated by a tab character and each row is terminated with a carriage return.  This is the standard format provided by the copy command in spreadsheet and other applications.

Paste column names, units, and data is similar to the previous option, except that the second row of data on the Clipboard is assumed to contain the units that should be assigned to each column. After pasting the column names and units from the first two rows of Clipboard information, pasting will continue to paste data into the Lookup table starting in row 1 and the specified column.


Open Lookup Table
Open Lookup Table (TABLES Menu)

The Open Lookup Table command will read the data in a Lookup file stored on disk into a Lookup Table in the Lookup Table Window.   There are three Lookup File Formats, and all three can be opened with the command.  In addition to being read into the Lookup Table, Lookup files can be accessed directly with Interpolate, Differentiate,   LOOKUP, LOOKUPCOL, and LOOKUPROW functions.

Lookup Tables must have a name to be used with functions that operate on the Lookup Table data.  The name that is given to the Lookup Table that is read in is the filename without the drive and filename extension.  The name appears on a tab at the top of the Lookup Table Window.  You can change the name by right-clicking on the tab.

See the descriptions of the Lookup File Formats,  Lookup Table window and the Differentiate, Interpolate,  LOOKUP, LOOKUPCOL, and LOOKUPROW functions for more information.


Save Lookup Table
Save Lookup Table (TABLES Menu)

The Save Lookup Table command will save the data in a selected (foremost) Lookup Table into a Lookup file on disk.  There are three possible Lookup file formats, and all three formats can be saved with this command.  The binary format (.LKT) saves all Lookup Table information in the file including the column heading, units, and display format.  The file can then be read into another EES program with the Open Lookup Table command.  The .TXT format saves all Lookup table information in an ASCII file.  It is somewhat slower and less efficient than the binary .LKT files, but it has the advantage of being directly readable.  The  .TXT format is necessary when you wish to export the Lookup Table data to another computer system.  The .CSV format saves only the data as a comma-delimited ASCII file. (Note semicolons are used for European format.)  The  .CSV format is necessary when you wish to export the data to another application, such as a spreadsheet.

Data stored in a Lookup File on disk can be directly accessed with Interpolate, Differentiate,   LOOKUP, LOOKUPCOL and LOOKUPROW functions.

Older versions of EES could only have one Lookup Table, which necessitated the saving of Lookup files on disk.  EES can now have any number of Lookup Tables.  The Save Lookup Table command is only needed when date in one EES program must be moved to another program.  Copy and Paste can also be used for this purpose.


Insert/Delete Rows
Insert/Delete Lookup Rows (TABLES Menu)

This command will allow one or more rows to be added or removed from an the specified Lookup Table in the Lookup Table Window.   Select the name of the Lookup Table for which the change is to be made from the drop-down list at the top of the dialog. Note that rows in a Lookup Table can be delete more simply by clicking in the row header (in the leftmost column) to select the row followed by pressing the Delete key or selecting the Delete command in the Edit menu.

Related topics: Lookup Table, New Lookup


Insert/Delete Cols
Insert/Delete Lookup Cols (TABLES Menu)

This command will allow one or more columns to be added or removed from an existing Lookup Table in the Lookup Table Window..  Select the name of the Lookup Table for which the change is to be made from the drop-down list at the top of the dialog.  Note that columns in a Lookup Table can be delete more simply by clicking in the column header to select the column followed by pressing the Delete key or selecting the Delete command in the Edit menu.

Related topics: Lookup Table, New Lookup Table


Delete Lookup Table
Delete Lookup (TABLES Menu)

The Delete Lookup Table command will, present a dialog that shows all Lookup Tables in the Lookup Table Window.  Select the Lookup Tables that you wish to delete by clicking on their names in the list.  Selected files will be deleted when the OK button is clicked.


Linear Regression (TABLES Menu)

This command provides regression capability for the data in the Parametric, Lookup,  Arrays, or Integral tables.   Note that the Curve Fit command in the Plot menu also provides regression capability but only one independent variable can be considered.  With the Linear Regression command, the data in any column can be regressed as a function of the data in up to six other columns.

First select the table you wish to operate on from the drop-down controls at the upper right and the starting and stopping rows in that table.  Specify the dependent variable by clicking on the variable name in the list on the left.  The independent variable(s) are selected by clicking on the names in the list on the right.  To deselect an item, click it a second time.  For example, suppose you have a Lookup Table with three columns having titles A, B, and C.  To  determine a correlation representing A as some function of B and C, select A from the list on the left, and B and C from the list on the right.

The dependent variable will be represented as a linear polynomial function of the independent variables.  The order of the polynomial is set by clicking on the 'spin button' up or down arrows.  The polynomial order may be 0 to 6.  If the cross-terms box is selected then terms involving the product of the independent variables will be included in the correlation.  As any information relating to the equation form is entered, a representation of the equation to be fit is displayed in the box at the bottom.

You may wish to exclude some terms from the regression.  This is done simply by clicking on the term.  This action will enable the Exclude button.  Click the Exclude button to remove the term from further consideration.  It is displayed within a crossed-out red box.  If you wish to later include an excluded term,  click on it.  The Exclude button should now be titled Include.  Click the Include button.

Click the Fit button.  If the fitting process is successful, the fitted equation will appear in the display box.  The Stats button will been enabled.  Clicking the Stats button will provide a table listing all of the coefficients, their associated standard errors, and other statistics such as the root-mean-square (rms) error, the bias error, and the R^2 value.   The coefficients can be copied to the Clipboard by checking the 'Copy to clipboard' box.  The Fit button will now be titled Copy and the Cancel button will be titled Done.  Either button will dismiss the dialog window.  The Copy button will first copy the fitted equation to the clipboard.  You can then paste this equation into an EES worksheet.  Note, however, that the Copy process will overwrite any other information in the Clipboard, such as the coefficients copied from the Regression Statistics dialog window.


Plot Menu

The Plot menu contains commands to prepare a new plot of the data in the Parametric, Lookup, or Arrays Table, or modify the appearance of an existing plot.  The plots may be X-Y, bar, or contour plots.  Also available are commands to generate property plots and curve fits to plotted data.

New Plot Window

Overlay Plot

Modify Plot

Modify Axes

Show/Hide Toolbar

Delete Plot Window

Property Plot

Curve Fit

All plots appear in a tabbed Plot Window.  Right-clicking on a tab will bring up a dialog in which you can rename, delete, or duplicate the plot.  The tab position can also be changed in this manner.  A Plot window tool bar is provide to add text and objects such as lines and rectangles to the plot


New Plot Window (Plot Menu)

EES plots may be generated from data in the Parametric, Lookup, Arrays or Integral tables.  The New Plot window command will display a submenu showing the three basic plot types that can be generated.   There is no intrinsic limit on the allowable number of plot windows.  All plot windows are saved with other program file information when the Save or Save As commands are applied.  Once created, the plots can be modified or copied using the Plot Window controls.

X-Y Plot

Bar Plot

X-Y-Z Plot


X-Y Plot

The New Plot Window | X-Y Plot command allows one or more variable(s) defined in the Parametric Table, the Lookup Table,  the Arrays Table or the Integral Table to be plotted as a function of any other variable in the table.  (When the $IntegralTable directive is used with the Solve Table command, an Integral Table is produced for each run (i.e., row) of the Parametric Table.  The control to the right of the Integral Table radio button allows the run number to be changed by clicking on the up/down arrows or by directly entering the run number.)  The plot is drawn in a new plotting window.  The information needed to produce the plot is specified in the New X-Y Plot Window dialog window.  All of the information specified in this dialog window can be modified later using the Modify Axes and Modify Plot commands.

The Tab Name is the name that will appear on the tab of the Plot Window.  The name you enter can be up to 80 characters in length, but shorter tab names are preferable.  The Description edit field can be used to enter a description of the plot contents or any other information you wish to save.  The description can be up to 255 characters in length.  It is saved with the plot window.  The description will be printed when the plot is printed if the check box at the upper right of the dialog is checked.  The description and printing option can be later modified by right-clicking on the tab for this plot in the Plot Window.

Select the table which is to be plotted with the radio buttons in the upper right of the dialog window.  The runs (or rows) for which values will be plotted is indicated in the input boxes at the upper right just below the table radio buttons.  The variables to be plotted on the X and Y axes are selected from the lists by clicking on their names, using the scroll bar or up/down arrow keys, if necessary to bring the variable names into view.  One or more Y-axis variables can be selected.  Clicking on an unselected variable name selects that variable, while clicking on a selected variable unselects it.  A separate plot line will be generated for each selected Y-axis variable.  All selected variables will be plotted with the same axis scale.   Strings, rather than numerical values can be plotted on the X-axis.  See Plotting Strings for details.

The two fields to the right of the word Format control the format of the numbers appearing in the scale for each axis.  The first field can be an A, E or F.  F and E format the numbers on the scale with a fixed number of decimal places or exponential notation, respectively. The number of decimal places (for fixed notation) or significant figures (for exponential notation) is entered in the second field as a single digit number between 0 and 9.  A (for automatic) chooses the E or F option format and the number of digits automatically to produce an appropriate presentation of results.  The Mininum. Maximum, and Interval fields control the scaling of each axis.  These fields will initially be filled with values which provide an appropriate choice of scale.  The axis number format and number of digits will also be automatically selected.  Any of these defaults may be changed.

Grid lines will be drawn on the X and/or Y axes if the Grid Lines check boxes are selected (shown with an X).  The number of grid lines or major tick marks drawn for each axis is determined by the value entered in the Interval field.

The plot may be formatted in a variety of ways.  Clicking the spin box arrows to the right side of the Line list box toggles the display through a list of the available line types.  Click on the desired line type or make a selection with the up and down arrow keys.  The plot symbol and line color are chosen in a similar manner.  If more than one Y-axis variable  is selected, the symbol and color list boxes will display 'auto'.   With the 'auto' option, the symbol and color for each plot line will be automatically selected by EES so that each plot  line has a different symbol and color.  This feature can be overridden by simply selecting the symbol and color.

The 'Spline fit' control will use cubic spline interpolation to draw a smooth curve through the data points.  The spline fit capability will be disabled if more than 100 points are being plotted or if the values of the X-axis coordinate are not in ascending or descending order.

When the Automatic update control is selected, the plot will use the current data in the table from which the plot was developed, rather than the data which existed when the plot was first drawn.  The data can be plotted from the Parametric, Lookup, Arrays, or Integral tables.  Any change in the data will cause the plot to be redrawn before it is displayed.

The 'Show error bars' checkbox control is visible only after the Uncertainty Propagation Table calculations are completed.  In this case, the propagated uncertainty of the selected variable is displayed in the Parametric table following its value.  If this selected variable is plotted, the 'Show error bars' control will be active and provide the option of displaying error bars to represent the propagated uncertainty.  Note that error bars can be drawn for any plotted variable, independent of the Uncertainty Propagation Table calculations.  To place error bars on an existing plot, select Modify Plot from the Plot menu or double click (or right click) the mouse within the plot rectangle.  The Modify Plot dialog has controls that allow the Specify Error Bar Information dialog to be displayed.  Symetric or unsymetric errors bars can be drawn for the X and Y axis variables on each plot.

The 'Add legend item' checkbox control will, if checked, place a text item with the name of the variable being plotted preceded by the plot symbol at the upper left of the plot rectangle.  Subsequent legend items will be placed below the previous item.  This feature makes the construction of a plot legend easy.  The text items can, of course, be moved to other locations, changed, or deleted using the Plot Window controls.

The 'Show array indices' check box is only enabled when plotting data from the Arrays table. Values in the arrays table are referenced by their array index, e.g., X[5].  Selecting this checkbox will generate a separate label for each plotted point containing the array index value.  The label is placed to the right and slightly above the point.  This option is very useful when superimposing calculated thermodynamic state points on a Property plot, such as a P-h diagram.  Plotting the arrays effectively places the cycle diagram on the property plot and with this option enabled, labels the points.  If the plotted line is deleted, the labels that were generated for the points on this line will also be removed.

When a new plot is generated the size of the plot and the characteristics of the axis scales are determined by the settings of the Plot Options in the Preferences dialog.

See also:

Modify Plot

Bar Plot

X-Y-Z Plot


Plotting Strings

In some situations, it is convenient to display strings rather than numerical values.on the X-axis of an X-Y or Bar plot.   For example, a Lookup table can contain the following data.  Note that it is necessary to set the format of the Month column to String in order to enter string data.  This is done by clicking the right mouse button in the column header and selecting the Properties item from the pop-up menu to bring up the Format Table Column dialog.

If the Month column is selected for the X-Axis in the Plot Setup dialog, the usual Minimum, Maximum, Interval, etc. information will be replaced with the following string information palette.

When a string variable is plotted, EES assigns the row number in the table to each string and plots the Y-axis variable variables versus the row number in the table.  Then the numerical values that normally appear on the X-axis are suppressed and the strings are plotted in its place, as shown below.  Strings can only be plotted on the lower and upper X-axes.


Bar Plot

The New Plot Window | Bar Plot operates in exactly the same manner as the X-Y plot.  The only difference is that the Bar Plot provides a list of different bar types in place of a list of plot symbols.  Note that all of the bar types except the solid bars are transparent so multiple bar plots can be produced to provide a 'stacked-bar' plot.  Also, strings can be plotted on the X-axis and then moved if necessary to provide labels for the bars.   The width of the bar plot is initially set to a default value, but it can be changed by moving the slider bar in the Modify Plot dialog.


X-Y-Z Plot

The X-Y-Z Plot command provides 2 options for displaying data of the form Z=f(X,Y)

1)  Isomeric Lines:  displays lines of constant Z in X-Y space (2-D projection)

2)  Color Bands:  uses colors ranging from blue to red to represent the value of Z in X-Y space (2-D projection)

3)  3-D Plot:  displays a 3-D rotatable projection using orthogonal or perspective coordinates.

A contour plot requires three-dimensional data for construction.  The data may be provided either in 3 separate columns for the X, Y, and Z variables or in a 2-D table.  In either case, the data used to construct the plot can be from the Parametric, Lookup,  Arrays or Integral table windows.  The table from which the data are taken is selected from the drop-down controls at the upper right of the dialog.

If the 3-column data radio button is selected, EES will expect that three dimensional data to be provided in three columns from one of the table windows.  The X, Y, and Z variables are then selected from the three lists.  Data provided in this form need not be in any particular order.   If the 2-D table data radio button is selected, EES will assume the column numbers in the table are proportional to the X-coordinate whereas the rows are proportional to the Y-coordinate.  The Z-values will be read from the table.  Controls are provided to allow a subset of rows and/or columns in the table to be plotted.  The X and Y axis scaling is, by default, set to the number of columns and rows in the table, but it can be changed as desired to provide scaling.

To prepare the X-Y-Z plot, the selected data must be interpolated or extrapolated as necessary to provide values of variable Z over the entire range of X and Y at relatively fine intervals.  A number of methods were investigated for this task.  The method which was found to be most successful is the multiquadric radial basis function.  With this approach, the selected data are first scaled and then fitted to a function of the form

where N is the number of data points, the w values are weighting factors, and σ is a relative smoothing parameter which, based on experimentation, is best set to zero for numerically-generated data.  However smoothing may be needed for experimental data or for sparse data sets.  Moving the Smoothing slider bar to the right increases σ which increases the smoothing effect.

The weights are found by solving the linear system of N equations that force the above equation to perfectly represent the provided data.  Once the weights are determined the equation is used to interpolate or extrapolate the values of Z to particular values of x and y.  The computations needed to determine the weights are O(N cubed) so there is a practical upper limit to the number of points (N) that can be accomodated.  This upper limit is controlled by the Resolution slider.  The range of the Resolution slider is 400 to 1600.  If more data points are provided than are specified by the Resolution slider, EES will select a subset of the data using a clustering algorithm.  At full resolution, it is necessary to solve a 1600 x 1600 system so you may have to wait a while for the plot to be prepared depending on the speed of your computer.

Two-dimensional contour plots may be produced using isometric lines or color bands representing constant values of Z.  The number of lines or bands is determined by as the difference between the maximum and minimum values divided by the interval value.  Each isometric line is a separate plot overlay, whereas the color band plot is simply one plot.  A maximum of 25 isometric lines and 250 colors is allowed.  Note that selecting a large number of colors (>100) results in a plot that has nearly continuous colors ranging from blue (low values) to red (high values).  The resulting plot can be quite pretty, but the time required to display the plot will increase with the number of colors.  A Label Contours check box control is provided for isometric contour plots.  In this case, EES will generate a text item containing the value for each contour line and place it on the line.  These text items can be moved or changed just as any other Plot window text items.   If a banded color plot is chosen, an Include Legend check box is provided.  If the Include Legend check box is selected, a color legend will be displayed to the right of the plot relating colors to the values of Z.  Note that, on a color band contour plot, you can read the value of Z directly in the Plot Window title bar at any X-Y position by holding the Ctrl and Shift keys down and moving the mouse.  An X-Y or bar plot can be overlayed on 2 two-dimensional contour plot using the Overlay Plot command.

The three dimensional plotting package is based on a modified version of the public domain GLScene package (http://www.glscene.org/). The plot has been modified to optionally display values of a 4th dimension with color or grayscale.  For example, it is possible to display the temperature as a color on an X-Y-Z surface.  The color variable is selected by clicking on header for the Z-Axis variable.  This action will cause the list to display the Color variable.  The color variable list is shown in yellow to make the distinction clear.  If a color variable is not selected, it is assumed to be the same as the Z-axis variable.  After it is constructed, the three-dimensional plot can be rotated about its center point by pressing the mouse button on the plot and dragging it in the desired direction.  A number of controls are provided to, for example, scale the image, set colors, and display grids and surface grid lines.  These controls are provided on the 3-D plot control panel.  Overlays are not supported for 3-D plots.

Return to Plot Menu


Overlay Plot
Overlay Plot (PLOT Menu)

Overlay Plot allows one or more new plot curve(s) to be drawn over existing plots using data from the Parametric, Lookup, Arrays, or Integral table.  The use of this command is identical to that for the New Plot Window command except that the plot is drawn in an existing rather than a new plot window.  Overlayed plots offer the option of a 2nd X scale (X2) which is initially displayed at the top of the plot and a second Y-scale (Y2) which is initially displayed  on the right side of the plot.  The position of the second scales can be changed by holding the Ctrl key down while pressing the up/down arrow keys (to move the X2 scale) or the left/right arrow keys (to move the Y2 scale).  The drop-down control below each list of variable names allows the first or second scale to be selected for any each overlayed plot.  The scale selections can later be changed with the Modify Plot command.


Modify Plot
Modify Plot (PLOT Menu)

The Modify Plot dialog can be accessed using the Modify Plot command or by double-clicking (or right-clicking) the mouse button anywhere within the plot rectangle in the Plot window.

Modify Plot allows the parameters of existing plots to be changed.   In addition, plot window parameters such as the plot size, border type, error bars, and major/minor tick sizes can be changed. Note that positive tick sizes indicate that the tick marks are directed into the plot rectangle whereas negative tick sizes result in tick marks that are outside of the plot rectangle.

The plots appearing in this plot window are shown in the list box at the top of the dialog.  The last plot in the list is preselected as you enter this dialog window.  Select the plot for which changes are to be made.  The line type, color, symbol, and symbol size and other plotting parameters will be displayed for the selected line.

Placing a symbol at each point can result in a messy plot when the line has many points.  A control is provided to specify symbols to be drawn every N points where 1<N<# of points.

The plot list will indicate (X2) or (Y2) if the plot uses the X2 (top X-axis) or Y2 (right Y-axis) scales.  Controls to select the X1/X2 and Y1/Y2 scales are available for plots in which 2nd axis scales have been defined.

The error bars control allows error bars to be placed in the horizontal, vertical or both directions.  Error bar information can come from one of two sources.  If calculations are initiated with the Uncertainty Propagation Table command,  the error bar information is assumed to be the calculated or specified uncertainty values for the variables plotted on the X and Y axes.  If the Uncertainty Propagation Table command is not used, clicking the X-Axis or Y_axis check box in the Error bars box will bring up the Specify Error Bar Information dialog in which the data needed to draw symetric or unsymetric error bars is entered.

When the Automatic Update control is selected, the plot will use the current data in the table from which the plot was developed, rather than the data which existed when the plot was first drawn.  The data can be plotted from the Parametric, Lookup, Arrays, or Integral tables.  Any change in the data will cause the plot to be redrawn before it is displayed.  The Data button to the right of the Automatic Update control will bring up the Modify Automatic Plot Data dialog in which the source of the data used to construct the plot may be changed.  Click the Apply button if you wish to view the changes you have made.  Click OK to accept the changes or Cancel.

Note that multiple plots can be selected by holding the Shift key down while clicking (or dragging) the mouse in the plot line list.  In this case, the plot line parameters will be displayed for the last selection.  If a change is made to a parameter, that change will be applied to all selected plots when the Apply or OK button is clicked.  This capability makes it easy to, for example, change the size of the symbols for all plots in the plot window at one time.  Other parameters can be changed in a similar manner.  However, the data sources (accessed with the Data button) are disabled when more than one plot is selected.  It is possible to change the range (First Row and Last Row) of all selected plots at one time provided that they were all plotted from the same table.

The Modify Plot dialog window allows the characteristics of one or more plots to be changed without exiting the dialog window.  Click the Apply button after changing the plot line characteristics and before selected another plot.  The plot window will immediately show any changes that are made.  However, the changes become permanent only after the OK button is clicked.  Clicking the Cancel button will restore the plot(s) to the condition it was in before the Modify Plot dialog window appeared.

The Delete button will remove the selected plot(s) from the plot window, leaving all others unchanged.  If a legend text item has been associated with the plot with the Add Text command, it also will be removed.  The plot window is immediately redrawn.  However, the plot is deleted only when the OK button is clicked.  Clicking cancel will restore one or more deleted plots.

The Delete button is intended for deleting individual plot lines.  Use the Delete Plot Window command to clear a selected plot window.

Animation controls are provided in the professional version.

Return to Plot menu.


Modify Automatic Plot Data

When a plot line is first constructed, the table, data columns, and range of rows that provide the data to form the plot must be selected.  At some later point, it may become necessary to change these data.  The Modify Automatic Plot Data dialog provides this capability.

This dialog is accessed from the Modify Plot dialog by clicking the Data button.  The Data button is enabled only if the Automatic Update check box is selected.  The table from which the data were initially plotted must be available for to allow Automatic Update.

The Modify Automatic Plot Data dialog allows the table, the X and Y-axis columns, and the range of rows in the table to be selected for the plot, in the same manner as originally used to develop the plot with the New Plot Window or Overlay Plot commands.  If the All Rows in Table check box is selected, the controls that allow the range of data to be plotted are disabled.  In this case, the plot will be update using all of the data in the selected columns of the table.  If rows are added or deleted from the table, the plot will be redraw to reflect the changes.

The changes made in this dialog will take affect when the Modify Plot dialog is dismissed with the OK button.  The selected plot will be automatically redrawn with the new data.

Note:  If more than one plot is selected in the Modify Plot dialog, the controls to select the table, the X and Y-axis columns are disabled since it is unlikely that changes of this nature would need to be applied to all selected plots.  However, the range of rows (First Row and Last Row) can be changed and this change will be applied to all selected plots that use data from the same table as shown in the table control.   The All Rows in Table control will also be applied to all selected plots.


Specify Error Bar Information

The Error Bar dialog is show above.  This dialog is presented after clicking the X-Axis or Y-Axis check box in the Error Bars box.  This dialog allows error bar information to be entered for a situation in which the Uncertainty Propagation Table calculations are not used.

The information in this dialog is for a particular variable plotted on the X or Y-axis.  In the example shown above, the variable is QH.  The dialog allows the error bars for values of the selected variable to be specified as either a constant that is taken to be the absolute value or relatative value, or as a variable that is read from a column in the Parametric, Lookup, Arrays, or Integral tables.

The error bars are normally drawn symetrically around the data point.  However, it is possible to have unsymetric error bars by unchecking the "Identical upper and lower values" check box.  In this case, the Specify Error Bar Information dialog will expand to allow entry of error bar information for the upper and lower legs of the error bars, as shown.

See also:

   	Modify Plot

Uncertainty Propagation Table


Modify Axes
Modify Axes (PLOT Menu)

Modify Axes allows the appearance of the axes of an existing plot to be changed.  For example a grid lines or a zero line can be displayed.  This command can also be invoked by double-clicking the mouse in the Plot window on the axis scale for which changes are to be made.  The axis for which changes are to be made is selected with the radio button controls at the upper left.  The current settings for the selected axis will be shown.  The plot will be automatically redrawn to reflect any change in these settings.

By default automatic axis scaling if off and the scaling of the selected axis is controlled by the minimum, maximum and interval values shown in the edit boxes.  These values can be changed as desired.  However, if the 'Automatic scaling' checkbox is checked then the axes will be automatically scaled as appropriate to contain plotted data for all lines in this plot window.  In this case, the edit boxes for the minimum, maximum and interval values will be disabled. If a new plot line is added or if the data in one or more of the plots are changed such that one or more points are outside the range of the axis scale, the axis scale will automatically change.

If the Gridlines checkbox is checked, the # Ticks/Division control will be shown within a border.  Clicking anywhere within this border will cause the display to change to # Grids/Division.  This control will allow the axis to be displayed with either tick marks or grid lines between the gridlines displayed at the location of each axis number.


Show/Hide Toolbar

Each plot window has its own toolbar with buttons to add new text or drawing items to the plot window or to manipulate these items.  The toolbar is ordinarily displayed when the plot window is created.  It can be hidden by clicking in the small box with the cross at the upper right of the toolbar.  The Show Toolbar command displays the toolbar if it was previously hidden.  If the toolbar is visible, this command will have a Hide Toolbar caption and if selected, it will hide the toolbar.

The toolbar can also be made visible or hidden by right-clicking anywhere outside of the plot rectangle.

The toolbar contains buttons to add text, add lines, add rectangles, add ellipses and to align selected items.


Add Text Toolbar Button

A text item can be added to the plot window by clicking on the text button in the plot window toolbar.  When clicked, a new text item will be created and then the Format Text dialog will appear in which information about the text item can be entered.  The text item initially appears in a default location on the Plot window.  However, it can be dragged to any location on the plot window.  The text you enter initially has the characteristics of the previous text item.  All of these characteristics can be changed by clicking the right mouse button (or double-clicking the left mouse button) on the text item.  This action will bring up the Format Text dialog for the selected text item.  The text item can be converted into a plot legend by associating it with a plot symbol in the Format Text dialog.  The text can also show the current value of any EES variable or the integral of plotted data.


Add Line Toolbar Button

The Add Line toolbar button in the plot window toolbar allows lines or arrows to be placed anywhere within the Plot window or Diagram window.

After clicking on the line button in the toolbar,  the cursor will appear as a cross.  Press and hold the mouse button down at the position where you wish the line line to begin.  Hold the mouse button down while moving the mouse to the desired end position of the line.  Release the mouse button.

You can move, resize, or rotate the line after it is created.  To move the line, press and hold the mouse button down anywhere near the middle of the line while dragging it to its new position.  You can also use the arrow keys to move one or more selected lines.  When you select a line by clicking on it, small boxes will be displayed at either end of the line.  To rotate the line and/or change its length, press and hold the mouse button within either of the two small boxes.  Move the end to its new position and release the mouse button.

Initially, a line will be created of the type that was last chosen.  If you wish to change the type, for example to add or change an arrowhead, double-click or right-click on the line.  A dialog window will appear in which the arrowhead type and size, line thickness, and color may be selected.  By default, the line can be resized, moved, or rotated.  If you wish to prevent these capabilities, deselect the Moveable check box.

The current line and and following lines created with the Add Line toolbar button will then have the same characteristics as the previous line.

Clicking on a line will cause it to be displayed with small boxes at both ends.  Multiple lines can be selected.  Double-clicking the left mouse button (or clicking the right mouse button) will cause the Modify Line dialog window to appear in which the characteristics (such as arrow style, arrowhead size, line thickness, and color) of all selected lines can be changed at one time.  Selected lines can be copied to the Clipboard  using the Cut and Copy commands in the Edit menu.  The Delete key will cut all selected lines.  Once on the Clipboard, the Paste command can be applied to move the line from the Clipboard to any EES window of the same type.


Add Rectangle Toolbar Button

The Add Rectangle toolbar button in the toolbar allows rectangles with straight or curved edges to placed anywhere within the Plot window or Diagram window.

After clicking on the rectangle button in the toolbar, the cursor will appear as a cross.  Press and hold the mouse button down at the position which will fixed the upper left corner.  Hold the mouse button down while moving the mouse to the desired lower right corner.  Release the mouse button.

You can move or resize the rectangle after it is created.  To move the rectangle, press and hold the mouse button down anywhere within the rectangle (but not on an existing text item, line, or other plot object) while dragging it to its new position.  When you select a rectangle by clicking on it, small boxes will be displayed at the center of each edge.  To change the size of the rectangle, hold the left mouse button down on any one of the four boxes and drag it to its desired location.

Initially, a rectangle will be created with default line color and fill characteristics.  If you wish to change these characteristics, double-click the left mouse button or click the right mouse button within the rectangle.  The Format Rectangle dialog window shown below will appear in which the line type, line color, fill type, fill color, corner roundness and other characteristics can be viewed or changed.  For example, you can change the rectangle line and fill color to white to provide a background for a plot legend.  You can, if you wish, prevent the rectangle from being moved if you select the Locked check box.  The animation controls are available in the Professional version.

Multiple rectangles can be selected.  Double-clicking the left mouse button (or clicking the right mouse button) will cause the Format Rectangle dialog window to appear in which the characteristics of all selected items can be changed at one time. Selected rectangles can be copied to the Clipboard  using the Cut and Copy commands in the Edit menu.  Once on the Clipboard, the Paste command can be applied to move the line from the Clipboard to any EES window of the same type. The Delete key will cut all selected rectangles.


Add Ellipse Toolbar Button

The Add Ellipse toolbar button in the toolbar allows ellipses or circles to placed anywhere within the Plot window or Diagram window.

After clicking on the ellipse button in the toolbar, the cursor will appear as a cross.  Press and hold the mouse button down at the position which will fixed the upper left corner.  Hold the mouse button down while moving the mouse to the desired lower right corner.  Release the mouse button.

You can move or resize the ellipse after it is created.  To move the ellipse, press and hold the mouse button down anywhere within the ellipse (but not on an existing text item, line, or other plot object) while dragging it to its new position.  When you select an ellipse by clicking on it, small boxes will be displayed at the top, left, bottom and right.  To change the size of the ellipse, hold the left mouse button down on any one of the four boxes and drag it to its desired location.

Initially, an ellipse will be created with default line color and fill characteristics.  If you wish to change these characteristics, double-click the left mouse button or click the right mouse button within the ellipse.  The Format Ellipse window will appear in which the line type, line color, fill type, fill color, and other characteristics can be viewed or changed.  You can, if you wish, prevent the ellipse from being moved if you deselect the Moveable check box in the Format ellipse dialog window.

Multiple ellipses can be selected.  Double-clicking the left mouse button (or clicking the right mouse button) will cause the Format Ellipse dialog window to appear in which the characteristics of all selected items can be changed at one time. Selected items can be copied to the Clipboard  using the Cut and Copy commands in the Edit menu.  Once on the Clipboard, the Paste command can be applied to move the line from the Clipboard to any EES window of the same type. The Delete key will cut all selected items.


Align Items Toolbar Button

The Align button is enabled when two or more text items, lines, rectangles, or ellipses are selected.  These objects are created with the Add Text, Add Line, Add Rectangle, and Add Ellipse toolbar buttons.  After selecting this button, a small dialog window will appear showing alignment choices.  Click OK to proceed with the alignment of the selected items.


Delete Plot
Delete Plot Window (PLOT Menu)

Delete Plot Window will completely clear the contents of one or more selected Plot Windows and recover the memory they required.  You can also delete a plot window by right-clicking on the tab at the top of the window.  A dialog will appear having a delete button.  Note that you can not undo the delete action, so be careful.


Property Plot
Property Plot (PLOT Menu)

The Property Plot command creates a new plot window with thermodynamic property data for a selected substance.  Once created, additional property data or thermodynamic cycle state points can be superimposed on the plot using the Plot_Overlay_Plot command.  Also, the plot characteristics and axis scales can be modified in the usual manner with the Modify Axes and Modify Plot commands.

Select the substance from the list at the left.  Detailed information relating to the substance model is accessed by clicking on the Fluid Info button above the list. Note that, in general, the general rule is that the substance is modeled as a real fluid if its name is spelled out (e.g., Oxygen) and as an ideal gas if its name is a chemical formula (e.g., O2).  Air is the exception to this rule since it is modelled as an ideal gas.  However, substance Air_ha is modelled as a real fluid.

Fluids modelled with a high-accuracy equation of state allow the reference state for enthalpy and entropy to be selected.  The options are DFT, NBP, ASH, and IIR.  These alternatives are defined in the discussion of the $Reference directive.

For all substances except AIRH2O (psychrometric air-water mixtures), there are six buttons which allow a specification of Temperature-entropy (T-s), Temperature-volume (T-v), Pressure-volume (P-v),  Pressure-enthalpy (P-h),  Enthalpy-pressure (h-s) or Temperature-enthalph (T-h) coordinate systems.  The T-h plot option is available only for substances that are represented by the high accuracy fundamental equation of state.  These substances are identified in the Fluid Property Information window.  AIRH20 allows lines of constant relative humidity and web-bulb temperature to be placed on a psychrometric chart.   After a coordinate system has been chosen, several sets of controls will appear in which 6 values of additional properties, such as isobars, isotherms, and/or isentropes can be specified.  Suggested values of these properties may be provided in the edit boxes.  To display lines of constant properties, click the check box so that an X appears in the box and then enter or modify the existing value for the property.

To superimpose your calculated property data on a property plot, it is most convenient to place the properties that are to be plotted in arrays using square brackets to enclose the array index, e.g., T[1].  In that way, the property values will be displayed in the Arrays window after calculations are completed and they can then be directly plotted.


Curve Fit
Curve Fit (PLOT Menu)

The Curve Fit command will find the best fit of a smooth curve through a previously plotted set of data points using unweighted least squares.  Chose the data to be fitted from the list of plots at the left.  Note that data can be plotted from the Parametric,  Lookup,  Arrays, or Integral table with the New Plot or Plot_Overlay_Plot commands.

Select the form of the curve fit by clicking the appropriate radio button.  A sample of the equation form will appear in blue in the box at the bottom of the dialog window.  The first four buttons correspond to commonly used equation forms for which linear least squares can be used to determine the unknown coefficients.  The Enter/Edit Equation button allows you to enter any equation form or to edit a previously entered equation.  The equation you enter may be linear or nonlinear in the unknown parameters.  You will have to supply guess values and (optionally) bounds for the unknown parameters.

Click the Fit button (or press the Enter key).  The fitted equation will be displayed in the box at the bottom of the dialog window.  A Stats button will appear.  Click the Stats button if you wish to see statistical information relating to the curve fit, such as the standard error of the parameters and the root mean square error of the fit.  The Fit button will now have changed into the Plot button.  Click the Plot button if you wish to have the curve fit equation overlayed on your plot.  If the Plot Legend check box is selected, a legend containing the equation will be created and displayed on the plot.  The curve fit equation will be copied to the Clipboard if the To Clipboard check box is selected when either the Plot or Exit button is selected.

The curve fit command will regress any plotted variable as a linear or non-linear function of any other variable.  The Linear Regression command in the Tables menu provides linear regression capability for one to six independent variables.


Format Text

The Format Text dialog window appears when the text button on the plot tool bar is clicked, or or when the mouse is double-clicked on an existing text item in the Plot Window.  The dialog window contains fields which allow the text and its appearance to be changed. Controls are provided to change the font, size, color and style of the text item as well as the text itself.  A single text item can provide multiple lines of text and bold, italic, underline, superscript and subscript styles can be added to selected sections of the text.

The text can be of three types.  The choice is controlled by the 'Text item',  'EES variable' and 'Integral' radio buttons.  If 'Text item' is selected, an edit box is provided to enter text.  Subscripts, superscripts, styles, symbols, and other enhancements to the text can be made as described below.  If 'EES variable' is selected, the text is composed of information about an EES variable which includes the EES variable name, the formatted value of the variable, and its units.  The inclusion of the EES variable name and its units are included only if the 'Show Name' and 'Show Units' check boxes are respectively selected.  The 'Auto Update' check box controls whether or not the text item is automatically changed if the value of the variable or its units is later changed.  If you do no wish this to occur, make sure that the 'Auto Update. check box is not selected.  If the Integral button is selected, EES will create a text item holding the integral of a selected line on the plot.  If Auto Update is selected for the plot and the values being plotted change, the integral will also change accordingly.

Styles (Bold, Italic, Underline), line breaks, and  subscripts and superscripts can be generated using the 'speed' buttons in the palette located to the right of the font name. First, select the text which for which the change is to be applied.  Then click the appropriate button for Bold, Italic, Subscript, Underline, NewLine, or Superscript.

Note that EES imbeds characters in the text to identify the formatting change.  The format characters can be directly entered from the keyboard and are define as follows"

\b	start or stop bold styling

\d	start subscript

\i	start or stop italic styling

\m	start new line

\n	start normal font (ends symbol font)

\s	start symbol font

\u	start superscript

\-	start or stop underline styling

end subscript or superscript

Three additional speed buttons are provided below the subscript button to facilitate entry of lower or upper case Greek letters and useful symbols.  The symbol entry buttons operate as follows.  Press and hold the mouse button down on one of the three symbol buttons.  A palette of symbols will be displayed to the right of the button.  While holding the mouse button depressed, slide the mouse cursor to the symbol palette and position it over the symbol you wish to select.  When the mouse button is released, that symbol will be added to the text item at the current insertion point. To place a dot, bar, or hat over a character or group of characters, first select the text in the Text box to which the formatting is to be applied;  then press and hold the third symbol button while sliding the mouse to the X_dot, X_bar or X_hat symbol, as shown below.

The text is displayed as it will appear in the large window at the top of the dialog.  A legend symbol can be associated with horizontal text by selecting the plot in the legend menu.  The legend symbol is automatically drawn to the left of the text.  The legend symbol moves with the text.

Clicking on a text item will cause it to be drawn inside of a red dotted box indicating that it is selected.  Multiple text items can be selected.  Double-clicking the left mouse button (or clicking the right mouse button) will cause the Modify Text dialog window to appear in which the characteristics (such as font, size, style and color) of all selected text items can be changed at one time.  If more than one text item is selected, alignment buttons will be provide to allow alignment of selected text items relative to each other.  Selected text items can be copied to the Clipboard  using the Cut and Copy commands in the Edit menu.  The Delete key will cut all selected text items.  Once on the Clipboard, the Paste command can be applied to move the text item from the Clipboard to any EES plot window.


Enter Curve Fit Equation
Enter/Edit Equation

The Enter/Edit Equation option allows the user to enter a curve fit equation of the form -YName=f(X-Name) with up to 7 unknown coefficients.  X-Name and -YName are the names of the X and Y variables appearing in the edit fields just above the equation.  By default, X-Name and Y-Name are set to the names appearing in the plot axis labels.  However, other names may be entered.  The coefficients must be entered as a0, a1, a2, ... a6.   Upper case or lower case letters may be used.  It is not necessary to use the coefficients in any order.  The equation must begin with Y-Name= and involve X-Name and at least one coefficient.  An example is shown in the above figure.

Note that the equation you enter may be either linear or nonlinear in the coefficients.  EES will employ a nonlinear least squares method to determine the unknown coefficients.  The parameter estimation algorithm requires that you supply guess values for each of the unknown parameters.  The Curve Fit Guess Values window will appear after you enter the equation.


Curve Fit Statistics

EES calculates the standard error of each fitted coefficient as well as other information such as the root mean square (rms) and bias errors.  The standard error (shown for the linear regression options) is the square root of the estimated variance of the coefficient.

The rms is sqrt(1/N sum[(Y-Y)^2]

where N is the number of data points, and Y is the estimated value of Y.

The bias error is 1/N sum[(Y-Y)].

The coefficients in this table can be selected by holding the left mouse button down and dragging the mouse over a range of cells.  If the Copy to Clipboard check box is checked, the contents of the selected cells will be placed on the clipboard.


Curve Fit Guess Values

The Enter/Edit Equation option allows the user to enter any equation of the form Y=F(X) with up to 7 unknown coefficients represented as a0, a1, a2, ... a6.  EES will employ a nonlinear least squares curve-fitting method to determine the unknown coefficients.  The parameter estimation algorithm requires that you supply guess values for each of the unknown coefficients. Better guess values increase the likelihood of a successful curve fit and reduce computational time.  You may also supply lower and upper bounds for each coefficient if you wish to restrict the range of the search.  The guess value must be within the lower and upper bounds.

The guess values dialog window also provides fields for the maximum allowable number of iterations and the relative converge tolerance.  The search for the best set of coefficients terminates when either the maximum number of iterations is exceeded or the sum of the squares of the residuals for two successive iterations is less that the product of the tolerance and the current residual sum of squares.  After the curve fitting process is completed, you may view statistical information about the fit including the number of iterations required by pressing the Stats button.


Windows Menu

The Windows menu provides a convenient way of bringing any of the EES windows to the front. The specific functions of each window are explained in the Help window for each of the following commands.  Some of the menu items in this menu access submenus.  For example, the Plot Windows menu item will contain a submenu that provides access to any of the plots contained in the Plot window.  Similar capability is provided for the Parametric Table, Lookup Table, Diagram and Report Window menu items.   Many of the menu commands have keyboard equivalents which may be easier to use.  Ctrl-F, for example, will bring Formatted Equations window to the front.

Equations

Formatted Equations

Solution

Arrays

Residuals

Parametric Table

Integral Table

Plot Windows

Lookup Table

Diagram Window

Report Window

Debug Window

Warnings

Tile

Cascade

Calculator


Tile
Tile (WINDOWS Menu)

The Tile command will resize and move all visible EES windows in a manner so that they fill the screen without overlapping one another.


Warnings

The Warnings menu item in the Windows menu will bring up a window showing warning messages that were issued during the preceding calculation.  Warning will appear only if the Display Warning Messages setting in the Options Tab of the Preferences dialog is selected.   If not warning messages exist, the menu item will be disabled.

Note that the generation of warning during calculations may reduce the calculation speed.  Turn warnings off in calculation-intensive problems.


Cascade
Cascade (WINDOWS Menu)

The Cascade command will resize and move all visible EES windows so that the title bar of each window is visible and each window is expanded to a size which fits on the screen.


Calculator

The Calculator menu item in the Windows menu activates the Calculator window.  The Calculator window allows single-line expressions to be evaluated.  For example, if you enter:

?sqrt(5)

and press the Enter key, EES will evaluate the expression and place the result on the following line.

The expression you enter can involve EES variables that have been previously defined (and evaluated) in the Equations window.  Any of the built-in functions can be used, as well.  Note that the value returned in the Calculator window is the current value of the variable.  If you have not initiated the Solve or SolveTable commands, the value may not be current.

New variables may be defined in the Calculator window, provided that they are not already defined in the Equations window.   For example, in the above example, variable x is set to the enthalpy of R134a.  If any of the thermodynamic property functions are used, the unit system in effect is that which is defined with the Unit System command.

Be sure to press the Enter key after entering each line in order to process the command.

The contents of the Calculator window are deleted when the window is closed.  If you need to save the information in this window, select it and copy it to another window or another application.


Help Menu

The Help menu contains provides commands for accessing Help and the EES startup window.  Context-sensitive help is also available at any point by pressing the F1 key.  Help information concerning any menu command can be accessed by pressing Shift-F1, which will cause the cursor to change to the Help cursor.  Select the menu command for which information is desired.

Help for External Libraries

Help Index

Using Help

About EES

New Features

It is possible to create distributable versions of EES which may be given to persons who do not own EES.  This capability is available with the Make Distributable Program command.  Help information can be provided for the files included in the distributable program.  Menu items for those files will appear at the bottom of the Help menu.


Help Index
Help Index (HELP Menu)

The Help Index command will start up the EES Help program and display the index.  Double-click the mouse on any green text to obtain information on that subject.


Help for External Libraries

EES allows the user to supply external routines written in EES itself or in a compiled language such as C++, Pascal, or FORTRAN.  EES Library routines, External functions and procedures  that are placed in the \USERLIB folder are automatically loaded at startup.  External routines can have a separate help file having a .HLP or .HTM filename extension.  Because these routines are not truly part of EES, the help files cannot be included within the EES help file.  However, access to the help file for any external routine is provided in the Function Information dialog by selecting the desired function and clicking the Function Info button.  The help information is also now accessible directly from the Help menu with the Help for External Libraries command.


Using Help
Using Help (HELP Menu)

The Using Help command provides instructions for using the EES Help program.


About EES
About EES (HELP Menu)

The About EES program displays information concerning your version of EES and the version number.  The version number must be reported in any correspondence to F-Chart Software.

If you are using EES on a write-protected network drive and you have not specified a working directory, you will see a Preferences button on this dialog which, if clicked, allows you to view, change and store a number of program preferences.


New Features

New Features provides a list of features that have been added to EES by version number and date.


Mathematical Functions

The mathematical functions built into EES are listed below in alphabetical order.  All of the functions (except PI, TABLENAME$, and TABLERUN#) require one or more arguments which must be enclosed in parentheses and separated with commas.  The argument may be a numerical value, a variable name, or an algebraic expression involving values and variables.  Functions that require two or more arguments can accept arguments in array range notation, e.g., X[1..5].

ABS	ANGLE	ANGLEDEG

ANGLERAD	ARCCOS	ARCCOSH

ARCSIN	ARCSINH	ARCTAN

ARCTANH	AVERAGE	AVGLOOKUP

AVGPARAMETRIC	BESSEL_IO	BESSEL_I1

BESSEL_JO	BESSEL_J1	BESSEL_K0

BESSEL_K1	BESSEL_YO	BESSEL_Y1

CIS	CONJ	CONVERT

CONVERTTEMP	COS	COSH

DIFFERENTIATE	DIFFERENTIATE1	DIFFERENTIATE2

ERF 	ERFC	EXP

FACTORIAL	FLOOR	GAMMA_

IF	IMAG	INTEGRAL

INTEGRALVALUE 	INTERPOLATE	INTERPOLATE1

INTERPOLATE2	INTERPOLATE2D	LOOKUP

LOOKUP$	LOOKUPCELLEMPTY	LOOKUPCOL

LOOKUPROW	LOOKUP$ROW	LN

LOG10	MAGNITUDE 	MAX

MIN	MOD	NLOOKUPROWS

PI	PRODUCT	RANDOM

REAL	ROUND	SIN

SINH 	SQRT	STEP

SUM	SUMLOOKUP	SUMPARAMETRIC

TABLENAME$	TABLERUN#	TABLEVALUE

TAN	TANH	TRUNC

UNCERTAINTYOF	UNITSYSTEM

See also: 	ERROR procedure

WARNING procedure

String functions

Thermophysical Property Functions

Internal User Functions

External User Functions


ABS

In complex mode, ABS(Arg) will return the Magnitude of a complex number.  In real mode, ABS(Arg) returns the absolute value of the argument.


ANGLE, ANGLEDEG, and ANGLERAD

Angle(X), AngleDeg(X) and AngleRad(X) all return the angle (also called amplitude or argument) of complex variable X. Representing X as X_r + i*X_i, this function returns arctan(X_i/X_r).  The difference between these three functions is the units in which the angle is returned.

Angle will return the angle in either degrees or radians depending on the Trig Function setting in the Unit System dialog.

AngleDeg will always return the angle in degrees.

AngleRad will always return the angle in radians.

All three functions return the angle in the correct quadrant of complex plane.

Examples:  Y=Angle(X);  YD=AngleDeg(X);  YR=AngleRad(X)

The first example will set the real part of Y (Y_r) to the angle of X and the imaginary part of Y to zero.

Note that the Angle functions areused to extract the angle of a complex number variable or expression.  They cannot be used for assigning the angle of a complex number.  For example,  the equation Angle(X)=4 will produce an error.

See also:  Magnitude, CIS, Complex Numbers


ARCCOS

ARCCOS(Arg) returns the angle which has a cosine equal to the value of the argument.  The units of the angle (degrees or radians) will depend on the unit choice made for trigonometric functions with the Unit System command.


ARCCOSH

ARCCOSH(Arg) returns the value which has a hyperbolic cosine equal to the value of the argument.


ARCSIN

ARCSIN(Arg) returns the angle which has a sine equal to the value of the argument.  The units of the angle (degrees or radians) will depend on the unit choice made for trigonometric functions with the Unit System command.


ARCSINH

ARCSINH(Arg) returns the value which has a hyperbolic sine equal to the value of the argument.


ARCTAN

ARCTAN(Arg) returns the angle which has a tangent equal to the value of the argument.  The units of the angle (degrees or radians) will depend on the unit choice made for trigonometric functions with the Unit System command.


ARCTANH

ARCTANH(Arg) returns the value which has a hyperbolic tangent equal to the value of the argument.


AVERAGE

AVERAGE(Arg1, Arg2, Arg3, ... ) will return the average value of the arguments.  The number of arguments must be between 1 and 2000. An array or subset of an array can be provided as an argument list by using array range notation, e.g., X[1..50].

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical formatNumerical_Format)


AVGLOOKUP

AVGLOOKUP returns the average of all or selected cells in a specified column of a Lookup table.  The format of this function is:

AVGLOOKUP('TableName', 'ColumnName')

or

AVGLOOKUP('TableName', 'ColumnName', RowStart, RowStop)

'TableName' is a string constant or string variable that contains the name of the Lookup table.  The name of the Lookup table is shown on its tab at the top of the table.

'ColumnName' is a integer value, string constant or string variable the identifies the column.  If an integer value is provided, it is taken to be the column number in the Lookup table.  If a string constant is provided, it is assumed to be the name of the variable for the column in the Lookup table. The single quotes that normally identify a string constant are not required.  If a string variable is provided, it must contain the name of one of the columns in the Lookup table.

RowStart and RowStop are integers or EES variables specifying the starting and stopping rows for which the average will be performed.  These parameters are optional.

See also:  SUMPARAMETRIC

    AVGPARAMETRIC

    SUMLOOKUP


AVGPARAMETRIC

AVGPARAMETRIC returns the average of all or selected cells in a specified column of the Parametric table.  The format of this function is:

AVGPARAMETRIC('TableName', 'ColumnName')

or

AVGPARAMETRIC('TableName', 'ColumnName', RowStart, RowStop)

'TableName' is a string constant or string variable that contains the name of the Parametric table.  The name of the Parametric table is shown on its tab at the top of the table.

'ColumnName' is a integer value, string constant or string variable the identifies the column.  If an integer value is provided, it is taken to be the column number in the Parametric table.  If a string constant is provided, it is assumed to be the name of the variable for the column in the Parametric table. The single quotes that normally identify a string constant are not required.  If a string variable is provided, it must contain the name of one of the variables in the Parametric table.

RowStart and RowStop are integers or EES variables specifying the starting and stpoping rows for which the average will be performed.  These parameters are optional.

See also:  SUMPARAMETRIC


BESSEL_I0

BESSEL_I0(x) returns the value of zeroth-order Modified Bessel function of the first kind for argument value x where -3.75<=x<infinity.


BESSEL_I1

BESSEL_I1(x) returns the value of first-order Modified Bessel function of the first kind for argument value x where -3.75<=x<infinity.


BESSEL_J0

BESSEL_J0(x) returns the value of zeroth-order Bessel function of the first kind for argument value x where -3<=x<infinity.


BESSEL_J1

BESSEL_J1(x) returns the value of first-order Bessel function of the first kind for argument value x where -3<=x<infinity.


BESSEL_K0

BESSEL_K0(x) returns the value of zeroth-order Modified Bessel function of the second kind for argument value x where 0<=x<infinity.


BESSEL_K1

BESSEL_K1(x) returns the value of first-order Modified Bessel function of the second kind for argument value x where 0<=x<infinity.


BESSEL_Y0

BESSEL_Y0(x) returns the value of zeroth-order Bessel function of the second kind for argument value x where 0<x<infinity.


BESSEL_Y1

BESSEL_Y1(x) returns the value of first-order Bessel function of the second kind for argument value x where 0<x<infinity.


CONVERT

The Convert function provides unit conversions.  The format of the Convert function is

Convert('From', 'To')

where From and To are unit designations provided either as string constants or string variables.  If string constants are used, the single quote marks are optional. String variables are identified with a $ as the final character in the variable name.  The unit designations can be optionally enclosed in square brackets.

NOTE:  The CONVERT function will convert temperature differences but it does NOT convert temperatures from one scale to another.  Use the CONVERTTEMP function for this purpose.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format)

The Convert function returns the value X which satisfies the following relation:

1.0 * From = X * To

As a specific example,

FI=Convert(ft^2, in^2)

will set FI to a value of 144 because 1 square foot is 144 square inches.

Combination of units and multiple unit terms may be entered.  In a combination of units, such as Btu/hr-ft^2-R, the individual units are separated with a multiplication symbol (i.e., *), a dash (i.e., -) or division signs.   Only one division symbol may be used in any one term.  All units to the right of the division symbol are assumed to be in the denominator (i.e., raised to a negative power).  The ^ symbol is optional so ft2 and ft^2 are equivalent.  The following example converts 5  Btu/hr-ft^2-R into W/m2-K and sets H equal to this number:

H=5*Convert('Btu/hr-ft^2-R','W/m2-K)

The Convert function will accept multiple unit terms.  Each term is enclosed within parentheses.  Terms are separated with an optional * symbol or with a / symbol, as in the example below.

P =15* Convert((lbm/ft3)*(ft)/(s^2/ft), kPa)

Groups of units contained in parentheses can be raised to a power as in the following conversion.

Energy=KE*convert((m/s)^2,kJ/kg)

The defined unit symbols can be displayed with the Unit Conversion Info in the Options menu.

If you find that a unit you need is not defined, you can enter it by editing the UNITS.TXT file in the EES directory.   Instructions for entering new units are provided in the UNITS.TXT  file.

The Convert function should be used in preference to constants that have inherent dimensions (e.g., 144 in^2/ft^2) in order to avoid false error reports from the Check Units command.

Special characters:

To enter µ as in µm, hold the Alt-Key down and type 230 on the  numeric keypad.  Let the Alt key up and the µ should appear.   Other useful characters are Alt-248 which displays the degree symbol ° and Alt-250 which which appears as a dot (·) and is used to represent multiplication.  The Convert routine will accept a hypen (-), a  star (*) or character 250 (·) as a separator for units.  For example,  W-hr, W*hr and W·hr will all be accepted in the Convert command for Watt-hours.

See also: CONVERTTEMP


CONVERTTEMP

The CONVERTTEMP function converts temperatures from one scale to another.  Four scales are supported:  Celsius (C), Kelvin (K), Farenheit (F), and Rankine (R).  The CONVERTTEMP function has the  following format:

ConvertTemp('C', 'F', T)

The first two parameters are string constants or string variables which must be C, K, F, or R.  Both upper and lower case letters are permitted.  The single quotes surrounding the string constants are not required.  The third parameter is a temperature in the scale indicated by the first parameter.  The function returns the temperature in the scale indicated by the second parameter.

Example:

TF=CONVERTTEMP('C', 'F', 100)

This statement will convert 100 C to the equivalent temperature in F.  TF will be set to 212.

Use the CONVERT function to convert differences in temperature from one scale to another.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format)


CIS

CIS(X) returns a complex number that is equal to cis(X)+i*sin(X)

Example:  Y=3*CIS(30deg)

The above example will define a complex number with a magnitude of 3 and an angle of 30 degrees.

See also: Real, Imag, Magnitude, Angle, Complex Numbers


CONJ

CONJ(X) returns the complex conjugate of a complex variable X. Representing X as X_r + i*X_i, this function returns X_r - i*X_i.

Example:  Y=CONJ(X)

The above example will set the real part of Y (Y_r) to the real part of X and the imaginary part of Y to negative of the imaginary part (Y_i).

See also: Real, Imag, CIS, Magnitude, Angle, Complex Numbers


COS

COS(Arg) will return the cosine of the angle provided as the argument.  The required units (degrees or radians) of the angle is controlled by the unit choice made for trigonometric functions with the Unit System command.


COSH

COSH(Arg) will return the hyperbolic cosine of the value provided as the argument.


DIFFERENTIATE

The DIFFERENTIATE function returns the derivative determined from two columns of tabular data in a  Lookup Table or a Lookup file.

DIFFERENTIATE('Table Name','ColName1','ColName2',ColName2=Value)

'Table Name' is a string constant or string variable  that provides the name of the Lookup table in the Lookup Window or the name of an existing Lookup file stored on disk. The string constant must be enclosed within single quote marks.  Lookup table names appear on the tabs at the top of the Lookup Table Window.   If the name of a disk file is supplied, it must be the name of an existing Lookup file having either the binary or ASCII Lookup file Format.  ColName1 and ColName2 are the column header names.  These variables must be either be string constants or string variables.  Since there is no ambiguity, the single quotes for string constants are optional.

The final parameter is of the form ColName2=Value where the text to the left of the equal sign can be either of the column header names (ColName1 or ColName2) specified with the two previous parameters.  Note that if a string variable was provided for the column name, then the same string variable must be used for this parameter.  Value is a numerical value or expression.   EES will return an estimate of the derivative  d(ColName1)/ d(ColName2) at a point fixed by the specified value of either ColName1 or ColName2.

The DIFFERENTIATE command will use cubic interpolation between points to determine the estimate of the derivative if there are at least five rows in the table or file are needed to use this command.  If there are less than 5, linear interpolation will be used.

Note:  use a semicolon instead of a comma as the list separator when using the European numerical format)

For backward compatibility, the Differentiate function will accept two (rather than three) arguments where 'Table Name' is not provided.  In this case, EES will assume that the Differentiate function is to be applied to the first table in the Lookup Table window.

See also:  DIFFERENTIATE1, DIFFERENTIATE2


DIFFERENTIATE1

The DIFFERENTIATE1 function is used exactly like the DIFFERENTIATE function.  The only difference is that DIFFERENTIATE1 uses linear interpolation whereas the DIFFERENTIATE function uses cubic interpolation in the process of differentiating the data in the table.   A warning message will be generated if the  command attempts to extrapolate data.  Warnings will not be visible unless the Display Warning Messages control in the Options tab of the Preferences dialog is checked.


DIFFERENTIATE2

The DIFFERENTIATE2 function is used exactly like the DIFFERENTIATE function.  The only difference is that DIFFERENTIATE2 uses quadratic interpolation whereas the DIFFERENTIATE function uses cubic interpolation in the process of differentiating the data in the table.  A warning message will be generated if the  command attempts to extrapolate data.  Warnings will not be visible unless the Display Warning Messages control in the Options tab of the Preferences dialog is checked.


DUPLICATE

Duplicate is not a function but rather an EES command.  The Duplicate command is necessary in Modules, Subprograms and the EES main program.

Within Modules, Subprograms and the EES main program, the Duplicate command provides a shorthand way of entering equations into EES.  The equations which are to be duplicated are enclosed between the Duplicate and End commands.  The lower and upper limits specified for the Duplicate command must be integer number or a variable set to an integer constant ahead of the Duplicate command.  In this application, the Duplicate command  is only useful when used with array variables, e.g., X[j].  For example, the following statements in a Module, Subprogram or EES main program:

 	Duplicate j=1,5

 	      A[j]=h[j]-T*s[j]

 	End

are equivalent to:

 	A[1]=h[1]-T*s[1]

 	A[2]=h[2]-T*s[2]

 	A[3]=h[3]-T*s[3]

 	A[4]=h[4]-T*s[4]

 	A[5]=h[5]-T*s[5]

The lower and upper loop limits can be any of the following:

  i)   a numerical quantity or expression

  ii)  an EES variable that has been set to a value ahead of the Duplicate statement

  iii) an EES variable that is set to a value in the Parametric table

  iv)  the TableRun# keyword.

Note that EES does not allow more than one Duplicate claus to appear within the range of an outer Duplicate clause.  The following code, for example, would result in a compilation error.

duplicate i=1,5

duplicate j=1,6

x[i,j]=i*j

end

duplicate k=1,5	"this will not work"

y[i,k]=i+k

end

end

However, these intent of these equations can be entered by placing each inner Duplicate clause within its own other clause, as shown below.  These equations will compile with no problems.

duplicate i=1,5

duplicate j=1,6

x[i,j]=i*j

end

end

duplicate i=1,5

duplicate k=1,5

y[i,k]=i+k

end

end

 The Duplicate command should generally NOT be used in Functions and Procedures since a Repeat-Until clause is more efficient and provides more capability. For example, the equations

 	Duplicate j=1,N

 	      A[j]:=h[j]-T*s[j]

 	End

should be written as

 	j:=0

repeat

     j:=j+1;

     A[j]:=h[j]-T*s[j]

until (j>=N)

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format)


ERF

ERF(Arg) returns the Gaussian Error function of Arg.


ERFC

ERFC(Arg) returns the complement to the Gaussian Error function of Arg.  The ERF and ERFC functions are related by:

ERFC(Arg) = 1 - ERF(Arg)


ERROR Procedure

The ERROR procedure can be used only within an internal function or procedure.  The ERROR procedure allows the user to halt calculations with an explanatory message if a value is out of range.  (The WARNING procedure differs from the ERROR procedure in that a warning message is placed in the message que and calculations are allowed to continue.)  The Error procedure has the following format:

   CALL ERROR(X)

         or

   CALL ERROR('My error message XXXF1',X)

        or

  CALL ERROR('My Error Message')

The error string contained within single quotes is optional.  If a string is provided, the variable X is optional.  X is the value of the parameter which initiates the error.  If an error message is not provided, EES will generate the following error message when it executes the ERROR procedure.

Calculations have been halted because a parmeter is out of range.  The value of the parameter is XXX in function YYY.

Here XXX is the parameter value provided to the Error function and YYY is the function or procedure name.

If an error string is provided, EES will display that string, inserting the value of X in place of the characters XXX.  If a formatting option, such as A3, F1 or E4 follows the XXX, as in the example above, the value of X will be accordingly formatted, otherwise a default format will be applied.  If no format is supplied, automatic format is assumed.

Note: To insert a string, rather than a numerical value, use $ as the formatting option following the XXX, for example,

    CALL ERROR('My error string is XXX$',X$)

This ERROR procedure will most likely be used with an IF - THEN - ELSE  statement as in the following example.

     Function abc(X,Y)

       if (x<=0) then CALL ERROR(' X must be greater than 0.  A value of XXXE4 was supplied',X)

       abc:=Y/X

     end

     g=abc(-3,4)

When this function is called, the following message will be displayed and calculations will stop:

X must be greater than 0.  A value of -3.000E0 was supplied.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).


EXP

EXP(Arg) will return the value e raised to the power of the argument.


FACTORIAL

FACTORIAL(Arg) will return the factorial of Round(argument).  Note that Factorial is not a built-in function, but rather a library function that is located in the USERLIB folder and automatically read in when EES is started.  If the file Factor.LIB is not present in the USERLIB folder, this function will not be available.


FLOOR

FLOOR(Arg) will return a value equal to the largest integer value that is less than or equal to the value of Arg.  Note that FLOOR differs from TRUNC in that FLOOR when Arg is less than zero.  For example TRUNC(-2.5) = -2 whereas FLOOR(-2.5) = -3.


GAMMA_

GAMMA_(x) returns the Γ (GAMMA) function for the argument value x.

The Gamma function is defined as:

The GAMMA function is approximated as a series expansion as described by Abramowitz and Stegun, "Handbook of Mathematical Functions", Dover Publications, 10th printing, 1972.


IF

IF(A, B, X, Y, Z) allows conditional assignment statements in the Equations window.  If A<B, the function will return a value equal to the value supplied for X;  if A=B, the function will return the value of Y;   if A>B, the function will return the value of Z.  In some problems, use of the IF function may cause numerical oscillation.  It is preferable to use the IF - THEN - ELSE or REPEAT UNTIL statements in a function or procedure for conditional assignments.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).


IMAG

Imag(X) returns the imaginary part of a complex variable X. Representing X as X_r + i*X_i, this function returns X_i.

Example:  Y=Imag(X)

The above example will set the real part of Y (Y_r) to the imaginary part of X and the imaginary part of Y to zero.

Note that the Imag function is used to extract the imaginary part of a complex number variable or expression.  It cannot be used for assigning the imaginary part of a complex number.  For example,  the equation Imag(X)=4 will produce an error.  Instead you should just enter X=4*i which will set X to 0 + 4*i.  If you wish to only set the imaginary part of X, you can enter

X_i=4.0

See also: Real, Magnitude, Angle, CIS, Complex Numbers


INTEGRAL
INTEGRAL Function

The INTEGRAL function is used to evaluate an integral and in the solution of differential equations.  There are two basic forms of the integral function which differ in the reliance on the Parametric Table.

Table-based Integral function

The table-based Integral function uses the Parametric Table to provide the limits and step size of the integration variable.  The format of this function is INTEGRAL(Integrand, VarName).  The function returns the integral of the expression represented by Integrand with respect to the variable VarName, i.e., ∫(Integrand) d(VarName).  This form of the Integral function can be used only in conjunction with the Parametric Table.  VarName must be a legal variable name which has values defined in one of the columns of the table.  Integrand can be a variable or any implicit or explicit algebraic expression involving variables, values, and the integration variable, VarName.

Equation-based Integral function

The equation-based integral function serves the same purpose as the table-based integral function but it does not require the use of the Parametric Table.  The format for the equation-based integral function is

F = INTEGRAL(Integrand, VarName, LowerLimit, UpperLimit, StepSize)

or

F = INTEGRAL(Integrand, VarName, LowerLimit, UpperLimit)  {automatic step size}

Integrand can be any EES variable or expression for which the integral is desired.  The expression may involve VarName and it may be an implicit function.  Note that EES uses numerical integration to arrive at an estimate of the integral.  EES cannot reliably integrate expressions for which the integrand may be infinite or undefined during the integration process, such as 1/X when X=0.

VarName is the integration variable.

LowerLimit and UpperLimit are the lower and upper limits of the integration variable.  These limits may be specified with a constant or an EES expression.  However, the limits cannot be a function of VarName or any other variable which changes during the course of the integration.

StepSize is the increment EES will use for the integration variable while numerically evaluating the integral between the specified limits.  StepSize can be a constant or a variable whose value varies during the course of the integration.   Note that specification of StepSize is optional.  If StepSize is not provided or if StepSize is set to 0,  EES will select the step size using an automatic step size adjustment algorithm with parameters set in the Integration tab of the  Tolerances dialog.  Note that Richardson extrapolation can be employed if a fixed step size is provided in the function call or if the "Use fixed step size" button is selected in the Integration tab of the  Tolerances dialog.

EES uses a second-order predictor-corrector algorithm for evaluating the integral.  This algorithm is designed for solving combined algebraic differential equations which result when the integrand is a complex function of other variables.  The algorithm is especially suited to stiff equations.

EES uses the INTEGRAL function to solve initial value differential equations.  Any first-order differential equation can be transformed into an appropriate form by integrating both sides.  For example, the differential equation dy/dx = f(x,y) can be equivalently written as

y=y0 +  ∫ f(x,y) dx

where y0 is the initial value of y.  This equation can be solved using either the table-based or equation-based forms of the INTEGRAL function.  The table-based form would be entered into the EES Equations Window as

y = y0 + INTEGRAL(fxy, x)

where fxy is an EES variable or expression.  To solve the equation it is necessary to create a Parametric Table containing a column for variable x.  Values of x are entered into the Parametric Table with the value in first row corresponding to the lower limit of x and the value in the last row corresponding to the upper limit.  The step size is determined by the difference between the value of x in successive rows and need not be a fixed value.  The integral is evaluated when the Solve Table command is applied.

The equation-based form would appear in the EES Equations window as

y = y0 + INTEGRAL(fxy, x, low, high)

y0 and fxy are as defined above.  Low and high are the lower and upper limits for x.  Since the step size is not specified, EES will use automatic step size selection.  The parameters that control the step size selection are set in the Tolerances dialog.  Note that the integral limits, low and high, can be EES variables, but their values can not be undetermined or vary with the integration variable.  It is possible to solve problems of this nature as described in the example, Finding a Limit of Integration.

Higher order differential equations can also be solved by additional integration.  Shown below is an EES program which solved a second-order differential equation using the equation-based form of the INTEGRAL function.  A $IntegralTable directive is used to automatically generate an Integral Table holding intermediate values of specified integrated quantities.

"This example illustrates how EES  can solve a differential equation using a small integration

step size while reporting integrated values at larger specified intervals using the $IntegralTable

directive.

This process is illustrated by solving the following 2nd order differential equation:

     y``+y`-2y=4x  with y`(0)=0 and y(0)=1 for x between 0 and 1.

The $IntegralTable directive automatically constucts a table of values for x, y, y`, and y`` at x

increments of 0.1.  Automatic step size is used in the integration.  The net result is that small

increments of x may are used to evaluate the integral, but values are only reported in the

Integral table for x increments of 0.1.

"

y``=4*x+2*y-y`

y`=y`_i+integral(y``,x,0,x_f)

y=y_i+integral(y`,x,0,x_f)

y_i=1

y`_i=0

x_f=1

$Integraltable x:0.1, y, y`, y``

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

See Chapter 5 of the EES manual for additional discussion of the INTEGRAL function.


Finding a Limit of Integration

The algorithms used in EES Integral function for numerical integration do not allow EES to directly solve for a limit of integration.  For example, the following equation would produce an error in EES.

3=integral(x^2 ,x, 0, a)

It is possible, however, to solve this problem in serveral other ways.  Perhaps the simplest solution is to use a Subprogram or Module in which the limit, (variable a in this problem) is provided as a parameter.  The method is illustrated in the following equations.

Module FindLimit(a:L)

      L=integral(x^2, x, 0, a)

end

L=3

Call FindLimit(a:L)

a_exact=9^(1/3)

Another way to solve this problem is to reformulate the problem to be an optimization problem and use the Min/Max command.  In this case,  EES will adjust variable a so as to minimize an objective function.  The method is illustrated in the following equations.

L=integral(x^2, x, 0, a)

f=abs(L-3)

a_exact=9^(1/3)

This simple problem as an analytic solution which is the cube root of 9.


INTEGRALVALUE

The IntegralValue is used to retrieve data from the Integral Table that is created using the $IntegralTable directive.  In that sense, the IntegralValue function is similar to the TableValue function which retrieve data from the Parametric Table and the Lookup and Interpolate functions which retrieves data from the Lookup Table window or Lookup files.  The format of the IntegralValue command is

IntegralValue(t,'X')

where

t  is the value of the independent integration variable for which the value of X is to be returned.

X is the name of a variable that has been included in the Integral Table.  (The single quotes around the variable name are optional.)

The value provided for t must be less than or equal to the current value of the independent integration variable.  Values of X corresponding to values of t that are not included in the integration range may not be properly defined.

Example:

"This example illustrates the IntegralValue function to numerically estimate the derivatative of

Z with respect to X where

"

Z=integral(X^2,x,0,1)  "Z is the integral of X^2 dx for 0<=X<=1"

z_last=integralValue(X-0.01,z) "Z_Last is the value of Z at X-0.1"

$integraltable X, Z, Z_Last, dZ\dX , dz\dx_act"Construct an integral table containg X, Z, X_Last, and dZ\dX"

dz\dx=(z-z_last)/0.01 "Numerical approximation of the average derivative "

dz\dx_act=X^2  "Analytical derivative for comparison"

"View the Integral table by pressing Ctrl-I or selecting it from the Windows menu."


INTERPOLATE

The Interpolate function returns an interpolated or extrapolated value from tabular data.  These data can be in a Lookup table in the  Lookup Table Window or a Lookup file (stored on disk).   This function combines the capabilities of the Lookup and LookupRow functions and it is much easier to use.  The format of this function is

INTERPOLATE('Table Name','ColName1','ColName2',ColName2=Value)

'Table Name' is a string constant or string variable  that provides the name of the Lookup table in the Lookup Window or the name of an existing Lookup file stored on disk. The string constant must be enclosed within single quote marks.  Lookup table names appear on the tabs at the top of the Lookup Table Window.   If the name of a disk file is supplied, it must be the name of an existing Lookup file having either the binary or ASCII Lookup file Format.

ColName1 and ColName2 are the column header names.  These variables must be either be string constants or string variables.  Since there is no ambiguity, the single quotes for string constants are optional.

The final parameter is of the form ColName2=Value where the text to the left of the equal sign can be either of the column header names (ColName1 or ColName2) specified with the two previous parameters.  Note that if a string variable was provided for the column name, then the same string variable must be used for this parameter.  Value is a numerical value or expression.   EES will return the interpolated value from the data in column ColName1 corresponding to the specified value of ColName2.  If the value of ColName1 is supplied, EES will return the interpolated value of ColName2.

The Interpolate function uses cubic interpolation and it requires a minimum of five rows in the table.  Related functions are Interpolate1 and Interpolate2 which provide exactly the same capability using linear interpolation and quadratic interpolation, respectively.  Interpolate3, which provides cubic interpolation, is identical the Interpolatedfunction.  The Interpolate2D function provides interpolation as a function of two independent variables.

EES will issue a warning if the Interpolate functions are used to provide extrapolation.  Warnings will not be visible unless the Display Warning Messages control in the Options tab of the Preferences dialog is checked.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

For backward compatibility, the Interpolate function will accept two (rather than three) arguments where 'Table Name' is not provided.  In this case, EES will assume that the Interpolate function is to be applied to the first table in the Lookup Table window.


INTERPOLATE1

The INTEPOLATE1 function is used exactly like the INTERPOLATE function.  The only difference is that INTERPOLATE1 uses linear interpolation whereas the INTERPOLATE function uses cubic interpolation.  A warning message will be generated if the Interpolate1 command attempts to extrapolate data  Warnings will not be visible unless the Display Warning Messages control in the Options tab of the Preferences dialog is checked.


INTERPOLATE2

The INTEPOLATE2 function is used exactly like the INTERPOLATE function.  The only difference is that INTERPOLATE1 uses quadratic interpolation whereas the INTERPOLATE function uses cubic interpolation.  A warning message will be generated if the Interpolate2 command attempts to extrapolate data  Warnings will not be visible unless the Display Warning Messages control in the Options tab of the Preferences dialog is checked.

See also:  INTERPOLATE, INTERPOLATE1


INTERPOLATE2D

The Interpolate2D function returns an interpolated or extrapolated value as a function of two independent variables from tabular data.  A minimum of 8 data points are required.  These data can be in a Lookup table in the  Lookup Table Window or a Lookup file (stored on disk).   This function extends the capability of the Interpolate function which returns a value as a function of one independent variable.  The format of this function is

INTERPOLATE2D('Table Name', X, Y, Z, X=value1, Y=Value1 )

or

INTERPOLATE2D('Table Name', X, Y, Z, X=value1, Y=Value1 ,N)

'Table Name' is a string constant or string variable  that provides the name of the Lookup table in the Lookup Window or the name of an existing Lookup file stored on disk. The string constant must be enclosed within single quote marks.  Lookup table names appear on the tabs at the top of the Lookup Table Window.   If the name of a disk file is supplied, it must be the name of an existing Lookup file having either the binary (.LKT) or ASCII (.TXT, .CSV) Lookup file Formats.

X, Y,  and Z are the names of three different columns in the specified table.  These arguments can be string constants or string variables.  Since there is no ambiguity, the single quotes that are normally required for string constants are optional and they have been left off in the example above.

The next two parameters identify the two independent variables and set their values.  The format is ColumnName=Value where the text to the left of the equal sign must be one of the three column names specified in the second, third and fourth parameters.  Note that if a string variable was provided for the column name, then the same string variable must be used for this parameter.  Value is a numerical value or expression.

The last parameter, N, is optional.  This parameter indicates the maximum number of data points to be used in the interpolation process.  The two-dimensional interpolation algorithm is computationally intensive for large values of N.   If no value for N is provided, N is set to 64.  If the data table contains more than N points, EES will use the N points in the table that are nearest to the point for which the interpolate is requested in normalized coordinates.  If the data table contains fewer than N points, N is set to the number of points in the table.  If N is set to be less than 8, EES will reset it to 8 and issue a warning message.

Values for two of the three specified columns in the data table are specified in the calling parameters.  EES will return the interpolated value from the data as a function of these independent variables using interpolation or extrapolation, as required using a multi-quadric radial basis function interpolation method.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

See also:  Interpolate, Interpolate1, Interpolate2


Multi-quadric Radial Basis Function Interpolation

The multi-quadric radial basis function interpolation scheme attempt to represent Z as a function of X and Y using the following relation

where N is the number of data points used in the interpolation process, the w values are weighting factors. σ is a relative smoothing parameter which is zero in the current implementation.

The weights are found by solving the linear system of N equations that force the above equation to perfectly represent the provided data.  Once the weights are determined the equation is used to interpolate or extrapolate the values of Z for specified values of X and Yy.  The computations needed to determine the weights are O(N cubed) so the computational effort increases signficantly as N is increased.  The Interpolate2D function provides an optional argument to specify N.  If N is less than the number of data points, N points will be selected that are closest to Z in normalized coordinates.  N is 64 by default.

Interpolate2D


LOG10

LOG10(Arg) will return the base 10 logarithm of the argument.


LN

LN(Arg) will return the natural logarithm of the argument.


LOOKUP

The Lookup function is used to retrieve the value in a cell of a Lookup Table or a Lookup file (stored in a separate file on disk).  Use the TableValue function to retrieve a value from the Parametric table or the IntegralValue function to retrieve a value from the Integral table.  The Lookup function returns a numerical value.  Use the LOOKUP$ function to return a string. The Lookup function can also be used to set the value of a cell in the Lookup Table as explained below.  The Lookup function can be used with the LookupRow function for interpolation of data in a Lookup Table or file, but the INTERPOLATE command is more convenient for this purpose.

The Lookup function returns a value at a specified row and column from a table of data.  The function normally requires three arguments.  The first argument is a (case-insensitive) string constant or string variable that provides the name of the Lookup table in the Lookup Window or the name of an existing Lookup file. The string constant must be enclosed within single quote marks.  Lookup table names appear on the tabs at the top of the Lookup Table Window.  The next two arguments are constants or variables that provide the row and column to access in the specified Lookup fable or Lookup file.  The function returns the value at the specified row and column.

The column may be indicated in several different ways.  Most simply, the column may be entered by supplying the column number.  In this case, it is not necessary for the column to be an integer.  Interpolation will be provided automatically for noninteger column numbers.  Alternatively, the column may be entered with a string variable or string constant set to the name of the column shown in the column header.  The string constant must be enclosed within single quote marks. The function will return the value in the Lookup Table at the specified row and column.   The row and column do not have to be integer values.  Linear interpolation will be applied as necessary if the row or column are non-integers. For example:

Lookup('myTable', 2,3.5) will return a value which is midway between the values on the second row in the third and fourth columns for the Lookup table named 'myTable'.

Use the Lookup$ command to return a string rather than a numerical value.

For backward compatibility, the Lookup function will accept two (rather than three) arguments where the first argument specifying the Lookup table name or file name is not provided.  In this case, EES will assume that the Lookup function is to be applied to the first table in the Lookup Table window.

EES recognizes both binary and ASCII forms for Lookup files, identified by the filename extensions of .LKT or .TXT, respectively.  If a filename extension is not provided, EES assumes the binary form for the Lookup file and internally adds .LKT.  See Lookup file Formats for additional information.

Lookup('C:\abc\CopperK.LKT', R, 'Temp')  will return the value found in row R and the column named Temp in file C:\abc\CopperK.LKT.  The Lookup file must be saved using the Save Lookup Table command in EES.  The file name and column name could have been provided with string variables, e.g., Lookup(File$,R,T$) where File$ must be set to the desired file name and T$ must be set to the name of the column.

If the specified row or column is less than one, the value in the first row or column will be returned. Similarly, if the row or column is greater than the number of rows and columns in the Lookup Table, the value in the last row or column will be returned.

The Lookup function can be used with the LookupCol and LookupRow LookupRow to provide interpolated values of user-supplied tabular information.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

The Lookup function can also be used to set the value of a cell in the Lookup Table window when it is used on the left-hand side of an equation in an internal Function or Procedure.  For example, the following function sets the values in the first column of the Lookup table named 'Lookup 1' to sequential integers beginning with 101.

function SetLookup(NRows)

   i:=0

   repeat

      i:=i+1

      Lookup('Lookup 1',i,1)=100+i

   until (i>=NRows)

   SetLookup:=1; {must return a value}

end

Note that variables (but not algebraic expressions) can be used as arguments to the Lookup function when it is used in this manner.  However, their values must be within the range of the currently defined Lookup Table.

Setting Lookup Table values overcomes a limitation in EES which prevents arrays from being passed as arguments to Functions and Procedures.  Since the Lookup Table is accessible to all EES statements, array information can be stored in the Lookup Table and used where it is needed.  This capability can also be used to chain EES programs for sequential operation by having one EES program save the Lookup Table in a Lookup file which is then used by the next EES program which is opened.  The $OpenLookup and $SaveLookup directives and the Link button that can be placed on the Diagram window facilitate the chaining process.

The $Export directive also provides a means of copying results from EES into a file on disk.  The $Export is more convenient when data are to be read into another application.


LOOKUP$

The LOOKUP$ function operates just like the Lookup function except that it returns a string rather than a numerical value.  As in the LOOKUP function the, LOOKUP$ function normally requires three arguments. The first is a string constant or string variable  that provides the name of the Lookup table in the Lookup Table Window or the name of Lookup file stored on disk.  The next argument is a numerical value or expression that provides the row in the table.  This row value should be an integer.  Interpolation between rows is not allowed, as it is in the LOOKUP function.  The final parameter indicates the column.  The column can be indicated by a numerical value or expression which provides the column number or by the name of the column provided in a string constant or string variable.

Note.  In order to accept string information, the format style of the column in the Lookup table must be set to STRING.  To change the format style, click in the column header and make the change in the Format Table dialog window.

For backward compatibility, the Lookup$ function will accept two (rather than three) arguments where the first argument specifying the Lookup table name or file name is not provided.  In this case, EES will assume that the Lookup$ function is to be applied to the first table in the Lookup Table window.


LOOKUP$ROW

The LOOKUP$ROW function operates just like the LOOKUPROW function except that it its final argument is a string rather than a value.  The function returns the row in the table in which this string exists.  As in the LOOKUPROW function, the LOOKUP$ROW function requires three arguments.  The first is a string constant or string variable  that provides the name of the Lookup table in the Lookup Table Window or the name of Lookup file stored on disk.  The next argument is the column in the table.  The column may be indicate by a number or by a string constant or variable that provides the name of the column.  The final argument is a string constant or string variable holding the string that will be searched in the table.

Note.  In order to accept string information, the format style of the column in the Lookup table must be set to STRING.  To change the format style, click in the column header and make the change in the Format Table dialog window.

See the description of the Lookup Table Window for more information.

Example:

  Row=LOOKUP$ROW('Lookup 1', 'Names', N$) {Returns the row in the column called NAMES that holds a string represented by N$}

For backward compatibility, the Lookup$Row function will accept two (rather than three) arguments where the first argument specifying the Lookup table name or file name is not provided.  In this case, EES will assume that the Lookup$Row function is to be applied to the first table in the Lookup Table window.


Lookup File Formats

A Lookup file is a two-dimensional table of data that has been stored in a disk file.  A name and display format for each column of data may also be stored, depending on the file format.  Lookup files can be accessed by the Differentiate, Interpolate, Lookup, LookupCol, and LookupRow commands.  EES recognizes both binary and ASCII forms for Lookup files.  Binary files are identified with a .LKT filename extension.  ASCII Lookup files can have a .TXT or .CSV filename extension.  Each file format has advantages and disadvantages.   The binary form is read in more quickly and it requires smaller file sizes.  The ASCII form is easier to edit and it can be read and written by spreadsheet or other applications.  Details for each file type follow:

Binary Lookup files (.LKT)

Binary Lookup files store all of the information that appears in a Lookup Table window in a binary file on disk, including the data, and the column name, units, and display format for each file type.  A binary (.LKT) Lookup file is created using the Save Lookup Table command.  Once created, the Lookup file can be opened into the Lookup Table window using the Open Lookup Table menu command, the $OPENLOOK directive, or a Link button (type 6) on the Diagram window.

ASCII Lookup files (.TXT)

There are several variations for the .TXT Lookup file format.  In the basic form, the first line of the file contains the number of rows and columns in the table.  Each following line provides the data for one row with the value for each column separated by one or more spaces or a tab character.  The basic form does not provide a means of specifying the names, units, or display format for the data.  EES assigns the names "COLUMN1', 'COLUMN2', etc. and these column names should be used when the file is used with the Interpolate or Differentiate commands.  Automatic formatting is used to display the data if the file is read into the Lookup Table with the Open Lookup Table command.  The following example shows the .TXT data needed for a Lookup file with five rows and three columns, with no column header informatino.

5  3

1	11	111

2	22	222

3	33	333

4	44	444

5	55	555

If the number of rows is a negative number, EES will determine the number of rows of data in the file.

If the number of columns is a negative number, EES will expect to find the format specification (e.g., F3, E4, or S0) followed by one space and then the column heading and units for each column.  If a column contains string data, then the format specification must be S0 and the string data must be contained in single quotes.  Units are optional but if supplied, they must be enclosed in square brackets with a least one space separating them from the column name.  The following lines contain the .TXT data for each row, separated by one or more spaces or a tab.  The example below would create a table with 2 rows and 3 columns.  The columns would be formatted with E4, F1, and S0 format specifications and the column names will be ColA, ColB, and ColC.

2  -3

E4 ColA [Btu]

F0 ColB

S0 Col

1.23E-12	2.2	'A'

2.34E-11	4.8	'B'

ASCII Lookup files (.CSV)

The .CSV file provides only data without any information concerning the column names or data format.  The number of values in the first row of the file determines the number of columns in the table.  The number of rows in the table is equal to the number of rows of data.  Values on each row are separated with the list separator character.  Each row ends with a linefeed - carriage return.


LOOKUPCOL

The LookupCol function scans a specified row in a table of  tabular data and returns the column in this table in which the value is equal to a specified value.  A bisection method is used in finding the column.

The function requires three arguments.  The first argument is a (case-insensitive) string constant or string variable that provides the name of the Lookup table in the Lookup Window or the name of an existing Lookup file. The string constant must be enclosed within single quote marks.  Lookup table names appear on the tabs at the top of the Lookup Table Window.  EES recognizes both binary and ASCII forms for Lookup files, identified by the filename extensions of .LKT or .TXT, respectively.  If a filename extension is not provided, EES assumes the binary form for the Lookup file and internally adds .LKT.  See Lookup File Formats for additional information.

The next arguments are the row in the table and a target value.  The function will return the column corresponding to the target value.  The column value returned will not necessarily be an integer.  Interpolation between columns will be provided as needed.

The purpose of the LookupCol function is to provide a means of relating tabular information in different rows of specified Lookup Tables. For example, suppose temperatures are entered in row 1 of the Lookup Table named 'data' and the viscosity at each temperature is entered in row 2.  The column corresponding to a temperature of 100 will be returned with LookupCol('data' 1,100). The viscosity corresponding to that temperature is then Lookup('data',2,LookupCol(1,100)).

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

For backward compatibility, the LookupCol function will accept two (rather than three) arguments where the first argument specifying the Lookup table name or file name is not provided.  In this case, EES will assume that the LookupCol function is to be applied to the first table in the Lookup Table window.

See also:

Lookup	LookupRow

INTERPOLATE	INTERPOLATE1

INTERPOLATE2


LOOKUPCELLEMPTY

The LOOKUPCELLEMPTY requires the same inputs as the LOOKUP function. These are 1) the name of the Lookup table or Lookup file, 2) the row and 3) the column.  As with the LOOKUP function, the column can be designated with an integer or EES variable or expression that evaluates to an integer for the column number, or by specifying the name of the a string constant or string variable that provides the name of the column.

The function returns either a 0 (if the specified cell is empty) or 1 if it contains a value.  The function can be used with logic statement such as IF THEN ELSE and REPEAT - UNITL in internal functions and procedures to ensure that a cell in the lookup table or file contains a value.


LOOKUPROW

The LookupRow function scans a specified column of  tabular data in a Lookup table or Lookup file and returns the row in this table in which the value is equal to a specified value.  A bisection method is used in finding the row.  Note that the INTERPOLATE command combines the functions of the Lookup and LookupRow commands, and it is somewhat more convenenient to use.

The function requires three arguments.  The first argument is a (case-insensitive) string constant or string variable that provides the name of the Lookup table in the Lookup Window or the name of an existing Lookup file. The string constant must be enclosed within single quote marks.  Lookup table names appear on the tabs at the top of the Lookup Table Window.   EES recognizes both binary and ASCII forms for Lookup files (stored on disk), identified by the filename extensions of .LKT or .TXT, respectively.  If a filename extension is not provided, EES assumes the binary form for the Lookup file and internally adds .LKT.  See Lookup file Formats for additional information.

The next arguments are the column in the table and a target value.  The function will return the row corresponding to the target value.  The row value returned will not necessarily be an integer.  Interpolation between rows will be provided as needed.  The column may be indicated in several values.  First, it may be entered as an integer value.  Alternatively, it may be entered by providing the column name as a string constant or a string variable.   The function will return the row in the Lookup Table corresponding to the value supplied as the second argument.  The row value returned will not necessarily be an integer. Interpolation between rows will be provided as needed.

The purpose of the LookupRow function is to provide a means of relating tabular information in different columns of a specified Lookup Table.  For example, suppose you have created a Lookup table called VISCDATA in which you have entered the temperature in the first column (titled TEMP) and the viscosity at that temperature in the second column (titled VISC).  The row corresponding to a temperature of 100 will be returned with LookupRow('VISCDATA', 'TEMP',100).  The viscosity corresponding to that temperature is then Lookup('VISCDATA', LookupRow('VISCDATA', 'TEMP', 100), 'VISC').  Note that the Interpolate functions have a similar function to Lookup and LookupRow and they are easier to use.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

For backward compatibility, the LookupRow function will accept two (rather than three) arguments where the first argument specifying the Lookup table name or file name is not provided.  In this case, EES will assume that the LookupRow function is to be applied to the first table in the Lookup Table window.

See also:

Lookup	LookupCol

INTERPOLATE	INTERPOLATE1

INTERPOLATE2


NLOOKUPROWS

NLOOKUPROWS takes one argument which must be either a string constant  or a string variable.  The string contains the name of a Lookup table (as in appears on a tab in the Lookup Table Window) or the name of a Lookup file stored on disk.   The function returns the number of rows in the specified table.  If the specified table does not exist, the function call will result in an error message.

Example:

N=NLOOKUPROWS('LOOKUP 1') "number of rows in the Lookup Table named 'Lookup 1'"

See also:	Lookup Window

Lookup File Formats


MAGNITUDE

Magnitude(X) returns the magnitude (also called modulus or absolute value) of a complex variable X. In complex mode, the ABS function also returns the magnitude.  Representing X as X_r + i*X_i, this function returns sqrt(X_r^2+X_i^2).

Example:  Y=Magnitude(X)

The above example will set the real part of Y (Y_r) to the magnitude of X and the imaginary part of Y to zero.

Note that the Magnitude function is used to extract the magnitude of a complex number variable or expression.  It cannot be used for assigning the magnitude of a complex number.  For example,  the equation Magnitude(X)=4 will produce an error.

See also:  Angle, Imag, Real, CIS, Complex Numbers


MAX

MAX(Arg1, Arg2, Arg3, ... ) will return the value of the largest of its arguments.  The number of arguments must be greater or equal to 1. An array or subset of an array can be provided in the argument list by using array range notation, e.g., X[1..50].

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).


MIN

MIN(Arg1, Arg2, Arg3, ... ) will return the value of the smallest of its arguments.  The number of arguments must be greater or equal to 1.  An array or subset of an array can be provided in the argument list by using array range notation, e.g., X[1..50].

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).


MOD

MOD(Arg1, Arg2) returns the modulus of Arg1 with respect to Arg2.  The modulus is the remainder when Arg1 is divided by Arg2.  If Arg2 is 0, an error will result.

Mathematical Functions


PI

PI is a reserved variable name which has the value of 3.1415927.


PRODUCT

PRODUCT(Arg, Series_info) returns the product of a series of terms.  Arg can be any algebraic expression.  Series_info provides the name of the product index variable and the lower and upper limits.  These limits must be integers or variables which have been previously assigned to integer values.  The function is best explained by examples.  PRODUCT(j, j=1,4) will return 1*2*3*4 or 24, which is 4 factorial.  The PRODUCT function is most useful when used with array variables, e.g., X[j].  For example, the product of the square of all 10 elements in the vector X can be obtained as PRODUCT(X[j]*X[j], j=1,10).

The PRODUCT function is quite similar in its operation to the SUM command.  Additional detail on the use of the PRODUCT function may be found with the SUM function description.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).


RANDOM

The Random function can have two or three arguments.  The usual application provides two arguments, so that Random(a,b) returns a uniformily distributed random number X such that a <=X<=b.

If a third argument is provided, it is used as a seed for the random number generator routines.  The argument should be an integer.  The random number generator will always return the same value if a constant value is provided for the seed, e.g.,

Random(0,5,99)

The Random function can be used only within Functions and Procedures.  Used with the

Repeat Until or other logical expressions, it can be used to implement Monte Carlo type calculations.

Mathematical Functions


REAL

Real(X) returns the real part of a complex variable X. Representing X as X_r + i*X_i, this function returns X_r.

Example:  Y=Real(X)

The above example will set the real part of Y (Y_r) to the real part of X and the imaginary part of Y to zero.

Note that the Real function is used to extract the real part of a complex number variable or expression.  It cannot be used for assigning the real part of a complex number.  For example,  the equation Real(X)=4 will produce an error.  Instead you should just enter X=4 which will set X to 4 + i*0.  If you wish to only set the real part of variable X, you can enter

X_r=4

See also: Imag, Magnitude, Angle, CIS, Complex Numbers


ROUND

ROUND(Arg) will return a value equal to the nearest integer value of the argument.

See also: TRUNC and FLOOR


SIN

SIN(Arg) will return the sine of the angle provided as the argument.  The required units (degrees or radians) of the angle is controlled by the unit choice made for trigonometric functions with the Unit System command.


SINH

SINH(Arg) will return the hyperbolic sine of the value provided as the argument.


SQRT

SQRT(Arg) will return the square root of the value provided as the argument.  The argument must be greater than or equal to zero.  The argument may be an algebraic expression.


STEP

STEP(Arg) will return a value of 1 if the argument is greater than or equal to zero;  otherwise the STEP function will return zero.  The STEP function can be used to provide conditional assignments similar to the IF function.  For example, the following equation will set A=B if Z>=5 and A=C if Z<5.

A  =  Step(Z - 5) * B  +  (1-Step(Z - 5)) * C


SUM

There are two forms for the SUM function.  EES determines which format is in use by context.

Index Form

SUM(Arg, i=1,50) returns the sum of a series of terms, i.e., ΣArg.  Arg can be any algebraic expression involving the index.  The index is represented as i here but it can be any EES variable name.  The lower and upper limits must be integers or variables which have been previously assigned to integer values.  The function is best explained by examples. SUM(j, j=1,4) will return 1+2+3+4 or 10.  The SUM function is most useful when used with array variables, e.g., X[j].  For example, the scalar product of two vectors, X and Y, each with 10 elements can be obtained as SUM(X[j]*Y[j], j=1,10).  The SUM function can be used with array variables to manipulate matrices.  Note that the limits appear in the Sum command must be integers or EES variables that have been previously set to integer values.  The following equations would be valid.

N=50

S=SUM(X[i], i=1,N)

When used in internal Functions and Procedures , the Sum function limits cannot be provided as arguments since the value of the limit is not known when the Sum statement is compiled,  In this case, a Repeat Until or Duplicate command should be used in place of the SUM function, as in the following example.

S=0

i:=0

repeat

     S:=S+x[i]

until (i>=N)

List Form

SUM(Arg1, Arg2, ...ArgN) returns the sum of the arguments.  Array range notation is particularly convenient for the list form.  For example, SUM(X[1..100]) returns the sum of the 100 elements in the X array. Note, however, that mathematical operations within the List Form of the Sum function is not provided.  For example:

Z=SUM(0.1*X[1..100]) "This will not work!!!!!'

If mathematical operations with the SUM function are required, use the Index Form.


SUMLOOKUP

SUMLOOKUP returns the sum of all or selected cells in a specified column of a Lookup table.  The format of this function is:

SUMLOOKUP('TableName', 'ColumnName')

or

SUMLOOKUP('TableName', 'ColumnName', RowStart, RowStop)

'TableName' is a string constant or string variable that contains the name of the Lookup table.  The name of the Lookup table is shown on its tab at the top of the table.

'ColumnName' is a integer value, string constant or string variable the identifies the column.  If an integer value is provided, it is taken to be the column number in the Lookup table.  If a string constant is provided, it is assumed to be the name of the variable for the column in the Lookup table. The single quotes that normally identify a string constant are not required.  If a string variable is provided, it must contain the name of one of the columns in the Lookup table.

RowStart and RowStop are integers or EES variables specifying the starting and stopping rows for which the average will be performed.  These parameters are optional.

See also:  SUMPARAMETRIC

    AVGPARAMETRIC

    AVGLOOKUP


SUMPARAMETRIC

SUMPARAMETRIC returns the sum of all or selected cells in a specified column of the Parametric table.  The format of this function is:

SUMPARAMETRIC('TableName', 'ColumnName')

or

SUMPARAMETRIC('TableName', 'ColumnName', RowStart, RowStop)

'TableName' is a string constant or string variable that contains the name of the Parametric table.  The name of the Parametric table is shown on its tab at the top of the table.

''ColumnName' is a integer value, string constant or string variable the identifies the column.  If an integer value is provided, it is taken to be the column number in the Parametric table.  If a string constant is provided, it is assumed to be the name of the variable for the column in the Parametric table. The single quotes that normally identify a string constant are not required.  If a string variable is provided, it must contain the name of one of the variables in the Parametric table.

RowStart and RowStop are integers or EES variables specifying the starting and stopping rows for which the sum will be performed.  These parameters are optional.

Note that the sum of all rows in the Parametric table can be viewed by selecting the "Include a Sum Row in the Parametric Table" control in the General tab of the Preferences dialog Alternatively, the sum row can be made visible with the $SUMROW ON directive.

See also:  AVGPARAMETRIC

                TABLEVALUE

                SUMLOOKUP


TABLENAME$

TABLENAME$ returns the name of Parametric Table that is currently being used in the calculations.  Parametric table names are seen on the tabs at the top of the Parametric Table Window.  The name of a Parametric Table can be changed by right-clicking on the tab.

This function has no arguments and it should only be used only when calculations are initiated with the Solve Table or Min/Max Table command in the Calculate menu.

The TABLERUN# function returns the run (row) in the Parametric table that is currently being used in the calculations.

Mathematical Functions


TABLERUN#

TABLERUN# returns the Parametric Table run number, i.e., the current row in the Parametric Table.  The name of the Parametric Table that is currently being used is accessed with the TABLENAME$ function.

This function has no arguments and it should only be used only when calculations are initiated with the Solve Table or Min/Max Table command in the Calculate menu.

Mathematical Functions


TABLEVALUE

TABLEVALUE('TableName', Row, Column) or TABLEVALUE('TableName', Row, 'VariableName') returns the value stored in the row and column of the specified Parametric Table.  'TableName' can either be a string variable or a string constant holding the name of the Parametric table, as it appears on the tab in the Parametric Table Window.  The name is case-insensitive.

The TABLEVALUE function in older versions of EES required only two arguments, the Row and Column.  To provide compatibility with older versions, EES will assume that the TABLEVALUE function is to be applied to the first Parametric table if 'TableName' is not provided.

The column number may be either entered directly as an integer number or indirectly by supplying the variable name for the desired column within single-quotes, e.g., TableValue('Table 1', 6, 'ABC') specifies the column in the table holding values of variable ABC.  Alternatively a string variable may be used to provide the name of the column.  An error message will be generated if the row or column (or corresponding variable name) does not exist in the Parametric Table or if referenced cell does not have a value.  The TABLEVALUE function is useful in the solution of some marching-solution type problems in which the current value of a variable depends on its value in previous calculations.

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

See also:

INTERPOLATE	INTERPOLATE1

INTERPOLATE2

INTEGRALVALUE

SUMPARAMETRIC


TAN

TAN(Arg) will return the tangent of the angle provided as the argument.  The required units (degrees or radians) of the angle is controlled by the unit choice made for trigonometric functions with the Unit System command.


TANH

TANH(Arg) will return the hyperbolic tangent of the value provided as the argument.


TRUNC

TRUNC(Arg) will return a value equal to the integer value corresponding to the argument rounded toward zero.

See also ROUND and FLOOR


UNCERTAINTYOF

The UNCERTAINTYOF function returns the assigned or calculated uncertainty of the variable that is provided as the argument to the function.

Example:  U=UncertaintyOf(X)

The returned value will be zero if uncertainty information has not been specified for the specified variable or if the calculations are not initiated with the Uncertainty Propagation or Uncertainty Propagation Table commands.

See:  Uncertainty Propagation

         Uncertainty Propagation Table


UNITSYSTEM

The UNITSYSTEM function provides information relating to the current settings in the Unit System dialog window.  The function takes one character-string argument which must be surrounded by single quote marks.  Legal arguments are 'SI', 'Eng', 'Mass', 'Molar', 'Deg', 'Rad', 'kPa', 'bar', 'psia', 'atm', 'C', 'K', 'F', 'R', 'Pa', 'MPa', and 'KJ'.  The function will return 1 (for true) or 0 (for false).

The function is particularly important if you are writing your own internal library routines.  For example, suppose you have established a correlation for specific heat that requires temperature to be in R.  You can convert the temperature supplied to the function depending on the unit system settings made in the EES program, as illustrated in the following function for the specific heat of ethylene glycol.

Function CPEG(T,MF)

{$CPEG

CPEG returns the specific heat of an ethylene-glycol solution in Btu/lb-F, given a temperature in Rankine and a mass fraction of ethylene-glycol in the solution.}

if (UnitSystem('F')=1)  then T:=T+459.6

if (UnitSystem('K')=1) then T:=T*1.8

if (UnitSystem('C')=1) then T:=(T+273.15)*1.8

{Following correlation requires T in degrees Rankine}

CPEG=0.8972266+1.6125E-04*T+1.8963E-08*T^2-2.0722E-11*T^3-7.2303E-01*MF-8.5445E-02*MF^2+0.00560529*MF^3+7.1584E-04*T*MF-7.4079E-05*T*MF^2+1.4842E-08*T^2*MF+8.9292E-09*T^2*MF^2

End

Also see:  $IF and $IFNOT directive

    $UNITSYSTEM


WARNING Procedure

The WARNING procedure can be used only within an internal function or procedure.  The WARNING procedure generates a warning message which is placed in the warning  message que and displayed when calculations are completed.  Note that a warning message generated in this manner is always displayed no matter what the setting of the 'Display Warning Messages' checkbox in the Options tab of the Preferences dialog or whether or not a $Warnings On directive is provided.  The WARNING procedure is similar to the ERROR procedure which halts calculations when some user-specified error condition is encountered.  The WARNING procedure has the following format:

   CALL WARNING(X)

         or

   CALL WARNING('My warning message XXXF1',X)

        or

  CALL WARNING('My warning message')

The warning string is optional, but if it is provided, it must be placed within single quote.  If a warning string is provided, the variable X is optional.  X is the value of the parameter which initiates the warning.  If a warning string is not provided, EES will generate the following generic warning message.

"A warning message was issued due to the value XXX in XXX."

Here XXX is the parameter value provided in the WARNING call statement and YYY is the function or procedure name in which the Call WARNING statement appears..

If a warning string is provided, EES will display that string, inserting the value of X in place of the characters XXX.  If a formatting option, such as A3, F1 or E4 follows the XXX, as in the example above, the value of X will be accordingly formatted, otherwise a default format will be applied.  If no format is supplied, automatic format is assumed.

Note: To insert a string, rather than a numerical value, use $ as the formatting option following the XXX, for example,

    CALL WARNING('My error string is XXX$',X$)

The WARNING procedure will most likely be used with an IF - THEN - ELSE  statement as in the following example.

     Function abc(X,Y)

       G:=X+Y

       if (G<=0) then CALL WARNING('The sum of X and Y should be greater than zero.  The sum was XXXA1 ',G)

       abc:=G

     end

     g=abc(3,-4)

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).


Richardson Extrapolation

Richardson extrapolation is provided as an option when the equation-based Integral function is used with a fixed step size.  A fixed step size can either be specified in one of two ways. The step size can be specified (as the fifth parameter) in the equation-based integral function.   Alternatively, if a step size is not provided in the function, EES will use the step size setting indicated in the Integration tab of the Tolerances dialog.  Richardson extrapolation can be employed if the 'Use fixed step size' radio button is selected.

Richardson extrapolation is a clever technique to reduce the truncation error associated with numerical integration.  For a fixed step size, h1, the true value of an integral, I, is approximately equal to

I = I(h1) + E(h1)

where

I(h1) is the value of the integral calculated by using numerical integration with a fixed step size h1

      E(h1) is the truncation error resulting from a step size equal to h1

Suppose the integral were calculated again, but with a different step size h2.  In this case,

I = I(h2) + E(h2)

The truncation error for the second-order integration algorithm used in EES is approximately a function of the square of the integration step size so

Solving for E(h2) and substituting this result for the integral estimate yields

Thus, the combined result of two numerical integration estimates with differing step sizes can be used to produce an improved estimate.  A more detailed explanation of this technique can be found in Numerical Methods for Engineers by S.C. Chapra and R.P. Canale, McGraw-Hill, 1985.

In the EES implementation of this technique, h2 = h1 / 2 and the extrapolation procedure is applied for every step.  Tests with this extrapolation procedure have shown that it reduces the truncation error by one to two orders of magnitude compared to the error that would occur at the the same step size.


String Functions

The following functions facility operation with string variables.

CONCAT$

COPY$

DATE$

lowercase$

STRING$

STRINGLEN

STRINGPOS

STRINGVAL

TIME$

UPPERCASE$


CONCAT$

The CONCAT$ function accepts two arguments both of which must be either a string constant or a string variable.  The function returns a single string that concatenates the two strings.

Example:  R$=CONCAT$('R','22')  {R$ will be set to 'R22', which can be used in thermophysical property function calls}

Return to String Functions


COPY$

COPY$ creates a string that is a substring of the string expression provided as the first argument.  The second argument indicates the character position at which the substring starts, and the third parameter is the substring length.  If this length exceeds the length of the string expression, it is set to the length of the string expression.

Example:  Neat$=COPY$('This is neat', 9, 255)  "the function returns 'neat'"

Return to String Functions


DATE$

The DATE$ function returns the current date.  The function has no arguments.  The format of the date is controlled by the settings in the Regional Options Control Panel of your Windows Operating System.

Example:   T$=concat$('Today is ',DATE$)

Return to String Functions


LOWERCASE$

The LowerCase$ function accepts one string variable or string constant argument.  It returns a string in which all letters in the string are converted to lowercase.  It is not necessary to change the case of fluid names or file names as the functions that use this information are case insensitive.

Example:  E$=LowerCase$('EESy')

Return to String Functions


STRING$

String$ accepts one argument which can be a numerical constant, variable, or expression.  The function returns a string representing the numerical value of the argument.  The function uses Auto format to set the format of the value before converting it to a string.

The StringVal function provides the inverse operation, converting a string to numerical value.

Example: R$=CONCAT$('R',String$(10+12))  "R$ is set to 'R22'"

Return to String Functions


STRINGPOS

StringPos accepts two arguments both of which must be either be a string constant or string variable.  The function returns the position of the first string within the second.  If the first string is not contained within the second, the function returns 0.  This function is case-sensitive.  You may wish to use the LowerCase$ or UpperCase$ functions.

Return to String Functions


STRINGVAL

StringVal returns the numerical value formed by the characters of a string constant or string variable.  This function provides the inverse operation of the String$ function.

This function can be applied with a string variable dropdown list on the Diagram window when it is desired to allow the user to select from a pre-determined set of numerical values.

Example: R$='22';   V=StringVal(R$) "V is set to value 22'

Return to String Functions


STRINGLEN

StringLen returns the number of characters in the string constant or string variable provided as the argument.

This function can be applied with a string variable dropdown list on the Diagram window when it is desired to allow the user to select from a pre-determined set of numerical values.

Example: R$='12345';   V=StringLen(R$) "V is set to value 5"

Return to String Functions


TIME$

The TIME$ function returns the current time.  The function has no arguments.  The format of the string returned by this function is controlled by the settings in the Regional Options Control Panel of your Windows Operating System.

Example:   T$=concat$('The time is now ',TIME$)

Return to String Functions


UPPERCASE$

The UPPERCASE$ function accepts one string variable or string constant argument.  It returns a string in which all letters in the string are converted to uppercase.  It is not necessary to change the case of fluid names or file names as the functions that use this information are case insensitive.

Example:  E$=UpperCase$('ees') "Sets E$ to 'EES'

Return to String Functions


Thermophysical Functions

The built-in thermophysical property functions are listed below in alphabetical order.

ACENTRICFACTOR	CONDUCTIVITY

CP	CV

DENSITY	DEWPOINT

DIPOLE	ENTHALPY

ENTROPY	FUGACITY

HUMRAT	INTENERGY

ISIDEALGAS	MOLARMASS

PRANDTL	PRESSURE

P_CRIT	P_SAT

QUALITY	RELHUM

SOUNDSPEED	SPECHEAT

SURFACETENSION	TEMPERATURE

T_CRIT	T_SAT

T_TRIPLE	VISCOSITY

WETBULB 	VOLUME

V_CRIT	VOLEXPCOEF

The first argument of all built-in thermophysical property functions is the name of the substance.  This argument is a string which may be provided as a string constant (enclosing quote marks are optional) or a string variable.

Arguments are separated with the list separator character which is a comma for the U.S. numerical format and a semcolon for  the European numerical format.

It may appear that some substances, e.g., N2 and Nitrogen, CO2 and CarbonDioxide, H2O and Steam (or Water), are duplicated, but this is not true.  Whenever a chemical symbol notation (e.g., N2, CO2, CH4) is used, the substance is modeled as an ideal gas and the enthalpy and entropy values are based on JANAF table references.  The JANAF table reference for enthalpy is based on the elements having an enthalpy value of 0 at 298 K (537 R).  The entropy of these substances is based on the Third Law of Thermodynamics.  Whenever the substance name is spelled out (e.g., Steam (or Water), Nitrogen, R12, CarbonDioxide, Methane, etc.) the substance is modeled as a real fluid with subcooled, saturated, and superheated phases.  Exceptions to this rule occur for Air and AirH2O, both of which are modeled as ideal gases.  AirH2O is the notation for air-water vapor mixtures, i.e., psychometrics.  Additional information concerning the methods, reference states, and ranges of applicability for the thermophysical properties are provided in the manual.  EES also allows User-Supplied Property Data as described in Appendix D of the manual.

All arguments in thermophysical property functions, aside from the substance name, are identified by a single case-insensitive letter followed by an equal sign.  Arguments must be separated with commas and may be in any order, provided that the substance name is first.  The value or algebraic expression representing the value of the argument follows the equal sign.  The letters which are recognized in function arguments and their meaning are:

B= wet-bulb temperature (only for substance AIRH2O)

D=dew-point temperature (only for substance AIRH2O)

H=specific enthalpy

P=pressure

R=relative humidity (only for substance AIRH2O)

S=specific entropy

T=temperature

U=specific internal energy

V=specific volume (=1/density)

W=humidity ratio (only for substance AIRH2O)

X=quality

Many of the thermodynamic functions can take alternate sets of arguments.  For example, the ENTHALPY function for steam can be accessed with temperature and pressure as arguments;  alternatively, the same function could be accessed with entropy and quality as arguments.  In general, any valid set of arguments can be supplied for thermodynamic functions.  The transport functions (CONDUCTIVITY and VISCOSITY), however, require temperature as the argument (for ideal gas substances) or temperature and pressure (for real fluids).  An exception is provided for steam (also water, and Steam_NBS) in which temperature and specific volume can be provided as the arguments.

EES does not require the argument to a function to have a known value.  For example:

h1 = ENTHALPY(Steam,T=T1,P=P1)

will return the value of h1 corresponding to known temperature and pressure, T1 and P1.  If, however, the value of h1 is known, but T1 is unknown, the same equation will return the appropriate value of the temperature.  Alternatively, the temperature could be found by:

T1 = TEMPERATURE(Steam,h=h1,P=P1)

The latter method is preferable in that the iterative calculations implemented for steam are less likely to have convergence difficulty.


CONDUCTIVITY

Conductivity returns the thermal conductivity of the specified substance in W/m-K in SI units and in Btu/hr-ft-R in English units.

For ideal gas substances, the Conductivity function takes one parameter in addition to the fluid name and this parameter must be temperature.  For AirH2O (moist air), the temperature, pressure, and humidity ratio (or relative humidity) must be supplied as arguments.  For real fluids, the Conductivity function takes two parameters.  Any two independent properties can be supplied, provided that the state does not consist of two phases.

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


AcentricFactor

The acentric factor, ω, is a thermodynamic property of a fluid that is commonly used in property correlations.  It is defined by

ω = -1.0 - log10(Psat/Pcrit)

where

Psat is the vapor pressure of the fluid at a temperature equal to 0.7 * Tcrit

Pcrit is the critical pressure

Tcrit is the critical temperature [R or K]

The acentric factor for noble gases is 0.  Negative values are not possible.


CP

The CP function provides exactly the same results as the SPECHEAT function.  SPECHEAT and CP are used interchangedly in EES.

See also:  CV


CV

CV [kJ/kg-K, kJ/kmole-K, Btu/lbm-R, Btu/lbmole-R] returns the constant volume specific heat of the specified substance.  For pure substances which obey the ideal gas law, the CV function has temperature as its only other argument in addition to the substance name.  For pure real fluids, two independent arguments are required.  Note that, at saturation, pressure and temperature are not independent.  If the constant volume specific heat of saturated liquid or vapor is required, it is necessary to provide the quality or some other quality-dependent property.  The constant volume specific heat of a two-phase mixture with a quality other than 0 or 1 is infinite and a value cannot be returned for this state.

For AirH2O, three arguments are required for the CV function.  One of these arguments must be total pressure (P).  The remaining two can be any of the following: temperature (T), enthalpy (H), relative humidity (R), humidity ratio (W), wetbulb (B), or dewpoint (D).   X (for quality) is not allowed.  Note also that the specific heat returned for substance AirH2O (psychrometrics) is per unit mass of dry air.

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.

See also:  SPECHEAT and CP


DENSITY

DENSITY [kg/m3, kmole/m3, lbm/ft3, lbmole/ft3] returns the density (inverse specific volume) of a specified substance.  Two arguments are required for all pure substances; three are needed for moist air (AIRH2O).  Note also that for substance AirH2O (psychrometrics), the density returned by this function is the mass of dry air per volume of air and water vapor mixture.

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


DEWPOINT

DEWPOINT [°F, °C, R, K] returns the dewpoint temperature for air-water gas mixtures.  This function can be used only with AirH2O as the substance name.  Three arguments follow the substance name in any order:  temperature (T), total pressure (P), and relative humidity (R) or humidity ratio (W) or wetbulb temperature (B).

The letters in parentheses are the identifiers for each property.  A complete list of the identifiers and instructions are available in the Thermophysical Function help.


DIPOLE

DIPOLE(FluidName) returns the molecular dipole moment of the substance in units of Debye.  1 Debye =3.336E-30 coulomb-m. This function accepts only one argument and that is the name of the fluid.  The fluid name can be provided as a string constant or a string variable.

 Most of the molecular dipole data were obtained from:

Poling, B.E, Prausnitz, J.M., and O'Connell, J.P.,

The Properties of Gases and Liquids

Fifth Edtion, McGraw-Hill, 2001

Example: D=DIPOLE(R134a)


ENTHALPY

ENTHALPY [kJ/kg, kJ/kmole, Btu/lbm Btu/lbmole] returns the specific enthalpy of a specified substance.  The exact form of the enthalpy function depends on the substance and independent variable(s) selected.  Substances which obey the ideal gas law, such as air, require a single argument in addition to the substance name (temperature or internal energy) whereas real fluid substances, e.g., Steam and CarbonDioxide, will always require two independent variables.

For AirH2O, three arguments are required.  One of these arguments must be total pressure (P).  The remaining two can be any of the following: temperature (T), internal energy (U), relative humidity (R),  humidity ratio (W), wetbulb (B), or dewpoint (D).   Note also that for substance AirH2O (psychrometrics), the specific enthalpy returned by this function is the enthalpy of the air and water vapor mixture per unit mass of dry air.

The reference state upon which the value of enthalpy is based varies with the substance.  However, all ideal gas substances (which have a chemical symbol name, e.g., N2, CO2, CH4)  have enthalpy values corresponding to JANAF table references.  The JANAF table reference for enthalpy is based on the elements having an enthalpy value of 0 at 298 K (537 R).

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


ENTROPY

ENTROPY [kJ/kg-K, kJ/kmole-K, Btu/lbm-R, Btu/lbmole-R] returns the specific entropy of a specified substance.  For all pure substances, the entropy function always requires two arguments, in addition to the substance name.

For AirH2O, three arguments are required.  One of these arguments must be total pressure (P).  The remaining two can be any of the following: temperature (T),  enthalpy (H), internal energy (U), relative humidity (R),  humidity ratio (W), wetbulb (B), or dewpoint (D).  Note also that for substance AirH2O (psychrometrics), the specific entropy returned by this function is the entropy of the air and water vapor mixture per unit mass of dry air.

The reference state upon which the value of enthalpy is based varies with the substance.  However, all ideal gas substances (which have a chemical symbol name, e.g., N2, CO2, CH4)  have enthalpy values corresponding to JANAF table references.  The JANAF table reference for entropy is based on the Third Law of Thermodynamics which references the entropy of all pure crystalline substances to zero at absolute zero temperature.

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


FUGACITY

The FUGACITY function returns the fugacity of the specified pure fluid for the given conditions. Fugacity is defined by the following relation:

where

f  is fugacity (same units as pressure)

P is pressure

v is the specific volume of the fluid

T is the absolute temperature

R is the gas constant.

For an ideal gas fluid, f is identical to P.

The FUGACITY function will accept any appropriate set of inputs.  Fugacity is particularly useful for some types of phase equilibrium calculations.

Example:

    f=FUGACITY (R$,T=100,P=101.3)

Return to Thermophysical Functions


HUMRAT

HUMRAT [kg water/kg dry air or lbm water/lbm dry air] returns the humidity ratio for air-water gas mixtures.  This function is applicable only to the substance AirH2O.  The function requires three arguments which must include pressure and any two remaining independent variables such as temperature (T), relative humidity (R), enthalpy (H), dew point (D), or wetbulb temperature (B).

The letters in parentheses are the identifiers for each property.  A complete list of the identifiers and instructions are available in the Thermophysical Function help.


INTENERGY

INTENERGY [kJ/kg, kJ/kmole, Btu/lbm, Btu/lbmole] returns the specific internal energy of a specified substance.  The exact form of the INTENERGY function depends on the substance and independent variable(s) selected.  Substances which obey the ideal gas law, such as air, require a single argument (temperature or enthalpy) whereas real fluid pure substances, like steam, will always require two arguments in addition to the substance name.

For AirH2O, three arguments are required.  One of these arguments must be total pressure (P).  The remaining two can be any of the following: temperature (T), enthalpy (H), relative humidity (R), humidity ratio (W), wetbulb (B), or dewpoint (D).  Note also that for substance AirH2O (psychrometrics), the specific internal energy returned by this function is the internal energy of the air and water vapor mixture per unit mass of dry air.

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


MOLARMASS

The MolarMass function returns the molar mass (commonly called the molecular weight) of the specified substance, as in the following example.

MW=MolarMass(CarbonDioxide)

Note that this function is not applicable for substance AirH2O, since the molecular weight of the mixture of air and water vapor depends on the humidity ratio.


ISIDEALGAS

ISIDEALGAS is a very simple function that requires only one parameter and that is the name of the fluid.  The function returns either 1 (meaning true) or 0 (meaning false).  If the function returns true, the fluid is considered to behave according to the ideal gas law.  The convention used in EES is that fluid names that are chemical symbols, e.g., O2, N2, and CO2, are modelled with the ideal gas law whereas fluid names that are spelled out, e.g., Oxygen, Nitrogen, and CarbonDioxide, are modelled as real fluids with subcooled, saturated and vapor phases.  Air is an exception to this rule.

The need for the ISIDEALGAS function arises because the number of arguments may depend on whether or not the fluid is represented by the ideal gas law.  Enthalpy, for example, is determined by temperature alone for O2, but temperature and another property such as pressure are needed to determine the enthalpy of Oxygen.  If you are trying to write a general function to return a property of a fluid that is specified in a string variable, you may not know how many parameters it requires unless you know if the fluid is represented by the ideal gas law.  That is the purpose of this function.  Use an IF THEN ELSE statement testing on the value of ISIDEALGAS to branch to the correct form of the property function you wish to determine.

Examples:

B=IsIdealGas(O2)

C=IsIdealGas(R$)

Thermophysical Property Functions


PRESSURE

PRESSURE [kPa, bar, psia, atm] returns the pressure of a specified substance.  The argument list for the pressure function always requires the substance name followed by two arguments, each item separated by commas.  The pressure function is not implemented for AirH2O;  however, an unknown pressure can still be determined using any of the functions which are applicable to moist air and which take pressure as an argument.

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


PRANDTL

The PRANDTL function returns the dimensionless Prandtl number for the specified fluid defined as

Pr=mu * Cp / k

where

mu is the viscosity

Cp is the specific heat

k is the thermal conductivity

The Prandtl function requires temperature as an input for ideal gas substances and temperature and pressure for real substances.

Examples:

Pr_1=Prandtl(Air,T=100)

Pr_2=Prandtl(Steam,T=100,P=50)


VOLEXPCOEF

The VOLEXPCOEF function returns the volumetric coefficient of thermal expansion for the specified fluid and conditions.  This coefficient is defined by the following relation:

β = -(1/ρ) dρ/dT    (at constant P)

where

β is the volumetric coefficient of thermal expansion in units of 1/K (SI) or 1/R (English)

ρ is the density of the fluid

dρ/dT is the derivative of density with respect to temperature at fixed pressure

For an ideal gas fluid, b evaluates to 1/T where T is the temperature in K or R.

The VOLEXPCOEF function will accept any appropriate set of inputs.  In general, any combination of inputs that are sufficient to determine density will be accepted.

Example:

     beta=VOLEXPCOEF (R$,T=100,P=101.3)

Return to Thermophysical Functions


P_Crit

P_Crit is a function that returns the critical pressure of the specified  fluid.  The returned value depends on the unit setting made in the Unit System dialog.   The fluid may be a fluid name or a string variable.

Example: Pc=P_Crit(R134a)  "returns the critical pressure of R134a"


P_SAT

P_SAT [kPa, bar, psia, atm] returns the saturation vapor pressure of a specified pure substance at the specified temperature.  This function accepts only one argument, in addition to the fluid name, and that is the temperature.  The T= must precede the value, variable, or expression providing the temperature. The temperature must be provided in the units specified in the Unit Information dialog.   The fluid may be a fluid name or a string variable.

Example:  PS=P_sat(R134a, T=25 [C])

Note that the saturation vapor pressure can also be obtained using the Pressure function with a supplied quality value, as in the following example

PS2=Pressure(R134a,T=25 [C], x=0.5)

Any value of the quality between 0 and 1 will return the saturation vapor pressure, so PS2 and PS in the above examples will return the same value.

The vapor pressure of a blend, e.g., R410A, depends on both the temperature and quality and so it cannot be returned by the P_SAT function.  However, the Pressure function will return a value appropriate to the quality that is supplied.


QUALITY

QUALITY [dimensionless] returns the quality (vapor mass fraction) for substances modeled as real fluids such as Water and R12.  Two independent arguments are required.  Temperature and pressure are not independent for saturated states.  If the state of the substance is found to be subcooled, the quality is returned as -100.  If it is superheated, 100 is returned.

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


RELHUM

RELHUM [dimensionless] returns the relative humidity as a fractional number for air-water gas mixtures.  There are three arguments to this function, in addition to the substance name, AirH2O.  The three arguments are temperature total pressure and any two remaining independent variables such as temperature (T), wetbulb (B), enthalpy (H), dew point (D), or humidity ratio (W).

The letters in parentheses are the identifiers for each property.  A complete list of the identifiers and instructions are available in the Thermophysical Function help.


SPECHEAT

SPECHEAT [kJ/kg-K, kJ/kmole-K, Btu/lbm-R, Btu/lbmole-R] returns the constant pressure specific heat of the specified substance.  For pure substances which obey the ideal gas law, the specific heat function has temperature as its only other argument in addition to the substance name.  For pure real fluids, two independent arguments are required.  Note that, at saturation, pressure and temperature are not independent.  If the specific heat of saturated liquid or vapor is required, it is necessary to provide the quality or some other quality-dependent property.  The specific heat of a two-phase mixture with a quality other than 0 or 1 is infinite and a value cannot be returned for this state.

For AirH2O, three arguments are required for the SPECHEAT function.  One of these arguments must be total pressure (P).  The remaining two can be any of the following: temperature (T), enthalpy (H), relative humidity (R), humidity ratio (W), wetbulb (B), or dewpoint (D).   X (for quality) is not allowed.  Note also that the specific heat returned for substance AirH2O (psychrometrics) is per unit mass of dry air.

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


SOUNDSPEED

The SoundSpeed function returns the speed of sound c with units [m/s, ft/s] through the fluid.  The speed of sound is defined as:

For an ideal gas, the sound speed simplifies to:

Examples:

         C1 = SoundSpeed(Air, T=300)

         C2 = SoundSpeed(R134a,T=300,P=100)

Thermophysical Functions


SURFACETENSION

SURFACETENSION [N/m, lbf/ft] returns the surface tension at the liquid-vapor interface of a saturated fluid.   This function requires only one argument, in addition to the fluid name, and that is the temperature.

Example:  sigma=SURFACETENSION(Water, T=400)

Thermophysical Functions


TEMPERATURE

TEMPERATURE [°C, K, °F, R] returns the temperature of the substance.  The exact form of the function depends on the substance and argument(s) selected.  Substances which are assumed to obey the ideal gas law, such as air, may require one or two arguments whereas pure real fluid substances, like Steam, will always require two arguments.

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


T_Crit

T_Crit is a function that returns the critical temperature of the specified fluid.  The returned value depends on the unit setting made in the Unit System dialog.   The fluid may be a fluid name or a string variable.

Example: Tc=T_Crit(R134a)


T_SAT

T_SAT [°C, K, °F, R] returns the saturation temperature of a specified substance at the specified pressure.  This function accepts only one argument, in addition to the fluid name, and that is the vapor pressure. The P= must precede the value, variable, or expression providing the pressure.  The pressure must be provided in the units specified in the Unit Information dialog.   The fluid may be a fluid name or a string variable.

Example:  TS=T_sat(R134a, P=100 [kPa])

Note that the saturation temperature can also be obtained using the temperature function with a supplied quality value, as in the following example

TS2=TEMPERATURE(R134a, P=100 [kPa], x=0.5)

Any value of the quality between 0 and 1 will return the saturation temperature, so TS2 andTPS in the above examples will return the same value.

The saturation temperature of a blend, e.g., R410A, depends on both the pressure and quality and so it cannot be returned by the T_SAT function.  However, the Temperature function will return a value appropriate to the quality that is supplied.


T_Triple

T_Triple is a function that returns the triple point temperature of the specified fluid.  The returned value depends on the unit setting made in the Unit System dialog.   The fluid may be a fluid name or a string variable.

Example: Tt=T_Triple(R134a)


VOLUME

VOLUME [m3/kg, m3/kmole, ft3/lbm, ft3/lbmole] returns the specific volume (inverse density) of a specified substance.  Two arguments are required for all pure substances; three are needed for moist air (AIRH2O).

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


V_Crit

V_Crit is a function that returns the critical specific volume of the specified  fluid.  The returned value depends on the unit setting made in the Unit System dialog.   The fluid may be a fluid name or a string variable.

Example: vc=v_Crit(R134a)  "returns the critical volume of R134a"


WETBULB

WETBULB [°C, K, °F, R] returns the wetbulb temperature for air-water gas mixtures.  This function is applicable only to the substance AirH2O.  There are three arguments to this function, in addition to the substance name.  One of these arguments must be total pressure (P).  The remaining two can be any of the following: temperature (T) or enthalpy (H),  relative humidity (R) or humidity ratio (W) or dewpoint (D).

The letters in parentheses are the identifiers for each property.  A complete list of the identifiers and instructions are available in the Thermophysical Function help.


VISCOSITY

The Viscosity function returns the viscosity of the specified substance in kg/s-m (or N-s/m2) in SI units and in lbm/ft-hr in English units.

For ideal gas substances, the Viscosity function takes one parameter in addition to the fluid name and this parameter must be temperature.  For AirH2O (moist air), the temperature, pressure, and humidity ratio (or relative humidity) must be supplied as arguments.  For real fluids, the Viscosity function takes two parameters.  Any two independent properties can be supplied, provided that the state does not consist of two phases.

The list of property identifiers needed in the calling arguments and instructions are available in the Thermophysical Function help.


Library Files

EES internal function, procedures and modules / subprograms can be saved in a Library file.  A Library file has a .LIB filename extension.  When EES starts, it will automatically load all of the functions and procedures in the library files which are found in the EES USERLIB\ subdirectory unless directed otherwise by the Library Manager.  However, library files can be loaded from anywhere at any time using the Load Library command in the File Menu.  Library files can also be loaded automatically using the $INCLUDE directive.

Library files will not appear in the Equations window.  They are used just like EES built-in functions.  Information describing the use of the functions and/or procedures in the Library file can be obtained in an identical manner to built-in functions with the Function Info command in the Options menu.  When the user clicks the INFO button, information describing the use of the routine is displayed.

This optional help information is placed anywhere in the function or procedure file as a comment between braces { }.  The comment must begin with $ followed by the function or procedure name.  The text on following lines, up to the closing comment brace is assumed to be the help information. Only the first comment with help information will be used.  However, this help information can be as long as needed.  Alternatively a Help file can be provided for the library file.

Use the Save As command to save the Library file.  Be sure to use the Check/Format or Solve command before saving the file.  Remember, the library file will be automatically loaded by EES at startup if it is placed in the working directory.

Note that EES can also access external functions and external procedures written as a dynamic link library in a compiled language.


Help for Library Files

Any internal or external library file can be linked to a help file that provides detailed information when the user selects the Func Info button in the Function Information dialog.

The file must have the same name as the library file and it must have an .HLP, .HTM or .PDF filename extension.  The .HLP file can be either an ASCII text file or a Windows HLP file.  The .HTM file must be an HTML file readable by a browser program.  The .PDF file must be a portable document format file readable by Adobe Acrobat.

A single library file can hold many functions.  For example, a library file written in EES can have any number of internal functions and procedures.  It is possible to design a Windows .HLP file such that EES will jump the appropriate topic when the user clickss the Func Info button.  This is done by providing a file containing help context information.  The help context file has the same name as the library file but with a .CTX filename extension.  EES will look for the .CTX file when help is requested.  If a .CTX file is found, EES will open the file to find the context number for the topic that has the name of the function for which help is requested.  The Help file will be then opened directly to that topic.  If the topic is not found or if the .CTX file is not provided, the Help file will open to the first topic.  Each line in the .CTX file contains two items:  the context number (as it is used in the Help program) and a string which contains the function name.  Shown below is the context file for the external files in the LiBr.DLL.

1 LiBr_External_Routines

2 H_LIBR

3 T_LIBR

4 P_LIBR

5 V_LIBR

6 X_LIBR

7 Q_LIBR

8 VISC_LIBR

9 COND_VISC


Internal Functions

EES provides support for both internal and external functions.  Internal functions are entered directly in the Equations window using the EES equation processor.  EES functions are similar to those in Pascal.  The rules for these functions are as follows:

1.	The user functions must appear at the top of the Equations window, before any of the equations in the main body of the EES file appear.

2.	User functions begin with the keyword FUNCTION.  The function name and arguments, enclosed in parentheses and separated by commas, follow on the same line.  Array range notation (e.g., X[1..5]) may be used as a shorthand argument list format.

3.	The function is terminated by the keyword END.

4.	The equations appearing in EES functions and procedures are fundamentally different from those appearing in the main body of EES.  The equations in functions and procedures are more properly called assignment statements, similar to those used in FORTRAN and Pascal.  An assignment statement sets the variable identified on the left of the statement to the numerical value on the right.  X:=X+1 is a valid assignment statement.  The := sign (rather than the = sign) is used to signify assignment.  However, EES will accept an equal sign in assignment statements if the  Allow = in Functions/Procedures control in the Preferences dialog window in the Options menu is selected.

5.	EES normally processes the assignment statements in a function or procedure in the order they appear.  However, IF - THEN - ELSE, REPEAT-UNTIL, GOTO statements and other logic control statements may be used in functions and procedures.

6.	Functions are called simply by using their name in an equation.  The arguments must follow the name, enclosed in parentheses.  The function must be called with the same number of arguments appearing in the FUNCTION statement. Arguments are separated by a comma (U.S. numerical format) or a semicolon (European numerical format).  Array range notation may be used.

7.	Equations in user functions may call any of the built-in functions.  In addition, they may call any user function, procedure  or subprogram.  Recursive calls in which a function calls itself are, however, not allowed.  A function cannot call a module.

8.	All variables used in the function body are local to the function.  The function returns the value to which its name is assigned.

9.	Variable values can also be passed to the function using the $COMMON directive.

10.  Optional Help information can be provided by placing the help text anywhere in the function or procedure file as a comment between braces { }.  The comment must begin with $ followed by the function or procedure name.  The text on following lines, up to the closing comment braced is assumed to be the help information.  This help information will be displayed when the user selects the Info button in the Function Information  dialog.  An example of the help format is provided below.  Help can alternatively be provided in a separate text or Windows .hlp or .htm file that has the same filename as the function.

11.	Functions always operate in real mode regardless of the Complex Numbers setting.

Functions can be used to implement an analytical relationship between two or more variables.  For example, the specific availability of a flowing stream, psi, is

psi = (h - ho) - To * (s - so) + V2/2 + gz

where

h and s are the specific enthalpy and entropy of the state, respectively

ho and so are the specific enthalpy and entropy at the dead state condition, To and Po

V is the velocity

g is gravitational acceleration

z is the elevation of the state, relative to a selected zero point

Once the temperature and pressure of the dead state are selected, ho and so are constants.   A user function for the availability of steam, with To=530 R and Po=1 atm, could be implemented by placing the following statements at the top of the worksheet.  A reference to PSI(T1, P1, V1, Z1) from an equation in the worksheet would return the specific availability of steam in Btu/lb.

FUNCTION PSI(T, P, V, Z)

{$PSI

This function returns the specific availability of steam in Btu/lbm as a function of

            T [F], P [psia], V [ft/sec] and Z [ft]

            }

h := Enthalpy(Steam, T=T, P=P)

s := Entropy(Steam, T=T, P=P)

PSI := (h-38.05)- 530 * (s  0.0745) + V^2/(2 * 32.17 * 778) + Z/ 778

END

Functions can also be used to change the name of any built-in function and/or to shorten the argument list.  For example, the following function changes the name of HumRat , the built-in function for humidity ratio, to w, eliminates the need to specify the substance AirH2O as an argument, and sets the total pressure to 100 kPa in each case.

FUNCTION w(T,RH)

           {$w

This function return the humidity ratio of moist air as a function of temperature

            and relative humidity.  Atmospheric pressure is assumed.}

     w := HumRat(AirH2O, T=T, P=100, R=RH);

END

Note that when the help information is displayed, the first two lines will be strung together, but the line beginning with    w:= will appear on a new line because it starts with a space.

Functions can have any number of input arguments. An example of a function which finds the smallest of three arguments is shown below.  This function (which is more complicated than necessary) demonstrates the format of the IF - THEN - ELSE and GOTO statements which are allowed in Functions and Procedures.

  FUNCTION Smallest(X,Y,Z)

        if (X<Y) then S:=X else S:=Y

        if (S<Z) then goto 10

        S:=Z

 10: Smallest:=S;

  END


Internal Procedures

EES Procedures are very much like EES Functions, except that they allow multiple inputs and outputs.  The format of a Procedure is:

PROCEDURE TEST(A,B,C:X,Y)

            {$TEST

            Optional help text can be provided as a comment, as shown here}

  	...

  	...

  	X :=...

  	Y :=...

  	END

Procedures must be placed at the top of the Equations window, before any of the non-function and non-procedure equations. The procedure name, TEST, in the example above, can be any valid EES variable name.  The argument list consists of a list of inputs and a list of outputs separated by a colon.  In the example above, A, B, and C are inputs and X and Y are outputs.  Each procedure must have at least one input and one output.  Array range notation can be used for both inputs and outputs.  Each output variable must be defined by an equation with the output variable name on the left of the equal sign.  An END statement closes the procedure.  Optional help can be provided as a comment starting with a $, just as for Internal Functions.

To use the procedure, place a CALL statement anywhere within your equations.  The CALL statement appears as

...

CALL TEST(1,2,3:X,Y)

The numbers of inputs and outputs in the CALL statement argument list must exactly match the PROCEDURE declaration statement.  The arguments may be constants, variables, or algebraic expressions.  EES will evaluate the outputs using the input variables supplied in the argument list.  Functions and procedures may also call other procedures, provided that the procedure is defined previously.   Arguments are separated by a comma (U.S. numerical format) or a semicolon (European numerical format).

The equations within a procedure differ from ordinary EES equations which are not in functions or procedures.  First, all variables except for the inputs and outputs are local to the procedure.  Second, the equations are really assignment statements, rather than equalities, and to make this distinction clear, the assignment symbol (:=) is used in place of the equal sign.  You may override this convention by enabling the Allow = in Functions/Procedures control in the Preferences dialog window.  Third, IF - THEN - ELSE, REPEAT-UNTIL, GOTO statements and other logic control statements and other control logic statements may be used.   Note the EES also provides Modules which are quite similar to Procedures except that Modules use equalities and do not allow logical statements, just as in the main body of EES.

The local variables used within a Function or Procedure are normally not of interest.  However, you may wish to know their values.  The values of the local variables for the most recent function/procedure call will be displayed in the Solution Window if the "Display local function/procedure values" control in the Preferences dialog window is selected.  The local variables in a Function or Procedure are always real regardless of the Complex Numbers setting.

Procedures offer a number of advantages for the EES user.  Commonly used procedures may be saved separately and merged into the Equations window with the Merge command in the File menu or with the $INCLUDE directive.  For example, the equations describing a turbine can be entered once and saved.  Each time a turbine calculation is needed, the CALL Turbine statement can be used to determine the turbine work and outlet state variables.  Modules and Subprograms provide similar capability.  An advantage of Procedures is that logic statements such as IF-THEN-ELSE and REPEAT-UNTIL can bue used.

EES supports both internal and external procedures.  Internal procedures are entered directly at the top of the Equations window, as described in this section.  External procedures are written in a high-level language such as C, Pascal, or FORTRAN and called from EES.  The CALL statement for both types of procedures is identical.

Variable values can also be passed to an internal procedure using the $COMMON directive.

Help can be provided as a comment in the file (shown in the example above) or in a separate Help file.


Modules and Subprograms

Modules and Subprograms can be considered to be stand-alone EES programs that can be called from the main EES program.  The format of a Module / Subprogram is similar to that for an internal Procedure.  The Module / Subprogram is supplied with inputs and it calculates outputs.  Like a Procedure, the Module statement can (optionally) use a colon in the argument list to separate inputs from outputs.  The number of arguments provided to the left of the colon is the number of degrees of freedom in the Module / Subprogram, or stated another way, the number of values that must be supplied to have the number of equations equal to the number of unknown.  Examples of Module / Subprogram statements with a colon in the argument list are:

MODULE Testme(A, B : X, Y)             or          SUBPROGRAM Testme(A, B : X, Y)

In this case, EES understands that there are two inputs (A and B) and two outputs (X and Y).  However, the equations in EES Modules / Subprograms are equalities rather than assignment statements as used in Procedures.  In most cases, it does not matter what variables are specified as inputs as long as the appropriate number are specified.  As a consequence, the colon which separates inputs from outputs is unnecesary and it can be replaced with a comma (or semi-colon for the European numerical format).  In fact, this is the preferred way to use Modules and Subprograms.  The following Module / Subprogram statements are equivalent to the format shown above.

MODULE Testme(A, B, X, Y)            or          SUBPROGRAM Testme(A, B, X, Y)

Modules and Subprograms must be placed at the top of the Equations Window before the equations in the main body of EES or in a library file.  The order in which the Modules, Subprograms, Functions, and Procedures appear is not important, as EES will use double-pass compilation if necessary to compile all of the routines.

A Module / Subprogram is accessed with a CALL statement.  For example, the following statement would access the Testme Module or Subprogram.

CALL Testme(77,1.5, X,Y)

Note that if a colon is used to separate the inputs and output in the MODULE / SUBPROGRAM statement, it must also be used in the CALL statement.  Similarly if a colon is not used in the MODULE /SUBPROGRAM statement, it should not be used in the CALL statement.

At this point, you must be curious as to the difference between a Module and a Subprogram.  The difference is explained below.

When EES encounters a CALL statement to a SUBPROGRAM, it opens a new workspace and it then solves the equations in the SUBPROGRAM, using blocking and iteration as necessary.  The calculated variables appearing as parameters in the SUBPROGRAM statement are returned to the main program.

When EES encounters a CALL statement to a MODULE, it transparently grafts the equations in the module into the equations in the main program.  The steps necessary for this process are as follows.  First, every variable in the module, including each input and output in the MODULE statement, is renamed with a unique qualifier that EES can recognize.  Then EES adds one equation for each input and output which sets the value of the parameter in the calling program to the value of the value in the module.  Note that the guess values and limits for the EES variables appearing in the CALL statement in the main program override the specified guess values and limits for the variables in the argument list of the MODULE statement.  Finally, all of the equations in the module, with their renamed variables, are merged into the EES program at the point at which it is called.  If the Module is called a second time, the process is repeated, but with a different qualifier for the variable names in the Module.  The net effect is that a copy of all of the equations in the Module are merged into the main EES program each time a CALL statement is encountered.  EES currently allows up to 6000 equations (10,000 in the Professional version)  so rather large problems can be developed.  EES then uses its efficient blocking techniques to reorganize the equations for optimal solution.  As a result of this reorganization, the equations in the Module may not necessarily be called in sequence.  In fact, this is rarely the case.  You can view the equations in the order that EES has rearranged them in the Residuals window.  Equations from a Module are identified with the Module name followed by a backslash and then the call index number.  For example, the following equation in the Residuals window

Turbine\2:  h2=h1+Q/m

would indicate that the equation h2=h1+Q/m originated from the second call to the Turbine module.

The Module / Subprogram is terminated with an END statement.  A CALL statement is used to call the Module / Subprogram, just as for a Procedure.  The important difference between a Procedure and a Module / Subprogram is that the Module / Subprogram is composed of equality statements whereas the Procedure is composed of assignment statements.  Consequently, a Module / Subprogram cannot support logic constructs such as IF THEN ELSE, but it can provide iterative solutions to implicit equations, when needed, and order independent equation input, just as in the main part of EES.   The following example uses a Module to solve an implicit set of two equations and two unknowns.

MODULE TestMe(A, B, X, Y)

X^2+Y^3=A

SQRT(X/(Y^2+1))=B

END

CALL TestMe(77,1.234,X1,Y1)

CALL TestMe(88,2.345,X2,Y2)

The local values of variables in Modules / Subprograms are normally not displayed in the Solution window.  However, you can view these local solutions for Modules / Subprograms that appear in the Equations window by selecting the 'Show function/procedure/module variables' control in the Options tab of the Preferenced dialog.

So should you use a  Module or a Subprogram?  Limited tests thus far indicate that a Module tends to solve a problem more efficiently than a Subprogram, although you may wish to test  both forms to determine which is better for your application.  A major advantage of a Subprogram is that it can be called from a Function or Procedure.    Conditional statements, such as the IF THEN ELSE, GOTO, and REPEAT - UNTIL are only supported in Functions and Procedures.  If your application requires integration with conditional statements, you will necessarily have to use a Subprogram.  Shown below is a short program which calls a Function that uses an IF THEN ELSE statement to call one of two Subprograms.

FUNCTION Myfunc(a,b)

   if (a<77) then

       call Mysub2(a,b:x)

   else

      call Mysub1(a,b:x,y)

  endif

      myfunc:=x

end

SUBPROGRAM Mysub1(a,b:x,y)

    x^2+y^3=Sumab(a,b)

    sqrt(x/(y^2+1))=b

end

SUBPROGRAM Mysub2(a,b:x)

      x=a+b

end

FUNCTION Sumab(a,b)

   sumab:=a+b

end

x=Myfunc(3,2)

Variables values are normally passed to a Module / Subprogram  through the argument list.  The $COMMON directive may be used to pass variables that are defined in the main program to a Module / Subprogram.  Variable information, including guess values and lower/upper limits for Module / Subprogram variables is accessible with the Variable Info command.  The local variables in a Module / Subprogram are always real regardless of the Complex Numbers setting.

Modules / Subprograms may be stored as library files, just like Internal Functions and Procedures.  The library files can be automatically loaded if they are placed in the USERLIB subdirectory.  Alternatively, a $INCLUDE directive can be used to transparently load a library file.  Help can be included within the Module / Subprogram (using the same syntax as used in internal Procedures) or it can be supplied with a separate help file having the same filename as the library file with a .HLP or .HTM filename extension.

Modules and Subprograms can significantly increase the capabilities of your EES program.


REPEAT - UNTIL

REPEAT - UNTIL statements provide logical operations in the same manner as in  IF - THEN - ELSE statements, but they are often somewhat more  convenient, especially for looping operations.  The REPEAT - UNTIL statements are written in the same manner as in Pascal.  Here is a small function which uses the REPEAT - UNTIL statements.

     FUNCTION SUMINV(X)

         SUMX:=0;  i:=0

         REPEAT

             i:=i+1

             SUMX:= SUMX+1/X^i

        UNTIL (i>10)

        SUMINV:=SUMX

     END

Note that IF - THEN - ELSE statements can only be used in internal functions or procedures.

Note that Duplicate loops should generally not be used in internal functions or procedures.  The Duplicate statement literally duplicates the equation, substituting the duplicate index as appropriate.  This construction is done during the compiling stage so it is then not possible to pass the lower or upper bound of the Duplicate loop as a parameter.  The following construction will not work properly:

function ThisDoesNotWork(N, X[1..N])

                 Sum=0

                 Duplicate i=1,N

                    Sum=Sum+X[i]

                 end

                 ThisDoesNotWork=Sum

           end

A Repeat - Until should be used instead as in the following example:

function SumIt(N, X[1..N])

                Sum=0

                i=0

                repeat

                   i=i+1

                   Sum=Sum+X[i]

                until (i>=N)

                SumIt=Sum

            end


Logical Operators

The logical (or comparison) operators that can appear in an IF - THEN  - ELSE or REPEAT - UNTIL statements are:

  <    	(less than)

  >    	(greater than)

  =    	(equal)

  <=  	(less than or equal)

  >=  	(greater than or equal)

  <>	(not equal)

  and 	(logical and)

  or    	(logical or)

An example of an IF - THEN -ELSE statement using these operators is:

  if (X<Y) and (Y>2) THEN A:=3 else A:=X*Y

The use of parentheses surrounding the logical test is required.

EES will process the logical operations from left to right.  When using more than a single AND or OR, it may be necessary to use parentheses to achieve the desired result.

Note that IF - THEN - ELSE statements can only be used in Internal functions or

procedures.


GOTO Statement and Statement Labels

EES will normally process the assignment statements in a function or procedure in the order they appear starting with the first statement.  However, the flow control can be altered using GoTo statements.  The format of a GoTo statement is simply

GoTo #

where # is a statement label number which must be an integer number between 1 and 30000.  Statement labels precede an assignment statement separated with a colon (:).  The GoTo statement must be used with If Then Else or Repeat-Until statements to be useful.  The following function illustrates the use of GoTo and If Then Else statements in the calculation of the factorial of a value supplied as the argument.

Function FACTORIAL(N)

       F:=1

       i:=1

10: i:=i+1

       F:=F*i

       If (i<N) Then GoTo 10

       FACTORIAL:=F

End

Y= FACTORIAL(5)   { Y will be set to 120 when this statement executes}

Use of GOTO statements makes code more difficult to follow.  It is best to limit their use.


External Procedures

An EES Procedure is a block of code written by the user which returns one or more outputs for a given set of inputs.  Internal procedures are written directly within EES.  A remarkable feature of EES is that the user can also add (and later remove) external procedures written in C, Pascal, and FORTRAN.  The external functions and procedures are used in exactly the same manner as internal functions and internal procedures.

External procedures are written as dynamic link libraries (DLLs) under the Windows operating system.  There are two formats for external procedures which exchange information with the external routines in different ways.  The .FDL format passes inputs and outputs in arrays containing 8 byte real numbers (doubles).  The .DLP format passes inputs and outputs as linked list.  EES identifies the format by the filename extension which must be .FDL or .DLP.  External procedures written in FORTRAN must have a .FDL filename extension since linked lists are not possible.  C, C++ and Pascal procedures can use either format.

When EES is started, it examines the files in the USERLIB\ subdirectory.  Any files having a .DLP or .FDL filename extension are assumed to be external procedures and they are automatically loaded unless directed otherwise by the Library Manager.  The procedure name used in the EES equations is the filename (without the extension).  An external procedure can also be manually loaded using the Load Library command in the File menu or by use of the $INCLUDE directive.  It is possible to load multiple EES procedures and functions in one .DLL file as explained in the Multiple External Routines section.

.DLP Format

A skeleton listing of a compiled procedure in .DLP format is shown below.  This listing is written in Delphi 5.0 but the same calling sequence is used in C++.  Example code for DELPHI and C++ are provided below.

library XTRNPROC;

{$N+}

type

    CharString = array[0..255] of char;

 	 ParamRecPtr = ^ParamRec;

 ParamRec = record  { defines structure of the linked list of inputs }

  	Value: double;

  	 next: ParamRecPtr;

 	 end;

procedure ProcName (var S:charstring; Mode:integer; Inputs, Outputs:ParamRecPtr): export; stdCall;

  begin

      ....

   {Set values of Outputs in linked list here;  Outputs must be extended precision }

      ....

end;

exports ProcName;

begin

end.

The major concern is the procedure header.  To be recognized by EES, the procedure name, called PROCName in the above example, must be the same as the filename.  The procedure statement has four arguments.

S is a 255 character C string.  The actual string length may be less than 255 characters.  It is terminated with a chr(0), following the normal C string conventions.  S can be used both to send text information from EES and to return text information from the external procedure.  The text information sent from EES to the function appears within single quotes as the first argument in the procedure call statement, as in the following example.

   Call ProcName('optional text', Input1, Input2 : Output1, Output2, Output3)

The text information is optional.  If it appears in the Call statement, as above, then S will be set to this text without the quotes.  Otherwise, S will be set to a null string.  The input and output variables of external procedures are always doubles regardless of the Complex Numbers setting.  Note that Array Range Notation (e.g., X[1..5] can be used as shorthand in the Call statement.

S is returned from the external procedure as the null string under normal circumstances.  If an error is encountered in the external function, S should be set to an appropriate error message.  EES will then terminate calculations and display this error message.

Mode is an integer set by EES.  If Mode=-1, then EES is requesting that the procedure return in S an example of the EES call format.  If Mode=>0, then the procedure should calculate and return the output values.

Inputs is a pointer to the head of a linked list of input values supplied by EES.  Each input consists of a value (double precision) and a pointer to the next input, as indicated by the ParamRec structure.  The procedure may have one or more inputs.  The next field of the last input will be a null pointer (nil).  The procedure should count the inputs to be sure that the number supplied is as expected and issue an error message in S if this is not the case.

Outputs is a pointer to the head of a linked list of output values calculated by the external procedures using the supplied input values.  Each output consists of a value double precision) and a pointer to the next output, as indicated by the ParamRec structure.  The procedure may have one or more outputs.  The next field of the last outputs will be a null pointer (nil).

Click here to view an example of an EES .DLP external procedure written in Delphi 5

Click here to view an example of an EES .DLP external procedure written in C++

.FDL Format

The .FDL format differs from the .DLP format in that it uses arrays to transfer the inputs and outputs between EES and the external routine, rather than linked lists.  An .FDL external routine can be written in any compiled language, including FORTRAN, C++, and DELPHI.  The format for all languages is illustrated by the following FORTRAN subroutine fragments.

32-bit .FDL library using the Digital Visual FORTRAN 5.0 compiler

 SUBROUTINE MYPROC(S,MODE,NINPUTS,INPUTS,NOUTPUTS,OUTPUTS)

!DEC$ATTRIBUTES ALIAS:'MYPROC' :: MYPROC

!DEC$ATTRIBUTES DLLEXPORT :: MYPROC

INTEGER(4) MODE, NINPUTS, NOUTPUTS

REAL(8) INPUTS(50), OUTPUTS(50)

CHARACTER(255) S

…

OUTPUTS(1)=…

…

RETURN

END

S is a 255 character string (CHARACTER(255) in FORTRAN) which can be used both to send text information to the procedure and to return text information from the procedure.  The text information sent from EES must appear within single quotes as the first argument in the procedure Call statement, as in the following example.

   Call MYSUB('optional text', Input1, Input2 : Output1, Output2, Output3)

The text information is optional.  If it appears in the Call statement, as above, then S will be set to this text (without the quotes).  Otherwise, S will be set to the null string.

The external procedure is expected to provide an example of  the calling sequence of the procedure in string S when MODE=-1.  S is also used to return an error message if necessary in which case the external procedure must set MODE to a value greater than 0.  In normal operation, MODE=0 and S need not be defined.

NIN and NOUT are the number of inputs and outputs provided by EES.  The routine should check to see if these agree with the expected number of inputs and outputs.  INPUTS is an array of REAL*8. (REAL*8 is a double in C++ and Delphi.)  Calculated results are placed in the OUTPUTS REAL*8 array.  There above example shows the INPUTS and OUTPUTS array to be dimensioned for 50 elements, but this limit is flexible.  The current implementation in EES can pass up to 100 variables to an external procedure.

Click here to view a .FDL external procedure in FORTRAN

Click here to view a .FDL external procedure in C++

HELP for External Routines

Information concerning external procedures can be obtained in an identical manner to built-in functions with the Function Info command in the Options menu.  The Function Info dialog has a Function Info button which, when used, provides help explaining the use of the selected function.  When the user clicks the Function Info button, EES will look for a file with the name of the compiled routine and either a .HLP or .HTM filename extension.  The .HLP file can either be an ASCII text file or a Windows .HLP file. The .HTM file should contain HTML code readable by a browser.  This help file will be displayed if the file is found in the directory in which the external library file resides;  otherwise a message will appear which states that help is not available for this item.

If an ASCII file is provided, it should be formatted so that each paragraph ends with a carriage return.  Long lines which do not fit within the Help window will be broken and word-wrapped as needed.  Blank lines and spaces can be used to make the text more clear.

Note that the Windows .HLP files (such as the you are now reading) and .HTM files allow figures and formatting options  and so it is a better way of providing help than an ASCII file.  The Window .HLP and .HTM files can be composed using any of the commercial Help generating programs.

See Chapter 6 of the EES manual for additional information.


Example .DLP External Procedure in DELPHI

MDAS is an acronym for 'multiply-divide-add-substract'.  MDAS takes two input values and returns four outputs which are the product, the ratio, the sum, and the difference of the two numbers.  Although the MDAS procedure itself is no use, it is shown here to  illustrate how to write external procedures for EES in DELPHI.  The source code follows.

______________________________________________________

library MDASP;

const Example = -1;

type

  CharString = array[0..255] of char;

  ParamRecPtr=^ParamRec;

  ParamRec=record

    Value:double;

    next:ParamRecPtr;

  end;

 function CountValues (P: ParamRecPtr): integer;

  var

   N: integer;

  begin

   N := 0;

   while (P <> nil) do begin

     N := N + 1;

     P := P^.next

    end;

   CountValues := N;

  end; {CountValues}

procedure MDAS(var CString:CharString; Mode:integer;

      Inputs,Outputs:ParamRecPtr); export; stdcall;

 procedure MyDearAuntSally;

  var

   P1, P2: extended;

   P: ParamRecPtr;

  begin

   P := Inputs;

   P1 := P^.Value;

   P := P^.next;

   P2 := P^.value;

   P := Outputs;

   P^.Value := P1 * P2;

   P := P^.next;

   P^.Value := P1 / P2;

   P := P^.next;

   P^.Value := P1 + P2;

   P := P^.next;

   P^.Value := P1 - P2;

  end; {doCall}

 begin {MDAS}

  if (Mode = -1) then

   CString := 'CALL MDAS(In1,In2:Out1,Out2,Out3,Out4)'

  else begin

    if (CountValues(Inputs) <> 2) then begin

      CString := 'Wrong number of inputs for MDAS.';

      exit;

    end;

    if (CountValues(Outputs) <> 4) then begin

      CString := 'Wrong number of outputs for MDAS.';

      exit;

    end;

    MyDearAuntSally;

    CString:='';

   end;

 end; {MDAS}

 exports

   MDAS;

begin

  {no initiation code needed}

end.

 __________________________________________________________________

This file was compiled using DELPHI 5.0.  After building the file, it is necessary to rename it to MDAS.DLP.

Note:  Using Delphi 3, 4 or 5, it is necessary to set the compiler options so that Aligned Record Fields and Huge Strings are disabled.  These settings are made in the Project Options dialog Compiler tab.


Example .DLP External Procedure in C++

MDAS is an acronym for 'multiply-divide-add-substract'.  MDAS takes two input values and returns four outputs which are the product, the ratio, the sum, and the difference of the two numbers.  Although the MDAS procedure itself is no use, it is shown here to  illustrate how to write external procedures for EES in C++.  The source code follows.

______________________________________________________

#include <windows.h>

#include <stdlib.h>

#include <string.h>

BOOL APIENTRY DllMain( HANDLE hModule,

                       DWORD  ul_reason_for_call,

                       LPVOID lpReserved

 )

{

    return TRUE;

}

// Structure for handling ees calling syntax

struct EesParamRec {

  double value;

  struct EesParamRec *next;

};

// Tell C++ to use the "C" style calling conventions rather than the C++ mangled names

extern "C"

__declspec (dllexport) void MDAS_C(char s[256], int mode, struct EesParamRec *input_rec, struct EesParamRec *output_rec) {

   double v, v1, v2;

   int NOutputs;

   EesParamRec *outputs, *inputs;

   if (mode==-1) {

     strcpy(s,"CALL MDAS_C(X,Y : M, D, A, S)");

     return;

   }

   if (input_rec->next==NULL) {

     strcpy(s,"MDAS_C expects two inputs");

     mode=1;

     return ;

   };

   outputs=output_rec;

   NOutputs=0;

   while (outputs!=NULL) {

       NOutputs++;

   outputs=outputs->next;

   }

   if (NOutputs!=4) {

     strcpy(s,"MDAS_C requires 4 outputs which are the product, difference, sum and difference of the two inputs.");

     mode=2;

     return ;

   }

   strcpy(s,"");

   inputs=input_rec;

   v1=inputs->value;

   inputs=inputs->next;

   v2=inputs->value;

   v=v1*v2;

   outputs=output_rec;

   outputs->value=v;

   outputs=outputs->next;

   if (v2==0) {

     strcpy(s,"attempt to divide by zero in MDAS_C");

 mode=3;

 return;

   }

   v=v1/v2;

   outputs->value=v;

   outputs=outputs->next;

   outputs->value=v1+v2;

   outputs=outputs->next;

   outputs->value=v1-v2;

   mode=0;

};

______________________________________________

This procedure was compiled into file MDAS_C.DLP using the Microsoft Vistual Studio 6.0 C++ compiler.


Example .FDL External Procedure in FORTRAN

Creating an external procedure with Digital Visual FORTRAN 5.0 is most easily done within the Microsoft Developer Studio environment or other similar products.  A new project workspace is selected as a Dynamic Link Library.  The FORTRAN sources file(s) are inserted into the workspace and compiled with the standard options.  Note that the two !DEC$ATTRIBUTES directives should be included in the main program, as noted above. The output filename in the Link settings should be set to MYPROC.FDL where MYPROC is the name that will be used in the EES Call statement.  Alternatively, the default filename MYPROC.DLL should be changed to MYPROC.FDL after building the dynamic link library project.

The simple FORTRAN program listed below provides the product, dividend, sum, and difference of two input values.  This program should provide a model for writing 32-bit external EES procedures in FORTRAN.

Listing of the FORTRAN MDASF Program

       SUBROUTINE MDASF(S,MODE,NINPUTS,INPUTS,NOUTPUTS,OUTPUTS)

C.  The following two lines are specific to Digital Visual Fortran 5.0

         !DEC$ATTRIBUTES ALIAS:'MDASF' :: MDASF

         !DEC$ATTRIBUTES DLLEXPORT :: MDASF

       INTEGER(4) MODE, NINPUTS, NOUTPUTS

       REAL(8) INPUTS(50), OUTPUTS(50)

       CHARACTER(255) S

C.

       IF (MODE.EQ.-1) GOTO 900

       IF (NINPUTS.NE.2) GOTO 100

       IF (NOUTPUTS.NE.4) GOTO 200

C.  DO CALCULATIONS

       X=INPUTS(1)

       Y=INPUTS(2)

       IF (ABS(Y).LE.1E-9) GOTO 300

       OUTPUTS(1)=X*Y

       OUTPUTS(2)=X/Y

       OUTPUTS(3)=X+Y

       OUTPUTS(4)=X-Y

       MODE=0

       S=''C

       RETURN

100    CONTINUE

C.  ERROR:  THE NUMBER OF INPUTS ISN'T WHAT THIS SUBROUTINE EXPECTS

C.  NOTE: SET MODE>0 IF AN ERROR IS DETECTED.  IF S IS EQUAL TO A

C.  NULL STRING, THEN EES WILL DISPLAY THE MODE NUMBER IN AN ERROR

C.  MESSAGE.  IF S IS DEFINED, EES WILL DISPLAY THE STRING IN THE

C.  ERROR MESSAGE.  THE C AT THE END OF THE STRING INDICATES C-STYLE

C.  S='MDASF REQUIRES 2 INPUTS'C

       MODE=1

       RETURN

200    CONTINUE

       S='MDASF EXPECTS TO PROVIDE 4 OUTPUTS'C

       MODE=2

       RETURN

300    CONTINUE

       S='DIVISION BY ZERO IN MDASF'C

       MODE=3

       RETURN

900    CONTINUE

C.  PROVIDE AN EXAMPLE OF THE CALLING FORMAT WHEN MODE=-1

       S='CALL MDASF(X,Y:A,B,C,D)'C

       RETURN

       END

The following statement in an EES program will call this file.

CALL MDASF(X,Y : M, D, A, S)


Example .FDL External Procedure in C++

MDAS is an acronym for 'multiply-divide-add-substract'.  MDAS takes two input values and returns four outputs which are the product, the ratio, the sum, and the difference of the two numbers.  Although the MDAS procedure itself is no use, it is shown here to  illustrate how to write external procedures for EES in C++.  The source code follows.

______________________________________________________

#include <windows.h>

#include <stdlib.h>

#include <string.h>

// Use extern "C" to prevent C++ name mangling

extern "C"

void FAR  _stdcall _export MDAS_C(char s[256], int& clen, int& mode,

   int& NInputs, double inputs[25], int& NOutputs, double outputs[25])

{

   if (mode==-1) {

     strcpy(s,"CALL MDAS_C(X,Y : M, D, A, S)");

     return;

   }

   if (NInputs!=2) {

     strcpy(s,"MDAS_C expects two inputs");

     mode=1;

     return;

   };

   if (NOutputs!=4) {

     strcpy(s,"MDAS_C requires 4 outputs which are the product, difference, sum and difference of the two inputs.");

     mode=2;

     return;

   }

   strcpy(s,"");

outputs[0]=inputs[0]*inputs[1];

   outputs[1]=inputs[0]/inputs[1];

   outputs[2]=inputs[0]+inputs[1];

   outputs[3]=inputs[0]-inputs[1];

   mode=0;

}

___________________________________________________________

This procedure was compiled into file MDAS_C.FDL using the Microsoft Vistual Studio 6.0 C++ compiler.


External Functions

A remarkable feature of EES is that the user can add (and later remove) functions and procedures written in any compiled language.  These external routines may have any number of arguments.  Functions return a single value whereas procedures may return multiple values.  The external functions and procedures are used in exactly the same manner as internal functions and internal procedures.

External functions are written as dynamic link libraries (DLL's) under the Windows operating system.  External functions are identified with a .DLF filename extension.  When EES is started, it examines the files in the USERLIB\ subdirectory.  Any files having a .DLF filename extension are assumed to be external functions and are loaded unless directed otherwise by the Library Manager.  The function name used in the EES equations is the filename (without the extension).  External functions can also be loaded using the $INCLUDE directive or the Load Library command.

External functions can be written in any compiled language that supports linked lists.  The function statement header, however, must have a specific format.  A skeleton listing of an external function in Borland's Delphi 5.0 is as follows:

library XTRNFUNC;

{$N+}

type

      charString = array[0..255] of char

 	ParamRecPtr = ^ParamRec;

 ParamRec = record

  	Value: double

  	 next: ParamRecPtr;

 	 end;

function FuncName (var S: charString;  Mode: integer;  Inputs: ParamRecPtr): double; export; stdCall;

    begin

...

...

FuncName:=Value;

end;

exports FuncName;

begin

end.

The major concern is the function header.  To be recognized by EES, the function name, called FuncName in the above example, must be the same as the filename.  The function statement has three arguments.

S is a 255 character C string.  The actual string length may be less than 255 characters.  It is terminated with a chr(0), following the normal C string conventions.  S can be used both to send text information from EES and to return text information from the external procedure.  The text information sent from EES to the function appears within single quotes as the first argument in the procedure call statement, as in the following example.

   g = FuncName('optional text', Arg1, Arg2)

The text information is optional.  If it appears in the function call, as above, then S will be set to this text without the quotes.  Otherwise, S will be set to the null string.  Note that Array Range Notation (e.g., X[1..5] can be used as shorthand in the Call statement.  The input variables and returned result for an external function are always real regardless of the setting for  Complex Numbers.

Under normal operation, S is returned from the function as the null string.  If an error is encountered in the external function, S should be set to an appropriate error message.  EES will then terminate calculations and display this error message.

Mode is an integer set by EES.  If Mode=-1, then EES is requesting that the function return in S an example of the function call.  If Mode=>0, then the function should simply return the function value.

Inputs is a pointer to the head of a linked list of input values supplied by EES.  Each input consists of a value (extended precision) and a pointer to the next input, as indicated by the ParamRec structure.  The function may have one or more inputs.  The next field of the last input will be a null pointer (nil).  The function should count the inputs to be sure that the number supplied is as expected and issue an error message in S if this is not the case.

An example external function written in DELPHI 5 called PWF is supplied with EES.  The PWF source code is in this help file.  The compiled function is in the PWF.DLF file.  Also available is a simple example of an external function written in C++.

Information concerning external functions can be obtained in an identical manner to built-in functions with the Function Info command in the Options menu.  When the user clicks the Function Info button, EES will look for a file with the name of the external function and either a .HLP or .HTM filename extension.  The .HLP file should contain ASCII text or a Windows .HLP file  explaining the operation of the function.  The .HTM file should be HTML code readable by a browser.  This text will be displayed if the file is found in the ame folder as the external function.


Example .DLF External Function in C++

The following source code creates a .DLF external function that returns the sum of two numbers.  The function is accessed from EES with a statement of the following format;

s=SUM_C(x,y)

_________________________________________________________

#include <windows.h>

// Structure for handling ees calling syntax

struct EesParamRec {

  double value;

  struct EesParamRec *next;

};

// Tell C++ to use the "C" style calling conventions rather than the C++ mangled names

  extern "C"  {

__declspec (dllexport) double SUM_C(char s[256], int mode, struct EesParamRec *input_rec)

 {

double In1, In2, sum_res;

int NInputs;

if (mode==-1) {

strcpy(s,"a = SUM_C(b,c)"); // return example call string

return 0;

}

// Check the number of inputs

    NInputs=0;

    EesParamRec * aninput_rec=input_rec;

while (aninput_rec!= 0)

{

aninput_rec= aninput_rec->next;

NInputs++;

};

if (NInputs!=2) {

strcpy(s,"SUM_C expects two inputs");

return 0;

}

In1= input_rec->value;

input_rec=input_rec->next;

In2=input_rec->value;

sum_res = In1+In2;

return sum_res;

}

};

This procedure was compiled into file SUM_C.DLF using the Microsoft Vistual Studio 6.0 C++ compiler.


Example .DLF External Function in DELPHI (PWF)

The following listing shows the source code for the PWF.DLF external function.

library PWFP;

const doExample = -1;

type

  CharString = array[0..255] of char;

  ParamRecPtr=^ParamRec;

  ParamRec=record

    Value:double;

    next:ParamRecPtr;

  end;

 function CountValues (P: ParamRecPtr): integer;

  var

   N: integer;

  begin

   N := 0;

   while (P <> nil) do begin

     N := N + 1;

     P := P^.next

    end;

   CountValues := N;

  end; {CountValues}

function PWF(var S:CharString; Mode:integer;

          Inputs:ParamRecPtr):double; export; stdcall;

  var

    P: ParamRecPtr;

    V: double;

 function CountValues (P: ParamRecPtr): integer;

  var

   N: integer;

  begin

    N := 0;

    while (P <> nil) do begin

      N := N + 1;

      P := P^.next

     end;

    CountValues := N;

  end; {CountValues}

 function PWFCalc: double;

  var

    NArgs: integer;

    interest, discount, periods: double;

  begin

    PWFCalc:=0; {in case of error exit}

    S := '';

    P := Inputs;

    Periods := P^.value;

    if (Periods < 0) then begin

      S := 'The number of periods for the PWF function must be >0.';

      exit;

    end;

    P := P^.next;

    interest := P^.value;

    if (interest >= 1) or (interest < 0) then begin

      S := 'The interest rate is a fraction and must be between 0 and 1.';

      exit;

    end;

    P := P^.next;

    discount := P^.value;

    if (discount >= 1) or (discount < 0) then begin

      S := 'The discount rate is a fraction and must be between 0 and 1.';

      exit;

    end;

    if (interest <> discount) then

      PWFCalc := 1 / (discount - interest) * (1 - exp(Periods * ln((1 + interest) / (1 + discount))))

    else

      PWFCalc := Periods / (1 + interest);

  end; {PWF}

 begin

   PWF:=1;

   if (Mode = doExample) then begin

     S := 'PWF(Periods,Interest,Discount)';

     exit;

   end;

   if (CountValues(Inputs)<>3) then

     S := 'Wrong number of arguments for PWF function.'

   else begin

     PWF:=PWFCalc;

   end;

 end; {PWF}

 exports

   PWF;

begin

  {no initiation code needed}

end.

This file was compiled using DELPHI 5.0.  After building the file, it is necessary to rename it to PWF.DLF.


Multiple External Routines in a Single DLL

EES recognizes three different types of externally compiled files.  The three types are:

DLF - dynamically-linked function

DLP - dynamically-linked procedure

FDL - dynamically-linked procedure with calling sequence accessible from any language

Originally, only one external routine could reside in a file.  The filename extension (.DLF, .DLP, or .FDL) identified the type of externally compiled file and the name of the external routine had to be the same name as filename (without the extension).

However, it is also possible to place one or more external routines in a single file and this single file can contain all three types of external routines. The external file can have any name but it must have a .DLL filename extension.  If this file is placed in the USERLIB subdirectory, EES will automatically load all the external routines in the file at startup unless directed otherwise by the Library Manager.

Help can be provided for each routine in a separate Windows .HLP or a .HTM file.

EES must know the names of the external routines in the .DLL file and their type (DLF, DLP, or FDL) because the calling arguments differ for each type.  The mechanism for telling EES the names and types of the external routines is to provide three short routines in the DLL file with names DLFNames, DLPNames, and FDLNames that do nothing but return the calling names of each routine type in the DLL file.  DLFName, DLPNames, and FDLNames must be exported in the DLL.  They have one argument which is a character string.  The character string is filled with the names of the routines of each type that are contained in the DLL file.  A comma separates each file name. A zero length string is used to indicate that there are no files of that type.  Short code fragments in DELPHI 5 and C++ follow.

DELPHI 5 Code

Visual C++ Code


DLL File Skeleton in DELPHI

library MYEXTRNLS

{This DLL file contains two DLF functions and one DLP procedure}

uses

  SysUtils;

const  doExample = -1;

{***********************************************************************}

type

  CharString = array[0..5] of char;

  ParamRecPtr = ^ParamRec;

  ParamRec = record

               Value : double;

               Next  : ParamRecPtr;

   end;

{***********************************************************************}

{There are 2 functions; names are separated with commas}

procedure DLFNames(Names : PChar); export; stdcall;

begin

  StrCopy(Names,'myFunc1, myFunc2');

end;

{***********************************************************************}

{There is one DLP procedure}

procedure DLPNames(Names : PChar); export; stdcall;

begin

  StrCopy(Names,'myDLP');

end;

{***********************************************************************}

{no FDL procedures so return a null string}

procedure FDLNames(Names : PChar); export; stdcall;

begin

  StrCopy(Names,'');

end;

{***********************************************************************}

function myFunc1 (var CString: CharString; Mode: integer;

       Inputs: ParamRecPtr): double; export; stdCall;

 begin

    {Code for myFunc1}

    ...

    ...

end; {myFunc1}

{***********************************************************************}

function myFunc2 (var CString: CharString; Mode: integer;

       Inputs: ParamRecPtr): double; export; stdCall;

 begin

    {Code for myFunc2}

    ...

    ...

end; {myFunc2}

procedure myDLP(var CString:CharString; Mode:integer;

        Inputs,Outputs:ParamRecPtr); export; stdCall;

 begin

    {Code for myDLP}

    ...

    ...

end; {myDLP}

{***********************************************************************}

 exports

   DLFNames,

   DLPNames,

   FDLNames,

   myFunc1,

   myFunc2,

   myDLP;

begin

end.


DLL File Skeleton in Visual C++

#include <windows.h>

#include <math.h>

// Defines the entry point for the dll

BOOL APIENTRY DllMain( HANDLE hModule,

                       DWORD  ul_reason_for_call,

                       LPVOID lpReserved

 )

{

    return TRUE;

}

// Tell EES which functions and procedures are exported in the library :

// List of DLF format functions

__declspec(dllexport) void DLFNames(char* Names)

{

strcpy(Names,"myFunc1,myFunc2");

}

// List of DLP format procedures

__declspec(dllexport) void DLPNames(char* Names)

{

strcpy(Names,"myDLP");

}

// List of FDL format procedures

__declspec(dllexport) void FDLNames(char* Names)

{

strcpy(Names,"myFDL");

}

// DLF functions implementation

__declspec(dllexport) double myFunc1(char s[256], int mode, EES_PARAM_REC *rec_in)

{Code for myFunc1}

    ...

    ...

return;

}

__declspec(dllexport) double myFunc2(char s[256], int mode, EES_PARAM_REC *rec_in)

{Code for myFunc2}

    ...

    ...

return;

}

// DLP procedure implementation

__declspec(dllexport) void myDLP(char s[256], int mode, EES_PARAM_REC *rec_in, EES_PARAM_REC *rec_out)

{Code for myDLP}

    ...

    ...

return;

}

// FDL procedures implementation (FORTRAN style)

// Note : fortran is always passing the length of the string after

// a string parameter. FORTRAN is always expecting parameters to be

// passed by reference

//

__declspec(dllexport) void myFDL(char s[256], int& clen, int& mode,

int& NInputs, double inputs[25], int& NOutputs, double outputs[25])

{

{Code for myDLP}

    ...

    ...

return;

}


Library Manager (Professional Version)

Normally, all files placed in the USERLIB folder in both the EES startup directory and the working directory are automatically loaded when EES is started.  These files can be library files with filename extensions .LIB, .FDL, .DLF, .DLP or .DLL.  Textbook menu files having a .TXB filename extension are also automatically loaded, but only one .TXB file can be active at a time.  The user can control which files are loaded at startup by moving files into and out of the USERLIB folder.  However, a more convenient alternative is to use the Library Manager provided in the Professional version of EES.

The Library Manager is accessed by clicking the Auto Load button in the Function Information dialog .  This action will bring up a dialog having the appearance shown in the figure below.  The Auto Load button is visible if either the EES Library Routines or the External Routines radio buttons is selected.  Each file in the USERLIB folder appears in the list.  The check box to the left of the list controls whether or not the file is automatically loaded when EES is started.  In addition, changing the loading status of any file has an immediate effect.  If a file is not currently loaded, clicking the check box will automatically load the file and also ensure that it is loaded the next time EES is started.  Unchecking a box will remove a loaded file from memory and prevent it from loading the next time EES is started.  Information is written by the Library Manager into file LibraryManager.txt in the USERLIB folder in the working directory.  Deleting this file will cause all files to be automatically loaded the next time EES is started.

See also:  Function Information

                Library Files


IF - THEN - ELSE

Both single and multiple line formats for IF - THEN - ELSE statements are allowed in Internal Functions and Procedures.  IF - THEN - ELSE statements use logical (also called comparison) operators.  An example of the single line format is:

     IF (X<Y) THEN A:=5 ELSE A:=6

Multiple line IF - THEN - ELSE statements allow a group of statements to be executed.  The format is illustrated in the following example.

     IF (X<Y) THEN

        A:=2

        B:=3

     ELSE

        A:=25

        B:=35

     ENDIF

The THEN keyword is required and it must be preceded and followed by one or more spaces.  An ELSE (or ENDIF) keyword terminates the first group of statements.  The ENDIF keyword terminates the IF statement.  An ENDIF keyword is required if the multiple line format is used.  The ENDIF keyword is not used in the single line format.

Logical operations using the keywords AND and OR may be used in the IF-THEN-ELSE statements, as in the following example.

    IF (X<Y) OR (X>0) THEN B:=106

Note that the use of parentheses surrounding the logical test is required.

EES will process the logical operations from left to right.  When using more than a single AND or OR, it may be necessary to use parentheses to achieve the desired result.  A simple example follows.

   IF (X<Y) AND ((X<Z) OR (Y<Z)) then B:=106

Without the parentheses, EES would have logically ANDed (X<Y) and (X<Z) and then logically ORed this result with (Y<Z).

The IFNOT keyword is similar to the IF keyword and has the same form.  The not equal operator (<>) can be used in the IF and IFNOT statements.  The following two statements are equivalent:

     IFNOT (X=Y) THEN GOTO 10

     IF (X<>Y) THEN GOTO 10

Logic can also be implemented with REPEAT - UNTIL statements.

The Error Procedure is often used within an IF - THEN - ELSE statement.


Fluid Property Information

EES provides built-in thermophysical property data for the fluids listed below.  Click on a fluid name to access additional information for that fluid.  All names in EES are case-insensitive. Additional fluid property data can be added by the user.

---- Ideal Gas ----	--------------------------------------------- Real Fluid ----------------------------------------------
Air	Air_ha*	Methanol*	R11	R404A
AirH2O	Ammonia*	Oxygen*	R12	R407C
CH4	Argon*	n-Butane*	R13	R410A
C2H2	Carbondioxide*	n-Heptane*	R14	R500
C2H4	Carbonmonoxide*	n-Hexane*	R22*	R502
C2H6	Cyclohexane*	n-Octane*	R23*	R507A
C2H5OH	Deuterium*	n-Pentane*	R32*	R508B
C3H8	Ethane*	Neon*	R114	R600*
C4H10	Ethanol*	Nitrogen*	R123*	R600a
C6H14	Ethylene*	Propane*	R125*	R717*
C8H18	Helium*	Propylene*	R134a*	R718*
CO	Hydrogen*	SF6*	R141b*	R744*
CO2	Ice*	Steam*	R143a*	RC318*
H2	Isobutane*	Steam_IAPWS*	R152a*
H2O	Isopentane*	Steam_NBS*	R290*
N2	Methane*	Water
NO		Xenon*
NO2
O2
SO2

* These fluids are implemented using a high accuracy equation of state.

The fluid properties are of two distinct types:  ideal gas and real fluid.  The enthalpy and internal energy of ideal gas substances are dependent only upon temperature.  EES will not accept pressure, along with temperature, as an independent property input in the Enthalpy and IntEnergy functions for ideal gas substances.  A general rule is that substances having a name which is a chemical formula, e.g.,  N2 or CO2, are implemented to be ideal gases whereas real fluids use spelled-out names, e.g., Nitrogen and CarbonDioxide.  Air and AirH2O (psychrometric relations) are exceptions to this rule in that both are based on ideal gas behavior.  Whenever a chemical symbol notation (e.g., N2, CO2, CH4 etc.) is used, the substance is modeled as an ideal gas and the enthalpy and entropy values are based on JANAF table references.  The JANAF table reference for enthalpy is based on the elements having an enthalpy value of 0 at 298K (537R).  The entropy of these substances is based on the Third Law of Thermodynamics.

Whenever the substance name is spelled out (e.g., Steam (or Water or R718), Nitrogen, R12, CarbonDioxide, Methane, etc.) the substance is modeled as a real fluid with subcooled, saturated, and superheated phases.  The fluids identified with an asterisk in the table above employ a high accuracy equation of state that accurately provides property information at all conditions including the vicinity of the critical point and the subcooled region.  Specific references to the equation of state are provided for each fluid.  Otherwise, the fluid properties in the subcooled region are determined using the Martin-Hou equation of state (A.I.Ch.E. Journal, Vol. 1, No. 2, 1955, pp. 142-151) and by assuming the fluid is incompressible.  The Martin-Hou equation of state has a claimed accuracy of 1% in specific volume for conditions at which the density is less than 1.5 * Critical density.   Thermodynamic properties at densities greater than 1.5 * critical density or in the vicinity of the critical point may be inaccurate with the Martin-Hou equation of state..

The property keywords Water, Steam, and R718 are treated identically.  All three keywords provides access to approximate water property functions based on empirical correlations which have been developed for rapid calculations.  The Steam/Water property correlations assume the fluid is incompressible in the subcooled region;  This assumption is not accurate for pressures above 350 atm and for states near the critical point.  The Steam_NBS keyword uses property correlations published by Harr, Gallagher, and Kell (Hemisphere, 1984).  These property correlations are extremely accurate at any condition.  However, they require considerably more computing effort than the Steam/Water relations. Steam_IAPWS provides the most accurate property data for water substance.  Steam_IAPWS is available in the Professional version.


User-Supplied Property Data

EES allows the user to add new property data to the existing data base.  An ASCII file containing the coefficients of the property data correlations must be prepared for each new fluid and placed in the USERLIB subdirectory.  Two types of data can be supplied: real fluid and JANAF table ideal gas.

Real Gas Formulation

EES uses the Martin-Hou (A.I.Ch.E. Journal, 1:142, 1955) and the Fundamental Equation of State (Reiner Tillner-Roth, "Fundamental Equations of State", Shaker, Verlag, Aachan, 1998) to represent the thermodynamic properties of real fluids.  Only the Martin-Hou representation can be used by the user to enter new data.  The file can have any legitimate DOS name with a .MHE filename extension.  An example file with comments is shown below.

UserFluid

58.1           {molecular weight}

0              {not used}

12.84149       {a} Liquid density = a+b*Tz^(1/3)+c*Tz^(2/3)+d*Tz+e*Tz^(4/3)+f*sqrt(Tz)+g*(Tz)^2} 33.02582       {b}    where Tz=(1-T/Tc) and Liquid Density[=]lbm/ft3

-2.53317       {c}

-0.07982       {d}

9.89109        {e}

0              {f}

0              {g}

-6481.15338    {a}  Vapor pressure fit: lnP=a/T+b+cT+d(1-T/Tc)^1.5+eT^2

15.31880       {b}     where T[=]øR and P[=]psia

-0.0006874     {c}

4.28739        {d}

0              {e}

0              {not used}

0.184697       {Gas constant in psia-ft3/lbm-R}

1.5259e-2      {b}  Constants for Martin-Hou EOS/English_units

-20.589        {A2}

9.6163e-3      {B2}

-314.538       {C2}

0.935527       {A3}

-3.4550e-4     {B3}

19.0974        {C3}

-1.9478e-2     {A4}

0              {B4}

0              {C4}

0              {A5}

2.9368e-7      {B5}

-5.1463e-3     {C5}

0              {A6}

0              {B6}

0              {C6}

5.475          {Beta}

0              {alpha}

0              {C'}

-7.39053E-3    {a}   Cv(0 pressure) = a + b T + c T^2 + d T^3 + e/T^2

6.4925e-4      {b}           where T[=]R and Cv[=]Btu/lb-R

9.0466e-8      {c}

-1.1273e-10    {d}

5.2005e3       {e}

124.19551      {href offset}

0.0956305      {sref offset}

550.6          {Pc [=] psia}

765.3          {Tc [=] R}

0.07064        {vc [=] ft3/lbm}

0              {not used}

0              {not used}

2              {Viscosity correlation type: set to 2: do not change}

260            {Lower limit of gas viscosity correlation in K}

535            {Upper limit of gas viscosity correlation in K}

-3.790619e6    {A}    GasViscosity*1E12=A+B*T+C*T^2+D*T^3

5.42356586e4   {B}    where T[=]K and GasViscosity[=]N-s/m2

-7.09216279e1  {C}

5.33070354e-2  {D}

115            {Lower limit of liquid viscosity correlation in K}

235            {Upper limit of liquid viscosity correlation in K}

2.79677345e3   {A}   Liquid Viscosity*1E6=A+B*T+C*T^2+D*T^3

-2.05162697e1  {B}    where T[=]K and Liquid Viscosity[=]N-s/m2

5.3698529e-2   {C}

-4.88512807e-5 {D}

2              {Conductivity correlation type: set to 2: do not change}

250            {Lower limit of gas conductivity correlation in K}

535            {Upper limit of gas conductivity correlation in K}

7.5931e-3      {A}   GasConductivity=A+B*T+C*T^2+D*T^3

-6.3846e-5     {B}    where T[=]K and GasConductivity[=]W/m-K

3.95367e-7     {C}

-2.9508e-10    {D}

115            {Lower limit of liquid conductivity correlation in K}

235            {Upper limit of liquid conductivity correlation in K}

2.776919161e-1 {A}   LiquidConductivity=A+B*T+C*T^2+D*T^3

-8.45278149e-4 {B}    where T[=]K and LiquidConductivity[=]W/m-K

1.57860101e-6  {C}

-1.8381151e-9  {D}

0              {not used: terminator}

Ideal Gas Formulation

The JANAF table ideal gas files must have a .IDG filename extension.  The .IDG file format allows several different types of correlations for the ideal gas specific heat, viscosity and thermal conductivity.  One form is consistent with the representations provided in the DIPPR data base.

DIPPR Project 801 - Evaluated Process Design Data,

BYU-DIPPR Thermophysical

Properties Laboratory, Chemical Engineering Department, Brigham Young

University, Provo, Utah, USA(2001).

http://dippr.byu.edu/

An example .IDG file with comments is provided below.

TestH2O

18.016         {Molar mass of fluid

-1             {Tn  If Tn>0, Tn is the reducing temperature used in the Cp equation; TN<0 indicates Cp equation type}

100            {Lower temperature limit of Cp correlation in K}

2273           {Upper temperature limit of Cp correlation in K}

3.3363E+04 0.0 {a0, b0  if (Tn>0) then  Cp=sum(a[i]*(T/Tn)^b[i], i=0,9 in kJ/kgmole-K}

2.6790E+04 0.0 {a1, b1  if (Tn=-1) then Cp=a1+a2*((a3/T)/sinh(a3/T))^2+a4*((a5/T)/sinh(a5/T))^2 in J/kgmole-K} 2.6105E+03 0.0 {a2, b2}

8.8960E+03 0.0 {a3, b3}

1.1690E+03 0.0 {a4, b4}

0 0            {a5, b5}

0 0            {a6, b6}

0 0            {a7, b7}

0 0            {a8, b8}

0 0            {a9, b9}

298.15         {TRef in K}

100            {Pref in kPa}

-2.41814E+05   {hform - enthalpy of formation in kJ/kgmole at TRef}

1.88724E+02    {s0 - Third law entropy in kJ/kgmole-K at Tref and PRef}

1              {viscosity correlation type: 0=Polynomial form, 1=DIPPR form}

1              {conductivity correlation type: 0=Polynomial, 1=DIPPR form}

273.15         {Lower temperature limit of gas phase viscosity correlation in K}

1073.0         {Upper temperature limit of gas phase viscosity correlation in K}

6.1839E-07     {v0  if (Viscosity Type = 0) Viscosity = sum(v[i]*T^(i)) for i=0 to 5 in Pa/m^2}

6.7779E-01     {v1} if (Viscosity Type = 1) Viscosity = v[0]*T^v[1] / (1 + v[2]/T + v[3]/T^2 in Pa/m^2) 8.4723E+02     {v2}

-7.3930E+04    {v3}

0              {v4}

0              {v5}

200            {Lower temperature limit of gas phase thermal conductivity correlation in K}

1000           {Upper temperature limit of gas phase thermal conductivity correlation in K}

2.1606E-03     {t0  if (Conductivity Type = 0)  Conductivity = sum(t[i]*T^(i)) for i=0 to 5 in W/m-K}

7.6839E-01     {t1  if (Conductivity Type = 1)  Conductivity = t[0]*T^t[1] / (1 + t[2]/T + t[3]/T^2)  in W/m-K} 3.9405E+03     {t2}

-4.4534E+05    {t3}

0              {t4}

0              {t5}

647.096 22064.0 3.10559e-3  0.348  {Tc [K], Pc [kPa], vc [m3/kg], acentric factor}

0              {Terminator - set to 0}

Up to 100 additional fluids can be added in this manner.


AIR

The thermodynamic and transport properties of air are implemented assuming that it obeys the ideal gas law.  The thermodynamic properties are based on data from Keenan, Chao, Keyes, Gas Tables, Wiley, 1983.  The properties are valid from 100 K to 3500 K.

Transport property correlations are based on tabular data available from:

Thermophysical Properties of Matter

Vol. 3:  Thermal Conductivity, Y.S. Touloukian, P.E. Liley, S.C. Saxena

Vol. 11: Viscosity,  Y.S. Touloukian, S.C. Saxena, and P. Hestermans

IFI/Plenun, NY, 1970, ISBN 0-306067020-8

The range of validity of the viscosity correlation is between 80 K and 2000 K.  The thermal conductivity correlation covers the range between 80 and 1500 K.

Note:  Air does NOT use the JANAF table reference states for enthalpy and entropy and can not be used in combustion calculations unless the reference state values are shifted.  If combustion calculations are needed, a mixture of O2 and N2 should be used in place of air.

Air is the only subtance in the EES database that does not follow the ideal gas name convention.  All other substances are modelled as a real substance if the fluid name is spelled out, (e.g., Nitrogen) and as an ideal gas if the fluid name is chemical formula (e.g., N2).  Air is modelled as an ideal gas.  However, Air_ha provides real fluid properties for the air mixture.

Fluid Property Information


AIR_ha

AIR_ha provides thermodynamic properties for the gas mixture composing air using the fundamental equation of state developed by:

E.W. Lemmon, R.T. Jacobsen, S.G. Penoncello, and Daniel Friend

"Thermodynamic Properties of AIr and Mixtures of Nitrogen, Argon, and Oxygen from 60 to 2000 K at Pressures to 2000 MPa",

J.Phys.Chem. Ref. Data, Vol. 29, No. 3, 2000.

The thermodynamic property correlations are valid for temperatures between 60 K and 2000 K at pressures up to 2000 MPa.

Note that AIR_ha provides thermodynamic properties assuming real fluid behavior.  Use AIR  for ideal gas properties of air as found in the air tables of thermodynamic textbooks.

Range of applicability for transport function correlations:

Gas-phase viscosity:  75 K to 1000 K with pressures up to 25 MPa

Liquid-phase viscosity: 75 K to 125 K

Gas-phase thermal conductivity :75 K to 1000 K with pressures up to 10 MPa

Liquid-phase thermal conductivity: 60 K to 130 K

Transport data for liquid air are based on the information provided in:

"Thermodynamic Properties of Refrigerants", P.E. Liley and P.D. Desai, ASHRAE, ISBN 1-883413-10-9, 1993.

The low pressure gas viscosity and thermal conductivity were fit to data found in:

Vol. 3:  Thermal Conductivity, Y.S. Touloukian, P.E. Liley, S.C. Saxena

Vol. 11: Viscosity,  Y.S. Touloukian, S.C. Saxena, and P. Hestermans

IFI/Plenun, NY, 1970, ISBN 0-306067020-8

The surface tension function of AIR_ha has been fit to data tabulated by Liley and Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  It is valid for temperatures between 70 K and 130 K.

Fluid Property Information


AIRH2O

Substance AIRH2O implements air-water vapor mixture (psychrometric) properties using thermodynamic data from the built-in AIR and STEAM property relations from Hyland and Wexler, “Formulations for the Thermodynamic Properties of the Saturated Phases of H2O from 173.15 K to 473.15 K, ASHRAE Transactions, Part 2A,Paper 2793 (RP-216), (1983).

Wet-bulb is approximated with the adiabatic saturation temperature.  The reference state sets the specific enthalpy of dry air to 0 at 0 F (in English units) and 0 C in (SI units) for consistency with most psychrometric charts.  Specific entropy is referenced to 0 K to be consistent with fluid AIR.  The reference state for both enthalpy and entropy of water vapor is based on the traditional steam table reference state.

Note that substance AIRH2O requires three independent properties to fix the state.  Pressure is one of the required properties.  The relative amount of moisture can be indicated by providing the humidity ratio (W), relative humidity (R), dewpoint temperature (D) or wetbulb temperature (B).   The following property functions only operate with substance AIRH2O: DEWPOINT, HUMRAT, WETBULB, RELHUM.

Viscosity and thermal conductivity of air-water vapor mixture are determined using the transport property data for pure air and pure water vapor with mixing rules as described by Van den Bulck Ph.D p. 358.

Fluid Property Information


AMMONIA_mh

AMMONIA provides thermodynamic properties for ammonia using the Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).  The correlations should be valid between 200 K and 700 K. R717 provides the same property data as AMMONIA

Range of applicability for transport function correlations:

Gas-phase viscosity:  200 K to 1000 K

Liquid-phase viscosity: 230 K to 390 K

Gas-phase thermal conductivity: 230 K to 900 K

Liquid-phase thermal conductivity: 244 K to 406 K

The Martin-Hou equation of state is valid for states in which the density is less than 1.5 times the critical density.  Properties in the vicinity of the critical point and at high pressures may be inaccurate.  Properties in the subcooled region are determined by assuming the fluid is incompressible.  Use fluid AMMONIA for more accurate property data.

Fluid Property Information


AMMONIA or R717

AMMONIA provides thermodynamic properties for ammonia using the fundamental equation of state developed by Tillner-Roth, Harms-Watzenberg, and Baehr, "Eine neue Fundamentalgleichung fur Ammoniak", DKV-Tagungsbericht 20:167-181, 1993.

The default values of specific enthalpy and entropy are referred to 200 kJ/kg and 1.00 kJ/kg-K, respectively for the state of saturated liquid at 273.15 K.  The reference state can be changed using the $Reference directive.

Range of applicability for transport function correlations:

Gas-phase viscosity:  200 K to 1000 K

Liquid-phase viscosity: 230 K to 390 K

Gas-phase thermal conductivity: 230 K to 900 K

Liquid-phase thermal conductivity: 244 K to 406 K

The surface tension function has been fit to data provided by Liley and Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  It is valid for temperatures between -75 C to 120 C.

A computationally more efficient but potentially less accurate formulation for ammonia properties is available with fluid name AMMONIA_mh.

Fluid Property Information


CH4

CH4 provides ideal gas thermodynamic properties valid for methane over the temperature range from 250 K to 3500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-74,865 kJ/kmol)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations are implemented using data from provided by N.B. Vargaftik, Y.K. Vinogradov, V.S. Yargin, V.S., Handbook of Physical Properties of Liquids and Gases, 3rd ed, 1996, ISBN 1-56700-063-0.  The viscosity correlation is applicable for temperatures between 200 K and 1200 K.  The thermal conductivity correlation is applicable for temperatures between 200 K and 1270 K.

Note that CH4 provides thermodynamic properties assuming ideal gas behavior.  Use METHANE to provide real fluid properties in the subcooled, saturated mixture, and superheated regimes.

Fluid Property Information


C2H2

C2H2 provides ideal gas thermodynamic and transport properties for acetylene over the temperature range from 250 K to 750 K.  The ideal gas specific heat and transport property data are based on information taken from:

Properties of Inorganic and Organic Fluids

Edited by C.Y. Ho

P.E. Liley, T. Makita, and Y. Tanaka

Cindas Data Serties of Material Properties, Vol. V-1

Hemisphere Publishing Corporation, (1988)

ISBN 0-89116-802-8

The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (226,730 kJ/kmol)  at 25°C.  The reference state for specific entropy is based on the Third Law of thermodynamics (200.85 kJ/kgmol-K at 25°C, 100 kPa).

The low density viscosity correlation is applicable (with an uncertainty of 3%) for 250 K< T < 750 K

The low density thermal conductivity correlation is applicable (with a 5% uncertainty) for 250 K < T < 750 K

Fluid Property Information


C2H4

C2H4 provides ideal gas thermodynamic properties for ethylene over the temperature range from 270 K to 2000 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (52,280 kJ/kmol)  at 25°C.  The reference state for specific entropy is based on the Third Law of thermodynamics (219.93 kJ/kgmol-K at 25°C, 100 kPa).

Transport data were fit from the tabular data provided by: P.E. Liley and P.D. Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9 for temperatures between 270 K and 475 K.

Note that C2H4 provides thermodynamic properties assuming ideal gas behavior.  Use ethylene to provide real fluid properties in the subcooled, saturated mixture, and superheated regimes.

Fluid Property Information


C2H6

C2H6 provides ideal gas thermodynamic properties for ethane valid over the temperature range from 250 K to 1500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-84,659 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations are implemented for temperatures between 200 K and 1000 K.

Note that C2H6 provides thermodynamic properties assuming ideal gas behavior.  Use ETHANE to provide real fluid properties in the subcooled, saturated mixture, and superheated regimes.

Fluid Property Information


C2H5OH

C2H5OH provides ideal gas thermodynamic and transport property data for low pressure gaseous ethanol over the temperature range from 270 K to 1000 K.  The ideal gas specific heat is based on data provided by

Properties of Inorganic and Organic Fluids

Edited by C.Y. Ho

P.E. Liley, T. Makita, and Y. Tanaka

Cindas Data Serties of Material Properties, Vol. V-1, Chapter 10

Hemisphere Publishing Corporation, (1988)

ISBN 0-89116-802-8

The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-235,310 at 25°C.  The reference state for specific entropy is based on the Third Law of thermodynamics (282.59 kJ/kgmol-K at 25°C, 101.3 kPa).  These reference state values were obtained from Table A-30 of Fundamentals of Engineering Thermdynamics by Moran and Shapiro, 3rd ed., Wiley, 1995.

Transport property information were also obtained from Liley, Makita, and Tanaka:

The low density viscosity correlation is applicable (with an uncertainty of 6%) for 352 K< T < 1000 K

The low density thermal conductivity correlation is applicable (with a 10% uncertainty) for 352 K < T < 600 K

Fluid Property Information


C3H8

C3H8 provides ideal gas thermodynamic properties for propane valid over the temperature range from 250 K to 1500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-103,836 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations were developed from data provided in:

Thermophysical Properties of Matter

Vol. 3:  Thermal Conductivity, Y.S. Touloukian, P.E. Liley, S.C. Saxena

Vol. 11: Viscosity,  Y.S. Touloukian, S.C. Saxena, and P. Hestermans

IFI/Plenun, NY, 1970, ISBN 0-306067020-8

The viscosity correlation is valid for temperatures between 270 K and 600 K.   The thermal conductivity correlation is applicable for temperatures between 200K and 600 K.

Note that C3H8 provides thermodynamic properties assuming ideal gas behavior.  Use PROPANE or R290 to provide real fluid properties in the subcooled, saturated mixture, and superheated regimes.

Fluid Property Information


C4H10

C4H10 provides ideal gas thermodynamic properties for n-butane valid over the temperature range from 0 K to 1500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-126,133 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations were developed from data provided in:

Thermophysical Properties of Matter

Vol. 3:  Thermal Conductivity, Y.S. Touloukian, P.E. Liley, S.C. Saxena

Vol. 11: Viscosity,  Y.S. Touloukian, S.C. Saxena, and P. Hestermans

IFI/Plenun, NY, 1970, ISBN 0-306067020-8

The viscosity and thermal conductivity correlatios are applicable for temperatures between 270 K and 520  K.

Note that C4H10 provides thermodynamic properties assuming ideal gas behavior.  Use n-Butane to provide real fluid properties in the subcooled, saturated mixture, and superheated regimes.

Fluid Property Information


C6H14

C6H14 provides ideal gas thermodynamic property data for n-hexane over the temperature range from 200 K to 1000 K.  The ideal gas specific heat uses the correlation provided by

M. Jaeschke and P. Schley,

"Ideal-Gas Thermodynamic Properties for Natural-Gas Applications International Journal of Thermophysics",

Vol. 16, No. 6, 1995, pp. 1381-1392

The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-167,200 at 25°C.  The reference state for specific entropy is based on the Third Law of thermodynamics (388.82 kJ/kgmol-K at 25°C, 100 kPa).  These reference state values were obtained from NIST  http://webbook.nist.gov/

Transport property information were implemented from information provided in:

Properties of Inorganic and Organic Fluids

Edited by C.Y. Ho

P.E. Liley, T. Makita, and Y. Tanaka

Cindas Data Serties of Material Properties, Vol. V-1

Hemisphere Publishing Corporation, (1988)

ISBN 0-89116-802-8

The low density viscosity correlation is applicable (with an uncertainty of 5%) for 342 K< T < 750 K

The low density thermal conductivity correlation is applicable (with a 5% uncertainty) for 342 K < T < 1000 K

Fluid Property Information


C8H18

C8H18 provides ideal gas thermodynamic property data for n-octane over the temperature range from 200 K to 1000 K.  The ideal gas specific heat uses the correlation provided by

M. Jaeschke and P. Schley,

"Ideal-Gas Thermodynamic Properties for Natural-Gas Applications International Journal of Thermophysics",

Vol. 16, No. 6, 1995, pp. 1381-1392

The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-208,459 kJ/kmol)  at 25°C.  The reference state for specific entropy is based on the Third Law of thermodynamics (463.67 kJ/kgmol-K at 25°C, 100 kPa).

Transport property information were implemented from information provided in:

Properties of Inorganic and Organic Fluids

Edited by C.Y. Ho

P.E. Liley, T. Makita, and Y. Tanaka

Cindas Data Serties of Material Properties, Vol. V-1

Hemisphere Publishing Corporation, (1988)

ISBN 0-89116-802-8

The low density viscosity correlation is applicable (with an uncertainty of 2%) for 250 K< T < 550 K

The low density thermal conductivity correlation is applicable (with a 10% uncertainty) for 400 K < T < 650 K

Fluid Property Information


CO

CO provides ideal gas thermodynamic properties for carbon monoxide valid over the temperature range from 250 K to 3500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-110,526 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations are implemented using data from provided by N.B. Vargaftik, Y.K. Vinogradov, V.S. Yargin, V.S., Handbook of Physical Properties of Liquids and Gases, 3rd ed, 1996, ISBN 1-56700-063-0.  The viscosity correlation is applicable for temperatures between 73.1 K and 1273.1 K.  The thermal conductivity correlation is applicable for temperatures between 80 K and 2200 K.

Note that CO provides thermodynamic properties assuming ideal gas behavior.  Use CARBONMONOXIDE to provide real fluid properties in the subcooled, saturated mixture, and superheated regimes.

Fluid Property Information


CO2

CO2 provides ideal gas thermodynamic properties for carbon dioxide valid over the temperature range from 250 K to 3500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-393,514)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations are implemented using data from provided by N.B. Vargaftik, Y.K. Vinogradov, V.S. Yargin, V.S., Handbook of Physical Properties of Liquids and Gases, 3rd ed, 1996, ISBN 1-56700-063-0.  The viscosity correlation is applicable for temperatures between 150 K and 2000 K.  The thermal conductivity correlation is applicable for temperatures between 200 K and 1400 K.

Note that CO2 provides thermodynamic properties assuming ideal gas behavior.  Use CARBONDIOXIDE OR R744 to provide real fluid properties in the subcooled, saturated mixture, and superheated regimes.

Fluid Property Information


H2

H2 provides ideal gas thermodynamic properties for hydrogen valid over the temperature range from 250 K to 3500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (0 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations are based on tabular data available from:

Thermophysical Properties of Matter

Vol. 3:  Thermal Conductivity, Y.S. Touloukian, P.E. Liley, S.C. Saxena

Vol. 11: Viscosity,  Y.S. Touloukian, S.C. Saxena, and P. Hestermans

IFI/Plenun, NY, 1970, ISBN 0-306067020-8

The range of validity of the viscosity correlation is between 10 K and 2000 K.  The thermal conductivity correlation covers the range between 20 and 1540 K.

Note that fluid H2 provides ideal gas properties.  Use fluid Hydrogen for real gas properties for hydrogen.

Fluid Property Information


H2O

H2O provides ideal gas thermodynamic properties for gaseous water valid over the temperature range from 250 K to 3500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-241,815 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations are implemented for temperatures between 245 K and 3500 K.

Note that H2O provides thermodynamic properties assuming ideal gas behavior.  Use STEAM or WATER  to provide real fluid properties in the subcooled, saturated mixture, and superheated regimes.  High accuracy steam properties are available with substance STEAM_IAPWS.

Fluid Property Information


N2

N2 provides ideal gas thermodynamic properties for nitrogen gas valid over the temperature range from 250 K to 3500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (0 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations are implemented from data provided by N.B. Vargaftik, Tables on the Thermophysical Properties of Liquids and Gases, Hemisphere Publishing Corp, 2nd ed., 1975, ISBN 0-470-90310-4  The correlation for viscosity is applicable for temperatures between 80 K and 2500 K.  The thermal conductivity correlation is applicable between 80 K and 1400 K.

Note that N2 provides thermodynamic properties assuming ideal gas behavior.  Use NITROGEN  to provide real fluid properties in the subcooled, saturated mixture, and superheated regimes.

Fluid Property Information


O2

O2 provides ideal gas thermodynamic properties for oxygen gas valid over the temperature range from 250 K to 3500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (0 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations are implemented for temperatures between 200 K and 3000 K using correlations provided by N.B. Vargaftik, Y.K. Vinogradov and V.S. Yargin, Handbook of Physical Properties of Liquids and Gases, 3rd ed, 1996, ISBN 1-56700-063-0.  (There is a typographical error in equation (1) on page 909.  The 3rd coefficient should be a negative value, i.e., -408.723

Note that O2 provides thermodynamic properties assuming ideal gas behavior.  Use OXYGEN to provide real fluid properties in the subcooled, saturated mixture, and superheated regimes.

Fluid Property Information


R11

The thermodynamic properties of refrigerant R11 are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).  Fitted parameters are from Downing and Knight, DuPont Technical Bulletin RT-52, 1971.

The values of specific enthalpy and entropy are referred to 0 for saturated liquid at -40 C (F).

Range of applicability for transport function correlations:

Gas-phase viscosity:  200 K to 380 K

Liquid-phase viscosity: 230 K to 500 K

Gas-phase thermal conductivity: 270 K to 420 K

Liquid-phase thermal conductivity: 235 K to 450 K

Fluid Property Information


R12

The thermodynamic properties of refrigerant R12 are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).  Fitted parameters are from Downing and Knight, DuPont Technical Bulletin RT-52, 1971.

The values of specific enthalpy and entropy are referred to 0 for saturated liquid at -40 C (F).

Range of applicability for transport function correlations:

Gas-phase viscosity:  250 K to 480 K

Liquid-phase viscosity: 170 K to 340 K

Gas-phase thermal conductivity: 240 K to 480 K

Liquid-phase thermal conductivity: 144 K to 344 K

Surface tension data are from Liley and Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  The range of valid for the surface tension data is -100 C < T < 110 C.

Fluid Property Information


R13

The thermodynamic properties of refrigerant R13 are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).  Fitted parameters are from Downing and Knight, DuPont Technical Bulletin RT-52, 1971.

The values of specific enthalpy and entropy are referred to 0 for saturated liquid at -40 C (F).

Range of applicability for transport function correlations:

Gas-phase viscosity:  220 K to 425 K

Liquid-phase viscosity: 200 K to 300 K

Gas-phase thermal conductivity: 220 K to 535 K

Liquid-phase thermal conductivity: 94 K to 270 K

Fluid Property Information


R14

The thermodynamic properties of refrigerant R14 are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).  Fitted parameters are from Downing and Knight, DuPont Technical Bulletin RT-52, 1971.

The reference state is determined by setting specific enthalpy to 142.5 kJ/kg and specific entropy to 1.784 kJ/kg-K for saturated liquid at -100 C.

Range of applicability for transport function correlations:

Gas-phase viscosity:  220 K to 425 K

Liquid-phase viscosity: 200 K to 300 K

Gas-phase thermal conductivity: 220 K to 535 K

Liquid-phase thermal conductivity: 94 K to 270 K

Fluid Property Information


R123

R123 provides thermodynamic properties for R123 using the fundamental equation of state described by Reiner Tillner-Roth in Fundamental Equations of State, Shaker, Verlag, Aachan, 1998. The equation is a refit of the modified Benedict-Webb-Rubin equation established by B.A. Younglove and M.O. McLinden,  "An International Standard Equation of State for the Thermodynamic Properties of Refrigerant R123," Journal of Physical and Chemical Reference Data, Vol. 23, No. 5, pp. 731-779, 1994.  Ancillary routines are from Younglove and McLinden.  The equation of state is valid for temperatures between 166K and 525K at pressures lower than 40 MPa.

The values of specific enthalpy and entropy are, by default, referred to 200 kJ/kg and 1.00 kJ/kg-K, respectively for the state of saturated liquid at 273.15 K.  The reference state can be changed using the $Reference directive.

Transport Properties:

Viscosity and thermal conductivity are calculated using the correlations presented by Y. Tanaka and T. Sotani, "Thermal Conductivity and Viscosity of 2-2-dichloro-1,1,1-trifluoroethane, (HCFC-123), Int. J. of Thermalphysics, Vol.  17, No. 2, pp. 293-328, 1966.  The correlation is valid for temperatures between 253 K and 425 K.

Surface tension data are from: Okada, M. and Higashi, Y., "R123--Thermodynamic and physical properties,  International Institute of Refrigeration, Paris, (1995).

Fluid Property Information


R125

R125 provides thermodynamic properties for R125 using the fundamental equation of state described by Reiner Tillner-Roth in Fundamental Equations of State, Shaker, Verlag, Aachan, 1998.  Ancillary routines are vapor pressure and saturated liquid and vapor densities are from S.L. Outcalt and M.O. McLinden, "Equation of State for the Thermodynamic Properties of R32 and R125, Int. J. of Thermophysics, Vol. 16, No. 1, 1995.    The equation of state is valid for temperatures between 172.5 K and 440 K at pressures lower than 70 MPa.

The values of specific enthalpy and entropy are, by default,  referred to 200 kJ/kg and 1.00 kJ/kg-K, respectively for the state of saturated liquid at 273.15 K.  The reference state can be changed using the $Reference directive.

Transport Properties:

Viscosity and thermoconductivity rely on the empirical relations presented by S.B. Kiselev, R.A. Perkins, and M.L. Huber, Int. J. of Refrigeration, Vol. 22, (1999), pp. 509-520

Surface tension data are from: Okada, M. and Higashi, Y., "Experimental Surface Tensions for HFC-32, CFC-124, HFC-125, HCFC-141b, CFC-142b, and HFC-152a", Int. J. of Thermophysics, Vol. 16, No.3, (1995).

Fluid Property Information


R134a_mh

The thermodynamic properties of refrigerant R134a are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955) based on themodynamic information from McLinden et al., Measurement and Formulation of the Thermodynamic Properties of R134a and 123, ASHRAE Trans., Vol. 95, No.2, 1989.

The values of specific enthalpy and entropy are referred to 0 for saturated liquid at -40 C (F).

Fluid R134a will provide properties using the international standard formulation and more accurate results at high densities.

Range of applicability for transport function correlations:

Gas-phase viscosity:  230 K to 475 K

Liquid-phase viscosity: 230 K to 375 K

Gas-phase thermal conductivity: 230 K to 475 K

Liquid-phase thermal conductivity: 230 K to 375 K

The Martin-Hou equation of state is valid for states in which the density is less than 1.5 times the critical density.  Properties in the vicinity of the critical point and at high pressures may be inaccurate.  Properties in the subcooled region are determined by assuming the fluid is incompressible.  Use fluid R134a for more accurate property data.

Surface tension data were fit to data obtained from the NIST REFPROP 6 program (M.O. McLinden, S.A. Klein, E.W. Lemmon and A.P. Peskin, Physical and Chemical Properties Division, National Institute of Standards and Technology, Boulder, CO 80303, 1995.  The range of applicability of the data are from 170 K to the 374 K.

Fluid Property Information


R134a

R134a provides thermodynamic properties for R134a using the fundamental equation of state developed by R. Tillner-Roth and H.D. Baehr, An International Standard Formulation for the Thermodynamic Properties of 1,1,1,2-Tetrafluoroethane (HFC-134a) for Temperatures from 170 K to 455 K and Pressures up to 70 MPa, J. Phys. Chem, Ref. Data, Vol. 23, No. 5, 1994.

The values of specific enthalpy and entropy are, by default, set to 0 kJ/kg and 0 kJ/kg-K at -40°C (and -40°F).  Another common reference state is the IIR reference for which h and s are referred to 200 kJ/kg and 1.00 kJ/kg-K, respectively for the state of saturated liquid at 273.15 K.  The reference state can be changed using the $Reference directive.

Transport Properties:

Viscosity is correlated with a relation developed by Marcia Huber, Arno Laesecke, and Richard A. Perkins at NIST-Boulder, submitted in January 2003 to Industrial Engineering and Chemistry Research;

Liquid phase thermal conductivity data are from the generalized correlation described by M.J. Assael, N.K. Dalaouti, A.A. Griva, and J.H. Dymond, "Viscosity and Thermal Conductivity of Halogenated Methane and Ethane Refrigerants", IJR, Vol. 22, pp. 525-535, 1999.  These property correlations are applicable over the same range as the equation of state.

Gas-phase viscosity:  230 K to 475 K

Gas-phase thermal conductivity: 230 K to 475 K

Surface tension data were fit to data obtained from the NIST REFPROP 6 program (M.O. McLinden, S.A. Klein, E.W. Lemmon and A.P. Peskin, Physical and Chemical Properties Division, National Institute of Standards and Technology, Boulder, CO 80303, 1995.  The range of applicability of the data are from 170 K to the 374 K.

A computationally more efficient but potentially less accurate formulation for R134a properties is available with fluid name R134a_mh.

Fluid Property Information


R143a

R143a provides high accuracy thermodynamic properties for R143a (1,1,1-trifluoroethane) using the fundamental equation of state presented in:

An International Standard Formulation for the Thermodynamic Properties of 1,1,1-trifluoroethane (R143a) for Temperatures from 161 to 450 K and Pressures up to 50 MPa.

Lemmon, E.W. and Jacobsen, R.T.,

J. Phys. Chem. Ref. Data, Vol. 29, No. 4, 2000

Ancillary routines are vapor pressure and saturated liquid and vapor densities are also provided in the above reference.

The values of specific enthalpy and entropy are, by default,  referred to 200 kJ/kg and 1.00 kJ/kg-K, respectively for the state of saturated liquid at 273.15 K.  The reference state can be changed using the $Reference directive.

Range of applicability for transport function correlations:

Gas-phase viscosity:  200 K to 650 K

Liquid-phase viscosity: 200 K to 350 K

Gas-phase thermal conductivity: 200 K to 650 K

Liquid-phase thermal conductivity: 200 K to 350 K

Surface tension data are from:

Schmidt, J.W., Carrillo-Nava, E., and Moldover, M.R.,

"Partially halogenated hydrocarbons CHFCl-CF3, CF3-CH3, CF3-CHF-CHF2, CF3-CH2-CF3, CHF2-CF2-CH2F, CF3-CH2-CHF2, CF3-O-CHF2: Critical temperature, refractive indices, surface tension and estimates of liquid, vapor and critical densities,"

Fluid Phase Equilibria, 122:187-206, 1996.}

Fluid Property Information


NO2

NO2 provides ideal gas thermodynamic properties for nitrogen dioxide gas valid over the temperature range from 250 K to 3500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (33,729 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property information were implemented from information provided in:

Properties of Inorganic and Organic Fluids

Edited by C.Y. Ho

P.E. Liley, T. Makita, and Y. Tanaka

Cindas Data Serties of Material Properties, Vol. V-1

Hemisphere Publishing Corporation, (1988)

ISBN 0-89116-802-8

The low density viscosity correlation is applicable (with an uncertainty of 10%) for 100 K< T < 1000 K

The low density thermal conductivity correlation is applicable (with a 10% uncertainty) for 380 K < T < 750 K

Fluid Property Information


R152a

Thermodynamic Properties

R152a uses the fundamental equation of state developed from the following reference:

"Equation of State from 1-1-DiFluouroethane, R152a", Y. Kim, C. Borgnakke, and R. Sonntag, Intl. Journal of Energy Research, Vol. 21, 575-589, 1997.  This equation is valid for temperatures between 213 K and 433 K at pressures up to 20 MPa.

The values of specific enthalpy and entropy are referred to 200 kJ/kg and 1.00 kJ/kg-K, respectively for the state of saturated liquid at 273.15 K.

Transport properties:

Liquid phase viscosity and conductivity data are from the generalized correlation described by M.J. Assael, N.K. Dalaouti, A.A. Griva, and J.H. Dymond, "Viscosity and Thermal Conductivity of Halogenated Methane and Ethane Refrigerants", IJR, Vol. 22, pp. 525-535, 1999.  These property correlations are applicable over the same range as the equation of state.

Transport properties for the gas phase were fit to data from the REFPROP 6 data base (M.O. McLinden, S.A. Klein, E.W. Lemmon and A.P. Peskin, Physical and Chemical Properties Division, National Institute of Standards and Technology, Boulder, CO 80303, 1995.)

Gas-phase viscosity:  180 K to 433

Gas-phase thermal conductivity: 180 K to 433 K

Surface tension data were fit to data obtained from the NIST REFPROP 6 program (M.O. McLinden, S.A. Klein, E.W. Lemmon and A.P. Peskin, Physical and Chemical Properties Division, National Institute of Standards and Technology, Boulder, CO 80303, 1995.)  The range of applicability of the surface tension data is the same as for the thermodynamic properties.

Fluid Property Information


R114

The thermodynamic properties of refrigerant R114 are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).  Fitted parameters are from Downing and Knight, DuPont Technical Bulletin RT-52, 1971.

The reference state is determined by setting specific enthalpy and entropy of saturated liquid to 0.

Range of applicability for transport function correlations:

Gas-phase viscosity:  230 K to 500 K

Liquid-phase viscosity: 170 K to 410 K

Gas-phase thermal conductivity: 280 K to 675 K

Liquid-phase thermal conductivity: 180 K to 360 K

Fluid Property Information


R22_mh

The thermodynamic properties of refrigerant R22 are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).  Fitted parameters are from Downing and Knight, DuPont Technical Bulletin RT-52, 1971.

The values of specific enthalpy and entropy are referred to 0 for saturated liquid at -40 C (F).

Range of applicability for transport function correlations:

Gas-phase viscosity:  250 K to 440 K

Liquid-phase viscosity: 170 K to 360 K

Gas-phase thermal conductivity: 230 K to 645 K

Liquid-phase thermal conductivity: 144 K to 340 K

The surface tension function has been fit to data provided by Liley and Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  It is valid for temperatures between -150 C to 90 C.

Fluid Property Information


R23

Thermodynamic properties for R23 are determined from the fundamental equation of state developed by:

S.G. Penoncello, Z. Shan, and R.T. Jacobsen,

"A Fundamental Equation for the Calculation of the Thermodynamic Properties of Trifluoromethane",

ASHRAE Transactions Paper DA-00-10-1 (RP997), Vol. 106, Pt. 1,  2000

The correlation is valid for temperatures between the triple point (118.02 K) and 475 K for pressures up to 120 MPa.

The values of specific enthalpy and entropy are by default referred to 200 kJ/kg and 1.00 kJ/kg-K, respectively for the state of saturated liquid at 273.15 K.  The reference state can be changed using the $Reference directive.

Transport Properties:

Liquid phase viscosity and conductivity data are from the generalized correlation described by M.J. Assael, N.K. Dalaouti, A.A. Griva, and J.H. Dymond, "Viscosity and Thermal Conductivity of Halogenated Methane and Ethane Refrigerants", IJR, Vol. 22, pp. 525-535, 1999.  These property correlations are applicable over the same range as the equation of state.

Gas-phase viscosity:  140 K to 475 K

Gas-phase thermal conductivity: 140 K to 475 K

Gas phase viscosity and thermal conductivity and surface tension data were fit to data obtained from the NIST REFPROP 6 program (M.O. McLinden, S.A. Klein, E.W. Lemmon and A.P. Peskin, Physical and Chemical Properties Division, National Institute of Standards and Technology, Boulder, CO 80303, 1995.

Fluid Property Information


R500

The thermodynamic properties of the azeotropic refrigerant mixture R500 (73.8% R12, 26.2% R152a by mass) are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).  Fitted parameters are from Downing and Knight, DuPont Technical Bulletin RT-52, 1971.

The reference state is determined by setting specific enthalpy and entropy of saturated liquid to 0.

Range of applicability for transport function correlations:

Gas-phase viscosity:  240 K to 390 K

Liquid-phase viscosity: 200 K to 370 K

Gas-phase thermal conductivity data are not implemented

Liquid-phase thermal conductivity" 290 K to 335 K

Fluid Property Information


R502

The thermodynamic properties of the azeotropic refrigerant mixture R502 (48.8% R22, 51.2% R115 by mass) are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).  Fitted parameters are from Downing and Knight, DuPont Technical Bulletin RT-52, 1971.

The reference state is determined by setting specific enthalpy and entropy of saturated liquid to 0.

Range of applicability for transport function correlations:

Gas-phase viscosity:  220 K to 390 K

Liquid-phase viscosity: 200 K to 350 K

Gas-phase thermal conductivity: 225 K to 380 K

Liquid-phase thermal conductivity: 280 K to 320 K

Fluid Property Information


SO2

SO2 provides ideal gas thermodynamic properties for nitrogen dioxide gas valid over the temperature range from 250 K to 1500 K based on the constant pressure specific heat correlation from Howell and Buckius, Fundamentals of Engineering Thermodynamics, McGraw-Hill, 1987.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (-297,094 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property correlations were developed from data provided in:

Thermophysical Properties of Matter

Vol. 3:  Thermal Conductivity, Y.S. Touloukian, P.E. Liley, S.C. Saxena

Vol. 11: Viscosity,  Y.S. Touloukian, S.C. Saxena, and P. Hestermans

IFI/Plenun, NY, 1970, ISBN 0-306067020-8

The viscosity correlation is valid for temperatures between 200 K and 1250 K.   The thermal conductivity correlation is applicable for temperatures between 250K and 900 K.

Fluid Property Information


WATER

Substance Water now provides the same properties as substance Steam.

Fluid Property Information


NO

NO provides ideal gas thermodynamic properties for nitrogen dioxide gas valid over the temperature range from 250 K to 3500 K based on the constant pressure specific heat correlation from Van Wylen and Sonntag, Fundamentals of Classical Thermodynamics, 3rd ed, John Wiley and Sons, 1986.  The reference state for specific enthalpy is based on the enthalpy of formation relative to the elements (12,542 kJ/kmole)  at 25 C.  The reference state for specific entropy is determined by the Third Law of Thermodynamics.

Transport property information were implemented from information provided in:

Properties of Inorganic and Organic Fluids

Edited by C.Y. Ho

P.E. Liley, T. Makita, and Y. Tanaka

Cindas Data Serties of Material Properties, Vol. V-1

Hemisphere Publishing Corporation, (1988)

ISBN 0-89116-802-8

The low density viscosity correlation is applicable (with an uncertainty of 2%) for 121.7 K< T < 1000 K

The low density thermal conductivity correlation is applicable (with a 5% uncertainty) for 121.7 K < T < 750 K

Fluid Property Information


NITROGEN

NITROGEN provides thermodynamic properties using the fundamental equation of state reported by R.T. Jacobsen, R.B. Stewart, and M. Jahangiri, "Thermodynamic Properties of Nitrogen from the Freezing Line to 2000 K at Pressures to 1000 MPa", J. Phys, Chem, Ref. Data, Vol. 15, No. 2, 1986.

The reference state for specific enthalpy and entropy is 0 at 298.15 K and 101.325 kPa.  The reference state can be changed using the $Reference directive.

Note that NITROGEN provides thermodynamic properties assuming real fluid behavior.  Use N2 for ideal gas properties of nitrogen consistent with reference states used in combustion calculations.

Transport data for low pressure gas states are based on the information provided in "Thermodynamic Properties of Refrigerants", P.E. Liley and P.D. Desai, ASHRAE, ISBN 1-883413-10-9, 1993.

The surface tension function has been fit to data tabulated by Liley and Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  It is valid for temperatures between 64 K and 125 K.

Range of applicability for transport function correlations:

Gas-phase viscosity:  75 K to 1000 K with pressures up to 25 MPa

Liquid-phase viscosity: 65 K to 125 K

Gas-phase thermal conductivity:75 K to 600 K

Liquid-phase thermal conductivity: 65 K to 125 K

Fluid Property Information


CARBONDIOXIDE or R744

CARBONDIOXIDE and R744 both provide high accuracy thermodynamic properties for carbon dioxide using the fundamental equation of state developed by R. Span and W. Wagner, A New Equation of State for Carbon Dioxide Covering the Fluid Region form the Triple-Point Temperature to 1100 K at Pressures up to 800 MPa, J. Phys. Chem, Ref. Data, Vol. 25, No. 6, 1996.

The values of specific enthalpy and entropy are, by default, referred to values of 0 at 298.15 K and 101.325 kPa in the ideal gas state.  The reference state can be changed using the $Reference directive.

Viscosity and thermal conductivity are determined in the manner described by Vesovic et al., The Transport Properties of Carbon Dioxide, J. Phys. Chem Ref, Data, Vol. 19, No. 3, 1990.  The viscosity correlation is valid for temperatures between 200K and 1500 K.  The thermal conductivity correlation is valid for temperatures between 200 K and 1000 K.  Both the viscosity and thermal conductivity correlations can be applied for pressures up to 100 MPa.

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Note that CARBONDIOXIDE and R744 provide thermodynamic properties assuming real fluid behavior.  Use CO2 for ideal gas properties of carbon dioxide consistent with reference states used in combustion calculations.

Fluid Property Information


CARBONDIOXIDE_ha

CARBONDIOXIDE_ha provides exactly the same capability as CARBONDIOXIDE and R744.  Originally CARBONDIOXIDE and CARBONDIOXIDE_ha used different property correlations, but now both name utilize the high accuracy property formulation.  Although it is redundant, the fluid name CARBONDIOXIDE_ha has been retained for reasons of backward compatibility.  Please use CARBONDIOXIDE as this name will be removed eventually.

Fluid Property Information


CARBONMONOXIDE

CARBOMONOXIDE (molar mass = 28.011)  provides high accuracy thermodynamic properties for carbon monoxide using the fundamental equation of state presented in:

R.T. Jacobsen, S.G. Penoncello and E.W. Lemmon

Thermodynamic Properties of Cryogenic Fluids

Plenum Press, ISBN 0-306-45522-6, 1997

This correlation is valid for temperatures within the range 68.127 [K] < T < 1000 [K] at pressures up to 30 MPa.

Viscosity and thermal conductivity are by regressing values obtained from the NIST Standard Reference Database 14, National Institute of Standards and Technology, E.W. Lemmon, A.P. Peskin, M.O. McLinden, and D.G. Friend, (2000).  The ranges of applicability for transport function correlations are:

Gas-phase viscosity:  70 K to 1000 K

Liquid-phase viscosity: 70 K to 130 K

Gas-phase thermal conductivity: 70 K to 1000 K

Liquid-phase thermal conductivity: 70 K to 130 K

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Note that CARBONMONOXIDE provides thermodynamic properties assuming real fluid behavior.  Use CO for ideal gas properties of carbon monoxide consistent with reference states used in combustion calculations.

Fluid Property Information


OXYGEN

OXYGEN provides thermodynamic properties using the Fundamental equation of state developed by R.B. Stewart, R.T. Jacobsen, and W. Wagner, "Thermodynamic Properties of Oxygen from the Triple Point to 300 K with Pressures to 80 MPa", J. Phys, Chem, Ref. Data, Vol. 20, No. 5, 1991.

Note that OXYGEN provides thermodynamic properties assuming real fluid behavior.  The reference state for ideal gas specific enthalpy and entropy is 0 kJ/kmol and 0 kJ/kmol-K respectively at 298.15 K and 101.1325 kPa.

Use O2 for ideal gas properties of oxygen consistent with reference states used in combustion calculations.

Range of applicability for transport function correlations:

Gas-phase viscosity:  80 K to 700 K

Liquid-phase viscosity: 80 K to 155 K

Gas-phase thermal conductivity: 80 K to 700 K

Liquid-phase thermal conductivity: 80 K to 155 K

Surface tension data are from Liley and Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  The range of valid for the surface tension data is 80 K < T < 150 K.

Fluid Property Information


PROPANE_mh

PROPANE provides thermodynamic properties of C3H8 using the Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).

The Martin-Hou equation of state is valid for states in which the density is less than 1.5 times the critical density.  Properties in the vicinity of the critical point and at high pressures may be inaccurate.  Properties in the subcooled region are determined by assuming the fluid is incompressible.  Use fluid PROPANE for more accurate property data.

Note that PROPANE provides thermodynamic properties assuming real fluid behavior.  The reference state for specific enthalpy and entropy is 0 for saturated liquid at 233.16 K.  Use C3H8 for ideal gas properties of propane consistent with reference states used in combustion calculations.

Range of applicability for transport function correlations:

Gas-phase viscosity:  240 K to 530 K

Liquid-phase viscosity: 210 K to 370 K

Gas-phase thermal conductivity: 240 K to 530 K

Liquid-phase thermal conductivity: 210 K to 370 K

Surface tension data were fit to data obtained from the NIST REFPROP 6 program (M.O. McLinden, S.A. Klein, E.W. Lemmon and A.P. Peskin, Physical and Chemical Properties Division, National Institute of Standards and Technology, Boulder, CO 80303, 1995.  The range of applicability of the data are from 86 K to the 369.8 K.

Fluid Property Information


PROPANE or R290

PROPANE provides high accuracy thermodynamic and transport properties for propane (C3H8, Molar mass = 44.095 g/mol) using the Fundamental (or Helmholtz Free Energy) Equation of State formulated by:

 Miyamoto, H., and Watanabe, K.,

"A thermodynamic property model for fluid-phase propane,"

Int. J. Thermophys., 21(5):1045-1072, 2000.

The equation of state is valid for temperatures between 85.48 K (the triple point temperature) and 623 K at pressures up to 103 MPa.  The default reference state is the IIR standard for which:	h=200.0 kJ/kg 	s=1.0 kJ/kg-K  for saturated liquid at 273.15 K.  The reference state can be changed using the $Reference directive.

Note that PROPANE provides thermodynamic properties assuming real fluid behavior.  Use C3H8 for ideal gas properties of propane consistent with reference states used in combustion calculations. An older, less accurate formulation for propane properties is available with fluid Propane_MH.

Thermal conductivity data are provided by:

K.N. Marsh, R.A. Perkins, M.L.V. Ramires,

"Measurement and correlation of the thermal conductivity of propane from 86 K to 600 K at pressures to 70 MPa,"

J. Chem. Eng. Data 47, 932-940 (2002)

Viscosity data are provided by:

B.A. Younglove and J.F. Ely,

"Thermophysical Properties of Fluids. II Methane, Ethane, Propane, Isobutane and Normal Butane",

J. Phys. Chem. Ref. Data Vol. 16, No. 4, 1987.

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Fluid Property Information


PROPYLENE

PROPYLENE provides high accuracy thermodynamic and transport properties for propylene (C3H6, R1270, Molar mass = 42.080 g/mole) using the Fundamental Equation of State presented by Reiner Tillner-Roth, "Fundamental Equations of State", Shaker, Verlag, Aachan, 1998.  This equation of state is valid for temperatures between 100 K < T < 600 K and for pressures up to 200 MPa.  The source of the data for this formulation is:

Angus, S., Armstrong, B. and de Reuck, K.M., International Thermodynamic Tables of the Fluid State-7 Propylene, International Union of Pure and Applied Chemistry, Pergamon Press, Oxford, 1980.

Ancillary equations for vapor pressure and saturated liquid and vapor density are provided by Professor Steve Penoncello, College of Engineering, University of Idaho, Moscow, Idaho, 83844-1011

Reference State

   T=298.15 K,  P=101.325 kPa:   h=0 kJ/kg,  s=0 kJ/kg-K  in ideal gas state.  The reference state can be changed using the $Reference directive.

Transport and surface tension data were fit from the tabular data provided by: P.E. Liley and P.D. Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  The valid temperature ranges for these transport data are as follows:

gas phase viscosity: 225 K < T < 575 K

liquid phase viscosity:  100 K < T < 325 K

gas phase thermal conductivity:  200 K < T < 600 K

liquid phase thermal conductivity: 100 K < T < 360 K

Fluid Property Information


HELIUM

Helium provides thermodynamic properties for normal fluid (not superfluid) Helium using the fundamental equation of state given by Reiner Tillner-Roth,  Fundamental Equations of State, Shaker, Verlag, Aachan, 1998.  Ancillary equations are provided by R.D. McCarty and V.D. Arp, "A New Wide Range Equation of State for Helium", Advances in Cryogenic Engineering, Vol. 35, pp. 1465-1475, 1990.  The range of applicability of the thermodynamic properties is from the triple point temperature 2.1768 K to 1500 K at pressures up to 100 MPa.

Note that there is a missing plus sign before the first summation in equation (2) of the McCarty and Arp paper and the X in table 2 should be defined as (T-TC)/(T1-TC).

The values of specific enthalpy and entropy are referred to values of 0 at 298.15 K and 101.325 kPa.  The reference state can be changed using the $Reference directive.

Fluid Property Information

Range of applicability for transport function correlations at pressures up to 100 MPa

Gas-phase viscosity:  3 K to 600 K

Liquid-phase viscosity: 3 K to 5 K

Gas-phase thermal conductivity: 3 K to 600 K

Liquid-phase thermal conductivity: 3 K to 5 K

Surface tension data are from Liley and Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  The range of valid for the surface tension data is 2.2 K < T < 5.1 K.

Fluid Property Information


HYDROGEN

HYDROGEN provides high accuracy thermodynamic properties for normal hydrogen (Molar mass =2.01594 kg/kmole) using the Fundamental Equation of State, as described by:

R.T. Jacobsen, S.G. Penoncello and E.W. Lemmon

Thermodynamic Properties of Cryogenic Fluids

Plenum Press, ISBN 0-306-45522-6, 1997

The equation of state is based upon the formulation and ancillary equations from the CATS formulations provided by Steve Penoncello, University of Idaho based on original data from:  McCarty, R.D.,  Hydrogen, Technological Survey - Thermophysical Properties,  NASA SP-3089, National Aeronautics and Space Administration, 1975.

Reference State

    h = 4200 kJ/kg, s = 70.42 kJ/kg-K at 298.15 K, 101.325 kPa.  The reference state can be changed using the $Reference directive.

Range of applicability for equation of state:

  	13.95 < T <  500 K

0 < P < 40 MPa

Note that HYDROGEN provides thermodynamic properties assuming real fluid behavior.  The reference state for this formulation is NOT consistent with the enthalpy of formation reference for which specific enthalpy would be 0 at 25C.  Use H2 for ideal gas properties of hydrogen consistent with reference states used in combustion calculations.

Transport and surface tension data were fit from the tabular data provided by: P.E. Liley and P.D. Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  The valid temperature ranges for these transport data are as follows:

gas phase viscosity: 18 K < T < 500 K

liquid phase viscosity:  14 K < T < 32 K

gas phase thermal conductivity:  14 K < T < 500 K

liquid phase thermal conductivity: 14 K < T < 32 K

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Fluid Property Information


METHANE

METHANE provides thermodynamic properties using the fundamental equation of state developed by U. Setzmann and W. Wagner, "A New Equation of State and Tables of Thermodynamic Properties for Methane Covering the Range from the Melting Line to 625 K at Pressures up to 1000 MPa", J. Phys. Chem. Ref. Data, Vol. 20, No. 6, 1991.

The values of specific enthalpy and entropy are by default referred to -0.9889 kJ/kg and -0.002289 kJ/kg-K, respectively at 298.15 K and 101.3 kPa.  The reference state can be changed using the $Reference directive.

Transport properties are from B.A. Younglove and J.F. Ely, "Thermophysical Properties of Fluids. II Methane, Ethane, Propane, Isobutane and Normal Butane", J. Phys. Chem. Ref. Data Vol. 16, No. 4, 1987.

Surface tension data are from P.E. Liley and P.D. Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  The range of valid for the surface tension data is -183 C < T < -85 C.

Range of applicability for equation of state and transport functions:

  	90.7 K < T <  625 K

0 < P < 1000 MPa

Note that METHANE provides thermodynamic properties assuming real fluid behavior.   Use CH4 for ideal gas properties of methane consistent with reference states used in combustion calculations.

Fluid Property Information


ETHANE

ETHANE provides thermodynamic properties using the fundamental equation of state developed by D.G. Friend, J.F. Ely, and H. Ingham, Tables for the Thermophysical Properties of Ethane, NIST Technical Note 1346, U.S. Dept. of Commerce, Thermophysics Division, Boulder, CO 8033303-3328, January, 1993

The values of specific enthalpy and entropy are  by default referred to 392.6 kJ/kg and 7.614 kJ/kg-K, respectively at 298.15 K and 101.3 kPa.  The reference state can be changed using the $Reference directive.

Correlations for transport properties are from B.A. Younglove and J.F. Ely, "Thermophysical Properties of Fluids. II Methane, Ethane, Propane, Isobutane and Normal Butane", J. Phys. Chem. Ref. Data Vol. 16, No. 4, 1987.

Note that the following typographical errors in this paper.

Eqn. 20: exponent shoud be (4-n)/3 not (n+2)/3

Table 2:  C[8] should be +0.209661014;

Eqn 26:  the term beginning with F2 should be preceded with a plus sign

Eqn 29:  exponent should be 4-n

Eqn 30:  exponent should be 7-n

Range of applicability for equation of state and transport functions:

  	90.35 K < T <  623 K

0 < P < 69 MPa

Surface tension data are from Liley and Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  The range of valid for the surface tension data is -183 C < T < 30 C.

Note that ETHANE  provides thermodynamic properties assuming real fluid behavior.  Use C2H6 for ideal gas properties of ethane consistent with reference states used in combustion calculations.

Fluid Property Information


ETHANOL

ETHANOL  provides high accuracy thermodynamic properties for deuterium (Molar mass =46.069 kg/kmole) using the Fundamental Equation of State, as described by:

H.E. Dillion and  S.G. Penoncello

"A FUNDAMENTAL EQUATION FOR THE CALCULATION OF THE THERMODYNAMIC PROPERTIES OF ETHANOL"

Fifteenth Symposium on Thermophysical Properties, June 22-27, 2003, Boulder, Colorado, U.S.A.

Reference State

    h =108.64 kJ/kg, s = 0.569318 kJ/kg-K at 298.15 K, 101.325 kPa.  The reference state can be changed using the $Reference directive.

Range of applicability for equation of state:

  	250 K < T < 650 K

0 < P < 280 MPa

Information concerning the viscosity of liquid ethanol for temperatures between 290 K and 330 K were obtained from:

M.J. Assael adn S.K. Polimatidou

"Measurements of the Viscosity of Alcohols in the Temperature Range 290-340 K at pressure up to 30 MPa."

Int. J. of Thermophysics, VOl. 15, No. 1, 1994

Thermoconductivity for liquid ethanal for temperatures between 290 and 350 were obtained from:

M.J. Assael, E. Chritidou, and C.A. Nieto de Castro

"Absolute Measurements of the Thermal Conductivity of Alcohols by the Transient Hot-Wire Technique"

Int. J. of Thermophysics, Vol. 9, No. 5, 1988

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Transport data for gaseous ethanol are not implemented.

Fluid Property Information


ETHYLENE

ETHYLENE provides high accuracy thermodynamic and transport properties for ethylene (C2H4, R1150, Molar mass = 28.054 g/mole) using the Fundamental Equation of State developed by Reiner Tillner-Roth, "Fundamental Equations of State", Shaker, Verlag, Aachan, 1998.  This equation of state is valid for temperatures between 104 K < T < 450 K for pressures up to 260 MPa.

Reference State

   T=298.15 K,  P=101.325 kPa:   h=0 kJ/kg, s=0 kJ/kg-K.  The reference state can be changed using the $Reference directive.

Ancillary equations for vapor pressure and density of saturated liquid and vapor are from: M Jahangiri, R.T. Jacobsen, R.B. Stewart, and R.D. McCarty, "Thermodynamic Properties of Ethylene from the Freezing Line to 450 K at Pressures to 260 MPa", J. Phys. Chem. Ref. Data, Vol. 15, No. 2, 1986

Transport data were fit from the tabular data provided by: P.E. Liley and P.D. Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Note that ETHYLENE  provides thermodynamic properties assuming real fluid behavior.  Use C2H4 for ideal gas properties of ethylene consistent with reference states used in combustion calculations.

Fluid Property Information


ISOBUTANE

ISOBUTANE provides high accuracy thermodynamic and transport properties for isobutane (R600a, Molar mass =58.122 g/mol) using the Fundamental (or Helmholtz Free Energy) Equation of State formulated by:

 Miyamoto, H., and Watanabe, K.,

"A thermodynamic property model for fluid-phase isobutane,"

Int. J. Thermophys., 23(2):477-499, 2002.

The equation of state is valid for temperatures between 113.56 K (the triple point temperature) and 573 K at pressures up to 35 MPa.     The default reference state is the IIR standard for which: h=200.0 kJ/kg,   s=1.0 kJ/kg-K.  The reference state can be changed using the $Reference directive.

Thermal conductivity data are provided by:

R. Perkins, "Measurement and correlation of the thermal conductivity of isobutane from 114 K to 600 K at pressures to 70 MPa,"

J. Chem. Eng. Data 47 (2002).

Viscosity information is provided by:

B.A. Younglove and J.F. Ely,

"Thermophysical Properties of Fluids. II Methane, Ethane, Propane, Isobutane and Normal Butane",

J. Phys. Chem. Ref. Data Vol. 16, No. 4, 1987.

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

A computationally more efficient but potentially less accurate formulation for isobutane thermodynamic and transport properties may be available if file R600a.mhe is in the USERLIB folder.

Fluid Property Information


ISOPENTANE

ISOPENTANE provides high accuracy thermodynamic properties for isopentane (Molar mass =72.115 g/mole) using the Fundamental Equation of State, as described by Reiner Tillner-Roth, "Fundamental Equations of State", Shaker, Verlag, Aachan, 1998.  The correlation is based on data from:

Polt, A., Platzer, B., and Maurer, G.

"Parameter der thermischen Zustandsgleichung von Bender fuer 14 mehratomige reine Stoffe,"

Chem. Tech. (Leipzig), Volume 44, Number 6, pp. 216-224, 1992.

The parameters for the fundamental equation of state were provided by Professor Steve Penoncello, College of Engineering, University of Idaho, Moscow, Idaho, 83844-1011

Reference State

    h = 0 kJ/kg, s = 0 kJ/kg-K at 298.15 K, 1 kPa.  The reference state can be changed using the $Reference directive.

Range of applicability for equation of state:

  	273 K < T <  553 K

0 < P < 7.5 MPa

Transport properties and surface tension data are not available for this substance.

Fluid Property Information


R600a

The thermodynamic properties of refrigerant isobutane are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955) based on themodynamic information from McLinden et al., Measurement and Formulation of the Thermodynamic Properties of R134a and 123, ASHRAE Trans., Vol. 95, No.2, 1989.

R600a is NOT built into EES.  If it appear in your version, the property data were read in from file R600a.MHE in the USERLIB folder.  A much more accurate formulation for both thermodynamic and transport properties is available with fluid ISOBUTANE.  Use ISOBUTANE unless compuational speed is an issue.

Fluid Property Information


n-BUTANE or R600

N-BUTANE and R600 provide high accuracy thermodynamic and transport properties for normal butane (R600, Molar mass = 58.122 g/mol) using the Fundamental (or Helmholtz Free Energy) Equation of State described by:

 Miyamoto, H., and Watanabe, K.,

"A thermodynamic property model for fluid-phase n-butane,"

Int. J. Thermophys., 22(2):459-475, 2001.

The equation of state is valid for temperatures between 134.87 K (the triple point temperature) and 589 K at pressures up to 69 MPa.     The default reference state is the IIR standard for which: h=200.0 kJ/kg,   s=1.0 kJ/kg-K.  The reference state can be changed using the $Reference directive.

Thermal conductivity data are provided by:

R.A. Perkins, M.L.V. Ramires, C.A. Nieto de Castro, L. Cusco,

"Measurement and correlation of the thermal conductivity of butane from 135 K to 600 K at pressures to 70 MPa,"

 J. Chem. Eng. Data 47 (2002).

Viscosity information is provided by:

B.A. Younglove and J.F. Ely,

"Thermophysical Properties of Fluids. II Methane, Ethane, Propane, Isobutane and Normal Butane",

J. Phys. Chem. Ref. Data Vol. 16, No. 4, 1987.

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Note that N-BUTANE and R600 all provide thermodynamic properties assuming real fluid behavior.   Use C4H10 for ideal gas properties of normal butane consistent with reference states used in combustion calculations.

Fluid Property Information


n-PENTANE

N-PENTANE provides high accuracy thermodynamic properties for normal pentane (Molar mass =72.147 g/mole) using the Fundamental Equation of State, as described by:

R.T. Jacobsen, S.G. Penoncello and E.W. Lemmon

Thermodynamic Properties of Cryogenic Fluids

Plenum Press, ISBN 0-306-45522-6, 1997

The equation of state is based upon the formulation developed by:

Span, R.,

"Multiparameter Equations of State - An Accurate Source of Thermodynamic of Property Data," Springer, Berlin, Heidelberg, New York, (2000).  The parameters needed for this formulation were provided by Eric Lemmon at NIST, Boulder Co.

The specific heat of n-pentane in the ideal gas state is determined from

Jaeschke, M. and Schley, P.

"Ideal-Gas Thermodynamic Properties for Natural-Gas Applications"

Intl. Journal of Thermophysics, Vol. 16, No. 6, pp. 1381-1385, (1995)

Reference State

    h = 0 kJ/kg, s = 0 kJ/kg-K at 298.15 K, 101.325 kPa.  The reference state can be changed using the $Reference directive.

Range of applicability for equation of state:

  	177 K < T <  589 K

0 < P < 55 MPa

Thermoconductivity and viscosity correlations were fit to tabular data provided in:

"Properties of Inorganic and Organic Fluids"

Edited by C.Y. Ho

Authored by: P.E. Liley, T. Makita, and Y. Tanaka.

CINDAS Data Series of Material Properties, Vol V-1

Hemisphere Publishing Corporation

Chapter 26 - n-Pentane

Range of applicability for transport function correlations:

Gas-phase viscosity:  290 K to 589 K

Liquid-phase viscosity: 177K to 470 K

Gas-phase thermal conductivity: 290 K to 589K

Liquid-phase thermal conductivity: 177K to 470 K

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Fluid Property Information


n-HEPTANE

n-OCTANE provides high accuracy thermodynamic properties for normal octane (Molar mass =114.231 g/mole) using the Fundamental Equation of State, as described by:

Span, R. and Wagner, W.

"Equations of State for Technical Applications:  II Results for Non-Polar Fluids"

Int. J. of Thermophysics, Vol. 24, No. 1, Jan. 2003

The specific heat of n-octtane in the ideal gas state is determined from

Jaeschke and Schley

Ideal-Gas Thermodynamic Properties for Natural-Gas Applications

International Journal of Thermophysics, Vol. 16, No. 6, 1995, pp. 1381-1392

Reference State

    h = 0 kJ/kg, s = 0 kJ/kg-K at 298.15 K, 101.325 kPa.  The reference state can be changed using the $Reference directive.

Range of applicability for equation of state:

  	216.37 K < T <  750 K

0 < P <100 MPa

Thermoconductivity and viscosity correlations were fit to tabular data provided in:

"Properties of Inorganic and Organic Fluids"

Edited by C.Y. Ho

Authored by: P.E. Liley, T. Makita, and Y. Tanaka.

CINDAS Data Series of Material Properties, Vol V-1

Hemisphere Publishing Corporation

Chapter 25 - n-Octane

Range of applicability for transport function correlations:

Gas-phase viscosity:  250 K to 550K

Liquid-phase viscosity: 216 K to 500 K

Gas-phase thermal conductivity: 300 K to 650 K

Liquid-phase thermal conductivity: 200 K to 525 K

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Fluid Property Information


n-OCTANE

n-OCTANE provides high accuracy thermodynamic properties for normal octane (Molar mass =114.231 g/mole) using the Fundamental Equation of State, as described by:

Span, R. and Wagner, W.

"Equations of State for Technical Applications:  II Results for Non-Polar Fluids"

Int. J. of Thermophysics, Vol. 24, No. 1, Jan. 2003

The specific heat of n-octtane in the ideal gas state is determined from

Jaeschke and Schley

Ideal-Gas Thermodynamic Properties for Natural-Gas Applications

International Journal of Thermophysics, Vol. 16, No. 6, 1995, pp. 1381-1392

Reference State

    h = 0 kJ/kg, s = 0 kJ/kg-K at 298.15 K, 101.325 kPa.  The reference state can be changed using the $Reference directive.

Range of applicability for equation of state:

  	216.37 K < T <  750 K

0 < P <100 MPa

Thermoconductivity and viscosity correlations were fit to tabular data provided in:

"Properties of Inorganic and Organic Fluids"

Edited by C.Y. Ho

Authored by: P.E. Liley, T. Makita, and Y. Tanaka.

CINDAS Data Series of Material Properties, Vol V-1

Hemisphere Publishing Corporation

Chapter 25 - n-Octane

Range of applicability for transport function correlations:

Gas-phase viscosity:  250 K to 550K

Liquid-phase viscosity: 216 K to 500 K

Gas-phase thermal conductivity: 300 K to 650 K

Liquid-phase thermal conductivity: 200 K to 525 K

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Fluid Property Information


n-HEXANE

n-HEXANE provides high accuracy thermodynamic properties for normal hexane (Molar mass =86.172 g/mole) using the Fundamental Equation of State, as described by:

R.T. Jacobsen, S.G. Penoncello and E.W. Lemmon

Thermodynamic Properties of Cryogenic Fluids

Plenum Press, ISBN 0-306-45522-6, 1997

The parameters for the fundamental equation of state were provided by Professor Steve Penoncello, College of Engineering, University of Idaho, Moscow, Idaho, 83844-1011

The specific heat of n-hexane in the ideal gas state is determined from

Jaeschke, M. and Schley, P.

"Ideal-Gas Thermodynamic Properties for Natural-Gas Applications"

Intl. Journal of Thermophysics, Vol. 16, No. 6, pp. 1381-1385, (1995)

Reference State

    h = 0 kJ/kg, s = 0 kJ/kg-K at 298.15 K, 101.325 kPa.  The reference state can be changed using the $Reference directive.

Range of applicability for equation of state:

  	222 K < T <  644 K

0 < P < 55 MPa

Viscosity and thermal conductivity are by regressing values obtained from the NIST Standard Reference Database 14, National Institute of Standards and Technology, E.W. Lemmon, A.P. Peskin, M.O. McLinden, and D.G. Friend, (2000).  The ranges of applicability for transport function correlations are:

Gas-phase viscosity: 222 K to 644 K

Liquid-phase viscosity: 222 K to 502 K

Gas-phase thermal conductivity: 222 K to 644 K

Liquid-phase thermal conductivity: 222 K to 502 K

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Fluid Property Information


CYCLOHEXANE

CYCLOHEXANE provides high accuracy thermodynamic properties for cyclohexane (Molar mass =84.1608 g/mol) using the Fundamental Equation of State, as described by:

S.G. Penoncello, R.T. Jacobsen,  and A.R.H. Goodwin

"A Thermodynamic Property Formulation for Cyclohexane"

International Journal of Thermophysics, Vol. 16, No. 2, pp. 519-529, 1995

Reference State

    h = 0 kJ/kg, s = 0 kJ/kg-K for saturated liquid at the triple point temperature, 279.47 K.  The reference state can be changed using the $Reference directive.

Range of applicability for equation of state:

    279.5 K < T <  700 K

    0 < P < 80 MPa

Viscosity and thermal conductivity relations are from:

KICCHE, Korea Information Center for Chemical Engineering,  http://infosys.korea.ac.kr/

The ranges of applicability for transport function correlations are:

Gas-phase viscosity: 273.15 K to 1273.15 K

Liquid-phase viscosity: 280.15 K to 553.15 K

Gas-phase thermal conductivity: 273 K to 1070 K

Liquid-phase thermal conductivity: 267 K to 527 K

Surface tension data are provided through a correlation developed by:

Jasper, J.J., "The Surface Tension of Pure Liquid Compounds,"

J. Phys. Chem. Ref. Data, Vol. 1, No.4, pp. 841-1009, 1972.

Fluid Property Information


STEAM, STEAM_NBS, Water, R718, and Ice

Thermodynamic properties of water substance have been implemented using the thermodynamic property correlation of Harr, Gallagher, and Kell, NBS/NRC Steam Tables, Hemisphere Publishing Co., 1984. The correlations are valid up to a pressure of 815 bar.  This formulation is now slightly outdated since a more recent formulation for the properties of water substance that extends to pressures of 1000 MPa is available in substance STEAM_IAPWS.

EES will return the properties of ice at temperatures below 0°C and pressures above the saturation vapor pressure of ice based on ice property information from Hyland and Wexler, Formulations for the Thermodynamic Properties of the Saturated Phases of H2O from 173.15 K to 473.15 K, ASHRAE Trans., Part 2A, Paper 2793, 1983.  The isothermal compressibility of ice is from equation 22 of Hyland and Wexler, Formulations for the Thermodynamic Properties of Dry Air from 173.15 to 373.15 and Saturated Moist Air from 173.15 to 372.15 K at Pressure to MPa, ASHRAE Trans., Part 2A, Paper 2794, 1983.

Enthalpy and entropy values are referred to 0 for saturated liquid at 0°C.

Note that substances STEAM, STEAM_NBS, WATER, R718 and ICE all use the same correlations for water substance in the solid, liquid and vapor regions and provide exactly the same properties.  Earlier versions of EES used the less accurate correlations for substance Water, Steam, and R718.  Substance Ice has been implemented to allow preference to ice properties in the calculations when specific volume is provided as one of the inputs.  In this case, there may be two solutions.  Specifying Ice as the substance will generally force the lower temperature solution as in the following example.

T_ice=temperature(Ice,v=1.088e-3,x=0)

T_steam=temperature(Steam,v=1.088e-3,x=0)

The solution to these equations will be:

T_ice=-16.85 [C]

T_steam=147.8 [C]

The transport property correlations are from Electrical Research Association, 1967 Steam Tables, Thermodynamic Properties of Water and Steam; Viscosity of Water and Steam, Thermal Conductivity of Water and Steam, Edward Arnold Publishers, London, 1967.  The transport functions are valid for temperatures between 273.15 K and 815 K at pressures up to 830 bar.

The thermal conductivity of solid ice is provided by a correlation from:

Willard Coles, Experimental Determation of the Thermal Conductivity of Low Density Ice,  National Advisory Committee for Aeronautics, Technical Note, 3143, Lewis Flight Propulsion Laboratory, Cleveland, OH, 1954

Fluid Property Information


R32

The thermodynamic properties of refrigerant R32 are provided using the fundamental equation state described by R. Tillner-Roth and A. Yokozeki, "An International Standard Formulation for Difluoromethane (R-32) for Temperatures from the Triple Point at 136.34 K to 435 K and Pressures up to 70 MPa", J. Phys. Chem. Ref. Data, Vol. 26, No. 6, 1997.

The values of specific enthalpy and entropy are by default referred to 200 kJ/kg and 1.00 kJ/kg-K, respectively for the state of saturated liquid at 273.15 K.  The reference state can be changed using the $Reference directive.

Transport Properties:

Liquid phase viscosity and conductivity data are from the generalized correlation described by M.J. Assael, N.K. Dalaouti, A.A. Griva, and J.H. Dymond, "Viscosity and Thermal Conductivity of Halogenated Methane and Ethane Refrigerants", IJR, Vol. 22, pp. 525-535, 1999.  These property correlations are applicable over the same range as the equation of state.

Gas-phase viscosity:  190 K to 350 K

Gas-phase thermal conductivity: 190 K to 350 K

Surface tension data were fit to data obtained from the NIST REFPROP 6 program (M.O. McLinden, S.A. Klein, E.W. Lemmon and A.P. Peskin, Physical and Chemical Properties Division, National Institute of Standards and Technology, Boulder, CO 80303, 1995.  The range of applicability of the data are from 136.3 K to the 351.2 K.

Fluid Property Information


R22

Fluid R22 implements the thermodynamic properties of refrigerant R22 using the fundamental equation state described by Wagner, W., Marx, V., Prob, A., "A New Equation of State for Chlorodifluoromethane covering the entire fluid region from 116 K to 550 K at pressures up to 200 MPa, Int. J. Refrig, 16:373, 1993.

The values of specific enthalpy and entropy are, by default, referred to 200 kJ/kg and 1.00 kJ/kg-K, respectively for the state of saturated liquid at 273.15 K.  The reference state can be changed using the $Reference directive.

Transport Properties:

Liquid phase viscosity and conductivity data are from the generalized correlation described by M.J. Assael, N.K. Dalaouti, A.A. Griva, and J.H. Dymond, "Viscosity and Thermal Conductivity of Halogenated Methane and Ethane Refrigerants", IJR, Vol. 22, pp. 525-535, 1999.  These property correlations are applicable over the same range as the equation of state.

Gas-phase viscosity:  250 K to 440 K

Gas-phase thermal conductivity: 230 K to 645 K

The surface tension function has been fit to data provided by Liley and Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  It is valid for temperatures between -150 C to 90 C.

A computationally more efficient but potentially less accurate formulation for ammonia properties is available with fluid name R22_mh.

Fluid Property Information


R141B

The thermodynamic properties of refrigerant R141b are provided by Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955).

The values of specific enthalpy and entropy are referred to 0 for saturated liquid at -40 C (F)..

Range of applicability for transport function correlations:

Gas-phase viscosity:  250 K to 475 K

Liquid-phase viscosity: 250 K to 475 K

Gas-phase thermal conductivity: 250 K to 475 K

Liquid-phase thermal conductivity: 250 K to 475 K

Fluid Property Information


R407C

R407C is a blend of R32 / R125 / R134a with mass percentages of  23% / 25% / 52%. Properties for this near-azeotropic blend have been fitted to Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955) as modified for blends by Bivens and Yokozeki, 1996 Intl. Conference on Ozone Protection Technologies, Washington, DC.

Blends do not necessarily remain at constant temperature during constant pressure evaporation or condensation.  EES will return the bubble point temperature as the temperature corresponding to saturated vapor (X=0) and the dew point temprature corresponding to saturated liquid X=1) at a specified pressure.

Viscosity values are obtained from the correlation presented in Viscosity of Mixed Refrigerants R404A, R407C, R410A, and R507A,   V.Z. Geller, presented at the 8th International Refrigeration Conference at Purdue University, July 25-28, 2000,  West Lafayette, IN

Thermal conductivity values are obtained from the correlation presented in Thermal Conductivity of Mixed Refrigerants R404A, R407C, R410A, and R507A,   V.Z. Geller, B.V. Nemzer, and U.V. Cheremnykh,  presented at the 14th Symposium on Thermophysical Properties, June 25-30, 2000,   Boulder, CO

Fluid Property Information


R410A

R410A is a 50/50 mass percentage blend of R32 and R125. Properties for this near-azeotropic blend have been fitted to Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955) as modified for blends by Bivens and Yokozeki, 1996 Intl. Conference on Ozone Protection Technologies, Washington, DC and DuPont Suva 410A Technical Information T-410A-ENG.

Blends do not necessarily remain at constant temperature during constant pressure evaporation or condensation.  EES will return the bubble point temperature as the temperature corresponding to saturated vapor (X=0) and the dew point temprature corresponding to saturated liquid X=1) at a specified pressure.

Viscosity values are obtained from the correlation presented in Viscosity of Mixed Refrigerants R404A, R407C, R410A, and R507A,   V.Z. Geller, presented at the 8th International Refrigeration Conference at Purdue University, July 25-28, 2000,  West Lafayette, IN

Thermal conductivity values are obtained from the correlation presented in Thermal Conductivity of Mixed Refrigerants R404A, R407C, R410A, and R507A,   V.Z. Geller, B.V. Nemzer, and U.V. Cheremnykh,  presented at the 14th Symposium on Thermophysical Properties, June 25-30, 2000,   Boulder, CO

Fluid Property Information


R404A

R404A is a blend of R125 / R143a / R134a with mass percentages of  44% / 52% / 4%. Properties for this near-azeotropic blend have been fitted to Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955) as modified for blends by Bivens and Yokozeki, 1996 Intl. Conference on Ozone Protection Technologies, Washington, DC.

Blends do not necessarily remain at constant temperature during constant pressure evaporation or condensation.  EES will return the bubble point temperature as the temperature corresponding to saturated vapor (X=0) and the dew point temprature corresponding to saturated liquid X=1) at a specified pressure.

Viscosity values are obtained from the correlation presented in Viscosity of Mixed Refrigerants R404A, R407C, R410A, and R507A,   V.Z. Geller, presented at the 8th International Refrigeration Conference at Purdue University, July 25-28, 2000,  West Lafayette, IN

Thermal conductivity values are obtained from the correlation presented in Thermal Conductivity of Mixed Refrigerants R404A, R407C, R410A, and R507A,   V.Z. Geller, B.V. Nemzer, and U.V. Cheremnykh,  presented at the 14th Symposium on Thermophysical Properties, June 25-30, 2000,   Boulder, CO

Fluid Property Information


R507A

R507A is a blend of R125 / R143a with mass percentages of  50% / 50%. Properties for this azeotropic blend have been fitted to Martin-Hou equation of state (A.I.Ch.E. Journal, 1:142, 1955) based on data from the NIST REFPROP 6 program (M.O. McLinden, S.A. Klein, E.W. Lemmon and A.P. Peskin, Physical and Chemical Properties Division, National Institute of Standards and Technology, Boulder, CO 80303, 1995.

Viscosity values are obtained from the correlation presented in Viscosity of Mixed Refrigerants R404A, R407C, R410A, and R507A,   V.Z. Geller, presented at the 8th International Refrigeration Conference at Purdue University, July 25-28, 2000,  West Lafayette, IN

Thermal conductivity values are obtained from the correlation presented in Thermal Conductivity of Mixed Refrigerants R404A, R407C, R410A, and R507A,   V.Z. Geller, B.V. Nemzer, and U.V. Cheremnykh,  presented at the 14th Symposium on Thermophysical Properties, June 25-30, 2000,   Boulder, CO

Fluid Property Information


Argon

ARGON provides thermodynamic properties using the fundamental equation of state developed by C. Tegeler, R. Span, and W. Wagner, "Eine neue Fundamental-gleichung für das fluide Zustandsgebiet von Argon für Temperaturen von der Schmelzlinie bis 700 K und Drücke bis 1000 MPa", Fortschritt-Berichte VDI, Reihe 3: Verfahrenstechnik Nr. 480.

Viscosity and thermal conductivity data are from  B.A.Younglove and H.J.M. Hanley, J.Phys. Chem. Ref. Data, Vol. 15, No. 4, 1986.  These transport properties are applicable over the same range of conditions as for the thermodynamic properties.  However, note that enhancement of thermal conductivity in the critical point region is not included.

Surface tension data are from P.E. Liley and P.D. Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  The range of valid for the surface tension data is 90 K < T < 145 K.

Fluid Property Information.


R508B

R508B is a blend of R23 / R116 with mass percentages of  46% / 54%. Properties for this nerar-azeotropic blend have been obtained from Technical Information supplied by DuPont in Technical Information T-95-Eng, Thermodynamic Properties of SUVA 95 Refrigerant, R-508B (46/54).

Transport data for this refrigerant were obtained form DuPont Product Information ART-32, Transport Properties of SUVA 95 Refrigerant.  The transport properties in the liquid phase are applicability from 170 K to 283 K.  The vapor phase properties are applicable for temperatures between 190 K and 373 K.

Fluid Property Information


NEON

NEON provides thermodynamic properties for Neon using the fundamental equation of state described in the paper entitled "Thermodynamic Properties of Neon for Temperatures from the Triple Point to 700 K at Pressures to 700 MPa", Katti, R. Jacobsen, R.T, Stewart, R.B., and Jahangiri, M., Adv. Cyro. Eng.,  Vol 31, p. 1189, 1986

It appears that the ancillary equations provided in the above reference are in error.  Ancillary equations were fitted to the data provided in "Thermodynamic Properties of Refrigerants" by Stewart, R., Jacobsen, R., and Penoncello, S., ASHRAE, 1986, ISBN 0-910110-47-6

The values of specific enthalpy and entropy are, by default, referred to values of 0 at 298.15 K and 101.325 kPa.  The reference state can be changed using the $Reference directive.

Transport are based on the information provided in "Thermodynamic Properties of Refrigerants", P.E. Liley and P.D. Desai, ASHRAE, ISBN 1-883413-10-9, 1993.  These data are provided in the range from 25 K to 700 K for gases and from 25 K to 44 K for liquids and for surface tension.

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Fluid Property Information


Steam_IAPWS

Steam_IAPWS implements high accuracy thermodynamic properties of water substance with the 1995 Formulation for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use, issued by The International Association for the Properties of Water and Steam (IAPWS).  This correlation replaced the 1984 formulation of Haar, Gallagher, and Kell (NBS/NRC Steam Tables, Hemisphere Publishing Co., 1984) which is implemented in substance STEAM.  The new formulation is based on the correlations of Saul and Wagner (J. Phys. Chem. Ref. Data, 16, 893, 1987) with modifications to adjust to the International Temperature Scale of 1990. The modifications are described by Wagner and Pruss (J. Phys. Chem. Ref. Data, 22, 783, 1993).

This correlation provides accurate results for temperatures between 273.15 K and 1273.15 K at pressures up to 1000 MPa.  The formulation allows extrapolation of properties to 5000 K.  Steam_IAPWS is available only in the Professional version.

Water also provides steam properties, but they use less accurate correlations which require significantly less computational effort.  Use Steam or Waterfor the properties of ice at temperatures below 0 C based on ice property information from Hyland and Wexler, Formulations for the Thermodynamic Properties of the Saturated Phases of H2O from 173.15 K to 473.15 K, ASHRAE Trans., Part 2A, Paper 2793, 1983.

Enthalpy and entropy values are referred to 0 for saturated liquid at 0 C.

The thermal conductivity, viscosity, and surface tension correlations for Steam_IAPWS are from J. Kestin, J.V. Sengers, B. Kangmar-Parsi, and J.M.H. Levelt Sengers, "Thermophysical Properties of Fluid H2O," J. Phys. Chem. Ref. Data, 13, 175 (1984).  The range of applicability for these transport correlations is the same as for the thermodynamic properties.

Fluid Property Information


METHANOL

METHANOL provides high accuracy thermodynamic and transport properties for methanol (C3H3OH, Molar mass = 32.042 g/mole) using the Fundamental Equation of State developed by Reiner Tillner-Roth, "Fundamental Equations of State", Shaker, Verlag, Aachan, 1998.

The data upon which this correlation is based are from:

de Reuck, K.M. and Craven, R.J.B.,

"Methanol, International Thermodynamic Tables of the Fluid State - 12,"

IUPAC, Blackwell Scientific Publications, London, 1993.

Reference State

   The default reference state correpsonds to the Ideal gas condition at 273.15 K, 101.3 kPa;   h=0.0 kJ/kg  s=0.0 kJ/kg-K.  The reference state can be changed using the $Reference directive.

Ancillary equations for vapor pressure and density of saturated liquid and vapor are from the CATS formulation provided by Professor Steve Penoncello, College of Engineering, University of Idaho, Moscow, Idaho, 83844-1011

Range of applicability for equation of state:

  	175.61 K < T <  570 K

0 < P < 800 MPa

Transport Properties

Viscosity for liquid methanol is determined using data from "Measurements of the Viscosity of Alcohols in the Temperature range 290-350 K at Pressures up to 30 MPa", Assael, M.J. and Polimatidou, S.K.,  Int. J. of Thermophysics, Vol. 15, No. 1, 1994.

Conductivity for liquid methanol at atmopheric pressure was fit to limited data provided in "Absolute Measurements of the Thermal Conductivity of Alcohols by the Transient Hot-Wire Technique", Assael, M.J., Charitidou, E., and Nieto de Castro, C.A., Int. J. of Thermophysics, Vol. 9, No. 5, 1988.

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Fluid Property Information


RC318

RC318 provides high accuracy thermodynamic and transport properties for RC318 (octafluorocyclobutane, C4H8, MW 200.03 g/gmole) using the Fundamental Equation of State as described by Reiner Tillner-Roth, "Fundamental Equations of State", Shaker, Verlag, Aachan, 1998.  The correlation is valid fo r temperatures in the range between 233.3 K and  623 K for pressures less than 60 MPa.  The correlation is based on information from:

Platzer, B., Polt, A., and Maurer, G., "Thermophysical Properties of Refrigerants,"  Springer-Verlag, Berlin, 1990.

The parameters for the fundamental equation of state and ancillary equations were provided by Professor Steve Penoncello, College of Engineering, University of Idaho, Moscow, Idaho, 83844-1011

Transport and surface tension data were fit from the tabular data provided by: P.E. Liley and P.D. Desai, "Thermophysical Properties of Refrigerants", ASHRAE, 1993, ISBN 1-1883413-10-9.  Data on the viscosity for low pressure gases were obtained from the NIST REFPROP 6 program (M.O. McLinden, S. A. Klein, E.W. Lemmon and A.P. Peskin, Physical and Chemical Properties Division, National Institute of Standards and Technology, Boulder, CO 80303, 1995.

Fluid Property Information


Xenon

Xenon provides high accuracy thermodynamic properties for elemental xenon using the fundamental equation of state developed by O. Sifner and J. Klomfar, "Thermodynamic Properties of Xenon from the Triple Point to 800 K with Pressures up to 350 MPa," J.Phys. Chem. Ref. Data, Vol. 23, No.1, pp. 63-152, (1994).  This correlation is also presented in a more convenient form in the textbook by R.T. Jacobsen, S.G. Penoncello, and E.W. Lemmon, "Thermodynamic Properties of Cryogenic Fluids", Plenum Press, 1997, ISBN 0-306-45522-6.  The thermodynamic property correlations are valid for temperatures between triple point (161.36 K) and 800 K at pressures up to 350 MPa.

Range of applicability for transport function correlations:

Gas-phase viscosity:  120 K to 1500 K

Liquid-phase viscosity: 173.15 K

Gas-phase thermal conductivity: 200 K to 1500 K

Liquid-phase thermal conductivity: 173.15

The low pressure gas viscosity correlations was fit to data:

Vol. 3:  Thermal Conductivity, Y.S. Touloukian, P.E. Liley, S.C. Saxena

Vol. 11: Viscosity,  Y.S. Touloukian, S.C. Saxena, and P. Hestermans

IFI/Plenun, NY, 1970, ISBN 0-306067020-8

Low pressure thermal conductivity data are from Table 15.1 in

Handbook of Physical Quantities, Igor. S. Gigoriev adn Evgenii Z. Meilikhov,

ISBN 0-08493-2861-6, 1995

Liquid xenon viscosity and thermal conductivity data were found for only one temperature, T=173.15 K, at saturation in:

Heat Exchanger Design Hanbook, Vol. 5, G.Hewitt, executive editor, 1995

Surface tension data are provided through a correlation developed by:

G.R. Somayajulu

"A Generalized Equation for Surface Tension from the Triple Point to the Critical Point"

International Journal of Thermophysics, Vol. 9, No. 4, 1988

Fluid Property Information


DEUTERIUM

DEUTERIUM provides high accuracy thermodynamic properties for deuterium (Molar mass =4.0282 kg/kmole) using the Fundamental Equation of State, as described by:

R.T. Jacobsen, S.G. Penoncello and E.W. Lemmon

Thermodynamic Properties of Cryogenic Fluids

Plenum Press, ISBN 0-306-45522-6, 1997

The equation of state is based upon the formulation and ancillary equations provided in section 5.10 of the above text.

Reference State

    h = 2126.981 kJ/kg, s = 33.370 kJ/kg-K at 298.15 K, 101.325 kPa to agree with the tabular values given by Jacobsen et al.  The reference state can be changed using the $Reference directive.

Range of applicability for equation of state:

  	18.71 < T < 423K

0 < P < 320 MPa

Transport properties and surface tension data are not available for this fluid.

Fluid Property Information


SF6

SF6 provides high accuracy thermodynamic properties for sulfur hexafluoride (Molar mass =146.054 g/mole) using the Fundamental Equation of State, as described by:

Span, R. and Wagner, W.

"Equations of State for Technical Applications:  II Results for Non-Polar Fluids"

Int. J. of Thermophysics, Vol. 24, No. 1, Jan. 2003

The specific heat of SF6 in the ideal gas state uses the equation given by:

Cole, W.A. and de Reuck, K.M.

An Interim Analytic Equation of State for Sulfurhexafluoride

International Journal of Thermophysics, Vol. 11, 1990, pp. 189-199

Reference State

    h = 0 kJ/kg, s = 0 kJ/kg-K at 273.15 K, 101.325 kPa.  The reference state can be changed using the $Reference directive.

Range of applicability for equation of state:

  	222.38 K < T <  750 K

0 < P < 60 MPa

Thermoconductivity and viscosity correlations were fit to tabular data provided in:

"Handbook of Physical Preoperties of Liquids and Gases"

Natan B. Vargaftik, Yurii K. Vinogradov, and Vadim S. Yargin

3rd Augmented and Revised Edition

Begell House, Inc

Range of applicability for transport function correlations:

Gas-phase viscosity:  222 K to 750K

Liquid-phase viscosity: 222 K to 318.7 K

Gas-phase thermal conductivity: 220 K to 750 K

Liquid-phase thermal conductivity: 222 K to 318.7 K

Surface tension data are provided through a correlation developed from data provided by the NIST REFPROP 7 program.

Fluid Property Information


Glossary

Array Range Notation

Clipboard

dragging

EES File

Import File

Picture Format


Clipboard

The Clipboard is a storage location in memory which either text or graphics may be placed.  Data on the Clipboard may be exchanged between applications.


String constant

A string constant provides character information.  It is usually enclosed within single quotes as in the following example.

A$='my characters'

In some situations such as when a string constant is used to provide the name of a fluid to a thermophysical property function,  the single quotes are optional.

Notate thae EES also recognizes string variables.


Dragging the Mouse

Dragging the mouse refers to moving its position while holding the mouse button depressed.   Dragging is used in the Plot window to move text items and to move the plot itself within the Plot window.


EES File Format

EES file format is the default format in which EES saves files.  Different operating systems use different formats so that a file saved on the Macintosh in EES format cannot be read directly by the Windows version.


MetaFilePict Format
MetaFilePict

The MetaFilePict format is a standard Windows object format which allows pictures to be exchanged between applications via the Clipboard.


Array Range Notation

Array range notation is a shorthand notation to facilitate passing of array variables to internal and external Functions and Procedures.  A range of array variables can be indicated by separating the first array index value from the last index value by two decimal points.  For example, X[1..5] can be used in place of X[1], X[2], X[3], X[4], X[5] as the argument list to a function.   This shorthand notation is supported for two dimensional array variables as well, e.g., Z[2,1..3].  EES variables may be used in the index range (e.g., X[N..M]) provided that their values have been previously set in assignment statements. The notation can be used in the arguments of function calls and CALL statements, in Function and Procedure statements and in $Common directives.

Array range notation can be convenient when array variables are being used as arguments to internal and external functions.  However, the major purpose of this notation is to allow long argument lists to be passed.  A long argument list isnot possible in any other way since EES statements must be 255 or fewer characters.  A maximum of 2000 values (total for all arguments) may be passed to an internal Function or procedure using array range notation.

Array range notation can be used with variable limits, provided that the variable is previously specified.  For example, X[1..n] can be used if n is set to a value in a statement before the X[1..n] is encountered.  When Array range notation is used in the header statement of an internal Function or Procedure, a problem occurs since the value of variable, cannot possibly be known.  In this case, EES provides a default maximum dimension of 100.  If you wish to have a larger maximum, you can specifically provide a number for the maximum.  This capability is only applicable for one-dimensional arrays.  The calling program can provide any number of elements for the array provided it is less than the maximum.

The following example should help describe this new capability.

 Function SumSquares(n, A[1..n])

"Note that n is not known at this point.  EES will assume n is a MAXIMUM of 100.  If you wish to increase this maximum to a larger value, say 200, change A[1..n] to A[1..200].  The calling program can provide any number of elements for A as long as it is less than the maximum."

   S:=0

   i:=1

   repeat

      S:=S+A[i]^2

       i:=i+1

   until (i=n)

   SumSquares:=S

end

n=90

duplicate i=1,n "initialize n elements array elements"

    X[i]=i

end

SumX2=SumSquares(n, X[1..n])  "returns the sum of the squares of n array elements."

"Note than n elements in array X are passed to array A in Function SumSquares.  n must be less than or equal to the maximum number of elements for which array A is dimensioned which is 100 by default.."

AvgX=AVERAGE(X[1..n]) "AVERAGE is a new built-in function.  It can accept up to 2000 arguments."

SumX=SUM(X[1..n])  "SUM is a built-in function, but this is notation is new."

OldSumX=SUM(X[i],i=1,n)  "This is the old notation for the SUM function;  it is still supported."

MaxX=MAX(X[1..n]) "MIN and MAX functions accept a variable number of arguments."

Note that the AVERAGE function has been added as a built-in function and that the SUM function can use either the old or new notation.


Greek and Special Symbols

If the Show Subscripts and Greek Symbols option in the Preferences dialog is selected, then EES variables having Greek alphabet names will be displayed as Greek symbols.  If the variable name consists entirely of capital letters and if the upper case Greek symbol differs from the arabic letter, then the upper case Greek symbol will be displayed;  otherwise the lower case Greek symbol will be displayed. The table below indicates the conversion.

EES Variable Name  	Upper case Symbol	Lower Case Symbol

ALPHA                       	   	α	α

ΒΕΤΑ                     	   	β	β

CHI	χ	χ

DELTA	Δ	δ

EPSILON	ε	ε

PHI	Φ	φ

gamma                       	   	Γ	γ

ETA	η	η

IOTA	ι	ι

JTHETA	ϑ	ϕ

KAPPA	κ	κ

LAMBDA	Λ	λ

MU	μ	μ

NU	ν	ν

THETA	Θ	θ

RHO	ρ	ρ

SIGMA	Σ	σ

TAU	τ	τ

UPSILON	υ	υ

OMEGA	Ω	ω

XI	Ξ	ξ

PSI	Ψ	ψ

ZETA	ζ	ζ

Special Symbols

(to enter these symbols, hold the Alt key down and enter the three digits on the numeric keypad with NumLock engaged)

µ	Alt-230

±	Alt-241

÷	Alt-246

°	Alt-248

Formatting Additions to Enhance Variable Display

X_1	will display as X with a subscript 1

X_bar	will display with a bar centered above the X

X_dot   	will display with a dot centered above the X

X_ddot  will display with a double-dot centered above the X

X_hat    will display with a hat (^) centered above the X

X|star	will display as X*

X|plus	will display as X superscript+

x|o	will display as X subcript o


CSV
Comma-separated values


Import File Format

Import format is a generic ASCII format which all versions of EES on all operating systems can read and write.


Debugging Help

Problem Failed to Converge

Convergence not attained

Setting Variable Limits

Inconsistent or Ill-Defined Equation Sets


Inconsistent or Ill-Defined Equation Sets

EES users may occasionally encounter the following error messages:

or the follow warning message:

In order to see the above warning, the Display Warning Messages checkbox in the Options tab of the Preferences dialog must be selected.  (The condition number of a matrix is the ratio of the largest to the smallest eigenvalues.  A large value for the condition number may indicate that the equations represented by this matrix are singular.  The most common cause of singular equations is a redundant equation.)

These messages can result in several ways.  One cause is an ill-defined equation set.  A simple example of an ill-defined equation set is:

X+Y=26

2*X+2*Y=52

It is easy to see in this case that the first and second equations are really the same and thus there is only one equation with two unknowns.  Although this problem commonly occurs, it is rarely so easy to identify.  For example, this problem can occur when the user enters a mass or energy balance for each component in a system and then also enters an overall mass or energy balance.  Another example that produces this problem is demonstrated in the following two equations:

h=enthalpy(Steam,T=T, P=100)

T=temperature(Steam, h=h, P=100)

Although the redundancy is more difficult to identify, the above two equations are singular since there is only one relation between T and h at P=100 for steam, regardless of how it is expressed.

If EES encounters equation sets similar to those above, it may issue an error or warning.  It is also possible that EES will find what it believes to be a solution for this problem, depending on the guess values, limits, and tolerances.

In some cases, the above messages can occur when the equations are well-defined, but the guess values do not permit a solution using the numerical methods in EES.  There are several ways to deal with this situation.  The most straightforward way is to change the guess values and/or variable limits using the Variable Information command and then try to solve the equations again.  Clicking the Yes button will display the Variable Information dialog with information for just the variables that are causing the problem. Viewing the Residuals window may also be helpful to see which equations are involved and to see how EES is solving the problem.

In some cases, a simple rearrangement of the equation set to converge.  This is particularly true when the equations involve transcendal functions that have algebraic expressions as their arguments.  Consider the following example:

x = 0.004

alpha = 1e-7

y = 0.8

y = erf(x/(2*sqrt(alpha*time)))

The intent of the above equations is to determine the value of variable time.  EES will not solve this equation set with the default guess values.  However, if the equations are rearranged as follows:

x = 0.004

alpha = 1e-7

y = 0.8

y = erf(Value)

Value = x/(2*sqrt(alpha*time))

a solution will be obtained.   The substitution of a variable in place of an expression in functions such as exp, erf, ln, etc. seems to increase the ability of EES to find a solution to the equation set.


Setting Variable Limits

Some mathematical operations (such as square root, natural log, and others) can not be evaluated with a zero or negative argument, thereby causing EES to stop.  This situation can arise when the equations representing the physical situation are not properly formulated.  The situation can also arise for a correctly formulated set of equations, since the numerical algorithms in EES may attempt negative values during the iterative calculations needed to solve the equations.  You can prevent an argument from becoming negative by setting the lower limit to zero with the Variable Info command.

In some problems, the argument is an expression rather than a single variable.  For example, a log-mean temperature difference is often used in heat transfer problems.  The log-mean temperature difference may be formulated as

DELTAT=((T_h_in-T_c_in)-(T_h_out-T_c_out)) / ln((T_h_in-T_c_in)/(T_h_out-T_c_out))

where T_h_in and T_h_out are the inlet and outlet temperature of the hot stream and T_c_in and T_c_out are the corresponding temperatures for the cold stream.

Two problems commonly arise in this situation.  During the first iteration, both T_h_out and T_c_out may both have a value of 1 unless you have previously set their guess values to other values with the Variable Info command.  A division by zero situation occurs and EES stops.

Second, the iteration process may produce an itermediate result in which the T_c_out is greater than T_h_out, resulting in a negative argument for the natural log function.  To prevent this situation, you should assign a variable to the argument of the ln function and set its lower limit to zero.  Thus the log-mean temperature difference would be better formulated as:

Arg = ln((T_h_in-T_c_in)/(T_h_out-T_c_out))  {the lower limit of Arg is set to 1E-9}

DELTAT=((T_h_in-T_c_in)-(T_h_out-T_c_out)) / ln(Arg)

A similar strategy can be applied to other functions (such as the property functions) in which the range of allowable values is restricted.


Convergence not attained

The message

Convergence not obtained in attempting the solution of this equation.  Try changing the guess value and/or limits of variable abc

is displayed when EES is unable to solve a single equation having a single unknown.  Under normal circumstances, the equation is highlighted in the Equations window.  However, the equation may not be visible if the problem occurred in a library routine or in a file that was loaded with the $Include directive.  The variable that EES was trying to determine is identified in the error message.

This error is raised only when when solving one equation with one unknown.  However, other variables appearing in the equation may have been set to incorrect or unexpected values due to an error in the problem formation.

Under some circumstances, the equation is completely correct, but EES cannot find a solution because the guess value and / or limits for the variable are inappropriate.  The guess value and limits can be changed by using the Variable Info command.  Alternatively, rearranging the equation set may aid convergences as illustrated in the discussion of Inconsistent or Ill-Defined Equation Sets.

One effective way to solve a problem of this nature is to change the equation temporarily so that you provide a reasonable value for the variable that you are trying to determine.  For example, consider the following equation:

3*x^3-200*x^2-x-1=0

The guess value for x is 1 unless you set it to be something else.  EES will not solve this equation when the guess value for x is 1.0.  To determine a better guess for x, modify the equation by adding a variable called Error:

3*x^3-200*x^2-x-1=Error

Since you have introduced a new variable, it is necessary to specify a value for x.  The best alternative at this point is to create a Parametric table with variables Error and x.  Enter values for x to cover the range over which you expect x to reside.  Run the table.   Table results for -100 < x < 100 appear below.

 error	   x

-5.000E+06	-100

 -2.621E+06	-77.78

 -1.132E+06	-55.56

 -333301	-33.33

 -28796	-11.11

-20588	11.11

-111145	33.33

 -102937	55.56

201567	77.78

 999899	100

It is clear from these results that a value of x in this range which solves the equation must be between 55.56 and 77.78 since that is the location for which Error becomes zero.   Return the equation to its original condition by replacing Error with 0.  Set the guess value of x to be 60 using the Variable Info command and try to run the problem again. Now it will quickly converge to a solution of x=66.67.


Problem Failed to Converge

The following error message

appears when a solution to the equations in a block is not obtained within the number of iterations specified as the maximum in the Tolerances dialog, 250 in the example shown above.  The most common cause for this error message is improper guess values and/or limits on the variables.  If you click the Yes button, EES will display the Variable Information dialog for the variables that are in the block for which convergence was not achieved.  Changing guess values and/or limits to realistic values for these variables generally will produce a solution if the problem is properly formulated.


Windows Keys

The keyboard topics below come from Help for Windows. You can create similar keyboard topics for your application's Help. Choose from the following list to review the keys used in Windows:

Cursor Movement Keys

Dialog Box Keys

Editing Keys

Help Keys

Menu Keys

System Keys

Text Selection Keys

Window Keys


Cursor Movement Keys

Key(s)	Function

DIRECTION key	Moves the cursor left, right, up, or down in a field.

End or Ctrl+Right Arrow	Moves to the end of a field.

Home or CTRL+Left Arrow	Moves to the beginning of a field.

PAGE UP or PAGE DOWN	Moves up or down in a field, one screen at a time.


Dialog Box Keys

Key(s)	Function

TAB	Moves from field to field (left to right and top to bottom).

SHIFT+TAB	Moves from field to field in reverse order.

ALT+letter	Moves to the option or group whose underlined letter matches the one you type.

DIRECTION key	Moves from option to option within a group of options.

ENTER	Executes a command button.

Or, chooses the selected item in a list box and executes the command.

ESC	Closes a dialog box without completing the command. (Same as Cancel.)

ALT+DOWN ARROW	Opens a drop-down list box.

ALT+UP or DOWN ARROW	Selects item in a drop-down list box.

SPACEBAR	Cancels a selection in a list box.

Selects or clears a check box.

CTRL+SLASH	Selects all the items in a list box.

CTRL+BACKSLASH	Cancels all selections except the current selection.

SHIFT+ DIRECTION key	Extends selection in a text box.

SHIFT+ HOME	Extends selection to first character in a text box.

SHIFT+ END	Extends selection to last character in a text box.


Editing Keys

Key(s)	Function

Backspace	Deletes the character to the left of the cursor.

Or, deletes selected text.

Delete	Deletes the character to the right of the cursor.

Or, deletes selected text.


Help Keys

Key(s)	Function

F1	Gets Help and displays the Help Index for the application. If the Help window is already open, pressing F1 displays the "Using Windows Help" topics.


Menu Keys

Key(s)	Function

Alt	Selects the first menu on the menu bar.

Letter key	Chooses the menu, or menu item, whose underlined letter matches the one you type.

Alt+letter key	Pulls down the menu whose underlined letter matches the one you type.

LEFT or RIGHT ARROW	Moves among menus.

UP or DOWN ARROW	Moves among menu items.

Enter	Chooses the selected menu item.


System Keys

The following keys can be used from any window, regardless of the application you are using.

Key(s)	Function

Ctrl+Esc	Switches to the Task List.

Alt+Esc	Switches to the next application window or minimized icon, including full-screen programs.

Alt+TAB	Switches to the next application window, restoring applications that are running as icons.

Alt+PrtSc	Copies the entire screen to the Clipboard.

Ctrl+F4	Closes the active window.

F1	Gets Help and displays the Help Index for the application. (See Help Keys.)


Text Selection Keys

Key(s)	Function

SHIFT+LEFT or RIGHT ARROW	Selects text one character at a time to the left or right.

SHIFT+DOWN or UP	Selects one line of text up or down.

SHIFT+END	Selects text to the end of the line.

SHIFT+HOME	Selects text to the beginning of the line.

SHIFT+PAGE DOWN	Selects text down one window.

Or, cancels the selection if the next window is already selected.

SHIFT+PAGE UP	Selects text up one window.

Or, cancels the selection if the previous window is already selected.

CTRL+SHIFT+LEFT or RIGHT ARROW	Selects text to the next or previous word.

CTRL+SHIFT+UP or DOWN ARROW	Selects text to the beginning (UP ARROW) or end (DOWN ARROW) of the paragraph.

CTRL+SHIFT+END	Selects text to the end of the document.

CTRL+SHIFT+HOME	Selects text to the beginning of the document.


Window Keys

Key(s)	Function

ALT+SPACEBAR	Opens the Control menu for an application window.

ALT+Hyphen	Opens the Control menu for a document window.

Alt+F4	Closes a window.

Alt+Esc	Switches to the next application window or minimized icon, including full-screen programs.

Alt+TAB	Switches to the next application window, restoring applications that are running as icons.

Alt+ENTER	Switches a non-Windows application between running in a window and running full screen.

DIRECTION key	Moves a window when you have chosen Move from the Control menu.

Or, changes the size of a window when you have chosen Size from the Control menu.