Language-Farnsworth

 view release on metacpan or  search on metacpan

lib/Language/Farnsworth/Units/Standard.pm  view on Meta::CPAN


line :=                1/12 inch; // Also defined as '.1 in' or as '1e-8 Wb'
rod :=                 11/2 surveyyard;
rd  :=                 rod;
perch :=               rod;
furlong :=             40 rod;          // From "furrow long" 
statutemile :=         statute mile;
league :=              3 statute mile;

// Calories: energy to raise a gram of water one degree celsius

cal_IT :=              41868/10000 J;    // International Table calorie
cal_th :=              4184/1000 J;     // Thermochemical calorie
cal_fifteen :=         4.18580 J;   // Energy to go from 14.5 to 15.5 degC
cal_twenty :=          4.18190 J;   // Energy to go from 19.5 to 20.5 degC
cal_mean :=            4.19002 J;   // 1/100 energy to go from 0 to 100 degC
calorie :=             cal_IT;
cal :=                 calorie;
calorie_IT :=          cal_IT;
thermcalorie :=        cal_th;
calorie_th :=          thermcalorie;
Calorie :=             kilocalorie; // the food Calorie
thermie :=          1ee6 cal_fifteen;// Heat required to raise the
                                    // temperature of a tonne of
                                    // water from 14.5 to 15.5 degC.

//
// Units derived from physical constants
//

inHg :=                inch gravity Hg;   // Inches of mercury
inH2O :=               inch gravity water;
inchmercury :=         inHg;
inchesmercury :=       inHg;              // Irregular plural
mmH2O :=               mm gravity water;
mmHg :=                mm gravity Hg;

kgf :=                 kg gravity;
technicalatmosphere := kgf / cm^2;
at :=                  technicalatmosphere;
hyl :=                 kgf s^2 / m;  // Also gram-force s^2/m according to [15]
torr :=                101325/760 Pa; // Exactly defined.  Differs from mmHg by
                                     // about 1 part in 7 million.
Torr :=                torr;     // Accepted symbol is Torr
                                // These units, both named after Evangelista
tor :=                 Pa;       // Torricelli, should not be confused.  
                                // Acording to [15] the torr is actually 
                                // atm/760 which is slightly different.

eV :=        electroncharge V;  // Energy acquired by a particle with charge e
electronvolt :=        eV;      //   when it is accelerated through 1 V
lightyear :=           c 365.25 day; // The 365.25 day year is specified in
                                    // NIST publication 811
ly :=                  lightyear;
lightsecond :=         c s;
lightminute :=         c min;
parsec :=              au radian / arcsec; // Unit of length equal to distance
pc :=                  parsec;             //   from the sun to a point having
                                           //   heliocentric parallax of 1
                                           //   arcsec (derived from parallax
                                           //   second) The formula should use
                                           //   tangent, but the error is about
                                           //   1e-12.
rydberg :=             h c Rinfinity;      // Rydberg energy
crith :=               0.089885 gram;      // The crith is the mass of one
                                           //   liter of hydrogen at standard
                                           //   temperature and pressure.
amagatvolume :=        molarvolume;
amagat :=  mol/amagatvolume;               // Used to measure gas densities
lorentz :=             bohrmagneton / (h c);// Used to measure the extent
                                           //   that the frequency of light
                                           //   is shifted by a magnetic field.
cminv :=               h c / cm;            // Unit of energy used in infrared
invcm :=               cminv;               //   spectroscopy.  
wavenumber :=          cminv;
kcal_mol :=            kcal / (mol N_A);     // kcal/mol is used as a unit of
                                            //   energy by physical chemists.
//
// CGS system based on centimeter, gram and second
//

dyne :=                cm gram / s^2 ; // force
dyn :=                 dyne;
erg :=                 cm dyne;        // energy
poise :=               gram / (cm s);  // viscosity, honors Jean Poiseuille
P :=                   poise;
poise ||| viscosity;

rhe :=                 poise^-1;        // reciprocal viscosity
rhe ||| reciprocal_viscosity;

stokes :=              cm^2 / s;       // kinematic viscosity
St :=                  stokes;
stokes ||| kinematic_viscosity;
stoke :=               stokes;
lentor :=              stokes;         // old name
Gal :=                 cm / s^2;       // acceleration, used in geophysics
galileo :=             Gal;            // for earth's gravitational field
                                       // (note that "gal" is for gallon
                                       // but "Gal" is the standard symbol
                                       // for the gal which is evidently a
                                       // shortened form of "galileo".)
barye :=               dyne/cm^2;      // pressure
barad :=               barye;          // old name
kayser :=              1/cm;           // Proposed as a unit for wavenumber
balmer :=              kayser;         // Even less common name than "kayser"
kine :=                cm/s;           // velocity
bole :=                g cm / s;       // momentum
pond :=                gram force;
glug :=            gram force s^2 / cm;// Mass which is accelerated at
                                       //   1 cm/s^2 by 1 gram force
darcy :=       centipoise cm^2 /(s atm);// Measures permeability to fluid flow.
                                       // One darcy is the permeability of a
                                       // medium that allows a flow of cc/s of
                                       // a liquid of centipoise viscosity
                                       // under a pressure gradient of atm/cm.
mohm :=                cm / (dyn s);   // mobile ohm, measure of mechanical
mobileohm :=           mohm;           //   mobility
mechanicalohm :=       dyn s / cm;     // mechanical resistance
acousticalohm :=       dyn s / cm^5;   // ratio of the sound pressure of
                                      //   1 dyn/cm^2 to a source of strength

lib/Language/Farnsworth/Units/Standard.pm  view on Meta::CPAN

//  http://www.bipm.org/pdf/si-brochure.pdf
J/kg        ||| specific_energy;
W/m^2       ||| heat_flux_density;
J/mol       ||| molar_energy;
J/(mol K)   ||| molar_heat_capacity;


// kvalue is defined as the amount of
// heat that will be transmitted through a one inch thick piece of
// homogenous material, one square foot in size, in one hour, when
// there is a one degree Fahrenheit temperature difference.
//
// Cvalue is the kvalue multiplied by the thickness in inches and thus
// gives the thermal conductance of a real piece of material with a given
// thickness.   
// Rvalue is the reciprocal of this, and refers to the thermal insulance of a
// real piece of material of a given, concrete thickness.

clo :=                 0.155 K m^2 / W;// Supposed to be the insulance 
                                      // required to keep a resting person
                                      // comfortable indoors.  The value
                                      // given is from NIST and the CRC,
                                      // but [5] gives a slightly different
                                      // value of 0.875 ft^2 degF hr / Btu.
// Misc other measures

clausius :=            1ee3 cal/K;      // A unit of physical entropy
langley :=             thermcalorie/cm^2;
poncelet :=            100 kg force m / s;
tonrefrigeration :=    ton 144 Btu / (lb day);// One ton refrigeration is
                                       // the rate of heat extraction required
                                       // turn one ton of water to ice in
                                       // a day.  Ice is defined to have a
                                       // latent heat of 144 Btu/lb.

tonsrefrigeration :=   tonrefrigeration;  // Irregular plural
tonref :=              tonrefrigeration;
refrigeration :=       tonref / ton;
frigorie :=            1000 cal_fifteen;// Used in refrigeration engineering.


// Energy in combustible fuels

TNT :=                 4184000000 J/ton;   // So you can write tons TNT, this
                                       // is a defined, not measured, value
PETN :=                6.01e6 J/kg;     // An explosive compound,
                                        // Pentaerythrite tetranitrate
                                        // used in plastic explosive like Semtex
gasoline :=            1.4e8 J/gallon;  // So you can convert energy
                                       // to gallons gasoline
gasoline_density := 0.694 g / cm^3; //Density at 300K, according to, http://wiki.answers.com/Q/How_does_temperature_affect_the_density_of_gasoline_or_petrol
natural_gas :=         1.09e6 J/foot^3; // Energy in natural gas
naturalgas :=          natural_gas;
propane :=             9.63e7 J/gallon; // Energy in liquid propane
kerosene :=            1.42e8 J/gallon; // Energy in liquid kerosene
oil :=                 41.868 GJ/metricton;
coal :=                18.20 GJ/metricton;

//
// Permeability: The permeability or permeance, n, of a substance determines
// how fast vapor flows through the substance.  The formula W = n A dP
// holds where W is the rate of flow (in mass/time), n is the permeability,
// A is the area of the flow path, and dP is the vapor pressure difference.
//
// Alan's Veto:  These are damned, damned sketchy, and are going to go.

// perm_0C :=             grain / (hr ft^2 inHg);
// perm_zero :=           perm_0C;
// perm_0 :=              perm_0C;
// perm :=                perm_0C;
//perm_23C :=            grain / (hr ft^2 in-Hg23C);
//perm_twentythree :=    perm_23C;

//
// Counting measures
//

unity :=               1;
pair :=                2;
couple :=              2;
brace :=               2;
nest :=                3;
dickers :=             10;
dozen :=               12;
bakersdozen :=         13;
score :=               20;
flock :=               40;
timer :=               40;
shock :=               60;
gross :=               144;
greatgross :=          12 gross;

// Paper counting measure

shortquire :=          24;
quire :=               25;
shortream :=           480;
ream :=                500;    
reams := ream;
perfectream :=         516;
bundle :=              2 reams;
bale :=                5 bundle;

//
// Paper measures
//

// USA paper sizes 

lettersize :=          8.5 inch 11 inch;
legalsize :=           8.5 inch 14 inch;
ledgersize :=          11 inch 17 inch;
executivesize :=       7.25 inch 10.5 inch;
Apaper :=              8.5 inch 11 inch;
Bpaper :=              11 inch 17 inch;
Cpaper :=              17 inch 22 inch;
Dpaper :=              22 inch 34 inch;
Epaper :=              34 inch 44 inch;

// The metric paper sizes are defined so that if a sheet is cut in half
// along the short direction, the result is two sheets which are

lib/Language/Farnsworth/Units/Standard.pm  view on Meta::CPAN

gph :=                 gal/hr;
gpm :=                 gal/min;
mgd :=                 megagal/day;
cf  :=                 ft^3;
ccf :=                 100 cf;      // sorta dubious, but used.
cfs :=                 cf/s;
cfh :=                 cf/hour;
cfm :=                 cf/min;
lpm :=                 liter/min;

// Miner's inch:  This is an old historic unit used in the Western  United
// States.  It is generally defined as the rate of flow through a one square
// inch hole at a specified depth such as 4 inches.  In the late 19th century,
// volume of water was sometimes measured in the "24 hour inch".  Values for the
// miner's inch were fixed by state statues.  (This information is from a web
// site operated by the Nevada Division of Water Planning:  The Water Words
// Dictionary at http://www.state.nv.us/cnr/ndwp/dict-1/waterwds.htm.)

minersinchAZ :=        1.5 ft^3/min;
minersinchCA :=        1.5 ft^3/min;
minersinchMT :=        1.5 ft^3/min;
minersinchNV :=        1.5 ft^3/min;
minersinchOR :=        1.5 ft^3/min;
minersinchID :=        1.2 ft^3/min;
minersinchKS :=        1.2 ft^3/min;
minersinchNE :=        1.2 ft^3/min;
minersinchNM :=        1.2 ft^3/min;
minersinchND :=        1.2 ft^3/min;
minersinchSD :=        1.2 ft^3/min;
minersinchUT :=        1.2 ft^3/min;
minersinchCO :=        1.56 ft^3/min;
minersinchBC :=        1.68 ft^3/min;  // British Columbia

// In vacuum science and some other applications, gas flow is measured
// as the product of volumetric flow and pressure.  This is useful
// because it makes it easy to compare with the flow at standard
// pressure (one atmosphere).  It also directly relates to the number
// of gas molecules per unit time, and hence to the mass flow if the
// molecular mass is known.

sccm :=                atm cc/min;    // 's' is for "standard" to indicate
sccs :=                atm cc/sec;    // flow at standard pressure
scfh :=                atm ft^3/hour; //
scfm :=                atm ft^3/min;
slpm :=                atm liter/min;
slph :=                atm liter/hour;
lusec :=               liter micron Hg force / s; // Used in vacuum science

// Wire gauge: this area is a nightmare with huge charts of wire gauge
// diameters that usually have no clear origin.  There are at least 5 competing
// wire gauge systems to add to the confusion.

// The use of wire gauge is related to the manufacturing method: a metal rod is
// heated and drawn through a hole.  The size change can't be too big.  To get
// smaller wires, the process is repeated with a series of smaller holes.  

// American Wire Gauge (AWG) or Brown & Sharpe Gauge appears to be the most
// important gauge. ASTM B-258 specifies that this gauge is based on geometric
// interpolation between gauge 0000, which is 0.46 inches exactly, and gauge 36
// which is 0.005 inches exactly.  Therefore, the diameter in inches of a wire
// is given by the formula 1/200 92^((36-g)/39).  Note that 92^(1/39) is close
// to 2^(1/6), so diameter is approximately halved for every 6 gauges.  For the
// repeated zero values, use negative numbers in the formula.  The same document
// also specifies rounding rules which seem to be ignored by makers of tables.
// Gauges up to 44 are to be specified with up to 4 significant figures, but no
// closer than 0.0001 inch.  Gauges from 44 to 56 are to be rounded to the
// nearest 0.00001 inch.  The table below gives 4 significant figures for all
// gauges.
//
// In addition to being used to measure wire thickness, this gauge is used to
// measure the thickness of sheets of aluminum, copper, and most metals other
// than steel, iron and zinc.

// The numbers below are DIAMETERS.
wire0000gauge :=       0.4600 in;
wire000gauge :=        0.4096 in;
wire00gauge :=         0.3648 in;
wire0gauge :=          0.3249 in;
wire1gauge :=          0.2893 in;
wire2gauge :=          0.2576 in;
wire3gauge :=          0.2294 in;
wire4gauge :=          0.2043 in;
wire5gauge :=          0.1819 in;
wire6gauge :=          0.1620 in;
wire7gauge :=          0.1443 in;
wire8gauge :=          0.1285 in;
wire9gauge :=          0.1144 in;
wire10gauge :=         0.1019 in;
wire11gauge :=         0.09074 in;
wire12gauge :=         0.08081 in;
wire13gauge :=         0.07196 in;
wire14gauge :=         0.06408 in;
wire15gauge :=         0.05707 in;
wire16gauge :=         0.05082 in;
wire17gauge :=         0.04526 in;
wire18gauge :=         0.04030 in;
wire19gauge :=         0.03589 in;
wire20gauge :=         0.03196 in;
wire21gauge :=         0.02846 in;
wire22gauge :=         0.02535 in;
wire23gauge :=         0.02257 in;
wire24gauge :=         0.02010 in;
wire25gauge :=         0.01790 in;
wire26gauge :=         0.01594 in;
wire27gauge :=         0.01420 in;
wire28gauge :=         0.01264 in;
wire29gauge :=         0.01126 in;
wire30gauge :=         0.01003 in;
wire31gauge :=         0.008928 in;
wire32gauge :=         0.007950 in;
wire33gauge :=         0.007080 in;
wire34gauge :=         0.006305 in;
wire35gauge :=         0.005615 in;
wire36gauge :=         0.005000 in;
wire37gauge :=         0.004453 in;
wire38gauge :=         0.003965 in;
wire39gauge :=         0.003531 in;
wire40gauge :=         0.003145 in;
wire41gauge :=         0.002800 in;
wire42gauge :=         0.002494 in;
wire43gauge :=         0.002221 in;
wire44gauge :=         0.001978 in;
wire45gauge :=         0.001761 in;
wire46gauge :=         0.001568 in;
wire47gauge :=         0.001397 in;
wire48gauge :=         0.001244 in;
wire49gauge :=         0.001108 in;
wire50gauge :=         0.0009863 in;
wire51gauge :=         0.0008783 in;
wire52gauge :=         0.0007822 in;
wire53gauge :=         0.0006966 in;
wire54gauge :=         0.0006203 in;
wire55gauge :=         0.0005524 in;
wire56gauge :=         0.0004919 in;

// Next we have the SWG, the Imperial or British Standard Wire Gauge.  This one
// is piecewise linear, so it is not generated by a simple formula.  It was used
// for aluminum sheets.

brwire0000000gauge :=  0.500 in;
brwire000000gauge :=   0.464 in;
brwire00000gauge :=    0.432 in;
brwire0000gauge :=     0.400 in;
brwire000gauge :=      0.372 in;
brwire00gauge :=       0.348 in;
brwire0gauge :=        0.324 in;
brwire1gauge :=        0.300 in;
brwire2gauge :=        0.276 in;
brwire3gauge :=        0.252 in;
brwire4gauge :=        0.232 in;
brwire5gauge :=        0.212 in;
brwire6gauge :=        0.192 in;
brwire7gauge :=        0.176 in;
brwire8gauge :=        0.160 in;
brwire9gauge :=        0.144 in;
brwire10gauge :=       0.128 in;
brwire11gauge :=       0.116 in;
brwire12gauge :=       0.104 in;
brwire13gauge :=       0.092 in;
brwire14gauge :=       0.080 in;
brwire15gauge :=       0.072 in;
brwire16gauge :=       0.064 in;
brwire17gauge :=       0.056 in;
brwire18gauge :=       0.048 in;
brwire19gauge :=       0.040 in;
brwire20gauge :=       0.036 in;
brwire21gauge :=       0.032 in;
brwire22gauge :=       0.028 in;
brwire23gauge :=       0.024 in;
brwire24gauge :=       0.022 in;
brwire25gauge :=       0.0200 in;
brwire26gauge :=       0.0180 in;
brwire27gauge :=       0.0164 in;
brwire28gauge :=       0.0149 in;
brwire29gauge :=       0.0136 in;
brwire30gauge :=       0.0124 in;
brwire31gauge :=       0.0116 in;
brwire32gauge :=       0.0108 in;
brwire33gauge :=       0.0100 in;
brwire34gauge :=       0.0092 in;
brwire35gauge :=       0.0084 in;
brwire36gauge :=       0.0076 in;
brwire37gauge :=       0.0068 in;
brwire38gauge :=       0.0060 in;
brwire39gauge :=       0.0052 in;
brwire40gauge :=       0.0048 in;
brwire41gauge :=       0.0044 in;
brwire42gauge :=       0.0040 in;
brwire43gauge :=       0.0036 in;
brwire44gauge :=       0.0032 in;
brwire45gauge :=       0.0028 in;
brwire46gauge :=       0.0024 in;
brwire47gauge :=       0.0020 in;
brwire48gauge :=       0.0016 in;
brwire49gauge :=       0.0012 in;
brwire50gauge :=       0.0010 in;

// The following is from the Appendix to ASTM B 258
// 
// For example, in U.S. gage, the standard for sheet metal is based on the
// weight of the metal, not on the thickness. 16-gage is listed as approximately
// .0625 inch thick and 40 ounces per square foot (the original standard was
// based on wrought iron at .2778 pounds per cubic inch; steel has almost
// entirely superseded wrought iron for sheet use, at .2833 pounds per cubic
// inch). Smaller numbers refer to greater thickness. There is no formula for
// converting gage to thickness or weight.
// 
// It's rather unclear from the passage above whether the plate gauge values are
// therefore wrong if steel is being used.  Reference [15] states that steel is
// in fact measured using this gauge (under the name Manufacturers' Standard
// Gauge) with a density of 501.84 lb/ft3 = 0.2904 lb/in3 used for steel.
// But this doesn't seem to be the correct density of steel (.2833 lb/in3 is
// closer), and nobody else lists these values.  
//
// This gauge was established in 1893 for purposes of taxation.

plate000000gauge :=    15/32 in;   // 300 oz / ft^2
plate00000gauge :=     14/32 in;   // 280 oz / ft^2
plate0000gauge :=      13/32 in;   // 260 oz / ft^2
plate000gauge :=       12/32 in;   // 240 oz / ft^2
plate00gauge :=        11/32 in;   // 220 oz / ft^2
plate0gauge :=         10/32 in;   // 200 oz / ft^2
plate1gauge :=          9/32 in;   // 180 oz / ft^2 
plate2gauge :=         17/64 in;   // 170 oz / ft^2
plate3gauge :=         16/64 in;   // 160 oz / ft^2
plate4gauge :=         15/64 in;   // 150 oz / ft^2
plate5gauge :=         14/64 in;   // 140 oz / ft^2
plate6gauge :=         13/64 in;   // 130 oz / ft^2
plate7gauge :=         12/64 in;   // 120 oz / ft^2
plate8gauge :=         11/64 in;   // 110 oz / ft^2
plate9gauge :=         10/64 in;   // 100 oz / ft^2
plate10gauge :=         9/64 in;   //  90 oz / ft^2
plate11gauge :=         8/64 in;   //  80 oz / ft^2
plate12gauge :=         7/64 in;   //  70 oz / ft^2
plate13gauge :=         6/64 in;   //  60 oz / ft^2
plate14gauge :=         5/64 in;   //  50 oz / ft^2
plate15gauge :=         9/128 in;  //  45 oz / ft^2
plate16gauge :=         8/128 in;  //  40 oz / ft^2
plate17gauge :=         9/160 in;  //  36 oz / ft^2
plate18gauge :=         8/160 in;  //  32 oz / ft^2
plate19gauge :=         7/160 in;  //  28 oz / ft^2
plate20gauge :=         6/160 in;  //  24 oz / ft^2
plate21gauge :=        11/320 in;  //  22 oz / ft^2
plate22gauge :=        10/320 in;  //  20 oz / ft^2
plate23gauge :=         9/320 in;  //  18 oz / ft^2
plate24gauge :=         8/320 in;  //  16 oz / ft^2
plate25gauge :=         7/320 in;  //  14 oz / ft^2
plate26gauge :=         6/320 in;  //  12 oz / ft^2
plate27gauge :=        11/640 in;  //  11 oz / ft^2
plate28gauge :=        10/640 in;  //  10 oz / ft^2
plate29gauge :=         9/640 in;  //   9 oz / ft^2
plate30gauge :=         8/640 in;  //   8 oz / ft^2
plate31gauge :=         7/640 in;  //   7 oz / ft^2
plate32gauge :=        13/1280 in; //   6.5 oz / ft^2
plate33gauge :=        12/1280 in; //   6 oz / ft^2
plate34gauge :=        11/1280 in; //   5.5 oz / ft^2
plate35gauge :=        10/1280 in; //   5 oz / ft^2
plate36gauge :=         9/1280 in; //   4.5 oz / ft^2
plate37gauge :=        17/2560 in; //   4.25 oz / ft^2
plate38gauge :=        16/2560 in; //   4 oz / ft^2

// Zinc sheet metal gauge

zinc1gauge :=          0.002 in;
zinc2gauge :=          0.004 in;



( run in 1.598 second using v1.01-cache-2.11-cpan-df04353d9ac )