% GRADAU_LAGUERRE Generalized Gauss-Radau quadrature formula % for generalized Laguerre weight function % % Given the parameter al of the generalized Laguerre weight % function and the fixed node 0 of multiplicity r, this routine % generates the generalized Gauss-Radau quadrature rule % involving r-1 consecutive derivative values at the % point 0 and N interior points. The N interior nodes % and weights are stored in the last N rows of the % (N+r)x2 output array xw, and the fixed node 0 (repeated % r times) and the r weights associated with the r % derivative values in the first r rows of xw. % % The routine is designed to avoid breakdown at very large % values of N, which would occur in the routine gradau for % ab=r_laguerre. % function xw=gradau_laguerre(N,al,r) % % internal nodes and weights % ab1=r_laguerre(N,al+r); xw0=gauss(N,ab1); xw(r+1:N+r,:)=xw0; xw(r+1:N+r,2)=xw(r+1:N+r,2)./(xw(r+1:N+r,1).^r); xw(1:r,1)=zeros(r,1); % % boundary weights % rs=zeros(r-1,1); A=zeros(r); b=zeros(r,1); x=zeros(r,1); for rho=1:r-1 rs(rho)=sum(xw0(:,1).^(-rho)); end p=1; for n=1:N p=(1+(al+r)/n)*p; end for i=r:-1:1 A(i,i)=factorial(i-1)*p^2; if i