Units
Model ElementUnits defines the units for the model being defined.
Class Name
Units
Description
Units allows you to specify four types of units: Mass, Length, Time, and Force. The last is obviously a function of the first three and can be automatically calculated for a consistent set of units. However, many unit systems are not "consistent", so it may be necessary to specify a force unit also.
Attribute Summary
Name | Property | Modifiable by command? | Designable? |
---|---|---|---|
force | Enum (Force, default="NEWTON") | NO | NO |
length | Enum (Length, default="METER") | ||
mass | Enum (Mass, default="KILOGRAM") | ||
time | Enum (Time, default="SECOND") | ||
ucf | Double (default=None) |
*Force=["CENTINEWTON", "DYNE", "KILOGRAM_FORCE", "KNEWTON",
"KPOUND_FORCE", "MEGANEWTON", "MICRONEWTON", "MILLINEWTON",
"NANONEWTON", "NEWTON", "OUNCE_FORCE", "POUND_FORCE",
"POUNDAL"]
*Length=["ANGSTROM", "CENTIMETER", "FOOT", "KILOMETER",
"INCH", "METER", "MICROINCH", "MICROMETER",
"MILE", "MILLIMETER", "MILLS", "NANOMETER","YARD"]
*Mass=["GRAM", "KILOGRAM", "KPOUND_MASS", "MILLIGRAM",
"MICROGRAM", "NANOGRAM", "OUNCE_MASS", "POUND_MASS",
"SLINCH", "SLUG","TONNE", "US_TON"]
*Time=["DAY", "HOUR", "MICROSECOND", "MILLISECOND",
"MINUTE", "NANOSECOND", "SECOND"]
Usage
#1: Explicit specification of mass, length, time and force units
Units (force=string, length=string, mass=string, time=string)
#2: Selecting a predefined set of unitsUnits (system=string)
#3: With a units consistency factor only
Units (UCF=double)
Attributes
- force_unit
- String
- mass_unit
- String
- length_unit
- String
- time_unit
- String
- system
- String
- ucf
- In lieu of specifying the mass, length, and time units, you can alternatively specify a Units Consistency Factor, UCF. This factor should ensure that for the set that's chosen, Newton's second law, F=MA, can still be used.
Example
- Define the SI unit
system.
si = Units (force="Newton", mass="Kilogram", length="Meter", time="Second")
- Set the UCF for example in Comment 1.
myunits = Units (ucf=1000)
- Define the following units system.
- Mass in Kilograms
- Length in yards
- Time in days
- Force in Newtons
weirdUnits = Units (force="Newton", mass="Kilogram", length="Yard", time="Day") >>>weirdUnits.time ‘Day’
- Define the model to be in the British units
system.
BritishUnits = Units (system="FPS")
Comments
- UCF is defined to the quantity
that enables Newton's Second law to be valid for an inconsistent set of units.
Thus the 2nd law may be written
as:
F = m * a * UCF
Therefore, UCF = F / (m*a).
Let's see how this works for the example below.- Mass is specified in grams
- Length is specified in micrometers
- Time is specified in milliseconds
- Force is specified in Newtons
(1) We see that UCF does not have any units. It is just a factor.
- See Properties for an explanation about what properties are, why they are used, and how you can extend these.
- For a more detailed explanation about Units, see Parameters: Units.