Professional Documents
Culture Documents
% problem9a.m
% antonio ferreira 2008
% clear memory
clear all
clc
% E; modulus of elasticity
% I: second moment of area
% L: length of bar
E=1e6;
L=10;
t=L/1000;
I=1*t^3/12;
EI=E*I;
elementNodes = zeros(numberElements,2);
for i=1:numberElements;
elementNodes(i,1)=i;
elementNodes(i,2)=i+1;
end
numberNodes=size(nodeCoordinates,1);
xx=nodeCoordinates(:,1);
% distributed force
P=-1000;
% for structure:
% displacements: displacement vector
% force : force vector
% stiffness: stiffness matrix
%U=zeros(GDof,1);
stiffnessSpring=zeros(GDof+1);
forceSpring=zeros(GDof+1,1);
% Inicializacion de la matriz de rigidez y el vector fuerza
force=zeros(GDof,1);
stiffness=zeros(GDof);
end
% spring added
stiffnessSpring(1:GDof,1:GDof)=stiffness;
forceSpring(1:GDof)=force;
k=10;
stiffnessSpring([GDof-1 GDof+1],[GDof-1 GDof+1])=...
stiffnessSpring([GDof-1 GDof+1],[GDof-1 GDof+1])+[k -k;-k k];
% displacements
% disp('Displacements')
% jj=1:GDof+1; format
% [jj' displacements]
%% Ploteo de la viga
% Create figure
figure1 = figure;
% Create axes
axes1 = axes('Parent',figure1,'FontSize',15);
box(axes1,'on');
hold(axes1,'all');
% Create plot
plot(nodeCoordinates,U,'MarkerSize',15,'Marker','.','LineStyle','none')
disp('Resultado')
U(end)