/[ascend]/trunk/models/measures.a4l
ViewVC logotype

Contents of /trunk/models/measures.a4l

Parent Directory Parent Directory | Revision Log Revision Log


Revision 63 - (show annotations) (download) (as text)
Wed Nov 30 06:03:46 2005 UTC (16 years, 9 months ago) by johnpye
File MIME type: text/x-ascend
File size: 10457 byte(s)
SI 'litre' and 'L' measure
1 PROVIDE "measures.a4l";
2
3 (*
4 * measures.a4l
5 * by Tom Epperly and Ben Allan
6 * Part of the ASCEND Library
7 * $Date: 1998/08/17 13:07:04 $
8 * $Revision: 1.5 $
9 * $Author: ballan $
10 * $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/measures.a4l,v $
11 *
12 * This file is part of the ASCEND Modeling Library.
13 *
14 * This provides common unit definitions. The user may write additional
15 * files of unit definitions particular to their problem or site.
16 *
17 * Copyright (C) 1997 Carnegie Mellon University.
18 *
19 * The ASCEND Modeling Library is free software; you can redistribute
20 * it and/or modify it under the terms of the GNU General Public
21 * License as published by the Free Software Foundation; either
22 * version 2 of the License, or (at your option) any later version.
23 *
24 * The ASCEND Modeling Library is distributed in hope that it will be
25 * useful, but WITHOUT ANY WARRANTY; without even the implied
26 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 * See the GNU General Public License for more details.
28 *
29 * You should have received a copy of the GNU General Public License
30 * along with the program; if not, write to the Free Software
31 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check
32 * the file named COPYING.
33 *)
34
35 (*
36 * Units input file
37 * by Tom Epperly
38 * Copyright(C) 1990 Thomas Guthrie Epperly
39 * Copyright(C) 1994-1997 Carnegie Mellon University
40 *
41 * This is a file defining the conversion factors ASCEND will recognize when
42 * it sees them as {units). Note that the assignment x:= 0.5 {100};; yields
43 * x == 50, and that there are no 'offset conversions,' e.g. F=9/5C+32;
44 * Added money which isn't really time 3-94 BAA
45 * Expanded, including some of Karl's units, constants. 4-94 BAA
46 * Updated with supplementary SI dimensions and less ambiguous mole dim. jz/baa
47 *
48 * Please keep unit names to 20 characters or less as this makes life pretty.
49 * This is not a hard limit however.
50 *
51 * The root system units in SI MKS system are set in the C code to:
52 * unitname DIMENSION
53 * define kilogram M; internal mass unit SI
54 * define mole Q; internal quantity unit SI
55 * define second T; internal time unit SI
56 * define meter L; internal length unit SI
57 * define Kelvin TMP; internal temperature unit SI
58 * define currency C; internal currency unit
59 * define ampere E; internal electric current unit SI suggested
60 * define candela LUM; internal luminous intensity unit SI
61 * define radian P; internal plane angle unit SI suggested
62 * define steradian S; internal solid angle unit SI suggested
63 *)
64
65 UNITS
66
67 (* distance *)
68
69 pc = {3.08374e+16*meter};
70 parsec = {pc};
71 kpc = {1000*pc};
72 Mpc = {1e6*pc};
73 km = {meter*1000};
74 m = {meter};
75 dm = {meter/10};
76 cm = {meter/100};
77 mm = {meter/1000};
78 um = {meter/1000000};
79 nm = {1.e-9*meter};
80 kilometer = {km};
81 centimeter = {cm};
82 millimeter = {mm};
83 micron = {um};
84 nanometer = {nm};
85 angstrom = {m/1e10};
86 fermi = {m/1e15};
87
88 mi = {1609.344*meter};
89 yd = {0.914412*meter};
90 ft = {0.304804*meter};
91 inch = {0.0254*meter};
92 mile = {mi};
93 yard = {yd};
94 feet = {ft};
95 foot = {ft};
96 in = {inch};
97
98 (* mass *)
99
100 metton = {kilogram *1000};
101 mton = {kilogram *1000};
102 kg = {kilogram};
103 g = {kilogram/1000};
104 gram = {g};
105 mg = {g/1000};
106 milligram = {mg};
107 ug= {kilogram*1e-9};
108 microgram= {ug};
109 ng= {kilogram*1e-12};
110 nanogram= {ng};
111 pg= {kilogram*1e-15};
112 picogram= {pg};
113
114 amu = {1.661e-27*kilogram};
115 lbm = {4.535924e-1*kilogram};
116 ton = {lbm*2000};
117 oz = {0.028349525*kilogram};
118 slug = {14.5939*kilogram};
119
120 (* time *)
121
122 yr = {31557600*second};
123 wk = {604800*second};
124 dy = {86400*second};
125 hr = {3600*second};
126 min = {60*second};
127 sec = {second};
128 s = {second};
129 ms = {second/1000};
130 us = {second/1e6};
131 ns = {second/1e9};
132 ps = {second/1e12};
133 year = {yr};
134 week = {wk};
135 day = {dy};
136 hour = {hr};
137 minute = {min};
138 millisecond = {ms};
139 microsecond = {us};
140 nanosecond = {ns};
141 picosecond = {ps};
142
143 (* molecular quantities *)
144
145 kg_mole= {1000*mole};
146 g_mole = {mole};
147 gm_mole = {mole};
148 kmol = {1000*mole};
149 mol = {mole};
150 mmol = {mole/1000};
151 millimole= {mmol};
152 umol = {mole/1e6};
153 micromole= {umol};
154 lb_mole = {4.535924e+2*mole};
155
156 (* temperature *)
157
158 K = {Kelvin};
159 R = {5*Kelvin/9};
160 Rankine = {R};
161
162 (* money *)
163
164 dollar = {currency};
165 US = {currency};
166 USdollar= {currency};
167 CR = {currency};
168 credits= {currency};
169
170 (* reciprocal time (frequency) *)
171
172 rev = {1.0};
173 cycle = {rev};
174 rpm = {rev/minute};
175 rps = {rev/second};
176 hertz = {cycle/second};
177 Hz = {hertz};
178
179 (* area *)
180
181 ha = {meter^2*10000};
182 hectare= {ha};
183 acre= {meter^2*4046.856};
184
185 (* volume *)
186
187 L = {meter^3/1000};
188 litre = {L};
189 liter = {L};
190 mL = {L/1000};
191 ml = {L/1000};
192 ul = {L/1e6};
193 uL = {L/1e6};
194 milliliter = {ml};
195 millilitre = {mL};
196 microliter = {ul};
197 microlitre = {uL};
198
199 hogshead= {2.384809e-1*meter^3};
200 cuft = {0.02831698*meter^3};
201 impgal = {4.52837e-3*meter^3};
202 gal = {3.785412e-3*meter^3};
203 barrel = {42.0*gal};
204 gallon = {gal};
205 quart = {gal/4};
206 pint = {gal/8};
207 cup = {gal/16};
208 floz = {gal/128};
209
210 (* force *)
211
212 N = {kilogram*meter/second^2};
213 newton = {N};
214 dyne = {N*1.0e-5};
215 EN = {1e18*N};
216 PN = {1e15*N};
217 TN = {1e12*N};
218 GN = {1e9*N};
219 MN = {1e6*N};
220 kN = {1000*N};
221 mN= {N*1e-3};
222 uN= {N*1e-6};
223 nN= {N*1e-9};
224 pN= {N*1e-12};
225 fN= {N*1e-15};
226 aN= {N*1e-18};
227 milliNewton= {mN};
228 microNewton= {uN};
229 nanoNewton= {nN};
230 picoNewton= {pN};
231 femtoNewton= {fN};
232 attoNewton= {aN};
233
234 lbf = {N*4.448221};
235
236 (* pressure *)
237
238 Pa = {kilogram/meter/second^2};
239 MPa = {1.0e+6*Pa};
240 bar = {1.0e+5*Pa};
241 kPa = {1000*Pa};
242 pascal = {Pa};
243
244 atm = {Pa*101325.0};
245 mmHg = {133.322*Pa};
246 torr = {133.322*Pa};
247 psia = {6894.733*Pa};
248 psi = {psia};
249 ftH2O = {2989*Pa};
250
251 (* energy *)
252
253 J = {kilogram*meter^2/second^2};
254 joule = {J};
255 MJ = {J * 1000000};
256 kJ = {J * 1000};
257 mJ= {J*1.0e-3};
258 uJ= {J*1.0e-6};
259 nJ= {J*1.0e-9};
260 milliJoule= {mJ};
261 microJoule= {uJ};
262 nanoJoule= {nJ};
263 erg = {J*1.0e-7};
264
265 BTU = {1055.056*J};
266 pCu = {BTU * 1.8};
267 cal = {J*4.18393};
268 calorie = {cal};
269 kcal= {1000*calorie};
270 Cal= {1000*calorie};
271
272 (* power *)
273
274 W = {J/second};
275 EW = {1.0e+18*W};
276 PW = {1.0e+15*W};
277 TW = {1.0e+12*W};
278 GW = {1.0e+9*W};
279 MW = {1.0e+6*W};
280 kW = {1000*W};
281 mW = {W/1e3};
282 uW = {W/1e6};
283 nW = {W/1e9};
284 pW = {W/1e12};
285 fW = {W/1e15};
286 aW = {W/1e18};
287 terawatt = {TW};
288 gigawatt = {GW};
289 megawatt = {MW};
290 kilowatt = {kW};
291 watt = {W};
292 milliwatt = {mW};
293 microwatt = {uW};
294 nanowatt = {nW};
295 picowatt = {pW};
296 femtowatt = {fW};
297 attowatt = {aW};
298 aWW= {1*EW}; (* we could say art has a lot of power *)
299
300 hp= {7.456998e+2*W};
301
302 (* absolute viscosity *)
303
304 poise = {Pa*s/10};
305 cP = {poise/100};
306
307 (* electric charge *)
308
309 coulomb= {ampere*second};
310 C = {coulomb};
311 coul = {coulomb};
312 mC = {0.001*C};
313 uC = {1e-6*C};
314 nC = {1e-9*C};
315 pC = {1e-12*C};
316
317 (* misc electro-magnetic fun *)
318
319 V = {kilogram*meter^2/second^3/ampere};
320 F = {ampere^2*second^4/kilogram/meter^2};
321 ohm = {kilogram*meter^2/second^3/ampere^2};
322 mho = {ampere^2*second^3/kilogram/meter^2};
323 S = {mho};
324 siemens = {S};
325 A= {ampere};
326 amp = {ampere};
327 volt = {V};
328 farad= {F};
329 mA= {A/1000};
330 uA= {A/1000000};
331 kV= {1000*V};
332 MV= {1e6*V};
333 mV= {V/1000};
334 mF = {0.001*F};
335 uF = {1e-6*F};
336 nF = {1e-9*F};
337 pF = {1e-12*F};
338 kohm = {1000*ohm};
339 Mohm = {1e6*ohm};
340 kS = {1000*S};
341 mS = {0.001*S};
342 uS = {1e-6*S};
343 Wb = {V*second};
344 weber = {Wb};
345 tesla = {Wb/m^2};
346 gauss = {1e-4*tesla};
347 H = {Wb/A};
348 henry = {H};
349 mH = {0.001*H};
350 uH = {1e-6*H};
351
352 (*
353 * numeric constants of some interest
354 * to set a variable or constant to these, the code is (in the declarations)
355 * ATOM constant REFINES real; END constant;
356 * MODEL gizmo;
357 * x IS_A constant;
358 * x := 1 {PI};
359 * ...
360 *)
361 molecule = {1.0};
362 PI= {3.1415926535897932385}; (* Circumference/Diameter ratio *)
363 EULER_C = {0.57721566490153286}; (* euler gamma *)
364 GOLDEN_C = {1.618033988749894}; (* golden ratio *)
365 HBAR = {1.055e-34*J*second}; (* Reduced planck's constant *)
366 PLANCK_C = {2*PI*HBAR}; (* Planck's constant *)
367 LIGHT_C = {2.99793e8 * meter/second}; (* Speed of light in vacuum *)
368 MU0 = {4e-7*PI*kg*m/C/C}; (* Permeability of free space *)
369 EPSILON0 = {1/LIGHT_C/LIGHT_C/MU0}; (* Permittivity of free space *)
370 BOLTZMAN_C = {1.3805e-23 * J/K}; (* Boltzman's constant *)
371 AVOGADRO_C = {6.022045e23 *molecule/mole}; (* Avogadro's number of molecules *)
372 GRAVITY_C = {6.673e-11 * N*m*m/kg/kg}; (* Newtons gravitational constant *)
373 GAS_C = {BOLTZMAN_C*AVOGADRO_C}; (* Gas constant *)
374 INFINITY= {1.0e38}; (* damn big number *)
375 LIM_EXP= {709.78}; (* ln ( maxdouble ) *)
376 LIM_CUBE= {5.6438030941223618e101}; (* cbrt ( maxdouble ) *)
377 LIM_SQR= {1.0e154}; (* sqrt(maxdouble) *)
378 (* swiped from C math.h *)
379 M_E= {2.7182818284590452354E0}; (* base e *)
380 M_LOG2E= {1.4426950408889634074E0}; (* log2(e) *)
381 M_LOG10E= {4.3429448190325182765E-1}; (* log10(e) *)
382 M_LN2= {6.9314718055994530942E-1}; (* ln(2) *)
383 M_LN10= {2.3025850929940456840E0}; (* ln(10) *)
384 M_PI= {3.1415926535897932385E0}; (* as PI, but for consistency *)
385 M_PI_2= {1.5707963267948966192E0}; (* PI/2 *)
386 M_PI_4= {7.8539816339744830962E-1}; (* PI/4 *)
387 M_1_PI= {3.1830988618379067154E-1}; (* 1/PI *)
388 M_2_PI= {6.3661977236758134308E-1}; (* 2/PI *)
389 M_2_SQRTPI= {1.1283791670955125739E0}; (* 2/sqrt(PI) *)
390 M_SQRT2= {1.4142135623730950488E0}; (* sqrt(2) *)
391 M_SQRT1_2= {7.0710678118654752440E-1}; (* 1/sqrt(2) *)
392
393 eCHARGE = {1.602e-19*C}; (* Charge of an electron *)
394 EARTH_G = {9.80665 * m/s/s}; (* Earth's gravitational field, somewhere *)
395 eMASS = {9.1095e-31*kilogram}; (* Electron rest mass, I suppose *)
396 pMASS = {1.67265e-27*kilogram}; (* Proton mass *)
397
398 (* constant based conversions *)
399
400 eV = {eCHARGE * V};
401 keV = {1000*eV};
402 MeV = {1e6*eV};
403 GeV = {1e9*eV};
404 TeV = {1e12*eV};
405 PeV = {1e15*eV};
406 EeV = {1e18*eV};
407
408 lyr = {LIGHT_C * yr}; (* Light-year *)
409
410 oersted = {gauss/MU0};
411
412 (* subtly dimensionless measures *)
413
414 rad = {radian};
415 srad = {steradian};
416 deg = {radian*1.74532925199433e-2};
417 degrees = {deg};
418 grad = {0.9*deg};
419 arcmin = {degrees/60.0};
420 arcsec = {arcmin/60.0};
421
422 (* light quantities *)
423
424 cd = {candela};
425 lm = {candela*steradian};
426 lumen = {lm};
427 lx = {lm/meter^2};
428 lux= {lx};
429
430 (* misc rates *)
431
432 gpm = {gallon/minute};
433
434 (* time variant conversions *)
435
436 MINIMUMWAGE = {3.35*US/hr}; (* 1987 *)
437 (*
438 * conversions we'd like to see , but probably won't
439 * milliHelen = {beauty/ship};
440 * Helen = {documentation/project};
441 *)
442 END UNITS;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22