What am I doing wrong on this problem?

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

Walter Roberson
Walter Roberson 2015년 9월 17일
no figure was included
Image Analyst
Image Analyst 2015년 9월 18일
편집: Image Analyst 2015년 9월 18일
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
Walter Roberson 2015년 9월 18일
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
George Lentini 2015년 9월 20일
편집: George Lentini 2015년 9월 20일
The path that the graph follows doesn't make sense when compared to the mechanism I am trying to calculate the positions of. For the most part, I just copied the code from a problem we did in class hoping it would work. I really have no understanding of Matlab.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2015년 9월 17일

편집:

2015년 9월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by