Symbolics > Working with Symbolics > Working with Variables > Example: Explicit Calculation
Example: Explicit Calculation
Keyword explicit
Use the keyword explicit in symbolic calculations to return expressions with the values of variables in place, but without reducing numerical expressions.
 To copy this example accurately, on the Calculation tab, click Calculation Options > Units/Constants in Symbolics to toggle this option on.
1. Define some variables with units:
2. Use the keyword explicit to substitute a variable for its value in the following expression:
3. Evaluate the expression numerically:
4. Change the units of the final result to meters per second:
Excluding Substitutions
The keyword explicit has modifiers that allow you to specify which variables receive substitution if assigned:
1. Substitute a single variable:
2. Show that explicit substitutes only the assigned variables:
Variable d is ignored because it is not part of the expression.
3. Show that using the ALL modifier has the same effect as specifying all variables:
4. Show that using no modifiers has the same effect as redefining variable names before other types of symbolic calculations:
5. To perform the above numeric calculation without using explicit, use the clear.sym function to clear the symbolic values of all variables:
6. Use explicit to display formulas in terms of variables, without substituting values for the variables defined elsewhere in the worksheet:
Chaining Evaluations
Use the keyword explicit and its modifiers chained with other symbolic keywords and evaluations, just as you do with other symbolic operations. The settings persist throughout the calculation.
1. Use the keywords explicit and float in a chained symbolic evaluation:
The result contains no numerical substitutions because all three variables were symbolically cleared in a previous step.
2. Redefine the three variables, and then repeat the above calculation:
3. Stack the keywords explict and float over a single symbolic evaluation operator:
The stacking of keywords and modifiers can, in some cases, yield a different result.
4. Assign the symbolic result to a variable then evaluate the variable numerically:
5. Show that the numerical result remains unchanged when you specify different variables after explicit:
Explicit calculation is used to revert to the named value of variables in symbolic computations without redefining the variables. Once the value has been masked, you can proceed with a multi-step symbolic or symbolic/numeric computation while treating some variables as names and some as their numeric assignments.
Substituting Values Dependent on Previous Values
You can chain definitions, but you have to include the whole sequence of variables to substitute all values.
1. Define some variables:
2. Use the keyword explicit to substitute for a specified variable:
3. Make the value of c show up as a single number by symbolically evaluating it in its definition:
4. Add a square root to the definition of variable d:
5. Replace the square root of c with a numeric value by choosing different symbolic representation for d: