MATLAB: The minimum required static coefficient of friction mu_smin to keep the block A always in contact without slipping with the drum surface versus the drum angular velocity Ω > Ω???.

dynamics

g=9.81
r=0.6
theta= (0:0.6:pi)'
speed=sqrt(g/r)
xlabel("Angular position")
ylabel(" Coefficient of static friction")
speeds= [5 6 7 8 9];
for i=speeds(1,:)
mu_s=g*sin(theta)./(r.*i.^2+g*cos(theta))
plot(theta*180/pi,mu_s,"lineWidth",1,"Marker","*")
xlabel("Angular position(degrees)")
ylabel("Coefficient of static friction")
hold on
end
hold off
legend("5m/s","6m/s","7m/s","8m/s","9m/s")
%[max,index]=max(mu_s)
save PLOTS
% speed 5 is the green and speed 9 is the blue. makesense.
% second question, the min mu_s that will keep the
%block on contact is equal to the max value on the
%plot of theata versus mu_s.
i have to plot the max point of each plot in another graph that containes the max points only. how can i do that please?
Thank you in advance

Best Answer

try this
g=9.81;
r=0.6;
theta= (0:0.6:pi)';
speed=sqrt(g/r);
xlabel("Angular position")
ylabel(" Coefficient of static friction")
speeds= [5 6 7 8 9];
mu_s = zeros(numel(theta), numel(speeds));
for i=1:numel(speeds)
mu_s(:,i)=g*sin(theta)./(r.*speeds(i).^2+g*cos(theta));
plot(theta*180/pi,mu_s(:,i),"lineWidth",1,"Marker","*")
xlabel("Angular position(degrees)")
ylabel("Coefficient of static friction")
hold on
end
hold off
legend("5m/s","6m/s","7m/s","8m/s","9m/s")
%[max,index]=max(mu_s)
figure();
axes();
plot(speeds, max(mu_s, [], 1), '*-', 'LineWidth', 1)
xlabel("Speed")
ylabel("Max Coefficient of static friction")
save PLOTS
% speed 5 is the green and speed 9 is the blue. makesense.
% second question, the min mu_s that will keep the
%block on contact is equal to the max value on the
%plot of theata versus mu_s.
Related Question