{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Matlab M-File Velocity Analysis, Example 1 Matlab Source

# Matlab M-File Velocity Analysis, Example 1 Matlab Source -...

This preview shows pages 1–2. Sign up to view the full content.

Sheet1 Page 1 %ME 3212: Mechanisms %Chapter 3 Examples %Finding the velocities of links %Dr. Jeremy Daily %close an initialize system clc clear all close all %Inverted slider crank mechanism %knowns: a2=25 d=45 omega2=20 theta2=linspace(0,2*pi,150) %position solution: r=sqrt(d^2+a2^2-2*d*a2*cos(pi-theta2)) theta4=acos((r.^2 + d.^2 - a2.^2)./(2*r*d)) theta4=atan2(a2*sin(theta2),d+a2*cos(theta2)) %velocity analysis for i=1:length(theta2) A=[ cos(theta4(i)) -r*sin(theta4(i)) sin(theta4(i)) r*cos(theta4(i))] C=[ -a2*omega2*sin(theta2(i)) a2*omega2*cos(theta2(i)) ]' v=A\C rdot(i)=v(1) omega4(i)=v(2) end %Plot the results subplot(2,2,1) plot(theta2*180/pi,theta4) xlabel('\theta_2 (deg)') ylabel('\theta_4 (rad)') grid on axis tight set(gca,'Xtick',[0:45:360]) %sets the current axis to have ticks every 45 deg

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: subplot(2,2,2) plot(theta2*180/pi,r) xlabel('\theta_2 (deg)') ylabel('slider position (mm)') grid on axis tight set(gca,'Xtick',[0:45:360]) %sets the current axis to have ticks every 45 deg subplot(2,2,3) plot(theta2*180/pi,omega4) Sheet1 Page 2 xlabel('\theta_2 (deg)') ylabel('\omega_4 (rad/s)') grid on axis tight set(gca,'Xtick',[0:45:360]) %sets the current axis to have ticks every 45 deg subplot(2,2,4) plot(theta2*180/pi,rdot) xlabel('\theta_2 (deg)') ylabel('slider velocity (mm/s)') grid on axis tight set(gca,'Xtick',[0:45:360]) %sets the current axis to have ticks every 45 deg...
View Full Document

{[ snackBarMessage ]}