You are on page 1of 4
Finite Element Learning Toolbox: Computer Assignment 1, Problem 2 (Prob 5-13) Senthil Vel Contents = Clear memory = Define variables = Specify the number of elements, nodes, DOFs = Specify element connectivity information = Specify the nodal coordinates 1» Intiaize the nodal displacement and force arrays Specify the type of boundary condition at each node 1» Specify non-zero values of the prescribed nodal displacements/forces 1 Invoke function to create element degrees of freedom array Plot the undeformed shape of the frame = Generate the element sifness matrices = Assemble the global sifress matrix by inserting the element stiffness matrices one at a time 1» Solve the global system of equations to obtain the nodal displacements and forces = Extract element nodal cisplacements and forces Clear memory clear all; Define variables E = 3006; 1123 = 20 8123 = 10; oy aa. La = 280; 12 = 280; 13 = 280; La = 240*sqrt(2); thetal = 99; theta = @5 theta3 = 98; thetad = -45; Specify the number of elements, nodes, DOFs ELEMENTS = 4; X Number of elements NODES = 45 X Number of nodes NDOF = 3; % Nodal degrees of freedom [GDOF = NODES*NDOF; % Global degrees of freedom Specify element connectivity information First column of each row is the element number. Second column onwards in each row are the nodes belonging to the element (ordered correctly), ENODES = [ Specify the nodal coordinates First column of each row is the node number. Second column is the x-coordinate of the node, Third column is the y-coordinate of the node, NODALCOORDINATES. 1 0 8; 2 0 240; 3 240 240; 4 280 0); Initialize the nodal displacement and force arrays 4 = zeros(sD0F,1); F = zeros(6D0F,1); Specify the type of boundary condition at each node 1 - displacement/essential boundary condition. 0 -forceinatural boundary condition. Bcrype = [111000800111]; Specify non-zero values of the prescribed nodal displacements/forces F(A) = 5000; Invoke function to create element degrees of freedom array EDOF = GenerateEDOFs(ENODES, NDOF) DOF 1. 102 3 4 5 6 2 5 6 7 8 30% uo mw 7 8 8 4 4 5 6 @ 1 @ Plot the undeformed shape of the frame Figure(1) PlotFraneUndeformed(ENODES ,NODALCOORDINATES) Undeformed shape of frame 200 100 50 of of 4 ° 50 100150200250 Generate the element stiffness matrices Ket = KeFrame(E,1123,A123,L1, theta1); Ke2 = KeFrane(E,1123,A123,L2,theta2); ke} = KeFrane(E,1123,A123,L3,theta3); Ket = KeFrane(E,14,At,L4, theta); Assemble the global stiffness matrix by inserti 1g the element stiffness matrices one at a time zeros(GDOF,GOOF); Xinitialize the global stiffness matrix Assemble(1,Ke1,K, EDOF); Assemble(2,Ke2,K, EDOF); Assemble(3,Ke3,K, EDOF); Assenble(4, Ked,K, EDOF); Solve the global system of equations to obtain the nodal displacements and forces [4,F] = SolveGlobal(K,4,F,8CType); Extract element nodal displacements and forces [de1, fe1] = ExtractelenentNodalValues(1,Ke1, EDOF,d); [de2, fe2] = ExtractElenentNodalValues(2,Ke2, DOF); [e3, fe3] = ExtractElenentNodalValues(3, Ke3, FDOF ,<); [det, Fea] = ExtractElenentNodalValues(4, Kea, EDOF,¢);

You might also like