You are on page 1of 7
Finite Element Learning Toolbox: Computer Assignment 3, Problem 1 ‘Author: Senthil Vel Contents = Clear memory = Define variables = Specify the number of elements, nodes, DOFs = Specify element connectivity information = Specify he 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 beam = Generate the element stifness 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 = Plot the deflection = Plot the bending moment diagram 1 Plot the shear force diagram Clear memory clear all; Define variables € = 7209; T= 1e-4} Ws) 2-25 B= 25 a= 35 Specify the number of elements, nodes, DOFs ELEMENTS: % Nunber of elenents NODES = 5; % Number of nodes NOOF = 25 % Nodal degrees of freedom [GDOF = NODES*NOOF; % Gloval 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 = [ 11 2; 223; 334) 445); 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 @ @; 2 3 @3 35 @ 47 6 5 10 el; In e the nodal placement and force arrays 4 = zeros(sD0F,1); F = zeros(sD0F,1); Specify the type of boundary condition at each node 1 - displacement/essential boundary condition. 0 -force/natural boundary condition. BcTyp: [1e1¢001010); Specify non-zero values of the prescribed nodal displacements/forces F(S) = -8003; Invoke function to create element degrees of freedom array EDOF = GenerateEDOFs (ENOD: 5 NDOF) DOF . 10203 4 203 4 5 6 205 6 7 8 4.7 8 9 Plot the undeformed shape of the beam Figure(1) PlotBeanUndeFormed(ENODES, NODALCOORDINATES) Undeformed Beam 08 Generate the element stiffness matrices Ket = KeBeam(E,1,L1) Ke2 = KeBeam(E,1,L2) Ke3 = KeBean(E,1,L3) Ke = KeBeam(E,1,L4) ker L.ecves * aetna -2.1111 4.6667 4.0667 9.3333 -4.6667 4.6567 “2.1112 -4.6667 3.2111 4.6567 4.6667 4.6667 -4.6667 9.3333 ke2 = ieseeeee — 105008e2 © -1050008 10580000 1eseeeee 14900002 -10500008 7800000 -1ese9eee © -10500088 © 1858000 © -10500000 1eseeee 7800002 © -10500008 © 14080000, Kes = 1050000 1@5000e2 © -10500008 10580000 105800 14990002 © -10500008 700000, “12590000 © -10500088 © 10580800 10500000 1eseee 7090002 © -10500e00 14900000, kes = 1.eees * 3.111 4.6667 3.1211 4,667 4.6667 9.3333 -4.6667 4.6567 3.1112 -4.6667 3.2111. 4.6667 4.6667 4.6667 -4.6667 9.3333, Assemble the global stiffness matrix by inserting the element stiffness matrices one at a time zeros(GDOF GOOF); %initialize the global stiffness matrix K = Assemble(1,xe1,K,ED0F); K = Assenble(2,xe2,K,E00F); K = Assenble(3,e3,K,EDOF); K = Assemble(4,ke4, K, EDOF Solve the global system of equations to obtain the nodal displacements and forces [d,F] = Solveslobal(k,¢,F,8CType) 5 Extract element nodal displacements and forces [cet, fet] = ExtractElenentNodaivalues(1, Ket, E00F, ¢); {de2, £e2] = ExtractElenentNodalValues(2, Ke2, F00F, ¢); [de3, Fe3] = ExtractE lenentNodalValues(3, Ke3, F00F,d); [dee, fea] = ExtractElenentNodalvalues(4, Ke4, E0OF, ); Plot the deflection Figure(2) PlotweanDeflection(ENODES, NODALCOORDINATES, 4) wao® Beam deflection Deflection v(x) Plot the bending moment diagram Figure(3) PlotBeanBendingMonent(ENODES, NODALCOORDINATES, E,T,d) 10 wao® Beam deflection Deflection v(x) 10 Bending Moment Diagram Bending Moment M(x) Plot the shear force diagram Figure(a) PlotaeanShearForce(ENODES NODALCOORDINATES, ,,4) 10 Shear Force Diagram Shear Force Vix) Published wth MATLABS R20200

You might also like