Professional Documents
Culture Documents
(1)
(2)
(3)
(4)
(4)
1
El desplazamiento transversal es interpolado por las funciones de forma de Hermite como:
(5)
(6)
(7)
(8)
(9)
(10)
2
Problema de la viga de Bernoulli
En las Figs. 2 y 3 se considera una viga de Bernoulli simplemente sostenida y
sujetada. En flexión, bajo carga uniforme. Código problem9.m resuelve este
problema para diversas condiciones de contorno. El usuario puede definir el
número de elementos. El desplazamiento transversal máximo (𝜔max) para la
viga simplemente soportada es 0,0130208 que coincide con la solución
analítica, mientras que para la viga fijada 𝜔max = 0,002604, igualando también
la solución analítica, como se ilustra en la Fig. 4.
Fig.2. Problema viga simplemente apoyado, bajo carga distribuida uniforme, problem9.m
3
Fig. 4. Deformada de la viga simplemente apoyado, bajo carga distribuida uniforme,
%................................................................
% MATLAB codes for Finite Element Analysis
% problem9.m
% antonio ferreira 2008
% clear memory
clear all
% E; modulus of elasticity
% I: second moment of area
% L: length of bar
E=1; I=1; EI=E*I;
4
% generation of coordinates and connectivities
numberElements=80;
nodeCoordinates=linspace(0,1,numberElements+1)’;
xx=nodeCoordinates;L=max(nodeCoordinates);
numberNodes=size(nodeCoordinates,1);
xx=nodeCoordinates(:,1);
for i=1:numberElements;
elementNodes(i,1)=i;
elementNodes(i,2)=i+1;
end
% distributed load
P=-1;
% for structure:
% displacements: displacement vector
% force: force vector
% stiffness: stiffness matrix
% GDof: global number of degrees of freedom
GDof=2*numberNodes;
U=zeros(GDof,1);
% stiffess matrix and force vector
[stiffness,force]=...
formStiffnessBernoulliBeam(GDof,numberElements,...
elementNodes,numberNodes,xx,EI,P);
% boundary conditions and solution
% clamped-clamped
%fixedNodeU =[1 2*numberElements+1]’;
%fixedNodeV =[2 2*numberElements+2]’;
% simply supported-simply supported
fixedNodeU =[1 2*numberElements+1]’; fixedNodeV =[]’;
% clamped at x=0
%fixedNodeU =[1]’; fixedNodeV =[2]’;
prescribedDof=[fixedNodeU;fixedNodeV];
% solution
displacements=solution(GDof,prescribedDof,stiffness,force);
% output displacements/reactions
outputDisplacementsReactions(displacements,stiffness,...
GDof,prescribedDof)
% drawing deformed shape
U=displacements(1:2:2*numberNodes);
plot(nodeCoordinates,U,’.’)
This code calls function formStiffnessBernoulliBeam.m for the computation of the
stiffness matrix and the force vector for the Bernoulli beam two-node element.
%................................................................
function [stiffness,force]=...
formStiffnessBernoulliBeam(GDof,numberElements,...
elementNodes,numberNodes,xx,EI,P);
force=zeros(GDof,1);
stiffness=zeros(GDof);
% calculation of the system stiffness matrix
% and force vector
for e=1:numberElements;
% elementDof: element degrees of freedom (Dof)
indice=elementNodes(e,:) ;
elementDof=[ 2*(indice(1)-1)+1 2*(indice(2)-1)...
2*(indice(2)-1)+1 2*(indice(2)-1)+2];
% ndof=length(indice);
% length of element
6.3 Bernoulli beam with spring 85
LElem=xx(indice(2))-xx(indice(1)) ;
5
ll=LElem;
k1=EI/(LElem)^3*[12 6*LElem -12 6*LElem;
6*LElem 4*LElem^2 -6*LElem 2*LElem^2;
-12 -6*LElem 12 -6*LElem;
6*LElem 2*LElem^2 -6*LElem 4*LElem^2];
f1=[P*LElem/2 P*LElem*LElem/12 P*LElem/2 ...
-P*LElem*LElem/12]’;
% equivalent force vector
force(elementDof)=force(elementDof)+f1;
% stiffness matrix
stiffness(elementDof,elementDof)=...
stiffness(elementDof,elementDof)+k1;
end