%PDAN3C.M Slike za DAN3C.M

hold off
clg

figure(1)
% joint motions
  subplot(2,1,1);
  plot(time, q(1,:));
  axis([0 t_d -2 4]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[rad]');
  title('ugao u 1. zglobu');

  subplot(2,1,2);
  plot(time, q(2,:));
  axis([0 t_d -2 4]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[rad]');
  title('ugao u 1. zglobu');

figure(2)
% joint velocities
  subplot(2,1,1);
  plot(time, dq(1,:));
  axis([0 t_d -8 5]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[rad/s]');
  title('brzina u 1. zglobu');

  subplot(2,1,2);
  plot(time, dq(2,:));
  axis([0 t_d -8 5]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[rad/s]');
  title('brzina u 2. zglobu');

figure(3)
% joint accelerations
  subplot(2,1,1);
  plot(time, ddq(1,:));
  axis([0 t_d -50 90]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[rad/s^2]');
  title('ubrzanje u 1. zglobu');

  subplot(2,1,2);
  plot(time, ddq(2,:));
  axis([0 t_d -50 90]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[rad/s^2]');
  title('ubrzanje u 2. zglobu');

figure(4)
% joint torques
  subplot(2,1,1);
  plot(time, tau_1);
  axis([0 t_d -7000 10000]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[Nm]');
  title('moment u 1. zglobu');

  subplot(2,1,2);
  plot(time, tau_2);
  axis([0 t_d -7000 10000]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[Nm]');
  title('moment u 2. zglobu');

figure(5)
% inertia torques 11 and 22
  subplot(2,1,1);
  plot(time, inert_11);
  axis([0 t_d -10000 10000]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[Nm]');
  title('sopstveni inercioni moment 1. zgloba');

  subplot(2,1,2);
  plot(time, inert_22);
  axis([0 t_d -10000 10000]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[Nm]');
  title('sopstveni inercioni moment 2. zgloba');

figure(6)
% inertia torques 12 and 21
  subplot(2,1,1);
  plot(time, inert_12);
  axis([0 t_d -1700 3100]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[Nm]');
  title('inercioni moment 1. zgloba usled ubrzanja 2. zgloba');

  subplot(2,1,2);
  plot(time, inert_21);
  axis([0 t_d -1700 3100]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[Nm]');
  title('inercioni moment 2. zgloba usled ubrzanja 1. zgloba');

figure(7)
% centipetal + coriolis torques
  subplot(2,1,1);
  plot(time,cen_2, time,cor_12,'r');
  axis([0 t_d -1500 1500]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[Nm]');
  title('centripetalna komponenta momenta 1. zgloba usled brzine 2. zgloba (zuto) i koriolisov moment (crveno)');

  subplot(2,1,2);
  plot(time, cen_1);
  axis([0 t_d -1500 1500]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[Nm]');
  title('centripetalna komponenta momenta 2. zgloba usled brzine 1. zgloba');

figure(8)
% gravitational torques
  subplot(2,1,1);
  plot(time,grav_1);
  axis([0 t_d -100 1000]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[Nm]');
  title('gravitacioni moment u 1. zglobu');

  subplot(2,1,2);
  plot(time,grav_2);
  axis([0 t_d -100 1000]);
%  set(gca,'fontname','Times','fontsize',12,'fontweight','normal');
  xlabel('[s]');
  ylabel('[Nm]');
  title('gravitacioni moment u 2. zglobu');
