%
%  characteristics
%

X0  = -4*pi:pi/16:4*pi;
T0  = zeros(size(X0));
T1  =  ones(size(X0)) * 4*pi;
X1  = X0 + sin(X0).*T1;

clf;  subplot(2,1,1);  hold on
axis([-2*pi 2*pi 0 2])

for k = 1:size(X0,2)
  plot([X0(k) X1(k)],[T0(k) T1(k)],'r')
end

title('\bf characteristics for advection nonlinearity')
xlabel('\bf x-axis');  ylabel('\bf t-axis')

subplot(2,1,2);  hold on
X   = -4*pi:pi/50:4*pi;
axis([-2*pi 2*pi -1.1 1.1])

for T = 0:0.5:1.5 
  plot(X+sin(X)*T,sin(X),'k')
end

title('\bf parametric solution of u(x,t)')
text(-2.5,0.8,'\bf t = 0.0, 0.5, 1.0, 1.5')
xlabel('\bf x-axis');  ylabel('\bf u-axis')

