DPlan - About the Program

Well, it's that time of year again, time to renew the web hosting. And for those of you that don't know, that has become a lot more expensive than it used to be. Fifty dollars a year is now several hundred. Not to mention the price of domain names has gone up ten-fold.

And I just found out that the nice folks at PayPal disabled all my Support buttons, and I never got a notice (although that may be my fault.) In any case, it is all working again now, so if you would like to make a small donation to help defray these costs, it would be greatly appreciated.

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


Sea Bass
A normal 3/4 pound male Sea Bass
on the right, and an enormous
18", 4-pound "Super-Male" on
the left. State record is 8 lbs 2 oz.

Spearfishing is really a solo activity. The presence of other divers in the water certainly does not preclude spearfishing, but the last thing you need is a buddy following you around in close proximity while you hunt, especially if he is spearfishing as well. This is in direct opposition to the conventionally accepted "buddy system" of diving and therefore makes spearfishing an activity only for more experienced divers who are capable of self-sufficiency in the water.

For every shot, assume you are going to miss. The resulting overshoot must never be a danger to other divers. This means either having visibility well in excess of the range of your weapon ( seldom ) or having a good backstop ( often the bottom is the best backstop. )

Printed from njscuba.net