# Engineering Mechanics

Solution

choice=menu(‘Which solution do you want’,’Solution 1′, ‘Solution 2’, ‘Solution 3′);

if choice==1

%order of forces in members-CD,BC,BD,DE,BE,AB,AE,EF,AF

A=[5/sqrt(29) 0 0 0 0 0 0 0 0;2/sqrt(29) 1 0 0 0 0 0 0 0;5/sqrt(29) 0 5/sqrt(29) 0 0 0 0 0 0;-2/sqrt(29) 0 2/sqrt(29) 1 0 0 0 0 0;…

0 0 5/sqrt(29) 0 5/sqrt(29) 0 0 0 0; 0 -1 -2/sqrt(29) 0 2/sqrt(29) 1 0 0 0;0 0 0 0 5/sqrt(29) 0 5/sqrt(29) 0 0;0 0 0 -1 -2/sqrt(29) 0 2/sqrt(29) 1 0;…

0 0 0 0 0 0 5/sqrt(29) 0 1];

b=[80;0;0;0;60;0;0;0;0];

x=A\b;

C=cell(10,3);

C{1,1}=’Member’;

C{1,2}=’Force(kN)’;

C{1,3}=’Type’;

C{2,1}=’CD’;C{3,1}=’BC’;C{4,1}=’BD’;C{5,1}=’DE’;C{6,1}=’BE’;C{7,1}=’AB’;C{8,1}=’AE’;C{9,1}=’EF’;C{10,1}=’AF’;

for i=2:1:10

C{i,2}=x(i-1);

if x(i-1)<0

C{i,3}=’Compression’;

else

C{i,3}=’Tension’;

end

end

C

end

if choice==2

vo=20;

theta=30;

alpha=25;

g=9.81;

vx=vo*sind(theta)*cosd(alpha);

vy=vo*sind(theta)*sind(alpha);

vz=vo*cosd(theta);

tb=(2*vz)/g;

t=linspace(0,tb,200);

xin=0;yin=0;zin=0;

for i=1:5

tb=(2*vz)/g;

t=linspace(0,tb,200);

for j=1:200

x1(j,i)=xin+vx*t(j);

y1(j,i)=yin+vy*t(j);

z1(j,i)=zin+vz*t(j)-0.5*g*t(j)^2;

end

xin=x1(200,i);

yin=y1(200,i);

zin=0;

vx=0.8*vx;

vy=0.8*vy;

vz=0.8*vz;

end

x=[x1(:,1);x1(:,2);x1(:,3);x1(:,4);x1(:,5)];

y=[y1(:,1);y1(:,2);y1(:,3);y1(:,4);y1(:,5)];

z=[z1(:,1);z1(:,2);z1(:,3);z1(:,4);z1(:,5)];

plot3(x,y,z);

grid on;

xlabel(‘x(m)’);

ylabel(‘y(m)’);

zlabel(‘z(m)’);

end

if choice==3

k=1;

d=linspace(0,4,1000);

w=linspace(0,8,1000);

S=0.001;

n=0.05;

for i=1:1000

for j=1:1000

Q(i,j)=((k*d(i)*w(j)/n)*(w(j)*d(i)/(w(j)+2*d(i)))^(2/3))*sqrt(S);

end

end

surf(Q);

end