# First dive to 25 m for 20 min with safety stop
d1 <- dive(c(25,20),c(5,5))
# Evaluate saturation according to DSAT model
s1 <- haldane(d1)
s1
# Look at saturation (in ata)
barplot(s1$N2, ylab="Saturation (ata)")
# Look at relative saturation
M0 <- param(pickmodel("D"), "N2", "M0")
barplot(100 * s1$N2/M0, ylab="Saturation (percent)")
# Evaluate saturation after 2 hour surface interval
s2 <- haldane(dive(c(0,120)), prevstate=s1)
# Then after another dive to 18 m for 30 min with safety stop
s3 <- haldane(dive(c(18, 30),c(5,3)), prevstate=s2)
# Assess effect of breathing 80\% oxygen at safety stop
s3o <- haldane(dive(c(18, 30),5, nitrox(0.8), c(5,3)), prevstate=s2)
# Inspect saturation during dive d1 at time 10 minutes
s10 <- haldane(chop.dive(d1, 0, 10))Run the code above in your browser using DataLab