What am I doing wrong on this problem?
Show older comments
Question:
For the walking beam mechanism in the figure below, calculate and plot the x and y components of the position of the coupler point P for one complete revolution of the crank O2A. Hint: Calculate them first with respect to the ground link O204 and then transform them into the global XY coordinate system (i.e., horizontal and vertical in the figure). Scale the figure for any additional information needed.
%%Walking Beam Problem
clear all; close all; clc;
%%Variables
a=1;
b=2.06;
c=2.33;
d=2.22;
p=3.06;
gamma=31*pi/180;
theta2= zeros (360,1)
%%Main Program
for i=1:361;
theta2(i)=(i-1)*(pi/180);
r=d-a*cos(theta2(i));
s=a*sin(theta2(i));
f2=r^2+s^2;
delta=acos((b^2+c^2-f2)/(2*b*c));
g=b-c*cos(delta);
h=c*sin(delta);
theta3(i)=atan2(h*r-g*s,g*r+h*s);
xp(i)=a*cos(theta2(i)+p*cos(theta3(i)+gamma));
yp(i)=a*sin(theta2(i)+p*sin(theta3(i)+gamma));
end
plot(xp,yp,'color','r')
grid on
title ('title')
xlabel('title')
ylabel('title')
4 Comments
Walter Roberson
on 17 Sep 2015
no figure was included
Image Analyst
on 18 Sep 2015
Edited: Image Analyst
on 18 Sep 2015
The PNG image you attached just shows gibberish. Try it and see. And why do you think something is wrong? What indicates that to you?
Walter Roberson
on 18 Sep 2015
Lately, my browser has tried to render most images as if they were text, including this one. If I download the image and use a viewer then it shows up fine.
George Lentini
on 20 Sep 2015
Edited: George Lentini
on 20 Sep 2015
Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!