Odd calculated deco "ripples" (was Re: RFC: color change for calculated deco)
dirk at hohndel.org
Mon Jan 14 06:53:06 PST 2013
On Jan 14, 2013, at 5:16 AM, Robert C. Helling wrote:
>> Hmm. I see the ripples and my first ideas about their origin were wrong (the guiding compartment does nothing fancy and what what goes into add_segment() does look completely normal as well, I had thought that the gas mix might jump but it does not). The ripples are still there with GFhigh=GFlow=100% i.e. plain vanilla Buehlmann, so the gradient factor stuff is not the origin either.
>> Understanding this requires more time than I have right now. But I will come back to this as soon as possible.
> so, lunch break is over, here are my results:
> The ripples seem to be related to the calling pattern of add_segment() (where the tissues are updated) in l. 1878 of profile.c vs deco_allowed_depth() (where the actual ceiling is computed).
> If I print the time j in l. 1878 of profile.c every time add_segment() is called and the pressure difference everytime the deco_allowed_depth() is called I obtain the attached file (the integers being time the floats pressures). If I just take the floats and plot them (with just line number as x-coordinate) I get the ripples. If I take the last integer before the float as x-coordinate, the ripples are gone.
That's odd. Those integers are indeed the x-coordinates that we should be plotting… I'll need to look into this to find out if there's something off going on there.
> This is as usually deco_allowed_depth is called every four seconds. But every fourth time, it takes eight seconds before it is computed again. Looking at the .xml, there is the same pattern for time differences between samples: 4,4,4,8,4,4,4,8 etc. So it seems to me as the origin of the ripples is that in the plot the sample number somehow works as the index rather than the (real)-time.
So the good news is that I built the loops correctly it seems and it's not missing add_segment() calls as I feared. The bad news is that we somehow get our x axis confused in the process.
> So far, I could not trace this further but maybe it's simpler for somebody with a better understanding of profile.c than me at the moment.
This is extremely helpful. I won't have time for this for quite a while, but if someone wants to play with it what I would do next is this:
first, single step through the code where you added the printfs and find out why there is this 4,4,4,8 pattern
then add some debugging output to plot_depth_profile() and look at the lines starting at 769. Are the X coordinates used there matching the time stamps recorded above with the deco_allowed_depth calls?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4130 bytes
Desc: not available
More information about the subsurface