FourBar (1).m - Abdullah Jadid MAE 342(Assignment 6 Four...

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

View Full Document Right Arrow Icon
% Abdullah Jadid % MAE 342 (Assignment 6) % Four Bar Link Mechanism clc; clear all; % Parameters R1 = 3; R2 = 4; R3 = 5; R4 = 5; t = 0:0.05:10; ang_speed = 2; theta = ang_speed*t; P1 = [0;0]; P4 = R4*[1;0]; P2 = R1*[cos(theta); sin(theta)]; E = sqrt(R1^2 + R4^2 - 2*R1*R4*cos(theta)); alfa = asin(R1*sin(theta)./E); beta = acos((E.^2 + R3^2 - R2^2)./(2*E*R3)); P3 = [R4 - R3*cos(alfa+beta); R3*sin(alfa+beta)]; P3_x = P3(1,:); P3_y = P3(2,:); P3_vx = diff(P3_x)./diff(t); P3_vy = diff(P3_y)./diff(t); P3_v = sqrt(P3_vx.^2 + P3_vy.^2); for i=1:length(t); ani = subplot(2,1,1); P1_circle = viscircles(P1',0.05); P2_circle = viscircles(P2(:,i)',0.05); P3_circle = viscircles(P3(:,i)',0.05); P4_circle = viscircles(P4',0.05); A_bar = line([P1(1) P2(1,i)],[P1(2) P2(2,i)]);
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern