New Bug Reports/Feature Requests

Lubomir I. Ivanov neolit123 at gmail.com
Wed Feb 24 06:56:49 PST 2016


On 24 February 2016 at 09:18, Linus Torvalds
<torvalds at linux-foundation.org> wrote:
> On Feb 23, 2016 15:46, "Linus Torvalds" <torvalds at linux-foundation.org> wrote:
>>
>
>>  (b) air is not actually entirely compressible.
>>
>>      This is a fairly small factor at 3000psi, but it's a factor.
>> HOWEVER. The rule for cylinder sizing is that the stated cylinder size
>> is basically the "theoretical" size, not the real size.
>
> Actually, doing the math, the compressibility of air is enough to
> bring that 80 cuft down to about 78 cuft. So that may actually be the
> biggest effect.
>
> We currently approximate the gas volume as being linear below 200 bar,
> and eat that up-to-3% error.
>
> Maybe we could do better.
>
> Does somebody have curve fitting software to generate a better
> function for the air compressibility factor? From Wikipedia (staying
> at 300K, which is warm water), we have
>
>    bar    compressibility
>    ---    ---------------
>      1    0.9999
>      5    0.9987
>     10    0.9974
>     20    0.9950
>     40    0.9917
>     60    0.9901
>     80    0.9903
>    100    0.9930
>    150    1.0074
>    200    1.0326
>    250    1.0669
>    300    1.1089
>    400    1.2073
>    500    1.3163
>
> and we could probably do better than our current "linear plus
> second-order" approximation.
>
> Somebody with R (or matlab) could probably get a reasonable curve from
> the above data. With a function for the compressibility factor, we
> could improve on our current "gas_volume()" function.
>
> Of course, we could also just do it the stupid way and do the above
> table and just do linear interpolation in between entries. Sometimes
> simple and stupid is good.
>

for the given data set i found the following polynomial regressions,
which should be OK interpolants due to the fact the data set exhibits
hyperbolic behaviour. lower order polynomials are a sub-optimal fit.

cubic:
y = 1.000735463265513 - 0.00035836444041944626*x +
0.0000030114065349908*x^2 - 2.06394800305e-9*x^3

biquadractic:
y = 1.0005190612200006 - 0.00034252282640064784*x +
0.00000283611134451994*x^2 - 1.46282083898e-9*x^3 - 6.2723738e-13*x^4

quintic:
y = 1.0002556612420115 - 0.0003115084635183305*x +
0.00000227808965401253*x^2 + 1.91596422989e-9*x^3 - 8.78421542e-12*x^4
+ 6.77746e-15*x^5

(excluding higher orders for performance reasons)

if all integer values in the interval {x | 1 <= x <= 500} are known,
then a lookup table with linear interpolation for all the fractional
inputs is a pretty good solution.
this method will probably outperform any of the above polynomials and
will provide pretty good accuracy.

lubomir
--


More information about the subsurface mailing list