Commands for Managing Systems of Units - Maple Help

Home : Support : Online Help : Science and Engineering : Units : Details : Commands for Managing Systems of Units

Details of Units Package Commands

Description

 • In addition to converting values from one unit to another, the Units package also provides commands that allow you to manage and create entire systems of units.

 add a base unit and associated base dimension add or rename a dimension add or modify a system of units add or modify a unit return dimension as a product of powers of base dimensions list all dimensions list units in a system of units list all systems of units get unit information list all unit names test whether a dimension exists test whether a system of units exists test whether a unit exists remove a dimension remove a system of units split an expression into a unitless part and a unit verify dimensional correctness of unit expression(s) return argument as a unit in standard form set default context(s) set the default mode for combining units set the default system of units set the default unit for one dimension list the default unit contexts return the default system of units

 To display the help page for a particular command, click the corresponding hyperlink.

Command Details

Managing Systems of Units

 • A system of units is made up of a set of dimensions, with units used to represent those dimensions. To see the dimensions available in the Units package, use the GetDimensions command.
 > with(Units):
 > GetDimensions();
 ${\mathrm{absorbed_dose}}{,}{\mathrm{acceleration}}{,}{\mathrm{action}}{,}{\mathrm{amount_of_information}}{,}{\mathrm{amount_of_substance}}{,}{\mathrm{angular_acceleration}}{,}{\mathrm{angular_jerk}}{,}{\mathrm{angular_speed}}{,}{\mathrm{area}}{,}{\mathrm{crackle}}{,}{\mathrm{currency}}{,}{\mathrm{dose_equivalent}}{,}{\mathrm{drop}}{,}{\mathrm{dynamic_viscosity}}{,}{\mathrm{electric_capacitance}}{,}{\mathrm{electric_charge}}{,}{\mathrm{electric_conductance}}{,}{\mathrm{electric_current}}{,}{\mathrm{electric_dipole_moment}}{,}{\mathrm{electric_displacement}}{,}{\mathrm{electric_field_strength}}{,}{\mathrm{electric_permittivity}}{,}{\mathrm{electric_polarizability}}{,}{\mathrm{electric_potential}}{,}{\mathrm{electric_resistance}}{,}{\mathrm{electric_resistivity}}{,}{\mathrm{energy}}{,}{\mathrm{enthalpy}}{,}{\mathrm{exposure}}{,}{\mathrm{force}}{,}{\mathrm{frequency}}{,}{\mathrm{heat_capacity}}{,}{\mathrm{heat_insulation_coefficient}}{,}{\mathrm{heat_transfer_coefficient}}{,}{\mathrm{illuminance}}{,}{\mathrm{jerk}}{,}{\mathrm{kinematic_viscosity}}{,}{\mathrm{length}}{,}{\mathrm{linear_frequency}}{,}{\mathrm{linear_mass_density}}{,}{\mathrm{lock}}{,}{\mathrm{logarithmic_gain}}{,}{\mathrm{luminous_flux}}{,}{\mathrm{luminous_intensity}}{,}{\mathrm{luminous_luminance}}{,}{\mathrm{magnetic_dipole_moment}}{,}{\mathrm{magnetic_flux}}{,}{\mathrm{magnetic_flux_density}}{,}{\mathrm{magnetic_inductance}}{,}{\mathrm{magnetic_permeability}}{,}{\mathrm{magnetic_polarizability}}{,}{\mathrm{magnetizing_force}}{,}{\mathrm{mass}}{,}{\mathrm{mass_density}}{,}{\mathrm{molar_electric_charge}}{,}{\mathrm{molar_energy}}{,}{\mathrm{moment_of_inertia}}{,}{\mathrm{momentum}}{,}{\mathrm{plane_angle}}{,}{\mathrm{pop}}{,}{\mathrm{power}}{,}{\mathrm{pressure}}{,}{\mathrm{snap}}{,}{\mathrm{solid_angle}}{,}{\mathrm{specific_heat_capacity}}{,}{\mathrm{speed}}{,}{\mathrm{surface_energy_density}}{,}{\mathrm{surface_power_density}}{,}{\mathrm{thermal_conductivity}}{,}{\mathrm{thermodynamic_temperature}}{,}{\mathrm{time}}{,}{\mathrm{torque}}{,}{\mathrm{volume}}{,}{\mathrm{volume_flow}}$ (1)
 • Most of these dimensions are complex dimensions, products of powers of base dimensions.  To see the dimensions used to derive a complex dimension, for example force, use the GetDimension command.
 > GetDimension('force');
 $\frac{{\mathrm{length}}{}{\mathrm{mass}}}{{{\mathrm{time}}}^{{2}}}$ (2)
 • To list the units available to represent force, use the GetUnits command.
 > GetUnits('dimension'='force');
 ${{\mathrm{dyne}}}_{{\mathrm{standard}}}{,}{{\mathrm{gramforce}}}_{{\mathrm{standard}}}{,}{{\mathrm{kip}}}_{{\mathrm{avoirdupois}}}{,}{{\mathrm{kipf}}}_{{\mathrm{standard}}}{,}{{\mathrm{newton}}}_{{\mathrm{SI}}}{,}{{\mathrm{ounceforce}}}_{{\mathrm{standard}}}{,}{{\mathrm{planck_force}}}_{{\mathrm{planck}}}{,}{{\mathrm{pond}}}_{{\mathrm{standard}}}{,}{{\mathrm{poundal}}}_{{\mathrm{standard}}}{,}{{\mathrm{poundforce}}}_{{\mathrm{standard}}}{,}{{\mathrm{sthene}}}_{{\mathrm{standard}}}{,}{{\mathrm{tonforce}}}_{{\mathrm{standard}}}$ (3)
 Other optional arguments available for filtering the list of units are described in the GetUnits help page.
 • For complete information describing a specific unit, use the GetUnit command.
 > GetUnit('newton');
 ${\mathrm{newton}}{,}{\mathrm{context}}{=}{\mathrm{SI}}{,}{\mathrm{default}}{=}{\mathrm{false}}{,}{\mathrm{conversion}}{=}\frac{{1000}{}{{\mathrm{metre}}}_{{\mathrm{SI}}}{}{{\mathrm{gram}}}_{{\mathrm{SI}}}}{{{\mathrm{second}}}_{{\mathrm{SI}}}^{{2}}}{,}{\mathrm{prefix}}{=}{\mathrm{SI}}{,}{\mathrm{symbol}}{=}{N}{,}{\mathrm{symbols}}{=}\left\{{N}\right\}{,}{\mathrm{spelling}}{=}{\mathrm{newton}}{,}{\mathrm{plural}}{=}{\mathrm{newtons}}{,}{\mathrm{spellings}}{=}\left\{{\mathrm{newton}}{,}{\mathrm{newtons}}\right\}{,}{\mathrm{abbreviation}}{=}{\mathrm{none}}{,}{\mathrm{abbreviations}}{=}{\varnothing }$ (4)
 • To attach a unit to a value, use the Unit constructor (or the Units palette) with either a unit's symbol or any of its spellings. Products of units can also be used. Note that units are automatically converted within the Unit command but not across operations.
 > 4*Unit('N');
 ${4}{}⟦{N}⟧$ (5)
 > 8*Unit('N'*'m');
 ${8}{}⟦{N}{}{m}⟧$ (6)
 > combine(8*Unit('N'*'m'), 'units');
 ${8}{}⟦{J}⟧$ (7)
 > 4*Unit('N') * 2*Unit('m');
 ${8}{}⟦{J}⟧$ (8)
 • To include units in expressions, and convert automatically to the default unit in the current system of units, use the Standard environment, the Simple environment, or the Natural environment. The UsingSystem command returns the current system of units. For a list of all the units in that system, use the GetSystem command.
 > with(Units[Standard]):
 > UsingSystem();
 ${\mathrm{SI}}$ (9)
 > GetSystem((9));
 ${{\mathrm{farad}}}_{{\mathrm{SI}}}{,}{{\mathrm{newton}}}_{{\mathrm{SI}}}{,}{{\mathrm{volt}}}_{{\mathrm{SI}}}{,}{{\mathrm{meter}}}_{{\mathrm{SI}}}{,}{{\mathrm{henry}}}_{{\mathrm{SI}}}{,}{{\mathrm{dollar}}}_{{\mathrm{US}}}{,}{{\mathrm{mole}}}_{{\mathrm{SI}}}{,}{{\mathrm{ampere}}}_{{\mathrm{SI}}}{,}{{\mathrm{pascal}}}_{{\mathrm{SI}}}{,}{{\mathrm{lux}}}_{{\mathrm{SI}}}{,}{{\mathrm{watt}}}_{{\mathrm{SI}}}{,}{{\mathrm{kilogram}}}_{{\mathrm{SI}}}{,}{{\mathrm{neper}}}_{{\mathrm{SI}}}{,}{{\mathrm{steradian}}}_{{\mathrm{SI}}}{,}{{\mathrm{second}}}_{{\mathrm{SI}}}{,}{{\mathrm{radian}}}_{{\mathrm{SI}}}{,}{{\mathrm{weber}}}_{{\mathrm{SI}}}{,}{{\mathrm{ohm}}}_{{\mathrm{SI}}}{,}{{\mathrm{lumen}}}_{{\mathrm{SI}}}{,}{{\mathrm{candela}}}_{{\mathrm{SI}}}{,}{{\mathrm{kelvin}}}_{{\mathrm{SI}}}{,}{{\mathrm{tesla}}}_{{\mathrm{SI}}}{,}{{\mathrm{coulomb}}}_{{\mathrm{SI}}}{,}{{\mathrm{siemens}}}_{{\mathrm{SI}}}{,}{{\mathrm{joule}}}_{{\mathrm{SI}}}$ (10)
 > 4*Unit('N') * 2*Unit('m');
 ${8}{}⟦{J}⟧$ (11)
 • For a list of all available systems of units, use the GetSystems command. To set the current system of units, use the UseSystem command.
 > GetSystems();
 ${\mathrm{Atomic}}{,}{\mathrm{CGS}}{,}{\mathrm{EMU}}{,}{\mathrm{ESU}}{,}{\mathrm{FPS}}{,}{\mathrm{MKS}}{,}{\mathrm{MTS}}{,}{\mathrm{SI}}$ (12)
 > UseSystem('FPS');
 > 4*Unit('N') * 2*Unit('m');
 $\frac{{1250000000000000}}{{6584392202157}}{}⟦{\mathrm{poundal}}{}{\mathrm{foot}}⟧$ (13)
 • To force a conversion to a non-default unit, use the convert/units command.
 > convert((13), 'units', 'calorie');
 $\frac{{1000}}{{523}}{}⟦{\mathrm{cal}}⟧$ (14)
 • Some units, like calorie, are derived differently in different contexts.  Use the UseContexts command to set the default context for context dependent units. To list the added default contexts, use the UsingContexts command.
 > convert(8*Unit('J'), 'units', 'calorie[nutrition]');
 $\frac{{1}}{{523}}{}⟦{{\mathrm{cal}}}_{{\mathrm{nutrition}}}⟧$ (15)
 > UseContexts('nutrition');
 > convert(8*Unit('J'), 'units', 'calorie');
 $\frac{{1}}{{523}}{}⟦{{\mathrm{cal}}}_{{\mathrm{nutrition}}}⟧$ (16)
 > convert(8*Unit('J'), 'units', 'calorie[thermochemical]');
 $\frac{{1000}}{{523}}{}⟦{\mathrm{cal}}⟧$ (17)
 > UsingContexts();
 ${\mathrm{nutrition}}$ (18)

Creating Systems of Units

 • If the units and systems of units available in the Units package are not sufficient, you can create new systems, units, and dimensions. To create a new base unit and corresponding base dimension, use the AddBaseUnit command. The HasDimension and HasUnit commands check to see if a dimension or unit already exists.
 > HasDimension('human');
 ${\mathrm{false}}$ (19)
 > HasUnit('soldier');
 ${\mathrm{false}}$ (20)
 > HasDimension('human');
 ${\mathrm{true}}$ (21)
 > HasUnit('soldier');
 ${\mathrm{true}}$ (22)
 • When a new base unit has been created, new composite dimensions and units can be defined based on that unit using the AddDimension and AddUnit commands. Previously defined or standard dimensions and units can also be redefined using these commands, or removed using the RemoveDimension command.
 > convert(150*Unit('soldiers'), 'units', 'sections');
 > GetUnit('section');
 ${\mathrm{section}}{,}{\mathrm{context}}{=}{\mathrm{standard}}{,}{\mathrm{default}}{=}{\mathrm{false}}{,}{\mathrm{conversion}}{=}\frac{{40468564224}{}{{\mathrm{metre}}}_{{\mathrm{SI}}}^{{2}}}{{15625}}{,}{\mathrm{prefix}}{=}{\mathrm{false}}{,}{\mathrm{symbol}}{=}{\mathrm{none}}{,}{\mathrm{symbols}}{=}{\varnothing }{,}{\mathrm{spelling}}{=}{\mathrm{section}}{,}{\mathrm{plural}}{=}{\mathrm{sections}}{,}{\mathrm{spellings}}{=}\left\{{\mathrm{section}}{,}{\mathrm{sections}}\right\}{,}{\mathrm{abbreviation}}{=}{\mathrm{none}}{,}{\mathrm{abbreviations}}{=}{\varnothing }$ (23)
 The unit section is already defined and included in the SI system. Specify the newly defined unit in its army context to use the new meaning.
 > GetUnit('section[army]');
 ${\mathrm{section}}{,}{\mathrm{context}}{=}{\mathrm{army}}{,}{\mathrm{default}}{=}{\mathrm{false}}{,}{\mathrm{conversion}}{=}{10}{}{{\mathrm{soldier}}}_{{\mathrm{army}}}{,}{\mathrm{prefix}}{=}{\mathrm{false}}{,}{\mathrm{symbol}}{=}{\mathrm{none}}{,}{\mathrm{symbols}}{=}{\varnothing }{,}{\mathrm{spelling}}{=}{\mathrm{section}}{,}{\mathrm{plural}}{=}{\mathrm{sections}}{,}{\mathrm{spellings}}{=}\left\{{\mathrm{section}}{,}{\mathrm{sections}}\right\}{,}{\mathrm{abbreviation}}{=}{\mathrm{none}}{,}{\mathrm{abbreviations}}{=}{\varnothing }$ (24)
 > convert(150*Unit('soldiers'), 'units', 'section[army]');
 ${15}{}⟦{{\mathrm{section}}}_{{\mathrm{army}}}⟧$ (25)
 • To create a new system, use the AddSystem command. This command is also used to customize an existing system by adding or changing the default unit for a dimension. To remove a system, use the RemoveSystem command.
 > HasSystem('military');
 ${\mathrm{false}}$ (26)
 ${80}{}⟦{\mathrm{soldier}}⟧$ (27)
 ${8}{}⟦{{\mathrm{section}}}_{{\mathrm{army}}}{}{\mathrm{hour}}⟧$ (28)