Temperature - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Units : Temperature

Temperature

 Calling Sequence Temperature( v, s ) Value( t ) Scale( t ) type( expr, Temperature )

Parameters

 v - : algebraic : expression designating the temperature value s - : unit : Unit expression designating the temperature scale t - : Temperature : temperature object expr - : anything : any Maple expression

Description

 • The Temperature( v, s ) command returns an absolute temperature object. An absolute temperature is a measure of the amount of heat in a physical object. This is to be distinguished from a relative temperature expression, such as 20*Units:-Unit( degC ), which represents a change in temperature of an object (for example, in space or time).
 • The value v can be an arbitrary algebraic expression not involving any units.
 • The temperature scale s is a unit expression of the form Units:-Unit( d ), where d is one of the valid temperature units: degC, degF, K, degR, degRe or degc.

Properties of Temperature Objects

 • A Temperature object has the type Temperature, and this may be checked by using the type command.
 • The value (that is, the magnitude) of a Temperature object can be retrieved by using the Value method.
 • The temperature scale (a unit expression) can be retrieved by using the Scale method.

Arithmetic with Temperature Objects

 • The difference ${t}_{1}-{t}_{2}$ of two (absolute) Temperature objects ${t}_{1}$ and ${t}_{2}$ evaluates to a relative temperature expression.
 • The average $\frac{1}{2}{t}_{1}+\frac{1}{2}{t}_{2}$ of two (absolute) Temperature objects ${t}_{1}$ and ${t}_{2}$ evaluates to an absolute temperature expression.
 • The sum ${t}_{\mathrm{abs}}+{t}_{\mathrm{rel}}$ of an absolute temperature ${t}_{\mathrm{abs}}$ and a relative temperature ${t}_{\mathrm{rel}}$ evaluates to an absolute temperature expression.
 • More general arithmetric with temperature objects is possible with affine combinations and null combinations of temperatures.
 • An affine combination of temperatures is an expression of the form $\sum _{i=1}^{n}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}{a}_{i}{t}_{i}$ in which each ${t}_{i}$ is a Temperature object, and the coefficients ${a}_{i}$ satisfy $\sum _{i=1}^{n}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}{a}_{i}=1$.
 • An affine combination of absolute temperatures evaluates to a single absolute temperature. If all the temperature scales are the same, then the temperature scale of the result is the scale of the addends. However, an affine combination of temperatures with heterogeneous temperature scales evaluates to an absolute temperature whose temperature scale is the system default.
 • A null combination of temperatures is an expression of the form $\sum _{i=1}^{n}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}{a}_{i}{t}_{i}$ in which each ${t}_{i}$ is a Temperature object, and the coefficients ${a}_{i}$ satisfy $\sum _{i=1}^{n}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}{a}_{i}=0$.
 • A null combination of absolute temperatures (such as a difference of absolute temperatures) always evaluates to a relative temperature expression.
 • If all the Temperature objects such a combination have the same temperature scale, then the resulting Temperature object will use that temperature scale. Otherwise, the system default temperature scale is used.
 • Combinations of Temperature objects that are neither affine nor null return unevaluated.

Examples

 > $\mathrm{t1}≔\mathrm{Temperature}\left(20,\mathrm{Units}:-\mathrm{Unit}\left(\mathrm{degC}\right)\right)$
 ${\mathrm{t1}}{≔}{20}{}⟦{\mathrm{°C}}⟧$ (1)
 > $\mathrm{type}\left(\mathrm{t1},'\mathrm{Temperature}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{Value}\left(\mathrm{t1}\right)$
 ${20}$ (3)
 > $\mathrm{Scale}\left(\mathrm{t1}\right)$
 $⟦{\mathrm{°C}}⟧$ (4)
 > $\mathrm{t2}≔\mathrm{Temperature}\left(25,\mathrm{Units}:-\mathrm{Unit}\left(\mathrm{degC}\right)\right)$
 ${\mathrm{t2}}{≔}{25}{}⟦{\mathrm{°C}}⟧$ (5)
 > $\mathrm{t2}-\mathrm{t1}$
 ${5}{}⟦{\mathrm{°C}}⟧$ (6)
 > $\mathrm{type}\left(\mathrm{t2}-\mathrm{t1},'\mathrm{Temperature}'\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{t3}≔\mathrm{Temperature}\left(30,\mathrm{Units}:-\mathrm{Unit}\left(\mathrm{degC}\right)\right)$
 ${\mathrm{t3}}{≔}{30}{}⟦{\mathrm{°C}}⟧$ (8)
 > $\frac{\mathrm{t1}+\mathrm{t2}+\mathrm{t3}}{3}$
 ${25}{}⟦{\mathrm{°C}}⟧$ (9)
 > $\mathrm{t1}+\mathrm{t2}-\mathrm{t3}$
 ${15}{}⟦{\mathrm{°C}}⟧$ (10)
 > $t≔a\mathrm{t1}+\left(1-a\right)\mathrm{t2}$
 ${t}{≔}\left({-}{5}{}{a}{+}{25}\right){}⟦{\mathrm{°C}}⟧$ (11)
 > $s≔\genfrac{}{}{0}{}{t}{\phantom{a=\sqrt{3}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{t}}{a=\sqrt{3}}$
 ${s}{≔}\left({-}{5}{}\sqrt{{3}}{+}{25}\right){}⟦{\mathrm{°C}}⟧$ (12)
 > $\mathrm{evalf}\left(s\right)$
 ${16.33974596}{}⟦{\mathrm{°C}}⟧$ (13)
 > $\mathrm{t4}≔\mathrm{Temperature}\left(50,\mathrm{Units}:-\mathrm{Unit}\left(\mathrm{degF}\right)\right)$
 ${\mathrm{t4}}{≔}{50}{}⟦{\mathrm{°F}}⟧$ (14)
 > $\mathrm{t1}+\mathrm{t2}+\mathrm{t3}+\mathrm{t4}$
 ${20}{}⟦{\mathrm{°C}}⟧{+}{25}{}⟦{\mathrm{°C}}⟧{+}{30}{}⟦{\mathrm{°C}}⟧{+}{50}{}⟦{\mathrm{°F}}⟧$ (15)
 > $\frac{\mathrm{t1}+\mathrm{t2}+\mathrm{t3}+\mathrm{t4}}{4}$
 $\frac{{1472}}{{5}}{}⟦{K}⟧$ (16)
 > $\mathrm{t1}-\mathrm{t2}+\mathrm{t3}-\mathrm{t4}$
 ${15}{}⟦{K}⟧$ (17)
 > 

Compatibility

 • The Temperature command was introduced in Maple 2015.