Multidimensional Arrays Global stiff matrix
이전 댓글 표시
Do anyone know how to make a Multidimensional Arrays GSM, cause I have already make a 2x2 Local Stiff matrix. But I am confuse on make a GSM with for loop. And here is my code for LSM and vaeiables. Thank you

%Step 1 Discretize
%Assign Variables
E = young;
A = area;
L = leng;
F1 = F;
Num_elements = no_e;
l = L/Num_elements ;
K = E*A/l ;
%step 2 Local Behavior
% Form local stiffness Matrixes
LSM = zeros(2, 2, Num_elements);
for x=1: 1: Num_elements
LSM(1,1,x)= K(x,1);
LSM(1,2,x)= -K(x,1);
LSM(2,1,x)= -K(x,1);
LSM(2,2,x)= K(x,1);
end
%Step 3
%Assemble Global Stiffness Matrix (GSM)
채택된 답변
추가 답변 (1개)
Sulaymon Eshkabilov
2020년 9월 8일
Here is the GSM created in loops:
LSM(1,1)= K;
LSM(1,2)= -K;
LSM(2,1)= -K;
LSM(2,2)= K;
GSM = zeros(Num_elements);
for ii=1:Num_elements-1
ROW = ii + [0 1];
COL = ROW;
GSM(ROW, COL) = GSM(ROW, COL)+LSM;
end
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!