FEM_Bar_Ex1

# FEM_Bar_Ex1 - Finite Element Method(Axially Loaded Bar...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Finite Element Method (Axially Loaded Bar: Example 1) Clear the workspace clear all; close all; clc; Define the number of elements ne=2 ne = 2 Given Physical Parameters Length L=60 L = 60 Modulus of Elasticity (if not constant compute for each element) E=30e6 E = 30000000 Cross Sectional area (if not constant compute for each element) A=2 A = 2 Size of each element (uniform mesh) h=L/ne h = 30 Nodal coordinates xx=[0:h:L]' xx = 0 30 60 Built Elemental stiffness matrix and load vectors for i=1:ne Ee(i,1)=E; Ae(i,1)=A; Ke(:,:,i)=(Ee(i,1)*Ae(i,1)/h)*[1 -1; -1 1]; % Need to modify the load vector based upon the loading fe(:,:,i)=-10*[((xx(i+1,1)^3)/2/h)-((xx(i+1,1)*xx(i,1)^2)/2/h)- ((xx(i+1,1)^3)/3/h)+((xx(i,1)^3)/3/h);... ((xx(i+1,1)^3)/3/h)-((xx(i,1)^3)/3/h)- ((xx(i,1)*xx(i+1,1)^2)/2/h)+((xx(i,1)^3)/2/h)]; end Assemble global matrix KK=zeros(ne+1,ne+1); FF=zeros(ne+1,1); for i=1:ne KK(i:i+1,i:i+1)=KK(i:i+1,i:i+1)+Ke(:,:,i); FF(i:i+1,1)=FF(i:i+1,1)+fe(:,:,i); end Apply boundary Condition (Fixed at the right side: Removing last row and column of the global...
View Full Document

{[ snackBarMessage ]}

### Page1 / 4

FEM_Bar_Ex1 - Finite Element Method(Axially Loaded Bar...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online