Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

mechanicalAdvantage.m

function[gapSize,m,Vout,Vout_x,Vout_y,x_out,y_out] = mechanicalAdvantage(theta1,omega1,a,b,c,h,k,g,i,j,alpha1,alpha2,alpha3,theta2)
gamma2=pi-theta1-alpha2;
gamma1=pi-gamma2;

d=c*sin(gamma2);
e=c*cos(gamma2);

beta1=asin((d-g)/k);
beta2=pi/2-beta1;

theta4=asin(i/h);
theta3=pi-theta2+beta1-theta4;

f=k*cos(beta1);

x_out=h*cos(theta3);
y_out=g-h*sin(theta3);
gapSize=2*y_out;

omega2=c/k*cos(gamma2)/cos(pi-beta1)*omega1;

Vout_x=h*omega2*sin(theta3);
Vout_y=h*omega2*cos(theta3);

Vin_x=k*omega2*sin(beta1)+a*omega1*sin(alpha3+gamma1);
Vin_y=-k*omega2*cos(beta1)+a*omega1*cos(alpha3+gamma1);

Vout=sqrt(Vout_x^2 + Vout_y^2);
Vin=sqrt(Vin_x^2 + Vin_y^2);

m=Vin/Vout;
end

velocity.m

function [y_out,m,omega2,theta3,beta1,gamma1,Vin,Vout] = velocity(inputArg1,inputArg2)
gamma2=pi-theta1-alpha2;
gamma1=pi-gamma2;

d=c*sin(gamma2);
e=c*cos(gamma2);

beta1=asin((d-g)/k);
beta2=pi/2-beta1;

theta4=asin(i/h);
theta3=pi-theta2+beta1-theta4;

f=k*cos(beta1);

y_out=g-h*sin(theta3);

omega2=c/k*cos(gamma2)/cos(pi-beta1)*omega1;

Vout_x=h*omega2*sin(theta3);
Vout_y=h*omega2*cos(theta3);

Vin_x=k*omega2*sin(beta1)+a*omega1*sin(alpha3+gamma1);
Vin_y=-k*omega2*cos(beta1)+a*omega1*cos(alpha3+gamma1);

Vout=sqrt(Vout_x^2 + Vout_y^2);
Vin=sqrt(Vin_x^2 + Vin_y^2);

m=Vin/Vout;
end


FinalProject.m

clear all;
clc;

...

bottomy_=-y_out_;
figure (4)
plot(x_out_,y_out_,x_out_,bottomy_);
title('Path of Jaws Across Range of Motion');
xlabel('Horizontal Position (in)');
ylabel('Vertical Position (in)');

mechanicalAdvantage.m

function[gapSize,m,Vout,Vout_x,Vout_y,x_out,y_out] = mechanicalAdvantage(theta1,omega1,a,b,c,h,k,g,i,j,alpha1,alpha2,alpha3,theta2)
gamma2=pi-theta1-alpha2;
gamma1=pi-gamma2;

d=c*sin(gamma2);
e=c*cos(gamma2);

beta1=asin((d-g)/k);
beta2=pi/2-beta1;

theta4=asin(i/h);
theta3=pi-theta2+beta1-theta4;

f=k*cos(beta1);

x_out=h*cos(theta3);
y_out=g-h*sin(theta3);
gapSize=2*y_out;

omega2=c/k*cos(gamma2)/cos(pi-beta1)*omega1;

Vout_x=h*omega2*sin(theta3);
Vout_y=h*omega2*cos(theta3);

Vin_x=k*omega2*sin(beta1)+a*omega1*sin(alpha3+gamma1);
Vin_y=-k*omega2*cos(beta1)+a*omega1*cos(alpha3+gamma1);

Vout=sqrt(Vout_x^2 + Vout_y^2);
Vin=sqrt(Vin_x^2 + Vin_y^2);

m=Vin/Vout;
end

velocity.m

function [y_out,m,omega2,theta3,beta1,gamma1,Vin,Vout] = velocity(inputArg1,inputArg2)
gamma2=pi-theta1-alpha2;
gamma1=pi-gamma2;

d=c*sin(gamma2);
e=c*cos(gamma2);

beta1=asin((d-g)/k);
beta2=pi/2-beta1;

theta4=asin(i/h);
theta3=pi-theta2+beta1-theta4;

f=k*cos(beta1);

y_out=g-h*sin(theta3);

omega2=c/k*cos(gamma2)/cos(pi-beta1)*omega1;

Vout_x=h*omega2*sin(theta3);
Vout_y=h*omega2*cos(theta3);

Vin_x=k*omega2*sin(beta1)+a*omega1*sin(alpha3+gamma1);
Vin_y=-k*omega2*cos(beta1)+a*omega1*cos(alpha3+gamma1);

Vout=sqrt(Vout_x^2 + Vout_y^2);
Vin=sqrt(Vin_x^2 + Vin_y^2);

m=Vin/Vout;
end