Problem 6     Due 2/7/00

  An engineer has a table of data on
the viscosity of aqueous solutions
of glycerin.  Unfortunately, there are
rather few entries and the engineer needs
the viscosity at points intermediate to
those in the table.  Because of the rapid
change in viscosity with composition, it
is desirable to do a high order inter-
polation.  The engineer has turned to 
you for help due to your expertise in
numerical methods.  To solve the problem,
write a matlab function that does the
following:

1) Takes in the desired concentration as
a variable.

2) Determines the three closest concentrations
on either side of the selected concentration
in the viscosity table.  This is easy to do -
find the closest one by using the min(abs())
command in an intelligent manner, and pick
the two closest points on either side of it.

3) Sets up a set of linear equations for
determining the parabola passing through the
three points and solves it.

4) Uses this parabola to estimate the viscosity
at the desired concentration.

NOTE:  Because of the power law nature of
the dependence of the viscosity on 
concentration, it is useful to fit the 
viscosity to a logarithmic relationship, e.g.,

log(viscosity) = a + b * conc + c * conc^2

where a, b, and c are constants to be determined
locally by your program.


Demonstrate this function for the concentrations:

30wt%, 50wt%, 95wt%


The concentration/viscosity values to be used
are given below.

These viscosities are from the CRC, 54th ed. and
are relative to the viscosity of water at 20 deg
C.  The viscosity of pure water at that temp is
0.01002poise, where poise is the cgs measure of
viscosity.  So:


wt% glycerine   visc/visc water
        .0      1.0
        .05     1.125
        .10     1.288
        .20     1.734
        .32     2.632
        .40     3.646
        .44     4.434
        .48     5.402
        .52     6.653
        .56     8.332
        .60     10.66
        .64     13.63
        .68     18.42
        .72     27.57
        .80     59.78
        .84     84.17
        .88     147.2
        .92     383.7
        .96     778.9
        1.00    1759.6

Try reading this information in as
an array rather than defining the array
in the function itself.  That way you
can add more data points without modifying
the function.