• A space-separated or comma-separated list of values: 10, 15, 23, 29.7, 30.
•
• Equally-spaced values using the range function as in range(start value,step_size,end value). For example, range(0,0.2,3) creates the values 0, 0.2, 0.4,..., 2.6, 2.8, and 3.0. The step size is 1 if you provide only start and end values and skip the step value.
start_value can be either smaller or larger than end_value. In the latter case, the step size must be negative. For example, range(0,-5,-100) creates the values 0, −5, −10, ..., −95, −100, while range(0,5,-100) is an empty set of values.
•
• A convenient way to generate vectors of values is to use the Range dialog box, which you open by clicking the Range button () next to most of the fields that accept vectors of values.
In that dialog box, use the Entry method list to select the method to enter the values that define the range:
•
• Select Number of values to define range using a specified number of values. See Step and Number of Values.
•
• Select ISO preferred frequencies to define the range using an octave or other interval of ISO preferred frequencies (requires a license for the Acoustics Module). To show this option, click the Show button () and select Advanced Study Options.
Step to enter a step size or Number of values to specify the number of values in the array. Specify the start value for an array of values in the Start field. Enter the step size in the Step field or the number of values in the Number of values field, depending on the setting in the Entry method list. Specify the end value for the array of values in the Stop field. By default, the spacing of the values is linear, but you can select a function to apply to all values. To do so, choose one of the available arithmetic and trigonometric functions from the Function to apply to all values list. For example, select exp10 to create an array of exponentially increasing values. The list includes the following functions:
• The default value None, which means linear spacing using the range function directly with the values specified.
• The exponential functions exp10 (base-10 exponential function) and exp (base-e exponential function), which create exponentially-spaced values using the specified range of values as powers of 10 and of the mathematical constant e, respectively.
•
• The square root function sqrt, which creates a vector with values that are the square roots of the values specified.Use this entry method to set up a logarithmic range of values (frequencies, for example). Enter the Start value (fmin in the expression below), the Stop value (fmax in the expression below), and the Steps per decade (N in the expression below). The range then becomes 10^{range(log10(fmin),1/(N-1),log10(fmax))}To show this option, click the Show button () and select Advanced Study Options. This method requires a license for the Acoustics Module. Use this entry method to set up ISO preferred frequencies — a list of frequencies defined based on the preferred numbers of ISO 3. Enter the Start frequency, the Stop frequency, and an Interval: Octave, 1/3 octave (the default), 1/6 octave, 1/12 octave, or 1/24 octave. For example, range of frequencies between 1 and 10 using an octave is {1, 2, 4, 8} and, using 1/3 octave, it is {1, 1.25, 1.6, 2, 2.5, 3.15, 4, 5, 6.3, 8, 10}.
Click Replace to replace the contents in the field with the values specified in the Range dialog box.Click Add to add the range of values to the end of the existing values in the associated field. That way you can create more complex ranges.For ranges that contain integer values only, an Integer Range dialog box opens instead of the normal Range dialog box. The Integer Range dialog box only contains Start, Step, and Stop fields, all of which must contain integer values.
•
•
•
• The times for output from the time-dependent solver and the list of parameter values in the Settings windows for study step nodes for time-dependent and stationary solvers and for parametric sweeps.
• The contour levels, the streamline start-point coordinates, and the coordinates in arrow plots. Whenever you specify a number of coordinates in Settings windows for plots, the COMSOL Multiphysics software uses scalar expansion — if one component is the same for all coordinates, enter a single number in the corresponding text field. For example, to get 101 linearly spaced coordinates from y = 6 to y = 7 along x = 3, enter it as the single scalar 3 for x and then range(6,0.01,7) for y. Thus, you need not enter 101 similar values for x.
Because the range function returns a list of values, it is a vector-valued function that you cannot use in a definition of a variable, for example. Variables must return a scalar value.