You are on page 1of 7

2/17/2020

Transformation of Coordinates y F2, u2


F1, u1
• The bar element was developed for
General Programming displacements along the element (i.e. in its
local coordinate system ( i.e. x, y )
x L
F2 Y
d2Y
Procedure {using MAPLE} for • The element can be oriented with an angle
θ, and we know the forces at each node in
Y F1 Y F2 X
Finite Element Method global horizontal and vertical directions.
d1 Y
θ
d2 X
• Let the global horizontal and vertical F1 X X
By
directions be named X and Y. d1 X F2 Y
Mahmoud M.S. Dwaikat
• Anything in directions of X , Y comes from d2Y
the components of x and y using the Y

 =    −  ()
relations: θ F1 Y F2 X

 =    + ()
F1 X d1 Y
d2 X

=
d1 X
θ
X
1 2

Rotation Matrix “R” Transformation Matrix “T”

 cos() −sin() 0 
• The previous relation can be written as • But the element matrix which we derived is only 2x2, and the global element DOF
are 4 in total.

 = sin() cos() 0   = 
• Rewrite the entries of Ke in local directions as 4x4:

 0 0 1  !& !' "& "'


! " %!! 0 %!" 0
%!! %!" = 0 0 0 0
#$ =
• R is called a rotation matrix. X is the global direction, and x is the local direction.
%"! %"" %"! 0 %"" 0
0 0 0 0
• This is applicable to all quantities, such as displacements and forces at any node
• We can do the inverse, and obtain x = R-1 X. Interestingly, the rotation matrix
has a special characteristic, that R-1 = RT ( i.e. its inverse is its transpose, such • Then we define the matrix T asa transformation matrix because it transforms all
the local quantities to the global directions
type of matrices are called “orthogonal” matrices).
cos() −sin() 0 0
sin() cos() 0 0
• We can use these relations to generalize the element matrices in any
(=
0 0 cos() −sin()
“orthogonal” coordinate system.
0 0 sin() cos()
3 4
2/17/2020

Globally Transformed Element Matrices Example: Truss


• Let the element equilibrium equations be written in its local coordinate • Let’s consider the following simple truss. F
system (i.e. x, y) as: Ke de = Fe Members AB and BC each has variable cross- B
sectional area such that at their middle the area
• But de = T-1 dG, where de is the element DOF and dG are the global DOF (i.e.
is twice the area at the ends. Take the area at the
A 30o 60o C
in X, Y). Similarly Fe = T-1FG. Re-writing: middle to be 2000 mm2, the force F is 500 kN.
and E = 200GPa. We wish to find the vertical and 4m
horizontal displacements of node B.
Ke de = Fe  Ke (T-1 dG) = T-1 FG  T Ke (T-1 dG) = FG  (T Ke T-1 )dG = FG
• First, we will find the exact displacements using
basic laws of mechanics of materials. Then we
• The matrix (T Ke T-1 ) is renamed as the global stiffness matrix of the
will solve this example using 2 Linear elements in
element KG in the global coordinate system.
each member, then try 1 quadratic element per
member.
5 6

Exact Solution Exact Solution


• The exact solution can be obtained using Virtual Work Principles. To find The vertical displacement at point B is computed as:

HIJ 9:;
L04 I04J 9;E
L4D I4DJ
vertical displacement at point B, a unit load is applied vertically and then
∆' = F G 12 = G 12 + G 12 = − M. N OO
K3 K3 K34D
horizontally there, and the external work is equated to the virtual internal
6 04 6

• For the vertical displacement ∆' = ∑ + . 12 , here nv are the virtual loads in
work.
,-
/0
Similarly for the horizontal direction, we have the internal axial forces in AB and

gives as above: ∆= – 1.099 mm


members due to a virtual vertical unit load at joint B. and N are real loads in BC due to a unit horizontal force at B as: nABH = cos(30), nBCH = -sin(30),, which
each member due to the actual load at joint B. In member AB , nABV = cos(60),
nBCV = sin(60), NAB = -F*cos(60), NBC = -F*sin(60). The cross-sectional area has
a variability, thus, expressing it as a function of x:
1000 + 2 ≤ 0.5>04 1000 + 2 ≤ 0.5>4D
!666& !666&

304 2 = 5 B C 34D (2) = 5


6.89:; 6.89;E

2000 − 2 > 0.5>04 2000 − 2 > 0.5>4D


!666 &@6.89:; !666(&@6.89;E )
6.89:; 6.89;E

7 8
2/17/2020

3
Exact Solution in MAPLE Meshing using Linear Elements
2
4
• The integrals can be easily done in MAPLE using the following code: • First let’s discretize the structure
using 2 linear elements per 1 5
member. 4m
• Give each node a global
number. And give every DOF a Discretization and global numbering
global identifying number. of nodes “ i.e. meshing”
• Note that this process is called
meshing and it has no unique 8=d3y
way to do. 3=d3x 7=d2y
• There are studies on the best 2=d2x 4=d4x
6=d1y 9=d4y
“way” to organize the 1=d1x 5=d5x 10=d5y
numbering such that the
4 m
resulting global matrix is well 4m
banded. DOF as translations in X-direction DOF as translations in Y-direction
9 10

Connectivity Matrix Connectivity Matrix 3


8
• For the assembly of the element matrices, we need to know the relation 4 = u2y 7
2 4
between the local numbering of the dof [per element] to the global DOF of 9
3 = u2x 1
the global structure matrix. Such processes is called connectivity. 2 = u1y
5 6 10
• Generating the Connectivity Matrix is very important step, and there are 5m 5m
1 = u1x DOF as translations in X-direction
many algorithms that can do this starting from a given mesh. [This is not our DOF as translations in Y-direction
focus here, so we will have to write it by hands] Global Labeling of the DOF
1
Local element dof
2
local dof
• Connectivity matrix generally has the form GN(e,n) = N . 1 2 3 4
1'
GN

3
1 , u1x 2 , u1y 3, u2x 4 , u2y
Elem. No.
4
1 1 6 2 7
• It reads like: The local dof n in element e has a Global DOF N. Notice here the
CPQRBQ = 5
e1 1 , d1x 6, d2x 2 , d1y 7 , d2y 2 2 7 3 8

6
local dof n for the element must be oriented parallel and in the same  3 3 8 4 9
7
e2 2, d2x 7, d3x 3, d2y 8, d3y 4 4 9 5 10
sequence as the global coordinate system.
8 1&
9
e3 3, d3x 8, d4x 4 ,d3y 9, d4y GN(3,1)=3 simply means: The global DOF for dof 1
• Since we are using linear elements, each element has two nodes, and each
10
(u1x) in element 3 is 8.
node has two translation dof ux, and uy. Thus we have the following table e4 4, d4x 9 ,d5x 5, d4y 10, d5y Notice, the command GN(3,1..4) will give you all
the locations (or global DOFs) of all the element # 3
11 local dofs in the global (assembled) matrix 12
2/17/2020

Let’s Start Coding … in Maple Define the Properties of the Elements


• First define the element matrix in local Le = length of each element
coordinates. Ae = average cross-sectional area of each element
• Notice the zero here are the stiffness in Ee = Elastic Modulus for each element
the local y directions, because this is a ThE = Angle orientation of each element
bar element and has no transverse
stiffness. Also, no rotational DOF.
• The order of the local dof here are
[ u1x,u1y , u2x, u2y ]
• The order must match with what you
assumed when you generated the
Connectivity Matrix.
13 14

Define Connectivity, Boundary, and Free Nodes Transformation Matrices


3 8 • Since our elements are bi-nodal (4 translation DOF each element), then the
2 7
1
4 9 transformation matrix is 4x4
5 6 10
4m 4m
DOF as translations in X- DOF as translations in Y- BN = Boundary Nodes
direction direction
FN = Free Nodes

Element Connectivity Matrix

15 16
2/17/2020

Assembly Procedure Note on the For-Loop Writing in MAPLE


• Algorithm / Logic: we need a For-Loop!! • Note: when you write each line, end up using “cntrl + j” to get to a second line [
• Prepare size of Global Matrix “KG” Do not hit enter, otherwise MAPLE will execute each line and gives you an error]
• Loop over each element • After you finish writing the entire for-loop [ From for …to ..end do ], Select all the
• Prepare element matrix in global coordinates lines you typed, then {hit F4} or Go to Edit in the menu and select: Split or Join >
• Scatter the terms of the local Ke to the global KG using connectivity Join Execution Group
• Sum to the previously looped element matrices.
• This will join the commands and make them run as one group.
• This procedure can be written as:

" Y
• The evalf() command, evaluates the numbers to numeric values, rather than keeping them
8
17
fractions and square-roots ( i.e. becomes 0.693 ) 18

Define Global Force Vector Static Condensation (Applying B.C)


• The Global Stiffness matrix is singular, and therefore, we must apply the
• Follow the global numbering necessary boundary conditions in order to be able to solve the system.
when you define the global
force vector • We do this by separating the global stiffness matrix into two forms: The
Boundary Form, and the Free Form.
• In our example on a force in the
negative direction of DOF 8 is • The Boundary Form (KB) represents the terms that are attached to the
applied. Boundary Nodes
• The Free Form (KF) is the remaining of the global matrix (terms attached to
the free nodes).
• This process of separation is also called Static Condensation

19 20
2/17/2020

Static Condensation (Applying B.C) Static Condensation (Applying B.C)


• The global system of equation can be written as KGdG=FG. In our example, the boundary DOF are 4, and the free are 6.
• The global displacement vector dG can be decomposed into dB and dF, where dB In MAPLE prepare the free and boundary matrices using :
is the displacements on the boundary DOF, and the dF are the free

#4 #4Z 14 L
displacements inside the domain.

= 4 , upon separation we have:


#4Z
[
#Z 1Z LZ
• The following MAPLE code assigns the
Re-writing :

and #4Z
values from the Global matrix to the free
[ and boundary matrices used in the static
KBdB+ KBFdF=FB dB+KFdF=FF condensation.
• The Boundary displacements dB are generally known (either = 0 or values), • Notice the order of the terms in the KB

dF= #Z@! (FF – #4Z


thus, we can solve for the free “unknown” DOF as
[
and KF will follow exactly as per the BN
dB) and FN terms as defined earlier.
• This step is essential for solving the system
and for imposing the boundary conditions.
21 22

Last Step: Solving the System The whole thing put-together


• Since in our example, all the boundary nodes have

solution is simply dF= #Z@! FF


zero prescribed DOF, then dB = 0. and thus the

• Doing this in MAPLE


• Notice the results will follow the same order as
that for FN, and will correspond to every DOF in it.
• Recall FN=[2,3,4,7,8,9]T , Thus the horizontal
displacement at B is d3=-1.057 mm, and the
vertical displacement is d8 = -3.943 mm
• This compares well with the exact (-1.099 and -4.1
mm

23 24
2/17/2020

3
Meshing using Quad Elements
Now: Let’s try solve it using Quad. Elem. 6 = u3y
2 4
4 = u2y
!& !' "& "' Y& Y' 5 = u3x 1 5

K3 0 0 0
2 = u1y
• We will use single Quad Elem per member. 7 0 −8 0 1 0

#$ =
3 = u2x 4m
• What do you expect that will change? 0 0 0 1 = u1x
−8 0 16 0 −8 0 Discretization and global numbering
• Element Local Matrix, now will be 6x6 3> 0 0 0 0 0 0 Local element dof of nodes “ i.e. meshing”
• The transformation Matrix
1 0 −8 0 7 0 Connectivity Matrix
• Connectivity Matrix
0 0 0 0 0 0 GN 1 2 3 4 5 6
8=d3y
1 1 6 2 7 3 8 3=d3x 7=d2y
cos() −sin() 0 0 0 0 2 3 8 4 9 5 10 6=d1y
2=d2x 4=d4x 9=d4y
sin() cos() 0 0 0 0
0 0 cos() −sin() 0 0 1=d1x 5=d5x 10=d5y
(=
0 0 sin() cos() 0 0 BN= (1,5,6,10) 4m
4m
0 0 0 0 cos() −sin() FN = (2,3,4,7,8,9)
0 0 0 0 sin() cos() DOF as translations in X-direction DOF as translations in Y-direction
25 26

MAPLE Solution using 2 Quad Elem.

• Solution did not “improve”, almost similar to the solution obtained using 4 linear elements
27

You might also like