function yp = onewaywave( t, y )
%
% Method of lines (compact spatial derivative) for the 
% linear wave equation
% Ut = -(1/5+sin^2(x-1))Ux
% u(0,t) = u(2pi,t) = 0
% y =u, dimension (n-1), 
% x0 = 0, x1 = 2pi/n, ..., x[n-1] = 2pi(1 - 1/n), x[n] = 2pi.
%
m = length((y));
x = linspace(0,2*pi,m);
n = m-1;
h = x(2)-x(1);
ux = first( y, h ); 
up = -(1/5+sin(x-1).^2).*ux';
yp = [0, up(2:n), 0]';