Re: Dive planner oddities

2015-10-12 Thread Rick Walsh
On 12 October 2015 at 18:21, Sergey Starosek 
wrote:

> Robert, Rick,
>
> On Sun, Oct 11, 2015 at 10:44 PM, Rick Walsh  wrote:
>
>> The cylinder pressure graph should start to flatten when starting
>> ascent.  Assuming a constant SAC, gas consumption varies with depth.  Is
>> that what you're referring to?
>>
> See another image attached (rec model, 1 min descent to 30 min, 17 min at
> 30 m, SAC set to 17/15 l/min). See the pressure graph spike (in red circle).
>
> Sergey
>

Yes, now I see what you mean.  I can reproduce it if the bottom time
exceeds the NDL in recreational mode.  I'm not sure about the cause.

Cheers,

Rick
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Dive planner oddities

2015-10-12 Thread Sergey Starosek
Robert, Rick,

On Sun, Oct 11, 2015 at 10:44 PM, Rick Walsh  wrote:

> The cylinder pressure graph should start to flatten when starting ascent.
> Assuming a constant SAC, gas consumption varies with depth.  Is that what
> you're referring to?
>
See another image attached (rec model, 1 min descent to 30 min, 17 min at
30 m, SAC set to 17/15 l/min). See the pressure graph spike (in red circle).

Sergey
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


[PATCH] Re: Dive planner oddities

2015-10-12 Thread Robert C. Helling
Hi,On 12 Oct 2015, at 09:21, Sergey Starosek  wrote:Robert, Rick,On Sun, Oct 11, 2015 at 10:44 PM, Rick Walsh  wrote:The cylinder pressure graph should start to flatten when starting ascent.  Assuming a constant SAC, gas consumption varies with depth.  Is that what you're referring to?See another image attached (rec model, 1 min descent to 30 min, 17 min at 30 m, SAC set to 17/15 l/min). See the pressure graph spike (in red circle).Sergey
this patch should correct this oddity.BestRobertFrom b77526a748a026c9ef3accee5a70fc29b7c8af0b Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" 
Date: Mon, 12 Oct 2015 22:03:50 +0200
Subject: [PATCH] Don't do a negative time step in recreational mode when
 beyond NDL

In recreational mode, we keep adding time at the last depth
until an ascent does violate the ceiling. Then we roll back
the last added time step and record the ascent. The test for
the ceiling violated was before adding the time so if it alreay
failed the first time we tried to unroll a time step that was
never added which resulted in a small kink in the pressure graph.

This patch corrects this logic by changin a while to a do {} while.

Furthermore, it removes the computation of deco state during the
final ascent since that is not used anywhere later.

Signed-off-by: Robert C. Helling 
---
 planner.c | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/planner.c b/planner.c
index 05fd26e..22d3716 100644
--- a/planner.c
+++ b/planner.c
@@ -1070,15 +1070,21 @@ bool plan(struct diveplan *diveplan, char 
**cached_datap, bool is_planner, bool
bool safety_stop = prefs.safetystop && max_depth >= 1;
track_ascent_gas(depth, 
_dive.cylinder[current_cylinder], avg_depth, bottom_time, 
safety_stop);
// How long can we stay at the current depth and still directly 
ascent to the surface?
-   while (trial_ascent(depth, 0, avg_depth, bottom_time, 
_dive.cylinder[current_cylinder].gasmix,
- po2, diveplan->surface_pressure / 1000.0) &&
-  enough_gas(current_cylinder)) {
+   do {
add_segment(depth_to_bar(depth, _dive),
-  
_dive.cylinder[current_cylinder].gasmix,
-  DECOTIMESTEP, po2, 
_dive, prefs.bottomsac);
+   
_dive.cylinder[current_cylinder].gasmix,
+   DECOTIMESTEP, po2, _dive, 
prefs.bottomsac);
update_cylinder_pressure(_dive, depth, depth, 
DECOTIMESTEP, prefs.bottomsac, _dive.cylinder[current_cylinder], 
false);
clock += DECOTIMESTEP;
-   }
+   } while (trial_ascent(depth, 0, avg_depth, bottom_time, 
_dive.cylinder[current_cylinder].gasmix,
+ po2, diveplan->surface_pressure / 1000.0) 
&&
+enough_gas(current_cylinder));
+
+   // We did stay one DECOTIMESTEP too many.
+   // In the best of all worlds, we would roll back also the last 
add_segment in terms of caching deco state, but
+   // let's ignore that since for the eventual ascent in 
recreational mode, nobody looks at the ceiling anymore,
+   // so we don't really have to compute the deco state.
+   update_cylinder_pressure(_dive, depth, depth, 
-DECOTIMESTEP, prefs.bottomsac, _dive.cylinder[current_cylinder], 
false);
clock -= DECOTIMESTEP;
plan_add_segment(diveplan, clock - previous_point_time, depth, 
gas, po2, true);
previous_point_time = clock;
@@ -1093,9 +1099,6 @@ bool plan(struct diveplan *diveplan, char **cached_datap, 
bool is_planner, bool
if (depth - deltad < 0)
deltad = depth;
 
-   add_segment(depth_to_bar(depth, _dive),
-   
_dive.cylinder[current_cylinder].gasmix,
-   TIMESTEP, po2, _dive, 
prefs.decosac);
clock += TIMESTEP;
depth -= deltad;
if (depth <= 5000 && depth >= (5000 - deltad) && 
safety_stop) {
-- 
1.9.5 (Apple Git-50.3)



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Dive planner oddities

2015-10-11 Thread Robert C. Helling
Sergey,

thanks for testing this. Unfortunately I think I need some more explanation of 
your findigs.

> On 11 Oct 2015, at 20:06, Sergey Starosek  wrote:
> 
> Some planner testing results:
> Reset preferences, no default divelog
> Start planner (Buehlmann model)
> Switch to recreational model
> Note that 2nd waypoint is not aligned with graph
What exactly do you mean by „not aligned“? Do you refer to the fact that the 
handle is not at the end of the 15m segment? That is on purpose, this is what 
„recreational mode“ is about: The second handle is the last manually entered 
waypoint and in recreational mode the planner stays at that depth for the 
maximum time that does not get you in conflict with gas usage and deco 
obligations.


> Change depth for the 1st and 2nd waypoint to be 30m
> Note a peak on a SAC graph
Maybe I am stupid but I cannot see it on your screen shots. Actually, I don’t 
see the pO2 graph at all. When I run subsurface, I can see the graph but no 
peak. Could you indicate on the screen shot where I am supposed to look?

> Cancel plan, close and restart ssrf
> Open planner
> Note that 2nd waypoint is not aligned with graph

As above.

Best
Robert



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Dive planner oddities

2015-10-11 Thread Rick Walsh
Hi Sergey,

Thanks for testing the planner.  The more people that try it and the more
feedback the better.

On 12 Oct 2015 6:35 am, "Sergey Starosek"  wrote:
>
> HI Robert,
>
> Away from keyboard, answering from mobile.
>
> On Oct 11, 2015 22:18, "Robert C. Helling"  wrote:
> >
> > Sergey,
> >
> > thanks for testing this. Unfortunately I think I need some more
explanation of your findigs.
> >
> > What exactly do you mean by „not aligned“? Do you refer to the fact
that the handle is not at the end of the 15m segment? That is on purpose,
this is what „recreational mode“ is about: The second handle is the last
manually entered waypoint and in recreational mode the planner stays at
that depth for the maximum time that does not get you in conflict with gas
usage and deco obligations.
>
> Thanks for the explanation,  user manual needs to clarify on this,  I
think. Will do more testing on this tomorrow.
>

Maybe we should also add a tooltip on recreational mode saying something
like, "maximize bottom time without deco".

> >> Note a peak on a SAC graph
> >
> > Maybe I am stupid but I cannot see it on your screen shots. Actually, I
don’t see the pO2 graph at all. When I run subsurface, I can see the graph
but no peak. Could you indicate on the screen shot where I am supposed to
look?
>
> I was talking about  cylinder pressure graph (SAC is irrelevant here,
just color of the line). Look for the spike just around ascent beginning.
>

The cylinder pressure graph should start to flatten when starting ascent.
Assuming a constant SAC, gas consumption varies with depth.  Is that what
you're referring to?

Cheers,

Rick
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Dive planner oddities

2015-10-11 Thread Sergey Starosek
HI Robert,

Away from keyboard, answering from mobile.

On Oct 11, 2015 22:18, "Robert C. Helling"  wrote:
>
> Sergey,
>
> thanks for testing this. Unfortunately I think I need some more
explanation of your findigs.
>
> What exactly do you mean by „not aligned“? Do you refer to the fact that
the handle is not at the end of the 15m segment? That is on purpose, this
is what „recreational mode“ is about: The second handle is the last
manually entered waypoint and in recreational mode the planner stays at
that depth for the maximum time that does not get you in conflict with gas
usage and deco obligations.

Thanks for the explanation,  user manual needs to clarify on this,  I
think. Will do more testing on this tomorrow.

>> Note a peak on a SAC graph
>
> Maybe I am stupid but I cannot see it on your screen shots. Actually, I
don’t see the pO2 graph at all. When I run subsurface, I can see the graph
but no peak. Could you indicate on the screen shot where I am supposed to
look?

I was talking about  cylinder pressure graph (SAC is irrelevant here, just
color of the line). Look for the spike just around ascent beginning.

Sergey
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface