Can we calculate no-fly-times?

There are various recommendations how long one should not fly after surfacing from a dive. DAN has recently done a study where they did Doppler measurements on a plane and recommends an interval of 12 hours after a single dive and 24 hours after repetitive diving.

But one would think that it should be possible to use a decompression model that works well under water to compute such a time. So let’s do this in this post or at least compute a conservative estimate. To be specific, we will use the Buhlmann model. We do that calculation compartment by compartment and assume that when leaving the water, the tissue has the maximally allowed partial pressure for surfacing (i.e. this tissue was the guiding tissue for the final part of the ascent). Clearly, this is a conservative assumption. Then, according to the model

$$p_s = (p_i -a)b.$$

Here, ps is the surface pressure and a and b are the usual Bühlmann coefficients.

Then we do a surface interval (whose length we wish to determine in the end) during which the partial pressure decays exponentially:

$$p_i(t) = f_{N_2} p_s+ (p_i(0) – f_{N_2}p_s)e^{-\gamma t}$$

where f is the N2 fraction the the breathing gas (0.79 for air which we are probably breathing while waiting for the plane to board). Finally, we don’t want the cabin pressure to be less than the minimal ambient pressure that Dr. Bühlmann recommends. We want to parametrize the cabin pressure using the barometric formula which asserts (assuming constant temperature) that the pressure drops exponentially at height with decay constant that the pressure is 1/e at about hs=8500m above sea level. So, we set

$$e^{-h/hs} p_s= (p_i(t) -a)b.$$

This we can then solve for t. Actually, being conservative, we want to throw in gradient factors. Again, being conservative, we don’t further linearly extrapolate gradient factors, but will use GFhi everywhere on the surface. Plugging everything in (with the help of Mathematica and some manual massaging) we find

$$e^{\gamma t} = \frac{a GF/p_s + 1-f_{N_2} + GF(1/b -1)}{a GF/p_s – f_{N_2} +e^{-h/h_s}(1+GF(1/b-1))}.$$

Now, we have to plug in numbers. For the cabin pressure, according to Wikipedia, we will assume h=2400m for older aircrafts. The wait times (in hours) for the different compartments are then shown in this plot:

You are supposed to see a number of things:

• The waiting time depends strongly on which tissue we are dealing with. For reasonably large gradient factors, only the tissues with half-times of several hours contribute significant waiting times. Remember, for this calculation, we assumed the loading is at its maximal value when you get out of the water. For realistic sports/tec-diving scenarios (as opposed to saturation diving) that should be quite hard even on a weeklong liveaboard  with at least five dives a day. If slightly faster tissues are leading, the inferred no-fly times are much shorter, probably shorter than the queue at check-in. I looked at some data from real dive trips where people got everything out of their booked liveaboard but they got nowhere close to exciting the slow tissues. In the Subsurface planner I had to do five consecutive 2-hour dives with less than two hour surface interval to see at least some ceiling for the 239 minute compartment. In the plots, this has the blue line and leads to a no-fly time of much less than 5 hours.
• The plot ends on the left (small gradient factors) with diverging values. These divergences move to higher gradient factors when you increase the cabin pressurisation equivalent altitude (for example by assuming a loss of cabin pressure, remember this is when the oxygen masks are supposed to drop from the ceiling)

This comes about as the no-fly time becomes infinite or even complex as according to the Bühlmann-with-gradient-factors limit, your are not allowed to be at the ambient pressure at that altitude even when saturated with the nitrogen that you experience at sea level. We can compute this limiting altitude by solving
$$f_{N_2} p_s = e^{-h/h_s} p_s (GF/b-GF +1) + a GF /p_s$$
for the altitude via
$$e^{-h/h_s} = \frac{f- aGF/p_s}{GF/b -GF +1}.$$
This is shown here, the maximum altitude after waiting an infinite amount of time:

• All these calculations are for air (or nitrox underwater since all we used was the assumption that the nitrogen saturation is at the limit). In particular, in view of an earlier post (N2 vs. He, what’s the difference?) there should not be large differences.
• You could try to repeat the same argument for VPM-B but according to that model, if you followed it during the ascent, the no fly time would always be infinite: The ascent is determined such that when you surface and stay at ambient pressure, you will just create the maximum amount of free gas that is barely allowed. So going to any altitude and lowering the ambient pressure further would release more free gas than allowed, no matter how long you waited. The only way out would be to produce fewer bubbles on the earlier ascent while still in the water, then you would have some reserves to go to altitude.

What are we supposed to conclude from this? One takeaway message is waiting for the recommended 24 hours is not totally off, in particular if there is a chance that your very slow tissues have loaded a significant amount of nitrogen.

On the other hand, for realistic dives, 24 hours is likely on the very conservative side. At least from the perspective of decompression theory. From this perspective it is a total mystery to my what kind of reasoning dive computers use to determine a no-fly time.

Apart from these model considerations, DCS symptoms often enough do not show up immediately after a dive but up to several hours later. And when you are in that situation that you find yourself with DCS symptoms (even those that would have occurred irrespective of flying or not) your chances for immediate proper treatment are probably much higher if you are not confined to an aircraft above the middle of the ocean. So even from that perspective it makes sense to wait a bit more to make sure you will not need a chamber in the next few hours.

PS: If you want to play around with the formulas, here is my Mathematica notebook.

More confusion from Isobaric Counter Diffusion

After I expressed my worries about the commonly used criterium for the occurrence of Isobaric Counter Diffusion (ICD), namely a gas change in which the N2 fraction increases by more than a fifth of the drop in the He fraction, I learned (suggested by the OSTC source code, around lines 2220) about another (and much better motivated) criterium: Simply check if the leading tissue is taking up more N2 than it dumps He to the environment. That would mean that the net effect is an on-gassing of inert gases.

$$\Delta p_{He}<0,\quad \Delta p_{N_2}>0,\quad \Delta p_{He} + \Delta p_{N2} >0$$

This sounds reasonable: If this is true for the leading tissue, the decompression is ineffective as the total inert gas pressure goes up.

So I implemented it in Subsurface. Turns out, this does not trigger where you expect it. For example for a 60m dive with 20min of bottom time on 18/45, forcing a gas change to air (i.e. high N2) at 45m does not trigger it: Yes, He in the tissue goes down and N2 goes up but He is so much faster that the net effect is still off-gassing.

But for the same dive, it triggers at a different, unexpected place: At the beginning of the ascent (at 58m to 54m). How does this come about? At the end of the bottom time (and also during the start of the ascent), the leading tissue is the second (with 8min of N2 half-time). After 20min bottom time, He is almost saturated but N2 still has a way to go. Thus, at the start of the ascent, pretty much off the bottom, He starts off-gassing while for N2, the depth difference is not really noticeable, so it is still on-gassing with positive net. So there actually is counter diffusion even without a gas change!

I guess, nobody would suggest that leaving the bottom at 60m would be dangerous. But this seems to be the only place where counter diffusion actually happens!

I tend to believe more and more that this whole ICD story is either not explained at all by a diffusion model (maybe because it is only relevant in the inner ear that does not follow this simple tissue+environment model) or it is totally bogus.

So I would like to hear from you, dear readers, do you have any experiences with ICD or could you suggest a dive profile where it should be relevant?

Isobaric Counter Diffusion Criteria

I would like to hear your opinion about isobaric counter diffusion (ICD) and the criteria you apply to decide if a gas switch should be considered dangerous.

But first a bit of background to make sure we are all on the same page: ICD is the phenomenon that occurs when you switch from a mix with a lot of helium to a mix that contains less helium but more nitrogen. Then it can happen (depending on the tissue loading) that some tissue is off-gassing He but on-gassing N2, i.e. that the two inert gases move in opposite directions. And historically this is considered bad for your deco.

As the He atoms are much small than the N2 molecules the former diffuses faster than the latter so, in typical situations, in total the off-gassing should happen on a shorter timescale than the on-gassing and thus the net effect will be that the tissues inert gas loading goes down. Anyway, this effect should be covered by the usual diffusion based deco algorithm (as this is exactly what it simulates) and no additional care would need to be taken as long as the diver stays within the boundary of the deco algorithm.

There is, however, an argument due to Steve Burton that suggests to take the solubility of the gases (in typical tissue) into account to compute the absolute amount of inert gases in the body. And since that is about 5 times higher for N2 than for He, he argues that in order to have a net unloading of the absolute amount of gas one has to limit the change in N2 percentage in the breathing gas by 1/5 of the change in He percentage in the breathing gas.  And at least one technical diving school of teaching seems to have adopted this criterium.

We are currently discussing if we implement this check into Subsurface and warn the user if a gas switch violates this “rule of fifth”. I am not sure though if I buy into this line of thought. After all, everything we do in deco planning is based on partial pressures, we never consider the absolute amount of gas. It is the partial pressure that plays the role of the fugacity determining if a particle moves across the diffusion boarder (in or out of the tissue say) and the rate is proportional to the differences (this is the mantra of diffusion based decompression models). So the solubility and with it the total amount of gas should play no direct role. I wonder if this rule of fifth (as is seems it comes out of a theoretical consideration with questionable initial assumptions) has received any empirical evaluation. Note that for example it forbids to change from Tx18/45 directly to EAN50 (as He goes down by 18% of which a fifth is 3.6% while the N2 fraction increases by 13 percentage points, much more than 3.6) even though I understand this is rather commonly done.

There is another ICD theory investigated by Doolette and Mitchell that focusses on inner ear DCS. They argue that in the inner ear the common diffusion model assumptions are violated since there is a relatively large amount of inner ear liquid that is not in direct (diffusive) contact with them ambient pressure (blood in practice) but only indirectly via inner ear tissue. So all off-gassing of the liquid goes first into the tissue. So what happens in an ICD caused inner ear DCS accident is that while that tissue is already on-gassing N2 from the environment (=blood) it is still receiving the He that comes out of the liquid and therefore experiences an over all uptake in inert gas which eventually causes DCS.

But i have not seen any hard “you should avoid doing the following” criterion that is derived from this line of thought beyond a general “shouldn’t really be a problem when using a CCR and otherwise be careful and always maximise the O2 fraction within the boundaries set by MOD”.

So, for the deeper trimix divers here: How do you decide which gas switches are ok and do you want your dive planning software to warn you about those.

PS: A last warning: It makes no sense to think about ICD in a way like “stuff moves in different directions, so the in-moving particles clog the out-going ones” as this little thought experiment shows: There are two stable nitrogen isotopes N-14 and N-15 (the former much more common in nature) that are chemically not distinguishable (only for example in a mass spectrometer). Image you are breathing a nitro mix with only N-14. Then you switch to the same mix but with all the N-14 replaced by N-15. Then there will be a counter diffusion of N-14 vs N-15. But of course, since both are chemically equivalent there are absolutely zero physiological consequences even, so the argument that the in-moving N-15 clogs up the out-moving N-14 cannot hold (and so it cannot hold in the case above).

VPM-B for real dives (or not)

The VPM-B model (of which I have described my understanding in previous posts) has a “derivation” in terms of bubble physics which I, as readers should have noticed, have some trouble to follow through completely as it is, to say the least, ad hoc and sketchy in places. I bet, only based on this derivation in prose plus formulas, nobody would be able to write a program to compute a VPM-B deco plan.

But we are lucky: There is a reference implementation in terms of a FORTRAN program. So, even though the VPM-B code in Subsurface is a complete rewrite (and solves many things algorithmically differently than the original code), we did a lot of testing to make sure that the plans we produce are identical to the plans computed using the FORTRAN program, even in places where we thought it makes little sense (like starting the ascent to the next stop when the ceiling depth equals the depth of the next stop rather than starting a bit earlier and making sure never to violate the ceiling during the ascent to the next stop (which is different since the ceiling goes up during the time it takes to get to the next stop). The latter is, at least to me, better motivated physically (“simply never violate the ceiling”) than basing the stop time on what happens at a different depth (namely the next stop depth) and we use the latter when computing Bühlmann schedules. But for VPM-B, we thought, given that we do not really understand the physics, we should not modify the model based on physics.

I have talked in the past about the Bühlmann model not being well defined to make all implementations come up with identical plans. In a sense, we are in a better situation with VPM-B, since there is the FORTRAN program which (at least for us) defines the model. But the problem is: This definition works only for the situation that you can compute with the FORTRAN program: You specify the bottom part of the dive and then let the program work out the ascent. Strictly speaking there is no definition for real dives: Dives where the distinction between bottom part and deco is blurred. But this is exactly what you have if you were to implement it in a dive computer or, as for Subsurface: Implement it in a dive log to show a ceiling for a logged dive (after all, Subsurface is mainly a divelog). For real dives, you cannot tell the exact point where bottom time ends and deco begins.

Unfortunately, the model depends on this: As explained in the VPM-B derivation post, one parameter that goes into the computation is the total deco time $$t_D$$ (clearly that ends when you reach the surface, but where does it start?) but there are other parameters that you are supposed to evaluate at the beginning of the ascent like $$p_{1st ceiling}$$ and the initial gradient for the Boyle compensation. All this depends on the time you call the end of bottom time and thus the computed ceilings also depend on that.

For Subsurface, we decided to take the point of time with the deepest ceiling (which, strictly speaking, is a circular definition but in practice is irrelevant) as the end of bottom time and base the ceiling computation in logbook mode on that. But that, to some degree, is arbitrary. And even for dives that we planned using VPM-B (and thus agree with the schedules computed by the FORTRAN program), applying this logic yields a slightly different ceiling. So it can appear that a VPM-B planned dive violates the VPM-B ceiling. But this is only due to the fact that the model is not really defined outside the planning situation.

Or put differently: You need to make arbitrary assumptions (not based on the depth profile and the gas you are breathing) to come up with a VPM-B ceiling. Which, at least for me, doesn’t strengthen my believe into this model.

PS: I am planning to be at the Boot dive show in Düsseldorf on Friday January 26th. If you happen to be there as well, please let me know and we can shake hands!

DIY on the fly

With the new version of Subsurface out today, I would like to point to a feature that was already there in 4.7.4, but which just got more usable: Computing deco variations in the planner.

This is motivated by the discussions about Ratio Deco and Deco On The Fly, for a discussion see this post by Rick. These approaches to computing deco are not really attempting to model anything that is supposed to go on in the diver’s body but simply to take a very pragmatic approach and interpolate deco schedules from known ones. If you like, they are (or attempt to be) mnemonics to learn deco plans by heart. The idea is simply that you memorise a reference plan and also how you have to modify deco if you modify the bottom part of your dive.

With Subsurface, you can now do exactly this: You can take any dive that you planned in the planner as reference dive and it will tell you how your total deco time depends on the bottom part. Take for example this trimix dive to 60m with 30min bottom time:

The runtime table says

The important line is the second:

Runtime: 118min, Stop times: + 3:05 /m + 3:59 /min

This tells you how to adjust the total deco time when changing the bottom time (the segment at 30m): For each meter that you go deeper, you have to add about three minutes (for example if you went to 63m for half an hour, you would have to add about 9 minutes or if you only went to 58m you could shorten your deco by 6 minutes). Similarly, if you change the bottom time you have to pay every extra minute on the bottom by about four minutes in deco.

It does not tell you how to distribute this time over the different stops but a good rule of thumb would be to do it roughly proportional to the time you already spend at the stops. So for example, of the about 90min of total deco time you spend roughly half at 6m,  you would also add half of the extra time at this last stop.

These numbers are supposed to be something like the partial derivative of the total deco time with respect to depth and duration of the bottom time element (actually: the last manually entered part of the dive). You are supposed to multiply these derivative with the actual variation of the bottom segment that you do.

How do we compute these numbers? When this calculation is enabled, Subsurface actually computes five extra plans: It first computes the original plan, but now with second resolution of the stops instead of minute resolution. Then it shortens the bottom segment by one minute and computes the plan (again to seconds) and then computes a plan for a bottom time extended by one minute. Then it computes to more plans for one meter shallower and one meter deeper.

This give us two time differences both for depth and duration variations. What is displayed is the average of those. But a bit of experimentation shows that the difference is typically only a few seconds (and what are seconds for 90min deco?). This is also a measure how good this linear approximation is (as this the quadratic correction): It gives me confidence to say this approximation isn’t too bad for a few minutes or a few meters.

So having these two numbers also on the runtime table should give the diver much more confidence in how to react to unforeseen changes of plan (both shallower and deeper and shorter and longer). But of course, always remember: Plan the dive, dive the wreck, wreck the plan!

CCR Schreiner Equation

Since there was a question on Scuba Board about how to compute the tissue pressures when diving a CCR (i.e painting constant partial pressure of oxygen) when chasing depth at a constant rate. When putting this on a computer I would say doing it for small time steps and pretending to be at constant depth for that short amount of time doesn’t do much wrong and you will end up doing this anyway (at least that’s what we do in Subsurface). But for the fun of it, let’s work out the analytic solution.

Let’s start by figuring out the inert gas ambient pressure at a given depth. We call $$p_d$$ the diluent partial pressure, $$p_{O2}$$ the partial pressure supplied from the oxygen cylinder (note that this is not the oxygen partial pressure since there is going to be some oxygen in the diluent as well), $$d$$ is the depth, $$f_{O2}$$ is the fraction of oxygen in the diluent while $$f_i$$ is the fraction of the inert gas we are computing in the diluent.

There are two obvious equations: The ambient pressure is equal to the diluent pressure plus the oxygen pressure in the loop:

$$p_d + p_{O2} = p_a = p_{surf} + dg\rho$$

Here, $$p_{surf}$$ is the surface pressure, and $$\rho$$ is the density of water and thus $$g\rho$$ the conversion factor between depth and pressure. The second equation says that the total partial pressure of oxygen (from diluent and oxygen cylinder combined) has to equal the set point pressure $$p_s$$:

$$f_{O2} p_d + P_{O2} = p_s.$$

We can subtract both equations to eliminate $$p_{O2}$$ and find

$$p_d = \frac{p_{surf} + g\rho d -p_s}{1-f_{O2}}.$$

This goes into the usual diffusion equation for the inert gas loading in the tissue $$p_t$$ that we are ultimately interested in:

$$\dot p_t = -\gamma( p_t -f_i p_d).$$

$$\gamma$$ is the usual diffusion constant that is related to the inverse of the tissue half-time by a factor of $$\ln(2)$$. Finally, we want the depth to change linearly in time, so $$d=d_0+vt$$ where my sign convention is that $$v$$ is the descend velocity, make it negative for ascends.

So we have to solve a linear inhomogeneous ODE with constant coefficients which we could tackle by “varying the constants”, but of course we are lazy and let Mathematica do the job. After a bit of massaging, we find

$$p_t = \frac{f_i}{1-f_{O2}} \left( e^{-\gamma t} -1\right) \left( p_s + \frac{vg\rho}\gamma\right) + e^{-\gamma t}\left( p_0 – \frac{f_i}{1-f_{O2}} (p_{surf} + d_0g\rho)\right) + \frac{f_i}{1-f_{O2}}(p_{surf} + dg\rho)$$

where $$p_0$$ is the initial tissue loading. So, here you go this is the CCR Schreiner equation. Or, if you want to follow the tradition to attaching names to simple solutions of ODEs, I allow you to call it the Helling equation.

We moved

Finally,  The Theoretical Diver is on its own domain thetheoreticaldiver.org . I had intended this move for a long time but it became necessary as the ancient WordPress instance had uninvited visitors (don’t get me started on why it was impossible to update that beyond mentioning that the OS version of the host of that blog required me to run a very old Debian release which came with an old PHP version which only allowed a WordPress version from about the time when my grandma went to elementary school).

So here we are now. And since WordPress does not really like to be moved to a new domain (yes, they store absolute paths in their database, no clue why) and backing up the old was also difficult given how old the WP version was (which excluded most plug-ins) I moved all posts essentially bu cut&paste. I tried to update all the links as well. But please let me know if you find something outdated.

What I couldn’t move are the comments. Which is a pity.

So, once more, welcome to the new site! I hope you feel at home.

When real gas corrections matter

We have all learned that most of the time the ideal gas law (maybe in its isothermal version known as Boyle-Mariotte law) is sufficiently accurate to calculate the amount of gas in cylinders. At least as long as we restrict to pressures not exceeding about 200bar (and of course we all know it’s a beginner’s mistake to assume 300 bar cylinders give you a 50% advantage in gas carried with respect to 200 bar cylinders even forgetting the problems of actually getting those filled to nominal pressure or attempting to mix in at those pressures).

But let’s look at this a bit more quantitatively: You can parametrize the error of the ideal gas law by a “compressibility factor” Z so that it becomes

$$pV = ZnRT$$

and then tabulate Z as for example done here. In the table for a realistic temperature of 300K you read off 1.0326 at 200 bar while only 1.0074 at 150 bar. So, at 200 bar, you overestimate the amount of gas in your cylinder by 3% or put differently, the amount of gas is that of an ideal gas but only at (1-3%) 200 bar = 194 bar while the amount calculated at 150bar is almost correct.

What is 3% amongst friends I hear you complain, that is likely less than the accuracy of your pressure gauge. That is of course correct but lets see how this relative error multiplies as soon as you take differences: Let’s say you want to compute your surface air consumption (SAC) for a dive in which you breath your cylinder down from 200 bar to 150 bar. Wrongly assuming the ideal gas law to hold lets you compute the amount of gas to be 50 bar times the volume of your cylinders. But as we saw, due to the compressibility factor, we should rather use 194 bar – 150 bar which is only 44 bar. Compared to the 50 bar of the ideal gas, we now have a 12% error, something that I would already consider significant. In particular when I use this value to extrapolate the gas use to other dives.

We see that suddenly the relative error multiplied by a factor of four and for the momentary gas use one needs to look at $$\partial Z/\partial p$$ as well.

The upshot is that even for 200 bar one should better use a real gas replacement to the ideal gas law. Anybody who had been in an undergraduate physics class would now probably go to van der Waal equation but as it turns out for typical diving gases in the commonly used pressure ranges that gets 1-Z rather poorly. So for Subsurface we had to use a more ad hoc approximation. But that is the topic of a future post.

N2 vs. He, what’s the difference?

Recently, a blog post on the Shearwater blog was pointed out to me (thanks Jan) that reports on a paper by David Doolette  etal and the Navy Experimental Diving Unit comparing the same 200ft dive with 40min bottom time both on a CCR rebreather once with  trimix 12/44 as diluent and once with 12/88 (i.e. heliox) as diluent. Divers followed a deco plan computed for trimix and the traditional wisdom would have been that a fraction of the heliox divers would get bent thanks to an increased amount of helium in their body. But the study found that this is not the case and only some of the test divers breathing trimix were getting bent.

Here is the dive replanned in Subsurface. One would need gradient factors 110/36 (low/high, note the order!) to come up with this plan, but ok, fine. Notice the unusual pattern on the heat-map.

The upshot apparently is that traditionally one was overestimating the penalty for using lots of helium in short bounce dives (from the perspective of the navy). Helium atoms being much smaller than nitrogen molecules are believed to diffuse much faster into the body and thus prompting deeper stops.

Obviously, this cannot be the whole argument since faster diffusion would also lead to faster desaturation, so here is a post to look a bit deeper into the differences between nitrogen, helium and trimix from the deco perspective. Since this is easiest to understand in its consequences, let us discuss these matters from the perspective of the good old Bühlmann model.

I think it is indeed not controversial that smaller particles diffuse faster but that alone should make zero difference! This might sound surprising but let’s look at Bühlmann’s list of half-times (these are essentially inverses of the diffusion constants). Those are for nitrogen (in minutes):

const double buehlmann_N2_t_halflife[] = { 5.0, 8.0, 12.5, 18.5, 27.0, 38.3, 54.3, 77.0, 109.0, 146.0, 187.0, 239.0, 305.0, 390.0, 498.0, 635.0 };

const double buehlmann_He_t_halflife[] = { 1.88, 3.02, 4.72, 6.99, 10.21, 14.48, 20.53, 29.11, 41.20, 55.19, 70.69, 90.34, 115.29, 147.42, 188.24, 240.03 };

Obviously, there is a difference. But how did he measure those? The answer is: He didn’t. You can come up with those (starting from N2) only by theoretical reasoning. You assume that the relevant physics is diffusion. And that has only one parameter, the diffusion constant or half-time. And that you don’t know a priori. But you can imagine that you only need to look at processes at time scales compared to those encountered during a dive. And there, pressure changes at the order of a few minutes and the total dive length which is a few hours. So anything in between will be relevant. And this is what gives you those numbers! They vary from five minutes to 10.5 hours. Ideally you want to cover the whole range of in-between numbers but of course you can do this only for a finite number of values (here taken to be 16) which you then evenly spread in the interval. Where evenly means that consecutive ones differ by the same percentage (rather than absolute value), i.e. they form a geometric progression. And, guess what, they do.

Obviously, there is a bit of arbitrariness in this procedure, in particular in picking the smallest and the largest value and in the number of intermediate steps. But as long as the slowest or fastest compartment are not the leading compartment for a larger part of the deco and the gaps between adjacent tissue half-times are not too big, those choices should not really matter.

But this means that what seems to be the biggest difference between nitrogen and helium, the difference in half-times is really no difference at all! It only means, we parametrize the range of possible diffusion constants differently. Yes, compartment number four has a different half-time for N2 (18.5min) than for  He (7min) but there are compartments six and seven (half-times 14.48min and 20.53min) which would cover the same time range. (Note that thanks to the diffusion equation, the tissue loading after time is the Laplace transform of the ambient pressure and according to the structural similarity between Laplace and Fourier transform, the half-time plays the role of a frequency, so a tissue gets particularly excited if the ambient pressure changes at the same time scale which is like exciting on oscillator with its resonant frequency).

Keep in mind that “the tissue” does not really correspond to a certain part of the human body like muscles being modeled by compartment x and bones by compartment y (even though some layman’s explanations make you believe that), rather the range of tissues models the range of diffusion constants and our ignorance about the time constants that might play a role in a complex system like that of a diver during the dive.

So, if you did one dive in which the breathing mix contained a given fraction of nitrogen, then the tissue loading of compartment four would be the same as if the same profile would be dived with breathing a mix that contains that fraction now in helium and then in compartment six or seven (ignoring the fact that before the dive, at the surface you were breathing air and not heliox 79).

So much for tissue loadings (where the difference between N2 and He is only in a shift in compartment number). But what about M-values (parametrized by a- and b-coefficients in Bühlmann’s model)? Those are different for He and N2.

Yes, they are. When indexed by compartment numbers. But we just saw, those don’t mean much, we should rather look at them as a function of half-time. And then the difference is much smaller as can be seen by these diagrams:

Orange is helium, blue is nitrogen. There seems to be a systematic difference for slow tissues for a and for fast tissues for b but this goes essentially away once one plots the tolerated ambient pressure (the “M-value”) as a function of tissue loadin according to the linear equation

$$p_{tol}=(p_{i} – a) \times b$$

This plot shows $$p_{tol}$$ as a function of (the log) of the half-time and the tissue loading and one sees there is hardly any difference between the orange and the blue surface (here is a version that you can rotate to look at it from all sides without coordinate frame though, thanks Mathematica). I computed all these plots in a Mathematica notebook that you can download here.

Again, the upshot is that once you align the tissue half-times, the difference between the two inert gases is quite small. So, why is there a “penalty” for using more helium in your mix (while there above mentioned study finds evidence for not so much difference)? Where does it come into the model?

The answer is that when actually diving trimix, that is having both N2 and He in your mix, one has to combine the effects of the two. In the Bühlmann model, you are supposed to add the partial tissue pressures and use the weighted average (weighted by the fractions of the two inert gases) of the M-values. And here it is, where you combine them using tissue number (and not as I did above) by half-time. The justification would be that due to the different diffusion rates this is what happens in a single tissue in the body (with the above mentioned caveat that these tissues are theoretical constructs of an interpolation and not necessarily reflect real physiological tissues).

The effect is that now some nitrogen load is compared to an M-value which partly comes from He which gives you a much stricter M-value (as the He-M-values are smaller when you compare them with aligned compartment number rather than half-time). This is where the penalty comes from.

To me it sounds as if it is this combining of the gases is actually the part of the Bühlmann model with the weakest justification from a physics point of view. And my interpretation of the NEDU study is that it supports doubts that this is the right thing to do.

It seems, further studies about this part, where one simply takes two gas compartments which happen to have the same compartment number (which is only a coordinate in diffusion constant space after all) and throws them together for the two different gases, are needed. At least, this is where I would put my money that this is an area where the models could be improved (or at least better empirically justified).

Update: In a previous version I had claimed that David Doolette had invented the heat-map display of decompression. It was pointed out to me that this was in fact user “UWSojourner” on several fora.

Why is Bühlmann not like Bühlmann

I often see complaints that two different dive planning programs or dive computers do not give identical deco schedules even though both claim to implement the same decompression model. Like both being Bühlmann with gradient factors. Once you implement a model, it should deterministically give you a plan for the ascend.

And yes, in an ideal world that would be true. But in ours, the model does not exist. Even though some description of how one is supposed to compute stops is written down, there are still a lot of undefined details that are up to the implementation to decide (often enough not consciously since the ill-definedness might be rather subtle). And I am not talking about random fudge factors that programmers add to their implementations to make the schedules more conservative and to reduce the DCS risk to divers following the program or computer’s advice (like always increasing the depth by a constant amount or some percentage or letting time run faster upon tissue loading and slower during off-gassing, OSTC I am looking at you!). IN particular, for dive computers with proprietary software the customer will never know which tweaks were implemented (or even advertised as features like taking temperature or heart rate into account or breathing rate or punishing ceiling violations). I am not saying these are bad ideas, it just makes schedules hard to compare

Here, I want to discuss more subtle issues, issues that arise since models are only defined in prose and that is up to interpretation. Like the original Bühlmann model being described in his book and gradient factors essentially defined in a figure on the last page of Erik Baker’s paper. In this respect, VPM-B is different: There exist texts but I find those confusing to say the least (which was also my motivation for some previous posts) and those are silent about things like repetitive diving or how to apply the model to real logged dives rather than in planning. The actual definition of VPM-B is, however, in the original FORTRAN program. And that has deterministic output. So that is clearly defined. On the other hand, the program does not tell you about the reasoning behind it so provides no basis for extrapolation (to things like logged dives).

• When is it time to leave a stop? All models I know provide you with a current minimal ambient pressure given the tissue loadings and the current ambient pressure. So, should you leave your stop once that minimal ambient pressure is less or equal than the ambient pressure of your next potential stop? This might be the naive guess. But one could also take into account not the current ambient pressure but that of the stop. And for gradient factors (see below), one has to take the gradient factor into account not at the current depth but at the depth of the next stop (or ceiling). I have seen implementations that got the maths of this wrong. But there is another thing that one could take into account: There is further off-gassing during the ascend to the next stop. So, the criterium should not be if the next stop is below the ceiling once i leave the previous stop but once I reach the next. To me, this is the only sensible criterium, so Subsurface does this for Bühlmann where it is not specified. But in order to be 100% compatible with the original implementation of VPM-B, using that model, we take the criterium to be the ceiling at the time of leaving the previous stop. The difference is minimal but can make stops one minute shorter or longer (and due to on-gassing on the deeper stops also influence the length of the shallower stops).
• The next difference is in what actually constitutes stop times: Everybody wants there stops to have integer minute lengths. But what exactly is the length of a stop (which is then subject to integer rounding), starting at the time you leave the previous stop or only at the time you arrive at the next? For 9m/min ascent rate and 3m intervals, this difference is 20s. This is only a rounding effect, so the immediate difference is only one minute per stop. But again, due to on-gassing of slow tissues on deeper stops this difference can multiply at the shallower stops.
• Looking at the graphics that is supposed to define gradient factors, Gradient factor definition one understands that the GFlow is supposed to be applied at the first stop depth. So far, so good. But what is that exactly? Is the the ceiling at the end of the bottom time? Or the deepest ceiling ever encountered during the dive? Or should we take into account the off-gassing during the ascend and take it to be the first time we actually hit the ceiling (since the first ceiling we see at the end of the bottom time might have moved up during the ascent? The last option is probably what was implied by Baker. And that might well apply to a planned dive. But not so much for a real dive: Image a carful diver that always does his stops one meter too deep (at the price of potentially longer stops). He never reaches the “first stop” in a strict sense because he always stays shy of reaching that stop and waits for it to clear before the further ascent (one could summarize his behavior also in terms of a very very slow ascent rate). So, in  a strict sense, for this diver, GFlow never applies (or only at the surface). Of course, this does not really make sense and thus, to avoid this paradox, in Subsurface we use the deepest ceiling encountered during the dive as the anchor depth for GFlow (also since for logged dives there is no clear distinction between the bottom part of the dive and the ascent).
• Finally, there are some other smaller ill-defined bits, like in how to average things when diving with different gases (as initially N2 and He are treated separately), how to take care of the notorious water vapor (and which partial pressure assume for it).

So in summery, even if two implementations follow the letters of the definition of a decompression model, they might come up with different deco plans. For all practical purposes, those differences should be small (like a few percent of total decompression time) and thus be hidden in the much larger systematic error of all these very simple models (after all, we do not have good information about all the things that are going on in a diver’s body) but they can be big enough to make people worry since they think decompression is an exact science or even that computer programs should be deterministic. Yes, programs can be deterministic, but it is well possible that a model described only in prose has several different implementations.

PS: Something completely different: I set up a Facebook page for this blog. Subscribe it if you want to be notified whenever a new post appears!