
% at the end edit properties and use "point cloud" with pointsize 2

% Showing solutions using characteristics

a = 0.101;
Nx=80; Nt=50;
tf=12*3;
L=5;
xi = linspace(-L,L,Nx);
t  = linspace(0,tf,Nt);
T  = kron(ones(1,Nx),t');
XI = kron(xi,ones(Nt,1));
X  = XI+(a*exp(-XI.^2)).*T;
U  = a*exp(-XI.^2);

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

surfl(X,T,U);
shading interp
colormap(gray)
ylabel('t')
xlabel('x')
zlabel('u(x,t)')
view([15 52])
view([15 30]);
axis tight
axis([-L L 0 tf -max(max(U)) max(max(U))])

Nx=80; Nt=2;
xi = linspace(-L,L,Nx);
t  = linspace(0,tf,Nt);
T  = kron(ones(1,Nx),t');
XI = kron(xi,ones(Nt,1));
X  = XI+(a*exp(-XI.^2)).*T;
U  = a*exp(-XI.^2);


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

mh=mesh(X,T,U,0*U);
ylabel('t')
xlabel('x')
zlabel('u(x,t)')
view([15 52])
view([15 30]);
axis tight
axis([-L L 0 tf -max(max(U)) max(max(U))])
set(mh,'FaceAlpha',0)
colormap(jet*0)

