;General data file for PhysCalc ;Copyright (C) 1990 Marty White ; ;This program is free software; you can redistribute it and/or ;modify it under the terms of the GNU General Public License ;as published by the Free Software Foundation; either version 2 ;of the License, or (at your option) any later version. ; ;This program is distributed in the hope that it will be useful, ;but WITHOUT ANY WARRANTY; without even the implied warranty of ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;GNU General Public License for more details. ; ;You should have received a copy of the GNU General Public License ;along with this program; if not, write to the Free Software ;Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ;; ( All units are American unless specified otherwise ) ;---------- Dimensions ---------- ;---- All units are defined in terms of these fundamental dimensions: dimension Distance dimension Time dimension Mass dimension Angle dimension Quantity ;Discrete things: atoms, molecules, particles dimension Charge Quantity dimension Temperature dimension Phenomena ;Events, cycles, waves ;---- The following compound dimensions are composed of fundamental dimensions ;---- Compound dimensions of basic physics dimension Area Distance^2 dimension Volume Distance^3 dimension Density Mass per volume dimension Velocity Distance per time dimension Acceleration Velocity per time dimension Acceleration_Per_Time Acceleration per time dimension Momentum Mass velocity dimension Force Mass acceleration dimension Energy Force distance dimension Work Energy dimension Power Energy per time dimension Pressure Force per area dimension Frequency per time ; Phenomena per time ;---- Compound dimensions of electricity dimension Current Charge per time dimension Potential Work per Charge dimension Resistance Potential per Current dimension Resistivity Resistance distance dimension Conductivity per resistivity dimension Capacitance Charge per potential dimension ElectricField Force per Charge dimension ElectricFlux ElectricField Area dimension MagneticField Force per current distance dimension MagneticInduction Force per current area dimension MagneticFlux Energy per current dimension Inductance Energy per current^2 ;---- Compound dimensions of heat dimension HeatCapacity Energy per temperature dimension SpecificHeat Energy per mass temperature dimension ThermalConductivity Power per distance temperature dimension TemperatureShock Temperature per Time ;---- dimension HyperVolume Distance^4 dimension SolidAngle Angle^2 ;Three-dimensional angle ;dimension Viscosity Pressure or mass per distance time ? ;---------- Units ---------- Unit METER 1.0 Distance Unit MM 0.001 Meter Unit M 1.0 Meter Unit MICRON 1E-6 Meter Unit Angstrom 1E-10 Meter Unit INCH 2.540000E-2 Meter Unit IN 2.540000E-2 Meter Unit FT 3.048000E-1 Meter Unit FOOT 3.048000E-1 Meter Unit FEET 3.048000E-1 Meter Unit YARD 9.144000E-1 Meter Unit YD 9.144000E-1 Meter Unit MILE 1609.344006 Meter Unit MI 1609.344006 Meter Unit MIL 2.540000E-5 Meters Unit FURLONG 201.168002 Meters Unit FATHOM 1.828800 Meters Unit ROD 5.029200 Meters Unit LEAGUE 5633.802817 Meters Unit NAIL 2.25 inch Unit Chain 4.0 Rods ;Surveyor's or Gunter's chain (American) Unit Chain_ 100.0 Feet ;Engineer's or Ramden's chain Unit ACRE 0.0015625 Miles^2 ;American Unit BARN 1E-28 Area Unit CIRCULARMILL 5.006508E-10 Area Unit LITER 1E-3 Volume Unit L 1 Liter Unit CC 1.0 Centimeter^3 Unit GALLON 3.785411E-3 Volume Unit QUART 9.463529E-4 Volume Unit PINT 4.731764E-4 Volume Unit CUP 2.365882E-4 Volume Unit FLUIDOUNCE 2.957353E-5 Volume Unit TABLESPOON 1.478676E-5 Volume Unit TEASPOON 4.928921E-6 Volume Unit BARREL 1.589873E-1 Volume Unit HOGSHEAD 2.384809E-1 Volume Unit Kilogram 1.0 Mass ;Physcalc requires a unit be defined for 1.0 Unit GRAM 1E-3 kilogram Unit G 1 gram Unit SLUG 14.594279 kilogram ;Also a "geepound" Unit AMU 1.660026E-27 kilogram Unit TON 907.184749 kilogram Unit POUND 4.535923E-1 kilogram Unit LB 4.535923E-1 kilogram Unit OUNCE 2.834952E-2 kilogram Unit OZ 2.834952E-2 kilogram Unit Tonne 1.0 Megagram Unit GRAIN 6.479891E-5 kilogram Unit TROYOUNCE 3.110347E-2 kilogram Unit SECOND 1.0 Time Unit SEC 1.0 Second Unit S 1.0 Sec Unit MINUTE 60.0 Sec Unit MIN 60.0 Sec Unit HOUR 3599.999971 Sec Unit DAY 86400.000553 Sec Unit WEEK 604800.019547 Sec Unit MONTH 2592000.061379 Sec Unit DECADE 315576874.526635 Sec Unit CENTURY 3155768745.266350 Sec Unit MILLENIUM 31557687452.663500 Sec Unit YEAR 31657591.490439 Sec Unit Y 31657591.490439 Sec Unit FORTNIGHT 1209600.009832 Sec Unit EON 3.165759E16 Sec Unit RADIAN 1.0 Angle Unit Rad 1.0 Radian Unit DEGREE 1.745329E-2 Radian Unit ARCMINUTE 2.908882E-4 Radian ;"centesimal minute" Unit ARCSECOND 4.848137E-6 Radian Unit REVOLUTION 6.283187 Radian Unit REV 1.0 Revolutions Unit GRAD 1.570796E-2 Radian ;1/400 revolution Unit Quadrant 0.25 Revolutions Unit COULOMB 1.0 Quantity ;Charge Unit MOLE 96487.842532 Coulomb Unit MOL 96487.842532 Coulomb Unit UNIT 1.602564E-19 Coulomb Unit FARADAY 96487.842532 Coulomb Unit Steradian 1 SolidAngle Unit Sphere 12.566382 Steradian Unit Kelvin 1.0 Temperature Unit K 1.0 Kelvins Unit Cycle 1.0 Phenomena Unit Event 1.0 Phenomena ;---------- Compound units ---------- Unit KNOT 5.144032E-1 Velocity Unit C 2.998E8 Meters per Second Unit Mach 331 Meters per Second ;In dry air at STP Unit MPH 1.0 Miles per Hour Unit KPH 1.0 Kilometers per Hour Unit RPM 1.0 Revolutions per minute Unit GRAVITY 9.81 Meter per Second^2 ;---- Force Unit NEWTON 1.0 Kilogram meter per sec^2 Unit N 1.0 Newton Unit DYNE 1E-5 Newton Unit DYN 1E-5 Newton Unit POUNDFORCE 4.448399 Newton Unit POUNDAL 1.382552E-1 Newton Unit GRAMFORCE 9.803921E-3 Newton Unit POUNDAL 1.382552E-1 Newton ;---- Pressure Unit PASCAL 1.0 Pressure Unit PA 1.0 Pascals Unit Poise 10.0 Pascals ; Viscosity? something else? Unit ATMOSPHERE 101327.388793 Pascals Unit ATM 101327.388793 Pascals Unit BAR 100000.0 Pascals Unit torr 133.32 Pascals ;---- Energy and Power Unit BTU 1054.741061 Energy Unit Therm 100000 BTU Unit ERG 1E-7 Energy Unit JOULE 1.0 Newton meter Unit J 1.0 Joule Unit CALORIE 4.185852 Energy Unit CAL 4.185852 Energy Unit ELECTRONVOLT 1.602050E-19 Energy Unit EV 1.602050E-19 Energy Unit FTLB 1.356300 Energy Unit WATT 1.0 Power Unit W 1.0 Watt Unit HORSEPOWER 745.712155 Power Unit AMPERE 1.0 Quantity per time ;Current Unit A 1.0 Ampere Unit VOLT 1.0 Potential Unit V 1.0 Volt Unit OHM 1.0 Resistance Unit FARAD 1.0 Capacitance Unit F 1.0 Farad Unit HENRY 1.0 Inductance Unit GAUSS 1E-4 Mass PER Time Quantity Unit GAMMA 1E-9 Mass PER Time Quantity Unit TESLA 1.0 Mass PER Time Quantity Unit T 1.0 Tesla Unit WEBER 1.0 Distance^2 Mass PER Time Quantity Unit WB 1.0 Weber Unit HERTZ 1.0 per Second ;Frequency Unit HZ 1.0 Hertz ;---- Temperature conversion functions define c_to_k(c) = (c + 273) * 1 kelvin define k_to_c(k) = k / 1 kelvin - 273 define f_to_c(f) = 5\9 * (f - 32) define c_to_f(c) = c * 9\5 + 32 define f_to_k(f) = c_to_k(f_to_c(f)) define k_to_f(k) = c_to_f(k_to_c(k)) ;---- General Physics Constants let g_const = 6.672e-11 Newton meters^2 per kg^2 ;"G" Gravitational constant let avogadro = 6.022e23 let boltzmann = 1.381e-23 joules per kelvin let coulomb = 8.988e9 newton meter^2 per coulomb^2 let electron_charge = 1.602e-19 coulombs let planck = 6.626e-34 joule seconds let lightspeed = 2.998e8 m per s let electron_mass = 9.1095e-31 kg let proton_mass = 1.673e-27 kg let neutron_mass = 1.675e-27 kg let earth_gravity = 9.81 m per s^2 define earth_weight(mass) = mass * earth_gravity let earth_radius = 6370 km let earth_mass = 5.98e24 kg define escape_velocity(mass,distance) = sqrt(2*g_const*mass/distance) let earth_escape_velocity := escape_velocity(earth_mass,earth_radius) ; (earth-sun distance) define gravity(m1,m2,r) = g_const * m1 * m2 / (r ^ 2) let air_density = 1.29 kg per m^3 let water_density = 1000 kg per m^3 let water_fussion = 333.5 kj per kg let water_vaporization = 2.257 Mj per kg let human.heat.output = 400 btu per hour define mass.relativistic(restmass,velocity) restmass/sqrt(1-(velocity^2/lightspeed^2)) define pendulum.period(length) 2*pi*sqrt(length / 1 gravity) ; From "Architectural Acoustics" by M. David Egan, 1988: define hearing_threshold = 1e-6 atm ; wavelength of sound in air (in feet) = 1130 / frequency in hertz ; here, 1130 is the speed of sound in air ; 1 bel = log(sound intensity in W/m^2 / hearing threshold in W/m^2) ; Decibels: Li = 10 log (I / I0) ; I0 = hearing threshold = 10E-12 W/m^2 ; define decibels_to_sound_intensity(db) (10^(db/10) * I0) let hiroshima = 15 kilotons Let PI=3.1415926535897932 load math.phy load money.phy load astro.phy load light.phy