42 lines
1.1 KiB
Matlab
42 lines
1.1 KiB
Matlab
function ang_incr = elemAngleIncr(Elem,U,d_U)
|
|
% 前一构型的位移=当前构型下的初始位移=当前荷载步的初始位移
|
|
U_0 = U - d_U;
|
|
|
|
% 当前荷载步的初始节点位移
|
|
dx1_0 = U_0(Elem.n1.dof(1));
|
|
dy1_0 = U_0(Elem.n1.dof(2));
|
|
dx2_0 = U_0(Elem.n2.dof(1));
|
|
dy2_0 = U_0(Elem.n2.dof(2));
|
|
|
|
% 当前荷载步的初始节点坐标
|
|
x1_0 = Elem.n1.x + dx1_0;
|
|
y1_0 = Elem.n1.y + dy1_0;
|
|
x2_0 = Elem.n2.x + dx2_0;
|
|
y2_0 = Elem.n2.y + dy2_0;
|
|
|
|
% 当前荷载步初始单元轴向向量
|
|
vx_0 = [x2_0-x1_0, y2_0-y1_0, 0];
|
|
|
|
% 当前迭代步更新后的新的节点位移
|
|
dx1_1 = U(Elem.n1.dof(1));
|
|
dy1_1 = U(Elem.n1.dof(2));
|
|
dx2_1 = U(Elem.n2.dof(1));
|
|
dy2_1 = U(Elem.n2.dof(2));
|
|
|
|
%当前迭代步更新后的新的节点坐标
|
|
x1_1 = Elem.n1.x + dx1_1;
|
|
y1_1 = Elem.n1.y + dy1_1;
|
|
x2_1 = Elem.n2.x + dx2_1;
|
|
y2_1 = Elem.n2.y + dy2_1;
|
|
|
|
% 当前迭代步更新后的新的轴向向量
|
|
vx_1 = [x2_1-x1_1, y2_1-y1_1, 0];
|
|
|
|
% 角度增量
|
|
dir = cross(vx_0,vx_1);
|
|
ang_incr = atan2(norm(dir),dot(vx_0,vx_1));
|
|
|
|
% 角度转动方向
|
|
s = sign(dir(3));
|
|
ang_incr = s * ang_incr;
|
|
end |