fourbar

# fourbar - b = asin(sin(g*c1/e t4 = 180*d2r a b t3 = t4 g...

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

% fourbar.m - path of a four-bar mechanism % constants d2r = pi /180; % enter link lengths a1 = 1.75; b1 = 1.0; c1 = 1.6; d1 = 1.5; % for loop for input (crank) angle i = 0; for t2deg = 0:1:360 % update counter i = i+1; % convert angles to radians t2 = t2deg*d2r; % geometric computation of other angles e = sqrt(a1^2 + b1^2 - 2*a1*b1*cos(t2)); a = asin(sin(t2)*b1/e); g = acos((-e^2 + c1^2 + d1^2)/(2*c1*d1));
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b = asin(sin(g)*c1/e); t4 = 180*d2r - a - b; t3 = t4 - g; % compute and store position of "point of interest" % where 1.75 is the distance along link 3 from point A px(i) = b1*cos(t2) + 1.75*cos(t3); py(i) = b1*sin(t2) + 1.75*sin(t3); end % generate a new figure figure hold on xlabel('x position (in)') ylabel('y position (in)') title('four-bar output') plot(px,py)...
View Full Document

## This note was uploaded on 03/28/2011 for the course CAE 311 taught by Professor Himn during the Spring '11 term at SJVCS.

Ask a homework question - tutors are online