0% found this document useful (0 votes)
47 views5 pages

All S Real T Real W Real

The document defines symbols and constants, then calculates the stiffness matrix K and force vector fq for a plane stress problem using the finite element method. It defines node locations, shape functions, elasticity properties, and incrementally builds up K and fq for different combinations of the parameters s and t through 9 steps. It then solves for the displacements d.

Uploaded by

Phanindra Attada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views5 pages

All S Real T Real W Real

The document defines symbols and constants, then calculates the stiffness matrix K and force vector fq for a plane stress problem using the finite element method. It defines node locations, shape functions, elasticity properties, and incrementally builds up K and fq for different combinations of the parameters s and t through 9 steps. It then solves for the displacements d.

Uploaded by

Phanindra Attada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

clear all;

syms s real;syms t real;syms w real;


E = 700*1000;
v = 0.499;
G = E/(2*(1+v));
k = E/(3*(1-(2*v)));
p=[1;s;t];
a = 23*10^(-6);t1=100;
e = [a*t1;a*t1;a*t1;0];
x1 =0;x2=25;x3=50;x4=50;x5=50;x6=25;x7=0;x8=0;x9=25;y1
=0;y2=5;y3=10;y4=15;y5=20;y6=20;y7=20;y8=10;y9=12.5;
n1=0.25*(1-s)*(1-t)*s*t;
n2=0.5*(1+s)*(1-t)*t*(s-1);
n3=-0.25*(1+s)*(1-t)*s*t;
n4=0.5*(1+s)*(1-t)*(t+1)*s;
n5=0.25*(1+s)*(1+t)*s*t;
n6=-0.5*(1+s)*(1+t)*t*(s-1);
n7=-0.25*(1-s)*(1+t)*s*t;
n8=0.5*s*(1-t)*(t+1)*(s-1);
n9=(s-1)*(s+1)*(t-1)*(t+1);
x = simplify(n1*x1+n2*x2+n3*x3+n4*x4+n5*x5+n6*x6+n7*x7+n8*x8+n9*x9)
y=simplify(n1*y1+n2*y2+n3*y3+n4*y4+n5*y5+n6*y6+n7*y7+n8*y8+n9*y9)
j = [diff(x,s) diff(x,t);diff(y,s) diff(y,t)]
k1=(1/det(j))*((diff(y,t)*diff(n1,s))-(diff(y,s)*diff(n1,t)));
k2=(1/det(j))*((diff(y,t)*diff(n2,s))-(diff(y,s)*diff(n2,t)));
k3=(1/det(j))*((diff(y,t)*diff(n3,s))-(diff(y,s)*diff(n3,t)));
k4=(1/det(j))*((diff(y,t)*diff(n4,s))-(diff(y,s)*diff(n4,t)));
k5=(1/det(j))*((diff(y,t)*diff(n5,s))-(diff(y,s)*diff(n5,t)));
k6=(1/det(j))*((diff(y,t)*diff(n6,s))-(diff(y,s)*diff(n6,t)));
k7=(1/det(j))*((diff(y,t)*diff(n7,s))-(diff(y,s)*diff(n7,t)));
k8=(1/det(j))*((diff(y,t)*diff(n8,s))-(diff(y,s)*diff(n8,t)));
k9=(1/det(j))*((diff(y,t)*diff(n9,s))-(diff(y,s)*diff(n9,t)));
K1=(1/det(j))*((diff(x,t)*diff(n1,s))-(diff(x,s)*diff(n1,t)));
K2=(1/det(j))*((diff(x,t)*diff(n2,s))-(diff(x,s)*diff(n2,t)));
K3=(1/det(j))*((diff(x,t)*diff(n3,s))-(diff(x,s)*diff(n3,t)));
K4=(1/det(j))*((diff(x,t)*diff(n4,s))-(diff(x,s)*diff(n4,t)));
K5=(1/det(j))*((diff(x,t)*diff(n5,s))-(diff(x,s)*diff(n5,t)));
K6=(1/det(j))*((diff(x,t)*diff(n6,s))-(diff(x,s)*diff(n6,t)));
K7=(1/det(j))*((diff(x,t)*diff(n7,s))-(diff(x,s)*diff(n7,t)));
K8=(1/det(j))*((diff(x,t)*diff(n8,s))-(diff(x,s)*diff(n8,t)));
K9=(1/det(j))*((diff(x,t)*diff(n9,s))-(diff(x,s)*diff(n9,t)));
Cd = G*[2 0 0 0;0 2 0 0;0 0 2 0;0 0 0 1];
C = E/((1+v)*(1-(2*v)))*[1-v v v 0;v 1-v v 0;v v 1-v 0;0 0 0 (0.5-v)];
B = eval([k1 0 k2 0 k3 0 k4 0 k5 0 k6 0 k7 0 k8 0 k9 0;0 K1 0 K2 0 K3 0 K4 0 K5 0 K6 0 K7 0 K8 0
K9;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;K1 k1 K2 k2 K3 k3 K4 k4 K5 k5 K6 k6 K7 k7 K8 k8 K9 k9]);
m = [1;1;1;0];
i = eye(4,4);
Bd = (i - ((1/3)*(m*m')))*B
Bv = m'*B
s= -0.774597;t=-0.774597;
w =0.308642;
Ka= eval(p*Bv*det(j)*w);
Kb = eval(w*p*(1/k)*p'*det(j));
Kc = eval(w*Bd'*Cd*Bd*det(j));
fq1 = eval(w*B'*C*e*det(j));
s= -0.774597;t=0;
w =0.493827;
Ka= Ka+eval(p*Bv*det(j)*w);
Kb = Kb+eval(w*p*(1/k)*p'*det(j));
Kc = Kc+eval(w*Bd'*Cd*Bd*det(j));
fq2 = eval(w*B'*C*e*det(j));
s= -0.774597;t=0.774597;
w =0.308642;
Ka= Ka+eval(p*Bv*det(j)*w);
Kb = Kb+eval(w*p*(1/k)*p'*det(j));
Kc = Kc+eval(w*Bd'*Cd*Bd*det(j));
fq3 = eval(w*B'*C*e*det(j));
s= 0;t=-0.774597;
w =0.493827;
Ka= Ka+eval(p*Bv*det(j)*w);
Kb = Kb+eval(w*p*(1/k)*p'*det(j));
Kc = Kc+eval(w*Bd'*Cd*Bd*det(j));
fq4 = eval(w*B'*C*e*det(j));
s= 0;t=0;
w =0.79013;
Ka= Ka+eval(p*Bv*det(j)*w);
Kb = Kb+eval(w*p*(1/k)*p'*det(j));
Kc = Kc+eval(w*Bd'*Cd*Bd*det(j));
fq5 = eval(w*B'*C*e*det(j));
s= 0;t=0.774597;
w =0.493827;
Ka= Ka+eval(p*Bv*det(j)*w);
Kb = Kb+eval(w*p*(1/k)*p'*det(j));
Kc = Kc+eval(w*Bd'*Cd*Bd*det(j));
fq6 = eval(w*B'*C*e*det(j));
s= 0.774597;t=-0.774597;
w =0.308642;
Ka= Ka+eval(p*Bv*det(j)*w);
Kb = Kb+eval(w*p*(1/k)*p'*det(j));
Kc = Kc+eval(w*Bd'*Cd*Bd*det(j));
fq7 = eval(w*B'*C*e*det(j));
s= 0.774597;t=0;
w =0.493827;
Ka= Ka+ eval(p*Bv*det(j)*w);
Kb = Kb+eval(w*p*(1/k)*p'*det(j));
Kc = Kc+eval(w*Bd'*Cd*Bd*det(j));
fq8 = eval(w*B'*C*e*det(j));
s= 0.774597;t=0.774597;
w =0.308642;
Ka= Ka+eval(p*Bv*det(j)*w);
Kb = Kb+eval(w*p*(1/k)*p'*det(j));
Kc = Kc+eval(w*Bd'*Cd*Bd*det(j));
fq9 = eval(w*B'*C*e*det(j));
K = Kc+(Ka'*inv(Kb)*Ka)
fq=fq1+fq2+fq3+fq4+fq5+fq6+fq7+fq8+fq9
K(:,1)=[];K(:,1)=[];K(:,11) =
[];K(:,11)=[];K(:,11)=[];K(:,11)=[];K(1,:)=[];K(1,:)=[];K(11,:)=[];K(11,:)=[];K(11,:)=[];K(11,:)=
[];
fq(1,:)=[];
fq(1,:)=[];
fq(11,:) = [];
fq(11,:)=[];
fq(11,:)=[];
fq(11,:)=[];
d = K\fq
s = 0;t = 0;
epsla = eval(B*[0;0;0.1019;0.0285;0.1915;-0.0199;0.1806;-0.0178; 0.1904;-0.0144;0.1016;-
0.0429;0;0;0;0;0.1047;0.0070])
Cd = [2*G 0 0 0 0 0;0 2*G 0 0 0 0;0 0 2*G 0 0 0;0 0 0 G 0 0;0 0 0 0 G 0;0 0 0 0 0 G];
C = E/((1+v)*(1-(2*v)))*[1-v v v 0 0 0;v 1-v v 0 0 0;v v 1-v 0 0 0;0 0 0 (0.5-v) 0 0;0 0 0 0
(0.5-v) 0;0 0 0 0 0 (0.5-v)];
sigma = Cd*[0.0036;0.0048;0;0.0001;0;0]

x =

25*s + 25

y =

(5*s)/2 + (15*t)/2 - (5*s*t)/2 + 25/2

j =

[ 25, 0]
[ 5/2 - (5*t)/2, 15/2 - (5*s)/2]

K =

1.0e+08 *

Columns 1 through 7

0.0301 -0.0926 -0.0675 -0.3089 -0.0324 -0.0630 0.0042


-0.0926 0.5207 0.2935 0.8762 0.0025 -0.0812 -0.1286
-0.0675 0.2935 0.2047 0.7606 0.0541 0.0867 -0.0208
-0.3089 0.8762 0.7606 4.1132 0.5162 1.1766 0.3238
-0.0324 0.0025 0.0541 0.5162 0.1052 0.2569 0.0955
-0.0630 -0.0812 0.0867 1.1766 0.2569 0.6723 0.2888
0.0042 -0.1286 -0.0208 0.3238 0.0955 0.2888 0.2135
0.1152 -0.2871 -0.2302 -1.1547 -0.1429 -0.2930 0.0579
0.0152 -0.0681 -0.0333 -0.0632 0.0072 0.0369 0.0549
-0.0526 0.3683 0.1451 -0.0218 -0.1128 -0.3789 -0.3467
-0.0058 0.1196 0.0432 -0.0598 -0.0505 -0.1495 -0.0860
-0.1508 0.2772 0.1618 0.5114 0.0588 -0.0217 -0.5544
-0.0224 -0.0236 0.0116 0.2062 0.0541 0.1263 -0.0045
-0.0224 -0.2296 -0.0642 0.2773 0.1418 0.3682 0.0710
0.0573 -0.4664 -0.2560 -0.6740 0.0304 0.1309 0.0523
0.1138 -0.2909 -0.2308 -1.1541 -0.1439 -0.2870 0.0576
0.0214 0.3637 0.0641 -0.7008 -0.2636 -0.7140 -0.3091
0.4612 -1.1534 -0.9224 -4.6240 -0.5766 -1.1554 0.2306

Columns 8 through 14

0.1152 0.0152 -0.0526 -0.0058 -0.1508 -0.0224 -0.0224


-0.2871 -0.0681 0.3683 0.1196 0.2772 -0.0236 -0.2296
-0.2302 -0.0333 0.1451 0.0432 0.1618 0.0116 -0.0642
-1.1547 -0.0632 -0.0218 -0.0598 0.5114 0.2062 0.2773
-0.1429 0.0072 -0.1128 -0.0505 0.0588 0.0541 0.1418
-0.2930 0.0369 -0.3789 -0.1495 -0.0217 0.1263 0.3682
0.0579 0.0549 -0.3467 -0.0860 -0.5544 -0.0045 0.0710
0.5867 0.0851 -0.2930 -0.0004 -1.1551 -0.1727 -0.2870
0.0851 0.0289 -0.1231 -0.0195 -0.2812 -0.0235 -0.0186
-0.2930 -0.1231 0.6720 0.1483 1.1765 0.0468 -0.0812
-0.0004 -0.0195 0.1483 0.0644 0.0600 -0.0294 -0.1183
-1.1551 -0.2812 1.1765 0.0600 4.1130 0.4840 0.8761
-0.1727 -0.0235 0.0468 -0.0294 0.4840 0.0881 0.1963
-0.2870 -0.0186 -0.0812 -0.1183 0.8761 0.1963 0.5209
0.0576 0.0213 -0.1884 -0.1207 0.4435 0.1163 0.4086
0.5743 0.0863 -0.2871 0.0003 -1.1536 -0.1716 -0.2909
0.2306 -0.0512 0.4834 0.2044 -0.2218 -0.1901 -0.5942
2.3090 0.3460 -1.1549 -0.0002 -4.6238 -0.6917 -1.1538

Columns 15 through 18

0.0573 0.1138 0.0214 0.4612


-0.4664 -0.2909 0.3637 -1.1534
-0.2560 -0.2308 0.0641 -0.9224
-0.6740 -1.1541 -0.7008 -4.6240
0.0304 -0.1439 -0.2636 -0.5766
0.1309 -0.2870 -0.7140 -1.1554
0.0523 0.0576 -0.3091 0.2306
0.0576 0.5743 0.2306 2.3090
0.0213 0.0863 -0.0512 0.3460
-0.1884 -0.2871 0.4834 -1.1549
-0.1207 0.0003 0.2044 -0.0002
0.4435 -1.1536 -0.2218 -4.6238
0.1163 -0.1716 -0.1901 -0.6917
0.4086 -0.2909 -0.5942 -1.1538
0.5543 0.0578 -0.4551 0.2305
0.0578 0.5833 0.2305 2.3060
-0.4551 0.2305 0.9793 0.9226
0.2305 2.3060 0.9226 9.2503
fq =

1.0e+07 *

-0.1342
0.6708
0.5367
2.6833
0.2683
0.6708
0.5367
0
0.1342
-0.6708
-0.0000
-2.6833
-0.2683
-0.6708
-1.0733
0
0.0000
0

d =

0.1019
0.0285
0.1915
-0.0199
0.1806
-0.0178
0.1904
-0.0144
0.1016
-0.0429
0.1047
-0.0070

epsla =

0.0036
0.0048
0
0.0001

sigma =

1.0e+03 *

1.6811
2.2415
0
0.0233

You might also like