I just need to know what does i, j represent in K(i,j) other than representing the row and column of the Sparse Matrix K?
4 views (last 30 days)
Show older comments
for elx = 1:nelx
for ely = 1:nely
n1 = (nely+1)*(elx-1)+ely;
n2 = (nely+1)* elx +ely;
edof = [2*n1-1; 2*n1; 2*n2-1; 2*n2; 2*n2+1; 2*n2+2; 2*n1+1; 2*n1+2];
K(edof,edof) = K(edof,edof) + x(ely,elx)^penal*KE;
end
end
As we are feeding the K here the whole dof matrix containing the degree of freedom of all the node of an element at once. How is it creating? Like for 1st element, the node numbers will be 1, 5, 6 and 2 in a cloclwise way from top left to right, where n1 and n2 represt 1 and 5, and 2 and 6 respectively?
2 Comments
Voss
on 15 Apr 2022
Construct a similar/simpler case on the command line or in another script, and see what happens
K = magic(6)
n1 = 1;
n2 = 2;
edof = [2*n1-1; 2*n1; 2*n2-1; 2*n2; 2*n2+1; 2*n2+2; 2*n1+1; 2*n1+2]
K(edof,edof)
Answers (1)
Shivam
on 27 Nov 2023
Hi,
From the code snippet provided, I understand that you want to know the meaning of indices 'i' and 'j' while indexing into the global stiffness sparse matrix, K.
In the Finite Element Method context, the global stiffness matrix K is a sparse matrix that stores the relationship between the applied forces and resulting nodal displacement in the system. The entry K(i, j) represents the force at the degree of freedom 'i' due to displacement at the degree of freedom 'j,' while all other displacements are zero.
I hope it helps.
0 Comments
See Also
Categories
Find more on Sparse Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!