% dmposcshow.m animierte Simulation eines
%   ged\"ampften Oszillators mit variabler D\"ampfung
yin = [0 10]';
global EFREQ
global OSCDAMP
EFREQ = 0.5;
plot([0 50], [0  0],'k')
hold on
dmp = [ 0.001, 0.005 , 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.1, ...
       0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.4, 0.5, 0.8, ...
        1.0, 1.2,  1.4, 1.8, 2.2, 2.5, 3, 4];
oldhd = 0;
voldhd = 0;
%
OSCDAMP = 0
[tsol, ysol] = ode45('dmposcpar', 50 , yin);
plot(tsol,ysol(:,2),'b')
%
xhd = 0; 
for k=1:28
  OSCDAMP = dmp(k);
  [tsol, ysol] = ode45('dmposcpar', 50 , yin);
%  nhd = plot(tsol,ysol(:,2),'r');
  if k>2
    delete(zhd)
  end
% Farbwechsel
  if k>1
    delete(olhd)
    xhd = plot(tol,yol(:,2),'g','LineWidth',1.5);
  end
  nhd = plot(tsol,ysol(:,2),'r');
  zhd = xhd;
  tol = tsol; yol = ysol;
  olhd = nhd;
  pause(0.7)
end
