ScientificConstants - Maple Programming Help

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

ScientificConstants

 ModifyConstant
 modify a physical constant definition

 Calling Sequence ModifyConstant( descriptor, value_eqn, opts ) ModifyConstant( descriptor, derive_eqn, derive_opts )

Parameters

 descriptor - name; full name or symbol of physical constant value_eqn - equation of the form 'value'=value_obj that redefines the value of the physical constant; value_obj must be of type constant or contain a Constant() object such that it evaluates to type constant opts - equation(s) of the form option=value, where option is one of 'check', 'symbol', 'uncertainty', or 'units'; specify the nonderived physical constant definition derive_eqn - equation of the form 'derive'=derive_obj that redefines the physical constant; derive_obj must be of type algebraic and contain at least one symbol or name of a physical constant opts - equation(s) of the form option=value, where option is one of 'check' or 'symbol'; specify the derived physical constant definition

Description

 • The ModifyConstant( descriptor, value_eqn, opts ) command modifies the definition of a derived or nonderived physical constant in the ScientificConstants package producing a nonderived constant for the current session.
 • The ModifyConstant( descriptor, derive_eqn, derive_opts ) command modifies the definition of a derived or nonderived physical constant in the ScientificConstants package producing a derived constant for the current session.
 • To update a constant for all future Maple sessions, add the ModifyConstant command to your Maple initialization file. For more information, see Create Maple Initialization File.
 • 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 derive_opts and opts arguments can contain one or more of the following equations that set the physical constant definition.
 'check' = true or false
 When 'check'=true, ModifyConstant checks whether the given symbol matches the name or symbol of a physical constant in the package. If it does, an error is returned.  The default value of 'check' is true.  When 'check'=false, ModifyConstant attempts to remove from the package any conflicting physical constant.  This is unsuccessful if any conflicting constant is 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 the $'\mathrm{symbol}'$ is modified, the descriptor must be the full name of the physical constant.
 • The opts argument can also contain one or more of the following equations that set the nonderived physical constant definition.
 'uncertainty' = uncertainty_obj
 This option redefines the precision to which the physical constant's value is known.
 If the pre-existing value of the $'\mathrm{uncertainty}'$ is not undefined, this equation is required.
 If the constant was previously defined as a derived constant, this equation is not required. The default value of the uncertainty is undefined.
 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.
 'units' = units_obj
 This option redefines the units in which the value and 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.
 This equation is optional.

Examples

 > $\mathrm{with}\left(\mathrm{ScientificConstants}\right):$
 > $\mathrm{GetConstant}\left(c\right)$
 ${\mathrm{speed_of_light_in_vacuum}}{,}{\mathrm{symbol}}{=}{c}{,}{\mathrm{value}}{=}{299792458}{,}{\mathrm{uncertainty}}{=}{0}{,}{\mathrm{units}}{=}\frac{{m}}{{s}}$ (1)
 > $\mathrm{ModifyConstant}\left(\mathrm{speed_of_light_in_vacuum},\mathrm{symbol}={c}_{0}\right)$
 > $\mathrm{GetConstant}\left({c}_{0}\right)$
 ${\mathrm{speed_of_light_in_vacuum}}{,}{\mathrm{symbol}}{=}{{c}}_{{0}}{,}{\mathrm{value}}{=}{299792458}{,}{\mathrm{uncertainty}}{=}{0}{,}{\mathrm{units}}{=}\frac{{m}}{{s}}$ (2)
 > $\mathrm{AddConstant}\left(\mathrm{Hooke1},\mathrm{symbol}=\mathrm{k1},\mathrm{value}=2.3,\mathrm{units}=\frac{N}{m}\right)$
 > $\mathrm{GetConstant}\left(\mathrm{k1}\right)$
 ${\mathrm{Hooke1}}{,}{\mathrm{symbol}}{=}{\mathrm{k1}}{,}{\mathrm{value}}{=}{2.3}{,}{\mathrm{uncertainty}}{=}{\mathrm{undefined}}{,}{\mathrm{units}}{=}\frac{{N}}{{m}}$ (3)
 > $\mathrm{ModifyConstant}\left(\mathrm{k1},\mathrm{value}=2.3,\mathrm{units}=\frac{N}{m},\mathrm{uncertainty}=\left[0.1,\mathrm{relative}\right]\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}}$ (4)
 > $\mathrm{AddConstant}\left(\mathrm{mass_ratio},\mathrm{symbol}=\mathrm{m\left[e\right]/m\left[p\right]},\mathrm{derive}=\frac{{m}_{e}}{{m}_{p}}\right)$
 > $\mathrm{evalf}\left(\mathrm{Constant}\left(\mathrm{m\left[e\right]/m\left[p\right]}\right)\right)$
 ${0.0005446170233}$ (5)
 > $\mathrm{ModifyConstant}\left(\mathrm{mass_ratio},\mathrm{symbol}=\mathrm{m\left[p\right]/m\left[e\right]},\mathrm{derive}=\frac{{m}_{p}}{{m}_{e}}\right)$
 > $\mathrm{evalf}\left(\mathrm{Constant}\left(\mathrm{m\left[p\right]/m\left[e\right]}\right)\right)$
 ${1836.152667}$ (6)