back.gif (198 bytes)up.gif (182 bytes)next.gif (196 bytes)

Tips and Tricks

Turn off error messages

There may be occasions when every cell in a large worksheet reports an error - for example, if it can't find TPX.DLL when it tries to calculate the worksheet. If you have error messages enabled, a pop-up window describing the error will appear for each error, and you must click "OK" for it to disappear. To avoid mouse burnout, turn off error messages (you'll still get in-cell error messages like #VALUE!) until you need them - for example, when you get #VALUE! or #NUM! and can't figure out why.

Moving a TPX Workbook to another PC

If you move a workbook from one PC to another, or download a workbook from the web, TPX may be installed in a different place on the destination PC than on the source PC.   In this case, when you open the workbook, Excel will ask if you want to "update external links". Answer NO to this question! Instead, select Fix Links on the TPX Tools menu. This usually works, resetting the function calls to point to TPX.XLA in the correct location.

If there still seem to be problems, try saving the workbook and re-opening it. If that doesn't work, try the Links... command on the Excel Edit menu. But almost always Fix Links is all that's required.

Running worksheets in a browser window

Depending on the configuration of your web browser, you may be able to open and run TPX workbooks posted on the web directly in your browser if you have Excel/TPX installed locally. This seems to work with Internet Explorer 4, but may not with Netscape.

In this mode with IE4, the TPX command bar is hidden and the pop-up menu is disabled, but the command bar can be made visible by selecting View / Toolbars / TPX. As always, use Fix Links on the TPX Tools menu to fix the broken external links - don't let Excel try to do it.

It is often easier, however, to download the file and then open it in Excel as usual.

Going for speed

Unfortunately, this version of TPX is not optimized for speed. Several things are done in Visual Basic code which could be done much faster in C++. This will be changed in a future version. Nevertheless, there are many things you can do to increase the speed now.

1) Specify T and v

Internally, TPX represents the state by temperature and density. If you specify any other two properties, TPX must search numerically for the temperature and density which produce the specified properties. Particularly when the search process has to consider states in the vapor dome, this can take much longer than the actual function evaluation. The whole search is avoided if you know T and v. If you are evaluating multiple properties, you can save time by first calculating T and v, and then computing the others for specified
T and v.

CAUTION: in the liquid region, the pressure depends very sensitively on volume. For liquids, if the pressure is known it is best to first calculate v as a function of P and another property. Then use this v as input to other calculations, rather than typing in an approximate numerical value for v.


2) If you are evaluating multiple properties at the same state, try to evaluate them consecutively.

Once TPX has found the (T,v) corresponding to the specified properties, for example (P, s), it saves (T, v), along with the input (P, s), and the substance name. If the inputs for the next property evaluation all match those of the previous computation of any property, it uses the saved (T,v) instead of searching over again. The problem using this feature is that Excel decides the order in which to update cells. But often things work out and it provides a significant speed up.

Function recalculation

Functions with no inputs: the unit string functions

In Excel, a function is only recalculated when its inputs change. Therefore, a function with no inputs like P_unit() will never be recalculated, even if the units are changed later. For this reason, the unit functions accept a "dummy" input parameter to force recalculation when it changes. For example, P_unit(B3) will recalculate whenever cell B3 changes. If you put '=rand()' in B3, P_unit(B3) will update whenever anything in the workbook changes, including changing units. Another solution is to use the numerical value of the property as the input parameter to the unit function. But make sure the property function recalculates!

Functions with inputs

Property functions will not necessarily recalculate when you change units, either. Sometimes you may need to change an input (say, a temperature) to force the function and all cells which reference it to recalculate.

The change(x) function

Another solution is provided by the function change(x), where x may have any data type. This function returns x, but is set up so that Excel regards it as having changed when anything in the workbook changes, even if x has not. Therefore, any function which refers to this cell will recalculate. This can be used to force property functions to recalculate when the units are changed, for example by entering the substance name in a cell as '=change("H2O") ' and then refering to this cell in the property function.

back.gif (198 bytes)up.gif (182 bytes)next.gif (196 bytes)