Finite Element Programming with MATLAB Lecture-13 MATLAB Codes

finite element programming with matlab n.w
1 / 11
Embed
Share

Learn about finite element analysis using MATLAB codes for spring elements in a structural problem. Understand the steps, boundary conditions, system stiffness matrix computation, and solution implementation. Explore the MATLAB code snippets provided for structure, displacements, forces, stiffness, and more.

  • Finite Element Analysis
  • MATLAB Codes
  • Spring Elements
  • Structural Problem
  • Programming

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Finite element programming with Matlab Lecture-13 MATLAB Codes for Finite Element Analysis (Spring Elements) Dr. ReemAlsehnawi

  2. Some basic steps 2

  3. we consider a problem, illustrated in figure 2.2 where the central bar is defined as rigid. Our problem has three finite elements and four nodes. Three clamped, being the boundary conditions defined as u1 = u3 = u4 = 0. In order to solve this problem, we set k = 1 for all springs and the external applied load at node 2 to be P = 10. nodes are 3

  4. and then obtain the static global equilibrium equations in the form the boundary conditions u1 = u3 = u4 = 0, we may write 4

  5. and then obtain the static global equilibrium equations in the form 5

  6. MATLAB Code: % MATLAB codes for Finite Element Analysis % antonio ferreira 2008 % clear memory clear all % elementNodes: connections at elements elementNodes=[1 2;2 3;2 4]; In this problem, the number of nodes is the same as the number of degrees of freedom % numberElements: number of Elements numberElements=size(elementNodes,1); % numberNodes: number of nodes numberNodes=4; 6

  7. MATLAB Code: % for structure: % displacements: displacement vector % force : force vector % stiffness: stiffness matrix displacements=zeros(numberNodes,1); force=zeros(numberNodes,1); stiffness=zeros(numberNodes); % applied load at node 2 force(2)=10.0; place the applied force at the corresponding degree of freedom: 7

  8. MATLAB Code: % computation of the system stiffness matrix for e=1:numberElements; % elementDof: element degrees of freedom (Dof) elementDof=elementNodes(e,:) ; stiffness(elementDof,elementDof)=... stiffness(elementDof,elementDof)+[1 -1;-1 1]; end % boundary conditions and solution % prescribed dofs prescribedDof=[1;3;4]; % free Dof : activeDof activeDof=setdiff([1:numberNodes] ,[prescribedDof]) ; 8

  9. MATLAB Code: % solution displacements=stiffness(activeDof,activeDof)\force(activeDof); % positioning all displacements displacements1=zeros(numberNodes,1); displacements1(activeDof)=displacements; % output displacements/reactions outputDisplacementsReactions(displacements1,stiffness,... numberNodes,prescribedDof) 9

  10. displacements and reactions Function % to output displacements and reactions: %.............................................................. function outputDisplacementsReactions... (displacements,stiffness,GDof,prescribedDof) % output of displacements and reactions in tabular form % GDof: total number of degrees of freedom of the problem % displacements disp( Displacements ) %displacements=displacements1; jj=1:GDof; format [jj displacements] % reactions F=stiffness*displacements; reactions=F(prescribedDof); disp( reactions ) [prescribedDof reactions] 10

  11. Results: for example displacements and reactions: Displacements ans = 1.0000 0 2.0000 3.3333 3.0000 0 4.0000 0 Reactions ans = 1.0000 -3.3333 3.0000 -3.3333 4.0000 -3.3333 11

More Related Content