Learn R Programming

scuba (version 1.11-1)

bestdoubledive: Find the Best Double Dive To Given Depths

Description

For two no-decompression dives, to depths d1 and d2 metres respectively, separated by a given time interval, find the optimal durations of the two dives.

Usage

bestdoubledive(d1, d2, surface = 30, verbose = FALSE, model = "D", asdive=TRUE)

Value

By default (when verbose=FALSE and asdive=TRUE) the result is a dive object (object of class "dive").

Otherwise, the result is a data frame with columns t1 and t2 containing the dive durations in minutes, phi containing the value of

\(\Phi\), and case specifying which of the cases specified in Baddeley and Bassom (2012) provided the optimum. If verbose=FALSE this data frame has only one row, giving the best double dive. If verbose=TRUE then the data frame has several rows giving the candidates for optimal dive in each case of the algorithm.

Arguments

d1

Depth of first dive in metres.

d2

Depth of second dive in metres.

surface

Length of surface interval between dives, in minutes.

verbose

Logical. If TRUE, print lots of extra information, and return extra information. If FALSE (the default), just return the optimal dive.

model

The decompression model. Either a character string, containing the name of a decompression model recognised by pickmodel, or an object of class "hm" (created by hm) representing a decompression model. Defaults to the DSAT model.

asdive

Logical. If TRUE (the default), the data for the optimal dive are converted into a dive object (object of class "dive"). If FALSE, the data are returned as a data frame.

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

Details

This command implements the algorithm described by Baddeley and Bassom (2012) which calculates the ‘best’ double dive to two given depths separated by a given surface interval, without exceeding the no-decompression limits.

Consider a no-decompression dive to depth \(d_1\) metres for \(t_1\) minutes, followed by a surface interval of \(s\) minutes, followed by a no-decompression dive to depth \(d_2\) for \(t_2\) minutes. The ‘best’ double dive is defined by Baddeley and Bassom (2012) as the one which maximises the integral of depth \(\Phi = t_1 d_1 + t_2 d_2\).

References

Baddeley, A. and Bassom, A.P. (2011) Classical theory of decompression and the design of scuba diving tables. The Mathematical Scientist 36, 75-88.

See Also

pickmodel, hm, ndl, haldane

Examples

Run this code
   d <- bestdoubledive(40, 12, 15)
   plot(d)
   # Table 3 in Baddeley and Bassom (2012)
   bestdoubledive(40, 12, 15, verbose=TRUE)
   # Brief description of optimal dive
   summary(bestdoubledive(40, 12, 15))
   # Data for optimal dive
   bestdoubledive(40, 12, 15, asdive=FALSE)

Run the code above in your browser using DataLab