0% found this document useful (0 votes)
52 views9 pages

Finite Element: Mid Term Part III: Develope The Element Matrix of Single Element'

This document provides the steps to develop element stiffness matrices (k1, k2, k3, k4) for a finite element analysis problem. It then combines the element matrices into a global structural stiffness matrix (K) and uses this to calculate the joint displacements (R) due to an applied load (F). The problem involves calculating displacements for a 2D plane stress problem with multiple elements.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
52 views9 pages

Finite Element: Mid Term Part III: Develope The Element Matrix of Single Element'

This document provides the steps to develop element stiffness matrices (k1, k2, k3, k4) for a finite element analysis problem. It then combines the element matrices into a global structural stiffness matrix (K) and uses this to calculate the joint displacements (R) due to an applied load (F). The problem involves calculating displacements for a 2D plane stress problem with multiple elements.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 9

> restart:

> with(linalg):
Warning, new definition for norm
Warning, new definition for trace

Finite Element: Mid Term Part III


Determine the nodal displacements and the element stresses, dueto the load shown, E = 200
GPa, nu = 0.33 and
t = 10 mm . Assume plane stress conditions.

Develope the element matrix of single element'


Material Properties:
> E:=200e6:kN/m^2:
> nu:=0.33:
> t:=0.01:m:
Matrix of nodal coordinates:
> aa:=matrix([[1,x1,y1],[1,x2,y2],[1,x3,y3]]):
> A:=det(aa)/2:
Displacement coefficient:
> dd:=matrix([[1,x,y]]):
Shape functions:
> N:=multiply(dd,inverse(aa)):
> Ns:=matrix([[N[1,1],0,N[1,2],0,N[1,3],0],[0,N[1,1],0,N[1,2],0,N[
1,3]]]):
Displacements in x and y directions:
> u:=N[1,1]*u1+N[1,2]*u2+N[1,3]*u3:
> v:=N[1,1]*v1+N[1,2]*v2+N[1,3]*v3:
Displacements matrix
> d:=matrix([[u1],[v1],[u2],[v2],[u3],[v3]]):
Strain matrix:
> ex:=diff(u,x):
> ey:=diff(v,y):
> r:=diff(u,y)+diff(v,x):
> epsilon:=matrix([[ex],[ey],[r]]):
Constitutive matrix
> Dd:=matrix([[1,nu,0],[nu,1,0],[0,0,(1-nu)/2]]):
> mu:=E/(1-nu^2):
> DD:=scalarmul(Dd,mu);
0.2244417013 109 0.7406576143 108

DD := 0.7406576143 108 0.2244417013 109

0
0

8
0.7518796994 10

Stress matrix:
> sigma:=multiply(DD,epsilon):
> U:=scalarmul(multiply(transpose(epsilon),sigma),1/2*t*A):
Element stiffness matrix:
> k:=matrix(6,6,[]):
> for i from 1 to 6 do

> for j from 1 to 6 do


> k[i,j]:=evalf(diff(U[1,1],[d[i,1],d[j,1]]),6);
> od:
> od:
Element matrix of element no1( node: 1 5 4)
> k1:=matrix(6,6,[]):
> for i from 1 to 6 do
> for j from 1 to 6 do
> x1:=0:x2:=.03:x3:=0:y1:=0:y2:=0:y3:=.03:
> k1[i,j]:=evalf(k[i,j],5)
> od:
> od:
v1
u5
v5
u4
> print(k1); u1
0.14981 107

746280.

7
-0.11222 10

-375950.

-375950.

-370330.

746280.
0.14981 107
-370330.
-375950.
-375950.
-0.11222 107

-0.11222 107
-370330.
0.11222 107
0
0
370330.

-375950.
-375950.
0
375950.
375950.
0

v4

-375950.
-370330.
-375950. -0.11222 107

0
370330.

375950.
0

375950.
0

7
0
0.11222 10

Element matrix of element no2 (node: 5 2 6)


> k2:=matrix(6,6,[]):
> for i from 1 to 6 do
> for j from 1 to 6 do
> x1:=0.03:x2:=.06:x3:=0.03:y1:=0:y2:=0.0:y3:=.03:
> k2[i,j]:=evalf(k[i,j],6)
> od:
> od:
v5
u2
v2
u6
> print(k2):u5

v6

0.149815 107
746270.
-0.112221 107 -375939. -375939.
-370330.

7
746270.
-370330.
-375939. -375939. -0.112221 107
0.149815 10

7
-370330.
0.112221 107
0
0
370330.
-0.112221 10

-375939.

-375939.
0
375939. 375939.
0

-375939.
-375939.
0
375939. 375939.
0

7
7
370330.
0
0
0.112221 10
-370330.
-0.112221 10
Element matrix of element no3 (node 5 6 4)
> k3:=matrix(6,6,[]):
> for i from 1 to 6 do
> for j from 1 to 6 do
> x1:=0.03:x2:=0.03:x3:=0:y1:=0:y2:=0.03:y3:=.03:
> k3[i,j]:=evalf(k[i,j],5)
> od:
> od:
>
> print(k3): u5
v5
u6
v6
u4
v4

375950.
0
-375950.
-375950.
0

7
7

-370330.
-0.11222 10
370330.
0
0.11222 10

7
-375950.
-370330.
0.14981 10
746280.
-0.11222 107

-375950. -0.11222 107


746280.
0.14981 107
-370330.

-370330.
0.11222 107
0
370330.
-0.11222 10

375950.
0
-375950.
-375950.
0
Element matrix of element no4 (node: 2 3 6)
> k4:=matrix(6,6,[]):
> for i from 1 to 6 do
> for j from 1 to 6 do
> x1:=0.06:x2:=0.06:x3:=0.03:y1:=0:y2:=0.03:y3:=.03:
> k4[i,j]:=evalf(k[i,j],5)
> od:
> od:
> print(k4): u2
v2
u3
v3
u6

375950.

-375950.

-375950.

375950.

0
-375950.
-375950.
0
375950.

7
7

0
0.11222 10
-370330.
-0.11222 10
370330.

7
-375950.
-370330.
0.14981 10
746280.
-0.11222 107

-375950. -0.11222 107


746280.
0.14981 107
-370330.

0
370330.
-0.11222 10
-370330.
0.11222 107

375950.
0
-375950.
-375950.
0
K1:=matrix(12,12,0):
K2:=matrix(12,12,0):
K3:=matrix(12,12,0):
K4:=matrix(12,12,0):
K1:=copyinto(submatrix(k1,1..2,1..2),K1,1,1):
K1:=copyinto(submatrix(k1,1..2,3..4),K1,1,9):
K1:=copyinto(submatrix(k1,1..2,5..6),K1,1,7):

375950.

-375950.

-375950.

375950.

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

K1:=copyinto(submatrix(k1,3..4,1..2),K1,9,1):
K1:=copyinto(submatrix(k1,3..4,3..4),K1,9,9):
K1:=copyinto(submatrix(k1,3..4,5..6),K1,9,7):
K1:=copyinto(submatrix(k1,5..6,1..2),K1,7,1):
K1:=copyinto(submatrix(k1,5..6,3..4),K1,7,9):
K1:=copyinto(submatrix(k1,5..6,5..6),K1,7,7):
K2:=copyinto(submatrix(k2,1..2,1..2),K2,9,9):
K2:=copyinto(submatrix(k2,1..2,3..4),K2,9,3):
K2:=copyinto(submatrix(k2,1..2,5..6),K2,9,11):
K2:=copyinto(submatrix(k2,3..4,1..2),K2,3,9):
K2:=copyinto(submatrix(k2,3..4,3..4),K2,3,3):
K2:=copyinto(submatrix(k2,3..4,5..6),K2,3,11):

v6

> K2:=copyinto(submatrix(k2,5..6,1..2),K2,11,9):
> K2:=copyinto(submatrix(k2,5..6,3..4),K2,11,3):
> K2:=copyinto(submatrix(k2,5..6,5..6),K2,11,11):
>
> K3:=copyinto(submatrix(k3,1..4,1..4),K3,9,9):
> K3:=copyinto(submatrix(k3,1..4,5..6),K3,9,7):
>
> K3:=copyinto(submatrix(k3,5..6,1..4),K3,7,9):
> K3:=copyinto(submatrix(k3,5..6,5..6),K3,7,7):
>
> K4:=copyinto(submatrix(k4,1..4,1..4),K4,3,3):
> K4:=copyinto(submatrix(k4,1..4,5..6),K4,3,11):
>
> K4:=copyinto(submatrix(k4,5..6,1..4),K4,11,3):
> K4:=copyinto(submatrix(k4,5..6,5..6),K4,11,11):
> F:=matrix(12,1,0):
> F[6,1]:=-10:
Structure stifness after restraint
> K:=evalf(evalm(K1+K2+K3+K4),4):
> K:=delcols(K,7..8):
> K:=delcols(K,1..2):
> K:=delrows(K,7..8):
> K:=delrows(K,1..2):
> print(K):(u2 v2
u3
v3
u5
v5
u6

v6)

0.1498 107 , 0 , -376000. , -376000. , -0.1122 107 , -370300. , 0 , 746300.

0 , 0.1498 107 , -370300. , -0.1122 107 , -375900. , -375900. , 746200. , 0

7
7
-376000. , -370300. , 0.1498 10 , 746300. , 0 , 0 , -0.1122 10 , -376000.

-376000. , -0.1122 107 , 746300. , 0.1498 107 , 0 , 0 , -370300. , -376000.

-0.1122 107 , -375900. , 0 , 0 , 0.2996 107 , 746300. , -751900. , -746300.

7
7
-370300. , -375900. , 0 , 0 , 746300. , 0.2996 10 , -746200. , -0.2244 10

0 , 746200. , -0.1122 107 , -370300. , -751900. , -746200. , 0.2996 107 , 746300.

746300. , 0 , -376000. , -376000. , -746300. , -0.2244 107 , 746300. , 0.2996 107


External force matrix
> F:=delrows(F,7..8):
> F:=delrows(F,1..2);
0

0

0

-10
F :=
0
0

0

0
Joint displacement:(u2,v2,u5,v5,u6,v6)

> R:=evalf(multiply(inverse(K),F),6);
-0.0000131019

-0.0000593955

0.0000171675

-0.0000665956

R :=

-0.0000102188

-0.0000226491

0.0000110644

-0.0000252053
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Calculate element stresses and principal stresses:
> restart:
> with(linalg):
Warning, new definition for norm
Warning, new definition for trace

>
>
>
>
>
>
>

E:=200e6:kN/m^
nu:=0.33:
t:=0.01:m
A:=0.00045:(area of each element)
Dd:=matrix([[1,nu,0],[nu,1,0],[0,0,(1-nu)/2]]):
mu:=E/(1-nu^2):
DD:=scalarmul(Dd,mu);(D matrix)
0.2244417013 109 0.7406576143 108

DD := 0.7406576143 108 0.2244417013 109

0
0

8
0.7518796994 10

>
> DD:=scalarmul(DD,1/(2*A));Matrix D divided by (2area)
0.2493796681 1012 0.8229529047 1011

11
12

DD := 0.8229529047 10
0.2493796681 10
0

0
0
0.8354218881 1011

Element data: coordinates,and joint displacements


> edata:=evalf(array([[.0,.03,0,.0,.0,.03,0,-.102188e-4,0,0,-.2264
91e-4,0],
> [.03,.06,.03,.0,.0,.03,-.102188e-4,-.131019e-4,.110644e-4,-.2264
91e-4,-.593955e-4,-.252053e-4],
> [.03,.03,.0,.0,.03,.03,-.102188e-4,.110644e-4,0,-.226491e-4,-.25
2053e-4,0],
> [.06,.06,.03,.0,.03,.03,-.131019e-4,.171675e-4,.110644e-4,-.5939
55e-4,-.665956e-4,-.252053e-4]]),3);
edata :=
[ 0 , 0.03 , 0 , 0 , 0 , 0.03 , 0 , -0.0000102 , 0 , 0 , -0.0000226 , 0 ]
[ 0.03 , 0.06 , 0.03 , 0 , 0 , 0.03 , -0.0000102 , -0.0000131 , 0.0000111 , -0.0000226 ,
-0.0000594 , -0.0000252 ]
[ 0.03 , 0.03 , 0 , 0 , 0.03 , 0.03 , -0.0000102 , 0.0000111 , 0 , -0.0000226 , -0.0000252 , 0 ]

[ 0.06 , 0.06 , 0.03 , 0 , 0.03 , 0.03 , -0.0000131 , 0.0000172 , 0.0000111 , -0.0000594 ,


-0.0000666 , -0.0000252 ]
Setup matrix of coordinates, displacements , beta values, gamma values of each element:
> x:=matrix(4,3,[]):
> y:=matrix(4,3,[]):
> u:=matrix(4,3,[]):
> v:=matrix(4,3,[]):
> for i from 1 to 4 do
> for j from 1 to 3 do
> x[i,j]:=edata[i,j];
> y[i,j]:=edata[i,j+3]:
> u[i,j]:=edata[i,j+6]:
> v[i,j]:=edata[i,j+9]:
> od:
> od:
> beta:=matrix(4,3,[]):
> Gamma:=matrix(4,3,[]):
> d:=matrix(4,6,[]):
> B1:=matrix(4,6,[]):
> B2:=matrix(4,6,[]):
> B3:=matrix(4,6,[]):
> c:=[2,3,1,2]:
> for i from 1 to 4 do:
> for j from 1 to 3 do:
> beta[i,j]:=y[i,c[j]]-y[i,c[j+1]];
> Gamma[i,j]:=-(x[i,c[j]]-x[i,c[j+1]]);
> d[i,2*j-1]:=u[i,j];
> d[i,2*j]:=v[i,j];
> B1[i,2*j-1]:=beta[i,j];
> B1[i,2*j]:=0;
> B2[i,2*j-1]:=0;
> B2[i,2*j]:=Gamma[i,j];
> B3[i,2*j-1]:=Gamma[i,j];
> B3[i,2*j]:=beta[i,j];
> od:
> od:
> print(x);(Each row are x1, x2 and x3 of each element, 1..4 respectively)
0
0.03
0

0.03 0.06 0.03

0.03 0.03
0

0.06 0.06 0.03


> print(y);(Each row are y1, y2 and y3 of each element, 1..4 respectively)
0

0
0
0.03
0.03

0.03

0.03

0.03

0.03

Displacements of each element:


> print(d);(Each row are displacements at node 1, 2 and 3 of each element, 1..4 respectively)

0
0
-0.0000102 -0.0000226
0
0

-0.0000102 -0.0000226 -0.0000131 -0.0000594 0.0000111 -0.0000252

-0.0000102 -0.0000226 0.0000111 -0.0000252

0
0

-0.0000131 -0.0000594 0.0000172 -0.0000666 0.0000111 -0.0000252


Beta values of each element:
> print(beta);(Each row are beta1, beta2 and beta3 of each element, 1..4 respectively)
0
-0.03 0.03

-0.03 0.03
0

0
0.03 -0.03

0.03 -0.03
0
Gamma values of each element:
> print(Gamma);(Each row are gamma1, gamma2 and gamma3 of each element, 1..4
respectively)
-0.03

-0.03

-0.03

-0.03

0
0
0.03
0.03

0.03

0.03

B matrix of element no 1x 2Area


> BB1:=stackmatrix(submatrix(B1,1..1,1..6),submatrix(B2,1..1,1..6)
,submatrix(B3,1..1,1..6));
-0.03

BB1 := 0

-0.03

0
-0.03
-0.03

0.03
0
0

0
0
0.03

0
0
0.03

0.03

>
B matrix of element no 2x 2Area
> BB2:=stackmatrix(submatrix(B1,2..2,1..6),submatrix(B2,2..2,1..6)
,submatrix(B3,2..2,1..6));
-0.03

BB2 := 0

-0.03

0
-0.03
-0.03

0.03
0
0
0
0
0.03

0
0
0.03

0.03

>
B matrix of element no 3x 2Area
> BB3:=stackmatrix(submatrix(B1,3..3,1..6),submatrix(B2,3..3,1..6)
,submatrix(B3,3..3,1..6));
0
0

BB3 := 0
-0.03

0
-0.03

0.03
0
-0.03
0
0.03
0
0.03 0.03
0

-0.03

>
B matrix of element no 4 x 2Area
> BB4:=stackmatrix(submatrix(B1,4..4,1..6),submatrix(B2,4..4,1..6)
,submatrix(B3,4..4,1..6));

0
0.03
0
-0.03
0
0

-0.03
0
0.03
0
0
BB4 := 0

0
0.03 0.03
0
-0.03
-0.03
Element stress of element no1
> sigma(1):=evalf(evalm(DD&*BB1&*transpose(submatrix(d,1..1,1..6))
),6);
-76310.3

( 1 ) := -25182.4

-56641.7
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Principal stress 1 and 2 of element no 1
> principal_stress_1:=evalf((sigma(1)[1,1]+sigma(1)[2,1])/2+((sigm
a(1)[1,1]-sigma(1)[2,1])^2/4+(sigma(1)[3,1])^2)^0.5,6);
principal_stress_1 := 11397.0
> principal_stress_2=evalf((sigma(1)[1,1]+sigma(1)[2,1])/2-((sigma
(1)[1,1]-sigma(1)[2,1])^2/4+(sigma(1)[3,1])^2)^0.5,6);
principal_stress_2 = -112890.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Principal stress direction of element no1 (in degree)
> theta:=evalf(180/(Pi)*1/2*arctan(2*sigma(1)[3,1]/(sigma(1)[1,1]sigma(1)[2,1])),3);
:= 33.1
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Element stress of element no2
> sigma(2):=evalf(evalm(DD&*BB2&*transpose(submatrix(d,2..2,1..6))
),6);
-28114.6

( 2 ) := -26611.

-38846.7
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Principal stress 1 and 2 of element no 2
> principal_stress_1:=evalf((sigma(2)[1,1]+sigma(2)[2,1])/2+((sigm
a(2)[1,1]-sigma(2)[2,1])^2/4+(sigma(2)[3,1])^2)^0.5,6);
principal_stress_1 := 11491.3
> principal_stress_2=evalf((sigma(2)[1,1]+sigma(2)[2,1])/2-((sigma
(2)[1,1]-sigma(2)[2,1])^2/4+(sigma(2)[3,1])^2)^0.5,6);
principal_stress_2 = -66216.9
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Principal stress direction of element no2 (in degree)
> theta:=evalf(180/(Pi)*1/2*arctan(2*sigma(2)[3,1]/(sigma(2)[1,1]sigma(2)[2,1])),3);
:= 44.5
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Element stress of element no3
> sigma(3):=evalf(evalm(DD&*BB3&*transpose(submatrix(d,3..3,1..6))

),6);
76624.7

( 3 ) := 7953.

-9774.4
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Principal stress 1 and 2 of element no 3
> principal_stress_1:=evalf((sigma(3)[1,1]+sigma(3)[2,1])/2+((sigm
a(3)[1,1]-sigma(3)[2,1])^2/4+(sigma(3)[3,1])^2)^0.5,6);
>
principal_stress_1 := 77988.9
> principal_stress_2=evalf((sigma(3)[1,1]+sigma(3)[2,1])/2-((sigma
(3)[1,1]-sigma(3)[2,1])^2/4+(sigma(3)[3,1])^2)^0.5,6);
principal_stress_2 = 6588.9
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Principal stress direction of element no3 (in degree)
> theta:=evalf(180/(Pi)*1/2*arctan(2*sigma(3)[3,1]/(sigma(3)[1,1]sigma(3)[2,1])),3);
:= -7.92
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>##
Element stress of element no4
> sigma(4):=evalf(evalm(DD&*BB4&*transpose(submatrix(d,4..4,1..6))
),6);
27860.5

( 4 ) := -38806.3

-27820.1
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Principal stress 1 and 2 of element no 4
> principal_stress_1:=evalf((sigma(4)[1,1]+sigma(4)[2,1])/2+((sigm
a(4)[1,1]-sigma(4)[2,1])^2/4+(sigma(4)[3,1])^2)^0.5,6);
principal_stress_1 := 37944.6
> principal_stress_2=evalf((sigma(4)[1,1]+sigma(4)[2,1])/2-((sigma
(4)[1,1]-sigma(4)[2,1])^2/4+(sigma(4)[3,1])^2)^0.5,6);
principal_stress_2 = -48890.4
<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>###
Principal stress direction of element no4 (in degree)
> theta:=evalf(180/(Pi)*1/2*arctan(2*sigma(4)[3,1]/(sigma(4)[1,1]sigma(4)[2,1])),3);
:= -19.9
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>##
Note: Small load 10 kN creats high stresses in each element due to small area and high value of E.

You might also like