IMAT and its related toolboxes provide you with significant functionality. However, it may not seem obvious how to use IMAT's capabilities, even after reading the documentation. Because of this, we have provided several useful examples that demonstrate how to use IMAT. All of the example files can be found in the examples subdirectory of your IMAT installation. We highly recommend that you include this directory in your MATLAB path if you have not already done so.
The following sections describe what you can find in the examples directory.
IMAT provides a number of useful utilities. These utilities are provided as MATLAB m-files, so the source code is readily visible. The following table summarizes the example functions provided.
Function | Description |
calc_energy_fractions.m | Calculate and report kinetic and strain energy fractions for groups |
cmif.m | Compute Complex Mode Indicator Functions |
create_default_fn | Create a default imat_fn of a specified type |
format_ppt.m | Format an imat_fn plot for pasting into Microsoft Powerpoint |
frfsyn.m | Synthesize Frequency Response Functions from real or complex mode shapes |
gmif.m | Compute the various mode indicator functions |
mmif.m | Compute Multivariate Mode Indicator Functions |
ortho.m | Compute Modal Assurance Criterion or Orthogonality for a set of mode shapes |
plot4views.m | Create a four-paneled mode shape plot |
psmif.m | Compute Power Spectrum Mode Indicator Functions |
qmif.m | Compute Quadrature Mode Indicator Functions (CMIF using the imaginary component of the FRF) |
rbmodes.m | Generate rigid body modes from FEM geometry |
readunv_180.m_example.m | Example for using the readunv API to import dataset 180 |
tdm_xlsread.m | Read Test Display Model from Excel worksheets |
tdm_xlsread_example_1.xlsx | TDM example Excel worksheet |
tdm_xlsread_example_2.xlsx | TDM example Excel worksheet |
tdm_xlsread_template.xlsx | TDM Excel worksheet template |
tdm_xlswrite.m | Write Test Display Model to Excel worksheets |
writeblk.m | Write to a Nastran BLK file |
writedmig.m | Write matrix in Nastran DMIG format |
writempc.m | Write a row- or column-oriented matrix as NASTRAN MPC cards |
writerandps.m | Write RANDPS and TABRND1 cards to a Nastran bulk data file |
writetabled1.m | Write imat_fn or fcn as Nastran TABLED1 cards |
write_nas_field.m | Pack real numbers into 16-character fields in Nastran format |
SMAC subdirectory | |
smac.m | Synthesize Modes and Correlate modal parameter extraction utility |
Anapost subdirectory | |
aelempost.m | Summarize solid element stress results from Nastran Output2/Punch files |
max_von_mises.m | Compute the highest von Mises stress for a load of unknown direction |
The examples we provide also happen to be useful. We provide functions to compute Modal Assurance Criteria (MAC) and orthogonality, generate rigid body mode shapes from supplied finite element model geometry, generate a modal substructure from mode shapes, compute normal, complex, and multivariate mode indicator functions, and synthesize frequency response functions (FRF) from real normal modes.
Another very useful set of example functions allows you to easily create and/or modify FEM connectivity using Microsoft Excel. This capability is particularly useful for test engineers who might use a test display model (TDM) for animating mode shapes. The examples directory contains several functions and spreadsheets whose filenames start with tdm_xls*. You can develop FEM connectivity including local coordinate systems, nodes, elements, and tracelines in Excel, and then invoke tdm_xlsread.m to import the TDM into an imat_fem in MATLAB for display. You can export an imat_fem from MATLAB using tdm_xlswrite.m to an Excel spreadsheet for modification and then subsequent import back into MATLAB. Also included are a blank template Excel file called tdm_xlsread_template.xlsx and two example TDM files.
In addition to these useful functions, we provide several readunv extension examples that show you how read Universal file datasets that are not natively handled by readunv. The three examples provided read datasets 2452, 2467, and 2477, which contain group information. If the examples directory is in your MATLAB path, readunv will automatically detect and use these extension functions.
The best way to familiarize yourself with the functions we provide is to browse the examples directory and read the help for these functions.
In addition to the sample functions found in this directory, the main IMAT source directory contains several MATLAB scripts that start with demo_*. These files contain code and comments that show you how to use IMAT by going through some simple examples. You can access these scripts by running them (type demo_ at the MATLAB prompt, followed by a <TAB> to see the available choices).
In the Demo_Files subdirectory you will find a number of data files. All of these files are related to a fictional spacecraft (the General Purpose Spacecraft, or GPSC). You can use these data files to exercise the various IMAT import functions, and also to load IMAT datatypes so you can exercise the functionality available to them.
This directory contains function and shape ADFs, Nastran bulk data, Output2, and Punch files, and an Abaqus Input file and ODB.
SMAC, or Synthesize Modes and Correlate, is not so much an example as it is a fully functional modal curve-fitting utility. It utilizes a different approach from most modal curve-fitting algorithms. SMAC is based on modal filter theory. You can find an introduction to SMAC along with helpful hints on how best to use it here.
To use SMAC, simply add the examples/SMAC directory to your MATLAB path, and invoke it by typing 'smac' at the MATLAB prompt.
SMAC is generously provided by Sandia National Laboratories through the United States government, and is released under Mozilla Public License version 1.1. The text of this license can be found here.
The anapost directory contains a collection of useful functions for post-processing Nastran results. These include aelempost, a utility that reads solid element stress results from Nastran OP2 or PCH and post-processes them. max_von_mises calculates the worst direction von Mises stress on a per-element basis, given stress inputs in 3 orthogonal directions. For more details on the supplied utilities, please review the contents of this directory in your installation. README.txt, located in this directory, gives more details about the available utilities.
To use any of these utilities, simply add the examples/anapost directory to your MATLAB path.