|
本帖最后由 VibInfo 于 2016-5-11 16:01 编辑
原帖由 liquid 于 2007-5-9 21:34 发表
xinyuxf同志所推荐的网页好像只有好友才能看,您看能不能把相关内容发我邮箱里,万分感谢啊!
我的邮箱是dingli6666@163.com
我贴出来吧
- %%平面应力,四节点八自由度单元求频率
- function PlateFreq8
- %%%%%%%%%%%%%%%%%%%前处理程序%%%%%%%%%%%%
- %%开始输入材料参数%%
- E=3e7; %弹性模量
- NU=0.3; %泊松比
- h=0.05; %板厚度
- ROU=7900; %密度
- %%%%输入板信息%%
- ND=4; %ND:单元结点数
- NF=2; %NF:结点自由度数
- LENGTH=1.5; %LENGTH:板长度
- BREADTH=1.5;%BREADTH:板宽度
- %%输入网格划分信息:NEI:横向单元个数;NEJ:纵向单元个数%%
- NEI=10;
- NEJ=10;
- %%%%%%划分网格%%%%%%%%%%%%%%%
- NE=NEI*NEJ; %%单元总数
- NDF=ND*NF; %%每个单元的总自由度数
- NP=(NEI+1)*(NEJ+1); %%节点总数
- N=NF*NP; %%自由度总数
- %%%%%%%%%%%%%%%%%求节点坐标%%%%%%%%%%%%%%%%%%
- [X,Y]=ECoordinates(NEI,NEJ,LENGTH,BREADTH);
- %%%%%%%%%%%%%%划分网格,求各单元连接的节点编号%%%%%
- ME=EMesh(ND,NEI,NEJ); %ND单元节点数、NEI、NEJ分别为横向和纵向节点数
- %%%%%%%%%%%%%%%%%%%%%%%%%%前处理程序结束%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- EK =SheetESM(E,NU,h); %单元刚度:E、UM弹性模量和泊松比;h板厚度
- EM = SheetEMM(ROU,h,LENGTH/NEI,BREADTH/NEJ);%单元质量:ROU密度;h板厚度;单元尺寸
- %%%%%%%%%%%%%%%%%%%%%%%%%%求刚度矩阵[K]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- SK=zeros(NP*2); % 整体刚度矩阵
- SM=zeros(NP*2); % 整体质量矩阵
- for i=1:1:NE
- SK = SheetASM(SK,EK,ME(i,:)); % 求整体刚度矩阵
- SM = SheetAMM(SM,EM,ME(i,:));%用集中质量法求质量矩阵
- end
- %%%%%%%%%%%%%%%%%%%%%%%%%%加入边界条件%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- SK(1:(NEJ+1)*2,:)=[];
- SK(:,1:(NEJ+1)*2)=[];
- SM(1:(NEJ+1)*2,:)=[];
- SM(:,1:(NEJ+1)*2)=[];
- %%%%%%%%%%%%%%%%%%%%%%%%%%求固有频率%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [V,D]=eig(SK,SM);
- [Freq2,index]=sort(sqrt(diag(D))); %频率
- Freq=Freq2/(2*pi);
- V = V(:,index); %振型
- Freq
- return;
- %%%%%%%%%%%%%%%%%%%%%%%%%主程序结束%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%各个子程序%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%%%%%%%%%%求节点坐标%%%%%%%%%%%%%%%%%%
- function [x,y]=ECoordinates(NEI,NEJ,LENGTH,BREADTH)
- %%%%给每一个结点配置X、Y方向的坐标,按横向分布
- for I=1:NEI+1
- for J=1:NEJ+1
- X((I-1)*(NEI+1)+J)=(I-1)*LENGTH/NEI;
- Y((I-1)*(NEI+1)+J)=(J-1)*BREADTH/NEJ;
- end
- end
- x=X;
- y=Y;
- return;
- %%%%%%%%计算各单元所连接的节点编号%%%%%%%%%%%%%%%
- function y=EMesh(ND,NEI,NEJ)
- for I=1:NEI
- for J=1:NEJ
- NEE=(I-1)*NEJ+J;
- ME(NEE,1)=J+(I-1)*(NEJ+1);
- ME(NEE,2)=J+I*(NEJ+1);
- ME(NEE,3)=J+I*(NEJ+1)+1;
- ME(NEE,4)=J+(I-1)*(NEJ+1)+1;
- end
- end
- y=ME;
- return;
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- %%%%%%%%矩形四节点单元法求单元刚度矩阵%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%x、y节点坐标;E、UM弹性模量和泊松比;T板厚度;lmd单元连接的各节点坐标
- function EK = SheetESM(E,nu,h)
- k=[ 1/2-nu/6 1/8+nu/8 -1/4-nu/12 -1/8+3*nu/8 ...
- -1/4+nu/12 -1/8-nu/8 nu/6 1/8-3*nu/8];
- EK = h*E/(1-nu^2)*[ k(1) k(2) k(3) k(4) k(5) k(6) k(7) k(8)
- k(2) k(1) k(8) k(7) k(6) k(5) k(4) k(3)
- k(3) k(8) k(1) k(6) k(7) k(4) k(5) k(2)
- k(4) k(7) k(6) k(1) k(8) k(3) k(2) k(5)
- k(5) k(6) k(7) k(8) k(1) k(2) k(3) k(4)
- k(6) k(5) k(4) k(3) k(2) k(1) k(8) k(7)
- k(7) k(4) k(5) k(2) k(3) k(8) k(1) k(6)
- k(8) k(3) k(2) k(5) k(4) k(7) k(6) k(1)];
- return;
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%%装配单元刚度矩阵%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- function SK = SheetASM(K,EK,lmd)
- for i = 1:1:4
- for j = 1:1:4
- for p = 1:1:2
- for q = 1:1:2
- m = (i-1) * 2 + p;
- n = (j-1) * 2 + q;
- M = (lmd(i)-1) * 2 + p;
- N = (lmd(j)-1) * 2 + q;
- K(M,N) = K(M,N) + EK(m,n);
- end
- end
- end
- end
- SK=K;
- return;
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%计算单元质量矩阵%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%x、y节点坐标;ROU材料密度;h板厚度;lmd单元连接的各节点坐标
- function EM = SheetEMM(ROU,h,x,y)
- Mfirst = x*y*h*ROU; %%%单元总质量
- I=eye(8);
- EM=I*Mfirst/4;
- return;
- %%%%%%%%%装配单元质量矩阵%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- function SM = SheetAMM(M,EM,lmd)
- for i = 1:1:4
- for j = 1:1:4
- for p = 1:1:2
- for q = 1:1:2
- r = (i-1) * 2 + p;
- s = (j-1) * 2 + q;
- R = (lmd(i)-1) * 2 + p;
- S = (lmd(j)-1) * 2 + q;
- M(R,S) = M(R,S) + EM(r,s);
- end
- end
- end
- end
- SM=M;
- return;
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- 本程序使用matlab7.0运行成功。
复制代码 |
|