%-------------------------------------------------------------------------%
% Example 5.4.7
% To solve transient response of a 2-d frame structure.
% The solution methods are: 1) central difference scheme. 3) Houbolt integration scheme.
% 4) Wilson ?? integration scheme. 5) Newmark integration scheme
% nodal dof: {u1 v1 w1 x1 y1 z1 u2 v2 w2 x2 y2 z2}
% Problem description
% Find the response of a frame structure which is made of three beams of lengths of 4 m,
% 3 m and 4 m, respectively. All beams have cross- section of 0.10 m height by 0.05 m
% width. The elastic modulus is 2.10x10^11 Pa. The frame is subjected to an impulse load
% of amplitude 500 N in the middle of the top beam. One end of the each vertical beam is
% fixed. (see Fig. 5-9 for the element discretization)
% Variable descriptions
% k, m - element stiffness matrix and mass matrix
% kk, mm - system stiffness matrix and mass matrix
% ff - system force vector
% index - a vector containing system dofs associated with each element
% bcdof - a vector containing dofs associated with boundary conditions
% bcval - a vector containing boundary condition values associated with the dofs in 'bcdof'
% dsp - displacement matrix
% vel - velocity matrix
% acc - acceleartion matrix
%--------------------------------------------------------------------------
% (0) input control data
%--------------------------------------------------------------------------
clear; clc;
Beam_InputData547; % import the input data for the information of
% nodes, elements, loads, constraints and materials
Opt_beam=1; % option for type of the beam
% =1 Euler Bernoulli beam
% =2 Timoshenko beam
Opt_mass=2; % option for mass matrix
% =1 consistent mass matrix
% =2 lumped mass matrix
Opt_section=1; % option for type of cross-section
% = 1 rectangular cross-section
% = 2 circular cross-section
TypeMethod=1; % option for selecting the solution method
% = 1 central difference scheme
% = 3 Houbolt integration scheme
% = 4 Wilson integration scheme
% = 5 Newmark integration scheme
Typeload=1; % option for selecting the load type
% = 1 impulse load
% = 2 step load
% = 3 Harmonic load
dt=0.00001; % time step size
ti=0; % initial time
tf=0.200; % final time
nt=fix((tf-ti)/dt); % number of time steps
tt=ti:dt:ti+nt*dt; % generate time samples vector
ac=0.00002; bc=0.00008; % Parameters for proportional damping
al=0; % angle between the reference coordinate system and
% the local coordinate system for the space element
%--------------------------------------------------------------------------
% (1) initialization of matrices and vectors to zero
%--------------------------------------------------------------------------
k=zeros(No_nel*No_dof,No_nel*No_dof); % element stiffness matrix
m=zeros(No_nel*No_dof,No_nel*No_dof); % element mass matrix
kk=zeros(Sys_dof,Sys_dof); % initialization of system stiffness matrix
mm=zeros(Sys_dof,Sys_dof); % initialization of system mass matrix
ff=zeros(Sys_dof,1); % initialization of system force vector
bcdof=zeros(Sys_dof,1); % initializing the vector bcdof
bcval=zeros(Sys_dof,1); % initializing the vector bcval
index=zeros(No_nel*No_dof,1); % initialization of index vector
%--------------------------------------------------------------------------
% (2) calculation of constraints
%--------------------------------------------------------------------------
[n1,n2]=size(ConNode);
% calculate the constrained dofs
for ni=1:n1
ki=ConNode(ni,1);
bcdof((ki-1)*No_dof+1:ki*No_dof)=ConNode(ni,2:No_dof+1);
% the code for constrained dofs
bcval((ki-1)*No_dof+1:ki*No_dof)=ConVal(ni,2:No_dof+1);
% the value at constrained dofs
end
%--------------------------------------------------------------------------
% (3) applied nodal loads
%--------------------------------------------------------------------------
[n1,n2]=size(P);
for ni=1:n1
ff(No_dof*(P(ni,2)-1)+P(ni,3))=P(ni,1);
end
%--------------------------------------------------------------------------
% (4) calculate the element matrices and assembling
%--------------------------------------------------------------------------
for iel=1:No_el % loop for the total number of elements
nd(1)=iel; % starting node number for element 'iel'
nd(2)=iel+1; % ending node number for element 'iel'
x(1)=gcoord(nd(1),1); y(1)=gcoord(nd(1),2); z(1)=gcoord(nd(1),3);
% coordinate of 1st node
x(2)=gcoord(nd(2),1); y(2)=gcoord(nd(2),2); z(2)=gcoord(nd(2),3);
% coordinate of 2nd node
leng=sqrt((x(2)-x(1))^2+(y(2)-y(1))^2+(z(2)-z(1))^2);
xi(1)=(x(2)-x(1))/leng; % cos of the local x-axis and system x-axis
xi(2)=(y(2)-y(1))/leng; % cos of the local x-axis and system y-axis
xi(3)=(z(2)-z(1))/leng; % cos of the local x-axis and system y-axis
if Opt_beam==1
[k,m]=FrameElement31(prop,leng,xi,al,Opt_section,Opt_mass);
% compute element matrix for Euler-Bernoulli beam
elseif Opt_beam==2
[k,m]=FrameElement32(prop,leng,xi,al,Opt_section,Opt_mass);
% compute element matrix for Timoshenko beam
end
index=femEldof(nd,No_nel,No_dof); % extract system dofs associated with element
kk=femAssemble1(kk,k,index); % assemble system stiffness matrix
mm=femAssemble1(mm,m,index); % assemble system mass matrix
end
%--------------------------------------------------------------------------
% (5) apply constraints and solve the matrix equation
%--------------------------------------------------------------------------
[kk0,mm0,ff0,bcdof0,bcval0,sdof0]=kkCheck1(kk,mm,ff,bcdof,bcval);
% check the zero main elements in kk and eliminate the rows
% and columns in equation associated with the zero main elements
[kk1,mm1,ff1,sdof1]=femApplybc1(kk0,mm0,ff0,bcdof0,bcval0);
% apply boundary conditions to the system equation
[kk2,mm2,ff2,sdof2]=bcCheck1(kk0,mm0,ff0,bcdof0,bcval0);
没有合适的资源?快使用搜索试试~ 我知道了~
Matlab有限元结构动力学分析(源程序)
共94个文件
m:93个
ex632:1个
5星 · 超过95%的资源 需积分: 48 233 下载量 41 浏览量
2018-03-11
11:23:09
上传
评论 22
收藏 105KB RAR 举报
温馨提示
MATLAB有限元结构动力学分析与工程应用的书本源程序,比较适合要使用到这本书的工程师和同学们
资源推荐
资源详情
资源评论
收起资源包目录
代码源文件.rar (94个子文件)
代码源文件
第七章
shellek.m 11KB
EX791.m 12KB
第五章
BeamElement14.m 4KB
HarmonicRespt.m 5KB
bcCheck1.m 3KB
femEldof.m 1013B
EX542.m 11KB
EX547.m 18KB
FrameElement31.m 8KB
FrameElement21.m 5KB
EX545.m 10KB
FrameElement22.m 5KB
femApplybc1.m 1KB
EX541.m 12KB
femFFT.m 3KB
EX544.m 14KB
EX543.m 14KB
BeamElement12.m 3KB
kkCheck1.m 3KB
EX548.m 8KB
EX546.m 10KB
BeamElement11.m 3KB
femAssemble1.m 839B
FrameElement32.m 9KB
mmCheck1.m 3KB
StepRespt.m 5KB
ImpulseRespt.m 5KB
第八章
EX852.m 629B
EX814.m 2KB
EX812.m 3KB
BobjFun1.m 2KB
EX811.m 1KB
OC.m 2KB
EX813.m 3KB
ConFun1.m 3KB
例821
EX821.m 6KB
feaplycs3.m 952B
FindBestAndWorstIndividual.m 961B
Decode.m 762B
reddistrib.m 1KB
GenerateInitialPopulation.m 489B
GenerateNextPopulation.m 3KB
EX851.m 985B
Trusssizeopt.m 7KB
例816
EX816.m 2KB
OC.m 2KB
reddistrib.m 1KB
FE.m 2KB
refdistrib.m 1KB
lk.m 4KB
EX842.m 2KB
FE.m 2KB
例815
OC.m 2KB
EX815.m 2KB
FE.m 3KB
llk.m 1KB
VALUE.m 571B
CalculateObjectValue.m 499B
EX823.m 1KB
EX825.m 3KB
例824
fetruss31.m 2KB
EX824.m 10KB
refdistrib.m 1KB
Trusstopology.m 9KB
lk.m 1KB
EX822.m 1KB
第四章
GaussPoint2.m 2KB
EX471.m 7KB
FemAsmbl1.m 793B
FemKine2D.m 928B
FemJacobi2.m 1KB
FemDeriv2.m 1KB
FemEldof.m 901B
FemAplyc2.m 912B
FemIsoq4.m 2KB
EX472.m 8KB
Materialiso.m 2KB
第三章
EX333.m 567B
EX332.m 2KB
第六章
BilinearElement1.m 10KB
EX632 4KB
LineartriElement1.m 7KB
EX631.m 9KB
第二章
EX243.m 335B
TransResp3.m 5KB
freqresponse.m 6KB
Inviter.m 2KB
Modalresponse.m 5KB
TransResp4.m 4KB
EX241.m 3KB
Ssiter.m 2KB
TransResp1.m 4KB
TransResp5.m 3KB
EX242.m 3KB
共 94 条
- 1
资源评论
- qq_347021092021-05-15很棒的资源,非常好
Lane1102
- 粉丝: 2
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功