Sie sind auf Seite 1von 1

% MATLAB code for FEM

% 2D truss stiffness matrix for ICSTaGE 2017


% created by Harish. J on 25-01-2017
% material, section properties and loads
E=2e5;
D=50.8;
A=0.7854*D*D;
EA=E*A;
F0=[0 0 0 0 0 0 0 444822.16 0 0 0 0 0]';
% nodes and elements
nodes=dlmread('nodes.txt');
elements=dlmread('elements.txt');
numberElements=elements(end,end);
numberNodes=nodes(end,1);
elementNodes=elements(:,1:2);
nodeCoordinates=nodes(:,2:3);
xx=nodeCoordinates(:,1);
yy=nodeCoordinates(:,2);
% degrees of freedom and corresponding force and displacement vector
GDof=2*numberNodes;
displacements=zeros(GDof, 1);
force=zeros(GDof, 1);
Fsw = slfwt2Dtruss(numberElements,elementNodes,...
xx,yy,GDof,A)
% stiffness matrix calc
[stiffness]=formStiffness2Dtruss(GDof,numberElements,elementNodes,numberNodes,no
deCoordinates,xx,yy,EA);
k=stiffness([3:9,11:16],[3:9,11:16]);
u0=inv(k)*F0;
kD=k./(D/2);
FF=F0./4.4482216e5;
uD=inv(k)*(-1.*(kD*u0));
uF=inv(k)*FF;
kDD=kD./D;
kF=k.*0;
rhs1=-2.*[(kD.*25.8064)+(kF.*225.969e3) (kD.*225.969e3)+(kF.*1.978e9)]*[uD; uF];
rhs2=-1.*(kDD.*25.8064)*u0;
rhs=rhs1+rhs2;
u2=inv(k)*rhs;
Eu=u0+(0.5.*u2);
Varu=[uD uF]*[25.8064 225.969e3; 225.969e3 1.978e9]*[uD uF]';
SDu=(diag(Varu)).^0.5;
res=[Eu SDu];
dlmwrite('Results of MIT truss.txt',res);
disp('Mean and standard deviation of nodal displacements')
dlmread('Results of MIT truss.txt')

Das könnte Ihnen auch gefallen