Units of measurement: Difference between revisions
No edit summary |
No edit summary |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Unlike many [[other modelling tools|other mathematical modelling programs]], ASCEND understands standard '''units of measurement''' including all base SI units (kg, m, s, etc.) and many non-SI units such as [http://en.wikipedia.org/wiki/United_States_customary_units United States customary units] and others, and treatment of units, conversion and consistency-checking are all integrated tightly into the ASCEND modelling language and model compiler. | |||
Unlike | |||
The units-of-measurement system is extensible: the user can define new units of measurement in model files then immediately use those new units of measurement to define values for use in the model's calculations. | The units-of-measurement system is extensible: the user can define new units of measurement in model files then immediately use those new units of measurement to define values for use in the model's calculations. | ||
Standard units of measurement are | Standard units of measurement defined using the [[UNITS]] statement, and the standard definitions are in {{src|models/measures.a4l}}. All measures are defined relative to the built-in base units, defined as follows: | ||
{| class="wikitable" style="border:solid 1px black;text-align:center" | |||
|+ Base units and dimensions in ASCEND | |||
! Unit !! Dim code !! Dimension !! Source | |||
|- | |||
| kg || M || mass || SI | |||
|- | |||
| mol || Q || amount of substance|| SI | |||
|- | |||
| s || T || time || SI | |||
|- | |||
| m || L || length || SI | |||
|- | |||
| K || TMP || temperature || SI | |||
|- | |||
| USD || C || currency || non SI | |||
|- | |||
| A || E || electric current || SI | |||
|- | |||
| cd || LUM || luminous intensity || SI | |||
|- | |||
| rad || P || plane angle || SI suggested | |||
|- | |||
| sr || S || solid angle || SI suggested | |||
|} | |||
Both the Tcl/Tk and PyGTK GUIs provide means for entering values in any desired (by applicable) unit, and allow the preferred units of measurement for any value-type to be selected and stored for future use. | Both the Tcl/Tk and PyGTK GUIs provide means for entering values in any desired (by applicable) unit, and allow the preferred units of measurement for any value-type to be selected and stored for future use. | ||
== Units of Measurement dialog in the PyGTK GUI == | == Units of Measurement dialog in the PyGTK GUI == | ||
| Line 13: | Line 36: | ||
The units of measurement dialog can be used in the PyGTK to choose the preferred units of measurement for any type currently available in the library that you have loaded. Normally this means that you are selecting between units defined in {{src|models/measures.a4l}} for types defined in {{src|models/atoms.a4l}}, but this will sometimes be different if you have defined your own atoms/units elsewhere. | The units of measurement dialog can be used in the PyGTK to choose the preferred units of measurement for any type currently available in the library that you have loaded. Normally this means that you are selecting between units defined in {{src|models/measures.a4l}} for types defined in {{src|models/atoms.a4l}}, but this will sometimes be different if you have defined your own atoms/units elsewhere. | ||
[[Image:Image-Preferred-units.png|thumb|none|375px|Specifying preferred units for 'volume' in the PyGTK GUI]] | |||
To access this dialog either use the 'Tools' menu, or right-click a variable in your model that is a real-valued variable. | To access this dialog either use the 'Tools' menu, or right-click a variable in your model that is a real-valued variable. | ||
| Line 20: | Line 43: | ||
You can change the preferred units for as many types as you want, then click 'Apply' or 'Close' to save the changes. If you click 'apply' you can see the changes applied immediately in the main window. which is a simple way of doing quick checks for different units. If you click 'cancel', any changes you have made will be ignored. | You can change the preferred units for as many types as you want, then click 'Apply' or 'Close' to save the changes. If you click 'apply' you can see the changes applied immediately in the main window. which is a simple way of doing quick checks for different units. If you click 'cancel', any changes you have made will be ignored. | ||
== Units of Measurement dialog in the Tcl/Tk GUI == | == Units of Measurement dialog in the Tcl/Tk GUI == | ||
| Line 26: | Line 48: | ||
See [[TcltkScreenshots#UNITS]]. | See [[TcltkScreenshots#UNITS]]. | ||
[[Category:Documentation]] | |||
Latest revision as of 19:03, 14 February 2012
Unlike many other mathematical modelling programs, ASCEND understands standard units of measurement including all base SI units (kg, m, s, etc.) and many non-SI units such as United States customary units and others, and treatment of units, conversion and consistency-checking are all integrated tightly into the ASCEND modelling language and model compiler.
The units-of-measurement system is extensible: the user can define new units of measurement in model files then immediately use those new units of measurement to define values for use in the model's calculations.
Standard units of measurement defined using the UNITS statement, and the standard definitions are in models/measures.a4l. All measures are defined relative to the built-in base units, defined as follows:
| Unit | Dim code | Dimension | Source |
|---|---|---|---|
| kg | M | mass | SI |
| mol | Q | amount of substance | SI |
| s | T | time | SI |
| m | L | length | SI |
| K | TMP | temperature | SI |
| USD | C | currency | non SI |
| A | E | electric current | SI |
| cd | LUM | luminous intensity | SI |
| rad | P | plane angle | SI suggested |
| sr | S | solid angle | SI suggested |
Both the Tcl/Tk and PyGTK GUIs provide means for entering values in any desired (by applicable) unit, and allow the preferred units of measurement for any value-type to be selected and stored for future use.
Units of Measurement dialog in the PyGTK GUI
The units of measurement dialog can be used in the PyGTK to choose the preferred units of measurement for any type currently available in the library that you have loaded. Normally this means that you are selecting between units defined in models/measures.a4l for types defined in models/atoms.a4l, but this will sometimes be different if you have defined your own atoms/units elsewhere.
To access this dialog either use the 'Tools' menu, or right-click a variable in your model that is a real-valued variable.
In this dialog, you can select the type you want to set units for. The list will self-filter if you start typing the name of the type you want. Then the list of available units-of-measurement appears, and you can select the one you want.
You can change the preferred units for as many types as you want, then click 'Apply' or 'Close' to save the changes. If you click 'apply' you can see the changes applied immediately in the main window. which is a simple way of doing quick checks for different units. If you click 'cancel', any changes you have made will be ignored.