
% Showing solutions to the wave equation with dissipation

k=0.5;
A=1;

x=-20:0.2:20;
t=0:0.1:20;

[X,T]=meshgrid(x,t);
z=k*(X-T);

set(gca,'FontSize',[16]);
figure(1)

Z=A*cos(z).*exp(-k^2*T);

surfl(X,T,Z);
shading interp
colormap(gray)
ylabel('t')
xlabel('x')
zlabel('u(x,t)')
view([15 52])

