FEM-Course-Matlab/16.几何非线性有限元matlab编程/几何非线性有限元-悬臂梁/elemAngle.m

21 lines
476 B
Mathematica
Raw Normal View History

2024-01-28 16:46:36 +00:00
%==========================================================================
function angle = elemAngle(Elem,U)
% Element nodes
N1 = Elem.n1;
N2 = Elem.n2;
% Nodal displacements
dx1 = U(N1.dof(1));
dy1 = U(N1.dof(2));
dx2 = U(N2.dof(1));
dy2 = U(N2.dof(2));
% New nodal coordinates
x1 = N1.x + dx1;
y1 = N1.y + dy1;
x2 = N2.x + dx2;
y2 = N2.y + dy2;
% Element angle with global axes
angle = atan2(y2-y1,x2-x1);
end