% threeplots.m

% (c) Philip D Loewen, 2014-11-15

tmax = 14*pi;
dt   = 2*pi/90;
tvalues = 0:dt:tmax;

theta0 = [1,2,3];
omega0 = [0,0,0];

for k=1:length(theta0)
  figure();
  
  subplot(2,1,1);
  title('Angular position \theta versus time')
  hold on;
  xlabel('t');
  ylabel('\theta');
  theta_lin= theta0(k)*cos(tvalues) + omega0(k)*sin(tvalues);
  plot(tvalues,theta_lin);
  grid on;
  % PLOTTING COMMAND FOR TRUE theta(t) GOES RIGHT HERE.
  
  subplot(2,1,2);
  title('Angular velocity \omega versus time')
  hold on;
  xlabel('t');  
  ylabel('\omega');
  omega_lin = -theta0(k)*sin(tvalues) + omega0(k)*cos(tvalues);
  plot(tvalues,omega_lin);
  grid on;
  % PLOTTING COMMAND FOR TRUE omega(t) GOES RIGHT HERE.

end;
