%  This function solves project [P5.1], part A
%  -------------------------------------------
%
echo on
%
%  Compute the damping of Houbolt
%
algor = 2;
whset = linspace(-3,0,51);
dset = zeros(size(whset));
n = length(whset);
for i = 1:n,
    wh = whset(i);
    if wh < 0,
      A = aa(0);
     else
      A = aa(180);
    end,
    F = ff4(A,abs(wh),algor);
    d = -log(max(abs(eig(F))));
    dset(i) = -d;
end
%
subplot(2,1,1)
plot(whset,dset,'k-',whset,whset,'k--')
grid on
title('tt1')
ylabel('yyy')
%
whset = -logspace(-2,6,151);
dset = zeros(size(whset));
n = length(whset);
for i = 1:n,
    wh = whset(i);
    if wh < 0,
      A = aa(0);
     else
      A = aa(180);
    end,
    F = ff4(A,abs(wh),algor);
    d = -log(max(abs(eig(F))));
    dset(i) = -d;
end
%
subplot(2,1,2)
semilogx(whset,dset,'k-')
grid on
title('tt2')
xlabel('xxx')
ylabel('yyy')
%
print -deps nsds_pr5_1a.eps
echo off
%
return
