Extract Matrix from ABAQUS

Matrix in ABAQUS

Matrices: Stiffness, Mass, Viscous Damping, Structural Damping, Load

Formats:

• FORMAT=MATRIX INPUT (default) to specify that the output use the matrix input text format that is consistent with the format used by the matrix definition technique in Abaqus/Standard.
• FORMAT=LABELS to specify that the output use the standard labeling format.
• FORMAT=COORDINATE to specify that the output use the common mathematical coordinate format.

Extract Element matrices

It is simple and just edit the keywords in input file. As the *STEP in input file, adding the keywords in the last two lines after the definition of step.

** STEP: Step-1
**
*Step, name=Step-1, nlgeom=NO, perturbation
*Frequency, eigensolver=Lanczos, acoustic coupling=on, normalization=displacement
, , 10., , ,
*Element Matrix Output,Elset=SET-2,
File Name=filename,Frequency=1,Output File=User Defined,Stiffness=Yes,Mass=Yes

Explanation: Elset, means the element set that you want to extract matrix from. File Name, you can name it as what you want and a .mxt file with this name will be generated in your file folder. In a nonlinear analysis, Dload=Yes can be used to extract  the load vector from distributed loads on the element. The exact meanings are detailed in keyword *ELEMENT MATRIX OUTPUT in Abaqus Keywords Reference Guide.

Extract Global Matrices

It is also easy to extract global matrix. You need to add the following codes at the end of the input file or adding these lines before or between step definitions. The difference of the positions in input file between the three lies on the matrices after which step.

**
*STEP
*MATRIX GENERATE, STIFFNESS, MASS
*MATRIX OUTPUT, STIFFNESS, MASS, FORMAT=MATRIX INPUT
*END STEP

After completing the analysis, two .mtx files with the name jobname_STIF2 and jobname_MASS2 (2 is the location number of the this step, i.e. the second step) will be generated in your file folder. Open the jobname_STIF2 file and you will find texts as follows.

1,1, 1,1, 1.000000000000000e+36
1,5, 1,1, 9.283850055777577e-12
1,6, 1,1, -4.181074365176346e+04

The meaning of the five numbers in a line are respectively:

1. Row node label
2. Degree of freedom for row node
3. Column node label
4. Degree of freedom for column node
5. Matrix entry
For more details, you can refer to Abaqus Analysis User’s Guide .

Note 1: It is noted that a step containing the mass matrix must be used to extract mass matrix. For example, the under a *Static step, the equation of structure is Kx=F and is not related to mass, and as such the mass matrix can not be extracted. In this example, a *Frequency step is defined.

All structural analyses apart from static will involve calculation and manipulation of the mass matrix.
Static case: Kx = f
Eigenvalue (modal or free vibration): Ma +Kx = 0
Dynamic (transient): Ma + Cv + Kx = f(t)

Note 2: This keyword is not available in Abaqus/Explicit and the analysis will be terminated.

Codes I often use in abaqus to extract matrices in dynamic implicit analysis

**
*STEP
*MATRIX GENERATE, STIFFNESS, MASS, STRUCTURAL DAMPING, VISCOUS DAMPING
*MATRIX OUTPUT, STIFFNESS, MASS, STRUCTURAL DAMPING, VISCOUS DAMPING, FORMAT=COORDINATE
*END STEP

34 comments On Extract Matrix from ABAQUS

• Tan Nguyen

Could you help me to add to my inp. file for extracting stiffness and mass matrix?

** Job name: TAN Model name: Model-1
** Generated by: Abaqus/CAE 2018
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
** PARTS
**
*Part, name=Part-1
*End Part
**
**
** ASSEMBLY
**
*Assembly, name=Assembly
**
*Instance, name=Part-1-1, part=Part-1
0., 2900., 0.
*Node
1, 0., -2900.
2, 0., 1100.
3, 4000., 1100.
4, 4000., -2900.
5, 0., -2500.
6, 0., -2100.
7, 0., -1700.
8, 0., -1300.
9, 0., -900.
10, 0., -500.
11, 0., -100.
12, 0., 300.
13, 0., 700.
14, 400., 1100.
15, 800., 1100.
16, 1200., 1100.
17, 1600., 1100.
18, 2000., 1100.
19, 2400., 1100.
20, 2800., 1100.
21, 3200., 1100.
22, 3600., 1100.
23, 4000., 700.
24, 4000., 300.
25, 4000., -100.
26, 4000., -500.
27, 4000., -900.
28, 4000., -1300.
29, 4000., -1700.
30, 4000., -2100.
31, 4000., -2500.
*Element, type=B21
1, 1, 5
2, 5, 6
3, 6, 7
4, 7, 8
5, 8, 9
6, 9, 10
7, 10, 11
8, 11, 12
9, 12, 13
10, 13, 2
11, 2, 14
12, 14, 15
13, 15, 16
14, 16, 17
15, 17, 18
16, 18, 19
17, 19, 20
18, 20, 21
19, 21, 22
20, 22, 3
21, 3, 23
22, 23, 24
23, 24, 25
24, 25, 26
25, 26, 27
26, 27, 28
27, 28, 29
28, 29, 30
29, 30, 31
30, 31, 4
*Nset, nset=_PickedSet2, internal, generate
1, 31, 1
*Elset, elset=_PickedSet2, internal, generate
1, 30, 1
** Section: Section-1 Profile: Profile-1
*Beam Section, elset=_PickedSet2, material=Material-1, temperature=GRADIENTS, section=RECT
100., 100.
0.,0.,-1.
*End Instance
**
*Nset, nset=_PickedSet4, internal, instance=Part-1-1
1, 4
*End Assembly
**
** MATERIALS
**
*Material, name=Material-1
*Density
7.85e-09,
*Elastic
200000., 0.3
**
** BOUNDARY CONDITIONS
**
** Name: BC-1 Type: Symmetry/Antisymmetry/Encastre
*Boundary
_PickedSet4, ENCASTRE
** —————————————————————-
**
** STEP: Step-1
**
*Step, name=Step-1, nlgeom=NO, perturbation
*Frequency, eigensolver=Lanczos, sim, acoustic coupling=on, normalization=mass
5, , , , ,
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-1
**
*Output, field, variable=PRESELECT
*End Step

• Dorothy

If you want element matrices, just add the codes as I did. And If you want global matrices, just add the codes as another step which you can find in this article. If you have further questions, please feel free to email me.

• Qinbo Zhou

Hello,

Thank you so much for this nice-presented work! It’s quite useful. I used the command to generate global mass and stiffnes matrix. But it seems that the mass matrix is only global LUMPED MASS MATRICES. What if I want to generate global CONSISTENT MASS MATRICES using abaqus?

• Dorothy

Hi Qinbo, if you use consistent mass for the model, you can then get consistent mass matrix. What you mean seems to be related to the matrix, actually the mass will be distributed to nodes and what you get from abaqus is just the right answer. You can calculate the mass matrix of a simple model with consistent mass and compare with what you get from abaqus. If you have further questions, please feel free to reply or email me.

• Nikhil K

Hello Dorothy,
Thanks for this article. I have some doubt in further usage of these mass and stiffness matrices. I would like to find natural frequencies using Matlab (e = eig(K,M);) by finding eigenvalues and taking their square roots.
First of all, my matrices’ size is thrice the number of nodes (actually it is a 3D problem, but DOFs isn’t 6 per node, I need a bit clarification on this too). So, I’m getting the same number of eigenvalues from Matlab as that of the size of mass and stiffness matrices and the results are not the same as that obtained from Abaqus (1st 10 natural frequencies are not matching).

• Dorothy

Hi Nikhil,
Did you compare the mass matrix and stiffness matrix from abaqus and the ones you used in matlab? I suggest you make a comparison.
Another thing is that the mass calculated in abaqus is distributed mass if you did not add the mass on nodes, while we tend to use lumped mass for convenience.
Since the dofs per node in your problem is not 6, abaqus magnifies the elements in stiffness matrix for fixed dofs while we prefer to delete the corresponding rows and columns in K matrix.
The different methods in dealing with mass matrix and stiffness matrix may lead to different eigenvalues. If the relative errors of eigenvalues are within 5%, the results are acceptable.

• DHEERAJ KULKARNI

Hello Dorothy,
Nice article. Thank you.
I used the 2nd method to generate global mass and stiffness matrices. But what I found is, the total mass calculated in Abaqus and the sum of all the entries from .mtx files are not matching. Analytical way mass calculation (density*volume) is agreeing with Abaqus result, but not with extracted matrix. So, the Abaqus answer is right.

• Dorothy

Hi Dheeraj,
Do you mean the sum of mass matrix is not consistent with the total mass you calculated with density*volume? It is the right case because you have two/three directions (for 2D/3D problem) in the model and the load applied to it may induce deformation(velocity, acceleration) in two/three directions. So, the different directions have the same mass for distributed mass condition. If mass only exists in gravity, there will be no deformation(velocity, acceleration) in other directions. The sum of mass matrix from abaqus should be two/three times of the total mass you calculated for distributed mass condition.

• AKBjk

Hello Dorothy,
Thanks for this article. I followed your instruction and then get the element stiffness matrix successfully. But yet I don’t know the meaning of the stiffness matrix element. For example, when I deal with a beam section from your article “Beam elements in ABAQUS”, it outputs the matrix as：
1062000.0000000 ,
0.0000000000000 , 43264.656088429
0.0000000000000 , 0.0000000000000 , 43264.656088429
0.0000000000000 , 0.0000000000000 , 0.0000000000000 , 4553.8475200000
0.0000000000000 , 0.0000000000000 , 21632.328044215 , 0.0000000000000 16736.164022107 ,
0.0000000000000 , -21632.328044215 , 0.0000000000000 , 0.0000000000000 0.0000000000000 , 6736.164022107
Can you explain to me how can I associate this matrix with the section property?(EI、EA、etc)

• Dorothy

Hi Akbjiang,
The elements in stiffness matrix is associated with node number and the degree of freedoms of each node. You can check the meaning from https://zxding.me/archives/d702tw.html or http://abaqus.software.polimi.it/v6.14/books/usb/default.htm?startat=pt04ch10s03at32.html#usb-anl-amtxgenerationperturbation. You cannot get section properties from stiffness matrix because stiffness matrix is related to both section properties and the length of elements. If you were doing nonlinear analysis, the stiffness matrix will change during the analysis. It seems you were using beam element. You can check E from material property and I and A from the sections you defined in Property Module.

• AKBjk

Hello Dorothy,
Thanks for your kindly reply, actually I wonder how abaqus calculate the element stiffness matrix and is there any relation of the element stiffness matrix we derived from abaqus and the section properties we input(for example, we input EA、EI、GJ as section properties when use MESHED), how can I get the stiffness matrix manually if node number and the degree of freedoms is determined?

• Dorothy

Sorry for the late reply. Something was wrong about the WordPress email. The stiffness matrix is definitely related to the section properties and also the meshing size. You can find the derivation of the stiffness matrix in any finite element book. This is one recommendation for you and you can download the PDF file from this link, http://web.mit.edu/kjb/www/Books/FEP_2nd_Edition_4th_Printing.pdf . You can also watch the lecture videos given by Prof. Bathe from MIT https://ocw.mit.edu/resources/res-2-002-finite-element-procedures-for-solids-and-structures-spring-2010/linear/. There is also course on nonlinear finite element analysis in MIT open course. If you just want to derive the initial stiffness matrix, you can just focus on the linear part which is much easier. There are also many lecture ppts online and you can find the derived matrix and just use it directly. The stiffness matrix of beam element is easier and there are at least three different stiffness matrix because of different consideration such as shear effects and integration method. The stiffness matrix you got from abaqus is also related to your settings about shear stiffness of beam section in Property module. For the setting, you can check the abaqus analysis user’s guide from http://130.149.89.49:2080/v2016/books/usb/default.htm .

• ddaniel

Dear All,
thank you for your very interested post.
I am aware of how to get out these matrices from Abaqus.
However I have not found yet any way to get out the MODAL mass/stiffness/damping matrices.
I am running a frequency analysis (my model has also some damping properties) and I would like to get the modal matrices.
This means if [M], [K], [C] are the mass,stiffness and damping matrices and [Φ] the eigevectors matrix I would like to get out
[Φ]'[M][Φ], [Φ]'[K][Φ], [Φ]'[C][Φ].
Does anyone know the way?
ddaniel

• Dorothy

Hi Ddaniel,
You can try to use the following codes to get the M, K, C matrices, it should work.
*MATRIX GENERATE, STIFFNESS, MASS, STRUCTURAL DAMPING, VISCOUS DAMPING *MATRIX OUTPUT, STIFFNESS, MASS, STRUCTURAL DAMPING, VISCOUS DAMPING, FORMAT=COORDINATE
To get the eigenvectors, you should first request eigenvectors at all nodes. Here is the link related to this, https://abaqus-docs.mit.edu/2017/English/SIMACAEANLRefMap/simaanl-c-freqextraction.htm. Since I never extracted eigenvector before and abaqus is now not available to me, I am not sure how to do. You can have a try after requesting the eigenvectors.
Please feel free to contact me if any questions.

• ddaniel

Dear Doothy,
What you describe is exactly what I am currently doing.
However I was hoping for a way to get the modal M,K,C matrices directly from Abaqus (this is something posible to be done for example with Nastran) without the need to multiply them with the eigenvectors matrix my self.
Best Regards,
ddaniel

• Dorothy

Hi Ddaniel,
Now I clearly understand what you want from abaqus. I think the ‘OUTPUT’ part in this link may be helpful. The generalized mass is written automatically to the output database as history data.

• Diana

Hi Dorothy,

I would like to extract the stiffness matrix at the initial step of the analysis and then after cracking occurs. I would like to view how the stiffness changed with the cracks.
Is this possible. Thank you

• Dorothy

Hi Diana,
You can add a step to extract the initial stiffness matrix and also a step after your cracking analysis for the final stiffness matrix. As far as I known, it’s not possible to extract stiffness matrix during the analysis for each substep. You can check the abaqus documents.

• Katy

Hi Dorothy,
I tried using the code for the extraction of element mass and stiffness matrix. The stiffness matrix works fine but not for the mass matrix in which I find a diagonal matrix. The problem is that I cannot calculate the eigenvalues with such a mass matrix. I tried to do the same for a cantilever beam and it works well but not for my 2D model. Can you help me with that? Thank you in advance

• Dorothy

Hi Katy,
To my best knowledge, the eigenvalues could be calculated with a lumped mass matrix which is a diagonal matrix. If you want consistent mass matrix, it should work if you avoid using point mass.

• Katy

Hi Dororthy,
I didn’t find a way to find the eigenvalues with a lumped mass can you share it if you know. And for the second option I would like to know how to do that in Abaqus.

• Dorothy

Hi Katy,
I am a little confused with your question, so I will explain what may be useful to you.
For the eigenvalues given by abaqus, you can go to the location where your abaqus job files are saved, then you search the jobname.dat file and you can find the eigenvalue output with eigenvalues and frequencies.
For the manual calculation of eigenvalues, you can use the matlab code [eigen_vec, w_square] = eig(K, M), in which the K and M are the stiffness matrix and mass matrix you have, and the w_square is the eigenvalue (which is the eigenvalue in abaqus). You can get the frequency w in rad/s (which is the frequency in rad/time in abaqus) by taking square root of w_square and w/(2*pi) in Hz.
If you use the material with density and do nothing else in abaqus, you will get consistent mass matrix, which will have non-diagonal elements because of the shape function of the element. If you want to use lumped mass matrix which only have diagonal elements, do not define density in material and go to the ‘Property‘ module and then go to the ‘Special->Inertia‘ to create the point mass/inertia. After successfully defined the point mass at the nodes you want, there will be a green square at the node with point mass.
Hope these could help you and feel free to contact me if you have further questions.

• Remya Nair

I have extracted the stiffness and mass matrix of an assembly, two beams bolted together. I created one beam as part and the other beam is a copy of this beam. I have to apply boundary conditions on certain nodes in the stiffness matrix. But when I created node-set, both my instances have the same node numbers. How to relate this to the stiffness matrix.

• Dorothy

Hi Remya,
I did not deal with this before, but I think one way to get the stiffness matrix related to the node numbers is renumbering the nodes. Here is the link about how to renumber the nodes.

• Alireza

hi Dorothy
i have modeled a 2D-plate using Q4 element in matlab. i have used consistent formulation of mass matrix to form the elemental mass matrix of the plate and then assembled them to creat the Global mass matrix of the plate. to extract the eigenvalues, i used eig(K,M) in matlab. i did the same in abaqus to model a 2D plate using CPS4 element in plane stress condition. the stiffness matrix calculated by abaqus is as same as the matlab. but the mass matrix extarcted from abaqus seems to be lumped mass matrix, because it’s numebr of values are as equal as the number of DOFs. so the first 3 eigenvalues calculated by matlab are 100 times greater than those of calculated by abaqus.
do you know the reason of this diffrence? is it possible to model a 2D-plate in abaqus whose mass matrix is consistent?
thank you.

• Dorothy

Hi Alireza,
From my understanding, abaqus uses consistent mass matrix by default. One can obtain lumped mass matrix only by create the point mass/inertia. If you only define the material density for your plate, the mass matrix should be the consistent one. You can double check the mass matrix you obtained from abaqus and also the one you have in matlab. I once compared the eigenvalues for a beam element from consistent and lumped mass matrix. The first eigenvalue is the same corresponding to rigid body motion, and the second one is about two times with consistent mass matrix.

• Alireza

I have compared both mass matrices extracted from Matlab and Abaqus. As I mentioned it in my first comment, the number of mass matirx entries calculated by Abaqus are equal to the number of DOFs, which means it is a diagonal mass matrix.
I have used Abaqus’ mass matrix values to form a diagonal mass matrix in Matlab. I have employed eig(K,M) again to extract the eigenvalues. The extracted eigenvalues didn’t differ from the previous ones (using consistent mass matrix). I was wondered because I used diagonal mass matrix instead of consistent mass matrix. so I have another question. Do you know how Abaqus calculates the eigenvalues? because Abaqus and Matlab gave the same stiffness matrix and the only diffrence between them was in the mass matrix. Actually I couldn’t understand where the problem was.
Thank you again.

• Dorothy

Hi Alireza,
The method for eigenvalue calculation in abaqus depends on which eigensolver you choose in ‘STEP’. It could be Lanczos, subspace or AMS. I used Lanczos method before for a simply supported rectangular plate and the differences of the eigenvalues are within 35% and 10% for the first 10 modes with a coarse and fine mesh respectively. I extracted the mass matrix of this model, and the first ten rows in .mxt file are shown as:
1,1, 1,1, 1.838929123451831e-03 2,1, 1,1, 1.837295790156881e-03 12,1, 1,1, 1.837295790156881e-03 13,1, 1,1, 1.836479123509406e-03 1,2, 1,2, 1.838929123451831e-03 2,2, 1,2, 1.837295790156881e-03 12,2, 1,2, 1.837295790156881e-03 13,2, 1,2, 1.836479123509406e-03 1,3, 1,3, 3.266666589899999e-03 2,3, 1,3, 1.633333294950000e-03
You can see the matrix does have off-diagonal elements. Maybe somewhere in your model is not correct.

• Alireza

Hi Dorothy,
Thanks a lot for your attention and fast response. Could you please give me your Email? I have some more questions about mesh numbers you used and the first 10 natural frequencies you extracted from Abaqus. I will be appreciated you.
Best regards.

• Dorothy

Hi Alireza,

• Karthikayen Raju

Hi Dorothy!
why cannot we extract matrices in abaqus explcit?

• Dorothy

Hi Karthikayen,
I am not sure what the reason is. I tried but the codes could not work. If you know the reason, please let me know. I am also confused.
One way to extract matrices in abaqus/explicit is to add keywords for one more step.
** *STEP *MATRIX GENERATE, STIFFNESS, MASS, STRUCTURAL DAMPING, VISCOUS DAMPING *MATRIX OUTPUT, STIFFNESS, MASS, STRUCTURAL DAMPING, VISCOUS DAMPING, FORMAT=COORDINATE *END STEP

• Lars

Hi Dorothy,

I managed to extract the mass and stiffness matrix from my Abaqus model, however, the mass matrix is a lumped (diagonal) matrix. How can I extract the consistent mass matrix instead? I use 3D solid elements.