Está en la página 1de 4

clc

clear

%%% CODIGO MECANISMO ROTATORIO OSCILATORIO%%%

global o1 AB BC CD AD of1

%%DATOS DE LAS CONSTANTES DEL MECANISMO

AB=20
BC=75.55
CD=61.31
AD=104.03
of1=185
of2=25
BE=40.14
%%CONTROL
o1o=60
o1f=360+o1o
%%%% PUNTOS DE ANALISIS
n=50
%%RANGO DE FUNCIONAMIENTO
r=o1f-o1o
%%INCREMENTO
in=r/n
%%DATOS EN LA POSICION INICIAL
xi=[30 280]

%REPETICION DE CALCULOS
for i=1:1:n+1
if i==1
o1=o1o
else
o1=o1+in
end

o=fsolve(@newton1,xi)%%% funcion nos permite resolver newton rapson del


subprograma
o2(i,1)=o(1,1)
o3(i,1)=o(1,2)
ang(i,1)=o1

j=[-BC*sind(o2(i,1)) -CD*sind(o3(i,1));
BC*cosd(o2(i,1)) CD*sind(o3(i,1))]

dj(i,1)=det(j)

ex(i,1)=AB*cosd(o1)+BE*cosd(o2(i,1)+of2)
ey(i,1)=AB*sind(o1)+BE*sind(o2(i,1)+of2)
end
desplazamiento_angular=max(o3)-min(o3)
plot(ang,o2,'*')
title('o1 vs o2')
xlabel('o1 en grados')
ylabel('o2 en grados')
grid on
figure
plot(ang,o3,'*')
title('o1 vs o3')
xlabel('o1 en grados')
ylabel('o3 en grados')
grid on
figure
plot(ang,dj)
title('o1 vs jacobiano')
xlabel('o1 en grados')
ylabel('jacobiano')
grid on
figure
plot(ex,ey)
title('ex vs ey')
xlabel('x')
ylabel('y')
grid on

%CODIGO DE NEWTON
function[f]=newton(x)
global o1 AB BC CD AD of1

o2=x(1)
o3=x(2)

f(1)=AB*cosd(o1)+BC*cosd(o2)+CD*cosd(o3)+AD*cosd(of1)
f(2)=AB*sind(o1)+BC*sind(o2)+CD*sind(o3)+AD*sind(of1)

end
CURVA DEL ACOPLADOR

TETA1 VS TETA2
TETA1 VS TETA3

TETA1 VS JACOBIANO

También podría gustarte