 function [A,x] = makeAconst(N,a);

% function [A,x] = makeAconst(N,a);
% 
% Spectral approximation of the wave operator with constant damping a(x) = c. 
% N: indicates grid size (grid uses N-1 interior points)
% a: the damping parameter
% A: block matrix [0 I; d^2/dx^2 -2a]; dim(A) = 2*N (default N=32)
% x: the interior grid points

 if nargin < 1, N = 32; end
 if nargin < 2, a = pi; end
 [D,x] = cheb01(N);
 L = D^2;
 L = L(2:N,2:N); x = x(2:end-1);
 ax = a*ones(size(x));
 A = [zeros(N-1) eye(N-1); L -2*diag(ax)];
