Curves are comprised of an X data vector and a Y data vector. The X and Y vectors can be read from a data file, defined as mathematical expressions, or entered as values. The X and Y vectors of a curve do not have to come from the same source. For instance, the data source for the X vector of a curve can be an ASCII file and the source for the Y vector of the same curve can be defined by an expression such as sqrt(x).
If File is selected as the source, the file panel is displayed, allowing you to select data files for the X and Y vectors.
File selected as the data source for a vector.
|
If Math is selected as the source, the curve calculator is displayed, allowing you to define the vector mathematically.
Math selected as the data source for a vector.
|
Curve Calculator
|
Curves can be defined mathematically using the program’s curve calculator. The curve calculator is displayed on the Define Curves panel when Math is selected as the data source for a vector.
The curve calculator is formatted much like a scientific calculator. It consists of a number pad, basic algebraic and trigonometric functions, and, curve fitting, filtering, and signal-processing functions. Expressions can be typed directly into the vector field or entered by clicking selected numbers, functions, or operators on the curve calculator.
Once the expression is constructed, click Apply to plot the curve
|
Defining a Range
|
Defining a range is a quick way of specifying a spread of values for a vector. Click Range to display the Range dialog.
The Range dialog consists of three fields: From, To, and By. Enter the start and end points for the range of values in the From and To fields respectively. The By field enables you to enter an increment by which the values in the range are created.
In the vector field, the range is denoted using the following syntax:
from:to:by
Ranges can also be defined by entering the information directly into the expression field using the same syntax.
OK Inserts the range in the vector field.
Cancel Exits the Range dialog without inserting the range into the expression.
|
Calculus Functions
|
Integrals and derivatives can be included in an expression. Integrals and derivatives are displayed as:
integral(,)
derivative(,)
Independent and dependent vectors must be supplied for both functions.
Note | See Math Reference for more information on integrals and derivatives. |
|
Signal Processing
|
Fast and discrete Fourier transforms, as well as windowing, power spectral density, and frequency response functions can be included in expressions.
Note | See Math Reference for more information on the signal-processing functions. Each window function is discussed in the Math Reference on-line help. |
There are six different windowing functions available:
|
Filter
|
Curves may be passed through two classes of filters, ideal or SAE. From the Define Curves panel, click Filters... to display the Filter dialog box.
Select either Ideal, SAE or SAE J211/1 from the Filter Class option menu.
There are four ideal filter types available:
For ideal filters, specify the type of filter and the cutoff frequency. Band pass and band stop filters require both a low and a high cutoff frequency. Click OK to insert the filter into the expression.
Any SAE filter class can be specified by modifying the entered filter class (60, 180, 600, or 1000) in the Y text field.
For SAE J211/1, select the padding type and direction.
|
Fit
|
Polynomial and exponential functions can be fit to curves. From the Define Curves panel, click Fit... to display the Curve Fit dialog box.
Select either a polynomial or an exponential function to fit to the curve. Up to a 20th order polynomial can be fit to a curve. Specify the order for the polynomial, then click OK.
|
Math Functions
|
The Functions... button displays a dialog box containing all available math functions. External functions or Templex functions can be registered in the program using *RegisterExternalFunction() or *RegisterTemplexFunction() in the preference file.
Any of the functions can be inserted into the current expression by selecting the function name from the list or by typing the name directly into the equation. See the List of Standard Functions topic in the Math Reference Help for more information.
|
External Functions
|
In addition to the built-in math functions and operators, external C-programs can also be called from within a math expression. This enables you to process plot data from within the program using your own set of specialized programs. For example, the external program can be a customized filter for manipulating plot data or a program that passes plot data to another application for processing.
External programs must be registered in the preferences file before they can be called from within a math expression. Registering an external program associates the program file with a function name. External programs can be registered in your own preferences file or in the global preferences file, making it available to everyone on the network.
Note | See Altair IPC for more information on writing and calling external C-programs from within a math expression. |
| See the *RegisterExternalFunction() statement in Preference Files help for more information on registering external functions in the preferences.mvw file. |
|
Freezing Vectors
|
When a vector is defined by an expression, the program automatically recalculates the vector each time the expression is altered, in turn, updating the curve. If an expression contains a reference to another curve and the referenced curve changes, the program recalculates the vector and updates the curve containing the reference.
Vectors can be frozen so that the program does not recalculate the curve. When a vector is frozen, it is no longer dependent on a referenced curve, so changes made to other curves are not reflected in the frozen vector. Vectors can be unfrozen, making them once again subject to change. The X and Y vectors can be frozen independently of each other or together, freezing the entire curve. Frozen vectors are saved as data point values in session files.
|
If Values is selected as the source, a table is displayed, allowing you to directly enter data point values.
Value selected as the data source for a vector.
You can cut, copy, paste, and insert data point values to the table. Click the expansion button, , to view a larger dialog containing all x and y data points.
|
|