archimedes-principle

0.0.1 • Public • Published

archimedes-principle

I had a question about helium...

The following script will serve as the example for this readme by answering that question with the help of Archimedes' principle and the ideal gas law ...

// install: `npm install gas-density-calcuator archimedes-principle`
var gaslaw = require('gas-density-calculator');
var archimedes = require('./');
 
// What volume of helium at standard pressure and temperature is required to lift one kilogram total mass?
 
var totalMass = 1;
 
// First get the density of helium at STP
var densityHelium = gaslaw.getDensity({
  molecularWeightGramMole: 4.002602,
  temperatureKelvin: 273.15,
  pressureKiloPascal: 101.325
});
 
// now get the density of air at STP
var densityAir = gaslaw.getDensity({
  molecularWeightGramMole: 28.97, // Molecular mass of air: http://www.engineeringtoolbox.com/molecular-mass-air-d_679.html
  temperatureKelvin: 273.15,
  pressureKiloPascal: 101.325
});
 
// Now determine the volume
var minVolume = archimedes.minVolumeForBouyancy({
  fluidDensity: densityAir,
  objectDensity: densityHelium,
  mass: totalMass
}).toFixed(4);
 
var gallons = minVolume * 264.17;
 
console.log("at standard temperature and pressure, a "+Math.ceil(gallons)+" gallon bag filled with helium can probably make 1kg mass bouyant");

Let's run it:

luchia :: ~/Projects/archimedes-principle ‹master*› » node helium.js
at standard temperature and pressure, a 238 gallon bag filled with helium can probably make 1kg mass bouyant

Readme

Keywords

none

Package Sidebar

Install

npm i archimedes-principle

Weekly Downloads

1

Version

0.0.1

License

BSD-2-Clause

Last publish

Collaborators

  • keyvanfatehi