g=9.81;
Ta=10;
mA=20;
for i=1:100
M=(i-1)*(30/99);
mB=4.05;
mC=M;
mD=M;
JC=0.005*M;
JD=JC;
JA=0.8055;
A=[mA 0 -1 1 0 0 0; (5*JA) 0 0.2 0 0 0 0; (10*JC) 0 0 -0.1 0 0.1 0; 0 mD 0 0 -1 -1 -1; 0 (10*JD) 0 0 0 -0.1 0.1; 0 mB 0 0 -1 0 0; -0.5 1 0 0 0 0 0];
B=[0; Ta; 0; (-mD*g); 0; (-mB*g); 0];
x=inv(A)*B;
aA(i)=x(1); aB(i)=x(2); FA(i)=x(3); TA(i)=x(4); TB(i)=x(5); TC(i)=x(6); TD(i)=x(7);
end
Mvector=linspace(0,30,100);
plot(Mvector, aA(i),'g',Mvector,aB(i),'b-.');
title('Acceleration');
legend('Disk A','Mass B');
xlabel('M (kg)');
ylabel('Acceleration (m/s^2)');
pause
plot(Mvector,aA(i),'g',Mvector,aB(i),'b-.');
title('Acceleration');
legend('Disk A','Mass M');
xlabel('M (kg)');
ylabel('acceleration (m/s^2)');
pause
plot(Mvector, FA(i),'k');
title('Plot 3');
xlabel('M (kg)');
ylabel('FA (N)');
pause
plot(Mvector,TA(i),'g',Mvector,TB(i),'b-.');
title('Plot 4');
legend('Cable A','Cable B');
xlabel('M (kg)');
ylabel('Tension (N))');
pause
plot(Mvector,TA(i),'g',Mvector,TC(i),'b:',Mvector,TD(i),'r-.');
title('Plot 5');
legend('Cable A','Cable C','Cable D');
xlabel('M (kg)');
ylabel('Tension (N)');
pause
plot(Mvector,FA(i)/(mA*g),'k');
title('Plot 6');
xlabel('M (kg)');
ylabel('mu');
Best Answer