DPlan - Output

When you have set up all your input parameters, click the ERROR button to generate the resulting ERROR. The Reset button resets the interface to default values, including replacing the waypoint information with the example, so save your waypoints elsewhere before using Reset.

False Precision affects the program's display of numbers, but not the actual calculations. This is useful as a 'sanity check', but the extra precision should not be believed - everything about decompression modeling is an estimate. Note that this setting only affects the display of results, internal calculations are always carried out in full precision. This is again more of a 'sanity check' than real accuracy - it allows me to compare numbers between different runs and versions of the program to verify the algorithm.

Trace causes the program to display a running trace of execution. As you can see, some user points generate multiple waypoints. Each item is an actual function name, followed by some useful information. If a function is indented below the function above, that means the second function was called by the first. Functions that are all indented together were all called by the same parent. When the indenting comes back out, that means the parent function has finished execution. There is also color-coding. Grayed-out lines are for test cases or predictions, which are discarded after use, while blue lines are actual committed calculations that become a new waypoint in the profile. Sometimes it takes a lot of tests to arrive at a single new waypoint. The trace only shows the most significant functions, low-level support functions are not shown. Some calculations are simple, like descents, while others may require a great deal of computation, like ascents with heavy decompression. Thankfully, the computer does all the work and doesn't make math errors ( although I may have in writing the program. ) For more details on program operations, see Trace below.

The trace was a late addition to the program, which was a mistake, I should have put it in from the beginning. It is an invaluable tool for debugging and optimizing the code. It is also a fascinating look inside the program, showing how complex decompression modeling really is. Remember, every step is carried out for up to 17 compartments, and many basic 'building-block'-type steps are not shown. There are five levels of Trace, each one shows an increasing level of detail. The final level of Trace dumps just about all intermediate calculations, so you can really see what is happening inside the algorithm.

M-values will print out a listing of the M-Values for the selected model, with no deco analysis.

Print Headers Last is self-evident - it inverts the order of program output so that the most interesting parts come first.

Pressure Graphics causes lovely ASCII-art tissue compartment loading graphs to be drawn before the regular program output. Actually, the graphs are quite interesting and instructive.

Perhaps unintuitively, pressure is on the X-axis, while the pressure compartments are on the Y-axis, ordered by half-time (ht). Pressure is absolute zero at the left edge in order to display partial-pressures. At the top, it is marked in atmospheres, at the bottom it is marked in equivalent feet fsw. At the right edge, each compartment's actual inert gas pressure is displayed in both ATA and fsw.

During a descent, you can see how the fast compartments load up first, but after a while the middle compartments take over. During ascent you can see how the compartments off-gas, and control moves from one to the next until all of them reach an acceptable level for surfacing. Also shown is each compartment's pressure ceiling, which is really the whole point of the program. The deepest of these ceilings determines the stop depth. Conservatism factors result in deeper ceilings, with slower off-gassing and therefore longer profiles. When the last ceiling decreases to 1 ATA or 0 feet, you can surface. Below is a fairly extreme dive profile with decompression that is quite instructive. I have manually added a 'zeroth' point to show the state before the dive begins.

  LEGEND    Model: Buehlmann ZH-L16B 1990
         0  Compartment Inert Gas Pressure
       ---  Controlling Compartment
         @  Compartment Pressure Ceiling
         )  Total Ambient Pressure
         :  Inert Gas Ambient Pressure
         '  PO2
         |  Surface

Stage: (0) Pre-Dive                    (O2/He)=(0.21/0.00) PO2=0.21

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA
 ht +----+----+----+----+----+----+----+----+----+----+----+----+-
  5 |    @  0 |                                               0.76
  8 |    @  0 |                                               0.76
 12 |    @  0 |                                               0.76
 18 |    @  0 |                                               0.76
 27 |    @  0 |                                               0.76
 38 |    @  0 |                                               0.76
 54 |    @  0 |                                               0.76
 77 |    @  0 |                                               0.76
109 |    @  0 |                                               0.76
146 |    @  0 |                                               0.76
187 |    @  0 |                                               0.76
239 |    @  0 |                                               0.76
305 |    @  0 |                                               0.76
390 |    @  0 |                                               0.76
498 |    @  0 |                                               0.76
635 |    @  0 |                                               0.76 
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (1) Descent to xxx ft 4min [4min] (O2/He)=(0.21/0.00) PO2=1.42

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |  @      |   '  0                                   :    1.68  22
  8 | @       |   0                                      :    1.37  12
 12 | @       | 0 '                                      :    1.16   5
 18 | @       0   '                                      :    1.03   1
 27 | @      0|   '                                      :    0.95  -2
 38 |  @     0|   '                                      :    0.89  -4
 54 |  @    0 |   '                                      :    0.85  -5
 77 |  @    0 |   '                                      :    0.82  -6
109 |  @    0 |   '                                      :    0.80  -7
146 |   @   0 |   '                                      :    0.79  -7
187 |   @   0 |   '                                      :    0.78  -7
239 |   @   0 |   '                                      :    0.77  -8
305 |   @   0 |   '                                      :    0.77  -8
390 |    @  0 |   '                                      :    0.76  -8
498 |    @  0 |   '                                      :    0.76  -8
635 |----@--0 |   '                                      :    0.76  -8
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (1) Waypoint   xxx ft 20min [24min] (O2/He)=(0.21/0.00) PO2=1.42

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |         |   '       @                            0 :    5.07 134
  8 |----------------------@----------------------0      :    4.60 119
 12 |         |   '       @                0             :    3.93  97
 18 |         |   '     @            0                   :    3.28  75
 27 |         |   ' @          0                         :    2.69  56
 38 |         |   @       0                              :    2.23  41
 54 |         | @ '    0                                 :    1.85  28
 77 |         @   ' 0                                    :    1.56  18
109 |       @ |  0'                                      :    1.34  11
146 |       @ | 0 '                                      :    1.19   6
187 |      @  |0  '                                      :    1.10   3
239 |      @  0   '                                      :    1.03   1
305 |     @   0   '                                      :    0.97  -1
390 |     @  0|   '                                      :    0.92  -3
498 |     @  0|   '                                      :    0.88  -4
635 |     @  0|   '                                      :    0.86  -5
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) Ascent  to  80ft 2min [26min] (O2/He)=(0.21/0.00) PO2=0.72

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |      '  |         @      :      )             0         4.81 126
  8 |----------------------@----------)----------0            4.51 116
 12 |      '  |           @    :      )    0                  3.93  97
 18 |      '  |         @      :     0)                       3.33  77
 27 |      '  |      @         :0     )                       2.75  58
 38 |      '  |   @        0   :      )                       2.28  42
 54 |      '  | @      0       :      )                       1.90  30
 77 |      '  @     0          :      )                       1.60  20
109 |      ' @|   0            :      )                       1.37  12
146 |      '@ | 0              :      )                       1.22   7
187 |      @  |0               :      )                       1.12   4
239 |      @  0                :      )                       1.04   1
305 |      @  0                :      )                       0.98  -1
390 |     @' 0|                :      )                       0.93  -2
498 |     @' 0|                :      )                       0.89  -4
635 |     @' 0|                :      )                       0.86  -5
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) GF Stop     80ft 2min [28min] (O2/He)=(0.21/0.00) PO2=0.72

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |      '  |      @         :      )        0              4.29 109
  8 |      '  |          @     :      )       0               4.21 106
 12 |--------------------@------------)---0                   3.80  92
 18 |      '  |        @       :     0)                       3.28  75
 27 |      '  |      @         0      )                       2.75  58
 38 |      '  |   @        0   :      )                       2.30  43
 54 |      '  | @      0       :      )                       1.92  30
 77 |      '  @     0          :      )                       1.62  20
109 |      ' @|   0            :      )                       1.38  13
146 |      '@ | 0              :      )                       1.23   8
187 |      @  |0               :      )                       1.13   4
239 |      @  |0               :      )                       1.05   2
305 |      @  0                :      )                       0.99  -0
390 |     @' 0|                :      )                       0.94  -2
498 |     @' 0|                :      )                       0.90  -3
635 |     @' 0|                :      )                       0.87  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) Ascent  to  70ft 0min [28min] (O2/He)=(0.21/0.00) PO2=0.66

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |      '  |      @       :     )           0              4.25 107
  8 |      '  |          @   :     )          0               4.19 105
 12 |--------------------@---------)------0                   3.79  92
 18 |      '  |        @     :     ) 0                        3.27  75
 27 |      '  |      @       : 0   )                          2.75  58
 38 |      '  |   @        0 :     )                          2.30  43
 54 |      '  | @      0     :     )                          1.92  30
 77 |      '  @     0        :     )                          1.62  20
109 |      ' @|   0          :     )                          1.38  13
146 |      '@ | 0            :     )                          1.23   8
187 |      @  |0             :     )                          1.13   4
239 |      @  |0             :     )                          1.05   2
305 |      @  0              :     )                          0.99  -0
390 |     @' 0|              :     )                          0.94  -2
498 |     @' 0|              :     )                          0.90  -3
635 |     @' 0|              :     )                          0.87  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) GF Stop     70ft 1min [29min] (O2/He)=(0.21/0.00) PO2=0.66

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |      '  |     @        :     )        0                 4.02 100
  8 |      '  |         @    :     )        0                 4.04 100
 12 |--------------------@---------)-----0                    3.72  90
 18 |      '  |        @     :     )0                         3.24  74
 27 |      '  |      @       : 0   )                          2.74  57
 38 |      '  |   @        0 :     )                          2.30  43
 54 |      '  | @      0     :     )                          1.93  31
 77 |      '  @     0        :     )                          1.62  21
109 |      ' @|   0          :     )                          1.39  13
146 |      '@ | 0            :     )                          1.24   8
187 |      @  |0             :     )                          1.14   5
239 |      @  |0             :     )                          1.06   2
305 |      @  0              :     )                          0.99  -0
390 |     @' 0|              :     )                          0.94  -2
498 |     @' 0|              :     )                          0.90  -3
635 |     @' 0|              :     )                          0.87  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) Ascent  to  60ft 0min [29min] (O2/He)=(0.21/0.00) PO2=0.59

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |     '   |     @     :     )           0                 3.98  98
  8 |     '   |         @ :     )           0                 4.02 100
 12 |--------------------@------)--------0                    3.70  89
 18 |     '   |        @  :     )   0                         3.24  74
 27 |     '   |      @    :    0)                             2.74  57
 38 |     '   |   @       :0    )                             2.30  43
 54 |     '   | @      0  :     )                             1.93  31
 77 |     '   @     0     :     )                             1.63  21
109 |     '  @|   0       :     )                             1.39  13
146 |     ' @ | 0         :     )                             1.24   8
187 |     '@  |0          :     )                             1.14   5
239 |     '@  |0          :     )                             1.06   2
305 |     '@  0           :     )                             0.99  -0
390 |     @  0|           :     )                             0.94  -2
498 |     @  0|           :     )                             0.90  -3
635 |     @  0|           :     )                             0.87  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) GF Stop     60ft 2min [31min] (O2/He)=(0.21/0.00) PO2=0.59

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |     '   |  @        :     )      0                      3.54  84
  8 |     '   |       @   :     )        0                    3.73  90
 12 |------------------@--------)------0                      3.54  84
 18 |     '   |        @  :     )   0                         3.16  71
 27 |     '   |      @    :    0)                             2.71  56
 38 |     '   |   @       :0    )                             2.30  43
 54 |     '   | @      0  :     )                             1.93  31
 77 |     '   @     0     :     )                             1.64  21
109 |     '  @|   0       :     )                             1.40  13
146 |     ' @ | 0         :     )                             1.25   8
187 |     '@  |0          :     )                             1.15   5
239 |     '@  |0          :     )                             1.06   2
305 |     '@  0           :     )                             1.00  -0
390 |     @  0|           :     )                             0.94  -2
498 |     @  0|           :     )                             0.90  -3
635 |     @  0|           :     )                             0.87  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) Ascent  to  50ft 0min [32min] (O2/He)=(0.21/0.00) PO2=0.53

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |    '    |  @      :    )         0                      3.48  82
  8 |    '    |      @  :    )           0                    3.68  88
 12 |------------------@-----)---------0                      3.52  83
 18 |    '    |       @ :    )     0                          3.15  71
 27 |    '    |      @  :    ) 0                              2.70  56
 38 |    '    |   @     :  0 )                                2.30  43
 54 |    '    | @      0:    )                                1.93  31
 77 |    '    @     0   :    )                                1.64  21
109 |    '   @|   0     :    )                                1.40  13
146 |    '  @ |  0      :    )                                1.25   8
187 |    ' @  |0        :    )                                1.15   5
239 |    ' @  |0        :    )                                1.06   2
305 |    ' @  0         :    )                                1.00  -0
390 |    '@  0|         :    )                                0.95  -2
498 |    '@  0|         :    )                                0.90  -3
635 |    '@  0|         :    )                                0.87  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) GF Stop     50ft 3min [35min] (O2/He)=(0.21/0.00) PO2=0.53

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |    '    @         :    )    0                           2.96  65
  8 |    '    |    @    :    )       0                        3.28  75
 12 |    '    |      @  :    )       0                        3.28  75
 18 |----------------@-------)----0                           3.02  67
 27 |    '    |     @   :    )0                               2.65  54
 38 |    '    |   @     :  0 )                                2.28  42
 54 |    '    | @      0:    )                                1.93  31
 77 |    '    |@    0   :    )                                1.64  21
109 |    '   @|   0     :    )                                1.41  14
146 |    '  @ |  0      :    )                                1.26   9
187 |    '  @ | 0       :    )                                1.16   5
239 |    ' @  |0        :    )                                1.07   2
305 |    ' @  0         :    )                                1.00   0
390 |    '@   0         :    )                                0.95  -2
498 |    '@  0|         :    )                                0.91  -3
635 |    '@  0|         :    )                                0.87  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) Ascent  to  40ft 0min [35min] (O2/He)=(0.21/0.00) PO2=0.46

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |    '    @      :    )      0                            2.90  63
  8 |    '    |    @ :    )         0                         3.24  74
 12 |    '    |      @    )         0                         3.25  74
 18 |----------------@----)-------0                           3.00  66
 27 |    '    |     @:    )   0                               2.64  54
 38 |    '    |   @  :    )0                                  2.27  42
 54 |    '    | @    : 0  )                                   1.93  31
 77 |    '    |@    0:    )                                   1.65  21
109 |    '   @|   0  :    )                                   1.41  14
146 |    '  @ |  0   :    )                                   1.26   9
187 |    '  @ | 0    :    )                                   1.16   5
239 |    ' @  |0     :    )                                   1.07   2
305 |    ' @  0      :    )                                   1.01   0
390 |    '@   0      :    )                                   0.95  -2
498 |    '@  0|      :    )                                   0.91  -3
635 |    '@  0|      :    )                                   0.87  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) GF Stop     40ft 5min [40min] (O2/He)=(0.21/0.00) PO2=0.46

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |    '@   |      :    )0                                  2.31  43
  8 |    '    |@     :    )    0                              2.70  56
 12 |    '    |    @ :    )      0                            2.88  62
 18 |---------------@-----)-----0                             2.78  59
 27 |    '    |    @ :    )  0                                2.53  50
 38 |    '    |   @  :    0                                   2.23  40
 54 |    '    | @    : 0  )                                   1.92  30
 77 |    '    |@    0:    )                                   1.65  21
109 |    '   @|   0  :    )                                   1.42  14
146 |    '  @ |  0   :    )                                   1.27   9
187 |    '  @ | 0    :    )                                   1.17   5
239 |    ' @  |0     :    )                                   1.08   3
305 |    ' @  0      :    )                                   1.01   0
390 |    ' @  0      :    )                                   0.96  -1
498 |    '@  0|      :    )                                   0.91  -3
635 |    '@  0|      :    )                                   0.88  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) Ascent  to  30ft 0min [40min] (O2/He)=(0.21/0.00) PO2=0.40

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |   ' @   |    :   )   0                                  2.27  42
  8 |   '     |@   :   )       0                              2.67  55
 12 |   '     |   @:   )         0                            2.85  61
 18 |---------------@--)--------0                             2.77  58
 27 |   '     |    @   )     0                                2.52  50
 38 |   '     |   @:   )  0                                   2.22  40
 54 |   '     | @  :   0                                      1.92  30
 77 |   '     |@   :0  )                                      1.65  21
109 |   '    @|   0:   )                                      1.42  14
146 |   '   @ |  0 :   )                                      1.27   9
187 |   '   @ | 0  :   )                                      1.17   6
239 |   '  @  |0   :   )                                      1.08   3
305 |   '  @  0    :   )                                      1.01   0
390 |   '  @  0    :   )                                      0.96  -1
498 |   ' @  0|    :   )                                      0.91  -3
635 |   ' @  0|    :   )                                      0.88  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) GF Stop     30ft 7min [47min] (O2/He)=(0.21/0.00) PO2=0.40

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |  @'     |    :  0)                                      1.77  25
  8 |   '  @  |    :   ) 0                                    2.12  37
 12 |   '     |@   :   )    0                                 2.41  46
 18 |   '     |  @ :   )     0                                2.47  48
 27 |-------------@----)---0                                  2.35  44
 38 |   '     |  @ :   ) 0                                    2.13  37
 54 |   '     | @  :   0                                      1.88  29
 77 |   '     @    :0  )                                      1.64  21
109 |   '    @|   0:   )                                      1.43  14
146 |   '   @ |  0 :   )                                      1.28   9
187 |   '   @ | 0  :   )                                      1.17   6
239 |   '  @  |0   :   )                                      1.09   3
305 |   '  @  0    :   )                                      1.02   1
390 |   '  @  0    :   )                                      0.96  -1
498 |   ' @  0|    :   )                                      0.92  -3
635 |   ' @  0|    :   )                                      0.88  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) Ascent  to  20ft 0min [48min] (O2/He)=(0.21/0.00) PO2=0.34

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |  @      |  :  ) 0                                       1.75  25
  8 |  '   @  |  :  )    0                                    2.10  36
 12 |  '      |@ :  )       0                                 2.39  46
 18 |  '      |  @  )        0                                2.45  48
 27 |-------------@-)------0                                  2.34  44
 38 |  '      |  @  )    0                                    2.13  37
 54 |  '      | @:  )  0                                      1.88  29
 77 |  '      @  :  0                                         1.64  21
109 |  '     @|  :0 )                                         1.43  14
146 |  '    @ |  0  )                                         1.28   9
187 |  '    @ | 0:  )                                         1.17   6
239 |  '   @  |0 :  )                                         1.09   3
305 |  '   @  0  :  )                                         1.02   1
390 |  '   @  0  :  )                                         0.96  -1
498 |  '  @  0|  :  )                                         0.92  -3
635 |  '  @  0|  :  )                                         0.88  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) GF Stop     20ft 12min [60min] (O2/He)=(0.21/0.00) PO2=0.34

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |@ '      |  0  )                                         1.33  11
  8 |  @      |  : 0)                                         1.54  18
 12 |  '   @  |  :  ) 0                                       1.82  27
 18 |  '      @  :  )   0                                     2.01  33
 27 |  '      |@ :  )   0                                     2.04  34
 38 |-----------@---)---0                                     1.95  31
 54 |  '      |@ :  ) 0                                       1.79  26
 77 |  '      @  :  0                                         1.59  20
109 |  '     @|  :0 )                                         1.41  14
146 |  '    @ |  0  )                                         1.28   9
187 |  '    @ | 0:  )                                         1.18   6
239 |  '   @  |0 :  )                                         1.09   3
305 |  '   @  0  :  )                                         1.03   1
390 |  '   @  0  :  )                                         0.97  -1
498 |  '  @  0|  :  )                                         0.93  -2
635 |  '  @  0|  :  )                                         0.89  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) Ascent  to  10ft 0min [60min] (O2/He)=(0.21/0.00) PO2=0.27

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |@ '      :  0                                            1.32  10
  8 |  @      :  ) 0                                          1.52  17
 12 |  '   @  :  )    0                                       1.81  27
 18 |  '      @  )      0                                     2.00  33
 27 |  '      :@ )      0                                     2.04  34
 38 |-----------@)-----0                                      1.95  31
 54 |  '      :@ )    0                                       1.78  26
 77 |  '      @  )  0                                         1.59  20
109 |  '     @:  )0                                           1.41  14
146 |  '    @ :  0                                            1.28   9
187 |  '    @ : 0)                                            1.18   6
239 |  '   @  :0 )                                            1.09   3
305 |  '   @  0  )                                            1.03   1
390 |  '   @  0  )                                            0.97  -1
498 |  '  @  0:  )                                            0.93  -2
635 |  '  @  0:  )                                            0.89  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) GF Stop     10ft 23min [83min] (O2/He)=(0.21/0.00) PO2=0.27

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 |  '      0  )                                            1.00   0
  8 |  '      :0 )                                            1.06   2
 12 |  @      : 0)                                            1.22   7
 18 |  ' @    :  )0                                           1.41  14
 27 |  '   @  :  )  0                                         1.57  19
 38 |  '     @:  )  0                                         1.62  20
 54 |--------@---)--0                                         1.58  19
 77 |  '     @:  ) 0                                          1.48  16
109 |  '    @ :  )0                                           1.35  12
146 |  '    @ : 0)                                            1.25   8
187 |  '    @ : 0)                                            1.16   5
239 |  '   @  :0 )                                            1.09   3
305 |  '   @  0  )                                            1.02   1
390 |  '   @  0  )                                            0.97  -1
498 |  '  @  0:  )                                            0.93  -2
635 |  '  @  0:  )                                            0.89  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160    

Stage: (2) Ascent  to  0ft 0min [83min] (O2/He)=(0.21/0.00) PO2=0.21

 P 0.0  0.5  1.0  1.5  2.0  2.5  3.0  3.5  4.0  4.5  5.0  5.5  ATA fsw
 ht +----+----+----+----+----+----+----+----+----+----+----+----+---
  5 | '     : 0                                               1.00  -0
  8 | '     : )0                                              1.06   2
 12 | '@    : ) 0                                             1.21   7
 18 | '  @  : )   0                                           1.41  13
 27 | '    @: )     0                                         1.56  19
 38 | '     :@)     0                                         1.62  20
 54 |--------@)-----0                                         1.58  19
 77 | '     :@)    0                                          1.48  16
109 | '     @ )   0                                           1.35  12
146 | '     @ ) 0                                             1.24   8
187 | '     @ ) 0                                             1.16   5
239 | '    @: )0                                              1.09   3
305 | '    @: 0                                               1.02   1
390 | '    @: 0                                               0.97  -1
498 | '   @ :0)                                               0.93  -2
635 | '   @ :0)                                               0.89  -4
(m) +---+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----
depth (fsw)   0     20    40    60    80   100   120   140   160   

During decompression, the ambient pressure line follows the decompression ceiling back to the surface line. The decompression ceiling is drawn towards the surface line by the inert gas line. When the decompression ceiling is entirely to the left of the surface line, decompression is complete. Conversely, for no-decompression models, the decompression ceiling is fixed, and becomes the no-decompression limit. The PO2 line has no effect, and is just shown for interest. Studying complete sequences of these graphs for various decompression schedules can greatly enhance your intuitive understanding of the decompression process.

Trace

In addition to its value for debugging the program, I find the program trace fascinating in its own right. Each line is generated by a function call. The first two numbers are k and j, the counters for user (input) points and (program) waypoints respectively. The next two numbers are depth and run-time at the end of the previous function ( equivalent to the beginning of the current function. ) After that is a note if the profile is in DECOmpression or if one of the CONServative settings is in force. The function name is displayed in bold, followed by some interesting note or result.

There are five levels of tracing, each showing progressively more detail. The last level also displays many intermediate results. You can watch compartment values, partial pressures, ceilings, etc change as you move through the profile.

If a function is indented below the previous one, that means the second one was called by the first. Functions at the same indent level were all called in the order shown by the same parent. A lot of basic bookkeeping-type functions are suppressed from the display to minimize clutter. There is a function Peek() that serves only to display results at interesting points in the program. Watch for it.

The program begins with Start(). This is little more than a bookend for the Trace() function, although it does do a little setting-up. Then comes a big one - Input(). Input reads the big control form ( which is itself a program ) and sets up all program parameters and user points, using defaults for any missing inputs. It generates additional points as needed, for example, a final ascent to the surface. Input() expands the waypoints you enter into program User Points, with additional bookend User points as necessary. User Points combine your dive waypoints with the equipment and environment factors selected.

The next function is DecoModel(), which sets up the parameters for the selected decompression model. Most of this function is just data arrays for 16 different models. Altitude is determined by PBaro(). After that, the MainLoop() function is called. This is where the simulation really begins. MainLoop() processes the user point list, creating program waypoints as it goes. Some user points translate into just one waypoint, while others may spawn many. All waypoints are saved for later use, unlike many decompression programs which constantly operate on just one data point. All of that saved data is made use of by the table generator.

MainLoop() initializes a new dive profile with NewProfile() whenever commanded - setting all states to pre-dive, and doing some bounds-checking and bookkeeping. Then it moves on to the dive simulation. Mainloop() reads in each User Point that was generated by Input(), and creates a Program Waypoint from it. A Program Waypoint contains all the information from the User Point, plus a lot more: pressures, ceilings, etc, that are calculated as the point is processed.

There are three main functions inside MainLoop() that correspond to phases of a dive: Descend(), Level(), and Ascend(). Each of these has two modes: Predict and Compute. In Predict mode, the current program state ( waypoint and compartments ) is saved while temporary calculations are made. Whatever results that were sought are saved, and then the original program state is restored. In Compute mode, the same function updates the program state, committing its calculations to the current waypoint. In the program trace, Predict mode is indicated by gray text, while Compute mode is indicated by blue text.

Descend() is called first - without that you are not diving. Descend() calls Shreiner() - the Shreiner equation - to calculate gas loadings, and then Ceilings() to determine the resulting decompression ceiling. It may do this once, or twice if the Descent Split Depth is crossed. Descending is simple, there is no need to test if you can go down, so Descend() is only ever called in Compute mode.

A descent is followed by a Level(). Level() uses the Haldane equation to calculate gas loadings for the specified time. Level() is used in both Predict and Compute modes.

Ascend() is the reverse of Descend(), using the Shreiner equation in much the same way. However, that is too dumb. On its own, Ascend() will take you directly to whatever depth is specified. In real life, this can get you BENT, and so too in the program. So Ascend() is never called directly, but is invoked by a controlling function - Decompress(), even if it turns out that no decompression is needed. Ascend() calls Shreiner(), and then Ceilings() to calculate the new decompression ceilings that result from its own use.

Decompress() uses Ascend() and Level() in Predict mode to determine the ceiling that you can ascend to, based on gas loadings and conservatism settings. Decompress() first calls StopDepth(), which is one half of the real brains of the algorithm. By comparison, SteppedDepth() is a dumb little function that just rounds-up the decompression ceiling to the next deeper stop depth.

StopDepth() begins with a stepped deco depth based on the current ceiling, and then calls Ascend() in predict mode as often as necessary to determine if it can be reached, or even exceeded, restoring the initial conditions between tests. This is necessary because the ceilings change during an ascent, you can't predict what they will be when you get there without actually doing it. When all this is done, StopDepth() then returns the shallowest stop depth that it was able to reach, and restores the initial conditions for the next stage.

Decompress() then calls Ascend() to reach the stop depth. It then determines the next stop depth, and calls StopTime() to determine the decompression time required to reach it. StopTime() is the other half of the brains of the program. StopTime() is actually where the program spends most of its time. StopTime() calls Level() and Ascend() repeatedly to determine the necessary decompression time to ascend to the next stop or the surface. For long decompressions, this can take many iterations.

In order to head off very long computing times, rather than simply starting at zero minutes and going up one by one, StopTime() begins with a search algorithm, with limits determined by the depth of the stop and the length of the dive profile. The search algorithm determines a good starting point, typically 1 minute short of the actual required time, and feeds it to the incremental algorithm, which then finds the solution in two steps. StopTime() can determine most decompression times in six to ten iterations. While very short stops may actually take longer to determine this way, very long stops are calculated much faster than they would be otherwise, and it is those that really blow up the program execution time. If a very short stop is expected, then the search algorithm is bypassed.

For extremely long decompressions ( say, for saturation diving ) StopTime() begins with one minute increments for the first sixty minutes, and increases the increment as the stop time gets longer, allowing it to calculate very long stop times. In one test I ran, StopTime() determined the final 10 foot decompression stop time from full saturation on air at 100 feet in approximately 150 iterations. The iteration limit is ten times that, so the program should be capable of solving almost any situation, including ones that are not realistic.

Once it has the stop time, Decompress() calls Level() and Ascend() once more in Compute mode to commit the calculation. I could probably be more clever and just keep the last temporary calculations without repeating them, but it is simpler to just do it one more time. The whole process repeats until the target ascent depth is reached. Each time Ascend() is called in Compute mode, it spawns a new waypoint, so the entire process may create many waypoints from a single user point, and require dozens or even hundreds or Predict mode computations.

Ceilings() is used by many other functions to determine the decompression ceiling at a given point in the profile. By default, Ceilings() only generates the ( non-conservative ) model ceiling, but if conservatism is in use, Ceilings() calls ConsCeilings() to determine the additional deeper conservative ceilings.

D-Plan has no limitations on dive profile - you can go down and up and back down as much as you like. Ascents do not need to be to the surface, ascents and descents may be to any depth, even with zero time. Yo-Yo profiles are no problem for computation, although they may be a problem in real life.

A dive is considered concluded if you touch the surface - zero depth - either by a user-inputted point or a program-generated point. This will cause a number of profile parameters to reset, and sums to be calculated. You can set a zero-time surface interval and go right back down, but that will still be a new dive.

That covers the basic decompression algorithm. But D-Plan does a lot more. At the end of each stage, and sometimes twice, it calculates gas volumes: Volume(), and oxygen toxicity: OxyToxCNS() and OxyToxOTU(). This functionality is implemented in a modular way, so I can turn it off completely if I need to simplify matters for debugging, but normally it is enabled.

D-Plan also implements several forms of conservatism and deep stops. These are mostly encoded in ConsCeilings(), which is called from Ceilings() as needed. ConsCeilings() does extra ceiling calculations based on user conservatism settings, and then replaces the base ceiling with the worst-case conservative ceiling. Again, this is all modular, the base algorithm runs with or without conservatism.

Gradient Factor conservatism is implemented in two functions: ConsInit(), which is called at the maximum depth of a dive, and ConsGF(), which calculates the Gradient Factor prior to every ascent, be it a Predict or a Compute. Pyle stops are invoked at the beginning of Decompress(). The PyleStops() function inserts however many deep stops that it calculates as new waypoints. ZH-L17TS deep stops are part of the model, and are invoked when the model is set up at the beginning of the program. Pressure Ratio conservatism is implemented in ConsPR(). No-decompression safety stops are implemented in SafetyStop(), also called at the beginning of Decompress().

Decompression gas switches are implemented in DecoGasSwitch(). If Deco gases are enabled, this function is called at the beginning of Level() and Ascend(), to set up the next stage.

The final addition to the base decompression algorithm is rebreathers. Rebreathers are implemented entirely in Rebreather(). It turns out that simulating a rebreather is mostly a matter of adjusting the gas fractions according to the logic of the device. This is very similar to Deco gas switching. Rebreathers are admittedly poorly modeled during ascents and descents, but I think this has little impact on the overall results.

DecoGasSwitch() will override Rebreather() if both are in use. In fact, realizing just how similar these two functions are is what got me to add rebreathers to the program in the first place, and now there are three different types! Rebreather functions can be removed easily, but deco gas switching is in the core of the program.

TimeToFly() is an accurate prediction of time to fly, based on decompression modeling to altitude. It is surprising how short the real time-to-fly can be, especially after a single dive.

If you only look at the blue sections of the trace, you can see the dive profile, and if you look at the gray sections, you can see all the thrashing the program went through to calculate that profile. Remember, a lot of basic operations are not shown, and every operation is really as many as 17 separate operations, one for each tissue compartment. There was a time when something like this might have had a noticeable execution time, but nowadays computers are so fast that any profile I try is generated almost instantaneously. Still, it would be all but impossible to do these calculations by hand.


Shark River Bay Aerial
The new steps are just off the top edge of the photo, past the tennis courts.
Type:
inland tidal bay
Depth:
20 ft max, 15 ft in most places

This dive site, formerly known as 'L Street' has changed completely, and for the better. The town of Belmar has done something really nice for us divers and installed wide wooden steps down the bulkhead in Maclearie Park. This more than makes up for the loss of the boat ramp area, which is off-limits to all swimmers since it was rebuilt. I suppose the little cove by the ramp is still accessible from the beach, but the new site is much better, and far from all the dangerous boat traffic around the ramp and marina.

Printed from njscuba.net