last updated 11/2/99
Now that I have started racing 2-stroke motorcycles, I care a bit more about air density than I used to. There are air density gauges available for around $100, but since I already have my HP calculator at the track, I use it to calculate air density.
I bought a Davis Perception II weather station which gives me Temp, Barometer, and Relative Humidity. From these values, I can calculate air density.
You are more than welcome to the source code. If you change it, please leave my comments as they are to give credit to those who contributed to it.
My best work so far, Solution #3 (and simplest yet):
The numbers produced from these formulas comes within 1% to 2% of the numbers produced by Stephen Bowline's Altalab Instrument Delta-Ace air density gauge (about $450!). Using my calculator, I can "forecast" what effects say a 5 degree rise in temp would cause...something a gauge cannot do. Note, that you want the "percent of Standard Air Density".
Here's the formula used:
StdAirDensity = 1.22556 and is defined at 59.0F degrees, 0.0% humidity, and 29.92
inches on the barometer
GasConstant=287.0
Temp_c = (Temp-32.0) * 5.0 / 9.0;
Temp_k = Temp_c + 273.0;
Baro_mb = Barometer / (29.92 / 1013.0);
Baro_pa = Baro_mb * 100.0;
SaturationPressure_mb = 6.11 * pow(10,(7.5*Temp_c)/(237.7+Temp_c));
VaporPressure_mb = Humidity * SaturationPressure_mb / 100.0;
TempVirtual_k = Temp_k / (1.0 - (VaporPressure_mb/Baro_mb)*(1.-0.622));
// D = P/(T*R)
AirDensity = Baro_pa / (TempVirtual_k*GasConstant);
% Std Density = AirDensity/StdAirDensity*100
Just so I don't lose the small amount of work I did to program this in my RPN calculator, I have listed my "program" here.
Air Density Calculation (for RPN calculator)
Source Code: | air.cpp (5k) |
x86 Executable: | air.exe (53k) |
Stephen Bacon (rad@stevebacon.org) created a version for the Palm Pilot using CASL - the Compact Application Solution Language:
Palm Pilot: | RadPilot.zip (191k) |
Improved Solution 2:
I was pointed to http://usatoday.com/weather/wworks0.htm for some simpler calculations that did not require table lookups. This is what I now have programmed into my calculator! No more bulky laptop needed!
I have included some text from their site. At the time of this writing, their site had no copyright notices, so I hope it is okay to post information from their site here.
I still have an x86 version exe you can use, or a spreadsheet which shows the formulas as does the .cpp file. The word doc is a compilation of the background text for all the formulas. Enjoy.
Source Code: | air.cpp (6k) | airsrc.zip (2k) |
x86 Executable: | air.exe (58k) | airexe.zip (28k) |
Word 97 doc: | airdensity.doc (102k) | airdoc.zip (20k) |
Excel 97 xls: | airdensity.xls (21k) | airxls.zip (5k) |
Brad Turner (mbt@3Com.Com) once again made some changes so this works on a Mac. Below are his two Macintosh self extracting archive files:
Mac Source Code: | AirDensitySrc.sea (23k) |
Mac Executable: | AirDensity (41k) |
Original Solution #1:
I found my dew point calculations on the web. Excerpts from this message are in my source code below. I used a Road Racing World & Motorcycle Technology article written by Doug Walby for my air density calculation. As he shows, this is just simple scientific calculations.
Source Code: | air.cpp (10k) | airsrc.zip (3k) |
x86 Executable: | air.exe (53k) | airexe.zip (25k) |
Brad Turner (mbt@3Com.Com) made some changes so this works on a Mac. Below are his two Macintosh self extracting archive files:
Mac Source Code: | AirDensitySrc.sea (28k) |
Mac Executable: | AirDensity (45k) |