convert/unit_free
convert to unit-free form
Calling Sequence
Parameters
Description
Examples
convert(u, unit_free, unit)
u
-
expression
unit
(optional) name
The convert(u, unit_free) function returns the unit-free component of u. If u is of type unit, then 1 is returned.
The convert(u, unit_free, unit) function returns the unit-free component of u and assigns the unit component of u to unit. If u is of type unit, then 1 is returned. If u is unit-free, then 1 is assigned to unit.
The term unit-free describes a scalar quantity with no (multiplicative) unit attached to it. Conversion to unit-free does not apply directly to any non-scalar Maple object or data structure, which may still have units embedded within it.
Notes:
To enter a unit in 2-D Math input, select the unit from the appropriate Units palette. If the unit you want is not there, select unit and then enter the unit.
When you edit a unit, double brackets appear around it.
convert⁡100.0,unit_free
100.0
convert⁡234,unit_free,unit1
234
unit1
1
expr≔convert⁡45⁢sin⁡x⁢Unit⁡farad,unit_free,unit2
expr≔45⁢sin⁡x
unit2
F
a≔expr⁢unit2
a≔45⁢sin⁡x⁢F
The conversion to unit_free state does not recurse into, or map over, non-scalar objects. Examples illustrating such mapping or effective unit-stripping recursion are shown below.
M≔Vectorrow⁡3⁢Unit⁡gram,5⁢Unit⁡kilogram
M≔3⁢g5⁢kg
map⁡convert,M,unit_free
35
t≔Int⁡sin⁡x⁢Unit⁡meter,x=1⁢Unit⁡s..10⁢Unit⁡s
t≔∫s10⁢ssin⁡x⁢mⅆx
subsindets⁡t,with_unit,z↦convert⁡z,unit_free
∫110sin⁡xⅆx
subsindets⁡t,specfunc⁡anything,Units:-Unit,1
If a non-scalar object contains a mix of units then it may be desirable to combine the units or convert to a single system, so as to get correct scaling.
expr≔Mrange=3⁢Unit⁡kg..5⁢Unit⁡g
expr≔Mrange=3⁢kg..5⁢g
subsindets⁡expr,with_unit,z↦convert⁡combine⁡z,units,unit_free
Mrange=3..1200
expr≔Mrange=3⁢Unit⁡kg..5⁢Unit⁡lb
expr≔Mrange=3⁢kg..5⁢lb
subsindets⁡expr,with_unit,z↦convert⁡convert⁡z,system,FPS,unit_free
Mrange=30000000045359237..5
See Also
convert
convert,conversion_table
convert,dimensions
convert,units
electric capacitance
type/with_unit
Units
Units/Index
Download Help Document