sijomon
10-07-2011, 15:29
Hi,
I am playing around trying to get a better understanding of how dive computers work by implementing a simulation of one myself. I have started with the Buhlman ZH-L16 alogrithm. I am restricting myself to nitrogen as the only inert gas, and am using the A version of the a/b values. I have the basic compartment pressure calculations done, I think correctly, and can therefore calculate the insert gas loading in each compartment as the simulated dive progresses. I have also got the minimum tolerated inspired gas pressure calculations sorted, so now I can calculate the ascent ceiling for each compartment. What I am currently having trouble with is calculating the 'no stop limit' for each compartment.
I am using the equation:
t = (-1/k)*ln[(Pi - Mo)/(Pi - Po)]
where:
t = the no-stop time for the compartment
k = ln(2) / compartment half life
Pi = pressure of inert gas inspired
Mo = surfacing M value for compartment
Po = current compartment inert gas pressure
all of this I have got from some papers by Erik Baker (you can find the no-stop time one here (http://www.ddplan.com/reference/ndl.pdf)). I shoud note that I am limiting the application of this equation to the cases where 0 < (Pi - Mo)/(Pi - Po) <= 1 ( I default it to 0 otherwise) as specified in the Baker paper.
What I'm expecting is that the no-stop time reaches 0 at exactly the same time that the minimum tolerated inspired gas pressure becomes greater than 1bar (i.e. the ascent ceiling is below the surface). This is working fine for the descents. However when I start to ascend the no-stop time sometimes becomes positive again even when the ascent ceiling is still below the surface.
My maths is nowhere near good enough to resolve this issue thorugh analysis of the equations, so I was hoping someone here has sufficient knowlegde of this subject, and can explain things in sufficiently simple terms to help me identify what I'm doing wrong.
I appreciate there may well not be enopugh information here to resolve the problem and am happy to provide more details as neccessary.
The current version of my simulation is avaiable at:
http://bsac.sijomon.com/labs.jsp
many thanks for any help anyone can provide, it will be appreciated.
Simon.
I am playing around trying to get a better understanding of how dive computers work by implementing a simulation of one myself. I have started with the Buhlman ZH-L16 alogrithm. I am restricting myself to nitrogen as the only inert gas, and am using the A version of the a/b values. I have the basic compartment pressure calculations done, I think correctly, and can therefore calculate the insert gas loading in each compartment as the simulated dive progresses. I have also got the minimum tolerated inspired gas pressure calculations sorted, so now I can calculate the ascent ceiling for each compartment. What I am currently having trouble with is calculating the 'no stop limit' for each compartment.
I am using the equation:
t = (-1/k)*ln[(Pi - Mo)/(Pi - Po)]
where:
t = the no-stop time for the compartment
k = ln(2) / compartment half life
Pi = pressure of inert gas inspired
Mo = surfacing M value for compartment
Po = current compartment inert gas pressure
all of this I have got from some papers by Erik Baker (you can find the no-stop time one here (http://www.ddplan.com/reference/ndl.pdf)). I shoud note that I am limiting the application of this equation to the cases where 0 < (Pi - Mo)/(Pi - Po) <= 1 ( I default it to 0 otherwise) as specified in the Baker paper.
What I'm expecting is that the no-stop time reaches 0 at exactly the same time that the minimum tolerated inspired gas pressure becomes greater than 1bar (i.e. the ascent ceiling is below the surface). This is working fine for the descents. However when I start to ascend the no-stop time sometimes becomes positive again even when the ascent ceiling is still below the surface.
My maths is nowhere near good enough to resolve this issue thorugh analysis of the equations, so I was hoping someone here has sufficient knowlegde of this subject, and can explain things in sufficiently simple terms to help me identify what I'm doing wrong.
I appreciate there may well not be enopugh information here to resolve the problem and am happy to provide more details as neccessary.
The current version of my simulation is avaiable at:
http://bsac.sijomon.com/labs.jsp
many thanks for any help anyone can provide, it will be appreciated.
Simon.