- 积分
- 1
- 注册时间
- 2008-3-11
- 仿真币
-
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2010-7-3 18:59:44
|
显示全部楼层
来自 北京海淀
clear
syms x y cofx cofe;
%corner node 1,2,3,4 shape function
Ni=1/4*(1+cofx*x)*(1+cofe*y)*(cofx*x+cofe*y-1);
N1=subs(Ni,{cofx,cofe},{-1,-1});
N2=subs(Ni,{cofx,cofe},{1,-1});
N3=subs(Ni,{cofx,cofe},{1,1});
N4=subs(Ni,{cofx,cofe},{-1,1});
%middle node 5,6,7,8 shape function
N5=1/2*(1-x^2)*(1-y);
N6=1/2*(1-y^2)*(1+x);
N7=1/2*(1-x^2)*(1+y);
N8=1/2*(1-y^2)*(1-x);
%Nsh is composed by shape functions
%Nsh=[0 N1 0 N2 0 N3 0 N4 0 N5 0 N6 0 N7 0 N8;N1 0 N2 0 N3 0 N4 0 N5 0 N6 0 N7 0 N8 0]
%We can simply vertify through u or v degree of freedom
Nsh=[N1 N2 N3 N4 N5 N6 N7 N8];
Masstr=Nsh.' * Nsh;
ngas=2;
posg=sym(zeros(1,ngas));
weig=sym(zeros(1,ngas));
if(ngas==2)
posg(1)=-1/sqrt(3);
weig(1)=1;
%nags=3,just thinking this two suitation
else
posg(1:2)=[-sqrt(3/5) 0];
weig(1:2)=[5/9 8/9];
end
kgas=floor(ngas./2);
for ig=1:kgas
jg=ngas+1-ig;
posg(jg)=-posg(ig);
weig(jg)=weig(ig);
end
Massst=sym(zeros(length(Masstr)));
Massco=Massst;
for ig=1:ngas
for jg=1:ngas
Massst=subs(Masstr,{x,y},{posg(ig),posg(jg)});
Massco = Massco + weig(ig) .* weig(jg) .* Massst;
end
end
Massco=simplify(Massco);
vs=sym(zeros(1,length(Massco)));
for i=1:length(Massco), vs(i) = Massco(i,i); end
sum(vs) .\ vs
经pasuka的指点,用2*2节点高斯积分得出结果[ 1/36, 1/36, 1/36, 1/36, 2/9, 2/9, 2/9, 2/9]
哎,王勖成的书上在介绍协调质量矩阵对角化时压根就没提高斯积分的这种方法,Zinkiewicz的书上倒是说了,却白纸黑字的写着是用缩放因子的方法推来的,这个是否可以向出版社反应一下,做个勘误啊,王勖成的书,在动力学这块我还发现了另外的一个公式有问题,有时间写出来,以免大家再费时间 |
|