平面單元應(yīng)力求解
2017-03-28 by:CAE仿真在線 來源:互聯(lián)網(wǎng)
E=210000000;
v=0.28;
t=0.01;
%%%%%%各單元節(jié)點(diǎn)坐標(biāo)向量,各行分別表示x1 y1 x2 y2 x3 y3
GDYJDZB=[0,1,0,2/3,1/3,2/3;
0,1,1/3,2/3,1/3,1;
1/3,1,1/3,2/3,2/3,2/3;
1/3,1,2/3,2/3,2/3,1;
2/3,1,2/3,2/3,1,2/3;
2/3,1,1,2/3,1,1;
0,2/3,0,1/3,1/3,1/3;0,2/3,1/3,1/3,1/3,2/3;
1/3,2/3,1/3,1/3,2/3,1/3;1/3,2/3,2/3,1/3,2/3,2/3;
2/3,2/3,2/3,1/3,1,1/3;2/3,2/3,1,1/3,1,2/3;
0,1/3,0,0,1/3,0;0,1/3,1/3,0,1/3,1/3;
1/3,1/3,1/3,0,2/3,0;1/3,1/3,2/3,0,2/3,1/3;
2/3,1/3,2/3,0,1,0;2/3,1/3,1,0,1,1/3];
%%%%%%位移編號(hào),各行分別為u1 v1 u2 v2 u3 v3
WYBH=[0,0,0,0,7,8;0,0,7,8,1,2;
1,2,7,8,9,10;1,2,9,10,3,4;
3,4,9,10,11,12;3,4,11,12,5,6;
0,0,0,0,13,14;0,0,13,14,7,8;
7,8,13,14,15,16;7,8,15,16,9,10;
9,10,15,16,17,18;9,10,17,18,11,12;
0,0,0,0,19,20;0,0,19,20,13,14;
13,14,19,20,21,22;13,14,21,22,15,16;
15,16,21,22,23,24;15,16,23,24,17,18];
%%%%%%求各單元單元?jiǎng)偠染仃嚺c集成整體剛度矩陣
K=zeros(24);
for i=1:1:18
AA=[1,GDYJDZB(i,1),GDYJDZB(i,2);1,GDYJDZB(i,3),GDYJDZB(i,4);1,GDYJDZB(i,5),GDYJDZB(i,6)]
A=0.5*det(AA);
abc=det(AA)*inv(AA);%求矩陣AA各元素的代數(shù)余子式,得到ai bi ci
b=abc(:,2);c=abc(:,3)
B=1/det(AA)*[b(1),0,b(2),0,b(3),0;0,c(1),0,c(2),0,c(3);c(1),b(1),c(2),b(2),c(3),b(3)];
D=E/(1-v^2)*[1,v,0;v,1,0;0,0,(1-v)/2];
k=B'*D*B*t*A;%單元?jiǎng)偠染仃?br /> P=find(WYBH(i,:));
CC=WYBH(i,P);
K(CC,CC)=K(CC,CC) k(P,P);%整體剛度矩陣
end
WLXL=[0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]';%外力向量,規(guī)定:向右、向上為正方向
WY=K\WLXL; %求解位移,或者 WY=inv(K)*WLXL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DYJDL=[];DYYL=[];DYYB=[];
for i=1:1:18
U=[0,0,0,0,0,0]';
AA=[1,GDYJDZB(i,1),GDYJDZB(i,2);1,GDYJDZB(i,1),GDYJDZB(i,4);1,GDYJDZB(i,5),GDYJDZB(i,6)];
A=0.5*det(AA);
abc=det(AA)*inv(AA);%求矩陣AA各元素的代數(shù)余子式,得到ai bi ci
b=abc(:,2);c=abc(:,3);
B=1/det(AA)*[b(1),0,b(2),0,b(3),0;0,c(1),0,c(2),0,c(3);c(1),b(1),c(2),b(2),c(3),b(3)];
D=E/(1-v^2)*[1,v,0;v,1,0;0,0,(1-v)/2];
k=B'*D*B*t*A;%單元?jiǎng)偠染仃?br /> P=find(WYBH(i,:));
CC=WYBH(i,P);
U(P)=WY(CC);
yb=B*U;
DYYB=[DYYB yb];
yl=D*B*U;
DYYL=[DYYL yl];
f=k*U;
DYJDL=[DYJDL f];%各節(jié)點(diǎn)的力應(yīng)平衡
end
%%%%%%%%%%%%%%節(jié)點(diǎn)處應(yīng)力修正(取各單元均值)
jdljdy=[1,2,0,0,0,0;2,3,4,0,0,0;4,5,6,0,0,0;4,0,0,0,0,0;
1,7,8,0,0,0;1,2,3,8,9,10;3,4,5,10,11,12;5,6,12,0,0,0;
7,13,14,0,0,0;7,8,9,14,15,16;9,10,11,16,17,18;11,12,18,0,0,0;
13,0,0,0,0,0;13,14,15,0,0,0;15,16,17,0,0,0;17,18,0,0,0,0];
JDYL=[];
for i=1:1:16
P=find(jdljdy(i,:));
CC=jdljdy(i,P);
x=numel(P);
jdyl=sum(DYYL(:,CC),2)/x;
JDYL=[JDYL jdyl]
end
v=0.28;
t=0.01;
%%%%%%各單元節(jié)點(diǎn)坐標(biāo)向量,各行分別表示x1 y1 x2 y2 x3 y3
GDYJDZB=[0,1,0,2/3,1/3,2/3;
0,1,1/3,2/3,1/3,1;
1/3,1,1/3,2/3,2/3,2/3;
1/3,1,2/3,2/3,2/3,1;
2/3,1,2/3,2/3,1,2/3;
2/3,1,1,2/3,1,1;
0,2/3,0,1/3,1/3,1/3;0,2/3,1/3,1/3,1/3,2/3;
1/3,2/3,1/3,1/3,2/3,1/3;1/3,2/3,2/3,1/3,2/3,2/3;
2/3,2/3,2/3,1/3,1,1/3;2/3,2/3,1,1/3,1,2/3;
0,1/3,0,0,1/3,0;0,1/3,1/3,0,1/3,1/3;
1/3,1/3,1/3,0,2/3,0;1/3,1/3,2/3,0,2/3,1/3;
2/3,1/3,2/3,0,1,0;2/3,1/3,1,0,1,1/3];
%%%%%%位移編號(hào),各行分別為u1 v1 u2 v2 u3 v3
WYBH=[0,0,0,0,7,8;0,0,7,8,1,2;
1,2,7,8,9,10;1,2,9,10,3,4;
3,4,9,10,11,12;3,4,11,12,5,6;
0,0,0,0,13,14;0,0,13,14,7,8;
7,8,13,14,15,16;7,8,15,16,9,10;
9,10,15,16,17,18;9,10,17,18,11,12;
0,0,0,0,19,20;0,0,19,20,13,14;
13,14,19,20,21,22;13,14,21,22,15,16;
15,16,21,22,23,24;15,16,23,24,17,18];
%%%%%%求各單元單元?jiǎng)偠染仃嚺c集成整體剛度矩陣
K=zeros(24);
for i=1:1:18
AA=[1,GDYJDZB(i,1),GDYJDZB(i,2);1,GDYJDZB(i,3),GDYJDZB(i,4);1,GDYJDZB(i,5),GDYJDZB(i,6)]
A=0.5*det(AA);
abc=det(AA)*inv(AA);%求矩陣AA各元素的代數(shù)余子式,得到ai bi ci
b=abc(:,2);c=abc(:,3)
B=1/det(AA)*[b(1),0,b(2),0,b(3),0;0,c(1),0,c(2),0,c(3);c(1),b(1),c(2),b(2),c(3),b(3)];
D=E/(1-v^2)*[1,v,0;v,1,0;0,0,(1-v)/2];
k=B'*D*B*t*A;%單元?jiǎng)偠染仃?br /> P=find(WYBH(i,:));
CC=WYBH(i,P);
K(CC,CC)=K(CC,CC) k(P,P);%整體剛度矩陣
end
WLXL=[0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]';%外力向量,規(guī)定:向右、向上為正方向
WY=K\WLXL; %求解位移,或者 WY=inv(K)*WLXL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DYJDL=[];DYYL=[];DYYB=[];
for i=1:1:18
U=[0,0,0,0,0,0]';
AA=[1,GDYJDZB(i,1),GDYJDZB(i,2);1,GDYJDZB(i,1),GDYJDZB(i,4);1,GDYJDZB(i,5),GDYJDZB(i,6)];
A=0.5*det(AA);
abc=det(AA)*inv(AA);%求矩陣AA各元素的代數(shù)余子式,得到ai bi ci
b=abc(:,2);c=abc(:,3);
B=1/det(AA)*[b(1),0,b(2),0,b(3),0;0,c(1),0,c(2),0,c(3);c(1),b(1),c(2),b(2),c(3),b(3)];
D=E/(1-v^2)*[1,v,0;v,1,0;0,0,(1-v)/2];
k=B'*D*B*t*A;%單元?jiǎng)偠染仃?br /> P=find(WYBH(i,:));
CC=WYBH(i,P);
U(P)=WY(CC);
yb=B*U;
DYYB=[DYYB yb];
yl=D*B*U;
DYYL=[DYYL yl];
f=k*U;
DYJDL=[DYJDL f];%各節(jié)點(diǎn)的力應(yīng)平衡
end
%%%%%%%%%%%%%%節(jié)點(diǎn)處應(yīng)力修正(取各單元均值)
jdljdy=[1,2,0,0,0,0;2,3,4,0,0,0;4,5,6,0,0,0;4,0,0,0,0,0;
1,7,8,0,0,0;1,2,3,8,9,10;3,4,5,10,11,12;5,6,12,0,0,0;
7,13,14,0,0,0;7,8,9,14,15,16;9,10,11,16,17,18;11,12,18,0,0,0;
13,0,0,0,0,0;13,14,15,0,0,0;15,16,17,0,0,0;17,18,0,0,0,0];
JDYL=[];
for i=1:1:16
P=find(jdljdy(i,:));
CC=jdljdy(i,P);
x=numel(P);
jdyl=sum(DYYL(:,CC),2)/x;
JDYL=[JDYL jdyl]
end
開放分享:優(yōu)質(zhì)有限元技術(shù)文章,助你自學(xué)成才
相關(guān)標(biāo)簽搜索:平面單元應(yīng)力求解 MatLab培訓(xùn) MatLab培訓(xùn)課程 MatLab在線視頻教程 MatLab技術(shù)學(xué)習(xí)教程 MatLab軟件教程 MatLab資料下載 MatLab代做 MatLab基礎(chǔ)知識(shí) Fluent、CFX流體分析 HFSS電磁分析 Ansys培訓(xùn) Abaqus培訓(xùn)
編輯