summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2017-10-29 17:47:09 +1100
committerGravatar Robert C. Helling <helling@atdotde.de>2017-10-30 21:48:15 +0100
commitf2535995f0dcf2c6541525fcb09f86f138a2c186 (patch)
treeb0f8d00f8353f7e99b492540c023334155ee17a1
parenteb62ced8a185927ca1c6328e54a84b2f684dfcd1 (diff)
downloadsubsurface-f2535995f0dcf2c6541525fcb09f86f138a2c186.tar.gz
VPM-B ceiling outside of planner: over-estimate deco_time on first iteration
This means the iterations converge from an over-estimate, consistent with planning VPM-B dives Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
-rw-r--r--core/profile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/profile.c b/core/profile.c
index e96febffb..d62caab93 100644
--- a/core/profile.c
+++ b/core/profile.c
@@ -1028,9 +1028,11 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru
if (first_iteration) {
nuclear_regeneration(t1);
vpmb_start_gradient();
- /* For CVA calculations, start by guessing deco time = dive time remaining */
+ /* For CVA calculations, deco time = dive time remaining is a good guess,
+ but we want to over-estimate deco_time for the first iteration so it
+ converges correctly, so add 30min*/
if (!in_planner())
- deco_time = pi->maxtime - t1;
+ deco_time = pi->maxtime - t1 + 1800;
vpmb_next_gradient(deco_time, surface_pressure / 1000.0);
}
}