Assembling stiffness matrices

Assembling stiffness matrices - Сообщения

#1 Опубликовано: 29.05.2021 13:07:09
EngMath

EngMath

0 сообщений из 51 понравились пользователям.

Группа: User

Hi,

I have two local stiffness matrices (6x6) calculated in SMath. Now I want to assemble them into a single global stiffness matrix (8x8):



Red numbers represent degrees of freedom. The assemblage is done in such a way that terms from these two local matrices which correspond to the same degree of freedom have to be added. So for example I take the term 5-5 (column numbered as 5 and row numbered as 5) from k1 and add it to the term 5-5 from k2. The problem is that these terms are located in different parts of the matrices. For example aforementioned term 5-5 is actually in the 3rd column and 3rd row of the first matrix, in the 5th column and 5th row of the second matrix and goes to the same place (5th column, 5th row) of the global matrix. Of course I can do it manually but it's a lot of work for larger matrices (even here it takes some time). Is there an automated way to do it in SMath ?

Thanks in advance for your help.
#2 Опубликовано: 29.05.2021 14:39:20
EngMath

EngMath

0 сообщений из 51 понравились пользователям.

Группа: User

Thanks for reply. I've seen this sample. It's really great but I'm not sure how to proceed in my case. I attached the .sm file.

Stiffness matrix.sm (40 КиБ) скачан 175 раз(а).
#3 Опубликовано: 29.05.2021 17:19:17
overlord

overlord

554 сообщений из 1333 понравились пользователям.

Группа: Moderator

Wrote

Thanks for reply. I've seen this sample. It's really great but I'm not sure how to proceed in my case. I attached the .sm file.

Stiffness matrix.sm (40 КиБ) скачан 175 раз(а).


There should be two ways for three methods I could think of.
I won't add algorithm style here, these are enough I guess.
You can also combine method1 and method2 but I wouldn't call this a new way.

Regards

Stiffness matrix_rev.sm (58 КиБ) скачан 98 раз(а).

2021-05-29_23-16.png

2021-05-29_23-54.png
2 пользователям понравился этот пост
EngMath 30.05.2021 08:57:00, sergio 30.05.2021 12:06:00
#4 Опубликовано: 29.05.2021 18:11:08
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: User

Hi. As Overlord says, there are an algorithmic way. You can try it also.

Stiffness matrix.sm (33 КиБ) скачан 135 раз(а).

Best regards.
Alvaro.
1 пользователям понравился этот пост
sergio 30.05.2021 12:06:00
#5 Опубликовано: 29.05.2021 19:08:14
EngMath

EngMath

0 сообщений из 51 понравились пользователям.

Группа: User

Thank you very much. After the assembly, selected rows and columns of the global stiffness matrix have to be removed to account for boundary conditions. For example I would like to delete columns 1-4 and rows 1-4. So far I was just manually rewriting remaining terms to new matrix (K_new) but again it's quite tedious work. What's the best way to do it automatically in SMath ? Column and row numbers for deletion are not always ordered like that. For example it could be 2 an 5-8 as well.
#6 Опубликовано: 29.05.2021 20:02:54
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: User

Hi. Check alg(#,#,#) and minor(#,#,#), both are in the matrix toolbar.

Best regards.
Alvaro.
#7 Опубликовано: 29.05.2021 20:36:09
overlord

overlord

554 сообщений из 1333 понравились пользователям.

Группа: Moderator

Wrote

Thank you very much. After the assembly, selected rows and columns of the global stiffness matrix have to be removed to account for boundary conditions. For example I would like to delete columns 1-4 and rows 1-4. So far I was just manually rewriting remaining terms to new matrix (K_new) but again it's quite tedious work. What's the best way to do it automatically in SMath ? Column and row numbers for deletion are not always ordered like that. For example it could be 2 an 5-8 as well.


Is this what you are wishing to accomplish?
Specified rows and columns automatically removed from matrix.
There are also matrix extension commands to remove columns and rows.
But I wanted to write those functions without extension.

Regards

PS: If you want to see the results without removal,
assigning rowsdel=[9] and colsdel=[9] shall be enough.
The rowsdel and colsdel should always be a vector.

Stiffness matrix_rev2.sm (45 КиБ) скачан 84 раз(а).

2021-05-30_02-32.png
#8 Опубликовано: 29.05.2021 21:19:05
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Check alg(#,#,#) and minor(#,#,#), both are in the matrix toolbar.


They are both resident since my first SS 5346
duplicate of vminor from f(x) menu and duplicate of panel Minor,
as exemplified in disambiguation from Samples document.

#9 Опубликовано: 29.05.2021 21:25:02
overlord

overlord

554 сообщений из 1333 понравились пользователям.

Группа: Moderator

Better removal for columns and rows added, algorithm rewritten.
And much more conventional way for not removal implemented.
Entering zero for not remove wanted row or col is easier.

Regards

Stiffness matrix_rev3.sm (53 КиБ) скачан 91 раз(а).

2021-05-30_03-22.png
1 пользователям понравился этот пост
EngMath 30.05.2021 08:57:00
#10 Опубликовано: 30.05.2021 08:44:11
Alvaro Gavilán

Alvaro Gavilán

25 сообщений из 68 понравились пользователям.

Группа: User

Hi EngMath! I have some documents that I used for my Finite Element Method course. I automatized that assembly task. Attached here:

01 - 1-element bar: 01-BARRAS DE 2 ELEMENTOS.sm (137 КиБ) скачан 118 раз(а).

02 - 2-element bar: 02-BARRAS DE 3 ELEMENTOS.sm (54 КиБ) скачан 113 раз(а).

03 - trusses: 03-ARMADURAS.sm (124 КиБ) скачан 101 раз(а).

04 - 1-element frame: 04-PORTICO DE 1 BARRA.sm (58 КиБ) скачан 100 раз(а).

05 - 2-element frame: 05-PORTICO DE 2 BARRAS.sm (60 КиБ) скачан 102 раз(а).

06 - 3-element frame: 06-PORTICO DE 3 BARRAS.sm (65 КиБ) скачан 112 раз(а).

07 - plates: 07-PLACAS.sm (132 КиБ) скачан 109 раз(а).

08 - axisymmetry: 08-AXISIMETRIA.sm (393 КиБ) скачан 100 раз(а).

In all of them you will find my algorithm for the assembly task. You will find also the reduced stiffness matrix, I created functions to delete specific rows and columns.

Documents {01,02}, {04,05,06} are the same, only with different number of rows (I created those this way to use it quickly in the SS Android version).

Screenshot 2021-05-30 075710.png
3 пользователям понравился этот пост
sergio 30.05.2021 15:41:00, Alvaro Diaz Falconi 30.05.2021 12:54:00, EngMath 30.05.2021 08:57:00
#11 Опубликовано: 30.05.2021 08:56:26
EngMath

EngMath

0 сообщений из 51 понравились пользователям.

Группа: User

I combined this with previous code for matrix assembly and it works great.

Thanks again, you guys are awesome, you really helped me a lot. And thank you Alvaro for sharing your FEM implementations in SMath. The 7th one (plates) is just what I'm working on now.
#12 Опубликовано: 30.05.2021 09:25:44
Alvaro Gavilán

Alvaro Gavilán

25 сообщений из 68 понравились пользователям.

Группа: User

Great! Glad it helped! I made some quick translations to my plate worksheet.

07-PLATES.sm (135 КиБ) скачан 101 раз(а).

07-PLATES.pdf (502 КиБ) скачан 117 раз(а).

07-PLATES (with code).pdf (540 КиБ) скачан 126 раз(а).
1 пользователям понравился этот пост
EngMath 30.05.2021 10:18:00
#13 Опубликовано: 30.05.2021 10:18:15
EngMath

EngMath

0 сообщений из 51 понравились пользователям.

Группа: User

Great, thanks Alvaro :-) Are these examples from some book ?
#14 Опубликовано: 30.05.2021 11:38:32
Alvaro Gavilán

Alvaro Gavilán

25 сообщений из 68 понравились пользователям.

Группа: User

You're welcome EngMath! Yes, they are from Introduction to Finite Elements in Engineering by Chandrupatla and Belegundu.
You can download it here:
https://1drv.ms/b/s!Ap2rcjsf-xok1woTCf8p26Qpw5Hn?e=SkhCnB
1 пользователям понравился этот пост
EngMath 30.05.2021 12:58:00
#15 Опубликовано: 30.05.2021 13:47:20
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

This example shows the use of an index vector (f, contains the unconstrained dofs) for reduction of the global system.

The input is via dof and connectivity tables.

Each bar element has 4 dofs defined by a line in the connectivity matrix
Each global dof is a line in the dof matrix with each containing

- initial position
- external nodal load
- constraint flag (1-constrained, 0-free)
- prescribed displacement (only relevant if dof is constrained, can be nonzero)


Fachwerk UE2.sm (80 КиБ) скачан 110 раз(а).
Fachwerk UE2.png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
sergio 30.05.2021 15:40:00
#16 Опубликовано: 31.05.2021 09:02:39
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Red numbers represent degrees of freedom. The assemblage is done in such a way that terms from these two local matrices which correspond to the same degree of freedom have to be added. So for example I take the term 5-5 (column numbered as 5 and row numbered as 5) from k1 and add it to the term 5-5 from k2. The problem is that these terms are located in different parts of the matrices. For example aforementioned term 5-5 is actually in the 3rd column and 3rd row of the first matrix, in the 5th column and 5th row of the second matrix and goes to the same place (5th column, 5th row) of the global matrix. Of course I can do it manually but it's a lot of work for larger matrices (even here it takes some time). Is there an automated way to do it in SMath ?


Stifness matrix is not my discipline.
From square/rectangular matrix ...
You can extract paired symmetric [5,5] or asymmetric [2,5] col/row.
Extract...single col, single row.
You can delete pair wise single col/row or any cols/rows in any combination.
You can delete only col or only row.
Once in hand the new matrix, you can insert valued col or row
or col & row anywhere in the new matrix.
That step is one by one at this point of my proposal, might be automated.
All that from minimalist handling matrix.
Your 'K' matrices don't speak to me ... more visible example would help.
Cheers ... Jean
#17 Опубликовано: 31.05.2021 10:41:02
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

might be automated.


... ½ automated left for clic/clic/DONE gurus.


Insert.PNG
#18 Опубликовано: 19.04.2022 19:13:30
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

Any ideas on how to integrate internal releases into the 2D Frame stiffness matrices?

2022-04-19 18_07_29-9780128117088.pdf - Adobe Acrobat Reader DC (32-bit).png

Seems to be a few 2D truss projects, and some 2D Frame projects, but I'm curious about internal releases for frame structures.
Maybe someone can save me a deep dive into my old text books.
Thanks
#19 Опубликовано: 20.04.2022 05:38:23
Alvaro Gavilán

Alvaro Gavilán

25 сообщений из 68 понравились пользователям.

Группа: User

Wrote

Any ideas on how to integrate internal releases into the 2D Frame stiffness matrices?



Screenshot 2022-04-21 113007.png

Here I attach the other elementary stiffness matrices. I didn't tested these in FE programs (always worked with rigid-rigid ends in FE), but when I was student of indeterminate structures (displacement method) I did some demonstrations of stiffness factors for each case, and these are well verified (except for the last page, that I wrote a few minutes ago just to complete the case of unitary rotation about the hinge (not needed for displacement method)).

Having in mind that the k(i,j) element of an elementary stiffness matrix is the reaction value in the j-displacement direction caused by an i-unitary displacement, you could trace each of the values found in my demonstrations.

Hope it works for you and please comment if it did once you have implemented it into your code.

I attach those demonstrations too (in spanish, but structural mechanics is a universal language :d )

Regards!

Alvaro

Файл не найден.Файл не найден.
5 пользователям понравился этот пост
sergio 20.04.2022 06:36:00, NDTM Amarasekera 20.04.2022 11:22:00, Alvaro Diaz Falconi 20.04.2022 12:36:00, Wesly Centerwall 20.04.2022 13:40:00, churichuro 20.04.2022 18:36:00
#20 Опубликовано: 20.04.2022 13:52:32
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

Wrote


Here I attach the other elementary stiffness matrices. I didn't tested these in FE programs (always worked with rigid-rigid ends in FE), but when I was student of indeterminate structures (displacement method) I did some demonstrations of stiffness factors for each case, and these are well verified (except for the last page, that I wrote a few minutes ago just to complete the case of unitary rotation about the hinge (not needed for displacement method)).

Having in mind that the k(i,j) element of an elementary stiffness matrix is the reaction value in the j-displacement direction caused by an i-unitary displacement, you could trace each of the values found in my demonstrations.

Hope it works for you and please comment if it did once you have implemented it into your code.

I attach those demonstrations too (in spanish, but structural mechanics is a universal language :d )

Regards!

Alvaro



This worked perfectly, thanks Alvaro! For now I just added an extra vector that set a condition for each member and had the stiffness and transformation matrix builder you have in your example cycle through an if statement to decide which stiffness matrix was used for each member as the total stiffness matrix is built. Attached is the modified version of your 3-beam frame example, which technically could be used for any number of beams.
I verified the results in the attached file with some 2D structural analysis software and it appears to be correct correct. Take a look and let me know. I'm sure there are more systematic ways of accomplishing this, but as a proof of concept, I'm happy with the results.

Working Stiffness Matrix Idea - Internal Releases.sm (100 КиБ) скачан 127 раз(а).

Now I just need to blend some of the graphical and data input ideas from other users and make this a more functional mini 2Dstructural analysis tool. Would be nice to get working standalone exe via SMath Viewer.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений