Matlab M-File Velocity Analysis, Example 2 Matlab Source

Matlab M-File Velocity Analysis, Example 2 Matlab Source -...

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

View Full Document Right Arrow Icon
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 %4-Bar mechanism %knowns: a1=600 a2=140 a3=690 a4=400 a5=200 a6=200 omega2=50 theta2=linspace(0,2*pi,150) %position solution: s=sqrt(a1^2+a2^2-2*a1*a2*cos(theta2)) beta=acos((s.^2 + a1^2 - a2^2)./(2*a1*s)) psi=acos((s.^2 + a1^2 - a2^2)./(2*a1*s)) 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)')
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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: grid on axis tight set(gca,'Xtick',[0:45:360]) %sets the current axis to have ticks every 45 deg subplot(2,2,2) plot(theta2*180/pi,r) xlabel('\theta_2 (deg)') ylabel('slider position (mm)') grid on Sheet1 Page 2 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) 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

Page1 / 2

Matlab M-File Velocity Analysis, Example 2 Matlab Source -...

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

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