The figure shows an offset slidercrank mechanism with given
Solution
Requested solution (5):
%MATLAB code start
a = 2; b = 12; c = 6; %length of links
p1 = [0 0]; %crank centre point position co-ordinates
omega = 1; %assumed crank angular vel
axis(gca, \'equal\');
axis([-5 15 -5 10]);
for t=1:63 %time of simulation (change for longer simulation)
theta2 = omega *(t/10); %angle of crank link
p2 = [a*cos(theta2) a*sin(theta2)]; %crank end point co-ordinates position
crank = line([p1(1) p2(1)],[p1(2) p2(2)]); %plot crank link
theta3 = asin((6 - (a*sin(theta2)))/b); %angle of link2 with horizontal
p3 = [(a*cos(theta2) + b*cos(theta3)) 6]; %slider position co-ordinates
slider = line([p2(1) p3(1)],[p2(2) p3(2)]); %plot link2
pause(0.1);
delete(crank);
delete(slider);
end
%MATLAB code end
Hope this helps. Let me know there are any questions.
Cheers!
