-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfebeam2.m
54 lines (42 loc) · 1.41 KB
/
febeam2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function [k,m]=febeam2(el,xi,leng,sh,area,rho,ipt)
%--------------------------------------------------------------
% Purpose:
% Stiffness and mass matrices for C^0 beam element
% nodal dof {v_1 theta_1 v_2 theta_2}
%
% Synopsis:
% [k,m]=febeam2(el,xi,leng,sh,area,rho,ipt)
%
% Variable Description:
% k - element stiffness matrix (size of 4x4)
% m - element mass matrix (size of 4x4)
% el - elastic modulus
% xi - second moment of inertia of cross-section
% leng - length of the beam element
% rho - mass density of the beam element (mass per unit volume)
% sh - shear modulus
% area - area of cross-section
% ipt = 1: consistent mass matrix
% 2: lumped mass matrix
% otherwise: diagonal mass matrix
%---------------------------------------------------------------
% stiffness matrix
c=el*xi/leng;
d=(5/6)*sh*area/(4*leng);
k= [ 4*d 2*d*leng -4*d 2*d*leng;...
2*d*leng c+d*leng^2 -2*d*leng -c+d*leng^2;...
-4*d -2*d*leng 4*d -2*d*leng;...
2*d*leng -c+d*leng^2 -2*d*leng c+d*leng^2];
% consistent mass matrix
if ipt==1
mm=rho*area*leng/6;
m=mm*[2 0 1 0;...
0 0 0 0;...
1 0 2 0;...
0 0 0 0];
% lumped or diagonal mass matrix
else
m=zeros(4,4);
mass=rho*area*leng/2;
m=mass*diag([1 0 1 0]);
end