FEM-Course-Matlab/10.四节点八节点四边形单元悬臂梁的Matlab有限元编程/4_nodes/UniLoad.m

16 lines
621 B
Matlab
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function Pe=UniLoad(ie,N_ID_p1,q0,Nodes,Elements,t) % 3级子程序分布荷载等效为结点荷载
% q0=1000;%1kN/m
s = [-sqrt(1/3) sqrt(1/3)]; % 2*2 高斯积分点
ENodes = N_ID_p1(ie,:); %获取单元结点号
Pe=zeros(8,1); %生成临时单元节点力零列向量
x1=Nodes(ENodes(1),1);
x6=Nodes(ENodes(4),1);
L16=abs(x6-x1); %单元长度
for i=1:2 %用于高斯积分的求和循环
N_q=ShapeFun(s(i),1); % 4级子程序ShapeFun(s(i),1)
q_x=q0;
Pe=Pe+N_q'*q_x*[0;L16/2]*t; %均布形荷载梯形面积
end
end