% linvsnl - linear versus nonlinear phase plots
% RMM, 17 Jul 06

aminit;					% initialize MATALB

m = 1; l = 1; b = 0.5; g = 1;		% parameters for damped inv pendulum

figure(1); clf; subplot(221)
amaxis([0 2*pi -2 2]); set(gca, 'DataAspectRatio', [1.25 1 1]);
amphaseplot('invpend', ...
  'logtime', [8 1.5], nan, ...
  [0,1.8; 3,2; 3.8,2; 4.58,2; 5,2; 2*pi,-1.4; ...
   2*pi,-1.8; 2*pi-3,-2; 2*pi-3.8,-2; 2*pi-4.58,-2; 2*pi-5,-2], ...
  20, m, l, b, g);
plot([0 pi 2*pi], [0 0 0], 'k.', 'MarkerSize', AM_data_markersize*3);

% Set up the axes to look like we want
set(gca, 'XTick', [0 pi/2 pi 3*pi/2 2*pi]);
set(gca, 'XTickLabel', {'0pi', 'pi/2', 'pi', '3pi/2', '2pi'});
xlabel('x1'); ylabel('x2', 'Rotation', 0)

amprint('linvsnl-1.eps');

figure(2); clf; subplot(222);
amaxis([-pi pi -2 2]); set(gca, 'DataAspectRatio', [1.25 1 1]);
amphaseplot('invpend_lin', ...
  'logtime', [8 1.5], nan, ...
  [-pi,2; 1.25,2; 1.8,2; 2.3,2; 2.8,2; -.8,-2; -1.5,-2; -2.1,-2; -2.8,-2], ...
  20, m, l, b, g);
plot([0], [0], 'k.', 'MarkerSize', AM_data_markersize*3);

% Set up the axes to look like we want
set(gca, 'XTick', [-pi -pi/2 0 pi/2 pi]);
set(gca, 'XTickLabel', {'-pi', '-pi/2', '0pi' 'pi/2', 'pi'});
xlabel('z1'); ylabel('z2', 'Rotation', 0)

amprint('linvsnl-2.eps');
