HyperWorks 13.0 HyperGraph 2D Tutorials
HyperWorks is a division of Altair
altairhyperworks.com
Al tai r En gi neer in g Su pp or t Co nt act Inf or mat io n Web site
www.altairhyperworks.com
Loc ation
Telephone
e-mail
Australia
64.9.413.7981 64.9.413.7981
[email protected]
Brazil
55.11.3884.0414
[email protected]
Canada
416.447.6463
[email protected]
China
86.400.619.6186
[email protected]
France
33.1.4133.0992
[email protected]
Germany
49.7031.6208.22
[email protected]
India
91.80. 6629.4500 1.800.425.0234 (toll free)
[email protected]
Italy
39.800.905.595
[email protected]
Japan
81.3.5396.2881
[email protected]
Korea
82.70.4050.9200
[email protected]
Mexico
55.56.58.68.08
[email protected]
New Zealand
64.9.413.7981
[email protected]
North America
248.614.2425
[email protected]
Scandinavia
46.46.460.2828
[email protected]
United Kingdom
01926.468.600
[email protected]
In addition, the following countries have resellers for Altair Engineering: Colombia, Czech Republic, Ecuador, Israel, Russia, Netherlands, Turkey, Poland, Singapore, Vietnam, Indonesia Official offices with resellers: Canada, China, France, Germany, India, Malaysia, Italy, Japan, Korea, Spain, Taiwan, United Kingdom, USA Copyright© Altair Engin eering eering Inc. All Rights Reserved Reserved for:
HyperMesh® 1990-2014; HyperCrash® 2001-2014; OptiStruct® 1996-2014; RADIOSS®1986-2014; RADIOSS®1986-2014; HyperView®1999-2014; HyperView Player® 2001-2014; HyperStudy® 1999-2014; HyperGraph®1995-2014; MotionView® 1993-2014; MotionSolve® 20022014; HyperForm® 1998-2014; HyperXtrude® 1999-2014; Process Manager™ 2003-2014; Templex™ 1990-2014; TextView™ 1996-2014; MediaView™ 1999-2014; TableView™ 2013-2014; BatchMesher™ 2003-2014; HyperMath® 2007-2014; Manufacturing Solutions™ 2005-2014; HyperWeld® 2009-2014; HyperMold® 2009-2014; sol idThinking® 1993-2014; solidThinking Inspire® 2009-2014; solidThinking Evolve®™ 1993-2014; Durability Director™ 2009-2014; Suspension Director™ 2009-2014; AcuSolve® 1997-2014; AcuConsole® 2006-2014; SimLab®™2004-2014 SimLab®™2004-2014 and Virtual Wind Tunnel™ 2012-2014. In addition to HyperWorks® trademarks noted above, Display Manager™, Simulation Manager™, Compute Manager™, PBS™, PBSWorks™, PBS GridWorks®, PBS Professional®, PBS Analytics™, PBS Desktop™, PBS Portal™, PBS Application Services™, e-BioChem™, e-Compute™ and e-Render™ are trademarks of ALTAIR ENGINEERING INC. Altair trademarks are protected under U.S. and international laws and treaties. Copyright© 1994-2014. Additionally, Altair software software is protected under patent #6,859,792 and other patents pending. All other marks are the property of their respective owners. ALTAIR ENGINEERING ENGINEERING INC. Proprietary Proprietary and Confidential. Contains Trade Secret Information. Not for use or disclosure outside of ALTAIR and its licensed clients. Information contained inHyperWorks® shall not be decompiled, decompiled, disassembled, or “unlocked”, reverse translated, reverse engineered, or publicly displayed or publicly performed in any manner. Usage of the software is only as explicitly permitted in the end user s oftware license agreement. Copyright notice does not imply publication
HyperGra Hyp erGraph ph 2D 13.0 13. 0 Tutorials .............................................................................................................................................3 Plotting Basics ............................ ........................................... ............................. ............................ ............................. ............................. ............................ ............................. ............................. ............................ ............................ .................4 ...4 HG-1000: Plotting XY Data ............................ .......................................... ............................. ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................17 ...17 HG-1010: Changing Curve Display Attributes ............................ .......................................... ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................22 ...22 HG-1011: Perform Math............................. on Curves Using the Plot Browser ............................ .......................................... ............................. ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................30 ...30 HG-1020: Modifying Plots ............................ .......................................... ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................36 ...36 HG-1021: Modifying Plots with............................. the Plot Browser ............................ .......................................... ............................. ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................52 ...52 HG-1030: Referencing and Filtering Curves ............................ .............. ............................ ............................. ............................ ............................ ............................. ............................ ............................. ............................. .................55 ...55 HG-1040: AVD Diagram Using ............................. Unit Scaling and Plot............................. Browser
.............................................................................................................................................63 Advanced Curve Manipulation ............................ .......................................... ............................. ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................64 ...64 HG-2000: Evaluating Curve Data ............................ .......................................... ............................. ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................68 ...68 HG-2010: Creating a Plot Macro
More .............................................................................................................................................75 Plotting ............................ .......................................... ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................76 ...76 HG-3000: Working with ............................. Bar Charts ............................ .......................................... ............................. ............................ ............................. ............................. ............................ ............................. ............................. .................80 ...80 HG-3010: Working with ............................. Complex Plots............................ ............................ .......................................... ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................85 ...85 HG-3020: Working with ............................. Polar Plots
.............................................................................................................................................90 Templates ............................ .......................................... ............................. ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................91 ...91 HG-4000: Creating an Export Template
.............................................................................................................................................97 Customization ............................ .......................................... ............................. ............................. ............................ ............................ ............................. ............................. ............................ ............................. ............................. .................98 ...98 HG-5010: Customizing the Environment
i
HyperGraph Hyp erGraph 2D 13.0 Tutorials Tutorials Proprietary Information of Altair Engineering
Altair Engineering
HyperGraph 2D Tutorials File Location
All files referenced in the HyperGraph tutorials are located in the HyperWorks installation direc tory under
/tutorials/mv_hv_hg/.
Finding the Installation Directory Most t utorials use files t hat are locat ed in the tutorials/ direct ory of t he softw are installation. In the tutorials, file paths are referenced as /../. In order to locate the files needed, you will need to determine the path of the installation directory . This path is dependent on the installation that was performed at your site. To determine what this path is, follow these instructions: 1.
Launch the application.
2.
From t he Help menu, select Updates. The HyperWorks Update Information dialog opens. The installation direct ory path appears after Altair Home:. The HyperGraph tutorial model files are located in /tutorials/ mv_hv_hg.
Plotting Basics HG-1000: Plotting XY Data HG-1010: Changing Curve Display Attributes HG-1011: Perform Math on Curves Using the Plot Browser HG-1020: Modifying Plots HG-1021: Modifying Plots with the Plot Browser HG-1030: Referencing and Filtering Curves HG-1040: AVD Diagram Using Unit Scaling and Plot Browser
Advanced Curve Manipulation HG-2000: Evaluating Curve Data HG-2010: Creating a Plot Macro
More Plotting HG-3000: Working with Bar Charts HG-3010: Working with Complex Plots HG-3020: Working with Polar Plots
Altair Engineering
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
1
Templates HG-4000: Creating an Export Template
Customization HG-5010: Customizing the Environment
2
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Plotting Basics HG-1000: Plotting XY Data HG-1010: Changing Curve Display Attributes HG-1011: Perform Math on Curves Using the Plot Browser HG-1020: Modifying Plots HG-1021: Modifying Plots with the Plot Browser HG-1030: Referencing and Filtering Curves HG-1040: AVD Diagram Using Unit Scaling and Plot Browser
Altair Engineering
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
3
HG-1000: Plotting XY Data In this tutorial you will learn how to: Plot curves from files. Plot multiples c urves in one window. Plot multiple curves in multiple windows. Use the Advance d Plot Options dialog to change the c urve and plot at tributes
Tools The Build Plots panel can be ac cessed one of t he following ways: Click the Build Plots icon, OR From the menu bar, select Curves > Build Plots. This panel allows you to const ruct multiple curves and plots from a single data file. Curves c an be overlaid in a single window or each curve can be assigned to a new window.
The Advanced Options feature on the Build Plots panel allows you to apply many options at once t o the session during plotting. Curves creat ed in this manner are added to the session in a new layer.
4
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
From the Build Plots panel, click Adv. Options to display the Advance Plot Options dialog.
The Multiple File Plotting dialog allows you to select multiple files with intersecting data (for example, multiple runs of a particular test) and plot the data from all files simultaneously in the current HyperGraph session.
Altair Engineering
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
5
To access the Multiple File Plotting dialog, click the Multiple File Plotting button, Build Plots panel.
6
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
, on the
Altair Engineering
Exercise: Creating XY Curves from Data Files Step 1: Open the demo.dat file. 1.
From File menu, select New > Session to clear all contents in the HyperGraph session.
2.
Verify XY Plot is selected from the plot type menu,
3.
Clic k t he Build Plots icon,
4.
Clic k t he Open File butt on, , and open the file /tutorials/ mv_hv_hg/plotting/demo.dat.
.
.
Step 2: Build multiple curves on a single plot. 1.
For X type: select Time.
2.
From t he Y type: column, select Force. The data available in the file is listed under the Y Request column.
3.
Under Y Request:, click the expansion butt on,
4.
Under Y Request:, press and hold the CTRL key and select REQ/3 Curve 3, REQ/5 Curve 5, REQ/7 Curve 7, and REQ/9 Curve9.
5.
Click OK to close the expanded list dialog.
6.
Under Y Component:, select X .
7.
Click Apply to create the curves on page 1.
Altair Engineering
, to easily view the Y Request list.
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
7
The plot’s X axis is labeled Time (the X t ype), while the y axis is labeled Force (the Y t ype). The plot’s title is X (the Y Component name). The curve’s names are the Y Request names.
Step 3: Build multiple curves on multiple plots. While in the Build Plots panel, do the following: 1.
Verify X type: Time is selected.
2.
Under Y type:, leave Force selected.
3.
Under Y Request:, leave REQ/3 , REQ/5 , REQ/7 , and REQ/9 selected.
4.
Under Y Component:, press the CTRL key and select Y and Z to add them to the already selected X. -OrPress the SHIFT key and selec t Z . This selects Z and everything between X and Z. -OrLeft click on X and drag the mouse down to Z .
5.
From t he Layout: drop-down menu, select One plot per Request . This option creates one plot for eac h selected Y request. Eac h plot cont ains as many c urves as there are selected Y components. The plot’s title is the Y Request name. The curve’s label is the Y C omponent name.
6.
8
Clic k t he Page Layout butt on,
, and select the four-window layout from the panel area.
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
7.
Click Apply to create the plots and curves on page 2.
Step 4: Use Advanced Options to change the curve and plot display attributes. While in the Build Plots panel, do the following: 1.
Keep the curves you created in Step 3.
2.
Click Adv. Options.
Altair Engineering
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
9
The Advanced Plot Options dialog is displayed.
3.
To change the page title font, click Page Options on the left side of the dialog.
4.
Click in the Font field on the right side of the dialog. Next, c lic k the Font icon, the Font dialog. Change the font size to 16 .
5.
Under Plot Options, select Header .
6.
Click in the Header field on the right side of the dialog to activate the drop-down menu. Deselect Y-Component.
, to display
This will remove the Y component from the header. 7.
Select Horizontal Axis from the left side of the dialog. Clic k in the Font field on the right side of the dialog. Next, c lick the Font icon,
, to display the Font dialog.
8.
From t he Font dialog, change the font size to 12.
9.
Repeat steps 7 and 8 the Vertical Axis.
10. Select Legend from the left side of the dialog. 11. From the Font dialog, change the legend font size to 10. 12. Select Curve Options from the left side of the dialog. 13. Click in the Label field on the right side of the dialog to activate the drop-down menu. Deselect Y Request. This removes the Y request from the label 14. Activate Show Prefix .
10
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
15. Click the Label Prefix field. Once the c ursor is displayed, enter Test 17. 16. Click OK to exit the Advanced Options dialog. 17. From the Build Plots panel, click Apply .
Altair Engineering
HyperGraph 2D 13.0 Tutorials 11 Proprietary Information of Altair Engineering
You can also perform filtering on the curve. For this, retain the c urve and plot modificat ions you just performed. 18. From the Build Plots panel, select Adv. Options. 19. Click Curve Options on the left side of the dialog. 20. Activate Math Expression. 21. Leave Expression for x as is. 22. Enter the following filter in the Expression for y field: saefilt95(u,v,60,5,3). 23. Click OK . 24. From the Build Plots panel, click Apply . 25. From Define C urves panel,
12
, you will see the filter you applied display in the y vector field:
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 5: Use Multiple File Plotting to plot multiples curves in one plot. 1.
From File menu, select New > Session to clear all contents in the HyperGraph session.
2.
Verify XY Plot is selected from the plot type menu,
3.
Clic k t he Build Plots icon
4.
Next to Data File, click the Multiple File Selection icon,
.
. .
The Multiple File Plotting dialog is displayed. 5.
Next to Select directory, click the Open File button, , and browse to the directory file /tutorials/mv_hv_hg/plotting/MultipleFiles.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 13 Proprietary Information of Altair Engineering
6.
You can expand the folders in the File Browser List to display the files contained in each folder.
You can selec t files from the File Browser List and click the arrow, Selected File Set. For this tutorial, we will filter them.
, to move them to the
7.
In the File-Filter field, enter *T01 and press ENTER. The following files are displayed:
8.
While holding the CTRL button, select the first eight files listed under File Browser List and click the right- fac ing arrow, , to move them to the Selected File Set.
14
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
9.
Under Curve Name, leave Prefix ac tivated and select Directory Leve l 2 from the drop-down menu.
10. Under Curve Attributes (Color/Style), leave By File selected. 11. Click Select to exit the dialog. 12. From the Build Plots panel, make the following selections: - For Y Type:, select Global Variables. - For Y Request:, select Internal Energy and Kinetic Ene rgy . - For Y C omponent:, select MAG . 13. From the Layout: drop-down menu, select One plot per Request . 14. Click the Page Layout button,
, and select the two- window layout from the panel area.
15. Click Apply .
Altair Engineering
HyperGraph 2D 13.0 Tutorials 15 Proprietary Information of Altair Engineering
16. You can also view the curve Label Prefix and Label information in the Plot Browser. These fields were edited using the Advanced Options dialog in Step 4.
16
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
HG-1010: Changing Curve Display Attributes In this tutorial you will learn how to: Use the Headers/Footers panel Change c urve att ributes Use the Notes panel Use the Options panel and style sheets
Tools The Headers/Footers panel can be accessed in one of the following ways: Click the Headers/Footers panel icon
in the toolbar
Or From the menu bar select Annotations > Headers/Footers The Headers/Footers panel allows you to add headers and footers to your plots, specify font style and color, position the titles, and turn them on and off.
The Curve Attributes panel can be accessed in one of the following ways: Click the Curve Attributes panel icon
in the toolbar
Or From the menu bar select Curves > Curve Attributes This panel allows you to change curve attributes such as line style, color, and weight as well as symbol style and color.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 17 Proprietary Information of Altair Engineering
The Options panel can be accessed in one of the following ways: Click on the Options panel icon Or From the menu bar select Preferences > Options This panel allows you to change the color of a XY plot window’s background, frame, grid lines, and zero line.
The Notes panel can be ac cessed one of t he following ways: Click on the Notes panel button, Or From the menu bar select Annotations > Notes This panel allows you to annotate plots. Notes are text boxes placed in plot windows for labeling points, describing trends, and relating additional curve information. You can create logic and expression-based not es using T emplex.
The Apply Style dialog can be accessed in the following ways: Right-click in the plot window and select HG ApplyStyle…
18
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
The Apply Style dialog allows you to quickly apply a plot window’s attributes across all plot windows on the current page, or on all pages in the plot.
Exercise: Editing Curve Display Attributes Step 1: Open Session File demo_3.mvw . 1.
From t he File menu, click Open > Session.
2.
Select the file /tutorials/mv_hv_hg/plotting/demo_3.mvw and click Open.
Step 2: Change the header for window 1 to REQ/3 force. 1.
Verify that window 1 on Page 2 is active.
2.
Click on the Headers/Footers panel icon,
3.
From t he Header tab, replace the name REQ/3 curve 3 with REQ/3 force and press ENTER to apply the change.
4.
Change the header font size by clicking the font butt on,
Altair Engineering
.
.
HyperGraph 2D 13.0 Tutorials 19 Proprietary Information of Altair Engineering
5.
Change the color of the header from the color palette.
Step 3: Change the line style for the curves in window 1. 1.
Clic k t he Curve Attributes icon
.
2.
From t he Curves list, select X , Y , and Z .
3.
From t he Line Attributes tab, change the thickness of the curves.
Step 4: Change the frame color for window 1 to yellow. 1.
Click on the Options panel butt on,
.
2.
From t he Color tab, select the option Frame.
3.
Select yellow from the color palette.
Step 5: Apply the window and curve display attributes of window 1 to the other plot windows on page 2. 1.
In window 1, right-c lick and select HG ApplyStyle… from the pop-up menu to open the Apply Style dialog.
2.
Select Current page.
3.
Activate only the attribute options Plot , Header , and Curves. Deac tivate all other options.
4.
Click OK to apply the active attributes to the other plot windows on page 2.
Max force is {Y} at time {X} " and attach it to a Step 6: Create the note " curve in window 1, on page 2. 1.
Activate window 1.
2.
Ent er t he Notes panel,
3.
Click Add to create a new note named Note1.
4.
From t he Text tab, replace Note1 with Max force is.
5.
Under t he Text window box, click {Y} to add the Templex string {y} to the note.
6.
Append to the note at time and click {X}.
.
The complete note is "Max force is {y} at time {x}". 7.
20
Click Apply to update the note.
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
8.
From t he Attach to tab, select the option Curve to add the note to a curve. Note: The note automatically attaches to a data point on curve 1 (the X curve). In the Notes panel, the Curve and Point to which the note is attached is called out. The note’s {X} and {Y} T emplex stat ements are updated to reflec t the dat a point’s X and Y values.
9.
Click points on any of t he curves in window 1 to update t he location/curve to which the note is attached. Note: The {X} and {Y} values are updated automatically.
10. Under Find point, click the Maximum butt on, maximum Y value.
, to att ach the note to the curve’s
11. With Note1 highlighted in the Notes list, turn off this note by deactivating the Note box.
Step 7: Create and attach a second note with Templex to a curve. While in the Notes panel, do the following: 1.
Activate window 3.
2. Add a note. 3.
On the Text tab, replace Note2 with "curve Y absolute area is {absarea(p2w3c2.x,p2w3c2.Y)}". The text in curly braces is a Templex statement.
4.
Click Apply to update the note.
5.
On the Attach to tab, select the option Curve.
6.
Clic k t he Next Curve button until the note is attached to curve 2 (curve Y).
Altair Engineering
HyperGraph 2D 13.0 Tutorials 21 Proprietary Information of Altair Engineering
HG-1011: Perform Math on Curves Using the Plot Browser In this tutorial you will learn how to use the Plot Browser to perform the following tasks: Perform math on a single curve in the Define Curves panel without creating duplicate curves Apply this math to all other curves in the session via the Plot Browser
Tools The HyperGraph 2D Plot Browser resides on a tab in the Tab Area sidebar and allows you to view the HyperGraph 2D plot structure.
The Plot Browser can be turned on or off using the View > Browsers > HyperGraph 2D > Plot menu options. A check mark indicat es that t he HyperGraph 2D Plot Browser is ac tivat ed for display in the Tab Area. You can use the Plot Browser tools to search, display and edit entities and their properties within the current session. From the Define C urves panel, you can edit existing curves and creat e new ones. To edit a curve, it must first be selected either from the curve list or picked from the window.
22
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
The X,Y, U, and V vectors are displayed at the top of the Define C urves panel. The data source s for these vec tors are displayed in the text fields. Click the radio butt on for a vec tor or c lick in the corresponding text box to selec t t hat vec tor for editing. In addition to the traditional X and Y vectors, you can perform math on curves prior to plotting your data with the support of u and v vec tors. As a result, only one curve is generat ed in the session, whereas in the older versions of HyperGraph, this could not be done without an initial curve. To use math as a data source, from the Define Curves panel, select Source > Math.
Exercise: Step 1: Open Session File demo_browser.mvw . 1.
From t he File menu click Open > Session.
2.
Select the file /tutorials/mv_hv_hg/plotting/ demo_browser.mvw and click Open.
Step 2: Use the Define Curves panel to apply an SAE filter to a curve. 1.
From the toolbar, select the Define Curves icon,
.
2.
Ac t ivat e t he x= radio button.
3.
Under Source, select Math.
4.
In the x= field, enter u. This applies the u vec tor to the x vec tor.
5.
Click Apply .
6.
Ac t ivat e t he y= radio button.
7.
Under Source, select Math.
8.
In the y= field, enter v. This applies the v vect or att ributes to the y vector.
9.
Click Apply .
You can now apply math to the y vector. 10. For the y vector, remove the v vector you entered in step 8. 11. With your cursor in the y= field, click Functions....
Altair Engineering
HyperGraph 2D 13.0 Tutorials 23 Proprietary Information of Altair Engineering
12. From the Functions dialog, select saefilt95 and click OK .
13. The saefilt95 funct ion takes six arguments: vector1, vector2, scalar1, scalar2, scalar3, scalar4. 14. Enter the following text in the function: saefilt95(u,v,60,20,3) and click Apply .
24
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
15. The result is a c orrupt c urve. This is because t he function expect s the t ime to be in seconds, and our curve is in milliseconds.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 25 Proprietary Information of Altair Engineering
16. To c orrect t his, you must apply the time vect or by 0.001. Enter the following in the y= field: saefilt95(u*0.001,v,60,20,3). The result is a properly filtered curve:
Step 3: Apply the math performed in Step 2 to all other curves in the session via the Plot Browser. In this step, you will apply the filter defined in Step 2 to all curves in the session using the Plot Browser. 1.
From t he Define Curves panel, highlight the y vector filter you added in step 1 and press CTRL+C to copy it.
2.
From t he Plot Browser, select the Curves icon from the top of the browser. This filters the session information so that only the curve information is displayed in the Plot Browser.
3.
Expand the folders for page 1 (p1: Angular Acceleration), window 1 (w1:XY Plot) and Curve by clicking the plus button next to each folder.
26
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
4.
As shown below, right-c lick on the y vector and select Select All .
All y vectors in the session are selected. 5.
Go t o t he Properties Table at the bot tom of the Plot Browser.
6.
From t he Source drop-down menu, select Math.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 27 Proprietary Information of Altair Engineering
7.
Notice that all the curves in the graphics area disappear, except for the curve we have already filtered on the Define C urves panel.
8.
Click in the Expression field and paste the filter you copied from the Define Curves panel and press ENTER. All curves in the session now contain the same filter and math.
9.
28
It is not required, but you can also apply math to the x vec tor. Similar to the steps above, right-click on the x vector from the Plot Browser and select Select All to select all x vectors in the session.
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
10. From the Source drop-down menu, select Math. 11. In the Expression field, enter u. Now all vectors in the session have the same math.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 29 Proprietary Information of Altair Engineering
HG-1020: Modifying Plots In this tutorial you will learn how to: Work with the Axes panel Use the Coordinate Info panel and TextView Modify curves Create secondary axis and assign curves to them
Tools The Axes panel can be ac cessed one of t he following ways: Click the Axes icon Or From the menu bar select Annotations > Axes This panel allows you to add multiple axes to plots. Also, axis attributes such as labels, color, and scaling can be modified.
To acc ess Convert Units tool, right-click on the plot axis and select Conve rt Units. The Convert Units tool allows you to convert the current unit of measure of a horizontal or vertical axis to another unit of measure. All curves associated with the axis are scaled accordingly and the axis label is updated to reflect the new unit of measure.
The Coordinate Info panel can be ac c essed one of t he following ways: Click the Coordinate Info icon Or From the menu bar select Curves > Coordinate Info
30
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
This panel allows you to retrieve individual point data on any curve in the active window. When a point is selected, its data is displayed in the panel .
To acc ess TextView, use the Select Application menu and click TextView
.
The text editor window allows you to view, edit, and save text files, conduct text searches, change text attributes, and evaluate Templex. With Templex, you can obtain curve data from the plot window and display the results in text format in the text window The Modify Curves panel can be accessed in one of the following ways: Click the Modify Curves icon Or From the menu bar select Curves > Modify Curves. The Modify Curves panel enables you to modify curve data pertaining to a plot. Curves can be deleted, trimmed, bridged, or hidden within a spec ified range and orientat ion.
The Scales Offset and Axis Assignments panel can be accessed in one of the following ways: Click the Scales Offset and Axis Assignments icon Or From the menu bar select Curves > Scales Offsets and Axis Assignments . Curve scaling, offsets, and axis assignments can be applied to multiple curves using this panel.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 31 Proprietary Information of Altair Engineering
Exercise: Modify and Interrogate XY Curves Step 1: Open Session File demo_3.mvw 1.
From t he File menu click Open > Session.
2.
Select the file /tutorials/mv_hv_hg/plotting/demo_3.mvw and click Open.
Step 2: Using the Convert Axis Units tool to scale the Y axis. 1.
On page 2, activate window 1.
2.
Right-c lick on the window’s vertical axis and select Convert Units from the pop-up menu. The current selection in the Conve rt Axis Units dialog defaults to Time. This is because the unit converter did not recognize the Y axis unit.
3.
Select Force from the dialog. Select From: N from the drop-down menu. Select To: kN from the drop-down menu.
4.
Click OK to apply the change and close the dialog. The Y axis’ label is changed from Force t o Force (kN). Also, the Y axis numbers and the curves’ Y data are scaled by 0.001.
5.
Open the unit c onverter again for the same Y axis. Force is now selected as the tool recognizes the axis’ unit of measure.
6.
Click Cancel to close the Conve rt Axis Units dialog.
Step 3: Change the Y axis label for window 1 to Force (kiloNewtons) 1.
Clic k t he Axes panel icon,
.
The Primary axis is highlighted or active in the Axes list. 2.
Above the Axes list, select Vertical from the drop-down menu.
3.
From t he Text tab, change Force (kN) t o Force (kiloNewtons) and press ENTER to apply the change.
Step 4: Creating a Datum Line 1.
Ac tivate window 2 on page 2.
2.
Clic k t he Datum Lines panel butt on,
32
.
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
3.
Click Add .
4.
Verify that the choice under the selection for Datum is Horizontal .
5.
Selec t t he Positon tab.
6.
Verif y t hat Axis is set to Primary .
7.
For Position, enter the expression sin(90) +100-cos(0) and press ENTER.
8.
Clic k t he Line Attributes tab and select a different color for the line.
Step 5: Trim the curves. 1.
Ac tivate window 3 on page 2.
2.
Clic k t he Modify Curves icon,
3.
To the right of the Curves field, there is a curves butt on,
. . Press this butt on.
The Select Curves dialog is displayed. 4.
Under p2:Force-2 select w3: X Y plot and click OK All curves in window 3 are selected and p2w3c1, p2w3c2, p2w3c3 are displayed in the Curves text field.
5.
Verify the option for Direction is set to Horizontal .
6.
Under Range, specify 0.2 for From and press ENTER.
7.
Spec ify 0.95 for To and press ENTER.
8.
Under Action, click Trim t o remove t he data out side of the spec ified range for the select ed curves.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 33 Proprietary Information of Altair Engineering
Step 6: Create a secondary Y axis in a plot window. 1.
Clic k t he Add Page icon,
.
2.
Go t o t he Build Plots panel,
3.
Open the file /tutorial/mv_hv_hg/plotting/demo.dat.
4.
Select the option Layout: Use current plot .
5.
Create a curve for X type: Time, Y type: Force, Y Request: REQ/3 Curve3, and Y Component: X.
6.
Create a second curve in the same plot window for X type: Time, Y type: Displacement, Y Request: REQ/33 Curve33, and Y C omponent: X.
7.
Go t o t he Axes panel,
8.
From the drop-down menu above the Axis list select Vertical .
9.
Click Add to create a secondary vertical axis on the plot window’s right side.
.
.
An axis with the name Y1 is created and its name is highlighted (active) in the Axis list. 10. In the Axis text field above the Axis list, rename the Y1 axis to disp and press ENTER. 11. On the Text tab, rename the Y1 axis label to Comp x disp and press ENTER. 12. Go to the Scales, Offsets, and Axis Assignments panel,
.
13. Verify the curve REQ/33 Curve 33-X is highlighted. 14. Under Axis assignments, click on the Y: drop down, select disp and click Apply . The secondary vertical axis is assigned to the curve REQ/33 Curve33-x. 15. Click Fit
to fit the curve to the plot window.
Step 7: In a text editor window using Templex, obtain information for existing xy curves. 1.
Click on the Page Layout button
2.
Make the second window active
34
and select a two- window layout
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
.
Altair Engineering
3.
From t he Select Application menu, select TextView
4.
Type the following text in the text editor window:
.
Maximum Force is {max(p3w1c1.Y)} Newton Maximum Displacement is {max(p3w1c2.Y)} meter
5.
From the toolbar, click the Edit Text button,
.
The Templex statements are evaluated and displayed. The text editor window is now in non-edit mode.
6.
Clic k t he Edit Text button again to go back to edit mode.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 35 Proprietary Information of Altair Engineering
HG-1021: Modifying Plots with the Plot Browser In this tutorial you will learn how to use the Plot Browser to perform the following tasks: Modify the following plot attributes o
Header font size
o
Legend position and font size
o
Axis fonts
Modify the following curve attributes o
Curve name and prefix
o
Line style
o
Color
Add notes attached to curves
36
o
Modify notes in the Notes panel
o
Apply these changes to all notes using the Plot Browser
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Tools The HyperGraph 2D Plot Browser resides on a tab in the Tab Area sidebar and allows you to view the HyperGraph 2D plot structure.
The Plot Browser can be turned on or off using the View > Browsers > HyperGraph 2D > Plot menu options. A check mark indicat es that t he HyperGraph 2D Plot Browser is ac tivat ed for display in the Tab Area. You can use the Plot Browser tools to search, display and edit entities and their properties within the current session.
Exercise: Modify the Plot and Curve Attributes Step 1: Open Session File demo_browser.mvw . 1.
From t he File menu click Open > Session.
2.
Select the file /tutorials/mv_hv_hg/plotting/ demo_browser.mvw and click Open.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 37 Proprietary Information of Altair Engineering
Step 2: Modify Modify the header he ader font size size.. 1.
From From the Plot Plot Br Browser owser tab, cli click the the Headers/Footers icon, browser.
, from the top of the
T hese icons allow allow you to fil f ilte te r the data t hat is displayed displayed in the Plot browser. For example, example, by clicking the Headers/Footers icon, Headers/Footers icon, only the header and footer information for each curve in your session is displayed in the browser. 2.
Expa Expand nd the fol folder ders for for page page 1 (p1: Angular Acceleration), Acceleration), window 1 (w1:XY ( w1:XY Plot) Plot) and Header by Header by clicking the plus button next to each folder.
3.
Right-cli t-click on Header and Header and select Select All .
38
HyperGraph Hyp erGraph 2D 13.0 Tutorials Tutorials Proprietary Information of Altair Engineering
Altair Engineering
T his his action ac tion select s all t he headers headers for each curve c urve listed listed in the plot browser. By doing t his, his, you can modify a header attribute only once, but it will be applied to all headers.
4.
F rom t he he Properties Table at Table at the bottom of the Plot Browser, select the font icon next to Primary Primary F ont Settings. Settings .
The Font Selector dialog Selector dialog is displayed.
Altair Engineering
HyperGr HyperGraph aph 2D 2D 13.0 13.0 Tutori utorials als 39 Proprietary Information of Altair Engineering
5.
Change t he he Font Size t Size t o 20 . The font size change is applied to all headers.
Step 3: Modify the legend font f ont size size and change the legend position. position. 1.
From From the Plot Plot Br Browser owser tab, cli click the the Legends icon,
, from the top of t he browser.
T hese icons allow allow you to fil f ilte te r the data t hat is displayed displayed in the Plot Browser. Browser. For example, example, by clicking the Legends icon, Legends icon, only the legend information for each curve in your session is displayed displayed in the browser. 2.
Expa Expand nd the fol folder ders for for page page 1 (p1: Angular Acceleration), Acceleration), window 1 (w1:XY ( w1:XY Plot) Plot) and Legends by Legends by clicking the plus button next to each folder.
3.
Right-cli t-click on Legends and Legends and select Select All .
40
HyperGraph Hyp erGraph 2D 13.0 Tutorials Tutorials Proprietary Information of Altair Engineering
Altair Engineering
This action select s all legends for each curve listed in the plot browser. By doing this, you can modify a legend attribute only once, but it will be applied to all curve legends.
4.
From t he Properties Table at the bottom of the Plot Browser, select the font icon next to Font Settings.
The Font Selector dialog is displayed. 5.
Change t he Font Size t o 12 . The font size change is applied to all legends.
6.
Next, we will change the legend place ment in the graphic s window.
7.
From t he Legend Placement drop-down menu, select Inside-Right-Bottom corner . The legend is moved to that position.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 41 Proprietary Information of Altair Engineering
Step 4: Modify the axis font size. 1.
From the Plot Browser tab, click the Axes icon,
, from the top of the browser.
These icons allow you to filte r the data t hat is displayed in the Plot Browser. For example, by clicking the Axes icon, only the axes information for each curve in your session is displayed in the browser. 2.
Expand the folders for page 1 (p1: Angular Acceleration), window 1 (w1:XY Plot) and HorizontalAxis by clicking the plus button next to each folder.
3.
From t he HorizontalAxis folder, right-click on Primary and select Select All .
This ac tion select s all horizontal axes for each c urve listed in the plot browser. By doing this, you can modify a horizontal axis attribute only once, but it will be applied to all horizontal axes. IMAGE
4.
From t he Properties Table at the bottom of the Plot Browser, select the font icon next to Font Settings. The Font Selector dialog is displayed.
5.
Change t he Font Size t o 12 . The font size change is applied to all horizontal axes.
6.
Repeat steps 1-5 for the VerticalAxes - Primary. The font size change is applied to all vertical axes.
Step 5: Modify the curve name. 1.
From the filter icons at the top of the Plot Browser, select the Curves icon,
2.
Expand the folders for page 1 (p1: Angular Acceleration), window 1 (w1:XY Plot) and Curve by clicking the plus button next to each folder.
42
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
.
Altair Engineering
3.
Right-click on the curve name c1:50th% Hybrid 3 - LOWER TORSO -Res ang and selec t Select All. All curve names in the Plot Browser are selected. The curve names contain the request and component information.
Next, remove the Y Request from the curve name. 4.
From t he Properties Table, click the Label drop-down menu and deselect the Y Request option. The curve names shown in the graphics area now only contain the Y Component name.
5.
Ac tivate Show Label Prefix .
6.
In the Label Prefix field, enter Test 17. The prefix Test 17 is added to the curve name label for all plots.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 43 Proprietary Information of Altair Engineering
Step 6: Modify the curve line style and color. In this step, you will change the curve line style for all curves that contain the components XYZ. 1.
Keep t he Curves icon selected at the top of the Plot Browser.
2.
Clic k t he Add Filter icon,
3.
From t he Filter Name drop-down menu, select Display Name.
4.
In the Value column, enter Res .
44
, to add a filter to the Filter Area.
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
HyperGraph searches for all the curve names that contain a resultant and display only those in the Plot Browser.
5.
Right-c lick on the first c urve listed in the Plot Browser and select Select All .
6.
Delete the filter you just added by clicking the Delete Filter icon,
Altair Engineering
.
HyperGraph 2D 13.0 Tutorials 45 Proprietary Information of Altair Engineering
The Plot Browser displays all the other curve names that contain something other than a resultant.
46
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
7.
Clic k t he Select Reverse icon, , to deselect the curves with resultant in the name and SELECT the curves with component in the name.
8.
From t he Properties Table, select the Line Style drop-down menu and select the dashed line style.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 47 Proprietary Information of Altair Engineering
The line style is changed to a dashed line style for all curves with component in the curve name. The curve name that contains the resultant remains a solid line.
9.
To c hange the line color of only the resultant c urve, click the Select Rev erse icon again, to deselect the c omponent c urves f rom the P lot Browser and select the resultant curve.
,
10. From the Properties Table, select the Line C olor color square and select the color black from the color palette.
48
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Only the resultant curve changes to black.
Step 7: Add and modify notes. 1.
Keep t he Curves icon selected at the top of the Plot Browser.
2.
Clic k t he Add Filter icon,
3.
From t he Filter Name drop-down menu, select Display Name.
5.
In the Value column, enter Res .
, to add a filter to the Filter Area.
The Plot Browser displays only the curve names with resultant in the name. 5.
Right- click on the first c urve name listed in the Plot Browser and select Select All to select all the resultant curves in the Plot Browser.
6.
Again, right- click on the first curve listed in the Plot Browser and select Single Curve Math > Max Note.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 49 Proprietary Information of Altair Engineering
This adds a note to the maximum value of each curve in the session.
Next, you will use the Notes panel to modify the note. 7.
From the toolbar, click the Notes icon,
.
8.
In the Text tab, change Max:{Y} to this: Max of {label} = {Y} and click Apply . The note now displays the label information.
9.
You c an further edit t he note display by added quotes around {label}, like this: Max of "{label}" = {Y}. Click Apply .
10. Edit t he note one more time by adding the time to it, like this:
50
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
The "ms" displays the time in milliseconds.
Next, you will apply the note text to all the curves in the session using the Plot Browser. 11. From the Notes panel, highlight the note text and press CTRL+C to copy the text. 12. Click the Notes icon on the Plot Browser. 13. Right-c lick on Note 1 and select Select All to select all notes in the session. 14. From the Properties Table, click in the Text field. 15. Notice the rectangular button that appears:
. Click on it to display the Edit String dialog.
16. Press CTRL+V to insert t he text you copied from the Notes panel and click OK . All max notes now have the same text string applied to them.
17. Click the Font Settings font icon and change the note font size to 12. All notes in the session are displayed with the same note attributes.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 51 Proprietary Information of Altair Engineering
HG-1030: Referencing and Filtering Curves In this tutorial you will learn how to reference and filter curves.
Tools The Define C urves panel can be accessed in one of the following ways: Click on the Define Curves icon Or From the menu bar select Curves > Define Curves . This panel allows you to edit existing curves and create new ones. The Define C urves panel also provides access to the program's curve calculator.
Referencing Curve Vectors in HyperGraph X and y vec tor expressions can reference any c urve vec tor in the session. A c urve vec tor reference defines the x or y vector (values) by page, window, and curve number. An example of a curve vec tor reference is p2w3c4.x, where: p2
is page 2
w3
is window 3
c4
is c urve 4
x
is the vector
52
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
There are two common methods to specify curve vector references: Pick a curve in a plot window
For the x = input field.
SHIFT and pick the curve to get the curve x vector reference SHIFT + CTRL and pick the curve to get the curve y vector reference
for y = input field.
SHIFT and pick the curve to get the curve y vector reference SHIFT + CTRL and pick the curve to get the curve x vector reference
Select a curve vector reference from the Curves… dialog, which is accessed from the Define Curves panel.
Exercise: Filtering a curve Step 1: Open Session File saefilter.mvw 1.
From t he File menu, click Open > Session.
2.
Select the file /tutorials/mv_hv_hg/plotting/saefilter.mvw and click Open.
Step 2: Filter a curve using the SAE J211/1 filter. 1.
Click on the Define Curves panel butt on
.
2.
Click Add and add a new curve.
3.
Change the name of the new curve from Curve 1 t o SAE J211/1 FILTER in the text box over the c urve list.
4.
Check the radio button for Math under Source:.
5.
Verify that the x vector is active.
6.
Hold the SHIFT key and click on the curve in the plot window. The x = curve reference is p1w1c1.x.
7.
Clic k t he y = field, and click Filter… from the panel menu to display the Filter dialog.
8.
Select the filter class SAE J211/1 from the Filter Class drop-down menu.
9.
Select Filter Class: 60, Padding: Mirror padding, and Direction: Fwd-Back .
10. Click OK to complete the selection and close the Filter dialog.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 53 Proprietary Information of Altair Engineering
11. Hold down the SHIFT + CTRL keys, t hen select the existing curve. 12. The x vector curve reference is entered in the saefilt95 function. 13. Hold down the SHIFT key and select t he curve again. Note: t he curve's y vec tor is referenced in the saefilt95 function. The y = field should read: saefilt95(p1w1c1.x,p1w1c1.y,60,1,3). 14. Click Apply to create the filtered curve.
54
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
HG-1040: AVD Diagram Using Unit Scaling and Plot Browser In this tutorial you will learn how To c reate an Acceleration Velocity Displac ement plot in one window To use the unit scaling feat ure for a plot. To use the Plot Browser to change the appearance of a plot, such as modifying the axes names, unit type and curve line color.
Tools The Build Plots panel can be ac cessed one of t he following ways: Click the Build Plots icon, OR From the menu bar select Curves > Build Plots. This panel allows you to construct multiple curves and plots from a single data file. Curves can be overlaid in a single window or each curve can be assigned to a new window.
The Plot Browser resides on a tab in the Tab Area sidebar and allows you to view the HyperGraph 2D plot structure. The Plot Browser tools allow you to search, display and edit ent ities and their properties within the c urrent session. The plot structure is viewed as a flat, listed tree structure within the browser. However, if the plot has a hierarchy, t hen the Plot Browser acc ommodates this hierarchical structure. From the Plot Browser, you can select entities one at a time or several simultaneously using common selection tec hniques. You can also use the browser's context-sensitive menus to selec t entities. Using the Plot Browser, you can perform many of t he operations available in the HyperGraph 2D panels, thus allowing you to modify your plot and curve properties in one location.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 55 Proprietary Information of Altair Engineering
Step 1: Clear any units association and enable unit scaling. 1.
From t he Tools menu, select Reset Units Association. The Reset Units Ass ociation dialog is displayed.
2.
If activated, click Reset Units to clear any unit assoc iations. If Reset Units is grayed out, you don't need to do anything.
3.
Click Close to close the dialog.
4.
From the toolbar, click the Options icon,
.
The Options panel is displayed.
5.
56
From t he Options dialog, make sure Enable Unit Scaling and Show Units Dialog are activated.
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 2: Open the nodout file. 1.
From File menu, select New > Session to clear all contents in the HyperGraph session.
2.
Verify XY Plot is selected from the plot type menu,
3.
Clic k t he Build Plots icon,
4.
Clic k t he Open File icon, , and open the file /demos/ mv_hv_hg/plotting/dyna/nodout.
.
.
Step 3: Plot the curves and set the curve units. 1.
Return to the Build Plots panel,
.
2.
For the X Type: select Time.
3.
From t he Y Type: column, select Node Data. The data available in the file is listed under the Y Request column.
4.
From t he Y Request: c olumn, press and hold the CTRL key and select Nodal Point 2500001 and Nodal Point 2500002.
5.
From t he Y Component: column, select X Displacement, X Velocity and X Acceleration
6.
From t he Layout drop-down menu, select Use Current Plot .
7.
Click Apply to create the curves on page 1. The Units Profile dialog is displayed.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 57 Proprietary Information of Altair Engineering
8.
From t he Units Profile dialog, select the C radio button and click OK . This sets the Length, Time and Mass units for the file to millimeter , milliseconds , and kilograms, respect ively.
9.
Click OK to c lose the Select Units Profile dialog. The curves are plotted and the units for the vertical and horizontal axis are changed to millimeters and milliseconds, respectively.
10. Click Apply . The displace ment, velocity and acc eleration are plotted. Notice that two additional axes have been added to t he right of the window to ac c ommodate t he velocity and ac celeration data. (use your plot with your default settings.
58
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 4: Modify the plot's appearance and rename an axis. In this step, you will use the Plot Browser to change the appearance of the plot. 1.
From t he Plot Browser, click the Axes icon,
2.
Expand the folders for page 1 (p1: Node Data), window 1 (w1:XY Plot) and VerticalAxis by clicking the plus button next to each folder.
3.
The following axes are listed in the VerticalAxis folder: Primary, Y1 and Y2.
4.
Selec t t he Primary axis.
Altair Engineering
.
HyperGraph 2D 13.0 Tutorials 59 Proprietary Information of Altair Engineering
5.
From t he Properties Table, located in the bottom portion of the Plot Browser, click the color palette next to Color and select black .
6.
From t he VerticalAxis folder, select the Y1 axis
7.
From t he Properties Table, click the color palette next to Color and select red .
8.
Change the color for the Y2 axis to blue.
Next, you will rename the axes using the Plot Browser. 9.
From t he Plot Browser and VerticalAxis folder, select the Primary axis.
10. From the Properties Table, click the Name field and enter the name Displacement. 11. Repeat steps 9 and 10 for the Y1 and Y2 axes. Rename them Velocity and Acceleration, respectively. The new vertical axes names for Primary, Y1 and Y2 are shown below:
60
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 5: Modify the curve line color. 1.
From t he Plot Browser, click the Curve filter icon,
.
2.
Expand the folders for page 1 (p1: Node Data), window 1 (w1:XY Plot) and Curve by clicking the plus butt on next to eac h folder.
3.
Selec t the t wo Displacement curves from the list for nodal points 2500001 and 2500002
4.
From t he Properties Table, next to Line C olor, click the color palette and select black . This changes the color of those two curves to black.
5.
From the same expanded Curves folder, select the X Velocity c urves.
6.
From t he Properties Table, change their line color to red .
7.
Selec t t he X Acceleration curves and change their line color to blue.
8.
From the Plot window, right-c lic k on the horizontal axis to display the following context menu:
9.
Select Conve rt Units and change the unit type from milliseconds to seconds (s).
10. From the Plot window, right- click in the vertical axis and select Conve rt Units. Change the distance from millimeters to meters.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 61 Proprietary Information of Altair Engineering
11. Repeat step 8, but f or the right-side Velocity axis. Change the speed from millimet ers/ milliseconds to mph . 12. You c an also change the unit t ype for a curve by right- c licking on the curve and selecting Enable/Change C urve Unit . The Enable/Change C urve Unit dialog is displayed.
13. From the YVector, select the right-most drop-down menu and change the unit from millimeter/ millisecond to kph . 14. Click OK . The final plot window is shown below:
62
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Advanced Curve Manipulation HG-2000: Evaluating Curve Data HG-2010: Creating a Plot Macro
Altair Engineering
HyperGraph 2D 13.0 Tutorials 63 Proprietary Information of Altair Engineering
HG-2000: Evaluating Curve Data In this tutorial you will learn how to: Reference curves Create curves using math expressions Create curves by using pre-defined functions Use the freeze option
Tools The Define C urves panel can be accessed in one of the following ways: Click the Define Curves icon Or From the menu bar select Curves > Define Curves . This panel allows you to edit existing curves and create new ones. The Define C urves panel also provides access to the program's curve calculator.
Referencing Curve Vectors in HyperGraph X and Y vector expressions can reference any curve vector in the session. A curve vector reference defines the x or y vector (values) by page, window, and curve number. An example of a curve vec tor reference is p2w3c4.x, where: p2
is page 2
w3
is window 3
c4
is c urve 4
x
is the vector
64
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
There are two common methods to specify curve vector references: Pick a curve in a plot window
For the x = input field
SHIFT and pick the curve to get the curve x vector reference
SHIFT + CTRL and pick the curve to get the curve y vector reference for y = input field
SHIFT and pick the curve to get the curve y vector reference
SHIFT + CTRL and pick the curve to get the curve x vector reference Select a curve vector reference from the Curves… dialog, which is accessed from the Define Curves panel.
Freeze Option The Freeze option is available when a vector’s source is Math. This option allows you to break the association of the dependent curve(s) from their parent curve, which allows modifications to the parent curve without updating the dependent curve(s).
Curve Dependencies browser To access the browser, right-click a curve and select View Dependencies. The selected curve displays from the context menu.
Exercise: Creating XY Curves by Referencing Existing Curve Vectors Step 1: Open Session File democ2.mvw
.
1.
From t he File menu, click Open > Session.
2.
Select the file /tutorials/mv_hv_hg/plotting/democ2.mvw and click Open.
Step 2: Practice referencing curve vectors by selecting curves from the plot window. 1.
Make window 3 (lower left window) on page 2 active by clicking on it.
2.
Expand window 3 by clicking the Expand Window button,
Altair Engineering
.
HyperGraph 2D 13.0 Tutorials 65 Proprietary Information of Altair Engineering
3.
Go t o t he Define Curves panel,
.
The Curve list displays the names of the four curves in window 3. 4.
Click Add under the curve list.
5.
Verif y t he x = radio button is selected.
6.
Select Math under Source of the curve to be created. This defines the x vector of the new curve to be a math function. In this case, it will simply be set equal to the x vector of an existing curve.
7.
Hold the SHIFT key and pick the dark red curve (Req/5 Curve 5). The x = curve reference is p2w3c2.x. This defines the page 2, window 3, curve 2, x vector.
8.
Clear the entry in the x = field.
9.
Wit h t he x = field still active, hold the SHIFT + CTRL keys and pick the same curve . The x = curve reference is p2w3c2.y. This defines the page 2, window 3, curve 2, y vector.
10. From the curve list, select Curve1 and click Cut . 11. Return to t he page’s original layout by c licking
66
.
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 3: Create a new curve with a math expression for its y vector. 1.
Click Add to create a new curve named Curve2.
2.
Verif y t he x = radio butt on is selected.
3.
Select Math for the Source:.
4.
Click Curves… to open its dialog. Select p2: Plot 2. Select w3: Plot . Select c2: Req/5 Curve 5 .
5.
Click Select to complete the selection The result is the same as when the curve was picked from the graphics area; the x curve reference is p2w3c2.x.
6.
Clic k t he y = radio button.
7.
Hold the SHIFT key and pick any curve in window 3. Notice in the y = field is the reference for the y vector of the picked curve.
8.
Append the character + to the string in the y = field.
9.
Hold the SHIFT key and select any other curve in window 3. Notice the y = field now has two y vectors separated by the + sign.
10. Click Apply to create the new curve. The new curve appears in window 3 and is the sum of the two y vectors.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 67 Proprietary Information of Altair Engineering
HG-2010: Creating a Plot Macro In this tutorial you will learn how to: Create a plot macro Append and use the Vehicle Safety Tools
Tools The Plot Macro panel can be accessed in one of the following ways: Click the Plot Macros icon Or From the menu bar select Curves > Plot Macros This panel allows you to c reate macros t hat produce c urves and notes for plots. Plot mac ros can be used to capture and replay frequently used curve operations such as adding two curves together and filtering curves.
Defining a plot macro consists of two steps: 1.
Define the parameters (variables of type c urve or scalar) needed to c reate t he curve.
2.
Define the curve using the parameters.
Plot macros created from the Plot Macros panel are saved to the session file.
68
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
To load Vehicle Safety Tools: 1.
From the menu bar select File > Load > Preference File.
2.
Selec t t he Vehicle Safety Tools preference file and then click Load .
The vehicle safety tools (VST) are a collection of over 200 macros, Templex functions, and external functions used by vehicle safety engineers. On appending the VST file, six new menus that contain the macros and functions are displayed on the menu bar: Math, Filter , Units, Injury , Misc , and Transforms.
Selecting a tool (macro) from one of these menus takes you to the Plot Macros panel.
Context Sensitive Menu When the VST are loaded, you can access its macros by right-clicking on a curve and selecting a macro from the pop-up menu. The pop-up menu can be customized.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 69 Proprietary Information of Altair Engineering
Exercise: Create a Plot Macro for the SAE J211 Filter Function Step 1: Define the macro’s first parameter. 1.
Click on the Plot Macros panel icon
.
2.
Click Add to create a new macro and open the Edit Plot Macro dialog.
3.
On the Parameters tab, click Add t o c reate t he first parameter. A parameter named Paramenter1 is displayed in the Parameters list and is highlighted.
4.
In the Parameter: field, replace the name Parameter1 with raw data curve and then press ENTER.
5.
In the Varname: field, replace the name p_1 with curve and press ENTER. The variable name references the parameter in the macro's definition.
6.
70
Set the parameter’s Type: t o Curve.
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 2: Define the macro’s second parameter. 1.
Click Add to create the second parameter.
2.
In the Parameter: field, replace the name Parameter2 with SAE J211/1 filter class.
3.
In the Varname: field, replace the name p_2 with class.
4.
Set the parameter’s Type: t o Scalar .
Step 3: Define the macro’s third parameter. 1. Add a third parameter. 2.
Change the parameter’s name to padding.
3.
Change the parameter’s variable name to padding.
4.
Verify Type: is set to Scalar .
Step 4: Define the macro’s fourth parameter. 1. Add a fourth parameter. 2.
Change the parameter’s name to direction.
3.
Change the variable’s name to direction.
4.
Verify Type: is set to Scalar .
Step 5: Define the macro’s curve label. The curve label should be curve.label+" SAE J211/1 "+class. 1.
From t he Curve tab, click the Label field.
2.
From t he Parameters list, double-click raw data curve.
curve.label is displayed in the Label field. 3.
In the Label field, add +" SAE J211/1 "+.
curve.label+" SAE J211/1 "+ is displayed in the Label field. The + symbol connec ts the string of variables and text. 4.
From t he Parameters list, double-click SAE J211/1 filter class.
curve.label+" SAE J211/1 "+class is displayed in the Label field.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 71 Proprietary Information of Altair Engineering
Step 6: Define the curve’s x vector. The curve’s x vector should be curve.x. 1.
Clic k t he X: field.
2.
From t he Parameters list, double-click raw data curve.
curve.x is displayed in the X: field.
Step 7: Define the curve’s y vector. The curve’s y vector should be saefilt95(curve.x,curve.y,class,padding,direction). 1.
Click in the Y: field.
2.
From t he Functions: list, double-click saefilt95.
saefilt95(,,,,) is displayed in the Y field. 3.
From t he Parameters list, double-click raw data curve.
saefilt95(curve.y,,,,) is displayed in the Y field. 4.
In the Y field, change curve.y t o curve.x.
5.
Position the cursor after the first comma.
6.
From t he Parameters list, double-click raw data curve.
saefilt95(curve.x,curve.y,,,) is displayed in the Y field. 7.
Position the cursor after the second comma.
8.
From t he Parameters list, double-click SAE J211/1 filter class.
saefilt95(curve.x,curve.y,class,,) is displayed in the Y field. 9.
Position the cursor after the third comma.
10. From the Parameters list, double-click padding.
saefilt95(curve.x,curve.y,class,padding,) is displayed in the Y field. 11. Position the cursor aft er the fourth c omma. 12. From the Parameters list, double-click direction.
saefilt95(curve.x,curve.y,class,padding,direction) is displayed in the Y field. 13. Close the Edit Plot Macro dialog. 14. In the Macro: field, change the name macro1 t o SAE J211/1 filter and press ENTER.
72
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
15. Save the session file as SAEJ211_macro.mvw.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 73 Proprietary Information of Altair Engineering
Step 8: Apply the SAE J211/1 filter macro. 1.
From the menu bar select File > Ope n > Sess ion and select the file /tutorials/mv_hv_hg/plotting/saefilter.mvw. Even though a new session file is opened, the SAE J211/1 filter macro remains in the session until HyperGraph is closed.
2.
Ent er t he Plot Macros panel.
3.
From t he Macro list, select SAE J211/1 filter.
4.
In the Parameters section of the Plot Macros panel, click the raw data curve field.
5.
Hold the SHIFT key and select the curve in the plot window.
p1w1c1 is displayed in the raw data curve field. 6.
Enter 60 in the SAE J211/1 filter class field.
7.
Enter 1 in the padding field.
8.
Enter 3 in the direction field.
9.
Verify the option Layout: Place new curves in original plots is active.
10. Deactivate the option Hide input curves. 11. Click Apply to create the filtered curve. This plot macro can be reused for any number of input curves to quickly repeat the curve filtering process.
74
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
More Plotting HG-3000: Working with Bar Charts HG-3010: Working with Complex Plots HG-3020: Working with Polar Plots
Altair Engineering
HyperGraph 2D 13.0 Tutorials 75 Proprietary Information of Altair Engineering
HG-3000: Working with Bar Charts In this tutorial, you will learn how to create bar charts by entering values, importing a data file, or spec ifying a mathemat ical expression.
Tools When the plot type is set to Bar Charts ( ), the Define C urves panel allows you to add and edit bar charts in the act ive plot window. It c an be acc essed one of the following ways. Click on the Define Curves panel butt on
on the toolbar
Or From the menu bar select Curves > Define Curves
Bar charts are comprised of data and categories. Data can be entered as values, read from an external file, or defined as a mathematical expression.
Exercise: Create Bar Charts Step 1: Create a bar chart by entering values in the Define Curves panel. Enter the values 563.35, 567.22, and 423.51. 1.
From the menu bar select File > New > Session to clear the contents of the current session.
2.
From the plot type menu, select Bar Chart,
3.
Ent er t he Define C urves panel,
4.
Click Add to create a new bar chart named Curve 1.
.
.
Curve 1 is highlighted in the series list to indicate it is the active series. 5.
In the Series field above the bar chart list, rename Curve 1 t o Nodal Point 1 and press ENTER.
6.
Under Source, select Values.
76
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
7.
8.
In the panel’s center, under the column Nodal Point 1, type these three values: Index 1:
563.35
Index 2:
567.22
Index 3:
423.51
Click Apply to create the bar chart.
Step 2: Create a bar chart by importing values from the data file nodal_values.dat . 1. Add a second bar chart to the current plot window. 2.
Rename Curve 2 t o Nodal Point 2.
3.
Under Source, select File.
4.
Click the file browser next to File: and open the file /tutorial/ mv_hv_hg/plotting/nodal_values.dat.
5.
Leave Type: set to Unknown.
6.
Leave Request: set to Block1.
7.
Leave Component: set to Column1.
8.
Click Apply to create the bar chart.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 77 Proprietary Information of Altair Engineering
Step 3: Create a bar chart using a math expression. 1.
From menu bar select File > Import > Session and open the session file bar_chart.mvw. A second page containing an XY Plot window with three XY data curves is added to the session and is currently displayed.
2.
Go back to the session’s page 1, which contains the bar chart.
3. Add a third bar chart to the current plot window. 4.
Rename Curve 3 t o Nodal Point 3.
5.
Under Source, select Math.
6.
In the Expression: field, type the following math expression: {max(p2w1c1.y),max(p2w1c2.y),max(p2w1c3.y)}
7.
Click Apply to create the bar chart.
78
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 4: Modify category labels. 1.
In the Categories c olumn, c lick One, rename it x disp, and click Apply to update the bar chart’s label.
2.
Rename category Two to y disp.
3.
Rename category Three to z disp.
4.
Click Apply to update the bar chart’s labels.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 79 Proprietary Information of Altair Engineering
HG-3010: Working with Complex Plots In this tutorial you will learn how to: Create complex plots from a data file Add and edit complex data curves by using mathematical functions
Tools The Build Plots panel can be accessed in one of the following ways: Click the Build Plots icon
from the toolbar
Or From the menu bar select Curves > Build Plots The Build Plots panel constructs multiple curves and plots from a single data file. Curves can be overlaid in a single window or eac h curve c an be assigned to a new window. Individual curves are edited using the Define Curves panel.
The Define C urves panel can be accessed in one of the following ways: Click the Define Curves panel butt on
from the toolbar
Or From the menu bar select Curves > Define Curves 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.
80
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Exercise: Plot Complex Data and Apply Math Functions Step 1: Build a complex data curve from a data file. 1.
From the menu bar select File > New > Session to clear the contents of the session.
2.
From the plot type menu, select Complex Plot
3.
Ent er t he Build Plots panel
4.
Use the file browser button to open the file /tutorials/ mv_hv_hg/plotting/control_arm_sol111.pch.
5.
Leave the X type: set to Frequency [hz].
6.
In the Y type: column, select Subcase 1 Displacements.
7.
In the Y Request: column, select Point id 2086.
8.
In the Y C omponent: column, select X-Rot.
9.
Click Apply to create the complex curves.
Altair Engineering
.
.
HyperGraph 2D 13.0 Tutorials 81 Proprietary Information of Altair Engineering
Step 2: Apply the Inverse Fast Fourier Transform (ifft) math function to the complex data curve. 1.
Change the current window layout of page 1 to a two-window layout
2.
Activate the window on the right side.
.
New plot windows are set to the xy plot type by default. 3.
Set the plot type for the window on the right side to XY Plot .
4.
Ent er t he Define C urves panel
.
5. Add a new XY plot curve named Curve 1. 6.
Rename Curve 1 t o ifft_curve.
7.
Under Source, select Math.
8.
In the x: field, enter p1w1c1.x.
9.
In the y: field, enter ifft(p1w1c1.ym,p1w1c1.yp).
10. Click Apply to c reate t he XY data c urve.
82
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 3: Create a complex data curve of frequency versus displacement for Subcase two, node 2086, x-rotation. 1.
Activate window 1 (the left window).
2.
Ent er t he Build Plots panel
3.
In the Y type: column, select Subcase 2 Displacements.
4.
In the Y Request: column, select Point id 2086.
5.
In the Y Component: column, select X-Rot.
6.
Click Apply to create the complex curves .
.
Step 4: Subtract the Subcase two curve from the Subcase one curve. 1.
Change the current window layout for page 1 to a three-window layout,
2.
Make the new, blank plot window active.
3.
From the plot type menu, select Complex Plot .
4.
Ent er t he Define Curves panel.
5.
Click Add P/M t o c reate a new c omplex curve.
Altair Engineering
.
HyperGraph 2D 13.0 Tutorials 83 Proprietary Information of Altair Engineering
6.
Rename Curve 1 t o sub_disp.
7.
Under Source, select Math.
8.
In the x: field, enter p1w1c1.x.
9.
In the yp: field, enter p1w1c2.yp - p1w1c1.yp.
10. In the ym: field, enter p1w1c2.ym - p1w1c1.ym. 11. Click Apply to create the complex curve.
84
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
HG-3020: Working with Polar Plots In this tutorial, you will learn how to: Create polar plots from a data file. Add polar plots by using mathematical functions.
Tools The Build Plots panel can be accessed in one of the following ways: Click the Build Plots button,
, from the toolbar
Or
From the menu bar select Curves > Build Plots. The Build Plots panel constructs multiple curves and plots from a single data file. Curves can be overlaid in a single window or eac h curve c an be assigned to a new window. Individual curves are edited using the Define Curves panel.
The Define C urves panel can be accessed in one of the following ways: Click the Define Curves butt on,
, from the toolbar
Or
From the menu bar select Curves > Define Curves 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.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 85 Proprietary Information of Altair Engineering
Exercise: Plot Polar Data and Add Plots Step 1: Build a polar data plot from a data file. 1.
From the menu bar select File > New > Session to clear the contents of the session.
2.
From the plot type menu, select Polar Plot,
3.
Ent er t he Build Plots panel,
4.
Use the file browser button to open the file modal_participation.f06 located in tutorials \mv_hv_hg\plotting.
5.
Leave the Subcase: field set to Subcase 11.
6.
Leave the Data Type: field set to Frequency .
7.
From t he Type: column, select Modal Participation.
8.
From t he Request: column, select FLUID Node 5417 .
9.
From t he Component: column, select Mode 1, Mode 3 and Mode 5 .
.
.
10. Click Apply to create the polar plots. The vectors are plotted at a frequency of 100.0Hz.
86
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
11. Access the Frequency dialog by clicking the listed frequency value in the bottom left region of the plot area. 12. Select the 128.0Hz frequency and click OK . The vec tors are plott ed at 128Hz frequency.
Step 2: Add polar data. 1.
Use the Page Layout button, layout.
, to change the window layout of page 1 to a two- window
2.
Activate the window on the right side.
3.
Change the plot type for the new window to Polar Plot .
4.
Ent er t he Define Curves panel.
5.
Add a new polar plot curve named Curve 1 by select ing Add R/I .
6.
Rename Curve 1 t o Summation by typing the new name in the Curve: field and pressing the ENTER key.
7.
Under Source, select Math.
8.
In the Frequency= field, enter p1w1c1.f. A frequency field is specified to allow HyperGraph to compute the summation vector for every frequency. In this case, the summation vec tor can be animated or updated when a certain frequency is chosen.
9.
Selec t t he Real = radio button and t hen select Math as the Source.
10. In the Real = field, enter p1w1c1.yr + p1w1c2.yr + p1w1c3.yr. 11. In the Imaginary = field, enter p1w1c1.yi + p1w1c2.yi + p1w1c3.yi.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 87 Proprietary Information of Altair Engineering
12. Set the Type: field to Vector Plot . 13. Click Apply to create the polar plot. 14. Access the Frequency dialog by clicking the listed frequency value in the bottom left region of the right hand side of window 2. 15. Choose the 128.0Hz frequency and click OK . The summation vector is now plotted at 128Hz frequency.
88
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
16. Change the Type: field to Phase vs Mag. Notice how a Phase vs Magnitude curve for all frequencies is shown as a line connect ing the t ips of the vec tors at different frequencies.
17. Click the start animation button,
.
Notice how the summation of vectors is updated in the animation for each frequency value in the list.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 89 Proprietary Information of Altair Engineering
Templates HG-4000: Creating an Export Template
90
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
HG-4000: Creating an Export Template In this tutorial, you will learn about: Export template language How to register the template How t o export plot data t o a f ile
Tools Export Template: is a file that contains instructions for exporting curve data into files. The instructions contained in an Export Template file are in an uncompiled type of programming language called Export. An Export Template tells the program in which format the data should be written into the file. Templex and Export Template Language State ments The language of Export Templates follows a mixture of Templex commands plus some additional special statements. For the export of c urves only a few stat ements are needed: Templex Commands indexofmin(i)
Index of the minimum of a vector (not the minimum itself)
numpts(x)
Dimension of the vector X
table()
Export of vectors organized in columns
for – endloop
Loop
if – else – endif
Logics
Special Export Commands cr()
New line
curvex(i)
X vector of curve i
curvey(i)
Y vect or of curve i
curvelabel(i)
Export of the legend of curve i
list
Export of vectors in rows
margins(0,30)
Length of a line
numcurves()
Number of curves in a window
;
End of a command (except loops and logics)
Altair Engineering
HyperGraph 2D 13.0 Tutorials 91 Proprietary Information of Altair Engineering
Registering an export template: The format selection list in the Export Curves... panel contains, by default, ten formats. Via the preferences file, registered templates are added to this list. Registration is done using the preferences file or via the Tools menu. 1.
Go to \hw\prefinc.
2.
Open preference_plot.mvw and add the following command that registers an export template with a session. *BeginDefaults() *BeginPlotDefaults() *AddExportFormat(par1,/homes/.../_madymo_export.tpl,par2) *EndPlotDefaults() *EndDefaults()
Above is a small sample of a preference_plot.mvw file that registers a new template (madymo_export.tpl) with a session. This file allows the user to customize sessions by specifying defaults or defining external files that should be able to interact with the user’s session. Note: The c ontent of t he parameter par1 is the name that shows up in the selec tion list. The parameter par2 specifies the extension of the files that is used for exporting the data: export.par2.
92
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Exercise: Export Template Templat e Example for MADYMO Step 1: Create Cre ate a T emplate emplate that makes a file file format f ormat for a functi f unction on in in MADYMO 1.
Add the comm commands ands belo below w to a text file file named named madymo_export.tpl. The statement on the right is an explanation of the command.
{ Row_1="!vehicle acceleration";
Set variable for the comment in line1
nc = numcurves();
Set number of curves
lc = nc - 1
for (i = 0; i < nc; i++)
Loop for the number of curves
x = curvex(i);
Set the x-vector of curve i
y = curvey(i);
Set t he y-vect or of curve i
t = numpts(x);
Set the number of points
if (!numpts(x))
If curve is switched off don’t export
else Row_1; cr();
Output for Line 1, label
t, %5i; cr();
Output for Line 2, number of points
table(x, y, "%10.6f %11.6f", 0, t - 1); Output Line 3 to t-1 with the table command endif
if (i != lc)
After every exported curve set an empty line
cr();
endif
endloop }
Altair Engineering
HyperGr HyperGraph aph 2D 2D 13.0 13.0 Tutori utorials als 93 Proprietary Information of Altair Engineering
Step 2: Register the Export Template. 1.
F rom Tools menu, Tools menu, select Readers, Writers, and Functions… Functions… .
2.
Go t o Export Templates tab. Templates tab.
3.
Browse owse the templ template ate created for Madym Madymo. o.
4.
Give the the Templ Template ate a nam name. e.
5.
Clic k Register… and OK .
94
HyperGraph Hyp erGraph 2D 13.0 Tutorials Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 3: Export plot data: 1.
F rom t he he File menu, File menu, select Export > Curves. Curves.
2.
Enter Enter a file file name name for the destin destination ation file. file. -Or Select an existing file using the file browser.
3.
F or Format, Format, select the file you just registered.
4.
Speci Specify fy a ran rang ge of pag pages es..
5.
Clic k Apply Apply . Plot data from the specified pages are exported to the file.
Altair Engineering
HyperGr HyperGraph aph 2D 2D 13.0 13.0 Tutori utorials als 95 Proprietary Information of Altair Engineering
RESULT: The below data file is created after exporting curves in this Madymo format: !vehicle acceleration 151 0.000000
13.591910
1.000000
12.144580
2.000000
10.850770
3.000000
10.180930
4.000000
9.921851
5.000000
9.995111
6.000000
10.342690
7.000000
11.209030
... ... 147.000000
132.563400
148.000000
130.487300
149.000000
129.073800
150.000000
127.332800
96
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Customization HG-5010: Customizing the Environment
Altair Engineering
HyperGraph 2D 13.0 Tutorials 97 Proprietary Information of Altair Engineering
HG-5010: Customizing the Environment In this tutorial, you will learn how to customize the program using the preference file.
Tools The Preference File: A preference file is a script file that is read eac h time the program is started. It spec ifies default user settings such as the order in which colors are assigned, the default printer, default page layout, the auto save interval, and so on. A standard preferenc e file can be creat ed in the program installation direc tory which is exec uted every time a license is act ivated. An additional preference file can be created in your working directory that contains personal settings that either overwrite the standard preference file or are added to the existing settings in the standard preference file. The HyperWorks installation contains two preference files located under $ALTAIR_HOME/hw: All HyperWorks desktop products, except HyperStudy: preferences.mvw HyperStudy only: preferences_hst.mvw Seven include preference files are contained in the installat ion. These include preferenc e files must be included in the main preference file, as they cannot be used as independent preference files. They are locat ed under $ALTAIR_HOME/hw/prefinc. Organization of the Preference File The following describes the standard structure of the preferences file, containing five principal blocks. *BeginDefaults() *EndDefefaults() *BeginDefinitions() *EndDefinitions() *BeginStatsTemplates() *EndStatsTemplates() *BeginPlotMacros() *EndPlotMacros() *BeginTemplexFunctions() *EndTemplexFunctions()
The *BeginDefaults() block is unique to a preference file while the *BeginDefintions(), *BeginStatsTemplates(), *BeginPlotMacros(), and *BeginTemplexFunctions() blocks are the same as those found in script files.
98
HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
The f ollowing are general conc epts f or each of these sec tions: *Id statement The syntax for the *Id statement is: *Id("Release") where the release gives the program name and version. For example: *Id("HyperGraph v8.0") The *BeginDefaults - *EndDefaults block The *BeginDefaults() block is comprised of general defaults and seven subordinate statement blocks. The general defaults are declared first, and then as many sub-blocks as required. Each sub-block has the same structure as the main block. This means there is a *Begin statement, followed by the necessary statements, and closing the block with an *End statement. General defaults General defaults include the autosave interval, bubble help status, and default printer settings. The block is delimited by these statements: *BeginDefaults() *EndDefaults()
Model defaults Model defaults are used to customize the model tool bar and to add MDL defaults for submitting mechanical system models to a solver. The block is delimited by these statements: *BeginModelDefaults() *EndModelDefaults()
Graphic defaults Graphic preferences such as model orientation and the part attributes are specified in the graphics default block. The block is delimited by these statements: *BeginGraphicDefaults() *EndGraphicDefaults()
Plot defaults Plotting preferences for curves including colors, fonts, and note defaults are specified in the plotting defaults block. The block is delimited by these statements: *BeginPlotDefaults() *EndPlotDefaults()
Altair Engineering
HyperGraph 2D 13.0 Tutorials 99 Proprietary Information of Altair Engineering
TextEditor defaults TextEditor preferences including text and background color and font settings are specified in the text editor defaults block. The block is delimited by these statements: *BeginTextEditorDefaults() *EndTextEditorDefaults()
Page header defaults Page headers are specified in the page header block. The block is delimited by these statements: *BeginHeader() *EndHeader()
Page footer defaults Page footers are specified in the page footer block. The block is delimited by these statements: *BeginFooter() *EndFooter()
To help you avoid compile problems, when you begin each block, start with the *Begin and *End block statements, then enter the remaining statements between the block delimiters.
Exercise: Changing the default setting through the preference file. Step 1: Set the auto save default. 1.
Select TextView window mode.
2.
Open the file /tutorials/mv_hv_hg/preferences/ autosave_bubble_help.mvw by select ing File > Open > Document from the menu bar.
3.
Aft er t he *BeginDefaults() line, add the following preference statement *SetAutoSaveInterval(2)
This sets t he autosave interval to two minute s. If this stat ement does not appear in the preferences.mvw file, the program sets the autosave interval to 10 minutes. 4.
Save the new preference file to your home direct ory as new_autosave_bubble_help.mvw by selecting File > Save As > Document from the menu bar.
100 HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 2: Observe the updated AutoSave default. 1.
Start the program.
2.
Set the preference file by selecting File > Load > Preference File. This opens a window which lists all the registered preference files.
3.
Select Register and then browse for the file new_autosave_bubble_help.mvw.
4.
Select new_autosave_bubble_help.mvw from the list of Registered Preferences and then click Load to load the preferenc e file. Click the red X in the upper right corner to close the window
5.
Wait for approximately two minutes and then list the cont ents of your working directory. A new file autosave.mvw will be present and contain a back up of the current session.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 101 Proprietary Information of Altair Engineering
Step 3: Set the curve defaults. 1.
Select TextView window mode.
2.
Open the file /tutorials/mv_hv_hg/preferences/ curve_defaults.mvw by select ing File > Open > Document from the menu bar.
3.
Aft er t he *BeginPlotDefaults() line, add the *ResetCurveDefaults() statement to ignore all previous *SetCurveDefaults() statements.
4.
Aft er t he *ResetCurveDefaults() line, add the following preference statements to set the curve defaults: *SetCurveDefaults(1, 7, 0, 0, 0) *SetCurveDefaults(3, 16, 1, 0, 0) *SetCurveDefaults(5, 24, 2, 0, 0) *SetCurveDefaults(2, 32, 3, 0, 0) *SetCurveDefaults(4, 40, 0, 0, 0) *SetCurveDefaults(5, 48, 1, 0, 0)
A plotting preference block can contain several *SetCurveDefaults() stat ements. The program assigns curve attributes sequentially. 5.
Save the new preference file to your home directory as new_curve_defaults.mvw by selecting File > Save As > Document from the menu bar.
102 HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 4: To observe the updated curve default settings: 1.
Clic k t he Add Page icon
to add a new page to the current session.
2.
Select HyperGraph 2D from the Select Application menu.
3.
Change t he Page Window Layout to two windows per page ,
4.
Click Build Plots on the plotting toolbar.
5.
Open a plotting file:
.
Click the file browser. Select the file /tutorials/mv_hv_hg/plotting/ANGACC. Click Open. 6.
Select the data components and channels to plot: Select Angular Acceleration from the Y Type list. Select 50th% Hybrid3 – LOWER TORSO from the Y C omponent list. Select the All button from the Y Channel list.
7.
Click Apply .
8.
Set the file new_curve_defaults.mvw as t he preference file by selec ting File > Load > Preference File.
9.
Select Register and then browse for the file new_curve_defaults.mvw. This automatically loads new_curve_defaults.mvw file as the preference file.
10. Select n e w_ c u r v e _ d e f a u l t s . mv w from the list and click Load . Then click the red X in the upper right corner to close the window. 11. If prompted to “Update all plots current default colors”, select No. 12. Click on the second plot window on this page. 13. Click Build Plots from the plotting toolbar.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 103 Proprietary Information of Altair Engineering
14. Click Apply . The color and line styles follow the defaults defined in the new_curve_defaults.mvw file instead of the program system defaults .
Step 5: To set the default plot colors: 1.
Add a new page and select the TextView window mode.
2.
Open the document /tutorials/mv_hv_hg/preferences/ plot_colors.mvw from the File menu.
3.
Aft er t he *BeginPlotDefaults() line, add the following preference statements to set the default plot colors: *SetBackgroundColor(9) *SetGridlineColor(6) *SetZerolineColor(2) *SetFrameColor(7) *SetAxisColor(4) *SetHeaderColor(0) *SetFooterColor(3)
4.
Save the new preference file as new_plot_colors.mvw in your working direc tory. You cannot save files back to t he default directory.
104 HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 6: To observe the updated default plot colors: 1.
Click Add Page on the toolbar to add a new page to the current session.
2.
Select HyperGraph 2D from the Select Application menu.
3.
Create header and footer text.
4.
Register and Load the preference file new_plot_colors.mvw. If prompted to "Update all plots current default colors", click No.
5.
Add a new page, which will activate the new settings.
6.
Create header and footer text. Note: The colors of the various areas of the plot window reflect the defaults defined in the file new_plot_color.mvw rather than the program system defaults .
Step 7: To set the default fonts for the plot area: 1.
Add a new page and select the TextView window mode.
2.
Open the file /tutorials/mv_hv_hg/preferences/font_defaults.mvw from the file browser on the toolbar.
3.
Aft er t he *BeginPlotDefaults() line, add the following preference statements: *SetAxisLabelFont("Times New Roman", 1, 0, 8) *SetAxisTicFont("Times New Roman", 0, 1, 18)
The first placeholder sets the font name. The sec ond placeholder sets the font weight. 0 = normal (default), 1 = bold. The third placeholder sets the slant, or font style. 0 = normal (default), 1 = italic. The fourth placeholder sets the font size, 8, 10, 12, 14, 18, or 24 points. Note: If the suggested font is not available on your system, use the name of a font available on your system. 4.
Aft er t he *SetAxisTicFont() line, add the following preference statements to set the font defaults for the header and footer text: *SetLine1HeaderFont("Verdana",0,0,8) *SetLine2HeaderFont("Verdana",1,0,10) *SetLine3HeaderFont("Verdana",0,1,12) *SetLine1FooterFont("Tahoma",0,0,8) *SetLine2FooterFont("Tahoma",0,1,10) *SetLine3FooterFont("Tahoma",1,0,12)
Note: If the suggested font is not available on your system, use the name of a font available on your system. Altair Engineering
HyperGraph 2D 13.0 Tutorials 105 Proprietary Information of Altair Engineering
6.
Save the new preference file as new_font_defaults.mvw.
Step 8: To observe the updated default plot fonts: 1.
Click Add Page on the toolbar to add a new page to the current session.
2.
Select HyperGraph 2D from the Select Application menu.
3.
Create a three line header and footer on the plot.
4.
Register and Load t he file new_font_defaults.mvw. If prompted to update to the current defaults, select No.
5.
Change Page Layout t o t wo windows per page.
6.
Click on the second plot window on the current page.
7.
Create a three line header and footer on the plot . The fonts in the plot window reflect the defaults defined in the new_font_defaults.mvw file, including each line of the header and footer area, rather than the program system defaults.
106 HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 9: Set the note defaults. 1.
Add a new page and select the TextView window mode.
2.
Select the file /tutorials/mv_hv_hg/preferences/ notes_legends.mvw from the file browser on toolbar.
3.
Aft er t he *BeginPlotDefaults() line, add the following preference statement to set the default font type, style and size for notes: *SetNoteFont("Tahoma", 1, 1, 10)
4. After the *SetNoteFont() line, add the f ollowing preference st atements t o set the default f or note attachment, text alignment, and color: *SetNoteAttachment(View) *SetNoteAlignment(Left) *SetNoteColor(5)
5.
Save the new preferences file as new_notes_legends.mvw.
Step 10: To set the legend defaults: 1.
Select the file new_notes_legends.mvw from the file browser in TextView window mode.
2.
Aft er t he *SetNoteColor() line, add the following preference statements to set the defaults for legend font and legend placement: *SetLegendFont("Tahoma",1,1,24) *SetLegendPlacement(TopRight)
3.
Save the new preference file as new_notes_legends.mvw.
Step 11: To observe the updated default plot fonts: 1.
Click Add Page on the toolbar to add a new page to the current session.
2.
Select HyperGraph 2D from the Select Application menu.
3.
Change page layout to two windows per page.
4.
Add a curve to the current plot.
5.
Add a note to the current plot.
6.
Register and Load the file new_notes_legends.mvw. If prompted to update to current defaults, select No.
7.
Click on the second plot window on the current page.
8.
Add a curve to the current plot.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 107 Proprietary Information of Altair Engineering
9.
Add a note to the current plot. The note and legend displayed on the plot reflect the defaults defined in the new_notes_legends.mvw file. To view the note at tac hment update, t ranslate the curves using the view control arrows located in the lower left of the program window.
Step 12: Update note and legend defaults. 1.
Add a page and select TextView from the Select Application menu.
2.
Open f ile /tutorials/mv_hv_hg/preferences/headers_footers.mvw from the file browser on the toolbar.
3.
Aft er t he *BeginDefaults() line, add the following preference statements to define the *BeginHeader() block: *BeginHeader() *EndHeader()
4.
Aft er t he *BeginHeader() line, add the following preference statements to define portion of the available header area: *BeginRegion(400, 0, 600, 300) *EndRegion()
5.
Region descriptions use a coordinate system. The arguments in the region statement represent: the minimum X coordinate, the minimum Y coordinate, the maximum X coordinate and the maximum Y coordinate. If the region you were describing was the entire header area your *BeginRegion statement would be: *BeginRegion(0,0,1000,1000).
6.
Aft er t he *BeginRegion() line, add the f ollowing preference stat ements t o set the t ext font, alignment and border for the region (update the path below to reflect where your installation is located): *Font("Times",0,1,12) *Alignment(Center) *BorderWidth(1,1,1,1)
7.
Aft er t he *BorderWidth() line, add the following preference statement to define the text in the header region: *Text("Project Title")
8.
Save the new preference file as new_headers_footers.mvw.
108 HyperGraph 2D 13.0 Tutorials Proprietary Information of Altair Engineering
Altair Engineering
Step 13: Add a page footer. 1.
Your file should be new_headers_footers.mvw. If not, open the file new_headers_footers.mvw from TextView window mode.
2.
Aft er t he *EndHeader() line, add the following preference statements to define the *BeginFooter() block: *BeginFooter() *EndFooter()
3.
Aft er t he *BeginFooter() line, add the following preference statements to define and set up one region in the footer: *BeginRegion(700, 0, 1000, 1000) *Font("Times",0,1,12) *Alignment(Center) *BorderWidth(1,1,1,1) *EndRegion()
The footer region’s coordinate system is similar to the header region: minimum X coordinate is 0 at the left and maximum X coordinate is 1000 at the right. The minimum Y coordinate is 0 at the base of the footer and its maximum coordinate is 1000. 4.
Aft er t he *BorderWidth() line, add the following preference statement to place text in the region: *Text("Your Name") *Text("{time()} on {date()}") *Text("Page:
5.
{pagenum}/{numpages}")
Aft er t he *EndRegion() line, add the following preference statements to define and set up a second region within the page footer: *BeginRegion(700, 0, 1000, 1000) *BorderWidth(1,1,1,1) *EndRegion()
6.
Aft er t he *BorderWidth() line, add the following preference statement to put an image in the region: *Image("/tutorials/mv_hv_hg/preferences/Altair_logo.gif")
Images, such as company logos, can be added to any region within the header or footer of a plot. The image type must be either GIF (format 87), JPG or BMP. Images are fitt ed vertically and centered horizontally. 7.
Save the new preference file as new_headers_footers.mvw.
Altair Engineering
HyperGraph 2D 13.0 Tutorials 109 Proprietary Information of Altair Engineering