CAPE COURSE: Tabulation of values
The vapour pressure-temperature relationship for many organic substances
is reasonably well approximated by the following equation:

where P* is vapour pressure in bar or atmospheres, and T is the Kelvin
temperature. Tb is the 1bar or 1atm boiling point, also in Kelvin.
Now, for mixtures of butane and pentane, write some programs to try
out this relationship. Where Tb at 1atm for butane is 272.5K,
and for pentane it is 309.4K.
- Define a function that calculates the vapour pressure for a given
temperature and boiling point. Check the function works by calling
it at the MATLAB command prompt.
- The next objective is to write a program that calculates the
vapour pressure of pentane at
n equally spaced points between temperatures T1 and
T2, where n, T1, T2 are variables to which values
respectively of 10, 260K and 340K are assigned in your program. There
are two ways to this, you should try both of them and compare the
results:
- Firstly use a WHILE or FOR
loop for this. Calling the function that you defined above
to calculate the vapour pressure of pentane for each
temperature. Consider storing the results of each function
evaluation in a vector of increasing size each time the
loop is executed.
- Secondly create a row vector of temperatures and use the
function to create a vector of vapour pressures. See the
hint for a quick way to create a row vector.
- Select your favoured method from 2 and adapt your program to
tabulate together the vapour pressures of both butane and pentane
between their normal boiling points.
HINT
-
In MATLAB there is a quick way to create a row vector. Try the
following, which creates a vector containing values between
1 and 7 by increasing each value by the increment 2.
x = 1:2:7
1 3 5 7