Escolar Documentos
Profissional Documentos
Cultura Documentos
MatlabChap02 PDF
MatlabChap02 PDF
The following ElasticTetElement and ElasticTetFaceNormalLoad generate element stiffness matrix and
equivalent load vector due to normal loads on faces of the tetrahedral. After the nodal displacements are
known, the second ElasticTetElement function computes element results.
MatlabFiles\Chap02\ElasticTetElement.m
% @ke, reD = ElasticTetElementHe, nu, alpha, dt, bx, by, bz, coordL
% Computes elements equations for a tetrahedral element
% e = Modulus of elasticity
% nu = Poisson's ratio
% h = Thickness
% alpha = coefficient of thermal expansion
% deltaT = temperature change
% bx, by, bz = components of the body force
% coord = coordinates at the element ends
e0 = alpha*deltaT*@1; 1; 1; 0; 0; 0D;
c = eêHH1 + nuL*H1 - 2*nuLL*@1 - nu, nu, nu, 0, 0, 0;
nu, 1 - nu, nu, 0, 0, 0;
nu, nu, 1 - nu, 0, 0, 0;
0, 0, 0, H1 - 2*nuLê2, 0, 0;
0, 0, 0, 0, H1 - 2*nuLê2, 0;
0, 0, 0, 0, 0, H1 - 2*nuLê2D;
@a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2, d3, d4, VD = ...
function @a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, ...
end
MatlabFiles\Chap02\ElasticTetFaceNormalLoad.m
switch HfaceL
x4=coordH4,1L; y4=coordH4,2L; z4=coordH4,3L;
case 1
rq = Aê3 *@0, 0, 0, qx, qy, qz, qx, qy, qz, qx, qy, qzD';
case 4
MatlabFiles\Chap02\TetElementResults.m
5
e0 = alpha*deltaT*@1; 1; 1; 0; 0; 0D;
C = eêHH1 + nuL*H1 - 2*nuLL*@1 - nu, nu, nu, 0, 0, 0;
nu, 1 - nu, nu, 0, 0, 0;
nu, nu, 1 - nu, 0, 0, 0;
0, 0, 0, H1 - 2*nuLê2, 0, 0;
0, 0, 0, 0, H1 - 2*nuLê2, 0;
0, 0, 0, 0, 0, H1 - 2*nuLê2D;
@a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2, d3, d4, VD = ...
function @a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, ...
end
à Example 2.1 p. 51
7
z
4
y
3
2
x
MatlabFiles\Chap02\TetSolidSoln.m
8
lm = @D;
for i=1:nel
end
K=zerosHdofL; R = zerosHdof,1L;
% Generate equations for each element and assemble them.
for i=1:nel
con = connHi,:L;
lm = lmmHi,:L;
@k, rD = ElasticTetElementHe, nu, alpha, deltaT,...
bx, by, bz, nodesHcon,:LL;
KHlm, lmL = KHlm, lmL + k;
RHlmL = RHlmL + r;
end
K
R
>> TetSolidSoln
K=
9
1.0e+005 *
Columns 1 through 6
Columns 7 through 12
R=
1.0e+003 *
-1.8006
-1.0804
-1.0804
1.8006
-1.0804
-1.0804
0
2.1607
10
0
0
0
2.1607
d=
0
0
0
0
0
0
0
0
0
0
0
0.0186
reactions =
1.0e+003 *
1.4828
0.8897
0
-1.4828
0.8897
0
0
-1.7794
0
sig =
-14.2353
-14.2353
0.0000
0
0
0
11
ps =
-14.2353
-14.2353
0.0000
EffectiveStress =
14.2353
MatlabFiles\Chap02\Solid8ElasElement.m
gpLocs = @-pt, -pt, -pt; -pt, -pt, pt; -pt, pt, -pt;...
pt=1êsqrtH3L;
gpWts = @1,1,1,1,1,1,1,1D;
-pt, pt, pt; pt, -pt, -pt; pt, -pt, pt; pt, pt, -pt; pt, pt, ptD;
ke=zerosH24L; re=zerosH24,1L;
for i=1:lengthHgpWtsL
r = gpLocsHi, 1L; s = gpLocsHi, 2L; t = gpLocsHi, 3L;
w = gpWtsHiL;
n = @H1ê8L*H1 - rL*H1 - sL*H1 - tL, H1ê8L*Hr + 1L*H1 - sL*H1 - tL,...
H1ê8L*Hr + 1L*Hs + 1L*H1 - tL, H1ê8L*H1 - rL*Hs + 1L*H1 - tL,...
H1ê8L*H1 - rL*H1 - sL*Ht + 1L, H1ê8L*Hr + 1L*H1 - sL*Ht + 1L,...
H1ê8L*Hr + 1L*Hs + 1L*Ht + 1L, H1ê8L*H1 - rL*Hs + 1L*Ht + 1LD;
dnr = @-HH1 - sL*H1 - tLLê8, HH1 - sL*H1 - tLLê8, ...
HH1 + sL*H1 - tLLê8, -HH1 + sL*H1 - tLLê8,...
-HH1 - sL*H1 + tLLê8, HH1 - sL*H1 + tLLê8,...
HH1 + sL*H1 + tLLê8, -HH1 + sL*H1 + tLLê8D;
dns=@-HH1 - rL*H1 - tLLê8, -HH1 + rL*H1 - tLLê8, ...
HH1 + rL*H1 - tLLê8, HH1 - rL*H1 - tLLê8, -HH1 - rL*H1 + tLLê8,...
-HH1 + rL*H1 + tLLê8, HH1 + rL*H1 + tLLê8, HH1 - rL*H1 + tLLê8D;
dnt=@-HH1 - rL*H1 - sLLê8, -HH1 + rL*H1 - sLLê8, ...
end
13
ke = ke + detJ*w* b*c*b';
re = re + detJ*w*nn*@bx; by; bzD+ detJ*w*b*c*e0;
end
MatlabFiles\Chap02\Solid8ElasFaceLoad.m
gpWts = @1,1,1,1D;
rq=zerosH24,1L;
for i=1:lengthHgpWtsL
a = gpLocsHi,1L; b = gpLocsHi,2L; w = gpWtsHiL;
switch HfaceL
0, 0, 0, 0D;
end
rq = rq + Js*w*qn*nn*nv;
end
15
MatlabFiles\Chap02\Solid8ElasEdgeLoad.m
gpWts = @1,1D;
rq=zerosH24,1L;
for i=1:lengthHgpWtsL
a = gpLocsHiL; w = gpWtsHiL;
switch HedgeL
Jc=normHvL;
nn=@D;
end
rq = rq + Jc*w*nn*q;
end
MatlabFiles\Chap02\Solid8ElasResults.m
sig = c*Heps-e0L
ps = eigH@sigH1L, sigH4L, sigH6L;
sigH4L, sigH2L, sigH5L;
end
à Example p. 75
z Pressure
y
8
7
5
6
3
1
2
MatlabFiles\Chap02\Solid8BeamEx.m
conn = @@1:8DD;
0, 0, 1; 4, 1, 1; 4, 2, 1; 0, 2, 1D;
end
lmm=@lmm; lmD;
end
K=zerosHdofL; R = zerosHdof,1L;
% Generate equations for each element and assemble them.
for i=1:nel
con = connHi,:L;
lm = lmmHi,:L;
@k, rD = Solid8ElasElementHe, nu, alpha, deltaT, ...
bx, by, bz, nodesHcon,:LL;
KHlm, lmL = KHlm, lmL + k;
RHlmL = RHlmL + r;
end
% Add the distributed load contributions
for i=1:nel
con = connHi,:L;
lm = lmmHi,:L;
r = Solid8ElasFaceLoadH6, -q, nodesHcon,:LL;
RHlmL = RHlmL + r;
end
debc = @1, 2, 3, 10, 11, 12, 13, 14, 15, 22, 23, 24D;
% Nodal solution and reactions
for i=1:nel
fprintfH1,'Results for element %3.0g \n',iL
EffectiveStress=Solid8ElasResultsHe, nu, alpha, deltaT, ...
nodesHconnHi,:L,:L, dHlmmHi,:LLL
end
>> Solid8BeamEx
d=
0
0
0
-0.0492
-0.0044
20
-0.2780
-0.0526
0.0042
-0.2799
0
0
0
0
0
0
0.0533
0.0038
-0.2819
0.0564
-0.0016
-0.2837
0
0
0
reactions =
1.0e+005 *
5.2482
0.2763
0.6959
5.4185
-0.2479
1.3485
-5.2482
-0.2913
1.6516
-5.4185
0.2629
2.3039
sig =
-0.2468
-0.1966
-3.9833
-0.0000
21
0.0058
-13.2558
EffectiveStress =
23.2659