<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Jan,<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 21.05.2015, at 00:11, Jan Darowski <<a href="mailto:jan.darowski@gmail.com" class="">jan.darowski@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hi!<br class="">Here is the current VPM-B project's state:<br class=""></div></blockquote><div><br class=""></div><div>Thanks a lot for your report. Here are a few comments:</div><br class=""><blockquote type="cite" class=""><div class="">I've been mostly working on two things: better understanding the<br class="">algorithm and getting through the existing subsurface planning code.<br class="">Lately I've started coding some skeleton of the vpm-b implementation.<br class="">My first idea was to seperate it completely from the Subsurface code.<br class="">Robert Helling told me that there is a lot of code that can be used<br class="">inside vpm-b and maybe I should consider just branching the existing<br class="">code and working on it.<br class="">The problem here is, that current implementation of the planner code<br class="">is completely unprepared for adding new deco algorithms. I would spend<br class="">more time on refactoring and seeking integration bugs than on writting<br class="">vpm-b. So wanting to first focus on the algorithm, I'm creating a new<br class="">code, which includes only few Subsurface files (dive.h, units.h).<br class="">Doing this, I can write implementation based on the Subsurface data<br class="">structures, using helping functions, without loosing control over the<br class="">whole code. Of course my implementation is based on how current deco<br class="">code is written.<br class=""></div></blockquote><div><br class=""></div><div>Please, please do not reinvent the wheel. There is much more that can be shared. All the code for computing tissue loadings (add_segment in deco.c and related functions) are identical in both algorithms. It is just the surfacing conditions (<span style="color: rgb(128, 128, 0);" class="">static</span><span style="color: rgb(192, 192, 192);" class=""> </span><span style="color: rgb(128, 128, 0);" class="">double</span><span style="color: rgb(192, 192, 192);" class=""> </span>tissue_tolerance_calc(<span style="color: rgb(128, 128, 0);" class="">const</span><span style="color: rgb(192, 192, 192);" class=""> </span><span style="color: rgb(128, 128, 0);" class="">struct</span><span style="color: rgb(192, 192, 192);" class=""> </span><span style="color: rgb(128, 0, 128);" class="">dive</span><span style="color: rgb(192, 192, 192);" class=""> </span>*dive)</div>
<div class="">) that differ (plus an iteration in the case of VPM): For VPM, there are no a- and b-factors but there is a fixed allowed overpressure (that is determined in the “critical volume algorithm).</div><div class=""><br class=""></div><div class="">Please reuse as much code as possible, since in the end we don’t want to have a separate vpm program but we want to have Buehlmann and vpm both in subsurface next to each other so they can be compared. Also doubling code is not a good idea since in later debugging this will lead to terrible problems when the two versions diverge.</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><br class="">About the algorithm: I've been planning to prepare the first part of<br class="">the algorithms description (what algorithm does before the deco,<br class="">during the dive simulation) by now but it appears to be quiet trivial:<br class="">It calculates gas pressure in the tissue compartments just like<br class="">current deco.c implementation but using more precise Schreiner<br class="">equation (instead of  Haldane) </div></blockquote><div><br class=""></div><div>That’s what I mean. So please use the existing code (and if you find bugs there, correct them of course).</div><div><br class=""></div><div>The difference between “Haldane” and “Schreiner” are in practice non-exsistant: The true, underlying eqaution for both is</div><div><br class=""></div><div>d tissue_pressure / dt = - gamma (ambient_pressure(t) - tissue_pressure)                    (*)</div><div><br class=""></div><div>where for Haldane the solution with constant in time ambient pressure is taken while for Schreiner it can vary linearly. But what we effectively do is simulate the differential equation (*) since we only add segments of at most one minute duration for which it is pretty save to assume the ambient pressure to stay constant over that time. So Haldane is enough. You don’t gain significant precision if you take the variation of depth during that minute into account.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class="">and keeps track of the maximum crushing<br class="">pressure (difference between gas pressure in the compartment and<br class="">ambient pressure). </div></blockquote><div><br class=""></div><div>Yes, that should be added to add_segment.</div><br class=""><blockquote type="cite" class=""><div class="">And that's all!<br class=""><br class="">As soon as my implementation will correctly read input files and<br class="">simulate gas pressures, I will link a repo so anyone could take a look<br class="">at it. I hope it will be done this weekend.<br class=""></div></blockquote></div><div class=""><br class=""></div>Good. Just keep in mind that in the end the input will just be for Buehlmann in subsurface (i.e. in terms of a struct diveplan) and not in terms of an input file.</div><div class=""><br class=""></div><div class="">Best</div><div class="">Robert<br class=""><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); font-family: Menlo;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class="">-- <br class="">.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO<br class="">Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics<br class="">                      Scientific Coordinator<br class="">                      Ludwig Maximilians Universitaet Muenchen, Dept. Physik<br class="">                      Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339<br class="">                      <a href="http://www.atdotde.de" class="">http://www.atdotde.de</a></div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Enhance your privacy, use cryptography! My PGP keys have fingerprints</div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">A9D1 A01D 13A5 31FA 6515  BB44 0820 367C 36BC 0C1D    and</div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F</div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div></div></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""></div></body></html>