IntroductionOne feature that Hewlett-Packard left out of the hp39g+ calculator was unit conversions and physical constants. Aplet Convert allows conversion between a wide range of metric and imperial units, over one thousand different combinations, and also includes a number of commonly used physical constants. |
Unit conversions on the hp 39g+ Graphing CalculatorUnfortunately there seems to be no way within the hp39g+'s programming language to read a value from the home screen or return a value directly to home. This is one situation where the old style of 'keystroke programmable' calculators had an advantage. Units are grouped by type (length, area, power etc.) so there is no chance of a meaningless conversion, such as feet to joules. |
Loading ConvertConvert is an aplet with several linked programs and should be transferred to the hp39g+ in the usual way, i.e.:
If you are typing in the program by hand (not recommended since it would be easy to mistype the conversion values), start by saving a copy of the Polar aplet, named Convert, then type in each of the programs listed at the end of this help file with the names shown into the Program catalog. The instructions text shown below will also need to be typed into Convet's note. |
Deleting ConvertDelete Convert from the APLET catalog. The helper programs then need to be individually deleted from the PROGRAM catalog. For easy identification the files all have names of the form .Conv.XXX. |
Setting up ConvertIf you have transferred Convert directly from a PC its VIEWS menu will already be set and this stage can be ignored. |
Running ConvertBefore beginning to use Convert or after using a different aplet, START Convert from the calculator's aplet catalog. This brings up a text note with brief instructions on usage, as shown below: Press VIEWS Select unit type Choose 'from' units Choose 'to' units Conversion factor is in q (X,T,q key). Temperatures: Store value in q Choose 'from' & 'to' Converted value in q Constants: Choose constant Value in qPressing HOME or changing to another screen will remove this message. Convert is meant to be used from the home screen. The general sequence of operations is:
This should become clear with an example. Suppose you want to convert 12 inches to millimetres.
Remember that the last used conversion factor is still stored in q so to convert another value in inches to millimetres there is no need to go through the menus again; just multiply by q. Whenever any of the Convert menus are displayed, pressing CANCEL (softkey 5) will exit Convert and return you to the previous screen, but the value stored in q is uncertain and should not be used. Converting TemperaturesTemperature conversions are a bit more complicated because it is not possible to use a simple conversion factor. Different scales have different zero points so there is an addition or subtraction step as well. To convert 25 degrees Celsius to Kelvins:
Accessing the Physical ConstantsPhysical constants are used in a similar way, via the variable q, except there is only one choosing step. What is the mean thermal kinetic energy of a gas molecule at a temperature of 800 Kelvins?
Within each conversion group the units are listed in a reasonably consistent order, i.e. metric units, then imperial units, then less common or specialist units. Note: the keys SYMB, PLOT and NUM do not do anything useful in aplet Convert. |
AccuracyConversion factors are taken from reliable and cross-checked sources and are stored to six significant figures, so should be accurate to within a few parts per million. |
Hardware RequirementsConvert runs on a Hewlett-Packard 39g+ calculator. It should also work on the 39g, 39gs and 40gs, and may work on the 38g, 48g, 49g and 50g but has not been tried. The 48 series onwards already has some conversions and constants built in anyway. The aplet and associated programs take up 13 kilobytes of RAM. This can be reduced if necessary by deleting the programs for any types of conversion not needed. |
Variables UsedConvert uses the HOME variables q, Z and Y, and will therefore overwrite any existing information stored in them. It also changes the 'last answer' variable (Ans.) |
Known BugsSince only one value can be stored in q at a time, it is not possible to use two or more physical constants or conversion factors in a single expression. Either copy the constants/factors to other variables or break the expression down into smaller sections. |
Conversions ProvidedThis is a full list of all the unit conversion factors and physical constants used by Convert. |
Units of Length Conversion factors are to metres | ||
---|---|---|
Displayed as | Multiplication factor | Notes |
millimetre | 0.001 | Millimetres |
centimetre | 0.01 | Centimetres |
metre | 1 | Metres |
kilometre | 1000 | Kilometres |
inch | 0.0254 | Inches |
foot | 0.3048 | Feet |
yard | 0.9144 | Yards, = 3 feet |
pole [rod] | 5.0292 | Poles, rods and perches are all the same unit, = 5½ yards. |
chain | 20.1168 | Chains, = 22 yards |
furlong | 201.168 | Furlongs, = 10 chains |
mile | 1609.344 | Miles, UK statute, = 1760 yards |
league | 4828.032 | Leagues, = 3 miles |
fathom | 1.8288 | Fathoms, = 6 feet |
nautical mile | 1852 | Nautical miles. There are three definitions of the nautical mile. Originally it was the distance along the Earth's equator equivalent to a change in longitude of one minute of arc. This was taken to be 6080 feet. Sometimes a 'rounded' nautical mile was used as exactly 1000 fathoms, which is 6000 feet. The international nautical mile which is the one most commonly used nowadays, and is the one used by Convert, is defined as 1852 metres, which equates to 6076 feet. |
astronom. unit | 1.4959787 x 1011 | Astronomical units, the mean distance between the Earth and the Sun. (Actually the definition is slightly more complicated and involves a theoretical massless Earth.) |
light year | 9.46053 x 1015 | Light years, the distance travelled by light through empty space in one tropical year of 365.24219 days. |
parsec | 3.08568 x 1016 | Parsecs (parallax seconds), the distance at which one astronomical unit subtends an angle of one second of arc. |
hand (horse) | 0.1016 | Hands, as used to measure the height of horses, = 4 inches. |
Units of Area Conversion factors are to square metres | ||
---|---|---|
Displayed as | Multiplication factor | Notes |
mm² | 1 x 10-6 | Square millimetres |
cm² | 0.0001 | Square centimetres |
m² | 1 | Square metres |
hectare | 10,000 | Hectares, = 10,000 square metres |
km² | 1000,000 | Square kilometres |
inch² | 6.4516 x 10-4 | Square inches |
foot² | 0.092903 | Square feet |
yard² | 0.836127 | Square yards |
rood | 1011.71 | Roods, = 1210 square yards |
acre | 4046.86 | Acres, = 4 roods |
mile² | 2589988 | Square miles |
Units of Volume Conversion factors are to cubic metres | ||
---|---|---|
Displayed as | Multiplication factor | Notes |
mm^3 | 1 x 10-9 | Cubic millimetres |
cm^3 | 1 x 10-6 | Cubic centimetres |
metre^3 | 1 | Cubic metres |
km^3 | 1 x 109 | Cubic kilometres |
inch^3 | 1.63871 x 10-5 | Cubic inches |
foot^3 | 0.0283168 | Cubic feet |
yard^3 | 0.764555 | Cubic yards |
mile^3 | 4.16816 x 109 | Cubic miles |
millilitre | 1 x 10-6 | Millilitres, same as cubic centimetres |
litre | 0.001 | Litres, = 1000 cubic centimetres |
dram | 3.55164 x 10-6 | Drams, = 1/8 of a UK fluid ounce |
fluid oz (UK) | 2.84131 x 10-5 | British fluid ounces |
gill | 1.42066 x 10-4 | Gills, = ¼ of a UK pint |
pint (UK) | 5.68262 x 10-4 | British pints |
gallon (UK) | 0.0045461 | British gallons, = 8 pints |
teaspoon | 4.92892 x 10-6 | Teaspoonful, taken as approx 5 mls |
tablespoon | 1.47868 x 10-5 | Tablespoonful, taken as approx 15 mls |
fluid oz (US) | 2.95735 x 10-5 | American fluid ounce (slightly more than a British fluid ounce) |
pint (US) | 4.73176 x 10-4 | American pint, = 16 American fluid ounces. Thus smaller than a British pint. |
gallon (US) | 0.00378541 | American gallon, = 8 American pints |
barrel (oil) | 0.158987 | Barrel of oil, = 42 American gallons |
Units of Mass/Weight Conversion factors are to kilograms | ||
---|---|---|
Displayed as | Multiplication factor | Notes |
milligram | 1 x 10-6 | Milligrams |
gram | 0.001 | Grams |
kilogram | 1 | Kilograms |
tonne (metric) | 1000 | Metric tonnes, = 1000 kilograms |
grain (avoir) | 5.90615 x 10-5 | Grains in the Avoirdupois system. Avoirdupois is the normal system of Imperial weight measurement, as used for buying food and cooking. There are 480 grains in an ounce.Note however that when 'grains' are referred to it is often Troy grains rather than Avoir grains which are intended. 480 Avoir grains = 437½ Troy grains. |
dram (avoir) | 0.00177185 | Drams in the Avoirdupois system, = 1/16 ounce Avoir. Notice that a dram can also be a unit of volume. |
ounce (avoir) | 0.0283495 | Ounces (Avoirdupois). The normal British ounce. |
pound (avoir) | 0.45359237 | Pounds (Avoirdupois). The standard British pound weight. |
stone | 6.35029 | Stone, = 14 pounds |
hundredweight | 50.80231 | Hundredweight, often written cwt, = 112 pounds |
ton (UK) | 1016.05 | British ton, = 2240 pounds |
troy grain | 6.47989 x 10-5 | Grains in the Troy measurement system, as used for precious metals |
troy pennywt | 0.00155517 | Troy pennyweights, = 24 Troy grains |
troy ounce | 0.0311035 | Troy ounce, = 480 Troy grains |
troy pound | 0.373242 | Troy pound, = 12 Troy ounces |
carat | 2 x 10-4 | Carat, the unit of weight of precious stones. The carat was originally 4 Avoirdupois grains (approx 207 milligrams), but early in the 20th century was redefined to be exactly 200 milligrams. |
ton (US short) | 907.185 | American 'short' ton, = 2000 pounds |
atom mass unit | 1.66054 x 10-27 | Atomic mass unit. This is defined s 1/12 of the mass of an atom of 12Carbon and is the 'average' mass of protons and neutrons in a nucleus. |
Units of Speed Conversion factors are to metres per second | ||
---|---|---|
Displayed as | Multiplication factor | Notes |
metre/sec | 1 | Metres per second |
kilom/hour | 1/3.6 | Kilometres per hour |
foot/sec | 0.3048 | Feet per second |
mile/hour | 0.44704 | Miles per hour |
knot | 0.514444 | Nautical miles per hour |
Units of Force Conversion factors are to Newtons | ||
---|---|---|
Displayed as | Multiplication factor | Notes |
newton | 1 | Newtons |
dyne | 1 x 10-5 | Dynes, the standard unit of force in the centimetre, gram, second system. |
kg force | 9.80665 | Kilograms force, i.e. the force exerted by a mass of one kilogram on the Earth's surface |
pound force | 4.44822 | Pounds force, the force exerted by a weight of one pound |
Units of Pressure Conversion factors are to Newtons per square metre (Pascals) | ||
---|---|---|
Displayed as | Multiplication factor | Notes |
pascal [N/m²] | 1 | Pascals or newtons per square metre |
megapascal | 1 x 106 | Megapascal, = 1 million pascals |
kg/cm² | 98066.5 | Kilograms force per square centimetre |
psi [lbs/in²] | 6894.76 | Pounds force per square inch |
mmHg [torr] | 133.322 | Millimetres of mercury, also known as Torrs |
millibar | 100 | Millibars, = 1/1000 of a bar |
atmosphere | 101325 | The standard average atmospheric pressure at the Earth's surface |
Units of Energy Conversion factors are to Joules | ||
---|---|---|
Displayed as | Multiplication factor | Notes |
joule | 1 | Joules, the work done when a force of one newton moves through a distance of one metre |
electron volt | 1.60218 x 10-19 | Electron volts, the energy gained by an electron when it is moved through a potential of one volt |
kilowatt hour | 3.6 x 106 | Kilowatt hours, a power of 1000 watts operating for one hour |
erg | 1 x 10-7 | Ergs, one dyne moving a distance of one centimetre |
calorie | 4.1868 | Calorie, the energy needed to raise the temperature of one gram of water by one degree Celsius. The value of the calorie depends on the specific heat capacity of water, which varies with its temperature and to a small extent with the ambient pressure. Thus there are slightly different values of the calorie depending on the conditions. The '15 degree' calorie refers to heating water from 14.5 to 15.5 °C and equals 4.1855 J. The 'thermochemical' calorie uses the average specific heat capacity between 0 and 100°C and equals 4.184 J. The 'international thermodynamic' calorie is the most commonly used and equals 4.1868 J. |
kilocal [Cal] | 4186.8 | Kilocalories, often written as Calories with a capital C, = 1000 calories. The energy content of food is usually quoted in kilocalories but if it is just written as Calories it can be confusing. 1 Calorie = 1000 calories. |
foot pound | 1.35582 | Foot pounds, the work done when one pound force moves through a distance of one foot |
BTU | 1055.06 | British Thermal Units, the energy needed to raise the temperature of one pound of water by 1 degree Fahrenheit |
therm | 105,506,000 | Therms, = 100,000 British Thermal Units. The energy content of domestic gas is sometimes quoted in therms. |
Units of Power Conversion factors are to Watts (Joules per second) | ||
---|---|---|
Displayed as | Multiplication factor | Notes |
watt | 1 | Watts, = 1 joule per second |
kilowatt | 1000 | Kilowatts, = 1000 watts |
horsepower | 745.7 | Horsepower, originally defined as 550 foot pounds force per second |
BTU/hour | 0.293071 | British Thermal Units per hour, sometimes used for domestic energy consumption |
kcal/hour | 1.163 | Kilocalories per hour, used as a measure of the rate of using up the energy in food. Coincidentally it is just over one watt. |
Units of Temperature Conversions are to Kelvins | |||
---|---|---|---|
Displayed as | Multiply by: | Add: | Notes |
Kelvin | 1 | 0 | Kelvins, the absolute temperature scale such that absolute zero is 0 Kelvins. |
°Celsius | 1 | 273.15 | Celsius, formerly known as centigrade. Freezing point of water = 0°C, boiling point of water = 100°C. |
°Fahrenheit | 5/9 | 255.37 | Fahrenheit Freezing point of water = 32°F, boiling point of water = 212°F. |
°Réaumur | 1.25 | 273.15 | Réaumur, named after Antoine Réaumur (1683-1757). Freezing point of water = 0°R, boiling point of water = 80°R. |
°Rankine | 5/9 | 0 | Rankine, an absolute scale with units the same size as Fahrenheit |
Gas Mark | 125/9 | 394.26 | Gas mark, as used for the temperature setting of gas ovens. This conversion method only works for gas marks between 1 and 9; gas mark ¼ and ½ do not fit the scale and ovens do not go above 9. |
Physical Constants The normal one or two letter abbreviation is shown. All use SI units (kilograms, metres, seconds etc.) | |||
---|---|---|---|
Displayed as | Value | Units | Notes |
c light | 2.99792458 x 108 | m/s | Speed of light |
G gravity | 6.6742 x 10-11 | Nm²/kg² | Newton's gravitational constant. |
g acc gravity | 9.80665 | m/s² | Standard acceleration due to gravity at the Earth's surface |
e elec charge | 1.6021773 x 10-19 | Coulombs | Charge on the electron |
h Planck | 6.6260755 x 10-34 | Js | Planck's constant |
k Boltzmann | 1.380658 x 10-23 | J/K | Boltzmann constant |
s Stefan | 5.67051 x 10-8 | W/m²/K4 | Stefan's constant for black body radiation |
N Avogadro | 6.0221367 x 1023 | /mol | Avogadro's constant, the number of atoms or molecules in one mole of a substance |
R ideal gas | 8.31451 | J/K/mol | The ideal gas constant, in the equation PV = nRT |
V0 gas mol v | 0.0224141 | m³/mol | Gas molar volume V0. The volume occupied by one mole of an ideal gas. |
F Faraday | 96485.31 | C/mol | Faraday constant. The electric charge of one mole of electrons. Used e.g. in electrochemistry. |
m0 permeabil | 4p x 10-7 | H/m | Permeability of free space, m0. The ratio of magnetic flux density to external field strength. |
e0 permittiv | 8.8541878 x 10-12 | F/m | Permittivity of free space, e0. Used e.g. in calculating the force between two charges: F=(1/4pe0)Q1Q2/r². |
a fine struc | 0.0072973531 | None | Fine structure constant. Defined as e²/(2he0c). Note that a is a dimensionless constant and thus has the same value in any system of units. It happens to have a value close to 1/137 and physicists sometimes wonder about the significance of this number. |
Me elec mass | 9.1093897 x 10-31 | kg | Rest mass of the electron |
Mp prot mass | 1.6726231 x 10-27 | kg | Rest mass of the proton |
Mn neut mass | 1.6749286 x 10-27> | kg | Rest mass of the neutron |
R¥ Rydberg | 1.0973732 x 107 | /m | Rydberg constant. Used when calculating atomic spectra. Do not confuse with the gas constant R. R¥ = m0²mee4c³/8h³ |
Program ListingsNote: the character ̃ represents the 'STO' arrow. |
Program .Conv.SV | Explanation |
---|---|
Defines the VIEWS menu. Only needs to be run once, when the aplet is first written, or if the views menu is changed. | |
SETVIEWS "Length";".Conv.LEN";0; "Area";".Conv.ARE";0; "Volume";".Conv.VOL";0; "Mass";".Conv.MAS";0; "Speed";".Conv.SPE";0; "Force";".Conv.FOR";0; "Pressure";".Conv.PRE";0; "Energy";".Conv.ENG";0; "Power";".Conv.POW";0; "Temperature";".Conv.TEM";0; "Start";".Conv.S";8; "Constants";".Conv.CON";0; " ";".Conv.SV";10:¿ | Define the menu items and specify which program is to be run when they are selected, and what view to return to afterwards. (Always the home view except for the Start option which displays the attached note.) Also lists program .Conv.SV with a menu name of a single space, so that it is linked to the aplet. |
Program .Conv.LEN | Explanation |
---|---|
Performs conversions between units of length. | |
1̃Z:¿ FOR Y=1 TO 2;¿ {0.001,0.01,1,1000, 0.0254,0.3048,0.9144, 5.0292,20.1168,201.168, 1609.344,4828.032, 1.8288,1852,1.4959787E11, 9.46053E15,3.08568E16, 0.1016}̃Ans:¿ CHOOSE Z;"Length conversions"; "millimetre";"centimetre"; "metre";"kilometre"; "inch";"foot"; "yard";"pole [rod]"; "chain";"furlong"; "mile";"league"; "fathom";"nautical mile"; "astronom. unit"; "light year"; "parsec";"hand (horse)":¿ IF Z==0 THEN STOP:END:¿ IF Y==1 THEN Ans(Z)̃q: ELSE q/Ans(Z)̃q:END:¿ END:¿ | The basic principle is that a conversion factor for all the possible units to one standard unit is stored. For length conversions the standard unit is the metre. When the 'from' unit is chosen the conversion factor to metres is stored in q. When the 'to' unit is picked the previous value of q is divided by the new unit's conversion factor to metres. The value in q is now the ratio of the two conversion factors to metres so that multiplying any value in the 'from' units by q will convert it to the 'to' units. |
Program .Conv.ARE | Explanation |
---|---|
Performs conversions between units of area. | |
1̃Z:¿ FOR Y=1 TO 2;¿ {1E-6,1E-4,1,1E4,1E6, 6.4516E-4,0.092903,0.836127, 1011.71,4046.86,2589988} ̃Ans:¿ CHOOSE Z;"Area conversions"; "mm²";"cm²"; "m²";"hectare"; "km²";"inch²"; "foot²";"yard²"; "rood";"acre"; "mile²":¿ IF Z==0 THEN STOP:END:¿ IF Y==1 THEN Ans(Z)̃q: ELSE q/Ans(Z)̃q:END:¿ END:¿ | See explanation under .Conv.LEN. The standard unit of area is the square metre. Y controls a FOR loop to prompt for the units twice, the 'from' and 'to' units. All the conversion factors to square metres are stored as a list in the Ans memory, to avoid corrupting any of the other lists. The possible units are then presented in a 'choose' dialogue box, in the same order as in the Ans list. The number of the chosen unit is obtained in Z and element number Z from the list is extracted and either stored in q (if Y==1) or divided into q (if Y==2). The number in q is thus the overall conversion factor. |
Program .Conv.VOL | Explanation |
---|---|
Performs conversions between units of volume. | |
1̃Z:¿ FOR Y=1 TO 2;¿ {1E-9,1E-6,1,1E9,1.63871E-5, 0.0283168,0.764555,4.16816E9, 1E-6,0.001,3.55164E-6,2.84131E-5, 1.42066E-4,5.68262E-4,0.0045461, 4.92892E-6,1.47868E-5, 2.95735E-5,4.73176E-4, 0.00378541,0.158987}̃Ans:¿ CHOOSE Z;"Volume conversions"; "mm^3";"cm^3";"metre^3";"km^3"; "inch^3";"foot^3"; "yard^3";"mile^3"; "millilitre";"litre"; "dram";"fluid oz (UK)"; "gill";"pint (UK)"; "gallon (UK)";"teaspoon"; "tablespoon"; "fluid oz (US)";"pint (US)"; "gallon (US)";"barrel (oil)":¿ IF Z==0 THEN STOP:END:¿ IF Y==1 THEN Ans(Z)̃q: ELSE q/Ans(Z)̃q:END:¿ END:¿ | See explanations under .Conv.LEN and .Conv.ARE. The standard unit of volume is the cubic metre. Notice the need to use the raise to a power symbol ^ followed by a 3 to indicate cubing. The hp39g+ does not have a superscript 3 in its character set, even though one appears in the CHARS screen. ( 3 actually displays as -1.) |
Program .Conv.MAS | Explanation |
---|---|
Performs conversions between units of mass/weight. | |
1̃Z:¿ FOR Y=1 TO 2;¿ {1E-6,1E-3,1,1000,5.90615E-5, 0.00177185,0.0283495,0.45359237, 6.35029,50.8023,1016.05, 6.47989E-5,0.00155517,0.0311035, 0.373242,2E-4,907.185,1.66054E-27} ̃Ans:¿ CHOOSE Z;"Mass conversions"; "milligram";"gram"; "kilogram";"tonne (metric)"; "grain (avoir)";"dram (avoir)"; "ounce (avoir)";"pound (avoir)"; "stone";"hundredweight"; "ton (UK)"; "troy grain";"troy pennywt"; "troy ounce";"troy pound"; "carat";"ton (US short)"; "atom mass unit":¿ IF Z==0 THEN STOP:END:¿ IF Y==1 THEN Ans(Z)̃q: ELSE q/Ans(Z)̃q:END:¿ END:¿ | See explanations under .Conv.LEN and .Conv.ARE. The standard unit of mass is the kilogram. |
Program .Conv.SPE | Explanation |
---|---|
Performs conversions between units of speed. | |
1̃Z:¿ FOR Y=1 TO 2;¿ {1,1/3.6,0.3048,0.44704,0.514444} ̃Ans:¿ CHOOSE Z;"Speed conversions"; "metre/sec";"kilom/hour"; "foot/sec";"mile/hour"; "knot":¿ IF Z==0 THEN STOP:END:¿ IF Y==1 THEN Ans(Z)̃q: ELSE q/Ans(Z)̃q:END:¿ END:¿ | See explanations under .Conv.LEN and .Conv.ARE. The standard unit of speed is the metre per second. |
Program .Conv.FOR | Explanation |
---|---|
Performs conversions between units of force. | |
1̃Z:¿ FOR Y=1 TO 2;¿ {1,1E-5,9.80665,4.44822} ̃Ans:¿ CHOOSE Z;"Force conversions"; "newton";"dyne";"kg force"; "pound force":¿ IF Z==0 THEN STOP:END:¿ IF Y==1 THEN Ans(Z)̃q: ELSE q/Ans(Z)̃q:END:¿ END:¿ | See explanations under .Conv.LEN and .Conv.ARE. The standard unit of force is the newton. |
Program .Conv.PRE | Explanation |
---|---|
Performs conversions between units of pressure. | |
1̃Z:¿ FOR Y=1 TO 2;¿ {1,1E6,98066.5,6894.76,133.322, 100,101325}̃Ans:¿ CHOOSE Z;"Pressure conversions"; "pascal [N/m²]";"megapascal"; "kg/cm²";"psi [lbs/in²]"; "mmHg [torr]";"millibar"; "atmosphere":¿ IF Z==0 THEN STOP:END:¿ IF Y==1 THEN Ans(Z)̃q: ELSE q/Ans(Z)̃q:END:¿ END:¿ | See explanations under .Conv.LEN and .Conv.ARE. The standard unit of pressure is the newton per square metre. |
Program .Conv.ENG | Explanation |
---|---|
Performs conversions between units of energy. | |
1̃Z:¿ FOR Y=1 TO 2;¿ {1,1.60218E-19,3.6E6,1E-7, 4.1868,4186.8,1.35582,1055.06, 105506000}̃Ans:¿ CHOOSE Z;"Energy conversions"; "joule";"electron volt"; "kilowatt hour";"erg"; "calorie";"kilocal [Cal]"; "foot pound";"BTU"; "therm":¿ IF Z==0 THEN STOP:END:¿ IF Y==1 THEN Ans(Z)̃q: ELSE q/Ans(Z)̃q:END:¿ END:¿ | See explanations under .Conv.LEN and .Conv.ARE. The standard unit of energy is the joule. Note that kilocalories, often written as Calories with a capital C, are what the energy content of food is usually quoted in. Do not confuse them with calories (with a small c). |
Program .Conv.POW | Explanation |
---|---|
Performs conversions between units of power. | |
1̃Z:¿ FOR Y=1 TO 2;¿ {1,1000,745.7,0.293071,1.163} ̃Ans:¿ CHOOSE Z;"Power conversions"; "watt";"kilowatt"; "horsepower";"BTU/hour"; "kcal/hour":¿ IF Z==0 THEN STOP:END:¿ IF Y==1 THEN Ans(Z)̃q: ELSE q/Ans(Z)̃q:END:¿ END:¿ | See explanations under .Conv.LEN and .Conv.ARE. The standard unit of power is the watt (joules per second). kcal is kilocalories. |
Program .Conv.TEM | Explanation |
---|---|
Performs conversions between units of temperature. | |
1̃Z:¿ FOR Y=1 TO 2;¿ {1,0,1,273.15,5/9,255.37, 1.25,273.15,5/9,0, 125/9,394.26}̃Ans:¿ CHOOSE Z;"Temperature conv."; "Kelvin";"°Celsius"; "°Fahrenheit";"°Réaumur"; "°Rankine";"Gas mark":¿ IF Z==0 THEN STOP:END:¿ IF Y==1 THEN Ans(Z*2-1)*q+Ans(Z*2)̃q: ELSE (q-Ans(Z*2))/Ans(Z*2-1) ̃q:END:¿ END:¿ | See explanations under .Conv.LEN and .Conv.ARE. The standard unit of temperature is the Kelvin. Temperature conversions are slightly different to the others because the different scales have different zero points. Hence to convert to Kelvins two numbers are needed: a multiplication factor and an addition. In the list stored in Ans there are thus two numbers for each unit, stored consecutively and accessed via Z. As before the principle is first to convert to Kelvins then from Kelvins to the second unit. The 'Gas Mark' conversions are only valid for gas mark numbers from 1 to 9, since the scale is not properly defined outside this range. |
Program .Conv.S | Explanation |
---|---|
This program is called when START is selected from the Aplet view. | |
There is deliberately no text in this program! It does nothing as such except that it allows pressing the START button to bring up the note attached to aplet Convert, since in the SetViews program (.Conv.SV), program .Conv.S is configured to go to the note view when it returns. |
Program .Conv.CON | Explanation |
---|---|
This program allows physical constants to be chosen. | |
1̃Z:¿ {2.99792458E8,6.6742E-11, 9.80665,1.6021773E-19, 6.6260755E-34,1.380658E-23, 5.67051E-8,6.0221367E23, 8.31451,0.0224141,96485.31, 4E-7*p,8.8541878E-12, 0.0072973531,9.1093897E-31, 1.6726231E-27,1.6749286E-27, 10973732}̃Ans:¿ CHOOSE Z;"Physical constants"; "c light";"G gravity"; "g acc grav";"e elec charge"; "h Planck";"k Boltzmann"; "s Stefan";"N Avogadro"; "R ideal gas";"V0 gas mol v"; "F Faraday";"m0 permeabil"; "e0 permittiv";"a fine struc"; "Me elec mass";"Mp prot mass"; "Mn neut mass";"R¥ Rydberg":¿ IF Z==0 THEN STOP:END:¿ Ans(Z)̃q:¿ | This works on the same principle as the unit conversions, using the number of the menu choice to look up a value stored in the list in Ans, but there is no loop since the constant only needs to be chosen once. |