<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 10/12/2016 00:46, Robert Helling
wrote:<br>
</div>
<blockquote
cite="mid:692DFE78-0805-4F3E-8EA8-0FF58D561767@atdotde.de"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
Anton,
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">Am 09.12.2016 um 23:40 schrieb Anton Lundin
<<a moz-do-not-send="true"
href="mailto:glance@acc.umu.se" class="">glance@acc.umu.se</a>>:</div>
<br class="Apple-interchange-newline">
<div class=""><span style="font-family: Helvetica;
font-size: 12px; font-style: normal; font-variant-caps:
normal; font-weight: normal; letter-spacing: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
float: none; display: inline !important;" class="">I
guess Willem is looking for something like the
"current-GF", in the</span><br style="font-family:
Helvetica; font-size: 12px; font-style: normal;
font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; orphans: auto; text-align:
start; text-indent: 0px; text-transform: none;
white-space: normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; orphans:
auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
float: none; display: inline !important;" class="">mouse-over
for example.</span><br style="font-family: Helvetica;
font-size: 12px; font-style: normal; font-variant-caps:
normal; font-weight: normal; letter-spacing: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"
class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">Best</div>
<div class="">Robert</div>
</blockquote>
<br>
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.<br>
<br>
Plot1, attached, is a combination of three plots, representative of
the firstcase profile I spoke about in my previous message.<br>
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.<br>
Bottom left is a graph of the maximal percentage value indicated at
the top left, regardless of which tissue compartment contributes
this maximal value.<br>
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.<br>
The straight red line in the top left graph is the linear
least-squares regression through the points in the top right graph.<br>
<br>
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.<br>
<br>
Gradient factors obtained in this way are:<br>
Plot1: 32/80 firstcase<br>
Plot2: 24/53 secondcase<br>
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.<br>
Plot4: 26/62 A shallow dive to 12m with straight-forwards ascent
ascent more or less in recreational style<br>
<br>
Of course the question that was not addressed here is the starting
point for calculations along the profile.<br>
Kind regards,<br>
willem<br>
<br>
R script below:<br>
<tt>a <- read.table("firstcase.dat",h=T)</tt><tt><br>
</tt><tt>a$depthm <- a$depth/1000.0</tt><tt><br>
</tt><tt>names(a)</tt><tt><br>
</tt><tt><br>
</tt><tt>par(mfcol=c(2,2))</tt><tt><br>
</tt><tt><br>
</tt><tt>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")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c2,typ="l",col="dodgerblue3")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c3,typ="l",col="deepskyblue1")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c4,typ="l",col="darkturquoise")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c5,typ="l",col="darkmagenta")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c6,typ="l",col="darkorchid")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c7,typ="l",col="darkorchid1")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c8,typ="l",col="magenta")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c9,typ="l",col="yellow")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c10,typ="l",col="yellow3")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c11,typ="l",col="yellowgreen")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c12,typ="l",col="yellow4")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c13,typ="l",col="red")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c14,typ="l",col="red3")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c15,typ="l",col="red4")</tt><tt><br>
</tt><tt>lines(a$depthm,a$c16,typ="l",col="black")</tt><tt><br>
</tt><tt><br>
</tt><tt>a$maxval <- 0</tt><tt><br>
</tt><tt>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)</tt><tt><br>
</tt><tt><br>
</tt><tt>a$maxperc <- 0</tt><tt><br>
</tt><tt>a$maxperc <- findmax(a$maxval,a$maxperc)</tt><tt><br>
</tt><tt><br>
</tt><tt>b <- lm(a$maxperc ~ a$depthm)</tt><tt><br>
</tt><tt>abline(coef(b)[1],coef(b)[2],col="red")</tt><tt><br>
</tt><tt><br>
</tt><tt>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")</tt><tt><br>
</tt><tt><br>
</tt><tt>plot(a$depthm,a$maxperc,col="blue",xlim=c(0,max(a$depthm)+1),ylim=c(0,100),xlab="Depth(m)",ylab="Percentage")</tt><tt><br>
</tt><tt><br>
</tt><tt># GFh:</tt><tt><br>
</tt><tt>coef(b)[1]</tt><tt><br>
</tt><tt><br>
</tt><tt># GFl:</tt><tt><br>
</tt><tt>coef(b)[1] + coef(b)[2]*max(a$depthm)</tt><tt><br>
</tt><tt><br>
</tt><tt># Largest instantaneous GF:</tt><tt><br>
</tt><tt>max(a$maxval)</tt><tt><br>
</tt><tt><br>
</tt><tt><br>
</tt><tt><br>
</tt><tt>calcMax <-
function(m,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16)
{</tt><tt><br>
</tt><tt> l <- length(a$c1)</tt><tt><br>
</tt><tt> for (i in 1:l)</tt><tt><br>
</tt><tt> m[i] <-
max(c1[i],c2[i],c3[i],c4[i],c5[i],c6[i],c7[i],c8[i],</tt><tt><br>
</tt><tt>
c9[i],c10[i],c11[i],c12[i],c13[i],c14[i],c15[i],c16[i])</tt><tt><br>
</tt><tt> return(m)</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><tt><br>
</tt><tt><br>
</tt><tt>findmax <- function(m,maxperc) {</tt><tt><br>
</tt><tt> l <- length(m)</tt><tt><br>
</tt><tt> localmax <- m[1]</tt><tt><br>
</tt><tt> for (i in 1:l)</tt><tt><br>
</tt><tt> if (m[i] > localmax) {</tt><tt><br>
</tt><tt> localmax <- m[i]</tt><tt><br>
</tt><tt> maxperc[i] <- localmax</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> else maxperc[i] <- NA</tt><tt><br>
</tt><tt> return(maxperc)</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt><br>
</tt><tt><br>
</tt><br>
</body>
</html>