DPlan - About the Program

I originally wrote D-Plan after uncovering serious flaws in a commercial decompression program that I had purchased. The first version was in Perl, and I still use it as a benchmark for testing the current version. Before that, I had a spreadsheet that could calculate simple decompression profiles. After I converted the entire website into PHP, I figured I might as well get rid of all the Perl. Some of that was easy, but D-Plan was a monster that I was putting off.

In the process of converting the code, I polished it up and found some minor bugs. The old version of the program slightly underestimated gas volumes, CNS O2, and OTUs. Given the nature of those calculations, the error was too small to matter, especially for recreational diving, but I fixed it nonetheless. I also made some small tweaks that make the program almost unnoticeably more conservative, but more correct. I made the program smarter about reporting gas use, and added options to disable automatic decompression in degrees, so you can fly it as manually as you want. I also added CNS O2 credits for surface intervals, and fixed a glitch in repetitive-dive O2 tracking. I split the SCR option into constant and variable flow versions and made both of them smarter.

Then I decided that the basic architecture had become a mess. So I re-wrote the core of the program in a much better way, and then converted all the features one by one to run on the new core. At every step, I tested the new PHP version against the old Perl version, which I had tested exhaustively before, and they produce the same results ( except for the errors, of course! I fixed a few small errors in the old program for the sake of being able to generate exactly matching numbers. )

The name is a tribute to Z-Plan - the original free deco program by William Smithers. The 'D' part of the name started as 'Death', but eventually, I started to believe the numbers and changed it to 'Depth'. That is still just one letter away from death though - don't forget that! Finally, I decided to shorten it to D-Plan.

All that adds up to about 8000 lines of code, although the core of the program is only about 500 lines, with another 900 lines of essential supporting functions. The rest is i/o routines, models, debugging, and non-essential functions like oxygen toxicity calculations, rebreathers, and conservatism. The program is modular so that the non-essential functions can be turned off or removed entirely.

If you think there are no more bugs in all that, you are crazy. This whole thing is just a programming exercise - if you use it for actual dive planning, then you are really crazy. What you can use it for is to evaluate the relative effects of using various deco gases, compare different types of equipment, and different decompression models.

WordPress Integration

The decompression program is entirely separate from WordPress. WordPress only displays the control form. The control form sends the inputs to the decompression program, which generates the output. WordPress is not involved in the calculations at all. In fact, when I transplanted it to WordPress, I never touched the decompression code, only the control form.

My 2 Cents:

Much of the difference between the various models gets lost when all the smoothness of Haldane's exponential on-gassing/off-gassing model is chopped up into discrete one-minute time steps and 10 foot stop depths. Much of the apparent precision in the results is overwhelmed by real-world uncertainties. Don't believe the last decimal place. Decompression modeling is much more of an art than a science.


References


Printed from njscuba.net