% plot standing waves for different times, and different wavenumber values

fig1=figure(1); clf
x=[0:0.1:pi];
k_values=[1,2,3];
omega=1;
T=2*pi/omega;
for k=k_values
  subplot(length(k_values),1,k)
  for t=0:T/20:T
    eta=sin(k*x)*cos(omega*t);
    hold on
    plot(x,eta)
    xlim([0,pi])
  end
  xlabel('$x$','interpreter','latex')
  title(sprintf('$\\sin(kx) \\cos(\\omega t)$, k=%d',k),'interpreter','latex');
  box on
end

%% save as pdf:
set(gcf, 'PaperUnits', 'inches'); set(gcf, 'PaperSize', [4 7]);
set(gcf, 'PaperPosition', [0 0 4 7]); % [left, bottom, width, height];
saveas(gcf,sprintf('Output/standing_waves.pdf'));
