Question calculating NDL is difficult

Please register or login

Welcome to ScubaBoard, the world's largest scuba diving community. Registration is not required to read the forums, but we encourage you to join. Joining has its benefits and enables you to participate in the discussions.

Benefits of registering include

  • Ability to post and comment on topics and discussions.
  • A Free photo gallery to share your dive photos with the world.
  • You can make this box go away

Joining is quick and easy. Log in or Register now!

Water vapor pressure is subtracted from the inspired gas before multiplying by the fraction of N2 and He. As such, it decreases the initial inert gas loading and impacts the gradient for on/off gassing. It's a small effect but trivial to implement.

Edit: forgot to mention it's constant. It's not a gas, so it doesn't compress; in other words, is not depth dependent. [Edit2: upon further thought, I'm not sure why it's treated as a constant and independent of depth.] An argument could be made that a CCR should have a higher/variable value, but the models don't care about humidity either. At some point the answers are not significantly affected.

Edit 3: looking at the NDL time for a 60 ft dive (GF x/85), it's 44 mins when vapor pressure is included and 38 mins when not. More of a difference than I initially thought.
 
  • Like
Reactions: OTF
I can't speak much about how to implement deco algos, but it's always fascinating reading about them. As to why you may not get an exact match across implementations (like Subsurface vs Shearwater), there is a really insightful article by one of the Subsurface contributors on his blog below. He addresses some not-quite-deterministic aspects of model implementation (and in general has some in-depth explanations of Buhlmann as well as other deco algos).

Interesting read, thanks for linking it. I disagree with the use of the descriptors deterministic / nondeterministic though. All deco alg implementations, including subsurface, are 100% deterministic. What is being addressed here is an algorithm analysis of too low granularity. Unfortunately this is a common issue seen in papers introducing algs.
 
My concerns would be correctness and fidelity of your code.

Correctness: does your code actually calculate the proper numbers? As indicated "some" equations have been published, but there appears to be other undocumented fudge factors?

Fidelity: does your code actually work in real time against ever changing conditions? How often do you need to sample? How often do you need to recalc? Is there any sample smoothing or rejection required (sensors are noisy!)

In the early days different algorithms where implemented (8 compartments vs 16) on the slow CPUs available. This does indicate that there are fidelity issues to be considered.

I found the following thread that highlights lots of confusion regarding real time fidelity (without any answers)


And finally: How are you doing to prove that your code does what it is supposed to do under all dive conditions? Is it safe? Seems like a lot of chamber testing of very many different scenarios would be required?
 
Water vapor pressure is subtracted from the inspired gas before multiplying by the fraction of N2 and He. As such, it decreases the initial inert gas loading and impacts the gradient for on/off gassing. It's a small effect but trivial to implement.

Edit: forgot to mention it's constant. It's not a gas, so it doesn't compress; in other words, is not depth dependent. [Edit2: upon further thought, I'm not sure why it's treated as a constant and independent of depth.]
I'm not sure exactly but I'll take an educated guess. While the water vapor pressure (WVP) is expressed in absolute pressure terms it becomes a constant that is added to the baseline of the inspired gas pressure adjusted by depth. Since the water vapor is not passed from the lungs into the blood and finally to the tissues it needs to be subtracted out to give a more accurate pressure of inspired gas in the tissues.

If anything, the WVP is dependent on lung volume assuming that larger lungs produce more water vapor. Since the difference in lung size is not great and the amount of water vapor produced is small we can use a one-size-fits-all approach for WVP.
 
And finally: How are you doing to prove that your code does what it is supposed to do under all dive conditions? Is it safe? Seems like a lot of chamber testing of very many different scenarios would be required?
On the accuracy of the results of the code, calculations should be done to a sufficient precision to obtain the required granularity. In cases where temporary results will be used to obtain a future result rounding should never be done on the temporary result but on the final result. This prevents multiplying errors through out the calculations.

Since the OP indicated the program would be used for personal use it isn't necessary to do chamber testing. The hardware itself needs to be chamber tested to ensure the device can withstand the maximum stated pressure plus maybe 10% if a safety margin is needed. The manufacturer has responsibility for this testing. I think it's only sufficient to test the program against other programs. When I wrote my Excel spreadsheet I compared the reults against Multideco and Shearwater's Perdix dive planning.
 
I will not for a moment pretend to be expert enough to talk with any real knowledge about water vapor calculations, but I can make a comment that people with more expertise might find valuable.

A number of years ago I was discussing a fatal diving accident on an attempted deco dive at an elevation of 16,000 feet/4,876 meters, and one of the people with whom I was discussing was a high altitude decompression specialist consulting with both NASA and the Pentagon (U2 flights). To summarize my understanding of what he said, he believed that there were only about a half dozen people in the world with enough knowledge to plan such a dive, and he was one. Apparently the rules and procedures that apply to dive planning at more normal elevations go out the window when you are at such an elevation. He cited water vapor as an example of something that has to be treated differently there.
 
On the accuracy of the results of the code, calculations should be done to a sufficient precision to obtain the required granularity. In cases where temporary results will be used to obtain a future result rounding should never be done on the temporary result but on the final result. This prevents multiplying errors through out the calculations.

Since the OP indicated the program would be used for personal use it isn't necessary to do chamber testing. The hardware itself needs to be chamber tested to ensure the device can withstand the maximum stated pressure plus maybe 10% if a safety margin is needed. The manufacturer has responsibility for this testing. I think it's only sufficient to test the program against other programs. When I wrote my Excel spreadsheet I compared the reults against Multideco and Shearwater's Perdix dive planning.
To clarify: I am not concerned about the ability to reproduce dive tables results in dive plan mode. That is trivial to perform and trivial to test.

I am concerned about the real time calc of tissue loading and ndl over time during a real dive as the dive computer moves about vertically in the water column.

A square profile is trivial to test and verify. A saw tooth profile with a few ndl violations and rapid ascents and descents is a more complex test and verify situation.

Understanding the distinction between these 2 situations is critical to delivering a working system.
 
the WVP is dependent on lung volume assuming that larger lungs produce more water vapor
On this point, larger lungs also have more alveoli / absorptive surface area, making for a somewhat constant "WVP per tissue area". Perhaps thats a contributing factor to the constant approximation?
 
forgot to mention it's constant. It's not a gas, so it doesn't compress; in other words, is not depth dependent. [Edit2: upon further thought, I'm not sure why it's treated as a constant and independent of depth.]
Thinking still further, the answer was simpler than I was trying to make it. Water vapor is a gas, but the partial pressure is constant because the quantity, (average) lung volume, and temperature don't change. (Those are the only other variables in the gas law equation.)
 
https://www.shearwater.com/products/swift/

Back
Top Bottom