This is the first release which I am going to call "stable". I will keep the syntax back-compatible with this version for all the minor upgrades of version 1
.
This version is not back-compatible with 0.1
and 0.2
, all the HE2MATH function calls have to be rewritten when you upgrade from 0.1
or 0.2
.
The distribution script: he2math_1.0.zip.
- Operating System: Windows XP; Windows 7; Windows 8. I have not tested with Windows 10 yet. Let me know if you have!
- Microsoft Office: MS Office 2007; MS Office 2010; MS Office 2013.
- Mathcad: The only supported version is Mathcad 15.
- HEPAK: any version supporting MS Excel function calls (
xla
-macro version).
Download and unpack HE2MATH
script file anywhere you can easily find it later (e.g. your Documents
folder).
IMPORTANT: this manual applies to a version 1.0
.
Add the reference to HE2MATH Mathcad file in the worksheet:
As soon as the reference is added, HE2MATH
functions can be called within the worksheet. The following are few simple examples describing the syntax of HE2MATH
.
The first example case defines the density of helium at atmospheric pressure (101325 Pa
) and ambient temperature (20 C
).
- First two lines define the pressure and temperature of helium at the point of interest. Defined variables
p.1
andt.1
could be then used as parameters of thehe2math_density
function. - Third line calls
he2math_density
function which returns the density of helium at101325 Pa
and20 C
.
- The order of inputs is as follows:
input_1_code
,input_1_value
,input_2_code
,input_2_value
. - The first and third input parameters of the function correspond to the first and second input codes as per hepak manual. Input codes can be entered as numbers or special variables starting with
property_
can be used (e.g.property_pressure
or shortenedprop_p
). - The second and forth parameters are input values describing the state of the fluid at the point of interest.
- Syntax of
he2math
scripts is similar to syntax of HEPAK for MS Excel. There are two main differences: the unit system (it's always SI, see the Units section below for detailed explanation) and the phase calculation code (since0
covers all the scenarios, it's hard-coded into the script).
- Input codes describe the properties to be entered as the second and forth parameters. In the example above,
property_pressure
input code indicates that the second parameter is pressure,property_temperature
input code indicates that the forth parameter is temperature. - Input codes can be entered as numbers,
property_pressure
andproperty_temperature
are usual Mathcad variables containing values1
and2
. - The list of possible input codes is defined by
he2math_properties
variable and can be displayed using equal sign anywhere in the worksheet.
- All the fluid properties (pressure, temperature, density, enthalpy, etc) inside of
HE2MATH
functions can be defined with units. Unitless variables are assumed to be in SI system. HE2MATH
does not verify the validity of units, i.e. replacement ofPa
withkg
would lead to the exact same result. That is becauseHE2MATH
only rescales all the units to their corresponding SI representations. Sincekg
is a standard SI unit, it is not rescaled afterHE2MATH
function call.- All the values are returned by
HE2MATH
functions with units. Returned values can be rescaled in a standard Mathcad-way by placing a unit next to the variable. - Avoid, if possible, working with unitless variables.
- The name of the function defines the property to be returned.
- All the functions start with
he2math_
and are followed by the name of the property to be calculated. - The list of the valid function names is defined by
he2math_functions
variable and can be displayed using equal sign anywhere in the worksheet.
- Calculations of fluid properties in case if they are fully defined by one variable (i.e. saturated temperature at a given pressure) could have been done using special input codes (e.g.
property_lambda_line
orproperty_saturated_liquid
) followed by any value. HEPAK constants (accessible usingheconst()
function in Excel) are not yet available. - The example below shows the calculation of temperature for saturated liquid helium at atmospheric pressure.
In order to use HE2MATH
functions within Mathcad worksheet, it is necessary to have HEPAK macro installed in MS Excel. If HEPAK is already installed (i.e. something like =hecalc("d",0,"p",101325,"T",300,1)
in excel spreadsheet returns a valid result), ignore this part.
HEPAK installation includes the only step of copying HEPAK distribution file (it is usually named HePak.xla
) to XLSTART
folder. This allows to load HEPAK plug-in automatically every time Excel is started.
Open Microsoft Office directory (usually C:\Program Files\Microsoft Office
for Windows 32-bit version and C:\Program Files (x86)\Microsoft Office
for Windows 64-bit version).
Depending from the version of MS Office installed, open the corresponding folder:
Office Version | Folder Path |
---|---|
MS Office 2007 | Office12\XLSTART |
MS Office 2010 | Office14\XLSTART |
MS Office 2013 | Office15\XLSTART |
Copy HePak.xla
file received from HEPAK distributor there.
To verify that you are done with HEPAK installation, open a new Excel document and type =hecalc("d",0,"p",101325,"T",300,1)
in any cell (or just copy-paste that).
If everything is OK you should see 0.162522
. The value shows density of helium in kg/m^3
at 101325Pa
pressure and 300K
temperature.