%  This function solves homework problem [H4.2]
%  --------------------------------------------
%
echo on
%
%  We start with NyMi3
%
[x1,y1] = stabdom3(1,+1);
plot(x1,y1)
axis equal
grid on;
title('tt1')
xlabel('rellamb')
ylabel('imllamb')
pause
%
print -deps nsds_hw4_2a.eps
%
clf
%
%  Let us find the asymptotic region of NyMi3
%  We sweep through s
%
svec = 0;
s = 0:0.05:2;
echo off
for ss = s,
  shat = damp3(ss,1);
  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')
pause
%
print -deps nsds_hw4_2b.eps
%
clf
%
%  Let us now look at NyMi4
%
[x2,y2] = stabdom3(2,+1);
plot(x2,y2)
axis equal
grid on;
title('tt3')
xlabel('rellamb')
ylabel('imllamb')
pause
%
print -deps nsds_hw4_2c.eps
%
clf
%
%  Let us look at the damping plot
%
svec = 0;
s = 0:0.05:3.1;
echo off
for ss = s,
  shat = damp3(ss,2);
  svec = [ svec ; shat ];
end
echo on
shat = [ svec(2:64) ];
s = -s';
shat = -shat;
subplot(2,1,1)
plot(s,shat,'k-',x,y,'k--')
grid on
title('tt4')
xlabel('xxx')
ylabel('yyy')
%
print -deps nsds_hw4_2d.eps
%
echo off
return
