function xp = cap7_idecartesiano3gdl(t,x) global tau1 tau2 tau3 d = [x(1); x(2); x(3)]; %vector de posición articular dp =[x(4); x(5); x(6)];%vector de velocidad articular m1=0.7; m2=0.28; m3=0.28; b1=0.02; b2=0.08; b3=.02; fc1=0.01; fc2=0.07; fc3=.02; g=9.81; theta1=m1+m2+m3; theta2=m1+m2; theta3=m3; theta4=b1; theta5=b2; theta6=b3; theta7=fc1; theta8=fc2; theta9=fc3; theta10=g*(m1+m2+m3); %modelo dinámico del robot M = [theta1, 0, 0; 0 theta2, 0; 0 0 theta3]; %matriz de inercia B=[ theta4, 0, 0; 0, theta5, 0; 0, 0, theta6]; %fricción viscosa Fc=[theta7, 0, 0; 0, theta8, 0; 0, 0, theta9]; %fricción de Coulomb par_grav = [theta10; 0; 0]; %vector de pares de gravitacionales fr= B*dp+Fc*sign(dp); %vector de fricción tau1=12.36+ 0.05*sin(t); tau2=(1-exp(-0.5*t))*0.13*sin(t); tau3=0.06*sin(t); tau=[tau1; tau2; tau3]; dpp = inv(M)*(tau- par_grav-fr); %vector de aceleración articular xp = [dp(1); dp(2); dp(3); dpp(1); dpp(2); dpp(3)];%vector de salida end