Homework2Solutions

Homework2Solutions - I } 90VWS gm 3 . 30/1/6 ‘QN’...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 10
Background image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: I } 90VWS gm 3 . 30/1/6 ‘QN’ ‘79:, Q3 0L pummel?“ ’70 éa- Homewof‘ L Z l I 6&IMH‘IW; ; 9441:3211 ! a) , " i :79 FL +F3 CO$<63> ‘XC :0 ’5) {-2, 671/! {QC} "‘ r73 91+} +‘ C :0 (\COLV‘W/ : 34M gzuwlmas M] (MM/8", L» (—31 Cosféeé> +- sz'giv} (:63) 2:. Z 1 (76¢ “ r7, COSC§5>> +‘ VP; $271695) 7" C5 .1 3 r3 ‘ WI —Z7cg Q ws/eg Mg}; 2 ‘ 1’ Qifmfi') + Z (‘2 a 37(923 +62 PM: M40 @Whi Mm} 0311*2Y‘wfi 1.1 fl 6 (kg +6 “r31 r2965ng 0L 3 ) [Q “M” ’W’"‘\/’”“'”“\\ ' C W26 6WAt Wq/ dc : .‘CD It bl “‘iOLC f___________...—————« Z 0\ Sn \ . 09 {43 x "£ 92,, k 600 / 6k 1 ‘j ': "2:5 1 (,1 ~3591’Ln 740 Z 16' ‘1: 1675a”: 2 fix;— 77.440! mg @ 9/14/09 10:32 PM /Users/jeremy/Documents/Teach.../Homework2Prob1.m 1 of 1 %ME 3212: Mechanisms *N%Homework Problem Set 2: Problem #1 fi%Solutions clc %clear screen clear all %clear memory close all %close all figure windows %define theta2 from O to 360 using radians every 1 degrees theta2: [O :pi/360:2*pi]; %Prob 10 %input known values e=1 r2=2.5 r3=7 %solve for theta3 as a function of theta2 theta3=asin((r2*sin(theta2)+e)/r3); %solve for XC as a function of theta2 and theta3 xc=r2*cos(theta2)+r3*cos(theta3); %Plot results F=figure(1) %open figure 1 window plot(theta2*180/pi,xc) )%modify the plot ‘axis([0 360 4 10]) set(gca,’XTick’,[O:30:360]) xlabel('\theta_2 (deg)’) ylabel(’Slider Position, x_c (in)’) title([’Mechanisms Homework 2, Problem 1 Plot’]) grid on saveas(F,'Homework2Prob1_plot.pdf') Slider Position, xC (in) 30 60 90 Mechanisms Homework 2, Problem 1 Plot 120 150 180 210 240 270 300 330 360 KW do?” 5%; MWW t; E g. ‘3) 11 "Y\LC0‘>9L+ (115695 93 ~Bx CO 9): FL‘Sm 9m“ rsmeg ’83,:0 BMW» :3 Iowa aeflmméc r‘r We: Cos/a m : CM 1% a} %‘(Rafi‘)z§hg (@353 4‘: {Tflifi'fi‘é I 9/14/09 10:30 PM /Users/jeremy/Documents/Teach.../Homework2Prob2.m l of l %ME 3212: Mechanisms ~M%Homework Problem Set 2: Problem #2 l%Solutions clc %clear screen clear all %clear memory close all %close all figure windows %define theta2 from 0 to 360 using radians every 10 degrees theta2=[0:pi/36:2*pi]; %Figure P4.lO in Cleghorn’s Text %input known values r2=4 r4=3 r522 Bx=lO By=-5 %solve for theta3 as a function of theta2 theta3=atan2(By—r2*sin(theta2),Bx—r2*cos(theta2)); Ax=r2*cos(theta2); Ay=r2*sin(theta2); Dx=Ax+r4*cos(theta3); Dy=Ay+r4*sin(theta3); )CX=Dx+r5*cos(theta3—pi/2); Cy=Dy+r5*sin(theta3—pi/2); Cx=Dx+r5*sin(theta3); %this gives the same as two lines above Cy=Dy-r5*cos(theta3); %this gives the same as two lines above for i=lzlength(theta2) %Plot results F=figure(l) %open figure 1 window plOt(CX,CY,’.’,[0 AX(i) BX DX(i) CX(i)],[0 AY(i) BY DY(i) CY(i)],’-O’,K Ax,Ay, ’y’) %modify the plot axis equal Xlabel(’X—Position (cm)’) ylabel(’Y—Position (cm)’) title([’Mechanisms Homework 2, Problem 2 Coupler Curve’]) grid on M(i)=getframe() %This makes a movie if i== saveas(F,’Homework2Prob2_plot.pdf’) end end )movie(M,2) %this plays a movie 2 times Y—Position (cm) Mechanisms Homework 2, Problem 2 Coupler Curve X—Position (cm) ‘" 7 f 9¢¢17T Oégér e ‘ Wfifi—i 7.119%177' Liv .— W’rfi 95 +7272) F LosC +V§ cos 9; fgfhéés + DZ”) . x ‘ r CosQLfrgsm Q5 ff 5 : C v z " {'1 6m h as ‘ ~ : “HS! %: cos (9; #775) a; C68 Q3 9/14/09 10:30 PM /Users/jeremy/Documents/Teach.../Homework2Prob3.m. 1 of 2 %ME 3212: Mechanisms \%Homework Problem Set 2: Problem #3 1%Purpose: Analyze a four bar linkage with similar notation to Fig 4.3a in %Cleghorn’s book. Numerical values come from Problem 4.18. clc; clear all; close all %input known values: r1=1.0 r2=0.2 r3=O.4 r4=l.O r5=O.2 r6=0.5 %input crank values in radians theta2=[0:pi/36:2*pi]; %Determine theta3 (these come from the book) h1=r1/r2; h2=r1/r3; h3=r1/r4; h4=(—r1“2—r2“2—r3“2+r4“2 )/(2*r2*r3); h5=(r1“2+r2A2—r3“2+r4“2)/( 2*rl*r2); %Determine theta3 and theta4 in closed form. See 4.3.3 in Cleghorn’s book. a=—h1+(1+h2)*cos(theta2)+h4; b=—2*sin(theta2); )c=h1—(1—h2)*cos(theta2)+h4; d=—h1+(1—h3)*cos(theta2)+h5; e=h1—(1+h3)*cos(theta2)+h5; %Cross Link Geometry %theta4=2*atan2(—b+sqrt(b.“2—4*d.*e),2*d); %theta3=2*atan2(—b+sqrt(b.A2—4*a.*c),2*a); %Open Link Geometry theta4=2*atan2(—b—sqrt(b.A2—4*d.*e),2*d); theta3=2*atan2(—b—sqrt(b.“2—4*a.*c),2*a); %Determine Nodes of interest szr2*cos(theta2); Ay=r2*sin(theta2); BX=r1+ r4*cos(theta4); By=0 + r4*sin(theta4); szAx + r5*cos(theta3) + r6*cos(theta3+pi/2); Cy=Ay + r5*sin(theta3) + r6*sin(theta3+pi/2); %plot the configuration of the mechanism F=figure(1) for i=1:length(theta2) 3 pl9t(CX,Cyl’.’{AXIAY5'Y’,B¥,By,’Y’,[0 AX(i) BX(i) CX(i) AX(i) BX(i) r1],¢ /[0 Ay(1) By(1) Cy(1) Ay(1) By(1) 0],’-o’) axis equal set(gca,’PlotBoxAspectRatio’,[512 384 720]) 9/14/09 10:30 PM /Users/jeremy/Documents/Teach.../Homework2Prob3.m 2 of 2 —————————_——._—__——__—_—————_——-——_—_——————__—§___— Xlabel(’X, cm’) ~ ylabel('Y, cm’) ) title(’Homework 2 Problem 3 Coupler Curve’) M(i)=getframe(F,[ O 0 512 384]); if i==7 %this corresponds to 30 degrees disp(theta2(i)*l80/pi) saveas(F,’Homework2Prob3—plot.pdf’) end end movie2avi(M,’HW2Prob3_animation.avi’) %Makes a movie file \_,-‘ Y, cm Homework 2 Problem 3 Coupler Curve X, cm ...
View Full Document

Page1 / 11

Homework2Solutions - I } 90VWS gm 3 . 30/1/6 ‘QN’...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online