# Discrepancy in Element Stiffness Matrix Output using Substructure Approach

**URL:** https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007
**Category:** Uncategorized
**Created:** [January 4, 2024, 6:00am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007 "2024-01-04T06:00:42Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)
#### Post date: [January 4, 2024, 6:00am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/1 "2024-01-04T06:00:42Z")

</div>

Dear Calculix Community,

I am reaching out to seek assistance regarding an issue I have encountered while attempting to output the element stiffness matrix from Calculix using the substructure approach. For this purpose, I have utilized the \*SUBSTRUCTURE GENERATE, \*RETAINED NODAL DOFS, and \*SUBSTRUCTURE MATRIX OUTPUT cards in my analysis.

In order to conduct initial testing of the element stiffness matrix from Calculix, I have set up a domain containing a **single 4Node Quad element (elem type = CPS4, solving plane stress problem)** and have successfully outputted the element stiffness matrix to a .mtx file. For verification purposes, I am comparing the obtained results with the ones generated by SolidsPy, an open-source FEA solver.

Upon comparison, I have noticed that the displacements are in agreement between Calculix and SolidsPy. However, there seems to be a discrepancy in the element stiffness matrix results. To provide you with a more comprehensive overview, I have attached the relevant files for your reference.

I am writing to seek your guidance and assistance in resolving this issue. If there are any insights or information you can provide regarding the observed discrepancy in the element stiffness matrix output, it would be immensely helpful for my analysis.

I appreciate your time and attention to this matter. Thank you in advance for your support. Please let me know if you require any additional information or files to further investigate this issue.

Looking forward to your prompt response.

 ![Inputfile](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/c/ce8b7f88ae2acd3d1a39da5a0d6074bc2ed79c21.png)

 ![Calculix_vs_Solidspy](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/2/2fe531c48ebc50a9edc952d07dd23db371319cb4.png)

![element_stiffness_matrix](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/3/3e2227db7629553b8e03bdc7b48a21a89c113384.png)

 ![Calculix_and_solidspy_solution_from_wolfram](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/5/57813f836258314d304790bf03889cc4f7cea9f6.png)

Best regards,  
Anoop

---

<div class="post-metadata">

### Author: ![JuanP74](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@JuanP74](https://calculix.discourse.group/u/JuanP74)
#### Post date: [January 4, 2024, 6:20am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/2 "2024-01-04T06:20:35Z")

</div>

Quick thinking…might be that the extra stiffness in ccx is due to stress stiffening? As you generate the stiffness matrix after calculation of the static step it might take that effect into account. Recalculate without the initial static step.

---

<div class="post-metadata">

### Author: ![JuanP74](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@JuanP74](https://calculix.discourse.group/u/JuanP74)
#### Post date: [January 4, 2024, 8:27am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/3 "2024-01-04T08:27:44Z")

</div>

the stiffness matrix obtained with ccx corresponds to a plane strain analysis…I do not understand very well what’s going on but I think it has to be with the 3d expansion and how afterwards is transformed into a plane stress or plane strain solution.

---

<div class="post-metadata">

### Author: ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)
#### Post date: [January 4, 2024, 8:56am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/4 "2024-01-04T08:56:04Z")

</div>

Try also extracting the stiffness matrix from CalculiX using `*FREQUENCY, SOLVER=MATRIXSTORAGE` as discussed here: [To output element stiffness matrix to a result file](https://calculix.discourse.group/t/to-output-element-stiffness-matrix-to-a-result-file/1988)

---

<div class="post-metadata">

### Author: ![JuanP74](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@JuanP74](https://calculix.discourse.group/u/JuanP74)
#### Post date: [January 4, 2024, 9:15am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/5 "2024-01-04T09:15:03Z")

</div>

I did it. I got the same result.

---

<div class="post-metadata">

### Author: ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)
#### Post date: [January 4, 2024, 9:30am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/6 "2024-01-04T09:30:13Z")

</div>

Used \*FREQUENCY, SOLVER=MATRIXSTORAGE. getting global stiffness with same results.

---

<div class="post-metadata">

### Author: ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)
#### Post date: [January 4, 2024, 9:31am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/7 "2024-01-04T09:31:59Z")

</div>

I did it. Getting same result.

---

<div class="post-metadata">

### Author: ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)
#### Post date: [January 4, 2024, 9:37am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/8 "2024-01-04T09:37:17Z")

</div>

I got this from matrix generation procedure in Abaqus (format: row number, column number, matrix entry):

```auto
1 1 1.000000000000000e+36
1 2 3.749999999999999e+04
2 1 3.749999999999999e+04
1 3 2.884615384615019e+03
3 1 2.884615384615019e+03
1 4 -2.884615384615389e+03
4 1 -2.884615384615389e+03
1 5 -4.903846153846118e+04
5 1 -4.903846153846118e+04
1 6 -3.749999999999999e+04
6 1 -3.749999999999999e+04
1 7 -5.192307692307727e+04
7 1 -5.192307692307727e+04
1 8 2.884615384615387e+03
8 1 2.884615384615387e+03
2 2 1.000000000000000e+36
2 3 2.884615384615387e+03
3 2 2.884615384615387e+03
2 4 8.538461538461465e+04
4 2 8.538461538461465e+04
2 5 -3.749999999999999e+04
5 2 -3.749999999999999e+04
2 6 -1.015384615384608e+05
6 2 -1.015384615384608e+05
2 7 -2.884615384615387e+03
7 2 -2.884615384615387e+03
2 8 -1.869230769230776e+05
8 2 -1.869230769230776e+05
3 3 9.807692307692343e+04
3 4 -3.749999999999999e+04
4 3 -3.749999999999999e+04
3 5 -5.192307692307727e+04
5 3 -5.192307692307727e+04
3 6 -2.884615384615388e+03
6 3 -2.884615384615388e+03
3 7 -4.903846153846118e+04
7 3 -4.903846153846118e+04
3 8 3.750000000000000e+04
8 3 3.750000000000000e+04
4 4 2.030769230769238e+05
4 5 2.884615384615386e+03
5 4 2.884615384615386e+03
4 6 -1.869230769230776e+05
6 4 -1.869230769230776e+05
4 7 3.750000000000000e+04
7 4 3.750000000000000e+04
4 8 -1.015384615384608e+05
8 4 -1.015384615384608e+05
5 5 9.807692307692344e+04
5 6 3.750000000000000e+04
6 5 3.750000000000000e+04
5 7 2.884615384615019e+03
7 5 2.884615384615019e+03
5 8 -2.884615384615388e+03
8 5 -2.884615384615388e+03
6 6 2.030769230769238e+05
6 7 2.884615384615387e+03
7 6 2.884615384615387e+03
6 8 8.538461538461463e+04
8 6 8.538461538461463e+04
7 7 1.000000000000000e+36
7 8 -3.749999999999999e+04
8 7 -3.749999999999999e+04
8 8 1.000000000000000e+36

```

---

<div class="post-metadata">

### Author: ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)
#### Post date: [January 4, 2024, 9:38am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/9 "2024-01-04T09:38:25Z")

</div>

R u sure the obtained stiffness matrix is for Plane strain analysis?.  
I am using element type = CPS4, which is Four-node plane stress element for this analysis.

---

<div class="post-metadata">

### Author: ![Disla](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/disla/32/3548_2.png) [@Disla](https://calculix.discourse.group/u/Disla)
#### Post date: [January 4, 2024, 9:52am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/10 "2024-01-04T09:52:22Z")

</div>

Do you have the input inp?. I would like to try something.

---

<div class="post-metadata">

### Author: ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)
#### Post date: [January 4, 2024, 10:04am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/11 "2024-01-04T10:04:28Z")

</div>

![SolidsPy_vs_Abaqus](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/d/d56f6b7ccc99c096adeb7e95e8fddad6a3b00a62.png)

The matrix value except the highlighted values from Abaqus matches with solidspy.

---

<div class="post-metadata">

### Author: ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)
#### Post date: [January 4, 2024, 10:05am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/12 "2024-01-04T10:05:27Z")

</div>

\*\*  
\*\* Heading +++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Heading  
Hash: 5oS75DSa, Date: 12/27/2023, Unit system: MM\_TON\_S\_C  
\*\*  
\*\* Nodes +++++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Node  
1, 0.00000000E+000, 0.00000000E+000  
2, 5.00000000E+000, 0.00000000E+000  
3, 5.00000000E+000, 2.00000000E+000  
4, 0.00000000E+000, 2.00000000E+000  
\*\*  
\*\* Elements ++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Element, Type=CPS4, Elset=Shell\_part-1  
1, 1, 2, 3, 4  
\*\*  
\*\* Node sets +++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Nset, Nset=Internal\_Selection-1\_Concentrated\_Force-1  
2, 3  
\*Nset, Nset=Internal\_Selection-1\_Displacement\_Rotation-1  
1, 4  
\*\*  
\*\* Element sets ++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Elset, Elset=Internal\_Selection-1\_Pshell  
Shell\_part-1  
\*\*  
\*\* Surfaces ++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* Physical constants ++++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* Materials +++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Material, Name=Steel  
\*Elastic  
210000, 0.3  
\*\*  
\*\* Sections ++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Solid section, Elset=Internal\_Selection-1\_Pshell, Material=Steel  
1  
\*\*  
\*\* Pre-tension sections ++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* Constraints +++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* Surface interactions ++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* Contact pairs +++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* Amplitudes ++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* Initial conditions ++++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* Steps +++++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* Step-1 ++++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Step  
\*Static  
\*\*  
\*\* Output frequency ++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Output, Frequency=1  
\*\*  
\*\* Boundary conditions +++++++++++++++++++++++++++++++++++++  
\*\*  
\*Boundary, op=New  
\*\* Name: Fixed  
\*Boundary  
Internal\_Selection-1\_Displacement\_Rotation-1, 1, 1, 0  
Internal\_Selection-1\_Displacement\_Rotation-1, 2, 2, 0  
\*\*  
\*\* Loads +++++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Cload, op=New  
\*Dload, op=New  
\*\* Name: Load  
\*Cload  
Internal\_Selection-1\_Concentrated\_Force-1, 1, 1000000  
\*\*  
\*\* Defined fields ++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* History outputs +++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*\*  
\*\* Field outputs +++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*Node file  
RF, U  
\*El file  
S, E  
\*\*  
\*\* End step ++++++++++++++++++++++++++++++++++++++++++++++++  
\*\*  
\*End step

\*NSET,NSET=N1  
1, 2, 3, 4  
\*STEP  
\*SUBSTRUCTURE GENERATE  
\*RETAINED NODAL DOFS,SORTED=NO  
N1,1,2  
\*SUBSTRUCTURE MATRIX OUTPUT,STIFFNESS=YES,OUTPUT FILE=USER DEFINED,FILE NAME=2D\_Rectangle\_prepomax\_concentrated\_load  
\*END STEP

---

<div class="post-metadata">

### Author: ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)
#### Post date: [January 4, 2024, 10:41am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/13 "2024-01-04T10:41:29Z")

</div>

> [@Anoop\_ng](#):
>
> except the highlighted values from Abaqus

Those are the fixed DOFs, apparently your matrix doesn’t account for BCs.

Actually, why are you using so large force for such a small model (2x5 mm) ?

---

<div class="post-metadata">

### Author: ![Disla](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/disla/32/3548_2.png) [@Disla](https://calculix.discourse.group/u/Disla)
#### Post date: [January 4, 2024, 10:42am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/14 "2024-01-04T10:42:07Z")

</div>

Is this is a good example for comparing stiffness matrices?.  
Both programs are far from satisfying the assumptions established by the element selection.  
The boundary conditions and element thickness do not satisfy Plane Stress and the extreme loads together with the Poissson ratio deliver a solution in wich the element is inverted.

 ![screenshot.12](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/c/cbe9d46ef847c31bb3d1341ca887d4dcb67af184.jpeg)

I would start with some suitable BC and load conditions.

---

<div class="post-metadata">

### Author: ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)
#### Post date: [January 4, 2024, 10:47am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/15 "2024-01-04T10:47:50Z")

</div>

The reason for using large force is to get displacements in the order greater than 10^0

---

<div class="post-metadata">

### Author: ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)
#### Post date: [January 4, 2024, 10:49am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/16 "2024-01-04T10:49:49Z")

</div>

Then maybe displacement control would be better. Because currently, you can’t e.g. enable NLGEOM in this preload step (it won’t converge).

---

<div class="post-metadata">

### Author: ![Anoop\_ng](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Anoop\_ng](https://calculix.discourse.group/u/Anoop_ng)
#### Post date: [January 4, 2024, 10:51am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/17 "2024-01-04T10:51:39Z")

</div>

The force applied won’t have effect on stiffness calculation right?, just it is necessary to calculate displacement. Please correct me if I am wrong.

---

<div class="post-metadata">

### Author: ![JuanP74](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@JuanP74](https://calculix.discourse.group/u/JuanP74)
#### Post date: [January 4, 2024, 10:52am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/18 "2024-01-04T10:52:48Z")

</div>

just change it to CPE4 and then you’ll see it…

---

<div class="post-metadata">

### Author: ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)
#### Post date: [January 4, 2024, 11:03am UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/19 "2024-01-04T11:03:50Z")

</div>

At least in Abaqus, matrix generation procedure can account for preload:

> Matrix generation:  
> …
> 
> - includes initial stress and load stiffness effects due to preloads and initial conditions if nonlinear geometric effects are included in the analysis

I’m pretty sure that CalculiX does the same.

Unfortunately, such comparisons can be tricky due to expansion of 2D elements to 3D ones in CalculiX.

---

<div class="post-metadata">

### Author: ![vicmw](https://avatars.discourse-cdn.com/v4/letter/v/6de8d8/32.png) [@vicmw](https://calculix.discourse.group/u/vicmw)
#### Post date: [January 4, 2024, 10:25pm UTC](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007/20 "2024-01-04T22:25:03Z")

</div>

How about start with a simpler case like a 3D element with no constraints? That eliminates the changes caused by 3D expansion and whether constraints are included in the output matrix or not. It looks like a lot of struggle to work out all those complicating factors in one go.

[Next page](https://calculix.discourse.group/t/discrepancy-in-element-stiffness-matrix-output-using-substructure-approach/2007.md?page=2)
