Retrospective gradient factors on real dives

Willem Ferguson willemferguson at zoology.up.ac.za
Sat Dec 10 06:31:03 PST 2016


On 10/12/2016 00:46, Robert Helling wrote:
> Anton,
>
>> Am 09.12.2016 um 23:40 schrieb Anton Lundin <glance at acc.umu.se 
>> <mailto:glance at acc.umu.se>>:
>>
>> I guess Willem is looking for something like the "current-GF", in the
>> mouse-over for example.
>
> that is a nice idea. Will you send a proper patch for this? What I 
> proposed in my previous mail was to come up with some sort of linear 
> fit to these values.
>
> Best
> Robert

Here is what I have been playing around with in R. There is no clear 
indication that this is the best way, it just follows the process i used 
to think about this.

Plot1, attached, is a combination of three plots, representative of the 
firstcase profile I spoke about in my previous message.
Top left represents the percentages data in profile.c dive structure. 
There are 16 lines, one for each tissue compartment, indicating the 
percentage towards the M-line for each compartment. I hope my 
interpretation is correct.
Bottom left is a graph of the maximal percentage value indicated at the 
top left, regardless of which tissue compartment contributes this 
maximal value.
Top right is a graph where all the valleys (or hollow parts) in the 
graph at bottom left has been removed and replaced with straight line 
segments to the next higher part of the graph at bottom left.
The straight red line in the top left graph is the linear least-squares 
regression through the points in the top right graph.

Plots 2, 3 and 4 are similar graphs for three other dives that differ in 
ascent profile from firstcase. Plot 2 represents the secondcase profile, 
also discussed previously.

Gradient factors obtained in this way are:
Plot1: 32/80 firstcase
Plot2: 24/53 secondcase
Plot3: 51/66 40m dive with some buoyancy issues in first part of ascent, 
including 30-second excursions into the ceiling. I thought this case 
might create complications. There are some curious patterns of 
relatively fast tissues in this graph, however that I am investigating.
Plot4: 26/62 A shallow dive to 12m with straight-forwards ascent ascent 
more or less in recreational style

Of course the question that was not addressed here is the starting point 
for calculations along the profile.
Kind regards,
willem

R script below:
a <- read.table("firstcase.dat",h=T)
a$depthm <- a$depth/1000.0
names(a)

par(mfcol=c(2,2))

plot(a$depthm,a$c1,typ="l",col="dodgerblue4",xlim=c(0,max(a$depthm)+1),ylim=c(0,100),xlab="Depth(m)",ylab="Percentage")
lines(a$depthm,a$c2,typ="l",col="dodgerblue3")
lines(a$depthm,a$c3,typ="l",col="deepskyblue1")
lines(a$depthm,a$c4,typ="l",col="darkturquoise")
lines(a$depthm,a$c5,typ="l",col="darkmagenta")
lines(a$depthm,a$c6,typ="l",col="darkorchid")
lines(a$depthm,a$c7,typ="l",col="darkorchid1")
lines(a$depthm,a$c8,typ="l",col="magenta")
lines(a$depthm,a$c9,typ="l",col="yellow")
lines(a$depthm,a$c10,typ="l",col="yellow3")
lines(a$depthm,a$c11,typ="l",col="yellowgreen")
lines(a$depthm,a$c12,typ="l",col="yellow4")
lines(a$depthm,a$c13,typ="l",col="red")
lines(a$depthm,a$c14,typ="l",col="red3")
lines(a$depthm,a$c15,typ="l",col="red4")
lines(a$depthm,a$c16,typ="l",col="black")

a$maxval <- 0
a$maxval <- 
calcMax(a$maxval,a$c1,a$c2,a$c3,a$c4,a$c5,a$c6,a$c7,a$c8,a$c9,a$c10,a$c11,a$c12,a$c13,a$c14,a$c15,a$c16)

a$maxperc <- 0
a$maxperc <- findmax(a$maxval,a$maxperc)

b <- lm(a$maxperc ~ a$depthm)
abline(coef(b)[1],coef(b)[2],col="red")

plot(a$depthm,a$maxval,col="blue",typ="l",xlim=c(0,max(a$depthm)+1),ylim=c(0,100),xlab="Depth(m)",ylab="Percentage")

plot(a$depthm,a$maxperc,col="blue",xlim=c(0,max(a$depthm)+1),ylim=c(0,100),xlab="Depth(m)",ylab="Percentage")

# GFh:
coef(b)[1]

# GFl:
coef(b)[1] + coef(b)[2]*max(a$depthm)

# Largest instantaneous GF:
max(a$maxval)



calcMax <- 
function(m,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16) {
   l <- length(a$c1)
   for (i in 1:l)
     m[i] <- max(c1[i],c2[i],c3[i],c4[i],c5[i],c6[i],c7[i],c8[i],
c9[i],c10[i],c11[i],c12[i],c13[i],c14[i],c15[i],c16[i])
   return(m)
}


findmax <- function(m,maxperc) {
   l <- length(m)
   localmax <- m[1]
   for (i in 1:l)
     if (m[i] > localmax) {
       localmax <- m[i]
       maxperc[i] <- localmax
       }
     else maxperc[i] <- NA
   return(maxperc)
   }




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20161210/82aedb2a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Plot4.jpg
Type: image/jpeg
Size: 21005 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20161210/82aedb2a/attachment-0004.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Plot3.jpg
Type: image/jpeg
Size: 26857 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20161210/82aedb2a/attachment-0005.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Plot2.jpg
Type: image/jpeg
Size: 20634 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20161210/82aedb2a/attachment-0006.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Plot1.jpg
Type: image/jpeg
Size: 35320 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20161210/82aedb2a/attachment-0007.jpg>


More information about the subsurface mailing list