clear all
clc
A=[0 1
0 0.8 1
0 0 0
0 0 0
0 0 0
0 0;
1
0 0 0.6
0 0 0
0 0 0
0 0 0
0 0 0;
0
0 0 -0.8 0
0.8 0.8 0 0
0 0 0
0 0 0 0;
0
0 0 -0.6 0
0.6 -0.6 -1 0 0 0
0 0 0 0 0;
0
0 0 0
0 0 0
1 0 0
0 0 0
0 0 0;
0
0 0 0
-1 0 0
0 1 0
0 0 0
0 0 0;
0
0 0 0
0 -0.8 0 0
0 0 0.8
0 0 0 0 0;
0
0 0 0
0 -0.6 0 0
0 -1 -0.6
0 0 0
0 0;
0
0 0 0
0 0 -0.8 0
-1 0 0
0.8 0 1 0 0;
0
0 0 0
0 0 0.6 0
0 1 0
0.6 0 0 0 0;
0
0 0 0
0 0 0
0 0 0 -0.8 -0.8 0 0
0.8 0;
0
0 0 0
0 0 0
0 0 0 0.6
-0.6 -1 0 -0.6 0;
0
0 0 0
0 0 0
0 0 0
0 0 1
0 0 0;
0
0 0 0
0 0 0
0 0 0
0 0 0
-1 0 1;
0
0 0 0
0 0 0 0
0 0 0
0 0 0 -0.8
-1;
0
0 1 0
0 0 0
0 0 0
0 0 0
0 0.6 0];
C=[0;5.271;0;10.271;0;0;0;10.271;0;0;0;10.271;0;0;0;5.271]
B=inv(A)*C
%PROSES EKSTRAK
ATAU AKSES DATA DARI MATRIK B DARI TIAP VARIABEL
R1=B(1,1)
R2=B(2,1)
R3=B(3,1)
S1=B(4,1)
S2=B(5,1)
S3=B(6,1)
S4=B(7,1)
S5=B(8,1)
S6=B(9,1)
S7=B(10,1)
S8=B(11,1)
S9=B(12,1)
S10=B(13,1)
S11=B(14,1)
S12=B(15,1)
S13=B(16,1)
disp('hasil
perhitungan gaya batang dan reaksi perletakan adalah:')
disp(['R1 = ',num2str(R1),' KN'])
disp(['R2 = ',num2str(R2),' KN'])
disp(['R3 = ',num2str(R3),' KN'])
disp(['S1 = ',num2str(S1),' KN'])
disp(['S2 = ',num2str(S2),' KN'])
disp(['S3 = ',num2str(S3),' KN'])
disp(['S4 = ',num2str(S4),' KN'])
disp(['S5 = ',num2str(S5),' KN'])
disp(['S6 = ',num2str(S6),' KN'])
disp(['S7 = ',num2str(S7),' KN'])
disp(['S8 = ',num2str(S8),' KN'])
disp(['S9 = ',num2str(S9),' KN'])
disp(['S10 = ',num2str(S10),' KN'])
disp(['S11 = ',num2str(S11),' KN'])
disp(['S12 = ',num2str(S12),' KN'])
disp(['S13 = ',num2str(S13),' KN'])
hold on
if
S1==0
plot([0,2],[0,1.5],'-y','linewidth',3) %batang
S1
elseif
S1<0
plot([0,2],[0,1.5],'-r','linewidth',3) %batang
S1
else
plot([0,2],[0,1.5],'-b','linewidth',3) %batang
S1
end
if
S2==0
plot([0,2],[0,0],'-y','linewidth',3) %batang
S2
elseif
S2<0
plot([0,2],[0,0],'-r','linewidth',3) %batang
S2
else
plot([0,2],[0,0],'-b','linewidth',3) %batang
S2
end
if
S3==0
plot([2,4],[1.5,3],'-y','linewidth',3) %batang
S3
elseif
S3<0
plot([2,4],[1.5,3],'-r','linewidth',3) %batang
S3
else
plot([2,4],[1.5,3],'-b','linewidth',3) %batang
S3
end
if
S4==0
plot([2,4],[1.5,0],'-y','linewidth',3) %batang
S4
elseif
S4<0
plot([2,4],[1.5,0],'-r','linewidth',3) %batang
S4
else
plot([2,4],[10.5,0],'-b','linewidth',3) %batang
S4
end
if
S5==0
plot([2,2],[0,1.5],'-y','linewidth',3) %batang
S5
elseif
S5<0
plot([2,2],[0,1.5],'-r','linewidth',3) %batang
S5
else
plot([2,2],[0,1.5],'-b','linewidth',3) %batang
S5
end
if
S6==0
plot([2,4],[0,0],'-y','linewidth',3) %batang
S6
elseif
S6<0
plot([2,4],[0,0],'-r','linewidth',3) %batang
S6
else
plot([2,4],[0,0],'-b','linewidth',3) %batang
S6
end
if
S7==0
plot([4,4],[0,3],'-y','linewidth',3) %batang
S7
elseif
S7<0
plot([4,4],[0,3],'-r','linewidth',3) %batang
S7
else
plot([4,4],[0,3],'-b','linewidth',3) %batang
S7
end
if
S8==0
plot([4,6],[3,1.5],'-y','linewidth',3) %batang
S8
elseif
S8<0
plot([4,6],[3,1.5],'-r','linewidth',3) %batang
S8
else
plot([4,6],[3,1.5],'-b','linewidth',3) %batang
S8
end
if
S9==0
plot([4,6],[0,1.5],'-y','linewidth',3) %batang
S9
elseif
S9<0
plot([4,6],[0,1.5],'-r','linewidth',3) %batang
S9
else
plot([4,6],[0,1.5],'-b','linewidth',3) %batang
S9
end
if
S10==0
plot([6,6],[0,1.5],'-y','linewidth',3) %batang
S10
elseif
S10<0
plot([6,6],[0,1.5],'-r','linewidth',3) %batang
S10
else
plot([6,6],[0,1.5],'-b','linewidth',3) %batang
S10
end
if
S11==0
plot([4,6],[0,0],'-y','linewidth',3) %batang
S11
elseif
S11<0
plot([4,6],[0,0],'-r','linewidth',3) %batang
S11
else
plot([4,6],[0,0],'-b','linewidth',3) %batang
S11
end
if
S12==0
plot([6,8],[1.5,0],'-y','linewidth',3) %batang
S12
elseif
S12<0
plot([6,8],[1.5,0],'-r','linewidth',3) %batang
S12
else
plot([6,8],[1.5,0],'-b','linewidth',3) %batang
S12
end
if
S13==0
plot([6,8],[0,0],'-y','linewidth',3) %batang
S13
elseif
S13<0
plot([6,8],[0,0],'-r','linewidth',3) %batang
S13
else
plot([6,8],[0,0],'-b','linewidth',3) %batang
S13
end
text(0.7,1,'S1')
text(1,-0.2,'S2')
text(2.5,2.3,'S3')
text(3,1,'S4')
text(2.1,0.5,'S5')
text(3,-0.2,'S6')
text(4.1,1.5,'S7')
text(5.2,2.3,'S8')
text(4.8,1,'S9')
text(5.3,0.5,'S10')
text(4.5,-0.2,'S11')
text(7,1,'S12')
text(6.5,-0.2,'S13')
xlabel('jarak
(m)')
ylabel('jarak
(m)')
title('kuda-kuda')
axis([-2 10 -2 5])
set(gca,'xtick',[-2:2:10])
set(gca,'ytick',[-2:1.5:5])
grid on
0 comments:
Post a Comment