Skip to main content

Craig Bampton Method

In a previous post, the Craig-Bampton (CB) substructuring method was used in Ansys to simplify a part for reuse. To learn more about what Ansys does in the background, I did some reading up. Here are some good resources:

Original Paper link
FEMCI general description: link
My Go-to Primer link
Tom Irvine's tutorial papers and Matlab scripts link

Octave/Matlab Scripts
Inspired by Tom's Matlab script, I coded a script to condense two 'random' bodies, keep only 10 modes of each body with 3 nodal interface points between them. The 'random' bodies are positive definite matrix that is generated randomly for each run to represent two mass and stiffness matrices. Running the script again would generate a different system and different plots.

Here are the links to the two Octave/Matlab scripts used to create the plots below:
Main Script: Random2PartsCB.m  link  (run this one)
Minion Script: CraigBampton.m  link

A run of the script may yield something like Figure 1 below. As only 10  modes were kept of body #1 and 10 additional modes were kept for body #2 as master nodes, the error exceeding 5% occurs right around the 20th mode. This is worth keeping in mind when selecting the master (M) degree of freedom. 
Figure 1 - Natural Frequency Error 

Three transfer functions are then computed at the 3 connection points comparing the CB System to the original Full System. The results compares well enough. 

Figure 2 - Transfer Function comparison

I'm sure there are quite a few bugs in the script but I'm satisfied with the results for now. Two key caveats: damping was ignored and Load Transformation Matrix (LTM) was not used. 

All posts on Superelement 
Reuse CMS Superelement in Ansys Workbench with Expansion Link
Component Mode Synthesis (CMS) with Results Expansion in Ansys Workbench Link
Craig Bampton Method Overview Link
Component Mode Synthesis(CMS) Substructure in ANSYS Workbench Link

It was pointed out to me that Hurty (1965) first proposed this ideas before Craig (1968). 
Hurty, W. C. (1965). Dynamic analysis of structural systems using component modes. AIAA Journal,3(4), 678–685


  1. Great web site dear Sze Kwan;
    plz can you guide me to achieve my task wich is about extract mass and stiffness matricess from ansys to matlab and performing craig-bamptom method of different dynamic mode. I modeled a wing strcuture and i extracted the both matrices from ansys. Now, i'm discontinued in craig-bamptom method. I have consulted all the links that you have already applied for on this site but I cannot project my idea. plz guide me i'm a PhD in mechanical engineering and i want to do something about flexible body so i chose performing lumped parametr method and finite element method for my wing structure, for LPM i did it well but currently i'm discontinued with the second method and excatly in craig-bamptom method.
    Plz help me

    1. "can you guide me to achieve my task wich is about extract mass and stiffness matricess from ansys to matlab and performing craig-bamptom method of different dynamic mode"

      Hi Atef,

      Please see and
      on exporting mass and stiffness matrix to Matlab.

      The post here has example scripts needed for an implementation of Craig-Bampton given the mass and stiffness extracted. Tom Irvine's tutorial is an especially useful reference.

  2. Dear Sze Kwan;
    Thank you very much for your answer
    Just a quick questions:
    1---- I extracted mass and stiffness matrices using commands below (obtained from tutorial video of ansys youtube channel)but i obtained the both of matrices (.matrix) file with capacity of 10 Gega Byte!!! that makes sense?????

    ! below commands create dense matrix

    ! Stiffness

    ! Mass

    ! below commands create sparse matrix

    For Mass

    2----- For Tom Irvine's tutorial, i used his code matlab wich is about Craig-bamptom putting my matrices but i did not get valid simulation and results!!!

    3---- What means please, this description :
    'C-B - 3D EB beam model, 3 interface frames, 100 elements, 18 static modes, 10 dynamic modes'
    'C-B - 3D EB beam model, 3 interface frames, 100 elements, 30 static modes, 20 dynamic modes'

    thank you very much sir :)

    1. 1a. You may try *SMAT instead of *DMAT to make it a sparse matrix.
      1b. Use *EXPORT instead of *PRINT to take advantage of Matrix Market Format.
      1c. Perhaps try first with a very small simple model with few nodes.

      2. It worked for me years ago. Sorry I can't trouble shoot from afar.

      3. Sorry, I don't know what that means either.

  3. hello pls i need the matlab code


Post a Comment

Popular posts from this blog

ANSYS User Defined Results

There is an abundant of options in ANSYS classic when one wishes to post process results. ANSYS workbench default pull down menu post processing options are more limited but they can still be accessed via the User Defined Results. One way not commonly used but can come in handy is as follows: Zeroth: Under Analysis Settings, there is "Output Controls" where you can toggle to "Yes" what you would like to save before the solution starts. This is like OUTRES in APDL. Output Controls First: After solving the model, click on Solution in the tree to highlight it. Solution Second: Click on Worksheet in the toolbar. Worksheet Third: In the worksheet, you will see list of results that are saved. Right click on it to create the User Defined Results. Create User Defined Results So here we have it. You could of look up the different expressions in the help document but I find this method of accessing the results convenient.  Example: Aspec

Export Stiffness Matrix from Ansys

It is sometimes useful to extract the mass and stiffness matrix from Ansys.     *SMAT, MatK, D, IMPORT, FULL, file.full, STIFF       *PRINT, matk, matk, txt Exporting mass matrix would be similar:       *SMAT, MatM, D, import, full, file.full, MASS The above script uses APDL Math to get the job done. (Please see previous post for another example). The ordering of the matrix is unfortunately not concurrently exported. To verify the sequencing is as expected, we will work to replicate a truss example in the  Finite Element Trusses course notes by Bob Greenlee. Figure 1: Truss Problem Setup Model Creation Script to create model: /prep7 !! Creates Model to reflect course notes ! Properties et ,1,1  mp , ex, 1, 29.5e6 r , 1, 1 ! Geometry n ,1 $  n ,2, 40 $  n ,3, 40, 30 $  n ,4, 0, 30 e ,1,2 $  e ,2,3 $  e ,1,3 $  e ,3,4 ! Boundary Conditions d ,1,ux,0 $  d ,1,uy,0 d ,2,uy,0 d ,4,ux,0 $  d ,4,uy,0 f ,2,fx,20e3 f ,3,fy,-25e3 ! solves /solu eqslv , sparse

ANSYS APDL Syntax Highlighting editor

Notepad++ with APDL User Defined Language The editor of my choice is Notepad++  with the available User Defined Language Files for APDL . You can install it without administrative privileges via the zip file. The best part of it is, it's FREE! After installing Notepad++, go to "Language>Define Your Language..." then "Import" the XML file downloaded from the above link. Remember to restart Notepad++ so that the language changes will take into effect. Opening up any *.inp or *.ans files should automatically switch highlighting to APDL. I made some minor edits. Here's my XML file: LINK . I also heard Sublime Text and  Ultraedit  has more advance features but they aren't (totally) free.