[PATCH] Calculate deco stops, TTS and NDL
Anton Lundin
glance at acc.umu.se
Wed Jun 19 15:59:21 PDT 2013
On 19 June, 2013 - Dirk Hohndel wrote:
> On Wed, 2013-06-19 at 20:19 +0200, Anton Lundin wrote:
> > + /* should we calculate a stop depth and time or have dc already done that? */
> > + if (entry->ceiling && !entry->stopdepth) {
> > + const int time_stepsize = 10;
> > + /* FIXME: This should be configurable */
> > + const int accent_time_per_m = 1;
> > + const int accent_per_s = 200; /* 12 m/s */
>
> I'm not sure I understand these two constants... I read this as accent
> time of 1 second per meter (that's 60m/min or pretty much "blow up the
> BC and see what happens"). The next one is even better... 12 meters per
> second is 43km/h or 27mph...... but it looks like you mean 20cm/s or 12
> m/min :-)
> Which still is faster than I like, especially for the shallower parts.
> Popping up from your safety stop / last stop at 3m in 15 seconds is not
> exactly smart...
>
> So let's assume I am misunderstanding the constant names / comments :-)
Yep, commend should have bin 12 m/min.
Did some clarifications of the comments and the constant names. Also did
some separation of accent speed up to first deco stop and accent speed
between deco stops.
> > + int next_stop;
> > + int accent_depth;
> > + int stepsize = prefs.calc_ceiling_3m_incr ? 3000 : 1000;
>
> Why a minimum step of 1m? When calculating ceilings I'd do 10cm (which
> works well for both metric and imperial people). But for actual stops I
> think everyone does 10ft / 3m multiples... and the calc_ceiling_3m_incr
> definitely should NOT be used to determine the stop depths for the tts
> calculation.
This is for actual stops. I switched to 10ft / 3m steps now.
> > + } else if (!entry->ndl) {
> > + const int time_stepsize = 60;
> > + const int max_ndl = 7200;
> > + entry->ndl = max_ndl;
> > + pi->has_ndl = TRUE;
> > +
> > + /* don't try to calculate a ndl for lower values than 3m
> > + * it would take forever */
>
> Even 3m seems aggressive :-)
> That's hours and hours and hours... and if people dive on EAN50 your
> likely to run into O2 toxicity before running into deco...
Thats why theres a max_ndl of 2h =)
Anyway its more if a optimization rather than a real-world limit. We
could change it to something else if someone comes up with a less
arbitrary value =)
> > + if (entry->depth > 3000) {
> > + entry->ndl = 0;
> > + /* stop if the ndl is above max_ndl seconds, and call it plenty of time */
> > + while (entry->ndl < max_ndl && deco_allowed_depth(tissue_tolerance, surface_pressure, dive, 1) <= 0) {
> > + entry->ndl += time_stepsize;
> > + tissue_tolerance = add_segment(depth_to_mbar(entry->depth, dive) / 1000.0,
> > + &dive->cylinder[cylinderindex].gasmix, time_stepsize, ccrdive ? entry->po2 * 1000 : 0, dive);
> > + }
> > + }
> > + }
> > +
>
> Other than that the patch looks good.
>
> Would you mind sending a new rev?
Found some more things to clean up, so a new rev is comming.
//Anton
--
Anton Lundin +46702-161604
More information about the subsurface
mailing list