Using modules for ideal gas and Redlich-Kwong

Attempting to use modules for ideal gas and Redlich-Kwong, providing a
(hopefully) clean way to change EOS and the respective functions as
needed. In theory, a new module is all that is needed to define a new
EOS, which seems handy.
Single file for constants and parameter data

Merged the reading of component data and definition of constants to a
single file for ease of use.
Added residual and RK thermodynamic potentials

Added residual and RK thermodynamic potentials; the latter is
calculated from the former and the corresponding ideal gas potential
Added second derivatives of residual A using R-K

Added the necessary second derivatives of residual A using R-K to
calculate the Hessian, and thus the equilibrium calculations.
Finished Hessians

Finished implementing the Hessians; the norm of the resulting Hessian
is large. This should be evaluated when the actual calculations are
performed - change of units necessary?
Scaling of units

The units of the model are scaled to (hopefully) give a better Hessian
for the N-R-iteration:

K     --> kK
Pa   --> MPa
mol  --> mol
m^3 --> m^3
J      --> kJ

Constants and parameters are scaled accordingly.
Newton-Raphson equilibrium iteration scheme

Added file containing N-R iteration scheme. Currently, this does not
give the expected results. There seems to be something wrong either
with
a) The iteration itself
b) The Hessian and/or other thermodynamic calculations
Started outer loop

Started outer loop for calculating the phase equilibrium data using
N-R-iteration at each (T,V) coordinate
Updated outer loop

Continued work on outer loop for calculating the phase equilibrium data
using N-R-iteration at each (T,V) coordinate.

The iteration scheme seems to work, but the N-R-iteration does not
converge - presumably because there is no step control. Relaxation
permits the iterations to continue longer, but does not solve the
underlying problem.

Thus:
- Step control should be implemented
- Trivial solutions should be checked
- If none of the above helps, the calculations of the Hessian and the
chemical potential should be verified
Using Julia to draw iteration grid in TikZ

Using Julia to draw iteration grid in TikZ to achieve custom for-loops
to draw up the iterations points and direction. Works a lot better than
expected, even though it is slightly time-consuming.

Julia is also used to run shell commands, so that the TikZ-picture is
automatically compiled.
Cleaning up in folder structure

Clean-up in the naming of folders
Step size adjustment etc.

Have attempted to add step-size adjustment, which helped. Depending on
the convergence criterion, results are produced.

However, the gradient is not at all zero - which it should be. This
must (!) be fixed, otherwise the whole point of the iteration does not
work.
Gradient perturbation to create numeric Hessian

Attempt at creating a numeric Hessian from a gradient perturbation. The
idea (from Tore) was quite interesting, and seems to work for some of
the elements - that is, give the same result as the analytic Hessian.

However, many of the elements are not the same - and it is not
completely clear whether this is due to actual errors in the analytic
Hessian or whether it is due to a mistake in the numeric approximation.
Error hunting in the Hessian

The whole day - give or take - has been used to hunt for errors in the
Hessian formulation. Using central differences - after tip from Tore -
only dmu/dn still holds an error.

Mu in itself seems to be correct - perturbation in the mole numbers on
A confirms. Thus the error seems to be in the derivative itself. Caught
a stupid error in the ideal gas Hessian, so it is (almost) right. Seems
to be on the same order of magnitude as Kasper and Fredrik, but no
convergence in sight...

I will have to continue the hunt tomorrow; not sure what I'll do if the
mistake cannot be found.
Numeric Hessian; struggelig with convergence

Used the day to do the following:
- Design a numeric Hessian
- Realize the important fact that deepcopy() is needed in Julia if you
intend to copy something; otherwise, you'll end up with a new reference
to the same object in memory
- Struggle with the convergence. Thought that it was good, but realized
that most solutions were trivial ones.
Checking results

The issue with the analytic Hessian is still not resolved, and I'm
still using the numeric Hessian. This seems to work satisfactory.

Units - or rather - the scaling of units seems to somehow have
introduced a problem of unknown origin. Changing back to SI units
seemed to help. It is hard to explain why this seems to be the case.
Separate Hessian testing function

Slight rewrite of the numeric Hessian calculation so that is may be
called with "ideal", "res" or "rk" flag to calculate the ideal Hessian,
residual Hessian and actual Hessian, respectively.

This is used in the hessianTesting.jl-script, which evaluates each of
the three using both analytic and numeric results - and then compares
the two.
Slight updates, new plots

Small updates to hessianTesting.jl and main.jl, and new plotting of
particular solutions. That did not turn out to be as easy as expected,
and will likely be omitted from the end report due to time constraints.
Clean-up in folder structure, added results

Clean-up in folder structure:
- Results added, being collected in a single folder
- Files that are not used are moved to sandbox
Merge branch 'EOSmodules'