function [a0,a1,a2]=qbdtest(m,delta)
% [a0,a1,a2]=qbdtest(m,delta)
% The function generates mxm nonnegative matrices
% a0, a1, a2, such that a0+a1+a2 stochastic.
% If delta>0 the QBD is positive recurrent. If delta>0
% is small (say delta=10^(-5) ) the associated quadratic
% matrix equation is ill-conditioned
a0=zeros(m);a1=a0;a2=a0;
for i=1:m
for j=1:m
a1(i,j)=m+6-abs(i-j);
a0(i,j)=1+abs(i-j);
end 
end 
a2=a0;
a2(1,1)=a2(1,1)+delta;
g=a2+a0+a1;
s=g*ones(m,1);
s=1./s;
a0=diag(s)*a0;
a1=diag(s)*a1;




