0% found this document useful (0 votes)
10 views3 pages

Final Code

Uploaded by

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

Final Code

Uploaded by

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

E1=210e9; E2=E1;

A1=8e-2; A2=A1;
I1=1.2e-4; I2=I1;
L1=3; L2=19;
alpha1=0*pi/180; alpha2=270*pi/180;
%Local stiffness matrix for element 1 with zero padding
A=A1;
L=L1;
I=I1;
c=cos(alpha1); s=sin(alpha1);
k1=[A*c^2+(12*I/L^2)*s^2 (A-12*I/L^2)*c*s -(6*I/L)*s -(A*c^2+(12*I/L^2)*s^2)
-(A-12*I/L^2)*c*s -(6*I/L)*s 0 0 0;
(A-12*I/L^2)*c*s A*s^2+(12*I/L^2)*c^2 (6*I/L)*c -(A-12*I/L^2)*c*s -
(A*s^2+(12*I/L^2)*c^2) (6*I/L)*c 0 0 0;
-(6*I/L)*s (6*I/L)*c 4*I (6*I/L)*s -(6*I/L)*c 2*I 0 0 0;
-(A*c^2+(12*I/L^2)*s^2) -(A-12*I/L^2)*c*s (6*I/L)*s A*c^2+(12*I/L^2)*s^2
(A-12*I/L^2)*c*s (6*I/L)*s 0 0 0;
-(A-12*I/L^2)*c*s -(A*s^2+(12*I/L^2)*c^2) -(6*I/L)*c (A-12*I/L^2)*c*s
A*s^2+(12*I/L^2)*c^2 -(6*I/L)*c 0 0 0;
-(6*I/L)*s (6*I/L)*c 2*I (6*I/L)*s -(6*I/L)*c 4*I 0 0 0;
0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0;

k1 = 9×9
0.0800 0 0 -0.0800 0 0 0 0
0 0.0002 0.0002 0 -0.0002 0.0002 0 0
0 0.0002 0.0005 0 -0.0002 0.0002 0 0
-0.0800 0 0 0.0800 0 0 0 0
0 -0.0002 -0.0002 0 0.0002 -0.0002 0 0
0 0.0002 0.0002 0 -0.0002 0.0005 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

%Local stiffness matrix for element 2 with zero padding


A=A2;
L=L2;
I=I2;
c=cos(alpha2); s=sin(alpha2);
k2=[0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0;
0 0 0 A*c^2+(12*I/L^2)*s^2 (A-12*I/L^2)*c*s -(6*I/L)*s -(A*c^2+(12*I/
L^2)*s^2) -(A-12*I/L^2)*c*s -(6*I/L)*s;
0 0 0 (A-12*I/L^2)*c*s A*s^2+(12*I/L^2)*c^2 (6*I/L)*c -(A-12*I/L^2)*c*s -
(A*s^2+(12*I/L^2)*c^2) (6*I/L)*c ;

1
0 0 0 -(6*I/L)*s (6*I/L)*c 4*I (6*I/L)*s -(6*I/L)*c 2*I ;
0 0 0 -(A*c^2+(12*I/L^2)*s^2) -(A-12*I/L^2)*c*s (6*I/L)*s A*c^2+(12*I/
L^2)*s^2 (A-12*I/L^2)*c*s (6*I/L)*s ;
0 0 0 -(A-12*I/L^2)*c*s -(A*s^2+(12*I/L^2)*c^2) -(6*I/L)*c (A-12*I/L^2)*c*s
A*s^2+(12*I/L^2)*c^2 -(6*I/L)*c ;
0 0 0 -(6*I/L)*s (6*I/L)*c 2*I (6*I/L)*s -(6*I/L)*c 4*I ;
]

k2 = 9×9
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0.0000 0.0000 0.0000 -0.0000 -0.0000
0 0 0 0.0000 0.0800 -0.0000 -0.0000 -0.0800
0 0 0 0.0000 -0.0000 0.0005 -0.0000 0.0000
0 0 0 -0.0000 -0.0000 -0.0000 0.0000 0.0000
0 0 0 -0.0000 -0.0800 0.0000 0.0000 0.0800
0 0 0 0.0000 -0.0000 0.0002 -0.0000 0.0000

K=(E1/L1)*k1 + (E2/L2)*k2 %Global stiffness matrix

K = 9×9
109 ×
5.6000 0 0 -5.6000 0 0 0 0
0 0.0112 0.0168 0 -0.0112 0.0168 0 0
0 0.0168 0.0336 0 -0.0168 0.0168 0 0
-5.6000 0 0 5.6000 0.0000 0.0004 -0.0000 -0.0000
0 -0.0112 -0.0168 0.0000 0.8954 -0.0168 -0.0000 -0.8842
0 0.0168 0.0168 0.0004 -0.0168 0.0389 -0.0004 0.0000
0 0 0 -0.0000 -0.0000 -0.0004 0.0000 0.0000
0 0 0 -0.0000 -0.8842 0.0000 0.0000 0.8842
0 0 0 0.0004 -0.0000 0.0027 -0.0004 0.0000

K_bc=K; %Make a copy of K in K_bc to eliminate...


K_bc( [7,8,9], : )=[]; % ...desired rows and
K_bc( :, [7,8,9] )=[]; % ...desired columns (where d=0)
K_bc

K_bc = 6×6
109 ×
5.6000 0 0 -5.6000 0 0
0 0.0112 0.0168 0 -0.0112 0.0168
0 0.0168 0.0336 0 -0.0168 0.0168
-5.6000 0 0 5.6000 0.0000 0.0004
0 -0.0112 -0.0168 0.0000 0.8954 -0.0168
0 0.0168 0.0168 0.0004 -0.0168 0.0389

F_bc=[0 -32e3 0 0 0 0]'; %Force applied to remaining elements


d_bc=inv(K_bc)*F_bc

d_bc = 6×1
-0.6876
-0.2286
0.0781
-0.6876
-0.0000
0.0724

2
d=[d_bc(1) d_bc(2) d_bc(3) d_bc(4) d_bc(5) d_bc(6) 0 0 0]'; %Construct d
from result and ...
F=K*d

F = 9×1
104 ×
0
-3.2000
0.0000
-0.0000
-0.0000
0
0.0000
3.2000
-9.6000

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy