Symbolics > About Units and Constants in Symbolics
About Units and Constants in Symbolics
PTC Mathcad uses labels to associate mathematical elements, such as units and variables, in a worksheet with specific mathematical types.
The default label styles of inserted units and constants, as well as typed-in variables, are as follows:
• None—Italic/Black.
• Variable—Italic/Black.
• Unit—Italic/Bold/Blue.
• Constant—Italic/Bold/Green.
• Function—Regular/Black.
• System—Bold/Black.
• Keyword—Bold/Black.
Labels that are assigned by the system, or explicitly by the user, to an identifier do not change with context. Examples of such labels are ones that are set by default in the unit or constant placeholders or set by default when solving functions are inserted and so forth.
As a PTC Mathcad user, you have control over the assignment, and reassignment, of labels and label styles. This is true both when you perform symbolic or numeric calculations.
You can enable the Units/Constants in Symbolics option to give PTC Mathcad some control over the assignment of labels and label styles. In this PTC Mathcad infers the label and returns it as part of the result of a calculation.
• As the name implies, the Units/Constants in Symbolics option applies only to symbolic calculations!
• You can choose to perform symbolic calculations with this option disabled (default) or enabled.
• Enabling the Units/Constants in Symbolics option automatically modifies the existing worksheet contents, as needed.
• When enabled, and in the absence of previous definitions, labels are returned by PTC Mathcad reflecting assumptions that it makes when computing expressions.
Working with the Calculation Option “Units/Constants in Symbolics” Disabled
This is the default state when you open a new worksheet. Here, you have control over assigning labels to typed-in identifiers. In this case:
• Inserting a unit from the Ribbon gives the unit the label, and label style, of Unit. Evaluating the unit symbolically results in the right-hand-side (RHS) of the equation also getting assigned the label, and label style, of Unit.
• Inserting a constant from the Ribbon gives the constant the label, and label style, of Constant. Evaluating the constant symbolically results in the RHS of the equation also getting assigned the label, and label style, of Constant.
• Manually typing in an identifier gives the identifier the label, and label style, of None. Evaluating the identifier symbolically results in the RHS of the equation also getting assigned the label, and label style, of None.
Example:
1. Type the expression m +. PTC Mathcad assigns m the None label.
2. Type a second m and manually assign it the Unit label
3. Evaluate the expression symbolically:
In this case, the result is identical to the input expression because PTC Mathcad does not attempt to resolve the labels based on its knowledge of built-in units or constants. PTC Mathcad treats the seemingly identical variables differently because they are labeled differently.
In general, if you type an identifier that has no special meaning to PTC Mathcad – a unit or a constant – then the identifier gets the default label of None. An exception to this rule applies when manually typing in the identifiers ∞ (Ctrl+Shift+Z), e, or π (p, Ctrl+G):
◦ Identifier ∞ is assigned the label, and label style, of Constant immediately and before applying the symbolic evaluation. After evaluation, the result is also assigned the label, and label style, of Constant.
◦ Identifiers e and π are initially assigned the label, and label style, of None. After evaluation, the label of the LHS remains None, but its label style changes to Constant. The results are assigned the label, and label style, of Constant.
Working with the Calculation Option “Units/Constants in Symbolics” Enabled
By enabling this option you allow PTC Mathcad to resolve and assign labels based on its knowledge of built-in units or constants.
If you enable this option after symbolically evaluating the previous expression, then PTC Mathcad returns:
The labels of the left-hand-side (LHS) remain unchanged, but their label style changes to Unit. However, the labels, and label styles, of RHS change to Unit. This allows PTC Mathcad to symbolically add two variables that have the same label.
The insertion of units, or constants, from the Ribbon followed by symbolic evaluation yields the same results and labels as before. Thus, enabling this option has no effect on the built-in units and constants.
However, manually typing in identifiers and evaluating them symbolically yields the same results but the assigned label, and label style, depend on what you manually type-in:
• Typing an identifier that PTC Mathcad does not recognize as a built-in unit or constant, such as x, and evaluating it symbolically results in PTC Mathcad assigning both sides of the equation the label, and label style, of None.
• Typing, but without evaluating, an identifier that PTC Mathcad recognizes as a built-in unit or constant, such as c or m:
◦ PTC Mathcad assigns it the label, and label style, of None.
◦ If the typed identifier is c, then symbolic evaluation results in the LHS keeping the None label and PTC Mathcad automatically assigning the LHS the label style of a constant and assigns the RHS the Constant label and label style.
◦ If the typed identifier is m, then symbolic evaluation results in the LHS keeping the None label and PTC Mathcad automatically assigning the LHS the label style of a unit and assigns the RHS the Unit label and label style.
PTC Mathcad always treats ∞, e, or π as if the Units/Constants in Symbolics option is enabled.