/[escript]/trunk/escript/py_src/unitsSI.py
ViewVC logotype

Annotation of /trunk/escript/py_src/unitsSI.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2398 - (hide annotations)
Tue Apr 28 04:41:53 2009 UTC (9 years, 11 months ago) by gross
File MIME type: text/x-python
File size: 3506 byte(s)
first version of units in escript



1 gross 2398
2     ########################################################
3     #
4     # Copyright (c) 2003-2008 by University of Queensland
5     # Earth Systems Science Computational Center (ESSCC)
6     # http://www.uq.edu.au/esscc
7     #
8     # Primary Business: Queensland, Australia
9     # Licensed under the Open Software License version 3.0
10     # http://www.opensource.org/licenses/osl-3.0.php
11     #
12     ########################################################
13    
14     __copyright__="""Copyright (c) 2003-2008 by University of Queensland
15     Earth Systems Science Computational Center (ESSCC)
16     http://www.uq.edu.au/esscc
17     Primary Business: Queensland, Australia"""
18     __license__="""Licensed under the Open Software License version 3.0
19     http://www.opensource.org/licenses/osl-3.0.php"""
20     __url__="https://launchpad.net/escript-finley"
21     __author__="Lutz Gross, l.gross@uq.edu.au"
22    
23     ## @file unitsSI.py
24    
25     """
26     some tools supporting the usage of symbols.
27    
28     @var __author__: name of author
29     @var __copyright__: copyrights
30     @var __license__: licence agreement
31     @var __url__: url entry point on documentation
32     @var __version__: version
33     @var __date__: date of the version
34    
35     @var Yotta : prefix yotta, symbol: Y
36     @var Zetta : prefix zetta, symbol: Z
37     @var Exa : prefix exa, symbol: E
38     @var Peta : prefix peta, symbol: P
39     @var Tera : prefix tera, symbol: T
40     @var Giga : prefix giga, symbol: G
41     @var Mega : prefix mega, symbol: M
42     @var Kilo : prefix kilo, symbol: k
43     @var Hecto : prefix hecto, symbol: h
44     @var Deca : prefix deca, symbol: da
45     @var Deci : prefix deci, symbol: d
46     @var Centi : prefix centi, symbol: c
47     @var Milli : prefix milli, symbol: m
48     @var Micro : prefix micro, symbol: mu
49     @var Nano : prefix nano, symbol: n
50     @var Pico : prefix pico, symbol: p
51     @var Femto : prefix femto, symbol: f
52     @var Atto : prefix atto, symbol: a
53     @var Zepto : prefix zepto, symbol: z
54     @var Yocto : prefix yocto, symbol: y
55    
56     @var km : unit of kilo meter
57     @var m : unit of meter
58     @var cm : unit of centi meter
59     @var mm : unit of milli meter
60     @var sec: unit of second
61     @var minute : unit of minute
62     @var h : unit of hour
63     @var day : unit of day
64     @var yr : unit of year
65     @var Myr : unit of mega year
66     @var Gyr : unit of giga year
67     @var gram : unit of gram
68     @var kg : unit of kilo gram
69     @var lb : unit of pound
70     @var ton : metric ton
71     @var A : unit of Ampere
72     @var Hz: unit of Hertz (frequency)
73     @var N: unit of Newton (force)
74     @var Pa: unit of Pascal (pressure, stress)
75     @var atm: unit of atmosphere (pressure)
76     @var J: unit of Joule (energy, work)
77     @var W: unit of Watt (power)
78     @var C: unit of Coulomb (electric charge)
79     @var V: unit of Volt (electric potential)
80     @var F: unit of Farad (Capacitance)
81     @var Ohm: unit of Ohm (electric resistance)
82     @var R_Earth_equator: Earth's equatorial radius
83     @var R_Earth_poles: Earth's polar radius
84     @var R_Earth: Earth's radius
85     @var v_light: speed of light
86     """
87     #
88     # prefixes:
89     #
90     Yotta=1.e24
91     Zetta=1.e21
92     Exa=1.e18
93     Peta=1.e15
94     Tera=1.e12
95     Giga=1.e9
96     Mega=1.e6
97     Kilo=1.e3
98     Hecto=1.e2
99     Deca=1.e1
100     Deci=1.e-1
101     Centi=1.e-2
102     Milli=1.e-3
103     Micro=1.e-6
104     Nano=1.e-9
105     Pico=1.e-12
106     Femto=1.e-15
107     Atto=1.e-18
108     Zepto=1.e-21
109     Yocto=1.e-24
110     #
111     # length
112     #
113     m=1.
114     km=Kilo*m
115     cm=Centi*m
116     mm=Milli*m
117     #
118     # time
119     #
120     sec=1.
121     minute=60.*sec
122     h=60.*minute
123     day=h*24.
124     yr=day*365.2425
125     Myr=Mega*yr
126     Gyr=Giga*yr
127     #
128     # mass
129     #
130     kg=1.
131     gram=Milli*kg
132     lb=453.59237*gram
133     ton=Kilo*kg
134     #
135     # electric current
136     #
137     A=1.
138     #
139     # others
140     #
141     Hz=1./sec
142     N = m*kg/sec**2
143    
144     Pa = N/m**2
145     atm=101325.024*Pa
146    
147     J = N*m
148     W= J/sec
149     C=sec*A
150     V = W/A
151     F = C/V
152     Ohm=V/A
153     #
154     # some constants
155     #
156     R_Earth_equator=6378.1370*km
157     R_Earth_poles=6356.7523*km
158     R_Earth=(R_Earth_equator+R_Earth_poles)/2
159     v_light=299792458.*m/sec

  ViewVC Help
Powered by ViewVC 1.1.26