NewFourBarWithGraph

NewFourBarWithGraph - theta4 = 180*d2r - angle1 - angle4;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% converting theta2 d2r = pi /180; % link lengths a = 1; b = 1.5; c = 1.75; d = 1.6; % for loop for input (crank) angle i = 0; for theta2deg = 0:1:360 % update counter i = i+1; % convert angles to radians theta2 = theta2deg*d2r; % geometric computation of other angles angle1 = sqrt(d^2 + a^2 - 2*d*a*cos(theta2)); angle2 = asin(sin(theta2)*a/angle1); angle3 = acos((-angle1^2 + b^2 + c^2)/(2*b*c)); angle4 = asin(sin(angle3)*b/angle1);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: theta4 = 180*d2r - angle1 - angle4; theta3 = theta4 - angle3; % where 3 is the distance along link 3 from point A % px(i) = a*cos(theta2) + 3*cos(theta3); py(i) = a*sin(theta2) + 3*sin(theta3); end % generate graph figure hold on xlabel('x position (in)') ylabel('y position (in)') title('My four-bar output') plot(px,py), grid...
View Full Document

Ask a homework question - tutors are online