In this tutorial, HyperMath files (*.hml) will be executed in Batch Mode. The output from the files will be written to text files.
Step 1: Launch HyperMath.
1. | From the Start menu, select All Programs > Altair HyperWorks > HyperMath. |
This launches HyperMath in the HyperMath GUI. Notice that by default, a file named Untitled1.hml exists in the Editor window.
Step 2: Open and run the files Tutorial_Matrix_noplot.hml and Tutorial_RK45_noplot.hml in HyperMath.
1. | From the File Browser, click on the open file icon, ![]() |
2. | From the list of files in the File Browser, left-click to select the file Tutorial_Matrix_noplot.hml. Drag and drop the file in the Editor window. |
3. | Click the Run File button, ![]() |
4. | Again, in the File Browser, locate the file Tutorial_RK45_noplot.hml. Left-click on the file and drag and drop it into the Editor window. |
5. | Click the Run File button, ![]() |
Notice that for both files, there is only text output to the Command window. There are no plots created. Therefore, both of these files can be run in HyperMath in batch mode.
Step 3: Open the command prompt and run the file Tutorial_Matrix_noplot.hml in batch mode.
1. | From the Windows Start menu, select Run. Type cmd and press ENTER. |
This launches the command prompt. We will use the command prompt to run the files in HyperMath in batch mode.
2. | At the command prompt, enter the following (replace <altair_installation_dir> with your actual installation location) and press ENTER. |
cd <altair_installation_dir>\hwx
This changes the directory to the location in the installation where the hypermath.bat file is located.
Note: On Linux the corresponding folder is <altair_installation_dir>/altair/scripts.
3. | To run the file hypermath.bat, type the following in the command prompt. Do not press ENTER after typing the following command: |
hypermath.bat
Note: On Linux the corresponding batch file is hmathbatch
4. | Following the hypermath.bat command, type –f and the path to the file Tutorial_Matrix_noplot.hml. This should look like the following: |
hypermath.bat –f <altair_installation_dir>\tutorials\hmath\Tutorial_Matrix_noplot.hml
The –f in the command above is a parameter which is needed before the files are passed to the batch file.
5. | Press ENTER to run the file in batch mode. Notice how all the output is printed to the command prompt. Also, the output is the same as what was printed in HyperMath in the Command window when the file was evaluated. |
Step 4: Run the file Tutorial_RK45_noplot.hml in batch mode.
1. | Again, type hypermath.bat at the command prompt. Do not press ENTER after typing this command. |
2. | Following the hypermath.bat command, type –f and the path to the file Tutorial_RK45_noplot.hml. This should look like the following: |
hypermath.bat –f <altair_installation_dir>\tutorials\hmath\Tutorial_RK45_noplot.hml
3. | Press ENTER to run the file in batch mode. Notice how the output is printed to the command prompt. Also, notice how this output is the same as what was printed in HyperMath in the Command window when the file was evaluated. |
Step 5: Run both of the files Tutorial_Matrix_noplot.hml and Tutorial_RK45_noplot.hml in batch mode. Also, have the output from the runs go into a text file.
1. | At the command prompt, type the following: |
hypermath.bat –f <altair_installation_dir>\tutorials\hmath\Tutorial_Matrix_noplot.hml <altair_installation_dir>\tutorials\hmath\Tutorial_RK45_noplot.hml >> C:\output.txt
After the –f, the paths to the two files are listed. After the two files, there is a >> with another file listed. This indicates that the output from the two files should be exported to this file. This file needs to be in a folder with write access.
2. | Press ENTER to run the file in batch mode. This time, there isn’t any output written to the command prompt. |
3. | Open the file output.txt in a text editor. This file contains the output from the two files that were run in batch mode. |
HMath-1000: Editing, Executing, Saving, and Plotting in HyperMath
HMath-1010: Working with HyperMath Authoring Mode
HMath-1020: Working with HyperMath Debugging Mode
HMath-2000: Working with HyperMath – Arithmetic and Relational Expressions and Control Structures
HMath-2010: Working with HyperMath – Logical and Relational Expressions and Control Structures
HMath-2020: Working with HyperMath – Functions and Matrix Operators
HMath-2030: Working with HyperMath – Plot Commands
HMath-3000: Working with HyperMath – String Library
HMath-3010: Working with HyperMath – Input/Output Library
HMath-3020: Working with HyperMath – Input/Output Library Continued
HMath-4000: Using HyperMath Functions for Curve Fitting
HMath-4001: Using HyperMath for Material Characterization
HMath-4010: Solving Ordinary Differential Equations
HMath-4020: Solving Differential Algebraic Equations
HMath-4030: Optimization Algorithms in HyperMath
HMath-5000: Using HyperMath in HyperView Results Math
HMath-5001: Post Processing Results from FEA
HMath-5002: Registering a Function in HyperGraph 2D
HMath-5003: HyperMesh-HyperMath Cross Execution of a Tcl Script
HMath-5004: HyperMesh-HyperMath Cross-debugging of a Tcl Script