Last updated: March, 2018.
QMTools Help:  Variables

Variables are characterized by a name, a value, and [possibly] a domain, and fall into two broad categories: dependent and independent. The value of a dependent variable must be assigned in context, (with an equation that often references other variables, or even functions). Variables include parameters, function arguments, and even [reserved] constants.

Mouse and keyboard input is described below for the Windows platform; for Mac users, a right-click becomes a ctrl-click, and cmd substitutes for ctrl in all keyboard shortcuts.

divider
Rules for Naming Variables

  1. Variable names are case sensitive; they may include digits but must start with a letter.
    Some Greek characters may be inserted using dedicated key combinations, as listed on the Insert item of the popup menu that is activated with a right-click in the formula field. (Holding down the shift key when typing these combinations inserts the upper case version of the character.)
  2. Variable names may not contain any arithmetic operations.
  3. Variable names may be subscripted; to append a subscript, type the variable name followed by ctrl+J.
    No arithmetic operations are allowed in subscripts (not even a leading minus sign).
    Only one level of subscripting is allowed, i.e., you cannot subscript another subscript. However, multiple subscripts are permitted and delineated by commas: for example, jk identifies a single subscript by that name, but j,k identifies two distinct subscripts named "j" and "k".
    Non-numeric subscripts appended to a variable are themselves treated as variables, not unlike function arguments. For example, aj,k is evaluated as would be the function a(j, k) named "a" with two arguments j and k. By contrast, b12 is simply a variable with a name extension (distinct from the variable b).

Back to Top

divider
Assigning Variables

Variables used as function arguments are created implicitly with the function, but parameters must be defined explicitly.

  1. Double-click in an area of the Math Palette where the first character will be placed, then type the parameter name.
  2. Next, type ctrl+X; this inserts the symbol "" and is the signal that you are defining something.
  3. Now enter the formula that will be used to calculate the parameter value, then type ctrl+Z. This last action tells the math engine to associate the formula with the parameter name, a process known as registering. When the engine successfully registers a function, it prints another equal sign followed by a checkmark. Failure to register properly causes an error mark to be printed, along with some explanation of the problem encountered.
    Parameter nesting is allowed to any level, i.e., a parameter formula can refer to any number of other parameters, whether or not they have been previously defined.
  4. A successfully-registered parameter is evaluated by typing its name followed by ctrl+Z.

Back to Top

divider
Setting a Variable's Domain

The domain defines the range of values permitted for the variable, All domains have an upper and lower bound (may be infinite). Domains may be discrete or continuous. For a discrete domain the allowed values (or their logarithms) are presumed distributed uniformly, and there are a countable number of them.

The domain concept applies to only that subset of variables we regard as independent. Function arguments fall into this category; indeed, any function we wish to graph must have an [artificial] grid imposed on its variables. Likewise, we are at liberty to assign a domain to parameters whose value expression does not reference other parameters; we call such parameters primitives.

Domains are set using the QMTools Domain Editor, a dialog box with editable fields specifying the minimum and maximum values permitted for the variable, and (for discrete domains) the number of values allowed. The domain editor appears on the Math Palette popup menu only as needed, i.e., when the mouse is right-clicked over an entry that defines either a function or a primitive parameter.

In the Domain Points field, enter the number of allowed values for a discrete domain, or -1 to specify a continuum.
If no domain is set, the variable can take any value consistent with its type (integer, floating point).

Back to Top