cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Insert a matrix into a larger matrix at certain positions Stiffness matrix

QS_10727930
4-Participant

Insert a matrix into a larger matrix at certain positions Stiffness matrix

Hello community!


I request your help with the following: I want to enter a matrix into a larger one.
I’m working on assembling a global stiffness matrix of a structure (truss)
I have defined the matrices of each element. The matrix of the element is 4x4, "i"= 1 to "n", n: number of elements

QS_10727930_0-1688132919627.png

I have an auxiliary matrix that defines in each row the degrees of freedom associated with each element. For example row 1 contains the degrees of freedom of element 1 and so on. I named this matrix GDL

 

QS_10727930_1-1688132985443.png

 

What I want is for Mathcad to grab the matrix of each element and place it in the global matrix at the positions corresponding to the columns and rows that indicate the row of the auxiliary matrix GDL. For example the stiffness matrix of element 3 must be placed in rows and columns numbers 1, 2,5 y 6 of the global matrix.

I understand that once the correct routine is created I would have to use a FOR cycle to do it for each element. But at the moment I’m trying to test with only one element

 

Very grateful in advance for your guidance

 

 

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:QS_10727930)

Yes 4x4, not 2x2 as I accidentally wrote.

 

So I guess that this should do the job:

Werner_E_2-1688144520594.png

 

Werner_E_1-1688144294230.png

 

Prime 9 worksheet attached

 

 

View solution in original post

8 REPLIES 8
Werner_E
25-Diamond I
(To:QS_10727930)

Can you manually create as an example the desired matrix to show what you actually want to see as a result?

Whats the dimension of the resulting matrix? 8x8 as the matrix K or rather 32x32 as at every position of K there has to be placed one of the 4x4 k(i) matrices?

If yes, should it be a nested matrix the elements are 4x4 matrices or should it be rather a plain 32x32 matrix?

QS_10727930
4-Participant
(To:Werner_E)

For example the matrix of element 3 would have to be placed in columns and rows 1,2,5 and 6

It would look like this:

 

This is element stiffness matrix 3: QS_10727930_0-1688140380080.png

 

This is its position in the global matrix:

 

QS_10727930_1-1688140449306.png

 

At the end the global stiffness matrix should look like this:

QS_10727930_2-1688141205672.png

 

 

 

 

 

 

 

 

 

 

Werner_E
25-Diamond I
(To:QS_10727930)

OK, it gets clearer!

Just to be on the safe side - The matrix GDL is always a square matrix because the number elements (e) is always the same as the number of nodes (N), correct?

And the matrices k(i) are always just 2x2 matrices?

 

Basically I can think of two ways to write a program to do the job. Either running throug all columns and rows (both of K and the k(i)) with nested loops, or using the submatrix() function to split the large matrix into parts and reassemble it using stack() and augment().

I guess the first approach might be the most forward.

 

QS_10727930
4-Participant
(To:Werner_E)

The matrix of each element will always be 4x4

The matrix of degrees of freedom (GDL) will always be square is correct. Because each element has 4 degrees of freedom. In the matrix of degrees of freedom in each row appear the numbers of degrees of freedom associated with that element.

Werner_E
25-Diamond I
(To:QS_10727930)

Yes 4x4, not 2x2 as I accidentally wrote.

 

So I guess that this should do the job:

Werner_E_2-1688144520594.png

 

Werner_E_1-1688144294230.png

 

Prime 9 worksheet attached

 

 

QS_10727930
4-Participant
(To:Werner_E)

Thank you so much!!!

Hi

Check section 2.4 of enclosed sheet for assembly of stiffness matrix from elemental stiffnesses

 

Capture.JPG

Thank you!

Announcements

Top Tags