Exemplo n.º 1
0
#!/usr/bin/env python

from base import add_si
from base import print_conversions

from sympy import symbols as symbols
from sympy import Eq
from sympy import tan

NAME = "FREQUENCY"

hz = symbols("hz")
dummy = symbols("dummy")

equations = []

units = {
    hz: "HERTZ",
}

add_si(hz, "HERTZ", units, equations)

if __name__ == "__main__":
    import sys
    print_conversions(sys.modules[__name__])
Exemplo n.º 2
0
from base import add_si
from base import print_conversions

from sympy.physics.units import centi
from sympy.physics.units import deci
from sympy.physics.units import kilo
from sympy.physics.units import mega
from sympy.physics.units import milli

from sympy import symbols as symbols
from sympy import Eq
from sympy import tan


NAME = "POWER"

w = symbols("w")

equations = [
]

units = {
    w: "WATT",
}

add_si(w, "WATT", units, equations)

if __name__ == "__main__":
    import sys
    print_conversions(sys.modules[__name__])
Exemplo n.º 3
0
#!/usr/bin/env python

from base import add_si

from sympy import symbols as symbols
from sympy import Eq

NAME = "TIME"

s, m, h, d = symbols("s m h d")

equations = [
    Eq(s, m * 60),
    Eq(m, h * 60),
    Eq(h, d * 24),
]

units = {
    s: "SECOND",
    m: "MINUTE",
    h: "HOUR",
    d: "DAY",
}

add_si(s, "SECOND", units, equations)
Exemplo n.º 4
0
from base import add_si
from base import print_conversions

from sympy.physics.units import centi
from sympy.physics.units import deci
from sympy.physics.units import kilo
from sympy.physics.units import mega
from sympy.physics.units import milli

from sympy import symbols as symbols
from sympy import Eq
from sympy import tan


NAME = "ELECTRICPOTENTIAL"

v = symbols("v")

equations = [
]

units = {
    v: "VOLT",
}

add_si(v, "VOLT", units, equations)

if __name__ == "__main__":
    import sys
    print_conversions(sys.modules[__name__])
Exemplo n.º 5
0
    Eq(thou, inch / 1000),
    Eq(li, inch * 12),
    Eq(ft, inch / 12),
    Eq(yd, ft / 3),
    Eq(mi, yd / 1760),
    Eq(pt, inch * 72),
]

units = {
    m: "METER",
    ang: "ANGSTROM",
    ua: "ASTRONOMICALUNIT",
    ly: "LIGHTYEAR",
    pc: "PARSEC",
    thou: "THOU",
    li: "LINE",
    inch: "INCH",
    ft: "FOOT",
    yd: "YARD",
    mi: "MILE",
    pt: "POINT",
    pixel: "PIXEL",
    frame: "REFERENCEFRAME",
}

add_si(m, "METER", units, equations)

if __name__ == "__main__":
    import sys
    print_conversions(sys.modules[__name__])
Exemplo n.º 6
0
#!/usr/bin/env python

from base import add_si
from base import print_conversions

from sympy import symbols as symbols
from sympy import Eq
from sympy import tan


NAME = "FREQUENCY"

hz = symbols("hz")
dummy = symbols("dummy")

equations = [
]

units = {
    hz: "HERTZ",
}

add_si(hz, "HERTZ", units, equations)

if __name__ == "__main__":
    import sys
    print_conversions(sys.modules[__name__])
Exemplo n.º 7
0
    Eq(cbar, bar * 100),
    Eq(mbar, bar * 1000),
    Eq(pa, atm * 101325),
    Eq(torr, atm * 760),
    Eq(mtorr, torr / 1000),
    Eq(pa, mmhg * 133.322387415),
    Eq(pa, psi * 6894.75729316836142),  # Approx.
]

units = {
    pa: "Pascal",
    bar: "BAR",
    megabar: "MEGABAR",
    kbar: "KILOBAR",
    dbar: "DECIBAR",
    cbar: "CENTIBAR",
    mbar: "MILLIBAR",
    atm: "ATMOSPHERE",
    psi: "PSI",
    torr: "TORR",
    mtorr: "MILLITORR",
    mmhg: "MMHG",
}

# Only the non-prefixed "Pascal" is not uppercase
add_si(pa, "PASCAL", units, equations)

if __name__ == "__main__":
    import sys
    print_conversions(sys.modules[__name__])
Exemplo n.º 8
0
#!/usr/bin/env python

from base import add_si
from base import print_conversions

from sympy.physics.units import centi
from sympy.physics.units import deci
from sympy.physics.units import kilo
from sympy.physics.units import mega
from sympy.physics.units import milli

from sympy import symbols as symbols
from sympy import Eq
from sympy import tan

NAME = "POWER"

w = symbols("w")

equations = []

units = {
    w: "WATT",
}

add_si(w, "WATT", units, equations)

if __name__ == "__main__":
    import sys
    print_conversions(sys.modules[__name__])
Exemplo n.º 9
0
    Eq(thou, inch / 1000),
    Eq(li, inch * 12),
    Eq(ft, inch / 12),
    Eq(yd, ft / 3),
    Eq(mi, yd / 1760),
    Eq(pt, inch * 72),
]

units = {
    m: "METER",
    ang: "ANGSTROM",
    ua: "ASTRONOMICALUNIT",
    ly: "LIGHTYEAR",
    pc: "PARSEC",
    thou: "THOU",
    li: "LINE",
    inch: "INCH",
    ft: "FOOT",
    yd: "YARD",
    mi: "MILE",
    pt: "POINT",
    pixel: "PIXEL",
    frame: "REFERENCEFRAME",
}

add_si(m, "METER", units, equations)

if __name__ == "__main__":
    import sys
    print_conversions(sys.modules[__name__])