Sei sulla pagina 1di 9

Jen Ming Victor Shih 994751648

Prof C.Steeves

Advanced Aerospace Structures Project 2


Results
ii) Physical Coordinates of all the nodes (16 elements arranges along the length of beam)
xg =

x
0
0.2500
0.5000
0.7500
1.0000
1.2500
1.5000
1.7500
2.0000
2.2500
2.5000
2.7500
3.0000
3.2500
3.5000
3.7500
4.0000
4.0000
3.7500
3.5000
3.2500
3.0000
2.7500
2.5000
2.2500
2.0000
1.7500
1.5000
1.2500
1.0000
0.7500
0.5000
0.2500
0

y
0
0.0156
0.0313
0.0469
0.0625
0.0781
0.0938
0.1094
0.1250
0.1406
0.1563
0.1719
0.1875
0.2031
0.2188
0.2344
0.2500
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000
0.5000

xg is the physical global coordinates of all the nodes in the


beam, the nodal are numbered starting at the bottom left of
the beam and are subsequently numbered along the border
of the beam in a counter-clockwise direction
the code uses a tailored fetch algorithm to generate element
nodal coordinates from xg
figure1 shows how the beam is broken down

Jen Ming Victor Shih 994751648


Prof C.Steeves

iii) Displacement of the nodes along the right edge of the beam:
U=

x
-0.0000
0.0002

y
-0.0023
-0.0023

(bottom)
(top)

iv) Contour Plot of the strains in the beam:

Figure 1: x direction strain is shown to vary across the height of the beam

Figure 2: y direction strain is shown to vary along the length of the beam

Jen Ming Victor Shih 994751648


Prof C.Steeves

Figure 3: y-direction strain mesh plot to emphasize area of greatest change

Figure 4: xy-direction strain has an oscillatory effect along the length of the beam

v) Contour Plot of von Mises equivalent stress:

Figure 5: von-Mises equivalent stress varies across the length of the beam

Figure 6: mesh plot of the von-Mises equivalent stress showing the variation along the rest of the beam

Jen Ming Victor Shih 994751648


Prof C.Steeves

Jen Ming Victor Shih 994751648


Prof C.Steeves

MATLAB Code
%% Advanced Aerospace Structures
% Assignment 4: Finite Element Solution to Tapered Cantilever Beam
% Isoparametric Element (15 QuadralateralElemets)
% Victor Shih
clc;
clearall;
closeall;
% assume plane stress
t = 0.1;
E = 75e9;
nu = 0.3;
D = (E/(1-nu^2))*[1 nu 0;...
nu 1 0;...
0 0 (1-nu)/2];
%% FORMING NODES xg
elems = 16;
nodes = 2*(elems+1);
cx = 0:4/elems:4;
cyt = zeros(1,elems+1) + 0.5;
cyb = zeros(1,elems+1);
fori = 1:elems+1
cyb(i) = 0.25/4*cx(i);
end
xg = horzcat([cx;cyb],[cx(elems+1:-1:1);cyt])'
figure(1)
plot(xg(:,1),xg(:,2), '-ob')
holdon
axis([-0.05 4.05 -0.05 0.55])
gridon
% view(2)
%% FORM GLOBAL STIFFNESS MATRIX and GLOBAL FORCE VECTOR
Kg = zeros(2*nodes);
fg = zeros(2*nodes,1);
%element loop
fori = 1:elems
x = form_x(i,elems,nodes,xg);
K = form_K(D,x,t);
L = form_fetch(i,nodes);
Kg = Kg + L'*K*L;
ifi> 12
load = [0, -1e3];
N = [1 0 0 0 0 0 1 0;...
0 1 0 0 0 0 0 1];
f = (load*N)';
fg = fg + L'*f;
end
end
%% CALCULATE DISPLACEMTN dg
%remove boundary nodes
K = Kg(3:2*nodes-2,3:2*nodes-2);
f = fg(3:2*nodes-2);
%calculate displacement
d = K\f;

Jen Ming Victor Shih 994751648


Prof C.Steeves
%put back boundary
dg = zeros(2*nodes,1);
dg(3:2*nodes-2) = d;
U = zeros(nodes,2);
fori = 1:nodes
U(i,1) = dg(i*2-1);
U(i,2) = dg(i*2);
end
U(nodes/2:nodes/2+1,:)
newxg = xg + U;
plot(newxg(:,1),newxg(:,2), '-or')
xlabel('x');
ylabel('y');
title('16 ISOPARAMETRIC ELEMENT FEM DEFORMATION')
holdoff
%% CALCULATE STRAIN AND STRESS
%element loop
e_x
= zeros(2,2*elems);
e_y
= zeros(2,2*elems);
e_xy = zeros(2,2*elems);
sv = zeros(2,2*elems);
x_gauss = zeros(2,2*elems);
y_gauss = zeros(2,2*elems);
fori = 1:elems
x = form_x(i,elems,nodes,xg);
%map physical coordinate of qausspts
[x_sub, y_sub] = form_x_gauss(x);
x_gauss(:,i*2-1:i*2) = x_sub;
y_gauss(:,i*2-1:i*2) = y_sub;
%1st Point (point a')
xi1 = -1/sqrt(3);
xi2 = -1/sqrt(3);
[H1,detJ1] = func_hesssion(xi1,
%3rd Point (point b')
xi1 = 1/sqrt(3);
xi2 = -1/sqrt(3);
[H2,detJ2] = func_hesssion(xi1,
%4th Point (point c')
xi1 = 1/sqrt(3);
xi2 = 1/sqrt(3);
[H3,detJ3] = func_hesssion(xi1,
%2nd Point (point d')
xi1 = -1/sqrt(3);
xi2 = 1/sqrt(3);
[H4,detJ4] = func_hesssion(xi1,

xi2, x);

xi2, x);

xi2, x);

xi2, x);

L = form_fetch(i,nodes);
d = L*dg;
e_a
e_b
e_c
e_d

%% STRAIN at gauss point


= H1*d;
= H2*d;
= H3*d;
= H4*d;

e_x(:,i*2-1:i*2) = [e_a(1) e_d(1); e_b(1) e_c(1)];


e_y(:,i*2-1:i*2) = [e_a(2) e_d(2); e_b(2) e_c(2)];
e_xy(:,i*2-1:i*2) = [e_a(3) e_d(3); e_b(3) e_c(3)];
s_a
s_b
s_c
s_d

%% STRESS at gauss point


= D*H1*d;
= D*H2*d;
= D*H3*d;
= D*H4*d;

Jen Ming Victor Shih 994751648


Prof C.Steeves

s_av
s_bv
s_cv
s_dv

=
=
=
=

sqrt(
sqrt(
sqrt(
sqrt(

s_a(1)^2
s_b(1)^2
s_c(1)^2
s_d(1)^2

s_a(1)*s_a(2)
s_b(1)*s_b(2)
s_c(1)*s_c(2)
s_d(1)*s_d(2)

+
+
+
+

s_a(2)^2
s_b(2)^2
s_c(2)^2
s_d(2)^2

+
+
+
+

3*s_a(3)^2
3*s_b(3)^2
3*s_c(3)^2
3*s_d(3)^2

);
);
);
);

sv(:,i*2-1:i*2) = [s_avs_dv; s_bvs_cv];


end
%ex-gauss pt plot
figure(2)
plot(xg(:,1),xg(:,2), '-ob')
axis([-0.05 4.05 -0.05 0.55])
xlabel('x');
ylabel('y');
title('\epsilon_x')
holdon
gridon
[C,h] = contour(x_gauss,y_gauss,e_x);
clabel(C,h);
holdoff
%ey-gauss pt plot
figure(3)
plot(xg(:,1),xg(:,2), '-ob')
axis([-0.05 4.05 -0.05 0.55])
xlabel('x');
ylabel('y');
title('\epsilon_y')
holdon
gridon
[C,h] = contour(x_gauss,y_gauss,e_y);
clabel(C,h);
holdoff
%
%
%
%
%
%
%
%
%

% %exy-gauss pt plot
figure(4)
plot(xg(:,1),xg(:,2), '-ob')
hold on
grid on
[C,h] = contour(x_gauss,y_gauss,e_xy);
clabel(C,h);
axis([0 4 0 0.5])
hold off

%Von-Mise Equivalent stress - gauss pt plot


figure(5)
plot(xg(:,1),xg(:,2), '-ob')
xlabel('x');
ylabel('y');
title('\sigma_v')
axis([-0.05 4.05 -0.05 0.55])
holdon
gridon
[C,h] = contour(x_gauss,y_gauss,sv);
clabel(C,h);
holdoff
function x = form_x(i,elems,nodes,xg)
L = zeros(4, 2*(elems+1));
L(1,nodes-i+1) = 1;
%fetch
L(2,i) = 1;
%fetch
L(3,i+1) = 1;
%fetch
L(4,nodes-i) = 1;
%fetch

node
node
node
node

a
b
c
d

x = L*xg;

Jen Ming Victor Shih 994751648


Prof C.Steeves

end

function [H,detJ] = func_hesssion(xi1, xi2, x)


J = 0.25*[ xi2-1, 1-xi2, 1+xi2, -xi2-1;...
xi1-1, -xi1-1, 1+xi1, 1-xi1]*x;
G = 0.25*[ xi2-1, 1-xi2, 1+xi2, -xi2-1;...
xi1-1, -xi1-1, 1+xi1, 1-xi1];
detJ = J(1,1)*J(2,2)-J(1,2)*J(2,1);
Hv = J\G;
H = [Hv(1,1) 0 Hv(1,2) 0 Hv(1,3) 0 Hv(1,4) 0;...
0 Hv(2,1) 0 Hv(2,2) 0 Hv(2,3) 0 Hv(2,4);...
Hv(2,1) Hv(1,1) Hv(2,2) Hv(1,2) Hv(2,3) Hv(1,3) Hv(2,4) Hv(1,4)];

function [x_gauss, y_gauss] = form_x_gauss(x)


%point a
xi1 = -1/sqrt(3);
xi2 = -1/sqrt(3);
N = form_shape(xi1,xi2);
xa = x(:,1)'*N;
ya = x(:,2)'*N;
%point b
xi1 = 1/sqrt(3);
xi2 = -1/sqrt(3);
N = form_shape(xi1,xi2);
xb = x(:,1)'*N;
yb = x(:,2)'*N;
%point c
xi1 = 1/sqrt(3);
xi2 = 1/sqrt(3);
N = form_shape(xi1,xi2);
xc = x(:,1)'*N;
yc = x(:,2)'*N;
%point d
xi1 = -1/sqrt(3);
xi2 = 1/sqrt(3);
N = form_shape(xi1,xi2);
xd = x(:,1)'*N;
yd = x(:,2)'*N;
x_gauss = [xaxd; xb xc];
y_gauss = [yayd; ybyc];
function K = form_K(D,x,t)
%Gauss Quadrature
%1st Point (point a')
xi1 = -1/sqrt(3);
xi2 = -1/sqrt(3);
[H1,detJ1] = func_hesssion(xi1, xi2, x);
%3rd Point (point b')
xi1 = 1/sqrt(3);

Jen Ming Victor Shih 994751648


Prof C.Steeves
xi2 = -1/sqrt(3);
[H2,detJ2] = func_hesssion(xi1, xi2, x);
%4th Point (point c')
xi1 = 1/sqrt(3);
xi2 = 1/sqrt(3);
[H3,detJ3] = func_hesssion(xi1, xi2, x);
%2nd Point (point d')
xi1 = -1/sqrt(3);
xi2 = 1/sqrt(3);
[H4,detJ4] = func_hesssion(xi1, xi2, x);
K1
K2
K3
K4

=
=
=
=

detJ1*H1'*D*H1;
detJ2*H2'*D*H2;
detJ3*H3'*D*H3;
detJ4*H4'*D*H4;

K = t*(K1+K2+K3+K4);

function N = form_shape(xi1,xi2)
Na
Nb
Nc
Nd

=
=
=
=

1/4*(1-xi1)*(1-xi2);
1/4*(1+xi1)*(1-xi2);
1/4*(1+xi1)*(1+xi2);
1/4*(1-xi1)*(1+xi2);

N = [Na;Nb;Nc;Nd];

function L = form_fetch(i,nodes)
L = zeros(8, nodes*2);
%fetch node a
L(1,2*nodes-2*i+1) = 1;
L(2,2*nodes-2*i+2) = 1;
%fetch node b
L(3,2*i-1) = 1;
L(4,2*i) = 1;
%fetch node c
L(5,2*i+1) = 1;
L(6,2*i+2) = 1;
%fetch node d
L(7,2*nodes-2*i-1) = 1;
L(8,2*nodes-2*i) = 1;
end

Potrebbero piacerti anche