%  This function solves homework problem [H4.4]
%  --------------------------------------------
%
echo on
%
%  Stability domain of classical Milne algorithm
%
[x1,y1] = stabdom3(3,+1);
plot(x1,y1)
axis equal
grid on;
title('tt1')
xlabel('rellamb')
ylabel('imllamb')
pause
%
print -deps nsds_hw4_4a.eps
%
clf
%
%  Let us find the asymptotic region
%  We sweep through s
%
svec = 0;
s = 0:0.05:2;
echo off
for ss = s,
  shat = damp3(ss,3);
  svec = [ svec ; shat ];
end
echo on
shat = [ svec(2:42) ];
%
%  Plot the results
%
x = [ -2 ; 0 ];
y = x;
s = -s';
shat = -shat;
subplot(2,1,1)
plot(s,shat,'k-',x,y,'k--')
grid on
title('tt2')
xlabel('xxx')
ylabel('yyy')
%
print -deps nsds_hw4_4b.eps
%
echo off
return
