It would be nice to see an average RMV being calculated based off of the data that came out of the computer. I assume that you can get the pressures from air integrated computers so calculating an average RMV for each dive should not be too hard to integrate.
Thanks. Let me know if you need help with anything else. I love this idea.
cool :) so if u're happy with the maths they'll be in production tmrw morning after i drop kid @ school ;)
(and everything will recalculate magically ;) )
plenty kudos for your help and support !
Sweet. So can we apply this to all profiles? I love what you are doing with Diveboard. I have wanted to do something similar for a long time. Good Job!
this is what i get when usign the real values
(avg depth being 14.860869565217392 m calculated from profile)
Those calculations are correct using this site you gave me earlier: http://divenerd.com/sac-rmv/metric.html.
I think we have it. Can you apply imperial to some so we can validate?
humm actually pressure difference is not 40 but 140 (180 - 40)
SAC = (140 / 38) / ((18 /10) + 1) = 1.32 BAR/min
RMV = 1.32 * (12) = 15.78 L/min
sounds like an awful lot doesn't it ?
The numbers in the detail section look good. I just know for the RMV in SI you do not use the pressure rating. Can you apply that formula to my Corsair dive so I can check the math?
here are the details :
I think your metric units are still off.
This is what I got.
SAC = (40 / 38) / ((18 /10) + 1) = .37 BAR/min
RMV = .37 * (12) = 4.44 L/min
That makes sense but I assumed 18m average depth.
The information needed to sanity check your code is:
Start pressure & units
End Pressure & units
Average Depth & units
In your original code example I think line 45 is where the problem is. Looks like you were using the volume of the tank instead of a 'tank baseline' type number. Your new results look reasonable. Is there someplace to read the average depth on the site? I can see you using it in the code example, but can't find it for your example dive.
Ok, I figured it out. When calculating SI it is
RMV = SAC * tank_size
For Imperial it is RMV = SAC * (tank_size / tank_rating)
Does that make sense?
For SI everything it in BAR. For Imperial you are using ATA and PSI so you have to convert.
lookign better now :
in imperial units (for my tank : http://stage.diveboard.com/ksso/5430)
yeah... i'm a heavy breather ...
does that sound realistic ?
I need to add the tank pressure rating as a user modifiable field...
def pressure_rating (si=true)
return 236 #236 bars
return 3420 #3420 psis
So I just calculated it out using my formula and it makes sense.
Baseline for calculation (agnostic of unit): http://www.diveboard.com/johnlento/5283
SAC = ((2936-1096) / 28) / ((100 / 33) + 1)
SAC = 16.35 PSI/minute
RMV = 16.35 * (80 / 3000)
RMV = 0.436
I think something in the code is dorked. I will take a look in a minute...PHP is not my strong suit.
That did help. Here is what I came up with. Tell me what you think.
metricSAC = (p_diff / btime) / ((avdepth / 10) + 1)
metricRMV = metricSAC * (tankVol / tankRatedPressure)
Not sure which variables had the tank volume or rated pressure...
this is how we calculate it
let me know 1) if it helps
2) if you find any issue :)
def SAC_n (si=true)
My bad on the baseline. Mixed up multiplication and division. I think the site SAC is actually RMV. Thanks for double checking Jason.
The calculation on the site seems to be about right, but I can't double-check the math without the average depth for the dive.
The Tank Baseline Formula is definitely wrong. It should be Volume / Rated Pressure.