27 lines
1.1 KiB
Matlab
27 lines
1.1 KiB
Matlab
function [Kt,Elem] = tangStiffMtxUL(Model,Anl,Elem,U)
|
|
%根据位移向量更新节点位置后得到的单元刚度矩阵
|
|
Kt = zeros(Model.neq,Model.neq);
|
|
for i = 1:Model.nel
|
|
% Elastic, geometric and tangent stiffness matrices
|
|
ke = elasticStiffMtxUL(Elem(i),U);%U影响节点坐标进而影响单元长度
|
|
kg = geometricStiffMtxUL(Anl,Elem(i),U);
|
|
kt = ke + kg;
|
|
% Store elastic stiffness matrix to be used in computation of internal forces
|
|
Elem(i).ke = ke;
|
|
% Rotation matrix from local to global coordinate system
|
|
angle = elemAngle(Elem(i),U);%%U影响节点坐标进而影响单元角度
|
|
c = cos(angle);
|
|
s = sin(angle);
|
|
rot = [ c -s 0 0 0 0;
|
|
s c 0 0 0 0;
|
|
0 0 1 0 0 0;
|
|
0 0 0 c -s 0;
|
|
0 0 0 s c 0;
|
|
0 0 0 0 0 1 ];
|
|
% Tangent stiffness matrix in global system
|
|
k = rot * kt * rot';
|
|
% Assemble element matrix to global matrix
|
|
gle = Elem(i).gle;
|
|
Kt(gle,gle) = Kt(gle,gle) + k;
|
|
end
|
|
end |