You are on page 1of 12

ESCUELA POLITCNICA DEL EJRCITO

FACULTAD DE I NGENI ER A MECNI CA



ELEMENTOS FINITOS

TEMA:
ARMADURAS Y PRTICOS
NOMBRE:
ANDREA PAOLA AGUILAR SNCHEZ
FECHA:
2014 05 03
NRC:
4530

SANGOLQU ECUADOR

ANDREA AGUILAR 1

EJERCICIO DE ARMADURA:

Calcular las reacciones y esfuerzos de la siguiente armadura:





CDIGO EN MATLAB:

%Armaduras 2D
clc
clear all
%% E: modulus of elasticity
% A: area of cross section
% L: length of bar
E=20000e6; A=0.05; EA=E*A;

%% Generation of coordinates and connectivities
elementNodes=[1 2;1 3;2 3;2 4;2 5;3 4;3 5;4 5;5 6;4 6];
numberElements=size(elementNodes,1)
numberNodes=max(max(elementNodes))
nodeCoordinates=[0 0;3 0;3 3;6 0;6 3;9 0]
xx=nodeCoordinates(:,1);
yy=nodeCoordinates(:,2);

%% for structure:
% displacements: displacement vector
% force: force vector
% stiffness: stiffness matrix (matriz de rigidez)
GDof=2*numberNodes; %GDof: total number of degrees od freedom
displacements=zeros(GDof,1)
force=zeros(GDof,1)
% applied load at node 1
force(4)=-5000


ANDREA AGUILAR 2

force(8)-5000
force(9)=100000
% computation of the system stiffness matrix
[stiffness]=formStiffness2Dtruss(GDof,numberElements,elementNodes,numberN
odes,nodeCoordinates,xx,yy,EA)
%% boundary conditions and solution
prescribedDof=[1,2,11,12]'; %Posiciones donde no hay desplazamiento
% solution
displacements=solution(GDof,prescribedDof, stiffness,force)

%% Drawing displacements
u=size(displacements);
scale=20;

for i=1:numberElements
XX(i,:)=[xx(elementNodes(i,1)) xx(elementNodes(i,2))];
YY(i,:)=[yy(elementNodes(i,1)) yy(elementNodes(i,2))];
hold on
plot(XX(i,:),YY(i,:),'b','LineWidth',2);
end
for j=1:numberElements
for k=1:2:u-1
if displacements(k)~=0
XX1(j,:)=[xx(elementNodes(j,1))+displacements(k)*scale
xx(elementNodes(j,2))];
YY1(j,:)=[yy(elementNodes(j,1))+displacements(k+1)*scale
yy(elementNodes(j,2))];
hold on
plot(XX1(j,:),YY1(j,:),'r');
end
end
end

%% Stress - Esfuerzo
stress2Dtruss(numberElements,elementNodes,xx,yy,displacements,E)

%% Reactions-- reacciones
[F]=round([stiffness]*displacements)
reactions=F(prescribedDof)


DEFORMACIONES:

function[stifness]=formStiffness2Dtruss(GDof,numberElements,elementNodes,
numberNodes,nodeCoordinates,xx,yy,EA);

stifness=zeros(GDof);

%computation of the system stifness matrix
for e=1:numberElements;
%element Dof: element degrees of freedom
indice=elementNodes(e,:);
elementDof=[indice(1)*2-1 indice(1)*2 indice(2)*2-1 indice(2)*2];
%matrix of element coordinates


ANDREA AGUILAR 3

xa=xx(indice(2))-xx(indice(1));
ya=yy(indice(2))-yy(indice(1));
length_element=sqrt(xa*xa+ya*ya); %pitagoras
C=xa/length_element; %coseno
S=ya/length_element; %seno
k1=EA/length_element*[C*C C*S -C*C -C*S;C*S S*S -C*S -S*S;-C*C -C*S
C*C C*S;-C*S -S*S C*S S*S];
stifness(elementDof,elementDof)=stifness(elementDof,elementDof)+k1;
end


DESPLAZAMIENTOS:

function displacements=solution(GDof, prescribedDof, stiffness, force)

%% function to find solutioin in terms of global displacements
activeDof=setdiff([1:GDof]',[prescribedDof]); % SETDIFF(A,B)when A,B are
vectors returns values in A that are not in B.
U=stiffness(activeDof,activeDof)\force(activeDof);
displacements=zeros(GDof,1);
displacements(activeDof)=U;


FUNCIN ARMADURA:

function stress2Dtruss(numberElements,elementNodes,xx,yy,displacements,E)

%stress at elements
for e=1:numberElements
indice=elementNodes(e,:);
elementDof=[indice(1)*2-1 indice(1)*2 indice(2)*2-1 indice(2)*2];
xa=xx(indice(2))-xx(indice(1));
ya=yy(indice(2))-yy(indice(1));
length_element=sqrt(xa*xa+ya*ya);
C=xa/length_element;
S=ya/length_element;
sigma(e)=E/length_element*[-C -S C S]*displacements(elementDof);
end
sigma=roundn(sigma,2)















ANDREA AGUILAR 4

RESULTADOS:

















ANDREA AGUILAR 5

MATRIZ DE RIGIDEZ:











ANDREA AGUILAR 6




GRFICO:












ANDREA AGUILAR 7

EJERCICIO DE PRTICO:

Calcular las reacciones y esfuerzos del siguiente prtico:





CDIGO EN MATLAB:

%Armaduras 2D
clc
clear all
%% E: modulus of elasticity
% A: area of cross section
% L: length of bar
E=200000e6; A=2e-4; EA=E*A;

%% Generation of coordinates and connectivities
elementNodes=[1 2;2 3;3 4];
numberElements=size(elementNodes,1);
numberNodes=max(max(elementNodes));
nodeCoordinates=[0 0;0 3;4 3;9.2 0];
xx=nodeCoordinates(:,1);
yy=nodeCoordinates(:,2);

%% for structure:
% displacements: displacement vector
% force: force vector
% stiffness: stiffness matrix (matriz de rigidez)
GDof=2*numberNodes; %GDof: total number of degrees od freedom
displacements=zeros(GDof,1);
force=zeros(GDof,1);


ANDREA AGUILAR 8

% applied load at node 1
force(3)=-2000;
force(4)=1000;
force(5)=-2000;
force(4)=-300;
force(6)=300;
% computation of the system stiffness matrix
[stiffness]=formStiffness2Dtruss(GDof,numberElements,elementNodes,numberN
odes,nodeCoordinates,xx,yy,EA)
%% boundary conditions and solution
prescribedDof=[1,2,7,8]'; %Posiciones donde no hay desplazamiento
% solution
displacements=solution(GDof,prescribedDof, stiffness,force)
%% Drawing displacements
u=size(displacements);
scale=20;

for i=1:numberElements
XX(i,:)=[xx(elementNodes(i,1)) xx(elementNodes(i,2))];
YY(i,:)=[yy(elementNodes(i,1)) yy(elementNodes(i,2))];
hold on
plot(XX(i,:),YY(i,:),'b','LineWidth',2);
end
% for j=1:numberElements
% for k=1:2:u-1
% if displacements(k)~=0
% XX1(j,:)=[xx(elementNodes(j,1))+displacements(k)*scale
xx(elementNodes(j,2))];
% YY1(j,:)=[yy(elementNodes(j,1))+displacements(k+1)*scale
yy(elementNodes(j,2))];
% hold on
% plot(XX1(j,:),YY1(j,:),'r');
% end
% end
% end

%% Stress - Esfuerzo
stress2Dtruss(numberElements,elementNodes,xx,yy,displacements,E)

%% Reactions-- reacciones
[F]=round([stiffness]*displacements)
reactions=F(prescribedDof)


DEFORMACIONES:

function[stifness]=formStiffness2Dtruss(GDof,numberElements,elementNodes,
numberNodes,nodeCoordinates,xx,yy,EA);

stifness=zeros(GDof);

%computation of the system stifness matrix
for e=1:numberElements;
%element Dof: element degrees of freedom


ANDREA AGUILAR 9

indice=elementNodes(e,:);
elementDof=[indice(1)*2-1 indice(1)*2 indice(2)*2-1 indice(2)*2];
%matrix of element coordinates
xa=xx(indice(2))-xx(indice(1));
ya=yy(indice(2))-yy(indice(1));
length_element=sqrt(xa*xa+ya*ya); %pitagoras
C=xa/length_element; %coseno
S=ya/length_element; %seno
k1=EA/length_element*[C*C C*S -C*C -C*S;C*S S*S -C*S -S*S;-C*C -C*S
C*C C*S;-C*S -S*S C*S S*S];
stifness(elementDof,elementDof)=stifness(elementDof,elementDof)+k1;
end


DESPLAZAMIENTOS:

function displacements=solution(GDof, prescribedDof, stiffness, force)

%% function to find solutioin in terms of global displacements
activeDof=setdiff([1:GDof]',[prescribedDof]); % SETDIFF(A,B)when A,B are
vectors returns values in A that are not in B.
U=stiffness(activeDof,activeDof)\force(activeDof);
displacements=zeros(GDof,1);
displacements(activeDof)=U;


FUNCIN PRTICO:

function stress2Dtruss(numberElements,elementNodes,xx,yy,displacements,E)

%stress at elements
for e=1:numberElements
indice=elementNodes(e,:);
elementDof=[indice(1)*2-1 indice(1)*2 indice(2)*2-1 indice(2)*2];
xa=xx(indice(2))-xx(indice(1));
ya=yy(indice(2))-yy(indice(1));
length_element=sqrt(xa*xa+ya*ya);
C=xa/length_element;
S=ya/length_element;
sigma(e)=E/length_element*[-C -S C S]*displacements(elementDof);
end
sigma=roundn(sigma,2)












ANDREA AGUILAR 10

RESULTADOS:











GRFICO:


ANDREA AGUILAR 11

You might also like