Académique Documents
Professionnel Documents
Culture Documents
Trusses in 3D space
Cx Cz Cy Cz 2 Cz Cx Cz Cy Cz 2 Cz
We then perform a basis transformation in order to obtain the global stiness matrix and the global vector of equivalent nodal forces, as we did for 2D trusses.
A.J.M. Ferreira, MATLAB Codes for Finite Element Analysis: Solids and Structures, Solid Mechanics and Its Applications 157, c Springer Science+Business Media B.V. 2009
69
70 Y y 2
5 Trusses in 3D space
Z z
E = 1 . 2 e6 X1 = (72, 0, 0) X2 = (0, 36, 0) X3 = (0, 36, 72) y 2 U2 = U3 = U4 = (0, 0, 0) 1 1 4 3 1000 A1 = 0.729 A1 = 0.187 x A1 = 0.302 v1 = 0 X4 = (0, 0, 48)
Fig. 5.2 A 3D truss problem: geometry, mesh, loads and boundary nodes, problem7.m
71
%................................................................ % % % % % MATLAB codes for problem7.m ref: D. Logan, A third Edition, A antonio ferreira Finite Element Analysis first couse in the finite element method, 3D truss example 2008
% clear memory clear all % E; modulus of elasticity % A: area of cross section % L: length of bar E=1.2e6; A=[0.302;0.729;0.187]; % area for various sections % generation of coordinates and connectivities nodeCoordinates=[72 0 0; 0 36 0; 0 36 72; 0 0 -48]; elementNodes=[1 2;1 3;1 4]; numberElements=size(elementNodes,1); numberNodes=size(nodeCoordinates,1); xx=nodeCoordinates(:,1); yy=nodeCoordinates(:,2); % for structure: % displacements: displacement vector % force : force vector % stiffness: stiffness matrix % GDof: global number of degrees of freedom GDof=3*numberNodes; U=zeros(GDof,1); force=zeros(GDof,1); % applied load at node 2 force(3)=-1000; % stiffness matrix [stiffness]=... formStiffness3Dtruss(GDof,numberElements,... elementNodes,numberNodes,nodeCoordinates,E,A);
72
5 Trusses in 3D space
% boundary conditions and solution prescribedDof=[2 4:12]; % solution displacements=solution(GDof,prescribedDof,stiffness,force); % output displacements/reactions outputDisplacementsReactions(displacements,stiffness,... GDof,prescribedDof) % stresses at elements stresses3Dtruss(numberElements,elementNodes,nodeCoordinates,... displacements,E) The results are in excellent agreement with analytical solution in [11]: Displacements ans = 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 reactions ans = 2.0000 -223.1632 4.0000 256.1226 5.0000 -128.0613 6.0000 0 7.0000 -702.4491 8.0000 351.2245 9.0000 702.4491 -0.0711 0 -0.2662 0 0 0 0 0 0 0 0 0
73
446.3264 0 297.5509
%................................................................ % % % % % MATLAB codes for problem8.m ref: D. Logan, A third Edition, A antonio ferreira Finite Element Analysis first couse in the finite element method, second 3D truss example 2008
5(8, 1, 1)
74
5 Trusses in 3D space
% clear memory clear all % E; modulus of elasticity % A: area of cross section % L: length of bar E=210000; A=[100 100 100 100]; % area for various sections % generation of coordinates and connectivities nodeCoordinates=[4000 4000 3000; 0 4000 0; 0 4000 6000; 4000 0 3000; 8000 -1000 1000]; elementNodes=[1 2;1 3;1 4;1 5]; numberElements=size(elementNodes,1); numberNodes=size(nodeCoordinates,1); xx=nodeCoordinates(:,1); yy=nodeCoordinates(:,2); % for structure: % displacements: displacement vector % force : force vector % stiffness: stiffness matrix % GDof: global number of degrees of freedom GDof=3*numberNodes; U=zeros(GDof,1); force=zeros(GDof,1); % applied load at node 2 force(2)=-10000; % stiffness matrix [stiffness]=... formStiffness3Dtruss(GDof,numberElements,... elementNodes,numberNodes,nodeCoordinates,E,A); % boundary conditions and solution prescribedDof=[4:15]; % solution
75
displacements=solution(GDof,prescribedDof,stiffness,force); % output displacements/reactions outputDisplacementsReactions(displacements,stiffness,... GDof,prescribedDof) % stresses at elements stresses3Dtruss(numberElements,elementNodes,nodeCoordinates,... displacements,E) The results are in excellent agreement with analytical solution in [11]: Displacements ans = 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 reactions ans = 1.0e+03 * 0.0040 0.0050 0.0060 0.0070 0.0080 0.0090 0.2709 0 0.2032 1.3546 0 -1.0160 -0.3024 -1.5177 0.2688 0 0 0 0 0 0 0 0 0 0 0 0
76
5 Trusses in 3D space
Stresses in elements 1 -3.38652236 2 -16.93261180 3 -79.68086584 4 -27.26097914 >> >> Both codes problem7.m and problem8.m call functions formStiness3Dtruss.m for stiness computation
function [stiffness]=... formStiffness3Dtruss(GDof,numberElements,... elementNodes,numberNodes,nodeCoordinates,E,A); stiffness=zeros(GDof); % computation of the system stiffness matrix for e=1:numberElements; % elementDof: element degrees of freedom (Dof) indice=elementNodes(e,:) ; elementDof=[3*indice(1)-2 3*indice(1)-1 3*indice(1)... 3*indice(2)-2 3*indice(2)-1 3*indice(2)] ; x1=nodeCoordinates(indice(1),1); y1=nodeCoordinates(indice(1),2); z1=nodeCoordinates(indice(1),3); x2=nodeCoordinates(indice(2),1); y2=nodeCoordinates(indice(2),2); z2=nodeCoordinates(indice(2),3); L = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) +... (z2-z1)*(z2-z1)); CXx = (x2-x1)/L;CYx = (y2-y1)/L;CZx = (z2-z1)/L; T = [CXx*CXx CXx*CYx CXx*CZx ; CYx*CXx CYx*CYx CYx*CZx ; ... CZx*CXx CZx*CYx CZx*CZx]; stiffness(elementDof,elementDof)=... stiffness(elementDof,elementDof)+E*A(e)/L*[T -T ; -T T]; end
77
function stresses3Dtruss(numberElements,elementNodes,... nodeCoordinates,displacements,E) % stresses in 3D truss elements fprintf(Stresses in elements\n) ff=zeros(numberElements,6); format for e=1:numberElements; % elementDof: element degrees of freedom (Dof) indice=elementNodes(e,:) ; elementDof=[3*indice(1)-2 3*indice(1)-1 3*indice(1)... 3*indice(2)-2 3*indice(2)-1 3*indice(2)] ; x1=nodeCoordinates(indice(1),1); y1=nodeCoordinates(indice(1),2); z1=nodeCoordinates(indice(1),3); x2=nodeCoordinates(indice(2),1); y2=nodeCoordinates(indice(2),2); z2=nodeCoordinates(indice(2),3); L = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) +... (z2-z1)*(z2-z1)); CXx = (x2-x1)/L;CYx = (y2-y1)/L;CZx = (z2-z1)/L; u=displacements(elementDof); member_stress(e)=E/L*[-CXx -CYx -CZx CXx CYx CZx]*u; fprintf(%3d %12.8f\n,e, member_stress(e)); end