Matlab Design Decisions

In order to write grcalc, some decisions about the code design had to be made. With a database as large as the 301 database, and with data missing here and there, what is the best way to implement Gr to be as general and scalable as possible?

1. Scalability

The code should run for any number of active compounds created by start301. This meshes well with mucalc, a great calculation tool for calculation of multiple viscosities, as well as prcalc, a program to calculate Prandtl numbers.

2. Accuracy

As water and air are two of the most common substances used, these compounds should have exceedingly accurate density values. Therefore, a third degree polynomial fit to several data in BSL is employed in both cases, which will quantify density with a high degree of accuracy over a large temperature range.

If two density values exist in the database for the same compound, then grcalc will make a linear fit for interpolation. If only one value exists, grcalc will use it, but caution the user with a warning, specifying the temperature of the database density value.

3. Hassle Free Units

A user only need worry about the units of the plate distance, and the program should take care of the rest.

4. Minimal User Input

The code should require as few input variables as possible. If the command just to run grcalc requires that a user make calculations and unit conversions just to run it, then it would be easier just to use a calculator. Therefore, a user only needs to enter a plate distance, and the hot and cold plate temperatures (in either order).

All other data will be handled by grcalc. If any density data is missing from the database, grcalc will ask for it, but the user can skip this if desired by pressing [Enter].

Home