% open day demonstrations - 1

% moving waves

clear

k     = 1.0  ; 
omega = 20.0   ; 
c = omega/k 

xhi=100 ;
x = -xhi:0.1:xhi ; 
tstep = 0.01 ; 
nsteps = 100 ;

for i = 1:nsteps 
    
    t = i*tstep ; 
    h = sin ( k*x - omega*t ) ;
    
    subplot(3,1,1)
    plot(x,h) 
    ylim([-1.5,1.5]) ; 
    title('single wave')
    mov(i) = getframe ; 
    
end

movie(mov, 1) 