You are on page 1of 133

FINITE ELEMENT

Chapter 1. Introduction
The finite element method (FEM), or finite

element analysis

(FEA), is based on the idea of building a


complicated object with
simple blocks, or, dividing a complicated
object into small and
manageable pieces. Application of this simple
idea can be found
everywhere in everyday life as well as in
engineering.

Types of Finite Element

Types of Finite Elements

Types of Finite Elements

III. Spring Element

III. Spring Element




Spring force-displacement relationship:

III. Spring Element

III. Spring Element

Spring System

Spring System
Assemble the stiffness matrix for the whole system


Consider the equilibrium of forces at node 1,

F1 =f1 1


at node 2

F2 =f2 1 + f1 2


at node 3

F1 =f2 2

Spring System

An alternative way of assembling


the whole stiffness matrix

Boundary and load conditions:

Example 1.1

Solution
(a)

Solution

Solution

Solution
(b)

=0

=0

Solution
(c)
=0

=0

(d) The FE equation for spring (element) 2 is

Example 1.2

For the spring system with arbitrarily numbered


nodes and elements, as shown above, find the global
stiffness matrix.

Solution

The element stiffness matrices

The global stiffness matrix

Chapter 2. Bar and Beam


Elements. Linear Static Analysis

Stiffness Matrix - Direct Method

Stiffness Matrix - Direct Method

The bar is acting


like a spring in
this case and we
conclude that
element stiffness
matrix is

Stiffness Matrix -A Formal Approach

Stiffness Matrix -A Formal Approach

Example 2.1

Solution

Solution

Example 2.2

Solution

Solution

Chapter 3. Bar Elements in 2-D

Stiffness matrix in the


local coordinate

It is stiffness Matrix in the local coordinate system

Stiffness matrix in global


coordinate

Stiffness matrix in global


coordinate

Element Stress

Example 2.3

Solution
Element 1

Solution
Element 2

Assemble the structure FE equation,

Load and boundary conditions (BC):

The stresses in the two bars,

Example 2.4

Solution
Element 1:

Solution
Element 2

Solution
Element 3

The global FE equation

Load and boundary conditions (BC):

The transformation relation and the BC

The transformation relation and the BC

Solution

Solution

Solution

Solution
Substituting this into the 2nd equation and rearranging,

MATLAB

Variable descriptions
% k = element stiffness matrix
% kk = system stiffness matrix
% ff = system force vector
% index=a vector containing system dofs associated with each
element
% gcoord = global coordinate matrix
% disp = nodal displacement vector
% elforce = element force vector
% eldisp = element nodal displacement
% stress = stress vector for every element
% elprop = element property matrix
% nodes = nodal connectivity matrix for each element
% bcdof = a vector containing dofs associated with boundary
conditions
% bcval = a vector containing boundary condition values
associated with the dofs in 'bcdof'

%








control input data

clear
nel=2; % number of elements
nnel=2; % number of nodes per element
ndof=2; % number of dofs per node
nnode=3;% total number of nodes in system
sdof=nnode*ndof; % total system dofs

%

nodal coordinates

%---------------------------

gcoord(1,1)=0.0;
gcoord(1,2)=0.0;
gcoord(2,1)=10.0;
gcoord(2,2)=0.0;
gcoord(3,1)=0.0;
gcoord(3,2)=10.0;







% x, y-coordinate of node 1
% x, y-coordinate of node 2
% x, y-coordinate of node 3

% material and geometric properties


%------------------------------------------






elprop(1,1)=30000000; % elastic modulus of


1st element
elprop(1,2)=0.4;
% cross-section of 1st
element
elprop(2,1)=30000000; % elastic modulus of
2nd element
elprop(2,2)=0.5;
% cross-section of 2nd
element

%----------------------------% nodal connectivity


%-----------------------------







nodes(1,1)=1;
nodes(1,2)=2; % nodes associated
with element 1
nodes(2,1)=2;
nodes(2,2)=3; % nodes associated
with element 2













applied constraints
%----------------------------bcdof(1)=1;
bcval(1)=0;
bcdof(2)=2;
bcval(2)=0;
bcdof(3)=5;
bcval(3)=0;
bcdof(4)=6;
bcval(4)=0;

% 1st dof (horizontal displ) is constrained


% whose described value is 0
% 2nd dof (vertical displ) is constrained
% whose described value is 0
% 5th dof (horizontal displ) is constrained
% whose described value is 0
% 6th dof (vertical displ) is constrained
% whose described value is 0








initialization to zero
%---------------------------ff=zeros(sdof,1);
% system force vector
kk=zeros(sdof,sdof);
% system stiffness matrix
index=zeros(nnel*ndof,1);
% index vector
elforce=zeros(nnel*ndof,1); % element force vector
eldisp=zeros(nnel*ndof,1);
% element nodal
displacement vector
k=zeros(nnel*ndof,nnel*ndof); % element stiffness
matrix
stress=zeros(nel,1);
% stress vector for every
element






%----------------------------% applied nodal force


%----------------------------ff(4)=-1000;
% 2nd node has 1000
lb in downward direction

% loop for elemet

for iel=1:nel % loop for the total number of elements


nd(1)=nodes(iel,1); % 1st connected node for the (iel)-th element
nd(2)=nodes(iel,2); % 2nd connected node for the (iel)-th element
x1=gcoord(nd(1),1); y1=gcoord(nd(1),2); % coordinate of 1st node
x2=gcoord(nd(2),1); y2=gcoord(nd(2),2); % coordinate of 2nd node
leng=sqrt((x2-x1)^2+(y2-y1)^2); % element length
if (x2-x1)==0;
if y2>y1;
beta=2*atan(1); % angle between local and global axes else
beta=-2*atan(1);
end
else
beta=atan((y2-y1)/(x2-x1));
end
el=elprop(iel,1);
% extract elastic modulus
area=elprop(iel,2);
% extract cross-sectional area
index=feeldof(nd,nnel,ndof); % extract system dofs for the element
k=fetruss2(el,leng,area,0,beta,1); % compute element matrix
kk=feasmbl1(kk,k,index);
% assemble into system matrix
end





















function [index]=feeldof(nd,nnel,ndof)

%---------------------------------------------------------% Purpose:
%
Compute system dofs associated with each element
% Synopsis:
%
[index]=feeldof(nd,nnel,ndof)
% Variable Description:
%
index - system dof vector associated with element "iel"
%
iel - element number whose system dofs are to be determined
%
nnel - number of nodes per element
%
ndof - number of dofs per node
%----------------------------------------------------------edof = nnel*ndof;
k=0;
for i=1:nnel
start = (nd(i)-1)*ndof;
for j=1:ndof
k=k+1;
index(k)=start+j;
end
end





















function k=fetruss2(el,leng,area,beta)

%-------------------------------------------------------------% % % Variable Description:


%
k - element stiffness matrix (size of 4x4)
%
m - element mass matrix (size of 4x4)
%
el - elastic modulus
%
leng - element length
%
area - area of truss cross-section
%
beta - angle between the local and global axes
%
positive if the local axis is in the ccw direction from
%
the global axis
%--------------------------------------------------------------------------

% stiffness matrix


















c=cos(beta); s=sin(beta);
k= (area*el/leng)*[ c*c c*s -c*c -c*s;...
c*s s*s -c*s -s*s;...
-c*c -c*s c*c c*s;...
-c*s -s*s c*s s*s];

function [kk]=feasmbl1(kk,k,index)

%---------------------------------------------------------% % Variable Description:


%
kk - system matrix
%
k - element matri
%
index - d.o.f. vector associated with an element
%----------------------------------------------------------edof = length(index);
for i=1:edof
ii=index(i);
for j=1:edof
jj=index(j);
kk(ii,jj)=kk(ii,jj)+k(i,j);
end
end


















apply constraints and solve the matrix


%--------------------------------------------------

[kk,ff]=feaplyc2(kk,ff,bcdof,bcval); %
apply the boundary conditions

disp=kk\ff; % solve the matrix


equation to find nodal displacements























post computation for stress calculation


%-------------------------------------------------for iel=1:nel
% loop for the total number of elements
nd(1)=nodes(iel,1); % 1st connected node for the (iel)-th element
nd(2)=nodes(iel,2); % 2nd connected node for the (iel)-th element
x1=gcoord(nd(1),1); y1=gcoord(nd(1),2); % coordinate of 1st node
x2=gcoord(nd(2),1); y2=gcoord(nd(2),2); % coordinate of 2nd node
leng=sqrt((x2-x1)^2+(y2-y1)^2); % element length
if (x2-x1)==0;
if y2>y1;
beta=2*atan(1);
% angle between local and global axes
else
beta=-2*atan(1);
end
else
beta=atan((y2-y1)/(x2-x1));
end
el=elprop(iel,1);
% extract elastic modulus
area=elprop(iel,2);
% extract cross-sectional area
index=feeldof(nd,nnel,ndof); % extract system dofs for the element
k=fetruss2(el,leng,area,0,beta,1); % compute element matrix











for i=1:(nnel*ndof)
% extract
displacements associated with
eldisp(i)=disp(index(i));
% (iel)-th element
end
elforce=k*eldisp;
% element force
vector
stress(iel)=sqrt(elforce(1)^2+elforce(2)^2)/area
; % stress calculation
if ((x2-x1)*elforce(3)) < 0;
stress(iel)=-stress(iel);
end
end










% print fem solutions


%---------------------------num=1:1:sdof;
displ=[num' disp]
displacements

% print

numm=1:1:nel;
stresses=[numm' stress]
stresses

% print















displ =
1.0000
2.0000
3.0000
4.0000
5.0000
6.0000

-0.0000
0
-0.0008
-0.0027
0
0

stresses =
1.0e+003 *
0.0010 -2.5000
0.0020 2.8284
>>

Chapter 4. Beams and Frames

Beams and Frames

Beams and frames

Beams and frames

Beams and frames

Beams and frames

Beams and frames

Beams and frames

Beams and frames

Beams and frames

Beams and frames

Beams and frames

Beams and frames

Beams and frames

Example

Element stiffness matrices

Global FE equation

Loads and constraints (BCs)

Solving equaiton

The reaction forces and


moments

Equivalent Nodal Loads of


Distributed Transverse Load

Example

Solution
The spring stiffness matrix

The boundary conditions,

Solving equation

The nodal reaction forces

The nodal reaction forces

Beam Element
vi
ui
i

vj
j
uij

Combining the axial stiffness (bar


element), we obtain the stiffness matrix
of a general 2-D beam element,

Beam Element
vi
ui
i

vj

j
uij

Example

Solution

The stiffness matrix

The stiffness matrix for element 1

The stiffness matrix in local


system for 2 snd 3 element

The transformation matrix


for element 2 and 3.

The stiffness matrices in the

global coordinate system

The stiffness matrices in the

global coordinate system

Boundary conditions

Solving equation

The reaction forces and


moments

Draw the free-body diagram


of the frame

Capter 5. Two-Dimensional
Problems

In general, the stresses and strains in a structure


consist of six components:

Plane (2-D) Problems




Plane stress:

A thin planar structure with constant thickness and


loading within the plane of the structure (xy-plane).

Elasticity matrix
Plane stress - isotropic material

Stress-Strain Relations


We can also express stresses in terms of


strains by solving the above equation

Plane (2-D) Problems




Plane strain:

A long structure with a uniform cross section and


transverse loading along its length (z-direction).

Elasticity matrix
Plane strain - isotropic material

Elasticity matrix
Plane strain - isotropic material

linear triangular element.

Displacement functions

Displacement functions

Displacement functions

Displacement functions

Strain matrix

Strain matrix

The strain energy

Examples


CIVL 7117 FINITE ELEMENT NETHODS


IN STRUCTURAL MECHANICS
(page:265)
CIVL 7117 FINITE ELEMENT NETHODS
IN STRUCTURAL MECHANICS
(page:274)

WEIGHTED RESIDUAL
RAYLEI RITZ
GALERKIN

COLE
dizininden