Contents - Index


Equations Window

 

The Equations window operates very much like a word processor.  The equations that 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.  Many of the capabilities of the Edit menu can be accessed by pressing the right mouse button anywhere within the Equations window.  Features of the Equations window are listed below.

 

1. Blank lines may be used to make the Equations window more legible.  

 

2. Comments are enclosed in braces {comment} or within quote marks "comment" and may span multiple lines.  Single line comments can also be initiated with the // characters, as indicated in #3.  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.   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 selected text can also be highlighted with a colored background from this pop-up menu.  The color and font of the comments can be set in the Equations Display Tab of the Preferences dialog. 

 

3. Any line that begins with characters // is assumed to be a comment (starting with version 7.534).  Starting with version 9.988, // placed anywhere on a line initiates a comment that includes all characters to the right of the // (including the //) up to the end of the line.  This type of comment is not displayed in the Formatted Equations window.  In rare circumstances, the '//' within a line should not be interpreted as a comment.  Use the $Allow '//' directive at the top of the Equations window to have the '//' within a line not be interpreted as a comment.

 

4. Syntax highlighting is optional and it can be turned on/off by clicking the right-most pane in the status bar at the bottom of the Equations window.  The time required to compile equations is necessary longer when syntax highlighting is used.   

 

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

 

                        P_4=100 [bar] 

 

A comment can be embedded within a unit string by surrounding the comment with either { } or \ characters, e.g., h=100 [kJ/kg{CH4}]  The comment will be displayed with the unit but it will be ignored by the Convert function when doing unit conversions.  Curly braces { } can be entered in the Solution window, the Variable Information dialog or in the header of the Parametric and Arrays tables.

 

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

 

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

 

7. The mathematical operators used in the equations conform to the rules used in procedural languages such as FORTRAN, Pascal or C.  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

 

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

 

9. 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 or predefined constant, except within the control of the SUM, PRODUCT or DUPLICATE commands.  As a general rule, variables should not be given names that correspond to those of built-in functions (e.g., PI, SIN, ENTHALPY).   Multiple array values can be entered with the short-hand Array Range Notation, e.g., 

 

                   X[1..3]=[11,33,44] 

 

10. The Annual and Commercial EES licenses have an upper limit of 3000, and 6000 variables, respectively, in the main program.  The Professional license can have up to 12,000 variables and 24,000 for the 64-bit Professional license). Note that variables in a module are added to the variables in the main program each time the module is called.  However variables in Subprograms are contained in a separate memory space.  

 

11. 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 that 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 General Display tab of the Preferences dialog.   When word wrapping is in effect, a light-gray margin will be displayed at the left of the editor screen.  A red + symbol will be shown in the margin for lines that are a continuation of the line above.  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.

 

12. 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.  Additional compilation may be needed when syntax highlighting is in effect.  Turn off this option if compilation speed is an issue. 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.

 

13 Equations can be imported from other .EES files or from .TXT files containing ASCII characters using 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.  Note that the Macintosh version of EES is no longer available but modern Macintosh computers can run the Windows operating system.

 

14. If the Display Subscripts and Greek Symbols option in the General Display tab of 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 symbolsArray 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, X_bar, and X_tilde will place a dot, double-dot, hat (^), bar, or tilde 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.

 

15. 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.  The Professional license provides a menu item to protect the Equations window from being changed and to insert hidden hyperlinks (see #24).  

 

16. By default, a variable information palette is displayed on the right side of the Equations window, as shown below.  This palette displays the variables in use in alphabetical order and the assigned units.  Clicking the left mouse button on a variable brings up a dialog that allows the variable properties (including its units) to be altered.  Clicking the right-mouse button finds the variable in the Equations window.  See Variable Information Palette in the Equations Window for more information.

 

 

 

17. Selecting a math function, string function, or property function in the Equations window and then pressing the right mouse button will bring up a pop-up menu which offers access to the online help for the selected function as one of the options, as shown below.  

 

 

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

 

 

19. Equations can be imported or exported from/to other applications by using Cut, Copy and Paste commands in the Edit menu.  The Load Library command in the File menu and the $INCLUDE directive may also be used to import the equations from an existing file.  Equations imported with the $INCLUDE directive will not be visible in the Equations window. 

 

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

 

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

 

22.  Constants representing time may be entered in Time Format.  For example, a time of 9 hours, 30 minutes and 10 seconds may be entered as 9:30:10.  EES will internally convert this value to hours and associate units of hours with its value.  However, it is preferable to enter times using the Time function, which allows a wider range of time formats. 

 

23.  Dates may be entered in Date Format using the Date function

 

24.  Active hypertext can be entered into the Equations window as hidden or visible links.  Hyperlinks should only be entered within comments. 

 

Visible Hyperlinks

Visible hyperlinks begin with http:\\, https:\\ or file:  In addition, a hypertext link that begins with \\EES_ following by the name of an EES window is understood to be a visible link to that window.  Clicking on a link will move the focus to that location, opening another program if necessary.  A summary of the visible  links is shown below:

 

http:\\fchartsoftware.com "open the default browser and point it at the web page that follows http:" 

https:\\fchartsoftware.com "open the default browser and point it at the web page that follows https:" 

file:c:\ees32\ees_manual.pdf  "open the local file with a filename that follows file:and start the appropriate application"

 

\\EES_Solution "open the Solution window and bring it to the front"

\\EES_Format  "open the Formatted equations window and bring it to the front"

\\EES_Plot "open the Plot window and bring it to the front" 

\\EES_Parametric "open the Parametric table and bring it to the front" 

\\EES_Lookup "open the Lookup table and bring it to the front" 

\\EES_Array "open the Array table and bring it to the front" 

\\EES_Integral "open the Integral table and bring it to the front" 

\\EES_Equations  "open the Equations window and bring it to the front" 

\\EES_Diagram  "open the Diagram window and bring it to the front"

\\EES_Residual  "open the Residuals window and bring it to the front"

\\EES_Calculator "open the EES Calculator window and bring it to the front"

 

\\EES_Solve "solve the current set of equations"

\\EES_SolveTable "apply the Solve Table command in the Calculate menu"

\\EES_MinMax "apply the MinMax command in the Calculate menu"

\\EES_MinMaxTable "apply the MinMax Table command in the Calculate menu"

 

Visible hypertext links that begin with http: or https: will also be active in the Formatted Equations window provided that the Enable http links menu item in that window is checked.

 

 

Hidden Hyperlinks

Hidden hyperlinks do not display the link itself, but rather the selected text that, when clicked, will execute the link.  Hidden hyperlinks can only be added with the Professional license.  To enter a hidden hyperlink, select the text that is to be associated with the link.  Then click the right mouse button and select the Insert Link command from the popup menu.  This will bring up a dialog in which you enter the hyperlink.

 

 

Click OK.  The text that will serve to trigger the link is displayed with underline style.  Clicking on this text will launch the link.  

 

Note.  You can edit the text without launching the link by holding the Ctrl key down when selecting the text.

 

A hidden hyperlink can be removed by selecting the link and then clicking the Link button or by right-clicking the link and selecting Remove Link from the popup menu.  The link can also be removed by deleting the text associated with the link, including the spaces before and after the text.

 

25. A status bar (shown below) is provided at the bottom of the Equations window.

 

 

  Clicking the mouse in the first panel will toggle the display background color from white to black or from black to white.  Text colors are adjusted to improve readability.  More options relating to the display are provided in the Display Options tab of the Preferences dialog.

 

 The second panel shows keyboard setting (US/EU).  The US/EU setting is set by the Region and Language choice in the Windows Control Panel.  The choices affect whether the decimal part of a real number is delimited with the decimal point (US) or comma (EU) as well as other differences.  This choice can also be overwritten with the $Keyboard directive.

 

 Following panels show the position of the cursor, and settings for word wrap, Caps lock, Insert mode, unit system, warnings, unit checking, complex math mode, and syntax highlighting on/off.  Clicking on these panels in the status bar toggles their settings. 

  

 Syntax highlighting necessarily slows compilation.  Turn it off for faster processing.

 

 Note that the Warning setting in the status bar controls whether Warning Information dialog will automatically appear after calculations are completed when warning messages exist.  If the Warning setting in the status bar is set to off, any warnings that were generated can be viewed by selecting Warnings from the Windows menu

 

 

26.  Bookmarks can be placed in the Equations window to make it easy to find equations in the Equations window when there are many lines.  The Bookmarks are entered with the $Bookmark directive, e.g., entering $Bookmark Bookmark1.  After checking the equations, the bookmarks will appear at the bottom of the Search menu.