% expfun_unstab.m - exponential function plots for unstable system
% KJA, 2012

aminit;					% initialize FBS macros

% Response of first order unstable system
t = 0:0.1:4;
y = exp(t);
y1 = max(0, 1+t);

subplot(331)
pl = plot(t, y, 'b-', t, y1, 'b--');
set(pl,  'LineWidth',  AM_data_linewidth);
set(gca, 'Ytick', [0 20 40]);
amaxis([0 4 0 40])
title('real unstable')
xlabel('tf')
ylabel('y')

%   Response of second order unstable system
t = 0:0.1:16;
y0 = zeros(size(t));
ys = exp(0.25*t).*sin(t);
yc = exp(0.25*t).*cos(t);
yu = exp(0.25*t);
yl = -yu;
y1 = 1+t;

subplot(334)
p2 = plot(t/4, ys, 'b-', t/4, yc, 'b--', t, y0, t/4, yu, 'b:', t/4, yl, 'b--');
set(p2,  'LineWidth',  AM_data_linewidth);
set(gca, 'Ytick', [-20 0 20 40]);
amaxis([0 4 -20 40])
xlabel('ts')
ylabel('y')
title('complex unstable');

amprint('expfun-unstab.eps')
