ScientificConstants - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Scientific Constants : Functions : ScientificConstants/AddConstant

ScientificConstants

 add a physical constant definition

 Calling Sequence AddConstant( full_name, value_eqn, opts ) AddConstant( full_name, derive_eqn, derive_opts )

Parameters

 full_name - name; full name of the physical constant. It cannot match the name or symbol of a physical constant in the ScientificConstants package (unless the 'check=false' option is given) value_eqn - equation of the form 'value'=value_obj that defines the value of the nonderived physical constant; value_obj must be of type constant or contain a Constant() object such that it evaluates to type constant opts - (optional) equation(s) of the form option=value, where option is one of 'check', 'symbol', derive_eqn - equation of the form 'derive'=derive_obj that defines the derived physical constant; derive_obj must be of type algebraic and contain at least one symbol or name of a physical constant derive_opts - (optional) equation(s) of the form option=value, where option is one of 'check' or 'symbol'; specify the derived physical constant definition

Description

 • The AddConstant( full_name, value_eqn, opts ) command adds a nonderived physical constant to the ScientificConstants package for the current session.
 • The AddConstant( full_name, derive_eqn, derive_opts ) command adds a derived physical constant to the ScientificConstants package for the current session.
 • To add a constant to all future Maple sessions, add the AddConstant command to your Maple initialization file. For more information, see Create Maple Initialization File.
 • After the physical constant has been added, the full name or symbol can be used to access the constant.
 • In the derive_eqn equation of the form 'derive'=derive_obj, the derive_obj expression is typically a product of rational powers of numerics, Maple constants, and physical constant identifiers (for example, symbols). Exceptions are the abs function, and a sum with dimensionally consistent summands.
 • The opts and derive_opts arguments can contain one or more of the following equations that specify the physical constant.
 'check' = true or false
 When 'check'=true, AddConstant checks whether the given name or symbol matches names or symbols of physical constants in the package. If it does, an error is returned.  The default value of 'check' is true. When 'check'=false, AddConstant attempts to remove from the package any conflicting physical constants.  This is unsuccessful if any of the conflicting constants are currently used in the definition of any derived physical constants.
 'symbol' = symbol
 This option defines the symbol of the physical constant. It cannot match the name or symbol of a physical constant in the ScientificConstants package (unless the 'check=false' option is given, see below).
 If a  physical constant definition does not include a 'symbol' equation, the full name is also assigned to the symbol.
 • The opts argument can also contain one or more of the following equations that specify the nonderived physical constant.
 'uncertainty' = uncertainty_obj
 This option defines the precision to which the physical constant's value is known. The uncertainty_obj option must be of type constant (or be so after Constant() objects evaluate) or a list of the form $\left[\mathrm{uncer},\mathrm{uncertainty_opt}\right]$ where uncertainty_opt is 'relative' or 'uld' and uncer is of type constant (or is after Constant() objects evaluate).
 If no uncertainty option uncertainty_opt is included, the value represents the absolute uncertainty of the physical constant. That is, the value is measured in units determined by the 'units' option.
 If uncertainty_obj is of the form $\left[\mathrm{uncer},'\mathrm{relative}'\right]$, uncer is the relative uncertainty in the physical constant's value.  The quantity uncer*value_obj is the absolute uncertainty of the physical constant.
 If uncertainty_obj is of the form $\left[\mathrm{uncer},'\mathrm{uld}'\right]$, uncer is the uncertainty in units in the least digit in the physical constant's value.  The quantity $\mathrm{uncer}\mathrm{SFloatExponent}\left(\mathrm{value_obj}\right)$ is the absolute uncertainty of the physical constant.  This form of uncertainty cannot be used with a non-float value_obj.
 If the 'uncertainty' option is not specified, the uncertainty is undefined.
 'units' = units_obj
 This option defines the units in which the value, and possibly uncertainty, are measured. The units_obj option can be an expression that Units[Unit] interprets as a unit or a Unit() standard form. For more information, see Units.
 If 'units'=units_obj is not specified, the units is unity, that is, one (1). This means that the physical constant is dimensionless.

Examples

 > $\mathrm{with}\left(\mathrm{ScientificConstants}\right):$
 > $\mathrm{AddConstant}\left(\mathrm{Hooke1},\mathrm{symbol}=\mathrm{k1},\mathrm{value}=2.3,\mathrm{uncertainty}=\left[0.1,\mathrm{relative}\right],\mathrm{units}=\frac{N}{m}\right)$
 > $\mathrm{GetConstant}\left(\mathrm{k1}\right)$
 ${\mathrm{Hooke1}}{,}{\mathrm{symbol}}{=}{\mathrm{k1}}{,}{\mathrm{value}}{=}{2.3}{,}{\mathrm{uncertainty}}{=}{0.23}{,}{\mathrm{units}}{=}\frac{{N}}{{m}}$ (1)
 > $\mathrm{AddConstant}\left(C,\mathrm{value}=3.0\right)$
 > $\mathrm{GetConstant}\left(C\right)$
 ${C}{,}{\mathrm{symbol}}{=}{C}{,}{\mathrm{value}}{=}{3.0}{,}{\mathrm{uncertainty}}{=}{\mathrm{undefined}}{,}{\mathrm{units}}{=}{1}$ (2)
 > $\mathrm{AddConstant}\left(\mathrm{Hooke2},\mathrm{symbol}=\mathrm{k2},\mathrm{value}=2\mathrm{Constant}\left(\mathrm{k1}\right),\mathrm{uncertainty}=2\mathrm{GetError}\left(\mathrm{Constant}\left(\mathrm{k1}\right)\right),\mathrm{units}=\mathrm{GetUnit}\left(\mathrm{Constant}\left(\mathrm{k1}\right)\right)\right)$
 > $\mathrm{GetConstant}\left(\mathrm{k2}\right)$
 ${\mathrm{Hooke2}}{,}{\mathrm{symbol}}{=}{\mathrm{k2}}{,}{\mathrm{value}}{=}{4.6}{,}{\mathrm{uncertainty}}{=}{0.46}{,}{\mathrm{units}}{=}\frac{{\mathrm{kg}}}{{{s}}^{{2}}}$ (3)
 > $\mathrm{AddConstant}\left(\mathrm{Hooke2d},\mathrm{symbol}=\mathrm{k2d},\mathrm{derive}=2\mathrm{k1}\right)$
 > $\mathrm{GetConstant}\left(\mathrm{k2d}\right)$
 ${\mathrm{Hooke2d}}{,}{\mathrm{symbol}}{=}{\mathrm{k2d}}{,}{\mathrm{derive}}{=}{2}{}{\mathrm{k1}}$ (4)
 > $\mathrm{Constant}\left(\mathrm{k2d}\right)$
 ${\mathrm{Constant}}{}\left({\mathrm{k2d}}\right)$ (5)
 > $\left(\mathrm{GetValue},\mathrm{GetError},\mathrm{GetUnit}\right)\left(\right)$
 ${4.6}{,}{0.4600000000}{,}⟦\frac{{\mathrm{kg}}}{{{s}}^{{2}}}⟧$ (6)
 > $\mathrm{GetConstants}\left(\mathrm{derivedfrom}=\mathrm{k1}\right)$
 ${\mathrm{k2d}}$ (7)
 > $\mathrm{GetConstant}\left(\mathrm{ℏ}\right)$
 ${\mathrm{Planck_constant_over_2pi}}{,}{\mathrm{symbol}}{=}{\mathrm{hbar}}{,}{\mathrm{derive}}{=}\frac{{h}}{{2}{}{\mathrm{\pi }}}$ (8)
 > $\mathrm{AddConstant}\left(\mathrm{electron_proton_mass_ratio},\mathrm{symbol}=\mathrm{m\left[e\right]/m\left[p\right]},\mathrm{derive}=\frac{m\left[e\right]}{m\left[p\right]}\right)$
 > $\mathrm{Constant}\left(\mathrm{m\left[e\right]/m\left[p\right]}\right)$
 ${\mathrm{Constant}}{}\left({\mathrm{m\left[e\right]/m\left[p\right]}}\right)$ (9)
 > $\mathrm{GetValue}\left(\right)$
 ${0.0005446170214}$ (10)
 > $\mathrm{GetError}\left(\right)$
 ${5.176301769}{}{{10}}^{{-14}}$ (11)
 > $\mathrm{GetConstant}\left(t\left[P\right]\right)$
 ${\mathrm{Planck_time}}{,}{\mathrm{symbol}}{=}{{t}}_{{P}}{,}{\mathrm{derive}}{=}\sqrt{\frac{{\mathrm{hbar}}{}{G}}{{{c}}^{{5}}}}$ (12)