%-------------------.. . .
--------
function [lc,m]=feframe2(el,xi,leng,area,rho,beta,ipt)
%----------------------------
% Purpose:
% Stiffness and mass matrices for the 2-D frame element
% nodal dof u1 v1 theta1 u2 v2 theta2
%
% Synopsis:
% [k,m]=feframe2{el,xi,leng,area,rho,beta,ipt)
%
% Variable Description:
% k - element stiffness matrix (size of 6x6)
% m - element mass matrix (size of 6x6)
% el - elastic modulus
% xi - second moment of inertia of cross-section
% Ieng - element length
% area - area of beam cross-section
% rho - mass density (mass per unit volume)
% beta - angle between the local and global axes
% is positive if the local axis is in the ccw direction from
% the global axis
% ipt = 1 - consistent mass matrix
% = 2 - lumped mass matrix
% = 3 - diagonal mass matrix
%----------------------------
%
% stiffness matrix at the local axis
%
a=el*area/leng;
c=el*xi/(leng·3);
kl=[a O O -a O O;...
0 12*c 6*leng*c O -12* c 6*leng*c;...
0 6*leng*c 4*leng"2*c O -6*leng*c 2*leng"2*c; ...
-a O O a O O;...
0 -12*c -6*leng*c O 12*c -6*leng*c;...
0 6*leng*c 2*leng"2*c O -6*leng*c 4*leng"2*c];
%
% rotation matrix
%
r=[ cos(beta) sin(beta) 0 0 0 O;.. .
-sin(beta) cos(beta) 0 0 0 O;.. .
0 0 1 0 0 O;...
0 0 0 cos(beta) sin(beta) O;.. .
0 0 0 -sin(beta) cos(beta) O;.. .
0 0 0 0 0 1];
%
% stiffness matrix at the global axis