Define numeric variables
Updated 30 Aug 2024
Values for a numeric variable can be a simple numeric, a range of values, an equation, function, or another variable. Numeric variables can also be used in calculations. For example, you could use 0.5*t^2 as a calculation in a question, where "t" is a numeric variable with a range of values.
How to define numeric list variables
- Open the Simple Editor so that the item you want to edit appears in the Edit Item window.
- Open the Define Variable form using one of these methods.
Move the Define Variable window to refer to item information that would otherwise be hidden.Define variables for an item (without inserting them in a text box yet)- Select Variables from the top toolbar.
- Choose the Define New Variable link.
- Repeat the process as needed.
Define and insert a variable as you work in the item, such as in a part text boxPlace your cursor in a text box and follow one of these paths.
- Choose Insert variable from the right-click menu or choose Insert then Insert variable from the editing toolbar menus. Select New.
- Enter a name for your new variable in the text box and select the text. Choose Add Variable from the editing toolbar. The variable name appears in a box. Select the variable name and then choose the define link.
- Choose Numeric for the variable type.
- In the Variable Name box, enter a name such as weights. About variable names
- Provide the applicable information for the kind of numeric value you want:
- Range of numeric values
Enter both a minimum and a maximum value. For Step, enter the increment between the min/max values. Using a min/max range of 1-10, a step of 1 will include the values 1 through 10 for the variable.- To define a constant — Make the minimum and maximum the same value and enter 0 for the step. Or, you can enter the constant in the "Formula or single numeric value" box (see next bullet below).
- To define variables using an equation — The equation must contain only constant numbers and predefined variables. For example, if you define a variable named m_1 that ranges from 10 to 20 kg and you want to want to define another mass that depends on m_1, you could enter m_1+1 as the minimum and m_1+11 as the maximum value.
- Math functions — The minimum, maximum, and step fields can contain any math function allowed in an answer. For more information, see Define numeric values with functions.
- Formula or single numeric value
Either enter a formula, such as 2(5*16), or enter a single numeric value, such as ¼, 6.25, or 51. You can also enter a constant.Tip: Numeric variables can also be used to define other variables. For example, if you create variables A and B, you can later define variable C as A*B.
- Range of numeric values
- Enter information for one or more of the following settings.(Optional)
These settings are also available when you define numeric string variables.- Units Name Enter TeX or ChemTeX, such as m^2.
- Format Enter a format for how numeric values should display in item text boxes. See Display format for numeric variables.
- Symbol Enter a letter or a TeX or ChemTeX symbol to use for displaying the variable name, such as /gamma.
- Units Conversion Enter a formula for converting this value to some other system of units as part of an answer.
Radians instead of degrees
Because the argument of all trigonometric functions in Mastering must be in radians, not degrees, the most common units conversion is from degrees to radians. For example, if you define an angle "theta" in degrees, and an answer later in the item is "sin(theta)", you must provide the conversion "theta*pi/180" in this field.
- Select OK.
The form closes and a list of defined variables (and their associated information) for the item appears at the top of the window. - To save your edits, select Save (from the top toolbar) or the Save & Preview link (top right). Do NOT press Ctrl+S (Windows) or Command-S (Mac OS).
- To insert the variable in the appropriate text box for the item, see Insert variables into item content.
After variables have been defined in an item, you can see variable values in the Edit Item window. After variables have been inserted in item content, you can preview variable values in Mastering Standard (student) and Solution views.
See also: