While on the desktop we show the error to the user, in Subsurface-mobile
it's only appended to the log; so in order to improve debuggability it
makes sense to show the full error there.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This updates the gas model to use the new virial coefficients from the R
script, and simplifies the expression a tiny bit by avoiding the
division by 1000 for the gas fractions, and replacing it with a multiply
by 0.001 at the end.
The virial coefficients for Oxygen and Nitrogen changed in the last
digits due to the use of a different tool for the least-square fitting.
That also accounts for the change in format (the coefficients are not
using scientific notation).
The coefficients for Helium changed noticeably more, since they are now
based on the new least-squares fit from the raw data.
But the actual end result does not change appreciably, the main
advantage is that now the numbers are easily reproducible.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Lubomir pointed to exactly where he got his data from, so I added that
raw Helium data to the R script, and let the least-squares fit just take
care of the interpolation between 273K and 323K.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It annoyed me that we hand-waved a bit about how the virial factors were
actually computed in the gas-model.c file, so here's an actual R script
that computes them and plots the results.
You can run it with (for example):
R --vanilla < compressibility.r
and it will generate a Rplots.pdf of the plots, and the coefficients
will be shown on stdout.
The result actually differs in insignificant ways from the values that
Lubomir computed, which is likely just due to tools. I used R, Lubomir
seems to have used
http://polynomialregression.drque.net/online.php
but the actual curve is pretty much the same.
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?
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This started out as cleaning up warnings - but it actually turned into a
matter of semantics and correctness. Which lead to changes in .h files
which will have a ton of ripple effects.
A lot more of this to come.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There was also a function not being used that could be safely removed.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>