You are on page 1of 1

2nd Class Codes How to construct Global Stiffness Matrix

>> K=zeros(10);

>> R=zeros(10,1);

>> k1=[111 201 301;201 222 232;301 232 333];

>> r1=[11;12;13];

>> lm1=[1 2 5];

>> K(lm1,lm1)=K(lm1,lm1)+k1;

>> R(lm1)=R(lm1)+r1;

>> k2=[77 80 90;80 88 100;90 100 99];

>> r2=[21;22;23];

>> lm2=[2 6 5];

>> K(lm2,lm2)=K(lm2,lm2)+k2;

>> R(lm2)=R(lm2)+r2;

>> R(lm1)=R(lm1)+r1;

3nd Class Codes How to make programme of Transmission tower bar


element

..k1=1000; k2=2000; f2=-500; f3=1000;K=zeros(3,3); ke1=k1*[1 -1;-1


1];K(1:2,1:2)=K(1:2,1:2)+ke1;ke2=k2*[1 -1,-1 1]; K(2:3,2:3)=K(2:3,2:3)+ke2; F=[0;f2;f3];D=zeros(3,1);

function k=TrussElemStiff(e,A,coord)
%Plane Truss Element (e,A,coord)
%Generates Stiffness Matrix for a Plane truss element
%e=modulus of elasticity
%A=area of cross section
%coord=coordinates of an element
x1=coord(1,1);y1=coord(1,2);
x2=coord(2,1);y2=coord(2,2);
L=sqrt((x2-x1)^2+(y2-y1)^2);
ls=(x2-x1)/L;ms=(y2-y1)/L;
k=e*A/L*[ls^2 ls*ms -ls^2 ls*ms;
ls*ms ms^2 -ls*ms -ms^2;
-ls^2 -ls*ms ls^2 ls*ms;
-ls*ms -ms^2 ls*ms ms^2];

You might also like