Professional Documents
Culture Documents
Summary EES Manual PDF
Summary EES Manual PDF
General commands
The Options menu provides commands for setting the guess values and bounds of variables, the unit
system, default information, and program preferences. A command is also provided for displaying
information on built-in and user-supplied functions.
The Calculate menu contains the commands to check, format and solve the equation set.
The Tables menu contains commands to set up and alter the contents of the Parametric and Lookup
Tables and to do linear regression on the data in these tables. The Parametric Table, similar to a
spreadsheet, allows the equation set to be solved repeatedly while varying the values of one or more
variables. The Lookup table holds user-supplied data which can be interpolated and used in the
solution of the equation set.
The Plot menu provides commands to modify an existing plot or prepare a new plot of data in the
Parametric, Lookup, or Array tables. Curve-fitting capability is also provided.
The Convert function has the following format: Convert(From, To) where From and To are
character strings identifying the unit type such as Btu/hr-ft2-R or mph.
Comments
Raising to a power ^ or **
Multiple equations may be entered on one line if they are separated by a semi-colon ;
The order in which the equations are entered does not matter.
The position of knowns and unknowns in the equation does not matter.
General:
For example:
Solve
Optimization
Min/Max: 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.
Methods: The recursive Quadratic Approximations method is usually faster, but the Golden
Section method is more reliable. Multi-dimensional optimization may be done using either Direct
Search or a Variable Metric algorithm. The Variable Metric method, which uses numerical
derivatives, usually performs much better than the Direct Search method, but it may be confounded
if the optimum is constrained to be on a bound.
Careful selection of the bounds and the guess value(s) of the independent variables will improve
the likelihood of finding an optimum.
Min/Max Table provides the same capability as the Min/Max command, except that the
calculations will be repeated for each row in the Parametric Table.
Update Guesses replaces the guess value of each variable in the Equations window with the value
determined in the last calculation. This command is accessible after calculations have been
successfully completed.
Built-in functions
Mathematical functions
From page 91 in Manual
if (A, B, X, Y, Z)
allows conditional assignment statements.
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.
A function is a subprogram that accepts one or more inputs and returns a single result.
A procedure can return one or more results.
A module is similar to a procedure in that it can return one or more results. However, it
differs from a procedure in that it employs equalities rather than assignment statements.
Functions
At the top of the Equations Window
An assignment statement sets the variable identified on the left of the statement to the
numerical value on the right.
FUNCTION function name(argument1, argument2,)
X:=X+1 is a valid assignment statement but it obviously cannot be an equality
END
Example
The specific availability of a flowing stream, often called , is
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 Equations window. A reference to psi(T1, P1, V1, Z1) from
an equation would return the specific availability of steam in Btu/lbm for the chosen dead state.
FUNCTION psi(T, P, V, Z)
To := 530 R dead state temperature
ho := 38.05 Btu/lbm specific enthalpy at dead state conditions
so := 0.0745 Btu/lbm-R specific entropy at dead state conditions
h := enthalpy(STEAM, T=T, P=P)
s := entropy(STEAM, T=T, P=P)
g = 32.17 ft/s^2 gravitational acceleration
psi := (h-ho)- To * (s so) + (V^2 / 2 + g * Z) * Convert(ft^2/s^2, Btu/lbm)
END
Procedures
EES procedures are very much like EES functions, except that they allow multiple outputs.
At the top of the Equations Window
The format of a Procedure is:
To use the procedure, place a CALL statement anywhere within your equations. The CALL
statement appears as
...
CALL test(1,2,3 : X,Y)
...
If then else, repeat until and goto statements may be used
Example:
Example:
Function IFTest(X, Y)
If (X<Y) and (Y<>0) Then
A:=X/Y
B:=X*Y
If (X<0) Then {nested If statement}
A:=-A; B:=-B
EndIf
Else
A:=X*Y
B:=X/Y
EndIf
IFTest:=A+B
End
Example:
Function FACTORIAL(N)
F:=1
i:=1
10: i:=i+1
F:=F*i
If (i<N) Then GoTo 10
FACTORIAL:=F
End
Example:
Function Factorial(N)
F:=1
Repeat
F:=F*N
N:=N-1;
Until (N=1)
Factorial:=F
End
Modules
Example:
Library Files
EES allows files containing one or more functions, procedures or modules (subprograms) to
be saved as Library files. A Library file has a .LIB filename extension.
Advanced Features
String Variables
Examples:
A$=carbon dioxide
B$=A$
h=enthalpy(R$,T=T,P=P)
N=5
X[1]=1
DUPLICATE j=2,N
X[j]=X[j1]+j
END
X[1]=1
X[2]=X[1]+2
X[3]=X[2]+3
X[4]=X[3]+4
X[5]=X[4]+5