Multidimensional Arrays Global stiff matrix
Afficher commentaires plus anciens
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)
Réponse acceptée
Plus de réponses (1)
Sulaymon Eshkabilov
le 8 Sep 2020
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
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!