diff --git a/scimath/units/angle.py b/scimath/units/angle.py index 52f71c5..a1e7609 100644 --- a/scimath/units/angle.py +++ b/scimath/units/angle.py @@ -36,6 +36,7 @@ radian.label = 'rad' radians = radian +rad = radian grad = degree * 0.9 grad.label = '^g' @@ -56,6 +57,7 @@ revolution = 360 * degree revolution.label = 'r' revolutions = revolution +rev = revolution circle = revolution circles = circle turn = circle diff --git a/scimath/units/area.py b/scimath/units/area.py index bd72a13..4940ef9 100644 --- a/scimath/units/area.py +++ b/scimath/units/area.py @@ -21,7 +21,9 @@ # fourth edition, John Willey and Sons, 1993 square_meter = meter**2 +square_meter.label = 'm2' square_centimeter = centimeter**2 +square_centimeter.label = 'cm2' square_foot = foot**2 square_inch = inch**2 @@ -35,6 +37,8 @@ b = barn bn = barn barns = barn +m2 = square_meter +cm2 = square_centimeter # version __id__ = "$Id: area.py,v 1.1.1.1 2003/07/02 21:39:14 aivazis Exp $" diff --git a/scimath/units/electromagnetism.py b/scimath/units/electromagnetism.py index 2a2144e..72073e1 100644 --- a/scimath/units/electromagnetism.py +++ b/scimath/units/electromagnetism.py @@ -2,12 +2,19 @@ from copy import copy from scimath.units.SI import ampere, coulomb, farad, henry, joule, ohm, \ - meter, micro, milli, pico, siemens, tesla, volt, watt, weber + meter, micro, milli, pico, siemens, tesla, volt, watt, weber, kilo + +############################################################################### +# electric charge +############################################################################### + +C = coulomb ############################################################################### # electric current ############################################################################### +A = ampere amp = ampere amps = ampere amperes = ampere @@ -24,18 +31,27 @@ volts = volt v = volt +V = volt millivolt = milli * volt -millivolt.label = 'mV' +millivolt.label = 'mv' milli_volt = millivolt mv = millivolt +mV = millivolt millivolts = millivolt +kilovolt = kilo * volt +kilovolt.label = 'kv' +kv = kilovolt +kV = kilovolt + ############################################################################### # resistivity ############################################################################### ohms = ohm +Ohm = ohm +Ohms = ohms ohmm = ohm * meter ohmm.label = 'ohmm' ohm_m = ohmm @@ -47,19 +63,24 @@ # capacitance ############################################################################### +F = farad + micro_farad = micro * farad micro_farad.label = 'uf' mf = micro_farad +mF = micro_farad pico_farad = pico * farad pico_farad.label = 'pf' pf = pico_farad +pF = pico_farad ############################################################################### # conductivity ############################################################################### siemen = siemens +S = siemens mSiemens = milli * siemens mSiemens.label = 'mS' mSiemen = mSiemens @@ -80,15 +101,18 @@ ############################################################################### henrys = henry +H = henry ############################################################################### # Magnetic Flux ############################################################################### webers = weber +Wb = weber ############################################################################### # Magnetic Field ############################################################################### teslas = tesla +T = tesla diff --git a/scimath/units/energy.py b/scimath/units/energy.py index ac56167..c237563 100644 --- a/scimath/units/energy.py +++ b/scimath/units/energy.py @@ -12,7 +12,7 @@ # from __future__ import absolute_import -from .SI import joule, kilo, mega, giga +from .SI import joule, kilo, mega, giga, tera, milli # @@ -35,7 +35,7 @@ calorie = 4.1858 * joule Calorie = 1000 * calorie -kilowatt_hour = 3.6e6 * joule +watt_hour = 3.6e3 * joule electron_volt = 1.60218e-19 * joule @@ -43,8 +43,17 @@ # aliases J = joule -kJ = kilo * joule -MJ = mega * joule +millijoule = milli * joule +kilojoule = kilo * joule +megajoule = mega * joule +gigajoule = giga * joule +terajoule = tera * joule + +mJ = millijoule +kJ = kilojoule +MJ = megajoule +GJ = gigajoule +TJ = terajoule eV = electron_volt KeV = kilo * eV @@ -52,7 +61,21 @@ GeV = giga * eV cal = calorie -kcal = kilo * calorie +kilocalorie = kilo * calorie +kcal = kilocalorie + +watt_second = joule +kilowatt_hour = kilo * watt_hour +megawatt_hour = mega * watt_hour +gigawatt_hour = giga * watt_hour +terawatt_hour = tera * watt_hour + +Ws = watt_second +Wh = watt_hour +kWh = kilowatt_hour +MWh = megawatt_hour +GWh = gigawatt_hour +TWh = terawatt_hour # version diff --git a/scimath/units/force.py b/scimath/units/force.py index 2f3542e..de7ee71 100644 --- a/scimath/units/force.py +++ b/scimath/units/force.py @@ -13,9 +13,16 @@ from __future__ import absolute_import from copy import copy -from .SI import newton +from .SI import newton, milli, kilo, mega N = newton +millinewton = milli * newton +kilonewton = kilo * newton +meganewton = mega * newton + +mN = millinewton +kN = kilonewton +MN = meganewton lbf = 4.44822 * newton lbf.label = 'lbf' diff --git a/scimath/units/frequency.py b/scimath/units/frequency.py index f59ae2b..d7beb25 100644 --- a/scimath/units/frequency.py +++ b/scimath/units/frequency.py @@ -12,7 +12,7 @@ # Date: 05/22/2005 # Description: Define units of frequency # -# Symbols defined: hz, khz +# Symbols defined: hz, khz, kHz, MHz, GHz # #------------------------------------------------------------------------------ @@ -20,7 +20,7 @@ # Imports: ############################################################################# from __future__ import absolute_import -from .SI import hertz, kilo +from .SI import hertz, kilo, mega, giga from .time import minute ############################################################################# @@ -30,6 +30,10 @@ hertz.label = 'Hz' kilohertz = kilo * hertz kilohertz.label = 'kHz' +megahertz = mega * hertz +megahertz.label = 'MHz' +gigahertz = giga * hertz +gigahertz.label = 'GHz' rpm = 1 / minute rpm.label = 'rpm' @@ -42,5 +46,8 @@ hz = hertz Hz = hertz khz = kilohertz +kHz = kilohertz +MHz = megahertz +GHz = gigahertz #### EOF ###################################################################### diff --git a/scimath/units/power.py b/scimath/units/power.py index 12de73a..24e715e 100644 --- a/scimath/units/power.py +++ b/scimath/units/power.py @@ -12,17 +12,34 @@ # from __future__ import absolute_import -from .SI import watt, kilo +from .SI import watt, kilo, mega, giga, tera, milli # # Definitions of common power units # Data taken from Appendix F of Halliday, Resnick, Walker, "Fundamentals of Physics", # fourth edition, John Willey and Sons, 1993 +milliwatt = milli * watt +milliwatt.label = 'mW' kilowatt = kilo * watt -kw = kilowatt +kilowatt.label = 'kW' +megawatt = mega * watt +megawatt.label = 'MW' +gigawatt = giga * watt +gigawatt.label = 'GW' +terawatt = tera * watt +terawatt.label = 'TW' horsepower = 745.7 * watt +# aliases + +mW = milliwatt +W = watt +kW = kilowatt +MW = megawatt +GW = gigawatt +TW = terawatt + # version __id__ = "$Id: power.py,v 1.1.1.1 2003/07/02 21:39:14 aivazis Exp $" diff --git a/scimath/units/pressure.py b/scimath/units/pressure.py index 5966d97..f92e1ae 100644 --- a/scimath/units/pressure.py +++ b/scimath/units/pressure.py @@ -12,7 +12,7 @@ # from __future__ import absolute_import -from .SI import pascal, kilo, mega, giga +from .SI import pascal, hecto, kilo, mega, giga from scimath.units.force import lbf from scimath.units.length import inch from scimath.units.unit import unit @@ -29,21 +29,27 @@ # aliases - +pascal.label = 'Pa' Pa = pascal -Pa.label = 'Pa' -kPa = kilo * pascal -kPa.label = 'kPa' +hectopascal = hecto * pascal +hectopascal.label = 'hPa' +hPa = hectopascal + +kilopascal = kilo * pascal +kilopascal.label = 'kPa' +kPa = kilopascal -MPa = mega * pascal -MPa.label = 'MPa' +megapascal = mega * pascal +megapascal.label = 'MPa' +MPa = megapascal mpa = MPa Mpa = MPa MPA = MPa -GPa = giga * pascal -GPa.label = 'GPa' +gigapascal = giga * pascal +gigapascal.label = 'GPa' +GPa = gigapascal gpa = GPa Gpa = GPa GPA = GPa @@ -61,10 +67,14 @@ kbars = kbar millibar = 100 * pascal +millibar.label = 'mbar' +mbar = millibar torr = 133.3 * pascal -atmosphere = 101325 * pascal +torr.label = 'torr' +atmosphere = 101325 * pascal +atmosphere.label = 'atm' atm = atmosphere pounds_per_square_inch = lbf / inch ** 2 diff --git a/scimath/units/speed.py b/scimath/units/speed.py index 5acf9e3..cae4352 100644 --- a/scimath/units/speed.py +++ b/scimath/units/speed.py @@ -27,8 +27,9 @@ ############################################################################# from __future__ import absolute_import -from .time import hour, second, millisecond +from .time import hour, minute, second, millisecond from .length import foot, kilometer, meter, nautical_mile, mile +from .angle import radian, revolution ############################################################################# # Definitions: @@ -47,9 +48,22 @@ meters_per_millisecond.label = 'm/msec' kilometers_per_second = kilometer / second kilometers_per_second.label = 'km/s' +kilometers_per_hour = kilometer / hour +kilometers_per_hour.label = 'km/h' miles_per_hour = mile / hour miles_per_hour.label = 'mph' +# angular speeds +radians_per_second = radian / second +radians_per_second.label = 'rad/s' +radians_per_minute = radian / minute +radians_per_minute.label = 'rad/min' +revolutions_per_second = revolution / second +revolutions_per_second.label = 'rev/s' +revolutions_per_minute = revolution / minute +revolutions_per_minute.label = 'rev/min' +rpm = revolutions_per_minute + ############################################################################# # Aliases: ############################################################################# diff --git a/scimath/units/time.py b/scimath/units/time.py index 95d0abc..d2bd02a 100644 --- a/scimath/units/time.py +++ b/scimath/units/time.py @@ -76,8 +76,11 @@ milliseconds = millisecond minutes = minute +min = minute hours = hour +h = hour days = day +d = day weeks = week years = year diff --git a/scimath/units/volume.py b/scimath/units/volume.py index eb65013..f2d6695 100644 --- a/scimath/units/volume.py +++ b/scimath/units/volume.py @@ -73,13 +73,14 @@ cm3 = cubic_centimeter cc = cm3 -m3 = V = cubic_meter +m3 = cubic_meter f3 = cubic_foot ft3 = f3 cuft = f3 liters = liter +l = liter bbl = barrel