Date
1  1 of 1
Descent rate calculation
Jerry
Someone asked how descent rate is calculated. The comments in the code (javascript) below show the calculation. This is part of the worker.js file that does all the wind download and calculations if you are really interested. Finally, here is a link to my presentation if you want to check out the links in it: https://dl.dropboxusercontent.com/u/9446302/gpslPresentation/Presentation.pptx // For the decent we need to calculate the descent rate at the various zones.
// the formula for velocity is
// V = sqrt((2*m*g)/(d*a*c))
// V = velocity in m/s
// m = mass in Kg
// g = gravity
// d = Air density Kg/m^3
// a = area
// c = drag coefficient
// since everything is constant except d and V this reduces to
// V = 1/SQRT(d) * velConstant.
// since we are given the velocity at sea level we can calc. velConstant from
// velConstant = V/SQRT(d)
// density (d) at sea level is 1.225 kg/m^3
var velConstant = currentPrediction.descentRate * Math.sqrt(1.225);
// This is the altitude entered for the TD alt
var TDTargetAlt = currentPrediction.TDTargetAlt;
// a couple of variables needed to get the ground alt. from google
var tmpWaypoints = new Array();
var TDLocs = []; // array of latLng passed to googlr to get the altitudes
// time for the descent calculation
var looplimit = 0;
while (current.alt > TDTargetAlt && looplimit < 50000) {
looplimit++;
// get the weather info on the current WP
var WPInfo = getWPInfo(current.secs, current.lat, current.lng, current.alt);
var descRate = 1 / Math.sqrt(WPInfo.density) * velConstant;
var zoneSeconds = (current.alt  TDTargetAlt) / descRate;
if (zoneSeconds > 15) {
// set the zone to 15 seconds
zoneSeconds = 15;
targetAlt = current.alt  (zoneSeconds * descRate);
} else {
targetAlt = TDTargetAlt;
}

