Creating Global Stiffness matrix

Hello,
I am quite noob in Matlab. I am trying to add two matrix to create a global stiffness matrx.
k1 =
10150000 -5000000 -3750000 2000000 -6400000 3000000
-5000000 12400000 3000000 -10000000 2000000 -2400000
-3750000 3000000 3750000 0 0 -3000000
2000000 -10000000 0 10000000 -2000000 0
-6400000 2000000 0 -2000000 6400000 0
3000000 -2400000 -3000000 0 0 2400000
k2 =
10150000 -5000000 -3750000 2000000 -6400000 3000000
-5000000 12400000 3000000 -10000000 2000000 -2400000
-3750000 3000000 3750000 0 0 -3000000
2000000 -10000000 0 10000000 -2000000 0
-6400000 2000000 0 -2000000 6400000 0
3000000 -2400000 -3000000 0 0 2400000
I will find a global stiffness matrix(K) (8X8). How can I find this matrix?

댓글 수: 5

the cyclist
the cyclist 2020년 7월 4일
Do you have any information on the formula you want to use to combine these matrices? You have given us two 6x6 matrices. (Actually, k1==k2, so really only one matrix.) How do you propose to make one 8x8 matrix out of two 6x6? I mean, conceptually, not in MATLAB. We can help you with the MATLAB part, if you help us with the conceptual part.
Alpha Boy
Alpha Boy 2020년 7월 4일
편집: Alpha Boy 2020년 7월 4일
K1 =
k2 =
I have to sum up 2X1 with 2X1, 2X5 with 2X5...
chitra lekha
chitra lekha 2021년 7월 21일
I am in the same platform as you
Daniyal Raja
Daniyal Raja 2022년 11월 24일
이동: the cyclist 2022년 11월 24일
sem question my g
Mohammad Hamad Sheikh
Mohammad Hamad Sheikh 2022년 11월 24일
dany boss wht u donig here

댓글을 달려면 로그인하십시오.

답변 (1개)

the cyclist
the cyclist 2020년 7월 5일

2 개 추천

If I've understood correctly, then
K = zeros(8);
vec1 = [1 2 3 4 7 8];
K(vec1,vec1) = K(vec1,vec1) + k1;
vec2 = [5 6 7 8 3 4];
K(vec2,vec2) = K(vec2,vec2) + k2;
gives what you want.
Because K starts out as all zeros, the addition with k1 could have been written
K(vec1,vec1) = k1;
but I thought it might be easier to see what was going on this way, and also that k1 and k2 are being treated symmetically.

댓글 수: 4

Alpha Boy
Alpha Boy 2020년 7월 5일
Yes, you are correct! But how can I do it in Matlab?
the cyclist
the cyclist 2020년 7월 5일
Uh, what? That is literally the exact MATLAB code to do it.
I'm assuming you've defined k1 and k2, such as
k1 =[
10150000 -5000000 -3750000 2000000 -6400000 3000000
-5000000 12400000 3000000 -10000000 2000000 -2400000
-3750000 3000000 3750000 0 0 -3000000
2000000 -10000000 0 10000000 -2000000 0
-6400000 2000000 0 -2000000 6400000 0
3000000 -2400000 -3000000 0 0 2400000];
k2 = [
10150000 -5000000 -3750000 2000000 -6400000 3000000
-5000000 12400000 3000000 -10000000 2000000 -2400000
-3750000 3000000 3750000 0 0 -3000000
2000000 -10000000 0 10000000 -2000000 0
-6400000 2000000 0 -2000000 6400000 0
3000000 -2400000 -3000000 0 0 2400000];
Ruairi Kavanagh
Ruairi Kavanagh 2023년 4월 23일
how would i would i change this code if i had 8 matrices fo 4x4 that needed to fit into a 6x6 matrix

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

질문:

2020년 7월 4일

댓글:

2023년 4월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by