Hi, This is the Part of the code I am stuck with-
clc
clear all
E=70e9;
A=0.001;
ks=3e6;
P=10e3;
nC=[0 0;0 3; 0 7;4 3];
nEl=4;
nDOF=size(nC,1)*2;
ElConn=[1 4;2 4;3 4;4 5]
%% Formulate Element Stiffness matrices
k= zeros(4,4,nEl);
for count=1:nEl;
n1=ElConn(count,1);
n2=ElConn(count,2);
x1=nC(n1,1)
x2=nC(n2,1)
y1=nC(n1,2);
y2=nC(n2,2);
le=sqrt((x2-x1).^2+(y2-y1).^2);
kdash=((E*A)/le)*[1 -1;-1 1];
l=(x2-x1)/le;
m=(y2-y1)/le;
L=[l m 0 0;0 0 l m];
k(:,:,count)=L'*kdash*L;
end
The Error I am Getting is in line 22 "x2=nC(n2,1)" I think the values I should be getting for x2 are 0, 3, 7 and 3
Thanks in advance for any help
0 Comments
Sign in to comment.