HyperGraph

Define Curves Panel - XY Plot

Define Curves Panel - XY Plot

Previous topic Next topic Expand/collapse all hidden text  

Define Curves Panel - XY Plot

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Existing curves can be edited individually and new curves can be added to the current plot using the Define Curves panel.  The Define Curves panel also provides access to the program's curve calculator.  Click the Define Curves button on the plotting toolbar to display the Define Curves panel.

define_curves_panel

Define Curves panel

If *AutoDefaultCurves() is turned on in the preference file and a curve is added to a plot with existing curves, the new curve is a copy of the most recently added existing curve.  If*AutoDefaultCurves() is turned off, the new curve is empty.

On the Define Curves panel, the curve name is defined by a Templex expression instead of a fixed string as in HyperGraph 9.0 and earlier.  The Templex expression is visible in editable fields only.  In non-editable fields, the evaluated expression is displayed.  In most cases, the evaluated expression should match the text that was hard-coded in previous versions.  Please see Dynamic Curve Names for more important information on this topic.

hmtoggle_plus1greyCreating and Defining Curves

The Define Curves panel enables you to edit existing curves and create new ones.  To edit a curve, it must first be selected either from the curve list or picked from the window.

The X,Y, U, and V vectors are displayed at the top of the Define Curves panel.  The data sources for these vectors are displayed in the text fields.  Click the radio button for a vector or click in the corresponding text box to select that vector for editing. You can perform math on curves prior to plotting your data with the support of u and v vectors.

xyuv_values

X, Y, U, and V vectors on the Define Curves panel.  The text field shows the data source for the vector.

New data can be selected from a source file, mathematically defined using the program's curve calculator, or entered as values.  The Define Curves panel changes depending on which source is selected.

hmtoggle_plus1greyConstructing Curves

Expressions are constructed in the text fields next to the X and Y radio buttons.  Expressions are built by clicking on numbers, operators, and functions located on the curve calculator.  As the expression is built, each operator, function, and number is displayed in the text field.  An expression may contain basic math functions such as addition, subtraction, multiplication, and division, as well as trigonometric and signal-processing functions.  Expressions can also reference other vectors.

While the curve calculator displays only certain commonly used functions, over 100 math functions and operators are available.

NoteSee Math Reference for a detailed description of each function and its purpose.
hmtoggle_plus1greyReferencing Curves

Expressions can reference any curve or vector in the current session.  Curve vector references can be defined by picking the curve with the mouse or by using the following syntax:

pmwnco.vector

where:

m is the number of the page on which the curve resides

n is the number of the window which contains the curve

o is the number of the curve in the window

vector indicates the X, Y, or time vector of the referenced curve

For example, p2w1c3.y references the Y vector (.y) of the third curve (c3), in first window (w1), on the second page (p2).

When a referenced curve is edited or updated, the curves that reference that curve are updated as well.

The Curves dialog provides a fast, easy way of referencing curves.  To display the Curves dialog, click Curves....  The dialog displays three lists: the Page list, the Window list, and the Curve list.

Option

Description

Page

list contains the names of pages in the current session.

Window

list contains the names of the windows on the page selected on the Page list.

Curves

list contains the names of the curves in the window selected on the Window list.

OK

insert the vector into the active expression.

Curves in the Complex Plot module are referenced with additional syntax.  To indicate that a curve references phase values, phase curves have the letter p at the end.  For example, pmwnco.vectorp. To indicate that a curve references magnitude values, magnitude curves have the letter m at the end.  For example, pmwnco.vectorm.  Real curves that reference real values have the letter r at the end, pmwnco.vectorr. Imaginary curves that reference imaginary values have the letter i at the end, pmwnco.vectori.

hmtoggle_plus1greyCurve List

The curve list displays the names of all the curves in the active window.  Curves can be renamed, added, cut, copied, and pasted using the curve list controls.

Individual curves can be turned on or off.  To turn a curve off, select the curve from the list or pick the curve from the window and deactivate the check box next to the curve name above the curve list.  To turn a curve on that was turned off, activate the check box.

The Cut, Copy, Paste, and Add buttons are used to maintain the curve list for the active window.  Curves can be copied and pasted into other windows.  Curves can also be added and deleted from the list.

hmtoggle_plus1greyData Sources

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.

define_curves_panel

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_data_source

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.

range_dialog_hg

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.

NoteSee 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.

window_define_curves_plot

NoteSee 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:

1.Hamming
2.Hanning
3.Kaiser-Bessel
4.Blackman-Harris
5.Parzen
6.Welch

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:

1.low pass
2.high pass
3.band pass
4.band stop

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.

NoteSee 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_data_source

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, exp-button, to view a larger dialog containing all x and y data points.

 

How do I...

hmtoggle_plus1 Rename a curve:

1.From the Define Curves panel., select a curve from the Curve list or pick a curve from the window.

The name of the curve is displayed in the text box above the list.

2.Highlight the name of the curve in the text box.
3.Type a new name for the curve.
4.Press ENTER.

The new name is displayed in the list and in the legend.

hmtoggle_plus1 Add a curve:

1.From the Define Curves panel, click Add under the Curve list.

For Complex Plot and Polar Plot, click Add P/M to add a Phase/Magnitude curve or Add R/I to add a Real/Imaginary Curve.

A curve labeled "Curve 1" is appended to the list.

2.Enter a name for the untitled curve in the text field above the list.
3.Click ENTER.

The new name is now displayed in the list and in the legend.

This process adds a new blank curve to the active window.

hmtoggle_plus1 Cut a curve from the active window:

1.From the Define Curves panel, select a curve from the Curve list or pick a curve from the active window.
2.Click Cut from the curve list controls.

The selected curve is removed from the list and is no longer displayed in the active window.  The cut curve can be pasted in any HyperGraph 2D or HyperGraph 3D window.

hmtoggle_plus1 Copy a curve from the active window:

1.From the Define Curves panel, select a curve from the Curve list or pick a curve from the active window.
2.Click Copy from the curve list controls.

The selected curve is copied to the clipboard leaving the original behind.  The copied curve can be pasted in any window.

hmtoggle_plus1 Paste a curve into another window:

1.From the Define Curves panel, cut or copy a curve from the active window.
2.Select a new HyperGraph 2D or HyperGraph 3D window.
3.Click Paste from the Curve list controls.

The curve is added to the active window’s curve list and is displayed in the active window.

hmtoggle_plus1 Turn a curve on or off:

1.From the Define Curves panel, select a curve from the Curve list.

Or

Pick a curve from the window.

2.Select or deselect the Curve check box to turn the curve on or off.

The curve is either displayed in the window or hidden from view.

hmtoggle_plus1 Use a file as a data source:

1.From the Define Curves panel, select File.
2.Click the file browser button and select a data file.
3.Click on the X vector radio button.
4.Select an X vector data source from Type.
5.Click on the Y vector radio button.
6.Select a data source for the Y vector from Type.

hmtoggle_plus1 Edit a curve whose data source is a file:

1.From the Define Curves panel, select a curve from the list or pick a curve from the window.
2.Click on the corresponding vector radio button to edit the X or Y data vector.
3.Select or enter the new data for the vector.
4.Click Apply.

The changes to the curve are reflected in the HyperGraph 2D window.

hmtoggle_plus1 Use math as a data source:

1.From the Define Curves panel, select Math.
2.Define the vector using the curve calculator to create a mathematical expression.

hmtoggle_plus1 Use values as a data source:

1.From the Define Curves panel, select Values.
2.Enter values in the table.
3.Click Apply.

hmtoggle_plus1 Cut data point values:

1.From the Define Curves panel, select Values.
2.Select a point from the table.
3.Click Cut.

The data points are removed from the table.

hmtoggle_plus1 Copy and paste data point values:

1.From the Define Curves panel, select Values.
2.Select a point from the table.
3.Click Copy.
4.Click Paste.

The data points are added to the next row in the table.

hmtoggle_plus1 Insert data point values:

1.From the Define Curves panel, select Values.
2.Select a point from the table.
3.Click Insert.

A new row is added above the selected row.  The data values are both zero by default, allowing you to enter new values.

hmtoggle_plus1 Freeze a vector:

1.From the Define Curves panel, click either the X or Y vector radio button for a curve with a Math data source.
2.Click Freeze on the curve calculator.

You are prompted for permission to break associativity with referenced vectors.

3.Click Yes.

The selected vector is frozen and will no longer reflect changes from external sources.

hmtoggle_plus1 Freeze a curve:

1.From the Define Curves panel, click the X vector radio button.
2.Click Freeze on the curve calculator.

You are prompted for permission to break associativity with referenced vectors.

3.Click Yes.
4.Click the Y vector radio button.
5.Click Freeze on the curve calculator.

You are prompted for permission to break associativity with referenced vectors.

6.Click Yes.

Both vectors are frozen and the curve will no longer reflect changes from an external source.

hmtoggle_plus1 Unfreeze a vector:

1.From the Define Curves panel, select the frozen vector by clicking on its radio button.
2.Turn off Freeze on the curve calculator.

You are prompted for permission to re-establish any associations with referenced vectors.

3.Click Yes.

The frozen vector is now unfrozen.

hmtoggle_plus1 Select a windowing function:

1.From the Define Curves panel, click Window... to display the Window dialog box.

The windowing functions are listed in an option menu.

2.Select a window function.

The Kaiser-Bessel window requires a beta value to be defined.  The larger the beta value, the narrower the window.

3.Click OK to insert the function in the expression.

hmtoggle_plus1 Insert a vector into the active expression:

1.Select the page, window, and curve that contain the required vector.
2.Click Apply to insert the vector into the active expression.

The dialog remains open, allowing more vectors to be selected.

3.Click OK to insert the vector and close the dialog.

hmtoggle_plus1 Reference a curve in the active window:

1.Place the cursor in one of the vector text fields.
2.Hold down the shift key and pick a curve.

The corresponding vector from the picked curve is inserted into the expression.  If the cursor is in the X vector text field, the X vector of the picked curve is inserted.

Or

Hold down the SHIFT and CTRL keys and pick a curve.  The opposite vector from the selected curve is inserted into the expression.  If the cursor is in the Y vector text field, the X vector of the selected curve is inserted.

Or

Type the curve reference directly into the text box using reference notation described above.

Or

Select a curve using the Curves dialog.

See Also

Math on Curves