[PATCH] gas-model: add R compressibility script

Lubomir I. Ivanov neolit123 at gmail.com
Wed Mar 9 14:07:44 PST 2016


hello,

On 9 March 2016 at 23:20, Linus Torvalds <torvalds at linux-foundation.org> wrote:
>
> NOTE! R is not entirely happy about the non-linear fit of the Helium
> curve: the fit is *so* precise that it failes the R relative-offset
> convergence criterion.  That is apparently generally a sign of
> artificial data.
>
>
> That is probably because Lubomir generated them from the linear mix of
> two polynomial fits, rather than a linear mix of the original data.  But
> maybe the original data was artificial?

that's a good observation.

the table (data set) for helium which i provided was only for
consistency with the rest of the gases.
*it is* the output of the polynomial, which i forgot to mention.

the polynomial itself is a linear mix between two polynomials formed
by fitting two different data sets.
the resulting polynomial is quite good for the fact that the helium Z
behaves almost linearly for our range of interest.

the source which wasn't consistent was the helium experimental data:
https://shareok.org/bitstream/handle/11244/2062/6614196.PDF?sequence=1

(in-document page 108).

the pressure samples differ between the two examined helium
temperatures which i've picked; for instance:

T = 323.15°K,
P = 540.204 atm, Z = 1.22738 PV/RT
P = 319.943 atm, Z = 1.13754 PV/RT
...
T =  319.943°K,
P = 534.047 atm, Z = 1.26914 PV/RT
P = 312.114 atm, Z = 1.16070 PV/RT
...

so unlike the other book, which had samples for Z at the exact same
pressures for all experimental temperatures, the experimental data
here was taken at varying pressures, for some reason, quite possibly
due to a equipment limitation - e.g. a manual sample-and-hold
technique, of sorts.

i'm not sure we can improve much on our end-result polynomial given
these inconsistencies, but even if we do it might still end up being
pretty close to what we currently have.
of course, it would have been *much* better if the first book (which
is apparently a *goto* resource) simply had the values for helium at
the exact 300°K.

i have never used R or much of Matlab, so perhaps Robert has the means
to review / test the script.

lubomir
--


More information about the subsurface mailing list