[PATCH 2/2] Add initial rudimentary no-fly time calculation

Robert C. Helling helling at atdotde.de
Fri Feb 8 11:31:48 PST 2013


On Feb 8, 2013, at 7:25 PM, Linus Torvalds wrote:

> Or we could just add a helper function fit this, like so many other things.
> 
>    double surface_pressure(struct dive *dive)
>    {
>       return (dive->dc.surface_pressure.mbar ?: SURFACE_PRESSURE) /1000.0;
>    }
> 
> or something very similar.
> 
Here is a patch that adds this to your no-fly patch. 

The part that adds this in deco.c should be pushed in any case since this fixes a bug. For this

suggested-by: Linus Torvalds <torvalds at linux-foundation.org>
signed-off-by: Robert C. Helling <helling at atdotde.de>

The rest is still you no-fly patch except one change: Since now, the no-flight time increases when you increase GF_LOW (as I was expecting before), I took the liberty to set #define GF_LOW 0.75 (same as GF_HIGH), so the gradient factor is independent of the ambient pressure. I don't know if you want to push this at this point.

There is one more thing: What worries my a bit is the fact that the no-flight time seems to be determined by the slowest compartments. One of my dives with significant deco has compartment 15 dominating, another one with shorter deco has compartment 13 dominating. This might be ok, but having the boundary case being significant makes one worry if one should trust this calculation or if one should have included more, even slower compartments. In real life, the optimum in never on the edge…

In my debugging session this afternoon, I wrote some code that computes target tissue pressures. One could use that to compute the no-flight time analytically by inverting the viz

t_noflight = T_1/2 * log((tissue_pressure-ambient_pressure) / (target_tissue_pressure - ambient_pressure)/log(2)

Best
Robert
--                                                                              
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO 
Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics  
                      Scientific Coordinator                                   
                      Ludwig Maximilians Universitaet Muenchen, Dept. Physik    
print "Just another   Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339       
    stupid .sig\n";   http://www.atdotde.de 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130208/4bae1f5f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nofly2.patch
Type: application/octet-stream
Size: 6420 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130208/4bae1f5f/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130208/4bae1f5f/attachment-0001.html>


More information about the subsurface mailing list