From f2535995f0dcf2c6541525fcb09f86f138a2c186 Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Sun, 29 Oct 2017 17:47:09 +1100 Subject: 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 --- core/profile.c | 6 ++++-- 1 file 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); } } -- cgit v1.2.3-70-g09d2