For the FEA Problem what is the matlab code to solve for the

For the FEA Problem, what is the matlab code to solve for the following 3D Truss

Solution

I have given generalized solution for 3D space structure.juat enter your values to get the answer.

Modulus of elasticity E, cross-sectional area A, Length L, and angles thetax, thetay, and theaz. It returns the 6x6 element stiffness matrix k. function y = SpaceTrussElementLength(x1,y1,z1,x2,y2,z2) SpaceTrussElementLength

This function returns the length of the space truss element whose first node has coordinates (x1,y1,z1) and second node has coordinates (x2,y2,z2). y = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2z1)); function y = Space Truss Element Stiffness (E,A,L,thetax,thetay,thetaz) %Space Truss Element Stiffness This function returns the element stiffness matrix for a space truss element with modulus of elasticity E, cross-sectional area A, length L, and angles the tax, the tay, thetaz (in degrees). The size of the element stiffness matrix is 6 x 6. x = thetax*pi/180; y = thetay*pi/180; z = thetaz*pi/180; Cx = cos(x); Cy = cos(y); Cz = cos(z); w = [Cx*Cx Cx*Cy Cx*Cz; Cy*Cx Cy*Cy Cy*Cz; Cz*Cx Cz*Cy Cz*Cz]; y = E*A/L*[w -w; -w w]

%Space Truss Element Assemble This function assembles the element stiffness matrix k of the space truss element with nodes i and j into the global stiffness matrix K. This function returns the global stiffness matrix K after the element stiffness matrix k is assembled. % Stiffness Matrix Construction k = zeros(3*G,3*G); for i=1:E for j=1:3 for h=1:3 k(3*(l1(i)-1)+h,3*(l1(i)-1)+j) = k(3*(l1(i)-1)+h,3*(l1(i)1)+j) + k_elem(h,j,i); k(3*(l1(i)-1)+h,3*(l2(i)-1)+j) = k(3*(l1(i)-1)+h,3*(l2(i)1)+j) + k_elem(h,j,i); %SpaceTrussElementForce k(3*(l2(i)-1)+h,3*(l1(i)-1)+j) = k(3*(l2(i)-1)+h,3*(l1(i)1)+j) + k_elem(h,j,i); k(3*(l2(i)-1)+h,3*(l2(i)-1)+j) = k(3*(l2(i)-1)+h,3*(l2(i)1)+j) + k_elem(h,j,i); %Assemble Matrix Construction K = zeros(3*G,3*G); for i=1:G for j=1:E if(l1(j)==i || l2(j)==i) K(3*i-2,3*i-2) = (Ro(j)*Area(j)*L(j))/2 + K(3*i-2,3*i-2); K(3*i-1,3*i-1) = (Ro(j)*Area(j)*L(j))/2 + K(3*i-1,3*i-1); K(3*i,3*i) = (Ro(j)*Area(j)*L(j))/2 + K(3*i,3*i); %Space Truss Element Assemble This function assembles the element stiffness matrix k of the space truss element with nodes i and j into the global stiffness matrix K. This function returns the global stiffness matrix K after the element stiffness matrix k is assembled. %Stiffness Matrix Construction k = zeros(3*G,3*G); for i=1:E for j=1:3 for h=1:3 k(3*(l1(i)-1)+h,3*(l1(i)-1)+j) = k(3*(l1(i)-1)+h,3*(l1(i)1)+j) + k_elem(h,j,i); k(3*(l1(i)-1)+h,3*(l2(i)-1)+j) = k(3*(l1(i)-1)+h,3*(l2(i)1)+j) + k_elem(h,j,i); k(3*(l2(i)-1)+h,3*(l1(i)-1)+j) = k(3*(l2(i)-1)+h,3*(l1(i)1)+j) + k_elem(h,j,i); k(3*(l2(i)-1)+h,3*(l2(i)-1)+j) = k(3*(l2(i)-1)+h,3*(l2(i)1)+j) + k_elem(h,j,i); %Assemble Matrix Construction K = zeros(3*G,3*G); for i=1:G for j=1:E if(l1(j)==i || l2(j)==i) K(3*i-2,3*i-2) = (Ro(j)*Area(j)*L(j))/2 + K(3*i-2,3*i-2); K(3*i-1,3*i-1) = (Ro(j)*Area(j)*L(j))/2 + K(3*i-1,3*i-1); K(3*i,3*i) = (Ro(j)*Area(j)*L(j))/2 + K(3*i,3*i); Function y = Space Truss Element Force (E, A, L, the tax, the tay, the taz,u) This function returns the element force given the modulus of elasticity E, the cross-sectional area A, the length L, the angles the tax, the tay, the taz (in degrees), and the element nodal displacement vector u. x = thetax * pi/180; w = thetay * pi/180; v = thetaz * pi/180; Cx = cos(x); Cy = cos(w); Cz = cos(v); y = E*A/L*[-Cx -Cy -CzCx Cy Cz]*u; Function y = Space Truss Element Stress (E,L, the tax, the tay, the taz,u) This function returns the element stress given the modulus of elasticity E, the length L, the angles the tax, the tay, the taz (in degrees), and the element nodal displacement vector u. x = the tax * pi/180; w = the tay * pi/180; v = the taz * pi/180; Cx = cos(x); Cy = cos(w); Cz = cos(v); y = E/L*[-Cx -Cy -CzCx Cy Cz]*u; %Plot Undeformed and Deformed shapes for i=1:E x_bef(1,i)=x(l1(i)); x_bef(2,i)=x(l2(i)); y_bef(1,i)=y(l1(i)); y_bef(2,i)=y(l2(i)); z_bef(1,i)=z(l1(i)); z_bef(2,i)=z(l2(i)); x_aft(1,i)=x(l1(i))+Q(1+3*(l1(i)-1),2); x_aft(2,i)=x(l2(i))+Q(1+3*(l2(i)-1),2); y_aft(1,i)=y(l1(i))+Q(2+3*(l1(i)-1),2); y_aft(2,i)=y(l2(i))+Q(2+3*(l2(i)-1),2); z_aft(1,i)=z(l1(i))+Q(3+3*(l1(i)-1),2); z_aft(2,i)=z(l2(i))+Q(3+3*(l2(i)-1),2); end x_offset=.2*(max(x)-min(x)); y_offset=.2*(max(y)-min(y)); z_offset=.2*(max(z)-min(z)); xmin=min(x)-x_offset; xmax=max(x)-x_offset; ymin=min(y)-y_offset; ymax=max(y)-y_offset; zmin=min(z)-z_offset; zmax=max(z)-z_offset; plot3(x_bef, y_bef, z_bef, \'b\', x_aft, y_aft, z_aft, \'g\') axisequal; axis([xmin xmax ymin ymax zmin zmax]); view([1,1,1]);

For the FEA Problem, what is the matlab code to solve for the following 3D TrussSolutionI have given generalized solution for 3D space structure.juat enter your

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site