Skip to main content

Defining Ansys Superelement SUB File Manually

Photo by  James Owen  on  Unsplash A surprisingly popular blog-post written here is Exporting Stiffness Matrix from Ansys . A sensible follow up question is what can one do with the exported stiffness matrix? In a recent Xansys Forum post, a question was raised on how we can edit the stiffness matrix of a superelement and use it for our model.  An approach presented below is to first create a superelement that has the same number of DOF and nodal location that will serve as a template. An APDL script can then be written to edit the stiffness matrix entries as desired before exporting to a new superelement *.SUB file for use in future models. The self-contained script below demonstrates this.  /prep7 et ,1, 185 mp , ex, 1, 200e3 mp , prxy, 1, 0.33 w = 0.1 ! single element (note nodal locations) n , 1, w, -w, -w n , 2, w, w, -w n , 3, -w, w, -w n , 4, -w, -w, -w n , 5, w, -w, w n , 6, w, w, w n , 7, -w, w, w n , 8, -w, -w, w e , 1, 2, 3, 4, 5, 6, 7, 8 /solu antype , substr     ! analy

Modal Assurance Criteria MAC with Ansys for select Measurement Locations

Where should the accelerometers be placed? - Test Person
Test People are tough to work with! I was one before so I would know. Have a bit of sympathy for them though as they could be frantically troubleshooting equipment in the middle of no-where or spend countless hours rolling-and-unrolling cables.

Goal of Measurement Points Selection
OK, we have a model with natural frequencies and mode shapes. If your company is well endowed, this is a simple question with pretest software like FEMtools or some other software that optimizes the MAC matrix. This would also help with correlation later. Generally speaking, the software will maximize the diagonal matrix while minimize the off diagonal matrix values. Loosely defined, this means the modes are relatively unique (mathematically speaking) for the chosen measurement locations.

Poor Man's Method for Picking Measurement Locations
Alternately, we can pick measurement locations by hand based on past experience and liberal use of engineering judgement. Here's a rough rule of thumb process in picking locations:
  1. Print a drawing of the part
  2. For all the computed modes of interest, mark the absolute maximum/minimum displacements with the mode number (e.g. red pen)
  3. Also for each mode, mark the node point with the mode number (e.g. blue pen)
  4. Group the locations that are close to each other
  5. If too many measurement points remain:
    5a. Review the points that aren't grouped
    5b. Eliminate those mode numbers already represented by the other grouped points
  6. Keep withering it down until an 'acceptable number' is achieved
  7. Narrow down to a few sets of measurement locations to simulate

Computing Expected MAC Matrix
OK, now that we have a few candidate points for accelerometers, we could test them out with our model. The test MAC should match the analytical MAC if we did a good job in setting up the model. The following procedure will help us determine if the picked measurement locations will provide us with a good MAC.

Overall Procedure of the Command Snippet
In general, the script does the following:
1. Creates the Super-Element using measurement points as master nodes
2. Compute modal analysis results for the Super-Element
3. Compute MAC Matrix of the Super-Element using RSTMAC
4. Computes Modal Analysis of earlier model as if nothing happened

Command Snippet Code
!!! Inputs
num_modes = 3
! masternodes = 'MeasPoints_bad' ! Toggle which Named Selection Here
masternodes = 'MeasPoints_good'  ! Toggle which Named Selection Here

!!! Creates Super-Element with Measurement Nodes
/filname,myse   ! name of the super element
antype,substr     ! analysis type: substructure
seopt, myse, 2   ! saves mass and stiffness matrix
cmsopt, fix, num_modes   ! Craig-Bampton

cmsel, s, %masternodes%
m, all, uy   ! creates master nodes *** IMPORTANT ***


!!! Compute Mode Shapes of SE
/filname, file
et,etmax+1,50              ! SuperElement Type

se,myse                    ! Creates Super Element

! Selects only superelement
esel, s, type,,etmax+1

antype, modal
modopt, lanb, num_modes

!!! Computes MAC matrix
rstmac, file, 1, all, file, 1, all, 0.01, 0.9,, 1

!!! Computes Mode Shape of Full Model
! so that WB solution will be 'pretty'

antype, modal
modopt, lanb, num_modes

For the cantilever beam model of the previous post, we could either pick semi-optimal points (e.g. named selection of MeasPoints_good):

or... a mediocre ones (e.g. named selection of MeasPoints_bad):

If you scroll through the long solver output file, you will find the MAC matrix listed when you solve the two cases individually for the two different set of measurement points. 
MAC Matrix

The MAC matrix for "MeasPoints_good" had off diagonal matrix of 5%, 4% and 30.4%. It could be improved but is a whole lot better than "MeasPoints_bad" locations with MAC of 90% in the off diagonal matrix. 

Workbench Archive File
Here's the v18.2 Archive File Link as reference. 


  1. Thank you for the nice post. Does the RSTMAC compute the MAC matrix of the SE with respect to itself or of the SE with respect to the full FE ?

    1. In the example here, the DOF used are of the superelement (SE) and is computed with respect to itself.

    2. Hello can we use these commands in ANSYS APDL to compute mac matrix
      rstmac, file, 1, all, file, 1, all, 0.01, 0.9,, 1

      should we define the two files ?

    3. Yes, you need to define the two files. The two files in the command are the same file which is the default name used in Ansys workbench.


Post a Comment