You are on page 1of 4

Etapa 1: Primeira Trabalho Computacional de Mecanica Aplicada as Maquinas

kill(all);
load(vect);
Definio da funo 'Produto Vetorial'
crossp(A,B):=matrix([A[2,1]*B[3,1]-A[3,1]*B[2,1]],[A[3,1]*B[1,1]A[1,1]*B[3,1]],[A[1,1]*B[2,1]-A[2,1]*B[1,1]]);
1. ANLISE CINEMTICA
1.1. Definio das variveis
l:l(t);
r:r(t);
alpha:alpha(t);
phi:phi(t);
sigma:sigma(t);
1.2. Matrizes de transformao
Ta:matrix([cos(alpha),0,-sin(alpha)],[0,1,0],[sin(alpha),0,cos(alpha)]);
Tf:matrix([1,0,0],[0,cos(phi),sin(phi)],[0,-sin(phi),cos(phi)]);
Ts:matrix([cos(sigma),0,-sin(sigma)],[0,1,0],[sin(sigma),0,cos(sigma)]);
TaT:transpose(Ta);
TfT:transpose(Tf);
TsT:transpose(Ts);
1.3. Velocidade e acelerao angulares
I_ap:[0,diff(phi,t),0];
I_apt:transpose(I_ap);
B1_fp:[diff(phi,t),0,0];
B2_sp:[0,0,diff(sigma,t)];
I_fp:TaT.B1_fp;
I_sp:TaT.TfT.B2_sp;
I_w2:I_apt+I_fp;
I_wgarra:I_apt+I_fp+I_sp;
I_wp1:diff(I_apt,t);
I_wp2:diff(I_w2,t);

I_wpgarra:diff(I_wgarra,t);
1.4. Vetor posio
B1_r_AB:[0,L1,0];
B2_r_BC:[0,L2,0];
I_r_AB:TaT.B1_r_AB;
I_r_BC:TaT.TfT.B2_r_BC;
I_r_OC:I_r_AB + I_r_BC;
1.5. Vetor velocidade
B1_v_rel:diff(B1_r_AB,t);
I_v_rel1:TaT.B1_v_rel;
B2_v_rel:diff(B2_r_BC,t);
I_v_rel2:TaT.TfT.B1_v_rel;
I_apt_x_I_r_AB:trigsimp(crossp(I_apt,I_r_AB));
I_w2_x_I_r_BC:trigsimp(crossp(I_w2,I_r_BC));
I_v_B:I_v_rel1+I_apt_x_I_r_AB;
I_v_C:I_v_B+I_v_rel2+I_w2_x_I_r_BC;
1.6. Vetor acelerao
B1_a_rel1:diff(B1_r_AB,t,2);
B2_a_rel2:diff(B2_r_BC,t,2);
I_a_rel1:TaT.B1_a_rel1;
I_a_rel2:TaT.TfT.B2_a_rel2;
I_a_coriolis1:2*trigsimp(crossp(I_apt,I_v_rel1));
I_a_tangencial1:trigsimp(crossp(I_wp1,I_r_AB));
I_a_centripeta1:trigsimp(crossp(I_apt,I_apt_x_I_r_AB));
I_a_B:I_a_rel1+I_a_coriolis1+I_a_tangencial1+I_a_centripeta1;
I_a_coriolis2:2*trigsimp(crossp(I_w2,I_v_rel2));
I_a_tangencial2:trigsimp(crossp(I_wp2,I_r_BC));
I_a_centripeta2:trigsimp(crossp(I_w2,I_w2_x_I_r_BC));
I_a_C:I_a_B+I_a_rel2+I_a_coriolis2+I_a_tangencial2+I_a_centripeta2;

Etapa 2: Primeira Trabalho Computacional de Mecanica Aplicada as Maquinas


2.1 - L vs teta
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
main()
{
FILE *saida;
double l, teta, teta_f, p1;
saida = fopen("L vs teta 01.txt", "w");
l = 0.0;
teta = 0.0;
teta_f = M_PI*2.0;
p1 = (teta_f - teta)/120.0;
while (teta < teta_f) {
l = 2+0.5*cos(2*teta);
fprintf(saida, "%.5e %.5e\n", l, teta);
teta += p1;
}
fclose(saida);
system("PAUSE");
return 0;
}
2.2 x vs y
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
main()
{
FILE *saida;
double l, teta, teta_f, p1, x, y;
saida = fopen("X vs Y 01.txt", "w");
l = 0.0;
x = 0.0;
y = 0.0;
teta = 0.0;
teta_f = M_PI*2.0;
p1 = (teta_f - teta)/120.0;
while (teta < teta_f) {
l = 2+0.5*cos(2*teta);
x = l*cos(teta);
y = l*sin(teta);
fprintf(saida, "%.5e %.5e\n", x, y);
teta += p1;
}
fclose(saida);
system("PAUSE");
return 0;

You might also like