Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


3 Pages123>
Options
Go to last post Go to first unread
Offline EngMath  
#1 Posted : 29 May 2021 19:07:09(UTC)
EngMath


Rank: Advanced Member

Groups: Registered
Joined: 18/10/2020(UTC)
Posts: 50
Poland

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.

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline EngMath  
#2 Posted : 29 May 2021 20:39:20(UTC)
EngMath


Rank: Advanced Member

Groups: Registered
Joined: 18/10/2020(UTC)
Posts: 50
Poland

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 (41kb) downloaded 101 time(s).
Online overlord  
#3 Posted : 29 May 2021 23:19:17(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,126
Turkey

Was thanked: 507 time(s) in 338 post(s)
Originally Posted by: EngMath Go to Quoted Post
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 (41kb) downloaded 101 time(s).

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 (59kb) downloaded 44 time(s).

2021-05-29_23-16.png

2021-05-29_23-54.png

Edited by user 29 May 2021 23:55:33(UTC)  | Reason: Not specified

thanks 2 users thanked overlord for this useful post.
on 30/05/2021(UTC),  on 30/05/2021(UTC)
Offline Razonar  
#4 Posted : 30 May 2021 00:11:08(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi. As Overlord says, there are an algorithmic way. You can try it also.

Stiffness matrix.sm (34kb) downloaded 72 time(s).

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 30/05/2021(UTC)
Offline EngMath  
#5 Posted : 30 May 2021 01:08:14(UTC)
EngMath


Rank: Advanced Member

Groups: Registered
Joined: 18/10/2020(UTC)
Posts: 50
Poland

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.
Offline Razonar  
#6 Posted : 30 May 2021 02:02:54(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi. Check alg(#,#,#) and minor(#,#,#), both are in the matrix toolbar.

Best regards.
Alvaro.
Online overlord  
#7 Posted : 30 May 2021 02:36:09(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,126
Turkey

Was thanked: 507 time(s) in 338 post(s)
Originally Posted by: EngMath Go to Quoted Post
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 (46kb) downloaded 37 time(s).

2021-05-30_02-32.png

Edited by user 30 May 2021 02:41:22(UTC)  | Reason: Not specified

Offline Jean Giraud  
#8 Posted : 30 May 2021 03:19:05(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Razonar Go to Quoted Post
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.

Online overlord  
#9 Posted : 30 May 2021 03:25:02(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,126
Turkey

Was thanked: 507 time(s) in 338 post(s)
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 (54kb) downloaded 45 time(s).

2021-05-30_03-22.png
thanks 1 user thanked overlord for this useful post.
on 30/05/2021(UTC)
Offline Alvaro Gavilán  
#10 Posted : 30 May 2021 14:44:11(UTC)
Alvaro Gavilán


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2020(UTC)
Posts: 65
Man
Paraguay
Location: France

Was thanked: 25 time(s) in 16 post(s)
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 (138kb) downloaded 68 time(s).

02 - 2-element bar: 02-BARRAS DE 3 ELEMENTOS.sm (55kb) downloaded 57 time(s).

03 - trusses: 03-ARMADURAS.sm (125kb) downloaded 55 time(s).

04 - 1-element frame: 04-PORTICO DE 1 BARRA.sm (59kb) downloaded 45 time(s).

05 - 2-element frame: 05-PORTICO DE 2 BARRAS.sm (61kb) downloaded 50 time(s).

06 - 3-element frame: 06-PORTICO DE 3 BARRAS.sm (66kb) downloaded 63 time(s).

07 - plates: 07-PLACAS.sm (133kb) downloaded 58 time(s).

08 - axisymmetry: 08-AXISIMETRIA.sm (394kb) downloaded 49 time(s).

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

Edited by user 30 May 2021 17:34:53(UTC)  | Reason: add image

thanks 3 users thanked Alvaro Gavilán for this useful post.
on 30/05/2021(UTC),  on 30/05/2021(UTC),  on 30/05/2021(UTC)
Offline EngMath  
#11 Posted : 30 May 2021 14:56:26(UTC)
EngMath


Rank: Advanced Member

Groups: Registered
Joined: 18/10/2020(UTC)
Posts: 50
Poland

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.
Offline Alvaro Gavilán  
#12 Posted : 30 May 2021 15:25:44(UTC)
Alvaro Gavilán


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2020(UTC)
Posts: 65
Man
Paraguay
Location: France

Was thanked: 25 time(s) in 16 post(s)
Great! Glad it helped! I made some quick translations to my plate worksheet.

07-PLATES.sm (136kb) downloaded 51 time(s).

07-PLATES.pdf (503kb) downloaded 55 time(s).

07-PLATES (with code).pdf (541kb) downloaded 66 time(s).
thanks 1 user thanked Alvaro Gavilán for this useful post.
on 30/05/2021(UTC)
Offline EngMath  
#13 Posted : 30 May 2021 16:18:15(UTC)
EngMath


Rank: Advanced Member

Groups: Registered
Joined: 18/10/2020(UTC)
Posts: 50
Poland

Great, thanks Alvaro :-) Are these examples from some book ?
Offline Alvaro Gavilán  
#14 Posted : 30 May 2021 17:38:32(UTC)
Alvaro Gavilán


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2020(UTC)
Posts: 65
Man
Paraguay
Location: France

Was thanked: 25 time(s) in 16 post(s)
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
thanks 1 user thanked Alvaro Gavilán for this useful post.
on 30/05/2021(UTC)
Offline mkraska  
#15 Posted : 30 May 2021 19:47:20(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
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 (81kb) downloaded 52 time(s).
Fachwerk UE2.png
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 30/05/2021(UTC)
Offline Jean Giraud  
#16 Posted : 31 May 2021 15:02:39(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: EngMath Go to Quoted Post
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
Offline Jean Giraud  
#17 Posted : 31 May 2021 16:41:02(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
might be automated.

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


Insert.PNG
Offline wb.c  
#18 Posted : 20 April 2022 01:13:30(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 135
United States

Was thanked: 22 time(s) in 19 post(s)
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
Offline Alvaro Gavilán  
#19 Posted : 20 April 2022 11:38:23(UTC)
Alvaro Gavilán


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2020(UTC)
Posts: 65
Man
Paraguay
Location: France

Was thanked: 25 time(s) in 16 post(s)
Originally Posted by: wb.c Go to Quoted Post
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 Biggrin )

Regards!

Alvaro

Element stiffness - beam.sm (25kb) downloaded 51 time(s). Element stiffness - demonstration.pdf (2,395kb) downloaded 49 time(s).

Edited by user 21 April 2022 12:32:00(UTC)  | Reason: Corrected stiffness matrices

thanks 5 users thanked Alvaro Gavilán for this useful post.
on 20/04/2022(UTC),  on 20/04/2022(UTC),  on 20/04/2022(UTC),  on 20/04/2022(UTC),  on 21/04/2022(UTC)
Offline wb.c  
#20 Posted : 20 April 2022 19:52:32(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 135
United States

Was thanked: 22 time(s) in 19 post(s)
Originally Posted by: Alvaro Gavilá Go to Quoted Post

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 Biggrin )

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 (101kb) downloaded 65 time(s).

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.
Users browsing this topic
Guest
3 Pages123>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.