Escolar Documentos
Profissional Documentos
Cultura Documentos
Andrew Phillips
MEng PhD
Lecturer in Structural Engineering and Structural Biomechanics Imperial College London Structural Biomechanics, Structures Section Department of Civil and Environmental Engineering www.imperial.ac.uk/structuralbiomechanics
Previously it was stated that the matrix stiness method could easily be implemented in a program such as Matlab. Here we will look at the implementation for a beam and a frame example. The approach can be used for any structure made up of distinct elements connected together at nodes or joints.
Beam Example
% Setting up a member stiffness matrix (bending) k = [4 2; 2 4]; % Setting up a matrix of distributed loads w=[40 20 20 60]; % Setting up a matrix of lengths L=[4 6 6 4]; % Setting up a matrix of EI values EI = [1 1.5 1.5 2]; % Assuming use of UB402x140x42 EI = EI.*(2.05*108*0.0001569); % kN/m2 * m4
% Setting up the combined structure stiffness matrix % Based on the degree of kinematic indeterminacy (5) ndof=5; K=zeros(ndof,ndof); for n=1:ndof-1 K(n:n+1,n:n+1)=K(n:n+1,n:n+1)+k.*EI(n)./L(n); end
% Setting up fixed end moments for each span (FE-M) FEMspan = zeros(ndof-1,2); for n=1:ndof-1 FEMspan(n,1) = +w(n).*L(n)2./12; FEMspan(n,2) = -w(n).*L(n)2./12; end % Setting up fixed end moments at each support (FE-M) FEMsupport=zeros(ndof,1); FEMsupport(1,1)=FEMspan(1,1); for n=2:ndof-1 FEMsupport(n,1)=FEMspan(n-1,2)+FEMspan(n,1); end FEMsupport(ndof,1)=FEMspan(ndof-1,2);
= K 1 (R FE )
%%%% Calculation to find values of theta %%%% theta=(K-1)*(-FEMsupport); fprintf('Theta Values (rad): \n'); fprintf('%1.4e, ',theta); fprintf('\n\n');
% Setting up a vertical stiffness matrix % These values can be taken from the 3D member stiffness matrix kvert = [6 6; -6 -6]; Kvert = zeros(ndof,ndof); for n=1:ndof-1 Kvert(n:n+1,n:n+1)=Kvert(n:n+1,n:n+1)+kvert.*EI(n)./L(n).2; end
% Setting up fixed end vertical reactions for each span (FE-R2) FER2span = zeros(ndof-1,2); for n=1:ndof-1 FER2span(n,1) = w(n).*L(n)./2; FER2span(n,2) = w(n).*L(n)./2; end % Setting up fixed end vertical reactions for each support (FE-R2) FER2support=zeros(ndof,1); FER2support(1,1)=FER2span(1,1); for n=2:ndof-1 FER2support(n,1)=FER2span(n-1,2)+FER2span(n,1); end FER2support(ndof,1)=FER2span(ndof-1,2);
%%%% Calculation to find values for the vertical support reactions (R2) R2 = FER2support+Kvert*theta; fprintf('Vertical Support Reactions (kN): \n'); fprintf('%1.4e, ',R2); fprintf('\n\n');
Conclusions
The script can be generalised for any continuous beam. Results are found to match those obtained from Oasys GSA excluding shear deformations.
Frame Example
% Defining the number of elements numelem=13; % Defining the number of nodes numnodes=11; % Defining pinned supports supports=[1 1 1 0; 2 1 1 0; 3 1 1 0; 4 1 1 0];
% E I A
% See the labelling on the diagram L = zeros(numelem,1); %number of elements L(1:12,1)=4; %refer to diagram L(13,1)=4*sqrt(2); %refer to diagram
% Setting up a reference member stiffness matrix for each member k=zeros(6,6,numelem); for n=1:numelem k(1:6,1:6,n) = [E*A/L(n) 0 0 -E*A/L(n) 0 0;... 0 12*E*I/L(n)3 6*E*I/L(n)2 0 -12*E*I/L(n)3 6*E*I/L(n)2;... 0 6*E*I/L(n)2 4*E*I/L(n) 0 -6*E*I/L(n)2 2*E*I/L(n);... -E*A/L(n) 0 0 E*A/L(n) 0 0;... 0 -12*E*I/L(n)3 -6*E*I/L(n)2 0 12*E*I/L(n)3 -6*E*I/L(n)2;... 0 6*E*I/L(n)2 2*E*I/L(n) 0 -6*E*I/L(n)2 4*E*I/L(n)]; end
% Rotating the member stiffness matices into the global axes alpha=[90 90 90 90 90 90 90 0 0 0 0 0 45]; alpha=alpha*pi./180; N=zeros(3,3,numelem); kdash=zeros(6,6,numelem); for n=1:numelem; % Setting up a transformation matrix for each of the four quadrants N(1:3,1:3,n)=[cos(alpha(n)) +sin(alpha(n)) 0;... -sin(alpha(n)) cos(alpha(n)) 0;... 0 0 1]; % kdash(1:3,1:3,n)=N(:,:,n)'*k(1:3,1:3,n)*N(:,:,n); kdash(1:3,4:6,n)=N(:,:,n)'*k(1:3,4:6,n)*N(:,:,n); kdash(4:6,1:3,n)=N(:,:,n)'*k(4:6,1:3,n)*N(:,:,n); kdash(4:6,4:6,n)=N(:,:,n)'*k(4:6,4:6,n)*N(:,:,n); end
% Setting up connectivity tables for the elements % Refer to the diagram % This will be used to shape the global stiffness matrix connelem=[1 5; 2 6; 3 7; 4 8; 6 9; 7 10; 8 11;... 5 6; 6 7; 7 8; 9 10; 10 11;... 5 9]; % % % % % As mentioned the k matrices can be broken into quadrants 3x3 in size Deriving an initial global stiffness matrix, K Note the final matrix must be symmetrical about the diagonal Taking each of the nodes in turn and working out where the different quadrant of the original kdash matrices should be placed in K
K=zeros(numnodes*3,numnodes*3); Klogic=zeros(numnodes,numnodes);
% placing the top-left quadrant for n=1:numnodes clear a a=find(connelem(:,1)==n); if isempty(a)=1; for m=1:length(a); K(1+(n-1)*3:n*3,1+(n-1)*3:n*3)=... K(1+(n-1)*3:n*3,1+(n-1)*3:n*3)+kdash(1:3,1:3,a(m)); % Klogic(n,n)=Klogic(n,n)+1; end end end
% placing the bottom-right quadrant for n=1:numnodes clear a a=find(connelem(:,2)==n); if isempty(a)=1; for m=1:length(a); K(1+(n-1)*3:n*3,1+(n-1)*3:n*3)=... K(1+(n-1)*3:n*3,1+(n-1)*3:n*3)+kdash(4:6,4:6,a(m)); % Klogic(n,n)=Klogic(n,n)+1; end end end
% placing the top-right and bottom-left quadrant for n=1:numnodes clear a b a=find(connelem(:,1)==n); if isempty(a)=1; b=connelem(a,2); for m=1:length(a); K(1+(n-1)*3:n*3,1+(b(m)-1)*3:b(m)*3)=... K(1+(n-1)*3:n*3,1+(b(m)-1)*3:b(m)*3)+kdash(1:3,4:6,a(m)); K(1+(b(m)-1)*3:b(m)*3,1+(n-1)*3:n*3)=... K(1+(b(m)-1)*3:b(m)*3,1+(n-1)*3:n*3)+kdash(4:6,1:3,a(m)); % Klogic(n,b(m))=Klogic(n,b(m))+1; Klogic(b(m),n)=Klogic(b(m),n)+1; end end end
% Addressing rows and columns in the stiffness matrix associated with % applied support constraints a=size(supports); b=0; Ksupportrefs=zeros(1,sum(sum(supports(:,2:4)=0))); for n=1:a(1) for m=2:a(2) if supports(n,m)==1; b=b+1; Ksupportrefs(b)=(supports(n,1)-1)*3+(m-1); end end end clear a b K(Ksupportrefs(1,:),:)=0; K(:,Ksupportrefs(1,:))=0; for n=1:length(Ksupportrefs) K(Ksupportrefs(1,n),Ksupportrefs(1,n))=1; end
%Setting up matrix of distributed loads w=[0 0 0 0 0 0 0 10 10 10 10 10 0]; %Setting up fixed end moments for each element (FE-M) FEMelem = zeros(numelem,2); for n=1:numelem FEMelem(n,1) = +w(n).*L(n)2./12; FEMelem(n,2) = -w(n).*L(n)2./12; end %Setting up fixed end x2 reactions for each element (FE-R2) FER2elem = zeros(numelem,2); for n=1:numelem FER2elem(n,1) = w(n).*L(n)./2; FER2elem(n,2) = w(n).*L(n)./2; end
%Setting up fixed end moment for each node FEMnode=zeros(numnodes,1); for n=1:numnodes clear a b a = find(connelem(:,1)==n); if isempty(a)=1; for m=1:length(a); FEMnode(n,1)=FEMnode(n,1)+FEMelem(a(m),1); end end b = find(connelem(:,2)==n); if isempty(b)=1; for m=1:length(b); FEMnode(n,1)=FEMnode(n,1)+FEMelem(b(m),2); end end end
%Setting up fixed end x2 reactions for each node FER2node=zeros(numnodes,1); for n=1:numnodes clear a b a = find(connelem(:,1)==n); if isempty(a)=1; for m=1:length(a); FER2node(n,1)=FER2node(n,1)+FER2elem(a(m),1); end end b = find(connelem(:,2)==n); if isempty(b)=1; for m=1:length(b); FER2node(n,1)=FER2node(n,1)+FER2elem(b(m),2); end end end
= K 1 (R FE )
%Finding the joint displacements displacements=(K-1)*(-FERnode); reshapedisplacements=reshape(displacements,3,[]); fprintf('\nDisplacements at the nodes (m,m,rad):\n\n'); disp(reshapedisplacements);
Displacements at the nodes (m,m,rad): 1.0e-003 * Columns 1 through 6 0 0 0.0689 0 0 -0.0355 0 0 -0.0198 0 0 -0.0971 0.0672 -0.0661 -0.1882 0.0760 -0.1966 0.0140
Columns 7 through 11 0.0893 -0.2742 -0.0274 0.1013 -0.1290 0.1182 0.2331 -0.2546 -0.1916 0.2170 -0.4155 -0.0053 0.2021 -0.1922 0.2021
R = k + R FE
%Finding the support reactions %Isolating the elements that have restrained ends %This relies on supports being defined for single elements a=size(supports); for n=1:a(1) b=find(connelem(:,1)==n); EndAdisp=displacements(1+(connelem(b,1)-1)*3:3+(connelem(b,1)-1)*3,1); EndBdisp=displacements(1+(connelem(b,2)-1)*3:3+(connelem(b,2)-1)*3,1); Endsdisp(1:3,1)=EndAdisp; Endsdisp(4:6,1)=EndBdisp; reactions(1+(n-1)*3:3+(n-1)*3,1)=kdash(1:3,1:6,b)*Endsdisp+... FERnode(1+(connelem(b,1)-1)*3:3+(connelem(b,1)-1)*3,1); end reshapereactions=reshape(reactions,3,[]); fprintf('\nReactions (kN,kN,kNm):\n\n'); disp(reshapereactions);
Reactions (kN,kN,kNm): 1.0333 19.8530 0.0000 -0.1987 59.0480 0.0000 0.0305 82.3450 -0.0000 -0.8651 38.7540 0.0000
Conclusions
The script can be generalised for any plane frame. The script can be adapted to include dierent cross sections. Results are found to match those obtained from Oasys GSA excluding shear deformations.
Ask not what you can do for the matrix stiness method... Ask what the matrix stiness method can do for you.