Contents - Index



The UNITSYSTEM function provides information relating to the current settings in the Unit System dialog window.  The function takes one character-string argument that must be surrounded by single quote marks.  Legal arguments are 'SI', 'Eng', 'Mass', 'Molar', 'Deg', 'Rad', 'Pa', 'kPa', 'bar', 'MPa',  'psia', 'atm', 'C', 'K', 'F', 'R', 'J', 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 returns the specific heat of an ethylene-glycol solution in Btu/lbm-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}







Also see: 



Mathematical functions