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 次查看(过去 30 天)
显示 更早的评论
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 个评论
Voss
2022-4-15
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)
回答(1 个)
Shivam
2023-11-27
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!