[PATCHES]

Rick Walsh rickmwalsh at gmail.com
Tue Sep 1 06:25:34 PDT 2015


Robert,

On 1 September 2015 at 08:02, Robert C. Helling <helling at atdotde.de> wrote:

> Hi,
>
> here are five patches cleaning up the code mainly in the planner. Mainly,
> they redo the ceiling calculation. For VPM-B, this iterates the ceiling and
> the Boyle compensation until the reference pressure is computed at the
> ceiling.
>
> I like what you've done.  At first I was hesitant about an (other)
iterative calculation, but what you have done is neat.  The change is
clever, and I agree cleaner.

I see perhaps the greatest improvement is that it should make calculating a
decent VPM-B ceiling for a real dive one step closer.

I had go at that (prior to your patch set).  Calculating a good
first_ceiling_pressure for a real dive is actually quite simple (take the
deepest ceiling works).  Boyle's compensation is improved now.  The one
thing I couldn't think of a nice way of doing was the CVA calc.  I can't
think of a better way than working through the samples until we can
calculate first_ceiling_pressure, then iterate until a calculated plan
converges, before continuing with the ceiling for the rest of the dive.

This results in slightly different runtimes in the test dives (typically a
> minute compared to what we did previously). The last patch updates the test
> but compared to the FORTRAN code, we now fail two tests. So this is up to
> discussion.
>
> It looks like Subsurface is now more "accurate" and consistent than the
Fortran code, which is nice.  But it also looks like Subsurface is
marginally more aggressive in most cases, which is not so good.  The
Fortran code, and it's more modern but seemingly barely changed
derivations, is and for the near future will probably stay the standard
reference, and arguably the "model" incorporates this when used for real
dives.  If you spend an extra minute or two at 6 m, your body won't care
what model you used to plan your dive.

Assuming there's no mistake that needs fixing in our implementation, we
could either live with the difference, or we could introduce a slight
conservatism to our nominal case.  The following is a very basic patch that
makes us pass all the tests again.  I'm not proposing it yes, at least not
until we've worked out there isn't some other tweak that we ought to do.
But it does work.

diff --git a/deco.c b/deco.c
index 8618a7c..e21eed3 100644
--- a/deco.c
+++ b/deco.c
@@ -167,17 +167,19 @@ double bottom_he_gradient[16];
double initial_n2_gradient[16];
double initial_he_gradient[16];

+// Subsurface appears to produce marginally less conservative plans than
our benchmarks
+// Introduce 1% additional conservatism
double get_crit_radius_He()
{
       if (prefs.conservatism_level <= 4)
-               return vpmb_config.crit_radius_He *
conservatism_lvls[prefs.conservatism_level];
+               return vpmb_config.crit_radius_He *
conservatism_lvls[prefs.conservatism_level] * 1.01;
       return vpmb_config.crit_radius_He;
}

double get_crit_radius_N2()
{
       if (prefs.conservatism_level <= 4)
-               return vpmb_config.crit_radius_N2 *
conservatism_lvls[prefs.conservatism_level];
+               return vpmb_config.crit_radius_N2 *
conservatism_lvls[prefs.conservatism_level] * 1.01;
       return vpmb_config.crit_radius_N2;
}



Cheers,

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150901/3bf39661/attachment.html>


More information about the subsurface mailing list